:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #172637;
  background: #f2f5f9;
  --muted: #516176;
  --accent: #184bbd;
  --strong: #123585;
  --tint: #e8eeff;
  --line: #d7e0eb;
  --white: #fff;
  --hero: #122945;
  --warn: #9b351c;
  --paper: #fff;
  font-synthesis: none;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
body[data-theme="savings"] { --accent: #006b58; --strong: #074d40; --tint: #e0f5ed; --hero: #083d38; }
body[data-theme="medical"] { --accent: #77479a; --strong: #552979; --tint: #f4e9fd; --hero: #442d59; }
body[data-theme="rights"] { --accent: #a34e22; --strong: #7b3413; --tint: #fceee4; --hero: #593721; }
body[data-theme="jobs"] { --accent: #325eb4; --strong: #1e438c; --tint: #e5eeff; --hero: #153b68; }
body[data-theme="admin"] { --accent: #345de0; --strong: #2244af; --tint: #e9efff; --hero: #10172f; }
a { color: var(--strong); text-underline-offset: .22em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #417cef; outline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button, input, textarea, select { min-height: 42px; }
button { border: 1px solid var(--accent); background: var(--accent); color: white; font-weight: 680; border-radius: 9px; padding: 9px 14px; cursor: pointer; }
button:hover { background: var(--strong); border-color: var(--strong); }
button.secondary { background: var(--white); border-color: #c2cedd; color: var(--strong); }
button.secondary:hover { background: var(--tint); border-color: var(--accent); }
button.quiet { background: transparent; border-color: transparent; color: var(--strong); padding-inline: 7px; }
button.quiet:hover { background: var(--tint); }
.topbar { padding: 14px max(5vw, 18px); background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 1190px; margin: auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 12px; align-items: center; font-weight: 790; font-size: 1.06rem; letter-spacing: -.026em; }
.mark { background: var(--accent); color: white; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: .75rem; font-weight: 790; letter-spacing: .04em; }
.topbar small, .eyebrow { font-size: .72rem; font-weight: 750; letter-spacing: .075em; text-transform: uppercase; }
.topbar small { color: var(--muted); text-align: right; }
.hero { position: relative; overflow: hidden; background: var(--hero); color: white; }
.hero::after { content: ""; position: absolute; width: 630px; height: 630px; right: -160px; top: -320px; border-radius: 50%; pointer-events: none; opacity: .32; background: repeating-radial-gradient(circle, transparent 0 17px, #ffffff35 18px 19px); mask-image: linear-gradient(to bottom left, #000, transparent 83%); }
.hero .inner { max-width: 1190px; margin: auto; padding: clamp(36px, 5vw, 64px) 0 clamp(32px, 4vw, 52px); position: relative; z-index: 1; }
.hero .eyebrow { color: #e1eaff; margin: 0 0 10px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4.7vw, 4.15rem); line-height: 1.05; letter-spacing: -.056em; max-width: 750px; }
.hero p:last-child { color: #e4edf7; font-size: clamp(.99rem, 1.5vw, 1.15rem); max-width: 680px; margin-top: 14px; }
.hero, main, footer { padding-inline: max(5vw, 18px); }
main { max-width: calc(1190px + 10vw); margin: 0 auto 52px; }
.notice { color: var(--muted); padding: 12px 0 5px; font-size: .875rem; }
#flash { min-height: 25px; color: var(--strong); font-size: .89rem; font-weight: 680; margin: 0 0 8px; }
#flash.error { color: var(--warn); }
#app { display: grid; gap: 18px; }
.stats, .grid, .project-grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid.wide { grid-template-columns: 1.55fr 1fr; }
.project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat, .panel { border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: 0 2px 7px #162b4209; min-width: 0; }
.stat { padding: 18px; }
.stat.highlight { background: var(--tint); border-color: transparent; color: var(--strong); }
.stat.warning strong { color: var(--warn); }
.stat strong { display: block; font-size: clamp(1.2rem, 2.65vw, 2rem); letter-spacing: -.037em; overflow-wrap: anywhere; margin: 6px 0 3px; font-variant-numeric: tabular-nums; }
.stat p, .panel header p, .note, footer { color: var(--muted); font-size: .88rem; }
.panel { padding: clamp(14px, 2vw, 23px); }
.panel > header { margin-bottom: 15px; }
h2 { font-size: 1.22rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
.panel header p { margin-top: 3px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions.top { margin-top: 0; }
.fields { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .88rem; font-weight: 650; }
label:has(textarea), label:has(input[type=file]) { grid-column: 1 / -1; }
input, textarea, select { background: white; border: 1px solid #b9c7d7; border-radius: 8px; width: 100%; color: #172637; padding: 8px 10px; min-width: 0; }
textarea { resize: vertical; font-weight: 400; }
.empty { padding: 16px; color: var(--muted); border: 1px dashed #bccadc; background: #f8fafd; border-radius: 9px; font-size: .92rem; }
.table-wrap { overflow: auto; width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .76rem; background: #f6f8fc; white-space: nowrap; }
td { overflow-wrap: anywhere; }
td:last-child:has(button) { min-width: 140px; }
td button { font-size: .8rem; min-height: 34px; }
tbody tr:last-child td { border-bottom: none; }
.chart { width: 100%; min-height: 180px; display: block; margin: 4px 0 7px; }
.chart .path { stroke: var(--accent); stroke-width: 3; fill: none; }
.chart .guide { stroke: #acb9cc; stroke-dasharray: 6 5; }
.chart .zero { stroke: #b25b43; stroke-dasharray: 5 3; }
.chart .axis { fill: var(--muted); font-size: 13px; }
summary { cursor: pointer; color: var(--strong); font-weight: 670; padding-block: 8px; }
.draft { background: var(--tint); border-radius: 12px; padding: 13px; margin-top: 12px; }
.draft h3 { margin: 0 0 7px; }
.tag { display: inline-block; background: var(--tint); color: var(--strong); border-radius: 999px; padding: 4px 9px; font-size: .74rem; font-weight: 730; }
.note { margin-top: 10px; }
.stack { display: grid; gap: 10px; }
.checklist { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: .89rem; }
.checklist li + li { margin-top: 5px; }
footer { padding-block: 18px; border-top: 1px solid var(--line); }
footer .inner { max-width: 1190px; margin: auto; }
@media (max-width: 850px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .grid.wide { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .table-wrap:has(.responsive-table) { overflow: visible; }
  .responsive-table { font-size: .9rem; }
  .responsive-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td { display: block; width: 100%; }
  .responsive-table tbody { display: grid; gap: 12px; }
  .responsive-table tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 6px 12px;
    background: var(--white);
  }
  .responsive-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 40%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
  .responsive-table td:last-child { border-bottom: 0; }
}
@media (max-width: 455px) {
  .project-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .stat { padding: 12px; }
  .topbar small { max-width: 120px; font-size: .66rem; }
  .chart { min-height: 132px; }
}
.product > header { margin: 12px 0; }
.product > header h3 { font-size: 1.13rem; letter-spacing: -.025em; }
#product { margin-bottom: 15px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
#period { margin-bottom: 13px; }
