:root {
  color-scheme: light;
  --canvas: #f3f6fb;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --raised: #f0f4fa;
  --stroke: #d9e2ef;
  --text: #18253c;
  --soft: #344862;
  --muted: #516580;
  --accent: #284fb9;
  --blue: #3157d6;
  --field: #fbfcff;
  --field-stroke: #aabbd1;
  --hover: #e8effa;
  --active-text: #2448a7;
  --active-bg: #eaf1ff;
  --active-stroke: #c4d6fb;
  --violet: #5938a3;
  --violet-bg: #f2ebff;
  --violet-stroke: #ddcdf6;
  --green: #0f6350;
  --green-bg: #e4f5ee;
  --green-stroke: #a9d9ca;
  --amber: #78501a;
  --amber-bg: #fff3de;
  --amber-stroke: #e8cd9d;
  --red: #a72e47;
  --red-bg: #ffedf0;
  --red-stroke: #eab7c2;
  --hero-start: #f0f5ff;
  --hero-end: #dce8ff;
  --hero-wash: #9bbbff66;
  --hero-ink: #304a73;
  --hero-orbit: #5d80cd88;
  --shadow: #2b46732e;
  --switch-off: #bcc8da;
  --switch-thumb: #ffffff;
  --progress-bg: #e3ebfa;
  --radius: 16px;
  --sidebar-width: 237px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0b1120;
  --sidebar: #0c1323;
  --panel: #111b2d;
  --raised: #172238;
  --stroke: #24334b;
  --text: #edf3ff;
  --soft: #c0cee1;
  --muted: #90a2bd;
  --accent: #a2baff;
  --blue: #446af1;
  --field: #0e1829;
  --field-stroke: #30415d;
  --hover: #20314e;
  --active-text: #b6cbff;
  --active-bg: #1b2c53;
  --active-stroke: #344d7c;
  --violet: #cbb0ff;
  --violet-bg: #30264e;
  --violet-stroke: #48356e;
  --green: #76dfb2;
  --green-bg: #13372f;
  --green-stroke: #255a4c;
  --amber: #f6c879;
  --amber-bg: #392d20;
  --amber-stroke: #624825;
  --red: #ffb6c1;
  --red-bg: #42242f;
  --red-stroke: #6e3a49;
  --hero-start: #15284c;
  --hero-end: #182b55;
  --hero-wash: #3e54bb77;
  --hero-ink: #bdccee;
  --hero-orbit: #88aaff59;
  --shadow: #02071499;
  --switch-off: #2a3750;
  --switch-thumb: #b6c3da;
  --progress-bg: #293951;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-width: 310px; color: var(--text); background: var(--canvas); }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, dl { margin: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: #375bcc; color: #fff; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 26px 16px 20px; background: var(--sidebar); border-right: 1px solid var(--stroke); z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; width: fit-content; }
.sidebar .brand { margin: 3px 0 33px 10px; }
.brand strong { display: block; font-size: 23px; line-height: 1.03; font-weight: 750; letter-spacing: .045em; }
.sidebar .brand strong { font-size: 17px; line-height: 1.25; letter-spacing: 0; overflow-wrap: anywhere; }
.login-mobile-brand strong { font-size: 19px; line-height: 1.25; letter-spacing: 0; overflow-wrap: anywhere; }
.brand small { display: block; margin-top: 6px; font-size: 9px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.nav-caption { margin: 0 0 10px 12px; color: var(--muted); font-size: 11px; letter-spacing: .14em; font-weight: 700; }
.secondary-caption { margin-top: 24px; }
.navigation { display: grid; gap: 5px; flex-shrink: 0; }
.navigation a { display: flex; position: relative; align-items: center; gap: 13px; padding: 12px 13px; border-radius: 9px; color: var(--soft); font-weight: 550; transition: color .16s, background .16s; }
.navigation a:hover { background: var(--hover); color: var(--text); }
.navigation a[aria-current="page"] { background: var(--active-bg); color: var(--active-text); box-shadow: inset 0 0 0 1px var(--active-stroke); }
.navigation a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); }
.sidebar-foot { margin-top: auto; flex-shrink: 0; padding: 13px 12px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--raised); }
.local-indicator { display: flex; gap: 8px; align-items: center; font-size: 12px; font-weight: 650; }
.local-indicator span, .login-footer span { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #63dcb0; box-shadow: 0 0 0 4px #63dcb014; }
.sidebar-foot small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }

.main-shell { min-width: 0; }
.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 clamp(17px, 3.2vw, 42px); background: var(--panel); border-bottom: 1px solid var(--stroke); }
.topbar-left, .topbar-right, .identity { display: flex; gap: 13px; align-items: center; }
.topbar-right { gap: 17px; }
.identity { gap: 9px; font-size: 13px; }
.identity span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb, .crumb-divider { color: var(--muted); }
.crumb-divider { color: var(--muted); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--active-bg); color: var(--active-text); font-weight: 750; border: 1px solid var(--active-stroke); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; border-radius: 8px; border: 1px solid var(--stroke); background: var(--raised); color: var(--soft); cursor: pointer; }
.icon-button:hover { background: var(--hover); color: var(--text); }
.menu-toggle { display: none; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; min-height: 36px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--raised); color: var(--soft); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.theme-toggle::before { content: ""; width: 14px; height: 14px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.theme-toggle:hover { color: var(--text); background: var(--hover); }
.workspace { max-width: 1550px; min-width: 0; margin: 0 auto; padding: 32px clamp(17px, 3.2vw, 42px) 18px; }
.workspace > section { min-width: 0; }
.workspace-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; margin-top: 29px; padding: 18px 0 5px; border-top: 1px solid var(--stroke); }

.hero { position: relative; overflow: hidden; display: flex; align-items: center; min-height: 272px; padding: clamp(28px, 4vw, 52px); border: 1px solid var(--active-stroke); border-radius: 20px; background: radial-gradient(ellipse at 92% 38%, var(--hero-wash), transparent 51%), linear-gradient(117deg, var(--hero-start), var(--hero-end)); isolation: isolate; }
.hero::before, .login-showcase::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(#729afa33 1px, transparent 1px), linear-gradient(90deg, #729afa33 1px, transparent 1px); background-size: 37px 37px; mask-image: linear-gradient(90deg, transparent, #000 95%); pointer-events: none; z-index: -1; }
.hero-copy { max-width: 56%; position: relative; z-index: 2; }
.hero h1, .page-heading h1 { font-size: clamp(31px, 4.3vw, 51px); font-weight: 760; line-height: 1.16; letter-spacing: -.035em; margin: 13px 0 15px; }
.hero p { max-width: 460px; line-height: 1.85; color: var(--hero-ink); font-size: 15px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.3; color: var(--accent); letter-spacing: .1em; font-weight: 700; }
.spark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--hero-wash); }
.hero-actions, .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.hero-actions { margin-top: 23px; }
.hero-visual, .login-visual { position: absolute; top: 50%; right: clamp(15px, 4.8vw, 72px); transform: translateY(-50%); width: min(32%, 330px); aspect-ratio: 1; color: var(--accent); }
.orbit { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--hero-orbit); }
.orbit-outer { width: 91%; border-style: dashed; }
.orbit-middle { width: 70%; box-shadow: 0 0 40px #628fff15 inset; }
.orbit-inner { width: 49%; border-color: #99b6ff88; }
.visual-core { display: grid; place-items: center; position: absolute; width: 32%; aspect-ratio: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 24%; background: linear-gradient(140deg, #587eec, #263e8e 72%); border: 1px solid #91abff; box-shadow: 0 0 46px #6b8af070, 0 11px 33px #07102d95, inset 0 0 18px #c3d2ff1f; }
.visual-core svg { width: 60%; height: 60%; stroke-width: 1.2; color: #f0f5ff; filter: drop-shadow(0 2px 9px #d4e3ff55); }
.orb { width: 9px; height: 9px; border-radius: 50%; position: absolute; background: #a3c0ff; box-shadow: 0 0 12px #a3c0ff; }
.orb-a { top: 16%; left: 40%; }.orb-b { top: 65%; left: 82%; }.orb-c { top: 74%; left: 14%; }
.visual-label { position: absolute; padding: 4px 9px; border-radius: 5px; border: 1px solid #6388e685; background: #202e5f; color: #c4d5ff; font-size: 11px; white-space: nowrap; }
.label-a { left: 3%; top: 32%; }.label-b { right: 1%; top: 30%; }.label-c { right: 19%; bottom: 8%; }

.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 8px 14px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background .16s, border-color .16s, box-shadow .16s; }
.button svg { width: 16px; height: 16px; }
.button.primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 4px 12px #2444b84f; }
.button.primary:hover { filter: brightness(.94); }
.button.ghost { color: var(--active-text); background: var(--panel); border-color: var(--active-stroke); }
.button.ghost:hover { background: var(--hover); }
.button.subtle { color: var(--soft); background: var(--raised); border-color: var(--stroke); }
.button.subtle:hover { background: var(--hover); }
.button:disabled, .icon-button:disabled { opacity: .45; cursor: not-allowed; }
.button.danger { background: var(--red-bg); border-color: var(--red-stroke); color: var(--red); }
.button.danger:hover { background: var(--red-stroke); }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); white-space: nowrap; font-size: 13px; font-weight: 650; }
.text-link:hover { color: var(--active-text); }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .panel h2 { font-size: 18px; line-height: 1.4; font-weight: 720; }
.section-heading p, .panel p, .page-heading p { color: var(--muted); line-height: 1.6; font-size: 13px; }
.section-heading p { margin-top: 5px; }
.section-heading.spaced { margin-top: 29px; }
.panel { background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); min-width: 0; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 18px; min-height: 130px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.stat h3 { font-size: 16px; font-weight: 700; margin-bottom: 5px; overflow-wrap: anywhere; }
.stat p { font-size: 12px; }
.glyph { display: grid; place-items: center; width: 37px; height: 37px; flex: none; border-radius: 9px; border: 1px solid var(--stroke); }
.glyph.blue, .badge.accent { background: var(--active-bg); color: var(--active-text); border-color: var(--active-stroke); }
.glyph.violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-stroke); }
.glyph.amber, .badge.amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-stroke); }
.glyph.green, .badge.green { background: var(--green-bg); color: var(--green); border-color: var(--green-stroke); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: var(--red-stroke); }
.badge.muted { background: var(--raised); color: var(--soft); border-color: var(--stroke); }
.badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 8px; border-radius: 6px; border: 1px solid transparent; font-size: 11px; line-height: 1.15; font-weight: 700; white-space: nowrap; }
.pipeline-panel { margin-top: 19px; padding: 22px; }
.pipeline { display: flex; align-items: center; gap: 14px; padding-top: 6px; }
.step { flex: 1 1 0; min-width: 0; }
.step-number { display: inline-block; margin-bottom: 10px; padding: 4px 8px; border-radius: 6px; color: var(--active-text); background: var(--active-bg); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.step strong, .step small { display: block; line-height: 1.5; }
.step small { margin-top: 5px; font-size: 12px; color: var(--muted); }
.step-divider { flex: 0 1 30px; height: 1px; background: var(--stroke); transform: translateY(-8px); }

.page-heading { margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(28px, 4.6vw, 39px); margin: 8px 0 9px; }
.form-panel, .editor-summary, .publish-panel { padding: 21px 23px; margin-bottom: 15px; }
.editor-summary, .summary-title, .publish-panel { display: flex; align-items: center; gap: 13px; }
.editor-summary, .publish-panel { justify-content: space-between; }
.summary-title { flex-wrap: wrap; gap: 9px; margin-bottom: 4px; }
.publish-panel { align-items: end; }
.publish-panel .field { width: min(100%, 620px); }
.publish-panel .field textarea { min-height: 62px; }
.settings-grid { display: grid; grid-template-columns: minmax(240px, 1.4fr) repeat(2, minmax(100px, 1fr)); gap: 13px; }
.field { display: grid; gap: 8px; align-content: start; min-width: 0; color: var(--soft); font-size: 13px; }
.field > span, .field > label { font-weight: 620; }
.field small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.field input, .field textarea, .field select, .compact-field select, .rule-fields input, .rule-fields select {
  width: 100%; min-width: 0; background: var(--field); border: 1px solid var(--field-stroke); border-radius: 8px; color: var(--text); padding: 9px 11px; min-height: 39px;
}
.field textarea { min-height: 155px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.toggle-list { display: grid; margin-top: 16px; }
.toggle-row { padding: 12px 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--stroke); cursor: pointer; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { color: var(--muted); margin-top: 4px; font-size: 12px; line-height: 1.5; }
input[role="switch"] { appearance: none; flex: none; width: 37px; height: 21px; background: var(--switch-off); border: 1px solid var(--field-stroke); border-radius: 30px; position: relative; margin: 0; cursor: pointer; }
input[role="switch"]::before { content: ""; width: 13px; height: 13px; position: absolute; top: 3px; left: 3px; background: var(--switch-thumb); border-radius: 50%; transition: transform .16s; }
input[role="switch"]:checked { background: var(--blue); border-color: var(--blue); }
input[role="switch"]:checked::before { transform: translateX(16px); background: #fff; }
.rule-list { display: grid; gap: 10px; }
.rule-card { min-width: 0; padding: 13px; background: var(--raised); border: 1px solid var(--stroke); border-radius: 11px; }
.rule-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.rule-head > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.rule-head .icon-button { width: 30px; height: 30px; }
.rule-head .icon-button:hover { color: var(--red); }
.rule-head label { display: inline-flex; align-items: center; gap: 7px; color: var(--soft); font-size: 12px; }
.rule-fields { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(160px, 1.7fr) repeat(4, minmax(90px, .65fr)); gap: 8px; }
.rule-fields .field { font-size: 12px; }
.empty-inline { padding: 19px; text-align: center; color: var(--muted); background: var(--field); border: 1px dashed var(--field-stroke); border-radius: 10px; line-height: 1.55; }

.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; color: var(--soft); font-size: 13px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
.data-table th { color: var(--muted); font-weight: 650; font-size: 12px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--raised); }
.data-table td .button { min-height: 31px; padding: 5px 9px; }
.revision-table td { vertical-align: top; }
.revision-version, .revision-time, .revision-action { white-space: nowrap; }
.revision-publisher { overflow-wrap: anywhere; }
.revision-note { width: 100%; }
.revision-version { font-weight: 650; color: var(--text); }
.revision-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; cursor: pointer; list-style: none; }
.revision-summary::-webkit-details-marker { display: none; }
.revision-summary::marker { content: ""; }
.revision-summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.revision-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; }
.revision-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 1px 0; color: var(--active-text); font-size: 12px; font-weight: 650; white-space: nowrap; }
.revision-toggle::after { content: ""; width: 6px; height: 6px; margin: 0 2px 3px 0; border: solid currentColor; border-width: 0 1px 1px 0; transform: rotate(45deg); }
.revision-detail[open] .revision-toggle::after { margin-top: 4px; transform: rotate(225deg); }
.revision-hide, .revision-detail[open] .revision-show { display: none; }
.revision-detail[open] .revision-hide { display: inline; }
.revision-detail-body { display: grid; gap: 10px; margin-top: 10px; padding: 12px 14px; border: 1px solid var(--stroke); border-radius: 9px; background: var(--field); overflow-wrap: anywhere; }
.revision-detail-body p { margin: 0; line-height: 1.65; white-space: pre-wrap; }
.revision-detail-body h3 { margin: 3px 0 0; font-size: 13px; color: var(--text); }
.revision-detail-body .button { justify-self: start; }
.revision-description { display: grid; gap: 8px; }
.revision-muted { color: var(--muted); }
.revision-changes, .revision-rules { display: grid; gap: 7px; padding: 0; margin: 0; }
.revision-change { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 6px 12px; align-items: baseline; }
.revision-change dt { font-weight: 620; }
.revision-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; }
.revision-values span { white-space: pre-wrap; }
.revision-before, .revision-arrow { color: var(--muted); }
.revision-after { color: var(--text); }
.revision-rules { list-style: none; }
.revision-rules li { padding: 8px 0 0; border-top: 1px solid var(--stroke); }
.revision-rule-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; color: var(--text); }
.system-updates-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.system-update { border: 1px solid var(--stroke); border-radius: 11px; background: var(--field); }
.system-update[open] { border-color: var(--active-stroke); }
.system-update-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 11px; cursor: pointer; list-style: none; }
.system-update-summary:hover { background: var(--raised); }
.system-update-summary::-webkit-details-marker { display: none; }
.system-update-summary::marker { content: ""; }
.system-update-intro { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.system-update-date { color: var(--muted); font-size: 12px; }
.system-update-title { color: var(--text); font-size: 15px; line-height: 1.45; }
.system-update-preview { color: var(--muted); font-size: 13px; line-height: 1.6; }
.system-update[open] .revision-toggle::after { margin-top: 4px; transform: rotate(225deg); }
.system-update[open] .revision-show { display: none; }
.system-update[open] .revision-hide { display: inline; }
.system-update-details { display: grid; gap: 8px; margin: 0; padding: 12px 16px 14px 34px; border-top: 1px solid var(--stroke); color: var(--soft); line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; }
.section-heading p.system-updates-error { color: var(--red); }
.batch-field textarea, .code-sample { font-family: "Cascadia Code", Consolas, "Microsoft YaHei UI", monospace; font-size: 13px; }
.batch-footer, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; }
.batch-footer p { font-size: 12px; }
.file-button:focus-within, .button-row:has(#file-input:focus-visible) .file-button { outline: 2px solid var(--accent); }
.upload-paste { position: relative; min-width: 0; }
.upload-paste > svg { position: absolute; inset: 50% auto auto 12px; width: 15px; height: 15px; color: var(--accent); transform: translateY(-50%); pointer-events: none; }
.upload-paste > textarea {
  display: block;
  width: 100%;
  padding: 10px 10px 10px 34px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  background: var(--field);
  font-size: 12px;
  line-height: 18px;
}
.upload-paste > textarea::placeholder { color: var(--muted); opacity: 1; }
.upload-paste > textarea:hover { border-color: var(--field-stroke); }
.upload-paste > textarea:focus { border-color: var(--accent); background: var(--active-bg); }
.batch-paste { margin-bottom: 14px; }
.speech-paste { margin-top: 8px; }
.progress-panel { padding: 17px 20px; }
.progress-panel > div { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.progress-panel span { color: var(--muted); }
progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; overflow: hidden; margin-top: 14px; background: var(--progress-bg); color: var(--blue); }
progress::-webkit-progress-bar { background: var(--progress-bg); }
progress::-webkit-progress-value { background: linear-gradient(90deg, #5379ed, #94b2ff); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--blue); }
.result-cards { margin-bottom: 15px; }
.result-stat { padding: 16px; }
.result-stat strong { display: block; font-size: 25px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.result-stat p { font-size: 12px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.metric-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; }
.metric-list dt, .metric-list dd { padding: 9px 0; border-bottom: 1px solid var(--stroke); margin: 0; font-size: 13px; }
.metric-list dt { color: var(--muted); }
.metric-list dd { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.matrix-table th:not(:first-child), .matrix-table td:not(:first-child) { text-align: center; }
.matrix-table .diagonal { color: var(--green); background: var(--green-bg); }
.results-table { min-width: 650px; }
.results-table td:first-child { min-width: 210px; max-width: 375px; }
.results-table td:nth-last-child(-n+2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-id { display: block; color: var(--accent); font-size: 11px; margin-bottom: 4px; }
.row-message { display: block; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.row-history { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--stroke); }
.row-history-label { color: var(--muted); font-size: 11px; }
.row-turns { display: grid; gap: 7px; margin: 6px 0 0; padding: 0; list-style: none; }
.row-turns li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: start; }
.row-speaker { color: var(--accent); font-size: 11px; line-height: 1.8; }
.row-reason { display: block; max-width: 195px; color: var(--muted); font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; }
.compact-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.compact-field select { min-height: 34px; padding: 6px 8px; }
.pagination { color: var(--muted); font-size: 12px; }

.speech-form-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; }
.speech-drop { display: grid; align-content: center; justify-items: center; gap: 8px; min-height: 174px; padding: 16px; text-align: center; cursor: pointer; border: 1px dashed var(--field-stroke); border-radius: 12px; background: var(--field); transition: background .16s, border-color .16s; }
.speech-drop:hover, .speech-drop.dragging { background: var(--active-bg); border-color: var(--accent); }
.speech-drop svg { width: 29px; height: 29px; color: var(--accent); margin-bottom: 3px; }
.speech-drop strong, #speech-result-file { overflow-wrap: anywhere; }
.speech-drop small { color: var(--muted); }
#speech-file:focus-visible + .speech-drop { outline: 2px solid var(--accent); outline-offset: 3px; }
#speech-file:disabled + .speech-drop { cursor: default; opacity: .6; }
.speech-hint { margin-top: 9px; }
.speech-toggle { margin-top: 13px; }
.speech-notice { margin-top: 14px; }
.speech-result-heading { flex-wrap: wrap; }
.speech-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 10px; margin-bottom: 15px; }
.speech-metrics > div { padding: 13px 15px; }
.speech-metrics dt { color: var(--muted); font-size: 12px; }
.speech-metrics dd { margin: 5px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.speech-transcript { margin: 0; min-height: 88px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.8; color: var(--soft); }
.speech-segments td:nth-child(-n+2) { width: 106px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.speech-segments td:last-child { white-space: pre-wrap; overflow-wrap: anywhere; }
#speech-elapsed { color: var(--muted); font-variant-numeric: tabular-nums; }
#speech-progress { margin-top: 14px; }
#speech-progress progress:indeterminate { appearance: auto; accent-color: var(--accent); }
#speech-verdict .section-heading { margin-bottom: 0; }

.code-sample { overflow-x: auto; border-radius: 9px; border: 1px solid var(--stroke); background: var(--field); padding: 13px; margin: 0 0 12px; color: var(--soft); line-height: 1.65; }
.api-heading { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; }
.api-connection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.api-connection h2 { margin: 6px 0; }
.api-connection > div { min-width: 0; }
.api-business-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.api-card { display: flex; flex-direction: column; align-items: start; padding: 18px; }
.api-card .glyph { margin-bottom: 12px; }
.api-card h3 { font-size: 16px; margin-bottom: 4px; }
.api-card > p { margin-bottom: 8px; }
.api-endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 6px; min-width: 0; }
.api-endpoint code { color: var(--accent); overflow-wrap: anywhere; }
.api-card .code-sample { width: 100%; margin-top: auto; }
.api-card-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; width: 100%; }
.api-outcomes { margin-top: 15px; }
.api-voice-health { padding-top: 12px; border-top: 1px solid var(--stroke); }
.response-list { display: grid; }
.response-list > div { display: grid; grid-template-columns: 62px 45px minmax(0, 1fr); align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--stroke); }
.response-list small { color: var(--muted); line-height: 1.5; }
.response-list > div:last-child { border: 0; }
.account-panel { max-width: 565px; }
.user-management-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 14px; }
.user-table { table-layout: fixed; }
.user-table th:last-child { width: 95px; }
.user-table td:first-child { overflow-wrap: anywhere; }
.user-table td:first-child .badge { margin-inline-start: 8px; }
.stack-form p.form-alert { color: var(--red); }
.access-panel { max-width: 790px; }
.access-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; margin: 0 0 17px; }
.access-meta > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--raised); }
.access-meta dt { color: var(--muted); font-size: 11px; }
.access-meta dd { margin: 4px 0 0; color: var(--text); font-size: 13px; font-weight: 620; overflow-wrap: anywhere; }
.management-hint { color: var(--muted); }
.token-disclosure { display: grid; gap: 11px; margin-top: 18px; padding: 14px; border: 1px solid var(--active-stroke); border-radius: 9px; background: var(--active-bg); }
#token-issued { font-family: "Cascadia Code", Consolas, monospace; }
.audit-settings { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.audit-settings .toggle-row { flex: 1 1 235px; }
.audit-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--stroke); }
.audit-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 7px 11px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--soft); cursor: pointer; font-weight: 620; }
.audit-tab svg { width: 16px; height: 16px; }
.audit-tab:hover { background: var(--hover); }
.audit-tab[aria-selected="true"] { border-color: var(--active-stroke); background: var(--active-bg); color: var(--active-text); }
.audit-filter { display: flex; align-items: end; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.audit-filter .field { max-width: 155px; }
.audit-table { min-width: 960px; }
.audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.audit-endpoint code, .audit-file-name, .audit-file small { display: block; overflow-wrap: anywhere; }
.audit-method, .audit-file small { color: var(--muted); font-size: 11px; }
.audit-ip, .audit-file { max-width: 170px; overflow-wrap: anywhere; }
.audit-view { min-height: 30px; padding: 4px 9px; }
.audit-outcome .badge + .badge, .audit-file .badge { display: flex; margin-top: 4px; }
.audit-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 13px; }
.audit-page-size { margin-left: auto; }
.audit-page-controls, .audit-jump { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.audit-jump input { width: 76px; min-height: 36px; padding: 6px 8px; border: 1px solid var(--field-stroke); border-radius: 8px; background: var(--field); color: var(--text); }
.audit-jump label, .audit-jump span, #audit-page-label { color: var(--muted); font-size: 12px; }
.audit-detail { width: min(810px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: clamp(14px, 3vw, 24px); color: var(--text); background: var(--panel); border: 1px solid var(--stroke); border-radius: var(--radius); box-shadow: 0 14px 50px var(--shadow); }
.audit-detail::backdrop { background: #08102088; }
.audit-detail #audit-detail-route { overflow-wrap: anywhere; }
.audit-result { margin: 14px 0 0; }
.audit-result h3, .audit-result summary { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.audit-result summary { cursor: pointer; }
.audit-result pre { margin-bottom: 0; max-height: 48dvh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-request-items, .audit-request-history { display: grid; gap: 8px; }
#audit-request-summary:not([hidden]) + .audit-request-items:not(:empty) { margin-top: 8px; }
.audit-request-item { padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 9px; }
.audit-request-item summary { margin-bottom: 0; overflow-wrap: anywhere; }
.audit-request-item[open] summary { margin-bottom: 10px; }
.audit-request-content { display: grid; gap: 8px; }
.audit-request-content strong { color: var(--soft); font-size: 12px; }
.audit-request-content pre { max-height: none; }
.audit-request-history { margin: 0; padding-inline-start: 22px; }
.audit-request-history pre { margin-top: 4px; }
#audit-original-name { overflow-wrap: anywhere; }
.audit-file-preview { display: grid; place-items: center; padding: 8px; border: 1px solid var(--stroke); border-radius: 10px; background: var(--raised); }
.audit-file-preview img, .audit-file-preview video { display: block; max-width: 100%; max-height: 48dvh; }
.audit-file-preview audio { display: block; width: 100%; }
.audit-preview-status { margin: 8px 0; }
.audit-cleanup { width: min(680px, calc(100% - 24px)); }
.audit-cleanup-options { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
.audit-cleanup-options .field { min-width: 0; }
.audit-cleanup-options .button { justify-self: end; }
.audit-check { display: flex; align-items: flex-start; gap: 9px; line-height: 1.6; color: var(--soft); }
.audit-check input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--blue); }
.audit-cleanup-preview { margin-top: 20px; padding: 16px; border: 1px solid var(--red-stroke); border-radius: 12px; background: var(--red-bg); }
.audit-cleanup-preview h3 { font-size: 15px; margin-bottom: 12px; }
.audit-cleanup-preview .access-meta { margin-bottom: 12px; }
.audit-cleanup-warning { color: var(--red); line-height: 1.7; margin-bottom: 12px; }
.audit-cleanup-preview .button { margin-top: 14px; }
.audit-cleanup-progress { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--stroke); border-radius: 10px; line-height: 1.7; background: var(--raised); white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .audit-page-controls { width: 100%; }
  .audit-cleanup-options { grid-template-columns: 1fr; }
  .audit-cleanup-options .button { justify-self: start; }
}
.stack-form { display: grid; gap: 17px; }
.account-panel .button { justify-self: start; }
.notification, .form-alert { padding: 12px 14px; color: var(--active-text); border: 1px solid var(--active-stroke); background: var(--active-bg); border-radius: 9px; line-height: 1.55; }
.notification { margin-bottom: 16px; }
.notification.error, .form-alert { color: var(--red); background: var(--red-bg); border-color: var(--red-stroke); }
.notification.success { color: var(--green); background: var(--green-bg); border-color: var(--green-stroke); }
.notification.warning { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-stroke); }

.login-body { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 68px 24px 24px; background: radial-gradient(ellipse at 15% 30%, var(--hero-wash), transparent 65%), var(--canvas); }
.login-theme { position: absolute; top: 18px; right: 24px; }
.login-layout { display: grid; grid-template-columns: 1.04fr 1fr; width: min(100%, 1060px); min-height: 610px; border: 1px solid var(--stroke); border-radius: 21px; overflow: hidden; background: var(--panel); box-shadow: 0 27px 82px var(--shadow); }
.login-showcase { overflow: hidden; isolation: isolate; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 34px 35px 39px; border-right: 1px solid var(--active-stroke); background: radial-gradient(ellipse at 64% 40%, var(--hero-wash), transparent 65%), linear-gradient(151deg, #192e56, var(--hero-end)); }
.login-showcase::before { opacity: .52; mask-image: linear-gradient(140deg, transparent, #000 45%, transparent); }
.login-visual { width: 70%; right: 15%; top: 48%; max-width: 320px; }
.login-message { position: relative; z-index: 2; }
.login-message h1 { font-size: clamp(29px, 4.3vw, 43px); letter-spacing: -.035em; line-height: 1.15; margin: 12px 0; }
.login-message p { color: var(--hero-ink); font-size: 14px; line-height: 1.65; }
.login-content { display: grid; place-items: center; padding: 40px clamp(23px, 5.5vw, 70px); }
.login-form-wrap { width: 100%; max-width: 405px; }
.login-mobile-brand { display: none; }
.login-lock { width: 42px; height: 42px; margin-bottom: 18px; }
.login-content h2 { font-size: clamp(27px, 3.5vw, 35px); font-weight: 750; letter-spacing: -.025em; margin: 8px 0; }
.login-lead { color: var(--muted); line-height: 1.65; margin-bottom: 22px; }
.login-content .field input { min-height: 46px; }
.password-box { position: relative; }
.password-box input { padding-right: 47px; }
.password-visibility { position: absolute; right: 6px; top: 5px; border-color: transparent; background: transparent; }
.login-submit { min-height: 44px; justify-content: space-between; }
.login-footer { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; margin-top: 22px; }

@media (max-width: 1180px) {
  .api-business-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rule-fields .pattern-field { grid-column: span 2; }
}
@media (max-width: 870px) {
  :root { --sidebar-width: 188px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .hero-copy { max-width: 62%; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid .field:first-child { grid-column: span 2; }
  .report-grid { grid-template-columns: minmax(0, 1fr); }
  .user-management-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .speech-form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pipeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .step-divider { display: none; }
}
@media (max-width: 680px) {
  .api-connection, .api-business-grid { grid-template-columns: minmax(0, 1fr); }
  .app-shell { display: block; }
  .topbar { height: 60px; gap: 7px; }
  .topbar-left, .topbar-right { gap: 9px; }
  .crumb, .crumb-divider { display: none; }
  .identity span { display: none; }
  .menu-toggle { display: inline-grid; }
  .sidebar { display: none; position: fixed; left: 0; top: 60px; width: min(245px, 82vw); height: calc(100dvh - 60px); padding: 16px 14px; box-shadow: 12px 0 42px var(--shadow); }
  .sidebar.open { display: flex; }
  .sidebar .brand { margin: 1px 0 22px 8px; }
  .workspace { padding-top: 19px; }
  .hero { min-height: 250px; padding: 23px; }
  .hero-copy { max-width: 100%; }
  .hero-visual { opacity: .22; width: 49%; right: -4%; top: 52%; }
  .hero h1 { margin-top: 10px; }
  .hero p { font-size: 14px; }
  .section-heading { gap: 12px; }
  .stat, .pipeline-panel, .form-panel, .editor-summary, .publish-panel, .api-card { padding: 14px; }
  .status-grid { gap: 8px; }
  .stat { min-height: 119px; }
  .stat h3 { font-size: 14px; }
  .glyph { width: 32px; height: 32px; }
  .glyph svg { width: 17px; height: 17px; }
  .rule-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-fields .pattern-field { grid-column: span 1; }
  .publish-panel { align-items: stretch; flex-direction: column; }
  .revision-table { display: block; }
  .revision-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .revision-table tbody { display: grid; gap: 8px; }
  .revision-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 9px; }
  .revision-table tbody td { display: block; min-width: 0; width: auto; padding: 0; border-bottom: 0; }
  .revision-publisher, .revision-note, .revision-action, .revision-empty { grid-column: 1 / -1; }
  .revision-note { margin: 3px 0; }
  .revision-time, .revision-publisher { color: var(--muted); font-size: 12px; }
  .revision-change { grid-template-columns: minmax(0, 1fr); }
  .batch-footer { align-items: flex-start; flex-direction: column; }
  .login-layout { display: block; min-height: auto; width: min(100%, 470px); }
  .login-showcase { display: none; }
  .login-content { padding: 28px 22px; }
  .login-mobile-brand { display: flex; margin-bottom: 27px; }
  .login-lock { display: none; }
}
@media (max-width: 420px) {
  .section-heading:has(.button-row) { align-items: flex-start; flex-direction: column; }
  .batch-footer .button-row { width: 100%; }
  .batch-footer .primary { flex: 1; }
  .result-stat { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
