/* Tithi Mithi — one stylesheet for every page.
   Rajdhani for English and Nepali; Nepali digits (०–९) come from a tiny Noto Sans Devanagari subset,
   because Rajdhani draws them with Latin shapes. Night-navy bands, crimson accents, roomy white cards. */

:root {
  --bg: #f4f5fa;
  --paper: #ffffff;
  --surface: #f6f7fc;
  --surface-2: #eceef6;
  --line: #e2e5ef;
  --line-strong: #cfd4e3;
  --ink: #0c1230;
  --ink-2: #3a4263;
  --ink-3: #69718f;
  --night: #0c1230;
  --night-2: #18204a;
  --on-night: #f3f5ff;
  --on-night-2: #b9c0e0;
  --crimson: #e3173e;
  --crimson-ink: #c3112f;
  --crimson-wash: #ffecf0;
  --blue: #2446c7;
  --blue-wash: #e8edff;
  --green: #12805c;
  --on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(12, 18, 48, .05);
  --shadow: 0 1px 2px rgba(12, 18, 48, .04), 0 10px 30px -12px rgba(12, 18, 48, .14);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: 'Noto Sans Devanagari', 'Rajdhani', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080b1a; --paper: #111731; --surface: #171e3b; --surface-2: #1f2748; --line: #252e52; --line-strong: #333d66;
    --ink: #eef0fb; --ink-2: #bcc2dc; --ink-3: #8b93b4;
    --night: #050817; --night-2: #121a3d;
    --crimson: #ff4a6b; --crimson-ink: #ff6f88; --crimson-wash: #3a1426;
    --blue: #8aa6ff; --blue-wash: #1a2550; --green: #3ccf97; --on-accent: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #080b1a; --paper: #111731; --surface: #171e3b; --surface-2: #1f2748; --line: #252e52; --line-strong: #333d66;
  --ink: #eef0fb; --ink-2: #bcc2dc; --ink-3: #8b93b4;
  --night: #050817; --night-2: #121a3d;
  --crimson: #ff4a6b; --crimson-ink: #ff6f88; --crimson-wash: #3a1426;
  --blue: #8aa6ff; --blue-wash: #1a2550; --green: #3ccf97; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 18px/1.55 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--crimson-ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.005em; }
[lang="ne"] { font-feature-settings: normal; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-sm); z-index: 50; }
.skip-link:focus { top: 12px; }
.mt-0 { margin-top: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand svg { width: 22px; height: 28px; flex: none; }
.brand-logo { height: 40px; width: auto; max-width: 180px; object-fit: contain; flex: none; display: block; }
@media (max-width: 420px) { .brand-logo { height: 34px; max-width: 140px; } }
.brand-name { font: 700 24px/1 var(--font-display); letter-spacing: .01em; }
.brand-name span { color: var(--crimson); }
.theme-toggle {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; color: var(--ink-2);
}
.theme-toggle:hover { border-color: var(--line-strong); color: var(--ink); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-weight: 600; font-size: 17px; white-space: nowrap; line-height: 1.3;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--crimson-wash); color: var(--crimson-ink); }
.nav-desktop { display: none; }
.nav-mobile ul { overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav-mobile ul::-webkit-scrollbar { display: none; }
.nav-mobile a { background: var(--surface); }
@media (min-width: 1060px) {
  .nav-desktop { display: block; }
  .nav-mobile { display: none; }
}

/* ---------- Ad slots (hidden until AdSense is configured, or ?ads=preview) ---------- */
.ad-slot { display: none; margin: 24px auto; text-align: center; }
.ad-slot.is-active { display: block; }
.ad-slot .ad-label { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .04em; }
.ad-slot .ad-box { min-height: 100px; width: 100%; }
.ad-slot[data-ad="sidebar"] .ad-box, .ad-slot[data-ad="inContent"] .ad-box, .ad-slot[data-ad="bottom"] .ad-box { min-height: 250px; }
@media (min-width: 720px) {
  .ad-slot[data-ad="top"] .ad-box { min-height: 90px; }
  .ad-slot[data-ad="sidebar"] .ad-box { min-height: 600px; }
}
.ad-slot.is-preview .ad-box {
  display: grid; place-items: center; border: 2px dashed var(--line-strong); border-radius: var(--radius-md);
  color: var(--ink-3); font-size: 15px; background: var(--paper);
}

/* ---------- Page head: night band ---------- */
main { display: block; padding: 24px 0 64px; }
@media (min-width: 720px) { main { padding-top: 32px; } }
.page-head {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--on-night);
  border-radius: 24px; padding: 36px 24px 40px; margin: 0 0 32px;
}
.page-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(110deg, transparent 20%, #000 75%);
  -webkit-mask-image: linear-gradient(110deg, transparent 20%, #000 75%);
}
.page-head::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  width: 420px; height: 420px; right: -140px; top: -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(227, 23, 62, .45), transparent 65%);
}
@media (min-width: 720px) { .page-head { padding: 56px 56px 60px; margin-bottom: 40px; } }
.page-head h1, .h1 {
  font: 700 clamp(38px, 6.4vw, 68px)/1 var(--font-display);
  letter-spacing: -.015em; margin: 0 0 14px; color: var(--on-night); max-width: 18ch;
}
.page-head .lede { margin: 0; color: var(--on-night-2); max-width: 60ch; font-size: clamp(18px, 2vw, 21px); line-height: 1.5; }
.page-head .lede em { color: var(--on-night); }
.page-head code { background: rgba(255, 255, 255, .12); color: var(--on-night); }
.page-head-home { padding-bottom: 44px; }
@media (min-width: 720px) { .page-head-home { padding: 64px 56px 68px; } }
.home-today {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 24px;
  padding: 10px 18px; border-radius: 999px; text-decoration: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: var(--on-night);
}
.home-today:hover { background: rgba(255, 255, 255, .14); color: var(--on-night); }
.home-today strong { font-size: 19px; font-weight: 700; }
.home-today span { color: var(--on-night-2); font-size: 16px; }

/* ---------- Layout ---------- */
.with-aside { display: grid; gap: 32px; align-items: start; }
.with-aside > * { min-width: 0; }
@media (min-width: 1060px) { .with-aside { grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; } }
.aside { display: grid; gap: 20px; position: relative; }
@media (min-width: 1060px) { .aside { position: sticky; top: 92px; } }
.aside-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.aside-block h2 { font-size: 20px; margin: 0 0 8px; }
.aside-block ul { list-style: none; padding: 0; margin: 0; }
.aside-block li + li { border-top: 1px solid var(--line); }
.aside-block li a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; text-decoration: none; color: var(--ink); font-weight: 600; line-height: 1.3; }
.aside-block li a:hover { color: var(--crimson-ink); }
.aside-block li a .ne { color: var(--ink-3); font-weight: 500; }
.aside .ad-slot { margin: 0; }
.section-title { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.1; margin: 56px 0 18px; }

/* ---------- Buttons & controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 8px 18px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font-weight: 600; font-size: 17px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--night-2); border-color: var(--night-2); color: #fff; box-shadow: 0 8px 18px -8px rgba(12, 18, 48, .5); }
:root[data-theme="dark"] .btn-primary:hover { color: var(--night); }
.btn-icon { width: 46px; padding: 0; }
.btn-lg { min-height: 54px; padding: 12px 22px; font-size: 18px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn.is-done, .btn-primary.is-done { background: var(--green); border-color: var(--green); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 700; font-size: 17px; color: var(--ink); }
.field .hint, .hint { font-size: 15.5px; color: var(--ink-3); }
select, .input {
  min-height: 48px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--paper); width: 100%; font-size: 17px;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
select:hover, .input:hover { border-color: var(--ink-3); }
select:focus, .input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-wash); }

/* ---------- Cards shared by tools ---------- */
.tt-step, .panel, .cal, .aside-block, .cta-box, .leaf { box-shadow: var(--shadow); }

