:root{
  --scheme:dark;
  --bg:#070a12;
  --bg2:#0b1220;
  --panel:rgba(16,24,40,.72);
  --panel2:rgba(10,16,30,.55);
  --surface:rgba(10,16,30,.55);
  --surface2:rgba(10,16,30,.42);
  --surface3:rgba(10,16,30,.32);
  --stroke:rgba(90,166,255,.22);
  --stroke2:rgba(0,255,255,.16);
  --text:#e6f1ff;
  --muted:rgba(230,241,255,.65);
  --muted2:rgba(230,241,255,.45);
  --accent:#4da3ff;
  --accent2:#18f0ff;
  --danger:#ff3b5c;
  --warn:#ffbe5c;
  --ok:#2cff9c;
  --shadow:0 18px 50px rgba(0,0,0,.34);
  --radius:10px;
  --radius2:8px;
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(77,163,255,.08);
  --sidebar-font-size:15px;
  --main-font-size:14px;
  --mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  --sans:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;
  --ops-answer-bg:linear-gradient(180deg, color-mix(in srgb, var(--surface2) 72%, var(--bg2)), color-mix(in srgb, var(--bg) 94%, #020617));
  --ops-answer-text:color-mix(in srgb, var(--text) 93%, #eaf3ff);
  --ops-answer-muted:color-mix(in srgb, var(--text) 58%, transparent);
  --ops-answer-border:color-mix(in srgb, var(--accent) 22%, var(--stroke));
  --ops-answer-shadow:inset 0 1px 0 rgba(255,255,255,.05), 0 18px 50px rgba(0,0,0,.18);
  --ops-answer-code-bg:color-mix(in srgb, var(--bg) 82%, #020617);
  --ops-answer-code-text:color-mix(in srgb, var(--accent) 72%, var(--text));
  --ops-answer-pre-bg:color-mix(in srgb, var(--bg) 86%, #020617);
  --ops-answer-quote-bg:color-mix(in srgb, var(--accent) 10%, var(--surface));
  --ops-answer-table-bg:color-mix(in srgb, var(--surface) 88%, var(--bg));
  --ops-answer-th-bg:color-mix(in srgb, var(--accent) 12%, var(--surface2));
}

/* Motion surfaces are intentionally isolated from the existing business styles. */
.image-modal-toolbar{
  display:flex;
  align-items:center;
  gap:6px;
  margin-right:8px;
}
.image-tool-btn{
  min-width:32px;
  height:32px;
  padding:0 8px;
  font-family:var(--mono);
  font-size:16px;
}
.image-zoom-value{
  min-width:48px;
  color:var(--muted2);
  font-family:var(--mono);
  font-size:11px;
  text-align:center;
}
.image-modal-viewport{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:240px;
  max-height:calc(100vh - 150px);
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  border-radius:var(--radius2);
  background:color-mix(in srgb, var(--bg) 88%, #000);
  touch-action:none;
}
#imageModalImg{
  display:block;
  max-width:100%;
  max-height:calc(100vh - 170px);
  width:auto;
  height:auto;
  transform-origin:center center;
  cursor:grab;
  user-select:none;
  -webkit-user-drag:none;
  will-change:transform;
}
#imageModalImg.is-dragging{cursor:grabbing;}
.motion-dragging{cursor:grabbing !important; user-select:none !important;}
.capture-metric-strip,
.confidence-summary{touch-action:pan-y;}
[data-motion-drag="ready"]{cursor:grab;scroll-behavior:auto;}
[data-motion-drag="ready"].motion-dragging{cursor:grabbing;}
.motion-theme-veil{
  position:fixed;
  inset:0;
  z-index:2000;
  pointer-events:none;
  background:var(--bg);
  opacity:0;
}

/* New Brutalism theme: hard edges, warm paper, and controlled accent blocks. */
:root[data-theme="new-brutalism"]{
  --scheme:light;
  --bg:#f3f3f1;
  --bg2:#ffffff;
  --panel:#ffffff;
  --panel2:#f5f5f5;
  --surface:#ffffff;
  --surface2:#f5f5f5;
  --surface3:#ededed;
  --stroke:#111111;
  --stroke2:#111111;
  --text:#111111;
  --muted:#4b5563;
  --muted2:#6b7280;
  --accent:#eab308;
  --accent2:#7c3aed;
  --danger:#ef5b50;
  --warn:#d97706;
  --ok:#149b70;
  --shadow:none;
  --radius:0px;
  --radius2:0px;
  --ring:0 0 0 2px #111111, 0 0 0 5px #eab308;
  --sans:"Trebuchet MS","Arial Narrow",Arial,"Microsoft YaHei",sans-serif;
  --ops-answer-bg:#ffffff;
  --ops-answer-text:#111111;
  --ops-answer-muted:#4b5563;
  --ops-answer-border:#111111;
  --ops-answer-shadow:4px 4px 0 #111111;
  --ops-answer-code-bg:#ededed;
  --ops-answer-code-text:#111111;
  --ops-answer-pre-bg:#ededed;
  --ops-answer-quote-bg:#eee8ff;
  --ops-answer-table-bg:#ffffff;
  --ops-answer-th-bg:#eab308;
}
:root[data-theme="new-brutalism"] body{
  background:#f3f3f1;
  background-attachment:initial;
}
:root[data-theme="new-brutalism"] body:before{
  background-image:none;
  mask-image:none;
  opacity:0;
}
:root[data-theme="new-brutalism"] .app{background:transparent;}
:root[data-theme="new-brutalism"] .topbar{
  border-bottom:2px solid #111;
  background:#fff;
  backdrop-filter:none;
  box-shadow:none;
}
:root[data-theme="new-brutalism"] .brand-logo-img{filter:contrast(1.06) saturate(1.12);}
:root[data-theme="new-brutalism"] .brand-code{color:#111;}
:root[data-theme="new-brutalism"] .topbar-summary{
  border:2px solid #111;
  border-radius:0;
  background:#eab308;
  color:#111;
  box-shadow:4px 4px 0 #111;
}
:root[data-theme="new-brutalism"] .conn{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  box-shadow:3px 3px 0 #111;
}
:root[data-theme="new-brutalism"] .sidebar{
  border-right:2px solid #111;
  background:#eab308;
  backdrop-filter:none;
  color:#111;
}
:root[data-theme="new-brutalism"] .nav-item{
  border:2px solid transparent;
  border-radius:0;
  color:#111;
  font-weight:800;
}
:root[data-theme="new-brutalism"] .nav-item:hover{
  border-color:#111;
  background:#fff;
  color:#111;
}
:root[data-theme="new-brutalism"] .nav-item.active{
  border-color:#111;
  background:#111;
  color:#fff;
  box-shadow:4px 4px 0 #111;
}
:root[data-theme="new-brutalism"] .nav-icon{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  color:#111;
  opacity:1;
}
:root[data-theme="new-brutalism"] .nav-item.active .nav-icon{
  border-color:#111;
  background:#111;
  color:#fff;
}
:root[data-theme="new-brutalism"] .nav-sub{
  border-left:2px solid #111;
  padding-left:28px;
}
:root[data-theme="new-brutalism"] .nav-subitem{
  border-radius:0;
  color:#111;
  font-weight:700;
}
:root[data-theme="new-brutalism"] .nav-subitem:hover,
:root[data-theme="new-brutalism"] .nav-subitem.active{
  border-color:#111;
  background:#fff;
  color:#111;
}
:root[data-theme="new-brutalism"] .main{background:#f3f3f1;}
:root[data-theme="new-brutalism"] .page-title,
:root[data-theme="new-brutalism"] .card-title,
:root[data-theme="new-brutalism"] .settings-card-title{
  color:#111;
  font-weight:900;
}
:root[data-theme="new-brutalism"] .card{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  box-shadow:none;
  transition:box-shadow .16s ease;
}
:root[data-theme="new-brutalism"] .card:before{
  height:7px;
  background:#eab308;
}
:root[data-theme="new-brutalism"] .dash-col-status > .card:first-child:before{background:#62d9c0;}
:root[data-theme="new-brutalism"] .time-card:before{background:#a78bfa;}
:root[data-theme="new-brutalism"] .performance-card:before{background:#62a7ff;}
:root[data-theme="new-brutalism"] .capture-metrics-card:before{background:#62d9c0;}
:root[data-theme="new-brutalism"] .plate-confidence-card:before{background:#f05a4f;}
:root[data-theme="new-brutalism"] .kv-row,
:root[data-theme="new-brutalism"] .kpi,
:root[data-theme="new-brutalism"] .list{
  border:2px solid #111;
  border-radius:0;
  background:#f5f5f5;
}
:root[data-theme="new-brutalism"] .btn{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  color:#111;
  box-shadow:3px 3px 0 #111;
  font-weight:800;
}
:root[data-theme="new-brutalism"] .btn:hover{
  border-color:#111;
  background:#fff;
  box-shadow:1px 1px 0 #111;
  transform:translate(2px,2px);
}
:root[data-theme="new-brutalism"] .btn:active{
  transform:translate(2px,2px);
  box-shadow:1px 1px 0 #111;
}
:root[data-theme="new-brutalism"] .btn.primary,
:root[data-theme="new-brutalism"] .btn.primary:hover{background:#eab308; color:#111; border-color:#111;}
:root[data-theme="new-brutalism"] .btn.danger{background:#f05a4f; color:#111; border-color:#111;}
:root[data-theme="new-brutalism"] .btn.danger:hover{background:#f05a4f;}
:root[data-theme="new-brutalism"] .btn.ghost,
:root[data-theme="new-brutalism"] .btn.ghost:hover{background:#fff;}
:root[data-theme="new-brutalism"] .input,
:root[data-theme="new-brutalism"] .select,
:root[data-theme="new-brutalism"] .textarea{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  color:#111;
  box-shadow:3px 3px 0 #111;
}
:root[data-theme="new-brutalism"] .input:focus,
:root[data-theme="new-brutalism"] .select:focus,
:root[data-theme="new-brutalism"] .textarea:focus{box-shadow:var(--ring);}
:root[data-theme="new-brutalism"] .table{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
}
:root[data-theme="new-brutalism"] .thead{
  border-bottom:2px solid #111;
  background:#eab308;
  color:#111;
  font-weight:900;
}
:root[data-theme="new-brutalism"] .trow{
  border-bottom:1px solid #111;
  background:#fff;
  color:#111;
}
:root[data-theme="new-brutalism"] .trow:hover{background:#eee8ff;}
:root[data-theme="new-brutalism"] .badge,
:root[data-theme="new-brutalism"] .pill,
:root[data-theme="new-brutalism"] .pill2{
  border:2px solid #111;
  border-radius:0;
  background:#62d9c0;
  color:#111;
  font-weight:800;
}
:root[data-theme="new-brutalism"] .modal-backdrop{background:rgba(17,17,17,.52);backdrop-filter:none;}
:root[data-theme="new-brutalism"] .modal-card{
  border:2px solid #111;
  border-radius:0;
  background:#fff;
  box-shadow:7px 7px 0 #111;
}
:root[data-theme="new-brutalism"] .image-modal-viewport{border:2px solid #111;border-radius:0;background:#ededed;}
:root[data-theme="new-brutalism"] .capture-metric-strip,
:root[data-theme="new-brutalism"] .capture-metrics-chart,
:root[data-theme="new-brutalism"] .plate-confidence-chart{
  border-color:#111;
  border-radius:0;
}
:root[data-theme="new-brutalism"] .capture-metric-item{border-color:#111;}
:root[data-theme="new-brutalism"] .capture-state,
:root[data-theme="new-brutalism"] .badge.ok{border-color:#111;}
:root[data-theme="new-brutalism"] .sidebar-footer .hint{color:#111;}
:root[data-theme="new-brutalism"] .motion-theme-veil{background:#eab308;}

:root[data-theme="new-brutalism"] *{border-radius:0 !important;}
:root[data-theme="new-brutalism"] :is(.card,.btn,.input,.select,.textarea,.table,.list,.modal-card,.plate-card,.violation-item,.log,.preview,.md-table-wrap){
  border-color:#111;
}
:root[data-theme="new-brutalism"] :is(.input,.select,.textarea){box-shadow:3px 3px 0 #111;}
:root[data-theme="new-brutalism"] :is(.seg,.segmented){border:2px solid #111;background:#fff;box-shadow:none;}
:root[data-theme="new-brutalism"] :is(.seg-btn,.segmented button).active{
  border-color:#111;
  background:#111;
  color:#fff;
  box-shadow:none;
}
:root[data-theme="new-brutalism"] :is(.plate-card,.violation-item){
  border:2px solid #111;
  background:#fff;
  box-shadow:none;
}
:root[data-theme="new-brutalism"] :is(.ops-answer,.voice-answer,.md-view,.log){
  border:2px solid #111;
  background:#fff;
  box-shadow:none;
}

@media (hover:hover) and (pointer:fine){
  :root[data-theme="new-brutalism"] .card:hover,
  :root[data-theme="new-brutalism"] :is(.plate-card,.violation-item):hover{
    box-shadow:4px 4px 0 #111;
  }
}

:root[data-motion="off"] .motion-theme-veil{display:none;}
:root[data-motion="off"] *,
:root[data-motion="off"] *::before,
:root[data-motion="off"] *::after{
  scroll-behavior:auto !important;
  transition-duration:.01ms !important;
  animation-duration:.01ms !important;
  animation-iteration-count:1 !important;
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
  }
}

:root[data-sidebar-font="14"]{--sidebar-font-size:14px;}
:root[data-sidebar-font="15"]{--sidebar-font-size:15px;}
:root[data-sidebar-font="16"]{--sidebar-font-size:16px;}
:root[data-sidebar-font="17"]{--sidebar-font-size:17px;}
:root[data-main-font="13"]{--main-font-size:13px;}
:root[data-main-font="14"]{--main-font-size:14px;}
:root[data-main-font="15"]{--main-font-size:15px;}
:root[data-main-font="16"]{--main-font-size:16px;}

:root[data-theme="dark-cyan"]{
  --scheme:dark;
  --bg:#070a12;
  --bg2:#0b1220;
  --panel:rgba(16,24,40,.72);
  --panel2:rgba(10,16,30,.55);
  --surface:rgba(10,16,30,.55);
  --surface2:rgba(10,16,30,.42);
  --surface3:rgba(10,16,30,.32);
  --stroke:rgba(90,166,255,.22);
  --stroke2:rgba(0,255,255,.16);
  --text:#e6f1ff;
  --muted:rgba(230,241,255,.65);
  --muted2:rgba(230,241,255,.45);
  --accent:#4da3ff;
  --accent2:#18f0ff;
  --danger:#ff3b5c;
  --ok:#2cff9c;
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(77,163,255,.08);
}

:root[data-theme="dark-purple"]{
  --scheme:dark;
  --bg:#070814;
  --bg2:#0f0a1f;
  --panel:rgba(22,14,42,.74);
  --panel2:rgba(16,10,30,.56);
  --surface:rgba(16,10,30,.56);
  --surface2:rgba(16,10,30,.44);
  --surface3:rgba(16,10,30,.34);
  --stroke:rgba(171,118,255,.22);
  --stroke2:rgba(255,73,211,.14);
  --text:#f0eaff;
  --muted:rgba(240,234,255,.65);
  --muted2:rgba(240,234,255,.45);
  --accent:#ab76ff;
  --accent2:#ff49d3;
  --danger:#ff3b5c;
  --ok:#2cff9c;
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(171,118,255,.10);
}

:root[data-theme="dark-amber"]{
  --scheme:dark;
  --bg:#0b0a08;
  --bg2:#14100b;
  --panel:rgba(30,20,10,.74);
  --panel2:rgba(22,14,8,.56);
  --surface:rgba(22,14,8,.56);
  --surface2:rgba(22,14,8,.44);
  --surface3:rgba(22,14,8,.34);
  --stroke:rgba(255,190,92,.22);
  --stroke2:rgba(255,120,84,.16);
  --text:#fff4e6;
  --muted:rgba(255,244,230,.68);
  --muted2:rgba(255,244,230,.48);
  --accent:#ffbe5c;
  --accent2:#ff7854;
  --danger:#ff3b5c;
  --ok:#2cff9c;
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(255,190,92,.10);
}

:root[data-theme="light-sky"]{
  --scheme:light;
  --bg:#f7f9fc;
  --bg2:#eef4fb;
  --panel:rgba(255,255,255,.92);
  --panel2:rgba(247,250,255,.86);
  --surface:rgba(255,255,255,.96);
  --surface2:rgba(246,249,254,.92);
  --surface3:rgba(238,243,250,.76);
  --stroke:rgba(45,64,91,.14);
  --stroke2:rgba(30,120,255,.12);
  --text:#172033;
  --muted:rgba(23,32,51,.66);
  --muted2:rgba(23,32,51,.46);
  --accent:#2563eb;
  --accent2:#14b8a6;
  --danger:#e61d46;
  --ok:#0bbf72;
  --shadow:0 16px 42px rgba(34,49,77,.10);
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(27,114,255,.10);
}

:root[data-theme="light-mint"]{
  --scheme:light;
  --bg:#f6faf8;
  --bg2:#edf6f2;
  --panel:rgba(255,255,255,.92);
  --panel2:rgba(248,252,250,.86);
  --surface:rgba(255,255,255,.96);
  --surface2:rgba(246,251,249,.92);
  --surface3:rgba(235,245,240,.76);
  --stroke:rgba(39,83,72,.14);
  --stroke2:rgba(5,150,105,.12);
  --text:#10231d;
  --muted:rgba(16,35,29,.66);
  --muted2:rgba(16,35,29,.46);
  --accent:#059669;
  --accent2:#2563eb;
  --danger:#e61d46;
  --ok:#0bbf72;
  --shadow:0 16px 42px rgba(31,68,55,.10);
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(0,198,156,.10);
}

:root[data-theme="light-rose"]{
  --scheme:light;
  --bg:#f8f6fb;
  --bg2:#f3f6fb;
  --panel:rgba(255,255,255,.93);
  --panel2:rgba(250,248,252,.88);
  --surface:rgba(255,255,255,.96);
  --surface2:rgba(249,247,251,.92);
  --surface3:rgba(241,236,245,.72);
  --stroke:rgba(79,57,88,.14);
  --stroke2:rgba(219,39,119,.12);
  --text:#241526;
  --muted:rgba(36,21,38,.66);
  --muted2:rgba(36,21,38,.46);
  --accent:#db2777;
  --accent2:#6366f1;
  --danger:#e61d46;
  --ok:#0bbf72;
  --shadow:0 16px 42px rgba(73,52,82,.10);
  --ring:0 0 0 1px var(--stroke), 0 0 0 4px rgba(219,39,119,.10);
}

:root[data-theme="light-sky"],
:root[data-theme="light-mint"],
:root[data-theme="light-rose"]{
  --ops-answer-bg:linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, #fff), color-mix(in srgb, var(--surface2) 96%, #fff));
  --ops-answer-text:color-mix(in srgb, var(--text) 94%, #111827);
  --ops-answer-muted:color-mix(in srgb, var(--text) 56%, transparent);
  --ops-answer-border:color-mix(in srgb, var(--accent) 18%, var(--stroke));
  --ops-answer-shadow:inset 0 1px 0 rgba(255,255,255,.86), 0 16px 40px rgba(34,49,77,.08);
  --ops-answer-code-bg:color-mix(in srgb, var(--accent) 7%, #fff);
  --ops-answer-code-text:color-mix(in srgb, var(--accent) 70%, var(--text));
  --ops-answer-pre-bg:color-mix(in srgb, var(--surface2) 96%, #fff);
  --ops-answer-quote-bg:color-mix(in srgb, var(--accent) 7%, #fff);
  --ops-answer-table-bg:color-mix(in srgb, var(--surface) 96%, #fff);
  --ops-answer-th-bg:color-mix(in srgb, var(--accent) 8%, var(--surface2));
}

*{box-sizing:border-box}
html,body{height:100%}
html{color-scheme:var(--scheme);}
body{
  margin:0;
  color:var(--text);
  font-family:var(--sans);
  background:
    radial-gradient(1200px 720px at 12% -6%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 58%),
    radial-gradient(940px 640px at 84% 8%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 62%),
    radial-gradient(780px 540px at 58% 100%, color-mix(in srgb, var(--danger) 5%, transparent), transparent 64%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  background-attachment:fixed;
}

body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    repeating-linear-gradient(0deg, color-mix(in srgb, var(--text) 4%, transparent) 0, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px, transparent 32px),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 4%, transparent) 0, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px, transparent 32px);
  mask-image:linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,.34) 48%, transparent 90%);
  opacity:.42;
}

.app{
  height:100%;
  display:grid;
  grid-template-columns:280px 1fr;
  grid-template-rows:98px 1fr;
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
}

.topbar{
  grid-area:topbar;
  display:grid;
  grid-template-columns:minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items:center;
  column-gap:18px;
  padding:0 22px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 92%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--surface2) 82%, transparent));
  backdrop-filter:blur(18px);
  box-shadow:0 1px 0 color-mix(in srgb, var(--text) 4%, transparent), 0 10px 30px rgba(0,0,0,.05);
  position:sticky;
  top:0;
  z-index:10;
}

.brand{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-width:0;
  justify-self:start;
}
.brand-logo-img{
  display:block;
  height:70px;
  width:auto;
  max-width:230px;
  object-fit:contain;
}
.logo{
  width:40px;
  height:40px;
  border-radius:12px;
  background:
    radial-gradient(circle at 24% 28%, color-mix(in srgb, #fff 62%, transparent), transparent 22%),
    radial-gradient(circle at 72% 76%, color-mix(in srgb, var(--accent) 88%, transparent), transparent 46%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent2) 82%, #fff), color-mix(in srgb, var(--accent) 86%, #fff));
  box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent), 0 12px 28px color-mix(in srgb, var(--accent) 16%, transparent);
}
.brand-title{font-weight:800; letter-spacing:.2px; line-height:1.15;}
.brand-subtitle{font-size:12px; color:var(--muted); margin-top:4px;}
.brand-code{
  font-size:12px;
  font-weight:700;
  line-height:1;
  letter-spacing:.08em;
  color:color-mix(in srgb, var(--text) 68%, var(--muted));
  white-space:nowrap;
}

.topbar-summary{
  justify-self:center;
  padding:8px 16px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--accent) 20%, var(--stroke));
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent2) 8%, var(--surface2)));
  color:color-mix(in srgb, var(--text) 90%, var(--accent));
  font-size:15px;
  font-weight:800;
  letter-spacing:.08em;
  white-space:nowrap;
  box-shadow:0 10px 24px color-mix(in srgb, var(--accent) 8%, transparent);
}
.topbar-right{display:flex; align-items:center; gap:12px; justify-self:end;}
.conn{display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:999px; background:color-mix(in srgb, var(--surface) 96%, transparent); border:1px solid color-mix(in srgb, var(--stroke) 92%, transparent); box-shadow:0 8px 22px rgba(0,0,0,.04);}
.conn-dot{width:8px; height:8px; border-radius:999px; background:color-mix(in srgb, var(--text) 25%, transparent); box-shadow:0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);}
.conn-dot.ok{background:var(--ok); box-shadow:0 0 0 3px rgba(44,255,156,.14), 0 0 24px rgba(44,255,156,.22);}
.conn-dot.bad{background:var(--danger); box-shadow:0 0 0 3px rgba(255,59,92,.14), 0 0 24px rgba(255,59,92,.18);}
.conn-text{font-size:13px; color:var(--muted);}

.sidebar{
  grid-area:sidebar;
  border-right:1px solid color-mix(in srgb, var(--stroke) 92%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, transparent), color-mix(in srgb, var(--surface2) 76%, transparent));
  backdrop-filter:blur(18px);
  display:flex;
  flex-direction:column;
  padding:18px 14px 16px;
  font-size:var(--sidebar-font-size);
}

.main{
  font-size:var(--main-font-size);
}

.main .card-title,
.main .settings-label,
.main .input,
.main .select,
.main .btn,
.main .trow,
.main .thead,
.main .kv,
.main .muted,
.main .mono,
.main .badge,
.main .pill2,
.main .metric-label,
.main .test-v{
  font-size:var(--main-font-size);
}

.main .page-title{
  font-size:calc(var(--main-font-size) + 5px);
}

.main .metric-value,
.main .kpi-value{
  font-size:calc(var(--main-font-size) + 8px);
}

.main .settings-card-title{
  font-size:calc(var(--main-font-size) + 1px);
}

.nav{display:flex; flex-direction:column; gap:7px;}
.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:42px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid transparent;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:var(--sidebar-font-size);
  font-weight:520;
  transition:background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.nav-item:hover{
  background:color-mix(in srgb, var(--surface2) 84%, transparent);
  border-color:color-mix(in srgb, var(--stroke) 70%, transparent);
  color:var(--text);
}
.nav-item.active{
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 15%, var(--surface)), color-mix(in srgb, var(--accent2) 10%, var(--surface2)));
  border-color:color-mix(in srgb, var(--accent) 24%, var(--stroke));
  color:var(--text);
  box-shadow:inset 3px 0 0 color-mix(in srgb, var(--accent) 76%, var(--accent2)), 0 10px 24px color-mix(in srgb, var(--accent) 10%, transparent);
}

.file{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px dashed color-mix(in srgb, var(--stroke) 92%, transparent);
  border-radius:10px;
  background:color-mix(in srgb, var(--surface2) 88%, transparent);
}
.file input[type="file"]{
  width:260px;
  color:var(--muted);
  flex:0 0 260px;
  min-width:260px;
}
.file input[type="file"]::file-selector-button{
  margin-right:10px;
  padding:7px 10px;
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
}
.file-meta{min-width:0; display:flex; flex-direction:column; gap:4px; flex:1 1 auto;}
.file-title{font-size:13px; color:var(--text); font-weight:600;}
.file-sub{font-size:12px; color:var(--muted2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:520px;}

#aiVisionBlock .filters,
#aiTtsBlock .filters{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(430px, max-content));
  align-items:stretch;
}
#aiVisionBlock .file,
#aiTtsBlock .file{
  min-width:430px;
  max-width:520px;
}
#aiMode{width:176px;}
#aiInferInterval{width:150px;}
#aiVisionBlock .input.mono,
#aiTtsBlock > .controls .input.mono{
  min-width:300px;
  flex:1 1 360px;
}
#aiVisionBlock .controls .tip{
  flex:1 1 180px;
}

.vpanel{
  display:grid;
  grid-template-columns:1.35fr .65fr;
  gap:14px;
  align-items:start;
}
.vstage{
  position:relative;
  border-radius:10px;
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--stroke) 95%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface3) 88%, transparent));
  min-height:420px;
}
.vstage video{
  width:100%;
  height:100%;
  display:block;
  object-fit:contain;
  background:rgba(0,0,0,.35);
}
.vstage canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
.vcontrols{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  background:linear-gradient(180deg, transparent, rgba(0,0,0,.55));
  pointer-events:auto;
}
.vseek{
  flex:1;
  min-width:0;
}
.vtime{
  font-size:12px;
  color:rgba(235,242,255,.92);
  opacity:.95;
  white-space:nowrap;
}
.btn.mini{
  padding:6px 10px;
  font-size:12px;
  border-radius:12px;
}
.vstage-overlay{
  position:absolute;
  left:12px;
  top:12px;
  display:flex;
  gap:10px;
}
.vright{display:flex; flex-direction:column; gap:14px;}
.list{
  min-height:160px;
  max-height:260px;
  overflow:auto;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:color-mix(in srgb, var(--surface2) 80%, transparent);
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  white-space:pre-wrap;
}
.nav-icon{
  width:24px;
  height:24px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-family:var(--mono);
  font-size:12px;
  opacity:.86;
  color:color-mix(in srgb, var(--text) 66%, transparent);
  background:color-mix(in srgb, var(--surface2) 72%, transparent);
  border:1px solid color-mix(in srgb, var(--stroke) 55%, transparent);
  font-size:0;
}
.nav-icon:before{
  content:"•";
  font-size:13px;
  line-height:1;
}
.nav-item[data-route="dashboard"] .nav-icon:before{content:"▦";}
.nav-item[data-group="ai"] .nav-icon:before{content:"◎";}
.nav-item[data-route="plates"] .nav-icon:before{content:"车";}
.nav-item[data-route="violations"] .nav-icon:before{content:"!";}
.nav-item[data-group="business"] .nav-icon:before{content:"¥";}
.nav-item[data-route="logs"] .nav-icon:before{content:"≡";}
.nav-item[data-route="ops"] .nav-icon:before{content:"?";}
.nav-item[data-group="docs"] .nav-icon:before{content:"文";}
.nav-item[data-route="settings"] .nav-icon:before{content:"⚙";}
.nav-item.active .nav-icon{
  color:color-mix(in srgb, var(--accent) 78%, var(--text));
  background:color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-color:color-mix(in srgb, var(--accent) 28%, transparent);
}

.sidebar-footer{margin-top:auto; padding:12px 10px 4px;}
.hint{font-size:calc(var(--sidebar-font-size) - 2px); color:var(--muted2); line-height:1.5;}
.tip{
  min-width:140px;
  font-size:12px;
  color:var(--muted2);
  line-height:1.3;
  font-family:var(--mono);
  display:flex;
  flex-direction:column;
  gap:6px;
}
.tip.ok{color:color-mix(in srgb, var(--ok) 80%, var(--text));}
.tip.danger{color:color-mix(in srgb, var(--danger) 80%, var(--text));}
.tip-text{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  word-break:break-word;
}
.pbar{
  height:6px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
  overflow:hidden;
  display:none;
}
.pbar.show{display:block;}
.pfill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 90%, #fff), color-mix(in srgb, var(--accent2) 90%, #fff));
}

.main{
  grid-area:main;
  padding:22px;
  overflow:auto;
}

.page{display:none;}
.page.active{display:block;}
.page-title{font-size:18px; font-weight:800; margin:6px 0 16px 0; letter-spacing:.1px;}
.page-head{display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.page-head .page-title{margin:6px 0 14px 0;}
.capture-page.active{
  min-height:calc(100vh - 142px);
  display:flex;
  flex-direction:column;
}
.capture-page .grid{
  flex:1 1 auto;
  min-height:0;
  grid-template-columns:1fr;
  align-items:stretch;
}
.capture-panel{
  min-height:0;
  display:flex;
  flex-direction:column;
}
.capture-panel .card-head{
  flex:0 0 auto;
}
.capture-filter-bar{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(145px,.8fr) minmax(112px,.58fr)) minmax(180px,1fr) repeat(2,minmax(130px,.68fr)) auto minmax(110px,.7fr);
  align-items:end;
  gap:10px;
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 78%, transparent);
}
.capture-filter-field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.capture-filter-field > span{
  color:var(--muted2);
  font-size:12px;
  font-weight:700;
}
.capture-filter-field .input,
.capture-filter-field .select{
  width:100%;
  min-width:0;
  height:38px;
}
.capture-filter-actions{
  display:flex;
  align-items:center;
  gap:8px;
}
.capture-filter-actions .btn{
  min-width:68px;
  height:38px;
}
.capture-filter-summary{
  align-self:center;
  justify-self:end;
  margin:18px 0 0;
  text-align:right;
  white-space:nowrap;
}
.capture-panel .table{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.capture-panel .tbody{
  flex:1 1 auto;
  max-height:none;
  min-height:360px;
}
.capture-panel .trow{
  min-height:66px;
}
.capture-panel .tbody .trow{
  content-visibility:auto;
  contain-intrinsic-size:auto 66px;
}
.capture-panel > .muted{
  flex:0 0 auto;
}

@media (max-width:1180px){
  .capture-filter-bar{
    grid-template-columns:repeat(4, minmax(130px, 1fr));
  }
  .capture-filter-summary{margin-top:0;}
}

@media (max-width:820px){
  .capture-filter-bar{grid-template-columns:repeat(2, minmax(140px, 1fr));}
  .capture-filter-actions{grid-column:1;}
  .capture-filter-summary{grid-column:2;}
}

@media (max-width:680px){
  .capture-filter-bar{grid-template-columns:1fr;}
  .capture-filter-actions,
  .capture-filter-summary{grid-column:auto;}
  .capture-filter-actions .btn{flex:1 1 0;}
  .capture-filter-summary{justify-self:start; margin-top:0; text-align:left;}
}

.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
  align-items:start;
}
.dash-grid{
  display:grid;
  grid-template-columns:minmax(380px, .86fr) minmax(560px, 1.14fr);
  gap:10px;
  align-items:stretch;
}
.dash-col{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}
.dash-col > .card{
  min-width:0;
}
.dash-col-performance{
  min-height:100%;
}
.performance-card{
  min-height:0;
  display:flex;
  flex-direction:column;
}
.dash-col-status .time-card{
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
}
.dash-col-status .time-card .time-donut{
  flex:1 1 auto;
}
#page-dashboard .card{
  padding:14px;
}
#page-dashboard .card-title{
  margin-bottom:10px;
}
#page-dashboard .gauge-grid{
  gap:8px;
}
#page-dashboard .gauge{
  min-height:148px;
  padding:10px;
}
#page-dashboard .gauge-svg{
  height:112px;
}
#page-dashboard .gauge-center{
  top:10px;
  height:112px;
}
#page-dashboard .trend{
  margin-top:8px;
  padding:10px;
}
#page-dashboard .trend-head{
  margin-bottom:7px;
}
#page-dashboard .trend canvas{
  height:250px;
}
.span-2{grid-column:1 / span 2;}

.modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:flex;
  align-items:center;
  justify-content:center;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(6px);
}
.modal-card{
  position:relative;
  width:min(520px, calc(100vw - 36px));
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:color-mix(in srgb, var(--panel) 92%, transparent);
  box-shadow:0 20px 60px rgba(0,0,0,.55);
  padding:16px;
}
.modal-card-img{
  width:min(980px, calc(100vw - 36px));
}
.device-info-modal{
  width:min(1120px, calc(100vw - 36px));
  max-height:calc(100vh - 42px);
  overflow:auto;
}
.modal-title{
  font-size:15px;
  font-weight:800;
  letter-spacing:.2px;
}
.modal-desc{
  margin-top:10px;
  font-size:13px;
  color:color-mix(in srgb, var(--text) 70%, transparent);
  line-height:1.5;
  white-space:pre-wrap;
}
.modal-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.card{
  background:linear-gradient(180deg, color-mix(in srgb, var(--panel) 98%, transparent), color-mix(in srgb, var(--surface) 88%, transparent));
  border:1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  position:relative;
  overflow:hidden;
}
.card:before{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), color-mix(in srgb, var(--accent2) 7%, transparent), transparent 48%);
  height:2px;
  pointer-events:none;
}
.card>*{position:relative;}
.card-title{font-size:13px; color:color-mix(in srgb, var(--text) 64%, transparent); letter-spacing:.1px; margin-bottom:14px; font-weight:700;}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px;}
.card-head .card-title{margin-bottom:0;}

