/* ============================================================================
   Lakuri · Nepal's district atlas
   ========================================================================= */

:root {
  --bg: #060b16;
  --bg-2: #0a1122;
  --ink: #eaf0ff;
  --ink-dim: #93a2c4;
  --ink-faint: #61708f;
  --line: rgba(148, 172, 226, 0.14);
  --line-strong: rgba(148, 172, 226, 0.28);
  --glass: rgba(15, 24, 45, 0.62);
  --glass-2: rgba(19, 30, 55, 0.78);
  --accent: #5ad1ff;
  --radius: 18px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.22, 0.68, 0.28, 1);
  --shadow: 0 24px 60px -20px rgba(0, 8, 24, 0.85);

  --p1: #ff6f68;
  --p2: #ff9f52;
  --p3: #ffd166;
  --p4: #63d78b;
  --p5: #45c8d8;
  --p6: #6d90ff;
  --p7: #b57cff;

  --pos: #35d18a;
  --neg: #f2545b;
  --neutral: #9aa9c9;
}

* {
  box-sizing: border-box;
}

/* Several components below set an explicit `display`, which would otherwise
   defeat the browser's default `[hidden] { display: none }` rule. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* Inter carries no Devanagari, and every headline is now Nepali. Appending
     the Devanagari faces to the BASE stack lets the browser fall back
     per-codepoint, so Latin stays Inter and नेपाली renders properly anywhere --
     not just in the few places that opt into .devanagari. */
  font-family: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
    "Noto Sans Devanagari", "Nirmala UI", "Mangal", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.devanagari {
  font-family: "Noto Sans Devanagari", "Nirmala UI", "Mangal", "Kokila", sans-serif;
}

kbd {
  font: inherit;
  font-size: 0.72em;
  padding: 0.15em 0.45em;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
}

a {
  color: var(--ink-dim);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--accent);
}

/* --- ambient background ---------------------------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 700px at 78% -10%, #12233f 0%, transparent 62%),
    radial-gradient(900px 620px at 8% 108%, #17182f 0%, transparent 60%),
    linear-gradient(178deg, var(--bg) 0%, var(--bg-2) 55%, #05080f 100%);
}

.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.4;
  animation: drift 34s var(--ease) infinite alternate;
}
.aurora__blob--1 {
  width: 46vw;
  height: 46vw;
  left: -8vw;
  top: -12vw;
  background: radial-gradient(circle, #1d5c8f 0%, transparent 70%);
}
.aurora__blob--2 {
  width: 40vw;
  height: 40vw;
  right: -6vw;
  top: 18vh;
  background: radial-gradient(circle, #7a3560 0%, transparent 70%);
  animation-duration: 43s;
  animation-delay: -8s;
}
.aurora__blob--3 {
  width: 38vw;
  height: 38vw;
  left: 32vw;
  bottom: -18vw;
  background: radial-gradient(circle, #1b6b6a 0%, transparent 70%);
  animation-duration: 51s;
  animation-delay: -20s;
}

.aurora__grain {
  position: absolute;
  inset: -50%;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4vw, 5vh, 0) scale(1.18);
  }
}

/* --- shell ----------------------------------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px clamp(14px, 2.4vw, 30px) 12px;
  transition: padding-bottom 0.28s var(--ease);
}
/* Reserve room so the dock player never covers the colophon. */
.app.has-player {
  padding-bottom: 78px;
}

/* --- masthead -------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  animation: rise 0.7s var(--ease) both;
}

.masthead__title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crest {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
}
/* The mark carries its own fills and gradients, so nothing here may set `fill`
   or `stroke` — an inherited stroke would outline every shape inside it. */
.crest svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(0, 8, 24, 0.55))
    drop-shadow(0 0 14px rgba(90, 160, 255, 0.28));
}

.masthead h1 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 27px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.masthead h1 .devanagari {
  color: var(--ink-faint);
  font-weight: 500;
  margin-left: 6px;
}
/* A four-word tagline, not the descriptive kicker this used to be: brighter and
   more widely tracked so it carries, since it is now the only line under the
   name. What the site actually *is* lives in <title> and the stats beside it. */
