:root {
  color-scheme: dark;
  --bg: #111419;
  --panel: #191e25;
  --panel-strong: #202731;
  --text: #f3f5f8;
  --muted: #aeb7c4;
  --soft: #7f8a99;
  --line: #2d3542;
  --accent: #4fb3a3;
  --accent-strong: #77d7c7;
  --warn: #f0bd63;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(79, 179, 163, 0.12), transparent 30rem),
    linear-gradient(135deg, #111419 0%, #15191f 52%, #101317 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  padding: 2rem clamp(1rem, 4vw, 3rem);
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 4vw, 4.4rem);
  line-height: 1;
  margin: 0;
}

.subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0.9rem 0 0;
}

.reset-button,
.copy-button {
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  color: #071411;
  font-weight: 800;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
}

.reset-button {
  background: transparent;
  border: 1px solid #8b4f59;
  color: #ffd5db;
  flex: 0 0 auto;
}

.dashboard {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  padding: 1.25rem clamp(1rem, 4vw, 3rem) 3rem;
}

.sidebar {
  position: relative;
}

.sidebar-inner {
  background: rgba(25, 30, 37, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.sidebar-title {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

#sampleNav {
  display: grid;
  gap: 0.35rem;
}

.nav-link {
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  display: block;
  line-height: 1.25;
  padding: 0.7rem 0.75rem;
  text-decoration: none;
}

.nav-link:hover,
.nav-link:focus {
  background: var(--panel-strong);
  border-color: var(--line);
  color: var(--text);
  outline: none;
}

.content {
  min-width: 0;
}

.summary-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 7.1rem;
  padding: 1rem;
}

.summary-card span {
  color: var(--soft);
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.summary-card strong {
  color: var(--text);
  display: block;
  font-size: clamp(1.35rem, 2.4vw, 2.15rem);
  line-height: 1.05;
}

.progress-track {
  background: #0d1015;
  border-radius: 999px;
  height: 0.45rem;
  margin-top: 1rem;
  overflow: hidden;
}

#progressFill {
  background: linear-gradient(90deg, var(--accent), var(--warn));
  height: 100%;
  transition: width 180ms ease;
  width: 0;
}

.sample-list {
  display: grid;
  gap: 1.25rem;
}

.sample-card {
  background: rgba(25, 30, 37, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.2vw, 1.6rem);
  scroll-margin-top: 1rem;
}

.sample-topline {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.sample-kicker {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.3rem);
  margin: 0;
}

.sample-description {
  color: var(--muted);
  line-height: 1.55;
  margin: 0.7rem 0 0;
  max-width: 72ch;
}

.recorded-toggle {
  align-items: center;
  background: #12161c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
}

.recorded-toggle input {
  accent-color: var(--accent);
  height: 1.1rem;
  width: 1.1rem;
}

.detail-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) minmax(0, 0.9fr) minmax(0, 1.08fr) minmax(13rem, 0.86fr);
  margin: 1.2rem 0;
}

.detail-card {
  background: #12161c;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 8.4rem;
  padding: 0.8rem;
}

.detail-card > span {
  color: var(--soft);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.detail-card strong {
  color: var(--text);
  display: block;
  font-size: 0.98rem;
  line-height: 1.35;
}

.mood-card {
  border-color: rgba(79, 179, 163, 0.45);
  box-shadow: inset 0 0 0 1px rgba(79, 179, 163, 0.08);
}

.mood-card strong {
  color: #eefbf8;
  font-size: 1.03rem;
}

.tone-references {
  display: grid;
  gap: 0.45rem;
}

.tone-references span {
  background: rgba(79, 179, 163, 0.1);
  border: 1px solid rgba(79, 179, 163, 0.18);
  border-radius: 999px;
  color: #d9f3ee;
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 0.42rem 0.6rem;
}

.reference-card {
  border-color: rgba(240, 189, 99, 0.26);
}

.reference-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin: -0.1rem 0 0.65rem;
}

.reference-videos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.reference-link {
  background: rgba(240, 189, 99, 0.1);
  border: 1px solid rgba(240, 189, 99, 0.24);
  border-radius: 999px;
  color: #ffe2a8;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  padding: 0.42rem 0.58rem;
  text-decoration: none;
}

.reference-link:hover,
.reference-link:focus {
  background: rgba(240, 189, 99, 0.18);
  border-color: rgba(240, 189, 99, 0.45);
  color: #fff0c7;
  outline: none;
}

.recording-stats {
  display: grid;
  gap: 0.45rem;
  margin: 0;
}

.recording-stats div {
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding-bottom: 0.38rem;
}

.recording-stats div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.recording-stats dt,
.recording-stats dd {
  margin: 0;
}

.recording-stats dt {
  color: var(--soft);
  font-size: 0.82rem;
  line-height: 1.25;
}

.recording-stats dd {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: right;
}

.script-toolbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.7rem;
}

.script-toolbar label,
.notes-label {
  color: var(--muted);
  font-weight: 800;
}

.script-editor,
.notes-editor {
  background: #0e1116;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  display: block;
  outline: none;
  resize: vertical;
  width: 100%;
}

.script-editor:focus,
.notes-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 179, 163, 0.18);
}

.script-editor {
  font-size: 1.15rem;
  line-height: 1.72;
  min-height: 32rem;
  padding: 1rem;
}

.notes-label {
  display: block;
  margin-top: 1rem;
}

.notes-editor {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.5rem;
  min-height: 5rem;
  padding: 0.8rem;
}

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

  .sidebar-inner {
    position: static;
  }

  #sampleNav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .app-header,
  .sample-topline {
    align-items: stretch;
    flex-direction: column;
  }

  #sampleNav,
  .summary-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .recorded-toggle,
  .reset-button,
  .copy-button {
    justify-content: center;
    width: 100%;
  }
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #fff;
    color: #111;
  }

  .app-header,
  .sidebar,
  .summary-grid,
  .script-toolbar,
  .notes-label,
  .recorded-toggle {
    display: none;
  }

  .dashboard {
    display: block;
    padding: 0;
  }

  .sample-card {
    border: 0;
    box-shadow: none;
    break-after: page;
    padding: 0;
  }

  .detail-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail-card,
  .script-editor {
    background: #fff;
    border-color: #ddd;
    color: #111;
  }

  .detail-card strong,
  .recording-stats dd {
    color: #111;
  }

  .detail-card > span,
  .recording-stats dt {
    color: #555;
  }

  .tone-references span {
    background: #f4f4f4;
    border-color: #ddd;
    color: #111;
  }

  .reference-note {
    color: #555;
  }

  .reference-link {
    background: #f8f8f8;
    border-color: #ddd;
    color: #111;
  }

  .script-editor {
    min-height: 0;
    overflow: visible;
  }
}