.kv{display:flex; flex-direction:column; gap:8px;}
.kv-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:34px;
  padding:7px 10px;
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 62%, transparent);
  border:1px solid color-mix(in srgb, var(--stroke) 38%, transparent);
}
.kv-row.ok{
  border-color:color-mix(in srgb, var(--ok) 34%, var(--stroke));
  background:color-mix(in srgb, var(--ok) 15%, var(--surface2));
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--ok) 8%, transparent);
}
.kv-row.warn{
  border-color:color-mix(in srgb, var(--warn) 34%, var(--stroke));
  background:color-mix(in srgb, var(--warn) 7%, var(--surface2));
}
.kv-row.danger{
  border-color:color-mix(in srgb, var(--danger) 36%, var(--stroke));
  background:color-mix(in srgb, var(--danger) 7%, var(--surface2));
}
.k{
  color:var(--muted2);
  font-size:12px;
  min-width:70px;
  flex:0 0 70px;
  white-space:nowrap;
}
.v{font-size:13px; color:var(--text); font-weight:650;}
.kv-row.ok .v{color:color-mix(in srgb, var(--ok) 82%, var(--text));}
.kv-row.warn .v{color:color-mix(in srgb, var(--warn) 84%, var(--text));}
.kv-row.danger .v{color:color-mix(in srgb, var(--danger) 84%, var(--text));}
.terminal-line{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.terminal-line .v{
  min-width:0;
  flex:1 1 auto;
}
.terminal-stack{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
}
.terminal-line .v{
  min-width:0;
  text-align:right;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.terminal-sub{
  max-width:100%;
  text-align:right;
  font-size:11px;
  line-height:1.25;
  color:var(--muted2);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.kv-row .terminal-stack .v{
  max-width:100%;
}
.terminal-line .btn{
  flex:0 0 auto;
  min-width:72px;
  padding-inline:10px;
}
.backend-terminal-stack{
  flex:1 1 auto;
  overflow:hidden;
}
.rk-terminal-stack{
  flex:1 1 auto;
  overflow:hidden;
}
.rk-inference-summary{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:5px;
  width:100%;
}
.rk-inference-summary::before{
  content:"";
  width:6px;
  height:6px;
  flex:0 0 6px;
  border-radius:50%;
  background:var(--muted2);
}
.rk-inference-summary.status-ok::before{background:var(--ok); box-shadow:0 0 0 3px color-mix(in srgb, var(--ok) 14%, transparent);}
.rk-inference-summary.status-warn::before{background:var(--warn); box-shadow:0 0 0 3px color-mix(in srgb, var(--warn) 14%, transparent);}
.rk-inference-summary.status-neutral::before{background:var(--muted2);}
.kv-row.ok .rk-inference-summary.status-warn{color:var(--warn);}
.kv-row.ok .rk-inference-summary.status-neutral{color:var(--muted2);}
.backend-resource-strip{
  max-width:100%;
  display:flex;
  justify-content:flex-end;
  gap:5px;
  overflow:hidden;
}
.backend-resource-item{
  min-width:0;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 5px;
  border:1px solid color-mix(in srgb, var(--stroke) 52%, transparent);
  border-radius:4px;
  background:color-mix(in srgb, var(--surface) 54%, transparent);
  white-space:nowrap;
  font-family:var(--mono);
  line-height:1.2;
}
.backend-resource-item small{
  color:var(--muted2);
  font-size:9px;
}
.backend-resource-item strong{
  color:var(--text);
  font-size:10px;
  font-weight:780;
}
.kv-row.ok .backend-resource-item strong,
.kv-row.warn .backend-resource-item strong,
.kv-row.danger .backend-resource-item strong{
  color:inherit;
}
.kv-row.ok .terminal-line,
.kv-row.ok .terminal-stack{
  color:color-mix(in srgb, var(--ok) 82%, var(--text));
}
.kv-row.ok .terminal-stack .v,
.kv-row.ok .terminal-stack .terminal-sub{
  color:inherit;
}
.kv-row:not(.ok) .terminal-stack .terminal-sub{
  color:var(--muted2);
}
.kv-row.ok .k,
.kv-row.ok .terminal-line .v{
  color:color-mix(in srgb, var(--ok) 82%, var(--text));
}
.kv-row.ok .terminal-sub{
  color:color-mix(in srgb, var(--ok) 72%, var(--muted2));
}
.kv-row.ok .btn.ghost{
  border-color:color-mix(in srgb, var(--ok) 30%, var(--stroke));
  background:color-mix(in srgb, var(--ok) 10%, var(--surface));
  color:color-mix(in srgb, var(--ok) 82%, var(--text));
}
.kv-row.ok .btn.ghost:hover{
  border-color:color-mix(in srgb, var(--ok) 50%, var(--stroke));
}
.kv-row.warn .btn.ghost{
  border-color:color-mix(in srgb, var(--warn) 28%, var(--stroke));
}
.kv-row.danger .btn.ghost{
  border-color:color-mix(in srgb, var(--danger) 28%, var(--stroke));
}
.kv-row.ok .terminal-line .btn,
.kv-row.warn .terminal-line .btn,
.kv-row.danger .terminal-line .btn{
  background:color-mix(in srgb, var(--surface) 88%, transparent);
}
.device-info-body{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.device-info-section{
  border:1px solid color-mix(in srgb, var(--stroke) 68%, transparent);
  border-radius:10px;
  background:color-mix(in srgb, var(--surface) 82%, transparent);
  overflow:hidden;
}
.device-info-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 56%, transparent);
}
.device-info-title{
  font-size:13px;
  font-weight:800;
}
.device-info-sub{
  font-size:12px;
  color:var(--muted2);
  font-family:var(--mono);
}
.device-info-table{
  overflow:auto;
}
.device-info-table table{
  width:100%;
  min-width:760px;
  border-collapse:collapse;
  font-size:12px;
}
.device-info-table th,
.device-info-table td{
  padding:10px 14px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 36%, transparent);
  text-align:left;
  vertical-align:top;
  line-height:1.45;
  word-break:break-all;
}
.device-info-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
  color:color-mix(in srgb, var(--text) 58%, transparent);
  font-weight:800;
}
.device-info-table td.category{
  width:110px;
  color:color-mix(in srgb, var(--text) 72%, transparent);
  font-weight:800;
  background:color-mix(in srgb, var(--surface2) 36%, transparent);
}
.device-info-table td.item{width:190px;}
.device-info-table td.value{width:28%;}
.device-info-table tr:last-child td{
  border-bottom:0;
}
.device-info-empty{
  padding:16px 14px;
  color:var(--muted2);
  font-size:12px;
}

