/* EroideTube PWA — stessi token di colore e tipografia dell'app Android (ui/theme/Theme.kt). */

:root {
  --bg: #0f0f0f;
  --bg-elev: #181818;
  --surface: #212121;
  --surface2: #272727;
  --surface3: #303030;
  --text: #f1f1f1;
  --text2: #aaaaaa;
  --text3: #717171;
  --line: #303030;
  --brand: #ff0033;
  --chip: #272727;
  --chip-on: #f1f1f1;
  --chip-on-ink: #0f0f0f;
  --glass-text: #e6d6dc;
  --glass-top: rgba(52, 46, 49, 0.55);
  --glass-bottom: rgba(14, 12, 13, 0.66);
  --glass-highlight: rgba(255, 255, 255, 0.28);
  --glass-shadow: rgba(0, 0, 0, 0.45);
  --bubble: rgba(255, 255, 255, 0.12);
  --scrim: rgba(0, 0, 0, 0.55);
  --link: #3ea6ff;

  --top-h: 56px;
  --bar-h: 72px;
  --mini-h: 62px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  color-scheme: dark;
}

:root[data-theme='light'] {
  --bg: #ffffff;
  --bg-elev: #f9f9f9;
  --surface: #f2f2f2;
  --surface2: #e9e9e9;
  --surface3: #dddddd;
  --text: #0f0f0f;
  --text2: #606060;
  --text3: #909090;
  --line: #e5e5e5;
  --chip: #f2f2f2;
  --chip-on: #0f0f0f;
  --chip-on-ink: #ffffff;
  --glass-text: #6c6166;
  --glass-top: rgba(255, 255, 255, 0.62);
  --glass-bottom: rgba(240, 238, 240, 0.70);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: rgba(0, 0, 0, 0.16);
  --bubble: rgba(0, 0, 0, 0.06);
  --scrim: rgba(0, 0, 0, 0.4);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; position: fixed; inset: 0; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

input { font: inherit; color: inherit; }
img { display: block; }
svg { display: block; flex: none; }

.ripple { position: relative; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.ripple:active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0.08;
  pointer-events: none;
}

.clamp1, .clamp2, .clamp6, .clamp12 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp1 { -webkit-line-clamp: 1; line-clamp: 1; word-break: break-all; }
.clamp2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp6 { -webkit-line-clamp: 6; line-clamp: 6; }
.clamp12 { -webkit-line-clamp: 12; line-clamp: 12; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- tipografia (TuboType) */

.page-title { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.3px; }
.section-title { font-size: 18px; line-height: 24px; font-weight: 600; }
.card-title { font-size: 15px; line-height: 20px; font-weight: 600; }
.meta { font-size: 12.5px; line-height: 17px; color: var(--text2); }
.body { font-size: 14px; line-height: 20px; }
.brand-word { font-size: 21px; font-weight: 700; letter-spacing: -0.6px; color: var(--text); }
.c-text { color: var(--text); }
.c-text2 { color: var(--text2); }
.c-text3 { color: var(--text3); }

/* ---------------------------------------------------------------- struttura */

#app { position: fixed; inset: 0; background: var(--bg); }

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--sat) + var(--top-h));
  padding-bottom: calc(var(--sab) + var(--bar-h) + 42px);
  padding-left: var(--sal);
  padding-right: var(--sar);
}
.page.with-mini { padding-bottom: calc(var(--sab) + var(--bar-h) + 42px + var(--mini-h) + 8px); }
.page-inner { max-width: 760px; margin: 0 auto; }

