/* CellsAndSundays tools site. Palette "Calm Ledger" (shop branding): cream F6F1E7, navy 1F2A44, sage 5E8C6A, coral C8553D, gold C9A227. Fonts self-hosted (SIL OFL 1.1). */
@font-face { font-family: "DM Serif Display"; src: url("/assets/fonts/dm-serif-display-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-var.woff") format("woff"); font-weight: 100 900; font-display: swap; }
:root {
  --cream: #F6F1E7; --paper: #FFFDF8; --navy: #1F2A44; --sage: #5E8C6A; --sage-dark: #3F6A4C; --coral: #C8553D; --gold: #C9A227;
  --line: #E2D9C6; --muted: #5A6275; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--navy); font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, h3 { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: .4em 0 .3em; }
h2 { font-size: 1.6rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.25rem; margin: 1.2em 0 .4em; }
a { color: var(--sage-dark); }
a:hover { color: var(--coral); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: #fff; padding: 8px; z-index: 10; }

.site-header { background: var(--navy); color: var(--cream); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.wordmark { font-family: "DM Serif Display", Georgia, serif; font-size: 1.6rem; color: var(--cream); text-decoration: none; }
.wordmark span { color: var(--gold); }
.wordmark img { display: block; height: 40px; width: auto; }
.nav { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; }
.nav a { color: var(--cream); text-decoration: none; font-weight: 500; }
.nav a[aria-current="page"], .nav a:hover { color: var(--gold); }
/* On a narrow screen the lockup and the three links cannot share one row
   without shrinking the mark too far, so the nav becomes its own right-aligned row. */
@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 0; padding-top: 12px; padding-bottom: 0; }
  .wordmark img { height: 36px; }
  .site-header nav { border-top: 1px solid rgba(246, 241, 231, 0.18); margin-top: 10px; }
  .nav { justify-content: flex-end; gap: 22px; padding: 8px 0 12px; }
}

main { padding-bottom: 40px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 46em; }

.placeholder-banner { background: #FFF4CC; border: 2px dashed var(--gold); border-radius: var(--radius); padding: 10px 14px; margin: 18px 0 0; font-size: .92rem; }
.placeholder { color: var(--navy); padding: 0 3px; background: #FFF4CC; outline: 1px dashed var(--gold); outline-offset: 2px; }

.tool-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 0; list-style: none; }
.tool-card { flex: 1 1 calc((100% - 32px) / 3); max-width: calc((100% - 32px) / 3); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
@media (max-width: 800px) {
  .tool-card { flex-basis: calc((100% - 16px) / 2); max-width: calc((100% - 16px) / 2); }
}
@media (max-width: 520px) {
  .tool-card { flex-basis: 100%; max-width: 100%; }
}
.tool-card h3 { margin-top: 0; }
.tool-card a { text-decoration: none; }
.tag { display: inline-block; background: var(--gold); color: var(--navy); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; vertical-align: middle; }

.calc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.calc h2 { margin-top: .2em; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.fields .field-span { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .9rem; }
/* label { display: block } would otherwise override the hidden attribute. */
[hidden] { display: none !important; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
input, select { font: inherit; color: inherit; width: 100%; padding: 8px 10px; border: 1px solid #C9BFA9; border-radius: 6px; background: #fff; margin-top: 4px; }
input:focus, select:focus { outline: 2px solid var(--sage); outline-offset: 1px; }
table.rows { width: 100%; border-collapse: collapse; margin: 12px 0; }
table.rows th { text-align: left; font-size: .82rem; color: var(--muted); font-weight: 600; padding: 4px 6px; }
table.rows td { padding: 4px 6px; vertical-align: middle; }
table.rows td input, table.rows td select { margin-top: 0; }
/* Give name and select columns enough width that long values are not clipped at 1280. */
table.rows-wide-name td:first-child { width: 26%; }
table.rows-wide-name input[data-field="name"] { min-width: 15em; }
table.rows-wide-name input[type="date"] { min-width: 12.5em; }
table.rows-wide-selects { table-layout: fixed; }
table.rows-wide-selects th:nth-child(1), table.rows-wide-selects td:nth-child(1) { width: 26%; }
table.rows-wide-selects th:nth-child(2), table.rows-wide-selects td:nth-child(2) { width: 16%; }
table.rows-wide-selects th:nth-child(3), table.rows-wide-selects td:nth-child(3) { width: 16%; }
table.rows-wide-selects th:nth-child(4), table.rows-wide-selects td:nth-child(4) { width: 22%; }
table.rows-wide-selects th:nth-child(5), table.rows-wide-selects td:nth-child(5) { width: 14%; }
table.rows-wide-selects th:nth-child(6), table.rows-wide-selects td:nth-child(6) { width: 6%; }
td.out { white-space: nowrap; font-variant-numeric: tabular-nums; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 6px; padding: 9px 14px; cursor: pointer; background: var(--navy); color: var(--cream); }
.btn.secondary { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn.remove { background: transparent; color: var(--coral); padding: 4px 8px; font-size: 1.1rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--cream); border-radius: 8px; padding: 12px 14px; }
.stat .k { font-size: .82rem; color: var(--muted); }
.stat .v { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.good .v { color: var(--sage-dark); }
.stat.bad .v { color: var(--coral); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.compare > div { background: var(--cream); border-radius: 8px; padding: 14px 16px; }
.compare h3 { margin-top: 0; }
.status-over { color: var(--coral); font-weight: 600; }
.status-almost { color: #8A6D00; font-weight: 600; }
.status-ok { color: var(--sage-dark); font-weight: 600; }
.error { color: var(--coral); font-weight: 600; min-height: 1.4em; margin: 8px 0 0; }
.warn { color: var(--coral); }
.calc-note { font-size: .88rem; color: var(--muted); margin-top: 14px; }

.product-box { background: var(--navy); color: var(--cream); border-radius: var(--radius); padding: 20px 22px; margin: 28px 0; }
.product-box h2 { margin-top: 0; color: var(--cream); }
.product-box .price { font-size: 1.3rem; font-weight: 700; color: var(--gold); }
.product-box .btn { background: var(--gold); color: var(--navy); text-decoration: none; display: inline-block; }

.prose { max-width: 46em; }
.site-footer { background: var(--navy); color: var(--cream); padding: 24px 0; font-size: .9rem; }
.site-footer a { color: var(--cream); }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.copy { opacity: .7; }
@media (max-width: 640px) {
  table.rows thead { display: none; }
  table.rows tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.rows td { padding: 0; width: auto; }
  table.rows td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); }
  table.rows-wide-name, table.rows-wide-selects { table-layout: auto; }
}
@media print { .site-header nav, .btn, .product-box .btn { display: none; } }

.schedule-wrap { max-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
table.rows.schedule { margin: 0; }
.source { font-size: .88rem; color: var(--muted); margin-top: 14px; }
.source a { color: var(--sage-dark); }
@media (max-width: 640px) {
  table.rows.schedule thead { display: table-header-group; }
  table.rows.schedule tr { display: table-row; border: 0; padding: 0; }
  table.rows.schedule td { padding: 4px 6px; }
  table.rows.schedule td[data-label]::before { content: none; }
}