.metrics{display:grid; grid-template-columns:repeat(3, 1fr); gap:10px;}
.metric{
  padding:12px;
  background:var(--panel2);
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  border-radius:var(--radius2);
}
.metric-label{font-size:12px; color:var(--muted2);}
.metric-value{margin-top:6px; font-size:20px; font-weight:750; letter-spacing:.6px;}

.gauge-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  align-items:stretch;
  flex:0 0 auto;
}
.gauge{
  position:relative;
  border-radius:var(--radius2);
  border:1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface2) 88%, transparent));
  padding:12px;
  min-height:166px;
  overflow:hidden;
}
.gauge:before{
  content:"";
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(240px 160px at 40% 20%, color-mix(in srgb, var(--accent2) 10%, transparent), transparent 65%),
    radial-gradient(220px 180px at 75% 35%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
  opacity:.45;
  pointer-events:none;
}
.gauge-svg{
  width:100%;
  height:130px;
  display:block;
  filter:drop-shadow(0 10px 30px rgba(0,0,0,.35));
}
.gauge-bg{
  fill:none;
  stroke:color-mix(in srgb, var(--stroke) 35%, transparent);
  stroke-width:10;
}
.gauge-fg{
  fill:none;
  stroke:color-mix(in srgb, var(--accent2) 78%, transparent);
  stroke-width:10;
  stroke-linecap:round;
  transform:rotate(-90deg);
  transform-origin:60px 60px;
}
.gauge-center{
  position:absolute;
  left:0;
  right:0;
  top:12px;
  height:130px;
  text-align:center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:0 10px;
}
.gauge-value{
  font-size:22px;
  font-weight:780;
  letter-spacing:.6px;
  line-height:1;
}
.gauge-unit{
  font-size:12px;
  color:color-mix(in srgb, var(--text) 55%, transparent);
  font-family:var(--mono);
  line-height:1;
}
.gauge-label{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  color:color-mix(in srgb, var(--text) 70%, transparent);
  font-size:12px;
  letter-spacing:.4px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.trend{
  margin-top:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  background:color-mix(in srgb, var(--surface2) 74%, transparent);
  padding:12px;
  position:relative;
  display:flex;
  flex-direction:column;
}
.trend-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.trend-title{
  font-size:12px;
  color:color-mix(in srgb, var(--text) 75%, transparent);
  letter-spacing:.5px;
}
.trend-sub{
  font-size:12px;
  color:color-mix(in srgb, var(--text) 45%, transparent);
  font-family:var(--mono);
}
.trend canvas{
  width:100%;
  height:310px;
  min-height:0;
  display:block;
  border-radius:8px;
  background:
    radial-gradient(600px 220px at 20% 20%, color-mix(in srgb, var(--accent2) 5%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 74%, transparent), color-mix(in srgb, var(--surface2) 48%, transparent));
  border:1px solid color-mix(in srgb, var(--stroke) 48%, transparent);
}

.time-split{
  margin-top:10px;
  font-size:12px;
  color:color-mix(in srgb, var(--text) 55%, transparent);
  font-family:var(--mono);
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
}
.ts-title{color:color-mix(in srgb, var(--text) 60%, transparent);}
.ts-item{display:inline-flex; gap:6px; align-items:center;}
.ts-dot{width:8px; height:8px; border-radius:999px; display:inline-block;}
.ts-dot-cap{background:rgba(77,163,255,.92);}
.ts-dot-inf{background:rgba(255,59,92,.90);}
.ts-dot-conv{background:rgba(255,190,92,.92);}
.ts-dot-disp{background:rgba(44,255,156,.90);}

.time-donut{
  margin-top:4px;
  display:grid;
  grid-template-columns:220px 1fr;
  gap:12px;
  align-items:center;
}
.donut-left{
  width:210px;
  height:210px;
  position:relative;
  border-radius:50%;
  overflow:visible;
}
#timeDonut{
  width:210px;
  height:210px;
  display:block;
}
.donut-center{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}
.donut-title{
  font-size:13px;
  color:color-mix(in srgb, var(--text) 60%, transparent);
  font-family:var(--mono);
}
.donut-ms{
  margin-top:4px;
  font-size:22px;
  font-weight:700;
  letter-spacing:.2px;
}
.donut-legend{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-size:12px;
  color:color-mix(in srgb, var(--text) 75%, transparent);
  font-family:var(--mono);
}
.donut-li{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:26px;
  padding:4px 8px;
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 68%, transparent);
}
.donut-dot{
  width:10px;
  height:10px;
  border-radius:3px;
  flex:0 0 auto;
}
.donut-li .t{
  flex:1 1 auto;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.donut-li .r{
  flex:0 0 auto;
  color:color-mix(in srgb, var(--text) 55%, transparent);
}
@media (max-width: 980px){
  .time-donut{grid-template-columns: 1fr; }
  .donut-left{margin:0 auto;}
}

.trend-legend{
  position:absolute;
  right:14px;
  bottom:12px;
  display:flex;
  gap:12px;
  align-items:center;
  font-size:12px;
  color:color-mix(in srgb, var(--text) 55%, transparent);
  font-family:var(--mono);
  background:color-mix(in srgb, var(--surface2) 84%, transparent);
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  border-radius:999px;
  padding:6px 10px;
  backdrop-filter:blur(10px);
}
.lg-item{display:inline-flex; gap:6px; align-items:center;}
.lg-dot{width:8px; height:8px; border-radius:999px; display:inline-block;}
.lg-dot-fps{background:rgba(24,240,255,.92);}
.lg-dot-cap{background:rgba(77,163,255,.92);}
.lg-dot-inf{background:rgba(255,59,92,.90);}

.capture-metrics-card{
  min-width:0;
  padding-bottom:12px;
}
.capture-metrics-head{
  align-items:flex-start;
  flex-wrap:wrap;
  gap:10px 18px;
}
.capture-metrics-basis{
  margin-top:-5px;
  color:var(--muted2);
  font-family:var(--mono);
  font-size:11px;
}
.capture-metrics-friendly{
  margin-top:4px;
  color:color-mix(in srgb, var(--accent2) 78%, var(--text));
  font-size:13px;
  font-weight:700;
  line-height:1.35;
}
.capture-metrics-flags{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:7px;
  margin-left:auto;
  color:var(--muted2);
  font-size:11px;
}
.capture-metrics-flags > span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:26px;
  padding:4px 8px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  border-radius:6px;
  background:color-mix(in srgb, var(--surface2) 72%, transparent);
  white-space:nowrap;
}
.capture-metrics-flags b{
  color:var(--muted2);
  font-weight:650;
}
.capture-metrics-flags strong{
  color:var(--text);
  font-family:var(--mono);
  font-weight:760;
}
.capture-state[data-state="running"]{
  border-color:color-mix(in srgb, #16b981 58%, var(--stroke));
  color:#16b981;
}
.capture-state[data-state="sampling"]{
  border-color:color-mix(in srgb, #f59e0b 58%, var(--stroke));
  color:#f59e0b;
}
.capture-state[data-state="stopped"]{
  border-color:color-mix(in srgb, #ef4444 52%, var(--stroke));
  color:#ef4444;
}
.capture-state[data-state="paused"]{
  border-color:color-mix(in srgb, #f59e0b 58%, var(--stroke));
  color:#c47a00;
}
.capture-metric-strip{
  display:grid;
  grid-template-columns:repeat(5, minmax(140px, 1fr));
  margin:2px 0 10px;
  border-top:1px solid color-mix(in srgb, var(--stroke) 50%, transparent);
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 50%, transparent);
  overflow-x:auto;
}
.capture-metric-item{
  min-width:140px;
  padding:10px 12px;
  border-left:1px solid color-mix(in srgb, var(--stroke) 46%, transparent);
}
.capture-metric-item:first-child{border-left:0;}
.capture-metric-item > span{
  display:block;
  min-height:18px;
  color:var(--muted2);
  font-size:11px;
  white-space:nowrap;
}
.capture-metric-item > span small{
  margin-left:5px;
  color:color-mix(in srgb, var(--accent2) 72%, var(--muted2));
  font-size:10px;
  font-weight:700;
}
.capture-metric-item > div{
  display:flex;
  align-items:baseline;
  gap:5px;
  margin-top:3px;
  white-space:nowrap;
}
.capture-metric-item strong{
  color:var(--text);
  font-family:var(--mono);
  font-size:17px;
  font-weight:780;
}
.capture-metric-item em{
  color:var(--muted2);
  font-family:var(--mono);
  font-size:10px;
  font-style:normal;
}
.capture-metric-primary strong{color:#06a7c7;}
.capture-metrics-chart{
  position:relative;
  width:100%;
  min-height:250px;
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--stroke) 52%, transparent);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 58%, transparent);
}
.capture-metrics-chart canvas{
  display:block;
  width:100%;
  height:250px;
  touch-action:none;
}
.capture-metrics-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  color:var(--muted2);
  font-size:13px;
  text-align:center;
  pointer-events:none;
}
.capture-metrics-empty[hidden]{display:none;}
.capture-metrics-tooltip{
  position:absolute;
  z-index:3;
  top:8px;
  max-width:calc(100% - 16px);
  padding:7px 10px;
  border:1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  border-radius:6px;
  background:color-mix(in srgb, var(--panel) 94%, var(--bg));
  box-shadow:0 8px 24px rgba(0,0,0,.16);
  color:var(--text);
  font-family:var(--mono);
  font-size:11px;
  line-height:1.45;
  white-space:nowrap;
  pointer-events:none;
}
.capture-metrics-tooltip[hidden]{display:none;}
.capture-metrics-legend{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:16px;
  min-height:24px;
  padding:7px 2px 0;
  color:var(--muted2);
  font-family:var(--mono);
  font-size:11px;
}
.capture-metrics-legend > span{
  display:inline-flex;
  align-items:center;
  gap:7px;
}
.capture-line{
  display:inline-block;
  width:22px;
  height:3px;
  border-radius:2px;
}
.capture-line-fps{background:#06a7c7;}
.capture-line-dma{background:#ef4444;}
.capture-line-wait{background:#f59e0b;}
.capture-line-copy{background:#16b981;}
.capture-axis-note{
  padding-left:14px;
  border-left:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
}

.plate-confidence-card{
  min-width:0;
  padding-bottom:14px;
}
#page-dashboard .plate-confidence-card .card-title{
  font-size:calc(var(--main-font-size) + 2px);
  font-weight:760;
}
.confidence-card-head{
  align-items:center;
  flex-wrap:wrap;
}
#page-dashboard .confidence-summary{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px 0;
  margin-left:auto;
  color:var(--muted2);
  font-size:calc(var(--main-font-size) + 1px);
}
.confidence-stat{
  display:flex;
  align-items:baseline;
  gap:7px;
  min-width:112px;
  padding:0 14px;
  border-left:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  white-space:nowrap;
}
.confidence-stat:first-child{min-width:96px;}
.confidence-stat-series{
  gap:12px;
  min-width:0;
}
#page-dashboard .confidence-stat-name{
  font-size:calc(var(--main-font-size) + 1px);
  font-weight:700;
}
.confidence-stat-metric{
  display:inline-flex;
  align-items:baseline;
  gap:5px;
  white-space:nowrap;
}
#page-dashboard .confidence-stat-metric em{
  color:var(--muted2);
  font-style:normal;
  font-size:var(--main-font-size);
}
#page-dashboard .confidence-stat strong{
  color:var(--text);
  font-family:var(--mono);
  font-size:calc(var(--main-font-size) + 2px);
  font-weight:800;
}
#page-dashboard .confidence-stat-det strong{color:#3b82f6;}
#page-dashboard .confidence-stat-ocr strong{color:#16b981;}
.plate-confidence-chart{
  position:relative;
  width:100%;
  min-height:280px;
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--stroke) 52%, transparent);
  border-radius:8px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 82%, transparent), color-mix(in srgb, var(--surface2) 58%, transparent));
}
.plate-confidence-chart canvas{
  display:block;
  width:100%;
  height:280px;
  touch-action:none;
}
.plate-confidence-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  color:var(--muted2);
  font-size:13px;
  text-align:center;
  pointer-events:none;
}
.plate-confidence-empty[hidden]{display:none;}
#page-dashboard .plate-confidence-tooltip{
  position:absolute;
  z-index:3;
  top:8px;
  max-width:calc(100% - 16px);
  padding:7px 10px;
  border:1px solid color-mix(in srgb, var(--stroke) 82%, transparent);
  border-radius:6px;
  background:color-mix(in srgb, var(--panel) 94%, var(--bg));
  box-shadow:0 8px 24px rgba(0,0,0,.16);
  color:var(--text);
  font-family:var(--mono);
  font-size:calc(var(--main-font-size) - 1px);
  line-height:1.45;
  white-space:nowrap;
  pointer-events:none;
}
.plate-confidence-tooltip[hidden]{display:none;}
#page-dashboard .plate-confidence-legend{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:18px;
  min-height:24px;
  padding:8px 2px 0;
  color:var(--muted2);
  font-size:var(--main-font-size);
  font-family:var(--mono);
}
.plate-confidence-legend > span{
  display:inline-flex;
  align-items:center;
  gap:7px;
}
.confidence-line{
  width:22px;
  height:3px;
  border-radius:2px;
  display:inline-block;
}
.confidence-line-det{background:#3b82f6;}
.confidence-line-ocr{background:#16b981;}
.confidence-line-average{
  height:0;
  border-top:2px dashed color-mix(in srgb, var(--text) 54%, transparent);
  background:transparent;
}
.confidence-extrema-dot{
  width:10px;
  height:10px;
  display:inline-block;
  border:2px solid color-mix(in srgb, var(--text) 64%, transparent);
  border-radius:50%;
  background:var(--surface);
}
.confidence-axis-note{
  padding-left:16px;
  border-left:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
}

.preview{
  position:relative;
  width:100%;
  height:340px;
  border-radius:10px;
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent2) 8%, transparent)),
    radial-gradient(600px 320px at 30% 30%, color-mix(in srgb, var(--accent2) 12%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg) 80%, transparent), color-mix(in srgb, var(--bg) 55%, transparent));
}
.preview img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  opacity:.92;
}
.preview:after{
  content:"";
  position:absolute;
  inset:0;
  background:
    repeating-linear-gradient(180deg, color-mix(in srgb, var(--accent2) 10%, transparent) 0, color-mix(in srgb, var(--accent2) 10%, transparent) 1px, transparent 1px, transparent 6px),
    radial-gradient(800px 420px at 50% 20%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
  mix-blend-mode:screen;
  opacity:.35;
  pointer-events:none;
}
.preview-overlay{
  position:absolute;
  left:12px;
  bottom:12px;
  right:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  pointer-events:none;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  color:var(--muted);
  font-size:12px;
  backdrop-filter:blur(10px);
}

.row{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:14px; flex-wrap:wrap;}
.row-right{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}

.seg{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.seg-sm .seg-btn{padding:9px 12px;}
.seg-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:var(--surface2);
  color:var(--muted);
  cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.seg-btn:hover{color:var(--text); border-color:rgba(90,166,255,.24);}
.seg-btn.active{
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 20%, var(--surface)), color-mix(in srgb, var(--accent2) 12%, var(--surface2)));
  border-color:color-mix(in srgb, var(--accent2) 32%, transparent);
  color:var(--text);
  box-shadow:0 8px 20px color-mix(in srgb, var(--accent) 10%, transparent);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 88%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 100%, transparent), color-mix(in srgb, var(--surface2) 86%, transparent));
  color:var(--text);
  cursor:pointer;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  box-shadow:0 8px 20px rgba(0,0,0,.04);
  transition:transform .12s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover{transform:translateY(-1px); border-color:color-mix(in srgb, var(--accent) 28%, var(--stroke)); box-shadow:0 12px 24px color-mix(in srgb, var(--accent) 8%, transparent);}
