/* =============================================================
   RequestK — Apple Store Online Design System
   Tokens: Apple style guide · WCAG 2.2 AA · Keyboard-first
   ============================================================= */

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Typography */
  --rk-font: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --rk-font-size-xs: 12px;
  --rk-font-size-sm: 14px;
  --rk-font-size-md: 15px;
  --rk-font-size-lg: 17px;
  --rk-font-size-xl: 20px;
  --rk-font-size-2xl: 24px;
  --rk-font-size-3xl: 28px;
  --rk-font-weight-regular: 400;
  --rk-font-weight-medium: 500;
  --rk-font-weight-semibold: 600;
  --rk-font-weight-bold: 700;
  --rk-line-height-tight: 1.14286;
  --rk-line-height-base: 1.33334;
  --rk-line-height-relaxed: 1.47059;
  --rk-letter-spacing-tight: -0.022em;
  --rk-letter-spacing-normal: -0.016em;
  --rk-letter-spacing-wide: 0.04em;

  /* Color — Light */
  --rk-color-text-primary: #1d1d1f;
  --rk-color-text-secondary: #6e6e73;
  --rk-color-text-tertiary: #aeaeb2;
  --rk-color-text-inverse: #f5f5f7;
  --rk-color-surface-page: #f5f5f7;
  --rk-color-surface-card: #ffffff;
  --rk-color-surface-fill: #f2f2f7;
  --rk-color-surface-fill-secondary: #e8e8ed;
  --rk-color-accent: #0071e3;
  --rk-color-accent-hover: #0077ed;
  --rk-color-red: #ff3b30;
  --rk-color-green: #34c759;
  --rk-color-orange: #ff9f0a;
  --rk-color-separator: rgba(60,60,67,0.12);
  --rk-color-separator-strong: rgba(60,60,67,0.20);
  --rk-color-overlay: rgba(0,0,0,0.32);
  --rk-color-ring: rgba(0,113,227,0.20);

  /* Spacing */
  --rk-space-1: 6px;
  --rk-space-2: 8px;
  --rk-space-3: 10px;
  --rk-space-4: 16px;
  --rk-space-5: 20px;
  --rk-space-6: 24px;
  --rk-space-7: 32px;
  --rk-space-8: 40px;

  /* Radius */
  --rk-radius-pill: 980px;
  --rk-radius-xl: 20px;
  --rk-radius-lg: 16px;
  --rk-radius-md: 12px;
  --rk-radius-sm: 10px;
  --rk-radius-xs: 8px;

  /* Motion */
  --rk-motion-instant: 120ms;
  --rk-motion-fast: 200ms;
  --rk-motion-normal: 320ms;
  --rk-motion-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Shadow */
  --rk-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --rk-shadow-card: 0 4px 24px rgba(0,0,0,0.06);
  --rk-shadow-modal: 0 -8px 48px rgba(0,0,0,0.16);
  --rk-shadow-toast: 0 -12px 48px rgba(0,0,0,0.20);

  color-scheme: light;
}



/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page ── */
.rk-app {
  font-family: var(--rk-font);
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-regular);
  line-height: var(--rk-line-height-relaxed);
  letter-spacing: var(--rk-letter-spacing-tight);
  color: var(--rk-color-text-primary);
  background: var(--rk-color-surface-page);
  min-height: 100vh;
  min-height: calc(var(--rk-vh, 1vh) * 100);
  min-height: 100dvh;
  padding: env(safe-area-inset-top, var(--rk-space-4)) env(safe-area-inset-right, var(--rk-space-4))
           env(safe-area-inset-bottom, var(--rk-space-4)) env(safe-area-inset-left, var(--rk-space-4));
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── Card ── */
.rk-inner {
  width: 100%;
  max-width: 480px;
  margin: 12px auto 48px;
  padding: var(--rk-space-7) var(--rk-space-6) var(--rk-space-7);
  background: var(--rk-color-surface-card);
  border-radius: var(--rk-radius-xl);
  box-shadow: var(--rk-shadow-card);
}

/* ── Typography ── */
.rk-title {
  font-size: var(--rk-font-size-3xl);
  font-weight: var(--rk-font-weight-bold);
  letter-spacing: 0.004em;
  line-height: var(--rk-line-height-tight);
  margin: 0 0 var(--rk-space-6);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--rk-space-2);
}
.rk-title svg { width: 28px; height: 28px; color: var(--rk-color-accent); }

.rk-section-label {
  font-size: var(--rk-font-size-xs);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--rk-letter-spacing-wide);
  margin: 0 0 12px;
}

