/* ============================================================
   Installable app shell (phones ≤ 520px, and the installed app)
   ------------------------------------------------------------
   Pages render a mobile copy of their content inside `.tfm` and keep the
   desktop markup inside `.tfd`; these media queries show exactly one of them,
   so desktop layouts never change. Everything here is prefixed `tm-` (and the
   tokens `--tm-`) so it can't collide with Tailwind utilities or the older
   `tlf-`/`tf-` styles.

   `.tfm` only ever goes on a plain wrapper with no display of its own: the
   standalone rule below reverts it to the element's default display.

   Dark is the default. Light mode is opt-in per page (html[data-app-theme],
   set by pages built from tokens) and per visitor (html[data-mode=light],
   set from localStorage before first paint by the layout).
   ============================================================ */

@media (min-width: 521px) { .tfm { display: none !important; } }
@media (min-width: 521px) and (display-mode: standalone) { .tfm { display: revert !important; } }
@media (max-width: 520px), (display-mode: standalone) { .tfd { display: none !important; } }

:root {
  --tm-bg: #09090B;
  --tm-surface: #0D0D10;
  --tm-text: #F3F3F0;
  --tm-muted: #9A9AA4;
  --tm-line: #1C1C21;
  --tm-line-strong: #2C2C33;
  --tm-chip: #18181D;
  --tm-dash: #4E4E57;
  --tm-accent: #D9FF52;
  --tm-accent-hover: #E8FF7A;
  --tm-accent-text: #D9FF52;
  --tm-accent-soft: rgba(217, 255, 82, 0.14);
  --tm-accent-ring: rgba(217, 255, 82, 0.32);
  --tm-on-accent: #08080A;
  --tm-eq: #D9FF52;
  --tm-deep: #16161B;
  --tm-on-deep: #F3F3F0;
  --tm-on-deep-muted: #9A9AA4;
  --tm-on-deep-line: #2C2C33;
  --tm-spotify: #1ED760;
  --tm-on-spotify: #08080A;
  --tm-youtube: #FF332C;
  --tm-danger: #FF7A6B;
  --tm-ok: #59C466;
  --tm-scrim: rgba(0, 0, 0, 0.62);
  --tm-shadow: rgba(0, 0, 0, 0.6);
  --tm-glow: rgba(217, 255, 82, 0.10);
  --tm-c1: #D9FF52; --tm-c2: #58B8F8; --tm-c3: #59C466; --tm-c4: #FFDD57; --tm-c5: #A78BFA; --tm-c6: #FF7A5C;
  --tm-font: Archivo, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --tm-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --tm-tabbar-h: 62px;
  --tm-gutter: max(16px, env(safe-area-inset-left, 0px));
  --tm-gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

:root[data-app-theme][data-mode="light"] {
  --tm-bg: #F3F3F0;
  --tm-surface: #FFFFFF;
  --tm-text: #0D0D10;
  --tm-muted: #5E5E68;
  --tm-line: #E3E3DE;
  --tm-line-strong: #CFCFC8;
  --tm-chip: #E9E9E4;
  --tm-dash: #A3A3AD;
  --tm-accent-hover: #CFF53D;
  --tm-accent-text: #4A6400;
  --tm-accent-soft: #EDF8C4;
  --tm-accent-ring: #B9D63A;
  --tm-eq: #0D0D10;
  --tm-deep: #0D0D10;
  --tm-on-deep-muted: #A3A3AD;
  --tm-danger: #B83A26;
  --tm-ok: #2E9E3E;
  --tm-scrim: rgba(13, 13, 16, 0.36);
  --tm-shadow: rgba(13, 13, 16, 0.16);
  --tm-glow: rgba(217, 255, 82, 0);
}

@media (max-width: 520px), (display-mode: standalone) {
  /* The cookie banner sits above the tab bar. */
  body.tm-body [data-controller~="consent-panel"] { bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 60; }
  html[data-app-theme] { color-scheme: dark; background: var(--tm-bg); }
  html[data-app-theme][data-mode="light"] { color-scheme: light; }
  html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 60px); }
  body.tlf-body { -webkit-tap-highlight-color: transparent; }
  body.tlf-body.tm-body { background: var(--tm-bg); color: var(--tm-text); padding-bottom: 0; }
  body.tm-body .tlf-main { padding: 0; }
  /* Legacy pages keep their own markup on phones: give them room above the tab bar. */
  body.tm-body:not(.tm-app-screen) .tlf-main { padding: 0 18px calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
  body.tm-has-mini:not(.tm-app-screen) .tlf-main { padding-bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 96px); }

  /* Flash messages become the app's top toasts. */
  #toast-region { left: 50%; right: auto; top: calc(env(safe-area-inset-top, 0px) + 8px); width: calc(100% - 32px); max-width: 420px; transform: translateX(-50%); align-items: center; z-index: 90; }
  #toast-region .tlf-flash { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--tm-text); color: var(--tm-bg); font: 650 14px/1.35 var(--tm-font); box-shadow: 0 10px 24px -6px var(--tm-shadow); animation: tm-toast-in .3s cubic-bezier(.2, .8, .2, 1) both; }
  #toast-region .tlf-flash::before { content: ""; flex: none; width: 18px; height: 18px; background: var(--tm-accent); -webkit-mask: var(--tm-check-mask) center / contain no-repeat; mask: var(--tm-check-mask) center / contain no-repeat; }
  #toast-region .tlf-flash[role="alert"]::before { background: var(--tm-danger); -webkit-mask-image: var(--tm-alert-mask); mask-image: var(--tm-alert-mask); }
  #toast-region .tlf-flash.translate-x-\[120\%\] { transform: translateY(-20px); }
}

:root {
  --tm-check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --tm-alert-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
}

@keyframes tm-toast-in { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }

/* The installed app on a wide window (desktop install): keep the phone column. */
@media (min-width: 521px) and (display-mode: standalone) {
  body.tm-body { max-width: 560px; margin-inline: auto; box-shadow: 0 0 0 1px var(--tm-line); }
  .tm-tabbar, .tm-clip, .tm-sheet-layer, #global-player.tf-player--app { max-width: 560px; margin-inline: auto; }
}

/* iOS draws white status-bar text over the page in the installed app; in light
   mode that text needs something dark behind it. */
