.chordbase-reader {
  --cb-border: #e2e8f0;
  --cb-surface: #ffffff;
  --cb-surface-muted: #f8fafc;
  --cb-text: #172033;
  --cb-muted: #64748b;
  --cb-accent: #dc5f1f;
  --cb-accent-soft: #fff3e9;
  margin: 1.5rem 0;
  color: var(--cb-text);
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  background: var(--cb-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.chordbase-reader__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cb-border);
  background: var(--cb-surface-muted);
}

.chordbase-reader__title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 14px;
}

.chordbase-reader__title-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  color: var(--cb-accent);
  background: var(--cb-accent-soft);
}

.chordbase-reader__controls {
  display: inline-flex;
  align-items: stretch;
  gap: 6px;
}

.chordbase-reader__button {
  min-width: 44px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--cb-text);
  background: var(--cb-surface);
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chordbase-reader__button:hover,
.chordbase-reader__button:focus-visible {
  border-color: var(--cb-accent);
  background: var(--cb-accent-soft);
  outline: none;
}

.chordbase-reader__button:active {
  transform: translateY(1px);
}

.chordbase-reader__button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.chordbase-reader__button--reset {
  min-width: 68px;
}

.chordbase-reader__status {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  width: 100%;
  color: var(--cb-muted);
  font-size: 13px;
}

.chordbase-reader__status strong {
  color: var(--cb-text);
}

.chordbase-reader__content {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-height: 160px;
  margin: 0;
  padding: 20px;
  border: 0;
  border-radius: 0;
  color: var(--cb-text);
  background: var(--cb-surface);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(14px, 2.4vw, 16px);
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
}

.chordbase-reader__content code {
  display: block;
  min-width: max-content;
  color: inherit;
  background: transparent;
  font: inherit;
  white-space: inherit;
}

.chordbase-reader__line {
  display: inline;
}

.chordbase-reader__line--chord {
  color: var(--cb-accent);
  font-weight: 800;
}

.chordbase-reader__line--section {
  color: var(--cb-text);
  font-weight: 800;
  text-transform: capitalize;
}

.chordbase-reader__line--inline {
  color: var(--cb-text);
}

.chordbase-reader__notice {
  margin: 0;
  padding: 12px 16px;
  color: #9a3412;
  background: #fff7ed;
}

@media (prefers-color-scheme: dark) {
  .chordbase-reader {
    --cb-border: #334155;
    --cb-surface: #0f172a;
    --cb-surface-muted: #111c31;
    --cb-text: #e5edf7;
    --cb-muted: #94a3b8;
    --cb-accent: #fb923c;
    --cb-accent-soft: #2d1d16;
    box-shadow: none;
  }

  .chordbase-reader__button {
    border-color: #475569;
  }
}

@media (max-width: 640px) {
  .chordbase-reader__toolbar {
    align-items: stretch;
  }

  .chordbase-reader__title {
    width: 100%;
  }

  .chordbase-reader__controls {
    width: 100%;
  }

  .chordbase-reader__button {
    flex: 1;
  }

  .chordbase-reader__content {
    padding: 16px 14px;
  }
}
