/* Shared design tokens and component appearance, including responsive refinements.
   Load after the page stylesheet; keep Agent appearance in the .agent-page rules. */
@font-face {
  font-family: 'Pretendard';
  src: url('/static/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light;
  --ui-canvas: #f3f6f5;
  --ui-surface: #fff;
  --ui-subtle: #eaf1ee;
  --ui-ink: #183438;
  --ui-muted: #526663;
  --ui-primary: #07695d;
  --ui-hover: #055348;
  --ui-nav: #102e32;
  --ui-line: #d9e3df;
  --ui-input-line: #9aafa7;
  --ui-focus: #087a68;
  --ui-font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  --ui-font-body: 15px;
  --ui-font-note: 12px;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 24px;
  --ui-space-6: 32px;
  --ui-radius-control: 8px;
  --ui-radius-panel: 12px;
  /* Compatibility tokens used by the incumbent Power Lab components. */
  --ink: var(--ui-ink);
  --muted: var(--ui-muted);
  --line: var(--ui-line);
  --green: var(--ui-primary);
  --bg: var(--ui-canvas);
}
html { scroll-padding-top: 100px; }
body { background: var(--ui-canvas); color: var(--ui-ink); font-family: var(--ui-font); }
body * { font-family: inherit; }
pre, code, pre *, code * { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
button, input, select, textarea { font-family: var(--ui-font); accent-color: var(--ui-primary); caret-color: var(--ui-primary); }
button, a, input, select, textarea, summary { touch-action: manipulation; }
a { color: var(--ui-primary); text-underline-offset: .22em; }
::selection { background: #c8e7dc; color: #102e32; }
::placeholder { color: var(--ui-muted); opacity: 1; }
:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 3px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible, svg [role=button]:focus-visible {
  outline: 3px solid var(--ui-focus); outline-offset: 3px;
}
main:focus { outline: none; }
button, a { transition: background-color .16s, color .16s, border-color .16s; }
button:disabled { cursor: not-allowed; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: #a3b9af transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: #a3b9af; border-radius: 4px; }
.ui-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.skip-link {
  position: fixed; top: 12px; left: 16px; transform: translateY(-200%); z-index: 2000;
  background: white; color: var(--ui-ink); padding: 12px 18px; border-radius: 8px;
}
.skip-link:focus { transform: none; }

/* Power Lab: a compact operating desk, with space reserved for real data. */
.power-page, .scenario-page { font-size: var(--ui-font-body); line-height: 1.75; }
.power-page .sidebar { width: 252px; padding: 28px 18px; background: var(--ui-nav); color: #d5e4df; }
.power-page main { margin-left: 252px; max-width: 1740px; padding: 0 32px 32px; }
.power-page header { height: 64px; font-size: 13px; }
.power-page header .quiet { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; }
.brand { letter-spacing: .05em; }
.brand-icon { border: 0; background: #254b4b; border-radius: 10px; }
.brand small { font-size: 10px; letter-spacing: .08em; color: #b6cdc6; }
.power-page .sidebar-label { color: #b6cdc6; font-size: 12px; margin: 32px 8px 12px; }
.power-page .step { padding: 12px 10px; gap: 10px; color: #c0d5cf; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.power-page .step.active { background: #28504f; color: white; }
.power-page .step:hover { background: #204345; filter: none; }
.power-page .step-number { font-size: 12px; }
.power-page .step small { font-size: 12px; opacity: 1; color: #b6cdc6; margin-top: 3px; }
.power-page .step.done .step-number { background: #387c69; border-color: #78b7a2; }
.power-page .sidebar-bottom { color: #b6cdc6; font-size: 12px; }
.sidebar :focus-visible, .sidebar button:focus-visible, .sidebar a:focus-visible { outline-color: #a5e1ce; }
.hero { padding: 28px 0 24px; align-items: flex-start; }
.hero h1 { font-size: clamp(26px, 2.4vw, 36px); line-height: 1.35; letter-spacing: -.025em; margin: 0 0 12px; text-wrap: balance; }
.hero p { max-width: 62ch; font-size: 15px; line-height: 1.7; }
.hero-badge { min-width: 190px; padding-left: 24px; font-size: 12px; }
.hero-badge strong { font-size: 24px; font-weight: 650; line-height: 1.65; }
.hero-badge small { font-size: 12px; }
.view-navigation { background: var(--ui-canvas); backdrop-filter: none; gap: 20px; margin-bottom: 12px; }
.view-navigation .view-tabs { gap: 28px; }
.view-navigation .view-tabs button { font-size: 15px; padding: 14px 0; }
.view-tabs button small { font-size: 12px; color: var(--ui-muted); margin-top: 3px; }
.view-navigation > .secondary { font-size: 13px; padding: 10px 14px; }
.run-picker { display: grid; gap: 4px; flex: 1; max-width: 330px; min-width: 190px; padding: 8px 0; }
.run-picker > span { font-size: 12px; color: var(--ui-muted); }
.power-page .run-picker select { width: 100%; font-size: 13px; height: 44px; }
.tab-badge { font-size: 10px; color: var(--ui-muted); background: #e2eae6; }
.view-hint, .course-note { font-size: 13px; color: var(--ui-muted); margin: 10px 0 18px; }
.controls { padding: 20px; gap: 16px; border-radius: 12px; }
.controls label { font-size: 13px; font-weight: 500; gap: 7px; min-width: 130px; }
.controls label:first-child { min-width: 245px; max-width: 100%; }
.power-page input, .power-page select, .scenario-page select {
  height: 48px; min-height: 44px; line-height: 1.4; padding: 10px 12px; border-color: var(--ui-input-line); border-radius: 8px; font-size: 14px;
}
.controls > .primary { min-height: 48px; }
.primary, .secondary { min-height: 44px; padding: 11px 18px; border-radius: 8px; font-size: 14px; }
.primary { background: var(--ui-primary); color: white; }
.primary:hover:not(:disabled) { background: var(--ui-hover); filter: none; }
.secondary { background: var(--ui-subtle); color: var(--ui-primary); border-color: #bfd1c7; }
.secondary:hover:not(:disabled) { background: #dfeae4; filter: none; }
.quiet { font-size: 13px; color: var(--ui-muted); }
.quiet:hover { color: var(--ui-primary); }
.power-page h2 { font-size: 18px; letter-spacing: -.02em; }
.power-page h3 { font-size: 16px; }
.card { border-color: var(--ui-line); border-radius: var(--ui-radius-panel); padding: var(--ui-space-5); box-shadow: none; }
.card-head { gap: 16px; margin-bottom: 22px; }
.card-head p, .history-card p { font-size: 13px; line-height: 1.7; margin-top: 7px; }
.card-head select { min-height: 40px; font-size: 12px; padding: 8px 10px; }
.section-line { margin-bottom: 16px; }
.tag { color: var(--ui-primary); background: #e7f0eb; font-size: 12px; border-radius: 4px; padding: 3px 8px; }
.tag.purple { color: #59418d; background: #f0edf7; }
.kpi-grid { gap: 0; background: white; border: 1px solid var(--ui-line); border-radius: 12px; overflow: hidden; margin-bottom: 24px; }
.kpi { border: 0; border-radius: 0; padding: 22px; }
.kpi + .kpi { border-left: 1px solid var(--ui-line); }
.kpi-label { font-size: 13px; }
.kpi strong { font-size: clamp(24px, 2.15vw, 32px); font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.3; margin: 12px 0 8px; }
.kpi strong small { font-size: 12px; display: inline-block; }
.kpi-note { font-size: 12px; color: var(--ui-muted); }
.dashboard-grid { gap: 24px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.map-body { height: 380px; gap: 10px; }
.map-ranking { max-height: 355px; }
.rank { min-height: 32px; font-size: 12px; padding: 6px; gap: 6px; }
.rank b { font-size: 12px; font-variant-numeric: tabular-nums; }
.rank.selected { background: #e7f0eb; color: var(--ui-primary); }
.chart.tall { height: 350px; }
.footnote, footer, .inline-state, .empty { color: var(--ui-muted); font-size: 12px; line-height: 1.8; }
.legend-gradient, .heatmap > span { font-size: 12px; }
.heatmap { min-width: 720px; gap: 4px; }
.heatmap button { min-height: 28px; }
.heat-card { scroll-padding: 16px; }
table, .business-outcome table { font-size: 13px; font-variant-numeric: tabular-nums; }
th { font-size: 12px; color: var(--ui-muted); background: #f0f5f2; }
td, th { padding: 12px 10px; border-color: var(--ui-line); }
.chart-reading { background: #eaf1ee; color: #36554a; padding: 20px 24px; margin: 20px 0 24px; font-size: 14px; }
.chart-reading p { margin: 8px 0; }
.chart-reading ol { padding-left: 22px; }
.chart-reading li + li { margin-top: 5px; }
.dashboard-progress { border: 1px solid var(--ui-line); border-radius: 12px; padding: 24px; margin: 0 0 24px; background: #fff; color: var(--ui-ink); }
.dashboard-progress h2 { font-size: 20px; margin: 0 0 8px; }
.dashboard-progress > p, .analysis-empty p { color: var(--ui-muted); line-height: 1.8; margin: 8px 0 14px; }
.analysis-empty { padding: 18px; border: 1px dashed var(--ui-line); border-radius: 8px; background: #f5f8f6; font-size: 14px; overflow-wrap: anywhere; }
.analysis-empty strong { display: block; color: var(--ui-ink); }
.analysis-empty .secondary { min-height: 44px; white-space: normal; text-align: left; }
.dashboard-progress .analysis-empty { margin-top: 16px; }
@media (max-width: 760px) { .dashboard-progress { padding: 18px; } .dashboard-progress h2 { font-size: 18px; } }
.flow-disclosure { padding: 0 20px; margin: 18px 0 24px; }
.flow-disclosure > summary { padding: 14px 0; min-height: 48px; color: var(--ui-ink); font-size: 14px; }
.flow-disclosure > summary span { color: var(--ui-muted); font-size: 12px; }
.flow-disclosure .business-flow { padding-bottom: 20px; }
.journey-heading p { font-size: 14px; }
.journey-heading .eyebrow { display: none; }
.journey-node { border-radius: 8px; }
.journey-node strong { font-size: 14px; }
.journey-node small, .journey-state { font-size: 12px; }
.data-journey { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.data-journey li::after { display: none; }
.lesson { padding: 32px; }
.lesson-head h2 { font-size: 28px; line-height: 1.45; margin: 8px 0 12px; }
.lesson-head p, .lesson-block p { font-size: 15px; line-height: 1.85; }
.lesson-head .eyebrow { font-size: 12px; letter-spacing: .06em; }
.lesson-block { padding: 26px 0; }
.movement-card { border-radius: 8px; padding: 20px; background: #f2f6f3; }
.movement-card.process { background: #edf2f5; border-color: #d5e0e6; }
.movement-card p, .movement-card li { font-size: 15px; color: #365047; }
.movement-card h4 { font-size: 16px; }
.business-outcome { border: 1px solid #b9d2c5; background: #f7faf8; padding: 24px; }
.business-outcome h3 { font-size: 20px; }
.outcome-sentence { font-size: 18px; max-width: 72ch; }
.business-check { background: #e7f0e9; border-radius: 8px; }
.business-check p, .business-action { font-size: 15px; }
.presenter-note { background: #edf2f5; }
.presenter-note p { max-width: 72ch; font-size: 16px; }
.technical-detail { color: var(--ui-muted); padding: 12px 0; border-bottom: 1px solid var(--ui-line); }
summary, .technical-detail > summary { font-size: 14px; min-height: 28px; }
.technical-detail > summary, .plain-glossary > summary { padding: 8px 0; min-height: 44px; }
.plain-glossary dl { font-size: 14px; }
.sample-label, .plain-score-guide, .run-actions span { font-size: 13px; color: var(--ui-muted); }
.manual p, .manual li { font-size: 14px; }
pre, .advanced-results pre { font-size: 13px; }
.run-actions { gap: 12px; margin: 20px 0; }
.history-card { gap: 20px; margin-top: 32px; }
.downloads a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px; font-size: 13px; }
.notice { font-size: 14px; background: #fff4df; color: #875016; }
footer { margin-top: 24px; }

/* Presenter: comfortable reading, same controls as the working screen. */
.scenario-page main { max-width: 1120px; padding: 0 32px 48px; }
.scenario-page-header { padding: 32px 0 24px; }
.scenario-page h1 { font-size: 32px; line-height: 1.4; letter-spacing: -.025em; margin: 0 0 12px; }
.scenario-page-header p { font-size: 15px; color: var(--ui-muted); line-height: 1.8; max-width: 68ch; }
.scenario-page-toolbar { gap: 16px; }
.scenario-page-toolbar a, .scenario-page-toolbar label { font-size: 14px; }
.scenario-page-toolbar a { min-height: 44px; display: inline-flex; align-items: center; }
.scenario-page #scenarioPageStatus { font-size: 14px; color: #36554a; background: var(--ui-subtle); padding: 16px 20px; }
.scenario-follow { background: #eaf1ee; backdrop-filter: none; border-radius: 8px; padding: 16px; gap: 12px 16px; font-size: 14px; border-color: #bfd1c7; }
.scenario-follow label { color: var(--ui-ink); min-height: 44px; }
.scenario-follow input { width: 18px; height: 18px; }
.scenario-follow span { font-size: 13px; color: var(--ui-muted); }
.scenario-follow button { font-size: 13px; min-height: 44px; }
.scenario-page #scenarioCourseLinks { margin: 24px 0; gap: 8px; }
.scenario-page #scenarioCourseLinks a { font-size: 13px; min-height: 44px; padding: 10px 14px; border-color: #bfd1c7; color: var(--ui-primary); }
.scenario-opening { background: transparent; padding: 20px 0; border: 0; border-top: 1px solid var(--ui-line); border-radius: 0; }
.scenario-opening p { font-size: 15px; max-width: 75ch; color: var(--ui-muted); }
.scenario-page .demo-scenario { margin: 24px 0 32px; padding: 28px; }
.scenario-page .scenario-heading h2 { font-size: 24px; letter-spacing: -.02em; margin: 0; }
.scenario-context { font-size: 15px; padding: 18px 20px; }
.scenario-speech { border: 0; border-radius: 8px; background: #eaf1ee; padding: 20px 24px; }
.scenario-page .scenario-speech { font-size: 16px; line-height: 1.95; }
.scenario-step { border-radius: 8px; padding: 0 20px; margin: 12px 0; }
.scenario-page .scenario-step summary { padding: 16px 0; font-size: 15px; }
.scenario-step dt { color: #365b4b; font-size: 14px; }
.scenario-page .scenario-step dd { font-size: 16px; max-width: 70ch; line-height: 1.9; }
.scenario-step.current-step { border: 2px solid var(--ui-primary); background: #f2f8f4; }
.demo-scenario li, .scenario-fallback, .scenario-readonly-note { font-size: 14px; color: var(--ui-muted); }
.demo-scenario h3 { font-size: 17px; margin: 24px 0 12px; }
.scenario-page .eyebrow { display: none; }
.scenario-step, .scenario-page .demo-scenario { scroll-margin-top: 180px; }

/* Agent: retain the working layout and the non-shrinking conversation results. */
.agent-page { font-size: 15px; }
.agent-page .sidebar { background: var(--ui-nav); padding: 20px 16px; }
.agent-page .sidebar > * { flex-shrink: 0; }
.agent-page .sidebar-header h2 { font-size: 15px; color: #d5e4df; margin: 12px 4px 8px; }
.agent-page .sidebar-logos { border-radius: 8px; padding: 12px 8px; background: #244547; }
.agent-page .user-badge { background: #244547; color: #d5e4df; border-radius: 8px; }
.agent-page .user-badge-logout { min-height: 36px; display: flex; align-items: center; gap: 5px; }
.agent-page .db-card { background: transparent; border: 1px solid #466361; border-radius: 8px; padding: 16px; }
.agent-page .db-label { font-size: 11px; color: #b6cdc6; letter-spacing: .03em; }
.agent-page .db-value { font-size: 13px; color: #f1f6f3; font-variant-numeric: tabular-nums; }
.agent-page .nav-btn { min-height: 44px; display: flex; align-items: center; gap: 10px; color: #d5e4df; background: transparent; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-size: 14px; }
.agent-page .nav-btn:hover, .agent-page .nav-btn.active { background: #28504f; border-color: #527b72; color: white; }
.agent-page .shortcut-btn { color: #d5e4df; background: #244547; border-color: #466361; min-height: 40px; }
.agent-page .shortcut-btn:hover { background: #28504f; }
.agent-page .sidebar-details summary { color: #d5e4df; font-size: 13px; min-height: 44px; }
.agent-page .sidebar-details summary .ui-icon { margin-right: 6px; }
.agent-page .mcp-section-header { background: transparent; border: 0; width: 100%; padding: 8px 4px; min-height: 44px; color: #d5e4df; text-align: left; }
.agent-page .mcp-label { color: #d5e4df; }
.agent-page .mcp-count { color: #b6cdc6; font-size: 11px; }
.agent-page .mcp-badge { background: #35675d; color: white; }
.agent-page .chat-header, .agent-page .monitor-header, .agent-page .tools-header { padding: 24px 32px 20px; border-bottom: 1px solid var(--ui-line); }
.agent-page .chat-header h1, .agent-page .monitor-header h1, .agent-page .tools-header h1 { font-size: 24px; font-weight: 700; color: var(--ui-ink); letter-spacing: -.025em; }
.agent-page .chat-header-controls { color: var(--ui-muted); font-size: 13px; }
.agent-page .chat-header-controls select, .agent-page .monitor-controls select { min-height: 40px; border-color: var(--ui-input-line); color: var(--ui-ink); }
.message-model { font-size: 12px; line-height: 1.6; font-weight: 650; color: #405e58; border-bottom: 1px solid var(--ui-line); padding-bottom: 8px; margin-bottom: 12px; }
.history-models { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; line-height: 1.6; }
.history-model-label, .history-model-pending { color: var(--ui-muted); }
.history-model-chip { color: var(--ui-ink); background: var(--ui-subtle); border: 1px solid var(--ui-line); border-radius: 6px; padding: 2px 8px; max-width: 100%; overflow-wrap: anywhere; }
.history-model-unknown { color: var(--ui-muted); background: var(--ui-canvas); }
.history-search { display: grid; grid-template-columns: minmax(160px, 230px) minmax(180px, 1fr) auto; gap: 12px; margin-top: 20px; align-items: end; }
.history-search label { display: grid; gap: 6px; min-width: 0; color: var(--ui-muted); font-size: 13px; }
.history-search input, .history-search select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ui-input-line); border-radius: 8px; background: white; color: var(--ui-ink); font-size: 15px; }
.history-search-actions { display: flex; gap: 8px; }
.history-search-actions button, .history-pagination button { min-height: 44px; }
.history-search p { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.6; color: var(--ui-muted); }
.history-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 20px 0; font-size: 13px; }
@media (max-width: 900px) { .history-search { grid-template-columns: 1fr; } .history-search input, .history-search select { font-size: 16px; } }
.agent-page .chat-header-controls { flex-wrap: wrap; }
.agent-page .chat-control-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agent-page .chat-control-field label { white-space: nowrap; }
.agent-page .chat-control-field select { min-height: 44px; }
#answerModelSelect { width: 170px; }
.agent-page .empty-state { color: var(--ui-muted); text-align: center; padding: 32px 16px; gap: 16px; }
.agent-page .empty-state h2 { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.45; color: var(--ui-ink); letter-spacing: -.025em; font-weight: 650; }
.agent-page .empty-icon { width: 64px; height: 64px; display: grid; place-items: center; color: var(--ui-primary); opacity: 1; background: #e3eeE7; border-radius: 16px; }
.agent-page .empty-state p { color: var(--ui-muted); line-height: 1.9; font-size: 15px; font-weight: 400; }
.empty-lab-link { font-size: 14px; min-height: 44px; display: inline-flex; gap: 16px; align-items: center; text-decoration: none; border-bottom: 1px solid #bfd1c7; }
.empty-lab-link:hover { border-color: var(--ui-primary); }
.agent-page .chat-input-area { padding: 16px 32px 24px; }
.agent-page .chat-input-wrapper { border: 1px solid var(--ui-input-line); border-radius: 12px; box-shadow: 0 4px 16px #163d3010; padding: 8px; gap: 8px; }
.agent-page .chat-input-wrapper:focus-within { border-color: var(--ui-primary); box-shadow: 0 4px 16px #163d3010; }
.agent-page #chatInput { font-size: 15px; color: var(--ui-ink); }
.agent-page #chatInput::placeholder { color: var(--ui-muted); }
.agent-page .attach-btn { color: var(--ui-muted); background: #edf3ef; width: 44px; height: 44px; border-radius: 8px; }
.agent-page .send-btn { background: var(--ui-primary); width: 44px; height: 44px; border-radius: 8px; }
.agent-page .send-btn:hover { background: var(--ui-hover); transform: none; }
.agent-page .msg-user { background: #e0eee5; color: var(--ui-ink); border-radius: 12px 12px 4px 12px; }
.agent-page .msg-assistant { background: white; border-color: var(--ui-line); border-radius: 12px; box-shadow: none; }
.agent-page .chat-messages:focus-visible { outline-offset: -4px; }
.chat-job-notice { margin: 12px 32px 0; padding: 12px 16px; border: 1px solid var(--ui-line); border-radius: 8px; background: #fff8e6; color: var(--ui-ink); font-size: 14px; line-height: 1.7; flex-shrink: 0; overflow-wrap: anywhere; }
.chat-job-notice button { margin: 8px 0 0; min-height: 44px; }
@media (max-width: 768px) { .chat-job-notice { margin: 8px 16px 0; } }
.agent-page .msg-user, .agent-page .msg-assistant { font-size: 15px; line-height: 1.8; }
.agent-page .refresh-btn, .agent-page .new-chat-btn, .agent-page .tool-action-btn { min-height: 40px; color: var(--ui-primary); background: #e7f0eb; border-color: #bfd1c7; }
.agent-page .tab-btn.active { color: var(--ui-primary); border-color: var(--ui-primary); background: #e7f0eb; }
.agent-page .tab-btn { min-height: 44px; }
.agent-page .tab-btn:not(.active) { color: var(--ui-muted); }
.agent-page .hc-pill.dim { opacity: 1; color: var(--ui-muted); background: #edf2ef; }
.agent-page .tool-card { box-shadow: none; border-color: var(--ui-line); border-radius: 12px; padding: 20px; }
.agent-page .tool-category-title, .agent-page .tool-name { color: var(--ui-ink); }
.agent-page .tool-desc { color: var(--ui-muted); font-size: 14px; }
.agent-page .tool-mcp-name { color: var(--ui-muted); font-size: 12px; overflow-wrap: anywhere; }
.agent-page .tools-header-sub { color: var(--ui-muted); font-size: 14px; }
.agent-page #toolsView > .tools-header { flex-shrink: 0; }
.tools-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 16px; }
.tools-filters label { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ui-ink); font-size: 13px; }
.tools-filters .tools-search-field { flex: 1 1 280px; }
.tools-filters input, .tools-filters select { width: 100%; min-height: 44px; min-width: 0; padding: 9px 12px; border: 1px solid var(--ui-line); border-radius: 8px; background: #fff; color: var(--ui-ink); font: inherit; font-size: 16px; }
.tools-filters .tool-action-btn { align-self: end; min-height: 44px; }
.tools-search-status { margin-top: 10px; color: var(--ui-muted); font-size: 13px; }
.tools-empty { padding: 32px 16px; border: 1px solid var(--ui-line); border-radius: 12px; background: #fff; color: var(--ui-ink); }
.tools-empty h2 { font-size: 18px; margin-bottom: 8px; }
.tools-empty p { color: var(--ui-muted); line-height: 1.7; }
.agent-page #toolsView .tools-content { min-height: 0; }
.agent-page #toolsView .tool-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.agent-page #toolsView .tool-card { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 768px), (max-height: 560px) {
  .agent-page #toolsView { overflow-y: auto; }
  .agent-page #toolsView .tools-content { flex: 0 0 auto; overflow: visible; }
}
@media (max-width: 768px) {
  .tools-filters .tools-search-field { flex-basis: 100%; }
  .tools-filters > label:not(.tools-search-field) { flex: 1 1 calc(50% - 6px); }
  .tools-filters .tool-action-btn { width: 100%; }
}
.agent-page .chart-card { border-radius: 12px; border-color: var(--ui-line); box-shadow: none; }
.agent-page .chart-card h2 { font-size: 16px; line-height: 1.6; color: var(--ui-ink); text-align: left; margin-bottom: 16px; }
.agent-page .chart-hint { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--ui-muted); }
.agent-page .metric-card { border-radius: 12px; border-color: var(--ui-line); box-shadow: none; }
.agent-page .metric-card:hover { box-shadow: none; transform: none; }
.agent-page .metric-label, .agent-page .metric-sub { color: var(--ui-muted); font-size: 12px; }
.agent-page .metric-value { font-variant-numeric: tabular-nums; }
.agent-page .hc-item, .agent-page .hc-strip { border: 1px solid var(--ui-line); border-radius: 12px; box-shadow: none; }
.agent-page .hc-desc, .agent-page .hc-strip-sub, .agent-page .hc-msg { color: var(--ui-muted); font-size: 13px; }
.agent-page .hc-footer { color: var(--ui-muted); font-size: 12px; }
.agent-page .data-panel-header { min-height: 44px; }
.agent-page .data-panel-header:focus-visible { outline-offset: -4px; }
.agent-page .tool-template-box { background: #f1f6f3; border-color: var(--ui-line); color: var(--ui-muted); font-size: 13px; }
.agent-page .tool-badge-quick { color: var(--ui-primary); background: #e7f0eb; }
.agent-page .mobile-topbar { background: var(--ui-nav); box-shadow: none; }
.agent-page .mobile-topbar-db { color: #d5e4df; }
.agent-page .logo-softline, .login-logos img:last-child { background: #fff; padding: 4px; border-radius: 4px; }

/* Authentication: no changes to form submission or account flow. */
body.login-body { background: var(--ui-canvas); min-height: 100dvh; height: auto; padding: 24px 0; }
.login-card { border-radius: 16px; border: 1px solid var(--ui-line); box-shadow: none; max-width: 440px; padding: 36px; }
.login-logos { background: var(--ui-nav); border-radius: 8px; padding: 18px 12px; margin-bottom: 28px; }
.login-card h1 { font-size: 22px; color: var(--ui-ink); letter-spacing: -.02em; line-height: 1.5; }
.login-sub { font-size: 14px; color: var(--ui-muted); margin: 12px 0 28px; }
.login-field { margin-bottom: 20px; }
.login-field label { font-size: 14px; margin-bottom: 8px; color: var(--ui-ink); }
.login-field input { min-height: 48px; border-color: var(--ui-input-line); border-radius: 8px; font-size: 16px; }
.login-field input:focus { border-color: var(--ui-primary); box-shadow: none; }
.login-submit { min-height: 48px; background: var(--ui-primary); font-size: 16px; border-radius: 8px; }
.login-submit:hover { background: var(--ui-hover); opacity: 1; }
.login-toggle { font-size: 14px; color: var(--ui-muted); }
.login-toggle button { min-height: 44px; border: 0; background: transparent; color: var(--ui-primary); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px; }
.login-toggle button:hover { text-decoration: underline; text-underline-offset: .22em; }

@media (max-width: 1200px) {
  .power-page .view-navigation { flex-wrap: wrap; gap: 0 20px; padding-bottom: 10px; }
  .run-picker { max-width: none; }
  .power-page .sidebar { width: 224px; padding: 24px 14px; }
  .power-page main { margin-left: 224px; padding: 0 24px 24px; }
  .power-page .brand { font-size: 18px; gap: 10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .hero-badge { display: none; }
  .controls label { flex-basis: 28%; }
  .controls label:first-child { flex-basis: 40%; }
  .controls > .primary { flex-grow: 1; }
  .kpi { padding: 18px; }
  .kpi strong { font-size: 24px; }
}
@media (max-width: 768px) {
  .agent-page .chat-header, .agent-page .monitor-header, .agent-page .tools-header { padding: 16px; }
  .agent-page .chat-header h1 { display: block; font-size: 20px; white-space: normal; }
  .agent-page .chat-header-controls { flex-wrap: wrap; width: 100%; }
  .agent-page .chat-control-field { width: 100%; }
  .agent-page .chat-control-field label { width: 76px; flex-shrink: 0; }
  .agent-page .chat-header-controls select { flex: 1; width: 0; min-width: 0; max-width: none; font-size: 16px; }
  .agent-page .chat-messages { padding: 16px; }
  .agent-page .chat-input-area { padding: 12px 16px 16px; }
  .agent-page #chatInput { font-size: 16px; }
  .agent-page .empty-state { padding: 20px 8px; gap: 14px; }
  .agent-page .empty-state p { font-size: 14px; }
  .agent-page .empty-state h2 { font-size: 22px; }
  .agent-page .mobile-topbar-title { font-size: 14px; }
  .agent-page .mobile-topbar-db { font-size: 12px; max-width: 26%; }
  .agent-page .mobile-topbar .menu-btn { width: 44px; height: 44px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 170px; }
  .power-page .sidebar { position: relative; width: 100%; padding: 18px 16px 12px; }
  .power-page main { margin-left: 0; padding: 0 16px 24px; }
  .power-page .brand { font-size: 18px; }
  .power-page .brand small { font-size: 10px; }
  .power-page .sidebar-label { margin: 16px 0 8px; }
  .power-page #steps { gap: 8px; padding: 4px 3px 8px; scroll-snap-type: x proximity; }
  .power-page .step { min-width: 172px; width: 172px; min-height: 64px; padding: 10px; scroll-snap-align: start; }
  .power-page .step > span:last-child { font-size: 13px; }
  .power-page .step small { display: none; }
  .power-page header { height: auto; min-height: 56px; gap: 12px; font-size: 12px; }
  .power-page .breadcrumb span { margin: 0 6px; }
  .power-page header .quiet { font-size: 12px; }
  .hero { padding: 24px 0 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 14px; }
  .view-navigation { gap: 0; padding-bottom: 10px; }
  .view-navigation .view-tabs { gap: 20px; }
  .view-navigation .view-tabs button { font-size: 14px; padding: 12px 0; }
  .view-tabs button small { font-size: 12px; }
  .view-navigation > .secondary { font-size: 12px; min-height: 40px; padding: 8px 12px; }
  .run-picker { flex-basis: 100%; min-width: 0; padding: 4px 0 8px; gap: 2px; }
  .power-page .run-picker select { font-size: 16px; }
  .controls { padding: 16px; gap: 16px 12px; }
  .controls label { flex-basis: calc(50% - 6px); min-width: 0; }
  .controls label:first-child { flex-basis: 100%; min-width: 0; }
  .power-page input, .power-page select, .scenario-page select { font-size: 16px; padding: 10px 8px; }
  .controls label input { width: 100%; }
  .controls > .primary { width: 100%; margin-top: 0; }
  .kpi-grid { gap: 0; }
  .kpi { padding: 18px 14px; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--ui-line); }
  .kpi strong { font-size: 25px; overflow-wrap: anywhere; }
  .kpi-label { font-size: 12px; }
  .kpi-note { font-size: 12px; }
  .dashboard-grid { gap: 18px; }
  .card { padding: 20px 16px; }
  .card-head { gap: 12px; flex-wrap: wrap; }
  .card-head h2 { font-size: 18px; }
  .card-head p { font-size: 13px; }
  .card-head select { font-size: 14px; }
  .chart, .chart.tall { height: 280px; }
  .map-body { flex-wrap: wrap; height: auto; gap: 16px; }
  #powerMap { width: 100%; height: 300px; }
  .map-ranking { max-width: 100%; width: 100%; flex-basis: 100%; max-height: 260px; }
  .rank { min-height: 44px; padding: 8px; font-size: 14px; }
  .rank b { font-size: 14px; }
  .chart-reading { padding: 18px; font-size: 14px; }
  .lesson { padding: 24px 16px; }
  .lesson-head { flex-wrap: wrap; }
  .lesson-head h2 { font-size: 24px; }
  .lesson-head p, .lesson-block p { font-size: 15px; }
  .business-outcome { padding: 18px 14px; }
  .business-outcome h3 { font-size: 18px; }
  .outcome-sentence { font-size: 17px; }
  .business-check { padding: 16px; }
  .movement-card { padding: 16px; }
  .movement-card p, .movement-card li { font-size: 15px; }
  .movement-grid { grid-template-columns: 1fr; }
  .run-actions > button { width: 100%; }
  .scenario-page main { padding: 0 16px 32px; }
  .scenario-page h1 { font-size: 27px; }
  .scenario-page-header { padding: 24px 0 20px; }
  .scenario-page-header p { font-size: 15px; }
  .scenario-page-toolbar select { width: 100%; }
  .scenario-follow { padding: 12px; gap: 8px; }
  .scenario-follow label { font-size: 14px; }
  .scenario-follow span { font-size: 13px; flex-basis: 100%; min-width: 0; }
  .scenario-follow button { font-size: 12px; }
  .scenario-page .demo-scenario { padding: 24px 16px; }
  .scenario-page .scenario-heading h2 { font-size: 22px; }
  .scenario-step { padding: 0 14px; }
  .scenario-step dl { display: block; }
  .scenario-step dt { margin-top: 16px; }
  .scenario-page .scenario-step dd { font-size: 16px; margin: 6px 0 18px; }
  .scenario-speech { padding: 18px; }
  .scenario-step, .scenario-page .demo-scenario { scroll-margin-top: 230px; }
  .login-card { padding: 28px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .skip-link { display: none; }
  .power-page main, .scenario-page main { margin: 0; max-width: none; padding: 0; }
  .power-page .sidebar, .power-page .controls, .power-page .view-navigation { display: none; }
  .scenario-page .demo-scenario { padding: 12px; }
  .scenario-page .scenario-step dd { font-size: 12px; }
  .scenario-step { scroll-margin-top: 0; }
}

#uiLoadError {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  border: 1px solid var(--ui-line, #d6e2dd);
  border-radius: 12px;
  background: var(--ui-surface, #fff);
  color: var(--ui-ink, #183b3c);
  box-shadow: 0 16px 48px #102f3233;
}
#uiLoadError::backdrop { background: #102f3299; }
#uiLoadError h2 { margin: 0 0 12px; font-size: 20px; }
#uiLoadError p { margin: 0 0 20px; line-height: 1.7; }
#uiLoadError button {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--ui-primary, #087f6e);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#uiLoadError button:focus-visible { outline: 2px solid var(--ui-focus, #087f6e); outline-offset: 4px; }
@media print { #uiLoadError { display: none !important; } }
