/* Design tokens */
:root {
  --primary: #0B6B5D;
  --primary-hover: #085449;
  --primary-soft: #E4F1EC;
  --accent: #D9822B;
  --accent-soft: #FFF1DF;
  --bg: #F3F6F2;
  --surface: #FFFFFF;
  --surface-muted: #F7F9F7;
  --text: #17342F;
  --text-sub: #64756F;
  --border: #D9E3DD;
  --success: #2F7D5B;
  --success-soft: #E7F3EC;
  --warning: #B96820;
  --warning-soft: #FFF1DF;
  --danger: #B84343;
  --danger-soft: #FBEAEA;
  --info: #366A8A;
  --info-soft: #E8F0F5;
  --display: STSong, SimSun, serif;
  --body: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(23,52,47,.05);
  --shadow-md: 0 12px 32px rgba(23,52,47,.08);
  --shadow-phone: 0 28px 80px rgba(23,52,47,.18);
  --header-h: 68px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 8% 4%, rgba(11,107,93,.08), transparent 26%), radial-gradient(circle at 92% 88%, rgba(217,130,43,.06), transparent 25%), radial-gradient(rgba(23,52,47,.055) .65px, transparent .65px);
  background-size: auto, auto, 18px 18px;
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.3; }
h1, h2 { font-family: var(--display); letter-spacing: -.02em; }
svg { flex-shrink: 0; }
::selection { background: #BFDCD1; color: var(--text); }
:focus-visible { outline: 3px solid rgba(11,107,93,.28); outline-offset: 3px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; vertical-align: middle; }
.noscript { margin: 40px auto; max-width: 600px; padding: 24px; background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-sub); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Global shell */
.global-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: rgba(250,252,249,.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--primary); box-shadow: 0 6px 16px rgba(11,107,93,.18); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-family: var(--display); font-size: 20px; letter-spacing: .06em; }
.brand-copy small { margin-top: 5px; color: var(--text-sub); font-size: 10px; letter-spacing: .05em; }
.surface-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: #E9EFEA; }
.surface-nav a { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 16px; border-radius: 10px; color: var(--text-sub); font-weight: 600; font-size: 13px; transition: background .18s, color .18s, box-shadow .18s; }
.surface-nav a:hover { color: var(--primary); }
.surface-nav a.active { color: var(--primary); background: white; box-shadow: var(--shadow-sm); }
.global-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.mock-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--text-sub); font-size: 12px; }
.icon-button { width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-sub); transition: .18s; }
.icon-button:hover { color: var(--primary); border-color: #A9C7BC; background: var(--primary-soft); }

/* Shared controls */
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 650; font-size: 13px; transition: transform .16s, background .16s, border-color .16s, color .16s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-hover); }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.button-secondary:hover { border-color: #A9C7BC; color: var(--primary); background: var(--primary-soft); }
.button-ghost { background: transparent; color: var(--primary); padding-inline: 8px; }
.button-ghost:hover { background: var(--primary-soft); }
.button-danger { background: var(--danger); color: white; }
.button-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: #F0CACA; }
.button-warning { background: var(--accent); color: white; }
.button-lg { min-height: 50px; padding: 13px 20px; border-radius: 13px; font-size: 16px; }
.button-block { width: 100%; }
.button[disabled], .button.disabled { opacity: .48; cursor: not-allowed; transform: none; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 650; font-size: 13px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-button { padding: 0; border: 0; background: none; color: var(--primary); font-weight: 650; }
.tag { display: inline-flex; align-items: center; gap: 4px; width: fit-content; max-width: 100%; padding: 3px 8px; border-radius: 999px; font-size: 11px; line-height: 1.5; font-weight: 650; white-space: nowrap; }
.tag-success { color: var(--success); background: var(--success-soft); }
.tag-warning { color: var(--warning); background: var(--warning-soft); }
.tag-danger { color: var(--danger); background: var(--danger-soft); }
.tag-info { color: var(--info); background: var(--info-soft); }
.tag-neutral { color: #5C6B65; background: #EDF1EE; }
.panel-kicker { margin-bottom: 8px; color: var(--primary); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { color: var(--text-sub); font-size: 12px; font-weight: 650; }
.input, .select, .textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); outline: none; transition: border .16s, box-shadow .16s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,107,93,.1); }
.input::placeholder, .textarea::placeholder { color: #94A19B; }
.input-with-icon { position: relative; min-width: 220px; }
.input-with-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-sub); pointer-events: none; }
.input-with-icon > .input { padding-left: 38px; }
.field-error { display: flex; align-items: center; gap: 5px; color: var(--danger); font-size: 12px; }
.field-help { color: var(--text-sub); font-size: 12px; }
.checkbox-row, .radio-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-row input, .radio-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--primary); }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: #EBF0EC; }
.segmented button { min-height: 34px; padding: 6px 13px; border: 0; border-radius: 8px; background: transparent; color: var(--text-sub); font-size: 12px; }
.segmented button.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 700; }