.tm-statusbar { display: none; }
@media (display-mode: standalone) {
  :root[data-app-theme][data-mode="light"] .tm-statusbar { display: block; position: fixed; inset: 0 0 auto; z-index: 95; height: env(safe-area-inset-top, 0px); background: #0D0D10; pointer-events: none; }
}

/* ---------- base ---------- */
.tm-screen, .tm-nav, .tm-tabbar, .tm-sheet, .tm-clip { font-family: var(--tm-font); color: var(--tm-text); -webkit-font-smoothing: antialiased; }
.tm-screen :focus-visible, .tm-nav :focus-visible, .tm-tabbar :focus-visible, .tm-sheet :focus-visible, #global-player :focus-visible, .tm-clip :focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 2px; }
:root[data-app-theme][data-mode="light"] :is(.tm-screen, .tm-nav, .tm-tabbar, .tm-sheet, #global-player, .tm-clip) :focus-visible { outline-color: var(--tm-text); }
/* Zero-specificity resets, so every component class below wins over them. */
:where(.tm-screen, .tm-sheet, .tm-nav, #global-player) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.tm-screen, .tm-sheet) :where(a) { color: inherit; text-decoration: none; }
.tm-mono { font-family: var(--tm-mono); }
.tm-num { font-variant-numeric: tabular-nums; }
.tm-ellip { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-clamp2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tm-hidden, .tm-screen [hidden], .tm-sheet [hidden] { display: none !important; }

/* ---------- top nav ---------- */
.tm-nav { position: sticky; top: 0; z-index: 30; box-sizing: content-box; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: 52px;
  padding: env(safe-area-inset-top, 0px) var(--tm-gutter-r) 0 max(8px, env(safe-area-inset-left, 0px)); background: var(--tm-bg); border-bottom: 1px solid transparent; transition: border-color .2s; }
.tm-nav.is-scrolled { border-bottom-color: var(--tm-line); }
.tm-nav__left { display: flex; min-width: 0; align-items: center; }
.tm-nav__right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.tm-nav__title { max-width: 190px; overflow: hidden; font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.tm-nav.is-scrolled .tm-nav__title, .tm-nav--titled .tm-nav__title { opacity: 1; }
.tm-back { display: inline-flex; min-width: 0; height: 44px; align-items: center; gap: 2px; padding: 0 8px 0 2px; border: 0; background: none; color: var(--tm-text); font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tm-back svg { flex: none; color: var(--tm-accent-text); }
.tm-back span { max-width: 104px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tm-brand { display: flex; align-items: center; gap: 10px; padding-left: 8px; color: var(--tm-text); font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; text-decoration: none; }
.tm-brand__dim { color: var(--tm-muted); }
.tm-eq { display: inline-flex; flex: none; align-items: flex-end; gap: 2px; height: 18px; }
.tm-eq i { width: 3px; height: 100%; background: var(--tm-eq); transform-origin: center bottom; animation: tm-eqbar 1.1s ease-in-out infinite; }
.tm-eq i:nth-child(2) { animation-delay: .18s; }
.tm-eq i:nth-child(3) { animation-delay: .36s; }
.tm-eq--still i { animation: none; }
.tm-eq--still i:nth-child(1) { height: 55%; }
.tm-eq--still i:nth-child(3) { height: 75%; }
@keyframes tm-eqbar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.tm-icon-btn { position: relative; display: grid; flex: none; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 22px; background: var(--tm-chip); color: var(--tm-text); cursor: pointer; text-decoration: none; }
.tm-icon-btn[aria-pressed="true"] { background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-nav .tm-icon-btn { width: 40px; height: 40px; }
.tm-nav .tm-icon-btn::after, .tm-sheet__head .tm-icon-btn::after { content: ""; position: absolute; inset: -2px; }
.tm-nav form { display: contents; }
.tm-mode-moon { display: none; }
:root[data-mode="light"] .tm-mode-sun { display: none; }
:root[data-mode="light"] .tm-mode-moon { display: block; }
.tm-avatar { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 20px; background: var(--tm-accent); color: var(--tm-on-accent); font-size: 15px; font-weight: 800; text-decoration: none; }
.tm-pill-btn { display: inline-flex; height: 40px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--tm-line-strong); border-radius: 20px; background: transparent; color: var(--tm-text); font: 500 11px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap; }

/* ---------- screens ---------- */
.tm-screen { position: relative; display: flex; flex-direction: column; gap: 16px; overflow-x: clip;
  padding: 4px var(--tm-gutter-r) calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 28px) var(--tm-gutter); }
.tm-has-mini .tm-screen { padding-bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 100px); }
.tm-screen > * { flex: none; min-width: 0; }
.tm-screen--glow::before { content: ""; position: absolute; left: -80px; top: -100px; width: 340px; height: 300px; background: radial-gradient(closest-side, var(--tm-glow), transparent); pointer-events: none; }
.tm-large { margin: 0; font-size: 36px; font-weight: 800; line-height: .95; letter-spacing: -0.045em; text-wrap: balance; }
.tm-lede { max-width: 34ch; margin: -4px 0 0; color: var(--tm-muted); font-size: 15px; line-height: 1.5; }
.tm-eyebrow { margin: 0 0 -10px; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .14em; text-transform: uppercase; }
.tm-sec { margin: 0; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.tm-sec--sm { font-size: 18px; letter-spacing: -0.03em; }
.tm-sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 10px 0 -6px; }
.tm-see-all { position: relative; display: inline-flex; flex: none; height: 32px; align-items: center; padding: 0 12px; border: 1px solid var(--tm-line-strong); border-radius: 16px; background: none; color: var(--tm-text); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; }
.tm-see-all::after { content: ""; position: absolute; inset: -6px -2px; }
.tm-link-btn { display: inline-flex; min-height: 44px; align-items: center; gap: 4px; padding: 0 2px; border: 0; background: none; color: var(--tm-accent-text); font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tm-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); }
.tm-card--row { flex-direction: row; align-items: center; gap: 14px; }
.tm-note { margin: 0; color: var(--tm-muted); font-size: 14px; line-height: 1.5; }
.tm-note strong, .tm-note b { color: var(--tm-text); }
.tm-note--sm { font-size: 13px; }
.tm-fine { display: flex; justify-content: center; gap: 14px; margin: -6px 0 0; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .12em; text-transform: uppercase; }
.tm-divider { height: 1px; background: var(--tm-line); }

/* ---------- buttons ---------- */
.tm-btn { display: inline-flex; height: 52px; box-sizing: border-box; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; cursor: pointer; transition: background-color .15s, transform .1s; }
.tm-btn--primary { background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-btn--primary:hover { background: var(--tm-accent-hover); }
.tm-btn--ghost { border: 1px solid var(--tm-line-strong); background: transparent; color: var(--tm-text); }
.tm-btn--spotify { background: var(--tm-spotify); color: var(--tm-on-spotify); }
.tm-btn--google { flex: none; gap: 12px; border: 1px solid var(--tm-line-strong); background: #FFFFFF; color: #1F1F1F; }
.tm-btn--danger { color: var(--tm-danger); }
.tm-btn--block { width: 100%; }
.tm-btn[disabled] { opacity: .55; cursor: not-allowed; }
.tm-btn:active, .tm-row:active, .tm-tile:active, .tm-trk:active, .tm-acard:active { transform: scale(.985); }
.tm-screen form.button_to, .tm-sheet form.button_to { display: contents; }

/* ---------- forms ---------- */
.tm-label { color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .12em; text-transform: uppercase; }
.tm-field-label { color: var(--tm-muted); font-size: 14px; font-weight: 650; }
.tm-input { display: flex; height: 52px; box-sizing: border-box; align-items: center; gap: 10px; padding: 0 6px 0 14px; border: 1px solid var(--tm-line-strong); border-radius: 12px; background: var(--tm-bg); color: var(--tm-muted); }
.tm-input input { flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 0; border: 0; outline: none; background: transparent; color: var(--tm-text); font-size: 16px; }
.tm-input input::placeholder, .tm-search input::placeholder { color: var(--tm-muted); }
.tm-input--url input::placeholder { font-family: var(--tm-mono); font-size: 13px; }
.tm-input:focus-within, .tm-search:focus-within { border-color: var(--tm-accent-ring); box-shadow: 0 0 0 3px var(--tm-accent-soft); }
.tm-input.is-error { border-color: var(--tm-danger); }
.tm-input--readonly { padding-right: 14px; background: var(--tm-chip); color: var(--tm-muted); font-size: 16px; }
.tm-yt { display: grid; flex: none; color: var(--tm-youtube); }
.tm-paste { flex: none; height: 38px; padding: 0 12px; border: 1px solid var(--tm-line-strong); border-radius: 9px; background: var(--tm-chip); color: var(--tm-text); font: 600 11px var(--tm-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.tm-err { margin: -4px 0 0; color: var(--tm-danger); font-size: 13px; line-height: 1.4; }
.tm-fgroup { display: flex; flex-direction: column; gap: 8px; }
.tm-fgroup .tm-err { margin: 0; }
.tm-form { display: flex; flex-direction: column; gap: 14px; }
.tm-check { display: flex; align-items: flex-start; gap: 12px; color: var(--tm-muted); font-size: 14px; font-weight: 600; line-height: 1.45; cursor: pointer; }
.tm-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--tm-accent); }
.tm-inline-link { color: var(--tm-accent-text); font-weight: 600; text-decoration: none; }
.tm-search { display: flex; height: 48px; box-sizing: border-box; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--tm-line-strong); border-radius: 12px; background: var(--tm-surface); color: var(--tm-muted); }
.tm-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--tm-text); font-size: 16px; -webkit-appearance: none; appearance: none; }
.tm-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tm-or { display: flex; flex: none; align-items: center; gap: 14px; color: var(--tm-muted); font-size: 14px; }
.tm-or::before, .tm-or::after { content: ""; flex: 1; height: 1px; background: var(--tm-line); }
.tm-switch-row { margin: 0; color: var(--tm-muted); font-size: 15px; text-align: center; }
.tm-switch-row a, .tm-switch-row button { display: inline-flex; min-height: 44px; align-items: center; padding: 0; border: 0; background: none; color: var(--tm-accent-text); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tm-forgot { align-self: flex-end; display: inline-flex; min-height: 36px; align-items: center; margin-top: -6px; color: var(--tm-accent-text); font-size: 14px; font-weight: 600; text-decoration: none; }

/* ---------- lists ---------- */
.tm-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.tm-row { display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 12px; padding: 12px 0; border: 0; border-bottom: 1px solid var(--tm-line); background: none; color: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: transform .1s; }
.tm-row--static { cursor: default; }
.tm-row__main { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 6px; }
.tm-row__main--tight { gap: 2px; }
.tm-row__title { font-size: 15px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.tm-row__sub { overflow: hidden; color: var(--tm-muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.tm-row__sub--wrap { font-size: 12.5px; line-height: 1.4; white-space: normal; }
.tm-row__meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; color: var(--tm-muted); font-size: 12.5px; }
.tm-row__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.tm-boxed { padding: 0 14px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); }
.tm-boxed > li:last-child > .tm-row, .tm-boxed > .tm-row:last-child, .tm-boxed > li:last-child.tm-row { border-bottom: 0; }
.tm-group .tm-row { min-height: 56px; }
.tm-status { display: inline-flex; align-items: center; gap: 6px; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.tm-status i { flex: none; width: 6px; height: 6px; border-radius: 3px; background: var(--tm-accent); }
.tm-status--on { color: var(--tm-accent-text); }
.tm-views { color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; font-variant-numeric: tabular-nums; }
:root[data-app-theme][data-mode="light"] .tm-status i { box-shadow: 0 0 0 1px var(--tm-accent-ring); }
.tm-pill { display: inline-flex; align-self: flex-start; height: 24px; align-items: center; padding: 0 9px; border: 1px solid var(--tm-line-strong); border-radius: 12px; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .08em; text-transform: uppercase; }
.tm-chev { display: grid; flex: none; color: var(--tm-dash); }
.tm-count { flex: none; color: var(--tm-muted); font: 12px var(--tm-mono); font-variant-numeric: tabular-nums; }
.tm-row-ico { display: grid; flex: none; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--tm-chip); color: var(--tm-text); }
.tm-row-ico--big { width: 48px; height: 48px; border-radius: 12px; background: var(--tm-accent-soft); color: var(--tm-accent-text); }
.tm-rank { flex: none; width: 24px; color: var(--tm-muted); font: 12px var(--tm-mono); font-variant-numeric: tabular-nums; }
.tm-metric { display: flex; flex: none; width: 76px; flex-direction: column; align-items: flex-end; gap: 6px; font: 11.5px var(--tm-mono); letter-spacing: .04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.tm-meter { display: block; width: 76px; height: 4px; overflow: hidden; border-radius: 2px; background: var(--tm-chip); }
.tm-meter svg { display: block; width: 100%; height: 100%; }
:root[data-app-theme][data-mode="light"] .tm-meter rect { fill: var(--tm-text); }

/* Cue colours: rows, stripes, timeline segments, meters. */
.tm-c1 { --cue: var(--tm-c1); } .tm-c2 { --cue: var(--tm-c2); } .tm-c3 { --cue: var(--tm-c3); }
.tm-c4 { --cue: var(--tm-c4); } .tm-c5 { --cue: var(--tm-c5); } .tm-c6 { --cue: var(--tm-c6); }
svg .tm-c1, svg .tm-c2, svg .tm-c3, svg .tm-c4, svg .tm-c5, svg .tm-c6 { fill: var(--cue); }

.tm-cover { display: flex; flex: none; width: 60px; height: 60px; box-sizing: border-box; align-items: center; padding: 0 9px; border: 1px solid var(--tm-on-deep-line); border-radius: 10px; background: var(--tm-deep); }
.tm-cover svg { display: block; width: 100%; height: 10px; }
.tm-cover__dash { width: 100%; border-top: 2px dashed var(--tm-on-deep-line); }
.tm-cover--thumb { padding: 0; overflow: hidden; }
.tm-cover--thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- chips + segmented ---------- */
.tm-chips { display: flex; gap: 8px; overflow-x: auto; margin-inline: calc(-1 * var(--tm-gutter)) calc(-1 * var(--tm-gutter-r)); padding-inline: var(--tm-gutter) var(--tm-gutter-r); scrollbar-width: none; }
.tm-chips::-webkit-scrollbar, .tm-rail::-webkit-scrollbar { display: none; }
.tm-chip { display: flex; flex: none; height: 44px; box-sizing: border-box; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--tm-line-strong); border-radius: 20px; background: transparent; color: var(--tm-text); font-size: 14px; font-weight: 650; white-space: nowrap; text-decoration: none; }
.tm-chip span { color: var(--tm-muted); font: 400 11px var(--tm-mono); }
.tm-chip[aria-current="true"], .tm-chip[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-chip[aria-current="true"] span, .tm-chip[aria-pressed="true"] span { color: inherit; opacity: .7; }
.tm-seg { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; padding: 3px; border: 1px solid var(--tm-line); border-radius: 12px; background: var(--tm-surface); }
.tm-seg > a, .tm-seg > button { display: grid; height: 44px; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--tm-muted); font-size: 14px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tm-seg > [aria-current="true"], .tm-seg > [aria-selected="true"], .tm-seg > [aria-pressed="true"] { background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-seg--mini { flex: none; padding: 2px; border-radius: 10px; }
.tm-seg--mini > button { height: 36px; padding: 0 12px; font-size: 13px; }

/* ---------- Find (home) ---------- */
.tm-hero { margin: 0; font-size: 44px; font-weight: 800; line-height: .9; letter-spacing: -0.045em; text-wrap: balance; }
.tm-install { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); }
.tm-install p { margin: 0; color: var(--tm-muted); font-size: 13px; line-height: 1.4; }
.tm-install strong { display: block; margin-bottom: 2px; color: var(--tm-text); font-size: 14px; }
.tm-install .tm-icon-btn { background: transparent; color: var(--tm-muted); }
.tm-install__go { margin-top: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.tm-app-icon { display: grid; flex: none; width: 44px; height: 44px; place-items: center; border-radius: 11px; background: #09090B; box-shadow: 0 0 0 1px var(--tm-line-strong); }
.tm-app-icon .tm-eq i { background: #D9FF52; }
.tm-steps { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: 15px; }
.tm-steps li { display: flex; align-items: center; gap: 12px; color: var(--tm-muted); }
.tm-steps .tm-dot { display: grid; flex: none; width: 24px; height: 24px; box-sizing: border-box; place-items: center; border: 2px solid var(--tm-line-strong); border-radius: 12px; }
.tm-steps .tm-dot svg { display: none; }
.tm-steps li.is-active { color: var(--tm-text); font-weight: 700; }
.tm-steps li.is-active .tm-dot { border-color: var(--tm-accent-text); }
.tm-steps li.is-active .tm-dot::after { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--tm-accent-text); animation: tm-pulse 1s ease-in-out infinite; }
.tm-steps li.is-complete { color: var(--tm-text); }
.tm-steps li.is-complete .tm-dot { border: 0; background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-steps li.is-complete .tm-dot svg { display: block; }
@keyframes tm-pulse { 50% { transform: scale(.55); } }
.tm-fill { display: flex; height: 12px; align-items: center; gap: 2px; padding: 8px; border-radius: 10px; background: var(--tm-deep); }
.tm-fill i { height: 100%; flex: 0 1 0; border-radius: 2px; background: var(--cue); transition: flex-grow .6s ease; }
.tm-fill i.is-on { flex-grow: 1; }
.tm-fill .tm-fill__rest { height: 0; flex: 1 1 0; border-top: 2px dashed var(--tm-on-deep-line); transition: flex-grow .6s ease; }
.tm-work-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tm-small-muted { margin: 0; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; }
.tm-rail { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--tm-gutter)) calc(-1 * var(--tm-gutter-r)); padding-inline: var(--tm-gutter) var(--tm-gutter-r); scrollbar-width: none; }
.tm-tile { display: flex; flex: none; width: 148px; height: 112px; box-sizing: border-box; flex-direction: column; justify-content: space-between; padding: 12px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); color: var(--tm-text); text-align: left; text-decoration: none; scroll-snap-align: start; transition: transform .1s, border-color .15s; }
.tm-tile b { font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.tm-tile span { color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; }
.tm-tile--feat { border-color: var(--tm-accent); background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-tile--feat span { color: var(--tm-on-accent); opacity: .75; }
.tm-tile em { align-self: flex-start; padding: 3px 7px; border-radius: 6px; background: var(--tm-on-accent); color: var(--tm-accent); font: normal 9.5px var(--tm-mono); letter-spacing: .12em; text-transform: uppercase; }
.tm-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 8px 0 0; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; }
.tm-legal a, .tm-legal button { display: inline-flex; min-height: 36px; align-items: center; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }

/* About + FAQ under the app content in the browser (SEO copy). Not in the installed app. */
.tm-about { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-top: 20px; border-top: 1px solid var(--tm-line); }
.tm-about p { margin: 0; color: var(--tm-muted); font-size: 14px; line-height: 1.55; }
.tm-faq details { border-bottom: 1px solid var(--tm-line); }
.tm-faq summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.tm-faq summary::-webkit-details-marker { display: none; }
.tm-faq summary::after { content: "+"; flex: none; color: var(--tm-accent-text); font: 18px var(--tm-mono); }
.tm-faq details[open] summary::after { content: "\2013"; }
.tm-faq summary h3 { margin: 0; font: inherit; }
.tm-faq details > p { margin: 0 0 14px; color: var(--tm-muted); font-size: 14px; line-height: 1.55; }
@media (display-mode: standalone) { .tm-about { display: none; } }

/* ---------- tracklist (set) ---------- */
.tm-video { position: relative; display: block; width: 100%; overflow: hidden; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--tm-on-deep-line); border-radius: 16px; background: var(--tm-deep); color: var(--tm-on-deep-muted); text-decoration: none; cursor: pointer; }
.tm-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.tm-video__play { position: absolute; top: 50%; left: 50%; display: grid; width: 60px; height: 60px; place-items: center; margin: -30px 0 0 -30px; border-radius: 30px; background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-video__label { position: absolute; left: 12px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; background: rgba(8, 8, 10, .72); color: #F3F3F0; font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; }
.tm-video__label svg { color: var(--tm-youtube); }
.tm-set-title { margin: 0; font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; text-wrap: balance; overflow-wrap: anywhere; }
.tm-set-meta { margin: -6px 0 0; color: var(--tm-muted); font-size: 14px; }
.tm-set-meta strong { color: var(--tm-text); }
.tm-deck { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 10px; border: 1px solid var(--tm-on-deep-line); border-radius: 16px; background: var(--tm-deep); color: var(--tm-on-deep); }
.tm-timeline { position: relative; height: 44px; cursor: pointer; touch-action: manipulation; }
.tm-timeline svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tm-timeline .tm-seg-bar { opacity: .3; transition: opacity .2s; }
.tm-timeline.is-idle .tm-seg-bar, .tm-timeline .tm-seg-bar.is-on, .tm-timeline .tm-seg-bar.is-past { opacity: 1; }
.tm-timeline .tm-intro { fill: var(--tm-on-deep-line); }
.tm-timeline__head { position: absolute; top: -3px; bottom: -3px; left: 0; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--tm-on-deep); transition: left .9s linear; pointer-events: none; }
.tm-timeline.is-idle .tm-timeline__head { display: none; }
.tm-tl-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--tm-on-deep-muted); font: 10.5px var(--tm-mono); letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.tm-tl-labels b { color: var(--tm-c1); font-weight: 500; }
.tm-dashed-tl { height: 20px; box-sizing: border-box; border: 2px dashed var(--tm-on-deep-line); border-radius: 4px; }
.tm-tracks { margin-inline: -8px; }
.tm-trk { display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; border-radius: 12px; color: inherit; transition: background-color .2s; }
.tm-trk.tf-track-row--active, .tm-trk.is-shared { background: var(--tm-accent-soft); box-shadow: none; }
.tm-trk__cue { flex: none; width: 3px; height: 30px; border-radius: 2px; background: var(--cue); }
.tm-trk__main { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; }
.tm-trk__title { overflow: hidden; font-size: 15px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; white-space: nowrap; text-overflow: ellipsis; }
.tm-trk__title a { color: inherit; text-decoration: none; }
.tm-trk time { flex: none; color: var(--tm-accent-text); font: 12.5px var(--tm-mono); font-variant-numeric: tabular-nums; }
.tm-trk__play { position: relative; display: grid; flex: none; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 18px; background: var(--tm-accent-soft); color: var(--tm-accent-text); cursor: pointer; }
.tm-trk__play::after { content: ""; position: absolute; inset: -4px; }
.tm-trk.tf-track-row--active .tm-trk__play { background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-bars { display: none; height: 14px; align-items: flex-end; gap: 2px; }
.tm-bars i { width: 3px; height: 40%; border-radius: 1px; background: currentColor; }
.tm-trk.tf-track-row--active .tm-bars { display: flex; }
.tm-trk.tf-track-row--active .tm-trk__pi { display: none; }
.tm-playing .tm-trk.tf-track-row--active .tm-bars i { animation: tm-eqrow .8s ease-in-out infinite alternate; }
.tm-playing .tm-trk.tf-track-row--active .tm-bars i:nth-child(2) { animation-delay: -.3s; }
.tm-playing .tm-trk.tf-track-row--active .tm-bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes tm-eqrow { from { height: 25%; } to { height: 100%; } }
.tm-hint { display: flex; gap: 8px; padding: 12px 14px; border: 1px solid var(--tm-accent-ring); border-radius: 12px; background: var(--tm-accent-soft); color: var(--tm-text); font-size: 13px; line-height: 1.45; }
.tm-hint a { color: var(--tm-accent-text); font-weight: 650; }

/* ---------- track ---------- */
.tm-big-title { margin: 0; font-size: 40px; font-weight: 800; line-height: .92; letter-spacing: -0.045em; overflow-wrap: anywhere; }
.tm-big-sub { margin: -6px 0 0; color: var(--tm-muted); font-size: 17px; font-weight: 600; }
.tm-big-sub a { color: var(--tm-accent-text); }
.tm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-stat { padding: 12px 14px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); }
.tm-stat--accent { border-color: var(--tm-accent); background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-stat b { display: block; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tm-stat span { display: block; margin-top: 6px; color: var(--tm-muted); font: 10.5px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; }
.tm-stat--accent span { color: var(--tm-on-accent); opacity: .7; }
.tm-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.tm-toggles > div { display: contents; }
.tm-toggle { display: inline-flex; height: 44px; box-sizing: border-box; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--tm-line-strong); border-radius: 22px; background: transparent; color: var(--tm-text); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.tm-toggle[aria-pressed="true"] { border-color: var(--tm-accent); background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-versions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tm-versions li { display: flex; height: 34px; box-sizing: border-box; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--tm-line); border-radius: 17px; background: var(--tm-surface); font-size: 14px; font-weight: 620; }
.tm-versions li span { color: var(--tm-accent-text); font: 12px var(--tm-mono); }
.tm-round-play { position: relative; display: grid; flex: none; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 20px; background: var(--tm-accent-soft); color: var(--tm-accent-text); text-decoration: none; cursor: pointer; }
.tm-round-play::after { content: ""; position: absolute; inset: -2px; }
.tm-round-play--locked { background: var(--tm-chip); color: var(--tm-muted); }
.tm-at { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 3px; }
.tm-at b { color: var(--tm-accent-text); font: 500 13px var(--tm-mono); font-variant-numeric: tabular-nums; }
.tm-at span { color: var(--tm-muted); font: 10px var(--tm-mono); letter-spacing: .08em; text-transform: uppercase; }
.tm-dock:not(:empty) { padding-bottom: 12px; }
.tm-dock .tf-player--docked { border-radius: 12px; overflow: hidden; }

/* ---------- festival ---------- */
.tm-fest-hero { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 16px; border-radius: 18px; background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-fest-hero h1 { margin: 0; font-size: 44px; font-weight: 800; line-height: .9; letter-spacing: -0.05em; overflow-wrap: anywhere; }
.tm-fest-hero p { margin: 0; font-size: 14px; line-height: 1.45; opacity: .85; }
.tm-fest-hero svg { display: block; width: 100%; height: 64px; }
.tm-fest-hero svg rect { fill: var(--tm-on-accent); }
.tm-fest-hero svg rect.is-pending { opacity: .25; }
.tm-cols-cap { display: flex; justify-content: space-between; gap: 8px; margin-top: -4px; font: 10px var(--tm-mono); letter-spacing: .08em; text-transform: uppercase; }
.tm-monogram { display: grid; flex: none; width: 48px; height: 48px; place-items: center; border-radius: 12px; background: var(--cue); color: #08080A; font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.tm-monogram img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* ---------- artists ---------- */
.tm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-acard { display: flex; min-width: 0; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--tm-line); border-radius: 16px; background: var(--tm-surface); color: inherit; text-align: left; text-decoration: none; transition: transform .1s, border-color .15s; }
.tm-acard b { overflow-wrap: anywhere; font-size: 15px; font-weight: 750; line-height: 1.2; letter-spacing: -0.01em; }
.tm-acard .tm-row__sub { margin-top: -6px; }
.tm-art { display: block; flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--tm-deep); box-shadow: 0 0 0 1px var(--tm-on-deep-line); object-fit: cover; }
.tm-art--sm { width: 40px; height: 40px; }
.tm-art--xl { width: 96px; height: 96px; }
.tm-art--ph { position: relative; display: grid; overflow: hidden; align-items: end; background: radial-gradient(110% 85% at 30% 12%, color-mix(in srgb, var(--cue) 60%, transparent), transparent 62%), radial-gradient(80% 60% at 85% 100%, color-mix(in srgb, var(--cue) 22%, transparent), transparent 70%), var(--tm-deep); }
.tm-art--ph svg { width: 100%; height: 100%; fill: #050506; opacity: .88; }
.tm-artist-head { display: flex; align-items: center; gap: 16px; }
.tm-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- trending ---------- */
.tm-top1 { display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 14px; padding: 16px; border: 0; border-radius: 18px; background: var(--tm-accent); color: var(--tm-on-accent); text-align: left; text-decoration: none; }
.tm-top1__rk { font-size: 52px; font-weight: 800; line-height: .9; letter-spacing: -0.05em; }
.tm-top1 .tm-row__sub { color: var(--tm-on-accent); opacity: .7; }
.tm-top1__val { margin-left: auto; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; text-align: right; font-variant-numeric: tabular-nums; }
.tm-top1__val span { display: block; font: 500 10px var(--tm-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.tm-panel { display: flex; flex-direction: column; gap: 12px; }

/* ---------- profile ---------- */
.tm-prof-head { display: flex; align-items: center; gap: 14px; }
.tm-prof-av { width: 64px; height: 64px; border-radius: 32px; font-size: 26px; }
.tm-prof-name { font-size: 30px; }
.tm-plan { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--tm-accent-ring); border-radius: 16px; background: var(--tm-surface); }
.tm-plan .tm-btn { flex: none; height: 40px; padding: 0 14px; font-size: 14px; }
.tm-switch { position: relative; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--tm-line-strong); -webkit-appearance: none; appearance: none; cursor: pointer; transition: background .2s; }
.tm-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s; }
.tm-switch:checked { background: var(--tm-accent); }
.tm-switch:checked::after { transform: translateX(20px); }
.tm-lib-actions { display: flex; gap: 8px; padding: 0 0 12px 72px; }
.tm-lib-set { border-bottom: 1px solid var(--tm-line); }
.tm-lib-set > .tm-row { padding-bottom: 6px; border-bottom: 0; }
.tm-empty { align-items: flex-start; }

/* ---------- tab bar ---------- */
.tm-tabbar { position: fixed; inset: auto 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px max(6px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--tm-line); background: var(--tm-bg); view-transition-name: tm-tabbar; }
.tm-tab { display: flex; min-height: 50px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tm-muted); font-size: 11px; font-weight: 600; text-decoration: none; }
.tm-tab__ico { display: grid; width: 54px; height: 30px; place-items: center; border-radius: 15px; transition: background .2s; }
.tm-tab[aria-current="page"] { color: var(--tm-text); font-weight: 750; }
.tm-tab[aria-current="page"] .tm-tab__ico { background: var(--tm-accent); color: var(--tm-on-accent); }

/* ---------- now playing (#global-player on phones) ----------
   player_controller.js adds .tf-player--app in the phone layout. Collapsed it
   is the mini player above the tab bar, with the live video as its thumbnail;
   .is-expanded turns the same element into the "Now playing" sheet. */
.tm-player-head, .tm-player-mini, .tm-player-body { display: none; }
@media (max-width: 520px), (display-mode: standalone) {
  #global-player.tf-player--app { position: fixed; inset: auto max(8px, env(safe-area-inset-right, 0px)) calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px) max(8px, env(safe-area-inset-left, 0px));
    z-index: 45; width: auto; height: 62px; box-sizing: border-box; overflow: hidden; border: 1px solid var(--tm-on-deep-line); border-radius: 16px; background: var(--tm-deep); color: var(--tm-on-deep);
    box-shadow: 0 12px 30px -8px var(--tm-shadow); font-family: var(--tm-font); view-transition-name: tm-player; }
  #global-player.tf-player--app .tf-player__bar { display: none; }
  #global-player.tf-player--app .tf-player__video { position: absolute; top: 12px; left: 12px; z-index: 1; width: 64px; height: 36px; aspect-ratio: auto; overflow: hidden; border-radius: 6px; background: #000; pointer-events: none; }
  #global-player.tf-player--app .tm-player-mini { position: relative; display: flex; height: 100%; align-items: center; gap: 4px; padding-right: 6px; }
  #global-player.tf-player--app.is-expanded { inset: auto 0 0; z-index: 81; display: flex; height: auto; max-height: calc(100% - env(safe-area-inset-top, 0px) - 12px); flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain;
    padding: 8px var(--tm-gutter-r) calc(24px + env(safe-area-inset-bottom, 0px)) var(--tm-gutter); border: 0; border-top: 1px solid var(--tm-line-strong); border-radius: 22px 22px 0 0; background: var(--tm-surface); color: var(--tm-text);
    animation: tm-sheet-up .38s cubic-bezier(.2, .8, .2, 1) both; }
  #global-player.tf-player--app.is-expanded .tf-player__video { position: relative; inset: auto; flex: none; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 14px; pointer-events: auto; }
  #global-player.tf-player--app.is-expanded .tm-player-mini { display: none; }
  #global-player.tf-player--app.is-expanded .tm-player-head { display: block; flex: none; }
  #global-player.tf-player--app.is-expanded .tm-player-body { display: flex; flex: none; flex-direction: column; gap: 14px; }
  body.tm-player-open::after { content: ""; position: fixed; inset: 0; z-index: 80; background: var(--tm-scrim); }
  body.tm-player-open { overflow: hidden; }
}
@keyframes tm-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.tm-mini__open { display: flex; flex: 1; min-width: 0; height: 100%; align-items: center; padding: 0 4px 0 88px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.tm-mini__text { display: flex; min-width: 0; flex-direction: column; }
.tm-mini__t { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.tm-mini__s { margin-top: 2px; color: var(--tm-on-deep-muted); font: 10.5px var(--tm-mono); letter-spacing: .04em; }
.tm-player-mini .tm-icon-btn { background: transparent; color: var(--tm-on-deep); }
.tm-player-mini .tm-icon-btn--solid { background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-mini__prog { position: absolute; left: 0; bottom: 0; width: 0; height: 2px; background: var(--tm-c1); transition: width .9s linear; }
.tm-playpause svg + svg { display: none; }
.tm-paused .tm-playpause svg { display: none; }
.tm-paused .tm-playpause svg + svg { display: block; }
.tm-player-stop { align-self: center; color: var(--tm-muted); }

/* ---------- sheets ---------- */
.tm-sheet-layer { position: fixed; inset: 0; z-index: 80; }
.tm-sheet-layer[hidden] { display: none; }
.tm-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: var(--tm-scrim); opacity: 0; transition: opacity .3s; cursor: default; }
.tm-sheet { position: absolute; inset: auto 0 0; display: flex; max-height: calc(100% - env(safe-area-inset-top, 0px) - 12px); box-sizing: border-box; flex-direction: column; gap: 14px; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px var(--tm-gutter-r) calc(24px + env(safe-area-inset-bottom, 0px)) var(--tm-gutter); border-top: 1px solid var(--tm-line-strong); border-radius: 22px 22px 0 0; background: var(--tm-surface);
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.tm-sheet-layer.is-open .tm-scrim { opacity: 1; }
.tm-sheet-layer.is-open .tm-sheet { transform: none; }
.tm-sheet > turbo-frame { display: contents; }
.tm-grabber { flex: none; width: 38px; height: 5px; margin: 0 auto 4px; border-radius: 3px; background: var(--tm-line-strong); }
.tm-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tm-sheet__head h2, .tm-sheet__title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.tm-sheet__head .tm-icon-btn { width: 36px; height: 36px; }
.tm-share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tm-share-grid a, .tm-share-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--tm-line); border-radius: 14px; background: var(--tm-bg); color: var(--tm-text); font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tm-urlbox { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--tm-line-strong); border-radius: 12px; background: var(--tm-bg); }
.tm-urlbox input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--tm-muted); font: 12.5px var(--tm-mono); }
.tm-mode-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tm-player-art { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--tm-on-deep-line); border-radius: 18px; background: var(--tm-deep); color: var(--tm-on-deep); }
.tm-video-slot { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #000; }
.tm-pl-t { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; }
.tm-pl-s { margin: 4px 0 0; color: var(--tm-on-deep-muted); font-size: 14px; }
.tm-pl-time { display: flex; justify-content: space-between; color: var(--tm-on-deep-muted); font: 11px var(--tm-mono); letter-spacing: .06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.tm-pl-time b { color: var(--tm-c1); font-size: 13px; font-weight: 500; }
.tm-controls { display: flex; align-items: center; justify-content: center; gap: 22px; }
.tm-controls .tm-icon-btn { width: 56px; height: 56px; border-radius: 28px; }
.tm-controls .tm-icon-btn--main { width: 72px; height: 72px; border-radius: 36px; background: var(--tm-accent); color: var(--tm-on-accent); }

/* ---------- clipboard bar ---------- */
.tm-clip { position: fixed; left: max(8px, env(safe-area-inset-left, 0px)); right: max(8px, env(safe-area-inset-right, 0px)); bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); z-index: 47;
  display: flex; height: 64px; box-sizing: border-box; align-items: center; gap: 10px; padding: 0 4px 0 8px; border: 1px solid var(--tm-accent-ring); border-radius: 16px; background: var(--tm-surface); box-shadow: 0 16px 36px -10px var(--tm-shadow); animation: tm-clip-in .3s cubic-bezier(.2, .8, .2, 1) both; }
.tm-has-mini .tm-clip { bottom: calc(var(--tm-tabbar-h) + env(safe-area-inset-bottom, 0px) + 78px); }
.tm-clip__thumb { position: relative; flex: none; width: 64px; height: 46px; overflow: hidden; border: 1px solid var(--tm-on-deep-line); border-radius: 9px; background: var(--tm-deep); }
.tm-clip__thumb img { width: 100%; height: 100%; object-fit: cover; }
.tm-clip__badge { position: absolute; top: 3px; right: 3px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 5px; background: var(--tm-accent); color: var(--tm-on-accent); }
.tm-clip__body { flex: 1; min-width: 0; }
.tm-clip__title { margin: 0; overflow: hidden; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; text-overflow: ellipsis; }
.tm-clip__url { margin: 3px 0 0; overflow: hidden; color: var(--tm-muted); font: 10.5px var(--tm-mono); white-space: nowrap; text-overflow: ellipsis; }
.tm-clip__use { position: relative; display: inline-flex; flex: none; height: 40px; align-items: center; gap: 4px; padding: 0 12px 0 14px; border: 0; border-radius: 10px; background: var(--tm-accent); color: var(--tm-on-accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.tm-clip__x { position: relative; display: grid; flex: none; width: 40px; height: 40px; place-items: center; border: 0; border-radius: 20px; background: none; color: var(--tm-muted); cursor: pointer; }
.tm-clip__use::after, .tm-clip__x::after { content: ""; position: absolute; inset: -2px; }
@keyframes tm-clip-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ---------- page transitions (Turbo + View Transitions) ---------- */
@media (max-width: 520px), (display-mode: standalone) {
  @media (prefers-reduced-motion: no-preference) {
    html[data-turbo-visit-direction="forward"]::view-transition-old(root) { animation: tm-vt-out-left .38s cubic-bezier(.2, .8, .2, 1) both; }
    html[data-turbo-visit-direction="forward"]::view-transition-new(root) { animation: tm-vt-in-right .38s cubic-bezier(.2, .8, .2, 1) both; }
    html[data-turbo-visit-direction="back"]::view-transition-old(root) { z-index: 1; animation: tm-vt-out-right .34s cubic-bezier(.2, .8, .2, 1) both; }
    html[data-turbo-visit-direction="back"]::view-transition-new(root) { animation: tm-vt-in-left .34s cubic-bezier(.2, .8, .2, 1) both; }
    html.tm-back-nav::view-transition-old(root) { z-index: 1; animation: tm-vt-out-right .34s cubic-bezier(.2, .8, .2, 1) both; }
    html.tm-back-nav::view-transition-new(root) { animation: tm-vt-in-left .34s cubic-bezier(.2, .8, .2, 1) both; }
    html.tm-tab-switch::view-transition-old(root) { animation: tm-vt-fade-out .12s ease both; }
    html.tm-tab-switch::view-transition-new(root) { animation: tm-vt-fade .12s ease both; }
  }
}
@media (min-width: 521px) and (not (display-mode: standalone)) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@keyframes tm-vt-in-right { from { transform: translateX(100%); } }
@keyframes tm-vt-out-left { to { transform: translateX(-28%); } }
@keyframes tm-vt-out-right { to { transform: translateX(100%); } }
@keyframes tm-vt-in-left { from { transform: translateX(-28%); } }
@keyframes tm-vt-fade { from { opacity: 0; } }
@keyframes tm-vt-fade-out { to { opacity: 0; } }

/* Edge swipe back (installed app): the screen follows the finger. */
.tm-swiping .tlf-main, .tm-swiping .tm-nav { transition: none; }
.tm-swipe-release .tlf-main, .tm-swipe-release .tm-nav { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }

@media (prefers-reduced-motion: reduce) {
  .tm-sheet, .tm-scrim, .tm-mini__prog, .tm-fill i, .tm-fill .tm-fill__rest, .tm-timeline__head, .tm-clip, #toast-region .tlf-flash { transition: none !important; animation: none !important; }
  .tm-steps li.is-active .tm-dot::after, .tm-playing .tm-trk.tf-track-row--active .tm-bars i, .tm-eq i { animation: none !important; }
}

.tm-select, .tm-textarea { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--tm-line-strong); border-radius: 12px; background: var(--tm-bg); color: var(--tm-text); font: 16px var(--tm-font); }
.tm-select { height: 52px; }
.tm-textarea { min-height: 96px; resize: vertical; }
.tm-select:focus, .tm-textarea:focus { border-color: var(--tm-accent-ring); outline: none; box-shadow: 0 0 0 3px var(--tm-accent-soft); }
.tm-textarea::placeholder { color: var(--tm-muted); }
.tm-queue-row.tf-track-row--active { margin-inline: -14px; padding-inline: 14px; background: var(--tm-accent-soft); box-shadow: none; }
/* Text fields show focus on their box (.tm-input:focus-within), not a second ring inside it. */
.tm-input input:focus-visible, .tm-search input:focus-visible, .tm-urlbox input:focus-visible { outline: none; }
.tm-h1-sub { display: block; margin-top: 6px; color: var(--tm-muted); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

/* Tap targets: every control reaches 44 x 44px, invisibly where the design is smaller. */
.tm-pill-btn, .tm-paste, .tm-avatar, .tm-forgot, .tm-legal a, .tm-legal button, .tm-seg--mini > button, .tm-brand { position: relative; }
.tm-pill-btn::after, .tm-avatar::after { content: ""; position: absolute; inset: -2px; }
.tm-paste::after { content: ""; position: absolute; inset: -4px -2px; }
.tm-forgot, .tm-legal a, .tm-legal button { min-height: 44px; }
.tm-seg--mini > button::after { content: ""; position: absolute; inset: -4px 0; }
.tm-seg--mini > button { position: relative; }
.tm-brand { min-height: 44px; }
.tm-h3 { margin: 0; font: inherit; font-size: 15px; font-weight: 650; }