/* ── Viewers pill ── */
.rk-viewers-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #dcfce7;
  color: #166534;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  margin-left: 10px;
  letter-spacing: 0;
  vertical-align: middle;
  animation: rk-fadein 0.3s ease;
}
.rk-viewers-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: rk-pulse 1.4s ease-in-out infinite;
}


/* ── Segmented Control ── */
.rk-tabbar {
  display: flex;
  background: var(--rk-color-surface-fill);
  border-radius: var(--rk-radius-sm);
  padding: 2px;
  margin-bottom: var(--rk-space-6);
}
.rk-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px var(--rk-space-4);
  margin: 0;
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-medium);
  letter-spacing: var(--rk-letter-spacing-normal);
  line-height: 1;
  border-radius: var(--rk-radius-xs);
  background: transparent;
  color: var(--rk-color-text-secondary);
  border: none;
  cursor: pointer;
  font-family: inherit;
  min-height: 42px;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  transition: background var(--rk-motion-instant) ease, color var(--rk-motion-instant) ease, box-shadow var(--rk-motion-instant) ease;
}
.rk-tab svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  display: block;
}
.rk-tab:hover { color: var(--rk-color-text-primary); }
.rk-tab:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: -2px;
  border-radius: var(--rk-radius-xs);
}
.rk-tab.rk-tab-active {
  background: var(--rk-color-surface-card);
  color: var(--rk-color-text-primary);
  font-weight: var(--rk-font-weight-semibold);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 0.5px rgba(0,0,0,0.04);
}


/* ── Search ── */
.rk-search-wrap {
  position: relative;
  margin-bottom: var(--rk-space-4);
}
.rk-search-inner {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid rgba(60,60,67,0.18);
  border-radius: 999px;
  padding: 0 var(--rk-space-4);
  min-height: 48px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: background var(--rk-motion-instant), border-color var(--rk-motion-instant), box-shadow var(--rk-motion-instant);
}
.rk-search-inner:hover {
  border-color: rgba(60,60,67,0.30);
  box-shadow: 0 2px 8px rgba(0,0,0,0.09);
}
.rk-search-inner:focus-within {
  background: #ffffff;
  border-color: var(--rk-color-accent);
  box-shadow: 0 0 0 3px var(--rk-color-ring), 0 1px 4px rgba(0,0,0,0.06);
}
.rk-search-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--rk-color-text-tertiary);
  flex-shrink: 0;
  margin-right: var(--rk-space-2);
  height: 100%;
}
.rk-search-icon svg { width: 18px; height: 18px; }
.rk-search-input {
  flex: 1; border: none; background: none;
  padding: 0; margin: 0;
  height: 48px;
  font-size: var(--rk-font-size-lg);
  font-family: inherit;
  font-weight: var(--rk-font-weight-regular);
  letter-spacing: var(--rk-letter-spacing-tight);
  line-height: 48px;
  color: var(--rk-color-text-primary);
  outline: none;
  min-width: 0; width: 100%;
  -webkit-appearance: none; appearance: none;
  border-radius: 0; box-shadow: none;
  text-indent: 0;
}
.rk-search-input::placeholder {
  color: var(--rk-color-text-tertiary);
  opacity: 1;
}
.rk-search-input::-webkit-search-cancel-button,
.rk-search-input::-webkit-search-decoration,
.rk-search-input::-webkit-search-results-button,
.rk-search-input::-webkit-search-results-decoration {
  -webkit-appearance: none; display: none;
}
.rk-search-clear {
  background: none; border: none;
  color: var(--rk-color-text-tertiary);
  cursor: pointer; padding: 0; margin: 0; margin-right: -6px;
  border-radius: 50%; flex-shrink: 0;
  touch-action: manipulation; min-width: 36px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-appearance: none; appearance: none;
  transition: background var(--rk-motion-instant);
}
.rk-search-clear:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-search-clear:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: -2px;
}
.rk-search-clear svg { width: 14px; height: 14px; }

/* ── Results ── */
.rk-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--rk-color-surface-card);
  border-radius: var(--rk-radius-lg);
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 100;
  box-shadow: var(--rk-shadow-modal);
  display: none;
  overscroll-behavior: contain;
  outline: 1px solid var(--rk-color-separator);
}