.masthead p {
  margin: 3px 0 0;
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.masthead__stats {
  display: flex;
  gap: 8px;
  margin: 0;
  flex-wrap: wrap;
}
.masthead__stats > div {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  min-width: 92px;
}
.masthead__stats dt {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.masthead__stats dd {
  margin: 1px 0 0;
  font-size: 17px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* --- stage ----------------------------------------------------------------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 16px;
  min-height: 0;
}

.mapwrap {
  position: relative;
  display: grid;
  /* toolbar / stage / legend. Exactly one of map, list and patro is ever
     visible, and all three share the flexible middle track -- see the explicit
     grid-row pins below. Those pins matter: with auto-placement the row a child
     lands in depends on how many siblings happen to be hidden, which is how the
     legend ended up collapsed to 0px in list view and spilling over the
     colophon. */
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
}
.canvas,
.listwrap,
.patrowrap {
  grid-row: 2;
}
.legend {
  grid-row: 3;
}

/* --- toolbar --------------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  animation: rise 0.7s 0.05s var(--ease) both;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  height: 40px;
  width: min(330px, 46vw);
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.search:focus-within {
  border-color: rgba(90, 209, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(90, 209, 255, 0.1);
}
.search__icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
  stroke-linecap: round;
}
.search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--ink);
  font: inherit;
}
.search input::placeholder {
  color: var(--ink-faint);
}
.search input::-webkit-search-cancel-button {
  display: none;
}
.search kbd {
  flex: none;
}
.search:focus-within kbd {
  opacity: 0;
}

.search__results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 310px;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--glass-2);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  animation: pop 0.18s var(--ease) both;
}
.search__results li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
}
.search__results li[aria-selected="true"],
.search__results li:hover {
  background: rgba(255, 255, 255, 0.07);
}
.search__results .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.search__results .sub {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 12px;
}
.search__results .empty {
  color: var(--ink-faint);
  cursor: default;
  justify-content: center;
}

.modes {
  display: flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.modes button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  padding: 6px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}
.modes button:hover {
  color: var(--ink);
}
/* Patro leaves the map behind rather than recolouring it, so it carries an icon
   the plain colour modes do not. */
.modes__alt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 12px;
  padding-right: 14px;
}
.modes button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modes button.is-active {
  color: #04101d;
  background: linear-gradient(180deg, #8ee2ff, var(--accent));
  font-weight: 600;
  box-shadow: 0 4px 16px -4px rgba(90, 209, 255, 0.7);
}

/* --- view switch: map or list ---------------------------------------------- */

.views {
  display: flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.views button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}
.views button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.views button:hover {
  color: var(--ink);
}
.views button.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* --- map canvas ------------------------------------------------------------ */

.canvas {
  position: relative;
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(66, 122, 190, 0.13), transparent 70%),
    linear-gradient(180deg, rgba(12, 20, 38, 0.5), rgba(6, 11, 22, 0.72));
  overflow: hidden;
  animation: rise 0.7s 0.1s var(--ease) both;
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#map.is-panning {
  cursor: grabbing;
}

#districts {
  filter: drop-shadow(0 20px 34px rgba(0, 6, 18, 0.65));
}

.district {
  stroke: rgba(6, 12, 24, 0.75);
  stroke-width: 0.9;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.45s var(--ease), opacity 0.28s var(--ease), transform 0.28s var(--ease),
    stroke 0.22s var(--ease), stroke-width 0.22s var(--ease);
  animation: sprout 0.75s var(--ease) both;
  animation-delay: calc(var(--i) * 9ms);
}

