/* LLM Tester v2 -- Data Lab palette (same tokens as llm.projects.data.syr.edu) */
@font-face { font-family: "DL Arabic"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/fonts/vazirmatn-arabic-400-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "DL Arabic"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(vendor/fonts/vazirmatn-arabic-700-normal.woff2) format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "DL Hebrew"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/fonts/noto-sans-hebrew-hebrew-400-normal.woff2) format("woff2");
  unicode-range: U+0590-05FF, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "DL Hebrew"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(vendor/fonts/noto-sans-hebrew-hebrew-700-normal.woff2) format("woff2");
  unicode-range: U+0590-05FF, U+20AA, U+25CC, U+FB1D-FB4F; }

:root {
  --bg: #f7f7f5; --fg: #1a1a19; --mut: #6b6a66; --card: #ffffff; --bd: #e4e3df; --bd2: #d6d5d0;
  --acc: #2a6fdb; --acc-h: #1f5cc0; --acc-bg: #eaf1fc; --ok: #1d7a46; --ok-bg: #e6f4ec; --wait: #8a5a00; --wait-bg: #fbf1dc;
  --err: #b42318; --err-bg: #fdecea; --code: #f2f1ee; --codebg: #1f2330; --codefg: #e6e8ef; --codebar: #2a2f3d;
  --side: #f0efec; --hover: #e9e8e4; --sel: #e2e1dc; --ububble: #ecebe7; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --overlay: rgba(20,20,18,.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, "DL Arabic", "Vazirmatn",
          "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, "DL Hebrew", "Noto Sans Hebrew", "Noto Sans CJK SC",
          "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Malgun Gothic", sans-serif,
          "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211; --fg: #ecebe8; --mut: #a3a29c; --card: #1a1a19; --bd: #2e2e2b; --bd2: #3a3a36;
    --acc: #5b9bf0; --acc-h: #7aaef3; --acc-bg: #1b2a40; --ok: #5fd08b; --ok-bg: #16301f; --wait: #f0b84a; --wait-bg: #33270f;
    --err: #f28b82; --err-bg: #3b1f1d; --code: #232321; --codebg: #191c26; --codefg: #e6e8ef; --codebar: #232838;
    --side: #171716; --hover: #232321; --sel: #2b2b28; --ububble: #262624; --shadow: 0 1px 2px rgba(0,0,0,.4);
    --overlay: rgba(0,0,0,.55); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211; --fg: #ecebe8; --mut: #a3a29c; --card: #1a1a19; --bd: #2e2e2b; --bd2: #3a3a36;
  --acc: #5b9bf0; --acc-h: #7aaef3; --acc-bg: #1b2a40; --ok: #5fd08b; --ok-bg: #16301f; --wait: #f0b84a; --wait-bg: #33270f;
  --err: #f28b82; --err-bg: #3b1f1d; --code: #232321; --codebg: #191c26; --codefg: #e6e8ef; --codebar: #232838;
  --side: #171716; --hover: #232321; --sel: #2b2b28; --ububble: #262624; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --overlay: rgba(0,0,0,.55); color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dl-logo { filter: invert(1) hue-rotate(180deg); } }
:root[data-theme="dark"] .dl-logo { filter: invert(1) hue-rotate(180deg); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 var(--font); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acc); text-decoration: none; } a:hover { text-decoration: underline; }
.mut { color: var(--mut); } .small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* form controls */
.input, select.input, textarea.input { width: 100%; background: var(--card); border: 1px solid var(--bd2); border-radius: 9px; padding: 8px 11px; }
.input:focus, textarea:focus, select:focus { outline: 2px solid var(--acc-bg); border-color: var(--acc); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--card); border: 1px solid var(--bd2);
       border-radius: 9px; padding: 7px 13px; cursor: pointer; font-size: 14px; color: var(--fg); white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--acc-h); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.btn.on { background: var(--acc-bg); border-color: var(--acc); color: var(--acc); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.ib { display: inline-flex; align-items: center; justify-content: center; gap: 5px; background: none; border: 0; cursor: pointer; color: var(--mut);
      padding: 6px; border-radius: 8px; font-size: 13px; }
.ib:hover { background: var(--hover); color: var(--fg); }
.ib.on { color: var(--acc); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); } .pill.wait { color: var(--wait); background: var(--wait-bg); }
.pill.off { color: var(--mut); background: var(--code); } .pill.err { color: var(--err); background: var(--err-bg); }
.alert { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.alert.err { background: var(--err-bg); color: var(--err); } .alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.info { background: var(--acc-bg); color: var(--fg); }

/* ---------- auth pages ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; font-size: 20px; font-weight: 650; }
.auth .brand img { height: 34px; width: auto; }
.auth .brand .sep { width: 1px; height: 26px; background: var(--bd2); }
.card { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); width: 100%; max-width: 420px; }
.card.wide { max-width: 560px; }
.card h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.01em; }
.card .lead { color: var(--mut); margin: 0 0 18px; font-size: 14px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field .hint { display: block; font-size: 12.5px; color: var(--mut); margin-top: 4px; font-weight: 400; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--bd2); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.seg a { padding: 9px 8px; text-align: center; font-size: 14px; font-weight: 600; color: var(--mut); background: var(--card); }
.seg a + a { border-left: 1px solid var(--bd2); }
.seg a.on { background: var(--acc-bg); color: var(--acc); }
.seg a:hover { text-decoration: none; }
.auth .foot { margin-top: 18px; font-size: 13.5px; color: var(--mut); text-align: center; max-width: 420px; }
.auth form .btn.primary { width: 100%; padding: 10px; }
.kindnote { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--mut); background: var(--code); border-radius: 9px; padding: 9px 11px; margin-bottom: 16px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } .card { padding: 20px 16px; } }

/* ---------- chat app layout ---------- */
.app { display: flex; height: 100%; overflow: hidden; }
.sidebar { width: 268px; flex: none; background: var(--side); border-right: 1px solid var(--bd); display: flex; flex-direction: column; min-height: 0; transition: margin-left .18s ease; }
.app.collapsed .sidebar { margin-left: -268px; }
.sb-top { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 14px; }
.sb-top .brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; min-width: 0; flex: 1; color: var(--fg); }
.sb-top .brand:hover { text-decoration: none; }
.sb-top .brand img { height: 22px; width: auto; }
.sb-top .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-actions { padding: 4px 10px 6px; display: flex; flex-direction: column; gap: 6px; }
.newchat { justify-content: flex-start; width: 100%; background: var(--card); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mut); width: 16px; height: 16px; }
.search input { width: 100%; background: transparent; border: 1px solid var(--bd2); border-radius: 9px; padding: 6px 10px 6px 32px; font-size: 14px; }
.search input:focus { background: var(--card); outline: 2px solid var(--acc-bg); border-color: var(--acc); }
.chatlist { flex: 1; overflow-y: auto; padding: 4px 8px 12px; min-height: 0; }
.grp { font-size: 12px; font-weight: 600; color: var(--mut); padding: 14px 8px 4px; }
.ci { display: flex; align-items: center; gap: 2px; border-radius: 8px; padding: 0 2px 0 10px; height: 34px; cursor: pointer; font-size: 14px; color: var(--fg); position: relative; }
.ci:hover { background: var(--hover); }
.ci.cur { background: var(--sel); }
.ci .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: start; }
.ci .ib { visibility: hidden; padding: 4px; }
.ci:hover .ib, .ci.cur .ib, .ci .ib.open { visibility: visible; }
.ci input { flex: 1; min-width: 0; border: 1px solid var(--acc); border-radius: 6px; padding: 3px 6px; background: var(--card); font-size: 14px; }
.listnote { color: var(--mut); font-size: 13px; padding: 14px 10px; }
.sb-foot { border-top: 1px solid var(--bd); padding: 8px; position: relative; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-radius: 9px; padding: 7px 8px; cursor: pointer; text-align: start; }
.me:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--acc); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 650; font-size: 13px; flex: none; }
.me .who { min-width: 0; flex: 1; line-height: 1.25; }
.me .who b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who small { color: var(--mut); font-size: 12px; }
.badge { background: var(--err); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; }

