/* AGL Assistant
   Brand: Thunderbird #b11116, Black #231f20, White. Typeface: Poppins.
   Red is reserved for primary actions, focus and active states. Everything else is neutral. */

:root {
  --brand: #b11116;
  --brand-hover: #9a0e13;
  --brand-tint: #fcf1f1;
  --ink: #231f20;
  --text: #2b2728;
  --text-2: #6b6566;
  --text-3: #9a9495;
  --bg: #ffffff;
  --bg-subtle: #f7f6f5;
  --bg-muted: #efedeb;
  --border: #e6e3e1;
  --border-strong: #d3cfcc;
  --success: #1b7a43;
  --success-tint: #edf7f1;
  --warning: #9a6200;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(35, 31, 32, .06);
  --shadow: 0 1px 2px rgba(35, 31, 32, .05), 0 4px 16px rgba(35, 31, 32, .06);
  --shadow-lg: 0 8px 32px rgba(35, 31, 32, .14);
  --sans: "Poppins", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --read: "Poppins", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --sidebar-w: 264px;
  --content-w: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
small { font-size: 12px; }
.text-2 { color: var(--text-2); }
.grow { flex: 1; }
kbd { font-family: var(--sans); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; line-height: 18px; background: var(--bg); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* icons */
svg[data-i], .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r); border: 1px solid transparent; background: none; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:disabled { background: var(--border-strong); cursor: default; }
.btn-secondary { background: var(--bg); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-muted); color: var(--ink); }
.btn-danger { color: var(--brand); }
.btn-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r); border: 0; background: none; color: var(--text-2); cursor: pointer; flex: none; }
.btn-icon:hover { background: var(--bg-muted); color: var(--ink); }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field small { color: var(--text-3); }
input:not([type=checkbox]):not([type=file]), select, textarea.input {
  height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); font-size: 14px; outline: none; transition: border-color .12s, box-shadow .12s;
}
select { appearance: none; padding-right: 32px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6566' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; cursor: pointer; }
input:focus, select:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(35, 31, 32, .08); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
.form-error { min-height: 20px; color: var(--brand); font-size: 13px; }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- sign in ---------- */
.auth { display: grid; grid-template-columns: minmax(380px, 44%) 1fr; min-height: 100%; }
.auth-brand { position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; }
.auth-brand-logo { width: 112px; position: relative; z-index: 1; }
.auth-brand-mark { position: absolute; right: -14%; bottom: 8%; width: 78%; aspect-ratio: 1; background: url("/static/mark-white.png") no-repeat center / contain; opacity: .07; }
.auth-brand-copy { margin-top: auto; position: relative; z-index: 1; max-width: 400px; }
.auth-brand-copy .eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #e8a9ab; margin-bottom: 16px; }
.auth-brand-copy h2 { color: #fff; font-size: 34px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; margin-bottom: 16px; }
.auth-brand-copy p { color: rgba(255, 255, 255, .66); font-size: 15px; line-height: 1.6; }
.auth-brand-foot { position: relative; z-index: 1; margin-top: 48px; font-size: 12px; color: rgba(255, 255, 255, .4); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.auth-form-logo { display: none; width: 120px; margin-bottom: 8px; }
.auth-form h1 { font-size: 24px; font-weight: 600; }
.auth-form > p { margin-top: -10px; margin-bottom: 8px; }
.auth-form .form-error { min-height: 0; }
.auth-form .form-error:empty { display: none; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100%; }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--bg-subtle); border-right: 1px solid var(--border); padding: 14px 12px 12px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 18px; }
.sidebar-logo { height: 30px; }
.new-chat { justify-content: flex-start; padding: 0 10px; }
.new-chat span { flex: 1; text-align: left; }
.nav { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r); color: var(--text-2); text-decoration: none; font-weight: 500; }
.nav-item:hover { background: var(--bg-muted); color: var(--ink); }
.nav-item.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.recents { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); padding-top: 12px; }
.recents-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 0 10px; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.recents-search { display: flex; align-items: center; gap: 6px; border-radius: var(--r-sm); padding: 0 6px; color: var(--text-3); width: 110px; }
.recents-search:focus-within { background: var(--bg); box-shadow: inset 0 0 0 1px var(--border); }
.recents-search svg { width: 14px; height: 14px; }
.recents-search input { border: 0 !important; box-shadow: none !important; height: 28px !important; padding: 0 !important; background: transparent !important; font-size: 12px !important; }
.conv-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.conv-group { font-size: 11px; font-weight: 500; color: var(--text-3); padding: 12px 10px 4px; }
.conv { position: relative; display: flex; align-items: center; height: 34px; padding: 0 6px 0 10px; border-radius: var(--r); cursor: pointer; color: var(--text); font-size: 13.5px; }
.conv:hover { background: var(--bg-muted); }
.conv.active { background: var(--bg); box-shadow: var(--shadow-sm); color: var(--ink); font-weight: 500; }
.conv.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--brand); }
.conv-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv .btn-icon { width: 26px; height: 26px; opacity: 0; }
.conv .btn-icon svg { width: 15px; height: 15px; }
.conv:hover .btn-icon, .conv.active .btn-icon { opacity: 1; }
.conv-empty { padding: 8px 10px; color: var(--text-3); font-size: 13px; }
.sidebar-foot { position: relative; border-top: 1px solid var(--border); padding-top: 10px; }
.account { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; background: none; border-radius: var(--r); cursor: pointer; text-align: left; }
.account:hover { background: var(--bg-muted); }
.account svg { color: var(--text-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.account-text b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-text small { color: var(--text-3); }

/* menus */
.dropdown { position: relative; }
.menu { position: absolute; z-index: 40; min-width: 200px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--r-sm); text-decoration: none; text-align: left; cursor: pointer; font-size: 13.5px; color: var(--text); }
.menu-item:hover, .menu-item.focus { background: var(--bg-subtle); }
.menu-item .menu-text { flex: 1; display: flex; flex-direction: column; }
.menu-item .menu-text small { color: var(--text-3); }
.menu-item .check { width: 16px; color: var(--brand); visibility: hidden; }
.menu-item[aria-selected=true] .check { visibility: visible; }
.account-menu { left: 0; right: 0; bottom: calc(100% + 6px); }
.model-menu { right: 0; top: calc(100% + 6px); width: 300px; }
.effort-menu { left: 0; bottom: calc(100% + 8px); width: 260px; }

.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.topbar { flex: none; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px 0 24px; border-bottom: 1px solid transparent; }
.view-page .topbar, .scrolled .topbar { border-bottom-color: var(--border); }
.topbar-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-btn { font-weight: 500; color: var(--ink); }
.model-btn svg { color: var(--text-3); }

/* ---------- chat ---------- */
.scroller { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 24px 12vh; }
.empty-mark { width: 40px; margin-bottom: 20px; }
.empty h2 { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 28px; text-align: center; }
.empty .composer-slot { width: 100%; max-width: var(--content-w); }
.starters { width: 100%; max-width: var(--content-w); display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.starter { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); cursor: pointer; transition: border-color .12s, background-color .12s; }
.starter:hover { border-color: var(--border-strong); background: var(--bg-subtle); }
.starter svg { margin-top: 2px; color: var(--text-2); }
.starter span { display: flex; flex-direction: column; gap: 2px; }
.starter b { font-weight: 500; font-size: 13.5px; color: var(--ink); }
.starter small { color: var(--text-3); }
.notice-inline { display: flex; gap: 8px; align-items: center; margin-top: 24px; padding: 10px 14px; border-radius: var(--r); background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-2); font-size: 13px; }
.notice-inline svg { color: var(--warning); }
.notice-inline a { color: var(--ink); font-weight: 500; }

