/* ==========================================================================
   nepali-english.com

   Motif: the shirorekha — the headline stroke Devanagari letters hang from.
   Sections hang from it, cards hang from it, and a marigold tick marks where
   each one begins, the way a word begins under the stroke. That device is
   where the boldness is spent; everything around it stays quiet.
   ========================================================================== */

:root {
  --ink:        #14233F;
  --ink-deep:   #0E1930;
  --ink-soft:   #2C3E63;
  --muted:      #5F6E8C;
  --on-ink:     #C9D6EA;
  --on-ink-dim: #8496B5;

  --paper:      #F1F4F9;
  --wash:       #E7EDF5;
  --surface:    #FFFFFF;

  --rule:       #CBD5E3;
  --rule-soft:  #E3E9F1;

  --marigold:   #E39A12;   /* graphics only */
  --marigold-d: #96610A;   /* text — 4.79:1 on paper, 5.24:1 on white */
  --crimson:    #A8213A;
  --ok:         #1B7A55;

  --display: "Tiro Devanagari Hindi", "Kohinoor Devanagari", "Nirmala UI",
             "Noto Serif Devanagari", Georgia, serif;
  --body: "IBM Plex Sans", "IBM Plex Sans Devanagari", "Kohinoor Devanagari",
          "Nirmala UI", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", "Courier New", monospace;

  --wrap: 1140px;
  --radius: 4px;
  --radius-lg: 8px;

  --lift-1: 0 1px 2px rgba(14, 25, 48, .05);
  --lift-2: 0 2px 4px rgba(14, 25, 48, .06), 0 12px 28px -18px rgba(14, 25, 48, .38);
  --lift-3: 0 4px 10px rgba(14, 25, 48, .08), 0 24px 48px -24px rgba(14, 25, 48, .42);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
@media (min-width: 720px) { body { font-size: 1.0625rem; } }

img { max-width: 100%; height: auto; }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--marigold); }

:focus-visible { outline: 2px solid var(--marigold-d); outline-offset: 2px; border-radius: 2px; }

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, 760px); margin-inline: auto; }
@media (min-width: 720px) { .wrap, .wrap-narrow { width: min(100% - 3rem, var(--wrap)); } }
@media (min-width: 720px) { .wrap-narrow { width: min(100% - 3rem, 760px); } }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 99;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
}
.skip:focus { left: 0; }

main { padding-bottom: 1rem; }

/* --------------------------------------------------------------- type ---- */

h1, h2, h3, h4 {
  font-family: var(--display); font-weight: 400; line-height: 1.18;
  color: var(--ink); letter-spacing: -.005em;
}
h1 { font-size: clamp(1.85rem, 1.35rem + 2.2vw, 3.15rem); margin: 0 0 .55rem; }
h2 { font-size: clamp(1.4rem, 1.18rem + .95vw, 2rem); margin: 2.5rem 0 .8rem; }
h3 { font-size: clamp(1.15rem, 1.05rem + .35vw, 1.3rem); margin: 1.9rem 0 .5rem; }
h4 { font-size: 1rem; font-family: var(--body); font-weight: 600; margin: 1.4rem 0 .35rem; }
p { margin: 0 0 1.05rem; }

.lede {
  font-size: clamp(1.03rem, .98rem + .35vw, 1.19rem);
  color: var(--ink-soft); max-width: 60ch; line-height: 1.58;
}
.eyebrow {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .45rem;
}
.deva { font-family: var(--display); }
.rom  { font-family: var(--mono); font-size: .88em; color: var(--muted); }

/* ------------------------------------------------- the shirorekha device -- */

/* A section heading hangs from a rule, with a marigold tick marking where it
   starts — the way a Devanagari word begins under the headline stroke. */
.hangs, h2.hang, .section > h2:first-child {
  position: relative;
  border-top: 2px solid var(--ink);
  padding-top: .9rem;
  margin-top: 2.9rem;
}
.hangs::before, h2.hang::before, .section > h2:first-child::before {
  content: ""; position: absolute; top: -2px; left: 0;
  width: 3.25rem; height: 2px; background: var(--marigold);
}
.hangs { margin-top: 1.75rem; }
.hangs-soft { border-top: 1px solid var(--rule); padding-top: .9rem; }

