
:root {
  --color-bg: #FCFCFD; --color-surface: #F2F4F7; --color-surface-subtle: #F8F9FB; --color-divider: #E4E7EC; --color-white: #ffffff;
  --color-text: #1F2430; --color-text-soft: #5A6373; --color-text-faint: #6B7385;
  --color-navy: #0A3D79; --color-navy-100: #E7EEF7; --color-navy-200: #C6D8EC; --color-navy-300: #94B5DA; --color-navy-600: #093260; --color-navy-700: #072747;
  --color-neutral-300: #D0D5DD; --color-neutral-400: #A8B0BD; --color-neutral-700: #414958; --color-neutral-800: #2C3340;
  --color-attention: #8A5A00; --color-attention-bg: #FBF3E4; --color-attention-fill: #C98A12;
  --color-problem: #97321F; --color-problem-bg: #FBEEEB;
  --color-settled: #2F6446; --color-settled-bg: #EDF5F0;
  --chart-1: #0A3D79; --chart-2: #4C82BE; --chart-3: #3E7C8C; --chart-4: #6B7A99; --chart-5: #8A7B5E; --chart-6: #A8B0BD;
  --tex: rgba(255,255,255,.75);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius-sm: 3px; --radius-md: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #12161D; --color-surface: #1A2029; --color-surface-subtle: #161B23; --color-divider: #2A323E; --color-white: #1A2029;
    --color-text: #E4E7EC; --color-text-soft: #A8B0BD; --color-text-faint: #8F98A8;
    --color-navy: #94B5DA; --color-navy-100: #1E2D42; --color-navy-200: #2B4466; --color-navy-300: #4C82BE; --color-navy-600: #C6D8EC; --color-navy-700: #E7EEF7;
    --color-neutral-300: #3A4452; --color-neutral-400: #5A6373; --color-neutral-700: #C5CBD6; --color-neutral-800: #E4E7EC;
    --color-attention: #E8B04A; --color-attention-bg: #2C2412; --color-attention-fill: #E8B04A;
    --color-problem: #F0907C; --color-problem-bg: #33191A;
    --color-settled: #7FC29B; --color-settled-bg: #17271E;
    --chart-1: #94B5DA; --chart-2: #4C82BE; --chart-3: #6FB0BF; --chart-4: #9AA7C4; --chart-5: #BDAE8E; --chart-6: #8A93A3;
    --tex: rgba(18,22,29,.7);
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--color-navy); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 700; } h2 { font-size: 20px; font-weight: 600; margin-top: 32px; } h3 { font-size: 16px; font-weight: 600; color: var(--color-neutral-800); margin-top: 20px; }
p { margin: 0 0 12px; max-width: 72ch; }
small, .small { font-size: 13px; color: var(--color-text-soft); }
a { color: var(--color-navy); }
b, strong { font-weight: 600; }
ul { padding-left: 24px; max-width: 72ch; } li { margin-bottom: 4px; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--color-surface); padding: 2px 5px; border-radius: var(--radius-sm); }
:focus-visible { outline: 2px solid var(--color-navy); outline-offset: 2px; }
.docbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--color-surface); border-bottom: 2px solid var(--color-navy); padding: 8px 16px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.stamp { display: inline-block; background: var(--color-navy); color: var(--color-bg); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius-sm); }
.docfoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; border-top: 1px solid var(--color-divider); padding: 12px 16px; font-size: 12px; color: var(--color-text-faint); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 4px; padding: 8px 12px; border-bottom: 1px solid var(--color-divider); background: var(--color-bg); }
.nav a { padding: 6px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--color-text-soft); font-size: 14px; font-weight: 500; }
.nav a:hover { background: var(--color-surface); }
.nav a[aria-current="page"] { background: var(--color-navy-100); color: var(--color-navy); font-weight: 600; box-shadow: inset 0 -2px 0 var(--color-navy); }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav form { margin: 0; }
.tap { display: inline-block; min-height: 24px; line-height: 24px; }
.menu { position: relative; }
.menu .icon { width: 20px; height: 20px; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md); background: var(--color-white); color: var(--color-navy); cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover, .menu[open] > summary { background: var(--color-navy-100); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 240px; max-width: calc(100vw - 32px); margin: 0; padding: 6px; list-style: none; background: var(--color-white); border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.menu-panel li { margin: 0; }
.menu-panel form { margin: 0; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; font: inherit; font-size: 15px; color: var(--color-text); background: none; border: 0; border-radius: var(--radius-sm); text-align: left; text-decoration: none; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--color-navy-100); }
.menu-panel a[aria-current="page"] { background: var(--color-navy-100); color: var(--color-navy); font-weight: 600; }
.menu-inline > summary { display: inline-flex; min-height: 44px; list-style: none; }
.menu-inline > summary::-webkit-details-marker { display: none; }
.group { background: var(--color-white); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 16px; margin: 0 0 16px; }
.group h3 { margin-top: 0; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; margin: 0 0 12px; }
.facts dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-faint); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.claim-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.claim-form .field { max-width: none; margin: 0; }
.select { width: 100%; min-height: 44px; font-family: var(--font); font-size: 16px; color: var(--color-text); background: var(--color-white); border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md); padding: 9px 12px; }
.input { min-height: 44px; }
.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn, .inline-form .btn { min-height: 44px; }
.env-banner { max-width: none; }
.env-banner p { max-width: none; }
.secret { border-top: 1px solid var(--color-divider); padding-top: 12px; margin-top: 12px; }
.secret p { margin-bottom: 8px; }
.secret .menu-inline { margin: 0 8px 8px 0; display: inline-block; vertical-align: top; }
.secret .menu-inline[open] { display: block; margin-right: 0; }
.rule-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.inline-form { margin: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.btn { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font); font-weight: 500; font-size: 14px; line-height: 1; padding: 9px 16px; border-radius: var(--radius-md); border: 1px solid transparent; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--color-navy); color: var(--color-bg); } .btn-primary:hover { background: var(--color-navy-600); }
.btn-secondary { background: var(--color-white); color: var(--color-navy); border-color: var(--color-neutral-300); } .btn-secondary:hover { background: var(--color-navy-100); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); margin-right: 4px; letter-spacing: .02em; }
.tag-navy { background: var(--color-navy-100); color: var(--color-navy); }
.tag-neutral { background: var(--color-surface); color: var(--color-neutral-700); border: 1px solid var(--color-divider); }
.tag-attention { background: var(--color-attention-bg); color: var(--color-attention); border: 1px solid var(--color-attention); }
.tag-problem { background: var(--color-problem-bg); color: var(--color-problem); border: 1px solid var(--color-problem); }
.tag-settled { background: var(--color-settled-bg); color: var(--color-settled); }
.note { background: var(--color-surface); border-left: 3px solid var(--color-navy); padding: 12px 16px; border-radius: 0 var(--radius-md) var(--radius-md) 0; margin: 0 0 12px; max-width: 80ch; }
.note p:last-child { margin-bottom: 0; }
.note-attention { background: var(--color-attention-bg); border-left-color: var(--color-attention); }
.note-problem { background: var(--color-problem-bg); border-left-color: var(--color-problem); }
.alert-amber { background: var(--color-attention-bg); border: 1px solid var(--color-attention); border-left-width: 5px; color: var(--color-text); }
.empty { background: var(--color-surface); border: 1px dashed var(--color-neutral-300); border-radius: var(--radius-md); padding: 12px 16px; color: var(--color-text-soft); max-width: 80ch; margin: 0 0 12px; }
.grid { display: grid; gap: 12px; margin: 0 0 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--color-white); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 12px 16px; }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-faint); margin: 0 0 4px; }
.kpi-value { font-size: 26px; font-weight: 700; color: var(--color-navy); line-height: 1.1; font-variant-numeric: tabular-nums; margin: 0; }
.kpi-note { font-size: 12px; color: var(--color-text-soft); margin: 4px 0 0; }
.panel { background: var(--color-white); border: 1px solid var(--color-divider); border-radius: var(--radius-md); padding: 16px; margin: 0 0 16px; }
.items { list-style: none; padding: 0; margin: 0 0 16px; max-width: none; }
.items li { padding: 10px 0; border-bottom: 1px solid var(--color-divider); margin: 0; }
.items li:last-child { border-bottom: none; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }
.table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 420px; }
.table caption { text-align: left; font-size: 13px; color: var(--color-text-soft); padding: 0 0 6px; }
.table th { background: var(--color-surface); color: var(--color-neutral-800); text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 8px 12px; border-bottom: 2px solid var(--color-navy); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--color-divider); vertical-align: top; }
.table tbody th { background: none; color: var(--color-text); font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; white-space: normal; border-bottom: 1px solid var(--color-divider); padding: 8px 12px; vertical-align: top; }
.table tbody tr:nth-child(even) td, .table tbody tr:nth-child(even) th { background: var(--color-surface-subtle); }
.table tr.is-over td, .table tr.is-over th { background: var(--color-attention-bg); }
.table tr.total td { background: var(--color-navy-100); color: var(--color-navy); font-weight: 700; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.field { display: block; margin-bottom: 16px; max-width: 420px; }
.field > label { display: block; font-size: 12px; font-weight: 600; color: var(--color-neutral-700); margin-bottom: 4px; }
.input { width: 100%; font-family: var(--font); font-size: 16px; color: var(--color-text); background: var(--color-white); border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md); padding: 9px 12px; }
.login { max-width: 420px; margin: 8vh auto 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; font-size: 14px; }
.filters a { padding: 4px 10px; border: 1px solid var(--color-neutral-300); border-radius: var(--radius-sm); text-decoration: none; }
.filters a[aria-current="true"] { background: var(--color-navy-100); border-color: var(--color-navy); font-weight: 600; }
.chart { margin: 0 0 8px; max-width: 640px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12px; fill: var(--color-text-soft); }
.chart .axis-label { font-size: 11px; }
.chart .value-label { fill: var(--color-text); font-weight: 600; }
.chart .grid-line { stroke: var(--color-divider); stroke-width: 1; }
.chart .axis-line { stroke: var(--color-neutral-400); stroke-width: 1; }
.chart .threshold { stroke: var(--color-attention); stroke-width: 2; stroke-dasharray: 6 4; }
.chart .gap { stroke: var(--color-bg); stroke-width: 2; }
.chart .over-label { fill: var(--color-attention); font-weight: 700; }
.fill-0 { fill: var(--chart-1); } .fill-1 { fill: var(--chart-2); } .fill-2 { fill: var(--chart-3); } .fill-3 { fill: var(--chart-4); } .fill-4 { fill: var(--chart-5); }
.stroke-0 { stroke: var(--chart-1); } .stroke-1 { stroke: var(--chart-2); } .stroke-2 { stroke: var(--chart-3); } .stroke-3 { stroke: var(--chart-4); }
.fill-over { fill: var(--color-attention-fill); }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; }
.marker { stroke: var(--color-bg); stroke-width: 2; }
.tex-line { stroke: var(--tex); stroke-width: 2; }
.tex-dot { fill: var(--tex); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0 0 16px; font-size: 13px; color: var(--color-text-soft); max-width: none; }
.legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
.swatch { width: 18px; height: 12px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 520px) {
  h1 { font-size: 24px; } .wrap { padding: 16px 16px 40px; } .kpi-value { font-size: 22px; }
  .docbar { padding: 8px 16px; } .nav a { padding: 8px 10px; } .nav .btn { min-height: 44px; }
}
@media print { .nav, .docbar .stamp { display: none; } }