/* barra in alto: sfondo 88% + blur 18px (.topbar del desktop) */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding-top: var(--sat);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.topbar-row { height: var(--top-h); display: flex; align-items: center; padding: 0 6px 0 12px; max-width: 900px; margin: 0 auto; }
.top-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); }
.logo { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 22px; }
.logo-mark { width: 32px; height: 22px; border-radius: 6px; background: var(--brand); display: grid; place-items: center; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- barra liquid glass */

.glass-wrap {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(var(--sab) + 14px);
  padding: 0 calc(12px + var(--sal)) 0 calc(12px + var(--sar));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.3s;
}
.glass-wrap > * { pointer-events: auto; }
.glass-wrap.hidden { transform: translateY(120px); opacity: 0; pointer-events: none; }
.glass-wrap.hidden > * { pointer-events: none; }

.glass-bar {
  position: relative;
  width: 100%;
  max-width: 520px;
  height: var(--bar-h);
  border-radius: 36px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.glass-bar .glass-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 10px 32px var(--glass-shadow), inset 0 1px 0 var(--glass-highlight), inset 0 0 0 0.5px var(--glass-highlight);
}
.glass-items { position: absolute; inset: 0 6px; display: flex; }
.glass-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--glass-text);
  font-size: 11px;
  font-weight: 500;
  line-height: 13px;
  position: relative;
  z-index: 2;
  transition: color 0.15s, transform 0.2s;
}
.glass-item.active { color: var(--brand); }
.glass-item span { white-space: nowrap; }
.glass-item .ic-bold, .glass-item.active .ic-normal { display: none; }
.glass-item.active .ic-bold { display: block; }
.glass-bubble {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: var(--bubble);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  z-index: 1;
  will-change: transform, width, height;
}
.glass-bubble.pressed {
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(2px) saturate(160%) brightness(1.1);
  backdrop-filter: blur(2px) saturate(160%) brightness(1.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ---------------------------------------------------------------- mini-player */

.mini {
  width: 100%;
  max-width: 520px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: var(--bg-elev);
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  touch-action: none;
  transition: opacity 0.2s;
}
.mini-row { height: 60px; display: flex; align-items: center; }
.mini-thumb { width: 106px; height: 60px; background: #000; flex: none; position: relative; overflow: hidden; }
.mini-thumb img, .mini-thumb video { width: 100%; height: 100%; object-fit: cover; }
.mini-thumb video { object-fit: contain; }
.mini-text { flex: 1; min-width: 0; padding: 0 10px; }
.mini-title { font-size: 14px; font-weight: 500; line-height: 18px; }
.mini-sub { font-size: 12px; color: var(--text2); line-height: 16px; }
.mini-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--text); flex: none; }
.mini-progress { height: 2px; background: var(--surface3); }
.mini-progress > div { height: 2px; background: var(--brand); }

/* ---------------------------------------------------------------- pagina video */

.watch {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.watch-status { height: var(--sat); background: #000; flex: none; }
.watch-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; padding-bottom: calc(var(--sab) + 16px); }
.watch-inner { max-width: 900px; margin: 0 auto; }
.watch.full { background: #000; }
.watch.full .watch-status { display: none; }

@media (orientation: landscape) and (max-height: 520px) {
  .watch .player { position: fixed; inset: 0; aspect-ratio: auto !important; z-index: 5; }
  .watch .watch-body, .watch .watch-status { display: none; }
}

/* ---------------------------------------------------------------- player */

.player { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; flex: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.watch-inner-player { max-width: 900px; margin: 0 auto; width: 100%; }
.player.full { position: fixed; inset: 0; aspect-ratio: auto; z-index: 5; }
.player-slot, .player-slot video { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.player-layer { position: absolute; inset: 0; }
.controls { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); transition: opacity 0.2s; }
.controls.off { opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.ctl-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ctl-top-left { position: absolute; top: 6px; left: 6px; }
.ctl-top-right { position: absolute; top: 6px; right: 6px; display: flex; }
.ctl-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; }
.ctl-play { width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center; color: #fff; }
.ctl-skip { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; position: relative; }
.ctl-skip b { position: absolute; font-size: 10px; font-weight: 700; padding-top: 3px; }
.ctl-bottom { position: absolute; left: 0; right: 0; bottom: 0; }
.player.full .ctl-bottom { padding: 8px calc(16px + var(--sar)) calc(8px + var(--sab)) calc(16px + var(--sal)); }
.player.full .ctl-top-left { top: calc(6px + var(--sat)); left: calc(6px + var(--sal)); }
.player.full .ctl-top-right { top: calc(6px + var(--sat)); right: calc(6px + var(--sar)); }
.ctl-time-row { display: flex; align-items: center; padding: 0 4px 0 12px; color: #fff; font-size: 13px; font-weight: 500; }
.seek { position: relative; height: 28px; margin: 0 12px; touch-action: none; }
.seek-track, .seek-buf, .seek-fill { position: absolute; left: 0; top: 50%; height: 3px; transform: translateY(-50%); border-radius: 2px; }
.seek-track { right: 0; background: rgba(255, 255, 255, 0.3); }
.seek-buf { background: rgba(255, 255, 255, 0.55); }
.seek-fill { background: var(--brand); }
.seek-thumb { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--brand); }
.seek.drag .seek-track, .seek.drag .seek-buf, .seek.drag .seek-fill { height: 5px; }
.seek.drag .seek-thumb { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.seek-hint { position: absolute; top: 50%; transform: translateY(-50%); padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; pointer-events: none; }
.spinner {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.spinner.brand { border-color: color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); width: 32px; height: 32px; }
.player .spinner.center { position: absolute; top: 50%; left: 50%; margin: -21px 0 0 -21px; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.audio-badge { position: absolute; left: 12px; bottom: 44px; color: #fff; font-size: 12px; background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 6px; }

/* ---------------------------------------------------------------- componenti */

.page-header { padding: 12px; }
.page-header .sub { margin-top: 4px; font-size: 13px; color: var(--text2); line-height: 17px; }
.row { display: flex; align-items: center; }
.row-top { display: flex; align-items: flex-start; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chip-row::-webkit-scrollbar, .shelf::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  background: var(--chip);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.chip.on { background: var(--chip-on); color: var(--chip-on-ink); }

.pill {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  background: var(--surface2);
  color: var(--text);
  white-space: nowrap;
}
.btn.primary { background: var(--chip-on); color: var(--chip-on-ink); }
.btn.block { width: 100%; }
.text-btn { font-size: 14px; font-weight: 600; color: var(--text); padding: 10px 12px; border-radius: 999px; margin-right: 8px; white-space: nowrap; }

.avatar {
  flex: none;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text2);
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface2); overflow: hidden; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .dur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  padding: 1px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.thumb .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.25); }
.thumb .prog > div { height: 100%; background: var(--brand); }

.video-card { padding-bottom: 18px; }
.video-card .info { display: flex; padding: 10px 4px 0 12px; gap: 12px; }
.video-card .info .meta { margin-top: 4px; }
.menu-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text); flex: none; }

.video-row { display: flex; padding: 6px 2px 6px 12px; gap: 12px; }
.video-row.hl { background: var(--surface); }
.video-row .thumb { width: 160px; border-radius: 8px; }
.video-row .meta { margin-top: 0; }

.channel-row { display: flex; align-items: center; padding: 12px; gap: 12px; }
.channel-row .av-box { width: 150px; display: grid; place-items: center; flex: none; }

.playlist-row { display: flex; padding: 8px 12px; gap: 12px; }
.playlist-row .thumb { width: 160px; border-radius: 10px; }

.small-card { width: 220px; flex: none; border-radius: 10px; }
.small-card .thumb { border-radius: 10px; margin-bottom: 6px; }
.shelf { display: flex; gap: 10px; overflow-x: auto; padding: 0 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.shelf > * { scroll-snap-align: start; scroll-margin-left: 12px; }
.section-head { display: flex; align-items: center; }
.section-head .section-title { flex: 1; padding: 8px 12px 10px; }

.list-row { display: flex; align-items: center; padding: 14px 16px; gap: 20px; }
.list-row .t { font-size: 15px; font-weight: 500; line-height: 20px; }

.empty { display: flex; flex-direction: column; align-items: center; padding: 48px 32px; text-align: center; }
.empty .circle { width: 88px; height: 88px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; color: var(--text2); }
.empty .section-title { margin-top: 18px; }
.empty .body { margin-top: 6px; color: var(--text2); white-space: pre-line; }
.empty .btn { margin-top: 18px; }

.card { border-radius: 12px; background: var(--surface); padding: 12px; }

.skeleton { animation: shimmer 1.6s ease-in-out infinite alternate; }
.skeleton .blk { background: var(--surface2); border-radius: 4px; }
@keyframes shimmer { from { opacity: 0.45; } to { opacity: 0.9; } }

.search-field {
  margin: 8px 12px;
  height: 44px;
  border-radius: 22px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  padding: 0 6px 0 14px;
  gap: 10px;
  color: var(--text2);
}
.search-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; color: var(--text); caret-color: var(--brand); }
.search-field input::placeholder { color: var(--text3); }
.search-field input::-webkit-search-cancel-button { display: none; }
.sugg-row { display: flex; align-items: center; padding: 4px 6px 4px 18px; gap: 16px; color: var(--text2); }
.sugg-row .t { flex: 1; font-size: 15px; color: var(--text); }

.bubble { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 10px; }
.bubble .ring { width: 58px; height: 58px; border-radius: 50%; padding: 3px; display: grid; place-items: center; }
.bubble .ring.on { background: var(--text); }
.bubble .label { margin-top: 4px; font-size: 11px; line-height: 14px; color: var(--text2); max-width: 68px; text-align: center; }
.bubble .label.on { color: var(--text); font-weight: 600; }

.group-title { font-size: 12px; letter-spacing: 0.8px; color: var(--text2); padding: 20px 16px 6px; text-transform: uppercase; }
.set-row { display: flex; align-items: center; padding: 12px 16px; gap: 18px; }
.set-row .t { font-size: 15px; line-height: 20px; }
.switch { width: 40px; height: 22px; border-radius: 999px; background: var(--surface3); position: relative; flex: none; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text2); transition: transform 0.15s, background 0.15s; }
.switch.on { background: color-mix(in srgb, var(--brand) 55%, transparent); }
.switch.on::after { transform: translateX(18px); background: var(--brand); }
.text-input {
  width: 100%;
  border-radius: 10px;
  background: var(--surface2);
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  caret-color: var(--brand);
}
.text-input::placeholder { color: var(--text3); }

.progress-bar { height: 4px; border-radius: 2px; background: var(--surface2); margin: 0 12px 6px; overflow: hidden; position: relative; }
.progress-bar > div { height: 100%; background: var(--brand); }
.progress-bar.indet > div { width: 35%; position: absolute; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

.banner { margin: 0 12px; aspect-ratio: 6.2; border-radius: 12px; background: var(--surface2); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; }

.ptr { height: 0; display: grid; place-items: center; overflow: visible; position: relative; z-index: 2; }
.ptr .spinner { position: absolute; top: 8px; }

/* ---------------------------------------------------------------- fogli e finestre */

.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 100; animation: fade-in 0.2s; }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0 auto;
  max-width: 640px;
  max-height: calc(100% - var(--sat) - 40px);
  z-index: 101;
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 28px 28px 0 0;
  padding-bottom: calc(24px + var(--sab));
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.28s cubic-bezier(.2,.8,.2,1);
  touch-action: pan-y;
}
.sheet.closing { animation: sheet-out 0.2s ease-in forwards; }
.scrim.closing { animation: fade-out 0.2s forwards; }
.sheet-handle { padding: 16px 0 10px; display: grid; place-items: center; flex: none; touch-action: none; }
.sheet-handle::after { content: ''; width: 32px; height: 4px; border-radius: 2px; background: var(--text3); opacity: 0.6; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-row { display: flex; align-items: center; gap: 20px; padding: 14px 20px; font-size: 15px; }
.sheet-title { padding: 10px 20px; }
.check-row { display: flex; align-items: center; gap: 18px; padding: 13px 20px; font-size: 15px; }
.check-box { width: 22px; height: 22px; border-radius: 4px; background: var(--surface3); display: grid; place-items: center; flex: none; color: var(--bg); }
.check-box.on { background: var(--text); }
.menu-row { display: flex; align-items: center; gap: 18px; padding: 15px 20px; font-size: 15px; }
.menu-row .v { color: var(--text2); font-size: 14px; }
.option-row { display: flex; align-items: center; padding: 14px 20px; font-size: 15px; }
.option-row .ck { width: 36px; color: var(--brand); }
.option-row.on { font-weight: 600; }

.dialog-wrap { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; background: var(--scrim); animation: fade-in 0.15s; }
.dialog { width: 100%; max-width: 360px; border-radius: 16px; background: var(--bg-elev); padding: 20px; animation: pop-in 0.18s cubic-bezier(.2,.8,.2,1); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--sab) + var(--bar-h) + 40px);
  transform: translateX(-50%);
  z-index: 200;
  max-width: calc(100% - 48px);
  background: color-mix(in srgb, var(--text) 92%, transparent);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 22px;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  animation: toast-in 0.2s ease-out;
  pointer-events: none;
  white-space: pre-line;
}
.toast.up { bottom: calc(var(--sab) + var(--bar-h) + 40px + var(--mini-h) + 8px); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes pop-in { from { transform: scale(0.94); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* commenti */
.comment { display: flex; padding: 8px 12px; gap: 10px; }
.comment .who { font-size: 12px; color: var(--text2); line-height: 16px; }
.comment .who.owner { font-weight: 600; }
.comment .txt { font-size: 14px; line-height: 20px; margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.comment .likes { display: flex; align-items: center; gap: 3px; margin-top: 4px; color: var(--text2); font-size: 12px; }
.replies-link { color: var(--link); font-size: 14px; font-weight: 600; padding: 6px 10px; margin: 0 0 8px 46px; border-radius: 999px; display: inline-block; }

.desc { white-space: pre-line; overflow-wrap: anywhere; }
.desc a { color: var(--link); text-decoration: none; }

/* schermi larghi (iPad, computer): schede video in griglia */
@media (min-width: 700px) {
  .grid-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0 16px; padding: 0 12px; }
  .grid-videos .video-card .thumb { border-radius: 12px; }
  .grid-videos .video-card .info { padding-left: 0; }
  .page-inner.wide { max-width: 1280px; }
}