/* ------------------------------------------------------------- header ---- */

.masthead {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--rule-soft);
  position: sticky; top: 0; z-index: 30;
}
.masthead-in { display: flex; align-items: center; gap: 1rem; padding: .7rem 0; }

.brand { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; }
.brand-rule {
  display: block; height: 2px; background: var(--ink); width: 100%;
  transform-origin: left; margin-bottom: .3rem;
  animation: draw .7s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.brand-name { font-family: var(--display); font-size: 1.2rem; letter-spacing: -.01em; }
.brand-name .sep { color: var(--marigold-d); padding: 0 .08em; }

.nav { margin-left: auto; display: flex; gap: 1.35rem; align-items: center; }
.nav a { font-size: .9375rem; text-decoration: none; color: var(--ink-soft); padding: .3rem 0; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--marigold); }

.nav-toggle { display: none; }
#nav-check { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

@media (max-width: 820px) {
  .masthead-in { position: relative; }
  .nav {
    position: absolute; inset: calc(100% + .7rem) -1rem auto; background: var(--surface);
    flex-direction: column; align-items: stretch; gap: 0;
    border-block: 1px solid var(--rule); padding: .35rem 1.5rem 1rem;
    display: none; z-index: 40; box-shadow: var(--lift-2);
  }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--rule-soft); font-size: 1.0625rem; }
  .nav a:last-child { border-bottom: 0; }
  .nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--marigold); padding-left: .7rem; }
  #nav-check:checked ~ .nav { display: flex; }
  .nav-toggle {
    display: block; margin-left: auto; cursor: pointer;
    font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
    border: 1px solid var(--rule); padding: .55rem .8rem; border-radius: var(--radius);
    color: var(--ink-soft); background: var(--surface);
  }
  #nav-check:checked ~ .nav-toggle { background: var(--ink); color: #fff; border-color: var(--ink); }
  #nav-check:focus-visible ~ .nav-toggle { outline: 2px solid var(--marigold-d); outline-offset: 2px; }
}

/* --------------------------------------------------------- breadcrumb ---- */

