:root {
  --bg: #f4f7f7;
  --surface: #fff;
  --text: #183632;
  --muted: #63746f;
  --border: #dce5e2;
  --accent: #087a65;
  --accent-hover: #056451;
  --accent-soft: #e9f5ef;
  --danger: #a63434;
  --danger-soft: #fdf0ee;
  --warning: #865511;
  --warning-soft: #fff5e2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
input:disabled { color: var(--muted); background: var(--bg); }
:focus-visible { outline: 3px solid #59b6a0; outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; padding: 12px; background: var(--surface); z-index: 10; }
.skip-link:focus { top: 8px; }
.topbar { min-height: 76px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 16px 36px; gap: 16px; }
.brand, .topbar-actions { display: flex; align-items: center; gap: 16px; }
.brand { font-size: 17px; font-weight: 650; line-height: 1.3; letter-spacing: -.3px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--accent); color: #fff; border-radius: 8px; font-size: 15px; letter-spacing: -1px; }
.brand-subtitle { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .08em; margin-top: 3px; }
.dashboard { max-width: 1200px; margin: 0 auto; padding: 36px 32px 20px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.35; letter-spacing: -.5px; font-weight: 650; }
h2 { font-size: 17px; line-height: 1.5; font-weight: 650; }
.eyebrow { font-size: 11px; letter-spacing: .1em; color: var(--muted); font-weight: 650; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 13px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 8px; }
.user-label { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; text-align: right; }
.badge { display: inline-flex; flex-shrink: 0; align-items: center; border-radius: 5px; padding: 3px 9px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.simulation { background: var(--accent-soft); color: var(--accent-hover); border: 1px solid #cfe7db; }
.neutral { background: #edf1f0; color: var(--muted); }
.positive { background: var(--accent-soft); color: var(--accent-hover); }
.warning { background: var(--warning-soft); color: var(--warning); }
.negative { background: var(--danger-soft); color: var(--danger); }
.mode-notice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #d3e7dc; background: #edf6f1; padding: 12px 16px; border-radius: 6px; color: #366353; font-size: 12px; margin-bottom: 24px; }
.mode-notice strong { color: #275542; margin-right: 8px; }
.notice-dot { flex: 0 0 6px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-top: 7px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 24px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 24px; }
.panel-heading .muted { margin-top: 5px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { margin-bottom: 22px; }
label { font-size: 13px; font-weight: 650; display: block; margin-bottom: 8px; }
.label-hint { color: var(--muted); font-size: 11px; font-weight: 400; margin-left: 4px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.key-state { font-size: 11px; color: var(--muted); }
input { border: 1px solid #cbd9d3; border-radius: 5px; width: 100%; min-width: 0; padding: 10px 12px; background: var(--surface); color: var(--text); font-size: 13px; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus { border-color: var(--accent); }
.field-help { font-size: 11px; color: var(--muted); margin-top: 7px; }
.button { border: 1px solid transparent; border-radius: 5px; padding: 9px 16px; line-height: 1.5; font-size: 12px; font-weight: 650; transition: background-color .15s; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
.secondary { background: var(--surface); border-color: #ccd9d3; color: var(--text); }
.secondary:hover:not(:disabled), .quiet:hover:not(:disabled) { background: #edf3f0; }
.quiet { color: var(--muted); background: transparent; }
.compact { padding: 3px 8px; }
.form-actions { display: flex; gap: 10px; padding-top: 2px; }
.action-help { margin-top: 14px; color: var(--muted); font-size: 11px; }
.feedback { font-size: 12px; padding: 10px 12px; margin-top: 16px; background: #eef3f1; color: var(--muted); border-radius: 5px; overflow-wrap: anywhere; }
.feedback.error { background: var(--danger-soft); color: var(--danger); }
.feedback.success { background: var(--accent-soft); color: var(--accent-hover); }
.page-feedback { margin: 0 0 20px; }
.reload-button { margin-top: 8px; padding-left: 0; text-decoration: underline; text-underline-offset: 3px; }
.service-status { display: flex; align-items: flex-start; gap: 12px; padding: 0 0 24px; }
.health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; background: #8c9f96; }
.health-dot.positive { background: var(--accent); }
.health-dot.warning { background: #bd8627; }
.health-dot.negative { background: var(--danger); }
.service-status strong { display: block; font-size: 15px; margin-bottom: 6px; }
.service-status .muted { font-size: 12px; }
.status-facts { margin: 0; border-top: 1px solid var(--border); padding-top: 8px; }
.status-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 12px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.status-footer { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 20px; color: var(--muted); font-size: 12px; }
.status-footer > p + p { margin-top: 10px; }
.recent-panel { margin-top: 24px; }
.recent-panel .panel-heading { margin-bottom: 16px; }
.empty-state { text-align: center; padding: 24px 12px 32px; color: var(--muted); }
.empty-symbol { font-size: 24px; color: #a2b7ac; margin-bottom: 8px; }
.empty-state strong { display: block; color: #566e61; font-size: 13px; }
.empty-state p { font-size: 12px; margin-top: 6px; }
.recent-list { list-style: none; padding: 0; margin: 0; }
.decision-row { display: grid; grid-template-columns: 152px minmax(0, 1fr) 144px; gap: 20px; padding: 18px 0; border-top: 1px solid var(--border); }
.decision-pair { font-weight: 650; display: block; font-size: 13px; overflow-wrap: anywhere; }
.decision-status { color: var(--muted); font-size: 11px; margin-top: 5px; }
.decision-reason { color: #52695d; font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
.decision-time { font-size: 11px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.page-footer { padding-top: 24px; text-align: center; color: var(--muted); font-size: 11px; }
.page-footer span { padding: 0 8px; }
.login-layout { max-width: 1060px; min-height: calc(100vh - 78px); margin: 0 auto; padding: 60px 36px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 80px; }
.login-intro h1 { font-size: 34px; margin: 14px 0 20px; }
.lead { max-width: 360px; line-height: 1.9; color: var(--muted); font-size: 15px; }
.login-note { display: flex; gap: 14px; margin-top: 40px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.note-line { width: 3px; background: #b6d7c8; flex-shrink: 0; border-radius: 1px; }
.login-panel { padding: 32px; }
.login-panel > .muted { margin: 8px 0 24px; }
.full-width { width: 100%; }
@media (min-width: 1440px) { .dashboard { padding-top: 44px; } }
@media (max-width: 850px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .login-layout { gap: 36px; padding: 40px 24px; }
  .login-intro h1 { font-size: 28px; }
  .login-panel { padding: 24px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; min-height: 66px; gap: 8px; }
  .brand { font-size: 14px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 12px; }
  .brand-subtitle { font-size: 10px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .button { padding: 8px; font-size: 11px; }
  .dashboard { padding: 24px 16px 16px; }
  h1 { font-size: 24px; }
  .page-heading { display: block; margin-bottom: 20px; }
  .user-label { display: block; margin-top: 12px; text-align: left; }
  .mode-notice { padding: 12px; margin-bottom: 20px; }
  .workspace-grid { gap: 20px; }
  .panel { padding: 20px 16px; }
  .panel-heading { margin-bottom: 20px; gap: 8px; }
  .config-panel .panel-heading { flex-wrap: wrap; }
  .form-actions { gap: 8px; }
  .form-actions .button { flex: 1; }
  .recent-panel { margin-top: 20px; }
  .decision-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .decision-time { text-align: left; }
  .decision-meta { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
  .login-layout { min-height: auto; grid-template-columns: minmax(0, 1fr); padding: 32px 16px; gap: 28px; }
  .login-intro h1 { font-size: 26px; margin: 8px 0 12px; }
  .lead { font-size: 13px; }
  .login-note { margin-top: 20px; }
  .login-panel { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
