:root {
  --bg: #0a1810;
  --surface: #11241a;
  --surface-2: #173020;
  --surface-3: #1e3d29;
  --border: #23452f;
  --text: #e5f5ea;
  --muted: #8fb59b;
  --primary: #34d27b;
  --primary-strong: #22b863;
  --on-primary: #04210f;
  --accent: #a3e635;
  --chord: #5ff0a0;
  --section: #b5e48c;
  --danger: #f2877a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --tabbar-h: 64px;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef7f1;
  --surface: #ffffff;
  --surface-2: #e2f1e7;
  --surface-3: #d0e8d8;
  --border: #c3dccb;
  --text: #0f2a1a;
  --muted: #4b6b56;
  --primary: #16a34a;
  --primary-strong: #15803d;
  --on-primary: #ffffff;
  --accent: #65a30d;
  --chord: #15803d;
  --section: #3f6212;
  --danger: #c2410c;
  --shadow: 0 8px 24px rgba(20, 60, 35, .12);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef7f1;
    --surface: #ffffff;
    --surface-2: #e2f1e7;
    --surface-3: #d0e8d8;
    --border: #c3dccb;
    --text: #0f2a1a;
    --muted: #4b6b56;
    --primary: #16a34a;
    --primary-strong: #15803d;
    --on-primary: #ffffff;
    --accent: #65a30d;
    --chord: #15803d;
    --section: #3f6212;
    --danger: #c2410c;
    --shadow: 0 8px 24px rgba(20, 60, 35, .12);
    color-scheme: light;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
svg.lucide { width: 20px; height: 20px; stroke-width: 2; flex: none; }

/* ---------- Estrutura ---------- */
#app { min-height: 100%; }
#view {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
}
.tabbar a svg.lucide { width: 24px; height: 24px; transition: transform .2s; }
.tabbar a.active { color: var(--primary); }
.tabbar a.active svg.lucide { transform: translateY(-2px) scale(1.08); }

@media (min-width: 900px) {
  .tabbar {
    top: 0; right: auto; width: 96px; height: auto; flex-direction: column; justify-content: flex-start;
    gap: 6px; padding: 20px 0; border-top: 0; border-right: 1px solid var(--border);
  }
  .tabbar a { flex: none; height: 72px; }
  #view { padding-left: 112px; max-width: 940px; padding-bottom: 40px; }
  .song-nav, .fab { margin-left: 48px; }
}

/* ---------- Topo ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px; min-height: 56px; margin-bottom: 8px;
}
.topbar h1 { font-size: 26px; margin: 0; flex: 1; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.topbar h1 .logo {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--on-primary);
}
.topbar h2 { font-size: 20px; margin: 0; flex: 1; min-width: 0; }
.topbar .sub { color: var(--muted); font-size: 14px; font-weight: 500; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--surface-2);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; color: var(--text);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: var(--primary); color: var(--on-primary); }
.icon-btn.ghost { background: transparent; }
.icon-btn.fav-on { color: var(--accent); }
.icon-btn.fav-on svg { fill: currentColor; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.field {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); outline: none;
}
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
textarea.field { font-family: var(--mono); font-size: 14px; min-height: 50vh; resize: vertical; white-space: pre; }
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }

.search-box { position: relative; margin-bottom: 12px; }
.search-box svg.lucide { position: absolute; left: 14px; top: 13px; color: var(--muted); }
.search-box .field { padding-left: 44px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip svg.lucide { width: 16px; height: 16px; }

/* ---------- Listas de itens ---------- */
.cards { display: flex; flex-direction: column; gap: 8px; }
.card {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit;
  transition: transform .12s, border-color .12s;
}
.card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.card:active { transform: scale(.985); }
.card .thumb {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--primary); overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .info { flex: 1; min-width: 0; }
.card .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .a { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  flex: none; min-width: 38px; padding: 4px 8px; border-radius: 8px; text-align: center; font-weight: 700; font-size: 13px;
  background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary);
}
.card .actions { display: flex; gap: 4px; }
.card .actions .icon-btn { width: 36px; height: 36px; background: transparent; color: var(--muted); }

.list-card .thumb { background: linear-gradient(135deg, var(--primary-strong), var(--accent)); color: var(--on-primary); }

.empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty .big {
  width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--primary);
}
.empty .big svg.lucide { width: 40px; height: 40px; }
.empty h3 { color: var(--text); margin: 0 0 6px; }

.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 4px 8px; }

.fab {
  position: fixed; right: max(20px, calc(50% - 390px)); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); z-index: 15;
  width: 60px; height: 60px; border-radius: 20px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--on-primary);
  display: grid; place-items: center; box-shadow: var(--shadow);
}
.fab svg.lucide { width: 28px; height: 28px; }
@media (min-width: 900px) { .fab { bottom: 28px; } }

/* ---------- Visualização da cifra ---------- */
.song-head { position: sticky; top: 0; z-index: 10; background: var(--bg); padding-top: env(safe-area-inset-top); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0 10px;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 600px) { .toolbar .sep { display: none; } }
.toolbar .sep { width: 1px; height: 28px; background: var(--border); flex: none; margin: 0 2px; }
.key-ctl {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); flex: none;
}
.key-ctl .icon-btn { width: 36px; height: 36px; background: transparent; }
.key-ctl select {
  appearance: none; border: 0; background: var(--primary); color: var(--on-primary); font-weight: 800;
  border-radius: 9px; padding: 6px 10px; min-width: 56px; text-align: center; cursor: pointer;
}
.key-ctl .lbl-mini { font-size: 11px; color: var(--muted); padding: 0 4px; font-weight: 700; }
.shift-info { font-size: 12px; color: var(--muted); flex: none; padding: 0 4px; }

.sheet-text {
  font-family: var(--mono); font-size: var(--fs, 15px); line-height: 1.5; padding: 16px 2px 40px;
  overflow-x: auto;
}
.sheet-text .ln { white-space: pre; min-height: 1.5em; }
.sheet-text .ch { color: var(--chord); font-weight: 800; }
.sheet-text .sec { color: var(--section); font-weight: 700; }
.sheet-text .ln-tab { color: var(--muted); }
.sheet-text.wrap .ln { white-space: pre-wrap; }