.crumbs { font-size: .8125rem; color: var(--muted); padding: .85rem 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.crumbs li::after { content: "›"; margin-left: .35rem; color: var(--rule); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }

/* --------------------------------------------------------------- hero ---- */

/* Full-bleed ink band. Dark behind the hero makes the Devanagari the first
   thing the eye lands on, and gives the page a top-to-bottom rhythm instead
   of one continuous field of grey. */
.hero-band {
  background: var(--ink-deep);
  background-image:
    radial-gradient(120% 90% at 88% 8%, rgba(227, 154, 18, .16), transparent 58%),
    radial-gradient(90% 70% at 0% 100%, rgba(44, 62, 99, .55), transparent 60%);
  color: var(--on-ink);
  padding: 2.25rem 0 2.5rem;
  position: relative; overflow: hidden;
}
.hero-band::after {
  content: "अ"; position: absolute; right: -1.5rem; bottom: -5rem;
  font-family: var(--display); font-size: 22rem; line-height: 1;
  color: rgba(255, 255, 255, .035); pointer-events: none; user-select: none;
}
@media (max-width: 720px) {
  .hero-band::after { font-size: 11rem; right: -1.5rem; bottom: auto; top: 4.5rem; opacity: .8; }
}

.hero-band h1 { color: #fff; }
.hero-band .lede { color: var(--on-ink); max-width: 54ch; }

.hero-mark .rule {
  height: 3px; background: var(--marigold);
  width: clamp(4rem, 22vw, 8rem);
  animation: draw .8s cubic-bezier(.2, .8, .2, 1) both;
}
.hero-mark .pair {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .55rem;
  font-family: var(--display);
  font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.7rem);
  line-height: 1.12; padding-top: .7rem; margin: 0 0 .7rem;
}
.hero-mark .pair .ne { color: #fff; }
.hero-mark .pair .swap { color: var(--marigold); font-size: .62em; }
.hero-mark .pair .en { color: var(--on-ink); }

/* Today strip: three labelled facts and an action, on one row when there is
   room and a clean two-column grid when there is not. */
.today {
  display: grid; gap: .9rem 1.5rem; margin: 1.5rem 0 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  align-items: end;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .05); padding: 1rem 1.15rem;
}
.today .eyebrow { color: var(--on-ink-dim); margin: 0 0 .3rem; }
.today .val { font-size: 1.05rem; color: #fff; line-height: 1.25; display: block; }
.today .val.deva { font-size: 1.3rem; }
.today .act { grid-column: 1 / -1; }
@media (min-width: 760px) { .today .act { grid-column: auto; justify-self: end; } }

.searchbar { display: flex; gap: .5rem; margin: 1.25rem 0 0; max-width: 560px; }
.searchbar input { flex: 1; min-width: 0; }
.hero-band .searchbar input {
  background: rgba(255, 255, 255, .96); border-color: transparent;
  font-size: 1rem; padding: .8rem .9rem;
}
.hero-band .searchbar input::placeholder { color: #6B7A96; }

/* -------------------------------------------------------------- bands ---- */

.band { padding: .5rem 0 2rem; }
.band-wash { background: var(--wash); padding: 2.25rem 0; }
.band-wash > .wrap > h2:first-child,
.band-wash > .wrap > .hangs:first-child { margin-top: 0; }

/* -------------------------------------------------------------- cards ---- */

.grid { display: grid; gap: .9rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }

.card {
  position: relative; display: block; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-lg); padding: 1.2rem 1.25rem 1.35rem;
  text-decoration: none; box-shadow: var(--lift-1);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1),
              box-shadow .2s ease, border-color .2s ease;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--marigold); transform: scaleX(0); transform-origin: left;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
/* Each card carries a Devanagari letterform as a watermark — the subject's
   own material doing the work an icon set would otherwise do. */
.card[data-glyph]::after {
  content: attr(data-glyph); position: absolute; right: .55rem; bottom: -.9rem;
  font-family: var(--display); font-size: 4.6rem; line-height: 1;
  color: var(--ink); opacity: .045; pointer-events: none; user-select: none;
  transition: opacity .25s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-2px); box-shadow: var(--lift-2); border-color: var(--rule);
}
.card:hover::before, .card:focus-within::before { transform: scaleX(1); }
.card:hover[data-glyph]::after { opacity: .085; }
@media (max-width: 420px) { .card[data-glyph]::after { display: none; } }

.card-tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--marigold-d); display: block; margin-bottom: .5rem;
}
.card-title {
  display: block; font-family: var(--display); font-size: 1.18rem;
  margin: 0 0 .3rem; line-height: 1.25;
}
.card-desc {
  display: block; font-size: .9rem; color: var(--muted);
  margin: 0; line-height: 1.5; position: relative;
}

/* --------------------------------------------------------------- tool ---- */

.tool {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  border-radius: var(--radius-lg); padding: 1.1rem;
  margin: 1.4rem 0 1rem; box-shadow: var(--lift-2);
}
@media (min-width: 720px) { .tool { padding: 1.4rem; } }

.tool-io { display: grid; gap: .7rem; }
@media (min-width: 900px) {
  .tool-io.side { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
}

.field { display: flex; flex-direction: column; min-width: 0; }
.field > label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .35rem;
}

textarea, input[type="text"], input[type="number"], input[type="date"], select {
  font-family: var(--body); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: .7rem .8rem; width: 100%;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 2rem; cursor: pointer; }
textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
@media (min-width: 720px) { textarea { min-height: 165px; } }
textarea.deva-out { font-family: var(--display); font-size: 1.15rem; line-height: 1.9; }
textarea.legacy { font-family: var(--mono); font-size: .95rem; }
textarea[readonly] { background: #FAFBFD; }
input:focus, textarea:focus, select:focus {
  border-color: var(--ink-soft); background: var(--surface); outline: none;
  box-shadow: 0 0 0 3px rgba(44, 62, 99, .1);
}

/* The direction marker points across on a wide screen and down on a narrow
   one, because that is where the output actually is. */
.io-mid { display: flex; align-items: center; justify-content: center; padding: .1rem; }
.io-mid .arrow {
  font-family: var(--mono); color: var(--marigold-d); font-size: 1.25rem;
  display: inline-block; transform: rotate(90deg);
}
@media (min-width: 900px) { .io-mid .arrow { transform: none; font-size: 1.4rem; } }

.btn {
  font-family: var(--body); font-size: .9375rem; font-weight: 500;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: .65rem 1.15rem; border-radius: var(--radius); cursor: pointer;
  transition: background .15s ease, transform .1s ease; min-height: 42px;
}
.btn:hover { background: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { background: var(--paper); border-color: var(--ink-soft); }
.hero-band .btn-ghost {
  background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4);
}
.hero-band .btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .85rem; align-items: center; }
.btn-note { font-size: .8125rem; color: var(--muted); }
@media (min-width: 620px) { .btn-note { margin-left: auto; } }

.trust {
  display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .78rem;
  color: var(--muted); font-family: var(--mono); margin: .8rem 0 0;
}
.trust span::before { content: "·"; color: var(--marigold-d); margin-right: .45rem; font-weight: 700; }

.beta {
  background: #FFF8EA; border: 1px solid #F0DCAF; border-left: 3px solid var(--marigold);
  padding: .8rem 1rem; font-size: .9rem; border-radius: var(--radius); margin: 1rem 0;
}

/* ------------------------------------------------------------- result ---- */

.result {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 1.35rem 1.1rem; text-align: center; margin-top: 1rem;
  /* Reserved height: the panel goes from one line to three when JavaScript
     fills it, and without this that costs a layout shift. */
  min-height: 8.5rem; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background-image: radial-gradient(85% 120% at 50% -10%, rgba(227,154,18,.14), transparent 62%);
}
.result .big {
  font-family: var(--display); line-height: 1.25;
  font-size: clamp(1.45rem, 1.05rem + 1.9vw, 2.3rem);
}
.result .sub {
  font-family: var(--mono); font-size: .75rem; letter-spacing: .09em;
  text-transform: uppercase; color: #A9BAD6; margin-top: .45rem;
}
.result.empty { background: var(--paper); color: var(--muted); border: 1px dashed var(--rule); }
.result.empty .big { font-size: 1rem; font-family: var(--body); color: var(--muted); }

/* -------------------------------------------------- conversion report ---- */

