/* TG 采集台 —— “档案阅览室”：冷灰绿纸面、深青墨色、荧光笔式命中高亮 */
:root {
  --paper: #e6ece9;
  --sheet: #f7f9f8;
  --sheet-2: #eef2f0;
  --rule: #c7d2ce;
  --rule-strong: #9fb0ab;
  --ink: #17353a;
  --ink-2: #536e71;
  --ink-3: #7d9294;
  --teal: #0e6870;
  --teal-dk: #0a4f55;
  --teal-bg: #d9eceb;
  --hit: #f3d86b;
  --red: #b6452f;
  --red-bg: #f6e1db;
  --amber: #a86a12;
  --amber-bg: #f6ead2;
  --green: #2f7d4f;
  --green-bg: #dcefe3;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.err { color: var(--red); margin: 0; min-height: 1.4em; font-size: 13px; }

/* ---------- 布局 ---------- */
#app { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 0 18px; border-right: 1px solid var(--rule); background: var(--sheet-2); }
.brand { font: 700 20px/1 var(--serif); letter-spacing: .02em; padding: 0 22px 22px; color: var(--ink); text-decoration: none; }
.nav { display: flex; flex-direction: column; }
.nav a { display: block; padding: 9px 22px; color: var(--ink-2); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { color: var(--ink); background: var(--sheet); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 600; background: var(--sheet); border-left-color: var(--teal); }
.who { margin-top: auto; padding: 14px 22px 0; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
main { padding: 30px 40px 80px; max-width: 1280px; width: 100%; outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font: 700 26px/1.2 var(--serif); }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-head .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- 按钮 / 表单 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--ink); background: transparent; border-radius: 3px; cursor: pointer; text-decoration: none; color: var(--ink); line-height: 1.4; white-space: nowrap; }
.btn:hover { background: var(--sheet); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dk); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 3px 10px; font-size: 13px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; font-size: inherit; }
.link.danger { color: var(--red); }
label { display: block; font-size: 13px; color: var(--ink-2); }
label > input, label > select, label > textarea { display: block; margin-top: 4px; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; color: var(--ink); min-height: 34px; }
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 2px var(--teal-bg); }
.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.check input { width: auto; margin: 0; }
.hint { font-size: 12.5px; color: var(--ink-2); margin: 4px 0 0; }

/* 开关 */
.sw { position: relative; display: inline-block; width: 34px; height: 20px; vertical-align: middle; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; z-index: 1; }
.sw i { position: absolute; inset: 0; background: var(--rule-strong); border-radius: 20px; transition: background .15s; }
.sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw input:checked + i { background: var(--teal); }
.sw input:checked + i::after { transform: translateX(14px); }
.sw input:focus-visible + i { outline: 2px solid var(--teal); outline-offset: 2px; }

