/* PodcastHub Design Lab · Time boxes, five options (B2, Rick, 2026-10-16)
   Uses ONLY tokens.css variables; --local-* values are derived from tokens with color-mix (listed in the B2 report). */

:root {
  --local-glow: color-mix(in srgb, var(--primary) 45%, transparent);
  --local-sheen: color-mix(in srgb, var(--ph-white) 55%, transparent);
  --local-hi: color-mix(in srgb, var(--ph-white) 85%, transparent);
  --local-shade: color-mix(in srgb, var(--ph-ink) 9%, transparent);
  --local-contact: color-mix(in srgb, var(--ph-ink) 14%, transparent);
  --local-drop: color-mix(in srgb, var(--ph-ink) 9%, transparent);
  --local-deep: var(--primary-active);
  --local-field-a: color-mix(in srgb, var(--primary) 30%, var(--canvas));
  --local-field-b: color-mix(in srgb, var(--secondary) 34%, var(--canvas));
  --local-field-c: color-mix(in srgb, var(--primary) 10%, var(--canvas));
  --local-card: color-mix(in srgb, var(--ph-white) 58%, transparent);
  --local-rail: var(--line);
}
[data-theme="dark"] {
  --local-glow: color-mix(in srgb, var(--secondary) 50%, transparent);
  --local-hi: color-mix(in srgb, var(--ph-white) 10%, transparent);
  --local-shade: color-mix(in srgb, var(--ph-ink) 60%, transparent);
  --local-contact: transparent; --local-drop: transparent;
  --local-field-a: color-mix(in srgb, var(--primary) 34%, var(--canvas));
  --local-field-b: color-mix(in srgb, var(--secondary) 20%, var(--canvas));
  --local-field-c: color-mix(in srgb, var(--primary) 12%, var(--canvas));
  --local-card: color-mix(in srgb, var(--surface) 62%, transparent);
  --local-rail: var(--line-strong);
}

@media (max-width: 430px) {
  .options { padding-inline: 0; }
  .option .label { padding-inline: 16px; }
  .option .frame { border-radius: 0; border-inline: 0; }
}

/* ---------- shared bits ---------- */
button { -webkit-tap-highlight-color: transparent; font: inherit; }
.ctx { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 14px; position: relative; }
.ctx .studio { font: 700 var(--fs-h3)/1.2 var(--font-display); font-stretch: var(--font-display-stretch); }
[dir="rtl"] .ctx .studio { font-family: var(--font-arabic); font-stretch: normal; }
.ctx .ask { font-size: var(--fs-ui); color: var(--fg-muted); }
.lbl { font-size: var(--fs-label); line-height: 1.25; color: var(--fg-subtle); font-weight: 500; }
.sum { margin-top: 16px; min-height: 76px; padding: 12px 14px; border-radius: var(--r-tile); background: var(--surface); border: 1px solid var(--line-subtle); display: flex; gap: 12px; align-items: center; position: relative; }
.sum .tick { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-fill); color: var(--primary-on); }
.sum .tick svg { width: 16px; height: 16px; }
.sum.empty .tick { background: var(--surface-sunken); color: var(--fg-subtle); }
.sum .what { font-size: var(--fs-ui); font-weight: 600; line-height: 1.35; }
.sum .more { font-size: var(--fs-ui); color: var(--fg-muted); line-height: 1.35; }
.sum.empty .what { color: var(--fg-muted); font-weight: 500; }
.sum.warn .tick { background: var(--accent-muted); color: var(--warning); }
.flip { display: inline-block; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.tk { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--primary-on); color: var(--primary-fill); flex: none; }
.tk svg { width: 11px; height: 11px; }
.pop-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.grp { font-size: var(--fs-label); color: var(--fg-subtle); font-weight: 600; letter-spacing: .02em; margin: 14px 0 8px; display: flex; justify-content: space-between; }
[dir="rtl"] .grp { letter-spacing: 0; }
.grp:first-of-type { margin-top: 0; }

