/* menu.css — Menu landing page only. Shared tokens/components live in /shared/theme.css. */

:root {
  /* set by menu.js layout() */
  --tw: 248px;
  --th: 155px;
  --gap: 20px;
  --cols: 4;
  --rows: 3;
  --pad: 22px;
  --topH: 64px;
  --barH: 160px;
  --dotsH: 28px;
  --tile-r: 16%;
}

[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { position: relative; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
button { font-family: var(--qg-font); }

/* ---------- Intro / exit fades ------------------------------------------ */
.whiteout, .fade {
  position: fixed; inset: 0; background: #fff; pointer-events: none; z-index: 3000;
}
.whiteout { opacity: 1; transition: opacity .45s ease-out; }
.whiteout.gone { opacity: 0; }
.fade { opacity: 0; transition: opacity .45s ease-in; }
.fade.on { opacity: 1; pointer-events: auto; }

/* ---------- Top: wordmark + organize ------------------------------------ */
.top {
  position: absolute; left: 0; right: 0; top: 0; height: var(--topH);
  display: flex; align-items: center; gap: 14px;
  padding: env(safe-area-inset-top, 0px) max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
  z-index: 20;
}
.wordmark {
  font: 800 19px/1 var(--qg-font);
  color: var(--qg-text-faint);
  letter-spacing: .02em;
}
.wordmark span { font-weight: 500; margin-left: 5px; color: #c4c8cc; }
.discover {
  appearance: none; border: 0; background: none; padding: 6px 10px; border-radius: var(--qg-radius-pill);
  font: 700 13px/1 var(--qg-font); color: var(--qg-blue-deep); opacity: .8;
  display: inline-flex; align-items: center; gap: 6px; transition: background .2s, opacity .2s;
}
.discover::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--qg-blue);
  box-shadow: 0 0 0 0 rgba(52,190,237,.5); animation: ping 2.2s infinite;
}
.discover:hover, .discover:focus-visible { outline: none; background: var(--qg-blue-soft); opacity: 1; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52,190,237,.55); } 70%,100% { box-shadow: 0 0 0 8px rgba(52,190,237,0); } }

.organize { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; font-size: 14px; }
.organize svg { width: 16px; height: 16px; fill: currentColor; opacity: .7; }
.organize[aria-pressed="true"] {
  color: #fff; border-color: var(--qg-blue-deep);
  background: linear-gradient(180deg, #5fd0f4, var(--qg-blue) 55%, var(--qg-blue-deep));
}
.organize[aria-pressed="true"] svg { opacity: 1; }

/* ---------- Stage / grid ------------------------------------------------ */
.stage {
  position: absolute; left: 0; right: 0;
  top: var(--topH);
  bottom: calc(var(--barH) + var(--dotsH));
  display: grid; place-items: center;
}
.viewport {
  width: 100%;              /* full-width pages: neighbours slide fully off-screen */
  overflow: hidden;
  touch-action: pan-y;
}
.track {
  display: flex;
  transition: transform .5s cubic-bezier(.25, .85, .3, 1);
  will-change: transform;
}
.track.dragging { transition: none; }
.page {
  flex: 0 0 100%;
  padding: var(--pad);
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--tw));
  grid-auto-rows: var(--th);
  gap: var(--gap);
  justify-content: center;
}

/* A channel tile */
.channel {
  position: relative;
  appearance: none; margin: 0; padding: 0;
  width: var(--tw); height: var(--th);
  border-radius: calc(var(--th) * .16);
  border: 2px solid #cfd4d8;
  background: #fff;
  box-shadow:
    inset 0 0 0 3px rgba(255,255,255,.95),
    inset 0 2px 8px rgba(80, 90, 100, .16),
    0 1px 2px rgba(80, 90, 100, .08);
  transition: transform .22s var(--qg-ease), box-shadow .2s, border-color .2s, opacity .3s;
  cursor: inherit;
  outline: none;
  -webkit-touch-callout: none;
}
.channel .ch-art {
  position: absolute; inset: 4px;
  border-radius: calc(var(--th) * .16 - 4px);
  overflow: hidden;
  background: #f1f4f6;
  box-shadow: inset 0 1px 6px rgba(70, 80, 90, .18);
}
.channel .ch-art img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  pointer-events: none; -webkit-user-drag: none;
}
.channel .ch-art::after { /* inner glassy rim */
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), inset 0 2px 0 rgba(255,255,255,.6);
  pointer-events: none;
}
.channel .ch-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px;
  font: 800 calc(var(--th) * .14)/1.1 var(--qg-font); color: #fff;
  background: var(--c, var(--qg-blue));
}

