:root,
[data-theme='light'] {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-dim: rgba(37, 99, 235, 0.12);
  --accent-text: #ffffff;
  --danger: #ef4444;
  --shadow: 0 4px 24px rgba(37, 99, 235, 0.08);
  --hero-glow: rgba(37, 99, 235, 0.15);
  --grain-opacity: 0.03;
  --header-bg: rgba(248, 250, 252, 0.9);
  --modal-overlay: rgba(15, 23, 42, 0.45);
  --waveform-bg: #e2e8f0;
  --waveform-fill: #2563eb;
  --waveform-handle: #1d4ed8;
}

[data-theme='dark'] {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --bg-card: #1e293b;
  --border: rgba(148, 163, 184, 0.15);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #3b82f6;
  --accent-dim: rgba(37, 99, 235, 0.2);
  --accent-text: #ffffff;
  --danger: #ef4444;
  --shadow: none;
  --hero-glow: transparent;
  --grain-opacity: 0;
  --header-bg: #0f172a;
  --modal-overlay: rgba(0, 0, 0, 0.55);
  --waveform-bg: #334155;
  --waveform-fill: #2563eb;
  --waveform-handle: #3b82f6;
}

[data-theme='dark'] .hero::before,
[data-theme='dark'] .beat-card:hover {
  box-shadow: none;
}

[data-theme='dark'] .license-card.featured {
  box-shadow: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:root {
  --radius: 12px;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'Bebas Neue', sans-serif;
  --header-h: 72px;
  --max-w: 1200px;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.nav-msg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.home-beats {
  padding-top: 0;
  margin-top: -2rem;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lic-yes {
  color: #16a34a;
}

.lic-no {
  color: var(--danger);
}

.order-code-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.tooltip-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: help;
  display: grid;
  place-items: center;
  padding: 0;
  margin-left: 0.35rem;
}

.tooltip-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 80vw);
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 50;
  overflow: hidden;
}

.tooltip-wrap:hover .tooltip-pop,
.tooltip-wrap:focus-within .tooltip-pop {
  opacity: 1;
  visibility: visible;
}

.tooltip-pop img {
  width: 100%;
  display: block;
  border-radius: 12px 12px 0 0;
}

.tooltip-pop p {
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.purchase-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  align-items: center;
}

.purchase-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

.purchase-dls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  border-radius: 8px;
  transition: transform 0.2s ease;
}

.logo:hover .logo-mark {
  transform: scale(1.05);
}

.logo-text {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.nav a.active::after,
.nav a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, transform 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:active {
  transform: scale(0.95);
}

[data-theme='light'] .theme-icon-dark,
[data-theme='dark'] .theme-icon-light {
  display: none;
}

.lang-switch {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.btn {
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

main {
  min-height: calc(100vh - var(--header-h) - 140px);
}

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 2rem;
  animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  animation: fadeUp 0.6s ease;
}

.hero::before {
  content: '';
  position: absolute;
  top: 5%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--hero-glow) 0%, transparent 65%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.notice-wav {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  max-width: 560px;
  font-size: 0.875rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.notice-wav strong {
  color: var(--accent);
}

.section-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 520px;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.tag-chip.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.tag-chip .count {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.tag-chip.active .count {
  background: rgba(255, 255, 255, 0.25);
  color: inherit;
}

.beats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.beat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease backwards;
}

.beat-card:nth-child(2) { animation-delay: 0.05s; }
.beat-card:nth-child(3) { animation-delay: 0.1s; }
.beat-card:nth-child(4) { animation-delay: 0.15s; }

.beat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15);
}

.beat-cover {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}

.beat-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.beat-card:hover .beat-cover img {
  transform: scale(1.04);
}

.beat-play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.beat-card:hover .beat-play-overlay {
  opacity: 1;
}

.beat-play-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: var(--accent-text);
  font-size: 1.1rem;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.beat-info {
  padding: 1rem;
}

.beat-info h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.beat-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.beat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.beat-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.order-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  animation: fadeUp 0.5s ease 0.2s backwards;
}

