/* Botões */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 12px 16px; border: 1px solid var(--linha); border-radius: var(--radius); background: var(--aco); color: var(--osso); font-weight: 600; letter-spacing: .03em; cursor: pointer; text-align: center; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--ouro), var(--ouro-esc)); color: #16110a; border-color: #e6c26a; font-weight: 800; font-size: 1.05rem; }
.btn.danger { border-color: var(--sangue); color: #f0a9a2; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 48px; font-size: .92rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

/* Início */
.hero { padding: 16px; border: 1px solid var(--linha); border-radius: var(--radius); background: linear-gradient(160deg, var(--aco), var(--grafite)); }
.hero .dayname { font-family: var(--font-head); font-size: 1.5rem; color: var(--ouro); }
.hero .meta { color: var(--osso-dim); font-size: .92rem; margin-bottom: 10px; }
.bar { height: 10px; border-radius: 6px; background: var(--ferro); border: 1px solid var(--linha); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--bronze), var(--ouro)); }
.stat-line { display: flex; justify-content: space-between; font-size: .9rem; margin: 6px 0 0; color: var(--osso-dim); }
.daylist { display: grid; gap: 10px; margin-top: 12px; padding: 0; list-style: none; }
.daycard { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 72px; border: 1px solid var(--linha); border-radius: var(--radius); background: var(--grafite); text-decoration: none; color: inherit; }
.daycard.today { border-color: var(--ouro); box-shadow: inset 4px 0 0 var(--ouro); }
.shield { flex: none; width: 46px; height: 54px; display: grid; place-items: center; padding-bottom: 8px; font-family: var(--font-head); font-weight: 800; color: #17110a; background: linear-gradient(160deg, #ecc765, var(--bronze)); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.daycard.rest .shield { background: linear-gradient(160deg, #6a6d76, #43464e); }
.daycard .t { flex: 1; min-width: 0; } .daycard .t b { display: block; font-size: 1.02rem; } .daycard .t span { color: var(--osso-dim); font-size: .86rem; }
.pill { font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--linha); color: var(--osso-dim); white-space: nowrap; }
.pill.ok { color: var(--musgo); border-color: var(--musgo); } .pill.warn { color: var(--ouro); border-color: var(--ouro-esc); }
.linkgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* Cartões de exercício */
.card { margin: 0 0 14px; padding: 14px; border: 1px solid var(--linha); border-left: 5px solid var(--linha); border-radius: var(--radius); background: var(--grafite); scroll-margin-top: 90px; }
.card.st-running { border-left-color: var(--ouro); background: linear-gradient(160deg, #22221d, var(--grafite)); }
.card.st-rest { border-left-color: var(--gelo); }
.card.st-done { border-left-color: var(--musgo); }
.card.st-done h3 { color: var(--osso-dim); }
.card.is-current { border-color: var(--bronze); }
.card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card h3 { font-size: 1.12rem; }
.presc { margin: 4px 0 8px; color: var(--ouro); font-weight: 600; }
.cardnote { font-size: .88rem; color: var(--osso-dim); margin: 0 0 8px; }
.sets { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.sets li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; background: var(--ferro); border: 1px solid var(--linha); font-size: .95rem; }
.sets li.done { color: var(--musgo); border-color: #3f5a35; }
.sets li.active { border-color: var(--ouro); color: var(--ouro); font-weight: 700; }
.sets li.pending { color: var(--osso-dim); }
.sets small { color: var(--osso-dim); }
.progline { display: flex; justify-content: space-between; font-size: .85rem; color: var(--osso-dim); margin: 6px 0 4px; letter-spacing: .04em; }
.actions { display: grid; gap: 10px; margin-top: 12px; }
.actions .row { gap: 10px; }
.modeswitch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.modeswitch .btn[aria-pressed="true"] { border-color: var(--ouro); color: var(--ouro); }
.startbar { position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 10; padding-top: 8px; }

/* Cronômetro */
.dock .phase { text-align: center; font-family: var(--font-head); letter-spacing: .12em; color: var(--ouro); font-size: 1.05rem; }
.dock .exname { text-align: center; color: var(--osso-dim); font-size: .88rem; }
.ringwrap { position: relative; width: 176px; height: 176px; margin: 4px auto; }
.ringwrap svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--aco2); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--ouro); stroke-width: 7; stroke-linecap: round; }
.dock.ph-prep .ring-fg { stroke: var(--bronze); } .dock.ph-rest .ring-fg { stroke: var(--gelo); }
.clock { position: absolute; inset: 0; display: grid; place-items: center; font-variant-numeric: tabular-nums; font-size: 2.7rem; font-weight: 800; letter-spacing: 0; }
.dock .hint { text-align: center; font-size: .92rem; margin-bottom: 8px; color: var(--osso); }
.donebig { text-align: center; font-family: var(--font-head); font-size: 1.5rem; color: var(--musgo); padding: 14px 0; }


