/* Subharmonicon-specific styling, layered on top of the shared chrome in
   styles.css. */

.view-tabs { display: flex; gap: 4px; padding: 10px 22px 0 22px; }
.view-tab {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  padding: 9px 16px 11px 16px;
  cursor: pointer;
}
.view-tab:hover { color: var(--text); }
.view-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.stage { overflow-y: auto; display: block; padding: 18px 22px 32px 22px; }
.view { display: none; }
.view.active { display: block; }

.hint { font-size: 12px; line-height: 1.55; color: var(--text-dim); margin: 0 0 14px 0; }

/* Matches .card-title in chrome.css — the layout properties are inherited
   from there via the shared selector; only the alias is declared here. */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 0 0 12px;
}

.card { margin-bottom: 16px; }
.card:last-child { margin-bottom: 0; }

/* ---------------- Osc 1 / Osc 2 tabs ---------------- */

.osc-grid { display: flex; gap: 18px; align-items: flex-start; }
.osc-main { flex: 1; min-width: 0; }
.osc-side { width: 300px; flex-shrink: 0; }

.root-value {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(0, 200, 255, 0.4);
  margin-bottom: 4px;
}
.root-value .unit { font-size: 15px; color: var(--text-dim); text-shadow: none; margin-left: 4px; }
.root-sub { font-size: 12px; color: var(--text-dim); min-height: 15px; margin-bottom: 16px; }

.root-controls { display: flex; flex-direction: column; gap: 10px; }
.root-control-row { display: flex; gap: 8px; align-items: center; }
.root-control-row input[type="text"] {
  flex: 1;
  background: var(--panel-raised);
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--mono);
}
.root-control-row .btn-inline {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-raised);
  border: 1px solid var(--hairline-strong);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.root-control-row .btn-inline:hover { border-color: var(--accent-dim); color: var(--accent); }
.root-control-row .btn-inline.detecting {
  color: #04211c;
  background: var(--accent);
  border-color: var(--accent);
}

.level-meter {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 2px;
}
.level-meter-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.06s linear;
}
.level-label {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Divide table */

.divide-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.divide-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 10px 8px 10px;
  border-bottom: 1px solid var(--hairline);
}
.divide-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
}
.divide-table tr:last-child td { border-bottom: none; }
.divide-table tr.is-sub1 { background: rgba(0, 200, 255, 0.07); }
.divide-table tr.is-sub2 { background: rgba(167, 139, 250, 0.08); }
.divide-table .n-col { color: var(--text-dim); width: 40px; }
.divide-table .note-col { color: var(--text); font-weight: 600; }
.divide-table .interval-col { color: var(--text-dim); font-family: var(--sans); }
.divide-table .assign-col { text-align: right; }

.assign-badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 3px 9px;
}
.assign-badge.sub1 { color: var(--accent); background: rgba(0, 200, 255, 0.15); }
.assign-badge.sub2 { color: var(--violet); background: rgba(167, 139, 250, 0.15); }

.sub-assign-row { display: flex; gap: 10px; margin-top: 14px; }
.sub-assign {
  flex: 1;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--panel-raised);
}
.sub-assign-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sub-assign.sub1 .sub-assign-label { color: var(--accent); }
.sub-assign.sub2 .sub-assign-label { color: var(--violet); }
.sub-assign select { width: 100%; padding: 7px 8px; font-size: 13px; }

/* Target picker */

.target-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.target-picker select { flex: 1; }
.target-result {
  font-size: 12px;
  color: var(--text-dim);
  min-height: 16px;
  margin-bottom: 4px;
}
.target-result strong { color: var(--accent); }

/* ---------------- Combined ---------------- */

.combined-tuning-row { display: flex; gap: 12px; align-items: center; }
.combined-tuning-row select { flex: 1; }
.combined-osc2-freq {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  white-space: nowrap;
}

.chord-list { display: flex; flex-direction: column; gap: 6px; }
.chord-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--panel-raised);
}
.chord-voice-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: 96px;
  flex-shrink: 0;
  color: var(--text-dim);
}
.chord-voice-label.osc1 { color: var(--accent); }
.chord-voice-label.osc2 { color: var(--violet); }
.chord-freq { font-family: var(--mono); font-size: 13px; color: var(--text); width: 90px; flex-shrink: 0; }
.chord-note { font-family: var(--mono); font-size: 13px; color: var(--text); width: 60px; flex-shrink: 0; }
.chord-interval { font-size: 12px; color: var(--text-dim); flex: 1; }

.map-card .ladder-wrap {
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: #000;
}
#ladderSvg { width: 100%; height: auto; display: block; }

/* ---------------- Ratio Library (unchanged pattern) ---------------- */

.library-grid { display: flex; gap: 18px; align-items: flex-start; }
.library-sidebar { width: 280px; flex-shrink: 0; display: flex; flex-direction: column; gap: 16px; }
.library-cat-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 6px 4px;
}
.library-item {
  display: block; width: 100%; text-align: left; font-size: 13px; color: var(--text);
  background: var(--panel-raised); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 6px; cursor: pointer;
}
.library-item:hover { border-color: var(--accent-dim); }
.library-item.active {
  border-color: var(--accent); background: rgba(0, 200, 255, 0.08); color: var(--accent); font-weight: 600;
}
.library-detail { flex: 1; min-width: 0; }
.library-detail-title { font-size: 19px; font-weight: 700; margin: 0 0 6px 0; }
.library-detail-cat {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: rgba(0, 200, 255, 0.1); border: 1px solid var(--accent-dim);
  border-radius: 3px; padding: 3px 10px; margin-bottom: 16px;
}
.library-detail-blurb { font-size: 13.5px; line-height: 1.65; color: var(--text-dim); margin: 0 0 22px 0; max-width: 620px; }
.divider-grid { display: grid; grid-template-columns: repeat(2, minmax(200px, 1fr)); gap: 14px; }
.divider-osc { border: 1px solid var(--hairline); border-radius: 8px; padding: 14px; background: var(--panel-raised); }
.divider-osc h3 { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 10px 0; }
.divider-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; padding: 3px 0; }
.divider-row span:first-child { color: var(--text-dim); }
.divider-row span:last-child { color: var(--text); }

@media (max-width: 900px) {
  .osc-grid, .library-grid { flex-direction: column; }
  .osc-side, .library-sidebar { width: 100%; }
  .divider-grid { grid-template-columns: 1fr; }
  .sub-assign-row { flex-direction: column; }
}