.btn:focus{outline:none; box-shadow:var(--ring);}
.btn:disabled{
  cursor:not-allowed;
  opacity:.62;
  transform:none;
  box-shadow:none;
}
.btn.primary{
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #fff), color-mix(in srgb, var(--accent2) 58%, var(--accent)));
  border-color:color-mix(in srgb, var(--accent2) 32%, transparent);
  color:#fff;
}
.btn.danger{
  background:linear-gradient(135deg, color-mix(in srgb, var(--danger) 92%, #fff), color-mix(in srgb, var(--danger) 62%, var(--accent)));
  border-color:color-mix(in srgb, var(--danger) 32%, transparent);
  color:#fff;
}
.btn.ghost{background:color-mix(in srgb, var(--surface) 74%, transparent); box-shadow:none;}
.btn.ghost.danger{
  background:color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color:color-mix(in srgb, var(--danger) 42%, var(--stroke));
  color:color-mix(in srgb, var(--danger) 86%, var(--text));
}
.btn.ghost.danger:hover{
  border-color:color-mix(in srgb, var(--danger) 58%, var(--stroke));
  box-shadow:0 12px 24px color-mix(in srgb, var(--danger) 10%, transparent);
}

.controls{display:flex; align-items:center; gap:10px; row-gap:10px; flex-wrap:wrap;}
.filters{display:flex; align-items:center; gap:10px; row-gap:10px; flex-wrap:wrap; margin-bottom:12px;}
.input,.select{
  height:40px;
  padding:0 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
  background:color-mix(in srgb, var(--surface) 98%, transparent);
  color:var(--text);
  min-width:220px;
  box-shadow:inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
}
.textarea{
  width:100%;
  min-width:0;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 90%, transparent);
  background:color-mix(in srgb, var(--surface) 98%, transparent);
  color:var(--text);
  resize:vertical;
  font-family:var(--sans);
  line-height:1.5;
}
.textarea::placeholder{color:color-mix(in srgb, var(--text) 35%, transparent);}
.textarea:focus{outline:none; box-shadow:var(--ring);}
.template-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}
.template-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.template-field > span{
  font-size:12px;
  color:color-mix(in srgb, var(--text) 62%, transparent);
  font-family:var(--mono);
}
.template-textarea{
  min-height:88px;
}
.ops-question{
  min-height:180px;
}
.audio{
  width:100%;
  margin-top:10px;
  border-radius:10px;
}
.tts-composer{
  position:relative;
  display:flex;
  align-items:flex-end;
  margin-top:12px;
}
.tts-textarea{
  min-height:104px;
  padding:12px 58px 12px 12px;
}
.tts-play-btn{
  position:absolute;
  right:12px;
  bottom:12px;
  width:36px;
  height:36px;
  min-width:36px;
  padding:0;
  border-radius:999px;
  box-shadow:0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}
.tts-play-btn:hover{
  transform:translateY(-1px);
}
.tts-play-btn.is-playing{
  background:linear-gradient(135deg, color-mix(in srgb, var(--danger) 94%, #fff), color-mix(in srgb, var(--danger) 66%, var(--accent)));
  border-color:color-mix(in srgb, var(--danger) 36%, transparent);
  color:#fff;
  box-shadow:0 10px 24px color-mix(in srgb, var(--danger) 22%, transparent);
}
.tts-play-icon{
  font-size:15px;
  font-weight:900;
  line-height:1;
  transform:translateX(1px);
}
.tts-play-btn.is-playing .tts-play-icon{
  font-size:13px;
  transform:none;
}
.voice-shell{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.voice-status-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.voice-status-row .muted{
  margin-top:0;
  word-break:break-word;
}
.voice-flow{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
}
.voice-flow span{
  min-width:0;
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background:color-mix(in srgb, var(--surface2) 78%, transparent);
  color:color-mix(in srgb, var(--text) 66%, transparent);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.voice-flow span.active{
  border-color:color-mix(in srgb, var(--accent2) 42%, var(--stroke));
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent2) 12%, var(--surface2)));
  color:var(--text);
  box-shadow:0 10px 24px color-mix(in srgb, var(--accent) 8%, transparent);
}
.voice-flow span.done{
  border-color:color-mix(in srgb, var(--ok) 34%, var(--stroke));
  color:color-mix(in srgb, var(--ok) 76%, var(--text));
}
.voice-grid{
  display:grid;
  grid-template-columns:minmax(260px, .82fr) minmax(320px, 1.18fr);
  gap:12px;
  align-items:stretch;
}
.voice-panel{
  min-width:0;
  padding:14px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface2) 90%, transparent), color-mix(in srgb, var(--surface) 74%, transparent));
}
.voice-orb{
  width:126px;
  height:126px;
  margin:4px auto 16px;
  border-radius:999px;
  position:relative;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent2) 30%, transparent), transparent 34%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--accent) 52%, var(--surface)), color-mix(in srgb, var(--surface2) 84%, transparent) 68%);
  border:1px solid color-mix(in srgb, var(--accent2) 26%, var(--stroke));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12), 0 18px 42px color-mix(in srgb, var(--accent) 12%, transparent);
}
.voice-orb::before,
.voice-orb::after{
  content:"";
  position:absolute;
  inset:18px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--accent2) 22%, transparent);
}
.voice-orb::after{
  inset:34px;
  border-color:color-mix(in srgb, var(--accent) 30%, transparent);
}
.voice-orb span{
  width:16px;
  height:48px;
  border-radius:999px;
  background:linear-gradient(180deg, #fff, color-mix(in srgb, var(--accent2) 68%, #fff));
  box-shadow:
    -22px 14px 0 -3px color-mix(in srgb, var(--accent) 62%, #fff),
    22px 14px 0 -3px color-mix(in srgb, var(--accent2) 58%, #fff);
  opacity:.9;
}
.voice-orb.active{
  animation:voicePulse 1.18s ease-in-out infinite;
  border-color:color-mix(in srgb, var(--ok) 42%, var(--accent2));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 8px color-mix(in srgb, var(--ok) 7%, transparent), 0 18px 48px color-mix(in srgb, var(--ok) 16%, transparent);
}
@keyframes voicePulse{
  0%,100%{transform:scale(1);}
  50%{transform:scale(1.035);}
}
.voice-actions{
  display:flex;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.voice-actions .btn,
.voice-controls .btn{
  min-width:86px;
}
.voice-textarea{
  min-height:142px;
  margin-top:8px;
  resize:vertical;
}
.voice-controls{
  margin-top:12px;
  justify-content:space-between;
}
.voice-tune{
  margin-top:14px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-soft);
}
.voice-tune-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.voice-tune-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.voice-tune-grid .tts-param{
  min-width:0;
}
.voice-answer{
  min-height:168px;
  max-height:360px;
  overflow:auto;
  padding:16px 18px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--accent) 18%, var(--stroke));
  background:var(--ops-answer-bg);
  color:var(--ops-answer-text);
  box-shadow:var(--ops-answer-shadow);
}
.voice-answer:empty::before{
  content:"语音助手回复会显示在这里";
  min-height:132px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--ops-answer-muted);
}
.voice-answer.md-view h1,
.voice-answer.md-view h2,
.voice-answer.md-view h3{
  color:color-mix(in srgb, var(--ops-answer-text) 96%, var(--text));
}
.voice-answer.md-view code{
  color:var(--ops-answer-code-text);
  background:var(--ops-answer-code-bg);
  border-color:var(--ops-answer-border);
}
.input::placeholder{color:color-mix(in srgb, var(--text) 35%, transparent);}
.input:focus,.select:focus{outline:none; box-shadow:var(--ring);}
.select{min-width:260px;}
.select-sm{min-width:auto; width:170px; height:40px;}
.theme{display:flex; align-items:center;}
.select-sm2{min-width:auto; width:140px; height:40px;}
.input-sm{min-width:auto; width:220px;}
.input-sm2{min-width:auto; width:170px;}

.muted{margin-top:10px; font-size:12px; color:var(--muted2); line-height:1.55;}
.mono{font-family:var(--mono); color:color-mix(in srgb, var(--text) 55%, transparent); font-size:12px; margin-top:6px;}
.divider{height:1px; background:color-mix(in srgb, var(--stroke) 55%, transparent); margin:16px 0;}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
}
.kpi{
  padding:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface2) 84%, transparent));
}
.kpi-label{
  font-size:12px;
  color:var(--muted2);
}
.kpi-value{
  margin-top:8px;
  font-size:22px;
  font-weight:780;
  letter-spacing:.4px;
  font-family:var(--mono);
}

.table{
  border:1px solid color-mix(in srgb, var(--stroke) 78%, transparent);
  border-radius:10px;
  overflow:hidden;
  background:color-mix(in srgb, var(--surface) 70%, transparent);
}
.thead,.trow{
  display:grid;
  grid-template-columns:1.3fr .6fr 1fr .8fr .7fr;
  gap:12px;
  padding:12px 14px;
  align-items:center;
  min-width:0;
}
.thead{
  color:color-mix(in srgb, var(--text) 66%, transparent);
  font-size:12px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 55%, transparent);
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
  padding-right:calc(12px + var(--sbw, 0px));
  font-weight:700;
}
.tbody{max-height:260px; overflow:auto; scrollbar-gutter:stable; overscroll-behavior:contain;}
.trow{
  font-size:13px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 44%, transparent);
  color:color-mix(in srgb, var(--text) 88%, transparent);
  background:color-mix(in srgb, var(--surface) 34%, transparent);
}
.trow:hover{background:color-mix(in srgb, var(--accent) 5%, var(--surface));}
.trow:last-child{border-bottom:none;}
.trow > div{min-width:0;}
.tbody::-webkit-scrollbar,.main::-webkit-scrollbar,.log::-webkit-scrollbar,.list::-webkit-scrollbar{width:10px; height:10px;}
.tbody::-webkit-scrollbar-thumb,.main::-webkit-scrollbar-thumb,.log::-webkit-scrollbar-thumb,.list::-webkit-scrollbar-thumb{
  border:2px solid transparent;
  border-radius:999px;
  background:color-mix(in srgb, var(--text) 24%, transparent);
  background-clip:padding-box;
}
.tbody::-webkit-scrollbar-track,.main::-webkit-scrollbar-track,.log::-webkit-scrollbar-track,.list::-webkit-scrollbar-track{
  background:transparent;
}