.rk-results-loading,
.rk-results-empty {
  padding: var(--rk-space-7) var(--rk-space-5);
  text-align: center;
  font-size: var(--rk-font-size-md);
  color: var(--rk-color-text-secondary);
  line-height: var(--rk-line-height-base);
}
.rk-results-empty small {
  display: block;
  font-size: var(--rk-font-size-sm);
  margin-top: var(--rk-space-1);
  color: var(--rk-color-text-tertiary);
}

.rk-result-item {
  display: flex; align-items: center; gap: var(--rk-space-4);
  padding: 14px 18px; cursor: pointer;
  touch-action: manipulation; min-height: 48px;
  border-bottom: 1px solid var(--rk-color-separator);
  transition: background var(--rk-motion-instant);
}
.rk-result-item:last-child { border-bottom: none; }
.rk-result-item:hover,
.rk-result-item:focus-visible { background: var(--rk-color-surface-fill); outline: none; }
.rk-result-item:active { background: var(--rk-color-surface-fill-secondary); }

.rk-result-art {
  width: 48px; height: 48px;
  border-radius: var(--rk-radius-sm);
  object-fit: cover; flex-shrink: 0;
  background: var(--rk-color-surface-fill);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.rk-result-info { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rk-result-title {
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-medium);
  line-height: var(--rk-line-height-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-result-artist {
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Pick button — outlined circle */
.rk-result-pick {
  background: var(--rk-color-surface-fill);
  color: var(--rk-color-accent);
  border: 2px solid var(--rk-color-accent);
  border-radius: 50%;
  width: 36px; height: 36px; min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; padding: 0;
  transition: background var(--rk-motion-instant), transform var(--rk-motion-instant), color var(--rk-motion-instant);
}
.rk-result-pick svg { width: 18px; height: 18px; }
.rk-result-pick:hover { background: rgba(0,113,227,0.08); }
.rk-result-pick:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-result-pick:active { transform: scale(0.9); }
.rk-result-pick.rk-picked {
  background: var(--rk-color-accent);
  color: var(--rk-color-text-inverse);
  border-color: var(--rk-color-accent);
}

.rk-result-item.rk-selected { background: var(--rk-color-surface-fill); }
.rk-result-item.rk-selected .rk-result-title { color: var(--rk-color-accent); }

/* Use-as-typed */
.rk-result-as-typed {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 18px 20px; margin: 12px; cursor: pointer;
  background: var(--rk-color-accent);
  border: none;
  border-radius: var(--rk-radius);
  touch-action: manipulation; min-height: 48px;
  text-align: center;
  transition: transform var(--rk-motion-instant), opacity var(--rk-motion-instant);
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}
.rk-result-as-typed:hover,
.rk-result-as-typed:focus-visible { opacity: 0.9; outline: 2px solid var(--rk-color-accent); outline-offset: 2px; }
.rk-result-as-typed:active { transform: scale(0.98); opacity: 0.85; }
.rk-as-typed-row { display: flex; align-items: center; gap: 10px; }
.rk-as-typed-icon { color: rgba(255,255,255,0.9); flex-shrink: 0; }
.rk-as-typed-icon svg { width: 22px; height: 22px; }
.rk-as-typed-text {
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-semibold);
  color: #ffffff;
}
.rk-as-typed-sub {
  font-size: var(--rk-font-size-sm);
  color: rgba(255,255,255,0.7);
  display: block;
}

/* ── Selected Chip ── */
.rk-selected-chip {
  display: flex; align-items: center; gap: var(--rk-space-4);
  background: var(--rk-color-surface-fill);
  border: 2px solid var(--rk-color-accent);
  border-radius: var(--rk-radius-lg);
  padding: 14px var(--rk-space-4);
  margin-bottom: var(--rk-space-5);
  animation: rk-fadein var(--rk-motion-normal) ease;
  overflow: hidden;
}
@keyframes rk-fadein { from { opacity: 0; transform: translateY(8px); } }
.rk-chip-art {
  width: 52px; height: 52px;
  border-radius: var(--rk-radius-xs);
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.rk-chip-info { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rk-chip-title {
  display: block;
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-semibold);
  line-height: var(--rk-line-height-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-chip-artist {
  display: block;
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-text-secondary);
  margin-top: 4px;
}
.rk-chip-remove {
  background: none; border: none;
  color: var(--rk-color-text-tertiary);
  cursor: pointer; padding: 0; margin: 0;
  border-radius: 50%;
  touch-action: manipulation; min-width: 40px; min-height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-appearance: none; appearance: none;
  transition: background var(--rk-motion-instant);
}
.rk-chip-remove:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-chip-remove:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: -2px;
}
.rk-chip-remove svg { width: 16px; height: 16px; }

/* ── Discovery ── */
.rk-section-divider {
  height: 1px;
  background: var(--rk-color-separator);
  margin: var(--rk-space-6) 0 var(--rk-space-5);
}
.rk-discovery { }

.rk-disc-tabbar {
  display: flex; gap: var(--rk-space-2);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: var(--rk-space-4);
  -ms-overflow-style: none; scrollbar-width: none;
}
.rk-disc-tabbar::-webkit-scrollbar { display: none; }

.rk-disc-tab {
  flex-shrink: 0;
  background: var(--rk-color-surface-fill);
  border: none;
  border-radius: var(--rk-radius-pill);
  padding: var(--rk-space-2) var(--rk-space-4);
  font-size: var(--rk-font-size-sm);
  font-weight: var(--rk-font-weight-medium);
  letter-spacing: var(--rk-letter-spacing-normal);
  color: var(--rk-color-text-secondary);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  touch-action: manipulation; min-height: 36px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background var(--rk-motion-instant), color var(--rk-motion-instant), transform var(--rk-motion-instant);
}
.rk-disc-tab:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-disc-tab:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-disc-tab:active { transform: scale(0.96); }
.rk-disc-tab.rk-disc-tab-active {
  background: var(--rk-color-text-primary);
  color: var(--rk-color-text-inverse);
}

.rk-disc-pane { margin-top: 2px; }
.rk-disc-loading,
.rk-disc-empty {
  text-align: center; padding: var(--rk-space-7) var(--rk-space-4);
  font-size: var(--rk-font-size-md);
  color: var(--rk-color-text-secondary);
}

.rk-disc-list {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: var(--rk-space-1);
}
.rk-disc-item {
  display: flex; align-items: center; gap: var(--rk-space-4);
  padding: 14px var(--rk-space-4);
  background: var(--rk-color-surface-fill);
  border-radius: var(--rk-radius-lg);
  min-height: 48px;
  transition: background var(--rk-motion-instant);
  cursor: pointer;
}
.rk-disc-item:hover,
.rk-disc-item:focus-visible { background: var(--rk-color-surface-fill-secondary); outline: none; }
.rk-disc-item:active { background: var(--rk-color-surface-fill-secondary); }
.rk-disc-rank {
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-tertiary);
  width: 28px; text-align: center; flex-shrink: 0;
}
.rk-disc-item-art {
  width: 44px; height: 44px;
  border-radius: var(--rk-radius-xs);
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.rk-disc-item-info { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rk-disc-item-name {
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-medium);
  line-height: var(--rk-line-height-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-disc-item-meta {
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-disc-item-meta strong { color: var(--rk-color-text-primary); font-weight: var(--rk-font-weight-semibold); }

.rk-disc-pick {
  background: var(--rk-color-surface-fill-secondary);
  color: var(--rk-color-accent);
  border: 2px solid var(--rk-color-accent);
  border-radius: 50%;
  width: 32px; height: 32px; min-width: 32px; min-height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; touch-action: manipulation; padding: 0;
  flex-shrink: 0;
  transition: background var(--rk-motion-instant), transform var(--rk-motion-instant), color var(--rk-motion-instant);
}
.rk-disc-pick svg { width: 16px; height: 16px; }
.rk-disc-pick:hover { background: rgba(0,113,227,0.12); }
.rk-disc-pick:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-disc-pick:active { transform: scale(0.9); background: var(--rk-color-accent); color: var(--rk-color-text-inverse); }

/* ── Name Input ── */
.rk-name-wrap { margin: var(--rk-space-5) 0 12px; }
.rk-name-label {
  display: flex; align-items: center; gap: var(--rk-space-1);
  font-size: var(--rk-font-size-sm);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-secondary);
  margin-bottom: var(--rk-space-2);
  letter-spacing: var(--rk-letter-spacing-normal);
}
.rk-name-label svg { width: 14px; height: 14px; }
.rk-name-input {
  width: 100%; padding: 0 var(--rk-space-4); margin: 0;
  height: 52px;
  background: var(--rk-color-surface-fill);
  border: 1.5px solid var(--rk-color-separator);
  border-radius: var(--rk-radius-md);
  font-size: var(--rk-font-size-lg);
  font-family: inherit;
  font-weight: var(--rk-font-weight-regular);
  letter-spacing: var(--rk-letter-spacing-tight);
  line-height: 52px;
  color: var(--rk-color-text-primary);
  outline: none;
  -webkit-appearance: none; appearance: none; box-shadow: none;
  text-indent: 0;
  transition: background var(--rk-motion-instant), border-color var(--rk-motion-instant), box-shadow var(--rk-motion-instant);
}
.rk-name-input:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-name-input:focus {
  background: var(--rk-color-surface-card);
  border-color: var(--rk-color-accent);
  box-shadow: 0 0 0 3px var(--rk-color-ring);
}
.rk-name-input::placeholder {
  color: var(--rk-color-text-tertiary);
  opacity: 1;
}

/* ── Submit Button ── */
.rk-submit-btn {
  width: 100%; padding: 0 var(--rk-space-4); margin: 0;
  height: 52px;
  background: var(--rk-color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--rk-radius-md);
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-semibold);
  font-family: inherit;
  letter-spacing: var(--rk-letter-spacing-tight);
  line-height: 52px;
  cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--rk-space-2);
  margin: var(--rk-space-2) 0 12px;
  margin-bottom: env(safe-area-inset-bottom, 12px);
  -webkit-appearance: none; appearance: none;
  transition: background var(--rk-motion-instant), transform var(--rk-motion-instant), box-shadow var(--rk-motion-instant);
  box-shadow: 0 2px 8px rgba(0,113,227,0.25);
}
.rk-submit-btn svg { width: 18px; height: 18px; }
.rk-submit-btn:hover { background: var(--rk-color-accent-hover); }
.rk-submit-btn:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-submit-btn:active { transform: scale(0.985); }
.rk-submit-btn:disabled {
  background: var(--rk-color-surface-fill-secondary);
  color: var(--rk-color-text-tertiary);
  box-shadow: none; cursor: not-allowed;
}

.rk-submit-error {
  text-align: center;
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-red);
  margin-top: var(--rk-space-2);
  display: none;
}

/* ── Queue Preview ── */
.rk-queue-preview { margin: var(--rk-space-6) 0 var(--rk-space-2); }

.rk-queue-mini-list {
  list-style: none; padding: 0;
  display: flex; flex-direction: column;
}
.rk-queue-mini-item {
  display: flex; align-items: center; gap: var(--rk-space-4);
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
  min-height: 44px;
  border-top: 1px solid var(--rk-color-separator);
}
.rk-queue-mini-item:first-child { border-top: none; }
.rk-qm-rank {
  width: 28px; height: 28px;
  background: var(--rk-color-text-primary);
  color: var(--rk-color-text-inverse);
  border-radius: 50%;
  font-size: var(--rk-font-size-sm);
  font-weight: var(--rk-font-weight-semibold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rk-qm-info { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rk-qm-title {
  display: block;
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-semibold);
  line-height: var(--rk-line-height-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-qm-artist {
  display: block;
  font-size: var(--rk-font-size-xs);
  color: var(--rk-color-text-secondary);
}
.rk-qm-votes {
  font-size: var(--rk-font-size-xs);
  color: var(--rk-color-red);
  font-weight: var(--rk-font-weight-semibold);
  flex-shrink: 0;
  display: flex; align-items: center; gap: 3px;
}
.rk-qm-votes svg { width: 12px; height: 12px; }
.rk-qm-repeat { flex-shrink: 0; color: var(--rk-color-text-tertiary); }
.rk-qm-repeat svg { width: 14px; height: 14px; }

.rk-queue-mini-more {
  text-align: center;
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-text-tertiary);
  padding: var(--rk-space-2) 0 0;
}

/* ── Playlist Button ── */
.rk-playlist-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--rk-space-2);
  padding: 0 var(--rk-space-4); margin: var(--rk-space-2) 0 var(--rk-space-5);
  height: 48px;
  background: transparent;
  border: 2px solid var(--rk-color-separator);
  border-radius: var(--rk-radius-lg);
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-accent);
  cursor: pointer; font-family: inherit;
  letter-spacing: var(--rk-letter-spacing-normal);
  line-height: 48px;
  touch-action: manipulation;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--rk-motion-instant), background var(--rk-motion-instant);
}
.rk-playlist-btn svg { width: 18px; height: 18px; }
.rk-playlist-btn:hover { border-color: var(--rk-color-accent); background: rgba(0,113,227,0.04); }
.rk-playlist-btn:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-playlist-btn:active { opacity: 0.7; }

.rk-playlist-count {
  background: var(--rk-color-red);
  color: #fff;
  border-radius: var(--rk-radius-pill);
  font-size: var(--rk-font-size-xs);
  font-weight: var(--rk-font-weight-bold);
  padding: 2px 8px;
  display: none;
}

/* ── Modal ── */
.rk-modal-overlay {
  position: fixed; inset: 0;
  background: var(--rk-color-overlay);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 9999;
}
.rk-modal {
  background: var(--rk-color-surface-card);
  border-radius: var(--rk-radius-xl) var(--rk-radius-xl) 0 0;
  width: 100%; max-width: 500px;
  max-height: 80vh; max-height: 80dvh;
  display: flex; flex-direction: column;
  box-shadow: var(--rk-shadow-modal);
}
.rk-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--rk-space-5) var(--rk-space-6);
  border-bottom: 1px solid var(--rk-color-separator);
}
.rk-modal-header h3 {
  margin: 0;
  font-size: var(--rk-font-size-xl);
  font-weight: var(--rk-font-weight-bold);
  letter-spacing: 0.004em;
  display: flex; align-items: center; gap: var(--rk-space-2);
}
.rk-modal-header h3 svg { width: 20px; height: 20px; color: var(--rk-color-accent); }
.rk-modal-close {
  background: var(--rk-color-surface-fill);
  border: none; border-radius: 50%;
  width: 32px; height: 32px;
  color: var(--rk-color-text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; min-width: 44px; min-height: 44px;
  transition: background var(--rk-motion-instant);
}
.rk-modal-close:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-modal-close:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: -2px;
}
.rk-modal-close svg { width: 16px; height: 16px; }

