/* AiSee Tours dashboard. Theme ported from the Apps Script dashboard: botanic greens,
   DM Sans + Chillax, frosted floating panels, light / dark. */
:root {
  --green: #1B4332;
  --green-600: #2D6A4F;
  --green-tint: #E9F2EC;
  --ink: #1A1F1C;
  --ink-60: #5B6660;
  --bg: #FAFBFA;
  --surface: #F1F4F2;
  --white: #ffffff;
  --line: #E7EAE8;
  --danger: #B23A48;
  --glass-bg: rgba(255,255,255,.62);
  --glass-border: rgba(255,255,255,.55);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Chillax", "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --chart-1: #258B5E;              /* validated: lightness, chroma, contrast vs #fff */
  color-scheme: light;
}
body.theme-dark {
  --green: #52B788;
  --green-600: #74C69D;
  --green-tint: #16291F;
  --ink: #E7ECEA;
  --ink-60: #98A39D;
  --bg: #0E1311;
  --surface: #1B221F;
  --white: #1C2320;
  --line: #2C332F;
  --glass-bg: rgba(22,27,24,.55);
  --glass-border: rgba(255,255,255,.12);
  --chart-1: #43A876;              /* validated vs the dark card surface #1C2320 */
  color-scheme: dark;
}
body.theme-dark .btn.primary,
body.theme-dark .avatar,
body.theme-dark .sim-split .sim-speed { background-color: #2D6A4F; border-color: #2D6A4F; }
body.theme-dark .btn.primary:hover { background-color: #35825F; }

* { box-sizing: border-box; }
html:has(body.theme-dark) { background: #0E1311; }   /* the root keeps the light --bg otherwise: white band under short pages */
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.5; font-size: 15px; -webkit-text-size-adjust: 100%; }
h1, h2, h3, .brand { font-family: var(--display); letter-spacing: -0.01em; }
a { color: var(--green-600); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface); padding: 1px 6px; border-radius: 4px; }
.empty { color: var(--ink-60); font-size: 14px; padding: 18px 4px; margin: 0; }
.empty.glass { padding: 16px; border-radius: 12px; background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); }
.muted { color: var(--ink-60); font-size: 12.5px; }

/* ── App bar ── */
.appbar { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 60; display: flex; align-items: center; gap: 22px; height: 60px; padding: 0 18px;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--glass-border); border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
.brand span { color: var(--green-600); }
.brand.big { font-size: 28px; }
.tabs { display: flex; gap: 4px; }
.tab { font-size: 12.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-60); padding: 8px 14px; border-radius: 8px; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab i { display: none; }
.tab span { white-space: nowrap; }
.tab.active { background: var(--green-tint); color: var(--green); }
body.theme-dark .appbar .tab { color: #C6CFCA; }
body.theme-dark .appbar .tab.active { color: var(--green); }
.spacer { flex: 1; }
.proj { position: relative; }
.projbtn { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; border: 1px solid var(--line); background: var(--white); font: 600 13.5px var(--sans); color: var(--ink); padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.projbtn:hover { background: var(--surface); }
.projbtn .pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.projbtn .fa-location-dot { color: var(--green-600); }
.projbtn .fa-chevron-down { font-size: 10px; color: var(--ink-60); }
.projmenu { position: absolute; top: 46px; right: 0; width: 300px; max-width: 90vw; z-index: 70; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(26,31,28,.18); padding: 8px; }
.projmenu[hidden] { display: none; }
.projsearch { width: 100%; font: 14px var(--sans); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--white); color: var(--ink); }
.projlist { max-height: 300px; overflow-y: auto; }
.projitem { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; text-align: left; border: 0; background: none; font: 600 13.5px var(--sans); color: var(--ink); padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.projitem:hover { background: var(--surface); }
.projitem.on { background: var(--green-tint); color: var(--green); }
.iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: var(--ink-60); border: 0; background: none; cursor: pointer; font-size: 15px; }
.iconbtn:hover { background: var(--surface); color: var(--green); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--green); color: #fff; font: 700 13px var(--sans); display: grid; place-items: center; cursor: pointer; }
.usermenu { position: absolute; top: 64px; right: 12px; width: 240px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(26,31,28,.14); padding: 12px 14px; z-index: 70; }
.usermenu[hidden] { display: none; }
.um-email { font-weight: 600; font-size: 13.5px; word-break: break-all; }
.um-role { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--green-600); margin-top: 4px; }

