:root {
  --bg: #f3f4f8;
  --panel: #ffffff;
  --side: #f7f7fb;
  --line: #e2e4ec;
  --line-2: #d3d6e2;
  --text: #1b1f2e;
  --text-2: #464c63;
  --muted: #737a92;
  --accent: #4b47d6;
  --accent-2: #3a36b8;
  --accent-ink: #ffffff;
  --accent-soft: #eceafe;
  --hover: #ececf4;
  --code-bg: #f4f4f8;
  --user-bubble: #4b47d6;
  --user-ink: #ffffff;
  --ok: #18794e;
  --ok-soft: #e7f6ee;
  --bad: #c4321f;
  --bad-soft: #fdeeec;
  --warn: #a35a00;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 44, 0.06), 0 8px 28px rgba(20, 24, 44, 0.1);
  --top: 52px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --panel: #191c27;
    --side: #151822;
    --line: #2a2e3d;
    --line-2: #363b4e;
    --text: #e8eaf2;
    --text-2: #c0c4d4;
    --muted: #8b91a8;
    --accent: #8d89ff;
    --accent-2: #a6a3ff;
    --accent-ink: #12141c;
    --accent-soft: #272646;
    --hover: #23273a;
    --code-bg: #10121a;
    --user-bubble: #3b38a8;
    --user-ink: #f2f2ff;
    --ok: #4cc38a;
    --ok-soft: #173326;
    --bad: #ff7b6b;
    --bad-soft: #3a1d1a;
    --warn: #f0b049;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.noscript, .boot { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 按钮、输入框 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel); color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); font-weight: 500; }
.btn-quiet:hover { background: var(--hover); }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.danger, .danger-text { color: var(--bad) !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 18px; line-height: 1;
}
.icon-btn:hover { background: var(--hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }
.icon-btn .i { width: 20px; height: 20px; }
input, select, textarea { background: var(--panel); }
.field { display: grid; gap: 5px; margin: 0 0 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input, .inline-form input:not([type="checkbox"]), .select {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; outline: none;
}
.field input:focus, .inline-form input:not([type="checkbox"]):focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); margin: 0 0 12px; white-space: nowrap; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--accent); }
.error { margin: 0 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.notice { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--ok-soft); color: var(--text); font-size: 14px; line-height: 1.8; }
.notice code { font-size: 16px; padding: 2px 8px; margin: 0 4px; letter-spacing: 0.5px; user-select: all; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; white-space: nowrap; }
.logo {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: linear-gradient(140deg, #6d68ff, #3b36c4); color: #fff; font-size: 15px; font-weight: 700;
}
.brand.big { font-size: 20px; margin-bottom: 22px; }
.brand.big .logo { width: 38px; height: 38px; font-size: 20px; border-radius: 11px; }

/* ---------- 登录 ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px 28px 24px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 22px; margin: 0 0 16px; }
.auth-card .form > .muted { margin: 14px 0 0; }
.auth-card .btn-quiet { margin-top: 8px; }

/* ---------- 主界面 ---------- */
.app { height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  height: var(--top); flex: none; display: flex; align-items: center; gap: 12px; padding: 0 14px 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.spend { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.account { position: relative; }
.account-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 8px 4px 12px; font-size: 14px; color: var(--text-2); max-width: 180px; white-space: nowrap; }
.account-btn span { overflow: hidden; text-overflow: ellipsis; }
.account-btn:hover { background: var(--hover); }
.menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 170px; z-index: 30; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid;
}
.menu button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.menu button:hover { background: var(--hover); }
.mobile-only { display: none; }

.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 264px minmax(0, 1fr) 300px; }

/* 左栏：项目和对话 */
.side { background: var(--side); border-right: 1px solid var(--line); padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ws-row { position: relative; display: flex; gap: 6px; align-items: center; }
.ws-row .select { min-height: 38px; font-weight: 600; cursor: pointer; }
.ws-row .menu { top: calc(100% + 4px); left: 0; right: auto; }
.side-title { margin: 8px 6px 0; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 0.5px; }
.conv-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.conv-item { position: relative; display: flex; align-items: stretch; border-radius: 9px; }
.conv-item:hover, .conv-item.is-current { background: var(--hover); }
.conv-item.is-current { background: var(--accent-soft); }
.conv-open { flex: 1; min-width: 0; display: grid; text-align: left; border: 0; background: none; padding: 7px 4px 7px 10px; }
.conv-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conv-open small { font-size: 12px; color: var(--muted); }
.conv-del { border: 0; background: none; color: var(--muted); width: 30px; font-size: 18px; border-radius: 8px; opacity: 0; }
.conv-item:hover .conv-del, .conv-item.is-current .conv-del, .conv-del:focus-visible { opacity: 1; }
.conv-del:hover { color: var(--bad); }

/* 中间：对话 */
.chat-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.chat-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 22px; border-bottom: 1px solid var(--line); }
.chat-title { flex: 1 1 160px; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; }
.seg button { display: grid; justify-items: center; border: 0; background: none; border-radius: 8px; padding: 4px 12px; line-height: 1.25; color: var(--text-2); }
.seg button b { font-size: 13px; }
.seg button small { font-size: 11px; color: var(--muted); }
.seg button:hover { background: var(--hover); }
.seg button.is-on { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(20, 24, 44, 0.12); }
.seg-small button { padding: 3px 10px; font-size: 13px; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 22px max(22px, calc((100% - 820px) / 2)) 10px; display: flex; flex-direction: column; gap: 16px; }

