:root {
  --ll-bg: #e8edf4;
  --ll-surface: #f7f9fc;
  --ll-text: #1f2937;
  --ll-muted: #4b5563;
  --ll-border: #c7d2e5;
  --ll-primary: #0b6ec7;
  --ll-primary-hover: #095ca6;
  --ll-success: #2f855a;
  --ll-danger: #c0392b;
  --ll-radius: 14px;
  --ll-shadow: 0 14px 36px rgb(15 23 42 / 9%);
  --ll-shell: 56rem;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ll-text);
  background:
    radial-gradient(120% 80% at 0% 0%, #f4f8ff 0%, transparent 60%),
    radial-gradient(80% 55% at 100% 12%, #dce8f8 0%, transparent 65%),
    linear-gradient(180deg, #ebf1f8 0%, #e3e9f2 100%);
  line-height: 1.5;
}

a {
  color: var(--ll-primary);
}

p {
  margin: 0;
}

.ll-page {
  padding: 1.5rem 1rem 2.5rem;
}

.ll-shell {
  width: min(100%, var(--ll-shell));
  margin-inline: auto;
}

.ll-shell--narrow {
  --ll-shell: 42rem;
}

.ll-stack > * + * {
  margin-top: 1.25rem;
}

.ll-hero {
  display: grid;
  gap: 0.45rem;
}

.ll-hero--center {
  justify-items: center;
  text-align: center;
}

.ll-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.ll-subtitle {
  color: var(--ll-muted);
  font-size: 1.15rem;
}

.ll-musical-abbreviation {
  font-family: "Cormorant Garamond", "Bodoni MT", "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ll-musical-abbreviation--symbol {
  font-size: 1.5em;
  line-height: 0.95;
  letter-spacing: 0;
}

.ll-abbreviation-label {
  color: #6b7280;
  font-size: 0.95em;
}

.ll-panel {
  background: var(--ll-surface);
  border: 1px solid var(--ll-border);
  border-radius: var(--ll-radius);
  box-shadow: var(--ll-shadow);
  padding: 1.3rem;
}

.ll-panel--overview {
  padding: 0;
  overflow: hidden;
}

.ll-panel--section {
  padding: 0;
  overflow: hidden;
}

.ll-panel-title {
  margin: 0;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--ll-border);
  font-size: clamp(1.7rem, 2.7vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.05;
  background: #f3f5f9;
}

.ll-panel-title--section {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ll-panel-body {
  padding: 1.35rem 1.45rem 1.5rem;
}

.ll-form {
  width: 100%;
}

.ll-field {
  display: grid;
  gap: 0.55rem;
}

.ll-label {
  font-weight: 650;
  font-size: 0.95rem;
}

.ll-input {
  width: 100%;
  border: 1px solid var(--ll-border);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--ll-text);
  min-height: 2.95rem;
  padding: 0.65rem 0.8rem;
  font: inherit;
}

.ll-input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
  border-color: #9bb2d7;
}

.ll-button {
  appearance: none;
  border: 0;
  border-radius: 0.8rem;
  min-height: 2.95rem;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 650;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ll-button--inline {
  width: fit-content;
}

.ll-button--primary {
  background: var(--ll-primary);
  color: #fff;
}

.ll-button--primary:hover {
  background: var(--ll-primary-hover);
}

.ll-button--secondary {
  background: #eef2f7;
  color: var(--ll-text);
  border: 1px solid var(--ll-border);
}

.ll-button--danger {
  background: #b8322f;
  color: #fff;
}

.ll-actions {
  display: flex;
  gap: 0.65rem;
}

.ll-inline-form {
  margin: 0;
}

.ll-actions--end {
  justify-content: flex-end;
}

.ll-actions--between {
  justify-content: space-between;
}

.ll-actions--center {
  justify-content: center;
}

.ll-actions--wrap {
  flex-wrap: wrap;
}

.ll-answer-option {
  width: 100%;
  border: 2px solid transparent;
  transition: border-color 120ms ease;
}

.ll-answer-option--reveal-correct {
  border-color: #5aa85f;
}

.ll-answer-option--correct {
  border-color: #2f855a;
}

.ll-answer-option--incorrect {
  border-color: #c0392b;
}

.ll-answer-option--locked,
.ll-answer-option:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.ll-status {
  color: var(--ll-muted);
}

.ll-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
}

.ll-group-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f6878;
}