.thread { max-width: var(--content-w); margin: 0 auto; padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 28px; }
.thread:empty { display: none; }
.msg-user { align-self: flex-end; max-width: 80%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.msg-user .bubble { background: var(--bg-muted); border-radius: var(--r-xl); padding: 10px 16px; font-family: var(--read); font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-user .bubble[dir=rtl] { text-align: right; }
.msg-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.msg-ai { display: grid; grid-template-columns: 28px 1fr; gap: 16px; }
.msg-ai-mark { width: 28px; height: 28px; border-radius: var(--r); border: 1px solid var(--border); display: grid; place-items: center; background: var(--bg); }
.msg-ai-mark img { width: 17px; }
.msg-ai-body { min-width: 0; padding-top: 2px; }
.msg-actions { display: flex; gap: 2px; margin-top: 6px; margin-left: -6px; }
.msg-actions .btn-icon { width: 28px; height: 28px; color: var(--text-3); }
.msg-actions .btn-icon svg { width: 15px; height: 15px; }

/* file chips */
.file-chip { display: inline-flex; align-items: center; gap: 10px; max-width: 260px; padding: 6px 10px 6px 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); text-decoration: none; font-size: 13px; }
.file-chip .ext { flex: none; width: 34px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 10px; font-weight: 600; letter-spacing: .02em; color: #fff; background: var(--text-2); }
.file-chip .ext.pdf { background: var(--brand); }
.file-chip .ext.doc { background: #2b5797; }
.file-chip .ext.xls { background: #1d6f42; }
.file-chip .ext.ppt { background: #c4501d; }
.file-chip .ext.img { background: #6b4fa0; }
.file-chip .meta { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.file-chip .meta b { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-chip .meta small { color: var(--text-3); }
.file-chip .btn-icon { width: 22px; height: 22px; margin-left: 2px; }
.file-chip .btn-icon svg { width: 13px; height: 13px; }
.file-chip.loading .ext { background: var(--border-strong); }

/* activity: tools + thinking */
.activity { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-height: 26px; }
.step svg { width: 15px; height: 15px; color: var(--text-3); }
.step .state { width: 14px; height: 14px; display: grid; place-items: center; }
.step.run .state::after { content: ""; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--border-strong); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.step.done .state::after { content: ""; width: 9px; height: 5px; border-left: 1.5px solid var(--success); border-bottom: 1.5px solid var(--success); transform: rotate(-45deg) translate(1px, -1px); }
.step.error .state::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }
details.thought { font-size: 13px; color: var(--text-2); }
details.thought summary { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; cursor: pointer; list-style: none; user-select: none; }
details.thought summary::-webkit-details-marker { display: none; }
details.thought summary:hover { color: var(--ink); }
details.thought summary svg { width: 14px; height: 14px; transition: transform .15s; }
details.thought[open] summary svg { transform: rotate(90deg); }
details.thought .thought-body { margin: 4px 0 8px 6px; padding: 2px 0 2px 14px; border-left: 2px solid var(--border); white-space: pre-wrap; line-height: 1.65; color: var(--text-2); max-height: 320px; overflow-y: auto; }
.pending-dots { display: inline-flex; gap: 4px; padding: 10px 0; }
.pending-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite both; }
.pending-dots i:nth-child(2) { animation-delay: .15s; } .pending-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.inline-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin: 8px 0; }
.inline-error { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border: 1px solid #efc9ca; background: var(--brand-tint); border-radius: var(--r); color: #7c0b0f; font-size: 13.5px; margin: 8px 0; }
.inline-error svg { margin-top: 2px; }

/* markdown */
.md { font-family: var(--read); font-size: 15px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 14px; }
.md [dir=rtl] { text-align: right; }
.md h1, .md h2, .md h3, .md h4 { color: var(--ink); line-height: 1.35; margin: 24px 0 10px; }
.md h2 { font-size: 18px; } .md h3 { font-size: 16px; } .md h4 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 14px; padding-inline-start: 22px; }
.md li { margin: 4px 0; padding-inline-start: 2px; }
.md li::marker { color: var(--text-3); }
.md strong { font-weight: 600; color: var(--ink); }
.md a { color: var(--brand); text-underline-offset: 2px; }
.md code { font-family: var(--mono); font-size: .86em; background: var(--bg-muted); border-radius: 4px; padding: .1em .35em; }
.md pre { margin: 0 0 14px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; overflow-x: auto; direction: ltr; text-align: left; line-height: 1.6; }
.md pre code { background: none; padding: 0; font-size: 13px; }
.md blockquote { margin: 0 0 14px; padding: 0 0 0 14px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.md table { width: 100%; border-collapse: collapse; margin: 4px 0 16px; font-size: 13.5px; line-height: 1.5; display: block; overflow-x: auto; }
.md th, .md td { text-align: start; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.md th { font-weight: 600; color: var(--ink); border-bottom-color: var(--border-strong); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }

/* approval card */
.approval { border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin: 6px 0 4px; }
.approval-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.approval-head svg { color: var(--brand); }
.approval-head b { font-weight: 600; color: var(--ink); }
.approval-head small { color: var(--text-3); margin-left: auto; }
.approval dl { margin: 0; padding: 12px 16px 0; display: grid; grid-template-columns: 72px 1fr; gap: 8px 12px; font-size: 13.5px; }
.approval dt { color: var(--text-3); }
.approval dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.approval .email-body { margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r); background: var(--bg-subtle); white-space: pre-wrap; font-size: 14px; line-height: 1.65; max-height: 280px; overflow-y: auto; }
.approval-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; }
.approval-foot .text-2 { margin-right: auto; align-self: center; font-size: 13px; }

/* composer */
.composer-dock { flex: none; padding: 0 24px 14px; }
.composer-dock .composer-slot { max-width: var(--content-w); margin: 0 auto; }
.composer-dock:has(.composer-slot:empty) { display: none; }
.disclaimer { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 8px; }
.composer { position: relative; border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--bg); box-shadow: var(--shadow); padding: 12px 12px 8px; transition: border-color .12s, box-shadow .12s; }
.composer:focus-within { border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(35,31,32,.05), 0 6px 24px rgba(35,31,32,.09); }
.composer textarea { display: block; width: 100%; min-height: 26px; max-height: 260px; border: 0; outline: none; resize: none; padding: 2px 6px; font-family: var(--read); font-size: 15px; line-height: 1.6; background: transparent; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachments:not(:empty) { margin-bottom: 10px; }
.composer-bar { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
#effort-btn { color: var(--text-2); }
.send { width: 34px; height: 34px; border-radius: var(--r); border: 0; display: grid; place-items: center; background: var(--brand); color: #fff; cursor: pointer; transition: background-color .12s; }
.send:hover { background: var(--brand-hover); }
.send:disabled { background: var(--bg-muted); color: var(--text-3); cursor: default; }
.send.is-stop { background: var(--ink); }
.send svg { width: 17px; height: 17px; stroke-width: 2; }
.drop-hint { display: none; position: absolute; inset: 0; border-radius: inherit; border: 1.5px dashed var(--ink); background: rgba(255,255,255,.92); place-items: center; font-weight: 500; }
.composer.dragging .drop-hint { display: grid; }

/* ---------- pages ---------- */
.view-page .page { flex: 1; overflow-y: auto; width: 100%; max-width: 920px; margin: 0 auto; padding: 32px 32px 96px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h2 { font-size: 22px; margin-bottom: 4px; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-2); margin-bottom: 16px; transition: .12s; }
.dropzone.dragging { border-color: var(--ink); background: var(--bg-subtle); color: var(--ink); }
.progress { position: relative; height: 32px; border-radius: var(--r); background: var(--bg-subtle); overflow: hidden; margin-bottom: 16px; display: flex; align-items: center; padding: 0 12px; font-size: 13px; color: var(--text-2); }
.progress-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bg-muted); transition: width .2s; }
.progress span { position: relative; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg-subtle); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { width: 48px; text-align: right; }
.table .muted { color: var(--text-2); }
.table .empty-row td { text-align: center; color: var(--text-3); padding: 32px 16px; }
.table .file-cell { display: flex; align-items: center; gap: 12px; }
.table .file-cell a { color: var(--ink); text-decoration: none; font-weight: 500; }
.table .file-cell a:hover { text-decoration: underline; }
.table .file-cell .ext { width: 32px; height: 28px; font-size: 9.5px; }
.table-flush { border-top: 1px solid var(--border); }
.table-flush th { background: none; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { position: relative; padding: 0 0 12px; text-decoration: none; color: var(--text-2); font-weight: 500; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); margin-bottom: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px; }
.card-head h3 { font-size: 15px; margin-bottom: 2px; }
.card-head p { font-size: 13px; }
.row { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--border); }
.row-label { display: flex; flex-direction: column; gap: 2px; }
.row-label b { font-weight: 500; color: var(--ink); }
.row-label small { color: var(--text-3); line-height: 1.45; }
.row-control.split { display: flex; gap: 8px; }
.row-control .port { width: 96px; flex: none; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.test-result { font-size: 13px; color: var(--text-2); }
.test-result.ok { color: var(--success); }
.test-result.bad { color: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--bg-muted); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.badge.ok { background: var(--success-tint); color: var(--success); }
.badge.ok::before { background: var(--success); }
.badge.plain::before { display: none; }
.save-bar { position: sticky; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-radius: var(--r-lg); background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); }
.save-bar span { flex: 1; font-size: 13.5px; }
.save-bar .btn-ghost { color: rgba(255,255,255,.75); }
.save-bar .btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* dialog */
.dialog { border: 0; border-radius: var(--r-xl); padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(35, 31, 32, .4); }
.dialog form { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.dialog h3 { font-size: 17px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r); font-size: 13.5px; box-shadow: var(--shadow-lg); transition: .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* RTL content inside an English UI */
[dir=rtl] { font-family: "IBM Plex Sans Arabic", var(--sans); }

/* ---------- responsive ---------- */
.only-mobile { display: none; }
.scrim { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app.side-open .sidebar { transform: none; }
  .app.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(35, 31, 32, .35); }
  .only-mobile { display: inline-grid; }
  .topbar { padding: 0 8px; }
  .thread { padding: 16px 16px 24px; }
  .composer-dock { padding: 0 12px 10px; }
  .starters { grid-template-columns: 1fr; }
  .empty h2 { font-size: 23px; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .view-page .page { padding: 20px 16px 96px; }
  .page-head { flex-direction: column; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-logo { display: block; }
  .new-chat kbd { display: none; }
}

/* ---------- assistant team ---------- */
.a-avatar { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; background: var(--ink); }
.a-avatar.lg { width: 48px; height: 48px; border-radius: 13px; font-size: 17px; }
.a-avatar.md { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.section-label { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 0 10px; margin: 16px 0 4px; }
.team-list { display: flex; flex-direction: column; gap: 1px; }
.team-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: var(--r); background: none; cursor: pointer; text-align: left; }
.team-item:hover { background: var(--bg-muted); }
.team-item.active { background: var(--bg); box-shadow: var(--shadow-sm); }
.team-item span.t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.team-item b { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.team-item small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-item .plus { opacity: 0; color: var(--text-3); width: 15px; height: 15px; }
.team-item:hover .plus { opacity: 1; }
.team-block + .nav { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 10px; }
.conv .a-dot { width: 6px; height: 6px; border-radius: 2px; flex: none; margin-right: 10px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.topbar-sep { color: var(--border-strong); }
.intro { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 28px; max-width: 520px; }
.intro .a-avatar { margin-bottom: 16px; }
.intro h2 { font-size: 26px; font-weight: 500; letter-spacing: -.02em; margin: 0; }
.intro .role { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.intro p { color: var(--text-2); margin-top: 10px; font-size: 14.5px; line-height: 1.55; }
.starter b { font-weight: 400; }
.starter svg { color: var(--text-3); }
.pane-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.pane-head h3 { font-size: 15px; margin-bottom: 2px; }
.pane-head p { font-size: 13px; }
.assistant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.a-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.a-card-head { display: flex; align-items: center; gap: 12px; }
.a-card-head div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.a-card-head b { font-weight: 600; color: var(--ink); }
.a-card-head small { color: var(--text-3); }
.a-card p { font-size: 13px; color: var(--text-2); line-height: 1.5; flex: 1; }
.a-card .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.a-card .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-muted); color: var(--text-2); }
.a-card-foot { display: flex; gap: 8px; border-top: 1px solid var(--border); margin: 0 -18px -18px; padding: 10px 12px; }
.a-card-foot .btn { flex: 1; }
.dialog-lg { width: min(640px, calc(100vw - 32px)); }
.dialog-lg form { padding: 0; gap: 0; max-height: calc(100vh - 48px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.dialog-body { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; overflow-y: auto; }
.dialog-lg .dialog-foot { padding: 14px 24px; border-top: 1px solid var(--border); margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea.textarea { height: auto !important; padding: 10px 12px !important; line-height: 1.55; resize: vertical; font-family: var(--sans); border: 1px solid var(--border); border-radius: var(--r); outline: none; width: 100%; }
textarea.textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(35,31,32,.08); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 400; color: var(--text); cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--ink); }
.swatches { display: flex; gap: 8px; height: 38px; align-items: center; }
.swatches button { width: 24px; height: 24px; border-radius: 7px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatches button[aria-pressed=true] { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 900px) { .grid-2, .checks { grid-template-columns: 1fr; } .who b { display: none; } .topbar-sep { display: none; } }
.msg-ai-mark-wrap .a-avatar { width: 28px; height: 28px; border-radius: 8px; font-size: 10.5px; }
a.btn { text-decoration: none; }

/* ---------- departments ---------- */
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -12px; padding: 0 12px; border-top: 1px solid var(--border); }
.sidebar-scroll .recents { border-top: 1px solid var(--border); margin-top: 10px; flex: none; min-height: auto; }
.sidebar-scroll .conv-list { overflow: visible; }
.nav { margin: 10px 0 10px; }
.team-block + .nav { border-top: 0; padding-top: 0; margin-top: 0; }
.dept-head { display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 8px 0 10px; border: 0; background: none; border-radius: var(--r); cursor: pointer; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; }
.dept-head:hover { background: var(--bg-muted); }
.dept-swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.dept-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dept-count { font-size: 11px; color: var(--text-3); font-weight: 400; }
.dept-chev { width: 14px !important; height: 14px !important; color: var(--text-3); transition: transform .15s; }
.dept.open .dept-chev { transform: rotate(90deg); }
.dept-roles { display: none; padding: 2px 0 6px 18px; }
.dept.open .dept-roles { display: block; }
.dept-roles .team-item { height: 30px; padding: 0 8px 0 10px; border-left: 1px solid var(--border); border-radius: 0 var(--r) var(--r) 0; }
.dept-roles .team-item b { font-weight: 400; font-size: 13px; color: var(--text-2); }
.dept-roles .team-item:hover b, .dept-roles .team-item.active b { color: var(--ink); }
.dept-roles .team-item.active { border-left: 2px solid var(--brand); background: var(--bg); box-shadow: var(--shadow-sm); }
.who-role { color: var(--text-2); font-weight: 400; }
.who-role::before { content: "·"; margin: 0 6px 0 0; color: var(--text-3); }
.intro .role { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 4px; }
.assistant-grid { display: flex; flex-direction: column; gap: 16px; }
.dept-section { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.dept-section-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 18px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
.dept-section-head h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.dept-section-head .dept-count { flex: 1; }
.role-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--border); }
.role-row:first-child { border-top: 0; }
.role-main b { font-weight: 500; color: var(--ink); }
.role-main p { margin: 2px 0 8px; font-size: 13px; color: var(--text-2); }
.role-main .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.role-main .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-muted); color: var(--text-2); }
.role-actions { display: flex; gap: 6px; }
.nowrap { white-space: nowrap; }
.table td.actions.nowrap { width: 80px; }
#nm-deps { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; }
.acc-dept { padding: 4px 0; border-bottom: 1px solid var(--border); }
.acc-dept:last-child { border-bottom: 0; }
.acc-dept label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.acc-dept-head b { font-weight: 500; color: var(--ink); }
.acc-dept-head small { color: var(--text-3); margin-left: auto; }
.acc-roles { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 4px 0 2px 24px; }
.acc-roles label { color: var(--text-2); font-size: 13px; }
.acc-roles input:disabled + * , .acc-roles label:has(input:disabled) { color: var(--text-3); }
#nm-deps input { width: 15px; height: 15px; accent-color: var(--ink); }
#dlg-member { width: min(520px, calc(100vw - 32px)); }
.lib-upload { display: flex; gap: 8px; align-items: center; }
.lib-upload select { width: 190px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.seg button { height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); cursor: pointer; font-size: 13px; color: var(--text-2); }
.seg button span { color: var(--text-3); margin-left: 4px; font-size: 12px; }
.seg button:hover { border-color: var(--border-strong); color: var(--ink); }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg button.on span { color: rgba(255,255,255,.6); }
.file-name { display: flex; flex-direction: column; min-width: 0; }
.file-name .path { color: var(--text-3); font-size: 12px; }
.badge.sync { height: 20px; font-size: 11px; margin-left: 6px; }
.token-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.token-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; padding: 8px 10px; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--r); }
.token-box small { width: 100%; color: var(--warning); }
.dept-names { display: flex; flex-wrap: wrap; gap: 6px; }
.dept-names code, .row-label code { font-family: var(--mono); font-size: 12px; background: var(--bg-muted); border-radius: 4px; padding: 2px 6px; }

/* ---------- briefings ---------- */
.table tr.clickable { cursor: pointer; }
.badge.bad { background: var(--brand-tint); color: var(--brand); }
.badge.bad::before { background: var(--brand); }
.row-top { align-items: start; }
.time-input { width: 140px !important; }
.br-sections { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.br-section { border: 1px solid var(--border); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-subtle); }
.br-section-top { display: grid; grid-template-columns: 1fr 180px 32px; gap: 8px; align-items: center; }
.br-section textarea { background: var(--bg); font-size: 13px; }
.br-view-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.briefing { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.briefing > header { padding: 24px 28px; border-bottom: 3px solid var(--brand); }
.briefing > header h2 { font-size: 22px; margin: 2px 0 4px; }
.briefing > section { padding: 22px 28px; border-top: 1px solid var(--border); }
.briefing > header + section { border-top: 0; }
.briefing h3 { font-size: 18px; margin: 2px 0 12px; }
.briefing .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
@media (max-width: 900px) { .br-section-top { grid-template-columns: 1fr; } }

/* ---------- dashboards ---------- */
.view-page .page.page-wide { max-width: 1240px; }
.source-badge { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.source-badge.demo { background: #fff4e0; color: #8a5a00; border: 1px solid #f0d9ae; }
.source-badge.live { background: var(--success-tint); color: var(--success); }
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; }
.db-head h2 { font-size: 24px; letter-spacing: -.02em; }
.db-head p { font-size: 13px; margin-top: 2px; }
.seg-tight { margin: 0; flex-wrap: nowrap; }
.seg button .sub { color: var(--text-3); }
.seg button.on .sub { color: rgba(255,255,255,.6); }
.alert-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px; border-radius: var(--r); background: var(--brand-tint); border: 1px solid #efc9ca; color: #7c0b0f; font-size: 13.5px; }
.alert-bar svg { color: var(--brand); }
.alert-bar span { margin-left: auto; color: #9c4a4d; font-size: 12.5px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 16px 12px; text-align: left; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); cursor: pointer; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.kpi-name { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 600; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 14px; font-weight: 500; color: var(--text-2); }
.kpi-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 18px; }
.delta { font-weight: 600; }
.delta.good { color: var(--success); } .delta.bad { color: var(--brand); } .delta.flat { color: var(--text-3); }
.vs { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.spark { width: 100%; height: 40px; margin-top: 6px; overflow: visible; }
.spark-line { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; opacity: .85; }
.spark-target { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--ink); stroke: var(--bg); stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark-empty { font-size: 11.5px; color: var(--text-3); height: 40px; margin-top: 6px; display: flex; align-items: center; }
.target { font-size: 11.5px; margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.target::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.target.good::before { background: var(--success); } .target.bad::before { background: var(--brand); }
.kpi-skeleton { height: 150px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--bg-subtle), var(--bg-muted), var(--bg-subtle)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.db-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.db-row.three { grid-template-columns: repeat(3, 1fr); }
.db-panel { margin-bottom: 12px; }
.db-panel .card-head { padding: 16px 18px 8px; }
.hbars { padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.hbar-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); }
.hbar-track { height: 10px; background: var(--bg-muted); border-radius: 0 4px 4px 0; }
.hbar-fill { display: block; height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.exc { padding: 0 18px 12px; }
.exc-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.exc-row:first-child { border-top: 0; }
.exc-main, .exc-meta { display: flex; flex-direction: column; min-width: 0; }
.exc-meta { text-align: right; color: var(--text-2); flex: none; }
.exc-main b { font-weight: 500; } .exc-main a { color: var(--ink); }
.exc small { color: var(--text-3); font-size: 11.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.empty-note { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; padding: 6px 0 10px; }
.empty-note svg { color: var(--success); }
.chart-tip { position: fixed; z-index: 80; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 1px; }
.chart-tip span { color: rgba(255,255,255,.7); }
.rules { display: flex; flex-direction: column; gap: 8px; padding: 0 24px 16px; }
.rule { display: grid; grid-template-columns: 40px 1.2fr 1.2fr 56px 90px 1.6fr 32px; gap: 8px; align-items: center; }
.switch.sm { transform: scale(.85); }
.dialog-xl { width: min(1100px, calc(100vw - 32px)); padding: 0; }
.dialog-xl .dialog-head { padding: 16px 24px; }
.dialog-xl .dialog-head h3 { font-size: 16px; } .dialog-xl .dialog-head p { font-size: 12.5px; }
.dialog-xl .dialog-body { max-height: 62vh; overflow: auto; }
.dialog-xl .dialog-foot { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-top: 1px solid var(--border); margin: 0; }
.kpi-def { font-size: 13px; color: var(--text-2); margin: 0 0 12px; }
.ext-ic { width: 12px !important; height: 12px !important; vertical-align: -1px; color: var(--text-3); }
.result { font-size: 12px; font-weight: 600; } .result.fail { color: var(--brand); } .result.pass { color: var(--success); }
.map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.map-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.stat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { font-size: 12px; color: var(--text-2); }
.stat b { font-size: 19px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 4px; }
.fb-ic { width: 15px !important; height: 15px !important; }
.fb-ic.good { color: var(--success); } .fb-ic.bad { color: var(--brand); }
.bars-chart { padding: 6px 24px 16px; }
.vbars { display: flex; align-items: flex-end; gap: 3px; height: 120px; border-bottom: 1px solid var(--border-strong); }
.vbar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.vbar span { display: block; width: 100%; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbar:hover span { opacity: .75; }
.vbars-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.audit-filters { display: flex; gap: 8px; }
.audit-filters select, .audit-filters input { width: 160px; height: 32px !important; font-size: 13px !important; }
.audit-detail { max-width: 520px; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.msg-actions [data-fb].chosen { color: var(--ink); background: var(--bg-muted); }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .stat-row { grid-template-columns: repeat(3, 1fr); } .db-row.three { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .db-row { grid-template-columns: 1fr; } .db-head { flex-direction: column; align-items: flex-start; } .rule { grid-template-columns: 1fr 1fr; } .map-grid { grid-template-columns: 1fr; } .stat-row { grid-template-columns: 1fr 1fr; } }
.db-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .db-row.three { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .db-row { grid-template-columns: minmax(0, 1fr); } }
.exc-row { display: flex; flex-direction: column; gap: 2px; }
.exc-line { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.exc-line > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exc-line b { font-weight: 500; flex: none; }
.exc-line b a { color: var(--ink); }
.exc-line > span:last-child { color: var(--text-2); font-size: 12.5px; text-align: right; }
.exc-line.sub > span { font-size: 11.5px; color: var(--text-3); }
.exc-line.sub > span:first-child { flex: 1; min-width: 0; }
.dialog-xl td, .dialog-xl th { white-space: nowrap; }
.seg button { white-space: nowrap; } .pane-head .seg { flex: none; } .stat b { white-space: nowrap; font-size: 18px; }