/* Shared content */
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 7px; font-size: 32px; }
.page-heading p { max-width: 700px; margin-bottom: 0; color: var(--text-sub); }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); }
.metric-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; }
.tone-primary { color: var(--primary); background: var(--primary-soft); }
.tone-warning { color: var(--warning); background: var(--warning-soft); }
.tone-danger { color: var(--danger); background: var(--danger-soft); }
.tone-info { color: var(--info); background: var(--info-soft); }
.metric-value { margin-bottom: 2px; font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1.1; }
.metric-label { color: var(--text); font-size: 13px; font-weight: 650; }
.metric-card p { margin: 6px 0 0; color: var(--text-sub); font-size: 11px; }
.metric-delta { color: var(--success); font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,1fr); gap: 20px; margin-bottom: 20px; }
.content-grid.equal { grid-template-columns: repeat(2,minmax(0,1fr)); }
.content-grid.wide-right { grid-template-columns: minmax(280px,1fr) minmax(0,1.65fr); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255,255,255,.96); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #E7EDE8; }
.panel-header h2, .panel-header h3 { margin: 0; font-family: var(--body); font-size: 15px; letter-spacing: 0; }
.panel-header p { margin: 3px 0 0; color: var(--text-sub); font-size: 11px; }
.panel-body { padding: 20px; }
.panel-body.flush { padding: 0; }
.panel-footer { padding: 12px 20px; border-top: 1px solid #E7EDE8; background: var(--surface-muted); }
.chart-wrap { width: 100%; overflow: hidden; }
.bar-chart { display: block; width: 100%; height: auto; min-height: 190px; }
.chart-axis { stroke: #AFC0B7; stroke-width: 1; }
.chart-grid { stroke: #E8EEE9; stroke-width: 1; stroke-dasharray: 4 5; }
.chart-label { fill: var(--text-sub); font-family: var(--body); font-size: 11px; }
.chart-legend { display: flex; justify-content: center; gap: 24px; color: var(--text-sub); font-size: 11px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #E5ECE7; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--text-sub); font-size: 11px; }
.reveal-item { animation: reveal .36s both; }
.reveal-item:nth-child(2) { animation-delay: .045s; }
.reveal-item:nth-child(3) { animation-delay: .09s; }
.reveal-item:nth-child(4) { animation-delay: .135s; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Tables and queues */
.table-shell { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
.data-table th { padding: 11px 14px; color: var(--text-sub); background: #F5F8F5; border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 650; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #E9EEE9; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #F6FAF7; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .align-right { text-align: right; }
.table-action { white-space: nowrap; }
.table-toolbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-toolbar .field { min-width: 140px; }
.table-toolbar .toolbar-grow { flex: 1; }
.table-result { margin-left: auto; align-self: center; color: var(--text-sub); font-size: 12px; }
.participant-cell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 750; }
.participant-cell strong { display: block; font-size: 12px; }
.participant-cell small { display: block; color: var(--text-sub); font-family: var(--mono); font-size: 10px; }
.queue-list { display: flex; flex-direction: column; }
.queue-item { display: flex; align-items: flex-start; gap: 12px; padding: 15px 20px; border-bottom: 1px solid #E9EEE9; }
.queue-item:last-child { border-bottom: 0; }
.queue-icon { width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0; border-radius: 10px; color: var(--warning); background: var(--warning-soft); }
.queue-icon.danger { color: var(--danger); background: var(--danger-soft); }
.queue-icon.success { color: var(--success); background: var(--success-soft); }
.queue-content { min-width: 0; flex: 1; }
.queue-content strong { display: block; margin-bottom: 3px; font-size: 12px; }
.queue-content p { margin: 0 0 5px; color: var(--text-sub); font-size: 11px; line-height: 1.55; }
.queue-content small { color: #8B9992; font-size: 10px; }
.list-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.record-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.record-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.record-card h3 { margin: 0 0 4px; font-family: var(--body); font-size: 14px; }
.record-card p { margin-bottom: 0; color: var(--text-sub); font-size: 12px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; color: var(--text-sub); font-size: 11px; }
.record-meta span { display: inline-flex; align-items: center; gap: 5px; }
.record-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.empty-state, .blocked-state { padding: 56px 24px; text-align: center; }
.empty-state > .icon { color: #92A29A; }
.empty-state h3 { margin: 14px 0 6px; font-family: var(--body); font-size: 16px; }
.empty-state p { max-width: 420px; margin: 0 auto 18px; color: var(--text-sub); }
.blocked-state { max-width: 640px; margin: 48px auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: white; }
.blocked-state h1 { margin: 12px 0; font-size: 28px; }
.blocked-state p { color: var(--text-sub); }
.blocked-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 20px; color: var(--warning); background: var(--warning-soft); }
.blocked-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0; color: var(--text-sub); font-size: 12px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 250px; color: var(--text-sub); }
.spinner { width: 20px; height: 20px; border: 2px solid #C9D8D0; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-stack { flex-basis: 100%; max-width: 520px; margin-top: 20px; }
.skeleton-stack i { display: block; height: 14px; margin: 12px 0; border-radius: 6px; background: #E7EDE8; animation: pulse 1.2s ease-in-out infinite alternate; }
.skeleton-stack i:nth-child(2) { width: 82%; }
.skeleton-stack i:nth-child(3) { width: 64%; }
@keyframes pulse { to { opacity: .45; } }

/* Mobile prototype stage */
.mobile-stage { max-width: 1320px; margin: 0 auto; padding: 28px 28px 40px; display: grid; grid-template-columns: 230px minmax(390px,430px) 250px; justify-content: center; align-items: start; gap: 32px; }
.scenario-panel, .mobile-context-panel { position: sticky; top: calc(var(--header-h) + 28px); padding-top: 24px; }
.scenario-panel h2, .mobile-context-panel h2 { margin-bottom: 8px; font-size: 27px; }
.scenario-panel > p { color: var(--text-sub); font-size: 12px; }
.scenario-list { display: flex; flex-direction: column; gap: 7px; margin-top: 20px; }
.scenario-button { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text-sub); text-align: left; font-size: 12px; transition: .18s; }
.scenario-button span { flex: 1; }
.scenario-button:hover { background: rgba(255,255,255,.7); color: var(--primary); }
.scenario-button.active { border-color: #B7D3C7; background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 700; }
.scenario-note { display: flex; gap: 8px; margin-top: 20px; padding: 12px; border-radius: 10px; background: rgba(255,255,255,.56); color: var(--text-sub); font-size: 10px; line-height: 1.6; }
.phone-column { min-width: 0; }
.phone-caption { display: flex; align-items: center; justify-content: space-between; margin: 0 8px 10px; color: var(--text-sub); font-size: 11px; }
.phone-frame { position: relative; width: 100%; height: min(844px, calc(100vh - 132px)); min-height: 650px; display: flex; flex-direction: column; overflow: hidden; border: 7px solid #223B35; border-radius: 42px; background: #F5F7F4; box-shadow: var(--shadow-phone); isolation: isolate; }
.phone-hardware { position: absolute; z-index: 40; top: 6px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; border-radius: 20px; background: #223B35; pointer-events: none; }
.phone-hardware span { display: block; width: 34px; height: 4px; margin: 8px auto; border-radius: 4px; background: #49605A; }
.phone-statusbar { height: 38px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; flex-shrink: 0; padding: 0 20px 5px; color: var(--text); font-size: 10px; line-height: 1; }
.phone-statusbar > span:nth-child(2) { opacity: .6; }
.phone-system-icons { display: flex; justify-content: flex-end; gap: 6px; }
.mobile-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #B8C7BF transparent; transition: filter .45s ease; }
.phone-frame.is-dimmed .mobile-scroll { filter: brightness(.42) saturate(.75); }
.mobile-bottom-nav { position: relative; z-index: 10; height: 70px; display: grid; grid-template-columns: repeat(5,1fr); flex-shrink: 0; padding: 7px 6px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid #E1E8E2; background: rgba(255,255,255,.97); }
.mobile-bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 10px; color: #71817A; font-size: 10px; }
.mobile-bottom-nav a.active { color: var(--primary); font-weight: 750; background: var(--primary-soft); }
.nav-dot { position: absolute; top: 5px; right: 17px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.context-index { margin-bottom: 20px; color: #B7C8BF; font-family: var(--display); font-size: 56px; line-height: 1; }
.context-list { margin: 22px 0; }
.context-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(191,205,196,.55); font-size: 11px; }
.context-list dt { color: var(--text-sub); }
.context-list dd { margin: 0; text-align: right; font-weight: 650; }
.context-rule { width: 38px; height: 3px; margin: 24px 0; background: var(--accent); }
.mobile-context-panel h3 { font-family: var(--body); font-size: 13px; }
.interaction-cues { margin: 0 0 20px; padding: 0; list-style: none; }
.interaction-cues li { display: flex; align-items: flex-start; gap: 7px; margin-bottom: 10px; color: var(--text-sub); font-size: 11px; }
.interaction-cues .icon { margin-top: 2px; color: var(--primary); }

/* Mobile pages */
.app-page { min-height: 100%; padding: 18px 17px 22px; animation: appEnter .28s both; }
@keyframes appEnter { from { opacity: 0; transform: translateX(5px); } to { opacity: 1; transform: translateX(0); } }
.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.app-header h1 { margin: 0 0 4px; font-size: 26px; }
.app-header p { margin: 0; color: var(--text-sub); font-size: 12px; }
.app-header .icon-button { width: 36px; height: 36px; border-radius: 50%; }
.app-greeting { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.app-greeting .avatar { width: 44px; height: 44px; font-size: 16px; }
.app-greeting h1 { margin: 0; font-size: 24px; }
.app-greeting p { margin: 3px 0 0; color: var(--text-sub); font-size: 12px; }
.monitor-card { position: relative; overflow: hidden; padding: 20px; border-radius: 22px; background: #114F46; color: white; box-shadow: 0 14px 30px rgba(17,79,70,.16); }
.monitor-card::after { content: ""; position: absolute; right: -32px; top: -36px; width: 140px; height: 140px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(255,255,255,.035), 0 0 0 48px rgba(255,255,255,.025); }
.monitor-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.monitor-status { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 750; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #88D7B5; box-shadow: 0 0 0 5px rgba(136,215,181,.14); }
.monitor-card .tag { background: rgba(255,255,255,.13); color: #E3F4EC; }
.monitor-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 22px; }
.monitor-metric { padding-right: 5px; border-right: 1px solid rgba(255,255,255,.14); }
.monitor-metric:last-child { border-right: 0; padding-left: 8px; }
.monitor-metric:nth-child(2) { padding-left: 8px; }
.monitor-metric strong { display: block; font-family: var(--display); font-size: 24px; line-height: 1.15; }
.monitor-metric span { color: #C4D9D2; font-size: 10px; }
.monitor-footer { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 18px; color: #C4D9D2; font-size: 10px; }
.app-card { margin-top: 14px; padding: 16px; border: 1px solid #E0E7E1; border-radius: 17px; background: white; box-shadow: var(--shadow-sm); }
.app-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.app-card-header h2, .app-card-header h3 { margin: 0; font-family: var(--body); font-size: 15px; letter-spacing: 0; }
.app-card-header .text-link { font-size: 11px; }
.risk-card { position: relative; }
.risk-main { display: flex; align-items: center; gap: 14px; }
.risk-emblem { width: 48px; height: 48px; display: grid; place-items: center; flex-shrink: 0; border-radius: 15px; color: var(--warning); background: var(--warning-soft); }
.risk-main h2 { margin: 0 0 4px; font-family: var(--body); font-size: 20px; }
.risk-main p { margin: 0; color: var(--text-sub); font-size: 11px; }
.risk-meter { height: 7px; margin: 16px 0 8px; border-radius: 99px; background: #E9EEEA; overflow: hidden; }
.risk-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.risk-scale { display: flex; justify-content: space-between; color: var(--text-sub); font-size: 9px; }
.app-notice { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 12px; border-radius: 12px; color: var(--info); background: var(--info-soft); font-size: 11px; line-height: 1.65; }
.app-notice.warning { color: var(--warning); background: var(--warning-soft); }
.app-notice.danger { color: var(--danger); background: var(--danger-soft); }
.app-notice.success { color: var(--success); background: var(--success-soft); }
.app-notice strong { display: block; margin-bottom: 2px; }
.app-notice p { margin: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 14px; }
.quick-action { min-height: 86px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 15px; background: white; color: var(--text); text-align: left; }
.quick-action:hover { border-color: #A8CABC; background: var(--primary-soft); }
.quick-action .icon { color: var(--primary); }
.quick-action strong { font-size: 13px; }
.quick-action small { color: var(--text-sub); font-size: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 10px; }
.section-title h2 { margin: 0; font-family: var(--body); font-size: 15px; }
.section-title span { color: var(--text-sub); font-size: 10px; }
.app-list { display: flex; flex-direction: column; gap: 10px; }
.event-item { padding: 14px; border: 1px solid #E1E8E2; border-radius: 15px; background: white; }
.event-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.event-top strong { font-size: 13px; }
.event-top small { display: block; margin-top: 3px; color: var(--text-sub); font-size: 10px; }
.sensor-values { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-sub); font-size: 10px; }
.sensor-values span { display: inline-flex; align-items: center; gap: 4px; }
.event-response { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px dashed #E2E8E3; color: var(--success); font-size: 10px; }
.app-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: #E7ECE8; }
.app-tabs button { flex: 1; min-height: 38px; padding: 7px; border: 0; border-radius: 9px; background: transparent; color: var(--text-sub); font-size: 12px; }
.app-tabs button.active { color: var(--primary); background: white; box-shadow: var(--shadow-sm); font-weight: 700; }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.filter-chips button { flex-shrink: 0; min-height: 34px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: white; color: var(--text-sub); font-size: 11px; }
.filter-chips button.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.app-risk-hero { padding: 20px; border-radius: 20px; background: #FFF8EC; border: 1px solid #F0DFC0; }
.app-risk-hero .risk-score { display: flex; align-items: baseline; gap: 6px; margin: 10px 0; }
.app-risk-hero .risk-score strong { font-family: var(--display); font-size: 42px; line-height: 1; }
.app-risk-hero .risk-score span { color: var(--text-sub); font-size: 11px; }
.app-risk-hero p { margin: 10px 0 0; color: #765D3D; font-size: 11px; }
.factor-list { display: flex; flex-direction: column; gap: 12px; }
.factor-row { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 9px; font-size: 10px; }
.factor-track { height: 6px; overflow: hidden; border-radius: 99px; background: #E7EDE8; }
.factor-track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.task-hero { padding: 22px 18px; border-radius: 20px; background: #E5F1EB; text-align: center; }
.task-hero h2 { margin: 0 0 6px; font-size: 23px; }
.task-hero > p { color: var(--text-sub); font-size: 12px; }
.timer-ring { --progress: 0deg; position: relative; width: 156px; height: 156px; display: grid; place-items: center; margin: 20px auto; border-radius: 50%; background: conic-gradient(var(--primary) var(--progress), #C9DCD2 var(--progress)); }
.timer-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #F7FBF8; }
.timer-value { position: relative; z-index: 1; font-family: var(--display); font-size: 45px; font-weight: 700; line-height: 1; }
.timer-value small { display: block; margin-top: 6px; color: var(--text-sub); font-family: var(--body); font-size: 10px; font-weight: 400; }
.task-actions { display: flex; justify-content: center; gap: 9px; }
.task-steps { margin: 0; padding: 0; list-style: none; counter-reset: task-step; }
.task-steps li { position: relative; display: flex; gap: 12px; padding-bottom: 18px; color: var(--text-sub); font-size: 12px; counter-increment: task-step; }
.task-steps li::before { content: counter(task-step); width: 25px; height: 25px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 750; }
.task-steps strong { display: block; margin-bottom: 2px; color: var(--text); }
.followup-card { position: relative; padding: 17px; border: 1px solid var(--border); border-radius: 17px; background: white; }
.followup-card + .followup-card { margin-top: 12px; }
.followup-card h3 { margin: 0 0 5px; font-family: var(--body); font-size: 15px; }
.followup-card p { color: var(--text-sub); font-size: 11px; }
.followup-date { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 11px; }
.question { margin-bottom: 18px; }
.question legend { margin-bottom: 10px; font-size: 13px; font-weight: 700; line-height: 1.6; }
.question small { display: block; margin-bottom: 8px; color: var(--text-sub); font-weight: 400; }
.choice-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.choice { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 11px; background: white; color: var(--text-sub); font-size: 11px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.choice input { accent-color: var(--primary); }
.form-success { padding: 24px 18px; text-align: center; }
.form-success .success-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: var(--success); background: var(--success-soft); }
.form-success h2 { font-size: 24px; }
.form-success p { color: var(--text-sub); font-size: 12px; }
.profile-summary { display: flex; align-items: center; gap: 13px; padding: 18px; border-radius: 18px; background: #114F46; color: white; }
.profile-summary .avatar { width: 50px; height: 50px; background: rgba(255,255,255,.15); color: white; font-size: 17px; }
.profile-summary h2 { margin: 0 0 3px; font-family: var(--body); font-size: 18px; }
.profile-summary p { margin: 0; color: #C4D9D2; font-size: 11px; }
.profile-group { margin-top: 16px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: white; }
.profile-group-title { padding: 12px 15px 6px; color: var(--text-sub); font-size: 10px; font-weight: 700; }
.profile-row { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 11px; padding: 12px 15px; border: 0; border-bottom: 1px solid #E8EDE8; background: white; text-align: left; }
.profile-row:last-child { border-bottom: 0; }
.profile-row > .icon:first-child { color: var(--primary); }
.profile-row-content { flex: 1; min-width: 0; }
.profile-row-content strong { display: block; font-size: 13px; }
.profile-row-content small { display: block; margin-top: 2px; color: var(--text-sub); font-size: 10px; }
.profile-row > .icon:last-child { color: #8A9991; }
.profile-row.danger, .profile-row.danger > .icon:first-child { color: var(--danger); }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { position: absolute; inset: 0; border-radius: 99px; background: #CAD4CE; transition: .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: .2s; }
.toggle input:checked + span { background: var(--primary); }
.toggle input:checked + span::after { transform: translateX(18px); }
.app-version { margin: 18px 0 4px; color: #93A098; text-align: center; font-size: 9px; line-height: 1.8; }

/* Intervention overlays */
.intervention-scrim { position: absolute; z-index: 30; inset: 0; display: flex; align-items: flex-end; background: rgba(15,36,31,.42); animation: fadeIn .2s both; }
.intervention-sheet { width: 100%; padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: white; box-shadow: 0 -18px 40px rgba(23,52,47,.14); animation: sheetUp .26s both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(30px); opacity: .5; } }
.intervention-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.intervention-level { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 12px; font-weight: 750; }
.voice-visual { display: flex; align-items: center; justify-content: center; gap: 5px; height: 42px; margin-bottom: 10px; color: var(--primary); }
.voice-visual i { width: 4px; height: 14px; border-radius: 4px; background: currentColor; animation: voice .8s ease-in-out infinite alternate; }
.voice-visual i:nth-child(2) { height: 28px; animation-delay: .15s; }
.voice-visual i:nth-child(3) { height: 36px; animation-delay: .3s; }
.voice-visual i:nth-child(4) { height: 22px; animation-delay: .45s; }
@keyframes voice { to { transform: scaleY(.45); opacity: .5; } }
.intervention-sheet h2 { margin: 0 0 8px; font-size: 24px; }
.intervention-sheet p { color: var(--text-sub); font-size: 13px; line-height: 1.75; }
.intervention-evidence { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.intervention-evidence div { padding: 10px 6px; border-radius: 10px; background: var(--surface-muted); text-align: center; }
.intervention-evidence strong { display: block; font-size: 15px; }
.intervention-evidence span { color: var(--text-sub); font-size: 9px; }
.intervention-actions { display: grid; gap: 8px; margin-top: 16px; }
.level2-scrim { align-items: center; padding: 18px; background: rgba(10,25,22,.76); }
.level2-card { width: 100%; padding: 22px 18px; border-radius: 22px; background: white; text-align: center; animation: reveal .24s both; }
.level2-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 18px; color: var(--warning); background: var(--warning-soft); }
.level2-card h2 { font-size: 24px; }
.level2-card p { color: var(--text-sub); font-size: 12px; }
.level2-note { margin: 14px 0; padding: 10px; border-radius: 10px; color: var(--warning); background: var(--warning-soft); font-size: 10px; }
.level3-scrim { align-items: stretch; padding: 0; background: #153E37; }
.level3-card { width: 100%; display: flex; flex-direction: column; justify-content: center; padding: 46px 24px 30px; color: white; }
.level3-card .level3-icon { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 24px; border: 1px solid rgba(255,255,255,.2); border-radius: 22px; color: #F5C583; background: rgba(255,255,255,.07); }
.level3-card .panel-kicker { color: #A9CFC2; }
.level3-card h2 { margin-bottom: 14px; font-size: 31px; }
.level3-card > p { color: #C7DCD5; font-size: 14px; line-height: 1.85; }
.level3-evidence { display: flex; gap: 10px; margin: 20px 0; }
.level3-evidence span { flex: 1; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); color: #E1EEE9; font-size: 11px; text-align: center; }
.level3-advice { margin: 4px 0 20px; padding: 16px; border-left: 3px solid #E5A955; border-radius: 0 12px 12px 0; background: rgba(255,255,255,.07); }
.level3-advice strong { display: block; margin-bottom: 6px; color: #F5C583; }
.level3-advice p { margin: 0; color: #D8E7E2; font-size: 12px; }
.level3-card .button-primary { background: #F4F8F5; color: #153E37; }
.level3-card .button-secondary { border-color: rgba(255,255,255,.25); background: transparent; color: white; }
.level3-footnote { margin-top: 16px; color: #9FBFB3 !important; font-size: 10px !important; text-align: center; }

/* Workbench shell */
.workbench-shell { min-height: calc(100vh - var(--header-h)); }
.wb-sidebar { position: fixed; z-index: 45; top: var(--header-h); bottom: 0; left: 0; width: var(--sidebar-w); display: flex; flex-direction: column; padding: 18px 14px; overflow-y: auto; border-right: 1px solid var(--border); background: rgba(248,250,248,.97); }
.wb-project { display: flex; align-items: center; gap: 10px; padding: 2px 7px 20px; border-bottom: 1px solid var(--border); }
.project-symbol { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); }
.wb-project strong { display: block; font-size: 12px; }
.wb-project small { display: block; color: var(--text-sub); font-size: 10px; }
.wb-nav { margin-top: 18px; }
.nav-section-label { padding: 0 10px 8px; color: #91A098; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.wb-nav a { min-height: 42px; display: flex; align-items: center; gap: 11px; margin: 3px 0; padding: 9px 11px; border-radius: 10px; color: var(--text-sub); font-size: 12px; transition: .16s; }
.wb-nav a span { flex: 1; }
.wb-nav a:hover { color: var(--primary); background: #EDF3EF; }
.wb-nav a.active { color: white; background: var(--primary); font-weight: 700; box-shadow: 0 6px 14px rgba(11,107,93,.14); }
.wb-nav a.restricted:not(.active) { color: #9CA8A1; }
.wb-nav a.restricted:not(.active):hover { color: var(--warning); background: var(--warning-soft); }
.sidebar-study-card { margin-top: auto; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: white; }
.study-progress { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 10px; }
.sidebar-study-card p { margin: 7px 0; color: var(--text-sub); font-size: 10px; }
.sidebar-study-card > span { display: flex; align-items: center; gap: 5px; color: var(--success); font-size: 9px; }
.sidebar-role { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.role-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #DCE8E1; color: var(--primary); font-weight: 750; }
.sidebar-role strong { display: block; font-size: 11px; }
.sidebar-role small { display: block; color: var(--text-sub); font-size: 9px; }
.wb-main { min-width: 0; margin-left: var(--sidebar-w); }
.wb-topbar { position: sticky; z-index: 35; top: var(--header-h); min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 28px; border-bottom: 1px solid var(--border); background: rgba(250,252,249,.93); backdrop-filter: blur(14px); }
.wb-breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--text-sub); font-size: 11px; }
.wb-breadcrumb strong { color: var(--text); }
.wb-menu-button { display: none; }
.wb-top-actions { display: flex; align-items: center; gap: 20px; }
.sync-status { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 10px; }
.role-switcher { display: flex; align-items: center; gap: 8px; }
.role-switcher > span { display: flex; align-items: center; gap: 5px; color: var(--text-sub); font-size: 10px; }
.role-switcher select { max-width: 260px; min-height: 34px; padding: 5px 28px 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: white; font-size: 10px; }
.workbench-content { max-width: 1560px; margin: 0 auto; padding: 26px 28px 44px; }

/* Workbench modules */
.research-banner { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; margin-bottom: 20px; padding: 22px 24px; overflow: hidden; border-radius: var(--radius-lg); background: #174C43; color: white; }
.research-banner::after { content: "RCT"; position: absolute; right: 170px; top: -28px; color: rgba(255,255,255,.045); font-family: var(--display); font-size: 120px; font-weight: 700; line-height: 1; }
.research-banner h2 { margin: 0 0 6px; font-size: 23px; }
.research-banner p { margin: 0; color: #C1D7CF; font-size: 11px; }
.research-banner .banner-meta { position: relative; z-index: 1; display: flex; gap: 26px; }
.research-banner .banner-meta div { text-align: right; }
.research-banner .banner-meta strong { display: block; font-family: var(--display); font-size: 23px; }
.research-banner .banner-meta span { color: #B6CFC6; font-size: 9px; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .spacer { flex: 1; }
.info-strip { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #D5E3EB; border-radius: 11px; background: var(--info-soft); color: var(--info); font-size: 11px; }
.info-strip.warning { border-color: #EFD7B8; background: var(--warning-soft); color: var(--warning); }
.info-strip.danger { border-color: #EECACA; background: var(--danger-soft); color: var(--danger); }
.info-strip p { margin: 0; }
.blind-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; background: var(--info-soft); color: var(--info); font-size: 10px; font-weight: 700; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #E9EEE9; font-size: 12px; }
.detail-list dt { color: var(--text-sub); }
.detail-list dd { margin: 0; font-weight: 550; }
.drawer-section { margin-top: 24px; }
.drawer-section h3 { margin-bottom: 12px; font-family: var(--body); font-size: 13px; }
.drawer-section:first-child { margin-top: 0; }
.detail-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.detail-metric { padding: 12px 8px; border-radius: 10px; background: var(--surface-muted); text-align: center; }
.detail-metric strong { display: block; font-family: var(--display); font-size: 20px; }
.detail-metric span { color: var(--text-sub); font-size: 9px; }
.timeline { position: relative; margin-left: 8px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: -21px; top: 6px; width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.timeline-item.warning::before { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item p { margin: 3px 0; color: var(--text-sub); font-size: 11px; }
.timeline-item small { color: #8B9992; font-size: 10px; }
.intervention-summary { display: flex; align-items: center; gap: 12px; }
.level-badge { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--primary); background: var(--primary-soft); font-family: var(--display); font-size: 19px; font-weight: 700; }
.level-badge.level-2 { color: var(--warning); background: var(--warning-soft); }
.level-badge.level-3 { color: var(--danger); background: var(--danger-soft); }
.sensor-reading { font-family: var(--mono); font-size: 11px; }
.sensor-reading small { display: block; color: var(--text-sub); font-family: var(--body); font-size: 9px; }
.followup-progress { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.followup-progress .progress-track { flex: 1; }
.followup-progress span { color: var(--text-sub); font-size: 10px; }
.quality-value { max-width: 220px; color: var(--text-sub); font-size: 11px; }
.quality-value del { color: var(--danger); }
.quality-value strong { display: block; color: var(--text); font-weight: 600; }
.model-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin-bottom: 20px; }
.model-card { position: relative; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: white; }
.model-card.released { border-color: #A8CBBD; box-shadow: inset 0 3px 0 var(--primary); }
.model-version { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.model-version strong { font-family: var(--mono); font-size: 13px; }
.model-card h3 { margin: 0 0 16px; font-family: var(--body); font-size: 16px; }
.auc-score { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 18px; }
.auc-score strong { font-family: var(--display); font-size: 42px; line-height: 1; }
.auc-score span { padding-bottom: 4px; color: var(--text-sub); font-size: 10px; }
.model-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.model-metric { padding: 10px; border-radius: 9px; background: var(--surface-muted); }
.model-metric span { display: block; color: var(--text-sub); font-size: 9px; }
.model-metric strong { font-family: var(--mono); font-size: 14px; }
.model-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--text-sub); font-size: 10px; }
.score-bar { margin: 10px 0; }
.score-bar .progress-meta { margin-bottom: 4px; }
.score-bar .progress-track { height: 5px; }
.snapshot-list { display: flex; flex-direction: column; gap: 10px; }
.snapshot-item { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.snapshot-item > .icon { color: var(--primary); }
.snapshot-item > div { flex: 1; min-width: 0; }
.snapshot-item strong { display: block; font-family: var(--mono); font-size: 11px; }
.snapshot-item small { display: block; color: var(--text-sub); font-size: 9px; }
.permission-note { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.audit-result { display: inline-flex; align-items: center; gap: 5px; }

/* Modal, drawer, toast */
#modal-root:empty { display: none; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15,36,31,.54); backdrop-filter: blur(3px); animation: fadeIn .18s both; }
.modal { width: min(100%,520px); max-height: min(90vh,800px); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: white; box-shadow: 0 24px 80px rgba(15,36,31,.25); animation: reveal .22s both; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 24px; }
.modal-header p { margin: 5px 0 0; color: var(--text-sub); font-size: 11px; }
.modal-body, .drawer-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-muted); }
.modal-danger .modal-header { border-top: 4px solid var(--danger); }
.drawer-backdrop { place-items: stretch end; padding: 0; }
.drawer { width: min(460px,100%); height: 100%; display: flex; flex-direction: column; background: white; box-shadow: -20px 0 60px rgba(15,36,31,.18); animation: drawerIn .24s both; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .5; } }
.drawer-body { flex: 1; }
.confirm-copy { color: var(--text-sub); line-height: 1.8; }
.confirm-copy strong { color: var(--text); }
.confirm-checklist { margin: 16px 0; padding: 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.confirm-checklist ul { margin: 6px 0 0; padding-left: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.toast-region { position: fixed; z-index: 150; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast { min-width: 260px; max-width: 420px; display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border: 1px solid #C7DED3; border-radius: 12px; background: white; color: var(--text); box-shadow: var(--shadow-md); animation: toastIn .24s both; pointer-events: auto; font-size: 12px; }
.toast .icon { color: var(--success); margin-top: 1px; }
.toast.error { border-color: #EECACA; }
.toast.error .icon { color: var(--danger); }
.toast.warning .icon { color: var(--warning); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* Design specification page */
.design-page { max-width: 1280px; margin: 0 auto; padding: 32px 32px 56px; }
.design-hero { position: relative; display: grid; grid-template-columns: 1.4fr .8fr; gap: 40px; align-items: end; min-height: 320px; margin-bottom: 28px; padding: 44px; overflow: hidden; border-radius: 28px; background: #174C43; color: white; }
.design-hero::after { content: ""; position: absolute; right: -70px; top: -70px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.design-hero .panel-kicker { color: #A9CFC2; }
.design-hero h1 { max-width: 660px; margin-bottom: 18px; font-size: 44px; }
.design-hero p { max-width: 650px; margin-bottom: 0; color: #C8DCD5; line-height: 1.9; }
.design-hero-meta { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.design-hero-meta div { padding: 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.055); }
.design-hero-meta strong { display: block; font-family: var(--display); font-size: 25px; }
.design-hero-meta span { color: #B6CFC6; font-size: 10px; }
.design-nav { position: sticky; z-index: 20; top: calc(var(--header-h) + 10px); display: flex; gap: 6px; margin-bottom: 24px; padding: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.94); }
.design-nav a { flex: 1; min-width: max-content; padding: 8px 12px; border-radius: 8px; color: var(--text-sub); text-align: center; font-size: 11px; }
.design-nav a:hover { color: var(--primary); background: var(--primary-soft); }
.design-section { scroll-margin-top: 140px; margin-bottom: 24px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(255,255,255,.96); }
.design-section-heading { display: grid; grid-template-columns: 52px 1fr; gap: 16px; margin-bottom: 24px; }
.design-section-index { color: #B4C8BD; font-family: var(--display); font-size: 36px; line-height: 1.2; }
.design-section-heading h2 { margin: 0 0 5px; font-size: 28px; }
.design-section-heading p { margin: 0; color: var(--text-sub); }
.principle-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.principle-card { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-muted); }
.principle-card > .icon { margin-bottom: 14px; color: var(--primary); }
.principle-card h3 { font-family: var(--body); font-size: 14px; }
.principle-card p { margin: 0; color: var(--text-sub); font-size: 12px; }
.flow-steps { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.flow-step { min-width: 130px; flex: 1; padding: 15px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.flow-step span { display: block; margin-bottom: 8px; color: var(--primary); font-family: var(--mono); font-size: 10px; }
.flow-step strong { display: block; font-size: 12px; }
.flow-step small { color: var(--text-sub); font-size: 10px; }
.flow-arrow { display: grid; place-items: center; color: #94A59B; }
.token-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 10px; }
.swatch { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: white; }
.swatch-color { height: 64px; }
.swatch-copy { padding: 9px; }
.swatch-copy strong { display: block; font-size: 10px; }
.swatch-copy code { color: var(--text-sub); font-family: var(--mono); font-size: 9px; }
.type-specimen { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.type-specimen:last-child { border-bottom: 0; }
.type-specimen > span { color: var(--text-sub); font-family: var(--mono); font-size: 10px; }
.type-display { font-family: var(--display); font-size: 32px; }
.type-body { font-size: 15px; }
.component-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--border); }
.component-row:last-child { border-bottom: 0; }
.component-row > .component-label { width: 120px; color: var(--text-sub); font-size: 11px; }
.spec-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.spec-list { margin: 0; padding: 0; list-style: none; }
.spec-list li { display: flex; gap: 9px; margin-bottom: 12px; color: var(--text-sub); font-size: 12px; }
.spec-list .icon { margin-top: 3px; color: var(--primary); }
.guide-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.guide-step { padding: 18px; border-radius: 14px; background: var(--surface-muted); border: 1px solid var(--border); }
.guide-step strong { display: block; margin-bottom: 8px; }
.guide-step p { margin: 0; color: var(--text-sub); font-size: 11px; }
.guide-number { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-bottom: 12px; border-radius: 8px; background: var(--primary); color: white; font-family: var(--mono); font-size: 11px; }
.prototype-disclaimer { display: flex; gap: 12px; margin-top: 22px; padding: 16px; border-radius: 13px; background: var(--warning-soft); color: var(--warning); }
.prototype-disclaimer p { margin: 0; font-size: 11px; }

/* Responsive */
@media (max-width: 1240px) {
  .mobile-stage { grid-template-columns: 220px minmax(390px,430px); }
  .mobile-context-panel { display: none; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .model-grid { grid-template-columns: 1fr; }
  .model-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
  .model-version, .model-card h3, .model-foot { grid-column: 1 / -1; }
  .model-foot { margin-top: 0; }
  .token-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 1023px) {
  .global-header { grid-template-columns: auto 1fr auto; padding: 0 18px; }
  .brand-copy small { display: none; }
  .surface-nav a { padding-inline: 12px; }
  .wb-sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 20px 0 50px rgba(23,52,47,.12); }
  body.wb-nav-open .wb-sidebar { transform: translateX(0); }
  .wb-main { margin-left: 0; }
  .wb-menu-button { display: inline-grid; }
  .wb-topbar { padding-inline: 18px; }
  .sync-status { display: none; }
  .workbench-content { padding: 22px 20px 40px; }
  .content-grid, .content-grid.equal, .content-grid.wide-right { grid-template-columns: 1fr; }
  .design-hero { grid-template-columns: 1fr; min-height: 0; padding: 36px; }
  .design-hero-meta { max-width: 480px; }
  .principle-grid { grid-template-columns: 1fr; }
  .guide-steps { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  :root { --header-h: 108px; }
  .global-header { height: var(--header-h); grid-template-columns: 1fr auto; grid-template-rows: 56px 52px; gap: 0 12px; padding: 0 14px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .brand-copy strong { font-size: 18px; }
  .global-actions { grid-column: 2; grid-row: 1; }
  .surface-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin-bottom: 7px; }
  .surface-nav a { flex: 1; justify-content: center; min-height: 36px; padding: 7px 8px; font-size: 11px; }
  .mobile-stage { display: block; padding: 16px 12px 30px; }
  .scenario-panel { position: static; margin-bottom: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.72); }
  .scenario-panel h2 { display: inline; margin-right: 8px; font-size: 20px; }
  .scenario-panel > p { display: inline; font-size: 10px; }
  .scenario-panel .panel-kicker { margin-bottom: 3px; }
  .scenario-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin-top: 12px; }
  .scenario-button { min-height: 42px; justify-content: center; padding: 8px; font-size: 10px; }
  .scenario-button > .icon:last-child { display: none; }
  .scenario-note { display: none; }
  .phone-column { max-width: 430px; margin: 0 auto; }
  .phone-frame { height: calc(100vh - 230px); min-height: 620px; }
  .wb-topbar { top: var(--header-h); }
  .role-switcher > span { display: none; }
  .role-switcher select { max-width: 190px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 28px; }
  .list-card-grid { grid-template-columns: 1fr; }
  .research-banner { grid-template-columns: 1fr; }
  .research-banner .banner-meta { justify-content: flex-start; }
  .research-banner .banner-meta div { text-align: left; }
  .table-result { flex-basis: 100%; margin-left: 0; }
  .design-page { padding: 20px 14px 40px; }
  .design-hero { padding: 28px 22px; border-radius: 20px; }
  .design-hero h1 { font-size: 34px; }
  .design-section { padding: 22px 18px; }
  .design-nav { top: calc(var(--header-h) + 6px); }
  .spec-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
}
@media (max-width: 520px) {
  .mock-badge { display: none; }
  .surface-nav a { gap: 5px; font-size: 10px; }
  .brand-copy strong { font-size: 17px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 15px; }
  .metric-value { font-size: 28px; }
  .metric-top { margin-bottom: 12px; }
  .workbench-content { padding: 18px 12px 32px; }
  .wb-topbar { padding-inline: 12px; }
  .wb-breadcrumb > span, .wb-breadcrumb > .icon { display: none; }
  .role-switcher select { max-width: 170px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .content-grid { gap: 14px; }
  .panel-header, .panel-body { padding-inline: 15px; }
  .table-toolbar { padding: 14px; }
  .table-toolbar .field, .input-with-icon { width: 100%; min-width: 0; }
  .research-banner { padding: 20px; }
  .research-banner .banner-meta { gap: 18px; }
  .model-card { display: block; }
  .list-card-grid { gap: 12px; }
  .token-grid { grid-template-columns: repeat(2,1fr); }
  .design-hero-meta { gap: 8px; }
  .design-hero h1 { font-size: 30px; }
  .design-section-heading { grid-template-columns: 38px 1fr; gap: 10px; }
  .design-section-heading h2 { font-size: 24px; }
  .guide-steps { grid-template-columns: 1fr; }
  .type-specimen { grid-template-columns: 90px 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal-header, .modal-body, .drawer-body { padding-inline: 17px; }
  .modal-footer { padding-inline: 17px; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; }
  .toast { min-width: 0; width: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