@keyframes sprout {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* dim everything else while pointing at one district */
.is-hovering .district:not(.is-hot) {
  opacity: 0.34;
}
.is-filtered .district.is-muted {
  opacity: 0.13;
}
/* No data for the active mode (in practice: a district with no FM stations) --
   fade it back so the districts that DO have data carry the eye. */
/* Hatched, not just dim: with real data "no coverage" is a fact about the press,
   not a low value, so it must not read as the bottom of the ramp. */
.district.is-nodata {
  opacity: 0.62;
  stroke: rgba(255, 255, 255, 0.14);
}
.is-hovering .district.is-nodata:not(.is-hot) {
  opacity: 0.34;
}

.district.is-hot {
  stroke: #ffffff;
  stroke-width: 1.9;
  transform: scale(1.022);
  filter: url(#lift) brightness(1.12) saturate(1.08);
}
.district.is-pinned {
  stroke: #fff6e8;
  stroke-width: 2.2;
}

/* the glassy highlight sitting on top of the country */
.sheen-layer {
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: 0.85;
}
.sheen-layer path {
  fill: url(#sheen);
  stroke: none;
}

.labels {
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.labels.is-on {
  opacity: 1;
}
.labels text {
  fill: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(3, 8, 18, 0.85);
  stroke-width: 2.6px;
  stroke-linejoin: round;
}

/* --- floating controls ----------------------------------------------------- */

.zoomctl {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zoomctl button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass-2);
  backdrop-filter: blur(14px);
  color: var(--ink-dim);
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.zoomctl button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.zoomctl button[aria-pressed="true"] {
  color: #04101d;
  background: var(--accent);
  border-color: transparent;
}
.zoomctl svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scalebar {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  font-size: 11.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  animation: pop 0.3s var(--ease) both;
}
.scalebar__ramp {
  width: 130px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
}
/* Matches the SVG hatch so the legend swatch and the map read as the same thing. */
.scalebar__none {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 9px;
  border-left: 1px solid var(--line);
  color: var(--ink-faint);
}
.scalebar__none i {
  width: 14px;
  height: 9px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background-color: #252b3b;
  background-image: repeating-linear-gradient(
    45deg,
    #39415a 0,
    #39415a 1.6px,
    #252b3b 1.6px,
    #252b3b 5px
  );
}

/* --------------------------------------------------------------------------
   List view
   -------------------------------------------------------------------------- */

.listwrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 20, 38, 0.5), rgba(6, 11, 22, 0.72));
  overflow: hidden;
  animation: rise 0.5s var(--ease) both;
}

.listwrap__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.listwrap__count {
  font-size: 12.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.listwrap__hint {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.listwrap__scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.dtable {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.dtable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 0;
  /* Opaque, not glass: rows scrolling under a translucent header turn it into
     unreadable soup. */
  background: #0d1526;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.dtable thead th button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 11px 14px;
  width: 100%;
  text-align: inherit;
  cursor: pointer;
  transition: color 0.18s var(--ease);
}
.dtable thead th button:hover {
  color: var(--ink);
}
.dtable thead th button.is-sorted {
  color: var(--accent);
}
/* The caret only appears on the active column, so the header never looks like
   five competing sort controls. */
.dtable thead th button.is-sorted::after {
  content: "\25BE";
  margin-left: 5px;
  font-size: 9px;
  display: inline-block;
}
.dtable thead th button[data-dir="asc"]::after {
  transform: rotate(180deg);
}
.dtable th.num,
.dtable td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* "Stories" plus a sort caret does not fit a phone-width column, so the header
   carries both labels and CSS picks one. */
.th-short {
  display: none;
}
.dtable th.wide {
  padding: 11px 14px;
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 400;
}

.drow {
  cursor: pointer;
  transition: background 0.16s var(--ease);
}
.drow td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
  color: var(--ink-dim);
}
.drow:hover td {
  background: rgba(255, 255, 255, 0.04);
}
.drow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.drow.is-pinned td {
  background: rgba(90, 209, 255, 0.1);
}
.drow.is-pinned td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.drow__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 9px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.drow__swatch.is-nodata {
  background-color: #252b3b;
  background-image: repeating-linear-gradient(
    45deg,
    #39415a 0,
    #39415a 1.6px,
    #252b3b 1.6px,
    #252b3b 5px
  );
}
.drow__name {
  color: var(--ink);
  font-weight: 500;
}
.drow__ne {
  margin-left: 7px;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-faint);
}
.drow__province {
  white-space: nowrap;
}
.drow__lead {
  max-width: min(38vw, 460px);
}
.drow__headline {
  display: block;
  color: var(--ink-dim);
  text-decoration: none;
  line-height: 1.5;
  /* Two lines keeps every row the same height, so the table stays scannable. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
a.drow__headline:hover,
a.drow__headline:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}
.drow__source {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-faint);
}
.drow__none,
.dtable .is-zero {
  color: var(--ink-faint);
  opacity: 0.75;
}

.drow__stations {
  color: var(--ink-dim);
  line-height: 1.5;
  /* Same two-line clamp as a headline: uniform row height is what makes the
     table scannable, and three long station names can still overflow. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dtable__empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(6, 11, 22, 0.6);
  transition: opacity 0.45s var(--ease);
}
.loading.is-done {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(148, 172, 226, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* --------------------------------------------------------------------------
   Patro (Bikram Sambat calendar)

   Laid out as grid + sidebar on desktop and a single column on narrow screens.
   The month grid is the hero: Nepali numerals are the primary date because that
   is the calendar people are reading, with the Gregorian day kept small in the
   corner as a bridge rather than a competitor.
   -------------------------------------------------------------------------- */

.patrowrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  animation: rise 0.5s var(--ease) both;
}

/* Today's date, pre-rendered at build time on /patro so the answer is in the
   HTML rather than only in JavaScript. It sits above the grid and is real,
   visible content -- app.js refreshes it in place once the calendar loads. */
.ptoday {
  grid-column: 1 / -1;
  padding: 14px 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.ptoday__head {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.ptoday__bs {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 3.4vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.ptoday__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 0;
  font-size: 0.86rem;
  color: var(--ink-dim);
}
.ptoday__meta [aria-hidden] {
  opacity: 0.45;
}

.ptoday__fest {
  color: var(--accent);
  font-weight: 600;
}

.patro__bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.patro__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.patro__nav .iconbtn:disabled {
  opacity: 0.3;
  cursor: default;
}
.patro__title {
  min-width: 190px;
  text-align: center;
}
.patro__title h2 {
  font-size: 21px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.patro__title p {
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

/* Lead-calendar pill. Both dates are always shown; this picks which one is set
   big. See the `[data-lead='ad']` block further down for the actual swap. */
.patro__lead {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.patro__lead button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.patro__lead button:hover {
  color: var(--ink);
}
.patro__lead button.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--line);
}
.patro__today {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.patro__today:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
}

.patro__search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 380px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 28, 0.65);
}
.patro__search svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 2;
  stroke-linecap: round;
}
.patro__search input {
  flex: 1;
  min-width: 0;
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.patro__search input::-webkit-search-cancel-button {
  filter: invert(0.6);
}
.patro__search .search__results {
  top: calc(100% + 7px);
}

/* --- month grid ------------------------------------------------------------ */

.patro__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.pcell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 74px;
  padding: 7px 8px 6px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(11, 19, 36, 0.55);
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease),
    transform 0.16s var(--ease);
}
.pcell:hover {
  background: rgba(22, 34, 60, 0.8);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.pcell--head {
  min-height: 0;
  align-items: center;
  gap: 0;
  padding: 6px 4px;
  background: none;
  border: 0;
  cursor: default;
  transform: none;
}
.pcell--head:hover {
  background: none;
  border: 0;
  transform: none;
}
.pcell--head span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.pcell--head small {
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.pcell.is-blank {
  border-color: transparent;
  background: none;
  cursor: default;
}
.pcell.is-blank:hover {
  transform: none;
  background: none;
  border-color: transparent;
}

.pcell__bs {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
}
.pcell__ad {
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 10.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}
.pcell__note {
  margin-top: auto;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* The tithi is context, not news: it should never out-shout a festival name. */
.pcell__note.is-tithi {
  color: var(--ink-dim);
  opacity: 0.72;
}
.pcell__note.is-festival {
  color: var(--accent);
  font-weight: 550;
}
.pcell__more {
  position: absolute;
  right: 7px;
  bottom: 6px;
  font-size: 9px;
  color: var(--ink-dim);
}

/* Saturday is Nepal's weekly holiday, so it gets the "day off" colour that a
   Western calendar would give Sunday. */
.pcell.is-saturday .pcell__bs,
.pcell--head.is-saturday span {
  color: var(--neg);
}
.pcell.is-holiday {
  border-color: rgba(255, 111, 104, 0.35);
  background: rgba(255, 111, 104, 0.08);
}
.pcell.is-holiday .pcell__bs {
  color: var(--neg);
}

.pcell.is-today {
  border-color: var(--accent);
  background: rgba(69, 200, 216, 0.13);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.pcell.is-selected {
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.09);
}

/* --- English-lead swap -----------------------------------------------------
   Only the EMPHASIS moves. Bikram Sambat stays in Devanagari and Gregorian
   stays in Arabic digits in both modes — two bare numerals in the same script
   on one square would be impossible to tell apart. These rules come after the
   Saturday/holiday colouring above on purpose, so the red follows whichever
   numeral is leading. */
.patrowrap[data-lead='ad'] .pcell__bs {
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 10.5px;
  font-weight: 500;
  line-height: normal;
  color: var(--ink-dim);
}
.patrowrap[data-lead='ad'] .pcell__ad {
  position: static;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
}
.patrowrap[data-lead='ad'] .pcell.is-saturday .pcell__ad,
.patrowrap[data-lead='ad'] .pcell.is-holiday .pcell__ad,
.patrowrap[data-lead='ad'] .pcell--head.is-saturday small {
  color: var(--neg);
}
.patrowrap[data-lead='ad'] .pcell--head.is-saturday span {
  color: var(--ink-dim);
}
/* .pcell--head is a flex column with exactly two children, so `order` is all
   it takes to put the English abbreviation on top. */
.patrowrap[data-lead='ad'] .pcell--head span {
  order: 2;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ink-dim);
}
.patrowrap[data-lead='ad'] .pcell--head small {
  order: 1;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--ink);
}

/* --- sidebar --------------------------------------------------------------- */

.patro__side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
}

