:root {
  --bg: #12302A; --surface: #1B3F37; --surface2: #1F463D; --nav: #0D2520;
  --cream: #F3F0E8; --muted: #B5C4BC; --accent: #FFA36C; --danger: #E5675A;
  --season: #EDB57E; --season-accent: #FFA36C;
  --r: 24px; --hf: 'Gabarito', system-ui, sans-serif; --bf: 'Albert Sans', system-ui, sans-serif;
  --ink: #12302A;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--nav); color: var(--cream); font-family: var(--bf); }
body { min-height: 100dvh; display: flex; justify-content: center; }
#app { width: 100%; max-width: 480px; min-height: 100dvh; background: var(--bg); display: flex; flex-direction: column; position: relative; }
main { flex: 1; padding: 18px 18px 110px; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3 { font-family: var(--hf); margin: 0; letter-spacing: -0.4px; }
h1 { font-weight: 800; font-size: 27px; line-height: 1.08; }
h2 { font-weight: 700; font-size: 20px; }
h3 { font-weight: 700; font-size: 15px; }
p { margin: 0; line-height: 1.45; }
a { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { font-family: var(--hf); font-weight: 800; font-size: 22px; letter-spacing: -0.4px; }
.brand small { display: block; font-family: var(--bf); font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: 0.4px; text-transform: uppercase; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--season-accent); color: var(--ink); font-family: var(--hf); font-weight: 700; font-size: 17px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--surface2); display: grid; place-items: center; flex-shrink: 0; }

.card { background: var(--surface); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.chip { font-size: 11px; font-weight: 700; background: var(--season); color: var(--ink); border-radius: 10px; padding: 4px 9px; white-space: nowrap; }

.btn { height: 48px; padding: 0 20px; border-radius: 24px; border: none; background: var(--accent); color: var(--ink); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.ghost { background: var(--surface2); color: var(--cream); }
.btn.cream { background: var(--cream); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); border: 2px solid var(--danger); }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; }
.pill { height: 36px; padding: 0 14px; border-radius: 18px; border: none; background: var(--surface2); color: var(--cream); font-weight: 600; font-size: 13px; white-space: nowrap; }
.pill.on { background: var(--cream); color: var(--ink); font-weight: 700; }
.scroller { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.scroller::-webkit-scrollbar { display: none; }

/* Home hero */
.hero { position: relative; height: 236px; border-radius: 30px; background: var(--season); color: var(--ink); padding: 22px; overflow: hidden; }
.hero .sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .copy { position: relative; z-index: 1; max-width: 54%; display: flex; flex-direction: column; gap: 6px; }
.hero .line { font-size: 11.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }
.hero .go { position: absolute; left: 22px; bottom: 44px; z-index: 2; }
.hero .turtle { position: absolute; right: 4px; bottom: 22px; width: 48%; max-width: 200px; }
.keys { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px; padding: 0 2px; }
.keys i { background: var(--cream); border-radius: 4px 4px 0 0; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week div { height: 62px; border-radius: 6px 6px 12px 12px; background: var(--cream); color: #3C5A52; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 7px; font-size: 11px; font-weight: 700; gap: 6px; }
.week .done { background: var(--season-accent); color: var(--ink); justify-content: space-between; padding-top: 9px; }
.week .today { border: 3px solid var(--season-accent); color: var(--ink); font-weight: 800; }

.task { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: var(--surface); text-decoration: none; color: inherit; }
.task .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--surface2); display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.task .ic img { width: 100%; height: 100%; object-fit: cover; }
.task b { display: block; font-size: 15px; }

/* Practice room */
.room { position: relative; border-radius: 26px; overflow: hidden; background: var(--surface); aspect-ratio: 350 / 250; }
.room svg { width: 100%; height: 100%; display: block; }
.room .plate { position: absolute; left: 12px; top: 12px; background: var(--cream); color: var(--ink); border-radius: 14px; padding: 8px 12px; max-width: 70%; }
.room .plate b { font-family: var(--hf); font-size: 13px; letter-spacing: .4px; display: block; }
.room .plate span { font-size: 11.5px; }
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-radius: 18px; padding: 4px; gap: 4px; }
.tabs button { height: 40px; border: none; border-radius: 14px; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; }
.tabs button.on { background: var(--cream); color: var(--ink); }
.bpm { font-family: var(--hf); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -1px; }
.beats { display: flex; gap: 8px; justify-content: center; }
.beats i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface2); transition: transform .08s; }
.beats i.on { background: var(--accent); transform: scale(1.35); }
.beats i.first.on { background: var(--cream); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.timer { font-family: var(--hf); font-weight: 800; font-size: 40px; font-variant-numeric: tabular-nums; }
.recbtn { width: 76px; height: 76px; border-radius: 50%; border: 5px solid var(--cream); background: var(--danger); display: grid; place-items: center; }
.recbtn.on { border-radius: 26px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(229, 103, 90, .25); } }
.take { display: flex; align-items: center; gap: 10px; background: var(--surface2); border-radius: 14px; padding: 8px 10px; }
.take audio { flex: 1; height: 34px; min-width: 0; }
.tuner-note { font-family: var(--hf); font-weight: 800; font-size: 64px; line-height: 1; text-align: center; }
.tuner-note sub { font-size: 22px; }
.meter { position: relative; height: 46px; border-radius: 23px; background: var(--surface2); overflow: hidden; }
.meter .mid { position: absolute; left: 50%; top: 6px; bottom: 6px; width: 3px; margin-left: -1.5px; background: var(--cream); border-radius: 2px; }
.meter .needle { position: absolute; top: 8px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: var(--accent); transition: left .1s; }
.meter .needle.ok { background: #7BD389; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.in, select.in, textarea.in { width: 100%; min-height: 46px; border-radius: 14px; border: 2px solid transparent; background: var(--surface2); color: var(--cream); padding: 10px 14px; font-size: 15px; }
textarea.in { min-height: 90px; resize: vertical; }
.in:focus { border-color: var(--accent); outline: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(243, 240, 232, .08); }
.switch input { width: 46px; height: 28px; accent-color: var(--accent); }
.colors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.colors label { display: flex; align-items: center; gap: 8px; background: var(--surface2); border-radius: 12px; padding: 6px 8px; font-size: 12px; }
.colors input[type=color] { width: 34px; height: 30px; border: none; background: none; padding: 0; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal span { font-size: 11px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal i { font-style: normal; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface2); }
.cal i.p { background: var(--season-accent); color: var(--ink); font-weight: 800; }
.cal i.t { outline: 2px solid var(--cream); }
.cal i.x { background: transparent; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { background: var(--surface); border-radius: 18px; padding: 12px; }
.stats b { font-family: var(--hf); font-size: 24px; display: block; }

/* nav */
nav.tabbar { position: fixed; bottom: 0; width: 100%; max-width: 480px; height: calc(74px + env(safe-area-inset-bottom)); padding: 8px 6px calc(12px + env(safe-area-inset-bottom)); background: var(--nav); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 20; }
nav.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; }
nav.tabbar a.on { color: var(--season-accent); font-weight: 700; }

/* sheets, toasts, viewer */
.scrim { position: fixed; inset: 0; background: rgba(5, 20, 17, .6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 88dvh; overflow: auto; background: var(--bg); border-radius: 28px 28px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--cream); color: var(--ink); padding: 12px 18px; border-radius: 18px; font-weight: 700; font-size: 14px; z-index: 60; max-width: 90%; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
.fb { position: fixed; right: max(12px, calc(50% - 228px)); bottom: 92px; z-index: 30; height: 36px; padding: 0 12px; border-radius: 18px; border: 2px solid var(--cream); background: var(--nav); color: var(--cream); font-size: 12px; font-weight: 700; opacity: .9; }
.viewer { position: fixed; inset: 0; background: #0b1d19; z-index: 50; overflow: auto; }
.viewer img { width: 100%; display: block; background: #fff; }
.viewer .close { position: sticky; top: 10px; left: 10px; margin: 10px; z-index: 2; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery button { padding: 0; border: none; border-radius: 12px; overflow: hidden; aspect-ratio: 3/4; background: var(--surface2); color: var(--cream); font-size: 12px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rooms button { border: none; padding: 0; border-radius: 16px; overflow: hidden; background: var(--surface); color: var(--cream); text-align: left; }
.rooms svg { width: 100%; display: block; aspect-ratio: 350/250; }
.rooms span { display: block; padding: 6px 10px 8px; font-size: 12px; font-weight: 700; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.note { background: var(--surface2); border-radius: 14px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
.stars button { background: none; border: none; font-size: 26px; padding: 0 2px; color: var(--surface2); }
.stars button.on { color: var(--accent); }
.mood { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood button { height: 56px; border-radius: 16px; border: 2px solid transparent; background: var(--surface2); color: var(--cream); font-weight: 700; }
.mood button.on { border-color: var(--accent); background: var(--surface); }
a.btn, a.task, a.pill { text-decoration: none; }
.hero h1 { font-size: 24px; }
.fb { right: max(0px, calc(50% - 240px)); bottom: auto; top: 46%; height: auto; padding: 12px 6px; border-radius: 12px 0 0 12px; border: none; border-left: 2px solid var(--cream); writing-mode: vertical-rl; transform: rotate(180deg); border-radius: 0 12px 12px 0; font-size: 11px; letter-spacing: .5px; opacity: .85; }
.viewer .vbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 10px; background: rgba(11, 29, 25, .92); flex-wrap: wrap; }
.viewer .vhint { margin: 8px 12px; color: var(--muted); font-size: 13px; }
.pg { position: relative; margin-bottom: 8px; }
.viewer.editing .pg { touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.mk { position: absolute; border: 3px solid var(--accent); background: rgba(255, 163, 108, .2); border-radius: 6px; pointer-events: auto; }
.mk span { position: absolute; left: -3px; top: -22px; background: var(--accent); color: var(--ink); font: 800 12px var(--hf); padding: 2px 7px; border-radius: 8px 8px 8px 0; }
.gallery .rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; aspect-ratio: auto; border-radius: 50%; background: rgba(13, 37, 32, .85); color: var(--cream); font-size: 18px; line-height: 1; }
.gallery .mkc { position: absolute; left: 4px; bottom: 4px; }
.legal h3 { margin-top: 10px; } .legal ul { margin: 0; padding-left: 20px; line-height: 1.5; } .legal p, .legal li { font-size: 14.5px; color: #DCE5E0; }
.kb { border-radius: 10px; overflow: hidden; background: var(--nav); padding: 4px; }
.hero { height: 256px; } .hero .copy p { font-size: 16px !important; }
/* feedback */
.fbk { background: var(--surface2); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.fbk.busy { color: var(--muted); font-weight: 600; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .fbk.busy, .recbtn.on { animation: none; } }
.mchips { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: baseline; gap: 4px; background: var(--bg); border-radius: 12px; padding: 6px 10px; font-size: 12px; color: var(--muted); }
.mchip b { font-family: var(--hf); font-size: 16px; color: var(--cream); }
.mchip.good b { color: #7BD389; } .mchip.warn b { color: var(--accent); }
.fbk ul.good { margin: 0; padding-left: 18px; color: #A8E0B5; font-size: 13.5px; line-height: 1.5; }
.issue { background: var(--bg); border-radius: 14px; padding: 10px 12px; border-left: 4px solid var(--muted); }
.issue.sev2, .issue.sev3 { border-left-color: var(--accent); } .issue.sev1 { border-left-color: #F2C94C; }
.issue summary { cursor: pointer; font-weight: 700; font-size: 14.5px; line-height: 1.35; list-style-position: outside; }
.issue .cat { display: block; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.issue p { margin: 6px 0; font-size: 13.5px; } .issue ol, .focus ol { margin: 4px 0 8px; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.focus { background: var(--season); color: var(--ink); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.focus b { font-family: var(--hf); font-size: 19px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.barrow .track { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; } .barrow .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.barrow .trend { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.barrow .trend.up { color: #7BD389; } .barrow .trend.up::before { content: '▲ '; } .barrow .trend.down { color: var(--accent); } .barrow .trend.down::before { content: '▼ '; }
ul.did { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.6; color: #DCE5E0; }
.gallery button { position: relative; } .pgno { position: absolute; right: 4px; bottom: 4px; background: rgba(13, 37, 32, .8); color: var(--cream); font-size: 11px; font-weight: 700; border-radius: 8px; padding: 1px 6px; }
details > summary { cursor: pointer; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: breathe 1s ease-in-out infinite; flex-shrink: 0; }
.lvl { width: 60px; height: 8px; border-radius: 4px; background: var(--surface2); overflow: hidden; } .lvl i { display: block; height: 100%; width: 0; background: #7BD389; transition: width .1s; }
.hearwarn { background: var(--season); color: var(--ink); border-radius: 12px; padding: 8px 10px; font-weight: 600; text-align: left; }
.tipcard { background: var(--cream); color: var(--ink); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.tipcard p { font-size: 14px; } .tipcard .iconbtn { background: rgba(18,48,42,.1); color: var(--ink); }

/* practice analysis */
.wkchart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 130px; align-items: end; }
.wkchart div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.wkchart i { display: block; width: 70%; min-height: 3px; background: var(--accent); border-radius: 6px 6px 3px 3px; }
.piece { display: flex; flex-direction: column; gap: 4px; }
.piece .track { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; } .piece .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }

.code { font-family: var(--hf); font-size: 34px; font-weight: 800; letter-spacing: 4px; text-align: center; background: var(--cream); color: var(--ink, #12302A); border-radius: 16px; padding: 10px; user-select: all; }
.cal i small { display: block; font-size: 9px; line-height: 1; opacity: .8; font-style: normal; }