/* the light-up (same recipe as the calendar page) */
.lit { box-shadow: 0 0 0 2px var(--primary), 0 0 14px 2px var(--local-glow) !important; }
.lit::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(120% 80% at 50% 0%, var(--local-sheen), transparent 60%); opacity: .55; pointer-events: none; }
.lit.pop { animation: pop var(--d-400) var(--ease-brand); }
.lit.pop::before { animation: sheen 520ms var(--ease-brand); }
@keyframes pop { 0% { transform: scale(var(--press-scale)); } 45% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes sheen { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: .55; } }

/* ============ OPTION 1 · Chips grid ============ */
.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.chip { position: relative; min-height: var(--t-button); padding: 6px 8px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; isolation: isolate; font-variant-numeric: tabular-nums; }
.chip .t { font-size: 17px; font-weight: 600; line-height: 1.2; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chip .s { font-size: var(--fs-label); line-height: 1.2; color: var(--fg-muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
button.chip { cursor: pointer; transition: transform var(--d-180) var(--ease-brand), background-color var(--d-120); }
button.chip:active { transform: scale(var(--press-scale)); transition-duration: var(--d-80); }
@media (hover: hover) { button.chip:hover { border-color: var(--line-strong); } }
.chip.taken { background: transparent; border-style: dashed; color: var(--fg-disabled); }
.chip.taken .t { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.chip.taken .s { color: var(--fg-subtle); }
.chip[aria-pressed="true"] { background: var(--primary-fill); border-color: transparent; color: var(--primary-on); }
.chip[aria-pressed="true"] .s { color: var(--primary-on); }

/* ============ OPTION 2 · Timeline rail ============ */
.rail { position: relative; }
.rail::before { content: ""; position: absolute; inset-block: 28px; inset-inline-start: 79px; width: 2px; background: var(--local-rail); border-radius: 1px; }
.rail .span-bar { position: absolute; inset-block-start: 0; inset-inline-start: 76px; width: 8px; height: calc(12 * var(--t-row)); border-radius: 4px; background: var(--primary-fill); transform-origin: top; transform: translateY(calc(var(--s) * var(--t-row))) scaleY(calc(var(--n) / 12)); transition: transform var(--d-260) var(--ease-brand), opacity var(--d-180); opacity: 0; box-shadow: 0 0 12px var(--local-glow); }
.rail .span-bar.on { opacity: 1; }
.rail .band { position: absolute; inset-inline: 0; border-radius: 14px; background: var(--primary-muted); top: calc(var(--s) * var(--t-row)); height: calc(var(--n) * var(--t-row)); opacity: 0; transition: opacity var(--d-180); }
.rail .band.on { opacity: 1; }
.rail::before { z-index: 0; }
.row { position: relative; width: 100%; min-height: var(--t-row); display: grid; grid-template-columns: 56px 32px 1fr auto; align-items: center; gap: 0 8px; padding: 0 12px 0 0; border: 0; border-radius: 14px; background: none; color: var(--fg); text-align: start; isolation: isolate; }
[dir="rtl"] .row { padding: 0 0 0 12px; }
.row .h { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; }
.row .node { justify-self: center; width: 12px; height: 12px; border-radius: 50%; background: var(--canvas); border: 2px solid var(--line-strong); z-index: 1; }
.row .what { font-size: var(--fs-ui); color: var(--fg-muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.row .tag { font-size: var(--fs-label); font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); background: var(--primary-fill); color: var(--primary-on); display: inline-flex; align-items: center; gap: 5px; }
button.row { cursor: pointer; transition: background-color var(--d-120), transform var(--d-180) var(--ease-brand); }
button.row:active { transform: scale(0.985); }
@media (hover: hover) { button.row:hover { background: var(--surface-hover); } }
.row.taken { color: var(--fg-disabled); }
.row.taken .h { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.row.taken .node { border-style: dashed; }
.row.taken .what { color: var(--fg-subtle); }
.row.inrange { background: transparent; }
.row.inrange .node { background: var(--primary-fill); border-color: var(--primary-fill); }
.row.inrange .what { color: var(--fg); font-weight: 600; }
.row.edge .node { width: 16px; height: 16px; border: 3px solid var(--primary-on); box-shadow: 0 0 0 2px var(--primary-fill), 0 0 10px var(--local-glow); background: var(--primary-fill); }
.rail-hint { font-size: var(--fs-ui); color: var(--fg-muted); margin: 0 0 8px; min-height: 24px; }
.rail-hint.warn { color: var(--warning); font-weight: 600; }

/* ============ OPTION 3 · Glass cards over a grainy one-hue field (A8) ============ */
.option .frame.field { background:
    radial-gradient(70% 55% at 15% 10%, var(--local-field-a), transparent 70%),
    radial-gradient(60% 50% at 95% 60%, var(--local-field-b), transparent 70%),
    radial-gradient(80% 60% at 30% 100%, var(--local-field-c), transparent 70%), var(--canvas); isolation: isolate; }
.option .frame.field::after { content: ""; position: absolute; inset: 0; background-image: var(--grain); opacity: .85; mix-blend-mode: overlay; pointer-events: none; z-index: 0; }   /* token grain α .06 × .85 ≈ 5 % */
.field > * { position: relative; z-index: 1; }
.gcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gcard { position: relative; min-height: 104px; padding: 12px 8px 10px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--fg); isolation: isolate;
  background: var(--local-card); -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)); border: 1px solid var(--glass-stroke); box-shadow: var(--glass-shadow); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .gcard { background: var(--surface); } }
@media (prefers-reduced-transparency: reduce) { .gcard { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.gcard .t { font: 700 22px/1.15 var(--font-display); font-stretch: var(--font-display-stretch); font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .gcard .t { font-family: var(--font-arabic); font-stretch: normal; font-size: 19px; }
[dir="rtl"] .gcard .p { white-space: normal; text-align: center; }
.gcard .p { font-size: var(--fs-label); color: var(--fg-muted); white-space: nowrap; }
.gcard .st { margin-top: 4px; font-size: var(--fs-label); font-weight: 600; padding: 2px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); display: inline-flex; align-items: center; gap: 5px; text-align: center; line-height: 1.3; }
button.gcard { cursor: pointer; transition: transform var(--d-180) var(--ease-brand); }
button.gcard:active { transform: scale(var(--press-scale)); }
.gcard.taken { background: color-mix(in srgb, var(--surface) 30%, transparent); color: var(--fg-subtle); border-style: dashed; border-color: color-mix(in srgb, var(--fg) 20%, transparent); }
.gcard.taken .t { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.gcard.taken .st { background: transparent; color: var(--fg-subtle); }
.gcard[aria-pressed="true"] { background: color-mix(in srgb, var(--primary-fill) 88%, transparent); color: var(--primary-on); border-color: color-mix(in srgb, var(--ph-white) 50%, transparent); }
.gcard[aria-pressed="true"] .p { color: var(--primary-on); }
.gcard[aria-pressed="true"] .st { background: var(--primary-on); color: var(--primary-fill); }
.field .sum { background: var(--local-card); -webkit-backdrop-filter: blur(var(--glass-blur)); backdrop-filter: blur(var(--glass-blur)); border-color: var(--glass-stroke); }

/* ============ OPTION 4 · Segmented hours + length stepper ============ */
.seg-card { background: var(--surface); border: 1px solid var(--line-subtle); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: 16px; }
.seg-card .cap { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.seg-card .cap b { font-size: var(--fs-ui); }
.seg-wrap { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; scroll-snap-type: x proximity; margin-inline: -4px; padding: 4px; }
.seg-wrap::-webkit-scrollbar { display: none; }
.seg { position: relative; display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-sunken); }
.seg .thumb { position: absolute; top: 4px; left: 0; height: var(--t-min); width: 72px; border-radius: var(--r-pill); background: var(--primary-fill); box-shadow: 0 2px 8px var(--local-glow); transition: transform var(--d-260) var(--ease-brand), opacity var(--d-180); opacity: 0; }
.seg .thumb.on { opacity: 1; }
.sg { position: relative; z-index: 1; flex: none; width: 72px; height: var(--t-min); border-radius: var(--r-pill); border: 0; background: none; color: var(--fg); display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; scroll-snap-align: center; white-space: nowrap; }
[dir="rtl"] .sg { width: 84px; font-size: 16px; }
[dir="rtl"] .seg .thumb { width: 84px; }
button.sg { cursor: pointer; transition: color var(--d-180); }
.sg[aria-pressed="true"] { color: var(--primary-on); }
.sg.taken { color: var(--fg-disabled); text-decoration: line-through; text-decoration-thickness: 1.5px; font-weight: 500; }
.sg .pop-dot { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; width: 6px; height: 6px; }
.seg-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: var(--fs-label); color: var(--fg-muted); }
.seg-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seg-legend s { color: var(--fg-disabled); }
.stepper { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-subtle); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper .cap2 b { display: block; font-size: var(--fs-ui); }
.stepper .ctrl { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--surface-sunken); }
.stepper .ctrl button { width: var(--t-button); height: var(--t-button); border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: grid; place-items: center; cursor: pointer; transition: transform var(--d-180) var(--ease-brand); }
.stepper .ctrl button:active { transform: scale(var(--press-scale)); }
.stepper .ctrl button:disabled { color: var(--fg-disabled); background: transparent; border-color: transparent; cursor: default; }
.stepper .ctrl svg { width: 20px; height: 20px; }
.stepper .val { min-width: 76px; text-align: center; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper .val small { display: block; font-size: var(--fs-label); font-weight: 500; color: var(--fg-muted); }

/* ============ OPTION 5 · Tactile keys (keypad) ============ */
.readout { margin-bottom: 14px; border-radius: 18px; padding: 12px 16px; background: var(--surface-sunken); box-shadow: inset 0 2px 6px var(--local-shade), inset 0 -1px 0 var(--local-hi); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
[data-theme="dark"] .readout { border: 1px solid var(--line); }
.readout .lcd { font: 700 26px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; color: var(--fg-disabled); letter-spacing: .02em; white-space: nowrap; }
.readout.on .lcd { color: var(--primary-ink); text-shadow: 0 0 12px var(--local-glow); }
.readout .lbl { text-align: end; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px; }
.key { position: relative; min-height: 72px; border-radius: 18px; border: 1px solid var(--line-subtle); padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--fg); isolation: isolate;
  background: linear-gradient(to bottom, var(--surface-raised), var(--surface));
  box-shadow: inset 0 1px 0 var(--local-hi), inset 0 -3px 0 var(--local-shade), 0 1px 2px var(--local-contact), 0 6px 14px var(--local-drop); }
[data-theme="dark"] .key { border-color: var(--line-strong); background: linear-gradient(to bottom, var(--surface-active), var(--surface-raised)); }
button.key { cursor: pointer; transition: transform var(--d-180) var(--ease-brand); }
button.key:active { transform: translateY(1px) scale(var(--press-scale)); box-shadow: inset 0 2px 6px var(--local-shade); transition-duration: var(--d-80); }
.key .t { font: 700 20px/1.15 var(--font-display); font-stretch: var(--font-display-stretch); font-variant-numeric: tabular-nums; white-space: nowrap; }
[dir="rtl"] .key .t { font-family: var(--font-arabic); font-stretch: normal; font-size: 19px; }
.key .s { font-size: var(--fs-label); color: var(--fg-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.key .led { position: absolute; inset-block-start: 8px; inset-inline-start: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.key.sunk { background: var(--surface-sunken); border-color: transparent; box-shadow: inset 0 2px 6px var(--local-shade), inset 0 -1px 0 var(--local-hi); color: var(--fg-subtle); }
[data-theme="dark"] .key.sunk { border-color: var(--line); background: var(--surface-sunken); }
.key.sunk .t { color: var(--fg-disabled); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.key[aria-pressed="true"] { background: linear-gradient(to bottom, var(--primary-fill), var(--local-deep)); color: var(--primary-on); border-color: transparent; }
.key[aria-pressed="true"] .s { color: var(--primary-on); }
.key[aria-pressed="true"] .led { background: var(--primary-on); box-shadow: 0 0 8px 2px color-mix(in srgb, var(--primary-on) 70%, transparent); }
.key.lit { box-shadow: var(--tactile-shadow), 0 0 0 2px var(--primary), 0 0 16px 3px var(--local-glow) !important; }

@media (prefers-reduced-motion: reduce) {
  .lit.pop, .lit.pop::before { animation: none; }
  .chip, .row, .gcard, .key, .sg, .seg .thumb, .rail .span-bar, .stepper .ctrl button { transition: background-color var(--d-120) !important; }
  button.chip:active, button.row:active, button.gcard:active, button.key:active, .stepper .ctrl button:active { transform: none; }
}