.patro__day:empty {
  display: none;
}
.patro__day > div {
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(69, 200, 216, 0.09), rgba(6, 11, 22, 0.5));
}
.pday__kicker {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.pday__bs {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 620;
  line-height: 1.25;
}
.pday__ad {
  font-size: 12.5px;
  color: var(--ink);
}
/* The card emits the two date lines in lead order; these only resize them. */
.patrowrap[data-lead='ad'] .pday__bs {
  margin-top: 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: normal;
  color: var(--ink);
}
.patrowrap[data-lead='ad'] .pday__ad {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 620;
  line-height: 1.25;
}
.pday__tithi {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink);
}
.pday__tithi em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 10.5px;
  color: var(--ink-dim);
}
.pday__fests {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  display: grid;
  gap: 8px;
}
.pday__fests li span {
  display: block;
  font-size: 13px;
  font-weight: 560;
  color: var(--accent);
}
.pday__fests li small {
  font-size: 10.5px;
  color: var(--ink-dim);
}

.patro__events {
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(10, 17, 33, 0.5);
}
.patro__events h3 {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
}
.patro__events ul {
  list-style: none;
  display: grid;
  gap: 3px;
}
.patro__none {
  font-size: 12px;
  color: var(--ink-dim);
}

.pevent {
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.pevent:hover {
  background: rgba(255, 255, 255, 0.06);
}
/* Recurring observances are real but routine, so they must not compete with a
   named festival for attention in the same list. */
.pevent--minor .pevent__name {
  font-weight: 500;
  color: var(--ink-dim);
}
.pevent--minor small {
  opacity: 0.75;
}
.pevent b {
  flex: none;
  width: 24px;
  text-align: right;
  font-size: 14px;
  font-weight: 620;
  color: var(--ink-dim);
}
.pevent.is-holiday b {
  color: var(--neg);
}
/* "25 Jul" needs more room than "२५". */
.patrowrap[data-lead='ad'] .pevent b {
  width: 46px;
  font-size: 12.5px;
}
.pevent__name {
  display: block;
  font-size: 12.5px;
  line-height: 1.35;
}
.pevent small {
  font-size: 10px;
  color: var(--ink-dim);
}

/* --- festival search results ----------------------------------------------- */

.fres__name {
  display: block;
  font-size: 13px;
}
.fres__name small {
  color: var(--ink-dim);
  font-size: 10.5px;
  margin-left: 5px;
}
.fres__when {
  display: block;
  text-align: right;
  font-size: 11.5px;
  color: var(--ink);
  white-space: nowrap;
}
.fres__when small {
  display: block;
  font-size: 10px;
  color: var(--accent);
}
#festivalResults li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

/* --- legend ---------------------------------------------------------------- */

.legend {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: rise 0.7s 0.16s var(--ease) both;
}
.legend button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.legend button:hover {
  color: var(--ink);
  transform: translateY(-1px);
}
.legend button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--swatch);
  background: color-mix(in srgb, var(--swatch) 16%, var(--glass));
}
.legend .swatch {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  background: var(--swatch);
  box-shadow: 0 0 10px -1px var(--swatch);
  flex: none;
}
.legend .count {
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --- side panel ------------------------------------------------------------ */

.panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  animation: rise 0.7s 0.14s var(--ease) both;
}
.panel::-webkit-scrollbar {
  width: 7px;
}
.panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.panel__empty {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink-faint);
}