/* ── Page shell ── */
.wrap { max-width: 1640px; margin: 0 auto; padding: 88px clamp(16px, 3.2vw, 56px) 64px; }
.page { max-width: none; }
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.phead h1 { margin: 4px 0 0; font-size: 30px; font-weight: 700; }
.sublabel { color: var(--ink-60); font-size: 13.5px; margin-top: 4px; }
.phead-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(26,31,28,.04); }
.pad { padding: 18px 20px; }
.sub { font-size: 13px; font-weight: 700; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0 0; font-size: 13.5px; }
.kv dt { color: var(--ink-60); }
.kv dd { margin: 0; word-break: break-all; }

/* ── Controls ── */
.btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: 600 13.5px var(--sans); padding: 9px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--white); color: var(--ink); }
.btn[hidden] { display: none; }
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: #143324; }
.btn.mini { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, .tab:focus-visible, .projbtn:focus-visible, .iconbtn:focus-visible, .trow-head:focus-visible { outline: 2px solid var(--green-600); outline-offset: 2px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; background: var(--green-tint); color: var(--green); padding: 3px 9px; border-radius: 999px; }
.badge { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 5px; background: var(--surface); color: var(--ink-60); }
.badge.active { background: var(--green-tint); color: var(--green); }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--line); border-top-color: var(--green-600); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { position: relative; overflow: hidden; background: var(--surface); }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-bar { display: block; height: 13px; border-radius: 6px; }
.te-lbl { display: block; font-size: 12px; font-weight: 700; color: var(--ink-60); margin: 12px 0 5px; }
.te-in { width: 100%; font: 14px var(--sans); padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.te-in:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-tint); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-60); margin: 14px 0 4px; }