.thead-accounts,.trow-accounts{
  grid-template-columns:1.2fr .8fr .8fr .7fr 1.1fr;
}
.thead-accounts > div:nth-child(2),
.thead-accounts > div:nth-child(3),
.trow-accounts > div:nth-child(2),
.trow-accounts > div:nth-child(3){
  text-align:right;
}
.thead-accounts > div:nth-child(4),
.trow-accounts > div:nth-child(4){
  text-align:center;
}
.thead-records,.trow-records{
  grid-template-columns:minmax(168px, 1.15fr) minmax(116px, .75fr) minmax(108px, .68fr) minmax(92px, .62fr) minmax(92px, .62fr) minmax(92px, .62fr) minmax(210px, 1.18fr);
  min-width:1040px;
}
.thead-blacklist,.trow-blacklist{
  grid-template-columns:minmax(132px, 1fr) minmax(116px, .9fr) minmax(220px, 1.45fr) minmax(82px, .55fr) minmax(150px, 1.05fr) minmax(150px, 1.05fr) minmax(150px, .9fr);
  min-width:1130px;
}
.thead-blacklist-events,.trow-blacklist-events{
  grid-template-columns:minmax(168px, 1.05fr) minmax(96px, .58fr) minmax(132px, .82fr) minmax(132px, .82fr) minmax(280px, 1.55fr);
  min-width:900px;
}
.thead-records > div:nth-child(4),
.thead-records > div:nth-child(5),
.thead-records > div:nth-child(6),
.trow-records > div:nth-child(4),
.trow-records > div:nth-child(5),
.trow-records > div:nth-child(6){
  text-align:right;
}
.thead-records > div:nth-child(7),
.trow-records > div:nth-child(7),
.thead-blacklist > div:nth-child(4),
.trow-blacklist > div:nth-child(4),
.thead-blacklist-events > div:nth-child(2),
.trow-blacklist-events > div:nth-child(2){
  text-align:center;
}
.trow-records,
.trow-blacklist,
.trow-blacklist-events{
  min-height:52px;
}
.blacklist-editor{
  margin:10px 0 12px;
  padding:10px 12px;
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 52%, transparent);
}
.blacklist-editor-title{
  margin-bottom:8px;
  color:color-mix(in srgb, var(--text) 76%, transparent);
  font-size:12px;
  font-weight:750;
}
.blacklist-editor-controls{
  align-items:stretch;
  gap:8px;
}
.blacklist-editor-controls .input,
.blacklist-editor-controls .select{
  min-width:140px;
  flex:1 1 150px;
}
.blacklist-editor-controls .btn{
  flex:0 0 auto;
}
.blacklist-editor-hint{
  margin-top:7px;
  font-size:11px;
}
.blacklist-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:6px;
  flex-wrap:wrap;
}
.blacklist-action-cell,
.capture-action-cell{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
}
.capture-delete-btn{
  padding:6px 9px;
}
.danger-text{
  color:color-mix(in srgb, var(--danger) 84%, var(--text));
}
.table .empty-row{
  color:color-mix(in srgb, var(--text) 45%, transparent);
  text-align:left;
  white-space:normal;
}
.thead-plates,.trow-plates{
  grid-template-columns:.9fr 1.3fr .6fr 1fr .8fr .7fr;
}
.thead-platecap,.trow-platecap{
  grid-template-columns:112px minmax(155px,1.05fr) minmax(150px,1fr) minmax(150px,1fr) minmax(90px,.65fr) minmax(165px,1fr) minmax(90px,.55fr);
  min-width:1030px;
}
.trow-platecap{
  min-height:78px;
}
.plate-cell-main{
  color:color-mix(in srgb, var(--text) 92%, transparent);
  font-weight:700;
  line-height:1.35;
}
.plate-cell-sub{
  margin-top:4px;
  color:color-mix(in srgb, var(--text) 54%, transparent);
  font-size:11px;
  line-height:1.35;
}
.plate-source-tags{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.plate-source-path{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.plate-number{
  color:color-mix(in srgb, var(--text) 96%, transparent);
  font-size:14px;
  font-weight:800;
}
.thead-violationcap,.trow-violationcap{
  grid-template-columns:120px 180px 110px minmax(420px, 1fr);
}
.trow-violationcap > div:last-child{
  min-width:0;
}
.trow-violationcap > div:last-child span:first-child{
  min-width:0;
  line-height:1.45;
}
.trow-violationcap > div:last-child span:last-child{
  flex:0 0 auto;
}
.trow-violationcap .btn{
  min-width:66px;
  padding:6px 10px !important;
  border-radius:8px !important;
  white-space:nowrap;
}
.btn.is-loading{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  opacity:.78;
}
.btn-spinner{
  width:14px;
  height:14px;
  border-radius:999px;
  border:2px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-top-color:color-mix(in srgb, var(--accent) 86%, var(--text));
  display:inline-block;
  animation:spin .75s linear infinite;
}
@keyframes spin{
  to{transform:rotate(360deg);}
}
.plate-thumb{
  width:96px;
  height:36px;
  object-fit:contain;
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  background:color-mix(in srgb, var(--surface) 92%, transparent);
}
.plate-gallery{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:10px;
  max-height:360px;
  overflow:auto;
}
.plate-card{
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.plate-img{
  width:100%;
  height:92px;
  object-fit:contain;
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  background:color-mix(in srgb, var(--surface) 92%, transparent);
}
.plate-meta{display:flex; align-items:center; justify-content:space-between; gap:8px;}
.plate-plate{font-family:var(--mono); font-weight:700; letter-spacing:.6px;}
.plate-time{font-size:12px; color:var(--muted2);}
.cell-right{text-align:right;}
.cell-center{text-align:center;}
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 75%, transparent);
  background:color-mix(in srgb, var(--accent) 10%, transparent);
  font-size:12px;
  font-family:var(--mono);
  color:color-mix(in srgb, var(--text) 78%, transparent);
  line-height:1.25;
  white-space:nowrap;
  vertical-align:middle;
}
.badge.danger{
  border-color:color-mix(in srgb, var(--danger) 40%, transparent);
  background:color-mix(in srgb, var(--danger) 10%, transparent);
}
.badge.ok{
  border-color:color-mix(in srgb, var(--ok) 42%, transparent);
  background:color-mix(in srgb, var(--ok) 12%, transparent);
}
.biz-result-badge{
  max-width:100%;
  min-width:54px;
  white-space:nowrap;
  text-align:center;
  word-break:keep-all;
  overflow:hidden;
  text-overflow:ellipsis;
}
.biz-hit-badge{
  min-width:32px;
  padding-inline:9px;
}
.biz-table-text{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.test-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.test-item{
  padding:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  background:color-mix(in srgb, var(--surface2) 88%, transparent);
}
.test-item.span-2{grid-column:1 / span 2;}
.test-k{font-size:12px; color:var(--muted2); margin-bottom:8px;}
.test-v{font-size:13px; color:color-mix(in srgb, var(--text) 82%, transparent); line-height:1.45; word-break:break-all;}
.esp32-card-note{
  margin:-6px 0 12px;
}
.esp32-card-actions{
  margin-bottom:14px;
}
.esp32-summary-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-bottom:12px;
}
.esp32-summary-item{
  min-width:0;
  padding:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  background:color-mix(in srgb, var(--surface2) 84%, transparent);
}
.esp32-summary-k{
  font-size:12px;
  color:var(--muted2);
  margin-bottom:8px;
}
.esp32-summary-v{
  font-size:13px;
  color:color-mix(in srgb, var(--text) 84%, transparent);
  line-height:1.45;
  word-break:break-all;
}
.esp32-status-grid{
  margin-top:8px;
}
.esp32-config-title{
  margin-top:14px;
  margin-bottom:10px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.5px;
  color:color-mix(in srgb, var(--text) 72%, transparent);
  text-transform:uppercase;
}
.esp32-param-grid{
  margin-top:0;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
  align-items:stretch;
}
.esp32-param{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  background:color-mix(in srgb, var(--surface2) 82%, transparent);
}
.esp32-param > span:first-child{
  color:color-mix(in srgb, var(--text) 82%, transparent);
  font-size:13px;
  font-weight:700;
  line-height:1.2;
}
.esp32-param small{
  color:var(--muted2);
  font-size:12px;
  line-height:1.45;
}
.esp32-param .input-sm2{
  width:100%;
  min-width:0;
}
.esp32-param-action{
  justify-content:space-between;
}
.esp32-param-action .btn{
  width:max-content;
  min-width:96px;
}
.esp32-checkline{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  color:var(--text);
  font-size:13px;
  flex-wrap:wrap;
}
.esp32-param-check{
  justify-content:flex-start;
}
.esp32-param-check .esp32-checkline{
  min-height:38px;
}
.esp32-param-check input[type="checkbox"]{
  width:16px;
  height:16px;
}
@media (max-width:1060px){
  .esp32-summary-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
  .voice-grid{grid-template-columns:1fr;}
}
@media (max-width:720px){
  .esp32-summary-grid{grid-template-columns:1fr;}
  .esp32-card-actions{flex-wrap:wrap;}
  .voice-flow{grid-template-columns:1fr 1fr;}
  .voice-panel{padding:12px;}
  .voice-orb{width:110px; height:110px;}
  .voice-actions,
  .voice-controls{align-items:stretch;}
  .voice-tune-head{align-items:flex-start; flex-direction:column;}
  .voice-tune-grid{grid-template-columns:1fr;}
  .voice-actions .btn,
  .voice-controls .btn{width:100%;}
  .voice-answer{max-height:none;}
}
.tts-param-grid{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-start;
}
.tts-param{
  min-width:0;
  flex:1 1 220px;
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 66%, transparent);
  background:color-mix(in srgb, var(--surface2) 82%, transparent);
}
.tts-param-grid > .tts-param-check{
  flex:0 1 230px;
}
.tts-param-grid > .tts-param:nth-child(2){
  flex:0 0 150px;
}
.tts-param > span:first-child{
  color:color-mix(in srgb, var(--text) 82%, transparent);
  font-size:12px;
  font-weight:700;
}
.tts-param small{
  color:var(--muted2);
  font-size:12px;
  line-height:1.45;
}
.tts-param .input-sm2{
  width:92px;
  min-width:92px;
}
.tts-checkline{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:38px;
  color:var(--text);
  font-size:13px;
}
.tts-range-line{
  min-height:38px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 48px;
  align-items:center;
  gap:10px;
}
.tts-range-line .mono{
  margin-top:0;
  text-align:right;
}
@media (max-width:720px){
  .tts-param-grid > .tts-param,
  .tts-param-grid > .tts-param-check,
  .tts-param-grid > .tts-param:nth-child(2){
    flex:1 1 100%;
  }
  .tts-param .input-sm2{
    width:100%;
    min-width:0;
  }
}
.pill2{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  justify-content:center;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:color-mix(in srgb, var(--accent) 10%, transparent);
  color:color-mix(in srgb, var(--text) 78%, transparent);
  font-size:12px;
  font-family:var(--mono);
}

.two-col{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.two-col.single{grid-template-columns:1fr;}
.card-lite{
  padding:14px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 68%, transparent);
  background:color-mix(in srgb, var(--surface) 76%, transparent);
}
.lite-title{font-size:12px; color:color-mix(in srgb, var(--text) 75%, transparent); letter-spacing:.5px; margin-bottom:8px;}