/* ---------- Typing tool ---------- */
.tt { display: grid; gap: 20px; }
.tt-step { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
@media (min-width: 720px) { .tt-step { padding: 28px 32px 32px; } }
.tt-h { display: flex; align-items: center; gap: 12px; font-size: 24px; line-height: 1.2; margin: 0 0 18px; }
.tt-num {
  width: 36px; height: 36px; border-radius: 11px; background: var(--crimson); color: #fff;
  display: grid; place-items: center; font-size: 19px; font-weight: 700; flex: none;
  box-shadow: 0 6px 14px -6px var(--crimson);
}
.tt-opt { font-weight: 500; color: var(--ink-3); font-size: 17px; }
.tt-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tt-modes button {
  position: relative; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-md);
  padding: 12px 8px; cursor: pointer; display: grid; gap: 2px; text-align: center; min-height: 74px; align-content: center; color: var(--ink);
  transition: border-color .15s ease, background-color .15s ease;
}
.tt-modes button:hover { border-color: var(--line-strong); }
.tt-modes button[aria-checked="true"] { border-color: var(--crimson); background: var(--crimson-wash); }
.m-title { font-weight: 700; font-size: 18px; line-height: 1.15; }
.m-eg { font-size: 14.5px; color: var(--ink-2); line-height: 1.3; }
@media (min-width: 720px) { .m-title { font-size: 20px; } .m-eg { font-size: 15.5px; } }
.tt-input {
  display: block; width: 100%; min-height: 150px; font-size: 24px; line-height: 1.55; padding: 16px 18px;
  border: 2px solid var(--line); border-radius: var(--radius-md); resize: vertical; background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.tt-input::placeholder { color: var(--ink-3); opacity: .8; }
.tt-input:focus { border-color: var(--blue); background: var(--paper); outline: none; box-shadow: 0 0 0 4px var(--blue-wash); }
.tt-mono, .tt-input.tt-mono { font-family: var(--mono); }
.tt-input.tt-mono { font-size: 19px; }
.tt-row { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
.tt-row .btn { flex: 1 1 0; }
@media (min-width: 560px) { .tt-row .btn { flex: none; } }
.tt-count { margin-left: auto; color: var(--ink-3); font-size: 15px; font-weight: 600; }
.tt-outs { display: grid; gap: 18px; }
@media (min-width: 780px) { .tt-outs { grid-template-columns: 1fr 1fr; gap: 24px; } }
.tt[data-mode="unicode"] [data-out="unicode"], .tt[data-mode="preeti"] [data-out="preeti"] { display: none; }
.tt[data-mode="unicode"] .tt-outs, .tt[data-mode="preeti"] .tt-outs { grid-template-columns: 1fr; }
.tt-out { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tt-out-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.tt-out h3 { margin: 0; font-size: 20px; }
.tt-hint { font-size: 15px; color: var(--ink-3); }
.tt-text {
  min-height: 104px; max-height: 320px; overflow: auto; padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px dashed var(--line-strong); font-size: 26px; line-height: 1.55;
  white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text;
}
.tt-text.tt-mono { font-size: 19px; }
.tt-text.is-empty { color: var(--ink-3); font-size: 17px; font-family: var(--font); }
.tt-out .btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.tt-out .btn-primary:hover { background: var(--crimson-ink); border-color: var(--crimson-ink); box-shadow: 0 10px 22px -10px var(--crimson); }
.tt-out .btn-primary.is-done { background: var(--green); border-color: var(--green); }

.chips-title { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); font-weight: 700; }
.chips-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px 8px; scrollbar-width: thin; }
.font-chip {
  flex: none; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-md);
  padding: 8px 14px; cursor: pointer; display: grid; min-width: 100px; text-align: center; color: var(--ink);
}
.font-chip:hover { border-color: var(--line-strong); }
.font-chip[aria-checked="true"] { border-color: var(--crimson); background: var(--crimson-wash); }
.chip-sample { font-size: 26px; line-height: 1.35; }
.chip-name { font-size: 14px; color: var(--ink-2); white-space: nowrap; font-weight: 600; }
.preview-stage {
  margin-top: 8px; border-radius: var(--radius-md); border: 1px solid var(--line); background: #fff;
  background-image: radial-gradient(#e7e9f2 1px, transparent 1.2px); background-size: 18px 18px;
  padding: 28px 20px; min-height: 170px; display: grid; place-items: center; overflow: auto;
}
.preview-stage.on-dark { background-color: #0c1230; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px); }
.preview-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; text-align: center; max-width: 100%; color: #0c1230; }
.preview-text.is-sample { opacity: .4; }
.preview-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 18px 0; }
.pc-size { display: flex; align-items: center; gap: 12px; font-weight: 700; flex: 1 1 220px; }
.pc-size input { flex: 1; accent-color: var(--crimson); min-height: 36px; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line); background: var(--sw); cursor: pointer; padding: 0; }
.swatches button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--crimson); }
.pc-bg { display: flex; gap: 8px; align-items: center; font-weight: 600; min-height: 44px; cursor: pointer; }
.pc-bg input { width: 22px; height: 22px; accent-color: var(--crimson); }
.preview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preview-actions .btn { padding-left: 10px; padding-right: 10px; }
@media (min-width: 780px) { .preview-actions { display: flex; flex-wrap: wrap; } }
.tt-note { margin: 14px 0 0; font-size: 15.5px; color: var(--ink-3); }

/* ---------- Home ---------- */
.home-top { display: grid; gap: 24px; grid-template-areas: "leaf" "cal" "tools"; }
.home-leaf { grid-area: leaf; }
.home-cal { grid-area: cal; min-width: 0; }
.home-tools { grid-area: tools; }
@media (min-width: 1060px) {
  .home-top { grid-template-columns: 320px minmax(0, 1fr); grid-template-areas: "leaf cal" "tools cal"; grid-template-rows: auto 1fr; gap: 32px; align-items: start; }
}
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tool-list a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 16px 18px; text-decoration: none; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .15s ease;
}
.tool-list a:hover { border-color: var(--crimson); transform: translateY(-1px); color: var(--ink); }
.tool-list .t-name { font-weight: 700; font-size: 20px; line-height: 1.2; }
.tool-list .t-ne { color: var(--ink-3); font-size: 17px; grid-row: 1; grid-column: 2; }
.tool-list .t-desc { color: var(--ink-2); grid-column: 1 / -1; font-size: 16px; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .tool-list a { transition: none; } .tool-list a:hover { transform: none; } }