.channel:not(.channel--empty):hover,
.channel:not(.channel--empty):focus-visible,
.channel.is-focus {
  border-color: var(--qg-blue);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.95), inset 0 2px 8px rgba(80,90,100,.12), var(--qg-glow);
  transform: scale(1.045);
  z-index: 2;
}
.channel:not(.channel--empty):active { transform: scale(1.0); }

/* Empty channel slot */
.channel--empty {
  border-color: #dde1e4;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.55) 0 2px, rgba(255,255,255,0) 2px 4px),
    linear-gradient(135deg, #eef0f2 0%, #e4e7ea 45%, #eceef0 55%, #e2e5e8 100%);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.7), inset 0 2px 10px rgba(80, 90, 100, .10);
  pointer-events: none;
}

/* Badges */
.ch-new {
  position: absolute; top: -7px; left: -7px; z-index: 3;
  font: 800 11px/1 var(--qg-font); letter-spacing: .06em; color: #fff;
  padding: 5px 8px 5px; border-radius: var(--qg-radius-pill);
  background: linear-gradient(180deg, #5fd0f4, var(--qg-blue) 60%, var(--qg-blue-deep));
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(13, 154, 211, .35);
  pointer-events: none;
}
.ch-players {
  position: absolute; right: 9px; bottom: 9px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px;
  font: 800 11px/1 var(--qg-font); color: var(--qg-text-soft);
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(213, 217, 221, .9);
  padding: 4px 7px 4px 6px; border-radius: var(--qg-radius-pill);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
.ch-players svg { width: 11px; height: 11px; fill: currentColor; }
.ch-hiddenmark {
  position: absolute; left: 9px; bottom: 9px; z-index: 3;
  font: 800 10px/1 var(--qg-font); letter-spacing: .05em; color: var(--qg-text-soft);
  background: rgba(255,255,255,.92); padding: 4px 7px; border-radius: var(--qg-radius-pill);
  pointer-events: none;
}
.channel.is-hidden .ch-art { opacity: .4; filter: grayscale(.8); }

.ch-x {
  position: absolute; top: -10px; right: -10px; z-index: 4;
  width: 30px; height: 30px; border-radius: 50%;
  display: none; place-items: center;
  background: radial-gradient(circle at 50% 30%, #fff, #eef1f3 60%, #dfe3e6);
  border: 2px solid var(--qg-line);
  color: var(--qg-text-soft);
  box-shadow: 0 2px 6px rgba(60,70,80,.2);
  transition: transform .15s var(--qg-ease), color .15s, border-color .15s;
}
.ch-x svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 3; stroke-linecap: round; fill: none; }
.ch-x:hover { transform: scale(1.15); color: var(--p2); border-color: var(--p2); }
.channel.is-hidden .ch-x:hover { color: var(--qg-blue-deep); border-color: var(--qg-blue); }

/* Organize mode */
body.organizing .channel:not(.channel--empty) { animation: wiggle .32s ease-in-out infinite alternate; }
body.organizing .channel:not(.channel--empty):nth-child(2n) { animation-delay: -.16s; animation-duration: .36s; }
body.organizing .ch-x { display: grid; }
body.organizing .ch-players, body.organizing .ch-new { opacity: 0; }
@keyframes wiggle { from { transform: rotate(-1.1deg); } to { transform: rotate(1.1deg); } }

/* Hide (shrink-away) animation */
.channel.removing { animation: shrink-away .32s ease-in forwards !important; pointer-events: none; }
@keyframes shrink-away { to { transform: scale(.2); opacity: 0; } }

/* Intro pop-in */
.track.intro .channel { animation: tile-pop .42s var(--qg-ease) both; animation-delay: var(--d, 0ms); }
@keyframes tile-pop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }

/* Notices (fetch error / all hidden) */
.notice {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 48px));
  text-align: center; z-index: 5;
  background: rgba(255,255,255,.96);
  border: 2px solid var(--qg-line-soft);
  border-radius: var(--qg-radius-lg);
  box-shadow: var(--qg-shadow-lg);
  padding: 26px 28px 24px;
  animation: qg-zoom-in .35s var(--qg-ease);
}
.notice h2 { font: 800 22px/1.2 var(--qg-font); margin: 0 0 6px; }
.notice p { font: 500 14px/1.45 var(--qg-font); color: var(--qg-text-soft); margin: 0 0 18px; }
.notice .art { width: 64px; height: 64px; margin: 0 auto 10px; display: block; }