/* ── Login ── */
.login-bg { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% 10%, #D8F3DC 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #B7E4C7 0%, transparent 55%), var(--bg); }
body.theme-dark .login-bg { background: radial-gradient(1200px 600px at 20% 10%, #16291F 0%, transparent 60%), radial-gradient(900px 500px at 90% 90%, #1B3326 0%, transparent 55%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 30px 28px; border-radius: 18px; background: var(--glass-bg); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); border: 1px solid var(--glass-border); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.login-sub { margin: 4px 0 14px; font-size: 14px; }
.login-msg { color: var(--danger); font-size: 13px; min-height: 20px; margin: 6px 0 8px; }

/* ── Tours ── */
.tours-layout { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 18px; align-items: start; }
.tours-list { display: flex; flex-direction: column; gap: 10px; }
.trow { background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trow.sel { border-color: var(--green-600); box-shadow: inset 3px 0 0 var(--green); }
.trow-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; }
.trow-head .tcaret { color: var(--ink-60); font-size: 11px; transition: transform .15s; }
.trow.open .tcaret { transform: rotate(90deg); }
.trow-name { font-weight: 700; font-size: 15.5px; flex: 1; }
.trow-detail { display: none; padding: 0 16px 16px; }
.trow.open .trow-detail { display: block; }
.tour-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.trow-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; }
.trow-desc { color: var(--ink-60); font-size: 13px; margin: 0 0 12px; }
.hl-title { font-size: 12.5px; font-weight: 700; margin: 0 0 8px; }
.hl-list { position: relative; }
.hl-list::before { content: ''; position: absolute; left: 9px; top: 14px; bottom: 14px; width: 2px; background: var(--green-600); opacity: .3; }
.hl { position: relative; display: flex; align-items: center; gap: 12px; padding: 4px 0; font-size: 13.5px; }
.hl.off { opacity: .5; }
.hl .dot { width: 14px; height: 14px; margin: 0 3px; border-radius: 50%; border: 2px solid var(--green-600); background: var(--white); flex: 0 0 auto; position: relative; z-index: 1; }
.hl .abc { width: 20px; height: 20px; border-radius: 50%; background: #EA4335; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: 0 0 auto; position: relative; z-index: 1; }
.hl .along { color: var(--ink-60); font-size: 11.5px; }
.hl-runner { position: absolute; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); opacity: 0; z-index: 3; transition: top .55s cubic-bezier(.45,.05,.3,1); }
.hl-runner.on { opacity: 1; animation: hlpulse 1.25s ease-in-out infinite; }
@keyframes hlpulse { 0%,100% { box-shadow: 0 0 0 3px rgba(27,67,50,.12); } 50% { box-shadow: 0 0 0 8px rgba(27,67,50,.22); } }
.tours-map { position: sticky; top: 84px; }
.mapwrap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.map { width: 100%; height: clamp(420px, calc(100vh - 120px), 900px); background: var(--surface); }
.map-off { display: grid; place-items: center; }
.map-note { padding: 26px 16px; color: var(--ink-60); font-size: 13.5px; text-align: center; }
.map-toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(26,31,28,.92); color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 5; white-space: nowrap; }
.map-toast.show { opacity: 1; }
.map-type-toggle { display: inline-flex; background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); border: 1px solid var(--glass-border); border-radius: 9px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.16); }
.map-type-toggle button { border: 0; background: none; font: 700 12px var(--sans); color: var(--ink); padding: 7px 13px; cursor: pointer; }
.map-type-toggle button.on { background: #2D6A4F; color: #fff; }
.iw-head { font: 700 14px/1.3 var(--sans); color: #1B4332; padding-top: 2px; max-width: 230px; }
.iw-body { font: 400 13px/1.45 var(--sans); color: #333; max-width: 250px; display: grid; gap: 4px; }
.iw-tags { font-weight: 600; color: #2D6A4F; }
.iw-sense { color: #8a6d1a; }
.iw-access { color: #a14b2a; }
.simbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 0 2px; }
.sim-split { display: inline-flex; align-items: stretch; }
.sim-split .sim-play { border-radius: 9px 0 0 9px; }
.sim-split .sim-speed { appearance: none; -webkit-appearance: none; border: 1px solid var(--green); border-left: 1px solid rgba(255,255,255,.4);
  background: var(--green) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round'/></svg>") no-repeat right 7px center;
  color: #fff; font: 700 12px var(--sans); padding: 0 21px 0 9px; border-radius: 0 9px 9px 0; cursor: pointer; }
.sim-split .sim-speed option { color: var(--ink); background: var(--white); }
.msg { font-size: 12.5px; color: var(--ink-60); }

/* ── Tables / status ── */
table.kb { width: 100%; border-collapse: collapse; }
table.kb th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-60); padding: 12px 14px; border-bottom: 1px solid var(--line); }
table.kb td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
table.kb tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; }
.status .sd { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-60); flex: 0 0 auto; }
.status.indexed .sd { background: #2e9e5b; }
.status.failed .sd { background: var(--danger); }
.status.processing .sd { background: #C9A227; }
.status.pending .sd { background: var(--ink-60); }

/* ── Knowledge Base ── */
.kb-search { font: 14px var(--sans); padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); width: 240px; max-width: 100%; }
.kb-search:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px var(--green-tint); }
.kbadd-wrap { position: relative; }
.kbadd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(26,31,28,.16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.kbadd-menu[hidden] { display: none; }
.kbadd-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; font: 600 13.5px var(--sans); color: var(--ink); padding: 9px 10px; border-radius: 7px; cursor: pointer; text-align: left; }
.kbadd-menu button:hover { background: var(--surface); }
.kbadd-menu i { width: 16px; color: var(--green-600); }
.kbwrap { overflow-x: auto; }
.kbwrap table.kb { min-width: 720px; }
.kbname { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; font: 700 13.5px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.kbname .tcaret { color: var(--ink-60); font-size: 11px; transition: transform .15s; }
.kbname.open .tcaret { transform: rotate(90deg); }
.chip-new { display: inline-block; margin-left: 10px; vertical-align: 1px; font: 700 10.5px var(--sans); letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: var(--green-600); padding: 2px 8px; border-radius: 999px; animation: newglow 1.8s ease-in-out 4; }
body.theme-dark .chip-new { background: #2D6A4F; }
@keyframes newglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(45,106,79,.45); } 50% { box-shadow: 0 0 0 6px rgba(45,106,79,0); } }
@media (prefers-reduced-motion: reduce) { .chip-new { animation: none; } }
.chip-dup { display: inline-block; margin-left: 10px; vertical-align: 1px; font: 700 10.5px var(--sans); letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: #B7791F; padding: 2px 8px; border-radius: 999px; animation: dupglow 1.8s ease-in-out 4; }
@keyframes dupglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(183,121,31,.45); } 50% { box-shadow: 0 0 0 6px rgba(183,121,31,0); } }
@media (prefers-reduced-motion: reduce) { .chip-dup { animation: none; } }
table.kb tr.dupe-row td { color: var(--ink-60); }
.kbname.is-static { cursor: default; color: var(--ink-60); }
.kbname.is-static i { color: var(--ink-60); font-size: 12px; }
.status.dupe .sd { background: #B7791F; }
table.kb tr.dupe-row .status { font-weight: 500; }
.tip-btn { position: relative; border: 0; background: none; padding: 2px 4px; margin-left: 4px; color: var(--ink-60); cursor: help; font-size: 13px; vertical-align: 0; border-radius: 6px; }
.tip-btn:hover, .tip-btn:focus-visible { color: var(--ink); outline: none; background: var(--surface); }
.tip-btn::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: 30;
  white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; font: 600 12px var(--sans); color: #fff; background: #1c1b19;
  padding: 6px 10px; border-radius: 7px; box-shadow: 0 6px 18px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .12s; }
.tip-btn:hover::after, .tip-btn:focus-visible::after { opacity: 1; }
.kbkind { color: var(--ink-60); font-weight: 600; white-space: nowrap; }
.kb-date, table.kb .status { white-space: nowrap; }
table.kb tr.srow:hover td { background: var(--surface); }
table.kb tr.srowx td { background: var(--bg); padding-top: 4px; }
.kb-kv { margin: 0 0 4px 26px; font-size: 13px; }
.kb-actions { text-align: right; }
.kb-actions > div { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.kb-actions .btn.ico { width: 34px; padding-left: 0; padding-right: 0; justify-content: center; }
.kb-actions .btn.kb-proc { width: 104px; justify-content: center; }
.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost:hover { background: rgba(178,58,72,.1); }
.kbfoot { padding: 12px 14px; color: var(--ink-60); font-size: 12.5px; }
.kbfoot:empty { display: none; }
.kb-jobs { margin-top: 16px; }
table.kb tr.kb-problem-row td { padding-top: 0; }
.kb-problem { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #FDF3E1; color: #6B4A06; }
.kb-banner { margin: 0 0 14px; }
.kb-problem > i { margin-top: 3px; color: #B7791F; }
.kb-problem-body { flex: 1; display: grid; gap: 2px; font-size: 13.5px; }
.kb-problem-body b { color: #5A3E05; }
.kb-problem-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.kb-problem .iconbtn { width: 30px; height: 30px; color: #8A6512; }
body.theme-dark .kb-problem { background: #33280F; color: #E9D3A3; }
body.theme-dark .kb-problem-body b { color: #F3E2BC; }
body.theme-dark .kb-problem > i, body.theme-dark .kb-problem .iconbtn { color: #E0B25C; }
.kb-jobs summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.kb-jobs summary::-webkit-details-marker { display: none; }
.kb-jobs summary .tcaret { color: var(--ink-60); font-size: 11px; transition: transform .15s; }
.kb-jobs[open] summary .tcaret { transform: rotate(90deg); }
.kb-jobs[open] summary { border-bottom: 1px solid var(--line); }
.up-card { margin: 0 0 14px; padding: 6px 0; }
.up-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 14px; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.up-ico { font-size: 20px; color: var(--danger); flex: 0 0 auto; }
.up-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.up-name { display: flex; gap: 8px; align-items: baseline; font-weight: 600; font-size: 13.5px; }
.up-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 5px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.up-bar span { display: block; height: 100%; background: var(--green-600); transition: width .2s; }
.up-row.failed .up-bar span { background: var(--danger); }
.up-state { font-size: 12px; color: var(--ink-60); }
.up-row.failed .up-state { color: var(--danger); }
.up-row.done .up-state { color: var(--green-600); }
.up-actions { display: flex; gap: 6px; }
.up-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.kb-modal, .form-modal { width: min(460px, 92vw); }
.form-modal.wide { width: min(640px, 94vw); max-width: none; }
.form-modal h3 { margin: 0 0 4px; }
.fd-intro { margin: 0 0 6px; font-size: 13px; }
.fd-hint { margin: 4px 0 0; font-size: 12px; color: var(--ink-60); }
.form-modal textarea.te-in { resize: vertical; }
.kb-modal h3 { margin: 0 0 4px; }
.kb-modal form > p.muted { margin: 0 0 6px; font-size: 13px; }
@media (max-width: 720px) { .kb-search { width: 100%; } .phead-actions { width: 100%; } }

/* ── Toasts + modal ── */
.toast-host { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: min(680px, 92vw); }
.toast { display: flex; align-items: flex-start; gap: 12px; background: #1c1b19; color: #fff; border-radius: 10px; padding: 12px 12px 12px 15px; box-shadow: 0 10px 34px rgba(0,0,0,.28); font-size: 13.5px; line-height: 1.45; }
.toast.err { background: #7a2230; }
.toast.ok { background: #1B4332; }
.toast-msg { flex: 1; word-break: break-word; white-space: pre-wrap; }
.toast-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.toast-btn { border: 0; background: rgba(255,255,255,.14); color: #fff; font: 600 12px var(--sans); cursor: pointer; border-radius: 7px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 5px; }
.toast-btn:hover { background: rgba(255,255,255,.26); }
dialog.modal { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; background: var(--white); color: var(--ink); max-width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog.modal::backdrop { background: rgba(14,19,17,.4); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ── Desktop Tours: full-viewport map with floating frosted list ── */
@media (min-width: 981px) {
  body[data-view="tours"] { overflow: hidden; }
  body[data-view="tours"] .wrap { max-width: none; padding: 0; height: 100vh; }
  body[data-view="tours"] .tours-layout { display: block; position: relative; height: 100vh; }
  body[data-view="tours"] .tours-map { position: absolute; inset: 0; z-index: 1; }
  body[data-view="tours"] .tours-map, body[data-view="tours"] #tourMapHost, body[data-view="tours"] .mapwrap, body[data-view="tours"] .map { height: 100%; }
  body[data-view="tours"] .mapwrap { border: 0; border-radius: 0; }
  body[data-view="tours"] .tours-left { position: absolute; z-index: 5; top: 84px; left: 16px; bottom: 16px; width: 380px; overflow-y: auto; padding-right: 2px; }
  body[data-view="tours"] .tours-left .trow { background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); border-color: var(--glass-border); }
}

/* ── Mobile ── */
@media (max-width: 980px) {
  .tours-layout { grid-template-columns: 1fr; }
  .tours-map { position: static; }
  .map { height: 60vh; }
}
@media (max-width: 720px) {
  .appbar { gap: 10px; padding: 0 10px; left: 8px; right: 8px; top: 8px; }
  .brand { font-size: 15px; }
  .tab { padding: 8px 10px; }
  .tab i { display: inline; font-size: 15px; }
  .tab span { display: none; }
  .tabs { gap: 2px; }
  .projbtn { max-width: 140px; padding: 7px 9px; }
  #themeBtn { display: none; }
  .wrap { padding-top: 80px; }
}
@media (max-width: 560px) {
  .brand { display: none; }
}

/* ── Tour list: add card ── */
.addcard { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--white); border: 1px dashed var(--green-600); border-radius: 12px; color: var(--green); font-weight: 700; font-size: 15px; text-decoration: none; }
.addcard:hover { background: var(--green-tint); }
.addcard .ai { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 12px; }
body.theme-dark .addcard .ai { background: #2D6A4F; }
a.btn { text-decoration: none; }

/* ── Tour editor: 3 panes ── */
.te3 { display: grid; grid-template-columns: 380px 1fr 340px; gap: 14px; }
.te-info, .te-inspector { background: var(--white); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; }
.te-inspector[hidden] { display: none; }
.te-topbar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.te-title-input { flex: 1; min-width: 0; border: 0; background: transparent; font: 700 19px var(--display); color: var(--ink); padding: 6px 4px; border-radius: 8px; }
.te-title-input:focus { outline: none; background: var(--surface); }
.te-scroll { flex: 1; overflow-y: auto; padding: 4px 14px 14px; }
.te-desc { min-height: 70px; resize: vertical; }
.te-info.loading .te-real, .te-info.loading #teName { display: none; }
.te-info:not(.loading) .te-skel, .te-info:not(.loading) .te-skel-title { display: none; }
.te-skel-title { flex: 1; max-width: 55%; height: 20px; margin: 6px 4px; }
.te-skel-desc { height: 92px; border-radius: 9px; }
.te-skel-card { height: 64px; border-radius: 10px; }
.te-skel-add { height: 58px; border-radius: 10px; margin-bottom: 16px; }
.te-skel-row { display: flex; align-items: center; gap: 10px; padding: 8px; }
.te-skel-dot { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.te-skel-lines { flex: 1; display: grid; gap: 7px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.stat { background: var(--surface); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.stat-l { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-60); }
.stat-v { font: 700 18px var(--display); color: var(--green); }
.te-addwrap { position: relative; }
.seq-addcard { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px dashed var(--green-600); border-radius: 10px; background: var(--white); cursor: pointer; font: inherit; color: var(--ink); }
.seq-addcard:hover { background: var(--green-tint); }
.te-addmenu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(26,31,28,.16); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.te-addmenu[hidden] { display: none; }
.te-addmenu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; font: 600 13.5px var(--sans); color: var(--ink); padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.te-addmenu button:hover { background: var(--surface); }
.te-hint { margin: 8px 2px 6px; }
.seq-badge { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-size: 11px; font-weight: 700; }
.seq-badge.num { background: #EA4335; color: #fff; }
.seq-badge.disc { background: var(--green-tint); color: var(--green-600); }
.seq-badge.cue { background: var(--surface); color: var(--green-600); border: 2px solid var(--green-600); font-size: 10px; }
.seq-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.seq-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seq-sub { font-size: 11.5px; color: var(--ink-60); }
.seq-list { display: flex; flex-direction: column; gap: 4px; }
.seq-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; background: var(--white); }
.seq-item:hover { background: var(--surface); }
.seq-item.sel { border-color: var(--green-600); background: var(--green-tint); }
.seq-item.off { opacity: .55; }
.seq-item.dragging { opacity: .4; }
.seq-item.drop-above { box-shadow: 0 -2px 0 var(--green-600); }
.seq-item.drop-below { box-shadow: 0 2px 0 var(--green-600); }
.seq-item:focus-visible { outline: 2px solid var(--green-600); outline-offset: 1px; }
.seq-grip { color: var(--ink-60); font-size: 11px; cursor: grab; }
.seq-move { display: flex; flex-direction: column; }
.iconbtn.sm { width: 22px; height: 18px; font-size: 10px; border-radius: 5px; }
.iconbtn:disabled { opacity: .3; cursor: default; }
.te-savebar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.te-map { min-height: 0; }
.te-mapcanvas { height: calc(100vh - 110px); border-radius: 14px; overflow: hidden; background: var(--surface); display: grid; }
.te-mapcanvas .map-note { align-self: center; }
.te-insp-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.te-insp-body { flex: 1; overflow-y: auto; padding: 4px 14px 16px; }
.te-insp-body textarea.te-in { resize: vertical; }
.te-latlng { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.te-delitem { margin-top: 18px; }
.toggle { display: inline-flex; background: var(--surface); border-radius: 9px; padding: 3px; }
.toggle button { border: 0; background: none; font: 600 12.5px var(--sans); color: var(--ink-60); padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.toggle button.on { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
select.te-in { appearance: auto; }

@media (min-width: 981px) {
  body.editing { overflow: hidden; }
  body.editing .wrap { max-width: none; padding: 0; height: 100vh; }
  body.editing .te3 { display: block; position: relative; height: 100vh; }
  body.editing .te-map { position: absolute; inset: 0; z-index: 1; }
  body.editing .te-mapcanvas { height: 100%; border-radius: 0; }
  body.editing .te-info, body.editing .te-inspector { position: absolute; top: 84px; bottom: 16px; z-index: 5; border: 0; border-radius: 14px;
    background: var(--glass-bg); -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); box-shadow: 0 8px 30px rgba(0,0,0,.16); }
  body.editing .te-info { left: 16px; width: 380px; }
  body.editing .te-inspector { right: 16px; width: 340px; }
  body.editing .te-topbar, body.editing .te-savebar, body.editing .te-insp-head { border-color: var(--glass-border); }
  body.editing .seq-item, body.editing .seq-addcard { background: transparent; }
  body.editing .seq-item:hover { background: rgba(255,255,255,.45); }
  body.theme-dark.editing .seq-item:hover { background: rgba(255,255,255,.06); }
  body.editing .seq-item.sel { background: var(--green-tint); }
}
@media (max-width: 980px) {
  .te3 { grid-template-columns: 1fr; }
  .te-mapcanvas { height: 55vh; }
}

/* ── Insights ── */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: -6px 0 16px; }
.te-in.sel { width: auto; min-width: 170px; padding: 8px 12px; appearance: auto; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-height: 118px; }
.klabel { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--ink-60); }
.klabel i { color: var(--green-600); font-size: 14px; }
.kval { font: 700 30px/1.15 var(--sans); color: var(--ink); }
.kval small { font-size: 15px; font-weight: 600; color: var(--ink-60); margin-left: 2px; }
.ksub { font-size: 12.5px; color: var(--ink-60); }
.ktrack { height: 6px; border-radius: 3px; background: var(--green-tint); overflow: hidden; }
.kfill { height: 100%; background: var(--chart-1); border-radius: 3px; }
.ins-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; }
.cardhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cardtools { display: flex; gap: 8px; align-items: center; }
.btn.on { background: var(--green-tint); border-color: var(--green-600); color: var(--green); }
.chart-box { position: relative; min-height: 240px; }
.chart-host { position: relative; outline: none; border-radius: 8px; }
.chart-host:focus-visible { box-shadow: 0 0 0 2px var(--green-600); }
.chart-host svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--ink-60); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart-col { fill: var(--chart-1); }
.chart-col.on { opacity: .75; }
.chart-hit { fill: transparent; cursor: default; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14); display: grid; gap: 1px; white-space: nowrap; }
.chart-tip[hidden] { display: none; }
.chart-tip b { font-size: 14px; color: var(--ink); }
.chart-tip span { font-size: 12px; color: var(--ink-60); }
.chart-empty { display: grid; place-items: center; min-height: 240px; }
.chart-table { max-height: 260px; overflow-y: auto; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.hbars { display: grid; gap: 12px; padding-top: 4px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: 4px 10px; align-items: center; }
.hbar-name { grid-area: name; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { grid-area: val; font-size: 13px; color: var(--ink-60); font-variant-numeric: tabular-nums; }
.hbar-track { grid-area: track; height: 8px; }
.hbar-fill { display: block; height: 100%; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.muted-cell { color: var(--ink-60); font-size: 12.5px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ins-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }

/* ── Devices ── */
.dev-name { font-weight: 700; }
.batt { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.batt-track { width: 44px; height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.batt-fill { display: block; height: 100%; background: #2e9e5b; }
.batt.warn .batt-fill { background: #C9A227; }
.batt.crit .batt-fill { background: var(--danger); }
.batt.crit i { color: var(--danger); }
.status.online .sd { background: #2e9e5b; }

/* ── Explorer ── */
.exp-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.exp-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 108px); }
.exp-h { margin: 4px 0 0; font-size: 30px; }
.exp-search { width: 100%; }
.exp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.exp-chip { font: 600 12px var(--sans); cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink-60); text-transform: capitalize; }
.exp-chip:hover { color: var(--ink); background: var(--surface); }
.exp-chip.on { background: var(--green); border-color: var(--green); color: #fff; }
body.theme-dark .exp-chip.on { background: #2D6A4F; border-color: #2D6A4F; }
.exp-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 8px; min-height: 120px; }
.exp-item { text-align: left; font: inherit; cursor: pointer; background: transparent; border: 0; border-radius: 9px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.exp-item:hover { background: var(--surface); }
.exp-item.on { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green-600); }
.exp-item:focus-visible { outline: 2px solid var(--green-600); outline-offset: -2px; }
.exp-item-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.exp-item-type { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-60); }
.exp-item-sub { font-size: 12px; color: var(--ink-60); }
.exp-detail { background: var(--white); border: 1px solid var(--line); border-radius: 14px; min-height: 60vh; overflow: hidden; }
.exp-placeholder { padding: 80px 30px; text-align: center; color: var(--ink-60); }
.exp-placeholder i { font-size: 28px; color: var(--green-600); opacity: .6; }
.exp-loading { padding: 38px 40px; display: flex; flex-direction: column; }
.exp-raw { border-top: 1px solid var(--line); padding: 12px 40px 20px; font-size: 12.5px; color: var(--ink-60); }
.exp-raw summary { cursor: pointer; font-weight: 600; }
.exp-raw pre { font: 11.5px/1.5 var(--mono); background: var(--surface); color: var(--ink); padding: 12px; border-radius: 8px; overflow: auto; max-height: 340px; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 860px) { .exp-layout { grid-template-columns: 1fr; } .exp-side { position: static; max-height: none; } .exp-list { max-height: 50vh; } }

/* specimen-card renderer (ported from the pipeline sample; scoped to .sc-root) */
.sc-root { --sc-serif: 'Iowan Old Style', 'Charter', Georgia, 'Times New Roman', Times, serif; --sc-mono: var(--mono);
  --sc-ink: #1c1b19; --sc-ink-soft: #2c2b28; --sc-grey: #8f8d87; --sc-rule: #e7e5df; --sc-footer: #f7f6f2; --sc-marker: #bfbdb6;
  font-family: var(--sc-serif); color: var(--sc-ink); line-height: 1.5; }
body.theme-dark .sc-root { --sc-ink: #EDEFEA; --sc-ink-soft: #D9DDD8; --sc-grey: #9AA39E; --sc-rule: #2F3833; --sc-footer: #18201C; --sc-marker: #5E6863; }
.sc-inner { padding: 38px 40px 8px; }
.sc-kicker { font-family: var(--sc-mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--sc-grey); margin-bottom: 14px; }
.sc-title { margin: 0; font-weight: 700; line-height: 1.08; letter-spacing: -.01em; color: var(--sc-ink); font-size: clamp(26px, 3.4vw, 38px); font-family: var(--sc-serif); }
.sc-subtitle { margin: 10px 0 0; font-style: italic; color: var(--sc-grey); font-size: clamp(17px, 2vw, 20px); line-height: 1.35; }
.sc-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-family: var(--sc-mono); font-size: 13px; color: var(--sc-grey); }
.sc-head { border-bottom: 1px solid var(--sc-rule); padding-bottom: 20px; }
.sc-body { padding-top: 6px; }
.sc-section { margin-top: 30px; }
.sc-section-label { font-family: var(--sc-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--sc-grey); padding-bottom: 12px; border-bottom: 1px solid var(--sc-rule); margin-bottom: 18px; }
.sc-facts { list-style: disc; margin: 0; padding-left: 22px; }
.sc-facts li { font-size: 16.5px; line-height: 1.6; color: var(--sc-ink-soft); margin-bottom: 13px; padding-left: 4px; max-width: 72ch; }
.sc-facts li:last-child { margin-bottom: 0; }
.sc-facts li::marker { color: var(--sc-marker); }
.sc-lead-in { font-weight: 700; color: var(--sc-ink); }
.sc-empty { color: var(--sc-grey); font-style: italic; margin-top: 24px; }
.sc-foot { background: var(--sc-footer); border-top: 1px solid var(--sc-rule); margin-top: 40px; padding: 24px 40px 30px; }
.sc-foot-label { font-family: var(--sc-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--sc-grey); margin-bottom: 12px; }
.sc-sources { margin: 0; padding-left: 20px; }
.sc-sources li { font-size: 14px; line-height: 1.5; color: var(--sc-ink-soft); margin-bottom: 8px; word-break: break-all; }
.sc-sources li::marker { font-family: var(--sc-mono); font-size: 11px; color: var(--sc-grey); }
.sc-sources a { color: inherit; }
@media (max-width: 860px) { .sc-inner { padding: 26px 20px 4px; } .sc-foot { padding: 22px 20px; } }
.plain-card { padding: 30px 34px; max-width: 820px; }
.plain-card h1 { margin: 6px 0 20px; }
.pc-kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-60); }
.pc-row { margin-bottom: 14px; }
.pc-key { font-weight: 700; font-size: 13px; color: var(--ink-60); margin-bottom: 2px; }
.pc-src { font-size: 13px; color: var(--ink-60); word-break: break-all; }

/* ── Editor: topic tags ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--green-tint); color: var(--green); }
.tag-chip button { border: 0; background: none; color: inherit; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.tag-chip button:hover { background: rgba(0,0,0,.08); }
.tagwrap { position: relative; margin: 8px 0 6px; }
.tagpop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 8px; }
.tagpop[hidden] { display: none; }
.tagpop-body { padding: 8px; }
.tagpop-q { margin-bottom: 6px; }
.tagpop-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; }
.tagpop-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.tagpop-row:hover { background: var(--surface); }
.tagpop-row input { accent-color: var(--green-600); width: 15px; height: 15px; flex: none; }
.tagpop-row span { flex: 1; min-width: 0; }
.tagpop-row small { color: var(--ink-60); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* ── Admin ── */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.subtab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--ink-60); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subtab:hover { color: var(--ink); }
.subtab.on { color: var(--green); border-bottom-color: var(--green-600); }
.subtab i { font-size: 13px; }
.chip-cur { display: inline-block; margin-left: 8px; vertical-align: 1px; font: 700 10px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--green); background: var(--green-tint); padding: 2px 7px; border-radius: 999px; }
.pr-agent { margin-bottom: 14px; overflow: hidden; }
.pr-agent-h { display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.pr-agent-name { font-weight: 700; font-size: 15px; }
.pr-agent-h .muted { margin-left: auto; }
.pr-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pr-row:last-child { border-bottom: 0; }
.pr-main { flex: 1; min-width: 0; }
.pr-name { font-weight: 700; font-size: 13.5px; }
.pr-name code { font-weight: 400; margin-left: 4px; }
.pr-preview { margin-top: 4px; font-size: 13px; color: var(--ink-60); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pr-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pr-chips .badge { text-transform: none; letter-spacing: 0; font-size: 11px; }