.empty { margin: auto; max-width: 600px; text-align: center; padding: 24px 0; }
.empty h2 { font-size: 24px; margin: 0 0 8px; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 22px; text-align: left; }
.examples button { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: var(--text-2); text-align: left; line-height: 1.5; }
.examples button:hover { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }

.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg .bubble { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
.msg-user .bubble { max-width: min(78%, 640px); background: var(--user-bubble); color: var(--user-ink); padding: 9px 14px; border-radius: 16px 16px 4px 16px; }
.msg-user .bubble p { margin: 0; }
.msg-user .bubble p + p { margin-top: 6px; }
.msg-user code { background: rgba(255, 255, 255, 0.15); border-color: transparent; color: inherit; }
.msg-user .file-chip { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.25); color: inherit; }
.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-ai .bubble { width: 100%; }
.bubble > :first-child { margin-top: 0; }
.bubble p { margin: 0 0 10px; }
.bubble ul, .bubble ol { margin: 0 0 10px; padding-left: 22px; }
.bubble li { margin: 2px 0; }
.bubble .md-h { margin: 16px 0 8px; line-height: 1.35; }
h3.md-h { font-size: 18px; }
h4.md-h { font-size: 16px; }
h5.md-h, h6.md-h { font-size: 15px; }
blockquote { margin: 0 0 10px; padding: 2px 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
pre.code { margin: 0 0 12px; padding: 12px 14px; background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
pre.code code { background: none; border: 0; padding: 0; font-size: inherit; white-space: pre; }
.table-wrap { overflow-x: auto; margin: 0 0 12px; }
table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg); font-weight: 600; white-space: nowrap; }
.typing { display: inline-flex; gap: 5px; margin: 6px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
.msg-error { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.msg-cost { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

details.think { margin: 0 0 10px; border-left: 2px solid var(--line-2); padding-left: 12px; }
details.think summary { cursor: pointer; font-size: 13px; color: var(--muted); list-style: none; }
details.think summary::-webkit-details-marker { display: none; }
details.think summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 8px 2px 2px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform 0.15s; }
details.think[open] summary::before { transform: rotate(45deg); }
details.think > div { margin-top: 6px; font-size: 13px; color: var(--muted); max-height: 280px; overflow-y: auto; }

.tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; margin: 0 0 10px; }
.tool {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 13px; line-height: 1.6;
  border: 1px solid var(--line); background: var(--bg); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.tool { cursor: pointer; }
button.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool.is-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); background: var(--ok-soft); }
.tool.is-working { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--accent-soft); }
.tool.is-working::before { content: ""; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.tool span { overflow: hidden; text-overflow: ellipsis; }
.tool.is-failed { color: var(--warn); background: var(--bad-soft); border-color: transparent; white-space: normal; }
details.refs { flex-basis: 100%; font-size: 13px; }
details.refs summary { cursor: pointer; color: var(--muted); }
details.refs a { display: block; margin: 3px 0 3px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 2px 9px; font-size: 13px; }
.file-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .i, .att > .i { color: var(--muted); }
.msg-user .file-chip .i { color: inherit; opacity: 0.8; }

/* 输入区 */
.chat-form { padding: 8px max(22px, calc((100% - 820px) / 2)) 12px; background: var(--panel); }
.pending { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; padding: 5px 4px 5px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.att.is-failed { border-color: var(--bad); background: var(--bad-soft); }
.att-text { display: grid; min-width: 0; line-height: 1.3; }
.att-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-text small { font-size: 12px; color: var(--muted); }
.att-x { border: 0; background: none; color: var(--muted); font-size: 17px; width: 26px; height: 26px; border-radius: 6px; flex: none; }
.att-x:hover { background: var(--hover); color: var(--text); }
.chat-box { display: flex; align-items: flex-end; gap: 8px; border: 1px solid var(--line-2); border-radius: 16px; padding: 7px; background: var(--panel); box-shadow: 0 2px 10px rgba(20, 24, 44, 0.05); }
.chat-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.attach { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: var(--bg); color: var(--text-2); font-size: 20px; }
.attach:hover { background: var(--hover); }
#chat-input { flex: 1; min-width: 0; max-height: 220px; resize: none; border: 0; outline: none; background: transparent; padding: 6px 4px; line-height: 1.55; }
.chat-box .btn { min-height: 36px; border-radius: 10px; }
.chat-note { margin: 6px 4px 0; }
.drop { position: absolute; inset: 8px; z-index: 10; display: grid; place-items: center; pointer-events: none; border: 2px dashed var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent-soft) 92%, transparent); color: var(--accent); font-size: 18px; font-weight: 600; }