.menu { position: absolute; z-index: 40; background: var(--card); border: 1px solid var(--bd); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.16);
        padding: 6px; min-width: 220px; display: none; }
.menu.open { display: block; }
.menu .mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer;
            font-size: 14px; color: var(--fg); text-align: start; text-decoration: none; }
.menu .mi:hover { background: var(--hover); text-decoration: none; }
.menu .mi.danger { color: var(--err); }
.menu .grow { flex: 1; }
.menu form { margin: 0; }
.menu .sep { height: 1px; background: var(--bd); margin: 5px 4px; }
.menu .mh { padding: 6px 10px 4px; font-size: 12px; color: var(--mut); }
.menu .themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 2px 4px 4px; }
.menu .themes button { border: 1px solid var(--bd2); background: var(--card); border-radius: 7px; padding: 4px; font-size: 12.5px; cursor: pointer; }
.menu .themes button.on { border-color: var(--acc); color: var(--acc); background: var(--acc-bg); }
.sb-foot .menu { bottom: 58px; left: 8px; right: 8px; }

.mainc { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.topbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: 54px; }
.topbar .grow { flex: 1; }
.app:not(.collapsed) .topbar .showside { display: none; }
.mpick { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mpick select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; border-radius: 9px; padding: 6px 28px 6px 10px; font-weight: 600; font-size: 15.5px; cursor: pointer;
  max-width: 300px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6a66' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.mpick select:hover { background-color: var(--hover); }
.mpick select option { font-weight: 400; background: var(--card); color: var(--fg); }
.mpick .vs { color: var(--mut); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mut); flex: none; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.wait { background: var(--wait); }
.topbar .menu { top: 48px; right: 10px; }

.scroller { flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; overflow-anchor: none; }
.thread { max-width: 780px; margin: 0 auto; padding: 12px 20px 28px; display: flex; flex-direction: column; gap: 26px; }

/* messages */
.msg { position: relative; min-width: 0; }
.msg.user { display: flex; flex-direction: column; align-items: flex-end; }
.ububble { background: var(--ububble); border-radius: 18px; padding: 10px 16px; max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; text-align: start; }
.msg.user .imgs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.msg.user .imgs img { max-height: 160px; max-width: 220px; border-radius: 12px; border: 1px solid var(--bd); }
.actions { display: flex; align-items: center; gap: 1px; margin-top: 4px; flex-wrap: wrap; min-height: 30px; }
.msg.user .actions { opacity: 0; transition: opacity .12s; margin-bottom: -10px; }
.msg.user:hover .actions, .msg.user:focus-within .actions { opacity: 1; }
.actions .ib { padding: 5px; }
.actions .ib svg { width: 16px; height: 16px; }
.meta { font: 12px var(--mono); color: var(--mut); margin-left: 8px; overflow-wrap: anywhere; }
.edit-box { width: 100%; background: var(--ububble); border-radius: 18px; padding: 10px 12px; }
.edit-box textarea { width: 100%; background: transparent; border: 0; resize: none; outline: none; min-height: 60px; max-height: 50vh; }
.edit-box .row { display: flex; justify-content: flex-end; gap: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pair > .msg { border: 1px solid var(--bd); border-radius: 14px; padding: 12px 14px; background: var(--card); }
.ans-model { font-size: 12.5px; font-weight: 600; color: var(--mut); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.msg.error .body { color: var(--err); background: var(--err-bg); border-radius: 10px; padding: 10px 14px; }
.waiting { display: flex; align-items: center; gap: 8px; color: var(--mut); font-size: 14px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--mut); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

details.think { margin: 0 0 10px; border-left: 2px solid var(--bd2); padding-left: 12px; }
details.think > summary { cursor: pointer; color: var(--mut); font-size: 13.5px; list-style: none; display: inline-flex; align-items: center; gap: 6px; user-select: none; }
details.think > summary::-webkit-details-marker { display: none; }
details.think > summary svg { width: 14px; height: 14px; transition: transform .15s; }
details.think[open] > summary svg { transform: rotate(90deg); }
details.think .tbody { color: var(--mut); font-size: 14px; margin-top: 6px; }
.shimmer { background: linear-gradient(90deg, var(--mut) 25%, var(--fg) 50%, var(--mut) 75%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
           color: transparent; animation: shim 2s linear infinite; }
@keyframes shim { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- markdown ---------- */
.md { overflow-wrap: anywhere; word-break: normal; line-height: 1.68; position: relative; overflow-x: clip; }
.md .katex, .md .katex-display, .md .tablewrap { position: relative; }
.md > .blk { display: contents; }
.md :where(p, ul, ol, blockquote, table, pre, .tablewrap, .codeblock, .katex-display, h1, h2, h3, h4, h5, h6, hr, dl) { text-align: start; }
.md p { margin: 0 0 .85em; }
.md :where(h1, h2, h3, h4, h5, h6) { margin: 1.15em 0 .5em; line-height: 1.3; font-weight: 650; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.25em; } .md h3 { font-size: 1.1em; } .md h4, .md h5, .md h6 { font-size: 1em; }
.md > .blk:first-child > :first-child, .md > :first-child { margin-top: 0; }
.md > .blk:last-child > :last-child, .md > :last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 0 0 .85em; padding-inline-start: 1.6em; }
.md li { margin: .2em 0; }
.md li > ul, .md li > ol { margin: .2em 0; }
.md li > p { margin: 0 0 .4em; }
.md li.task { list-style: none; } .md li.task input { margin-inline: -1.35em .45em; vertical-align: -1px; }
.md :not(pre) > code { background: var(--code); padding: .12em .38em; border-radius: 5px; font: .88em var(--mono); overflow-wrap: anywhere; unicode-bidi: isolate; }
.md blockquote { margin: 0 0 .85em; padding: .1em 0; padding-inline-start: 14px; border-inline-start: 3px solid var(--bd2); color: var(--mut); }
.md hr { border: 0; border-top: 1px solid var(--bd); margin: 1.4em 0; }
.md a { overflow-wrap: anywhere; }
.md img { max-width: 100%; height: auto; border-radius: 8px; }
.md .tablewrap { overflow-x: auto; margin: 0 0 1em; max-width: 100%; border: 1px solid var(--bd); border-radius: 10px; }
.md table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.md th, .md td { border-bottom: 1px solid var(--bd); padding: 7px 12px; text-align: start; vertical-align: top; overflow-wrap: normal; }
.md td + td, .md th + th { border-inline-start: 1px solid var(--bd); }
.md tr:last-child td { border-bottom: 0; }
.md th { background: var(--code); font-weight: 600; white-space: nowrap; }
.md :is(td, th)[align="center"] { text-align: center; } .md :is(td, th)[align="right"] { text-align: right; }
.md .codeblock { margin: .4em 0 1em; border-radius: 10px; overflow: hidden; background: var(--codebg); direction: ltr; text-align: left; }
.md .codebar { display: flex; align-items: center; justify-content: space-between; background: var(--codebar); color: #a9b1c6; font: 12px var(--mono); padding: 5px 8px 5px 14px; }
.md .codebar button { background: none; border: 0; color: #c9cfdd; font: 12px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; }
.md .codebar button:hover { background: rgba(255,255,255,.08); }
.md .codebar svg { width: 14px; height: 14px; }
.md pre { margin: 0; padding: 12px 16px; overflow-x: auto; color: var(--codefg); background: var(--codebg); }
.md pre code { font: 13px/1.6 var(--mono); background: none; padding: 0; white-space: pre; tab-size: 4; }
.md pre code.hljs { background: none; padding: 0; }
.md .katex { font-size: 1.08em; direction: ltr; unicode-bidi: isolate; }
.md .katex-display { margin: .7em 0 1em; overflow-x: auto; overflow-y: hidden; padding: 2px 0; direction: ltr; text-align: center; }
.md .katex-display > .katex { white-space: nowrap; }
.md .math-pending { font: 13px var(--mono); color: var(--mut); white-space: pre-wrap; direction: ltr; unicode-bidi: isolate; }
.md div.math-pending { display: block; margin: .5em 0; padding: 8px 10px; border: 1px dashed var(--bd2); border-radius: 8px; }
.md .katex-error { color: var(--err); font: 13px var(--mono); }
.md .footnotes { font-size: 13.5px; color: var(--mut); border-top: 1px solid var(--bd); margin-top: 1.2em; padding-top: .6em; }
.md .footnotes ol { margin-bottom: 0; }
.md sup a { text-decoration: none; }
.md [dir="rtl"] { font-family: "DL Arabic", "Vazirmatn", "Noto Sans Arabic", Tahoma, "DL Hebrew", var(--font); }
.md li[dir="rtl"], .md ul[dir="rtl"], .md ol[dir="rtl"] { text-align: right; }

/* token probabilities */
.tok { border-radius: 3px; white-space: pre-wrap; cursor: help; }
.lpwrap { font: 13.5px/1.8 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.tip { position: fixed; z-index: 60; background: var(--card); border: 1px solid var(--bd); box-shadow: 0 4px 16px rgba(0,0,0,.15); border-radius: 8px; padding: 8px 10px;
       font: 12px var(--mono); pointer-events: none; display: none; }
.tip td { padding: 1px 6px; } .tip td.n { text-align: right; color: var(--mut); }

/* empty state */
.empty { max-width: 680px; margin: 12vh auto 0; text-align: center; padding: 0 20px; }
.empty h1 { font-size: 28px; font-weight: 650; margin: 0 0 6px; letter-spacing: -.015em; }
.empty p { color: var(--mut); margin: 0 0 26px; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: start; }
.starter { border: 1px solid var(--bd); background: var(--card); border-radius: 12px; padding: 12px 14px; cursor: pointer; font-size: 14px; color: var(--fg); text-align: start; }
.starter:hover { border-color: var(--bd2); background: var(--hover); }
.starter b { display: block; font-weight: 600; } .starter span { color: var(--mut); font-size: 13px; }
.banner { max-width: 780px; margin: 10px auto 0; padding: 0 20px; width: 100%; }
.banner .alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.banner .alert .grow { flex: 1; min-width: 200px; }

/* composer */
.composer { padding: 0 16px 14px; }
.cbox { max-width: 780px; margin: 0 auto; background: var(--card); border: 1px solid var(--bd2); border-radius: 22px; box-shadow: var(--shadow); padding: 8px 8px 8px 12px; }
.cbox:focus-within { border-color: var(--mut); }
.cbox.drag { border-color: var(--acc); background: var(--acc-bg); }
.cbox textarea { display: block; width: 100%; border: 0; resize: none; min-height: 28px; max-height: 40vh; padding: 6px 4px; background: transparent; outline: none; font-size: 15.5px; line-height: 1.5; text-align: start; }
.cbar { display: flex; align-items: center; gap: 4px; }
.cbar .grow { flex: 1; }
.cbar .ib { border-radius: 999px; padding: 7px; }
.sendbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.sendbtn:disabled { opacity: .3; cursor: default; }
.sendbtn svg { width: 18px; height: 18px; stroke-width: 2.4; }
.sendbtn.stop svg { fill: currentColor; stroke: none; width: 14px; height: 14px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 2px 6px; }
.thumbs:empty { display: none; }
.thumb { position: relative; } .thumb img { height: 58px; border-radius: 10px; border: 1px solid var(--bd); display: block; }
.thumb button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); font-size: 13px; line-height: 20px; cursor: pointer; padding: 0; }
.chint { text-align: center; color: var(--mut); font-size: 12px; margin-top: 7px; }
.cmpchip { font-size: 12.5px; }

/* settings drawer */
.scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .18s; }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100%; background: var(--card); border-left: 1px solid var(--bd); z-index: 55;
          transform: translateX(100%); transition: transform .2s ease; display: flex; flex-direction: column; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.drawer header { display: flex; align-items: center; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--bd); }
.drawer header h2 { margin: 0; font-size: 16px; flex: 1; }
.drawer .dbody { overflow-y: auto; padding: 6px 20px 24px; flex: 1; }
.drawer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); margin: 18px 0 8px; }
.drawer .f { display: grid; grid-template-columns: 1fr 104px; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.drawer .f.wide { grid-template-columns: 1fr; gap: 5px; }
.drawer .f input { width: 100%; }
.drawer .tg { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0; font-size: 14px; cursor: pointer; }
.drawer .hint { font-size: 12.5px; color: var(--mut); margin: 4px 0 0; }
.drawer textarea.sys { min-height: 110px; resize: vertical; font-size: 14px; }
.drawer input[type=number], .drawer input[type=text] { padding: 6px 9px; }
.switch { appearance: none; -webkit-appearance: none; width: 36px; height: 21px; border-radius: 999px; background: var(--bd2); position: relative; cursor: pointer; flex: none; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch:checked { background: var(--acc); } .switch:checked::after { transform: translateX(15px); }
.drawer .presets { display: flex; gap: 6px; margin-bottom: 8px; }
.drawer .presets select { flex: 1; min-width: 0; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 14px;
         z-index: 70; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; }

/* mobile */
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; margin-left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  .app.sideopen .sidebar { transform: none; box-shadow: 10px 0 40px rgba(0,0,0,.2); }
  .app .topbar .showside { display: inline-flex !important; }
  .app.collapsed .sidebar { margin-left: 0; }
  .sidescrim { position: fixed; inset: 0; background: var(--overlay); z-index: 44; display: none; }
  .app.sideopen .sidescrim { display: block; }
}
@media (max-width: 640px) {
  .thread { padding: 8px 14px 24px; gap: 22px; }
  .topbar { padding: 6px 6px; gap: 2px; }
  .mpick select { max-width: 190px; font-size: 15px; padding-left: 6px; }
  .pair { grid-template-columns: 1fr; }
  .starters { grid-template-columns: 1fr; }
  .empty { margin-top: 6vh; } .empty h1 { font-size: 23px; }
  .composer { padding: 0 10px 10px; }
  .ububble { max-width: 92%; }
  .chint { display: none; }
  .hide-sm { display: none !important; }
  .msg.user .actions { opacity: 1; }
}

/* ---------- admin ---------- */
.admin { min-height: 100%; }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--bd); background: var(--card); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.admin-top .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; color: var(--fg); }
.admin-top .brand:hover { text-decoration: none; }
.admin-top .brand img { height: 24px; }
.admin-top .brand .sep { width: 1px; height: 20px; background: var(--bd2); }
.admin-top .grow { flex: 1; }
.admin main { max-width: 1120px; margin: 0 auto; padding: 22px 20px 60px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--bd); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--mut); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--fg); border-color: var(--acc); }
.tabs a:hover { text-decoration: none; color: var(--fg); }
.panel { background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 18px 20px; margin: 0 0 18px; }
.panel h2 { font-size: 16px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.panel > p.mut { margin: 0 0 12px; font-size: 13.5px; }
.tbl { overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mut); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--bd); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--bd); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tbl .acts form { margin: 0; }
.tbl .reason { max-width: 380px; color: var(--mut); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.temp { font: 600 18px var(--mono); background: var(--code); padding: 8px 14px; border-radius: 8px; display: inline-block; margin-top: 6px; user-select: all; letter-spacing: .03em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat span { color: var(--mut); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.form-grid .field { margin: 0; }
.form-grid .full { grid-column: 1 / -1; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; max-height: 300px; overflow-y: auto; border: 1px solid var(--bd); border-radius: 10px; padding: 10px 12px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.checks label small { display: block; color: var(--mut); font-size: 12px; }
.tgl { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin: 0; flex: 1; min-width: 180px; }
.bar { height: 6px; background: var(--code); border-radius: 3px; min-width: 60px; }
.bar > div { height: 6px; background: var(--acc); border-radius: 3px; }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .form-grid { grid-template-columns: 1fr 1fr; } .admin main { padding: 16px 12px 40px; } .panel { padding: 14px; } }
@media (max-width: 480px) { .form-grid { grid-template-columns: 1fr; } }

/* LDAP photos (2026-10-30) */
.avatar.has-photo { background: none; overflow: hidden; }
.avatar img.photo, img.avatar.photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
img.avatar.photo { width: 30px; height: 30px; flex: none; }
.who { display: inline-flex; align-items: center; gap: 10px; }