.ll-muted {
  color: var(--ll-muted);
}

.ll-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

.ll-list--plain {
  list-style: none;
  padding-left: 0;
}

.ll-list-row {
  border: 1px solid var(--ll-border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.ll-history-metrics {
  text-align: right;
}

.ll-history-session {
  width: 100%;
}

.ll-history-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  cursor: pointer;
}

.ll-history-summary::-webkit-details-marker {
  display: none;
}

.ll-accuracy-pill {
  display: inline-block;
  border-radius: 0.6rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1f2b3d;
}

.ll-accuracy-pill.ll-legend--lt30,
.ll-accuracy-pill.ll-legend--gte90 {
  color: #fff;
}

.ll-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 1.1rem;
}

.ll-metric-card {
  border: 1px solid var(--ll-border);
  border-radius: 1rem;
  background: #fbfcff;
  padding: 0.85rem 0.95rem;
  min-height: 7.8rem;
}

.ll-metric-label {
  color: #5f6878;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ll-metric-value {
  margin-top: 0.2rem;
  color: #1f2b3d;
  font-size: clamp(1.3rem, 1.55vw, 2rem);
  font-weight: 700;
  line-height: 1;
}

.ll-metric-value--compact {
  font-size: clamp(1.25rem, 1.45vw, 1.85rem);
  white-space: nowrap;
}

.ll-panel--overview .ll-muted {
  font-size: 0.95rem;
}