.order-cta p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
  }

  .header {
    padding: 0 1rem;
  }
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
}

.stat-box .num {
  font-family: var(--display);
  font-size: 2.5rem;
  color: var(--accent);
}

.stat-box .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.year-hint {
  border-bottom: 1px dashed var(--accent);
  cursor: help;
  color: var(--accent);
}

.licenses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.license-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.license-card:hover {
  transform: translateY(-4px);
}

.license-card.featured {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 8px 40px var(--accent-dim);
}

.license-price {
  font-family: var(--display);
  font-size: 2.5rem;
  color: var(--accent);
  margin: 0.5rem 0 1rem;
}

.license-card ul {
  list-style: none;
  margin-bottom: 1.5rem;
}

.license-card li {
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.license-card li::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
}

.profile-header {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  object-fit: cover;
}

.avatar-lg {
  width: 120px;
  height: 120px;
}

.profile-name {
  font-family: var(--display);
  font-size: 2.5rem;
  letter-spacing: 0.06em;
}

.profile-uid {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.credits-line {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.panel h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.stats-table th,
.stats-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  color: var(--text-muted);
  font-weight: 500;
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.modal-root[hidden] {
  display: none !important;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
}

.modal-wide {
  max-width: 780px;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.2s;
}

.modal-close:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.upload-success {
  text-align: center;
  padding: 2rem 1rem;
  animation: fadeUp 0.4s ease;
}

.upload-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}

.waveform-wrap {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.waveform-canvas {
  width: 100%;
  height: 80px;
  display: block;
  border-radius: 6px;
  cursor: pointer;
  background: var(--waveform-bg);
}

.waveform-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.beat-detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .beat-detail {
    grid-template-columns: 1fr;
  }
}

.beat-detail-cover {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  box-shadow: var(--shadow);
}

.beat-detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.key-toggle {
  display: inline-flex;
  background: var(--bg-elevated);
  border-radius: 8px;
  padding: 3px;
  margin: 0.5rem 0 1rem;
  border: 1px solid var(--border);
}

.key-toggle button {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.key-toggle button.active {
  background: var(--accent);
  color: var(--accent-text);
}

.audio-player {
  width: 100%;
  margin: 1rem 0;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.like-btn:hover {
  transform: scale(1.03);
}

.like-btn.liked {
  border-color: var(--danger);
  color: var(--danger);
}

.comments-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.3s ease;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  flex-shrink: 0;
  object-fit: cover;
}

.comment-body {
  flex: 1;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 600;
}

.comment-author span {
  color: var(--text-muted);
  font-weight: 400;
}

.comment-text {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  min-height: 480px;
}

@media (max-width: 768px) {
  .messages-layout {
    grid-template-columns: 1fr;
  }
}

.conv-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.conv-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.conv-item:hover,
.conv-item.active {
  background: var(--accent-dim);
}

.conv-item h4 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.conv-item p {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  min-height: 480px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  animation: fadeUp 0.25s ease;
}

.chat-msg.mine {
  align-self: flex-end;
  background: var(--accent);
  color: var(--accent-text);
  border-bottom-right-radius: 4px;
}

.chat-msg.theirs {
  align-self: flex-start;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.chat-msg .msg-meta {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-top: 0.35rem;
}

.chat-msg .beat-attach {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.chat-msg.theirs .beat-attach {
  background: var(--accent-dim);
  color: var(--accent);
}

.chat-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  resize: none;
}

.chat-tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  z-index: 300;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.35rem;
}

.footer-contact a {
  color: var(--accent);
  font-weight: 500;
}

.footer-contact a:hover {
  text-decoration: underline;
}

.verify-code-input {
  font-size: 1.75rem;
  letter-spacing: 0.45em;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.upload-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
