/* WAYO theme - palette derived from the current site (deep blue / accent blue /
   WAYO orange), rebuilt responsive + modern. */

/* Mulish - the station's brand typeface, self-hosted. One variable woff2 per
   subset covers the whole 300-800 weight range (efficient: ~30 KB each, and the
   browser only fetches latin-ext when an accented glyph is actually on the
   page). Source: Google Fonts (OFL). */
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/mulish-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Mulish';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/mulish-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #004590;
  --accent: #0b7cf8;
  --orange: #fe911d;
  --ink: #16181d;
  --muted: #5b6470;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e3e6ea;
  --radius: 10px;
  --maxw: 1180px;
  --player-h: 64px;
  font-family: 'Mulish', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  line-height: 1.55; padding-bottom: var(--player-h);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1 { font-size: 2rem; line-height: 1.15; margin: .2em 0 .5em; }
h2 { font-size: 1.4rem; }
.muted, .meta { color: var(--muted); }
.meta { font-size: .85rem; }
.empty { color: var(--muted); font-style: italic; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
.main { padding-top: 1.5rem; padding-bottom: 2.5rem; min-height: 50vh; }
.section-title { border-bottom: 2px solid var(--line); padding-bottom: .3rem; margin-top: 2rem; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--blue); color: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand img { display: block; }
.main-nav { margin-left: 1.25rem; margin-right: auto; }
.main-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; align-items: center; flex-wrap: wrap; }
.main-nav a { color: #fff; padding: .5rem .6rem; border-radius: 6px; font-weight: 600; font-size: .92rem; text-transform: uppercase; letter-spacing: .02em; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.15); text-decoration: none; }
/* search sits at the far right of the top bar (where Listen Live used to be) */
.header-search { margin-left: auto; }
.header-search input { border: 0; border-radius: 6px; padding: .45rem .65rem; font: inherit; min-width: 11rem; }
.nav-toggle { display: none; margin-left: auto; background: transparent; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }

/* on-air strip: [On now] [Up next] [Full schedule] ...... [Listen Live] [Watch] */
.onair { background: #00305f; color: #dfe8f5; font-size: .9rem; }
.onair-inner { display: flex; gap: 1rem; align-items: center; padding: .4rem 1rem; }
.onair-live { display: flex; gap: 1.25rem; align-items: center; flex: 1 1 auto; flex-wrap: wrap; min-width: 0; }
.onair-item { display: inline-flex; align-items: center; gap: .4rem; min-width: 0; }
.onair-account { white-space: nowrap; }
.onair-account .acct-icon { display: none; }
.onair a { color: #fff; font-weight: 600; }
.onair .lbl { color: var(--orange); font-weight: 700; text-transform: uppercase; font-size: .72rem; }
.onair .auto { color: #aebdd0; }
.onair-next time { color: #aebdd0; }
.onair-full { white-space: nowrap; font-weight: 600; }

.listen-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--orange); color: #111; border: 0; border-radius: 10px; padding: .45rem 1rem;
  font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .02em;
  cursor: pointer; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,.2);
  font-family: inherit; line-height: 1.2; }
.listen-btn:hover, .listen-btn.is-playing { background: #f36916; }
.ll-icon { font-size: .85em; line-height: 1; }
.onair-actions { flex: 0 0 auto; display: flex; gap: .5rem; align-items: center; }
.onair a.watch-btn { color: #111; font-weight: 700; }
.onair a.watch-btn:hover { text-decoration: none; }
.wb-icon { width: 1.1em; height: 1.1em; fill: currentColor; }

/* ---------- buttons ---------- */
.btn { display: inline-block; background: #e9edf2; color: var(--ink); border-radius: 999px; padding: .5rem 1.1rem; font-weight: 600; border: 1px solid var(--line); }
.btn:hover { text-decoration: none; background: #dfe4ea; }
.btn-orange { background: var(--orange); color: #111; border-color: transparent; }
.cta-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* prominent call-to-action stack (Donate / Volunteer / Be a DJ) */
.cta-stack { display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1.2rem; }
.btn-cta { display: block; background: var(--accent); color: #fff; border-radius: 12px;
  padding: .65rem 1rem; font-weight: 700; font-size: 1.05rem; text-align: center; }
.btn-cta:hover { background: var(--blue); text-decoration: none; }

/* ---------- home ---------- */
.home-grid { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; }
.home-side .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1.2rem; }
.panel h3 { margin: 0 0 .5rem; }
.panel-now { border-top: 4px solid var(--orange); }
.now-title { font-size: 1.2rem; font-weight: 700; margin: .2rem 0; }
.now-title.auto { color: var(--muted); font-weight: 600; }
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: flex; gap: .6rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.upcoming time { color: var(--orange); font-weight: 700; min-width: 4.5rem; }

/* ---------- home: on-air hero (Now playing / Up next, with show images) ---- */
.onair-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: .5rem; }
.onair-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.onair-card-label { display: block; background: var(--orange); color: #16181d;
  font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: .72rem;
  padding: .35rem .7rem; }
.onair-card.is-empty .onair-card-label { background: var(--muted); color: #fff; }
.onair-card-media { position: relative; }
.onair-card-media img { aspect-ratio: 21/9; object-fit: cover; width: 100%; }
.onair-card-ph { aspect-ratio: 21/9; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), var(--accent)); }
.onair-card-ph span { color: #fff; font-weight: 800; font-size: 1.6rem; letter-spacing: .12em; opacity: .85; }
.onair-card-cap { position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem .8rem .55rem; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0)); }
.onair-card-title { display: block; color: #fff; font-weight: 800; font-size: 1.2rem; line-height: 1.2; }
a.onair-card-title:hover { text-decoration: underline; }
.onair-card-host { font-size: .85rem; color: #e6edf6; }
.onair-card-host a { color: #fff; font-weight: 600; }

/* ---------- home sidebar: Recent Live @ WAYO (YouTube embeds) ---------- */
.panel-live { border-top: 4px solid var(--orange); }
.live-list { display: flex; flex-direction: column; gap: .9rem; }
.live-list .ep .embed-yt { border-radius: 8px; }

/* ---------- home: latest news with older/newer swap ---------- */
.home-news-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.home-news-card { container-type: inline-size; }
/* flow-root contains the floated cover image; the prose cap is lifted so text
   actually fills the space beside the image. */
.home-news-body { padding: .8rem 1rem 1rem; display: flow-root; }
.home-news-body .prose { max-width: none; overflow-wrap: break-word; }
/* Cover image keeps its own aspect ratio, capped in height. Narrow cards: its
   own centered row above the text. Wider cards: floated left at most 60% wide
   (text always keeps 40%+), and the text wraps beside it then runs full width
   below. */
.home-news-media { display: block; margin: .5rem 0 .8rem; }
.home-news-media img { width: auto; height: auto; max-width: 100%; max-height: 360px;
  margin: 0 auto; border-radius: 8px; }
@container (min-width: 540px) {
  .home-news-media { display: inline; }
  .home-news-media img { float: left; max-width: 60%; margin: .3rem 1.2rem .6rem 0; }
  /* Outside list markers would otherwise draw on top of the float. */
  .home-news-body .prose :is(ul, ol) { display: flow-root; }
}
.home-news-body h3 { margin: 0 0 .2rem; font-size: 1.25rem; }
.home-news-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .7rem 0 0; }
.home-news-nav .btn-sm { cursor: pointer; }

/* ---------- /news: full-article vertical list (matches wayofm.org) ---------- */
.news-list { display: flex; flex-direction: column; gap: 1.6rem; margin-bottom: 1.4rem; }
.news-item { display: grid; grid-template-columns: 240px 1fr; column-gap: 1.2rem; row-gap: .5rem;
  align-items: start; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.2rem; }
.news-item:not(:has(.news-item-media)) { grid-template-columns: 1fr; }
/* Title + date span the top; the image then aligns with the article text below it. */
.news-item-head { grid-column: 1 / -1; }
.news-item-head h2 { margin: 0 0 .15rem; font-size: 1.3rem; }
.news-item-head .meta { margin: 0; }
.news-item-media img { width: 100%; border-radius: 8px; object-fit: cover; aspect-ratio: 4/3; display: block; }
@media (max-width: 620px) { .news-item { grid-template-columns: 1fr; } }

/* ---------- cards / grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.card-body { padding: .7rem .8rem; }
.card-body h3 { margin: 0 0 .2rem; font-size: 1.05rem; }

.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; }
/* episodes always render as a single vertical column */
.ep-list { display: flex; flex-direction: column; gap: 1.3rem; max-width: 760px; }
.ep-list .ep { border-bottom: 1px solid var(--line); padding-bottom: 1.1rem; }
.ep-list .ep:last-child { border-bottom: 0; }
.ep h3 { font-size: 1rem; margin: 0 0 .4rem; display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
/* home page Recent Episodes: less air between episodes */
.home-main .ep-list { gap: .5rem; }
.home-main .ep-list .ep { padding-bottom: .5rem; }
.home-main .ep-list .ep h3 { margin-bottom: .3rem; }
.ep .yt { position: relative; padding-top: 56.25%; }
.ep .yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.ep .ep-show { margin: -.25rem 0 .45rem; }
.ep-teaser p { margin: .5rem 0 0; }
.ep-more { display: inline-block; margin-top: .3rem; font-size: .85rem; font-weight: 600; }

/* episode page (/episodes/<slug>) */
.episode-detail { max-width: 760px; }
.episode-detail .ep-crumb { margin: 0 0 .6rem; }
.episode-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.episode-head h1 { margin: 0 0 .2rem; }
.episode-head .meta { margin: 0; }
.episode-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; flex: none; }
.episode-head.has-image { flex-wrap: wrap; align-items: flex-start; gap: 1.5rem; }
.episode-hero { width: 320px; max-width: 100%; border-radius: var(--radius); object-fit: cover; }
.episode-detail .prose { margin-top: 1.2rem; }
@media (max-width: 520px) { .episode-thumb { width: 64px; height: 64px; } }

/* show page: episode search + sort + date-range controls */
.ep-controls { display: flex; flex-wrap: wrap; gap: .6rem; max-width: 760px; margin: .8rem 0 1rem; }
.ep-controls input[type=search] { flex: 1; min-width: 12rem; padding: .45rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.ep-controls select { padding: .45rem .5rem; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; }
.ep-daterange { display: flex; align-items: center; gap: .35rem; }
.ep-daterange input[type=date] { padding: .4rem .5rem; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; background: #fff; }
.ep-daterange-sep { color: var(--muted, #667); font-size: .85rem; }

/* ---------- shows: search + day-filtered lineup list ---------- */
.show-search { position: relative; max-width: 520px; margin: 1rem 0 .6rem; }
.show-search input { width: 100%; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.show-search-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; }
.show-search-list { list-style: none; margin: .25rem 0 0; padding: 0; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.show-search-list li + li { border-top: 1px solid var(--line); }
.show-search-list a { display: block; padding: .5rem .8rem; color: var(--ink); font-weight: 600; }
.show-search-list a:hover { background: #eef1f5; text-decoration: none; }
.show-search-empty { background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .8rem; margin: .25rem 0 0; box-shadow: 0 6px 18px rgba(0,0,0,.12); }

.day-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.day-tab { cursor: pointer; }
.day-today { color: var(--orange); font-weight: 800; }
.chip.active .day-today { color: #fff; }

.show-list { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.show-row { border-bottom: 1px solid var(--line); }
.show-row-link { display: flex; align-items: center; gap: .9rem; padding: .6rem .2rem; color: var(--ink); }
.show-row-link:hover { text-decoration: none; background: #f0f4f9; }
.show-row-img, .show-row-noimg { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 8px; object-fit: cover; }
.show-row-noimg { display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #fff; background: var(--blue); }
.show-row-text { display: flex; flex-direction: column; min-width: 0; }
.show-row-title { font-weight: 700; }
.show-row-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .82rem; color: var(--muted); }
.show-row-time { color: var(--blue); font-weight: 700; }
.show-row-weeks { font-style: italic; }
.show-row-kind { background: #eef1f5; border-radius: 4px; padding: 0 .4rem; }

/* ---------- show grid (used on host profiles) ---------- */
.filter-bar { display: flex; gap: .4rem; flex-wrap: wrap; margin: 1rem 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem .9rem; cursor: pointer; font: inherit; }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.show-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.show-card:hover { text-decoration: none; box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.show-card img, .show-card-noimg { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.show-card-noimg { display: grid; place-items: center; font-size: 2.5rem; font-weight: 800; color: #fff; background: var(--blue); }
.show-card-title { padding: .5rem .6rem .1rem; font-weight: 700; color: var(--ink); }
.show-card-kind { padding: 0 .6rem .5rem; font-size: .78rem; color: var(--muted); }

/* ---------- show / host detail ---------- */
.show-head, .host-head { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.show-hero { width: 320px; max-width: 100%; border-radius: var(--radius); object-fit: cover; }
.host-photo { width: 180px; border-radius: var(--radius); }
.show-head-text h1 { margin-bottom: .5rem; }
.show-hosts { font-size: 1.05rem; }
.badge { display: inline-block; background: #eef1f5; color: var(--muted); border-radius: 4px; padding: .1rem .5rem; font-size: .8rem; }

/* show meta bubble: compact host / type / timeslot chips, tight line spacing */
.show-meta-bubble { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .6rem; }
.meta-chip { display: inline-flex; align-items: center; gap: .4rem; background: #eef3fa;
  border: 1px solid #dbe6f3; color: var(--ink); border-radius: 999px;
  padding: .25rem .7rem; font-size: .9rem; line-height: 1.25; }
.meta-chip a { color: var(--blue); font-weight: 600; }
.meta-chip-key { text-transform: uppercase; font-size: .66rem; font-weight: 700;
  letter-spacing: .04em; color: var(--muted); }
.meta-chip-slot { background: #fff3e2; border-color: #ffd9a8; }
.meta-chip-slot .meta-chip-key { color: #b5651d; }
.meta-chip-muted { color: var(--muted); font-style: italic; }

/* social links (Facebook / Instagram / website) */
.social-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 .4rem; }
.social-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600;
  font-size: .85rem; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }
.social-link:hover { text-decoration: none; border-color: var(--accent); color: var(--blue); }
.social-fb svg { color: #1877f2; }
.social-ig svg { color: #e1306c; }
.social-web svg { color: var(--muted); }
.prose { max-width: 70ch; } .prose.small { font-size: .9rem; }
.prose img { border-radius: 8px; margin: .8rem 0; }
.article-hero, .show-hero { margin-bottom: 1rem; }
.article { max-width: 75ch; }

/* ---------- schedule (time-aligned week grid) ---------- */
.sched-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.sched-range { font-weight: 700; }
.sched-today { margin-left: .6rem; font-weight: 600; }

.sched-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .4rem; }
.sched-grid { display: grid; grid-template-columns: 54px repeat(7, minmax(116px, 1fr));
  min-width: 760px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }

/* The gutter mirrors a column's structure (head spacer + body) so its hour
   labels line up exactly with the blocks in every day column. */
.sched-gutter { position: sticky; left: 0; z-index: 3; background: var(--card);
  border-right: 1px solid var(--line); }
.sched-corner { z-index: 4; }
.sched-gutter-body { position: relative; }
.sched-hour { position: absolute; right: 6px; transform: translateY(-50%);
  font-size: .68rem; color: var(--muted); white-space: nowrap; }
/* The first label sits on the 6am origin (top:0); centering it would push its
   top half above the body where the sticky header clips it, so top-align it. */
.sched-hour:first-of-type { transform: translateY(0); }
/* Likewise the last one sits on the bottom edge (the next 6am), where the
   scroll box would clip its lower half: bottom-align it. */
.sched-hour:last-of-type { transform: translateY(-100%); }

/* mobile-only arrows that scroll days into view (the grid horizontal-scrolls) */
.sched-daynav { display: none; gap: .4rem; }
.sched-shift { cursor: pointer; }
/* Phones: the date range gets its own line, then one row of buttons:
   [< Prev week]  [< Days] [Days >]  [Next week >] */
@media (max-width: 760px) {
  .sched-nav { gap: .5rem; margin: .8rem 0 .6rem; }
  .sched-range { order: -1; flex: 1 0 100%; text-align: center; }
  .sched-daynav { display: flex; }
}
@media (max-width: 360px) {
  .sched-nav .btn-sm { font-size: .75rem; padding: .25rem .45rem; }
  .sched-nav, .sched-daynav { gap: .3rem; }
}

.sched-col { position: relative; border-left: 1px solid var(--line); }
.sched-col:first-of-type { border-left: 0; }
.sched-col.is-today { background: #fff8ef; }
.sched-col-head { position: sticky; top: 0; z-index: 2; text-align: center; font-size: .82rem;
  font-weight: 700; padding: .35rem .2rem; background: var(--blue); color: #fff; }
.sched-col-head span { display: block; font-weight: 400; font-size: .7rem; color: #cfe0f3; }
.sched-col.is-today .sched-col-head { background: var(--orange); color: #111; }
.sched-col.is-today .sched-col-head span { color: #6b4400; }
.sched-col-body { position: relative;
  background-image: repeating-linear-gradient(to bottom,
    var(--line) 0, var(--line) 1px, transparent 1px, transparent var(--hour-h)); }

.sblock { position: absolute; left: 3px; right: 3px; overflow: hidden; border-radius: 5px;
  padding: 3px 5px; font-size: .74rem; line-height: 1.15; background: #e7f1ff; color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0,69,144,.12); }
a.sblock:hover { text-decoration: none; background: #d4e6ff; }
.sblock-time { display: block; color: var(--blue); font-weight: 700; font-size: .66rem; }
.sblock-title { font-weight: 600; }
.sblock-auto { background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 6px, #f1f3f6 6px, #f1f3f6 12px);
  color: var(--muted); box-shadow: none; }
.sblock-auto .sblock-title { font-weight: 400; font-style: italic; }

/* ---------- search ---------- */
.search-form input { width: 100%; max-width: 520px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search-list { list-style: none; padding: 0; }
.search-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.search-list .kind { display: inline-block; min-width: 5.5rem; font-size: .72rem; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 4px; padding: .05rem .4rem; margin-right: .5rem; }
.snip { color: var(--muted); margin: .2rem 0 0; }
mark { background: #fff2c2; }

.pager { display: flex; gap: .4rem; justify-content: center; align-items: center; flex-wrap: wrap; margin: 2rem 0; }
.page-num { min-width: 2rem; text-align: center; padding: .3rem .5rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; color: var(--ink); font-weight: 600; font-size: .9rem; }
a.page-num:hover { background: #eef1f5; text-decoration: none; }
.page-num.is-current { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-gap { color: var(--muted); padding: 0 .2rem; }
.pager .btn-sm { margin: 0 .3rem; }

/* ---------- footer (blue, matching the station brand) ---------- */
.site-footer { background: var(--blue); color: #cfe0f3; margin-top: 2.5rem; }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; padding: 2rem 1rem; }
.site-footer a { color: #fff; }
.footer-station { font-weight: 800; color: #fff; font-size: 1.1rem; }
/* tighten the stacked links/text in the footer columns (was gratuitously spaced) */
.footer-col p { margin: .25rem 0; line-height: 1.4; }
.footer-col .btn { margin: .2rem .2rem 0 0; background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }
.footer-col .btn:hover { background: rgba(255,255,255,.24); }
.footer-col .btn-orange { background: var(--orange); color: #111; border-color: transparent; }
.footer-col .btn-orange:hover { background: #f36916; }
.footer-copy { color: #a9c4e6; font-size: .85rem; }

/* ---------- click-to-load media facades (no third-party load until play) ---------- */
.embed { position: relative; border-radius: 8px; overflow: hidden;
  background: linear-gradient(135deg, var(--blue), #00305f); }
.embed-mc { height: 120px; }
.embed-yt { aspect-ratio: 16 / 9; }
.embed-play { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; cursor: pointer;
  background: transparent; color: #fff; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; }
.embed-play:hover { background: rgba(0,0,0,.18); }
.embed-icon { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--orange); color: #111;
  display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.embed-label { font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.embed-frame { display: block; width: 100%; height: 100%; border: 0; }
.embed-mc .embed-frame { height: 120px; }

.pager-page { color: var(--muted); font-size: .9rem; align-self: center; }

/* ---------- sticky player ---------- */
.player { position: fixed; bottom: 0; left: 0; right: 0; height: var(--player-h); z-index: 60;
  background: #fff; border-top: 2px solid var(--blue); display: flex; align-items: center;
  gap: 1rem; padding: 0 1rem; box-shadow: 0 -2px 10px rgba(0,0,0,.12); }
.wp-toggle { width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer; background: var(--blue); color: #fff; font-size: 1rem; flex: 0 0 auto; }
.player.is-playing .wp-toggle { background: var(--orange); color: #111; }
.wp-meta { display: flex; flex-direction: column; min-width: 0; }
.wp-status { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wp-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.wp-vol { width: 7rem; }
.wp-links { margin-left: auto; display: flex; gap: .6rem; font-size: .8rem; }
/* Phones: sticky instead of fixed, so the player is in the page flow after the
   footer. It still pins to the bottom while scrolling, but at the end of the
   page it sits below the footer instead of over it, so the address and the
   CMS / sign-in links can't end up hidden behind it when the browser's
   toolbars or zoom shift a fixed bar around. Full-height phone footers keep
   every page taller than the screen, so it never floats mid-screen. */
@media (max-width: 760px) {
  body { padding-bottom: 0; }
  .player { position: sticky; }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .onair-cards { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; order: 3; }
  .header-search { order: 2; margin-left: auto; }
  .header-search input { min-width: 0; width: 8.5rem; }
  .main-nav { order: 4; margin: 0; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--blue); display: none; padding: .5rem 1rem 1rem; }
  body.nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .onair-inner { gap: .6rem; }
  .listen-btn { padding: .4rem .7rem; font-size: .82rem; }
  .wp-links { display: none; }
  .wp-title { max-width: 38vw; }
}

/* On-air banner on phones: a small grid instead of one squeezed flex row.
     On now ............ [Listen Live]
                         [   Watch   ]
     Up next (full width) ....... 9:00pm
     Full schedule          (icon) Name
   .onair-live is the htmx swap target; display: contents lets the items it
   receives sit directly in this grid while it keeps polling. */
@media (max-width: 760px) {
  .onair-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto;
    column-gap: .75rem; row-gap: .3rem; padding-top: .5rem; padding-bottom: .5rem; }
  .onair-live { display: contents; }
  .onair-item { display: grid; grid-template-columns: 4.1rem minmax(0, 1fr) auto;
    column-gap: .4rem; align-items: baseline; grid-column: 1 / -1; }
  .onair-item:first-child { grid-column: 1; grid-row: 1; align-self: center; }
  .onair-next { grid-row: 2; }
  .onair .lbl { white-space: nowrap; }
  .onair-item a, .onair-item .auto { min-width: 0; overflow-wrap: break-word; hyphens: auto; line-height: 1.3; }
  .onair-next time { white-space: nowrap; }
  .onair-actions { grid-column: 2; grid-row: 1; align-self: center;
    flex-direction: column; align-items: stretch; gap: .3rem; }
  .onair-actions .listen-btn { justify-content: center; }
  .onair-full, .onair-account { grid-column: 1 / -1; grid-row: 3; align-self: center; }
  .onair-full { justify-self: start; }
  .onair-account { justify-self: end; max-width: calc(100% - 8rem); display: inline-flex;
    align-items: center; gap: .3rem; font-size: .82rem; color: #dfe8f5; }
  .onair-account .acct-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; fill: currentColor; opacity: .8; }
  .onair-account .acct-pre { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .onair-account .acct-name { overflow: hidden; text-overflow: ellipsis; }
}
/* Narrowest phones: the label goes above the show name so titles get the width. */
@media (max-width: 360px) {
  .onair-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .onair .lbl { grid-column: 1 / -1; }
}

/* ---------- flashes ---------- */
.flashes { margin-bottom: 1rem; }
.flash { padding: .6rem 1rem; border-radius: 8px; margin-bottom: .5rem; }
.flash-success { background: #e3f5e8; color: #14622e; border: 1px solid #b6e2c4; }
.flash-error { background: #fde7e7; color: #8a1f1f; border: 1px solid #f3bcbc; }

/* ---------- auth ---------- */
.auth-box { max-width: 360px; margin: 2rem auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
/* Sign-in steps (auth/_login_step.html) */
.login-step h1 { margin-top: 0; }
.login-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; overflow-wrap: anywhere; }
.login-choices { border: 0; padding: 0; margin: 0 0 .8rem; min-width: 0; }
.login-choices legend { font-weight: 700; margin-bottom: .4rem; padding: 0; }
.login-choice { display: flex; align-items: flex-start; gap: .55rem; padding: .55rem .7rem; margin-bottom: .4rem;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer; overflow-wrap: anywhere; font-weight: 600; }
.login-choice input { margin-top: .25rem; flex: none; }
.login-choice:has(input:checked) { border-color: var(--orange); background: #fff7ec; }
/* .btn:hover would otherwise out-rank .btn-orange and turn these grey */
.login-step .btn-orange:hover, .pe-box .btn-orange:hover { background: #f36916; }
/* The password box and the button's wording follow the picked option */
.login-choose:not(:has(input[name=method][value=password]:checked)) .login-pw,
.login-choose:not(:has(input[name=method][value=password]:checked)) .when-pw,
.login-choose:has(input[name=method][value=password]:checked) .when-code { display: none; }
.cms-form input.login-code-input { font-size: 1.5rem; letter-spacing: .3em; text-align: center;
  font-variant-numeric: tabular-nums; }
/* Six digit boxes drawn by js/code-boxes.js under the real input, which stays
   on top, transparent, so typing, paste and autofill are the browser's own.
   Without JavaScript the plain input above shows instead. */
.code-boxes { position: relative; max-width: 22rem; }
.code-slots { display: none; }
.code-boxes.is-enhanced .code-slots { display: grid; gap: .4rem;
  grid-template-columns: repeat(3, 1fr) .3rem repeat(3, 1fr); }
.code-slot:nth-child(4) { grid-column-start: 5; }
.code-slot { height: 3.2rem; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-slot.is-active { border-color: var(--orange); outline: 2px solid var(--orange); outline-offset: -1px; }
.code-slot.is-active:not(.is-filled)::after { content: ""; width: 2px; height: 1.6rem;
  background: var(--ink); animation: code-caret 1s steps(1) infinite; }
@keyframes code-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .code-slot.is-active::after { animation: none; } }
.cms-form .code-boxes.is-enhanced input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  padding: 0; border: 0; outline: none; background: transparent; color: transparent; caret-color: transparent;
  font-size: 16px; letter-spacing: 0; text-align: left; }
.code-boxes.is-enhanced input::selection { background: transparent; }
.code-boxes.is-enhanced input:-webkit-autofill { -webkit-text-fill-color: transparent;
  transition: background-color 600000s 0s; }
.login-links { margin-top: 1rem; font-size: .92rem; line-height: 1.7; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent);
  text-decoration: underline; cursor: pointer; }

/* ---------- CMS ---------- */
.cms-layout { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; }
.cms-nav { display: flex; flex-direction: column; gap: .2rem; border-right: 1px solid var(--line); padding-right: 1rem; }
.cms-nav a { padding: .45rem .6rem; border-radius: 6px; color: var(--ink); font-weight: 600; }
.cms-nav a:hover { background: #eef1f5; text-decoration: none; }
.cms-content { min-width: 0; }
.stat-row { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1rem 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
.stat b { font-size: 1.5rem; display: block; color: var(--blue); }
ul.plain { list-style: none; padding: 0; } ul.plain li { padding: .2rem 0; }

.cms-form { max-width: 760px; }
.cms-form .field { margin-bottom: .9rem; display: flex; flex-direction: column; gap: .25rem; }
.cms-form label { font-weight: 600; }
.cms-form input[type=text], .cms-form input[type=email], .cms-form input[type=password],
.cms-form input[type=search], .cms-form input[type=url], .cms-form input[type=date],
.cms-form input[type=time], .cms-form input[type=number],
.cms-form input:not([type]), .cms-form textarea, .cms-form select {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: #fff; }
/* selects were visually shorter than text inputs (browser default box) - match them */
.cms-form select { height: calc(1.55em + 1rem + 2px); line-height: 1.55; appearance: auto; }
.cms-form .check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 600; }
.cms-form .check input { width: auto; }

/* modern editor layout: short fields flow into columns, textareas span full width */
.cms-form .field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .1rem 1.3rem; align-items: start; }
.cms-form .field-grid > .fg-item { min-width: 0; }
.cms-form .field-grid > .fg-wide, .cms-form .field-grid > .fg-check { grid-column: 1 / -1; }
.cms-form .fg-check { margin: .1rem 0 .6rem; }
.cms-form .check-help { display: block; font-size: .85rem; margin: .1rem 0 0 1.6rem; }

/* inline field help text under a label */
.field-note { font-size: .82rem; color: var(--muted); margin: -.1rem 0 .3rem; }
/* "(optional)" next to a question that isn't required: part of the label, but
   quieter than it, so the question itself still reads first */
.opt { font-weight: 400; font-size: .85em; color: var(--muted); }

/* grouped settings page: section dividers + a jump-to nav */
.cms-set-section { border-top: 1px solid var(--line); margin-top: 1.7rem; padding-top: 1.1rem; }
.cms-set-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.cms-set-section h2 { margin: 0 0 .35rem; }
.cms-set-section > .muted { margin-top: 0; }
.cms-jump { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: .7rem 0 1.3rem; font-size: .9rem; }

/* gallery browser (insert images inline into a markdown field) */
.gallery-browser { margin: .35rem 0 0; font-size: .85rem; }
.gallery-browser summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.gallery-body { margin-top: .5rem; }
.gallery-upload-lbl { display: inline-block; cursor: pointer; margin-bottom: .5rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem;
  max-height: 240px; overflow-y: auto; padding: .2rem; border: 1px solid var(--line); border-radius: 6px; background: #fafbfc; }
.gallery-pick { padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; overflow: hidden; aspect-ratio: 1; }
.gallery-pick:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(11,124,248,.25); }
.gallery-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-empty { grid-column: 1 / -1; margin: .4rem; }

/* markdown quick-syntax help */
.md-help { margin: .35rem 0 0; font-size: .82rem; }
.md-help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.md-help-body { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0 0; }
.md-help-body code { background: #eef1f5; border-radius: 4px; padding: .05rem .35rem; }

/* change-password modal */
.modal { border: 0; border-radius: 12px; padding: 1.4rem 1.6rem; max-width: 26rem; width: 92%;
  box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(0,0,0,.45); }
.modal h2 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.pw-reqs { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .82rem; }
.pw-reqs li { color: var(--muted); padding-left: 1.3rem; position: relative; }
.pw-reqs li::before { content: "○"; position: absolute; left: .2rem; }
.pw-reqs li.ok { color: #1a8a3a; }
.pw-reqs li.ok::before { content: "✓"; }
#pw-submit:disabled { opacity: .5; cursor: not-allowed; }
.err { color: #b00; font-size: .85rem; }
.pw-row { display: flex; gap: .5rem; align-items: center; }
.pw-row input { flex: 1; }
.pw-row .btn-sm { cursor: pointer; white-space: nowrap; }
.admin-only-fields { border: 1px solid var(--line); border-radius: 8px; padding: .2rem 1rem 1rem; margin: .6rem 0 1rem; background: #fbfcfd; }
.admin-only-fields legend { font-weight: 700; font-size: .85rem; padding: 0 .4rem; }
.md-input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.md-preview { background: #fafbfc; border: 1px dashed var(--line); border-radius: 6px; padding: .5rem .8rem; margin-top: .4rem; min-height: 1rem; }

/* navigation manager: one panel per menu location */
.nav-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.2rem; }
.nav-panel { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; background: var(--card); }
.nav-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.nav-panel-head h2 { margin: 0; font-size: 1.1rem; }
.nav-items { list-style: none; margin: 0; padding: 0; }
.nav-item-row { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.nav-item-row:last-child { border-bottom: 0; }
.nav-item-row.is-hidden { opacity: .5; }
.nav-item-move { display: inline-flex; flex-direction: column; gap: .1rem; }
.nav-item-move .btn-sm { padding: 0 .35rem; line-height: 1.2; cursor: pointer; }
.nav-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.nav-item-label { font-weight: 600; }
.nav-item-url { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item-vis { cursor: pointer; white-space: nowrap; }
.nav-item-row form { display: inline; }

/* list toolbar (filter + toggles) above CMS tables */
.cms-listtools { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: .6rem 0 1rem; }
.inline-lbl { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .85rem; }
.inline-lbl select { padding: .4rem .5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.forms-table .sub-payload { margin: 0; font-size: .85rem; }
.forms-table tr.sub-done { background: #f4f8f4; color: var(--muted); }
.btn-sm.handled-yes { background: #e7f4ea; border-color: #b7dcc0; color: #1a8a3a; }
.cms-filter { flex: 1 1 18rem; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* slide-check switch (reusable) */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 40px; height: 22px; border-radius: 999px; background: #cbd3dc; position: relative; transition: background .15s; flex: 0 0 auto; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch-label { font-weight: 600; font-size: .9rem; }

.cms-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cms-table th, .cms-table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cms-table th { background: #f0f3f7; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.cms-table form { display: inline; }
.btn-sm { font: inherit; font-size: .8rem; padding: .25rem .6rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.btn-sm.danger { color: #b00; border-color: #f3bcbc; }
.tag { display: inline-block; background: #eef1f5; border-radius: 4px; padding: 0 .35rem; font-size: .72rem; margin-right: .2rem; }
/* schedule slot editor on the show page */
.slot-list { list-style: none; padding: 0; margin: 0 0 .8rem; }
.slot-row { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 6px; margin-bottom: .35rem; background: var(--card); }
.slot-when { font-weight: 600; }
.slot-del { margin-left: auto; }
.slot-add { border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; background: #fbfcfd; max-width: 640px; }
.slot-add-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; }
.slot-lbl { display: flex; flex-direction: column; gap: .2rem; font-weight: 600; font-size: .85rem; }
.slot-lbl select, .slot-lbl input { padding: .45rem .5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.weeks-control { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: .8rem 0; }
.wk-weeks { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.wk-weeks[hidden] { display: none; }
.wk-check { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 600; }
/* schedule history: a show's changes (CMS show Schedule tab), CMS > Schedule > History */
.sh-heading { font-size: 1.1rem; margin: 1.6rem 0 .4rem; }
.sh-list { list-style: none; padding: 0; margin: 0; max-width: 720px; }
.sh-event { display: grid; grid-template-columns: 12rem 6.5rem 1fr; gap: .2rem .8rem; align-items: baseline;
  padding: .45rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.sh-event:first-child { border-top: 0; }
.sh-when { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.sh-status { justify-self: start; }
.tag.sh-scheduled { background: #e3f5e8; color: #14622e; }
.tag.sh-unscheduled { background: #fde8e8; color: #9b1c1c; }
.tag.sh-tracking { background: #e3f5e8; color: #14622e; }
.sh-slots { list-style: none; margin: 0; padding: 0; }
.sh-added::before { content: "+ "; color: #14622e; font-weight: 700; }
.sh-removed { color: var(--muted); text-decoration: line-through; }
.sh-removed::before { content: "- "; display: inline-block; text-decoration: none; }
.sh-section { margin: 1.2rem 0 1.6rem; }
.sh-section h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.sh-section h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.sh-form { max-width: none; margin-bottom: .6rem; }
.sh-answer { margin: .4rem 0; }
.cms-table .row-actions { white-space: nowrap; text-align: right; }
.cms-table .row-actions a.btn-sm { display: inline-block; text-decoration: none; color: var(--ink); }
@media (max-width: 760px) {
  .sh-event { grid-template-columns: 1fr auto; }
  .sh-slots { grid-column: 1 / -1; }
}
.wk-check input { width: auto; }

.ep-desc { font-size: .82rem; margin-top: .15rem; }
.ep-desc summary { cursor: pointer; }
.ep-aired { white-space: nowrap; }
.ep-actions { white-space: nowrap; text-align: right; }
.ep-actions a.btn-sm { display: inline-block; text-decoration: none; color: var(--ink); }
.ep-new { margin: 0 0 1rem; }
/* episode editor page (cms/episode_edit.html) */
.ep-back { margin: 0 0 .3rem; }
.ep-page-meta { margin: -.4rem 0 1rem; }
.ep-image-field { margin-top: 1rem; }
.form-actions .ep-delete { margin-right: auto; color: #b00; border-color: #f3bcbc; background: #fff; cursor: pointer; }
@media (max-width: 760px) {
  /* Edit / Delete stack so the table fits a phone */
  .ep-actions { white-space: normal; }
  .ep-actions .btn-sm, .ep-actions a.btn-sm { display: block; width: 100%; margin-bottom: .3rem;
    text-align: center; box-sizing: border-box; }
  .ep-table th, .ep-table td { padding: .45rem .35rem; }
}
.ep-desc[open] summary { margin-bottom: .3rem; }
.ep-desc-body { max-width: 70ch; padding: .4rem .6rem; border-left: 3px solid var(--line); background: #fafbfc; }
.ep-desc-body > :first-child { margin-top: 0; }
.ep-desc-body > :last-child { margin-bottom: 0; }

/* save/preview action row - buttons sit on the right of the form */
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

/* Live preview under each markdown field: a clearly-labeled box that re-renders
   as you type (hx-trigger keyup on the textarea targets the .md-preview below). */
.md-preview-wrap { margin-top: .5rem; border: 1px solid var(--line);
  border-top: 3px solid var(--orange); border-radius: 6px; overflow: hidden; }
.md-preview-head { display: flex; align-items: center; gap: .6rem;
  padding: .4rem .7rem; background: #f5f7f9; border-bottom: 1px solid var(--line); }
.preview-tag { background: var(--orange); color: #111; font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .04em; padding: .18rem .55rem; border-radius: 4px; }
.preview-note { color: var(--muted); font-size: .8rem; }
.md-preview-wrap .md-preview { border: 0; border-radius: 0; margin-top: 0; }

/* Inline field errors: sit on the same row as the field label (not in a block
   far below the input). Empty by default; the server fills it after a failed
   submit and cms-forms.js rewrites it in real time as the user types. */
.field-label { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.field-err { color: #b00; font-size: .8rem; font-weight: 500; }
.field-err:empty { display: none; }
.fg-check .field-err { display: block; margin-top: .1rem; }
.cms-form .invalid { border-color: #b00; box-shadow: 0 0 0 1px rgba(176,0,0,.25); }

/* Profile editor: form on the left, a live mirror of the public profile on the
   right that re-renders (via hx-post) whenever any field changes. */
.profile-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 1.5rem; align-items: start; max-width: none; }
.profile-editor .cms-form { max-width: 620px; }
.live-preview { position: sticky; top: 1rem; border: 1px solid var(--line);
  border-top: 3px solid var(--orange); border-radius: 8px; overflow: hidden;
  background: var(--card); }
.live-preview-head { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem;
  background: #f5f7f9; border-bottom: 1px solid var(--line); }
.live-preview-body { padding: 1rem; }
.live-preview-body .host-detail { display: block; }
.live-preview-body .host-head { gap: 1rem; }
.live-preview-body .host-photo { width: 120px; }
.live-preview-body h1 { font-size: 1.4rem; margin: 0 0 .3rem; }
.pv-empty { font-style: italic; }
@media (max-width: 860px) {
  .profile-editor { grid-template-columns: 1fr; }
  .live-preview { position: static; }
}

/* Gallery-based profile photo picker (replaces the old file upload). */
.photo-field .photo-pick-row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.photo-current { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.photo-thumb { width: 150px; border-radius: var(--radius); display: block; }
.photo-field [hidden] { display: none; }
.photo-field .gallery-browser { flex: 1; min-width: 220px; margin-top: 0; }

/* Image alignment/wrap set by the insert helper - applies in rendered markdown
   everywhere (public prose + every CMS preview). */
.prose::after { content: ""; display: block; clear: both; }
.prose img.img-left { float: left; margin: .3rem 1rem .5rem 0; }
.prose img.img-right { float: right; margin: .3rem 0 .5rem 1rem; }
.prose img.img-center { display: block; margin: .8rem auto; }
.prose img.img-full { display: block; width: 100%; height: auto; }
@media (max-width: 520px) {
  .prose img.img-left, .prose img.img-right { float: none; display: block; margin: .8rem auto; }
}

/* Insert-image helper modal (size + text wrap). */
.img-insert-modal { max-width: 34rem; }
.img-insert-preview { text-align: center; margin-bottom: .8rem; }
.img-insert-preview img { max-height: 160px; max-width: 100%; border-radius: 8px; }
.img-opt-row { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.img-opt-row label { font-weight: 400; display: inline-flex; align-items: center; gap: .3rem; }
.img-insert-modal .img-custom-input { width: 5rem; padding: .25rem .4rem; }

/* host management on the show editor */
.host-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.host-chip { display: inline-flex; align-items: center; gap: .4rem; background: #e7f1ff;
  border: 1px solid #cfe0f3; border-radius: 999px; padding: .25rem .35rem .25rem .7rem; font-weight: 600; }
.host-x { border: 0; background: #bcd4f2; color: #00305f; border-radius: 50%;
  width: 1.3rem; height: 1.3rem; line-height: 1; cursor: pointer; font-size: 1rem; }
.host-x:hover { background: var(--orange); color: #111; }
.host-add { position: relative; max-width: 420px; }
.host-add input { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.host-suggest-list { list-style: none; margin: .2rem 0 0; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; background: #fff; }
.host-suggest-list li + li { border-top: 1px solid var(--line); }
.host-opt { display: block; width: 100%; text-align: left; border: 0; background: #fff;
  padding: .45rem .6rem; cursor: pointer; font: inherit; }
.host-opt:hover { background: #eef1f5; }

/* category manager + dashboard quick links */
/* category -> shows chips with a +N more expand */
.cat-shows { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.cat-show { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-shows:not(.expanded) .cat-show-extra { display: none; }
.cat-expand { cursor: pointer; }

.cat-add { display: flex; gap: .5rem; max-width: 520px; margin: 1rem 0; flex-wrap: wrap; }
.cat-add input { flex: 1 1 8rem; min-width: 0; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.cat-add .btn { flex: 0 0 auto; white-space: nowrap; }
/* CMS > Redirects: one row per redirect, each an editable form. The row wraps
   on a narrow screen, so the fields stay usable instead of shrinking to
   nothing. */
.rd-add { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 1rem 0; }
.rd-add input, .rd-edit input, .rd-search input,
.rd-add select, .rd-edit select { padding: .45rem .55rem; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; min-width: 0; }
.rd-add input[name=from_path], .rd-edit input[name=from_path] { flex: 1 1 11rem; }
.rd-add input[name=to_path], .rd-edit input[name=to_path] { flex: 2 1 16rem; }
.rd-add input[name=note], .rd-edit input[name=note] { flex: 1 1 9rem; }
.rd-arrow { color: var(--muted); }
.rd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1rem 0 .4rem; }
.rd-search { display: flex; gap: .4rem; }
.rd-tools .muted { margin-right: auto; }
.rd-list { display: flex; flex-direction: column; gap: .5rem; }
.rd-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; }
.rd-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; flex: 1 1 24rem; min-width: 0; }
.rd-meta { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .1rem .8rem; margin: 0; font-size: .85rem; }
.rd-warn { color: #b00; font-weight: 600; }
.rd-row.is-dead { border-color: #f3bcbc; background: #fff8f7; }
@media (max-width: 640px) {
  /* stacked fields: the arrow between them has nothing left to point at */
  .rd-arrow { display: none; }
  .rd-add input, .rd-add select, .rd-edit input, .rd-edit select { flex: 1 1 100%; }
}

.dash-links { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.dash-link { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .9rem; font-weight: 600; color: var(--ink); }
.dash-link:hover { background: #eef1f5; text-decoration: none; }

/* form builder rows */
/* form-builder field cards (reorderable) */
.fb-card { border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; margin-bottom: .5rem; background: var(--card); }
.fb-card.dragging { opacity: .5; }
.fb-card.is-section { background: #f3f6fb; border-style: dashed; }
.fb-card-main { display: flex; align-items: center; gap: .5rem; }
.fb-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; user-select: none; }
.fb-card-main .fb-label { flex: 1 1 auto; width: auto; min-width: 0; }
.fb-card-main .fb-type { flex: 0 0 10rem; width: auto; }
.fb-card input, .fb-card select { padding: .35rem .45rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.fb-card-tools { display: inline-flex; gap: .25rem; margin-left: auto; }
.fb-card-tools .btn-sm { cursor: pointer; }
.fb-card-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .4rem .8rem; margin-top: .5rem; }
.fb-sub { display: flex; flex-direction: column; gap: .15rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.fb-sub input { width: 100%; }
.fb-card .check { align-self: end; }

/* public form: text sections + field help */
.form-section { margin: 1.2rem 0 .4rem; }
.form-section-text { font-weight: 700; margin: 0; }
/* spam honeypot: moved off-screen (display:none would tip off smarter bots) */
.hp-field { position: absolute; left: -9999px; top: -9999px; height: 1px; width: 1px; overflow: hidden; }

/* media library */
.media-upload { display: flex; gap: .5rem; align-items: center; margin: 1rem 0 1.5rem; flex-wrap: wrap; }
.media-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.media-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
.media-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: 6px; }
.media-file { display: grid; place-items: center; aspect-ratio: 4/3; background: var(--blue); color: #fff; border-radius: 6px; font-weight: 800; }
.media-file:hover { text-decoration: none; filter: brightness(1.1); }
.media-url { width: 100%; margin: .4rem 0 .3rem; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 6px; font-size: .72rem; }
.media-row-actions { display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-size: .76rem; }
.media-row-actions .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-row-actions form { margin: 0; }
.sub { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin-bottom: .8rem; }
.sub.done { opacity: .6; }

@media (max-width: 760px) {
  .cms-layout { grid-template-columns: 1fr; }
  .cms-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 .5rem; }
}

/* --- RSS subscribe links --- */
.rss-link {
  font-size: .6em; vertical-align: middle; margin-left: .6rem;
  padding: .12em .45em; border-radius: 3px; text-decoration: none;
  background: var(--wayo-orange, #fe911d); color: #fff; letter-spacing: .04em;
}
.rss-link:hover { filter: brightness(1.08); }
.footer-feeds a { white-space: nowrap; }

/* ---------- Production Studio booking calendar ---------- */
.cal-page-head { display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; }
.cal-page-head h1 { margin: 0; }

.cal-toolbar { display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; flex-wrap: wrap; margin: .9rem 0; }
.cal-nav { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.cal-heading { font-weight: 700; margin-left: .3rem; }
.cal-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-views { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-views .btn-sm { border: 0; border-radius: 0; border-left: 1px solid var(--line); background: #fff; }
.cal-views .btn-sm:first-child { border-left: 0; }
.cal-views .btn-sm.is-active { background: var(--blue); color: #fff; }
.cal-notice { margin-bottom: .6rem; }
.cal-legend { font-size: .78rem; margin: .5rem 0 0; }

/* ---- unified 6am->6am percent grid (interactive calendar + kiosk) ----
   A bounded box on the page, the full viewport on the kiosk; both show all 24
   hours with no scroll. Blocks/lines are positioned in percent by the engine. */
.pgrid { display: flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; height: 72vh; min-height: 500px; }
.pgrid.is-kiosk { flex: 1 1 0; min-height: 0; height: auto; border-radius: 10px; }

.pgutter { flex: 0 0 auto; width: 52px; display: flex; flex-direction: column;
  border-right: 1px solid var(--line); background: var(--card); }
.pgrid.is-kiosk .pgutter { width: 68px; }

.pcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--line); }
.pcol:first-of-type { border-left: 0; }
.pcol.is-today { background: #fff8ef; }
.pcol-head { flex: 0 0 auto; text-align: center; font-size: .8rem; font-weight: 700;
  padding: .28rem .2rem; background: var(--blue); color: #fff; line-height: 1.15; }
.pcol-head span { font-weight: 400; opacity: .85; }
.pcorner { background: var(--card); }
.pcol.is-today .pcol-head { background: var(--orange); color: #111; }
.pgrid.is-kiosk .pcol-head { height: 2.2rem; display: flex; align-items: center;
  justify-content: center; gap: .35rem; font-size: 1rem; font-weight: 800; }

.pgutter-body, .pbody { flex: 1 1 0; min-height: 0; position: relative; }
.pbody { overflow: hidden; }
.pbody[data-interactive] { cursor: crosshair; }

/* hour gridlines: an inner layer inset by the axis padding (30/1500 = 2%) so the
   24 evenly-spaced lines land exactly on the gutter labels */
.pbody-lines { position: absolute; left: 0; right: 0; top: 2%; bottom: 2%;
  pointer-events: none; background-image: repeating-linear-gradient(to bottom,
    var(--line) 0, var(--line) 1px, transparent 1px, transparent calc(100% / 24)); }
/* soft dashed divider at midnight (start of the next day) */
.pline-mid { position: absolute; left: 0; right: 0; height: 0; z-index: 1;
  border-top: 1px dashed #b6bfc9; pointer-events: none; }

.phour { position: absolute; right: 6px; transform: translateY(-50%);
  font-size: .72rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.phour.is-midnight { color: var(--blue); font-weight: 800; }
.pgrid.is-kiosk .phour { right: 8px; font-size: clamp(0.66rem, 1.5vh, 1.02rem);
  font-weight: 800; color: var(--ink); white-space: nowrap; }

/* non-bookable hours (outside the configured window) */
.pclosed { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(45deg, rgba(120,132,144,.06) 0 6px,
    rgba(120,132,144,.12) 6px 12px); }

/* booking blocks */
.pblock { position: absolute; left: 3px; right: 3px; overflow: hidden; border: 0;
  border-left: 3px solid var(--blue); border-radius: 5px; padding: 1px 6px;
  font: inherit; font-size: .72rem; line-height: 1.15; text-align: left; z-index: 2;
  background: #e7f1ff; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(0,69,144,.12); }
button.pblock { cursor: pointer; }
button.pblock:hover { background: #d4e6ff; }
.pblock.mine { background: #fff3e0; border-left-color: var(--orange);
  box-shadow: inset 0 0 0 1px rgba(254,145,29,.28); }
button.pblock.mine:hover { background: #ffe9cc; }
.pblock-time { display: block; font-weight: 700; color: var(--blue); font-size: .66rem; }
.pblock.mine .pblock-time { color: #a35b00; }
.pblock-who { font-weight: 600; }
.pblock-title { display: block; color: var(--muted); font-size: .68rem;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
/* booking description on the block: up to two lines, then clipped */
.pblock-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--muted); font-size: .66rem; line-height: 1.12; overflow: hidden; }
.pgrid.is-kiosk .pblock { padding: 2px 7px; font-size: .92rem; border-left-width: 4px; }
.pgrid.is-kiosk .pblock-time { font-size: .82rem; font-weight: 800; }
.pgrid.is-kiosk .pblock-desc { font-size: .8rem; -webkit-line-clamp: 3; }

/* current-time line */
.pnow { position: absolute; left: 0; right: 0; height: 2px; z-index: 4;
  background: var(--orange); pointer-events: none; }
.pnow::before { content: ''; position: absolute; left: -1px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* hover marker + drag selection (interactive grid only) */
.pghost { position: absolute; left: 3px; right: 3px; z-index: 3; pointer-events: none;
  border: 1px dashed var(--accent); border-radius: 5px; background: rgba(11,124,248,.10); }
.pghost-line { position: absolute; left: 0; right: 0; height: 0; z-index: 3;
  border-top: 1px solid #8b95a0; pointer-events: none; }
.pghost-label { position: absolute; right: 4px; top: -2px; transform: translateY(-100%);
  font-size: .64rem; font-weight: 700; color: #fff; background: var(--accent);
  padding: 0 4px; border-radius: 3px; pointer-events: none; }

/* month grid */
.cal-month { border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--card); min-width: 620px; }
.cal-month-head { display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--blue); color: #fff; }
.cal-month-head > div { padding: .35rem .2rem; text-align: center; font-size: .74rem; font-weight: 700; }
.cal-month-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-daycell { min-height: 96px; border-top: 1px solid var(--line);
  border-left: 1px solid var(--line); padding: 2px 3px 4px; overflow: hidden; }
.cal-daycell:nth-child(7n+1) { border-left: 0; }
.cal-daycell.out { background: #fafbfc; }
.cal-daycell.out .cal-daynum { color: var(--muted); }
.cal-daycell.is-today { background: #fff8ef; }
.cal-daynum { display: inline-block; font-size: .78rem; font-weight: 700;
  padding: 1px 5px; border-radius: 6px; color: var(--ink); }
a.cal-daynum:hover { background: #eef1f5; text-decoration: none; }
.cal-daycell.is-today .cal-daynum { background: var(--orange); color: #111; }
.cal-chip { display: block; width: 100%; text-align: left; border: 0; cursor: pointer;
  background: #e7f1ff; color: var(--ink); border-radius: 5px; padding: 1px 5px;
  margin-top: 2px; font: inherit; font-size: .7rem; white-space: nowrap;
  text-overflow: ellipsis; overflow: hidden; }
.cal-chip.mine { background: #fff3e0; }
.cal-chip:hover { filter: brightness(.96); }
.cal-chip-time { font-weight: 700; color: var(--blue); }
.cal-chip.mine .cal-chip-time { color: #a35b00; }

/* booking dialog */
.cal-dialog { max-width: 520px; width: calc(100% - 2rem); }
.cal-form-err { margin-bottom: .6rem; }
.cal-repeat { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-repeat input { width: 5rem; }
.cal-form .modal-actions { align-items: center; }
.cal-form .modal-actions .spacer { flex: 1; }

/* start/end time steppers */
.cal-times { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-bottom: .2rem; }
.cal-times .fg-item { margin: 0; }
.tpick { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: .35rem; border: 1px solid var(--line); border-radius: 10px; padding: .3rem .55rem; background: #fff; }
.tpick-col { display: inline-flex; flex-direction: column; align-items: center; gap: .12rem; }
.tpick-btn { border: 1px solid var(--line); background: #fff; color: var(--blue);
  width: 2.2rem; height: 1.3rem; line-height: 1; border-radius: 6px; cursor: pointer;
  font-size: .7rem; padding: 0; -webkit-user-select: none; user-select: none; }
.tpick-btn:hover { background: #eaf2fd; }
.tpick-btn:active { background: #d4e6ff; }
.tpick-val { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 2.2rem; text-align: center; padding: .05rem 0;
  -webkit-user-select: none; user-select: none; }
.tpick-colon { font-size: 1.4rem; font-weight: 800; }
.tpick-hint { width: 100%; text-align: center; margin-top: .25rem; font-size: .78rem;
  font-weight: 600; color: var(--muted); }
/* The native time input is fully replaced by the stepper; clip it to 1px so it
   can't show (some platforms ignore opacity on native date/time widgets). The
   class selector must out-specify the generic `.cms-form input[type=time]`. */
.cms-form input.tpick-native { position: absolute; width: 1px; height: 1px; min-width: 0;
  padding: 0; margin: 0; border: 0; opacity: 0; pointer-events: none; overflow: hidden; }

/* on-behalf-of autocomplete */
.ac { position: relative; }
.ac-input { width: 100%; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  margin: 3px 0 0; padding: 0; list-style: none; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(0,0,0,.14);
  max-height: 220px; overflow-y: auto; }
.ac-list[hidden] { display: none; }
.ac-list li { padding: .42rem .6rem; cursor: pointer; font-size: .92rem; }
.ac-list li.is-active, .ac-list li:hover { background: #eaf2fd; }

/* admin bookings list row tools */
.cms-rowtools { display: flex; gap: .4rem; align-items: center; }
.cms-rowtools form { margin: 0; }

/* kiosk board (standalone, fullscreen, fills the viewport, no scrolling) */
.cal-kiosk-body { padding-bottom: 0; margin: 0; background: var(--bg); height: 100vh; overflow: hidden; }
.cal-kiosk { display: flex; flex-direction: column; height: 100vh; padding: .7rem 1rem; gap: .6rem; }
.cal-kiosk-main { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: .55rem; }

/* single-row kiosk header: name + date left, clock + views + fullscreen right */
.kbar { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 1rem; }
.kbar-title { justify-self: start; display: flex; align-items: baseline; gap: .9rem; min-width: 0; }
.kbar-name { font-size: 1.7rem; font-weight: 800; color: var(--blue); white-space: nowrap; }
.kbar-sub { font-size: 1.15rem; font-weight: 700; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbar-right { justify-self: end; display: flex; align-items: center; gap: .9rem; }
.kbar-clock { justify-self: center; text-align: center; font-size: 1.9rem;
  font-weight: 800; font-variant-numeric: tabular-nums; }

/* merged Day/Week/Month buttons with generous horizontal padding */
.cal-kviews { display: inline-flex; border: 2px solid var(--blue); border-radius: 12px; overflow: hidden; }
.cal-kview { padding: .55rem 1.35rem; border: 0; border-left: 2px solid var(--blue);
  background: #fff; color: var(--blue); font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.cal-kview:first-child { border-left: 0; }
.cal-kview.is-active { background: var(--blue); color: #fff; }
.cal-kview:hover:not(.is-active) { background: #eaf2fd; }

/* kiosk month view fills height instead of scrolling */
.cal-kmonth-wrap { flex: 1 1 0; min-height: 0; }
.cal-kmonth { min-width: 0; height: 100%; display: flex; flex-direction: column; }
.cal-kmonth .cal-month-row { flex: 1 1 0; min-height: 0; }
.cal-kmonth .cal-daycell { min-height: 0; }
.cal-kmonth .cal-daynum, .cal-kmonth .cal-chip { font-size: .95rem; }

@media (max-width: 640px) {
  .cal-daycell { min-height: 70px; }
  .pgrid { height: 68vh; min-height: 420px; }
  .kbar-name { font-size: 1.3rem; }
  .kbar-clock { font-size: 1.4rem; }
  .cal-kview { padding: .5rem 1rem; font-size: .95rem; }
}

/* ---- booking dialog: title + date on one row, inline repeat row ---- */
.cal-form-head { display: flex; align-items: center; justify-content: space-between;
  gap: .9rem; margin-bottom: .7rem; }
.cal-form-head h2 { margin: 0; }
.cms-form input.cal-head-date { width: auto; flex: 0 0 auto; }
.cal-repeat-field { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.cal-repeat-field .cal-repeat-label { margin: 0; font-weight: 600; }
.cms-form .cal-repeat-field input[type=number] { width: 4.5rem; }
.cal-repeat-field input:disabled { opacity: .5; }
.cal-repeat-switch { margin: 0; }

/* ---- settings: tab panels + condensed grid ---- */
.set-tabs { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 2px solid var(--line);
  margin: .8rem 0 1.2rem; }
.set-tab { border: 0; background: transparent; padding: .5rem .95rem; font: inherit;
  font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent;
  margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.set-tab:hover { color: var(--ink); background: #f2f5f9; }
.set-tab.is-active { color: var(--blue); border-bottom-color: var(--orange); }
a.set-tab:hover { text-decoration: none; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.set-panel-note { margin: 0 0 1rem; max-width: 60ch; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .1rem 1.5rem; align-items: start; }
.set-grid .set-full { grid-column: 1 / -1; }
.cms-form .set-num input { max-width: 9rem; }

/* ---- article cover-image editor ---- */
.cover-field { border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem 1rem;
  background: #fbfcfd; }
.cover-row { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: flex-start; }
.cover-current { display: flex; flex-direction: column; gap: .4rem; }
.cover-current img { max-width: 220px; border-radius: 8px; border: 1px solid var(--line); }
.cover-upload { display: flex; flex-direction: column; gap: .35rem; min-width: 14rem; }

/* small tip line inside the markdown help */
.md-help-tip { flex-basis: 100%; color: var(--muted); }

/* ============================ media library =============================== */
/* toolbar: search (with thumbnail autocomplete), sort, uploader filter */
.media-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center;
  margin: 0 0 1rem; padding: .6rem .8rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.media-search-wrap { position: relative; flex: 1 1 240px; min-width: 200px; }
.media-search-wrap input[type=search] { width: 100%; }
.media-sort { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--muted); }
.media-uploader-filter { position: relative; display: inline-flex; align-items: center; gap: .3rem; }
.media-uploader-filter input { min-width: 12rem; }

/* autocomplete dropdown, shared by the name search and the uploader filter */
.media-ac { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 30;
  list-style: none; margin: 0; padding: .2rem; max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.media-ac li { display: flex; align-items: center; gap: .55rem; padding: .3rem .4rem;
  border-radius: 6px; cursor: pointer; font-size: .82rem; }
.media-ac li:hover { background: #eef4ff; }
.media-ac img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; flex: none; }
.media-ac-ext { width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  background: var(--blue); color: #fff; border-radius: 4px; font-size: .6rem; font-weight: 800; }
.media-ac-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-ac-meta { color: var(--muted); font-size: .74rem; flex: none; }

/* list view: thumbnail | details | actions */
.media-count { margin: 0 0 .5rem; font-size: .82rem; }
.media-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.media-row { display: grid; grid-template-columns: 88px 1fr auto; gap: .8rem; align-items: start;
  padding: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.media-thumb { display: block; width: 88px; height: 66px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line); background: #fafbfc; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-ext { display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--blue); color: #fff; font-weight: 800; font-size: .8rem; }
.media-meta { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.media-meta .media-url { margin: 0; max-width: 34rem; }
.media-facts { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .76rem; }
.media-uses { font-size: .78rem; }
.media-uses a { color: var(--accent); }
.media-uses-more summary { cursor: pointer; color: var(--accent); }
.media-uses-more ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.media-actions form { margin: 0; }
.media-pager { display: flex; gap: .8rem; align-items: center; justify-content: center; margin: 1rem 0 .2rem; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* inline picker: search + upload row, then the thumbnail grid */
.gallery-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.gallery-search { flex: 1 1 180px; min-width: 140px; }
.gallery-more-wrap { margin-top: .5rem; text-align: center; }
.gallery-more[hidden] { display: none; }

/* documents (media.kind='file'): public/private badge, admin actions, and the
   "Link a document" picker's name rows */
.media-vis { display: inline-block; border-radius: 4px; padding: 0 .4rem; font-weight: 700; }
.media-vis.is-public { background: #e3f5e8; color: #14622e; }
.media-vis.is-private { background: #fef3c7; color: #92400e; }
.media-actions { display: flex; flex-direction: column; gap: .35rem; align-items: flex-end; }
.media-private-opt { font-size: .85rem; }
.file-private-lbl { font-size: .82rem; }
.gallery-grid.file-grid { display: flex; flex-direction: column; gap: .3rem; }
.gallery-pick.file-pick { aspect-ratio: auto; display: flex; align-items: center; gap: .55rem;
  padding: .3rem .5rem .3rem .3rem; text-align: left; font: inherit; color: inherit; }
.file-pick .media-ext { width: 2.6rem; height: 1.9rem; flex: none; border-radius: 4px; font-size: .7rem; }
.file-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick .media-vis { flex: none; font-size: .72rem; }
.file-pick-size { flex: none; color: var(--muted); font-size: .74rem; }

/* storage report */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th, .data-table td { padding: .45rem .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.data-table thead th { background: #f6f8fa; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tfoot th { border-top: 2px solid var(--line); font-weight: 800; }
.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-th:hover { color: var(--accent); }
.sortable-th[data-dir=asc]::after { content: " \2191"; }
.sortable-th[data-dir=desc]::after { content: " \2193"; }

/* impersonation */
.page-head-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-head-row h1 { margin-right: auto; }
.impersonate-btn { display: inline-flex; align-items: center; gap: .4rem; }
.impersonate-btn svg { width: 14px; height: 14px; }
.impersonation-banner { background: #5b21b6; color: #fff; font-size: .88rem; }
.impersonation-banner form { max-width: 1100px; margin: 0 auto; padding: .4rem 1rem;
  display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; }
.impersonation-banner .btn-sm { background: #fff; color: #5b21b6; border-color: transparent;
  font-weight: 700; white-space: nowrap; }

/* API access keys */
.api-key { font-size: .78rem; word-break: break-all; }
.api-key-cell { display: inline-flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.api-key-masked { letter-spacing: .04em; color: var(--muted); }
.api-row-actions { white-space: nowrap; }
.api-row-actions form { display: inline-block; margin-right: .3rem; }

/* Sign-in security */
.captcha-box img { display: block; border-radius: 6px; border: 1px solid #d8d2c6;
  margin: .35rem 0; }
.captcha-box input[name="captcha_text"] { max-width: 180px; text-transform: lowercase; }
.badge-auto { background: #fef3c7; color: #92400e; border-radius: 4px;
  padding: .1rem .45rem; font-size: .75rem; font-weight: 700; }
.security-alert { background: #fef3c7; border: 1px solid #f59e0b; border-radius: 8px;
  padding: .6rem .9rem; margin: .8rem 0; }
.security-alert a { font-weight: 700; }

/* ======================================================================
   Votes (STAR voting)
   ====================================================================== */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- status chips (label always present; the dot is a secondary cue) ---- */
.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px;
  padding: .1rem .6rem; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: #eef1f5; color: var(--muted); }
.chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.chip-open { background: #e3f5e8; color: #14622e; }
.chip-upcoming { background: #e6f0fd; color: var(--blue); }
.chip-closed { background: #eef1f5; color: #3d4652; }
.chip-draft { background: #f4f1ea; color: #6b5d3e; }
.chip-disabled { background: #fde7e7; color: #8a1f1f; }

/* ---- public ballot page ---- */
.vote-app { --star-off: #c9d0d8; --star-on: var(--orange); overflow-anchor: none; }
.vote-head { max-width: 75ch; }
.vote-head h1 { margin-bottom: .25rem; }
.vote-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: 0 0 .8rem; }
/* info box at the top of a vote (also the editor preview) */
.vote-info { display: flex; gap: .8rem; align-items: flex-start; border-radius: var(--radius);
  border: 1px solid; border-left-width: 5px; padding: .8rem 1rem; margin: .9rem 0 1rem; max-width: 75ch; }
.vote-info-icon { width: 26px; height: 26px; flex: 0 0 26px; fill: currentColor; margin-top: .05rem; }
.vote-info-body { min-width: 0; flex: 1; }
.vote-info-title { font-size: 1.08rem; margin: 0 0 .2rem; line-height: 1.3; color: var(--ink); }
.vote-info-text { color: var(--ink); overflow-wrap: anywhere; }
.vote-info-text > :first-child { margin-top: 0; }
.vote-info-text > :last-child { margin-bottom: 0; }
.vote-info-text a { color: inherit; text-decoration: underline; font-weight: 600; }
.vote-info-info { background: #eef5fe; border-color: #c3d8f5; border-left-color: var(--accent); color: var(--blue); }
.vote-info-highlight { background: #fff5e8; border-color: #fbd7a8; border-left-color: var(--orange); color: #b85c00; }
.vote-info-important { background: #fdeeee; border-color: #f3bcbc; border-left-color: #c62828; color: #b01f1f; }
.vote-intro { max-width: 75ch; }
.vote-notice { background: #e6f0fd; border: 1px solid #c3d8f5; color: #10325e; border-radius: var(--radius);
  padding: .7rem 1rem; margin: 1rem 0; }
.vote-notice.is-warn { background: #fef3c7; border-color: #f5d27a; color: #6b4a06; }
/* editors only: the external "already voted" state lives in the browser, so
   this row reports it and clears it (see showFlagState() in vote.js) */
.vote-tools { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .9rem;
  border: 1px dashed var(--line); border-radius: var(--radius); padding: .5rem .8rem; margin: 1rem 0; }
.vote-tools .js-flag-state { flex: 1 1 12rem; }
.vote-tools button[disabled] { opacity: .55; cursor: not-allowed; }
.vote-voted { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: #e3f5e8;
  border: 1px solid #b6e2c4; color: #14622e; border-radius: var(--radius); padding: .8rem 1rem; margin: 1rem 0; }
.vote-voted[hidden] { display: none; }
.vote-voted > div { flex: 1 1 14rem; display: flex; flex-direction: column; }
.vote-voted-icon { width: 28px; height: 28px; flex: 0 0 28px; fill: currentColor; }
.vote-voted-sub { font-size: .9rem; }
.vote-voted .muted { color: #3d6b4b; }
.vote-howto { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .5rem 1rem; margin: 1rem 0; max-width: 75ch; }
.vote-howto summary { cursor: pointer; font-weight: 700; }
.vote-howto p { margin: .5rem 0; }

/* align-items: start so a card is only as tall as its own art and text: the
   frames keep the art's proportions, so stretching them to a common row height
   would just park a block of empty space under the shorter entries */
.vote-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-items: start; gap: 1rem; margin: 1rem 0; }
.vote-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; }
/* the frame takes the art's own shape: votes/ballot.html sets aspect-ratio
   inline from the picture's pixel size, so the 4:3 here is only the fallback
   for art with no dimensions on file. `contain` means a missing or stale ratio
   letterboxes instead of cropping, and the cap stops a very tall entry from
   swallowing its row. */
.vote-zoom { display: block; width: 100%; padding: 0; border: 0; background: #e9edf2; cursor: zoom-in;
  aspect-ratio: 4 / 3; max-height: 36rem; overflow: hidden; }
.vote-zoom img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s; }
.vote-zoom:hover img { transform: scale(1.03); }
.vote-zoom:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.vote-noimg { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #e9edf2;
  color: #8a94a0; font-size: 3rem; font-weight: 800; text-transform: uppercase; }
.vote-card-body { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.vote-name { font-size: 1.08rem; line-height: 1.25; margin: 0; overflow-wrap: anywhere; }
.vote-credit { margin: 0; color: var(--muted); font-size: .9rem; }
.vote-desc { margin: .15rem 0 0; font-size: .9rem; }

/* 0 pill + five stars; the stars up to the checked one light up */
.star-pick { border: 0; margin: 0; padding: .1rem 0 0; display: flex; align-items: center; gap: .2rem; min-width: 0; }
.star-pick label { display: inline-grid; place-items: center; flex: 0 1 42px; min-width: 34px; height: 42px; border-radius: 10px;
  cursor: pointer; color: var(--star-off); -webkit-tap-highlight-color: transparent; }
.star-pick label svg { width: min(32px, 100%); height: 32px; fill: currentColor; transition: transform .1s; }
.star-pick label:hover svg { transform: scale(1.1); }
.star-pick .star-zero { flex: 0 0 36px; height: 32px; margin-right: .3rem; border: 2px solid var(--line);
  color: var(--muted); font-weight: 800; border-radius: 999px; }
.star-pick:has(input:checked) label.star { color: var(--star-on); }
.star-pick input:checked + label ~ label.star { color: var(--star-off); }
.star-pick input[value="0"]:checked + .star-zero { background: #3d4652; border-color: #3d4652; color: #fff; }
.star-pick input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 1px; }
/* "worst" over the 0 pill and "best" over the fifth star (first row per card).
   The pill is 10px shorter than a star label and centred, hence the two offsets;
   the colour is set here because the labels' own colour lights up when picked */
.star-pick.has-hints { padding-top: 1.05rem; }
.star-pick label { position: relative; }
.star-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% - 1px);
  font-size: .7rem; font-weight: 700; line-height: 1; color: var(--muted); white-space: nowrap; pointer-events: none; }
.star-pick .star-zero .star-hint { bottom: calc(100% + 4px); }

.vote-yours { margin: 0; padding-top: .2rem; display: flex; align-items: center; gap: .4rem; }
.vote-yours[hidden] { display: none; }
.stars-static { display: inline-flex; gap: 1px; color: var(--star-off); }
.stars-static svg { width: 20px; height: 20px; fill: currentColor; }
.stars-static[data-score="1"] svg:nth-child(-n+1),
.stars-static[data-score="2"] svg:nth-child(-n+2),
.stars-static[data-score="3"] svg:nth-child(-n+3),
.stars-static[data-score="4"] svg:nth-child(-n+4),
.stars-static[data-score="5"] svg:nth-child(-n+5) { color: var(--star-on); }

/* entry score rows (one per position the entry is in) */
.vote-slots { margin-top: auto; padding-top: .45rem; display: flex; flex-direction: column; }
.vote-slot + .vote-slot { border-top: 1px dashed var(--line); margin-top: .35rem; padding-top: .35rem; }
.vote-slot-label { margin: 0; font-size: .74rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--blue); overflow-wrap: anywhere; }
/* separate layout: a titled section per position */
.vote-position { margin: 1.6rem 0 .5rem; }
.vote-position-head { border-bottom: 3px solid var(--orange); padding-bottom: .3rem; margin-bottom: .2rem; max-width: 75ch; }
.vote-position-head h2 { margin: 0; font-size: 1.45rem; }
.vote-position-head p { margin: .1rem 0 0; }
.vote-pos-desc { display: block; }
/* combined layout: the positions listed once above the entries */
.vote-positions-legend { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .6rem 1rem; margin: 1rem 0; max-width: 75ch; }
.vote-positions-legend h2 { font-size: 1rem; margin: 0 0 .3rem; }
.vote-positions-legend ul { margin: 0; padding-left: 1.1rem; }
.vote-positions-legend li { margin: .15rem 0; }
.vote-positions-legend .vote-pos-desc { font-size: .9rem; color: var(--muted); }
.vote-questions { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1.1rem .4rem; margin: 1.2rem 0; max-width: 760px; }
/* a <legend> is normally painted on the top border, which left the title
   sitting on the frame and cutting the rounded corner. Floating it takes it out
   of that placement and makes it an ordinary heading inside the card; the
   full-width float needs the next block to clear it. */
.vote-questions legend { float: left; width: 100%; font-weight: 800; padding: 0; margin: 0 0 .5rem; }
.vote-questions legend + * { clear: left; }

.vote-submit { position: sticky; bottom: calc(var(--player-h) + .5rem); z-index: 5;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.12); padding: .6rem .8rem; margin: 1rem 0; }
.vote-progress { margin: 0 auto 0 0; }
.vote-submit .btn, .ve-actions .btn, .vote-voted .btn { cursor: pointer; font-family: inherit; }
.vote-submit .vote-client-err { flex: 1 1 100%; margin: 0; padding: .4rem .7rem; }
/* .btn:hover would otherwise out-rank .btn-orange and turn these grey */
.vote-submit .btn-orange:hover, .ve-actions .btn-orange:hover,
.dash-vote .btn-orange:hover { background: #f36916; }
.vote-submit .btn-orange { font-size: 1rem; padding: .6rem 1.4rem; }
.vote-submit button[disabled] { opacity: .55; cursor: not-allowed; }
.vote-form.is-busy .vote-submit button { opacity: .6; pointer-events: none; }

.vote-app.is-voted .star-pick,
.vote-app.is-voted .vote-submit,
.vote-app.is-voted .vote-questions,
.vote-app.is-voted .vote-howto,
.vote-app.is-voted .vote-client-err,
.vote-app.is-voted.after-banner .vote-gallery { display: none; }

/* lightbox */
.vote-lightbox { border: 0; padding: 0; background: #0b0f15; max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh; margin: 0; overflow: hidden; }
.vote-lightbox::backdrop { background: #0b0f15; }
.vote-lightbox[open] { display: flex; flex-direction: column; }
html.lb-open { overflow: hidden; }
.lb-frame { flex: 1 1 auto; min-height: 0; position: relative; display: flex; align-items: center;
  justify-content: center; padding: 3rem 3.5rem .5rem; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; touch-action: pan-y;
  transition: filter .25s ease; }
/* the card's thumbnail stands in (blurred, so the swap reads as sharpening)
   until the big copy has loaded - see loadFull() in vote.js */
.lb-img.is-preview { filter: blur(3px); }
.lb-frame.is-loading::after { content: ""; position: absolute; top: 1rem; left: 50%; width: 26px; height: 26px;
  border-radius: 999px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: lb-spin .8s linear infinite; pointer-events: none; }
@keyframes lb-spin { from { transform: translateX(-50%) rotate(0); } to { transform: translateX(-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .lb-img { transition: none; }
  .lb-img.is-preview { filter: none; }
  .lb-frame.is-loading::after { animation: none; transform: translateX(-50%); border-top-color: rgba(255,255,255,.7); }
}
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff;
  border-radius: 999px; cursor: pointer; display: grid; place-items: center; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-close { top: .6rem; right: .6rem; width: 44px; height: 44px; font-size: 1.8rem; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 2.4rem; line-height: 1; }
.lb-nav[hidden] { display: none; }
.lb-prev { left: .4rem; }
.lb-next { right: .4rem; }
.lb-info { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: .4rem 1.2rem; color: #fff; padding: .6rem 1rem 1rem; text-align: center; }
.lb-info .muted { color: #c3cad3; }
.lb-scores { display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.lb-score { display: grid; grid-template-columns: minmax(0, 9rem) auto; align-items: center;
  column-gap: .6rem; }
.lb-score-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #c3cad3; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.lb-score:has(.lb-score-label:empty) { grid-template-columns: auto; }
.lb-score-label:empty { display: none; }
.lb-score-picks { display: flex; gap: .2rem; align-items: center; }
.lb-pick { width: 44px; height: 44px; border: 0; background: transparent; color: #56606c; cursor: pointer;
  display: grid; place-items: center; border-radius: 10px; }
.lb-pick svg { width: 34px; height: 34px; fill: currentColor; }
.lb-pick.star-zero { border: 2px solid #56606c; color: #c3cad3; font-weight: 800; width: 38px; height: 34px;
  border-radius: 999px; margin-right: .3rem; }
.lb-pick.star.is-on { color: var(--orange); }
.lb-pick.star-zero.is-on { background: #fff; border-color: #fff; color: #111; }
.lb-pick:focus-visible { outline: 3px solid var(--accent); }

@media (max-width: 640px) {
  .vote-gallery { grid-template-columns: 1fr; gap: .8rem; }
  /* one column here, so the fallback frame goes square rather than letterbox a
     full-width card; art whose size is on file overrides this from the markup */
  .vote-zoom, .vote-noimg { aspect-ratio: 1 / 1; }
  .vote-submit { bottom: calc(var(--player-h) + .3rem); padding: .5rem .6rem; }
  .vote-submit .btn-orange { flex: 1 1 auto; }
  .vote-progress { flex: 1 1 100%; font-size: .9rem; }
  .lb-frame { padding: 3.4rem .3rem .3rem; }
  .lb-nav { top: auto; bottom: .4rem; transform: none; height: 48px; background: rgba(0,0,0,.45); }
  /* phones: each position's label sits on its own line above its stars */
  .lb-score { grid-template-columns: auto; justify-items: center; }
  .lb-score-label { text-align: center; }
  .lb-scores:has(.lb-score + .lb-score) .lb-pick { height: 40px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .vote-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* ---- dashboard: open votes ---- */
.dash-votes { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .4rem 1rem .6rem; margin: 1rem 0; }
.dash-votes h2 { font-size: 1.1rem; margin: .5rem 0; }
.dash-vote-list { list-style: none; margin: 0; padding: 0; }
.dash-vote { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem 0;
  border-top: 1px solid var(--line); }
.dash-vote > div { flex: 1 1 14rem; display: flex; flex-direction: column; }
.dash-vote-title { font-weight: 700; }

/* ---- submissions inbox: browser under the IP ---- */
.sub-ua { font-size: .78rem; }

/* ---- CMS: responsive table (cards on phones) ---- */
.cms-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.row-actions form { display: inline; }
.row-actions .btn-sm { text-decoration: none; color: var(--ink); display: inline-block; }
.vote-list-title { font-weight: 700; }
.vote-list-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; margin-top: .2rem; font-size: .85rem; }
.vote-window { font-size: .85rem; }
@media (max-width: 760px) {
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .rtable td { border: 0; padding: .25rem .8rem; }
  .rtable td[data-label]:not(:first-child)::before { content: attr(data-label); display: inline-block;
    min-width: 5.5rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
  .rtable td.num { text-align: left; }
  .rtable .row-actions { margin-top: .3rem; }
  .rtable td[data-label="Actions"]::before { display: none; }
}

/* ---- CMS: vote editor ---- */
.vote-editor { max-width: 860px; }
.ve-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .3rem 1.1rem .8rem; margin: 0 0 1rem; }
.ve-section > h2, .ve-section-head h2 { font-size: 1.15rem; margin: .7rem 0 .5rem; }
.ve-lock { background: #fef3c7; border: 1px solid #f5d27a; border-radius: 8px; padding: .45rem .7rem;
  font-size: .88rem; color: #6b4a06; }
.ve-errors { margin: .3rem 0 0; padding-left: 1.2rem; }
.field-label-text { font-weight: 600; }
.cms-form input[type=datetime-local] { width: 100%; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; font: inherit; background: #fff; }
.input-prefix { display: flex; align-items: stretch; }
/* flex: none + nowrap so the prefix keeps its full width: browsers may break a
   line after a "/", which let "/vote/" shrink and wrap onto two lines when the
   field got narrow. */
.input-prefix span { display: flex; flex: none; align-items: center; white-space: nowrap;
  padding: 0 .5rem; background: #f0f3f7;
  border: 1px solid var(--line); border-right: 0; border-radius: 6px 0 0 6px; color: var(--muted); font-size: .9rem; }
.cms-form .input-prefix input { border-radius: 0 6px 6px 0; min-width: 0; }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; margin: .3rem 0 .8rem; }
.cms-form .choice-card { display: flex; gap: .6rem; align-items: flex-start; border: 2px solid var(--line);
  border-radius: 10px; padding: .6rem .75rem; cursor: pointer; font-weight: 400; background: #fff; }
.cms-form .choice-card input { width: auto; margin-top: .3rem; accent-color: var(--blue); }
.choice-card:has(input:checked) { border-color: var(--accent); background: #f3f8ff; }
.choice-card:has(input:disabled) { cursor: not-allowed; opacity: .75; }
.choice-body { display: flex; flex-direction: column; gap: .15rem; }
.choice-body span { font-size: .86rem; color: var(--muted); }
.vote-editor:has(input[name=mode][value=internal]:checked) .only-external,
.vote-editor:has(input[name=mode][value=external]:checked) .only-internal { display: none; }

.ve-cands { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.ve-cand { display: grid; grid-template-columns: auto 96px 1fr auto; gap: .6rem; align-items: start;
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem; background: #fbfcfd; }
.ve-cand.dragging { opacity: .5; }
.ve-handle { align-self: center; }
.ve-cand-img { width: 96px; height: 96px; border: 2px dashed #c9d0d8; border-radius: 8px; background: #fff;
  padding: 0; cursor: pointer; overflow: hidden; display: grid; place-items: center; }
.ve-cand-img:hover { border-color: var(--accent); }
.ve-cand-img img { width: 100%; height: 100%; object-fit: cover; }
.ve-cand-img img[hidden], .ve-cand-noimg[hidden] { display: none; }
.ve-cand-noimg { font-size: .8rem; font-weight: 700; color: var(--accent); }
.ve-cand-fields { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.cms-form .ve-cand-fields input, .cms-form .ve-cand-fields textarea { padding: .35rem .5rem; }
.cms-form .ve-cand-fields .ve-name { font-weight: 700; }
.ve-cand-tools { flex-direction: column; margin-left: 0; }
.ve-add-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.ve-add-row .btn-sm, .ve-bulk-lbl { cursor: pointer; font-size: .85rem; padding: .35rem .8rem; }
.cms-form .ve-bulk-lbl { font-weight: 600; display: inline-block; }
.ve-bulk-status { font-size: .85rem; }
.ve-actions { position: sticky; bottom: calc(var(--player-h) + .5rem); z-index: 5; background: rgba(255,255,255,.96);
  border: 1px solid var(--line); border-radius: 12px; padding: .5rem .7rem; box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.ve-danger { border-color: #f3bcbc; max-width: 860px; margin-top: 2rem; }
.ve-danger-row { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .5rem 0; }
.ve-danger-row .btn-sm[disabled] { opacity: .5; cursor: not-allowed; }
.ve-info-preview-wrap { margin-bottom: .4rem; }
.ve-info-preview { padding: .2rem .9rem; background: var(--bg); min-height: 3rem; }
.ve-info-preview .vote-info { max-width: none; }
.ve-info-empty { margin: .8rem 0; font-size: .88rem; }
.tone-picks { display: flex; flex-wrap: wrap; gap: .4rem; }
.cms-form .tone-pick { display: inline-flex; align-items: center; gap: .4rem; border: 2px solid var(--line);
  border-radius: 999px; padding: .3rem .8rem .3rem .45rem; cursor: pointer; font-weight: 600; font-size: .9rem; background: #fff; }
.cms-form .tone-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tone-pick span::before { content: ""; display: inline-block; width: .85rem; height: .85rem; border-radius: 50%;
  margin-right: .35rem; vertical-align: -.1rem; }
.tone-info span::before { background: var(--accent); }
.tone-highlight span::before { background: var(--orange); }
.tone-important span::before { background: #c62828; }
.tone-pick:has(input:checked) { border-color: var(--ink); background: #f3f6fa; }
.tone-pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 1px; }
.vote-editor:not(.is-multi) .only-multi { display: none; }
.ve-positions { display: flex; flex-direction: column; gap: .5rem; margin: .6rem 0; }
.ve-pos { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start;
  border: 1px solid var(--line); border-radius: 10px; padding: .55rem; background: #fbfcfd; }
.ve-pos.dragging { opacity: .5; }
.ve-pos.is-empty { border-color: #f5d27a; background: #fffbeb; }
.ve-pos-fields { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.cms-form .ve-pos-fields input { padding: .35rem .5rem; }
.cms-form .ve-pos-fields .ve-pos-name { font-weight: 700; }
.ve-pos-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; }
.cms-form .ve-pos-win-lbl { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; }
.cms-form .ve-pos-win-lbl input { width: 4.5rem; }
.ve-pos-elig { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .85rem; }
.ve-pos-elig .btn-sm { cursor: pointer; }
.ve-pos.is-empty .ve-pos-elig-count { color: #92400e; font-weight: 700; }
.ve-cand-elig { border: 0; padding: 0; margin: .1rem 0 0; min-width: 0; }
.ve-cand-elig legend { font-size: .75rem; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: .15rem; }
.ve-elig-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.cms-form .ve-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line);
  border-radius: 999px; padding: .15rem .6rem .15rem .35rem; font-size: .82rem; font-weight: 600;
  background: #fff; cursor: pointer; max-width: 100%; }
.cms-form .ve-chip input { width: auto; margin: 0; accent-color: var(--blue); }
.ve-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-chip:has(input:checked) { border-color: var(--accent); background: #eef5fe; }
.ve-chip:has(input:disabled) { cursor: not-allowed; opacity: .8; }
.ve-img-modal { max-width: 46rem; }
.ve-img-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.ve-img-head h2 { margin: 0; font-size: 1.15rem; }
.ve-img-modal .gallery-browser > summary { display: none; }
.ve-img-modal .modal-actions .btn, .ve-img-modal .btn-sm { cursor: pointer; }
.ve-img-modal .modal-actions [hidden] { display: none; }
@media (max-width: 640px) {
  .ve-section { padding: .2rem .7rem .7rem; }
  .ve-cand { grid-template-columns: 72px 1fr auto; }
  .ve-handle { display: none; }
  .ve-cand-img { width: 72px; height: 72px; }
  .ve-pos { grid-template-columns: 1fr auto; }
  .ve-actions { justify-content: stretch; }
  .ve-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* ---- CMS: results ---- */
.vote-share { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .7rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.vote-share-link { display: flex; flex-direction: column; min-width: 0; flex: 1 1 18rem; }
.vote-share-link code { overflow-wrap: anywhere; font-size: .9rem; }
.vote-share-when { flex: 1 1 100%; margin: 0; font-size: .85rem; }
.vote-stats .stat { flex: 1 1 10rem; }
.vote-stats .stat-text { font-size: 1rem; }
.vote-panel { margin-top: .5rem; }
.vote-tabs { margin-bottom: 1rem; }
.vote-tabs .btn-sm { padding: .4rem 1.1rem; font-size: .9rem; }
.vote-tabs a.btn-sm { color: var(--ink); }
.vote-tabs a.btn-sm.is-active { color: #fff; }
.vote-tabs a:hover { text-decoration: none; }

/* chart roles (validated: runoff pair and 1-5 ramp, light surface #fff) */
.viz {
  --viz-surface: #ffffff;
  --viz-accent: #2a78d6;      /* emphasis / runoff side A */
  --viz-b: #eb6834;           /* runoff side B */
  --viz-neutral: #dcdfe3;     /* no preference, 0 stars */
  --viz-context: #b8bec6;     /* de-emphasised bars */
  --viz-d1: #86b6ef; --viz-d2: #5598e7; --viz-d3: #2a78d6; --viz-d4: #1c5cab; --viz-d5: #104281;
  --viz-text-2: #5b6470;
}
.viz-block { background: var(--viz-surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .8rem 1.1rem 1rem; margin: 0 0 1rem; }
.viz-title { font-size: 1.1rem; margin: 0 0 .3rem; }
.viz-title::first-letter { text-transform: uppercase; }
.viz-caption { color: var(--viz-text-2); margin: 0 0 .8rem; font-size: .92rem; max-width: 70ch; }
.viz-empty { background: var(--card); border: 1px dashed #c9d0d8; border-radius: var(--radius);
  padding: 2rem 1rem; text-align: center; display: flex; flex-direction: column; gap: .3rem; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: .3rem; }
.key-a, .key-fin { background: var(--viz-accent); }
.key-b { background: var(--viz-b); }
.key-eq, .d0 { background: var(--viz-neutral); }
.key-ctx { background: var(--viz-context); }
.d1 { background: var(--viz-d1); } .d2 { background: var(--viz-d2); } .d3 { background: var(--viz-d3); }
.d4 { background: var(--viz-d4); } .d5 { background: var(--viz-d5); }
.key-d { margin: 0 .15rem 0 .45rem; }
.tag-win { background: #e3f5e8; color: #14622e; font-weight: 700; }

.winner-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.winner-card { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: .6rem; }
.winner-img { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; flex: 0 0 84px; }
.winner-text { display: flex; flex-direction: column; min-width: 0; }
.winner-seat { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--viz-text-2); font-weight: 700; }
.winner-name { font-size: 1.2rem; line-height: 1.2; overflow-wrap: anywhere; }
.viz-thumb-none { display: grid; place-items: center; background: #e9edf2; color: #8a94a0; font-weight: 800; text-transform: uppercase; }

.runoff-ends { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.runoff-end { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.runoff-end .tag { flex: 0 0 auto; }
.runoff-end-b { justify-content: flex-end; text-align: right; }
.runoff-end .key { margin: 0; }
.runoff-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; line-height: 1.25; }
.runoff-num { font-size: 1.3rem; }
.runoff-bar { display: flex; gap: 2px; height: 24px; }
.runoff-bar .seg { min-width: 4px; }
.runoff-bar .seg:first-child { border-radius: 4px 0 0 4px; }
.runoff-bar .seg:last-child { border-radius: 0 4px 4px 0; }
.runoff-bar .seg:only-child { border-radius: 4px; }
.seg-a { background: var(--viz-accent); }
.seg-b { background: var(--viz-b); }
.seg-eq { background: var(--viz-neutral); }
.runoff-bar .seg:hover, .runoff-bar .seg:focus-visible { filter: brightness(1.12); outline: 2px solid var(--ink); outline-offset: 1px; }
.runoff-mid { text-align: center; font-size: .85rem; margin: .35rem 0 0; }
.viz-notes { margin: .8rem 0 0; padding: .5rem .8rem .5rem 1.8rem; background: #f4f6f8; border-radius: 8px; font-size: .88rem; }
.viz-notes.is-warn { background: #fef3c7; color: #6b4a06; }
.viz-note { margin: .8rem 0 0; padding: .5rem .8rem; border-radius: 8px; font-size: .88rem; }
.viz-note.is-warn { background: #fef3c7; color: #6b4a06; }
.viz-excluded { margin: .7rem 0 0; }
.viz-pos-heading { font-size: 1.3rem; margin: 1.4rem 0 .6rem; padding-bottom: .25rem;
  border-bottom: 3px solid var(--orange); }
.pos-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.pos-sum { display: flex; flex-direction: column; gap: .35rem; border: 2px solid var(--line); border-radius: 10px;
  padding: .6rem .7rem; color: var(--ink); background: #fff; }
.pos-sum:hover { text-decoration: none; border-color: var(--accent); }
.pos-sum.is-active { border-color: var(--blue); background: #f3f8ff; }
.pos-sum-name { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--blue); }
.pos-sum-winner { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.pos-sum-winner b { overflow-wrap: anywhere; }
.pos-sum-img { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 6px; object-fit: cover; }
.pos-sum-meta { font-size: .8rem; margin-top: auto; }

.viz-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--viz-text-2); margin-bottom: .6rem; }
.score-list { list-style: none; margin: 0; padding: 0; }
.score-row { display: grid; grid-template-columns: 2rem 48px 1fr 3.6rem; gap: .7rem; align-items: center;
  padding: .55rem 0; border-top: 1px solid var(--line); }
.score-rank { text-align: right; color: var(--viz-text-2); font-variant-numeric: tabular-nums; font-weight: 700; }
.viz-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.score-main { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.score-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.score-name b { overflow-wrap: anywhere; }
.score-track { display: flex; align-items: center; gap: .45rem; min-height: 12px; }
.score-bar { display: block; height: 12px; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--viz-context); }
.score-row.is-finalist .score-bar { background: var(--viz-accent); }
.score-bar:hover, .score-bar:focus-visible { filter: brightness(1.1); outline: 2px solid var(--ink); outline-offset: 1px; }
.score-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.dist-bar { display: flex; gap: 2px; height: 6px; max-width: 320px; border-radius: 3px; overflow: hidden; }
.dist-bar:hover, .dist-bar:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.score-avg { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.score-avg .muted { font-size: .75rem; }
.viz-table { margin-top: .8rem; }
.viz-table summary, .viz-howto summary { cursor: pointer; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.viz-howto ol { padding-left: 1.3rem; }
.viz-howto li { margin: .35rem 0; }
.viz-tip { position: fixed; z-index: 1000; pointer-events: none; background: #16181d; color: #d8dde3;
  border-radius: 8px; padding: .4rem .6rem; font-size: .8rem; max-width: 18rem; box-shadow: 0 4px 16px rgba(0,0,0,.25); white-space: pre-wrap; }
.viz-tip[hidden] { display: none; }
.viz-tip-value { color: #fff; font-weight: 800; font-size: .95rem; }
@media (max-width: 640px) {
  .viz-block { padding: .7rem .75rem .8rem; }
  .score-row { grid-template-columns: 1.4rem 40px 1fr 3rem; gap: .5rem; }
  .viz-thumb { width: 40px; height: 40px; }
  .winner-img { width: 64px; height: 64px; flex-basis: 64px; }
  .runoff-num { font-size: 1.1rem; }
}

/* ballots */
.ballot-ip-input { padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; font: inherit; width: 11rem; }
.ballot-tools .btn-sm { text-decoration: none; color: var(--ink); }
.ballot-export { margin-left: auto; }
.ballot-count { font-size: .88rem; }
.ballot-list { display: flex; flex-direction: column; gap: .6rem; }
.ballot { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; }
.ballot.is-void { background: #f7f7f8; border-style: dashed; }
.ballot.is-void .ballot-scores, .ballot.is-void .ballot-answers { opacity: .55; }
.ballot-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; }
.ballot-id { font-weight: 800; color: var(--viz-text-2, var(--muted)); font-variant-numeric: tabular-nums; }
.ballot-time { font-size: .85rem; }
.ballot-void { margin-left: auto; }
.chip-flag { background: #fef3c7; color: #92400e; cursor: help; }
.ballot-bulk { margin: 0 0 .6rem; }
.ballot-ip-group { margin: .5rem 0 -.2rem; font-size: .92rem; font-weight: 800; overflow-wrap: anywhere; }
.ballot-ip-group:first-child { margin-top: 0; }
.ballot-ip-group .muted { font-weight: 400; font-size: .84rem; margin-left: .4rem; }
.vote-stats .stat-warn b { color: #92400e; }
.ballot-net { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .9rem; font-size: .84rem; margin: .3rem 0; }
.ballot-net .muted { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
a.badge-auto:hover { text-decoration: none; filter: brightness(.96); }
.ballot-answers { margin: .4rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .2rem .9rem; font-size: .88rem; }
.ballot-answers div { display: flex; flex-direction: column; }
.ballot-answers dt { font-weight: 700; font-size: .78rem; color: var(--muted); }
.ballot-answers dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.ballot-scores { list-style: none; padding: 0; margin: .45rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem .45rem; }
.ballot-scores li { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line);
  border-radius: 999px; padding: .1rem .55rem .1rem .15rem; font-size: .84rem; max-width: 100%; }
.bs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
.bs-val { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; border-radius: 999px;
  font-weight: 800; font-size: .8rem; font-variant-numeric: tabular-nums; }
.bs-val.s0 { background: #dcdfe3; color: #5b6470; }
.bs-val.s1 { background: #86b6ef; color: #0b1b33; }
.bs-val.s2 { background: #5598e7; color: #0b1b33; }
.bs-val.s3 { background: #2a78d6; color: #fff; }
.bs-val.s4 { background: #1c5cab; color: #fff; }
.bs-val.s5 { background: #104281; color: #fff; }
.ballot-group + .ballot-group { margin-top: .35rem; }
.ballot-group-name { margin: .45rem 0 0; font-size: .74rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .04em; color: var(--blue); }
.ballot-group-name + .ballot-scores { margin-top: .2rem; }
.ballot-group.is-skipped .ballot-scores { opacity: .55; }
.ballot-ua-full { margin-top: .4rem; font-size: .8rem; }
.ballot-ua-full summary { cursor: pointer; color: var(--muted); }
.ballot-ua-full code { overflow-wrap: anywhere; }
.ballot-pager { display: flex; justify-content: center; align-items: center; gap: .6rem; margin: 1rem 0; }
.ballot-pager .btn-sm { color: var(--ink); text-decoration: none; }
@media (max-width: 640px) {
  .ballot-export { margin-left: 0; }
  .ballot-ip-input { width: 100%; }
  .ballot-void { margin-left: 0; }
  .bs-name { max-width: 60vw; }
}

/* ---- Slack: form builder box + test-post buttons ---- */
.slack-box { border: 1px solid var(--line); border-radius: 8px; padding: .3rem 1rem 1rem;
  margin: 1.2rem 0 1rem; background: #fbfcfd; }
.slack-box legend { font-weight: 700; padding: 0 .4rem; }
.slack-off { margin: .3rem 0 .6rem; }
.slack-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .4rem 1.5rem; margin: .4rem 0 .8rem; }
.slack-pick-h { font-weight: 700; margin: 0 0 .35rem; }
.slack-pick .check { display: flex; font-weight: 400; margin-bottom: .25rem; }
.slack-test { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; margin-top: .6rem; }
.slack-test .field-note { flex-basis: 100%; margin: 0; }
.slack-test-result { font-size: .9rem; display: inline-flex; flex-direction: column; gap: .15rem; }
.slack-ok { color: #14622e; font-weight: 600; }
.slack-bad { color: #8a1f1f; font-weight: 600; overflow-wrap: anywhere; }
/* Settings > Slack webhook list */
.slack-hooks { margin-top: 1.2rem; }
.slack-hooks-h { margin: 0 0 .2rem; }
.hook-row { display: grid; grid-template-columns: auto minmax(10rem, 1fr) minmax(14rem, 2fr);
  gap: .2rem 1rem; align-items: end; border: 1px solid var(--line); border-radius: 8px;
  padding: .7rem 1rem .5rem; margin: .6rem 0; background: #fbfcfd; }
.hook-row .field { margin-bottom: .3rem; min-width: 0; }
.cms-form .hook-default { display: flex; align-items: center; gap: .3rem; font-weight: 400;
  margin-bottom: .75rem; font-size: .9rem; }
.hook-default input { width: auto; }
.hook-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; }
.hook-tools .hook-del, .hook-tools .hook-drop { margin-left: auto; }
.cms-form .hook-del { font-weight: 400; }
.hook-used { grid-column: 1 / -1; margin: .2rem 0 0; }
/* Security > Single sign-on rows reuse .hook-row; the secret gets a full line */
.sso-row .sso-secret, .sso-row .sso-inbound { grid-column: 1 / -1; }
.sso-secret-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.sso-secret-line input { flex: 1 1 18rem; min-width: 0; font-family: ui-monospace, monospace; }
@media (max-width: 700px) {
  .hook-row { grid-template-columns: 1fr; }
  .cms-form .hook-default { margin-bottom: 0; }
}

/* Settings > Email test row; My Profile > Personal email */
.email-test { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-top: 1rem; }
.email-test .field { flex: 1 1 240px; margin: 0; }
.email-test-result { flex: 1 1 100%; overflow-wrap: anywhere; }
.pe-box { max-width: 520px; margin-bottom: 1.5rem; }
.pe-current { overflow-wrap: anywhere; }
.pe-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
