:root {
  --ink: #12233f;
  --muted: #68758a;
  --line: #dce4f0;
  --paper: #f4f7fc;
  --card: #ffffff;
  --brand: #0057b8;
  --brand-dark: #003f88;
  --brand-soft: #e6f0ff;
  --orange: #d71920;
  --red: #d71920;
  --shadow: 0 18px 45px rgba(18, 35, 63, .13);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.45 Inter, Segoe UI, Arial, sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-story { padding: 9vh 8vw; color: white; background: linear-gradient(145deg, #002b63, #0057b8 64%, #2378d5); position: relative; overflow: hidden; }
.login-story::after { content: ""; position: absolute; width: 460px; height: 460px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; right: -180px; bottom: -180px; box-shadow: 0 0 0 80px rgba(255,255,255,.04), 0 0 0 160px rgba(255,255,255,.03); }
.logo { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 17px; background: white; color: var(--brand); font-weight: 900; letter-spacing: -.08em; }
.app-logo { display: block; object-fit: cover; background: white; overflow: hidden; }
.mobile-login-logo { display: none; width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; object-fit: cover; }
.eyebrow { margin-top: 28px; text-transform: uppercase; letter-spacing: .13em; font-size: 12px; font-weight: 800; opacity: .78; }
h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.045em; max-width: 700px; margin: 16px 0 20px; }
.story-copy { max-width: 600px; font-size: 18px; opacity: .9; }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 28px; padding: 34px; }
.login-card h2 { margin: 0 0 7px; font-size: 28px; }
.login-card p { color: var(--muted); margin: 0 0 25px; }
label { display: block; font-size: 13px; font-weight: 750; margin: 17px 0 7px; }
select, input { width: 100%; padding: 13px 14px; border: 1px solid #cbd6e6; border-radius: 12px; background: white; color: var(--ink); }
.primary { width: 100%; margin-top: 22px; border: 0; border-radius: 13px; padding: 14px; background: var(--brand); color: white; font-weight: 800; }
.primary:hover { background: var(--brand-dark); }
.prototype-note { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 340px 1fr; }
.network-status { position: fixed; z-index: 1000; top: 10px; left: 50%; transform: translateX(-50%); width: min(720px,calc(100vw - 24px)); padding: 10px 14px; border: 1px solid #e2a929; border-radius: 10px; background: #fff7d6; color: #674600; box-shadow: 0 8px 24px #18304f2e; font-size: 12px; font-weight: 700; text-align: center; }
.network-status.hidden { display: none; }
.install-app-card { margin-top: 12px; padding: 10px; border: 1px solid #b8d3ef; border-radius: 12px; background: #edf6ff; color: #15324f; display: grid; gap: 6px; }
.install-app-card strong { font-size: 12px; }
.install-app-card span { color: var(--muted); font-size: 11px; line-height: 1.4; }
.install-app-card .small-btn { justify-self: start; }
.workspace.sidebar-compact .install-app-card,.workspace.sidebar-icons .install-app-card { display: none; }
.workspace.sidebar-compact { grid-template-columns: 230px 1fr; }
.workspace.sidebar-icons { grid-template-columns: 76px 1fr; }
.workspace.sidebar-icons .brand-row > div:last-child,
.workspace.sidebar-icons .company-context,
.workspace.sidebar-icons .context-note,
.workspace.sidebar-icons .user-pill > div:last-child,
.workspace.sidebar-icons .tabs,
.workspace.sidebar-icons .search,
.workspace.sidebar-icons .conversation > div:nth-child(2),
.workspace.sidebar-icons .side-foot > .ghost:not(.sidebar-size) { display: none; }
.workspace.sidebar-icons .conversation { grid-template-columns: 1fr; justify-items: center; padding: 10px 6px; }
.workspace.sidebar-icons .conversation .badge { position: absolute; margin: -7px 0 0 33px; }
.workspace.sidebar-icons .side-head { padding: 14px 8px; }
.workspace.sidebar-compact .context-note { display: none; }
.workspace.sidebar-compact .conversation { padding-left: 10px; padding-right: 10px; }
.sidebar { background: #fff; border-right: 1px solid var(--line); height: 100vh; display: flex; flex-direction: column; }
.side-head { padding: 20px; border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 12px; }
.brand-row .logo { width: 42px; height: 42px; color: white; background: var(--brand); border-radius: 13px; }
.brand-title { font-weight: 850; }
.brand-sub { color: var(--muted); font-size: 12px; }
.company-context { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 16px; }
.company-btn { border: 1px solid var(--line); border-radius: 10px; padding: 8px 7px; background: white; color: var(--muted); font-size: 11px; font-weight: 800; }
.company-btn:disabled { cursor: not-allowed; opacity: .38; filter: grayscale(.35); }
.company-btn:disabled.active { color: var(--muted); border-color: var(--line); background: #edf1f7; }
.company-btn.active { color: white; border-color: var(--brand); background: var(--brand); }
.company-btn[data-company="Esaote"].active { border-color: var(--red); background: var(--red); }
.company-btn[data-company="Both"].active { border-color: #243c64; background: #243c64; }
.company-btn[data-company="General"].active { border-color: #68758a; background: #68758a; }
.context-note { margin-top: 7px; color: var(--muted); font-size: 10px; text-align: center; }
.user-pill { width: 100%; margin-top: 17px; padding: 11px 12px; background: var(--brand-soft); border: 1px solid transparent; border-radius: 12px; display: flex; align-items: center; gap: 10px; text-align: left; color: inherit; }
.user-pill:hover, .user-pill:focus-visible { border-color: var(--brand); background: #e4f0ff; outline: none; }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: white; font-weight: 850; }
.group-avatar { width: 43px; height: 43px; border-radius: 14px; font-size: 13px; letter-spacing: .01em; }
.group-avatar.service { background: #1955a5; }
.group-avatar.sales { background: #3379c9; }
.group-avatar.accounts { background: #273f68; }
.group-avatar.application { background: #4b63a8; }
.group-avatar.dispatch { background: #4b617d; }
.group-avatar.pndt { background: #385888; }
.group-avatar.private { background: #596579; }
.header-group-icon { width: 42px; height: 42px; }
.profile-icon-setting { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 6px 0 12px; }
.profile-icon-setting .avatar { width: 52px; height: 52px; }
.user-pill strong { display: block; font-size: 13px; }
.user-pill span { color: var(--muted); font-size: 11px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 12px 14px 8px; }
.tab { border: 0; border-radius: 9px; padding: 9px 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; }
.tab.active { color: var(--brand-dark); background: var(--brand-soft); }
.search { margin: 4px 16px 10px; }
.conversation-list { overflow: auto; padding: 0 8px 20px; }
.conversation { width: 100%; text-align: left; border: 0; border-radius: 14px; background: transparent; padding: 12px; display: grid; grid-template-columns: 43px 1fr auto; gap: 10px; align-items: center; }
.conversation:hover, .conversation.active { background: #eaf2ff; }
.conversation h3 { margin: 0; font-size: 14px; }
.conversation p { margin: 2px 0 0; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.badge { min-width: 21px; height: 21px; border-radius: 11px; padding: 0 6px; display: grid; place-items: center; color: white; background: var(--brand); font-size: 11px; font-weight: 800; }
.badge.attention { background: var(--brand); animation: attentionPulse 1.65s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(0,87,184,.34); }
.badge.urgent { background: var(--red); animation: urgentPulse 1.2s ease-in-out infinite; }
@keyframes attentionPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0,87,184,.28); } 50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(0,87,184,0); } }
@keyframes urgentPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.side-foot { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.app-menu{position:relative}.app-menu>summary{min-height:38px;padding:9px 11px;border:1px solid #b9c8db;border-radius:9px;background:#fff;color:var(--brand-dark);font-size:12px;font-weight:800;text-align:center;cursor:pointer;list-style:none}.app-menu>summary::-webkit-details-marker{display:none}.app-menu>summary::before{content:'☰ ';font-weight:900}.app-menu[open]>summary{border-color:var(--brand);background:#edf5ff}.app-menu-items{position:absolute;right:0;bottom:calc(100% + 7px);z-index:12;width:min(260px,calc(100vw - 24px));padding:7px;display:grid;gap:6px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 12px 32px rgba(18,35,63,.2)}.app-menu-items .ghost{width:100%;text-align:left}
.ghost { width: 100%; border: 1px solid var(--line); background: white; padding: 7px 8px; border-radius: 9px; color: var(--ink); font-size: 11px; font-weight: 600; }

.content { min-width: 0; height: 100vh; display: flex; flex-direction: column; }
.content-head { min-height: 76px; padding: 14px 24px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mobile-back { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--brand); font-size: 21px; font-weight: 900; }
.title-wrap { min-width: 0; }
.content-head h2 { margin: 0; font-size: 20px; }
.content-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.head-actions { display: flex; gap: 8px; }
.small-btn { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 10px; padding: 9px 12px; font-weight: 700; }
.small-btn:disabled { cursor: not-allowed; opacity: .38; }
.messages { flex: 1; overflow: auto; padding: 28px max(25px, 7vw); background: radial-gradient(circle at 10% 10%, rgba(0,87,184,.08), transparent 28%), #f4f7fc; }
.date-chip { width: max-content; margin: 0 auto 24px; padding: 6px 11px; border-radius: 12px; color: var(--muted); background: #e8edf5; font-size: 11px; font-weight: 750; }
.message { max-width: 680px; margin: 12px 0; }
.message.mine { margin-left: auto; }
.bubble { padding: 12px 14px; border-radius: 5px 17px 17px 17px; background: white; border: 1px solid var(--line); box-shadow: 0 5px 18px rgba(18,35,63,.06); }
.mine .bubble { background: #e3efff; border-radius: 17px 5px 17px 17px; }
.sender { color: var(--brand-dark); font-weight: 850; font-size: 12px; margin-bottom: 3px; }
.meta { color: var(--muted); font-size: 10px; margin-top: 6px; text-align: right; }
.message-actions { margin-top: 5px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.reply-btn { border: 0; background: transparent; color: var(--brand); padding: 2px 4px; font-size: 11px; font-weight: 800; }
.message-more { position: relative; }
.message-more > summary { width: 28px; height: 24px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; list-style: none; font-size: 18px; line-height: 1; }
.message-more > summary::-webkit-details-marker { display: none; }
.message-more[open] > summary { background: #edf2f8; color: var(--brand-dark); }
.message-more-menu { position: absolute; right: 0; bottom: 28px; z-index: 5; min-width: 128px; padding: 5px; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 22px rgba(18,35,63,.14); }
.message-more-menu .reply-btn { width: 100%; padding: 7px 8px; text-align: left; white-space: nowrap; font-weight: 600; }
.secondary-only { margin-top: 2px; }
.reply-quote { display: block; width: 100%; margin-bottom: 8px; padding: 8px 10px; border: 0; border-left: 3px solid var(--brand); border-radius: 7px; background: rgba(230,240,255,.78); color: var(--muted); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.reply-quote strong { display: block; color: var(--brand-dark); }
.reply-quote:hover,.reply-quote:focus { background: #dceaff; outline: 2px solid rgba(35,91,166,.25); }
.message-jump-highlight .bubble { animation: message-jump-highlight 1.8s ease; }
@keyframes message-jump-highlight { 0%,100% { box-shadow: none; } 20%,70% { box-shadow: 0 0 0 4px #ffd45c,0 8px 24px rgba(18,35,63,.16); } }
.view-status { margin: 8px 0 14px auto; width: max-content; max-width: 100%; border-radius: 10px; padding: 7px 10px; color: var(--brand-dark); background: #eaf2ff; border: 1px solid #bfd3ef; font-size: 11px; font-weight: 750; }
.view-status::before { content: "●"; margin-right: 6px; color: var(--brand); }
.file-card { margin-top: 9px; padding: 11px; border-radius: 11px; border: 1px solid #b9cdea; background: rgba(255,255,255,.72); display: flex; justify-content: space-between; gap: 12px; }
.file-card strong { font-size: 12px; }
.task-card { margin: 16px 0; padding: 16px; border-radius: 16px; background: #fff; border-left: 5px solid var(--brand); box-shadow: 0 7px 24px rgba(18,35,63,.08); }
.task-card.sender-urgent { border-left-color: var(--red); background: #fff7f7; }
.task-top { display: flex; justify-content: space-between; gap: 12px; }
.task-card h4 { margin: 0; }
.task-labels { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.task-company, .task-status { padding: 5px 9px; border-radius: 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.task-company { background: #eef2f7; color: #46566b; }
.task-status { background: #e7f0ff; color: var(--brand-dark); text-transform: capitalize; }
.task-actions { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
.task-action { min-height: 36px; padding: 7px 12px; border: 1px solid #a9bdd9; border-radius: 9px; background: white; color: var(--brand-dark); font-weight: 800; cursor: pointer; }
.task-action:hover, .task-action:focus-visible { border-color: var(--brand); background: #edf5ff; outline: none; }
.task-action.primary-action { border-color: var(--brand); background: var(--brand); color: white; }
.task-complete-label { color: #16734a; font-weight: 800; }
.visual-task { border: 1px solid var(--line); border-left: 5px solid var(--brand); }
.visual-task h3 { margin: 0 0 4px; font-size: 1.15rem; color: var(--ink); }
.task-centre { color: var(--muted); font-weight: 600; }
.task-glance { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin: 14px 0 10px; padding: 11px 12px; border-radius: 12px; background: #f3f7ff; }
.task-glance span,.task-glance strong { overflow-wrap: anywhere; }
.task-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.task-chip { border-radius: 999px; padding: 5px 9px; font-size: .78rem; font-weight: 700; background: #eaf1ff; color: #174c9c; }
.task-chip.application { background: #eef3f8; color: #31445c; }
.task-expanded { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; }
.task-expanded > div { display: grid; gap: 3px; }
.task-expanded span { white-space: pre-wrap; color: var(--muted); }
.paste-assignment { padding: 14px; border: 1px dashed #8aa9d8; border-radius: 14px; background: #f7faff; }
.paste-assignment textarea { min-height: 110px; }
.tag { padding: 5px 9px; border-radius: 9px; background: #e7f0ff; color: var(--brand-dark); font-size: 11px; font-weight: 800; }
.visual-task .tag { flex: 0 0 auto; white-space: nowrap; text-transform: capitalize; }
.sender-urgent .tag { background: #ffe9eb; color: #a30f16; }
.task-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.task-execution { display: grid; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-execution-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-execution > label, .task-execution > article { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: start; padding: 8px; border-radius: 8px; background: #f8fafc; }
.task-execution > label input { width: auto; }
.task-execution > label small, .task-execution > article small { grid-column: 2; color: var(--muted); }
.task-execution > article span { grid-column: 1 / -1; overflow-wrap: anywhere; }
.task-filters { display: flex; gap: 10px; align-items: end; padding: 10px 22px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.task-filters label { min-width: 150px; color: var(--muted); font-size: 11px; font-weight: 750; }
.task-filters select { margin-top: 4px; padding: 8px 10px; background: white; }
.report-panel { width: min(1120px, 96vw); }
.report-controls { display: flex; gap: 10px; align-items: end; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.report-controls label { color: var(--muted); font-size: 11px; font-weight: 750; }
.report-controls input { margin-top: 4px; padding: 8px 10px; }
.report-metrics { display: grid; grid-template-columns: repeat(5,minmax(120px,1fr)); gap: 10px; }
.report-metrics article, .report-people article { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.report-metrics strong { display: block; color: var(--brand-dark); font-size: 24px; }
.report-metrics span, .report-people p, .report-records summary span { color: var(--muted); font-size: 12px; }
.report-people { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; margin-top: 14px; }
.report-people h4, .report-people p { margin: 0 0 5px; }
.report-records { display: grid; gap: 8px; margin-top: 14px; }
.report-records details { border: 1px solid var(--line); border-radius: 10px; background: white; }
.report-records summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px; cursor: pointer; }
.report-record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; padding: 0 12px 14px; }
.report-record-grid div { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.report-record-grid span { overflow-wrap: anywhere; }
.presence-text { color: var(--brand); font-size: 11px; font-weight: 700; }
.group-member-names { margin-top: 3px; color: var(--ink); font-size: 11px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.group-member-names strong { color: var(--muted); }
.composer { padding: 12px 22px 14px; background: white; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 9px 10px; align-items: center; }
.compose-context { grid-column: 1 / -1; color: var(--muted); font-size: 11px; font-weight: 750; }
.compose-context strong { color: var(--brand-dark); }
.selected-work-target,.quick-task-context{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border:1px solid #9bb7d3;border-radius:10px;background:#eef6ff;color:var(--brand-dark)}.selected-work-target button{border:0;background:transparent;color:inherit;font-size:18px;cursor:pointer}.quick-task-context{grid-column:1 / -1;align-items:flex-start;flex-direction:column}.quick-task-context span{color:var(--muted);font-size:11px}
.reply-preview { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-left: 4px solid var(--brand); border-radius: 8px; background: #edf4ff; color: var(--muted); font-size: 11px; }
.reply-preview strong { color: var(--brand-dark); }
.reply-preview button { border: 0; background: transparent; color: var(--muted); font-weight: 900; }
.task-fields { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr .8fr 1fr; gap: 8px; padding: 10px; border: 1px solid #cbd6e6; border-radius: 12px; background: #f7faff; }
.task-fields label { color: var(--muted); font-size: 11px; font-weight: 800; }
.task-fields select, .task-fields input { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid #cbd6e6; border-radius: 8px; background: white; color: var(--ink); }
.task-fields textarea { width: 100%; min-height: 82px; margin-top: 4px; padding: 9px; border: 1px solid #cbd6e6; border-radius: 8px; background: white; color: var(--ink); font: inherit; resize: vertical; }
.work-form-panel { width: min(920px, 96vw); }
.work-form-panel .task-fields { grid-template-columns: repeat(3,minmax(0,1fr)); }
.wide-field, .probe-field { grid-column: 1 / -1; }
.probe-field { padding: 10px; border: 1px solid #d6dfec; border-radius: 10px; background: white; color: var(--muted); font-size: 11px; }
.probe-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 9px 0; }
.probe-options label { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 650; }
.probe-options input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.compose-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.tool-btn { border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; background: white; color: var(--ink); font-size: 11px; font-weight: 750; }
.tool-btn:hover:not(:disabled) { border-color: #a8c2e8; background: #eef5ff; }
.tool-btn.active { color: white; border-color: var(--brand); background: var(--brand); }
.tool-btn.urgent.active { border-color: var(--red); background: var(--red); }
.tool-btn:disabled { cursor: not-allowed; opacity: .38; }
.tool-status { display: inline-flex; align-items: center; padding: 6px 9px; border: 1px solid #d9e1eb; border-radius: 9px; background: #f7f9fb; color: var(--muted); font-size: 11px; font-weight: 750; cursor: default; }
.composer textarea { width: 100%; min-height: 46px; max-height: 120px; resize: vertical; margin: 0; padding: 12px 14px; border: 1px solid #cbd6e6; border-radius: 12px; color: var(--ink); font: inherit; }
.ai-assist-btn { color: #68788a; border-color: #d5dde7; background: #f7f9fb; opacity: .72; }
.ai-assist-btn:hover { opacity: .92; }
.ai-assist-btn span { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: #edf1f5; color: #718095; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.ai-review-message { color: #748194; border-color: #d8dfe8; background: #f7f8fa; opacity: .7; }
.ai-review-message span { margin-left: 3px; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.ai-assist-panel { grid-column: 1 / -1; width: min(520px,100%); margin-top: 6px; padding: 12px; border: 1px solid #a9bfdb; border-radius: 14px; background: #f7faff; box-shadow: 0 12px 30px rgba(23,58,101,.12); }
.ai-assist-panel.hidden { display: none; }
.ai-assist-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 10px; }
.ai-assist-head strong,.ai-assist-head small { display: block; }
.ai-assist-head small { margin-top: 2px; color: #63758c; }
.panel-x { border: 0; background: transparent; color: #334d6d; font-size: 22px; cursor: pointer; }
.ai-language { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: #344d6c; font-size: 13px; font-weight: 700; }
.ai-language select { min-width: 135px; padding: 7px 9px; border: 1px solid #b8c8dd; border-radius: 9px; background: white; color: #1e3552; }
.ai-step { width: 100%; display: flex; align-items: center; gap: 10px; margin-top: 7px; padding: 9px 10px; text-align: left; border: 1px solid #d3deec; border-radius: 11px; background: white; color: #203a5a; cursor: pointer; }
.ai-step b { flex: 0 0 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #16457c; color: white; }
.ai-step span,.ai-step strong,.ai-step small { display: block; }
.ai-step small { margin-top: 2px; color: #63758c; line-height: 1.3; }
.ai-future-note { margin: 10px 2px 0; color: #6b7788; font-size: 12px; }
.send { border: 0; border-radius: 12px; background: var(--brand); color: white; padding: 12px 17px; font-weight: 800; }
.local-message { margin-left: auto; }
.local-message.urgent-post .bubble { border: 2px solid var(--red); background: #fff6f6; }
.local-message .urgent-label { display: inline-block; margin-bottom: 5px; color: var(--red); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.observer-banner { margin: 0; padding: 10px 22px; color: var(--brand-dark); background: #eaf2ff; border-top: 1px solid #bfd3ef; font-size: 12px; font-weight: 700; }
.empty { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 30px; }
.panel-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(18,35,63,.48); }
.panel-backdrop.hidden { display: none; }
.settings-panel { width: min(680px, 100%); max-height: 88vh; overflow: auto; border-radius: 22px; background: white; box-shadow: var(--shadow); }
.panel-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2 { margin: 0; font-size: 20px; }
.close-panel { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-weight: 900; }
.settings-body { padding: 20px; }
.settings-section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.settings-section:first-child { padding-top: 0; }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin: 0 0 10px; font-size: 14px; }
.setting-row { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; }
.setting-row span { color: var(--muted); font-size: 12px; }
.setting-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.service-time-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-top: 6px; }
.map-helper { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.map-helper small { color: var(--muted); }
.map-link { display: inline-flex; align-items: center; text-decoration: none; }
.map-link.disabled { opacity: .42; pointer-events: none; }
.map-action { display: inline-flex; align-items: center; text-decoration: none; }
.date-confirmation { display: flex !important; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #f7faff; }
.date-confirmation input { width: 18px; height: 18px; accent-color: var(--brand); }
.task-entry-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.field-missing { padding: 9px; border: 2px solid var(--red) !important; border-radius: 11px; background: #fff5f5; }
.service-validation { padding: 13px 15px; border: 2px solid var(--red); border-radius: 13px; background: #fff5f5; color: #712121; }
.service-validation.hidden { display: none; }
.service-validation strong { display: block; margin-bottom: 6px; }
.service-validation ul { margin: 0; padding-left: 20px; }
.service-validation li + li { margin-top: 4px; }
.validation-link { width: 100%; padding: 5px 0; border: 0; background: transparent; color: #712121; text-align: left; font: inherit; cursor: pointer; }
.validation-link:hover,.validation-link:focus { text-decoration: underline; }
.validation-link span { float: right; color: var(--brand); font-size: 11px; font-weight: 800; }
.file-tabs { display: flex; gap: 7px; padding: 12px 20px; border-bottom: 1px solid var(--line); overflow: auto; }
.file-tab { border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; background: white; color: var(--muted); font-size: 12px; font-weight: 800; }
.file-tab.active { color: white; border-color: var(--brand); background: var(--brand); }
.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; padding: 20px; }
.library-file { min-height: 110px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #f8faff; }
.library-file .file-icon { font-size: 25px; }
.library-file h4 { margin: 10px 0 3px; font-size: 13px; }
.library-file p { margin: 0; color: var(--muted); font-size: 11px; }
.message-photo-link { display: block; margin: 7px 0; }
.message-photo { display: block; width: min(100%, 420px); max-height: 420px; object-fit: contain; border-radius: 12px; background: #f4f6fa; }
.message-file-link { display: inline-block; margin: 7px 0; color: var(--brand); font-weight: 700; }
.recalled-message { color: var(--muted); font-style: italic; }
.timing-action { border-color: #7c9bc4; background: #eef5ff; color: var(--brand-dark); font-weight: 800; }
.inline-message-editor{display:grid;gap:7px;margin:7px 0;padding:10px;border:1px solid #9bb7d3;border-radius:10px;background:#f7faff}.inline-message-editor label{font-size:11px;font-weight:800;color:var(--brand-dark)}.inline-message-editor textarea{width:100%;min-height:84px;padding:9px;border:1px solid #b8c8dc;border-radius:8px;font:inherit;resize:vertical}.inline-message-editor>div{display:flex;gap:7px;flex-wrap:wrap}.inline-message-editor small{color:var(--muted)}
.group-linked-task{margin:6px 34px 18px;border-left-color:#2d7a58;background:#f7fcf9}.task-link-label{margin-bottom:7px;color:#2d6b50;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.linked-task-action{color:#1f684a;border-color:#93c6ad}.independent-group-tasks{margin:8px 0 18px;padding:10px 14px;border:1px solid #d7e1ed;border-radius:14px;background:#f8fafc}.navigation-highlight{animation:navigationHighlight 2.2s ease-out}@keyframes navigationHighlight{0%,35%{box-shadow:0 0 0 4px rgba(30,120,85,.28)}100%{box-shadow:0 0 0 0 rgba(30,120,85,0)}}
.translation-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 3px 0 6px; color: var(--brand); font-size: 11px; font-weight: 800; }
.translated-message,.original-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.translation-switch { border: 0; padding: 2px 0; background: transparent; color: var(--brand); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.translation-picker { position: relative; }
.translation-picker > summary { display: block; list-style: none; cursor: pointer; }
.translation-picker > summary::-webkit-details-marker { display: none; }
.translation-menu { position: absolute; left: 0; bottom: 28px; z-index: 6; min-width: 128px; padding: 5px; display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 22px rgba(18,35,63,.14); }
.translation-menu button { border: 0; border-radius: 7px; padding: 7px 9px; background: transparent; color: var(--ink); text-align: left; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.translation-menu button:hover,.translation-menu button:focus { background: #edf4ff; color: var(--brand); }
.translation-menu button:disabled { opacity: .65; cursor: wait; }
.translation-error { margin-top: 6px; padding: 6px 8px; border-left: 3px solid #c47a00; border-radius: 5px; background: #fff8e8; color: #704500; font-size: 11px; }
.receipt-details { margin-top: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: #f8faff; color: var(--ink); font-size: 11px; }
.receipt-details > strong { display: block; margin-bottom: 5px; }
.receipt-details > div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-top: 1px solid #e8edf5; }
.receipt-details small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.35; }
.receipt-state { font-weight: 800; white-space: nowrap; }
.receipt-state.acknowledged { color: #16734a; }
.receipt-state.viewed { color: var(--brand); }
.receipt-state.not_viewed { color: var(--muted); }
.terms-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: linear-gradient(145deg,#eef4ff,#f8fbff 52%,#edf7f3); }
.terms-card { width: min(760px,100%); max-height: calc(100vh - 56px); overflow: auto; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 18px 50px rgba(18,35,63,.14); }
.terms-card h1 { margin: 14px 0 4px; font-size: clamp(24px,4vw,34px); }
.terms-version { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.terms-summary { font-size: 16px; line-height: 1.5; }
.terms-notice { margin: 18px 0; padding: 14px 16px; border-left: 5px solid #c47a00; border-radius: 10px; background: #fff8e8; color: #563700; }
.terms-notice p { margin: 5px 0 0; line-height: 1.45; }
.terms-card ol { padding-left: 24px; line-height: 1.5; }
.terms-card li + li { margin-top: 8px; }
.terms-accept { display: flex; gap: 10px; align-items: flex-start; margin: 20px 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #f8faff; font-weight: 700; }
.terms-accept input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--brand); }
.terms-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.terms-admin-metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.terms-admin-metrics article { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8faff; }
.terms-admin-metrics strong { display: block; color: var(--brand); font-size: 24px; }
.terms-admin-metrics span,.terms-people article div span,.terms-history span { display: block; color: var(--muted); font-size: 11px; }
.terms-admin-heading,.terms-people article { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.terms-admin-heading h3,.terms-admin-heading p { margin: 0 0 4px; }
.terms-people,.terms-history { display: grid; gap: 7px; }
.terms-people article,.terms-history article { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.terms-state { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.terms-state.accepted { background: #e9f8f0; color: #16734a; }
.terms-state.pending { background: #fff1dc; color: #8a5200; }
.device-list { display: grid; gap: 8px; }
.device-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.device-card > div:first-child span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.device-card > div:last-child { display: flex; align-items: center; gap: 7px; }
.device-card.revoked { opacity: .65; background: #f5f6f8; }
.member-management-list{display:grid;gap:8px;margin-bottom:16px}.member-management-list article{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}.member-identity{display:grid;gap:3px}.member-identity span,.member-self{color:var(--muted);font-size:11px;text-transform:capitalize}.member-work-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}
.file-source-help { color: var(--muted); font-size: 10px; line-height: 1.25; }

@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { padding: 20px; }
  .mobile-login-logo { display: block; }
  .workspace { min-height: 100dvh; grid-template-columns: 1fr; }
  .workspace.sidebar-compact,.workspace.sidebar-icons { grid-template-columns: 1fr; }
  .workspace.sidebar-icons .brand-row > div:last-child,
  .workspace.sidebar-icons .context-note,
  .workspace.sidebar-icons .user-pill > div:last-child,
  .workspace.sidebar-icons .conversation > div:nth-child(2) { display: block; }
  .workspace.sidebar-icons .tabs { display: grid; }
  .workspace.sidebar-icons .search { display: block; }
  .workspace.sidebar-icons .install-app-card { display: grid; }
  .workspace.sidebar-compact .context-note { display: block; }
  .workspace.sidebar-icons .conversation { grid-template-columns: 45px 1fr auto; justify-items: stretch; padding: 11px 10px; }
  .workspace.sidebar-icons .conversation .badge { position: static; margin: 0; }
  .workspace.sidebar-icons .side-head { padding: 14px 16px 12px; }
  .sidebar { height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
  .content { display: none; }
  .workspace.chat-open .sidebar { display: none; }
  .workspace.chat-open .content { display: flex; height: 100dvh; }
  .side-head { padding: 14px 16px 12px; }
  .brand-row .logo { width: 39px; height: 39px; }
  .company-context { margin-top: 12px; }
  .tabs { position: sticky; top: 0; z-index: 2; background: white; padding-top: 10px; }
  .tab { min-height: 42px; font-size: 13px; }
  .search { margin: 5px 12px 9px; }
  .search input { min-height: 44px; }
  .conversation-list { padding: 0 7px 155px; }
  .conversation { min-height: 68px; padding: 11px 10px; grid-template-columns: 45px 1fr auto; }
  .conversation p { max-width: 58vw; }
  .side-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; grid-template-columns: 1fr; padding: 7px 9px calc(7px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); }
  .side-foot .sidebar-size { display: none; }
  .ghost { min-height: 36px; }
  .content-head { min-height: 60px; padding: 7px 9px; gap: 7px; }
  .mobile-back { display: block; flex: 0 0 auto; }
  .header-group-icon { display: none; }
  .content-head h2 { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
  .group-member-names { max-width: 50vw; }
  .task-filters { padding: 8px 12px; overflow-x: auto; align-items: end; }
  .task-filters label { min-width: 135px; }
  .report-controls { overflow-x: auto; }
  .report-controls label { min-width: 135px; }
  .report-metrics { grid-template-columns: repeat(2,minmax(120px,1fr)); }
  .terms-admin-metrics { grid-template-columns: 1fr; }
  .terms-people article { align-items: flex-start; }
  .report-records summary { display: grid; }
  .report-record-grid { grid-template-columns: 1fr; }
  .head-actions { margin-left: auto; overflow-x: auto; max-width: 58vw; gap: 4px; padding-bottom: 2px; }
  .head-actions .small-btn { flex: 0 0 auto; min-height: 40px; padding: 6px 8px; white-space: nowrap; font-size: 11px; font-weight: 650; }
  .messages { padding: 10px 9px; scroll-behavior: smooth; }
  .date-chip { margin-bottom: 10px; }
  .message { max-width: 92%; margin: 7px 0; }
  .bubble { padding: 9px 11px; border-radius: 4px 13px 13px 13px; box-shadow: 0 2px 8px rgba(18,35,63,.05); }
  .mine .bubble { border-radius: 13px 4px 13px 13px; }
  .sender { font-weight: 700; }
  .message-actions { gap: 2px; overflow-x: auto; }
  .reply-btn { font-weight: 600; font-size: 10px; white-space: nowrap; }
  .task-card { margin: 8px 0; padding: 11px; border-radius: 12px; box-shadow: 0 3px 10px rgba(18,35,63,.06); }
  .task-top { align-items: flex-start; }
  .task-labels { justify-content: flex-start; }
  .task-actions { justify-content: stretch; }
  .task-action { flex: 1 1 auto; min-height: 42px; }
  .visual-task h3 { font-size: 1rem; }
  .task-entry-meta { font-size: 10px; }
  .task-glance { grid-template-columns: 1fr; gap: 5px; }
  .task-expanded { grid-template-columns: 1fr; }
  .composer { position: sticky; bottom: 0; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: #fff; gap: 6px; }
  .compose-context { font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .compose-tools { flex-wrap: wrap; overflow: visible; padding-bottom: 0; gap: 4px; }
  .file-source-help { flex: 1 1 150px; }
  .tool-btn { min-height: 32px; padding: 5px 7px; white-space: nowrap; font-size: 10px; font-weight: 600; }
  .compose-tools .tool-btn:nth-of-type(n+4) { display: none; }
  .composer textarea { min-height: 48px; font-size: 16px; }
  .task-fields { grid-template-columns: 1fr; }
  .work-form-panel .task-fields { grid-template-columns: 1fr; }
  .probe-options { grid-template-columns: 1fr 1fr; }
  .send { min-height: 48px; padding-inline: 16px; }
  .observer-banner { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .file-grid { grid-template-columns: 1fr; }
  .settings-panel { max-height: 94dvh; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .badge.attention, .badge.urgent { animation: none; }
}
.upload-notice{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:10px 18px;padding:12px 14px;border:1px solid #9bb7d3;border-radius:10px;background:#eef6ff;color:#17324d}.upload-notice div{display:flex;flex-direction:column;gap:3px}.upload-notice span{font-size:.88rem}.upload-notice.clean{border-color:#70ad83;background:#edf8f0;color:#174d29}.upload-notice.error{border-color:#d88b8b;background:#fff1f1;color:#762222}.upload-notice.scanning{border-color:#d5b45c;background:#fff8df;color:#5d470d}.upload-notice button{border:0;background:transparent;color:inherit;font-size:1.35rem;cursor:pointer}