/* ---------- 状态 ---------- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 6px; }
.dot.ok { background: var(--green); } .dot.run { background: var(--teal); animation: pulse 1.4s ease-in-out infinite; }
.dot.wait { background: var(--amber); } .dot.err { background: var(--red); } .dot.off { background: var(--rule-strong); }
@keyframes pulse { 50% { opacity: .35; } }
.tag { display: inline-block; padding: 0 6px; border-radius: 2px; font-size: 12px; line-height: 18px; background: var(--sheet-2); color: var(--ink-2); border: 1px solid var(--rule); white-space: nowrap; }
.tag.red { background: var(--red-bg); color: var(--red); border-color: #e3bcb1; }
.tag.teal { background: var(--teal-bg); color: var(--teal-dk); border-color: #b4d6d4; }
.tag.amber { background: var(--amber-bg); color: var(--amber); border-color: #e4cfa2; }
.notice { padding: 10px 14px; border-left: 3px solid var(--amber); background: var(--amber-bg); margin-bottom: 18px; }
.notice.red { border-color: var(--red); background: var(--red-bg); }

/* ---------- 账本式表格 ---------- */
.ledger { width: 100%; border-collapse: collapse; background: var(--sheet); border-top: 2px solid var(--ink); }
.ledger th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.ledger td { padding: 11px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger tr:hover td { background: #f0f5f3; }
.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger .ttl { font-weight: 600; }
.empty { padding: 44px 20px; text-align: center; color: var(--ink-2); background: var(--sheet); border-top: 2px solid var(--ink); }
.empty strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }

/* 菜单 */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; padding: 3px 10px; border: 1px solid var(--rule-strong); border-radius: 3px; font-size: 13px; background: #fff; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--teal); }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 150px; background: #fff; border: 1px solid var(--rule-strong); box-shadow: 0 6px 20px rgba(23,53,58,.14); padding: 4px 0; }
.menu-list button { display: block; width: 100%; text-align: left; padding: 7px 14px; border: 0; background: none; cursor: pointer; font-size: 13px; }
.menu-list button:hover { background: var(--teal-bg); }
.menu-list button.danger { color: var(--red); }

/* ---------- 概览 ---------- */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-strong); background: var(--sheet); margin-bottom: 28px; }
.strip > div { padding: 14px 18px 14px; border-right: 1px solid var(--rule); }
.strip > div:last-child { border-right: 0; }
.strip .fig { font: 700 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.strip .cap { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; }
.block h2 { font: 600 17px/1.3 var(--serif); padding-bottom: 8px; border-bottom: 1px solid var(--rule-strong); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.block + .block { margin-top: 30px; }
.chart text { font-size: 11px; fill: var(--ink-2); font-family: var(--sans); }
.chart rect { fill: var(--teal); } .chart rect:last-of-type { fill: var(--ink); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.rank a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank a:hover { color: var(--teal); text-decoration: underline; }
.rank .bar { grid-column: 1 / -1; height: 3px; background: var(--rule); } .rank .bar i { display: block; height: 100%; background: var(--teal); }
.feed { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow: auto; }
.feed li { padding: 8px 0; border-bottom: 1px solid var(--rule); animation: slidein .25s ease-out; }
@keyframes slidein { from { opacity: 0; transform: translateY(-4px); } }
.feed .src { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 8px; }
.feed .src b { color: var(--ink); font-weight: 600; }
.feed p { margin: 2px 0 0; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 14px 0 0; }
.steps li { counter-increment: s; padding: 10px 0 10px 40px; position: relative; border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px; width: 26px; height: 26px; text-align: center; line-height: 26px; font: 700 15px/26px var(--serif); border: 1px solid var(--ink); border-radius: 50%; }

/* ---------- 检索 ---------- */
.searchbar { display: flex; gap: 8px; }
.searchbar input { font-size: 16px; padding: 10px 14px; min-height: 44px; border-color: var(--ink); }
.searchbar .btn { padding: 0 26px; font-size: 15px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin: 14px 0 6px; }
.resultbar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 6px; color: var(--ink-2); font-size: 13px; min-height: 28px; }
.results { background: var(--sheet); border-top: 2px solid var(--ink); }
.day { position: sticky; top: 0; z-index: 2; padding: 6px 14px; font: 600 13px/1.4 var(--serif); background: var(--sheet-2); border-bottom: 1px solid var(--rule-strong); color: var(--ink-2); }
.hit { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0 12px; padding: 11px 14px; border-bottom: 1px solid var(--rule); cursor: pointer; }
.hit:hover, .hit:focus-visible { background: #eef5f3; outline-offset: -2px; }
.hit time { font: 12.5px/1.9 var(--mono); color: var(--ink-3); }
.hit .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; }
.hit .meta b { font-weight: 600; }
.hit .txt { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.hit.deleted .txt { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 1px; }
mark { background: var(--hit); color: inherit; padding: 0 1px; border-radius: 1px; }
.more { padding: 16px; text-align: center; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--sheet); border-left: 2px solid var(--ink); z-index: 60; display: flex; flex-direction: column; box-shadow: -12px 0 30px rgba(23,53,58,.12); animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--rule-strong); }
#drawer-body { overflow: auto; padding: 18px 20px 40px; flex: 1; }
.mask { position: fixed; inset: 0; background: rgba(23,53,58,.28); z-index: 55; }
.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 12px; margin: 0 0 14px; font-size: 13px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; word-break: break-word; }
.fulltext { white-space: pre-wrap; word-break: break-word; padding: 12px 14px; background: #fff; border: 1px solid var(--rule); margin: 0 0 14px; font-size: 14.5px; line-height: 1.7; }
.drawer h3 { font: 600 14px/1.4 var(--serif); margin: 18px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
.thread { list-style: none; margin: 0; padding: 0; }
.thread li { padding: 6px 8px; border-bottom: 1px solid var(--rule); cursor: pointer; font-size: 13px; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
.thread li:hover { background: #eef5f3; }
.thread li.cur { background: var(--teal-bg); border-left: 3px solid var(--teal); }
.thread .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { padding: 8px 10px; background: #fff; border: 1px solid var(--rule); margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.media-box img, .media-box video { max-width: 100%; max-height: 360px; display: block; background: #fff; border: 1px solid var(--rule); }
.media-box audio { width: 100%; }

.modal-back { position: fixed; inset: 0; background: rgba(23,53,58,.4); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow: auto; }
.modal { background: var(--sheet); width: min(560px, 100%); border-top: 3px solid var(--ink); box-shadow: 0 18px 50px rgba(23,53,58,.3); animation: pop .15s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px 10px; }
.modal-head h2 { font: 700 19px/1.3 var(--serif); }
.modal-body { padding: 4px 22px 18px; display: grid; gap: 14px; }
.modal-foot { padding: 12px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--rule); }
.tabs { display: flex; border-bottom: 1px solid var(--rule-strong); gap: 2px; }
.tabs button { padding: 7px 14px; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ink-2); }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--teal); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button { text-align: left; padding: 12px 14px; border: 1px solid var(--rule-strong); background: #fff; cursor: pointer; border-radius: 3px; }
.seg button[aria-pressed="true"] { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: var(--teal-bg); }
.seg strong { display: block; } .seg span { font-size: 12.5px; color: var(--ink-2); }
.qr { width: 220px; height: 220px; margin: 0 auto; padding: 8px; background: #fff; border: 1px solid var(--rule); }
.qr svg { width: 100%; height: 100%; display: block; }

#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: min(520px, 92vw); animation: pop .15s ease-out; }
.toast.err { background: var(--red); }

/* ---------- 登录 ---------- */
#login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-sheet { width: min(380px, 100%); background: var(--sheet); border-top: 3px solid var(--ink); padding: 30px 30px 28px; display: grid; gap: 14px; box-shadow: 0 14px 40px rgba(23,53,58,.15); }
.login-sheet h1 { font: 700 28px/1.2 var(--serif); }
.login-sheet .sub { margin: -6px 0 6px; color: var(--ink-2); }
.settings-sec { max-width: 760px; margin-bottom: 40px; }
.settings-sec .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-sec .stack { display: grid; gap: 14px; }
.types { display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--rule); overflow-x: auto; gap: 8px; }
  .brand { padding: 12px 8px 12px 6px; white-space: nowrap; }
  .nav { flex-direction: row; } .nav a { border-left: 0; border-bottom: 3px solid transparent; padding: 14px 10px; white-space: nowrap; }
  .nav a[aria-current="page"] { border-bottom-color: var(--teal); }
  .who { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; white-space: nowrap; gap: 10px; }
  main { padding: 20px 16px 70px; }
  .cols { grid-template-columns: 1fr; }
  .settings-sec .grid2 { grid-template-columns: 1fr; }
  .hit { grid-template-columns: 1fr; } .hit time { line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 补充 ---------- */
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-line { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.stats-line b { color: var(--ink); font-weight: 600; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lvl { font: 12px/18px var(--mono); padding: 0 6px; border-radius: 2px; }
.lvl.info { background: var(--sheet-2); color: var(--ink-2); } .lvl.warn { background: var(--amber-bg); color: var(--amber); } .lvl.error { background: var(--red-bg); color: var(--red); }

.ledger .ttl a { text-decoration: none; }
.ledger .ttl a:hover { text-decoration: underline; text-decoration-thickness: 1px; }

/* Telegram 风格消息流 */
.results { --chat-bg: #dce8df; background: var(--chat-bg); border: 1px solid var(--rule); border-radius: 14px; padding: 18px clamp(12px, 3vw, 32px) 24px; min-height: 180px; }
.results .day { position: static; width: fit-content; margin: 8px auto 20px; padding: 5px 14px; border: 0; border-radius: 20px; background: var(--sheet); font: 500 13px/1.5 var(--sans); box-shadow: 0 1px 3px rgba(23,53,58,.08); }
.message-row { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 16px; min-width: 0; }
.msg-avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--teal); color: white; display: grid; place-items: center; font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.msg-bubble { min-width: 0; width: min(100%, 660px); padding: 12px 14px 6px; background: white; border-radius: 14px 14px 14px 4px; box-shadow: 0 1px 3px rgba(23,53,58,.12); overflow-wrap: anywhere; }
.msg-source { color: var(--ink-2); font-size: 12px; line-height: 1.5; margin-bottom: 2px; }
.msg-sender { font-size: 14px; font-weight: 600; color: var(--teal-dk); margin-bottom: 8px; }
.msg-sender span { font-weight: 400; font-size: 12px; margin-left: 8px; color: var(--ink-2); }
.msg-text { font-size: 15px; line-height: 1.65; white-space: pre-wrap; margin: 6px 0; }
.msg-forward, .msg-reply { border-left: 3px solid var(--teal); background: var(--teal-bg); padding: 6px 10px; margin-bottom: 8px; font-size: 13px; border-radius: 3px; }
.msg-footer { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.msg-detail { border: 0; background: transparent; color: var(--teal); cursor: pointer; min-height: 44px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.msg-detail:hover, .msg-detail:active { background: var(--teal-bg); }
.msg-media { margin: 8px 0; }
.msg-photo { display: block; border: 0; padding: 0; background: var(--sheet-2); width: min(100%, 540px); border-radius: 10px; overflow: hidden; cursor: zoom-in; }
.msg-media img, .msg-media video { display: block; width: 100%; max-width: 540px; height: auto; min-height: 160px; max-height: 480px; object-fit: contain; border-radius: 10px; background: var(--sheet-2); }
.msg-media img { aspect-ratio: auto 16 / 9; }
.msg-media video { width: min(100%, 540px); aspect-ratio: 16 / 9; background: var(--ink); }
.msg-media audio { width: 100%; margin: 4px 0; }
.msg-file { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; min-height: 44px; margin-top: 6px; border-radius: 8px; background: var(--sheet-2); text-decoration: none; font-size: 12px; }
.msg-file strong { font-weight: 500; overflow-wrap: anywhere; }
.msg-file span { color: var(--ink-2); font-size: 12px; }
.msg-file.unavailable { flex-direction: column; align-items: flex-start; gap: 2px; color: var(--ink-2); }
.msg-media-error, .msg-truncated { color: var(--ink-2); background: var(--sheet-2); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.msg-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-reactions span { background: var(--teal-bg); padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.msg-deleted { color: var(--red); }
.message-row.deleted .msg-bubble { border: 1px dashed var(--red); }
.message-row.current .msg-bubble { outline: 2px solid var(--teal); outline-offset: 2px; }
.message-preview .msg-avatar, .message-context .msg-avatar { display: none; }
.message-preview .msg-bubble, .message-context .msg-bubble { width: 100%; }
.message-info { margin: 20px 0; border-bottom: 1px solid var(--rule); padding-bottom: 10px; }
.message-info summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--teal); }
.message-context { background: var(--paper); padding: 12px; border-radius: 12px; }
.context-date { font-size: 12px; text-align: center; color: var(--ink-2); margin-bottom: 10px; }
.image-viewer img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
@media (max-width: 600px) {
  .message-row { gap: 6px; }
  .msg-avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 13px; }
  .msg-bubble { padding: 10px 10px 4px; }
  .results { padding: 12px 8px 16px; }
  .msg-media img, .msg-media video { min-height: 100px; max-height: 360px; }
}