/* --- leaderboard ----------------------------------------------------------- */

.lead__head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.lead__head p {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.lead {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lead__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.lead__title::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tone);
}
.lead__title[data-tone='news'] {
  --tone: #f2915a;
}
.lead__title[data-tone='radio'] {
  --tone: #33b0cd;
}

.lead__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead__row {
  --tone: var(--ink-dim);
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 46px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  color: var(--ink-dim);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.lead__row[data-tone='news'] {
  --tone: #f2915a;
}
.lead__row[data-tone='radio'] {
  --tone: #33b0cd;
}
.lead__row:hover,
.lead__row:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  transform: translateX(2px);
  outline: none;
}

.lead__name {
  font-size: 12.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lead__meter {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.lead__meter i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  transform-origin: left;
  background: var(--tone);
  border-radius: 999px;
  animation: growx 0.5s var(--ease) both;
}
.lead__value {
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--tone);
}

/* In the patro the rows are dates, not districts: a Nepali date replaces the
   bar and a countdown replaces the count. A countdown ("in 2 months") needs
   far more room than the two-digit tally the default 46px column allows. */
.lead__row--date {
  grid-template-columns: minmax(0, 1fr) 66px 78px;
}

.lead__when {
  font-size: 11.5px;
  text-align: right;
  color: var(--ink-faint);
}