/* 右栏：项目文件 */
.files { background: var(--side); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.files.is-over { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.files-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 14px 14px 6px; }
.files-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px 8px; border-bottom: 1px solid var(--line); }
.file-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.files-empty { padding: 10px 8px; }
.tree-row { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: none; border-radius: 7px; padding: 5px 8px; text-align: left; font-size: 14px; }
.tree-row:hover { background: var(--hover); }
.tree-row.is-current { background: var(--accent-soft); color: var(--accent); }
.tree-row .i { color: var(--muted); width: 16px; height: 16px; }
.tree-row.is-dir .i:first-child { width: 13px; height: 13px; margin-right: -3px; }
.tree-row.is-current .i { color: inherit; }
.tree-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row.is-dir .name { font-weight: 600; }
.tree-row small { color: var(--muted); font-size: 12px; flex: none; }

/* ---------- 弹窗 ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(14, 16, 28, 0.45); }
.viewer { width: min(1100px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.viewer-path { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.viewer-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.viewer-body { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; }
.viewer-body:has(> .frame) { padding: 0; overflow: hidden; }
.frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.view-code { margin: 0; min-height: 100%; }
.md-view { max-width: 780px; margin: 0 auto; }
.md-view .md-h:first-child { margin-top: 0; }
.md-view p, .md-view li { line-height: 1.8; }
.img-view { display: grid; place-items: center; min-height: 100%; }
.img-view img, .media { max-width: 100%; max-height: calc(100dvh - 140px); border-radius: 8px; }

.admin { width: min(860px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.admin[open] { display: flex; flex-direction: column; }
.admin .viewer-head strong { margin-right: auto; }
.admin-body { overflow: auto; padding: 18px 22px 22px; }
.admin-body .form { max-width: 440px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.inline-form input { width: auto; flex: 1 1 160px; min-height: 36px; }
.inline-form .check { margin: 0 4px; }
.row-actions { white-space: nowrap; }

/* ---------- 提示 ---------- */
.toasts { position: fixed; right: 16px; top: calc(var(--top) + 12px); z-index: 100; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px 10px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); animation: pop 0.18s ease-out; }
.toast.is-error { background: var(--bad); color: #fff; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; opacity: 0.7; font-size: 16px; line-height: 1; padding: 2px 6px; }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } }
.scrim { display: none; }

/* ---------- 窄屏：左右两栏变抽屉 ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  .mobile-only { display: inline-grid; }
  .topbar { padding: 0 8px; gap: 6px; }
  .spend { font-size: 12px; }
  .layout { grid-template-columns: minmax(0, 1fr); position: relative; }
  .side, .files {
    position: fixed; top: var(--top); bottom: 0; z-index: 15; width: min(300px, 86vw);
    transition: transform 0.22s ease; box-shadow: var(--shadow);
  }
  .side { left: 0; transform: translateX(-105%); }
  .files { right: 0; transform: translateX(105%); }
  .side.is-open, .files.is-open { transform: none; }
  .scrim { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 14; background: rgba(14, 16, 28, 0.35); }
  .scrim[hidden] { display: none; }
  .conv-del { opacity: 1; }
  .chat-head { padding: 8px 12px; gap: 8px; }
  .chat-title { flex-basis: 100%; }
  .seg button small { display: none; }
  .chat-log { padding: 16px 12px 8px; }
  .chat-form { padding: 6px 10px calc(10px + env(safe-area-inset-bottom)); }
  .examples { grid-template-columns: minmax(0, 1fr); }
  .msg-user .bubble { max-width: 88%; }
  .viewer, .admin { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .viewer-body { padding: 14px; }
  .admin-body { padding: 14px; }
}
@media (max-width: 480px) {
  .brand b { display: none; }
  .account-btn { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
