:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(22, 25, 34, 0.86);
  --panel-strong: #171b24;
  --line: #2b3140;
  --text: #f4f6fb;
  --muted: #969eae;
  --accent: #78e7c2;
  --accent-strong: #3ed5a4;
  --violet: #a79bff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 0%, rgba(91, 75, 190, 0.2), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(48, 177, 142, 0.13), transparent 28rem),
    var(--bg);
  font: 16px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 36px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
  letter-spacing: -0.025em;
}

.intro {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.selection-readout {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 14, 20, 0.66);
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.volume-control input[type="range"] {
  width: 90px;
  cursor: pointer;
  accent-color: var(--accent-strong);
}

.selection-play-button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  color: #07100d;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 30px rgba(62, 213, 164, 0.2);
  cursor: pointer;
}

.selection-play-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6);
  opacity: 0.35;
}

.panel {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.button,
.note-toggle {
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 750;
}

.button:focus-visible,
.note-toggle:focus-visible,
.result-item:focus-visible,
.selection-play-button:focus-visible,
.show-notes-control input:focus-visible {
  outline: 3px solid rgba(120, 231, 194, 0.45);
  outline-offset: 3px;
}

.button:not(:disabled):hover,
.note-toggle:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.button-quiet {
  color: var(--text);
  border-color: var(--line);
  background: #202530;
}

.button-primary {
  color: #07100d;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 30px rgba(62, 213, 164, 0.2);
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(58px, 1fr));
  gap: 10px;
}

.note-toggle {
  position: relative;
  min-height: 76px;
  color: #c6ccda;
  border-color: var(--line);
  background: linear-gradient(180deg, #202531, #181c25);
  font-size: 1rem;
  font-weight: 800;
}

.note-toggle::after {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #596173;
  content: "";
}

.note-toggle[aria-pressed="true"] {
  color: #07100d;
  border-color: var(--accent);
  background: linear-gradient(145deg, #9af1d6, #55ddb1);
  box-shadow: 0 10px 30px rgba(62, 213, 164, 0.18);
}

.note-toggle[aria-pressed="true"]::after {
  background: #0a5c46;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.results-heading {
  align-items: flex-end;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.show-notes-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.show-notes-control input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-strong);
}

.results-heading .hint {
  margin-top: 5px;
}

.empty-state {
  padding: 52px 20px 46px;
  border: 1px dashed #343b4b;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 9px 0 3px;
  color: var(--text);
}

.empty-state p {
  margin-bottom: 0;
}

.empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: auto;
  place-items: center;
  border-radius: 50%;
  color: var(--violet);
  background: rgba(167, 155, 255, 0.11);
  font-size: 1.55rem;
}

.result-output {
  display: grid;
  gap: 8px;
  max-height: 490px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-strong);
  scrollbar-color: #51596b transparent;
}

.result-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 13px 14px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 10px;
  background: #1d222d;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.result-item:hover {
  border-color: #434b5c;
  background: #232936;
}

.result-item[aria-selected="true"] {
  color: #07100d;
  border-color: var(--accent);
  background: linear-gradient(135deg, #9af1d6, #55ddb1);
}

.result-item span {
  font: 0.88rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  opacity: 0.82;
}

@media (max-width: 900px) {
  .note-grid {
    grid-template-columns: repeat(6, 1fr);
  }

}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding: 36px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .selection-readout {
    justify-self: start;
  }

  .panel {
    padding: 20px;
    border-radius: 19px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .results-heading {
    flex-direction: column;
  }

  .result-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .button-primary {
    width: 100%;
  }

  .note-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