.ll-legend-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ll-legend {
  border-radius: 0.6rem;
  border: 1px solid var(--ll-border);
  padding: 0.35rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.ll-heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.ll-heatmap-card {
  border: 1px solid var(--ll-border);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.95rem 0.8rem 0.8rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.2rem;
}

.ll-heatmap-card--button {
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.ll-heatmap-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.5rem;
  margin: 0;
  border-radius: 0.75rem 0.75rem 0 0;
  background: #b5bfcd;
}

.ll-band-none,
.ll-legend--none {
  background: #b5bfcd;
}

.ll-band-lt30,
.ll-legend--lt30 {
  background: #cc4c43;
}

.ll-band-lt50,
.ll-legend--lt50 {
  background: #d97835;
}

.ll-band-lt70,
.ll-legend--lt70 {
  background: #cab34b;
}

.ll-band-lt90,
.ll-legend--lt90 {
  background: #82b348;
}

.ll-band-gte90,
.ll-legend--gte90 {
  background: #4a9f50;
}

.ll-flash-stack {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.ll-flash {
  border-radius: 0.7rem;
  border: 1px solid transparent;
  padding: 0.6rem 0.85rem;
  background: #e5e7eb;
}

.ll-flash--notice {
  background: #e7f7ee;
  border-color: #b9e5ca;
  color: #19543a;
}

.ll-flash--alert {
  background: #fdeeee;
  border-color: #efc8c7;
  color: #8a2622;
}

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

.ll-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(15 23 42 / 45%);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 50;
  animation: ll-backdrop-fade-in 160ms ease-out;
}

.ll-modal-backdrop[hidden] {
  display: none;
}

.ll-modal-card {
  width: min(100%, 72rem);
  background: #fff;
  border: 1px solid var(--ll-border);
  border-radius: 1.4rem;
  box-shadow: 0 22px 44px rgb(15 23 42 / 20%);
  padding: 1.1rem 1.35rem 1.25rem;
  display: grid;
  gap: 0.55rem;
  animation: ll-modal-pop-in 180ms ease-out;
}

.ll-modal-header {
  display: flex;
  justify-content: flex-end;
}

.ll-modal-tag {
  margin: 0;
  color: #7a828f;
  font-size: clamp(0.82rem, 1.4vw, 1.05rem);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes ll-backdrop-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes ll-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ll-modal-title {
  margin: 0;
  text-align: center;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.ll-modal-definition {
  margin: 0;
  text-align: center;
  font-size: clamp(2rem, 5.8vw, 3.1rem);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ll-text);
}

.ll-modal-meta {
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}

.ll-modal-abbreviation {
  font-size: 1.05rem;
}

.ll-summary-card {
  border: 1px solid var(--ll-border);
  border-left-width: 8px;
  border-radius: 0.9rem;
  background: #fbfcff;
  padding: 1rem 1rem 0.95rem;
}

.ll-summary-card--correct {
  border-left-color: #3c9a4a;
}

.ll-summary-card--incorrect {
  border-left-color: #d85a45;
}

.ll-summary-title {
  margin: 0 0 0.4rem;
  color: #0d66b5;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.12;
}

.ll-summary-answer-line {
  margin: 0.45rem 0;
  font-size: clamp(1.05rem, 2.35vw, 1.3rem);
  line-height: 1.28;
}

.ll-summary-answer-line strong {
  font-weight: 700;
}

.ll-question-title {
  letter-spacing: 0.08em;
  text-align: center;
}

.ll-question-progress {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ll-term-review-title {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.15;
}

.ll-term-review-pronunciation {
  margin: 0.1rem 0 0;
  color: var(--ll-muted);
  font-size: 1.05rem;
  line-height: 1.25;
}

.ll-term-review-abbreviation {
  margin: 0.25rem 0 0;
  color: var(--ll-muted);
  font-size: 1.05rem;
  line-height: 1.25;
}

.ll-term-review-definition {
  margin: 0.1rem 0 0;
  font-size: clamp(1.2rem, 1.8vw, 1.9rem);
  line-height: 1.25;
}

.ll-term-review-card {
  padding: 1.05rem 1rem 0.95rem;
  gap: 0.3rem;
}

.ll-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ll-summary-group {
  margin: 0;
  color: #7a828f;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ll-history-detail-list {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--ll-border);
}

@media (width <= 640px) {
  .ll-page {
    padding-inline: 0.8rem;
  }

  .ll-panel {
    padding: 1rem;
  }

  .ll-button {
    width: 100%;
  }

  .ll-panel-title {
    padding-inline: 1rem;
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .ll-panel-body {
    padding: 1rem 1.05rem 1.1rem;
  }

  .ll-metrics-grid {
    padding: 1rem;
    grid-template-columns: 1fr;
  }

  .ll-metric-value {
    font-size: clamp(1.2rem, 6.1vw, 1.55rem);
  }

  .ll-metric-card {
    min-height: 8.2rem;
    padding: 0.9rem 0.95rem;
  }

  .ll-metric-value--compact {
    font-size: clamp(1.15rem, 5.7vw, 1.45rem);
  }

  .ll-actions .ll-inline-form {
    width: 100%;
  }

  .ll-button--mobile-full {
    width: 100%;
  }

  .ll-history-metrics {
    text-align: left;
  }

  .ll-modal-card {
    width: min(100%, 40rem);
    padding-inline: 1rem;
  }

  .ll-modal-tag {
    font-size: 1.2rem;
  }

  .ll-legend-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .ll-legend {
    width: 100%;
    text-align: center;
    font-size: 0.84rem;
    padding: 0.34rem 0.45rem;
    border-radius: 0.7rem;
  }
}

@media (width <= 860px) {
  .ll-panel-title {
    font-size: clamp(1.85rem, 7.8vw, 2.7rem);
  }

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

  .ll-metric-card {
    min-height: 7rem;
  }

  .ll-metric-value {
    font-size: clamp(1.15rem, 4.2vw, 1.45rem);
  }

  .ll-metric-value--compact {
    font-size: clamp(1.1rem, 3.9vw, 1.35rem);
    white-space: normal;
    line-height: 1.05;
  }

  .ll-button--mobile-full {
    width: 100%;
  }
}