.rk-modal-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: var(--rk-space-5) var(--rk-space-6) var(--rk-space-7);
}

.rk-modal-empty { text-align: center; padding: var(--rk-space-8) var(--rk-space-5); }
.rk-modal-empty-icon { color: var(--rk-color-text-tertiary); margin-bottom: var(--rk-space-4); }
.rk-modal-empty-icon svg { width: 56px; height: 56px; }
.rk-modal-empty-title {
  font-size: var(--rk-font-size-xl);
  font-weight: var(--rk-font-weight-bold);
  margin: 0 0 var(--rk-space-1);
}
.rk-modal-empty-sub {
  font-size: var(--rk-font-size-md);
  color: var(--rk-color-text-secondary);
  margin: 0; line-height: var(--rk-line-height-relaxed);
}

.rk-modal-section {
  font-size: var(--rk-font-size-xs);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--rk-letter-spacing-wide);
  margin: 0 0 12px;
}
.rk-modal-section + .rk-modal-section { margin-top: var(--rk-space-6); }

.rk-modal-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--rk-space-2); }
.rk-modal-item {
  display: flex; align-items: center; gap: var(--rk-space-4);
  background: var(--rk-color-surface-fill);
  border-radius: var(--rk-radius-lg);
  padding: 14px var(--rk-space-4);
  min-height: 48px;
}
.rk-modal-rank {
  width: 28px; height: 28px;
  background: var(--rk-color-text-primary);
  color: var(--rk-color-text-inverse);
  border-radius: 50%;
  font-size: var(--rk-font-size-sm);
  font-weight: var(--rk-font-weight-semibold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rk-modal-info { flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.rk-modal-title {
  display: block;
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-semibold);
  line-height: var(--rk-line-height-base);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rk-modal-artist {
  display: block;
  font-size: var(--rk-font-size-sm);
  color: var(--rk-color-text-secondary);
}

.rk-badge-row { display: flex; gap: var(--rk-space-2); flex-wrap: wrap; margin-top: var(--rk-space-1); }
.rk-badge {
  font-size: 11px;
  font-weight: var(--rk-font-weight-semibold);
  padding: 3px 10px;
  border-radius: var(--rk-radius-pill);
  line-height: 1.4;
  display: inline-flex; align-items: center; gap: 4px;
}
.rk-badge svg { width: 11px; height: 11px; }
.rk-badge-votes { background: rgba(255,59,48,0.1); color: var(--rk-color-red); }
.rk-badge-repeat { background: rgba(255,159,10,0.12); color: var(--rk-color-orange); }

.rk-vote-btn {
  background: var(--rk-color-surface-card);
  border: 2px solid var(--rk-color-separator);
  border-radius: var(--rk-radius-md);
  padding: 0 var(--rk-space-4); margin: 0;
  height: 44px; line-height: 44px;
  cursor: pointer; flex-shrink: 0;
  touch-action: manipulation; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  -webkit-appearance: none; appearance: none;
  transition: border-color var(--rk-motion-instant), color var(--rk-motion-instant), transform var(--rk-motion-instant);
  color: var(--rk-color-text-secondary);
  font-family: inherit; font-size: var(--rk-font-size-lg);
}
.rk-vote-btn svg { width: 18px; height: 18px; }
.rk-vote-btn:hover { border-color: var(--rk-color-accent); color: var(--rk-color-accent); }
.rk-vote-btn:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-vote-btn:active { transform: scale(0.95); }
.rk-vote-btn:disabled {
  background: var(--rk-color-green);
  border-color: var(--rk-color-green);
  color: #fff;
  cursor: default;
}

.rk-modal-played { opacity: 0.4; }
.rk-modal-played .rk-modal-rank { background: var(--rk-color-text-tertiary); }
.rk-modal-played .rk-modal-title { color: var(--rk-color-text-tertiary); }

body.rk-modal-open { overflow: hidden; }

/* ── Toast ── */
.rk-toast-overlay {
  position: fixed; inset: 0;
  background: var(--rk-color-overlay);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 9998; display: none;
}
.rk-toast {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--rk-color-surface-card);
  border-radius: var(--rk-radius-xl) var(--rk-radius-xl) 0 0;
  padding: var(--rk-space-7) var(--rk-space-6) calc(var(--rk-space-7) + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--rk-shadow-toast);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform var(--rk-motion-normal) var(--rk-motion-ease);
  will-change: transform;
  max-height: 85vh; max-height: 85dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.rk-toast.rk-toast-visible { transform: translateY(0); }

.rk-toast-icon { text-align: center; margin-bottom: 12px; color: var(--rk-color-green); }
.rk-toast-icon svg { width: 52px; height: 52px; }
.rk-toast-title {
  font-size: var(--rk-font-size-2xl);
  font-weight: var(--rk-font-weight-bold);
  text-align: center;
  letter-spacing: 0.004em;
  margin: 0 0 4px;
}
.rk-toast-sub {
  font-size: var(--rk-font-size-lg);
  color: var(--rk-color-text-secondary);
  text-align: center;
  line-height: var(--rk-line-height-relaxed);
  margin: 0 0 var(--rk-space-7);
}

/* Tip section */
.rk-tip-section {
  background: var(--rk-color-surface-fill);
  border-radius: var(--rk-radius-lg);
  padding: var(--rk-space-5);
  margin-bottom: var(--rk-space-5);
}
.rk-tip-header {
  display: flex; align-items: center; justify-content: center; gap: var(--rk-space-2);
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-semibold);
  margin-bottom: 18px;
}
.rk-tip-header-icon svg { width: 24px; height: 24px; color: var(--rk-color-red); }

.rk-tip-amounts { display: flex; gap: var(--rk-space-2); margin-bottom: var(--rk-space-4); }
.rk-tip-btn {
  flex: 1; text-align: center;
  padding: var(--rk-space-4) var(--rk-space-1);
  background: var(--rk-color-surface-card);
  border: 2px solid var(--rk-color-separator);
  border-radius: var(--rk-radius-md);
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-primary);
  text-decoration: none; cursor: pointer;
  touch-action: manipulation; min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--rk-motion-instant), color var(--rk-motion-instant), transform var(--rk-motion-instant);
  letter-spacing: var(--rk-letter-spacing-normal);
}
.rk-tip-btn:hover { border-color: var(--rk-color-green); color: var(--rk-color-green); }
.rk-tip-btn:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-tip-btn:active { transform: scale(0.96); }

