:root {
  --bg: #0c0e12;
  --panel: #151920;
  --panel-2: #1c2129;
  --panel-3: #232934;
  --line: #2a313c;
  --text: #e7e9ee;
  --muted: #8b94a4;
  --accent: #f2a541;
  --accent-ink: #1a1206;
  --ok: #4cc38a;
  --bad: #e5575b;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` must win over classes that set display (flex rows, players…). */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-size: 17px; margin-bottom: 10px; }

/* ---------- header ---------- */

.topbar {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.logo { color: var(--accent); display: flex; }
.brand-name { display: block; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.brand-sub { display: block; color: var(--muted); font-size: 11px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 7px 14px; border-radius: 8px; font-weight: 600;
}
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.connection { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

main { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 20px 24px; }
@media (max-width: 720px) { main, .topbar { padding-left: 16px; padding-right: 16px; } .nav { order: 3; flex-basis: 100%; } }

.footer { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 10px 24px 18px; border-top: 1px solid var(--line); }
.log summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.log pre { max-height: 220px; overflow: auto; font-size: 11px; color: var(--muted); margin: 8px 0 0; white-space: pre-wrap; }

/* ---------- basics ---------- */

.page { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.hint.error, .error { color: var(--bad); white-space: pre-line; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 6px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }

select, input, textarea {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 9px; font: inherit;
}
textarea { width: 100%; resize: vertical; }
select:focus-visible, input:focus-visible, textarea:focus-visible, .btn:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 13px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); color: var(--bad); }
.icon { flex-shrink: 0; }

.pill { padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.on { background: rgba(76, 195, 138, .14); color: var(--ok); }
.pill.off { background: rgba(139, 148, 164, .14); color: var(--muted); }
.pill.error { background: rgba(229, 87, 91, .14); color: var(--bad); }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.badge.warn { background: rgba(242, 165, 65, .15); color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- create ---------- */

.result-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.preset-title { font-size: 24px; color: var(--accent); margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.summary { margin: 10px 0 0; }
.tips { color: var(--muted); border-left: 3px solid var(--accent); padding-left: 10px; }
.warnings { color: var(--accent); font-size: 12px; padding-left: 18px; }
.warnings:empty { display: none; }

.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 4px; align-self: flex-start; }
.tab { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--panel-3); color: var(--text); }

/* ---------- song mode ---------- */

.song-input { display: flex; gap: 8px; flex-wrap: wrap; }
.song-input input { flex: 1; min-width: 220px; font-size: 15px; padding: 9px 12px; }
.song-artist { margin: 2px 0 0; color: var(--muted); }
.tone-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.revise { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.revise label { font-weight: 600; font-size: 14px; }
.revise .row { align-items: stretch; margin-top: 6px; }
.tone-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
@media (max-width: 720px) { .tone-item { grid-template-columns: auto 1fr; } .tone-state { grid-column: 2; } }
.tone-item.done { border-color: rgba(76, 195, 138, .45); }
.tone-item.running { border-color: var(--accent); }
.tone-item.error { border-color: rgba(229, 87, 91, .5); }
.tone-pick input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.tone-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tone-sections { color: var(--muted); font-size: 12px; }
.tone-desc { margin: 4px 0 0; font-size: 13px; }
.tone-meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.tone-meta:empty { display: none; }
.tone-state { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 120px; }

/* ---------- improve ---------- */

.grow { flex: 1; min-width: 200px; }
.row.left { justify-content: flex-start; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.empty-state { text-align: center; padding: 40px 16px; }
.empty-state .actions { justify-content: center; margin-top: 16px; }
.preset-strip { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.preset-strip .hint { flex-basis: 100%; margin: 0; }
.preset-strip .hint:empty { display: none; }
.preset-title.small { font-size: 18px; font-weight: 700; color: var(--accent); }
.preset-strip .mini-chain { margin-top: 6px; }
.steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 18px; }
.steps > li::marker { color: var(--accent); font-weight: 700; }
.steps > li > strong { display: inline-block; margin-bottom: 4px; }
.wave { margin-top: 10px; border-radius: 8px; background: var(--panel-2); min-height: 0; }
.wave:not(:empty) { padding: 6px; }
.transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; }
.transport input[type=range] { width: 110px; accent-color: var(--accent); padding: 0; }
.nudge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.clock { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 56px; }
.clock.bad { color: var(--bad); font-weight: 700; }
.ab { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.ab-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ab-row > span { min-width: 120px; font-size: 13px; font-weight: 600; }
.ab audio { height: 36px; flex: 1; min-width: 220px; }
.meter-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.meter { position: relative; flex: 1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
#meter-bar { position: absolute; left: 0; top: 0; height: 100%; width: 0; background: var(--ok); }
#meter-bar.hot { background: var(--accent); }
#meter-bar.clip { background: var(--bad); }
#meter-peak { position: absolute; top: 0; width: 2px; height: 100%; background: var(--text); left: 0; }
.rec-progress { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.rec-progress .bar { flex: 1; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
#rec-bar { display: block; height: 100%; width: 0; background: var(--bad); }
.btn.recording { background: var(--bad); border-color: var(--bad); color: #fff; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); margin-right: 6px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.score { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.score-value { font-size: 26px; font-weight: 800; }
.good { color: var(--ok); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }
.level-line { margin: 4px 0 0; font-size: 13px; }
.findings { margin: 8px 0; padding-left: 18px; }
.findings:empty { display: none; }
/* Extra readings of the comparison and the "back to the best round" offer. */
.insights { margin: 6px 0 10px; font-size: 14px; }
.insights summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.insights ul { margin: 6px 0 0; padding-left: 18px; }
.best-round { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: rgba(242, 165, 65, .1); font-size: 14px; }
.chart-wrap { overflow-x: auto; }
.chart-wrap canvas { max-width: 100%; height: auto; background: var(--panel-2); border-radius: 8px; }
.legend { display: flex; gap: 16px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.legend .ref { color: #5d9cec; }
.legend .cap { color: var(--accent); }
.spectro { margin: 10px 0; }
.spectro summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.spectro img { max-width: 100%; border-radius: 8px; margin-top: 8px; }
.ai-result { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.diagnosis { margin: 0 0 8px; }
.changes { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.change-values { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.rounds { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12px; }
.rounds th, .rounds td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.rounds th { color: var(--muted); font-weight: 600; }
.rounds:has(tbody:empty) { display: none; }

/* ---------- board ---------- */

.board { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 8px 0; }
.unit { display: flex; gap: 6px; padding: 6px; border-radius: 14px; border: 1px dashed transparent; }
.unit.core { background: rgba(255, 255, 255, .025); border-color: var(--line); }
.board:not(.read-only) .unit { cursor: grab; }
.unit.dragging { opacity: .4; }
.unit.drop { border-color: var(--accent); background: rgba(242, 165, 65, .07); }
.cable { width: 18px; height: 3px; background: var(--line); border-radius: 2px; }

.pedal {
  --kind: var(--accent);
  position: relative; width: 92px; padding: 8px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border-radius: 10px; background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  border: 1px solid var(--line); border-top: 3px solid var(--kind); user-select: none;
}
/* Pedals with many blocks (GP-200: 11) get narrower blocks and shorter cables. */
.board.compact .pedal { width: 80px; }
.board.compact .cable { width: 10px; }
.board:not(.read-only) .pedal { cursor: pointer; }
.pedal:hover { border-color: var(--kind); }
.pedal.selected { box-shadow: 0 0 0 2px var(--kind); }
.pedal.off { opacity: .45; border-top-color: var(--line); }
.pedal-module { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted); }
.pedal-icon { color: var(--kind); display: flex; }
.pedal.off .pedal-icon { color: var(--muted); }
.pedal-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; min-height: 2.4em; display: flex; align-items: center; }
.led {
  width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: #3a2020; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4);
}
.pedal.on .led { background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.led:disabled { cursor: default; }

.mini-chain { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-block {
  --kind: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 7px; color: var(--kind); background: var(--panel-2); border: 1px solid var(--line);
}

/* ---------- editor ---------- */

.toolbar, .pedal-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.name-field { flex-direction: row; align-items: center; gap: 8px; }
.name-field input { width: 150px; font-weight: 700; font-size: 15px; letter-spacing: .03em; }
.volume-field input[type=range] { width: 140px; accent-color: var(--accent); padding: 0; }
.volume-field output { min-width: 28px; color: var(--text); font-weight: 700; }
.pedal-info { font-size: 13px; }
.pedal-info span { color: var(--ok); font-weight: 700; }
.pedal-info span.off { color: var(--muted); font-weight: 400; }
.board-card .board { justify-content: flex-start; }

.panel { --kind: var(--accent); border-top: 3px solid var(--kind); }
.panel-head { display: flex; align-items: center; gap: 14px; }
.panel-icon { color: var(--kind); display: flex; padding: 8px; background: var(--panel-2); border-radius: 10px; }
.panel-title { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.panel-module { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.panel-title select { font-size: 16px; font-weight: 700; max-width: 260px; }
.panel .desc { color: var(--muted); font-size: 12px; margin: 10px 0 4px; }
.controls { display: flex; flex-wrap: wrap; gap: 18px 22px; margin-top: 12px; }

.knob { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; }
.knob svg { cursor: ns-resize; touch-action: none; }
.knob .track { fill: none; stroke: var(--panel-3); stroke-width: 5; stroke-linecap: round; }
.knob .value { fill: none; stroke-width: 5; stroke-linecap: round; }
.knob .cap { fill: var(--panel-2); stroke: var(--line); }
.knob .pointer { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.knob-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.knob-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; }
.toggle-control, .select-control { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 76px; min-height: 96px; }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch.big { width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--panel-3); border-radius: 999px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 50%; translate: 0 -50%; background: var(--text); border-radius: 50%; transition: .15s; }
.switch.big span::after { width: 20px; height: 20px; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-ink); }
.switch.big input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- history ---------- */

.search { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.search input { flex: 1; font-size: 15px; padding: 10px 12px; }
.library-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.library-bar .search { flex: 1; min-width: 240px; }
.library-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.library-actions .hint { margin: 0; }
label.btn { cursor: pointer; }
.badge.device-badge { background: rgba(93, 156, 236, .15); color: #8db8f0; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history-item { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; }
@media (max-width: 820px) { .history-item { grid-template-columns: 1fr; } }
.item-title { display: flex; align-items: center; gap: 8px; }
.item-title .name { font-size: 16px; font-weight: 700; color: var(--accent); text-decoration: none; }
.item-title .name:hover { text-decoration: underline; }
.history-item .request { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.history-item .meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.star { background: none; border: 0; padding: 0 2px; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; }
.star.on { color: var(--accent); }
.star:hover { color: var(--accent); }
.badge.score { background: rgba(80, 200, 120, .15); color: #7fd49a; }
.history-item .improvements { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.history-item .improvements summary { cursor: pointer; }
.history-item .improvements ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.item-actions { display: flex; gap: 6px; }

.song-group { display: flex; flex-direction: column; gap: 10px; }
.group-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.group-icon { color: var(--accent); display: flex; }
.group-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.group-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-item.nested { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.group-note:empty { display: none; }
.rounds tr.current-round td { background: rgba(242, 165, 65, .08); }
.rounds tr.pending-round td:nth-child(2) { color: var(--muted); font-style: italic; }

/* CTRL footswitches (editor) */
.ctrl-card { display: grid; gap: 10px; }
.ctrl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.ctrl-head .hint { margin: 0; }
.ctrl-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.ctrl-row .chips { margin-top: 0; }
.ctrl-label { font-weight: 700; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { .ctrl-row { grid-template-columns: 1fr; } }

/* Guitar isolation model download (Melhorar) */
.model-box { margin: 8px 0; padding: 10px 12px; border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 8px; }
.model-box .hint { margin: 0 0 8px; }
.model-progress { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.model-progress .bar { flex: 1; height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.model-progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }

/* Unsupported browser/device notice (compat.js) */
.unsupported { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: var(--bg, #0f1216); overflow: auto; }
.unsupported-card { max-width: 520px; width: 100%; background: var(--panel, #171b21); border: 1px solid var(--line, #2a313c); border-radius: 12px; padding: 24px; text-align: center; }
.unsupported-card h1 { margin: 0 0 12px; font-size: 22px; color: var(--accent, #f2a541); }
.unsupported-text { margin: 0 0 12px; line-height: 1.5; color: var(--text, #e7e9ee); }
.unsupported-url { margin: 0 0 20px; font-family: ui-monospace, monospace; color: var(--muted, #8b94a4); word-break: break-all; }
.unsupported-continue { background: none; border: 0; padding: 0; color: var(--muted, #8b94a4); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }

/* AI choice page (#/ia) */
.ai-page h2 { margin: 0 0 8px; }
.ai-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.ai-option { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: inherit; }
.ai-option:hover { border-color: var(--accent); }
.ai-option[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ai-option .ai-name { font-weight: 700; font-size: 15px; }
.ai-option .ai-by { font-size: 12px; color: var(--muted); }
.ai-option .ai-about { font-size: 12px; color: var(--muted); line-height: 1.4; }
.ai-option .ai-tag { justify-self: start; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.ai-option.recommended .ai-tag { background: rgba(76, 195, 138, .14); color: var(--ok); }
.ai-option.current .ai-tag::after { content: ' · em uso'; color: var(--accent); }
.ai-config { display: grid; gap: 10px; }
.ai-config h3 { margin: 0; }
.ai-config .field input { width: 100%; }
.ai-config .local-help { line-height: 1.6; }
.ai-config code { background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
.ai-manual summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ai-choice { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-option:disabled { opacity: .45; cursor: not-allowed; }
.ai-option:disabled:hover { border-color: var(--line); }

/* first visit: welcome, AI and guitar steps */
body.setup .nav, body.setup .connection > :not(#ai-choice):not(#guitar-choice) { visibility: hidden; }
body.setup .connection #ai-choice, body.setup .connection #guitar-choice { display: none; }
.setup-steps { display: flex; gap: 8px; flex-wrap: wrap; max-width: 1200px; margin: 16px auto 0; padding: 0 16px; }
.setup-steps .step { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.setup-steps .step.done { color: var(--ok); }
.setup-steps .step.done::after { content: ' ✓'; }
.setup-steps .step.current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.welcome-hero h2 { margin: 6px 0 10px; }
.welcome-hero p { line-height: 1.55; margin: 0 0 10px; }
.badge-alpha { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.terms h3 { margin: 0 0 8px; }
.terms ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.guitar-form h3 { margin: 18px 0 2px; font-size: 14px; }
.guitar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.guitar-form > .field { margin-top: 10px; }
.field.check { margin-top: 4px; color: var(--text); }

/* first visit: welcome, AI and guitar steps (the header shows only the brand) */
body.setup .nav, body.setup .connection { visibility: hidden; }
.setup-steps { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; max-width: 1280px; margin: 16px auto 0; padding: 0 24px; }
.setup-steps .step { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.setup-steps .step.done { color: var(--ok); }
.setup-steps .step.done::after { content: ' ✓'; }
.setup-steps .step.current { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
@media (max-width: 720px) { .setup-steps { padding: 0 16px; } }
.welcome-hero h2 { margin: 8px 0 10px; }
.welcome-hero p { line-height: 1.55; margin: 0 0 10px; max-width: 80ch; }
.badge-alpha { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.terms h3 { margin: 0 0 8px; }
.terms ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; max-width: 90ch; }
.guitar-page h2 { margin: 0 0 8px; }
.guitar-form h3 { margin: 18px 0 2px; font-size: 14px; }
.guitar-form h3:first-of-type { margin-top: 18px; }
.guitar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0; }
.guitar-form > .field { margin-top: 10px; }
.field.check { margin-top: 4px; color: var(--text); }
.footer a.hint { margin: 0; }
.hint.cost-note { color: var(--warn, #e0a84b); font-weight: 600; }
.ai-option .ai-about:empty { display: none; }

/* guide, privacy and credits */
.doc-page h2 { margin: 0 0 8px; }
.doc-page h3 { margin: 0 0 8px; }
.doc-page p, .doc-page li { line-height: 1.55; max-width: 90ch; }
.doc-page ol, .doc-page ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.doc-page a { color: var(--accent); }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.stats-page form { align-items: flex-end; }
.stats-table { border-collapse: collapse; min-width: 260px; }
.stats-table td { padding: 4px 12px 4px 0; border-bottom: 1px solid var(--line); }
.stats-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.contact-email { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