/* Page arrows */
.page-arrow {
  position: absolute; top: 50%; z-index: 10;
  width: 64px; height: 64px; margin-top: -32px; padding: 0;
  border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 50% 28%, #8fe0fa 0%, var(--qg-blue) 50%, var(--qg-blue-deep) 100%);
  box-shadow: 0 4px 12px rgba(13, 154, 211, .35), inset 0 2px 0 rgba(255,255,255,.55);
  display: grid; place-items: center;
  transition: transform .2s var(--qg-ease), box-shadow .2s, opacity .2s;
  cursor: inherit;
  animation: arrow-in .3s var(--qg-ease);
}
.page-arrow[hidden] { display: none; }
.page-arrow svg { width: 60%; height: 60%; }
.page-arrow path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.page-arrow--left { left: max(14px, env(safe-area-inset-left)); }
.page-arrow--right { right: max(14px, env(safe-area-inset-right)); }
.page-arrow:hover, .page-arrow:focus-visible { outline: none; transform: scale(1.12); box-shadow: 0 4px 12px rgba(13,154,211,.35), var(--qg-glow); }
.page-arrow--left:hover { animation: nudge-l .8s ease-in-out infinite; }
.page-arrow--right:hover { animation: nudge-r .8s ease-in-out infinite; }
@keyframes nudge-l { 50% { transform: scale(1.12) translateX(-3px); } 0%,100% { transform: scale(1.12); } }
@keyframes nudge-r { 50% { transform: scale(1.12) translateX(3px); } 0%,100% { transform: scale(1.12); } }
@keyframes arrow-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

/* Page dots */
.dots {
  position: absolute; left: 0; right: 0; bottom: var(--barH); height: var(--dotsH);
  display: flex; justify-content: center; align-items: center; gap: 9px; z-index: 6;
}
.dots i {
  width: 8px; height: 8px; border-radius: 50%; background: #cfd4d8;
  transition: background .25s, transform .25s var(--qg-ease), width .25s;
}
.dots i.on { background: var(--qg-blue); width: 20px; border-radius: 4px; box-shadow: 0 0 6px rgba(52,190,237,.6); }