.pdf-wrap { padding: 12px 0 40px; display: flex; flex-direction: column; gap: 12px; }
.pdf-page { width: 100%; height: auto; border-radius: 8px; background: #fff; box-shadow: var(--shadow); }

.song-nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  z-index: 15; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.song-nav .pos { font-size: 13px; color: var(--muted); padding: 0 8px; white-space: nowrap; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.has-nav .sheet-text, .has-nav .pdf-wrap { padding-bottom: 110px; }
@media (min-width: 900px) { .song-nav { bottom: 20px; } }

.scroll-ctl { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.scroll-ctl input[type=range] { width: 90px; accent-color: var(--primary); }

/* ---------- Afinador ---------- */
.tuner { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tuner .note-big {
  font-size: 88px; font-weight: 800; line-height: 1; letter-spacing: -.04em; transition: color .15s;
}
.tuner .note-big sub { font-size: 30px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.tuner .freq { color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.tuner .hint { font-weight: 700; min-height: 1.5em; display: flex; align-items: center; gap: 6px; }
.gauge { width: min(100%, 420px); }
/* Cores do afinador: verde = certo, vermelho = baixo, amarelo = alto */
.tuner { --low: #f87171; --high: #facc15; --st: var(--muted); }
:root[data-theme="light"] .tuner { --low: #dc2626; --high: #ca8a04; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .tuner { --low: #dc2626; --high: #ca8a04; } }
.tuner.st-ok { --st: var(--primary); }
.tuner.st-low { --st: var(--low); }
.tuner.st-high { --st: var(--high); }

.gauge .needle { transition: transform .12s ease-out; transform-origin: 200px 200px; }
.gauge .needle line, .gauge circle { transition: stroke .2s, fill .2s; }
.gauge .zone { fill: none; stroke-width: 16; stroke-linecap: butt; opacity: .25; transition: opacity .2s; }
.gauge #zone-ok { stroke-width: 20; opacity: .45; }
.tuner.st-ok #zone-ok, .tuner.st-low #zone-low, .tuner.st-high #zone-high { opacity: 1; }
.gauge .g-lbl { font-size: 15px; font-weight: 800; letter-spacing: .06em; }
.gauge .g-over { font-size: 46px; font-weight: 800; opacity: 0; }
.tuner.over.st-low #over-low, .tuner.over.st-high #over-high { animation: blink .7s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }

.tuner .note-big { color: var(--text); }
.tuner[class*="st-"] .note-big { color: var(--st); }
.tuner[class*="st-"] .hint { color: var(--st); background: color-mix(in srgb, var(--st) 16%, transparent); }
.tuner.st-ok .hint { animation: pop .3s ease-out; }
@keyframes pop { from { transform: scale(.9); } }
@media (max-width: 600px) {
  .tuner { gap: 10px; }
  .gauge { width: min(100%, 300px); margin-bottom: -6px; }
  .tuner .note-big { font-size: 60px; }
  .tuner .note-big sub { font-size: 22px; }
  .mic-btn { width: 68px; height: 68px; }
}
.tuner.close .note-big { color: var(--accent); }

.string-pick { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pick-title { font-weight: 700; font-size: 15px; }
.strings { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; }
.string-btn {
  position: relative; border-radius: 14px; border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 2px 10px;
}
.string-btn .sn { font-size: 18px; font-weight: 800; line-height: 1.1; }
.string-btn .sl { font-size: 13px; font-weight: 700; color: var(--primary); }
.string-btn .sp { font-size: 11px; color: var(--muted); font-weight: 600; }
.string-btn .gauge-line { position: absolute; left: 10px; right: 10px; bottom: 4px; border-radius: 2px; background: var(--muted); opacity: .6; }
.string-btn.target { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.string-btn.target .gauge-line { background: var(--primary); opacity: 1; }
.string-btn.done::after {
  content: "✓"; position: absolute; right: 5px; top: 3px; font-size: 12px; font-weight: 800; color: var(--primary);
}
.auto-chip { font-size: 13px; }

.target-card {
  width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 10px;
}
.tc-main { display: flex; align-items: center; gap: 12px; }
.tc-num, .tc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--on-primary); font-size: 22px; font-weight: 800;
}
.tc-icon { background: var(--surface-3); color: var(--primary); }
.tc-note { font-size: 24px; font-weight: 800; line-height: 1.2; }
.tc-note span { font-size: 14px; font-weight: 600; color: var(--muted); }
.target-card .btn { min-height: 40px; font-size: 14px; }
.tuner .hint { font-size: 17px; padding: 6px 14px; border-radius: 999px; }
.string-btn.playing { animation: pulse .6s ease-out; }
@keyframes pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 60%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }

.mic-btn {
  width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--on-primary); box-shadow: var(--shadow);
}
.mic-btn svg.lucide { width: 34px; height: 34px; }
.mic-btn.live { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--primary) 18%, transparent); } }
.level { width: 160px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.level > div { height: 100%; width: 0; background: var(--primary); transition: width .08s; }

.panel { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.panel .row { justify-content: space-between; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }

/* ---------- Folha inferior (modal) ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s;
}
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .22s ease-out;
}
@media (min-width: 700px) { .backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
.sheet h3 { margin: 4px 0 12px; display: flex; align-items: center; gap: 8px; }
.menu { display: flex; flex-direction: column; gap: 6px; }
.menu button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border-radius: 14px; border: 0;
  background: var(--surface-2); cursor: pointer; text-align: left;
}
.menu button .mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); flex: none; }
.menu button b { display: block; }
.menu button span.d { color: var(--muted); font-size: 13px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--primary); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 90px); z-index: 60;
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; transition: .25s;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }

.spinner {
  width: 26px; height: 26px; border: 3px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin: 10px 0;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  font-size: 14px;
}
.notice svg.lucide { color: var(--accent); margin-top: 1px; }
.offline-pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
}
.offline-pill svg.lucide { width: 14px; height: 14px; }
.reorder { display: flex; flex-direction: column; }
.reorder .icon-btn { width: 30px; height: 22px; border-radius: 6px; }
.reorder .icon-btn svg.lucide { width: 16px; height: 16px; }
/* ---------- Login e conta ---------- */
body.logged-out .tabbar { display: none; }
body.logged-out #view { padding-left: 16px; padding-bottom: 24px; }
.login {
  min-height: calc(100vh - 40px); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 24px 8px; max-width: 420px; margin: 0 auto;
}
.login-logo {
  width: 96px; height: 96px; border-radius: 30px; display: grid; place-items: center; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--on-primary);
  box-shadow: 0 16px 40px color-mix(in srgb, var(--primary) 35%, transparent);
}
.login-logo svg.lucide { width: 50px; height: 50px; }
.login h1 { font-size: 34px; margin: 0; letter-spacing: -.03em; }
.login-tag { color: var(--muted); margin: 0 0 8px; font-size: 16px; }
.login-feats { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 8px; width: 100%; text-align: left; }
.login-feats li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); font-weight: 600;
}
.login-feats svg.lucide { color: var(--primary); }
.gbtn { min-height: 46px; display: flex; justify-content: center; }
.gbtn .spinner { margin: 8px auto; }
/* Sem isso o quadro do botão do Google ganha fundo branco no tema escuro */
.gbtn iframe { color-scheme: normal; }
.google-btn {
  display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 22px 0 6px; border-radius: 999px;
  border: 0; background: #202124; color: #fff; font-weight: 600; font-size: 16px; cursor: pointer;
}
.google-btn .g {
  width: 36px; height: 36px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font: 800 20px/1 Arial, sans-serif; color: #4285f4;
}
.login-msg { color: var(--danger); min-height: 1.2em; margin: 4px 0; font-weight: 600; }
.login-foot { display: flex; gap: 8px; align-items: flex-start; text-align: left; max-width: 340px; }
.login-foot svg.lucide { color: var(--primary); width: 18px; height: 18px; margin-top: 1px; }

.avatar {
  border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--on-primary); font-weight: 800;
}
.avatar-btn { display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px var(--primary); }
.topbar h1 > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.hello { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.panel.account { display: flex; align-items: center; gap: 12px; }

.preview-head { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.key-pill { color: var(--primary); }
.preview-body { max-height: 55vh; overflow: auto; background: var(--bg); border-radius: 12px; padding: 12px; border: 1px solid var(--border); }
.preview-actions { margin-top: 12px; }

.copy-box { display: flex; gap: 8px; align-items: center; margin: 8px 0; padding: 8px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.copy-box code { flex: 1; min-width: 0; font-size: 12px; word-break: break-all; color: var(--text); }
.sc-steps li { margin: 8px 0; }

.steps { margin: 0 0 12px; padding-left: 20px; color: var(--muted); }
.steps li { margin: 4px 0; }
.steps b { color: var(--text); }

.icon-btn.star { color: var(--muted); }
.icon-btn.star.on { color: #facc15; }
.icon-btn.star.on svg { fill: currentColor; }
.card.fav { border-color: color-mix(in srgb, #facc15 45%, var(--border)); }
.fav-title { display: flex; align-items: center; gap: 6px; }
.fav-title svg.lucide { width: 15px; height: 15px; color: #facc15; fill: #facc15; }
.chip.chip-fav svg.lucide { color: #facc15; fill: #facc15; }
.chip.chip-fav.on svg.lucide { color: var(--on-primary); fill: var(--on-primary); }
.site-tag {
  display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}

/* ---------- Aba Livro ---------- */
.book-head { display: flex; align-items: center; gap: 10px; margin: 6px 4px 10px; font-weight: 700; color: var(--muted); }
.book-head .btn { min-height: 36px; padding: 0 12px; }
.section-card .thumb { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--accent); }
.section-card > svg.lucide, .book-link > svg.lucide { color: var(--muted); }
.book-link { margin-bottom: 4px; border-style: dashed; }
.book-link .thumb { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--accent); }
.tabbar a { font-size: 11.5px; }

/* ---------- Meus PDFs ---------- */
.search-box.big .field { min-height: 54px; font-size: 17px; border-width: 2px; }
.search-box.big svg.lucide { top: 17px; }
.card .thumb .pg { display: flex; flex-direction: column; align-items: center; font-size: 10px; font-weight: 700; line-height: 1.1; }
.card .thumb .pg b { font-size: 15px; }
.card.result { align-items: flex-start; }
.snip { font-size: 14px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.snip mark { background: color-mix(in srgb, var(--primary) 30%, transparent); color: var(--text); border-radius: 4px; padding: 0 2px; font-weight: 700; }
.card.part { cursor: default; }
.card.part .title-in { min-height: 38px; padding: 6px 10px; font-weight: 650; margin-bottom: 4px; }
.split-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); margin-top: 14px; z-index: 5;
  padding: 8px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);
}
@media (min-width: 900px) { .split-bar { bottom: 16px; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
