/* Pulse Wave Radio — reusable light-theme foundations (local design-system v0.3).
   The approved Paper White direction now uses a pure white canvas. Mobile Quiet Dock / Inline Signal are approved
   directions. New UI should consume these semantic variables and components
   instead of adding new button colors/radii. The existing prototype has not
   yet been fully migrated to this file. */
:root {
  color-scheme: light;
  --pw-color-canvas: #ffffff;
  --pw-color-surface: #ffffff;
  --pw-color-surface-raised: #ffffff;
  --pw-color-surface-soft: #f8f7f5;
  --pw-color-surface-pearl: #fff6e9;
  --pw-color-wash: #f7f4f0;
  --pw-color-wash-strong: #eee9e4;
  --pw-color-ink: #111315;
  --pw-color-ink-secondary: #515658;
  --pw-color-ink-muted: #666e70;
  --pw-color-border: #eae5e0;
  --pw-color-border-strong: #d5cec7;
  --pw-color-player-strip: #242729;
  --pw-color-player-ink: #ffffff;
  --pw-color-artwork-veil-end: #111315d9;
  --pw-color-selection: #111315;
  --pw-color-selection-ink: #ffffff;
  --pw-color-coral: #de766d;
  --pw-color-coral-dark: #92564b;
  --pw-color-error-bg: #fff1ec;
  --pw-color-error-ink: #823d32;
  --pw-color-error-border: #edbcb0;
  --pw-color-success-bg: #f3f4ef;
  --pw-color-success-ink: #45534b;
  --pw-color-focus: #92564b;

  --pw-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --pw-type-display: 800 34px/1.12 var(--pw-font-body);
  --pw-type-section: 580 20px/1.25 var(--pw-font-body);
  --pw-type-subhead: 620 15px/1.35 var(--pw-font-body);
  --pw-type-body: 400 14px/1.5 var(--pw-font-body);
  --pw-type-label: 650 13px/1.25 var(--pw-font-body);
  --pw-type-meta: 500 11px/1.35 var(--pw-font-body);

  --pw-space-1: 4px;
  --pw-space-2: 8px;
  --pw-space-3: 12px;
  --pw-space-4: 16px;
  --pw-space-6: 24px;
  --pw-space-8: 32px;
  --pw-space-12: 48px;

  --pw-radius-xs: 8px;
  --pw-radius-sm: 12px;
  --pw-radius-md: 16px;
  --pw-radius-lg: 21px;
  --pw-radius-pill: 999px;
  --pw-shadow-floating: 0 12px 32px #1113151a;
  --pw-shadow-card: 0 2px 10px #11131508;
  --pw-motion-fast: 140ms;
  --pw-motion-standard: 220ms;
  --pw-profile-size: 44px;
  --pw-profile-seal-size: 15px;
  --pw-topics-row-gap-desktop: 32px;
}