.report {
  border: 1px solid var(--rule); border-left: 3px solid var(--ok);
  background: var(--surface); border-radius: var(--radius);
  padding: .8rem 1rem; margin-top: .9rem; font-size: .88rem;
}
.report.warn { border-left-color: var(--marigold); background: #FFFCF5; }
.report.bad  { border-left-color: var(--crimson); background: #FEF7F8; }
.report-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.report-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.report.warn .dot { background: var(--marigold); }
.report.bad  .dot { background: var(--crimson); }
.report .meter {
  flex: 1; min-width: 80px; max-width: 190px; height: 5px;
  background: var(--rule-soft); border-radius: 3px; overflow: hidden; margin-left: auto;
}
.report .meter > span { display: block; height: 100%; background: var(--ok); }
.report.warn .meter > span { background: var(--marigold); }
.report.bad  .meter > span { background: var(--crimson); }
.report-notes { margin: .55rem 0 0; padding-left: 1.05rem; color: var(--ink-soft); font-size: .86rem; }
.report-notes li { margin-bottom: .3rem; }
.report-notes li:last-child { margin-bottom: 0; }

/* ------------------------------------------------- dictionary answer ----- */

.answer {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 3px solid var(--crimson);
  border-radius: var(--radius-lg); padding: 1.35rem; box-shadow: var(--lift-2);
  margin: 1.2rem 0; position: relative; overflow: hidden;
}
@media (min-width: 720px) { .answer { padding: 1.6rem; } }
.answer-word {
  font-family: var(--display); line-height: 1.12; margin: 0;
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.2rem);
}
.answer-rom { font-family: var(--mono); color: var(--muted); font-size: .95rem; margin: .35rem 0 0; }
.answer-meta {
  display: flex; flex-wrap: wrap; gap: .45rem 1.4rem; margin-top: .95rem;
  padding-top: .95rem; border-top: 1px solid var(--rule-soft);
  font-size: .86rem; color: var(--muted);
}
.answer-meta b { color: var(--ink); font-weight: 500; }

.examples { list-style: none; padding: 0; margin: 0; }
.examples li { border-top: 1px solid var(--rule-soft); padding: .85rem 0; }
.examples li:first-child { border-top: 2px solid var(--ink); }
.examples .ex-ne { font-family: var(--display); font-size: 1.18rem; line-height: 1.7; display: block; }
.examples .ex-rom { font-family: var(--mono); font-size: .8rem; color: var(--muted); display: block; margin: .2rem 0; }
.examples .ex-en { font-size: .92rem; color: var(--ink-soft); display: block; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: .5rem 0 0; list-style: none; }
.chips a {
  display: inline-block; text-decoration: none; font-size: .875rem;
  border: 1px solid var(--rule); background: var(--surface);
  padding: .42rem .85rem; border-radius: 999px; color: var(--ink-soft);
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.chips a:hover { border-color: var(--ink-soft); background: var(--paper); color: var(--ink); }
.chips a .deva { font-size: 1.05em; }

/* ------------------------------------------------------------- tables ---- */

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .92rem; }
caption { text-align: left; font-size: .8125rem; color: var(--muted); padding-bottom: .5rem; }
th, td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--rule-soft); }
thead th {
  border-bottom: 2px solid var(--ink); font-family: var(--mono); font-size: .7rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 400;
  white-space: nowrap;
}
tbody tr:hover { background: var(--surface); }
/* Shadows appear on whichever edge still has content past it, so a table that
   scrolls sideways says so instead of just cutting text off. */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(255,255,255,0)) left center / 34px 100% no-repeat local,
    linear-gradient(to left,  var(--surface) 30%, rgba(255,255,255,0)) right center / 34px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(14,25,48,.16), rgba(14,25,48,0)) left center / 13px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(14,25,48,.16), rgba(14,25,48,0)) right center / 13px 100% no-repeat scroll,
    var(--surface);
}
@media (max-width: 620px) { .table-scroll table { min-width: 430px; } }

/* ----------------------------------------------------------- calendar ---- */

.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--rule-soft); border: 1px solid var(--rule-soft);
  border-radius: var(--radius-lg); overflow: hidden; margin: 1rem 0;
  box-shadow: var(--lift-1);
}
.cal .dow {
  background: var(--ink); color: #fff; font-family: var(--mono);
  font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  text-align: center; padding: .55rem .15rem;
}
.cal .day { background: var(--surface); min-height: 60px; padding: .4rem .45rem; }
.cal .day.pad { background: var(--paper); }
.cal .day .bs { font-family: var(--display); font-size: 1.1rem; display: block; line-height: 1.1; }
.cal .day .ad { font-family: var(--mono); font-size: .62rem; color: var(--muted); }
.cal .day.sat .bs, .cal .day.holiday .bs { color: var(--crimson); }
.cal .day.holiday { background: #FEF6F7; }
.cal .day .ev { display: block; font-size: .6rem; color: var(--crimson); line-height: 1.25; margin-top: .15rem; }
@media (max-width: 700px) {
  .cal .day { min-height: 46px; padding: .3rem .25rem; }
  .cal .day .bs { font-size: .95rem; }
  .cal .day .ad { font-size: .56rem; }
  .cal .day .ev { display: none; }
  .cal .dow { font-size: .55rem; padding: .45rem .1rem; }
}

/* ---------------------------------------------------------------- faq ---- */

.faq { border-top: 2px solid var(--ink); margin-top: 1rem; }
.faq details { border-bottom: 1px solid var(--rule-soft); }
.faq summary {
  cursor: pointer; padding: .95rem 0; font-weight: 500;
  list-style: none; display: flex; gap: 1rem; align-items: flex-start;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--marigold-d);
  font-family: var(--mono); font-size: 1.15rem; line-height: 1.2; flex: none;
}
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { color: var(--ink); }
.faq details > div { padding: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; }
.faq details > div > p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- prose ---- */