/* ---------- Bottom bar -------------------------------------------------- */
.bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--barH);
  z-index: 15;
}
.bar-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 -3px 8px rgba(80, 90, 100, .10)); }
.bar-btn {
  position: absolute;
  width: var(--btnS, 78px); height: var(--btnS, 78px);
  top: calc(var(--barH) * .5 - var(--btnS, 78px) / 2);
  border-width: 3px;
  background: radial-gradient(circle at 50% 28%, #ffffff 0%, #f4f5f7 55%, #e0e4e7 100%);
  box-shadow: 0 3px 0 rgba(255,255,255,.9) inset, 0 4px 10px rgba(60,70,80,.16), 0 0 0 5px rgba(255,255,255,.55);
}
.bar-btn--left { left: calc(var(--btnX, 60px) - var(--btnS, 78px) / 2); font: 800 calc(var(--btnS, 78px) * .2)/1 var(--qg-font); letter-spacing: .01em; }
.bar-btn--right { right: calc(var(--btnX, 60px) - var(--btnS, 78px) / 2); }
.bar-btn--right svg { width: 46%; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.bar-btn--right.has-mail { color: var(--qg-blue-deep); border-color: #9fdcf3; animation: mail-glow 2.4s ease-in-out infinite; }
@keyframes mail-glow { 50% { box-shadow: 0 3px 0 rgba(255,255,255,.9) inset, 0 4px 10px rgba(60,70,80,.16), 0 0 0 5px rgba(255,255,255,.55), 0 0 18px rgba(52,190,237,.6); } }
.mail-count {
  position: absolute; top: -2px; right: -2px;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  display: grid; place-items: center;
  font: 800 12px/1 var(--qg-font); color: #fff;
  background: linear-gradient(180deg, #5fd0f4, var(--qg-blue) 60%, var(--qg-blue-deep));
  border: 2px solid #fff; box-shadow: 0 2px 5px rgba(13,154,211,.35);
}

.clock {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none; text-align: center;
}
.time {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--barH) - var(--flatY, 64px) + 4px);
  font: 300 var(--clockS, 54px)/1 var(--qg-font);
  color: #9da3a9;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 1px 0 #fff;
}
.time .colon { display: inline-block; margin: 0 .04em; transform: translateY(-.06em); transition: opacity .2s; }
.time .colon.off { opacity: .15; }
.time small { font-size: .32em; font-weight: 500; letter-spacing: .06em; margin-left: .3em; color: #aab0b5; }
.date {
  position: absolute; left: 0; right: 0;
  top: calc(var(--flatY, 64px) + var(--barH) * .1);
  font: 500 var(--dateS, 20px)/1 var(--qg-font);
  color: #8f959b; letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

/* ---------- Hover caption bubble --------------------------------------- */
.bubble {
  position: fixed; z-index: 50; pointer-events: none;
  transform: translate(-50%, -100%);
  background: #fff;
  border: 2px solid var(--qg-line);
  border-radius: var(--qg-radius-pill);
  padding: 9px 16px;
  font: 700 15px/1 var(--qg-font); color: var(--qg-text);
  box-shadow: var(--qg-shadow-lg);
  white-space: nowrap;
  animation: bubble-in .18s var(--qg-ease);
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px;
  background: #fff; border-right: 2px solid var(--qg-line); border-bottom: 2px solid var(--qg-line);
  transform: translateX(-50%) rotate(45deg);
}
.bubble small { display: block; font-weight: 500; font-size: 12px; color: var(--qg-text-soft); margin-top: 4px; }
@keyframes bubble-in { from { opacity: 0; transform: translate(-50%, -88%) scale(.9); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }

/* ---------- Context menu (right-click / long-press) -------------------- */
.ctx-menu {
  position: fixed; z-index: 60; min-width: 190px;
  background: #fff; border: 2px solid var(--qg-line-soft);
  border-radius: 20px; box-shadow: var(--qg-shadow-lg);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
  animation: qg-zoom-in .18s var(--qg-ease);
  transform-origin: top left;
}
.ctx-menu .ctx-title { font: 800 13px/1 var(--qg-font); color: var(--qg-text-soft); padding: 8px 12px 6px; }
.ctx-menu button {
  appearance: none; border: 0; background: none; text-align: left;
  font: 700 15px/1 var(--qg-font); color: var(--qg-text);
  padding: 11px 12px; border-radius: 12px; cursor: inherit;
  display: flex; align-items: center; gap: 10px;
}
.ctx-menu button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { outline: none; background: var(--qg-blue-soft); color: var(--qg-blue-deep); }

/* ---------- Channel preview -------------------------------------------- */
.zoomer {
  position: fixed; z-index: 900; overflow: hidden;
  background: #fff;
  border: 2px solid var(--qg-blue);
  transition: left .42s cubic-bezier(.3,.8,.25,1), top .42s cubic-bezier(.3,.8,.25,1),
              width .42s cubic-bezier(.3,.8,.25,1), height .42s cubic-bezier(.3,.8,.25,1),
              border-radius .42s, opacity .25s, border-color .3s;
}
.zoomer img { width: 100%; height: 100%; object-fit: cover; display: block; }

.preview {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column;
  background: #fff;
  animation: qg-fade .25s ease-out;
}
.preview[hidden] { display: none; }
.preview.leaving { animation: pv-out .22s ease-in forwards; }
@keyframes pv-out { to { opacity: 0; } }

.pv-banner {
  position: relative; flex: 1; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #ffffff, #f3f6f8);
}
.pv-backdrop { position: absolute; inset: -8%; }
.pv-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(34px) saturate(1.2); opacity: .45; transform: scale(1.1); }
.pv-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.75)); }

.pv-content {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(22px, 4vw, 56px);
  width: min(1180px, calc(100vw - 48px));
  padding: 28px 0;
}
.pv-art {
  position: relative; flex: 0 1 auto;
  width: min(54vw, 620px, calc((100vh - 260px) * 1.6));
  aspect-ratio: 16 / 10;
  border-radius: 28px; overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--qg-line), 0 18px 40px rgba(60,70,80,.22);
  animation: pv-art-in .6s var(--qg-ease) both, float 6s ease-in-out .6s infinite;
}
.pv-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-sweep {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.65) 48%, rgba(255,255,255,.0) 60%);
  background-size: 250% 100%; background-repeat: no-repeat;
  animation: sweep 3.6s ease-in-out .5s infinite;
}
@keyframes sweep { 0% { background-position: 160% 0; } 55%, 100% { background-position: -60% 0; } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes pv-art-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

.pv-info { flex: 0 1 400px; min-width: 0; animation: pv-info-in .55s ease-out .12s both; }
@keyframes pv-info-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.pv-title { font: 800 clamp(30px, 4vw, 48px)/1.05 var(--qg-font); margin: 0 0 10px; color: var(--qg-text); letter-spacing: .005em; }
.pv-tagline { font: 700 clamp(15px, 1.6vw, 19px)/1.35 var(--qg-font); color: var(--accent, var(--qg-blue-deep)); margin: 0 0 14px; }
.pv-desc { font: 500 15px/1.6 var(--qg-font); color: var(--qg-text-soft); margin: 0 0 18px; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font: 700 13px/1 var(--qg-font); color: var(--qg-text);
  background: rgba(255,255,255,.9); border: 2px solid var(--qg-line-soft);
  padding: 8px 12px; border-radius: var(--qg-radius-pill);
}
.chip svg { width: 14px; height: 14px; fill: var(--qg-blue-deep); }

.pv-shimmer {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(100deg, transparent 0 40%, rgba(255,255,255,.45) 50%, transparent 60% 100%);
  background-size: 300% 100%;
  animation: qg-shimmer 5s linear infinite;
  mix-blend-mode: soft-light;
}

.pv-bar {
  position: relative; flex: 0 0 auto;
  padding: 26px 24px calc(22px + env(safe-area-inset-bottom));
  background:
    repeating-linear-gradient(180deg, #f2f3f5 0 3px, #e9ebee 3px 4px);
  border-top: 2px solid var(--qg-blue);
  box-shadow: 0 -4px 14px rgba(52,190,237,.18);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pv-buttons { display: flex; gap: clamp(16px, 5vw, 80px); justify-content: center; flex-wrap: wrap; }
.pv-btn { min-width: min(260px, 40vw); padding: 20px 34px; font-size: 21px; }
.pv-hide { font: 600 13px/1 var(--qg-font); color: var(--qg-text-soft); display: flex; gap: 10px; align-items: center; min-height: 26px; }
.link-btn {
  appearance: none; border: 0; background: none; padding: 6px 10px; border-radius: 10px;
  font: 700 13px/1 var(--qg-font); color: var(--qg-text-soft); cursor: inherit;
  text-decoration: underline; text-decoration-color: rgba(138,144,151,.35); text-underline-offset: 3px;
}
.link-btn:hover, .link-btn:focus-visible { outline: none; color: var(--qg-blue-deep); background: var(--qg-blue-soft); }
.link-btn.danger:hover, .link-btn.danger:focus-visible { color: var(--p2); background: rgba(232,82,74,.1); }

/* ---------- Dialogs ---------------------------------------------------- */
.dialog { position: relative; width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; animation: qg-zoom-in .28s var(--qg-ease); }
.dialog--wide { width: min(640px, calc(100vw - 32px)); }
.dialog-close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%;
  appearance: none; border: 2px solid var(--qg-line); background: var(--qg-surface-2);
  font: 700 20px/1 var(--qg-font); color: var(--qg-text-soft); cursor: inherit;
  display: grid; place-items: center; padding: 0 0 2px;
  transition: transform .15s var(--qg-ease), border-color .15s, color .15s;
}
.dialog-close:hover, .dialog-close:focus-visible { outline: none; border-color: var(--qg-blue); color: var(--qg-blue-deep); transform: scale(1.08); }
.dialog .qg-title { padding-right: 40px; }
.dialog-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.dialog-actions .qg-btn { min-width: 120px; padding: 13px 26px; font-size: 16px; }

.settings-list { margin-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 4px; border-top: 2px solid var(--qg-line-soft); cursor: inherit;
}
.setting b { display: block; font: 700 16px/1.2 var(--qg-font); }
.setting small { display: block; font: 500 13px/1.3 var(--qg-font); color: var(--qg-text-soft); margin-top: 3px; }

/* iOS-ish switch in theme colors */
.switch {
  appearance: none; flex: 0 0 auto; margin: 0;
  width: 54px; height: 32px; border-radius: 16px;
  background: #dfe3e6; border: 2px solid var(--qg-line);
  position: relative; cursor: inherit; transition: background .2s, border-color .2s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #fff, #f0f2f4); box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .22s var(--qg-ease);
}
.switch:checked { background: var(--qg-blue); border-color: var(--qg-blue-deep); }
.switch:checked::after { transform: translateX(22px); }
.switch:focus-visible { outline: none; box-shadow: var(--qg-glow); }

.hid-list {
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px;
}
.hid-item {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  padding: 8px; border-radius: 20px; border: 2px solid var(--qg-line-soft); background: var(--qg-surface-2);
  animation: qg-zoom-in .25s var(--qg-ease) both;
}
.hid-item .mini {
  aspect-ratio: 16/10; border-radius: 14px; overflow: hidden; border: 2px solid #d5d9dd; background: #fff;
}
.hid-item .mini img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.5); opacity: .8; }
.hid-item .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 2px; }
.hid-item b { font: 700 14px/1.2 var(--qg-font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hid-item .qg-btn { padding: 8px 14px; font-size: 13px; }
.hid-empty {
  grid-column: 1 / -1; text-align: center; padding: 28px 10px 10px;
  font: 500 14px/1.5 var(--qg-font); color: var(--qg-text-soft);
}
.hid-empty svg { width: 56px; height: 56px; display: block; margin: 0 auto 8px; }

/* Toast with action */
.qg-toast.menu-toast {
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 22px;
  bottom: calc(var(--barH) + 14px);
  white-space: nowrap;
}
.qg-toast.menu-toast .sep { color: var(--qg-text-faint); }
.qg-toast.menu-toast button {
  appearance: none; border: 0; cursor: inherit;
  font: 800 14px/1 var(--qg-font); color: var(--qg-blue-deep);
  background: var(--qg-blue-soft); padding: 9px 14px; border-radius: var(--qg-radius-pill);
}
.qg-toast.menu-toast button:hover, .qg-toast.menu-toast button:focus-visible { outline: none; background: var(--qg-blue); color: #fff; }
.qg-toast.out { animation: toast-out .2s ease-in forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(-50%) translateY(8px); } }

/* ---------- Narrow screens --------------------------------------------- */
@media (max-width: 599px) {
  .wordmark { font-size: 16px; }
  .page-arrow { width: 38px; height: 38px; margin-top: -19px; border-width: 2px; }
  .page-arrow--left { left: 2px; }
  .page-arrow--right { right: 2px; }
  .ch-new { font-size: 9.5px; padding: 4px 6px; }
  .ch-players { font-size: 10px; right: 6px; bottom: 6px; padding: 3px 6px 3px 5px; }
  .ch-x { width: 26px; height: 26px; top: -8px; right: -8px; }
  .discover { font-size: 12px; padding: 6px 4px; }
  .pv-content { flex-direction: column; gap: 18px; padding: 18px 0; }
  .pv-art { width: min(100%, calc((100vh - 420px) * 1.6)); border-radius: 22px; }
  .pv-info { flex: 0 0 auto; text-align: center; }
  .pv-chips { justify-content: center; }
  .pv-desc { font-size: 14px; }
  .pv-bar { padding-top: 18px; }
  .pv-btn { padding: 16px 20px; font-size: 18px; min-width: 0; flex: 1; }
  .pv-buttons { width: 100%; gap: 12px; flex-wrap: nowrap; }
  .qg-toast.menu-toast { font-size: 14px; }
}
@media (max-height: 560px) and (min-width: 600px) {
  .pv-desc { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .track { transition: none; }
  body.organizing .channel:not(.channel--empty) { animation: none; }
  .pv-art, .pv-sweep, .pv-shimmer { animation: none !important; }
  .zoomer { transition: none; }
}