.rk-tip-custom {
  display: flex; align-items: center; gap: var(--rk-space-3);
  background: var(--rk-color-surface-card);
  border: 2px solid var(--rk-color-separator);
  border-radius: var(--rk-radius-md);
  padding: 0 0 0 var(--rk-space-4);
  min-height: 48px;
  transition: border-color var(--rk-motion-instant), box-shadow var(--rk-motion-instant);
}
.rk-tip-custom:focus-within {
  border-color: var(--rk-color-green);
  box-shadow: 0 0 0 3px rgba(52,199,89,0.15);
}
.rk-tip-dollar {
  font-size: var(--rk-font-size-xl);
  font-weight: var(--rk-font-weight-bold);
  color: var(--rk-color-green);
  flex-shrink: 0;
}
.rk-tip-input {
  flex: 1; border: none; background: none;
  font-size: var(--rk-font-size-lg);
  font-family: inherit;
  font-weight: var(--rk-font-weight-medium);
  letter-spacing: var(--rk-letter-spacing-tight);
  line-height: 40px;
  color: var(--rk-color-text-primary);
  padding: 0; margin: 0; outline: none; min-width: 0; height: 40px;
  -webkit-appearance: none; appearance: none; border-radius: 0; box-shadow: none;
  -moz-appearance: textfield;
}
.rk-tip-input::-webkit-outer-spin-button,
.rk-tip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rk-tip-input::placeholder {
  color: var(--rk-color-text-tertiary);
  font-weight: var(--rk-font-weight-regular);
  opacity: 1;
}

