:root {
  color-scheme: light;
  --ink:#172724; --muted:#536560; --line:#ced8d1; --paper:#fffefa; --surface:#f4f5ef;
  --accent:#22594c; --wash:#e1efe7;
  font-family:"Work Sans","Noto Sans CJK SC","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
  color:var(--ink); background:var(--surface); font-size:16px; line-height:1.55;
}
*, *::before, *::after { box-sizing:border-box; }
body { margin:0; }
[hidden] { display:none !important; }
a { color:inherit; text-decoration:none; }
a:hover { text-decoration:underline; text-underline-offset:.23em; }
button, input, select, textarea { font:inherit; }
button, .button, .file-button {
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  min-height:42px; padding:.5rem .9rem; border:1px solid var(--line); border-radius:6px;
  color:var(--ink); background:var(--paper); line-height:1.35; font-weight:600; font-size:.93rem;
}
button:hover, .button:hover, .file-button:hover { border-color:var(--accent); text-decoration:none; }
button:active, .button:active { transform:translateY(1px); }
button:disabled { cursor:default; opacity:.5; transform:none; }
button.primary, .button.primary { color:white; border-color:var(--accent); background:var(--accent); }
button.primary:hover, .button.primary:hover { filter:brightness(.91); }
:focus-visible { outline:3px solid #138067; outline-offset:3px; }
.skip { position:absolute; left:-999em; }
.skip:focus { left:1rem; top:1rem; z-index:4; background:white; padding:.6rem; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.24; }
.wrap { width:min(1176px,calc(100% - 6rem)); margin-inline:auto; }
.mono, .wordmark, .project-name, .stat-num, .numeric {
  font-family:"IBM Plex Mono","Noto Sans Mono CJK SC",ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums;
}
.topbar { border-bottom:1px solid var(--line); }
.topinner { display:flex; justify-content:space-between; align-items:center; gap:1rem; min-height:72px; }
.brand { display:inline-flex; gap:.65rem; align-items:center; text-decoration:none !important; }
.mark { width:28px; height:31px; display:inline-block; background:#ce5938; clip-path:polygon(0 0,68% 0,100% 29%,100% 100%,0 100%); position:relative; flex:none; }
.mark::before { content:""; position:absolute; right:0; top:0; width:32%; height:29%; background:#682f24; }
.mark::after { content:""; position:absolute; left:20%; top:48%; width:48%; height:8%; box-shadow:0 6px #fff8ea; background:#fff8ea; }
.wordmark { font-weight:800; font-size:1.03rem; letter-spacing:.11em; }
.nav { display:flex; align-items:center; gap:1.5rem; font-size:.9rem; color:var(--muted); }
.nav a:hover,.quiet-link:hover { color:var(--ink); }
.project-name { font-size:.83rem; letter-spacing:.07em; font-weight:700; color:var(--accent); }
.hero { display:grid; grid-template-columns:1fr 1fr; gap:4rem; align-items:center; padding:clamp(2.6rem,5vw,4.7rem) 0 3.1rem; }
.eyebrow { color:var(--accent); font-weight:700; font-size:.88rem; letter-spacing:.07em; margin-bottom:.8rem; }
.hero h1 { font-size:clamp(3rem,5.7vw,5.4rem); letter-spacing:-.07em; font-weight:800; }
.hero-copy { color:var(--muted); font-size:1.08rem; line-height:1.85; max-width:29em; margin:1.05rem 0 1.45rem; }
.stage {
  background-color:#e2e9dd; background-image:radial-gradient(#b6c3b5 1px,transparent 1px);
  background-size:12px 12px; border:1px solid #c5d0c2; border-radius:12px;
  padding:1.6rem clamp(1rem,4vw,3.9rem); position:relative; isolation:isolate;
}
.stage-paper { border:1px solid #aebbb0; background:var(--paper); padding:1rem 1.25rem .9rem; border-radius:3px; box-shadow:5px 6px 0 #c2cfbf; transform:rotate(-1deg); }
.paper-head { display:flex; align-items:center; justify-content:space-between; gap:.5rem; border-bottom:1px dashed #b9c7bd; padding-bottom:.65rem; }
.preview-label { font-size:.83rem; font-weight:650; }
.paper-head .mono { color:var(--muted); font-size:.76rem; }
.paper-title { font-size:1.35rem; margin:.85rem 0 .25rem; letter-spacing:-.04em; }
.preview-lines { padding:.25rem 0 .45rem; min-height:6rem; }
.line { display:flex; align-items:center; justify-content:space-between; gap:.6rem; border-bottom:1px solid #e5e9e4; padding:.25rem 0; font-size:.89rem; }
.preview-tabs,.filters,.actions,.tags,.chips { display:flex; gap:.45rem; align-items:center; flex-wrap:wrap; }
.preview-tabs button, .filters button { min-height:34px; padding:.3rem .7rem; font-size:.875rem; }
.preview-tabs [aria-pressed="true"], .filters [aria-pressed="true"] { background:var(--ink); color:white; border-color:var(--ink); }
.catalog { padding:1rem 0 2.9rem; }
.section-head, .panel-head, .card-foot, .foot, .tool-heading, .item-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.section-head { border-top:2px solid var(--ink); padding-top:1.1rem; margin-bottom:1.15rem; }
.section-head h2 { font-size:1.5rem; letter-spacing:-.045em; }
.micro { font-size:.82rem; color:var(--muted); }
.cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.05rem; }
.card { display:flex; flex-direction:column; padding:1.35rem; border:1px solid var(--line); border-top:4px solid var(--accent); background:var(--paper); border-radius:9px; transition:transform .15s,border-color .15s; }
.card:hover,.card:focus-within { border-color:var(--accent); transform:translateY(-2px); }
.card-head { display:flex; align-items:center; gap:.75rem; margin-bottom:1.1rem; }
.tool-icon { width:42px; height:42px; padding:9px; display:inline-grid; place-items:center; border-radius:8px; background:var(--wash); color:var(--accent); }
.glyph { position:relative; display:block; height:21px; width:23px; border:2px solid currentColor; border-radius:2px; }
.glyph-grid { background:linear-gradient(to right,transparent 37%,currentColor 37% 45%,transparent 45%),linear-gradient(to bottom,transparent 26%,currentColor 26% 36%,transparent 36% 65%,currentColor 65% 75%,transparent 75%); }
.glyph-cal::before { content:""; position:absolute; inset:4px 0 auto; border-top:2px solid; }
.glyph-cal::after { content:""; position:absolute; left:4px; top:9px; width:3px; height:3px; background:currentColor; box-shadow:6px 0,0 5px; }
.glyph-bill { width:18px; background:repeating-linear-gradient(0deg,transparent 0 4px,currentColor 4px 6px) center/9px 12px no-repeat; }
.row-tone { --accent:#17654e; --wash:#e0f0e6; }
.week-tone { --accent:#4b5098; --wash:#e9eafa; }
.split-tone { --accent:#974626; --wash:#fae9dc; }
.card h3 { font-size:1.45rem; margin-bottom:.55rem; letter-spacing:-.04em; }
.card p { color:var(--muted); line-height:1.75; margin-bottom:1.15rem; }
.card-foot { margin-top:auto; padding-top:.85rem; border-top:1px solid var(--line); }
.card-foot a { color:var(--accent); font-weight:700; }
.card-foot .mono { color:var(--muted); font-size:.78rem; }
.help { border-block:1px solid var(--line); padding:1rem 0; }
.help summary { cursor:pointer; font-weight:650; }
.help p { color:var(--muted); padding:.65rem 0 0; }
.foot { padding:1.25rem 0 2.2rem; color:var(--muted); font-size:.82rem; }
.tool-hero { padding:2.25rem 0 1.45rem; }
.tool-hero h1 { font-size:clamp(2.1rem,4.2vw,3.4rem); letter-spacing:-.06em; }
.tool-hero p { color:var(--muted); margin:.6rem 0 0; max-width:50em; }
.tool-hero .eyebrow { margin:0 0 .35rem; color:var(--accent); }
.panel, .result-panel { border:1px solid var(--line); border-radius:10px; background:var(--paper); padding:clamp(1rem,2.2vw,1.45rem); }
.panel + .panel, .result-panel { margin-top:1rem; }
.panel-head { margin-bottom:.9rem; flex-wrap:wrap; }
.panel h2,.result-panel h2 { font-size:1.2rem; }
.work { padding-bottom:1.5rem; }
.grid2, .workcols { display:grid; gap:1rem; align-items:start; }
.grid2 { grid-template-columns:repeat(2,minmax(0,1fr)); }
.workcols { grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr); }
.stack { display:grid; gap:1rem; }
.stack > .panel { margin:0; }
.field { display:flex; flex-direction:column; gap:.35rem; min-width:0; }
.field > span,.legend,.data-label { font-size:.9rem; font-weight:650; }
input:not([type=checkbox]):not([type=file]), select, textarea {
  min-width:0; max-width:100%; border:1px solid #aebdb2; padding:.55rem .65rem;
  background:#fff; color:var(--ink); border-radius:5px; min-height:42px;
}
textarea { display:block; width:100%; resize:vertical; }
.data-input { font-family:"IBM Plex Mono",ui-monospace,"Noto Sans Mono CJK SC",monospace; font-size:.93rem; line-height:1.6; min-height:9rem; white-space:pre; }
fieldset { margin:0; min-width:0; padding:0; border:0; }
legend { padding:0 0 .4rem; }
select { appearance:none; padding-right:2rem !important; background-image:linear-gradient(45deg,transparent 50%,#51605b 50%),linear-gradient(135deg,#51605b 50%,transparent 50%) !important; background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50% !important; background-size:5px 5px !important; background-repeat:no-repeat !important; }
.input-top { display:flex; justify-content:space-between; align-items:center; gap:.5rem; margin:0 0 .4rem; }
.file-button { position:relative; font-size:.87rem; min-height:32px; padding:.3rem .65rem; overflow:hidden; }
.file-button input { position:absolute; inset:0; opacity:0; width:100%; height:100%; cursor:pointer; }
.file-button:focus-within { outline:3px solid #138067; outline-offset:3px; }
.controls { display:flex; align-items:end; flex-wrap:wrap; gap:.7rem; margin-top:1rem; }
.controls .field { min-width:10rem; }
.notice { margin-top:.65rem; color:var(--muted); font-size:.91rem; }
.notice:empty { display:none; }
.notice.error { color:#96351e; }
.note { color:var(--muted); font-size:.88rem; line-height:1.65; }
.stats { display:flex; flex-wrap:wrap; gap:.6rem 1.5rem; margin:.7rem 0 .9rem; }
.stat { display:flex; gap:.45rem; align-items:baseline; }
.stat-num { font-size:1.65rem; font-weight:650; }
.stat-label { color:var(--muted); font-size:.875rem; }
.table-scroll { overflow:auto; max-width:100%; border-radius:4px; }
table { width:100%; border-collapse:collapse; font-size:.925rem; }
th,td { text-align:left; padding:.65rem .6rem; border-bottom:1px solid var(--line); vertical-align:top; overflow-wrap:anywhere; }
th { font-size:.82rem; color:var(--muted); font-weight:650; background:#f0f3ed; }
td.value { white-space:pre-wrap; min-width:5rem; }
.pill { display:inline-block; white-space:nowrap; padding:.12rem .48rem; border-radius:4px; background:var(--wash); color:var(--accent); font-size:.81rem; font-weight:650; }
.pill.added { color:#1b634a; background:#e0f0e4; }
.pill.modified { color:#775521; background:#f5ebd6; }
.pill.removed,.pill.warn { color:#963b29; background:#fae4dc; }
.filters { margin:.8rem 0; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem .85rem; }
.span-all { grid-column:1 / -1; }
.rule { border:0; border-top:1px solid var(--line); margin:1rem 0; }
.item { padding:.75rem 0; border-top:1px solid var(--line); }
.item h3 { font-size:1rem; }
.item p { margin-top:.15rem; }
.item-head { gap:.5rem; align-items:flex-start; }
.mini-btn,.text-btn { min-height:32px; padding:.25rem .48rem; font-size:.85rem; }
.text-btn { border:0; color:var(--accent); background:transparent; text-decoration:underline; text-underline-offset:.2em; }
.inline-form { display:flex; gap:.45rem; align-items:end; }
.inline-form .field { flex:1; }
.chip,.check { display:inline-flex; align-items:center; gap:.38rem; background:var(--wash); padding:.25rem .55rem; border-radius:4px; font-size:.9rem; }
.chip button { min-height:26px; min-width:24px; padding:0 .2rem; background:transparent; border:0; }
.check input { width:1rem; height:1rem; margin:0; accent-color:var(--accent); }
.big-sum { font-family:"IBM Plex Mono",ui-monospace,monospace; font-size:clamp(1.8rem,4vw,2.7rem); letter-spacing:-.06em; line-height:1.35; overflow-wrap:anywhere; }
.highlight { border-top:4px solid var(--accent); }
.transfer { display:flex; justify-content:space-between; align-items:baseline; gap:1rem; padding:.6rem 0; border-bottom:1px solid var(--line); }
.transfer strong { color:var(--accent); }
.empty { color:var(--muted); padding:.85rem 0; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:900px) {
  .wrap { width:min(100% - 3rem,1176px); }
  .hero { gap:1.7rem; }
  .workcols { grid-template-columns:minmax(0,1fr) minmax(0,.85fr); }
  .card { padding:1rem; }
}
@media (max-width:740px) {
  .wrap { width:calc(100% - 2rem); }
  .topinner { min-height:58px; }
  .nav { gap:.8rem; }
  .hero { grid-template-columns:1fr; gap:1.3rem; padding:2rem 0 1.6rem; }
  .hero-copy { margin:.6rem 0 1rem; font-size:1rem; }
  .stage { padding:1.15rem max(1rem,7%); }
  .stage-paper { transform:none; }
  .cards,.workcols { grid-template-columns:1fr; }
  .card-head { margin-bottom:.65rem; }
  .card h3 { font-size:1.3rem; }
  .card p { margin-bottom:.75rem; }
  .tool-heading { align-items:flex-start; flex-direction:column; gap:.8rem; }
  .tool-hero { padding:1.5rem 0 1rem; }
  .foot { flex-wrap:wrap; }
}
@media (max-width:560px) {
  .grid2 { grid-template-columns:1fr; }
  .data-input { min-height:6.8rem; }
  .stats { gap:.4rem .85rem; }
  .stat-num { font-size:1.35rem; }
  .form-grid { gap:.7rem; }
  th,td { padding:.46rem .38rem; }
  .topinner .nav { font-size:.84rem; }
  .wordmark { font-size:.95rem; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; } }
