/* DateCalc — clean, readable, AdSense-friendly */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #1a2233;
  --muted: #5b6b81;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --border: #dde3ec;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand-mark { font-size: 1.3rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: .5rem 1rem; min-width: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.site-nav a:hover { color: var(--accent); }

/* ---------- Main / hero ---------- */
main { flex: 1; width: min(880px, 100% - 2rem); margin: 0 auto; padding: 1.5rem 0 2.5rem; }

.hero { text-align: center; padding: .75rem 0 1.25rem; }
.hero h1 { font-size: 1.9rem; margin: 0 0 .35rem; letter-spacing: -.01em; }
.tagline { color: var(--muted); margin: 0 0 1.1rem; font-size: 1.02rem; }

.nl-box { display: flex; gap: .5rem; max-width: 640px; margin: 0 auto; }
.nl-input {
  flex: 1; padding: .8rem .9rem; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
}
.nl-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.examples { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: .85rem; }
.chip {
  background: var(--surface); border: 1px solid var(--border); color: var(--accent);
  border-radius: 999px; padding: .32rem .8rem; font-size: .84rem; cursor: pointer;
}
.chip:hover { border-color: var(--accent); background: #eff4ff; }
.chip:active { background: #dbe7fe; transform: translateY(1px); }

/* ---------- Results ---------- */
.result {
  margin: 1rem auto 0; max-width: 640px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem 1.15rem;
}
.result h4 { margin: 0 0 .25rem; font-size: 1.05rem; }
.result .answer { font-size: 1.2rem; font-weight: 700; color: var(--accent); }
.result .detail { color: var(--muted); font-size: .95rem; margin-top: .4rem; }
.result .holiday { color: #9a5b12; }
.result.error { border-color: #fecaca; background: #fef2f2; }
.result.error .answer { color: #b91c1c; }

/* Fresh result pulse — every new computation visibly flashes the panel. */
@keyframes result-flash {
  0% { box-shadow: 0 0 0 4px rgba(22, 163, 74, .45); }
  100% { box-shadow: var(--shadow); }
}
.result.flash { animation: result-flash 650ms ease-out; }

/* ---------- Tools / tabs ---------- */
.tools { margin-top: 1rem; }
.tabs { display: flex; gap: .35rem; border-bottom: 1px solid var(--border); }
.tab {
  background: transparent; border: 1px solid transparent; border-bottom: none;
  padding: .7rem 1rem; font-size: 1rem; cursor: pointer; color: var(--muted); border-radius: var(--radius) var(--radius) 0 0;
}
.tab.active { background: var(--surface); border-color: var(--border); color: var(--ink); font-weight: 600; }
.tab:active { background: #eef2f9; }

.panel { background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 1.1rem; }
.field-row { display: flex; flex-wrap: wrap; gap: .85rem; align-items: flex-end; margin-bottom: .85rem; }
.field-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.field-row input, .field-row select {
  padding: .55rem .65rem; font-size: .98rem;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink);
}
.field-row input:focus, .field-row select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.inline-group { display: inline-flex; gap: .4rem; align-items: center; }
.num-sm { width: 5.5rem; }

.primary {
  background: var(--accent-strong, var(--accent)); color: var(--accent-ink); border: none;
  padding: .62rem 1.1rem; font-size: .98rem; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.primary:hover { background: #1d4fd7; }
.primary:active { background: #163d9e; transform: translateY(1px); }

/* Pressed-flash ring applied by a click-delegation handler in app.js. */
@keyframes click-flash {
  0% { box-shadow: 0 0 0 3px rgba(37, 99, 235, .55); }
  100% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0); }
}
.clicked { animation: click-flash 320ms ease-out; }

/* ---------- Time Zone quick-pick ---------- */
.quick-pick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: 0 0 .85rem; }
.qp-label { font-size: .85rem; color: var(--muted); }
.qp {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: .3rem .7rem; font-size: .85rem; cursor: pointer;
}
.qp:hover { border-color: var(--accent); color: var(--accent); }
.qp:active { background: #dbe7fe; }
.qp.selected {
  background: var(--accent-strong, var(--accent)); border-color: var(--accent-strong, var(--accent)); color: var(--accent-ink); font-weight: 600;
}

/* ---------- Top-20 city picker ---------- */
.top20-picker { margin: 0 0 .9rem; }
.top20-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .35rem;
  margin-top: .4rem;
}
.top20-city {
  min-width: 0; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: .35rem .45rem; font-size: .8rem; line-height: 1.2;
  cursor: pointer; text-align: center;
}
.top20-city:hover { border-color: var(--accent); color: var(--accent); }
.top20-city.selected {
  background: var(--accent-strong, var(--accent)); border-color: var(--accent-strong, var(--accent));
  color: var(--accent-ink); font-weight: 600;
}
@media (max-width: 640px) {
  .site-header { flex-wrap: wrap; gap: .5rem; }
  .site-nav { width: 100%; }
  .top20-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .top20-city { font-size: .78rem; }
}

/* ---------- World clock (same Top 20 cities as the picker) ---------- */
.clock-title { margin: 1.1rem 0 .55rem; font-size: 1.05rem; }
.clock-note { font-weight: 400; color: var(--muted); font-size: .85rem; }
.clocks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .6rem; min-width: 0;
}
.clock {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem;
  min-width: 0; overflow-wrap: anywhere; cursor: pointer;
}
.clock:hover { border-color: var(--accent); }
.clock-city-link {
  display: inline-block; max-width: 100%; color: var(--ink); text-decoration: none;
  font-weight: 600; font-size: .95rem; overflow-wrap: anywhere;
}
.clock-city-link:hover { color: var(--accent); text-decoration: underline; }
.clock-city-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.clock .time { font-variant-numeric: tabular-nums; color: var(--accent); font-size: 1.25rem; font-weight: 700; }
.clock .offset { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .clocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock-note { display: block; }
}

/* ---------- Ad slot ---------- */
.ad-slot {
  margin-top: 1.4rem; min-height: 120px; border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; background: var(--surface);
}
.ad-note { color: var(--muted); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 1.1rem 1.25rem; text-align: center; color: var(--muted); font-size: .9rem;
}
.foot-links { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: .5rem 0; }
.foot-links a { color: var(--accent); text-decoration: none; }
.disclaimer { font-size: .8rem; max-width: 720px; margin: .5rem auto 0; }

/* ---------- Text pages (about / contact / privacy) ---------- */
.text-page { max-width: 720px; margin: 0 auto; padding: 1.25rem .5rem 2.5rem; }
.text-page h1 { margin: .25rem 0 .2rem; font-size: 1.7rem; }
.text-page h2 { margin-top: 1.4rem; font-size: 1.2rem; }
.text-page a { color: var(--accent); }
.text-page .email { font-size: 1.1rem; font-weight: 600; }

/* ---------- Embed widget ---------- */
.datecalc-widget {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .9rem 1rem; max-width: 360px;
  color: var(--ink); line-height: 1.45; font-size: .95rem;
}
.datecalc-widget input, .datecalc-widget select {
  width: 100%; margin: .25rem 0 .6rem; padding: .45rem .55rem;
  border: 1px solid var(--border); border-radius: 6px; font-size: .95rem;
}
.datecalc-widget .dcw-go {
  background: var(--accent-strong, var(--accent)); color: var(--accent-ink); border: none;
  padding: .5rem .9rem; font-size: .95rem; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.datecalc-widget .dcw-go:hover { background: #1d4fd7; }
.datecalc-widget .dcw-go:active { background: #163d9e; }
.datecalc-widget .dcw-answer { font-weight: 700; color: var(--accent); margin-top: .35rem; }
.datecalc-widget .dcw-foot { font-size: .8rem; color: var(--muted); margin-top: .55rem; }
.datecalc-widget .dcw-foot a { color: var(--accent); }

@media (max-width: 560px) {
  .hero h1 { font-size: 1.5rem; }
  .field-row { flex-direction: column; align-items: stretch; }
}


/* Hub rail — internal links across the tool network */
.hub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; justify-content: center; }
.hub a {
  color: inherit; opacity: 0.92; text-decoration: none; font-size: 0.9em;
  font-size: 0.8em; padding: 2px 8px; border: 1px solid currentColor; border-radius: 999px;
}
.hub a:hover { opacity: 1; }

/* >>> theme-by-name (2026-11-02) >>> */
/* Theme derived from the site's MEANING, not a random variant.
 * Time and calendars = warm paper and amber, the colour of a desk calendar. Numerals lead.
 * Ad layout is deliberately NOT set here — container width and rail geometry are
 * measured and verified separately by check-ad-layout.mjs.
 */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #241f18;
  --muted: #77705f;
  --line: #e8e1d5;
  --brand: #9a6b1f;
  --brand-strong: #9a6b1f;
  --accent: #9a5b12;
  /* White on #c2701a is 3.19:1 — the primary button and active tab failed AA.
     A darker amber clears it with white text and still reads as the same hue. */
  --accent-strong: #9a5b12;
  --radius: 10px;
  --font-sans: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}
body { font-family: var(--font-sans); background: var(--bg); color: var(--ink); }
h1, h2, h3 { font-family: var(--font-sans); font-weight: 600; letter-spacing: -0.015em; }
.card, .panel, section[class*="card"] { border-radius: var(--radius); }
/* <<< theme-by-name <<< */

/* Privacy architecture section (2026-11-08) — the selling point of every site. */
.privacy-section{margin-top:34px;padding-top:24px;border-top:2px solid #e2e8f0}
.privacy-section h2{font-size:1.35em;margin-bottom:10px}
.privacy-section h3{font-size:1.05em;margin:20px 0 8px}
.privacy-steps{margin:10px 0 14px;padding-left:22px}
.privacy-steps li{margin-bottom:8px;line-height:1.6}
.privacy-section kbd{background:#f1f5f9;border:1px solid #cbd5e1;border-bottom-width:2px;
  border-radius:4px;padding:1px 5px;font-size:.85em;font-family:ui-monospace,Menlo,monospace}
