.interactive-cifra-panel {
  --ic-border: rgba(148, 163, 184, 0.22);
  --ic-surface: rgba(15, 23, 42, 0.72);
  --ic-muted: #94a3b8;
  --ic-accent: #5eead4;
  color: #e2e8f0;
  display: grid;
  gap: 1rem;
  width: 100%;
}

.interactive-cifra-panel *,
.interactive-cifra-panel *::before,
.interactive-cifra-panel *::after {
  box-sizing: border-box;
}

.interactive-cifra-panel h2,
.interactive-cifra-panel h3,
.interactive-cifra-panel p,
.interactive-cifra-panel ol,
.interactive-cifra-panel ul,
.interactive-cifra-panel dl {
  margin: 0;
}

.interactive-cifra-panel ol,
.interactive-cifra-panel ul {
  list-style: none;
  padding: 0;
}

.interactive-cifra-panel__header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.interactive-cifra-panel__header h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin-top: 0.25rem;
}

.interactive-cifra-panel__header p,
.interactive-cifra-panel__time,
.interactive-cifra-panel__lyric-meta {
  color: var(--ic-muted);
}

.interactive-cifra-panel__eyebrow,
.interactive-cifra-panel__status {
  color: var(--ic-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interactive-cifra-panel__status {
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

.interactive-cifra-panel__notice {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 0.65rem;
  color: #fde68a;
  padding: 0.75rem;
}

.interactive-cifra-panel__metadata,
.interactive-cifra-panel__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interactive-cifra-panel__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.interactive-cifra-panel__metadata > div,
.interactive-cifra-panel article {
  background: var(--ic-surface);
  border: 1px solid var(--ic-border);
  border-radius: 0.75rem;
  min-width: 0;
  padding: 0.85rem;
}

.interactive-cifra-panel__metadata dt,
.interactive-cifra-panel__actions > span,
.interactive-cifra-panel h3 {
  color: var(--ic-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.interactive-cifra-panel__metadata dd {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
}

.interactive-cifra-panel__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interactive-cifra-panel__actions button {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--ic-border);
  border-radius: 0.5rem;
  color: var(--ic-muted);
  cursor: not-allowed;
  padding: 0.45rem 0.7rem;
}

.interactive-cifra-panel h3 {
  margin-bottom: 0.75rem;
}

.interactive-cifra-panel__section-item,
.interactive-cifra-panel__chord,
.interactive-cifra-panel__capabilities li {
  align-items: center;
  border-top: 1px solid var(--ic-border);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.6rem 0;
}

.interactive-cifra-panel__section-item:first-child,
.interactive-cifra-panel__chord:first-child,
.interactive-cifra-panel__capabilities li:first-child {
  border-top: 0;
}

.interactive-cifra-panel__section-item strong {
  text-transform: capitalize;
}

.interactive-cifra-panel__chord {
  display: grid;
  grid-template-columns: minmax(6rem, 1fr) 1fr 0.7fr;
}

.interactive-cifra-panel__chord-name {
  color: var(--ic-accent);
  font-size: 1.05rem;
}

.interactive-cifra-panel__roman {
  font-family: "JetBrains Mono", monospace;
  text-align: right;
}

.interactive-cifra-panel__beats {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.interactive-cifra-panel__beat {
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--ic-border);
  border-radius: 0.45rem;
  display: grid;
  gap: 0.15rem;
  padding: 0.45rem;
  text-align: center;
}

.interactive-cifra-panel__beat.is-downbeat {
  border-color: rgba(94, 234, 212, 0.55);
}

.interactive-cifra-panel__beat small {
  color: var(--ic-muted);
}

.interactive-cifra-panel__lyric {
  border-top: 1px solid var(--ic-border);
  padding: 0.75rem 0;
}

.interactive-cifra-panel__lyric:first-child {
  border-top: 0;
}

.interactive-cifra-panel__lyric-meta {
  display: flex;
  font-size: 0.75rem;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.3rem;
  text-transform: capitalize;
}

.interactive-cifra-panel__capabilities strong {
  font-size: 0.75rem;
}

.interactive-cifra-panel__capabilities .is-available {
  color: #86efac;
}

.interactive-cifra-panel__capabilities .is-unavailable,
.interactive-cifra-panel__warnings {
  color: #fca5a5;
}

.interactive-cifra-panel__warnings {
  display: grid;
  gap: 0.55rem;
  list-style: disc;
  padding-left: 1.2rem;
}

.interactive-cifra-panel__empty {
  color: var(--ic-muted);
  padding: 0.5rem 0;
}

.interactive-cifra-panel__plan-preview {
  border-color: rgba(94, 234, 212, 0.38);
  display: grid;
  gap: 0.85rem;
}

.interactive-cifra-panel__plan-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.interactive-cifra-panel__plan-header h3 {
  margin-bottom: 0.3rem;
}

.interactive-cifra-panel__readonly {
  border: 1px solid var(--ic-border);
  border-radius: 999px;
  color: var(--ic-accent);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
}

.interactive-cifra-panel__plan-notice {
  background: rgba(245, 158, 11, 0.09);
  border-left: 3px solid #f59e0b;
  color: #fde68a;
  padding: 0.6rem 0.75rem;
}

.interactive-cifra-panel__plan-metadata {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.interactive-cifra-panel__plan-metadata > div {
  border: 1px solid var(--ic-border);
  border-radius: 0.55rem;
  min-width: 0;
  padding: 0.6rem;
}

.interactive-cifra-panel__plan-metadata dt {
  color: var(--ic-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
}

.interactive-cifra-panel__plan-metadata dd {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.25rem 0 0;
  overflow-wrap: anywhere;
}

.interactive-cifra-panel__plan-summary,
.interactive-cifra-panel__confirmation {
  color: var(--ic-accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.interactive-cifra-panel__plan-chords {
  border: 1px solid var(--ic-border);
  border-radius: 0.65rem;
  overflow: hidden;
}

.interactive-cifra-panel__plan-chord {
  align-items: center;
  border-top: 1px solid var(--ic-border);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2rem minmax(5rem, 1fr) minmax(7rem, 1fr) minmax(3rem, 0.5fr);
  padding: 0.55rem 0.7rem;
}

.interactive-cifra-panel__plan-chord:first-child {
  border-top: 0;
}

.interactive-cifra-panel__plan-index {
  color: var(--ic-muted);
  font-family: "JetBrains Mono", monospace;
}

.interactive-cifra-panel__plan-footer section {
  min-width: 0;
}

.interactive-cifra-panel__plan-capabilities {
  display: grid;
  gap: 0.5rem;
}

.interactive-cifra-panel__plan-capabilities li {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.interactive-cifra-panel__plan-capabilities .is-unavailable {
  color: #fca5a5;
}

.interactive-cifra-panel__quantized-preview {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--ic-border);
  border-radius: 0.8rem;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.interactive-cifra-panel__quantized-preview.is-unavailable {
  border-style: dashed;
}

.interactive-cifra-panel__performance-preview {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 0.8rem;
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.interactive-cifra-panel__performance-preview.is-unavailable {
  border-style: dashed;
}

.interactive-cifra-panel__quantized-metadata {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.interactive-cifra-panel__performance-metadata {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.interactive-cifra-panel__quantized-controls {
  align-items: end;
  border: 1px solid var(--ic-border);
  border-radius: 0.65rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(2, minmax(8rem, 0.8fr)) minmax(12rem, 1fr);
  padding: 0.75rem;
}

.interactive-cifra-panel__quantized-control-header {
  display: grid;
  gap: 0.2rem;
}

.interactive-cifra-panel__quantized-control-header h4 {
  color: var(--ic-muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.interactive-cifra-panel__quantized-control-header span,
.interactive-cifra-panel__quantized-controls p {
  color: var(--ic-muted);
  font-size: 0.78rem;
}

.interactive-cifra-panel__quantized-controls label {
  display: grid;
  gap: 0.3rem;
}

.interactive-cifra-panel__quantized-controls label span {
  color: var(--ic-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.interactive-cifra-panel__quantized-controls select {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--ic-border);
  border-radius: 0.5rem;
  color: #e2e8f0;
  min-height: 2.25rem;
  padding: 0.4rem 0.55rem;
}

.interactive-cifra-panel__quantized-chords {
  display: grid;
  gap: 0;
}

.interactive-cifra-panel__performance-chords {
  display: grid;
  gap: 0;
}

.interactive-cifra-panel__quantized-chord {
  align-items: center;
  border-top: 1px solid var(--ic-border);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2rem minmax(5rem, 1fr) repeat(5, minmax(5rem, 1fr));
  padding: 0.65rem 0;
}

.interactive-cifra-panel__performance-chord {
  align-items: center;
  border-top: 1px solid var(--ic-border);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2rem minmax(5rem, 1fr) repeat(3, minmax(7rem, 1fr));
  padding: 0.65rem 0;
}

.interactive-cifra-panel__quantized-chord:first-child {
  border-top: 0;
}

.interactive-cifra-panel__performance-chord:first-child {
  border-top: 0;
}

.interactive-cifra-panel__quantized-chord span {
  display: grid;
  gap: 0.15rem;
}

.interactive-cifra-panel__performance-chord span {
  display: grid;
  gap: 0.15rem;
}

.interactive-cifra-panel__quantized-chord small {
  color: var(--ic-muted);
}

.interactive-cifra-panel__performance-chord small {
  color: var(--ic-muted);
}

.interactive-cifra-panel__send-controls {
  display: grid;
  gap: 0.65rem;
  justify-items: start;
}

.interactive-cifra-panel__send-controls > button,
.interactive-cifra-panel__send-confirm button {
  background: rgba(94, 234, 212, 0.1);
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 0.5rem;
  color: #ccfbf1;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
}

.interactive-cifra-panel__send-controls > button:disabled {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--ic-border);
  color: var(--ic-muted);
  cursor: not-allowed;
}

.interactive-cifra-panel__send-confirm {
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 0.65rem;
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
}

.interactive-cifra-panel__send-confirm > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.interactive-cifra-panel__send-result {
  border-left: 3px solid var(--ic-muted);
  padding: 0.45rem 0.65rem;
}

.interactive-cifra-panel__send-result.is-sent {
  border-color: #86efac;
  color: #86efac;
}

.interactive-cifra-panel__send-result.is-error,
.interactive-cifra-panel__send-result.is-blocked {
  border-color: #fca5a5;
  color: #fca5a5;
}

@media (max-width: 720px) {
  .interactive-cifra-panel__header {
    display: grid;
  }

  .interactive-cifra-panel__status {
    justify-self: start;
  }

  .interactive-cifra-panel__grid,
  .interactive-cifra-panel__metadata,
  .interactive-cifra-panel__plan-metadata,
  .interactive-cifra-panel__quantized-controls,
  .interactive-cifra-panel__performance-metadata,
  .interactive-cifra-panel__quantized-metadata {
    grid-template-columns: 1fr;
  }

  .interactive-cifra-panel__plan-header {
    display: grid;
  }

  .interactive-cifra-panel__readonly {
    justify-self: start;
  }

  .interactive-cifra-panel__plan-chord {
    grid-template-columns: 1.5rem 1fr 1fr;
  }

  .interactive-cifra-panel__plan-chord .interactive-cifra-panel__roman {
    grid-column: 2 / -1;
    text-align: left;
  }

  .interactive-cifra-panel__beats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .interactive-cifra-panel__quantized-chord {
    grid-template-columns: 1.5rem 1fr 1fr;
  }

  .interactive-cifra-panel__performance-chord {
    grid-template-columns: 1.5rem 1fr;
  }

  .interactive-cifra-panel__performance-chord span {
    grid-column: 2 / -1;
  }
}
