/* ============================================================
   theme.css — overtimehourscalculator.com skin layer
   Generated from DESIGN.md (editorial-ledger, Fraunces + Public Sans,
   oxblood #9f1239, pay-ledger motif). Loaded after base.css.
   Base layer (base.css) is the shared structural layer — never edit it.
   ============================================================ */

:root {
  --paper: #fbf9f4;
  --card: #ffffff;
  --ink: #241f1c;
  --ink-soft: #6d6157;
  --accent: #9f1239;
  --accent-deep: #7c0e2d;
  --accent-tint: #fbe8ed;
  --line: #e9e2d6;
  --line-strong: #cdc0ab;
  --header-ink: #241f1c;
  --header-fg: #f7f3ec;
  --header-fg-soft: #c8beb2;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Fraunces", Georgia, serif;
  --shadow-card: 0 1px 2px rgba(36, 31, 28, 0.05), 0 16px 36px -20px rgba(36, 31, 28, 0.3);
  --radius: 4px;
  --radius-sm: 3px;
  --page-max: 960px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f;
    --card: #211c17;
    --ink: #ece5da;
    --ink-soft: #a2968a;
    --accent: #e35d80;
    --accent-deep: #ee7f9b;
    --accent-tint: #3a1b24;
    --line: #352e26;
    --line-strong: #4a4136;
    --header-ink: #0f0c09;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 36px -20px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- motif: pay-ledger（DESIGN.md 三落点，不铺满） ---------- */

/* ① ruled ledger paper background */
body {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 31px,
      rgba(120, 100, 80, 0.055) 31px, rgba(120, 100, 80, 0.055) 32px),
    var(--paper);
}
@media (prefers-color-scheme: dark) {
  body {
    background:
      repeating-linear-gradient(0deg, transparent, transparent 31px,
        rgba(236, 229, 218, 0.045) 31px, rgba(236, 229, 218, 0.045) 32px),
      var(--paper);
  }
}

/* display face for headings & brand */
h1, h2, .brand { font-family: var(--display); }
h1 { font-weight: 650; }
.brand { font-size: 1.15rem; font-weight: 650; }
.brand b { color: var(--accent); font-weight: 650; }
.eyebrow { text-transform: uppercase; font-weight: 700; letter-spacing: 0.16em; font-size: 0.74rem; }

/* ② the ledger card: tool card reads as a pay ledger sheet */
#tool {
  border-top: 6px solid var(--accent);
  padding: 1.5rem 1.6rem;
}
#tool h2:first-child { margin: 0 0 1rem; font-size: 1.15rem; border-bottom: 0; }

/* ledger fields: label left, underlined figure right */
.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0;
}
.field label { color: var(--ink-soft); font-size: 0.95rem; }
.field input, .field select {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--line-strong);
  width: 7.5rem;
  padding: 0.15rem 0.2rem;
  transition: border-color 0.15s;
}
.field select { font-family: var(--sans); font-size: 0.95rem; font-weight: 600; text-align: right; }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--accent); }
.field input:hover, .field select:hover { border-bottom-color: var(--accent); }
.auto-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.auto-note b { color: var(--accent-deep); font-variant-numeric: tabular-nums; }

/* result lines + ③ double-rule grand total (accounting convention) */
.sumline {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.sumline output {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.1rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.4rem;
  padding-top: 0.7rem;
}
.grand .lbl {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.grand output {
  font-family: var(--display);
  font-weight: 650;
  font-size: 2rem;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  border-bottom: 6px double var(--ink);
  padding-bottom: 0.1rem;
}
@media (prefers-color-scheme: dark) { .grand output { border-bottom-color: var(--ink); } }

/* time-card style grids (weekly rows) */
.tc-grid { width: 100%; font-variant-numeric: tabular-nums; }
.tc-grid input { width: 100%; min-width: 4.2rem; }

/* header nav can wrap on narrow screens */
header nav { flex-wrap: wrap; row-gap: 0.2rem; }

/* h2: ledger section rule */
h2 { border-bottom: 3px double var(--line-strong); padding-bottom: 0.35rem; }
#tool h2, footer h2 { border-bottom: 0; }

/* FAQ question mark, ledger red */
.faq h3::before {
  content: "Q.";
  font-family: var(--display);
  font-style: italic;
  color: var(--accent);
  margin-right: 0.5rem;
}

/* numbers in inputs/outputs align like a ledger column */
input, output { font-variant-numeric: tabular-nums; }

/* share / embed row */
.actions { flex-wrap: wrap; margin-top: 0.9rem; }
details.embed { margin-top: 0.9rem; font-size: 0.9rem; }
details.embed summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.formula { margin-top: 0.9rem; font-size: 0.93rem; }
details.formula summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.formula .stepbox {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-top: 0.6rem;
  font-variant-numeric: tabular-nums;
}
details.formula .stepbox p { margin: 0.3rem 0; }

/* embed mode: ?embed=1 keeps only the tool card */
.embed-mode header, .embed-mode footer, .embed-mode main > *:not(#tool) { display: none !important; }
.embed-mode main { padding-top: 1rem; }

/* chart page: printable table */
@media print {
  header, footer, .actions, details.embed, section, .eyebrow, .badges, .tagline { display: none !important; }
  main > h1, #tool, .print-keep { display: block !important; }
  body { background: #fff; }
  #tool { box-shadow: none; border: 1px solid #999; }
}