/* Modais */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.72); }
.sheet { width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 18px 16px calc(18px + var(--safe-b)); border-radius: 16px 16px 0 0; background: #1a1b20; border-top: 3px solid var(--bronze); overscroll-behavior: contain; }
.sheet h2 { font-size: 1.3rem; color: var(--ouro); margin-bottom: 10px; }
.sheet h4 { margin: 14px 0 4px; font-family: var(--font-head); color: var(--bronze); font-size: .98rem; }
.sheet ul { margin: 0; padding-left: 20px; } .sheet li { margin-bottom: 4px; }
.sheet .close { margin-top: 16px; }
.field { display: grid; gap: 4px; margin: 12px 0; }
.field label { font-size: .88rem; color: var(--osso-dim); }
.field input, .field select, .field textarea { min-height: 50px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--linha); background: var(--ferro); width: 100%; }
.field.inline { grid-template-columns: 1fr 120px; align-items: end; gap: 8px; } .field.inline label { grid-column: 1 / -1; }
.field .err { color: #f0a9a2; font-size: .85rem; min-height: 1em; }
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; } .check input { width: 26px; height: 26px; accent-color: var(--ouro); }
.saved { color: var(--musgo); font-size: .9rem; min-height: 1.2em; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 20px); z-index: 60; background: #2a2c33; border: 1px solid var(--bronze); padding: 12px 18px; border-radius: 999px; max-width: 90vw; font-size: .95rem; }
.zoomimg { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.94); display: grid; place-items: center; padding: 12px; }
.zoomimg figure { margin: 0; width: 100%; } .zoomimg svg { width: 100%; max-height: 78vh; } .zoomimg figcaption { text-align: center; color: var(--osso); margin-top: 8px; }

/* Ilustrações */
.il-wrap { display: grid; gap: 10px; margin: 8px 0; }
.il-fig { margin: 0; padding: 8px; background: var(--ferro); border: 1px solid var(--linha); border-radius: 8px; cursor: zoom-in; }
.il-fig svg { width: 100%; height: auto; display: block; }
.il-fig figcaption { font-size: .82rem; color: var(--osso-dim); text-align: center; }
.il-b { fill: none; stroke: var(--ouro); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.il-h { fill: var(--ouro); } .il-f { stroke: #55585f; stroke-width: 2; } .il-w { stroke: var(--bronze); stroke-width: 3; stroke-dasharray: 6 4; }
.il-a { fill: none; stroke: var(--gelo); stroke-width: 2.5; } .il-ah { fill: var(--gelo); } .il-o { fill: var(--bronze); stroke: var(--bronze); stroke-width: 2; }
.caption-note { font-size: .78rem; color: var(--osso-dim); text-align: center; }

/* Histórico, métricas, ajustes */
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.item { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px; border: 1px solid var(--linha); border-radius: var(--radius); background: var(--grafite); text-decoration: none; color: inherit; }
.item small { color: var(--osso-dim); display: block; }
.panel { padding: 14px; border: 1px solid var(--linha); border-radius: var(--radius); background: var(--grafite); margin-bottom: 14px; }
.chart { width: 100%; height: auto; } .c-axis { stroke: var(--linha); stroke-width: 1; } .c-txt { fill: var(--osso-dim); font-size: 10px; } .c-line { stroke: var(--ouro); stroke-width: 2.5; } .c-dot { fill: var(--ouro); }
.bignum { font-family: var(--font-head); font-size: 3.2rem; color: var(--ouro); line-height: 1; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; } .kv span:nth-child(odd) { color: var(--osso-dim); }
.restscreen { text-align: center; padding: 40px 16px; border: 1px solid var(--bronze); border-radius: var(--radius); background: linear-gradient(160deg, var(--aco), var(--grafite)); font-family: var(--font-head); font-size: 1.25rem; line-height: 1.5; color: var(--ouro); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--linha); }
.switch input { width: 28px; height: 28px; accent-color: var(--ouro); }
.muted { color: var(--osso-dim); font-size: .9rem; }
.banner { padding: 12px 14px; border: 1px solid var(--ouro-esc); border-radius: var(--radius); background: #26210f; margin-bottom: 14px; }