.rk-tip-send {
  background: var(--rk-color-green);
  color: #fff;
  border: none;
  border-radius: var(--rk-radius-sm);
  padding: 12px var(--rk-space-5);
  font-size: var(--rk-font-size-md);
  font-weight: var(--rk-font-weight-semibold);
  font-family: inherit;
  text-decoration: none; cursor: pointer; touch-action: manipulation;
  flex-shrink: 0; white-space: nowrap; min-height: 40px;
  display: flex; align-items: center;
  letter-spacing: var(--rk-letter-spacing-normal);
  transition: opacity var(--rk-motion-instant);
}
.rk-tip-send:hover { opacity: 0.85; }
.rk-tip-send:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}

.rk-toast-close {
  width: 100%; padding: 0 var(--rk-space-4); margin: 0;
  height: 50px; line-height: 50px;
  background: var(--rk-color-surface-fill);
  color: var(--rk-color-text-primary);
  border: none;
  border-radius: var(--rk-radius-md);
  font-size: var(--rk-font-size-lg);
  font-weight: var(--rk-font-weight-medium);
  font-family: inherit; cursor: pointer;
  touch-action: manipulation;
  letter-spacing: var(--rk-letter-spacing-tight);
  -webkit-appearance: none; appearance: none;
  transition: background var(--rk-motion-instant);
}
.rk-toast-close:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-toast-close:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: -2px;
}