.eval-page{min-width:0;}
.eval-head,
.eval-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.eval-head .card-title{margin-bottom:5px;}
.eval-title{font-size:18px; font-weight:800; color:var(--text);}
.eval-section{
  padding-top:20px;
  margin-top:20px;
  border-top:1px solid color-mix(in srgb, var(--stroke) 58%, transparent);
}
.eval-section:first-of-type{margin-top:16px;}
.eval-section-title{font-size:14px; font-weight:780; color:var(--text);}
.eval-input-grid{
  display:grid;
  grid-template-columns:minmax(380px, 1.5fr) repeat(3, minmax(150px, .55fr));
  gap:12px;
  align-items:stretch;
  margin-top:14px;
}
.eval-folder-file{min-width:0;}
.eval-folder-file input[type="file"]{width:250px; min-width:250px; flex-basis:250px;}
.eval-field{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:11px 12px;
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface2) 76%, transparent);
}
.eval-field > span{font-size:12px; color:var(--muted2);}
.eval-field .input,
.eval-field .select{width:100%; min-width:0;}
.eval-actions{margin-top:14px;}
.eval-progress-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:16px;
  font-size:12px;
  color:var(--muted);
}
.eval-progress{
  height:8px;
  margin-top:7px;
  overflow:hidden;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background:color-mix(in srgb, var(--surface2) 90%, transparent);
}
.eval-progress-fill{
  width:0%;
  height:100%;
  background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 88%, #fff), color-mix(in srgb, var(--accent2) 84%, #fff));
  transition:width .18s ease;
}
.eval-metrics{
  display:grid;
  grid-template-columns:repeat(5, minmax(0, 1fr));
  margin-top:14px;
  border:1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
  border-radius:8px;
  overflow:hidden;
}
.eval-metric{
  min-width:0;
  min-height:66px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:7px;
  padding:10px 14px;
  background:color-mix(in srgb, var(--surface2) 66%, transparent);
  border-right:1px solid color-mix(in srgb, var(--stroke) 52%, transparent);
}
.eval-metric:last-child{border-right:none;}
.eval-metric span{
  font-size:12px;
  color:var(--muted2);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.eval-metric strong{
  font-size:18px;
  color:var(--text);
  font-family:var(--mono);
  letter-spacing:0;
}
.eval-compare-files{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
.eval-column-hint{margin-top:12px; white-space:normal; overflow-wrap:anywhere;}
.eval-compare-metrics{grid-template-columns:repeat(6, minmax(0, 1fr));}
.eval-table-wrap{
  margin-top:14px;
  max-width:100%;
  max-height:430px;
  overflow:auto;
  border:1px solid color-mix(in srgb, var(--stroke) 62%, transparent);
  border-radius:8px;
  background:color-mix(in srgb, var(--surface) 52%, transparent);
  scrollbar-gutter:stable;
}
.eval-table{
  width:100%;
  min-width:1220px;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  font-size:12px;
}
.eval-compare-table{min-width:1180px;}
.eval-table th,
.eval-table td{
  padding:10px 12px;
  text-align:left;
  vertical-align:middle;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 42%, transparent);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.eval-table th{
  position:sticky;
  top:0;
  z-index:2;
  color:color-mix(in srgb, var(--text) 68%, transparent);
  background:color-mix(in srgb, var(--surface2) 96%, var(--bg));
  font-weight:730;
}
.eval-table tbody tr:last-child td{border-bottom:none;}
.eval-table tbody tr:hover td{background:color-mix(in srgb, var(--accent) 5%, var(--surface));}
.eval-table th:first-child,
.eval-table td:first-child{width:52px; text-align:center;}
.eval-table th:nth-child(2),
.eval-table td:nth-child(2){width:230px;}
.eval-table th:nth-child(3),
.eval-table td:nth-child(3){width:92px; text-align:center;}
.eval-table th:nth-child(4),
.eval-table td:nth-child(4){width:130px;}
.eval-table th:nth-child(5),
.eval-table td:nth-child(5){width:125px;}
.eval-table th:nth-child(6),
.eval-table td:nth-child(6){width:105px;}
.eval-table th:nth-child(7),
.eval-table td:nth-child(7),
.eval-table th:nth-child(8),
.eval-table td:nth-child(8){width:112px; text-align:right;}
.eval-table th:nth-child(9),
.eval-table td:nth-child(9){width:88px; text-align:right;}
.eval-empty{height:70px; text-align:center !important; color:var(--muted2);}
.eval-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:58px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:color-mix(in srgb, var(--surface2) 84%, transparent);
  color:var(--muted);
  white-space:nowrap;
}
.eval-status.ok{
  color:color-mix(in srgb, var(--ok) 78%, var(--text));
  border-color:color-mix(in srgb, var(--ok) 40%, transparent);
  background:color-mix(in srgb, var(--ok) 10%, transparent);
}
.eval-status.danger{
  color:color-mix(in srgb, var(--danger) 78%, var(--text));
  border-color:color-mix(in srgb, var(--danger) 40%, transparent);
  background:color-mix(in srgb, var(--danger) 10%, transparent);
}
.eval-status.warn{
  color:color-mix(in srgb, var(--warn) 80%, var(--text));
  border-color:color-mix(in srgb, var(--warn) 42%, transparent);
  background:color-mix(in srgb, var(--warn) 10%, transparent);
}
.eval-compare-table th:first-child,
.eval-compare-table td:first-child{width:220px; text-align:left;}
.eval-compare-table th:nth-child(2),
.eval-compare-table td:nth-child(2){width:84px; text-align:center;}
.eval-compare-table th:nth-child(9),
.eval-compare-table td:nth-child(9){width:126px; text-align:center;}

.log{
  height:360px;
  overflow:auto;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:color-mix(in srgb, var(--surface) 78%, transparent);
  padding:12px;
  font-family:var(--mono);
  font-size:12px;
  color:color-mix(in srgb, var(--text) 82%, transparent);
  line-height:1.55;
  white-space:pre-wrap;
}

.ops-layout{
  display:grid;
  grid-template-columns:280px minmax(0, 1fr);
  gap:18px;
  align-items:start;
}
.ops-history{
  min-height:calc(100vh - 176px);
  display:flex;
  flex-direction:column;
  gap:12px;
}
.ops-history-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  overflow:auto;
  min-height:0;
  padding-right:2px;
}
.ops-history-empty{
  padding:14px 12px;
  border-radius:10px;
  border:1px dashed color-mix(in srgb, var(--stroke) 68%, transparent);
  color:var(--muted2);
  font-size:12px;
  background:color-mix(in srgb, var(--surface2) 70%, transparent);
}
.ops-history-item{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  width:100%;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background:color-mix(in srgb, var(--surface) 94%, transparent);
  color:var(--text);
  border-radius:10px;
  padding:12px 12px;
  cursor:pointer;
  text-align:left;
}
.ops-history-item:hover{
  border-color:color-mix(in srgb, var(--accent) 28%, var(--stroke));
  background:color-mix(in srgb, var(--accent) 5%, var(--surface));
}
.ops-history-item.active{
  border-color:color-mix(in srgb, var(--accent) 38%, var(--stroke));
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent2) 8%, var(--surface2)));
}
.ops-history-title{
  font-size:13px;
  font-weight:700;
  line-height:1.45;
}
.ops-history-meta{
  font-size:12px;
  color:var(--muted2);
}
.ops-main{
  min-width:0;
}
.ops-chat{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.ops-overview{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}
.ops-overview-item{
  min-width:0;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 70%, transparent);
  background:color-mix(in srgb, var(--surface2) 78%, transparent);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.ops-overview-item span{
  font-size:12px;
  color:var(--muted2);
}
.ops-overview-item strong{
  min-width:0;
  color:var(--text);
  font-size:12px;
  font-weight:800;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ops-overview-item.ok strong{color:color-mix(in srgb, var(--ok) 82%, var(--text));}
.ops-overview-item.warn strong{color:color-mix(in srgb, var(--warn) 86%, var(--text));}
.ops-overview-item.danger strong{color:color-mix(in srgb, var(--danger) 86%, var(--text));}
.ops-quickbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.ops-chip{
  min-height:32px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:color-mix(in srgb, var(--surface) 86%, transparent);
  color:color-mix(in srgb, var(--text) 76%, transparent);
  cursor:pointer;
  font-size:12px;
  font-weight:650;
}
.ops-chip:hover{
  border-color:color-mix(in srgb, var(--accent) 30%, var(--stroke));
  background:color-mix(in srgb, var(--accent) 8%, var(--surface));
  color:var(--text);
}
.ops-thread{
  min-height:360px;
  display:flex;
}
.ops-answer{
  flex:1 1 auto;
  min-height:360px;
  height:calc(100vh - 530px);
  background:var(--ops-answer-bg);
  color:var(--ops-answer-text);
  border-color:var(--ops-answer-border);
  box-shadow:var(--ops-answer-shadow);
  padding:22px 26px;
  font-size:14px;
  line-height:1.75;
}
.ops-answer:empty::before{
  content:"这里会显示运维问答、摘要和报告结果";
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:320px;
  color:var(--ops-answer-muted);
  font-size:14px;
  white-space:normal;
  text-align:center;
}
.ops-answer.md-view{
  color:var(--ops-answer-text);
}
.ops-answer.md-view h1,
.ops-answer.md-view h2,
.ops-answer.md-view h3{
  color:color-mix(in srgb, var(--ops-answer-text) 96%, var(--text));
  border-bottom:1px solid var(--ops-answer-border);
  padding-bottom:8px;
}
.ops-answer.md-view p{
  margin:12px 0;
}
.ops-answer.md-view ul,
.ops-answer.md-view ol{
  margin:12px 0 12px 24px;
}
.ops-answer.md-view strong{
  color:color-mix(in srgb, var(--ops-answer-text) 96%, var(--text));
  font-weight:800;
}
.ops-answer.md-view code{
  color:var(--ops-answer-code-text);
  background:var(--ops-answer-code-bg);
  border-color:var(--ops-answer-border);
}
.ops-answer.md-view pre{
  color:var(--ops-answer-text);
  background:var(--ops-answer-pre-bg);
  border-color:var(--ops-answer-border);
}
.ops-answer.md-view blockquote{
  margin:12px 0;
  padding:8px 14px;
  border-left:4px solid color-mix(in srgb, var(--accent) 55%, var(--stroke));
  color:color-mix(in srgb, var(--ops-answer-text) 78%, transparent);
  background:var(--ops-answer-quote-bg);
}
.ops-answer.md-view .md-table-wrap{
  border-color:var(--ops-answer-border);
  background:var(--ops-answer-table-bg);
}
.ops-answer.md-view th{
  color:color-mix(in srgb, var(--ops-answer-text) 96%, var(--text));
  background:var(--ops-answer-th-bg);
}
.ops-answer.md-view td{
  border-color:color-mix(in srgb, var(--ops-answer-border) 88%, transparent);
}
.ops-composer{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.ops-input-shell{
  position:relative;
  display:flex;
  align-items:flex-end;
}
.ops-question{
  min-height:118px;
  padding:14px 58px 14px 16px;
  border-radius:18px;
  line-height:1.55;
}
.ops-actions{
  justify-content:flex-end;
}
.ops-send-btn{
  position:absolute;
  right:12px;
  bottom:12px;
  width:36px;
  height:36px;
  min-width:36px;
  padding:0;
  border-radius:999px;
  box-shadow:0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ops-send-btn:hover{
  transform:translateY(-1px);
}
.ops-send-btn.is-running{
  background:linear-gradient(135deg, color-mix(in srgb, var(--text) 84%, var(--surface)), color-mix(in srgb, var(--text) 58%, var(--surface2)));
  border-color:color-mix(in srgb, var(--text) 18%, transparent);
  color:var(--surface);
}
.ops-send-icon{
  font-size:20px;
  font-weight:900;
  line-height:1;
  transform:translateY(-1px);
}
.ops-send-btn.is-running .ops-send-icon{
  font-size:13px;
  transform:none;
}

#page-settings{
  width:min(980px, 100%);
  margin:0 auto 36px;
}
#page-settings .page-title{
  margin:8px 0 16px;
}
.settings-layout{
  display:flex;
  flex-direction:column;
  gap:16px;
  align-items:stretch;
}
.settings-card{
  min-width:0;
  padding:0;
  border-radius:10px;
}
.settings-card:before{
  background:linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent2) 10%, transparent), transparent 62%);
}
.settings-card-title{
  margin:0;
  padding:18px 20px 0;
  font-size:14px;
  color:color-mix(in srgb, var(--text) 76%, transparent);
}
.settings-form{
  display:flex;
  flex-direction:column;
  gap:0;
  padding:8px 20px 18px;
}
.settings-row{
  display:grid;
  grid-template-columns:150px minmax(0, 1fr);
  gap:16px;
  align-items:center;
  min-height:52px;
  padding:7px 0;
  border-top:1px solid color-mix(in srgb, var(--stroke) 42%, transparent);
}
.settings-form .settings-row:first-child{
  border-top:0;
}
.settings-label{
  color:color-mix(in srgb, var(--text) 72%, transparent);
  font-size:13px;
  font-weight:700;
  line-height:1.4;
}
.settings-control{
  min-width:0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
.settings-control .input,
.settings-control .select{
  min-width:0;
  width:auto;
  flex:1 1 260px;
}
.settings-control .select{
  max-width:360px;
}
.settings-control-wide .input,
.settings-control-wide .select{
  flex-basis:420px;
  max-width:none;
}
.settings-actions{
  align-items:center;
}
.settings-actions .btn{
  min-width:86px;
}
.settings-note{
  margin:0;
  padding:0 20px 18px;
}
.settings-card .toggle{
  min-height:40px;
}
.tts-runtime-panel[hidden],
[hidden]{
  display:none !important;
}
.tts-runtime-panel{
  min-width:0;
}
.model-status-box{
  width:100%;
  min-width:0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  padding:10px 12px;
  border:1px solid color-mix(in srgb, var(--stroke) 74%, transparent);
  border-radius:10px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface2) 82%, transparent));
}
.model-status-box .mono{
  min-width:0;
  flex:1 1 260px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.status-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:color-mix(in srgb, var(--muted2) 82%, transparent);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--muted2) 12%, transparent);
  flex:0 0 auto;
}
.status-dot.ok{
  background:var(--ok);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
.status-dot.danger{
  background:var(--danger);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}
.settings-file{
  width:100%;
  min-width:0;
  max-width:none;
}
.settings-file .file-meta{
  min-width:0;
}
.settings-file .file-sub{
  max-width:none;
}
.settings-local-note{
  margin:0;
  padding:4px 0 0 166px;
  font-size:12px;
  line-height:1.6;
}

.md-view{
  font-family:var(--sans);
  white-space:normal;
  color:color-mix(in srgb, var(--text) 86%, transparent);
  line-height:1.65;
}
.md-view > :first-child{margin-top:0;}
.md-view h1,.md-view h2,.md-view h3{
  margin:14px 0 10px 0;
  font-weight:780;
  letter-spacing:.2px;
}
.md-view h1{font-size:20px;}
.md-view h2{font-size:16px;}
.md-view h3{font-size:14px;}
.md-view p{margin:10px 0;}
.md-view ul,.md-view ol{margin:10px 0 10px 20px; padding:0;}
.md-view li{margin:6px 0;}
.md-view code{
  font-family:var(--mono);
  font-size:12px;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--stroke) 65%, transparent);
  background:color-mix(in srgb, var(--surface2) 90%, transparent);
}
.md-view pre{
  margin:12px 0;
  padding:12px;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:color-mix(in srgb, var(--bg) 78%, transparent);
  overflow:auto;
}
.md-view pre code{
  padding:0;
  border:none;
  background:transparent;
  display:block;
  white-space:pre;
}
.md-table-wrap{
  margin:14px 0;
  overflow:auto;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  border-radius:10px;
  background:color-mix(in srgb, var(--surface) 88%, transparent);
}
.md-view table{
  width:100%;
  min-width:620px;
  border-collapse:collapse;
  font-size:13px;
  line-height:1.55;
}
.md-view th,
.md-view td{
  padding:10px 12px;
  border-bottom:1px solid color-mix(in srgb, var(--stroke) 58%, transparent);
  border-right:1px solid color-mix(in srgb, var(--stroke) 42%, transparent);
  vertical-align:top;
}
.md-view th:last-child,
.md-view td:last-child{border-right:none;}
.md-view tbody tr:last-child td{border-bottom:none;}
.md-view th{
  color:var(--text);
  font-weight:760;
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
}
.mermaid-block{
  margin:14px 0;
  padding:16px;
  overflow:hidden;
  max-width:100%;
  border-radius:10px;
  border:1px solid color-mix(in srgb, var(--stroke) 72%, transparent);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface2) 82%, transparent));
}
.mermaid-svg{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  margin:0 auto;
}
.mermaid-node rect{
  fill:color-mix(in srgb, var(--surface) 94%, transparent);
  stroke:color-mix(in srgb, var(--accent) 34%, var(--stroke));
  stroke-width:1.2;
}
.mermaid-node text{
  fill:var(--text);
  font-family:var(--sans);
  font-size:11px;
  font-weight:620;
}
.mermaid-edge{
  fill:none;
  stroke:color-mix(in srgb, var(--accent2) 58%, var(--muted));
  stroke-width:1.6;
}
.mermaid-arrow{
  fill:color-mix(in srgb, var(--accent2) 70%, var(--muted));
}
.mermaid-edge-label{
  font-family:var(--sans);
  pointer-events:none;
}
.mermaid-edge-label rect{
  fill:color-mix(in srgb, var(--surface) 92%, transparent);
  stroke:color-mix(in srgb, var(--stroke) 65%, transparent);
}
.mermaid-edge-label text{
  fill:var(--muted);
  font-size:10px;
  font-weight:650;
}
.md-view a{
  color:color-mix(in srgb, var(--accent2) 80%, var(--text));
  text-decoration:none;
}
.md-view a:hover{text-decoration:underline;}

