:root {
  color-scheme: light; --ink:#183f3d; --muted:#516763; --sea:#165f55; --tide:#dcf0e7;
  --paper:#f7f6ed; --card:#fffef8; --line:#d4d9c9; --rust:#a34326; --sand:#f0ebda;
  font-family:"DM Sans","Microsoft YaHei","PingFang SC",sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; color:var(--ink); background:var(--paper); font-size:15px; line-height:1.55; }
button,input,select,textarea { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.47; }
button,a,input,select,textarea { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid #c8753a; outline-offset:3px; }
a { color:var(--sea); text-underline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.25; }
button,select,input,textarea { border-radius:6px; }
button { padding:8px 14px; border:1px solid var(--line); background:var(--card); }
button:not(:disabled):hover { border-color:#829d8d; background:var(--sand); }
button.primary { background:var(--sea); border-color:var(--sea); color:#fff; font-weight:650; }
button.primary:not(:disabled):hover { background:#104c44; }
label:not(.check):not(.search) { display:block; font-weight:650; margin:0 0 6px; }
input:not([type=checkbox]),select,textarea { padding:10px 12px; border:1px solid #acbaaa; background:#fffefa; width:100%; min-width:0; }
textarea { resize:vertical; }
input[type=checkbox] { accent-color:var(--sea); width:17px; height:17px; flex:none; }
.top { border-bottom:1px solid var(--line); background:var(--card); }
.bar,.desk,.entry { max-width:1300px; margin:0 auto; padding-left:clamp(16px,4vw,54px); padding-right:clamp(16px,4vw,54px); }
.bar { min-height:72px; display:flex; align-items:center; gap:22px; }
.brand { display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink); font-weight:800; font-size:21px; line-height:1.1; white-space:nowrap; }
.brand b { display:grid; place-content:center; width:38px; height:38px; border-radius:50%; background:var(--sea); color:var(--paper); font:38px Georgia,serif; }
.brand small { display:block; font:600 8px/1.8 monospace; letter-spacing:1.5px; }
.top-name { border-left:1px solid var(--line); padding-left:20px; font-weight:650; }
.top-actions { margin-left:auto; display:flex; align-items:center; gap:16px; font-size:13px; }
.entry { display:grid; grid-template-columns:1.1fr 1fr; max-width:1000px; padding-top:clamp(38px,10vh,110px); }
.coast { min-height:420px; background:#b7d4c6 url('/harbor-preview.webp') center center/cover no-repeat; border-radius:12px 0 0 12px; border:1px solid var(--line); }
.entry-form { display:flex; flex-direction:column; justify-content:center; padding:clamp(22px,4vw,52px); background:var(--card); border:1px solid var(--line); border-left:0; border-radius:0 12px 12px 0; }
.entry-form h1,.page-title h1 { font-size:clamp(28px,3.4vw,45px); letter-spacing:-.04em; }
.entry-form>p:first-of-type { margin:10px 0 24px; color:var(--muted); }
.hint,.ledger p,.section-title p,.page-title p,.pass-grid p,.target-help,.review p,.list-summary { color:var(--muted); font-size:13px; }
.hint { margin:8px 0 19px; }
.key-help { margin-top:16px; font-size:12px; color:var(--muted); }.key-help summary { cursor:pointer; }.key-help p { margin-top:6px; }.key-help code { overflow-wrap:anywhere; }
.error,.notice,.success { margin-top:12px; overflow-wrap:anywhere; }
.error { font-weight:550; color:#942e20; }.success { color:var(--sea); font-weight:650; }
.error:empty,.notice:empty,.success:empty { display:none; }
.desk { padding-top:clamp(22px,4vw,45px); padding-bottom:50px; }
.page-title,.section-title,.list-footer,.dialog-head { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.page-title p,.section-title p { margin-top:6px; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:21px 0; background:var(--card); border:1px solid var(--line); border-radius:9px; overflow:hidden; }
.metric { padding:15px clamp(12px,2.5vw,29px); }
.metric+.metric { border-left:1px solid var(--line); }
.metric span { display:block; font-size:13px; font-weight:650; }
.metric strong { font-size:clamp(22px,2.6vw,36px); line-height:1.5; font-variant-numeric:tabular-nums; letter-spacing:-.03em; overflow-wrap:anywhere; }
.metric small { color:var(--muted); margin-left:5px; font-size:11px; white-space:nowrap; }
.metric.budget { background:#e7efe1; }
.sections { display:flex; gap:clamp(9px,2.5vw,35px); border-bottom:1px solid var(--line); margin:12px 0 17px; }
.sections button { border:0; border-bottom:3px solid transparent; border-radius:0; background:none; padding:10px 3px; white-space:nowrap; }
.sections button[aria-current=page] { border-bottom-color:var(--rust); font-weight:750; }
.sheet { border:1px solid var(--line); border-radius:9px; padding:clamp(15px,2.8vw,32px); background:var(--card); }
.section-title { margin-bottom:20px; }.section-title h2,.dialog-head h2 { font-size:clamp(20px,2.3vw,28px); }
.filters { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.search { flex:1 1 140px; max-width:370px; }
.check { display:flex; align-items:center; gap:5px; margin-left:6px; }
.list-summary { margin:15px 0 8px; min-height:1.4em; }
.fish-list,.history-list { border-top:1px solid var(--line); }
.fish-row,.record { display:grid; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.fish-row { grid-template-columns:20px minmax(120px,1.4fr) minmax(80px,1fr) minmax(85px,1fr) auto; }
.fish-row>div,.record>div,.recipient>div { min-width:0; overflow-wrap:anywhere; }
.row-title { display:block; font-weight:700; }
.sub,.time,.minor { display:block; color:var(--muted); font-size:12px; }
.status-dot { display:inline-block; width:8px; height:8px; border-radius:50%; background:#3b825a; margin-right:5px; }
.empty { padding:25px 0; color:var(--muted); font-size:14px; }
.list-footer { flex-wrap:wrap; margin-top:13px; }
.pages { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:13px; }
.pages:empty { display:none; }
.pages button,.fish-row button,.record button { padding:6px 12px; }
.grant-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(200px,.85fr); gap:clamp(20px,5vw,65px); align-items:start; }
.form-fields { display:grid; gap:13px; align-items:start; }
.form-fields>label { margin:0 0 -10px!important; }
.form-fields>button { justify-self:start; }
.target-help button { font-size:13px; padding:4px 8px; margin:3px 6px 3px 0; }
.target-help .selected-names { display:flex; flex-wrap:wrap; margin:4px 0; }
.ledger,.review { padding:18px; border-radius:7px; }
.ledger { background:var(--sand); }
.ledger h3,.review h3,.pass-grid h3 { font-size:18px; }
.ledger dl { margin:12px 0; }
.ledger dl div { display:flex; align-items:baseline; justify-content:space-between; gap:8px; padding:6px 0; }
.ledger dd { margin:0; font-weight:650; }.ledger .emphasis { border-top:1px solid #c4ccb8; }
.review { margin-top:18px; border:1px solid #95bca5; background:#edf4e8; }
.review p { margin:7px 0; }.review strong { color:var(--ink); }
.review button { margin:6px 8px 0 0; }
.record { grid-template-columns:minmax(90px,1.8fr) minmax(95px,1fr) auto; }
#history-pages { margin-top:12px; }
.pass-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.pass-grid article { border:1px solid var(--line); padding:18px; border-radius:7px; }.pass-grid article:first-child { background:#f1f5e9; }
.pass-grid p { margin:8px 0 15px; }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
dialog { color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:10px; width:min(520px,calc(100vw - 28px)); max-height:82vh; padding:20px; }
dialog::backdrop { background:rgba(18,46,44,.42); }.dialog-head { margin-bottom:9px; }
#detail-label { color:var(--muted); font-size:14px; }
.recipient { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
#detail-pages { margin-top:12px; }
.desk-tools { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
#key-dialog p { margin:10px 0; }
@media(max-width:740px){
  .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }.metric:nth-child(3) { border-left:0; }.metric:nth-child(n+3) { border-top:1px solid var(--line); }
  .grant-grid { grid-template-columns:minmax(0,1fr); gap:18px; }.ledger { max-width:none; }
  .fish-row { grid-template-columns:20px minmax(0,1.2fr) minmax(0,1fr) auto; }.fish-row .fish-activity { grid-column:2/4; grid-row:2; }.fish-row button { grid-column:4; grid-row:1/3; }
}
@media(max-width:560px){
  .bar { min-height:64px; gap:10px; }.top-name { display:none; }.top-actions { gap:8px; font-size:12px; }.top-actions button { padding:6px; }
  .entry { grid-template-columns:1fr; padding-top:20px; }.coast { min-height:130px; border-radius:8px 8px 0 0; }.entry-form { border:1px solid var(--line); border-top:0; border-radius:0 0 8px 8px; }
  .sections { justify-content:space-between; gap:2px; }.sections button { font-size:14px; }.pass-grid { grid-template-columns:1fr; }
  .fish-row { grid-template-columns:18px minmax(0,1fr) auto; gap:4px 8px; }.fish-row .fish-place,.fish-row .fish-activity { grid-column:2; grid-row:auto; }.fish-row button { grid-column:3; grid-row:1/4; }
  .record { grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; }.record .record-meta { grid-column:1; }.record button { grid-column:2; grid-row:1/3; }
  .filters .check { flex-basis:100%; margin:0; }.list-footer { align-items:flex-start; }
}

.row-actions{display:flex;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.metrics-5{grid-template-columns:repeat(5,minmax(0,1fr))}
.sections-grouped{flex-wrap:wrap;align-items:center;gap:6px 18px}
.nav-group-label{font-size:11px;font-weight:750;letter-spacing:.04em;color:var(--muted);background:var(--sand);padding:3px 8px;border-radius:99px;white-space:nowrap}
.nav-sep{margin-left:8px}
.fiscal-pools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:14px 0 18px}
.pool-card{background:var(--sand);border:1px solid var(--line);border-radius:8px;padding:12px 14px}
.pool-card span{display:block;font-size:12px;color:var(--muted);font-weight:650}
.pool-card strong{display:block;font-size:22px;margin:4px 0 2px;font-variant-numeric:tabular-nums}
.pool-card small{font-size:11px;color:var(--muted)}
.fiscal-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.fiscal-box{border:1px solid var(--line);border-radius:8px;padding:16px;background:#fffefa}
.fiscal-box-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:12px;border-bottom:1px solid var(--line);padding-bottom:8px}
.fiscal-box-head h3{font-size:16px}
.pos{color:#166534}.neg{color:#9a3412}
.fbar-row{margin:9px 0}
.fbar-meta{display:flex;justify-content:space-between;gap:8px;font-size:13px}
.fbar-track{height:7px;background:#ece8d8;border-radius:99px;overflow:hidden;margin-top:4px}
.fbar-fill{height:100%;border-radius:99px;background:var(--sea)}
.fbar-fill.out{background:#c26a3b}
.fiscal-net-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:14px 0;padding:12px 16px;border-radius:8px;background:#edf4e8;border:1px solid #95bca5}
.fiscal-net-bar strong{font-size:20px;font-variant-numeric:tabular-nums}
.policy-box{margin-top:14px;border:1px solid var(--line);border-radius:8px;padding:12px 16px;background:var(--sand)}
.policy-box summary{cursor:pointer;font-weight:700}
.policy-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.voucher-presets{display:flex;flex-wrap:wrap;gap:8px}
.two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.three-col{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.period-btn[aria-pressed=true],.lfilter-btn[aria-pressed=true]{background:var(--sea);border-color:var(--sea);color:#fff}
@media(max-width:900px){
  .metrics-5,.fiscal-pools{grid-template-columns:repeat(2,minmax(0,1fr))}
  .fiscal-cols,.policy-grid,.two-col,.three-col{grid-template-columns:1fr}
}
