:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent: #cf0f5c;
    --border: #e2e8f0;
  }
  body {
    margin: 0;
    padding: 0;
    background-color: #fafaf9;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  .soundboard-hero {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    max-width: 860px;
    margin: 0 auto;
  }
  .soundboard-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #cf0f5c;
    color: #ffffff;
    border: 2px solid #0f172a;
    box-shadow: 2px 2px 0px #0f172a;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.85rem;
  }
  .soundboard-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0 0 0.75rem;
    line-height: 1.15;
    letter-spacing: -0.025em;
  }
  .soundboard-hero p {
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 auto 1.5rem;
    max-width: 680px;
  }
  .soundboard-main-container {
    max-width: 1100px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
  }
  .sound-deck-card {
    background: #ffffff;
    border: 2.5px solid #0f172a;
    box-shadow: 4px 4px 0px #0f172a;
    border-radius: 20px;
    padding: 2rem;
  }
  .sound-deck-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1rem;
  }
  .sound-deck-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .sound-grid-talkback {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
  @media (max-width: 1024px) {
    .sound-grid-talkback {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  @media (max-width: 600px) {
    .sound-grid-talkback {
      grid-template-columns: 1fr;
    }
  }
  .talkback-btn-card {
    background: #ffffff;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 14px;
    padding: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .talkback-btn-card:hover {
    transform: translate(-1.5px, -1.5px);
    box-shadow: 4.5px 4.5px 0px #0f172a;
    background: #fdf2f8;
  }
  .talkback-btn-card:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #0f172a;
  }
  .sample-meow-card {
    background: #ffffff;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 14px;
    padding: 1.25rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .sample-meow-card:hover {
    transform: translate(-1.5px, -1.5px);
    box-shadow: 4.5px 4.5px 0px #0f172a;
    background: #f0fdf4;
  }
  .sample-meow-card:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #0f172a;
  }
  .ear-feedback-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f8fafc;
    border: 2px solid #0f172a;
    border-radius: 14px;
    box-shadow: 2px 2px 0px #0f172a;
  }
  .ethology-guide-section {
    background: #ffffff;
    border: 2.5px solid #0f172a;
    box-shadow: 4px 4px 0px #0f172a;
    border-radius: 20px;
    padding: 2rem;
  }
  /* ANIME MANGA BRANDING & HERO HOST CARD */
  .anime-hero-host-card {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 2.5px solid #0f172a;
    box-shadow: 4px 4px 0px #0f172a;
    border-radius: 16px;
    padding: 0.85rem 1.25rem;
    margin-top: 1.25rem;
    text-align: left;
    max-width: 640px;
  }
  .anime-host-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2.5px solid #0f172a;
    box-shadow: 2px 2px 0px #0f172a;
    object-fit: cover;
    flex-shrink: 0;
  }
  .anime-host-text {
    font-size: 0.88rem;
    color: #334155;
    line-height: 1.45;
  }
  .anime-host-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #be185d;
    display: block;
    margin-bottom: 0.15rem;
  }

  /* MANGA ICON BADGES (REPLACES UNSTYLED BARE EMOJIS) */
  .manga-icon-badge {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    border: 2px solid #0f172a;
    box-shadow: 2.5px 2.5px 0px #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: transform 0.12s ease;
  }
  .talkback-btn-card:hover .manga-icon-badge,
  .sample-meow-card:hover .manga-icon-badge {
    transform: scale(1.08) rotate(-3deg);
  }
  .manga-icon-badge.indigo { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: #3730a3; }
  .manga-icon-badge.emerald { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); color: #065f46; }
  .manga-icon-badge.amber { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #9a3412; }
  .manga-icon-badge.pink { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); color: #9d174d; }
  .manga-icon-badge.crimson { background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); color: #991b1b; }
  .manga-icon-badge.orange { background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%); color: #c2410c; }
  .manga-icon-badge.purple { background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%); color: #5b21b6; }
  .manga-icon-badge.rose { background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%); color: #be123c; }
  .manga-icon-badge.cyan { background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%); color: #0369a1; }

  /* MANGA CHIP ICONS */
  .manga-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid #0f172a;
    font-size: 0.8rem;
    margin-right: 0.35rem;
    flex-shrink: 0;
  }
  .manga-chip-icon.amber { background: #fef3c7; }
  .manga-chip-icon.indigo { background: #e0e7ff; }
  .manga-chip-icon.emerald { background: #d1fae5; }
  .manga-chip-icon.pink { background: #fce7f3; }
  .manga-chip-icon.crimson { background: #fee2e2; }

  /* ADMIN BANNER */
  .admin-dev-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: #fef08a;
    color: #854d0e;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 10px;
    padding: 0.55rem 0.95rem;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
  }

  /* TALKBACK STUDIO & GARAGEBAND DSP RACK STYLES */
  .studio-deck {
    position: relative;
    overflow: hidden;
  }
  .studio-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1.5px solid #0f172a;
    box-shadow: 2px 2px 0px #0f172a;
    background: #fdf2f8;
    color: #be185d;
  }
  .studio-tier-badge.pro {
    background: #fef08a;
    color: #854d0e;
  }
  .speech-act-input-box {
    margin: 1.25rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .speech-act-input-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
  }
  .studio-input {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 12px;
    box-shadow: 3px 3px 0px #0f172a;
    transition: all 0.15s ease;
  }
  .studio-input:focus {
    outline: none;
    border-color: #cf0f5c;
    box-shadow: 3px 3px 0px #cf0f5c;
  }
  .studio-arcade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1.35rem;
    font-size: 0.92rem;
    font-weight: 800;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 12px;
    cursor: pointer;
    background: #ffffff;
    color: #0f172a;
    transition: all 0.12s ease;
    user-select: none;
    text-decoration: none;
  }
  .studio-arcade-btn:hover {
    transform: translate(-1.5px, -1.5px);
    box-shadow: 4.5px 4.5px 0px #0f172a;
  }
  .studio-arcade-btn:active {
    transform: translate(1.5px, 1.5px);
    box-shadow: 1.5px 1.5px 0px #0f172a;
  }
  .studio-arcade-btn.primary {
    background: #cf0f5c;
    color: #ffffff;
  }
  .studio-arcade-btn.play-btn {
    background: #047857;
    color: #ffffff;
    font-size: 1.02rem;
    padding: 0.85rem 1.75rem;
  }
  .studio-arcade-btn.play-btn.playing {
    background: #f59e0b;
    animation: studioPulse 1.2s infinite;
  }
  @keyframes studioPulse {
    0%, 100% { box-shadow: 3px 3px 0px #0f172a; }
    50% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.75), 3px 3px 0px #0f172a; }
  }
  .studio-arcade-btn.stop-btn {
    background: #dc2626;
    color: #ffffff;
  }
  .studio-arcade-btn.reset-btn {
    background: #f1f5f9;
    color: #334155;
  }
  .studio-arcade-btn.save-btn {
    background: #4f46e5;
    color: #ffffff;
  }
  .speech-act-chips-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  .speech-act-chip {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    background: #f8fafc;
    border: 1.5px solid #0f172a;
    box-shadow: 1.5px 1.5px 0px #0f172a;
    border-radius: 9999px;
    cursor: pointer;
    color: #334155;
    transition: all 0.12s ease;
  }
  .speech-act-chip:hover {
    background: #ffe4e6;
    color: #be123c;
    transform: translate(-1px, -1px);
    box-shadow: 2.5px 2.5px 0px #0f172a;
  }
  .speech-act-chip:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #0f172a;
  }

  /* GARAGEBAND RACK & WAVEFORM */
  .garageband-rack {
    background: #090d16;
    border: 2.5px solid #0f172a;
    box-shadow: 4px 4px 0px #0f172a;
    border-radius: 16px;
    padding: 1.5rem;
    color: #f8fafc;
    margin-bottom: 1.5rem;
  }
  .rack-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .rack-title {
    font-size: 0.88rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }
  .waveform-container {
    background: #030712;
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 10px;
    position: relative;
    height: 120px;
    width: 100%;
    margin-bottom: 1.25rem;
    overflow: hidden;
  }
  #studioWaveformCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
  }
  .waveform-overlay-info {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.7rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #38bdf8;
    background: rgba(0, 0, 0, 0.65);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.3);
  }
  .dsp-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
  }
  .dsp-control-unit {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  .dsp-unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .dsp-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
  .dsp-value-badge {
    font-size: 0.72rem;
    font-weight: 800;
    background: #38bdf8;
    color: #030712;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  }
  .dsp-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
  }
  .dsp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #cf0f5c;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 42, 133, 0.8);
    transition: transform 0.1s ease;
  }
  .dsp-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
  }
  .dsp-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #cf0f5c;
    border: 2px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 42, 133, 0.8);
  }
  .dsp-select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
  }
  .dsp-desc {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.35;
    margin: 0;
  }
  .contour-btn-group {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
  }
  .contour-btn {
    background: #1e293b;
    color: #cbd5e1;
    border: 1.5px solid #475569;
    border-radius: 6px;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.12s ease;
  }
  .contour-btn:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #38bdf8;
  }
  .contour-btn.active {
    background: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
  }
  .transport-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1.25rem;
  }

  /* CAT REACTION GAME */
  .cat-reaction-game-card {
    background: #ffffff;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 14px;
    padding: 1.35rem;
    margin-bottom: 1.5rem;
  }
  .reaction-btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.65rem;
    margin: 0.85rem 0;
  }
  .reaction-btn {
    background: #f8fafc;
    border: 2px solid #0f172a;
    box-shadow: 2px 2px 0px #0f172a;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.12s ease;
  }
  .reaction-btn:hover {
    background: #f0fdf4;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px #0f172a;
  }
  .reaction-btn.selected {
    background: #bbf7d0;
    border-color: #166534;
    color: #14532d;
    box-shadow: 2px 2px 0px #166534;
  }
  .reaction-feedback-box {
    background: #f8fafc;
    border: 1.5px solid #0f172a;
    border-radius: 10px;
    padding: 1rem 1.15rem;
    margin-top: 0.75rem;
  }

  /* SAVED REACTION REPORTS */
  .saved-reports-card {
    background: #fffbeb;
    border: 2px solid #0f172a;
    box-shadow: 3px 3px 0px #0f172a;
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin-top: 1.5rem;
  }
  .saved-reports-title { margin: 0; font-size: 1rem; font-weight: 900; color: #78350f; }
  .saved-reports-note { margin: 0.25rem 0 0.75rem; font-size: 0.8rem; color: #92400e; }
  .saved-reports-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
  .saved-report-row {
    background: #ffffff;
    border: 1.5px solid #0f172a;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .saved-report-text { flex: 1; min-width: 200px; }
  .saved-report-sentence { font-weight: 800; color: #0f172a; font-size: 0.92rem; }
  .saved-report-meta { font-size: 0.75rem; color: #64748b; margin-top: 0.15rem; }
  .saved-report-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

  /* STUDIO UPGRADE MODAL */
  .studio-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 9999;
  }
  .studio-modal-card {
    background: #ffffff;
    border: 3px solid #0f172a;
    box-shadow: 6px 6px 0px #0f172a;
    border-radius: 20px;
    max-width: 540px;
    width: 100%;
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
  }
  @media (prefers-reduced-motion: reduce) {
    .studio-arcade-btn.play-btn.playing {
      animation: none;
    }
    .studio-arcade-btn, .speech-act-chip, .talkback-btn-card, .sample-meow-card {
      transition: none;
    }
  }

.dsp-slider:focus-visible { outline: var(--border-w) solid var(--focus); outline-offset: var(--border-w); }

#scratchPadInput, #fieldTestNotesInput { box-sizing: border-box; max-width: 100%; }