/* ---------- Calendar leaf ---------- */
.leaf { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.leaf-top { background: var(--crimson); color: #fff; padding: 14px 22px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.leaf-top .m { font-weight: 700; font-size: 22px; }
.leaf-top .m-en { font-size: 16px; opacity: .9; font-weight: 600; }
.leaf-body { padding: 10px 22px 22px; display: grid; grid-template-columns: auto 1fr; gap: 0 20px; align-items: center; }
.leaf-day { font: 700 clamp(96px, 26vw, 128px)/1.05 var(--font-display); color: var(--ink); padding-top: 8px; letter-spacing: -.02em; }
.leaf-day.is-sat { color: var(--crimson); }
.leaf-meta { display: grid; gap: 2px; }
.leaf-meta .wd { font-weight: 700; font-size: 24px; }
.leaf-meta .wd-en, .leaf-meta .ad { color: var(--ink-2); font-size: 17px; }
.leaf-foot { grid-column: 1 / -1; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: 16px; }
.leaf-foot strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.leaf-events { grid-column: 1 / -1; margin: 10px 0 0; padding: 0; list-style: none; }
.leaf-events li { color: var(--crimson-ink); font-weight: 700; font-size: 16px; }
@media (min-width: 1060px) { .leaf-body { grid-template-columns: 1fr; } .leaf-day { font-size: 150px; } }

/* ---------- Calendar ---------- */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-bar .selects { display: flex; gap: 10px; flex: 1 1 100%; min-width: 0; order: -1; }
.cal-bar select { width: auto; flex: 1; min-width: 0; }
.cal-bar .btn-today { flex: 1; order: 1; }
.cal-bar .btn-next { order: 2; }
@media (min-width: 560px) {
  .cal-bar { flex-wrap: nowrap; }
  .cal-bar .selects { flex: 1 1 auto; order: 0; }
  .cal-bar .btn-today { flex: none; order: 3; }
  .cal-bar .btn-next { order: 0; }
}
.cal-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; padding: 20px 20px 6px; }
.cal-title h2 { font: 700 32px/1.1 var(--font-display); margin: 0; }
.cal-title .sub { color: var(--ink-3); font-size: 16px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; padding: 10px 10px 14px; }
.cal-dow { text-align: center; font-weight: 700; font-size: 15px; color: var(--ink-2); padding: 6px 0; line-height: 1.2; }
.cal-dow small { display: block; font-weight: 600; font-size: 12px; color: var(--ink-3); }
.cal-dow.sat, .cal-dow.sat small { color: var(--crimson); }
.cal-day {
  position: relative; min-height: 60px; padding: 7px 7px 5px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; color: var(--ink);
  transition: border-color .12s ease, background-color .12s ease;
}
.cal-day:hover { border-color: var(--line-strong); background: var(--paper); }
.cal-day .bs { font-weight: 700; font-size: 22px; line-height: 1; }
.cal-day .ad { font-size: 12.5px; color: var(--ink-3); align-self: flex-end; line-height: 1; font-weight: 600; }
.cal-day .ev { display: none; }
.cal-day.is-sat .bs, .cal-day.is-holiday .bs { color: var(--crimson); }
.cal-day.is-holiday { background: var(--crimson-wash); }
.cal-day.has-event::after { content: ''; position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--crimson); }
.cal-day.is-today { background: var(--crimson); border-color: var(--crimson); box-shadow: 0 10px 22px -10px var(--crimson); }
.cal-day.is-today .bs, .cal-day.is-today .ad, .cal-day.is-today .ev { color: #fff; }
.cal-day.is-today::after { background: #fff; }
.cal-day[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cal-day.is-today[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #fff, 0 10px 22px -10px var(--crimson); }
.cal-blank { min-height: 60px; }
@media (min-width: 720px) {
  .cal-grid { gap: 8px; padding: 12px 18px 20px; }
  .cal-day, .cal-blank { min-height: 88px; }
  .cal-day { padding: 10px 11px 8px; }
  .cal-day .bs { font-size: 28px; }
  .cal-day .ad { font-size: 13.5px; }
  .cal-day .ev { display: -webkit-box; font-size: 12.5px; line-height: 1.2; color: var(--crimson-ink); overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-top: 2px; font-weight: 600; }
  .cal-day.has-event::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cal-day { transition: none; } }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0 20px 16px; font-size: 15px; color: var(--ink-3); font-weight: 600; }
.cal-legend span::before { content: ''; display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 7px; vertical-align: -1px; }
.cal-legend .lg-today::before { background: var(--crimson); }
.cal-legend .lg-hol::before { background: var(--crimson-wash); border: 1px solid var(--crimson); }
.cal-legend .lg-sat::before { border: 2px solid var(--crimson); }
.cal-detail { border-top: 1px solid var(--line); padding: 18px 20px 20px; display: grid; gap: 4px; background: var(--surface); }
.cal-detail .d-ne { font-weight: 700; font-size: 24px; }
.cal-detail .d-en { color: var(--ink-2); }
.cal-detail .d-ev { color: var(--crimson-ink); font-weight: 700; }
.cal-detail .d-actions { margin-top: 6px; }
.month-events { margin: 32px 0 0; }
.month-events h2 { font-size: 26px; margin: 0 0 12px; }
.month-events ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.month-events li { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 14px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); }
.month-events .when { font-weight: 700; }
.month-events .when small, .month-events .what small { display: block; font-weight: 500; color: var(--ink-3); font-size: 15px; }
.month-events .what { font-weight: 700; }
.month-events .empty { color: var(--ink-3); display: block; grid-column: 1 / -1; font-weight: 500; }

/* ---------- Date converter ---------- */
.conv-grid { display: grid; gap: 20px; }
@media (min-width: 800px) { .conv-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
@media (min-width: 720px) { .panel { padding: 28px; } }
.panel h2 { margin: 0 0 2px; font-size: 28px; }
.panel .panel-sub { margin: 0 0 18px; color: var(--ink-3); font-size: 16px; }
fieldset.ymd { border: 0; padding: 0; margin: 0; min-width: 0; }
.ymd { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px 10px; }
.ymd .field:first-of-type { grid-column: 1 / -1; }
.result {
  margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night);
  min-height: 118px; display: grid; gap: 2px; align-content: start;
}
.result .r-main { font-weight: 700; font-size: 28px; line-height: 1.2; }
.result .r-sub { color: var(--on-night-2); font-size: 17px; }
.result .r-rel { color: #ff9fb2; font-size: 16px; font-weight: 600; }
.result .r-err { color: #ffb4c2; font-weight: 600; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ---------- Article content ---------- */
.prose { max-width: 72ch; font-size: 18.5px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(26px, 3vw, 32px); line-height: 1.15; margin: 48px 0 12px; }
.prose h3 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--crimson); font-weight: 700; }
.prose code, kbd {
  font-family: var(--mono); font-size: .82em; background: var(--surface-2);
  padding: 2px 7px; border-radius: 7px; color: var(--ink); font-weight: 500;
}
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.prose figure { margin: 24px 0; }
.prose figcaption { font-size: 15px; color: var(--ink-3); margin-top: 8px; }
.prose blockquote { border-left: 4px solid var(--crimson); margin: 20px 0; padding: 4px 20px; background: var(--paper); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.prose pre { overflow-x: auto; background: var(--night); color: var(--on-night); padding: 16px 18px; border-radius: var(--radius-md); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose h2[id], .prose h3[id] { scroll-margin-top: 90px; }
article.prose, .with-aside > div > .prose { margin-top: 48px; }
.table-wrap { position: relative; overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: 16.5px; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--surface); font-weight: 700; color: var(--ink); }
tr:last-child td { border-bottom: 0; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 0 20px; }
.faq details[open] { border-color: var(--line-strong); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; font-size: 19px; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 600; font-size: 26px; line-height: .9; color: var(--crimson); flex: none; }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 18px; }
.notice { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: var(--paper); padding: 14px 18px; border-radius: var(--radius-sm); color: var(--ink-2); font-size: 16.5px; margin: 24px 0; }

.keymap { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 12px 0 4px; }
.keymap div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.keymap b { font-size: 24px; font-weight: 700; color: var(--ink); }
.keymap code { background: none; padding: 0; color: var(--ink-2); }
.keymap-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
#keys { margin-top: 48px; }

/* ---------- Blog ---------- */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.post-item {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px;
  display: grid; gap: 16px; box-shadow: var(--shadow-sm); transition: border-color .15s ease;
}
.post-item:hover { border-color: var(--line-strong); }
.post-list > li:not(.post-item) { list-style: none; }
@media (min-width: 640px) { .post-item.has-cover { grid-template-columns: minmax(0, 1fr) 220px; align-items: center; } }
.post-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-md); }
.post-item h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.15; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { color: var(--crimson-ink); }
.post-item p { margin: 6px 0 0; color: var(--ink-2); font-size: 17px; }
.post-meta { color: var(--ink-3); font-size: 15.5px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 28px 0; }
.post-head {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--night); color: var(--on-night); border-radius: 24px; padding: 32px 24px 36px; margin-bottom: 28px;
}
.post-head::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.4px); background-size: 22px 22px;
  mask-image: linear-gradient(110deg, transparent 25%, #000 80%); -webkit-mask-image: linear-gradient(110deg, transparent 25%, #000 80%);
}
@media (min-width: 720px) { .post-head { padding: 48px 48px 52px; } }
.post-head h1 { font: 700 clamp(32px, 5vw, 54px)/1.04 var(--font-display); margin: 0 0 14px; letter-spacing: -.012em; max-width: 22ch; }
.post-head .post-meta { color: var(--on-night-2); }
.breadcrumbs { font-size: 15.5px; color: var(--on-night-2); margin-bottom: 12px; font-weight: 600; }
.breadcrumbs a { color: var(--on-night); }
.post-cover { margin: 0 0 24px; }
.post-cover img { width: 100%; height: auto; border-radius: var(--radius); }
.toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 22px; margin: 0 0 32px; }
.toc h2 { font-size: 18px !important; margin: 0 0 6px !important; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { font-size: 17px; }
.cta-box {
  background: var(--night); color: var(--on-night); border-radius: var(--radius); padding: 26px 28px; margin: 40px 0; max-width: 72ch; border: 0;
}
.cta-box h2 { font-size: 26px; margin: 0 0 6px; color: var(--on-night); }
.cta-box p { margin: 0 0 16px; color: var(--on-night-2); }
.cta-box .btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0; max-width: 72ch; align-items: center; }
.share span { color: var(--ink-3); margin-right: 4px; font-weight: 700; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; max-width: 600px; }
.form textarea.input { min-height: 170px; resize: vertical; line-height: 1.5; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.wrap > .form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .wrap > .form { padding: 32px; } }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin: 0 0 18px; max-width: 600px; font-weight: 600; }
.alert-ok { background: #e6f6ef; color: #0b5a40; border: 1px solid #b4e3cd; }
.alert-err { background: var(--crimson-wash); color: var(--crimson-ink); border: 1px solid var(--crimson); }
.field .err { color: var(--crimson-ink); font-size: 15.5px; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: var(--on-night-2); padding: 48px 0 40px; font-size: 16.5px; }
.footer-cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 18px; margin: 0 0 10px; color: var(--on-night); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 4px 0; }
.site-footer a { color: var(--on-night-2); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-note { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); color: #8189ad; font-size: 14.5px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 14px; font-weight: 600; z-index: 60;
  box-shadow: 0 16px 34px -12px rgba(12, 18, 48, .45);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-action { margin-left: 10px; background: transparent; border: 0; color: inherit; text-decoration: underline; font-weight: 700; cursor: pointer; padding: 4px 6px; font-size: inherit; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- Home hero: copy + live demo ---------- */
.hero-demo { display: none; }
@media (min-width: 980px) {
  .page-head-home { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  .page-head-home h1 { max-width: 12ch; }
  .hero-demo {
    display: grid; gap: 10px; padding: 18px; border-radius: 20px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
  .hd-row { display: grid; gap: 4px; padding: 14px 18px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
  .hd-main { background: var(--crimson); box-shadow: 0 18px 36px -16px rgba(227, 23, 62, .8); }
  .hd-tag { font-size: 14px; font-weight: 700; color: var(--on-night-2); letter-spacing: .03em; }
  .hd-main .hd-tag { color: rgba(255, 255, 255, .85); }
  .hd-val { font-size: 26px; font-weight: 700; color: var(--on-night); line-height: 1.3; }
  .hd-main .hd-val { font-size: 36px; color: #fff; }
  .hd-mono, .hd-roman { font-family: var(--mono); font-size: 20px; font-weight: 500; }
}
.home-today { border-radius: 16px; }

/* ---------- Font search + colour picker ---------- */
.font-search { position: relative; display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.font-search svg { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.font-search .input { padding-left: 44px; background: var(--surface); flex: 1; min-width: 0; }
.font-search .input:focus { background: var(--paper); }
.font-count { font-size: 15px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.font-empty { margin: 0 0 12px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface); color: var(--ink-2); font-size: 16px; }
.chips-row[hidden], .chips-title[hidden], .font-chip[hidden] { display: none; }
.color-pick {
  position: relative; width: 38px; height: 38px; border-radius: 12px; cursor: pointer; flex: none;
  background: conic-gradient(#e3173e, #f59e0b, #22c55e, #06b6d4, #2446c7, #a855f7, #e3173e);
  border: 2px solid var(--line);
}
.color-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.color-pick .cp-swatch { position: absolute; inset: 8px; border-radius: 6px; background: var(--sw, transparent); border: 2px solid #fff; display: none; }
.color-pick.is-on .cp-swatch { display: block; }
.color-pick.is-on { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--crimson); }
.color-pick:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.hex-field { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.hex-field .input { width: 112px; min-height: 42px; font-family: var(--mono); font-size: 16px; text-transform: uppercase; }
.hex-field .input.is-bad { border-color: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-wash); }

/* =================================================================
   Guides, festivals and extra tools
   ================================================================= */
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.check { display: flex; align-items: center; gap: 10px; font-size: 17px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--crimson); flex: none; }
.mt { margin-top: 20px; }
.badge { display: inline-flex; align-items: center; font-size: 13.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; white-space: nowrap; text-transform: capitalize; }
.badge-hol { background: var(--crimson-wash); color: var(--crimson-ink); }
.chip { border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-size: 16px; font-weight: 600; cursor: pointer; min-height: 38px; }
.chip:hover { border-color: var(--crimson); color: var(--crimson-ink); }
.input-xl { font-size: 26px; min-height: 60px; font-weight: 700; letter-spacing: .01em; }
textarea.input { resize: vertical; line-height: 1.5; font-family: inherit; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 460px; padding: 4px; background: var(--surface-2); border-radius: 14px; margin-bottom: 18px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 17px; padding: 10px 16px; border-radius: 10px; cursor: pointer; min-height: 44px; }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Word guide ---------- */
.guide-search { display: grid; gap: 14px; margin-bottom: 20px; }
.search-big { position: relative; }
.search-big svg { position: absolute; left: 18px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-big input {
  width: 100%; min-height: 64px; padding: 12px 18px 12px 54px; border-radius: 18px; font-size: 22px; font-weight: 600;
  border: 2px solid var(--line-strong); background: var(--paper); box-shadow: var(--shadow);
}
.search-big input:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 5px var(--crimson-wash); }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.cat-chip { flex: none; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: 16px; font-weight: 700; cursor: pointer; min-height: 40px; }
.cat-chip span { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.cat-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.cat-chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.g-live { display: grid; gap: 12px; margin-bottom: 20px; }
.gl-best, .gl-typed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 20px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); }
.gl-best { background: var(--night); border-color: var(--night); color: var(--on-night); }
.gl-best a:not(.btn) { color: #fff; text-decoration: none; }
.gl-best code { background: rgba(255, 255, 255, .12); color: #fff; }
.gl-best .btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.gl-label { flex: 1 1 100%; font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
.gl-best b, .gl-typed b { font-size: 34px; line-height: 1.3; }
.word-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: 20px; }
.word-card {
  display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease; min-width: 0;
}
.word-card:hover { border-color: var(--crimson); transform: translateY(-1px); color: var(--ink); }
.word-card[hidden] { display: none; }
.wc-ne { font-size: 30px; font-weight: 700; line-height: 1.35; }
.wc-en { font-size: 17px; font-weight: 700; color: var(--ink-2); }
.wc-keys { font-size: 15px; color: var(--ink-3); overflow-wrap: anywhere; }
.g-empty { padding: 18px; border-radius: var(--radius-md); background: var(--surface); }
@media (prefers-reduced-motion: reduce) { .word-card { transition: none; } .word-card:hover { transform: none; } }

.word-hero { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 18px; }
@media (min-width: 720px) { .word-hero { padding: 28px 32px; } }
.wh-word { font-size: clamp(56px, 12vw, 88px); font-weight: 700; line-height: 1.25; color: var(--crimson); }
.wh-rows { display: grid; gap: 12px; }
.wh-row { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface); }
@media (min-width: 720px) { .wh-row { grid-template-columns: 1fr auto; align-items: center; } .wh-row .wh-label { grid-column: 1 / -1; } }
.wh-label { font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.wh-code { font-size: 24px; font-weight: 700; background: none; padding: 0; overflow-wrap: anywhere; }
.wh-ne { font-size: 30px; font-weight: 700; }
.wh-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.alias-list { display: flex; flex-wrap: wrap; gap: 8px; }
.alias { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 600; }

/* breakdown */
.bd-section { margin-top: 8px; }
.bd-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); margin-top: 14px; }
.bd-syl { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 10px; align-content: start; }
.bd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line-strong); padding-bottom: 8px; }
.bd-big { font-size: 44px; font-weight: 700; line-height: 1.25; color: var(--crimson); }
.bd-keys { font-size: 20px; font-weight: 700; }
.bd-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bd-parts li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; font-size: 15.5px; color: var(--ink-2); }
.bd-parts b { font-size: 26px; color: var(--ink); text-align: center; }
.bd-note { margin: 0; font-size: 15px; color: var(--ink-2); background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.bd-tool { margin-bottom: 20px; }
.bd-input { min-height: 0; font-size: 24px; }
.bd-out { margin-top: 16px; }
.bd-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 18px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night); }
.bd-summary b { font-size: 36px; line-height: 1.3; }
.bd-summary code { background: rgba(255, 255, 255, .12); color: #fff; }

/* barakhari & letters */
.bk-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.bk-picker button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: 22px; cursor: pointer; }
.bk-picker button:hover { border-color: var(--crimson); }
.bk-picker button[aria-checked="true"] { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.bk-grid, .letter-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.bk-cell, .lg-cell { display: grid; justify-items: center; gap: 2px; padding: 12px 6px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.bk-cell b, .lg-cell b { font-size: 38px; line-height: 1.3; }
.bk-cell code, .lg-cell code { font-size: 16px; font-weight: 700; }
.bk-cell small, .lg-cell small { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }
.big-cell { font-size: 28px; }

/* typing hints */
.tt-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hint-chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; text-align: left; border: 1px solid #f2c94c; background: #fff8db; color: #5c4400; border-radius: 12px; padding: 8px 14px; font-size: 16px; cursor: pointer; }
.hint-chip b { font-size: 22px; color: var(--ink); }
.hint-chip:hover { border-color: #d4a017; }
.hc-keys { font-family: var(--mono); font-size: 14px; color: #7a5b00; }
.hint-more { font-size: 15px; font-weight: 700; }
:root[data-theme="dark"] .hint-chip { background: #2e2810; border-color: #6b5714; color: #f7e7a6; }
:root[data-theme="dark"] .hc-keys { color: #e6cf77; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hint-chip { background: #2e2810; border-color: #6b5714; color: #f7e7a6; } :root:not([data-theme="light"]) .hc-keys { color: #e6cf77; } }

/* ---------- Festivals ---------- */
.year-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.year-nav strong { font-size: 32px; }
.fest-month { margin-bottom: 26px; }
.fest-month h2 { font-size: 26px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fest-month h2 span { font-size: 17px; color: var(--ink-3); font-weight: 600; }
.fest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fest-item { display: grid; grid-template-columns: 58px 1fr; gap: 6px 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); }
.fest-item .badge { grid-column: 2; justify-self: start; }
@media (min-width: 640px) { .fest-item { grid-template-columns: 64px 1fr auto; } .fest-item .badge { grid-column: auto; } }
.fest-item.is-past { opacity: .62; }
.fe-date { display: grid; justify-items: center; line-height: 1.1; padding: 6px 0; border-radius: 12px; background: var(--crimson-wash); color: var(--crimson-ink); }
.fe-date b { font-size: 26px; }
.fe-date span { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.fe-body { display: grid; gap: 1px; min-width: 0; }
.fe-name { font-weight: 700; font-size: 19px; color: var(--ink); }
a.fe-name { text-decoration: none; }
a.fe-name:hover { color: var(--crimson-ink); text-decoration: underline; }
.fe-ne { font-size: 17px; color: var(--ink-2); }
.fe-meta { font-size: 15px; color: var(--ink-3); }
.fest-hero { display: grid; gap: 20px; margin-bottom: 28px; }
@media (min-width: 720px) { .fest-hero { grid-template-columns: 300px 1fr; align-items: start; } }
.fh-info { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.fh-count { margin: 0 0 12px; font-size: 32px; font-weight: 700; color: var(--ink); }
.fh-count.is-soon { color: var(--crimson); }
.fh-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fh-facts li { display: grid; gap: 1px; }
.fh-facts span { font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.fh-facts b { font-size: 19px; }
.cal-detail .d-ev a, .month-events .what a { color: var(--crimson-ink); font-weight: 700; }

/* ---------- Age calculator ---------- */
.age-tool .ymd { margin-bottom: 4px; }
.age-on { margin-top: 14px; }
.age-on summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.age-on .field { margin-top: 10px; max-width: 320px; }
.age-out { margin-top: 20px; display: grid; gap: 14px; }
.age-hero { display: grid; gap: 4px; padding: 22px 24px; border-radius: var(--radius); background: var(--night); color: var(--on-night); }
.age-hero .ac-label { color: var(--on-night-2); }
.age-big { font-size: clamp(30px, 6vw, 44px); line-height: 1.15; font-weight: 700; color: #fff; }
.age-ne { font-size: 19px; color: var(--on-night-2); }
.age-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.age-card { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); }
.ac-label { font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.ac-main { font-size: 26px; line-height: 1.25; }
.ac-sub { font-size: 16px; color: var(--ink-2); }
.age-out .r-err { color: var(--crimson-ink); font-weight: 700; padding: 14px 16px; border-radius: var(--radius-md); background: var(--crimson-wash); margin: 0; }

/* ---------- Number to words ---------- */
.num-tool { display: grid; gap: 10px; }
.num-tool .hint:empty { display: none; }
.num-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.num-outs { display: grid; gap: 10px; margin: 20px 0; }
.num-out { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius-md); background: var(--paper); border: 1px solid var(--line); }
.no-label { grid-column: 1; font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.num-out output { grid-column: 1; font-size: 21px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; min-height: 1.4em; }
.num-out .btn-icon { grid-column: 2; grid-row: 1 / span 2; }
.digits-tool { margin-top: 24px; display: grid; gap: 12px; }

/* ---------- Legacy fonts ---------- */
.legacy-tool { display: grid; gap: 14px; }
.legacy-tool .field { max-width: 320px; }
.legacy-tool .btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }

/* ---------- Greeting cards ---------- */
.card-maker { display: grid; gap: 22px; margin-bottom: 28px; }
@media (min-width: 900px) { .card-maker { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .cm-canvas { position: sticky; top: 92px; } }
.cm-canvas { background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: flex; justify-content: center; }
.cm-canvas canvas { width: 100%; max-width: 560px; height: auto; max-height: 78vh; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
.cm-form { display: grid; gap: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.cm-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.cm-form legend { margin-bottom: 10px; font-size: 20px; }
.cm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cm-pick { border: 3px solid transparent; border-radius: 14px; min-height: 64px; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; padding: 6px; display: flex; align-items: flex-end; justify-content: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.cm-pick[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper) inset; }
.cm-dashain { background: linear-gradient(150deg, #b3122e, #f76707); }
.cm-tihar { background: linear-gradient(150deg, #1b1446, #4a1d6e); }
.cm-birthday { background: linear-gradient(150deg, #d6336c, #7048e8); }
.cm-newyear { background: linear-gradient(150deg, #0c1230, #2446c7); }
.cm-teej { background: linear-gradient(150deg, #c2255c, #7a0b2e); }
.cm-chhath { background: linear-gradient(150deg, #ff922b, #e64980); }
.cm-wedding { background: linear-gradient(150deg, #fff8ee, #ffd8d8); color: #5c1a1b; text-shadow: none; }
.cm-general { background: linear-gradient(150deg, #087f5b, #1864ab); }
.cm-shows { font-size: 16px; color: var(--green); font-weight: 600; }
.cm-shows:empty { display: none; }
.cm-row { display: grid; gap: 12px; }
@media (min-width: 560px) { .cm-row { grid-template-columns: 1fr 1fr; } }
.cm-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cm-actions .btn-primary { background: var(--crimson); border-color: var(--crimson); color: #fff; flex: 1 1 auto; }
@media (max-width: 420px) { .cm-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Widget ---------- */
.widget-tool { display: grid; gap: 14px; }
.wg-preview { padding: 22px; border-radius: var(--radius-md); background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 24px 24px; display: flex; justify-content: center; overflow-x: auto; }
.wg-preview iframe { border: 0; border-radius: 12px; max-width: 100%; background: transparent; }
.widget-tool textarea { font-size: 14px; }

/* ---------- All tools, install ---------- */
.tools-group .section-title { margin-top: 32px; }
.tool-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.install-box { margin-top: 16px; display: grid; gap: 10px; justify-items: start; }
.install-box[hidden] { display: none; }

/* ---------- Blog blocks: buttons, countdowns, embeds ---------- */
.cta-wrap { margin: 28px 0; }
.prose .btn-cta { text-decoration: none; min-height: 56px; padding: 12px 28px; font-size: 19px; font-weight: 700; border-radius: 16px; }
.btn-cta-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-cta-primary:hover { background: var(--night-2); color: #fff; }
.btn-cta-red { background: var(--crimson); color: #fff; border-color: var(--crimson); }
.btn-cta-red:hover { background: var(--crimson-ink); color: #fff; border-color: var(--crimson-ink); }
.btn-cta-secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.prose .btn-cta.is-locked { opacity: .55; cursor: not-allowed; }
.cd-box { margin: 32px 0; padding: 26px 24px; border-radius: 22px; background: var(--night); color: var(--on-night); text-align: center;
  background-image: radial-gradient(circle at 15% 0, rgba(227, 23, 62, .35), transparent 50%), radial-gradient(circle at 100% 100%, rgba(36, 70, 199, .45), transparent 55%); }
.prose .cd-title { margin: 0 0 14px; font-size: 21px; font-weight: 700; color: #fff; }
.cd-clock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cd-unit { display: grid; min-width: 74px; padding: 12px 8px 8px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); }
.cd-unit b { font-size: clamp(30px, 7vw, 44px); line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.cd-unit small { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-night-2); margin-top: 4px; }
.prose .cd-done { margin: 16px 0 0; font-size: 20px; font-weight: 700; color: #ffd166; }
.cd-box .cta-wrap { margin: 18px 0 0; }
.cd-box .btn-cta-primary { background: #fff; color: var(--night); border-color: #fff; }
.cd-box .btn-cta-secondary { color: #fff; border-color: #fff; }
.cd-box.is-done .cd-unit { opacity: .5; }
.cd-error { color: var(--crimson-ink); font-weight: 700; }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 24px 0; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 16px 0; background: var(--paper); }
.prose details summary { font-weight: 700; cursor: pointer; }

/* =================================================================
   Home (revamp), blog cards, contact, 404
   ================================================================= */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal] { opacity: 1; transform: none; transition: none; } }

.eyebrow { margin: 0 0 6px; font-size: 14px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--crimson-ink); }
.sec-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px; margin-bottom: 22px; }
.sec-head .eyebrow, .sec-head h2 { grid-column: 1; }
.sec-head h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; letter-spacing: -.01em; }
.sec-link { grid-column: 2; grid-row: 2; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sec-link svg, .soon-all svg, .pcard-more svg { width: 18px; height: 18px; transition: transform .2s ease; }
.sec-link:hover svg, .soon-all:hover svg { transform: translateX(3px); }
.home-section { margin: 72px 0; }
@media (min-width: 720px) { .home-section { margin: 96px 0; } }

/* hero */
.hero { position: relative; overflow: hidden; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.hero-pills span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 14.5px; font-weight: 700; color: var(--on-night); }
.hero-pills svg { width: 15px; height: 15px; color: #ff8ea3; }
.hero h1 { font-size: clamp(40px, 7vw, 68px); line-height: 1.02; letter-spacing: -.02em; max-width: 13ch; }
.hero-hl { background: linear-gradient(90deg, #ff6f88, #ffb86b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 22px; }
.btn-hero { background: var(--crimson); border-color: var(--crimson); color: #fff; box-shadow: 0 14px 30px -12px rgba(227, 23, 62, .8); }
.btn-hero:hover { background: #ff2d55; border-color: #ff2d55; color: #fff; }
.btn-hero svg { transition: transform .2s ease; }
.btn-hero:hover svg { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--on-night); border-color: rgba(255, 255, 255, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .5); }
@media (min-width: 900px) {
  .hero-demo .hd-row { opacity: 0; transform: translateY(10px); animation: hd-in .6s cubic-bezier(.2, .7, .2, 1) forwards; }
  .hero-demo .hd-2 { animation-delay: .35s; } .hero-demo .hd-3 { animation-delay: .7s; }
  .hero-demo { transform: rotate(-1.5deg); }
  .hd-main { transform: rotate(1.5deg) scale(1.03); }
}
@keyframes hd-in { to { opacity: 1; transform: none; } }
.hd-caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 3px; vertical-align: -3px; background: #ff8ea3; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-demo .hd-row { animation: none; opacity: 1; transform: none; } .hd-caret { animation: none; } }
.home-type { scroll-margin-top: 84px; }

/* today + coming up */
.home-today-grid { display: grid; gap: 20px; }
.home-today-grid > * { min-width: 0; }
@media (min-width: 760px) { .home-today-grid { grid-template-columns: 300px minmax(0, 1fr); } .soon { grid-column: 1 / -1; } }
@media (min-width: 1180px) { .home-today-grid { grid-template-columns: 290px minmax(0, 1fr) 300px; } .soon { grid-column: auto; } }
.card-soft { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.soon h3 { margin: 0 0 12px; font-size: 21px; }
.soon-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.soon-list a, .soon-list li > div { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); transition: background-color .15s ease; }
.soon-list a:hover { background: var(--crimson-wash); color: var(--ink); }
.soon-date { display: grid; justify-items: center; width: 50px; flex: none; padding: 4px 0; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); line-height: 1.05; }
.soon-date b { font-size: 22px; color: var(--crimson); }
.soon-date small { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; }
.soon-text { display: grid; min-width: 0; flex: 1; }
.soon-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-text small { color: var(--ink-3); font-size: 14px; }
.soon-hol { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--crimson-wash); color: var(--crimson-ink); flex: none; }
.soon-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }

/* tool cards with icons */
.tcard-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.tcard { display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.tcard:hover { border-color: var(--crimson); color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); }
.tcard-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--crimson-wash); color: var(--crimson); transition: transform .25s ease; }
.tcard:hover .tcard-ic { transform: rotate(-6deg) scale(1.06); }
.tcard-ic svg { width: 24px; height: 24px; }
.tcard-text { display: grid; gap: 4px; min-width: 0; }
.tcard-name { font-weight: 700; font-size: 19px; line-height: 1.2; }
.tcard-ne { font-weight: 600; font-size: 15.5px; color: var(--ink-3); margin-left: 4px; }
.tcard-desc { color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.tcard-grid li:nth-child(3n+2) .tcard-ic { background: var(--blue-wash); color: var(--blue); }
.tcard-grid li:nth-child(3n) .tcard-ic { background: #e3f6ec; color: #12805c; }
:root[data-theme="dark"] .tcard-grid li:nth-child(3n) .tcard-ic { background: #12301f; color: #3ccf97; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tcard-grid li:nth-child(3n) .tcard-ic { background: #12301f; color: #3ccf97; } }
@media (prefers-reduced-motion: reduce) { .tcard, .tcard-ic { transition: none; } .tcard:hover, .tcard:hover .tcard-ic { transform: none; } }

/* blog cards */
.pcard-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.pcard-grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (min-width: 1000px) { .pcard-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pcard { min-width: 0; }
.pcard-link { display: flex; flex-direction: column; height: 100%; border-radius: 20px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.pcard-link:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--ink); }
.pcard-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.pcard-link:hover .pcard-media img { transform: scale(1.04); }
.pcard-art { width: 100%; height: 100%; display: grid; place-items: center; color: rgba(255, 255, 255, .92); position: relative; }
.pcard-art::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .16) 1.2px, transparent 1.3px); background-size: 18px 18px; }
.pcard-art svg { width: 56px; height: 56px; position: relative; z-index: 1; transition: transform .3s ease; }
.pcard-link:hover .pcard-art svg { transform: scale(1.1) rotate(-4deg); }
.pa-0 { background: linear-gradient(135deg, #0c1230, #2446c7); }
.pa-1 { background: linear-gradient(135deg, #c3112f, #ff7a59); }
.pa-2 { background: linear-gradient(135deg, #12805c, #2bb38a); }
.pa-3 { background: linear-gradient(135deg, #5b2bbf, #c2255c); }
.pa-4 { background: linear-gradient(135deg, #b35c00, #f2a20c); }
.pa-5 { background: linear-gradient(135deg, #18204a, #e3173e); }
.pcard-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.pcard-meta { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; color: var(--ink-3); font-size: 14.5px; font-weight: 600; }
.pcard-title { margin: 0; font-size: 22px; line-height: 1.2; letter-spacing: -.005em; }
.pcard-link:hover .pcard-title { color: var(--crimson-ink); }
.pcard-text { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-more { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--blue); }
.pcard-link:hover .pcard-more svg { transform: translateX(3px); }
@media (min-width: 760px) {
  .pcard-feature { grid-column: 1 / -1; }
  .pcard-feature .pcard-link { flex-direction: row; }
  .pcard-feature .pcard-media { flex: 0 0 48%; aspect-ratio: auto; min-height: 280px; }
  .pcard-feature .pcard-body { padding: 28px 30px; justify-content: center; }
  .pcard-feature .pcard-title { font-size: 30px; }
}
.pcard-ad { grid-column: 1 / -1; }
@media (prefers-reduced-motion: reduce) { .pcard-link, .pcard-media img, .pcard-art svg { transition: none; } .pcard-link:hover, .pcard-link:hover .pcard-media img, .pcard-link:hover .pcard-art svg { transform: none; } }

/* why */
.why-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.why-grid li { padding: 24px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
.why-grid h3 { margin: 14px 0 6px; font-size: 21px; }
.why-grid p { margin: 0; color: var(--ink-2); }
.why-ic { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--night); color: #ff8ea3; }
.why-ic svg { width: 24px; height: 24px; }
.home-prose { max-width: 75ch; margin: 0 auto 48px; }

/* contact */
.contact-head h1 { font-size: clamp(36px, 6vw, 56px); }
.contact-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 980px) { .contact-grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; } .contact-side { position: sticky; top: 92px; } }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 24px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .contact-card { padding: 32px; } }
.contact-form { display: grid; gap: 18px; }
.cf-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .cf-row { grid-template-columns: 1fr 1fr; } }
.cf-foot { display: grid; gap: 10px; justify-items: start; }
.contact-form textarea { min-height: 160px; }
.reason-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.reason-list li { display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.reason-list h2 { margin: 0 0 2px; font-size: 18px; }
.reason-list p { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
.reason-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--crimson-wash); color: var(--crimson); }
.reason-ic svg { width: 21px; height: 21px; }
.link-btn { border: 0; background: none; padding: 0; margin-top: 6px; font: inherit; font-weight: 700; font-size: 15px; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.contact-facts { display: grid; gap: 8px; padding: 18px; border-radius: 18px; background: var(--night); color: var(--on-night); }
.contact-facts p { margin: 0; display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; color: var(--on-night-2); }
.contact-facts strong { color: #fff; }
.contact-facts a { color: #fff; }
.contact-facts svg { width: 19px; height: 19px; flex: none; color: #ff8ea3; margin-top: 3px; }
.sent-card { display: flex; gap: 18px; align-items: flex-start; padding: 24px; margin-bottom: 24px; border-radius: 24px; background: #e6f6ef; border: 1px solid #b4e3cd; color: #0b4a35; }
.sent-card h2 { margin: 0 0 6px; }
.sent-card p { margin: 0 0 14px; }
.sent-ic { width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #12805c; color: #fff; }
.sent-ic svg { width: 26px; height: 26px; }
.contact-faq { max-width: 820px; margin: 48px 0; }

/* 404 */
.nf { text-align: center; padding: 48px 0 24px; display: grid; justify-items: center; }
.nf-num { display: flex; gap: 6px; font-size: clamp(110px, 26vw, 220px); font-weight: 700; line-height: .9; color: var(--ink); letter-spacing: -.04em; }
.nf-zero { color: var(--crimson); display: inline-block; animation: nf-wobble 3.2s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes nf-wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .nf-zero { animation: none; } }
.nf-eyebrow { margin: 18px 0 6px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--crimson-ink); font-size: 14px; }
.nf h1 { margin: 0; font-size: clamp(32px, 5vw, 48px); }
.nf-excuse { margin: 12px auto 26px; max-width: 46ch; font-size: 20px; color: var(--ink-2); min-height: 3em; }
.nf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.nf-search { display: flex; gap: 8px; width: min(100%, 480px); margin-top: 28px; }
.nf-tools { margin: 24px 0 64px; }
.home-today-grid > .home-leaf, .home-today-grid > .home-cal, .home-today-grid > .soon { grid-area: auto; }
.home-today-grid { align-items: start; }
.contact-form { max-width: none; }
/* covers are 1200×630: show them whole */
.pcard-media { aspect-ratio: 1200 / 630; background: #0c1230; }
@media (min-width: 760px) {
  .pcard-feature .pcard-media { flex: 0 0 56%; aspect-ratio: auto; min-height: 0; display: flex; align-items: center; }
  .pcard-feature .pcard-media img { height: auto; aspect-ratio: 1200 / 630; object-fit: contain; }
}

/* ---------- Currency converter ---------- */
.num { text-align: right; font-variant-numeric: tabular-nums; }
.fx-tool { display: grid; gap: 14px; }
.fx-row { display: grid; gap: 12px; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 720px) { .fx-row { grid-template-columns: 1.1fr 1fr auto 1fr; } }
.fx-swap { font-size: 22px; justify-self: center; }
.fx-result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 18px 20px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night); }
.fx-result span { color: var(--on-night-2); font-size: 18px; }
.fx-result b { font-size: clamp(28px, 5vw, 40px); color: #fff; font-variant-numeric: tabular-nums; }
.fx-result small { flex-basis: 100%; color: var(--on-night-2); font-size: 15px; }
.fx-table-box { margin-top: 28px; }
.fx-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 10px 20px; margin-bottom: 8px; }
.fx-head h2 { margin: 0; font-size: 22px; }
.fx-date-pick { display: grid; gap: 4px; font-weight: 700; font-size: 15px; }
.fx-date-pick .input { min-height: 42px; }
.fx-table td, .fx-table th { white-space: nowrap; }
.fx-cur { display: flex; align-items: center; gap: 10px; }
.fx-cur span { display: grid; line-height: 1.2; }
.fx-cur small { color: var(--ink-3); font-size: 14px; }
.fx-flag { font-size: 24px; }

/* ---------- Gold and silver ---------- */
.gold-date { margin: 0 0 12px; font-weight: 700; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gold-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-bottom: 20px; }
.gold-card { display: grid; gap: 2px; padding: 18px 20px; border-radius: 20px; color: #3a2400; background: linear-gradient(150deg, #fff3c4, #ffd56b); border: 1px solid #f2c94c; box-shadow: var(--shadow-sm); }
.gold-card.gc-tejabi { background: linear-gradient(150deg, #fff6dc, #ffe39b); }
.gold-card.gc-silver { color: #1f2a37; background: linear-gradient(150deg, #f4f6fa, #d9dee8); border-color: #c5ccd8; }
.gc-label { font-weight: 700; font-size: 15px; }
.gold-card b { font-size: clamp(28px, 4vw, 36px); line-height: 1.1; font-variant-numeric: tabular-nums; }
.gc-unit, .gc-10g { font-size: 14.5px; opacity: .8; }
.chg { font-weight: 700; font-size: 14.5px; }
.chg.up { color: #b3261e; } .chg.down { color: #0f7a52; }
.gold-calc { display: grid; gap: 14px; }
.gold-calc h2 { margin: 0; }
.gc-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.gc-row .field { min-width: 180px; }
.gc-unit-seg { margin: 0; }
.gc-weights { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gc-weights[data-w="gram"] { grid-template-columns: minmax(0, 220px); }
.gc-weights[hidden] { display: none; }
.gc-making { max-width: 260px; }
.gold-hist { margin-top: 28px; }
.gold-hist h2 { font-size: 22px; }
.spark { width: 100%; height: auto; display: block; margin: 8px 0 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }

/* ---------- Rashifal ---------- */
.rs-find { display: grid; gap: 8px; margin-bottom: 24px; }
.rs-find-out { margin: 0; font-size: 18px; min-height: 1.4em; }
.rs-find-out b { font-size: 22px; }
.rs-note { font-size: 18px; margin: -4px 0 16px; color: var(--ink-2); }
.rs-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin-bottom: 28px; }
.rs-grid-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.rs-card { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-content: start; padding: 18px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s ease, transform .2s ease; }
a.rs-card:hover { border-color: var(--crimson); transform: translateY(-2px); color: var(--ink); }
.rs-sym { grid-row: span 2; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: linear-gradient(150deg, var(--night-2), var(--night)); color: #ffd166; }
.rs-name { display: flex; align-items: baseline; gap: 8px; }
.rs-name b { font-size: 24px; }
.rs-name small { color: var(--ink-3); font-weight: 600; }
.rs-letters { color: var(--crimson-ink); font-size: 15px; font-weight: 600; }
.rs-text { grid-column: 1 / -1; margin-top: 8px; color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }
.rs-full { font-size: 21px; line-height: 1.8; padding: 22px 24px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); margin-bottom: 24px; }
.rs-h-sym { color: #ffd166; margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .rs-card { transition: none; } a.rs-card:hover { transform: none; } }

/* ---------- Cookie consent ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px; background: var(--night); color: var(--on-night); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); }
.consent p { margin: 0; font-size: 16px; }
.consent a { color: #fff; }
.consent div { display: flex; justify-content: flex-end; gap: 8px; }
.consent .btn { min-height: 42px; }
.footer-link { color: inherit; font-weight: 500; text-decoration: none; margin: 0; }

/* ---------- Land area converter ---------- */
.land-tool { display: grid; gap: 16px; }
.land-seg { display: flex; flex-wrap: wrap; max-width: none; margin: 0; }
.land-seg button { flex: 1 1 auto; }
.land-in { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.land-in[data-in="bkd"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.land-in.land-one { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.land-in[hidden] { display: none; }
.land-in .input { font-size: 20px; font-weight: 700; min-height: 54px; }
@media (max-width: 520px) { .land-in { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.land-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.land-card { display: grid; gap: 2px; padding: 16px 18px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night); }
.land-card span { font-size: 13.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--on-night-2); }
.land-card b { font-size: 28px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.land-card small { color: var(--on-night-2); font-size: 14px; }
.land-more { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.land-more li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.land-more span { color: var(--ink-3); font-size: 15px; }
.land-more b { font-variant-numeric: tabular-nums; }
.land-price summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.land-price-row { display: grid; gap: 10px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); margin-top: 10px; }
.land-total { display: block; margin-top: 10px; font-size: 18px; }
.land-total b { font-size: 26px; }

/* ---------- EMI calculator ---------- */
.emi-tool { display: grid; gap: 16px; }
.emi-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .emi-grid { grid-template-columns: 1.3fr 1fr 1.2fr; } }
.emi-tenure { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.emi-tenure span { color: var(--ink-3); font-weight: 600; }
.emi-range { width: 100%; accent-color: var(--crimson); margin-top: 6px; }
.emi-result { display: grid; gap: 12px; padding: 20px; border-radius: var(--radius-md); background: var(--night); color: var(--on-night); }
.emi-main { display: grid; }
.emi-main span, .emi-facts span { font-size: 13.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--on-night-2); }
.emi-main b { font-size: clamp(34px, 6vw, 48px); color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.emi-facts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.emi-facts div { display: grid; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
.emi-facts b { font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.emi-result .hint { color: var(--on-night-2); margin: 0; }
.emi-bar { display: flex; height: 28px; border-radius: 999px; overflow: hidden; background: var(--surface-2); font-size: 13px; font-weight: 700; color: #fff; }
.emi-bar span { display: grid; place-items: center; transition: width .3s ease; min-width: 0; overflow: hidden; }
#emi-bar-p { background: var(--blue); } #emi-bar-i { background: var(--crimson); }
.emi-legend { display: flex; gap: 16px; margin: -6px 0 0; font-size: 14.5px; color: var(--ink-2); }
.emi-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.lg-p::before { background: var(--blue); } .lg-i::before { background: var(--crimson); }
.emi-sched { margin-top: 28px; }
.emi-sched .table-wrap { max-height: 520px; overflow-y: auto; }
@media (prefers-reduced-motion: reduce) { .emi-bar span { transition: none; } }

/* ---------- Tax, salary, vehicle, electricity ---------- */
.tax-tool, .vt-tool, .nea-tool { display: grid; gap: 16px; }
.tax-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.tax-wide { grid-column: 1 / -1; }
.tax-checks { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.tax-tables { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.tax-tables h3 { margin-top: 0; }
tr.is-total th, tr.is-total td { font-weight: 700; background: var(--surface); }
#sa-rows th { text-align: left; font-weight: 600; }

/* ---------- Typing test ---------- */
.tt-test { display: grid; gap: 14px; }
.tt-test-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: end; }
.tt-test-top .seg { margin: 0; }
.tt-test-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.tt-test-opts label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; }
.tt-test-opts select { min-height: 42px; width: auto; }
.tt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tt-stats div { display: grid; padding: 10px 12px; border-radius: 14px; background: var(--night); color: var(--on-night); }
.tt-stats span, .tt-stats small { font-size: 12.5px; color: var(--on-night-2); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.tt-stats b { font-size: 26px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.2; }
@media (max-width: 520px) { .tt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tt-target { font-size: 24px; line-height: 1.9; padding: 16px 18px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); max-height: 240px; overflow-y: auto; position: relative; }
.tt-target span { padding: 1px 2px; border-radius: 4px; }
.tt-target .ok { color: #12805c; }
.tt-target .bad { color: var(--crimson-ink); background: var(--crimson-wash); text-decoration: underline wavy; }
.tt-target .cur { background: #fff1c2; color: #3a2a00; box-shadow: 0 0 0 2px #f2c94c; }
:root[data-theme="dark"] .tt-target .cur { background: #4a3d0f; color: #fff; }
.tt-next { margin: 0; font-size: 16px; color: var(--ink-2); min-height: 1.4em; font-family: var(--mono); }
.tt-type { font-family: var(--mono); font-size: 19px; }
.tt-type.is-ne { font-family: var(--font); font-size: 22px; }
.tt-shows { font-size: 20px; min-height: 1.4em; color: var(--ink-2); }
.tt-result { padding: 20px; border-radius: var(--radius-md); background: var(--crimson-wash); }
.tt-result h2 { margin: 0 0 10px; }
.tt-res-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.tt-res-grid div { display: grid; }
.tt-res-grid b { font-size: 32px; color: var(--crimson-ink); }

/* ---------- Keyboard ---------- */
.kb-tool { display: grid; gap: 12px; }
.kb-tool .seg { margin: 0; }
.kb-input { font-family: var(--mono); font-size: 17px; }
.kb-out { font-size: 26px; min-height: 64px; padding: 12px 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px dashed var(--line-strong); white-space: pre-wrap; }
.kb-out.is-empty { font-size: 16px; color: var(--ink-3); }
.kb { display: grid; gap: 6px; padding: 10px; border-radius: 18px; background: var(--surface-2); user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.kb-key { flex: 1 1 0; min-width: 0; max-width: 64px; min-height: 58px; padding: 4px 2px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; line-height: 1.1; box-shadow: 0 2px 0 var(--line-strong); }
.kb-key:active { transform: translateY(2px); box-shadow: none; }
.kb-key b { font-size: 22px; font-weight: 600; }
.kb-key small { font-size: 11px; color: var(--ink-3); font-family: var(--mono); }
.kb-wide { flex: 1.6 1 0; max-width: 110px; font-weight: 700; font-size: 14px; }
.kb-wide.is-on { background: var(--ink); color: var(--paper); }
.kb-space { max-width: 420px; flex: 6 1 0; font-weight: 700; }
@media (max-width: 560px) { .kb { padding: 6px; gap: 4px; } .kb-row { gap: 3px; } .kb-key { min-height: 46px; border-radius: 7px; } .kb-key b { font-size: 17px; } .kb-key small { font-size: 9px; } }

/* ---------- Letters ---------- */
.letter-tool { display: grid; gap: 18px; align-items: start; margin-bottom: 28px; }
@media (min-width: 980px) { .letter-tool { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } .letter-side { position: sticky; top: 88px; } }
.letter-form { display: grid; gap: 12px; }
.letter-form textarea { min-height: 64px; }
.letter-paper { background: #fff; color: #111; padding: 32px 34px; border-radius: 8px; box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 17.5px; line-height: 1.75; min-height: 420px; }
.letter-paper p { margin: 0; }
.letter-paper .lt-gap { height: .8em; }
.letter-paper .lt-ex { color: #9aa1b5; }
.letter-paper .lt-v { font-weight: 600; }
.letter-actions { margin-top: 12px; }
@media print {
  body * { visibility: hidden !important; }
  .letter-paper, .letter-paper * { visibility: visible !important; }
  .letter-paper { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; border: 0; padding: 0; }
  .letter-paper .lt-ex { color: #111; }
}

/* ---------- Postal ---------- */
.pc-tool { display: grid; gap: 12px; }
.pc-district { max-width: 280px; }
#pc-body tr[hidden] { display: none; }

/* ---------- Panchang ---------- */
.panchang { display: grid; gap: 16px; margin-bottom: 8px; }
.pc-hero { display: flex; gap: 20px; align-items: center; padding: 22px; border-radius: var(--radius); background: var(--night); color: var(--on-night); background-image: radial-gradient(circle at 90% 0, rgba(242, 162, 12, .25), transparent 50%); }
.pc-hero .eyebrow { color: #ffd166; }
.pc-hero h2 { margin: 0; font-size: clamp(28px, 5vw, 40px); color: #fff; }
.pc-sub { margin: 4px 0 0; color: var(--on-night-2); }
.pc-moon { width: 72px; height: 72px; flex: none; border-radius: 50%; background: conic-gradient(from 180deg, #fff3c4 0 var(--lit), #1b2350 var(--lit) 100%); box-shadow: 0 0 30px rgba(255, 220, 140, .35), inset 0 0 0 2px rgba(255, 255, 255, .15); }
.pc-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.pc-facts li { display: grid; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.pc-facts span { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.pc-facts b { font-size: 19px; }
.pc-pick { display: grid; gap: 6px; max-width: 260px; font-weight: 700; }
.pc-month tr.is-today td { background: var(--crimson-wash); font-weight: 700; }
.pc-month small { color: var(--ink-3); }

/* ---------- Weather ---------- */
.wx-grid { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.wx-card { display: grid; gap: 6px; padding: 16px 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s ease, transform .2s ease; }
.wx-card:hover { border-color: var(--blue); transform: translateY(-2px); color: var(--ink); }
.wx-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.wx-top small { color: var(--ink-3); }
.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-now b { font-size: 38px; line-height: 1; }
.wx-emoji { font-size: 34px; }
.wx-cond { color: var(--ink-2); font-size: 15px; }
.aq-badge { justify-self: start; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.aq-good { background: #dcf5e7; color: #0f5b3a; } .aq-mod { background: #fff4c2; color: #6b5200; } .aq-usg { background: #ffe2c4; color: #8a3d00; }
.aq-bad { background: #ffd2d6; color: #9b1022; } .aq-vbad { background: #ead2ff; color: #5b1691; } .aq-haz { background: #5c1427; color: #fff; } .aq-na { background: var(--surface-2); color: var(--ink-3); }
.wx-hero { display: grid; gap: 14px; margin-bottom: 14px; }
.wx-hero-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 20px 22px; border-radius: var(--radius); background: linear-gradient(150deg, #2446c7, #0c1230); color: #fff; }
.wx-hero-main b { font-size: 56px; line-height: 1; }
.wx-hero-main .wx-emoji { font-size: 52px; }
.aq-box { display: grid; gap: 4px; padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 8px; }
.aq-box div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.aq-box div span { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.aq-box b { font-size: 34px; }
.aq-box em { font-style: normal; font-weight: 700; }
.aq-box p { margin: 0; }
.aq-parts { opacity: .85; font-size: 15px; }
.wx-hours { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
.wx-hours div { flex: none; display: grid; justify-items: center; gap: 2px; padding: 10px 12px; min-width: 64px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.wx-hours span { font-size: 22px; }
.wx-rain { color: var(--blue); font-weight: 700; }
.wx-days { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.wx-days li { display: grid; grid-template-columns: 1.3fr auto 2fr .6fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.wx-days li > span:nth-child(2) { font-size: 22px; }
.wx-days small { color: var(--ink-3); }
@media (max-width: 520px) { .wx-days li { grid-template-columns: 1fr auto auto auto; } .wx-dcond, .wx-days .wx-rain { display: none; } }
.wx-links a { white-space: nowrap; }

/* ---------- Results hub ---------- */
.rh-grid { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.rh-card { display: grid; gap: 4px; height: 100%; padding: 18px 20px; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .2s ease, transform .2s ease; }
.rh-card:hover { border-color: var(--crimson); transform: translateY(-2px); color: var(--ink); }
.rh-card b { font-size: 21px; }
.rh-card small { color: var(--ink-3); }
.rh-date { font-weight: 600; color: var(--ink-2); font-size: 15px; }
.rh-more { margin-top: 6px; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--blue); }
.rh-more svg { width: 18px; height: 18px; }
.rh-status { justify-self: start; display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.st-up { background: #fff4c2; color: #6b5200; } .st-pub { background: #dcf5e7; color: #0f5b3a; } .st-closed { background: var(--surface-2); color: var(--ink-3); }
.rh-statusline { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 0 0 14px; }
.rh-check { display: grid; gap: 12px; margin-bottom: 20px; }
.rh-check h2 { margin: 0; }
.rh-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }
.rh-result { padding: 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); overflow-x: auto; }
.rh-out .r-err { color: var(--crimson-ink); font-weight: 700; padding: 12px 14px; border-radius: 12px; background: var(--crimson-wash); margin: 0; }
.rh-links-box { margin-bottom: 20px; }
.rh-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rh-links li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.rh-links a { display: grid; text-decoration: none; min-width: 0; }
.rh-links a small { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-kind { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.rh-health { font-size: 13.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.rh-health::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--line-strong); }
.rh-health.h-up { color: #12805c; } .rh-health.h-up::before { background: #12805c; }
.rh-health.h-slow { color: #a15c00; } .rh-health.h-slow::before { background: #f2a20c; }
.rh-health.h-down { color: var(--crimson-ink); } .rh-health.h-down::before { background: var(--crimson); }
@media (max-width: 520px) { .rh-links li { grid-template-columns: 1fr auto; } .rh-kind { display: none; } }
.rh-sms, .rh-html, .rh-embed { margin-bottom: 20px; }
.rh-embed iframe { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.table-wrapcells td, .table-wrapcells th { white-space: normal; min-width: 90px; } .table-wrapcells td:last-child { min-width: 220px; }

/* ---------- Mega menu ---------- */
.mega-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--ink-2); white-space: nowrap;
}
.mega-btn svg { width: 16px; height: 16px; transition: transform .2s ease; }
.mega-btn:hover, .mega-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.mega-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.mega-btn-mobile { border: 1px solid var(--line); border-radius: 12px; height: 44px; padding: 0 12px; background: var(--paper); font-size: 16px; }
.mega-btn-mobile svg { width: 18px; height: 18px; }
.mega-btn-mobile[aria-expanded="true"] svg { transform: none; }
@media (min-width: 1060px) { .mega-btn-mobile { display: none; } }
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 24px 48px -24px rgba(12, 18, 48, .35);
  max-height: calc(100vh - 68px); max-height: calc(100dvh - 68px); overflow-y: auto; overscroll-behavior: contain;
  animation: mega-in .18s ease-out;
}
@keyframes mega-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mega { animation: none; } .mega-btn svg { transition: none; } }
.mega-inner { padding-top: 20px; padding-bottom: 24px; }
.mega-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.mega-q {
  flex: 1 1 260px; max-width: 460px; min-height: 46px; padding: 10px 16px; font: inherit; font-size: 17px; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
}
.mega-q:focus { outline: none; border-color: var(--crimson); box-shadow: 0 0 0 4px var(--crimson-wash); background: var(--paper); }
.mega-all { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; margin-left: auto; }
.mega-all svg { width: 18px; height: 18px; }
.mega-cols { display: grid; gap: 18px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.mega-group h2 { margin: 0 0 6px; padding: 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.mega-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mega-group a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.mega-group a:hover, .mega-group a:focus-visible { background: var(--surface-2); }
.mega-group a[aria-current="page"] { background: var(--crimson-wash); }
.mega-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--crimson-ink); }
.mega-ic svg { width: 19px; height: 19px; }
.mega-t { display: grid; min-width: 0; line-height: 1.25; }
.mega-t b { font-weight: 700; font-size: 16px; }
.mega-t small { font-size: 13.5px; color: var(--ink-3); }
.mega-empty { margin: 8px 10px 0; color: var(--ink-2); }
.mega [hidden] { display: none !important; }
@media (max-width: 719px) {
  .mega-cols { grid-template-columns: 1fr 1fr; gap: 14px 8px; }
  .mega-group a { padding: 8px 6px; gap: 8px; }
  .mega-ic { width: 32px; height: 32px; }
  .mega-t b { font-size: 15px; }
  .mega-all { margin-left: 0; }
}
@media (max-width: 380px) { .mega-cols { grid-template-columns: 1fr; } }
.cpage-full { max-width: 860px; margin: 0 auto; }
.pc-table tr.is-head td { background: var(--surface); }
.pc-table .badge { font-size: 12px; margin-left: 4px; }
.pc-districts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.pc-districts a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 600; }
.pc-districts a:hover { border-color: var(--crimson); }
.pc-districts b { color: var(--crimson-ink); font-variant-numeric: tabular-nums; }
.pc-head-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; font-size: 18px; }
.pc-big { font: 700 34px/1 var(--font-display); color: var(--crimson-ink); letter-spacing: .02em; }
.rs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 0 0 16px; }
.rs-head .gold-date { margin: 0; }
.rs-days { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); }
.rs-days a { padding: 7px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.rs-days a[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.rs-moon { margin: 0; color: var(--ink-2); font-weight: 600; }
.rs-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14.5px; color: var(--ink-3); }
.rs-stars { color: #e0a100; letter-spacing: 2px; font-size: 16px; }
.rs-stars span { color: var(--line-strong); }
.rs-facts { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.rs-facts li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.rs-facts li > span:first-child { font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.rs-facts b { font-size: 19px; }
.pc-districts li { min-width: 0; }
.pc-districts a span { min-width: 0; overflow-wrap: anywhere; }
.pc-districts b { flex: none; }
@media (max-width: 420px) { .pc-districts { grid-template-columns: 1fr 1fr; } .pc-districts a { padding: 9px 10px; font-size: 15px; } }
.wx-live { font-size: 12px; font-weight: 700; color: #12805c; text-transform: uppercase; letter-spacing: .04em; align-self: center; }
.badge-live { background: #e3f6ee; color: #0d6b4c; text-transform: none; }
:root[data-theme="dark"] .badge-live { background: #12301f; color: #3ccf97; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge-live { background: #12301f; color: #3ccf97; } }
.home-wx { padding-top: 0; }
.wx-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.wx-strip::-webkit-scrollbar { display: none; }
.wx-strip a { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: var(--ink); white-space: nowrap; font-weight: 600; }
.wx-strip a:hover { border-color: var(--crimson); }
.wx-strip b { font-size: 19px; }
.wx-strip .aq-badge { font-size: 12px; }
.wx-strip-all { color: var(--crimson-ink) !important; }
.wx-strip-all svg { width: 16px; height: 16px; }

/* ---------- Poster maker ---------- */
.pm-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.pm-filters .chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pm-sep { width: 1px; height: 24px; background: var(--line-strong); margin: 0 4px; }
.pm-grid { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); align-items: start; }
.pm-grid-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.pm-card { display: grid; gap: 8px; text-decoration: none; color: var(--ink); padding: 10px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); transition: border-color .2s ease, transform .2s ease; }
.pm-card:hover { border-color: var(--crimson); transform: translateY(-2px); color: var(--ink); }
.pm-thumb { display: block; width: 100%; max-height: 360px; border-radius: 12px; overflow: hidden; background: var(--surface-2); margin: 0 auto; }
.pm-thumb img, .pm-thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.pm-name { display: grid; } .pm-name small { color: var(--ink-3); }
.pm-size { font-size: 13.5px; color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .pm-card { transition: none; } .pm-card:hover { transform: none; } }
.pm-editor { display: grid; gap: 24px; margin-bottom: 32px; }
@media (min-width: 900px) { .pm-editor { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } .pm-stage { position: sticky; top: 88px; } }
.pm-canvas-box { background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--paper) 0 50%) 0 0 / 20px 20px; border-radius: 18px; padding: 12px; border: 1px solid var(--line); display: grid; place-items: center; }
.pm-canvas-box canvas { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow); touch-action: none; }
.pm-size-note { text-align: center; }
.pm-side { display: grid; gap: 14px; min-width: 0; }
.pm-form { display: grid; gap: 12px; }
.pm-form .field { margin: 0; }
.pm-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 0 4px; }
.pm-mini { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.pm-mini input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--paper); }
.pm-mini input[type=range] { width: 130px; }
.pm-mini select { min-height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); padding: 4px 8px; }
.pm-photo { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pm-move { margin: 0; }
.pm-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