/* Shared identity control: use the same Ink Initials mark in Home and the desktop rail. */
.pw-profile-mark { position:relative; display:inline-grid; place-items:center; width:var(--pw-profile-size); height:var(--pw-profile-size); flex:0 0 var(--pw-profile-size); border-radius:50%; background:var(--pw-color-ink); color:#fff; }
.pw-profile-mark__initials { font:650 13px/1 var(--pw-font-body); letter-spacing:.025em; }
.pw-profile-mark__seal { position:absolute; display:grid; place-items:center; width:var(--pw-profile-seal-size); height:var(--pw-profile-seal-size); right:-2px; bottom:-2px; border:2px solid #fff; border-radius:50%; background:#fff; color:var(--pw-color-ink); }
.pw-profile-mark__seal svg { width:11px; height:11px; stroke-width:2.6; }
.pw-profile-mark.is-guest { border:1px solid var(--pw-color-border-strong); background:var(--pw-color-surface); color:var(--pw-color-ink); }
.pw-profile-mark.is-guest>svg { width:20px; height:20px; }
.pw-upgrade-banner { position:relative; display:flex; flex-direction:column; gap:7px; min-height:132px; padding:16px; overflow:hidden; border:1px solid var(--pw-color-ink); border-radius:var(--pw-radius-md); background:var(--pw-color-ink); color:#fff; text-align:left; isolation:isolate; cursor:pointer; transition:background-color var(--pw-motion-fast),transform var(--pw-motion-fast),box-shadow var(--pw-motion-fast); }
.pw-upgrade-banner::after { content:''; position:absolute; z-index:-1; width:118px; height:118px; right:-53px; top:-58px; border:20px solid #ffffff0b; border-radius:50%; pointer-events:none; }
.pw-upgrade-banner__top { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:5px; }
.pw-upgrade-banner__top>img { display:block; width:28px; height:28px; border-radius:8px; }
.pw-upgrade-banner__top>svg { width:17px; height:17px; flex:none; color:#d8dcde; }
.pw-upgrade-banner>strong { font:650 20px/1.1 var(--pw-font-body); letter-spacing:-.035em; }
.pw-upgrade-banner>small { color:#c1c6c8; font:450 11px/1.4 var(--pw-font-body); }
.pw-upgrade-banner:hover { background:#242729; box-shadow:0 8px 20px #11131514; transform:translateY(-1px); }
.pw-upgrade-banner:active { transform:translateY(0); background:#000; }
.pw-upgrade-banner:focus-visible { outline:2px solid var(--pw-color-focus); outline-offset:4px; }
@media(prefers-reduced-motion:reduce) { .pw-upgrade-banner { transition:none; }.pw-upgrade-banner:hover { transform:none; } }

.pw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: var(--pw-radius-pill);
  font: 650 13px/1 var(--pw-font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--pw-motion-fast), color var(--pw-motion-fast), border-color var(--pw-motion-fast), transform var(--pw-motion-fast);
}
.pw-button:active { transform: translateY(1px) scale(.985); }
.pw-button:focus-visible,
.pw-icon-button:focus-visible,
.pw-pill:focus-visible,
.pw-tab:focus-visible,
.pw-card:focus-visible,
.pw-input:focus-visible {
  outline: 2px solid var(--pw-color-focus);
  outline-offset: 3px;
}
.pw-button:disabled, .pw-button[aria-disabled="true"],
.pw-icon-button:disabled, .pw-pill:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}
.pw-button--primary { background: var(--pw-color-ink); color: #fff; }
.pw-button--primary:hover:not(:disabled) { background: #33383a; }
.pw-button--primary:active:not(:disabled) { background: #000; }
.pw-button--secondary { border-color: var(--pw-color-border); background: var(--pw-color-surface); color: var(--pw-color-ink); }
.pw-button--secondary:hover:not(:disabled) { border-color: var(--pw-color-border-strong); background: var(--pw-color-wash); }
.pw-button--secondary:active:not(:disabled) { background: var(--pw-color-wash-strong); }
.pw-button--tertiary { background: transparent; color: var(--pw-color-coral-dark); }
.pw-button--tertiary:hover:not(:disabled) { background: var(--pw-color-wash); }
.pw-button--tertiary:active:not(:disabled) { background: var(--pw-color-wash-strong); }
.pw-button--destructive { border-color: var(--pw-color-error-border); background: var(--pw-color-error-bg); color: var(--pw-color-error-ink); }
.pw-button--destructive:hover:not(:disabled) { background: #ffe4dc; }
.pw-button--destructive:active:not(:disabled) { background: #ffd6ca; }
.pw-button[aria-busy="true"] { cursor: progress; }
.pw-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pw-spin .8s linear infinite; }
@keyframes pw-spin { to { transform: rotate(360deg); } }

.pw-icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--pw-color-border);
  border-radius: 50%;
  background: var(--pw-color-surface);
  color: var(--pw-color-ink);
  cursor: pointer;
  transition: background-color var(--pw-motion-fast), border-color var(--pw-motion-fast), transform var(--pw-motion-fast);
}
.pw-icon-button:hover:not(:disabled) { background: var(--pw-color-wash); border-color: var(--pw-color-border-strong); }
.pw-icon-button:active:not(:disabled) { transform: scale(.96); }
.pw-icon-button[aria-pressed="true"] { color: var(--pw-color-coral-dark); border-color: #deb1a6; background: #fff2ec; }
.pw-icon-button svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.pw-pill {
  min-height: 38px;
  padding: 7px 15px;
  border: 1px solid var(--pw-color-border);
  border-radius: var(--pw-radius-pill);
  background: var(--pw-color-surface);
  color: #4c5052;
  font: 590 13px/1.1 var(--pw-font-body);
  white-space: nowrap;
  cursor: pointer;
}
.pw-pill:hover:not(:disabled) { border-color: #cfc9c5; background: #faf5f1; }
.pw-pill[aria-pressed="true"] { border-color: var(--pw-color-selection); background: var(--pw-color-selection); color: var(--pw-color-selection-ink); }
.pw-pill:active:not(:disabled) { transform: scale(.98); }

/* Approved AI suggestions: Artwork Capsules. Keep the artwork decorative and
   give the full request to the button's accessible name. */
.pw-artwork-prompt {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  min-height: 44px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--pw-color-border);
  border-radius: var(--pw-radius-pill);
  background: var(--pw-color-surface);
  color: var(--pw-color-ink-secondary);
  font: 650 12px/1.25 var(--pw-font-body);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--pw-motion-fast), background-color var(--pw-motion-fast);
}
.pw-artwork-prompt:hover { border-color: var(--pw-color-border-strong); background: #fafafa; }
.pw-artwork-prompt:focus-visible { outline: 2px solid var(--pw-color-ink); outline-offset: 3px; }
.pw-artwork-prompt:active { background: var(--pw-color-surface-soft); }
.pw-artwork-prompt__art { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; }
.pw-tab {
  min-height: 37px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--pw-radius-pill);
  background: transparent;
  color: #756c69;
  font: 680 12px/1 var(--pw-font-body);
  cursor: pointer;
}
.pw-tab:hover { color: var(--pw-color-ink); }
.pw-tab[aria-selected="true"] { background: var(--pw-color-selection); color: var(--pw-color-selection-ink); box-shadow: 0 3px 7px #201a1725; }
.pw-tablist { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #eee3dc; border-radius: var(--pw-radius-pill); background: #f5f0ec; }

.pw-input {
  width: 100%;
  min-height: 45px;
  padding: 0 12px;
  border: 1px solid #dedbd8;
  border-radius: var(--pw-radius-sm);
  background: var(--pw-color-surface);
  color: var(--pw-color-ink);
  font: 400 16px/1.3 var(--pw-font-body);
}
.pw-input::placeholder { color: #767e80; }
.pw-input[aria-invalid="true"] { border-color: #c56e5f; background: #fff9f6; }
.pw-input:disabled { background: #f4f3f1; color: #777; }

.pw-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 9px;
  border: 1px solid var(--pw-color-border);
  border-radius: var(--pw-radius-md);
  background: var(--pw-color-surface);
  color: var(--pw-color-ink);
  text-align: left;
  box-shadow: var(--pw-shadow-card);
  cursor: pointer;
}
.pw-card:hover { border-color: #d9cbc3; background: #fffaf7; }
.pw-card:active { background: #f9eee8; }
.pw-card[aria-current="true"] { border-color: #e5a69a; background: #fff9f5; }
.pw-art { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 11px; background: linear-gradient(135deg,#efb598,#c77570); color: #fff; font-weight: 790; }
.pw-card-copy { display: grid; min-width: 0; gap: 3px; }
.pw-card-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 650; }
.pw-card-copy small { color: var(--pw-color-ink-muted); font-size: 11px; }

.pw-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 410px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--pw-color-border);
  border-radius: var(--pw-radius-md);
  background: var(--pw-color-surface);
  color: var(--pw-color-ink);
  box-shadow: var(--pw-shadow-floating);
}
.pw-toast--success { border-color: #d4dfcf; background: var(--pw-color-success-bg); color: var(--pw-color-success-ink); }
.pw-toast--error { border-color: var(--pw-color-error-border); background: var(--pw-color-error-bg); color: var(--pw-color-error-ink); }
.pw-toast strong { font-size: 13px; }
.pw-toast p { margin: 2px 0 0; color: inherit; font-size: 12px; line-height: 1.35; }

/* The approved mobile dock is outside the list scrollport. The compact inline
   signal is its visual treatment; safe-area space belongs outside this strip. */
.pw-player-dock {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 68px;
  padding: 8px 10px;
  border-top: 1px solid var(--pw-color-border);
  background: var(--pw-color-surface);
  color: var(--pw-color-ink);
}
.pw-player-dock--inline {
  border-color: var(--pw-color-player-strip);
  background: var(--pw-color-player-strip);
  color: var(--pw-color-player-ink);
}
.pw-player-dock__art { width: 48px; height: 48px; flex: none; border-radius: var(--pw-radius-xs); object-fit: cover; }
.pw-player-dock__copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pw-player-dock__copy strong, .pw-player-dock__copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-player-dock__copy strong { font-size: 14px; font-weight: 650; }
.pw-player-dock__copy small { color: currentColor; font-size: 11px; opacity: .72; }
.pw-player-dock__control { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.pw-player-dock__control:hover { background: #ffffff21; }
.pw-player-dock__control:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.pw-player-dock__control svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* HD is a compact playback indicator for a reported stream bitrate >=192 kbps.
   Render only after playback starts; connecting, paused and unknown omit it. */
.pw-hd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 23px;
  height: 16px;
  padding: 0 3px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font: 800 9px/1 var(--pw-font-body);
  letter-spacing: .025em;
}

@media (prefers-reduced-motion: reduce) {
  .pw-button, .pw-icon-button, .pw-pill, .pw-card, .pw-artwork-prompt { transition: none; }
  .pw-spinner { animation-duration: 1.8s; }
}
