/* ==========================================================================
   放送手帖 · Airing Notebook — "Signal Bloom"
   One continuous board of frosted panels on a slowly breathing pink–violet
   aurora. Shape language: soft rounded rectangles, pills, hairlines and a
   broadcast waveform. Motion is a single calm entrance + slow ambient drift.
   ========================================================================== */

:root {
  --bg: #f6f0f5;
  --bg-2: #eee5f0;
  --surface: #fffbfd;
  --glass: rgba(255, 252, 254, .68);
  --glass-2: rgba(255, 255, 255, .5);
  --ink: #221329;
  --ink-2: #57475f;
  --ink-3: #8b7b94;
  --ink-4: #c4b7cb;
  --line: rgba(52, 20, 70, .08);
  --line-2: rgba(52, 20, 70, .15);
  --night: #1c0f24;
  --night-2: #2c1638;
  --pink: #d93f7c;
  --rose: #ff8fbd;
  --blush: #fde7f0;
  --violet: #6f4fdc;
  --lilac: #b9a2ff;
  --lav: #efe9ff;
  --ok: #24785c;
  --warn: #a8660b;
  --bad: #cf3462;
  --iris: linear-gradient(100deg, #ff7fb2 0%, #c78bff 56%, #7d5cf2 100%);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "Hiragino Mincho ProN", "Yu Mincho", "SimSun", Georgia, serif;
  --sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Yu Gothic UI", sans-serif;

  --r: 22px;
  --r-sm: 14px;
  --gap: 14px;
  --pad: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 1px rgba(52, 20, 70, .055), 0 22px 44px -32px rgba(70, 22, 104, .34);
  --wrap: 1240px;
  --gut: clamp(12px, 3vw, 32px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 14px/1.55 var(--sans);
  background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "palt" 1;
  overflow-x: hidden;
}
/* fine grain over everything */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .45; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .25  0 0 0 0 .1  0 0 0 0 .35  0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
main, .foot, .topbar { position: relative; z-index: 1; }

/* ambient aurora: three soft blooms drifting very slowly */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -10vw; top: -14vw; background: radial-gradient(circle, #ffc2dc 0%, transparent 68%); animation: drift1 34s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 42vw; height: 42vw; right: -8vw; top: -6vw; background: radial-gradient(circle, #d9c6ff 0%, transparent 68%); animation: drift2 40s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 50vw; height: 50vw; left: 30vw; top: 46vh; background: radial-gradient(circle, #f6cdf0 0%, transparent 66%); opacity: .4; animation: drift3 46s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(8vw, 6vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-6vw, 10vh) scale(.94); } }
@keyframes drift3 { to { transform: translate(-12vw, -8vh) scale(1.1); } }

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 8px; }
::selection { background: #f5c6da; color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
.noscript { text-align: center; padding: 40px; }
[hidden] { display: none !important; }
.eyebrow { font-size: 10px; line-height: 1.4; letter-spacing: .2em; text-transform: uppercase; font-weight: 650; color: var(--ink-3); }
html[lang="zh-CN"] .eyebrow, html[lang="ja-JP"] .eyebrow { letter-spacing: .14em; }
.is-muted { color: var(--ink-3) !important; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --bh: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--bh); padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 13.5px; letter-spacing: .01em; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn svg { font-size: 16px; }
.btn-sm { --bh: 34px; padding: 0 14px; font-size: 13px; }
.btn-xs { --bh: 30px; padding: 0 12px; font-size: 12px; }
.btn-primary { color: #fff; background: var(--ink); border-color: var(--ink); }
.btn-primary:hover:not(:disabled) { background: #34183f; transform: translateY(-1px); box-shadow: 0 12px 24px -14px rgba(223, 69, 128, .8); }
.btn-primary:disabled { opacity: .5; }
.btn-light { color: var(--ink); background: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(255, 255, 255, .6); }
.btn-soft { background: var(--blush); color: #ad2560; }
.btn-soft:hover { background: #f9d3e2; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #b5254f; }
.btn-danger-ghost { background: transparent; color: var(--bad); border-color: rgba(207, 52, 98, .28); }
.btn-danger-ghost:hover { background: rgba(207, 52, 98, .06); }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { color: var(--pink); border-color: var(--pink); background: #fff; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; overflow: hidden; }
.stepper button { width: 36px; height: 30px; border: 0; background: transparent; font-size: 17px; line-height: 1; color: var(--ink); transition: background .15s, color .15s; }
.stepper button + button { border-left: 1px solid var(--line-2); }
.stepper button:hover:not(:disabled) { background: var(--blush); color: var(--pink); }
.stepper button:disabled { color: var(--ink-4); }

/* ------------------------------------------------------------------ top bar */
.topbar { position: sticky; top: 0; z-index: 20; transition: background .3s, box-shadow .3s; }
.topbar.is-scrolled { background: rgba(245, 239, 243, .8); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); box-shadow: 0 1px 0 var(--line); }
.topbar-in { max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gut); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { position: relative; width: 28px; height: 28px; border-radius: 50%; flex: none; margin: 0 4px;
  background: radial-gradient(circle at 34% 28%, #ffd0e2 0, #ff7fb2 30%, #a774f5 62%, #5a39c9 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.brand-mark i { position: absolute; left: -7px; right: -7px; top: 50%; height: 11px; margin-top: -5.5px; border: 1.2px solid var(--ink); border-radius: 50%; transform: rotate(-20deg);
  -webkit-mask-image: linear-gradient(180deg, transparent 44%, #000 45%); mask-image: linear-gradient(180deg, transparent 44%, #000 45%); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--serif); font-weight: 500; font-size: 17px; letter-spacing: .08em; }
html[lang="en-US"] .brand-text b { letter-spacing: 0; }
.brand-text i { font-style: normal; font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); margin-top: 1px; }
.topnav { display: flex; gap: 4px; }
.topnav a { position: relative; text-decoration: none; font-size: 13px; color: var(--ink-2); padding: 6px 10px; }
.topnav a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.topnav a:hover { color: var(--ink); }
.topnav a:hover::after { transform: none; }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.lang { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.lang button { border: 0; background: transparent; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--ink-3); transition: background .2s, color .2s; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.lang button:hover:not([aria-pressed="true"]) { color: var(--ink); }

#authBtn .admin-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 3px rgba(223, 69, 128, .18); }
#authBtn .sep { color: var(--ink-4); }
#authBtn svg { font-size: 15px; }
.is-admin #authBtn { border-color: rgba(223, 69, 128, .45); }

.home-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; color: var(--ink-2); padding: 0 2px; }
.home-link svg { font-size: 17px; }
.home-link:hover { color: var(--pink); }

.sync { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .7); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.sync:disabled { cursor: default; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4); flex: none; }
[data-state="saved"] .sync-dot, [data-state="ready"] .sync-dot { background: var(--ok); }
[data-state="saving"] .sync-dot, [data-state="loading"] .sync-dot, [data-state="unsaved"] .sync-dot { background: var(--violet); animation: pulse 1s infinite ease-in-out; }
.sync[data-state="error"], .sync[data-state="loadError"] { color: var(--bad); border-color: rgba(207, 52, 98, .4); background: #fff3f6; }
[data-state="error"] .sync-dot, [data-state="loadError"] .sync-dot { background: var(--bad); }
.sync[data-state="expired"], .sync[data-state="invalid"] { color: var(--warn); border-color: rgba(168, 102, 11, .4); background: #fff8ec; }
[data-state="expired"] .sync-dot, [data-state="invalid"] .sync-dot, [data-state="draft"] .sync-dot { background: var(--warn); }
.sync[data-state="conflict"] { color: #fff; border-color: var(--bad); background: var(--bad); }
.sync[data-state="conflict"] .sync-dot { background: #fff; }
.sync:not(:disabled):hover { filter: brightness(.97); }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
@keyframes shimmer { to { background-position: -200% 0; } }
/* ------------------------------------------------------------ top bar tune */
.topbar-in { padding: 10px var(--gut); gap: 22px; }
.topbar.is-scrolled { background: rgba(246, 240, 245, .74); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; margin: 0; border-radius: 10px; color: #fff; font-size: 22px;
  background: linear-gradient(140deg, #ff8fbd 0%, #c78bff 55%, #6f4fdc 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 8px 18px -10px rgba(111, 79, 220, .8); }
.brand-mark svg { stroke-width: 2.4; }
.lang { background: rgba(255, 255, 255, .55); }

/* -------------------------------------------------------------------- board */
.board {
  max-width: var(--wrap); margin: 0 auto; padding: 4px var(--gut) 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap);
}
.panel {
  position: relative; grid-column: 1 / -1; min-width: 0;
  padding: var(--pad) calc(var(--pad) + 2px);
  border-radius: var(--r);
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.35); backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: var(--shadow);
  animation: rise .9s var(--ease-out) both; animation-delay: calc(var(--d, 0) * 70ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* panel heading: one compact line - index, title, note, count */
.ph { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; margin: -2px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ph-no { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--pink); background: var(--blush); padding: 2px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.ph h2 { margin: 0; font: 500 19px/1.25 var(--serif); letter-spacing: .02em; }
html[lang="en-US"] .ph h2 { letter-spacing: 0; }
.ph p { margin: 0; font-size: 12px; color: var(--ink-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-aside { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 2px 10px; border-radius: 999px; background: var(--glass-2); box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
.ph-aside:empty { display: none; }

/* -------------------------------------------------------------------- intro */
.p-intro { grid-column: span 8; overflow: hidden; isolation: isolate; padding: 22px 26px 24px;
  background: radial-gradient(90% 130% at 100% 0%, rgba(255, 196, 223, .42), transparent 58%), var(--glass); }
.intro { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.hero-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.date-chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px 0 3px; border-radius: 999px; background: rgba(255, 255, 255, .75); box-shadow: 0 0 0 1px var(--line); font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.date-chip b { background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 10.5px; font-weight: 650; letter-spacing: .04em; }
.date-chip span { font-weight: 650; color: var(--ink); }
.date-chip i { font-style: normal; color: var(--ink-3); padding-left: 7px; border-left: 1px solid var(--line-2); }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .22em; color: var(--ink-3); text-transform: uppercase; }
.hero-kicker::before { content: ""; width: 18px; height: 1px; background: var(--ink-4); }
.hero-line { margin: 14px 0 6px; font: 400 clamp(26px, 2.9vw, 38px)/1.16 var(--serif); letter-spacing: -.005em; max-width: 17em; text-wrap: balance; }
.hero-line em { font-style: normal; font-weight: 500; background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .04em; }
.hero-sub { margin: 0; color: var(--ink-2); font-size: 13px; max-width: 38em; }
.hero-foot { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; }
.stats { margin: 0; display: flex; }
.stats div { padding: 0 20px; border-left: 1px solid var(--line-2); }
.stats div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.stats dd { margin: 2px 0 0; font: 400 30px/1.05 var(--serif); font-variant-numeric: tabular-nums; }
.stats .is-accent dd { background: var(--iris); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lineup { flex: 1 1 260px; min-width: 0; display: grid; gap: 6px; }
.lineup ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lineup li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 10px; background: rgba(255, 255, 255, .66); box-shadow: 0 0 0 1px var(--line); font-size: 12.5px; }
.lineup li.is-past { opacity: .55; }
.lineup time { font-weight: 700; font-variant-numeric: tabular-nums; color: hsl(var(--h) 58% 46%); }
.lineup-name { border: 0; background: none; padding: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lineup-name:hover { color: var(--pink); }
.lineup-state { font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* broadcast waveform ornament */
.signal { position: absolute; z-index: 0; right: 0; bottom: 4px; width: 56%; height: 110px; pointer-events: none; opacity: .75;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); }
.sig { vector-effect: non-scaling-stroke; }
.sig-a { stroke-width: 1.5; animation: waveA 10s linear infinite; }
.sig-b { stroke-width: 1; opacity: .55; animation: waveB 16s linear infinite; }
@keyframes waveA { to { transform: translateX(-200px); } }
@keyframes waveB { to { transform: translateX(-300px); } }

/* --------------------------------------------------------------- next up */
.p-next { grid-column: span 4; overflow: hidden; isolation: isolate; padding: 18px 20px;
  background: linear-gradient(155deg, rgba(255, 226, 239, .94) 0%, rgba(242, 228, 255, .92) 55%, rgba(224, 214, 255, .94) 100%); }
.p-next::before { content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; right: -120px; top: -150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .85), transparent 65%); animation: sheen 18s ease-in-out infinite alternate; }
@keyframes sheen { to { transform: translate(-60%, 55%); } }
.nx { display: grid; gap: 12px; height: 100%; align-content: start; }
.nx-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nx-head .eyebrow { color: #8a3d73; }
.nx-in { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 650; color: #7a2d63; white-space: nowrap; }
.live { width: 6px; height: 6px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 0 rgba(217, 63, 124, .5); animation: live 2.4s ease-out infinite; }
@keyframes live { 70%, 100% { box-shadow: 0 0 0 7px rgba(217, 63, 124, 0); } }
.nx-main { display: grid; grid-template-columns: 146px minmax(0, 1fr); gap: 16px; align-items: center; }
.dial { position: relative; width: 146px; aspect-ratio: 1; }
.dial-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.dial-svg text, .dial-in, .dial-now, .dial-halo { stroke: none; }
.dial-in { fill: rgba(255, 255, 255, .72); }
.dial-track { fill: none; stroke: rgba(52, 20, 70, .1); stroke-width: 1.2; }
.dial-ticks line { stroke: rgba(52, 20, 70, .16); stroke-width: 1; }
.dial-ticks line.mj { stroke: rgba(52, 20, 70, .38); stroke-width: 1.4; }
.dial-arc { fill: none; stroke: url(#dialG); stroke-width: 3.6; stroke-linecap: round; }
.dial-days text { font-size: 12px; fill: var(--ink-3); text-anchor: middle; dominant-baseline: central; font-family: var(--sans); }
.dial-days text.on { fill: var(--pink); font-weight: 700; }
.dial-now { fill: var(--ink); }
.dial-halo { fill: rgba(217, 63, 124, .2); transform-box: fill-box; transform-origin: center; animation: halo 2.8s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.5); opacity: .4; } }
.dial-end { fill: #fff; stroke: var(--pink); stroke-width: 2; }
.dial-core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-time { font: 400 29px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dial-date { margin-top: 4px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.nx-cap { display: grid; gap: 4px; min-width: 0; }
.nx-ep { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--pink); }
.nx-name { border: 0; background: none; padding: 0; text-align: left; font: 400 19px/1.28 var(--serif); color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
button.nx-name:hover { color: var(--pink); }
span.nx-name { font-size: 14px; }
.nx-after { border-top: 1px solid rgba(52, 20, 70, .1); padding-top: 10px; display: grid; gap: 4px; }
.nx-after ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nx-after li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12px; }
.nx-after time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nx-after time b { color: hsl(var(--h) 50% 42%); font-weight: 650; }
.nx-after button { border: 0; background: none; padding: 0; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-after button:hover { color: var(--pink); }

/* --------------------------------------------------------------- timetable */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-col { display: flex; flex-direction: column; gap: 9px; min-width: 0; min-height: 108px; padding: 10px 10px 12px; border-radius: 16px;
  background: rgba(255, 255, 255, .48); box-shadow: 0 0 0 1px var(--line); transition: background .3s, box-shadow .3s; }
.wk-col.is-today { background: linear-gradient(180deg, rgba(255, 229, 240, .95), rgba(240, 231, 255, .85)); box-shadow: 0 0 0 1px rgba(217, 63, 124, .26), 0 14px 30px -22px rgba(217, 63, 124, .7); }
.wk-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.wk-head b { font-size: 13px; font-weight: 650; white-space: nowrap; }
.wk-head small { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.wk-head em { margin-left: auto; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; background: var(--pink); padding: 1px 7px; border-radius: 999px; white-space: nowrap; align-self: center; }
.is-before .wk-head b { color: var(--ink-3); font-weight: 600; }
.wk-body { display: grid; gap: 9px; align-content: start; min-width: 0; }
.wk-strip { position: relative; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, transparent calc(50% - .5px), rgba(52, 20, 70, .14) calc(50% - .5px), rgba(52, 20, 70, .14) calc(50% + .5px), transparent calc(50% + .5px)), rgba(52, 20, 70, .06); }
.wk-strip i { position: absolute; top: 50%; left: calc(var(--x) * 100%); width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: hsl(var(--h) 78% 62%); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
.wk-strip i.wk-pre, .wk-strip i.wk-post { background: var(--ink-4); }
.wk-now { position: absolute; top: -4px; bottom: -4px; left: calc(var(--x) * 100%); width: 2px; margin-left: -1px; border-radius: 1px; background: var(--pink); }
.wk-now::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--pink); animation: live 2.4s ease-out infinite; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 0; }
.wk-chip { position: relative; width: 100%; display: grid; gap: 1px; padding: 7px 9px 8px 11px; border: 0; border-radius: 11px; text-align: left; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 1px var(--line), 0 8px 16px -14px rgba(70, 22, 104, .6); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.wk-chip::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, hsl(var(--h) 85% 70%), hsl(calc(var(--h) - 40) 70% 64%)); }
.wk-chip:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px hsl(var(--h) 60% 70% / .55), 0 14px 22px -14px hsl(var(--h) 60% 45% / .6); }
.wk-chip time { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: hsl(var(--h) 55% 44%); }
.wk-name { font-size: 12.5px; line-height: 1.32; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-ep { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-pre .wk-chip, .wk-post .wk-chip { background: rgba(255, 255, 255, .5); box-shadow: inset 0 0 0 1px var(--line-2); }
.wk-pre .wk-chip::before, .wk-post .wk-chip::before { background: var(--ink-4); }
.wk-pre .wk-name, .wk-post .wk-name { color: var(--ink-2); }
.wk-item.is-past .wk-chip { opacity: .66; }
.wk-off { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-4); letter-spacing: .12em; white-space: nowrap; }
.wk-off::before { content: ""; width: 12px; height: 1px; background: currentColor; }
.unsched { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.unsched .eyebrow { margin-right: 4px; }
.unsched button { border: 0; padding: 4px 11px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px var(--line-2); }
.unsched button:hover { color: var(--pink); }
.empty { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ------------------------------------------------------------------ toolbar */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; min-width: 0; }
.search svg { font-size: 16px; color: var(--ink-3); transition: color .2s; }
.search input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; outline: 0; font-size: 13.5px; }
.search input::placeholder { color: var(--ink-3); }
.search:focus-within svg { color: var(--violet); }
.select select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 34px 0 14px; border-radius: 999px; border: 0; box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; color: var(--ink-2);
  background: rgba(255, 255, 255, .75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23221329' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; }
.select select:hover { box-shadow: inset 0 0 0 1px var(--line-2); }

/* ------------------------------------------------------------ airing cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 10px; }
.show { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "cover id next" "prog prog prog"; gap: 12px 14px; align-items: center;
  padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .74); box-shadow: 0 0 0 1px var(--line), 0 10px 24px -20px rgba(70, 22, 104, .5);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s; }
.show:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 0 0 1px hsl(var(--h) 60% 75% / .6), 0 18px 32px -22px hsl(var(--h) 55% 40% / .55); }
.cover { grid-area: cover; width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; font: 22px/1 var(--serif);
  background: linear-gradient(145deg, hsl(var(--h) 92% 80%), hsl(calc(var(--h) - 34) 76% 64%)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 10px 20px -12px hsl(var(--h) 70% 45% / .9); }
.show-id { grid-area: id; min-width: 0; display: grid; gap: 2px; }
.slot { display: flex; gap: 7px; font-size: 11px; align-items: baseline; }
.slot b { color: var(--pink); font-weight: 700; }
.slot span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.show-title { margin: 0; font: 500 17px/1.3 var(--serif); overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 0 12px; font-size: 11.5px; color: var(--ink-3); }
.facts span + span { position: relative; }
.facts span + span::before { content: ""; position: absolute; left: -7px; top: 50%; width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }
.show-next { grid-area: next; display: grid; gap: 1px; justify-items: end; text-align: right; }
.show-when { font: 400 20px/1.1 var(--serif); font-variant-numeric: tabular-nums; white-space: nowrap; }
.show-when i { font-style: normal; color: var(--violet); margin-left: 6px; }
.show-in { font-size: 11px; color: var(--ink-3); }
.show-prog { grid-area: prog; display: flex; align-items: center; gap: 12px; padding-top: 11px; border-top: 1px dashed var(--line-2); min-width: 0; }
.show-prog .big { flex: none; font: 400 22px/1 var(--serif); font-variant-numeric: tabular-nums; }
.show-prog .of { font: 12px var(--sans); color: var(--ink-3); margin-left: 4px; }
.show-prog .ticks, .show-prog .pbar { flex: 1; min-width: 60px; }
.show-ctrl, .card-ctrl { display: flex; align-items: center; gap: 4px; flex: none; }
.card-ctrl .stepper button { width: 26px; height: 24px; padding: 0; font-size: 14px; }
.show-ctrl .icon-btn, .shelf-side .icon-btn { width: 26px; height: 26px; font-size: 13px; }
.show-ctrl .btn-xs { --bh: 26px; padding-inline: 9px; font-size: 11px; }
.show.is-done { opacity: .82; }
.show.is-skel, .shelf-item.is-skel { min-height: 104px; box-shadow: 0 0 0 1px var(--line); background: linear-gradient(90deg, rgba(255,255,255,.5) 25%, rgba(255,255,255,.9) 50%, rgba(255,255,255,.5) 75%) 0 0 / 200% 100%; animation: shimmer 1.6s linear infinite; }
.shelf-item.is-skel { min-height: 70px; }
.skel-line { display: block; height: 34px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.4) 25%, rgba(255,255,255,.9) 50%, rgba(255,255,255,.4) 75%) 0 0 / 200% 100%; animation: shimmer 1.6s linear infinite; }

/* -------------------------------------------------------------- backlog */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.shelf-item { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px 14px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px var(--line); transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .3s; }
.shelf-item:hover { transform: translateY(-1px); background: #fff; box-shadow: 0 0 0 1px hsl(var(--h) 60% 78% / .6), 0 14px 26px -20px hsl(var(--h) 55% 40% / .5); }
.disc { position: relative; width: 42px; height: 42px; }
.disc svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.disc-track { fill: rgba(255, 255, 255, .8); stroke: rgba(52, 20, 70, .08); stroke-width: 4.5; }
.disc-fill { fill: none; stroke: hsl(var(--h) 76% 63%); stroke-width: 4.5; stroke-linecap: round; }
.disc span { position: absolute; inset: 0; display: grid; place-items: center; font: 15px/1 var(--serif); color: hsl(var(--h) 45% 40%); }
.shelf-main { min-width: 0; display: grid; gap: 4px; }
.shelf-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.shelf-title { margin: 0; min-width: 0; font: 500 14.5px/1.3 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-details { display: flex; align-items: center; gap: 8px; min-width: 0; }
.shelf-meta { display: flex; flex: 1; min-width: 0; flex-wrap: wrap; gap: 0 9px; font-size: 11px; color: var(--ink-3); overflow-wrap: anywhere; }
.shelf-meta b { color: var(--ink-2); font-weight: 600; }
.shelf .tk, .shelf .pbar { height: 5px; }
.shelf-main .ticks, .shelf-main .pbar { margin-top: 3px; }
.shelf-side { display: flex; align-items: center; gap: 4px; flex: none; }
.shelf-item .badge { height: 20px; padding: 0 8px; font-size: 10.5px; }

/* The title viewport keeps its measured size while the full text moves inside it. */
.scroll-title.is-scrolling {
  display: flex; align-items: center; width: var(--title-width); max-width: 100%;
  height: var(--title-height); min-width: 0; overflow: hidden; text-overflow: clip;
  white-space: nowrap; overflow-wrap: normal; -webkit-line-clamp: unset;
}
.scroll-title.is-scrolling .title-text { display: block; flex: none; width: max-content; white-space: nowrap; }

.empty-card { grid-column: 1 / -1; padding: 22px; text-align: center; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--ink-3); background: rgba(255, 255, 255, .35); }
.empty-orbit { display: inline-block; width: 30px; height: 4px; border-radius: 2px; background: var(--iris); }
.empty-card p { margin: 8px 0 0; font-size: 13px; }
.empty-card small { color: var(--ink-4); }

.flash { animation: flash 1.6s var(--ease) !important; }
@keyframes flash { 0%, 55% { box-shadow: 0 0 0 3px rgba(217, 63, 124, .45), 0 18px 32px -22px rgba(217, 63, 124, .6); background: #fff; } }
@keyframes shimmer { to { background-position: -200% 0; } }
/* progress ticks: one continuous iris thread across segments */
.ticks { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
.ticks-dense { gap: 2px; }
.tk { position: relative; display: block; height: 7px; border-radius: 2px; border: 0; padding: 0; background: rgba(40, 16, 56, .07); transition: transform .15s var(--ease), background .2s; }
.tk:first-child { border-radius: 4px 2px 2px 4px; }
.tk:last-child { border-radius: 2px 4px 4px 2px; }
.tk-a { background: hsl(var(--h) 90% 86%); }
.tk-w { background: var(--iris); background-size: calc(var(--n) * 100%) 100%; background-position: calc(var(--i) * 100% / max(1, var(--n) - 1)) 0; }
.ticks-open { -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent); mask-image: linear-gradient(90deg, #000 72%, transparent); }
button.tk::after { content: ""; position: absolute; inset: -8px -1px; }
button.tk:hover { transform: scaleY(1.7); }
.pbar { position: relative; height: 7px; border-radius: 4px; background: rgba(40, 16, 56, .07); overflow: hidden; }
.pbar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.pbar-a { background: hsl(var(--h) 90% 86%); }
.pbar-w { background: var(--iris); }
.pbar-open { -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent); mask-image: linear-gradient(90deg, #000 72%, transparent); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 650; white-space: nowrap; letter-spacing: .02em; flex: none; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-hot { color: #bd2763; background: #fde5ee; }
.badge-ok { color: var(--ok); background: #e3f3ec; }
.badge-soft { color: #5b3fc4; background: var(--lav); }
.badge-done { color: #fff; background: var(--ink); }
/* ------------------------------------------------------------------ dialogs */
.dlg { border: 1px solid var(--line); padding: 0; border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: 0 50px 100px -40px rgba(30, 8, 46, .6); width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; }
.dlg-sm { width: min(440px, calc(100vw - 24px)); }
html:has(dialog[open]) { overflow: hidden; overscroll-behavior: none; }
.dlg::backdrop { background: rgba(24, 10, 34, .48); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dlg[open] { animation: dlgIn .34s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.dlg-body { padding: 32px 30px 26px; display: grid; gap: 16px; position: relative; isolation: isolate; }
.dlg-body::before { content: ""; position: absolute; z-index: -1; top: 0; right: 0; width: min(320px, 100%); height: 180px; border-radius: inherit; background: radial-gradient(ellipse at top right, rgba(199, 139, 255, .2), transparent 65%); pointer-events: none; }
.dlg h3 { margin: -4px 0 0; font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; letter-spacing: -.01em; }
.dlg-kicker { display: flex; align-items: center; gap: 10px; font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--pink); font-weight: 700; }
.dlg-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.dlg-kicker-danger { color: var(--bad); }
.dlg-kicker-warn { color: var(--warn); }
.dlg-note { margin: 0; color: var(--ink-2); font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.dlg-actions-split .autosave-hint { margin-right: auto; font-size: 12px; color: var(--ink-3); }
.dlg-actions-split #delBtn { order: -1; }
.dlg-actions-stack { justify-content: stretch; }
.dlg-actions-stack .btn { flex: 1 1 auto; }
.conflict-steps { margin: 0; padding: 14px 16px 14px 34px; border-radius: 16px; background: #fff7ec; color: #6b4a1a; font-size: 13.5px; display: grid; gap: 6px; }

.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field > span:first-child { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.field input, .field select {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; outline: 0;
  transition: border-color .2s, box-shadow .2s; font-variant-numeric: tabular-nums;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e1024' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center / 13px; }
.field input:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(113, 80, 222, .12); }
.field:has(.form-err:not(:empty)) input, .field:has(.form-err:not(:empty)) select { border-color: rgba(207, 52, 98, .6); }
.field-name input { height: 54px; font-family: var(--serif); font-size: 20px; }
.form-err { color: var(--bad); font-size: 12px; margin: 0; }
.form-err:empty { display: none; }
.field-hint { font-size: 11.5px; color: var(--ink-3); }
.with-clear { display: flex; gap: 6px; }
.with-clear input { flex: 1; min-width: 0; }
.mini { flex: none; height: 46px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); font-size: 12px; color: var(--ink-2); }
.mini:hover { color: var(--pink); border-color: rgba(223, 69, 128, .4); }

.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); width: max-content; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-3); transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--violet); }

.edit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.edit-head > div:first-child { display: grid; gap: 12px; min-width: 0; }
.edit-sync { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); padding: 4px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); max-width: 52%; line-height: 1.35; }
.edit-sync[data-state="error"], .edit-sync[data-state="conflict"] { color: var(--bad); }
.edit-sync[data-state="expired"], .edit-sync[data-state="invalid"], .edit-sync[data-state="draft"] { color: var(--warn); border-color: rgba(168, 102, 11, .3); background: #fffaf0; }
.edit-grid { border: 1px solid var(--line); border-radius: 20px; margin: 0; padding: 14px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; background: rgba(245, 239, 243, .55); }
.edit-grid:not(.edit-grid-2) > .field:first-of-type { grid-column: 1 / -1; }
.edit-grid-2 { grid-template-columns: 1fr 1fr; }
.edit-grid .field-wide { grid-column: 1 / -1; }
.edit-grid legend { padding: 0 8px; margin-left: -8px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; display: flex; gap: 10px; align-items: baseline; }
.edit-grid legend small { font-size: 11px; letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--pink); }
.dlg-edit[data-status="completed"] .edit-grid legend small { color: var(--ink-3); }
.stepper-lg { width: 100%; height: 46px; border-radius: 14px; }
.stepper-lg button { width: 46px; height: 100%; }
.stepper-lg input { flex: 1; min-width: 0; height: 100%; border: 0 !important; border-left: 1px solid var(--line-2) !important; border-right: 1px solid var(--line-2) !important; border-radius: 0 !important; text-align: center; font-family: var(--serif); font-size: 20px; box-shadow: none !important; -moz-appearance: textfield; }
.stepper-lg input::-webkit-inner-spin-button, .stepper-lg input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.edit-preview { margin: 0; padding: 12px 16px 12px 38px; border-radius: 14px; background: var(--lav); font-size: 13px; color: #3e2885; position: relative; }
.edit-preview::before { content: ""; position: absolute; left: 16px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--iris); }

/* Keep the editor compact enough to fit without a scrollable dialog. */
.dlg-edit { width: min(680px, calc(100vw - 24px)); max-width: calc(100vw - 24px); overflow: clip; overscroll-behavior: none; }
.dlg-edit .dlg-body { padding: 20px 22px; gap: 12px; }
.dlg-edit .edit-head { align-items: center; }
.dlg-edit .edit-head > div:first-child { gap: 5px; flex: 1; }
.dlg-edit h3 { margin: 0; font-size: 24px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-edit .edit-sync { flex-shrink: 0; overflow-wrap: anywhere; }
.dlg-edit .field { gap: 4px; }
.dlg-edit .field input, .dlg-edit .field select, .dlg-edit .mini, .dlg-edit .stepper-lg { height: 40px; border-radius: 11px; }
.dlg-edit .field-name input { font-size: 18px; }
.dlg-edit .mini { padding-inline: 10px; }
.dlg-edit .stepper-lg button { width: 34px; }
.dlg-edit .field-status { display: flex; align-items: center; gap: 12px; }
.dlg-edit .seg { max-width: 100%; padding: 3px; }
.dlg-edit .seg span { padding: 6px 14px; }
.dlg-edit .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 12px 12px; gap: 9px; border-radius: 16px; }
.dlg-edit .edit-grid legend { letter-spacing: .06em; gap: 6px; }
.dlg-edit .edit-grid legend small { font-size: 10px; }
.dlg-edit .edit-preview { padding: 9px 12px 9px 30px; font-size: 12px; line-height: 1.4; }
.dlg-edit .edit-preview::before { left: 12px; }
.dlg-edit .dlg-actions { margin: 0; gap: 8px; }

@media (min-width: 640px) {
  .dlg-edit .dlg-body { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dlg-edit :is(.edit-head, .edit-preview, .dlg-actions) { grid-column: 1 / -1; }
  .dlg-edit .field-status { display: grid; gap: 4px; }
}

/* ------------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--night-2); color: #fff; font-size: 13px; box-shadow: 0 18px 36px -18px rgba(30, 8, 46, .7); opacity: 0; transform: translateY(10px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); flex: none; }
.toast.bad { background: var(--bad); }
.toast.warn { background: #fff8ec; color: #7a4a08; box-shadow: inset 0 0 0 1px rgba(168, 102, 11, .35), 0 18px 36px -18px rgba(80, 50, 8, .4); }


/* ------------------------------------------------------------------- footer */
.foot { max-width: var(--wrap); margin: 18px auto 0; padding: 0 var(--gut); }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 14px 2px calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); font-size: 12px; color: var(--ink-3); }
.foot-mark { width: 10px; height: 10px; border-radius: 50%; background: var(--iris); box-shadow: 0 0 0 3px rgba(199, 139, 255, .18); }
.foot-brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.foot-brand i { font: italic 16px var(--serif); color: var(--ink); }
.foot-in p { margin: 0; flex: 1; min-width: 200px; }
.foot-home { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; color: var(--ink); padding: 5px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; transition: background .2s, color .2s; }
.foot-home:hover { background: #fff; color: var(--pink); }

/* ------------------------------------------- entrance choreography (once) */
body.is-ready:not(.is-settled) :is(.show, .shelf-item, .wk-item) { animation: fadeUp .65s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 16) * 45ms + 260ms); }
body.is-ready:not(.is-settled) :is(.tk-w, .pbar-w) { transform-origin: left; animation: grow .6s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 30) * 16ms + 480ms); }
body.is-ready:not(.is-settled) .dial-arc { animation: draw 1.5s var(--ease-out) .35s both; }
body.is-ready:not(.is-settled) .dial-end { animation: pop .5s var(--ease-out) 1.3s both; }
body.is-ready:not(.is-settled) .disc-fill { animation: drawDisc 1.2s var(--ease-out) .5s both; }
body.is-ready:not(.is-settled) :is(.hero-line, .hero-sub, .stats div, .nx-cap, .lineup) { animation: fadeUp .7s var(--ease-out) both; animation-delay: .12s; }
body.is-ready:not(.is-settled) .stats div:nth-child(2) { animation-delay: .2s; }
body.is-ready:not(.is-settled) .stats div:nth-child(3) { animation-delay: .28s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes grow { from { transform: scaleX(0); opacity: .2; } }
@keyframes draw { from { stroke-dashoffset: var(--len); } }
@keyframes drawDisc { from { stroke-dasharray: 0 200; } }
@keyframes pop { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .p-intro { grid-column: span 7; }
  .p-next { grid-column: span 5; }
}
@media (max-width: 960px) {
  .p-intro, .p-next { grid-column: 1 / -1; }
  .p-intro { min-height: 0; }
  .nx { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 20px; }
  .nx-head { grid-column: 1 / -1; }
  .nx-after { border-top: 0; padding: 0 0 0 18px; border-left: 1px solid rgba(52, 20, 70, .1); align-content: center; }
  /* timetable becomes seven compact rows */
  .wk { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .wk-col { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: start; min-height: 0; padding: 9px 10px; border-radius: 14px; }
  .wk-head { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 2px; }
  .wk-head em { margin: 3px 0 0; align-self: flex-start; }
  .wk-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
  .wk-col.is-empty { align-items: center; padding-block: 7px; }
  .wk-col.is-empty .wk-head { flex-direction: row; align-items: baseline; gap: 6px; padding: 0; }
  .wk-col.is-empty .wk-body { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
}
@media (max-width: 720px) {
  .topnav { display: none; }
  .ph { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ph p { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .ph h2 { grid-column: 2; }
  .ph-aside { grid-column: 3; grid-row: 1; }
  .show { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "cover id" "next next" "prog prog"; gap: 10px 12px; }
  .cover { width: 44px; height: 44px; border-radius: 14px; }
  .show-next { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 10px; text-align: left; padding: 8px 10px; border-radius: 10px; background: rgba(240, 233, 255, .55); }
  .show-when { font-size: 17px; }
  .show-prog { flex-wrap: wrap; gap: 10px; }
  .show-prog .ticks, .show-prog .pbar { order: 9; flex-basis: 100%; }
  .show-ctrl { margin-left: auto; }
}
@media (max-width: 560px) {
  :root { --pad: 15px; --gap: 10px; --r: 20px; }
  .topbar-in { gap: 10px; }
  .topbar-tools { gap: 6px; }
  .brand-text i { display: none; }
  .lang button { min-width: 26px; padding: 0 6px; }
  #authBtn { padding: 0 10px; }
  #authBtn > span:not(:last-child):not(.admin-dot) { display: none; }
  .home-link span { display: none; }
  .sync { position: fixed; left: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; box-shadow: 0 12px 26px -14px rgba(52, 20, 70, .5); background: rgba(255, 255, 255, .92); }
  .toasts { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .p-intro { padding: 18px 18px 20px; }
  .hero-line { font-size: 26px; margin-top: 12px; }
  .hero-foot { padding-top: 14px; }
  .stats div { padding: 0 14px; }
  .stats dd { font-size: 25px; }
  .signal { width: 62%; height: 64px; bottom: 0; opacity: .45; }
  .p-next { padding: 16px; }
  .nx { grid-template-columns: minmax(0, 1fr); }
  .nx-after { border-left: 0; border-top: 1px solid rgba(52, 20, 70, .1); padding: 10px 0 0; }
  .nx-main { grid-template-columns: 116px minmax(0, 1fr); gap: 14px; }
  .dial { width: 116px; }
  .dial-time { font-size: 24px; }
  .dial-date { font-size: 9.5px; }
  .nx-name { font-size: 17px; }
  .wk-col { grid-template-columns: 54px minmax(0, 1fr); gap: 8px; padding: 8px; }
  .wk-head b { font-size: 12.5px; }
  .wk-list { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-wrap: wrap; border-radius: 18px; }
  .search { flex-basis: 100%; }
  .select { flex: 1; }
  .select select { width: 100%; }
  .shelf { grid-template-columns: minmax(0, 1fr); }
  .shelf-item { grid-template-columns: 40px minmax(0, 1fr); padding: 10px 12px; }
  .disc { width: 40px; height: 40px; }
  .dlg-body { padding: 24px 18px 20px; }
  .dlg h3 { font-size: 24px; }
  .dlg-edit .dlg-body { padding: 16px; gap: 10px; }
  .dlg-edit .edit-head { gap: 10px; }
  .dlg-edit .edit-sync { max-width: 45%; font-size: 11px; padding: 4px 8px; }
  .dlg-edit .dlg-actions-split .autosave-hint { flex-basis: 100%; order: 3; text-align: center; margin: 0; font-size: 11px; line-height: 1.35; }
  .dlg-edit .edit-grid { padding: 8px 10px 10px; gap: 8px; }
  .dlg-edit .edit-grid legend { flex-wrap: wrap; gap: 0 6px; }
  .dlg-edit .mini { padding-inline: 7px; font-size: 11px; }
  .dlg-edit .field input, .dlg-edit .field select { padding-inline: 10px; }
  .dlg-edit .field select { padding-right: 26px; background-position: right 9px center; }
  .dlg-edit .stepper-lg button { width: 28px; }
}
@media (max-height: 700px) {
  .dlg-edit .dlg-body { padding: 12px 14px; gap: 6px; }
  .dlg-edit .edit-head h3 { display: none; }
  .dlg-edit .field-name { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
  .dlg-edit .field-name .form-err { grid-column: 2; }
  .dlg-edit .field input, .dlg-edit .field select, .dlg-edit .mini, .dlg-edit .stepper-lg { height: 36px; }
  .dlg-edit .edit-grid { padding: 6px 8px 8px; gap: 6px; }
  .dlg-edit .edit-preview { padding-block: 7px; }
  .dlg-edit .dlg-actions .btn { min-height: 36px; height: 36px; }
  .dlg-edit .form-err { font-size: 11px; line-height: 1.25; }
  .dlg-edit .edit-sync { max-width: 75%; font-size: 10px; }
  .dlg-edit :is(.autosave-hint, .field-hint) { display: none; }
}
@media (max-height: 600px) {
  .dlg-edit .dlg-body { padding: 10px 12px; gap: 5px; }
  .dlg-edit .edit-grid legend small { display: none; }
  .dlg-edit:has(.form-err:not(:empty)) .edit-preview { display: none; }
}
@media (max-width: 420px) {
  .shelf-top { flex-wrap: wrap; gap: 4px 8px; }
  .shelf-title { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (max-width: 360px) {
  .hero-line { font-size: 24px; }
  .brand-text { display: none; }
  .stats div { padding: 0 10px; }
  .stats dt { font-size: 10.5px; }
  .nx-main { grid-template-columns: 104px minmax(0, 1fr); }
  .dial { width: 104px; }
  .dial-days { display: none; }
  .wk-col { grid-template-columns: 48px minmax(0, 1fr); }
  .wk-head small { font-size: 10px; }
}

/* The configured motion switch follows the same final-state rules as reduced motion. */
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation: none !important;
  transition-duration: .01ms !important;
}
