/* TubeLabLight — © 2026 Carlo Andrea Rozzi. AGPL-3.0-only.
   Dark theme matching TubeLab (the shared shape editor draws on a dark canvas). */

:root {
    --bg:        #0f150f;
    --panel:     #162016;
    --border:    #2b3d2b;
    --text:      #e3eee3;
    --text-dim:  #9db39d;
    --accent:    #f0a54a;
    --accent-2:  #6fc36f;
    --blue:      #5ab0ff;
    --row-hover: #203020;
    --row-sel:   #2c452c;
    font-size: 15px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.4;
}

button, select, input { font: inherit; color: inherit; }

button, select {
    background: #223322;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
}
button:hover, select:hover { border-color: var(--accent-2); }
button.accent { background: var(--accent); color: #1a1205; border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: 0.4; cursor: default; }

a { color: var(--accent); }

/* ---------- top bar ---------- */
.topbar {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.title-block { display: flex; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 1.4rem; }
.credits { color: var(--text-dim); font-size: 0.85rem; flex-basis: 100%; }
.topbar h1 .light { color: var(--accent); }
.subtitle { color: var(--text-dim); }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.lang-btn { border-radius: 0; padding: 3px 8px; }
.lang-btn:first-child { border-radius: 6px 0 0 6px; }
.lang-btn:last-child  { border-radius: 0 6px 6px 0; border-left: none; }
.lang-btn.active { background: var(--accent-2); color: #0b140b; font-weight: 600; }
button.active { background: var(--accent-2); color: #0b140b; font-weight: 600; }

/* ---------- layout ---------- */
.layout {
    display: grid;
    grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr);
    gap: 12px; padding: 12px 16px;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ---------- phones ---------- */
@media (max-width: 600px) {
    :root { font-size: 14px; }
    .topbar { padding: 6px 10px; gap: 6px; }
    .topbar h1 { font-size: 1.2rem; }
    .layout { padding: 8px; gap: 8px; grid-template-columns: minmax(0, 1fr); }
    .panel { padding: 6px 8px 8px; margin-bottom: 8px; }
    .row > span:first-child { min-width: 6.5em; }
    .row input[type=range] { flex-basis: 100px; min-width: 0; }
    .row select { max-width: 100%; }
    .radio { margin-right: 8px; }
    button, select { padding: 6px 10px; }            /* finger-sized targets */
    .chart-wrap { height: 240px; }
    .chart-wrap.vowel { height: 240px; }
    table.modes th, table.modes td { padding: 6px 4px; }
    table.modes th.note, table.modes td.note { padding-left: 10px; }
    .chart-controls .spacer { display: none; }
    footer { padding: 6px 10px 10px; }
    .footer-right { margin-left: 0; }
}

.panel {
    background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 12px 10px; margin-bottom: 12px;
}
.panel h2 { margin: 0 0 8px; font-size: 1rem; color: var(--accent-2); font-weight: 600; }

.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; }
.row > span:first-child { min-width: 9em; color: var(--text-dim); }
.row.compact > span:first-child { min-width: 0; }
.row input[type=range] { flex: 1 1 140px; }
.row output { min-width: 5.5em; text-align: right; font-variant-numeric: tabular-nums; }
.buttons { gap: 6px; }
.buttons > span { min-width: 0 !important; }
#scale-buttons { color: var(--text); margin: 0; }
.spacer { flex: 1; }
.radio { display: inline-flex; align-items: center; gap: 4px; margin-right: 12px; cursor: pointer; }

.hint { color: var(--text-dim); font-size: 0.85rem; margin: 6px 0 0; }
.dim { color: var(--text-dim); margin: 4px 0 0; }
.series { margin: 6px 0 0; font-weight: 600; }

#shape-canvas {
    display: block; width: 100%; height: auto; aspect-ratio: 800 / 360;
    border: 1px solid var(--border); border-radius: 4px; margin-top: 8px; touch-action: none;
}

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.vowel { height: 280px; }

/* ---------- modes table ---------- */
table.modes { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.modes th, table.modes td { padding: 4px 6px; text-align: right; border-bottom: 1px solid var(--border); }
table.modes th { color: var(--text-dim); font-weight: 500; }
table.modes th:first-child, table.modes td:first-child { text-align: left; }
table.modes th.note, table.modes td.note { text-align: left; padding-left: 18px; white-space: nowrap; }
table.modes td { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
table.modes tbody tr { cursor: pointer; }
table.modes tbody tr:hover { background: var(--row-hover); }
table.modes tbody tr.selected { background: var(--row-sel); outline: 1px solid var(--blue); }
.dev-ok   { color: var(--accent-2); }
.dev-mid  { color: var(--accent); }
.dev-far  { color: #ff7a6a; }

/* ---------- footer ---------- */
footer {
    display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 16px 12px;
    color: var(--text-dim); font-size: 0.85rem; border-top: 1px solid var(--border);
}
.footer-right { margin-left: auto; }