.lead__row--date .lead__value {
  font-weight: 550;
  color: var(--ink-dim);
}

.lead__hint {
  margin: auto 0 0;
  padding-top: 10px;
  font-size: 11px;
  text-align: center;
  color: var(--ink-faint);
  opacity: 0.75;
}

@keyframes growx {
  from {
    transform: scaleX(0);
  }
}

.panel__body {
  display: flex;
  flex-direction: column;
  animation: pop 0.3s var(--ease) both;
}
/* Explicit ordering so Radio mode can promote the station list above the
   news feed - in Radio mode the stations are what you came for. */
.panel__body .resume { order: -1; }
.panel__body .dhead { order: 0; }
.panel__body .dhq { order: 1; }
.panel__body .dnews { order: 2; }
.panel__body .dradio { order: 3; }
.panel__body .dradio__none { order: 4; }
.panel__body .dneighbours { order: 5; }

.panel__body[data-lead='radio'] .dradio,
.panel__body[data-lead='radio'] .dradio__none {
  order: 2;
}
.panel__body[data-lead='radio'] .dnews {
  order: 3;
}
/* Promoted to the top, the block no longer needs its separating rule. */
.panel__body[data-lead='radio'] .dradio,
.panel__body[data-lead='radio'] .dradio__none {
  border-top: 0;
  padding-top: 0;
}
.panel__body[data-lead='radio'] .dnews {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* A quiet note, not a banner: it explains why the panel opened on its own and
   offers the way back to the whole country, then gets out of the way. */
.resume {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.resume button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.resume button:hover { color: var(--ink); }

.dhead__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dhead__acts {
  display: flex;
  gap: 4px;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.16s, background 0.16s, border-color 0.16s, transform 0.16s;
}
.iconbtn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.iconbtn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.iconbtn[aria-pressed='true'] {
  color: #ffd166;
  border-color: color-mix(in srgb, #ffd166 40%, transparent);
  background: color-mix(in srgb, #ffd166 12%, transparent);
}
.iconbtn[aria-pressed='true'] svg {
  fill: currentColor;
}
.iconbtn.is-copied {
  color: var(--pos);
  border-color: color-mix(in srgb, var(--pos) 45%, transparent);
}

.mychip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
}
.mychip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.mychip__star {
  font-size: 14px;
  color: #ffd166;
}
.mychip__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}
.mychip__text em {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.mychip__text b {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.dhead__province {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--swatch, var(--accent));
  background: color-mix(in srgb, var(--swatch, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--swatch, var(--accent)) 40%, transparent);
}
.dhead h2 {
  margin: 11px 0 0;
  font-size: 27px;
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.dhead p {
  margin: 3px 0 0;
  font-size: 17px;
  color: var(--ink-faint);
}

.dhq {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 18px 0 4px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.dhq svg {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dhq span {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.dhq strong {
  font-size: 14.5px;
  font-weight: 560;
}

.dneighbours {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.dneighbours__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.dneighbours div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.dneighbours button {
  padding: 4px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.dneighbours button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

/* --- news: shared story component ------------------------------------------ */

.story {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.story__body {
  min-width: 0;
}
.story__headline {
  margin: 0;
  font-size: 12.8px;
  font-weight: 540;
  /* Devanagari stacks matras above and below the baseline, so Latin-tuned
     leading collides. It also gains nothing from negative tracking. */
  line-height: 1.6;
  color: var(--ink);
  letter-spacing: 0;
  display: block;
  text-decoration: none;
}
a.story__headline:hover,
a.story__headline:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.story__meta {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10.5px;
  color: var(--ink-faint);
}

.dnews__empty {
  margin: 14px 0 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  color: var(--ink-faint);
}

/* --- news: detail panel ---------------------------------------------------- */

.dnews {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.dnews__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.dnews__head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.chip-live {
  padding: 1.5px 6px;
  border-radius: 5px;
  font-size: 8.5px;
  letter-spacing: 0.07em;
  color: #6ee7de;
  background: rgba(94, 224, 220, 0.13);
  box-shadow: inset 0 0 0 1px rgba(94, 224, 220, 0.28);
  cursor: help;
}

/* --------------------------------------------------------------------------
   Radio: station list + dock player
   -------------------------------------------------------------------------- */

.dradio {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.dradio__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.dradio__head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-faint);
}
.dradio__count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--neutral);
  white-space: nowrap;
}
.dradio__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dradio__none {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-faint);
}
.dradio__none a {
  color: #6ee7de;
  text-decoration: none;
  border-bottom: 1px dashed rgba(110, 231, 222, 0.5);
}
.dradio__none a:hover {
  color: #a5f3ee;
}

.station {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.station:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}
.station.is-current {
  background: rgba(94, 224, 220, 0.1);
  box-shadow: inset 0 0 0 1px rgba(94, 224, 220, 0.35);
}
.station.is-dead {
  opacity: 0.45;
}
.station.is-dead .station__name::after {
  content: ' · offline';
  color: var(--neg);
  font-weight: 500;
}

.station__play {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(94, 224, 220, 0.16);
  color: #6ee7de;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.station:hover .station__play {
  background: rgba(94, 224, 220, 0.28);
}
.station__play svg {
  grid-area: 1 / 1;
  width: 13px;
  height: 13px;
  fill: currentColor;
  stroke: none;
}
.station__ico-pause,
.station.is-playing .station__ico-play {
  display: none;
}
.station.is-playing .station__ico-pause {
  display: block;
}

.station__body {
  flex: 1 1 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.station__name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.station__site {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--ink-faint);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease;
}
.station:hover .station__site {
  opacity: 1;
}
.station__site:hover {
  color: #6ee7de;
}

/* Equaliser bars, only animated on the row that is actually playing. */
.station__bars,
.player__bars {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 13px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.station__bars i,
.player__bars i {
  width: 2.5px;
  height: 30%;
  border-radius: 1px;
  background: #6ee7de;
}
.station.is-playing .station__bars,
.player.is-playing .player__bars {
  opacity: 1;
}
.station.is-playing .station__bars i,
.player.is-playing .player__bars i {
  animation: eq 0.9s ease-in-out infinite;
}
.station__bars i:nth-child(2),
.player__bars i:nth-child(2) {
  animation-delay: 0.15s;
}
.station__bars i:nth-child(3),
.player__bars i:nth-child(3) {
  animation-delay: 0.3s;
}
.player__bars i:nth-child(4) {
  animation-delay: 0.45s;
}
@keyframes eq {
  0%,
  100% {
    height: 25%;
  }
  50% {
    height: 100%;
  }
}

/* --- dock player --- */
.player {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 60;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 13px;
  width: min(560px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(16, 22, 38, 0.88);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 18px 44px rgba(0, 8, 20, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.09);
  animation: playerIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
@keyframes playerIn {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

.player__toggle {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(140deg, #5ee0dc, #33b0cd);
  color: #05202a;
  cursor: pointer;
  transition: filter 0.16s ease;
}
.player__toggle:hover {
  filter: brightness(1.12);
}
.player__toggle:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink-faint);
  cursor: not-allowed;
}
.player__toggle svg {
  grid-area: 1 / 1;
  width: 15px;
  height: 15px;
  fill: currentColor;
  stroke: none;
}
.player__spinner {
  grid-area: 1 / 1;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(5, 32, 42, 0.3);
  border-top-color: #05202a;
  border-radius: 50%;
  display: none;
  animation: spin 0.7s linear infinite;
}
.player[data-state='loading'] .player__spinner {
  display: block;
}
.player[data-state='loading'] .player__icon-play,
.player[data-state='loading'] .player__icon-pause,
.player[data-state='playing'] .player__icon-play,
.player[data-state='paused'] .player__icon-pause,
.player[data-state='error'] .player__icon-pause {
  display: none;
}

.player__meta {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.player__meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player__meta span {
  font-size: 10.5px;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player__meta span[data-tone='error'] {
  color: var(--neg);
}

.player__vol {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
}
.player__vol svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.player__vol input {
  width: 74px;
  height: 3px;
  accent-color: #5ee0dc;
  cursor: pointer;
}

.player__close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}
.player__close:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
}

.player__audio {
  display: none;
}

.tooltip__radio {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: #6ee7de;
}
.tooltip__radio svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .station__bars i,
  .player__bars i,
  .player {
    animation: none !important;
  }
}

@media (max-width: 620px) {
  .player__vol {
    display: none;
  }
}

.dnews__count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.dnews__rank {
  margin: 7px 0 0;
  font-size: 10.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.dnews__list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dnews__list .story {
  --accent: #f2915a;
  padding: 9px 10px 9px 9px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 8%, transparent),
    transparent 62%
  );
  box-shadow: inset 2px 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  animation: storyIn 0.4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
  transition: background 0.2s var(--ease);
}
.dnews__list .story:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent) 15%, transparent),
    rgba(255, 255, 255, 0.02) 70%
  );
}

@keyframes storyIn {
  from {
    opacity: 0;
    transform: translateX(-7px);
  }
}

/* --- news: tooltip strip --------------------------------------------------- */

.tnews {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tnews__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.tnews__label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.tnews__count {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 5px;
  color: #ffc07a;
  background: rgba(255, 170, 90, 0.14);
  font-variant-numeric: tabular-nums;
}

/* --- tooltip --------------------------------------------------------------- */

.tooltip {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  width: 272px;
  padding: 13px 15px 12px;
  border-radius: 15px;
  background: rgba(11, 19, 36, 0.9);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 22px 46px -14px rgba(0, 4, 14, 0.9);
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(0.96);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  will-change: transform;
}
.tooltip.is-visible {
  opacity: 1;
}
.tooltip__province {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--swatch, var(--accent));
}
.tooltip__name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 3px;
}
.tooltip__name strong {
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -0.02em;
}
.tooltip__name em {
  font-style: normal;
  font-size: 13px;
  color: var(--ink-faint);
}
.tooltip__grid {
  margin: 11px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 12px;
}
.tooltip__grid dt {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.tooltip__grid dd {
  margin: 1px 0 0;
  font-size: 13.5px;
  font-weight: 570;
  font-variant-numeric: tabular-nums;
}
.tooltip__cta {
  display: block;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* --- colophon -------------------------------------------------------------- */

.colophon {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-faint);
  animation: rise 0.7s 0.2s var(--ease) both;
}
.colophon__hint {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
/* Was a warning about fake data; the feed is real now, so this is just a note
   about coverage. Amber and a ⚠ would overstate it. */
.colophon__warn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
}
.colophon__warn::before {
  content: "\1F4E1";
  font-size: 10px;
}

/* --- motion ---------------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- responsive ------------------------------------------------------------ */

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }
  .app {
    height: auto;
    min-height: 100vh;
  }
  .stage {
    grid-template-columns: minmax(0, 1fr);
  }
  .canvas {
    height: 62vh;
    min-height: 420px;
  }
  .listwrap {
    height: 70vh;
    min-height: 420px;
  }
  /* The sidebar stops being a sidebar: below the grid it reads as a natural
     continuation, and a 292px column would squeeze the week to nothing. */
  .patrowrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }
  .patro__grid {
    overflow-y: visible;
  }
  .patro__side {
    overflow-y: visible;
  }
  /* Headquarters is the least load-bearing column, so it goes first. Columns are
     targeted by class, not nth-child, because the set of columns changes with
     the colour mode. */
  .dtable .col-hq {
    display: none;
  }
  .panel {
    max-height: none;
  }
}

@media (max-width: 780px) {
  .dtable .col-province {
    display: none;
  }
  /* Auto table layout sizes to content, which pushed the headline column off
     the side of a phone. Fixed layout makes the columns share the width. */
  .dtable {
    table-layout: fixed;
    width: 100%;
  }
  .dtable .col-name {
    width: 31%;
  }
  .dtable .num {
    width: 16%;
  }
  /* The sort caret eats into a fixed-width column, which clipped "STORIES". */
  .dtable thead th button,
  .dtable th.wide {
    font-size: 10px;
    letter-spacing: 0.03em;
  }
  .th-full {
    display: none;
  }
  .th-short {
    display: inline;
  }
  .dtable thead th button,
  .drow td,
  .dtable th.wide {
    padding-left: 9px;
    padding-right: 9px;
  }
  .drow__lead {
    max-width: none;
  }
  .drow__ne {
    display: none;
  }
  .listwrap__hint {
    display: none;
  }
  /* A seven-column month has a hard floor on how narrow it can get, so the
     cells shed padding and the tithi label rather than the week structure. */
  .patro__grid {
    gap: 4px;
  }
  .pcell {
    min-height: 56px;
    padding: 5px 5px 4px;
    border-radius: 8px;
  }
  .pcell__bs {
    font-size: 15px;
  }
  .pcell__ad {
    top: 5px;
    right: 5px;
    font-size: 9px;
  }
  .pcell__note {
    font-size: 8.5px;
    -webkit-line-clamp: 1;
  }
  /* The tithi is the first thing to go: it is the least urgent label and the
     one that costs the most width. Festivals and holidays stay. */
  .pcell__note.is-tithi {
    display: none;
  }
  .patro__title {
    min-width: 0;
  }
  .patro__title h2 {
    font-size: 17px;
  }
  .patro__search {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .masthead__stats {
    width: 100%;
  }
  .masthead__stats > div {
    flex: 1;
    min-width: 0;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search {
    width: 100%;
  }
  .modes {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .modes::-webkit-scrollbar {
    display: none;
  }
  /* Four buttons no longer fit 390px, so let the pill scroll rather than let
     flex squeeze the labels into two lines. */
  .modes button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .colophon__hint {
    display: none;
  }
  .tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