.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.1rem; margin: 0 0 1.05rem; }
.prose li { margin-bottom: .4rem; }
code {
  font-family: var(--mono); font-size: .88em; background: var(--wash);
  padding: .12em .4em; border-radius: 3px; word-break: break-word;
}

.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; padding-left: 2.5rem; position: relative; margin-bottom: .85rem; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -.05rem;
  font-family: var(--mono); font-size: .75rem; color: var(--marigold-d);
  border: 1px solid var(--rule); background: var(--surface); border-radius: 50%;
  width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
}
.note {
  border-left: 3px solid var(--marigold); background: var(--surface);
  padding: .85rem 1rem; color: var(--ink-soft); font-size: .93rem;
  border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1.05rem;
}

.toc {
  background: var(--surface); border: 1px solid var(--rule-soft);
  border-top: 2px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius);
  padding: 1rem 1.2rem; margin: 1.4rem 0; box-shadow: var(--lift-1);
}
.toc p {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem;
}
.toc ol { margin: 0; padding-left: 1.1rem; font-size: .93rem; }
.toc li { margin-bottom: .3rem; }

.search-hero {
  background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--ink);
  border-radius: var(--radius-lg); padding: 1.15rem; margin: 1.4rem 0; box-shadow: var(--lift-2);
}
.search-hero .searchbar { margin: 0; max-width: none; }
/* Results are rendered server-side and replaced in place, so the grid keeps a
   floor height and nothing below it jumps when a query narrows the list. */
#search-results { min-height: 60vh; align-content: start; }

/* ------------------------------------------------------------- footer ---- */

.foot {
  background: var(--ink-deep); color: var(--on-ink); margin-top: 3.5rem;
  padding: 2.5rem 0 1.75rem; font-size: .9rem;
}
.foot h2 {
  color: #fff; font-size: .72rem; font-family: var(--mono); letter-spacing: .15em;
  text-transform: uppercase; margin: 0 0 .75rem;
  border-top: 1px solid #2B3C5E; padding-top: .75rem; position: relative;
}
.foot h2::before {
  content: ""; position: absolute; top: -1px; left: 0;
  width: 1.75rem; height: 1px; background: var(--marigold);
}
.foot a { color: var(--on-ink); text-decoration: none; }
.foot a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--marigold); }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin-bottom: .38rem; }
.foot-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.foot-base {
  border-top: 1px solid #2B3C5E; margin-top: 1.9rem; padding-top: 1.15rem;
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .8rem; color: var(--on-ink-dim);
}

/* ---------------------------------------------------------- utilities ---- */

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mt0 { margin-top: 0; }
.center { text-align: center; }

/* Inline links inside a sentence are exempt from the 24px minimum; stacked
   lists of links are not. */
@media (pointer: coarse) {
  .foot li a { display: inline-block; padding: .3rem 0; min-height: 24px; }
  .foot li { margin-bottom: .12rem; }
  .crumbs a { display: inline-block; padding: .2rem 0; }
  .chips a { padding: .55rem .9rem; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
}

@media (max-width: 720px) {
  .hangs, h2.hang, .section > h2:first-child { margin-top: 2.1rem; padding-top: .75rem; }
  .hangs { margin-top: 1.15rem; }
  h1 { margin-bottom: .45rem; }
  .lede { margin-bottom: .75rem; }
  .tool { margin-top: 1rem; }
  .crumbs { padding-top: .6rem; }
  .eyebrow { margin-bottom: .3rem; }
  h2 { margin-top: 2.1rem; }
}

@media print {
  .masthead, .foot, .nav, .btn, .crumbs { display: none; }
  body { background: #fff; font-size: 11pt; }
  .tool, .card, .answer { box-shadow: none; border: 1px solid #ccc; }
}