.toggle{display:flex; align-items:center; gap:10px; color:color-mix(in srgb, var(--text) 78%, transparent); font-size:13px;}
.toggle input{display:none;}
.toggle-ui{
  width:46px;
  height:26px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--stroke) 85%, transparent);
  background:color-mix(in srgb, var(--surface2) 92%, transparent);
  position:relative;
  transition:background .15s ease, border-color .15s ease;
}
.toggle-ui:after{
  content:"";
  width:20px;
  height:20px;
  border-radius:999px;
  background:color-mix(in srgb, var(--text) 82%, transparent);
  position:absolute;
  top:2px;
  left:2px;
  transition:transform .15s ease, background .15s ease;
  box-shadow:0 10px 24px rgba(0,0,0,.35);
}
.toggle input:checked + .toggle-ui{
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, transparent), color-mix(in srgb, var(--accent2) 18%, transparent));
  border-color:color-mix(in srgb, var(--accent2) 32%, transparent);
}
.toggle input:checked + .toggle-ui:after{
  transform:translateX(20px);
  background:color-mix(in srgb, var(--text) 92%, transparent);
}

.nav-group{display:flex; flex-direction:column;}
.nav-sub{
  display:none;
  padding-left:34px;
  margin-top:4px;
  border-left:none;
}
.nav-group.open .nav-sub{display:flex; flex-direction:column; gap:6px;}
.nav-subitem{
  height:34px;
  border-radius:8px;
  border:1px solid transparent;
  background:transparent;
  color:color-mix(in srgb, var(--text) 78%, transparent);
  font-size:13px;
  text-align:left;
  padding:0 10px;
  cursor:pointer;
}
.nav-subitem:hover{background:color-mix(in srgb, var(--surface2) 92%, transparent);}
.nav-subitem.active{
  border-color:color-mix(in srgb, var(--accent2) 42%, transparent);
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent2) 12%, var(--surface2)));
  color:color-mix(in srgb, var(--text) 92%, transparent);
}
.docs-nav-sub{
  max-height:min(520px, calc(100vh - 250px));
  overflow:auto;
  padding-right:4px;
}
.nav-doc-tree{
  display:flex;
  flex-direction:column;
  gap:4px;
}
.nav-doc-outline{
  display:none;
  flex-direction:column;
  gap:4px;
  padding-left:10px;
}
.nav-doc-tree.open .nav-doc-outline{
  display:flex;
}
.nav-doc-tree.active > .nav-doc-file{
  border-color:color-mix(in srgb, var(--accent2) 42%, transparent);
  background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent2) 12%, var(--surface2)));
  color:color-mix(in srgb, var(--text) 92%, transparent);
}
.nav-doc-file,
.nav-doc-section{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.nav-doc-file span:first-child,
.nav-doc-section span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.nav-doc-section{
  font-weight:650;
}
.nav-doc-section-wrap{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.nav-doc-children{
  display:none;
  flex-direction:column;
  gap:3px;
}
.nav-doc-section-wrap.open .nav-doc-children{
  display:flex;
}
.nav-doc-child{
  height:28px;
  padding-left:20px;
  font-size:12px;
  color:color-mix(in srgb, var(--text) 64%, transparent);
}
.nav-doc-child.active{
  color:color-mix(in srgb, var(--text) 92%, transparent);
}
.nav-mini-caret{
  margin-left:auto;
  opacity:.7;
  transition:transform .15s ease;
}
.nav-doc-tree.open > .nav-doc-file .nav-mini-caret,
.nav-doc-section-wrap.open > .nav-doc-section .nav-mini-caret{
  transform:rotate(180deg);
}
.nav-doc-loading{
  padding:6px 10px;
  color:var(--muted2);
  font-size:12px;
}
.nav-doc-loading.danger{
  color:color-mix(in srgb, var(--danger) 80%, var(--text));
}
.nav-caret{margin-left:auto; opacity:.7;}
.nav-group.open .nav-caret{transform:rotate(180deg);}

.docs-layout{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:16px;
  align-items:start;
}
.docs-nav{
  position:relative;
  padding:14px 12px;
}
.docs-nav-title{
  font-size:13px;
  font-weight:700;
  color:var(--muted2);
  margin-bottom:8px;
}
.docs-nav a{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:8px;
  color:color-mix(in srgb, var(--text) 76%, transparent);
  text-decoration:none;
  border:1px solid transparent;
  line-height:1.4;
}
.docs-nav a:hover{
  background:color-mix(in srgb, var(--surface2) 76%, transparent);
  color:var(--text);
}
.docs-nav a::after{
  content:"›";
  margin-left:auto;
  color:var(--muted2);
  font-size:18px;
  line-height:1;
}
.docs-card{
  min-width:0;
  padding:16px 18px;
}
.docs-view{
  max-width:860px;
}
:root[data-theme="new-brutalism"] .docs-view{
  box-sizing:border-box;
  width:100%;
  max-width:none;
  margin-top:10px;
  padding:16px 18px;
}
.docs-view h1,
.docs-view h2,
.docs-view h3{
  scroll-margin-top:18px;
}

/* User font-size settings must stay at the end of base rules so fixed component
   sizes above cannot override the values selected in Settings. */
.sidebar,
.sidebar .nav,
.sidebar .nav-item,
.sidebar .nav-subitem,
.sidebar .nav-doc-file,
.sidebar .nav-doc-link,
.sidebar .nav-doc-loading{
  font-size:var(--sidebar-font-size);
}

.sidebar .hint,
.sidebar-footer,
.sidebar-footer .hint{
  font-size:calc(var(--sidebar-font-size) - 2px);
}

.main,
.main *,
.main .card,
.main .card-title,
.main .settings-label,
.main .settings-note,
.main .settings-control,
.main .input,
.main .select,
.main .btn,
.main .seg-btn,
.main .toggle,
.main .thead,
.main .trow,
.main .kv,
.main .kv-row,
.main .muted,
.main .mono,
.main .badge,
.main .pill2,
.main .metric-label,
.main .test-k,
.main .test-v,
.main .lite-title,
.main .docs-nav-title,
.main .docs-nav a,
.main .md-view,
.main .ops-answer,
.main .ops-history{
  font-size:var(--main-font-size);
}

.main .page-title{
  font-size:calc(var(--main-font-size) + 5px);
}

.main .settings-card-title,
.main .card-title{
  font-size:calc(var(--main-font-size) + 1px);
}

.main .metric-value,
.main .kpi-value,
.main .comm-status{
  font-size:calc(var(--main-font-size) + 8px);
}

.main .md-view h1{font-size:calc(var(--main-font-size) + 8px);}
.main .md-view h2{font-size:calc(var(--main-font-size) + 5px);}
.main .md-view h3{font-size:calc(var(--main-font-size) + 3px);}
.main .ops-send-icon,
.main .tts-play-icon{
  font-size:inherit;
}

@media (max-width:1060px){
  .app{grid-template-columns:1fr; grid-template-areas:"topbar" "main";}
  .sidebar{display:none;}
  .grid{grid-template-columns:1fr;}
  .dash-grid{grid-template-columns:1fr;}
  .span-2{grid-column:auto;}
  .metrics{grid-template-columns:1fr;}
  .gauge-grid{grid-template-columns:1fr 1fr;}
  .kpi-grid{grid-template-columns:1fr 1fr;}
  .preview{height:280px;}
  .table{overflow:auto;}
  .thead,.trow{min-width:760px; grid-template-columns:1.2fr .6fr 1fr .8fr .7fr;}
  .thead-accounts,.trow-accounts{grid-template-columns:1.2fr .8fr .8fr .7fr 1.1fr;}
  .thead-platecap,.trow-platecap{
    min-width:1030px;
    grid-template-columns:112px minmax(155px,1.05fr) minmax(150px,1fr) minmax(150px,1fr) minmax(90px,.65fr) minmax(165px,1fr) minmax(90px,.55fr);
  }
  .thead-violationcap,.trow-violationcap{min-width:860px;}
  .two-col{grid-template-columns:1fr;}
  .ops-layout{grid-template-columns:1fr;}
  .docs-layout{grid-template-columns:1fr;}
  .docs-nav{position:static;}
  .ops-history{min-height:auto;}
  #aiVisionBlock .filters,
  #aiTtsBlock .filters{grid-template-columns:1fr;}
  .eval-input-grid{grid-template-columns:1fr 1fr;}
  .eval-folder-file{grid-column:1 / span 2;}
  .eval-metrics,
  .eval-compare-metrics{grid-template-columns:repeat(3, minmax(0, 1fr));}
  .eval-metric:nth-child(3n){border-right:none;}
}

@media (max-width:720px){
  .app{grid-template-rows:auto 1fr;}
  .topbar{
    grid-template-columns:1fr;
    grid-template-areas:
      "brand"
      "summary"
      "right";
    align-items:center;
    gap:10px;
    padding:12px 16px;
  }
  .brand{grid-area:brand; justify-self:center;}
  .brand-logo-img{height:60px; max-width:min(260px, 100%);}
  .brand-code{font-size:11px;}
  .topbar-summary{grid-area:summary; padding:7px 14px; font-size:14px;}
  .topbar-right{grid-area:right; width:100%; justify-content:space-between;}
  .main{padding:16px;}
  .brand-title{font-size:16px;}
  .grid{gap:14px;}
  .dash-grid{gap:10px;}
  .card{padding:14px;}
  .capture-metrics-head{align-items:flex-start;}
  .capture-metrics-flags{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
  .capture-metric-strip{grid-template-columns:repeat(2, minmax(145px, 1fr));}
  .capture-metric-item:nth-child(odd){border-left:0;}
  .capture-metric-item:nth-child(n+3){border-top:1px solid color-mix(in srgb, var(--stroke) 46%, transparent);}
  .capture-metrics-legend{justify-content:flex-start;gap:12px;}
  .capture-metrics-tooltip{white-space:normal;}
  .confidence-card-head{align-items:flex-start;}
  .confidence-summary{
    width:100%;
    justify-content:space-between;
    overflow-x:auto;
  }
  .confidence-stat{
    min-width:max-content;
    padding:0 10px;
  }
  .confidence-stat-series{
    width:100%;
    padding:7px 0;
    border-left:0;
    border-top:1px solid color-mix(in srgb, var(--stroke) 60%, transparent);
    justify-content:space-between;
    overflow-x:auto;
  }
  .confidence-stat:first-child{
    min-width:max-content;
    padding-left:0;
    border-left:0;
  }
  .plate-confidence-chart,
  .plate-confidence-chart canvas{min-height:250px;height:250px;}
  .plate-confidence-tooltip{white-space:normal;}
  .plate-confidence-legend{justify-content:flex-start;gap:12px;}
  .trend canvas{height:260px;}
  .gauge-grid,.kpi-grid{grid-template-columns:1fr;}
  .time-donut{grid-template-columns:1fr;}
  .donut-left{width:210px; height:210px; margin:0 auto;}
  #timeDonut{width:210px; height:210px;}
  .template-grid{grid-template-columns:1fr;}
  .input,.select,.input-sm,.input-sm2,.select-sm,.select-sm2{width:100%; min-width:0;}
  .controls,.filters,.row-right{align-items:stretch;}
  .btn{justify-content:center;}
  #aiVisionBlock .file,
  #aiTtsBlock .file{
    min-width:0;
    max-width:none;
    width:100%;
    flex-wrap:wrap;
  }
  #aiVisionBlock .file input[type="file"],
  #aiTtsBlock .file input[type="file"]{
    width:100%;
    min-width:0;
    flex:1 1 100%;
  }
  .eval-head,
  .eval-section-head{align-items:flex-start;}
  .eval-input-grid,
  .eval-compare-files{grid-template-columns:1fr;}
  .eval-folder-file{grid-column:auto;}
  .eval-folder-file input[type="file"],
  .eval-compare-files input[type="file"]{
    width:100%;
    min-width:0;
    flex:1 1 100%;
  }
  .eval-metrics,
  .eval-compare-metrics{grid-template-columns:1fr 1fr;}
  .eval-metric,
  .eval-metric:nth-child(3n){border-right:1px solid color-mix(in srgb, var(--stroke) 52%, transparent);}
  .eval-metric:nth-child(2n){border-right:none;}
  .ops-history,
  .ops-answer{
    min-height:0;
    height:auto;
  }
  .ops-overview{grid-template-columns:1fr;}
  .ops-history-list{
    max-height:260px;
  }
  .ops-answer:empty::before{
    min-height:180px;
  }
  .settings-layout,
  .ops-layout{
    gap:14px;
  }
  #page-settings{
    margin-bottom:24px;
  }
  .settings-card{
    padding:0;
  }
  .settings-card-title{
    padding:16px 16px 0;
  }
  .settings-form{
    padding:8px 16px 16px;
  }
  .settings-row{
    grid-template-columns:1fr;
    gap:8px;
    min-height:auto;
    padding:12px 0;
  }
  .settings-actions-row .settings-label{
    display:none;
  }
  .settings-control{
    align-items:stretch;
  }
  .settings-control .input,
  .settings-control .select,
  .settings-control-wide .input,
  .settings-control-wide .select{
    flex:1 1 100%;
    max-width:none;
  }
  .settings-control .btn{
    flex:1 1 auto;
  }
  .settings-note{
    padding:0 16px 16px;
  }
}