/* ── Social ── */
.rk-social-section {
  margin-top: var(--rk-space-6);
  padding-top: var(--rk-space-5);
  border-top: 1px solid var(--rk-color-separator);
  text-align: center;
}
.rk-social-label {
  font-size: var(--rk-font-size-xs);
  font-weight: var(--rk-font-weight-semibold);
  color: var(--rk-color-text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--rk-letter-spacing-wide);
  margin: 0 0 var(--rk-space-4);
}
.rk-social-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.rk-social-btn {
  width: 44px; height: 44px;
  border-radius: var(--rk-radius-md);
  background: var(--rk-color-surface-fill);
  display: flex; align-items: center; justify-content: center;
  color: var(--rk-color-text-secondary);
  text-decoration: none;
  touch-action: manipulation;
  transition: transform var(--rk-motion-instant), background var(--rk-motion-instant);
}
.rk-social-btn:hover { background: var(--rk-color-surface-fill-secondary); }
.rk-social-btn:focus-visible {
  outline: 2px solid var(--rk-color-accent);
  outline-offset: 2px;
}
.rk-social-btn:active { transform: scale(0.9); }
.rk-social-btn svg { width: 20px; height: 20px; }

/* ── Spinner ── */
@keyframes rk-spin { to { transform: rotate(360deg); } }
.rk-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rk-spin 0.6s linear infinite;
}

/* ── Icon Helper ── */
.rk-ic {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; vertical-align: middle;
}
.rk-ic svg {
  flex-shrink: 0;
  display: block;
  width: 1em; height: 1em;
}
.rk-ic > span {
  line-height: 1;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .rk-app *, .rk-app *::before, .rk-app *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive Tablet ── */
@media (min-width: 521px) {
  .rk-inner { margin-top: var(--rk-space-6); padding: 36px var(--rk-space-7) var(--rk-space-8); }
  .rk-title { font-size: 32px; }
  .rk-modal-overlay { align-items: center; padding: var(--rk-space-5); }
  .rk-modal { border-radius: var(--rk-radius-xl); max-height: 70vh; }
  .rk-toast {
    left: 50%; right: auto; bottom: var(--rk-space-8);
    width: 440px; margin-left: -220px;
    border-radius: var(--rk-radius-xl); padding-bottom: var(--rk-space-7);
    transform: translateY(calc(100% + var(--rk-space-8)));
  }
}

/* ── iOS Safari Specific ── */
@supports (-webkit-touch-callout: none) {
  .rk-search-results, .rk-disc-list, .rk-modal-body, .rk-toast {
    -webkit-overflow-scrolling: touch;
  }
}
