/* Pure fonte — interface sombre. Les couleurs vives sont celles des disques olympiques. */
:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --s1: #15181d;
  --s2: #1e2229;
  --s3: #2a2f38;
  --line: #252a32;
  --tx: #f1f3f5;
  --tx2: #a3abb7;
  --tx3: #858e9b;
  --accent: #f2c230;
  --on-accent: #1a1400;
  --ok: #3ecf8e;
  --red: #ff6b61;
  --r: 16px;
  --st: env(safe-area-inset-top);
  --sb: env(safe-area-inset-bottom);
  /* Marge sous les onglets : juste assez pour le trait d'accueil. */
  --nav: max(0px, calc(var(--sb) - 14px));
  --tabs: calc(50px + var(--nav));
  /* Hauteur de l'app, remplacée par la hauteur d'écran dans l'app installée (voir app.js). */
  --h: 100dvh;
  --num: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  font: 400 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
/* min-height : filet de sécurité, l'app ne peut jamais se retrouver sans hauteur. */
html, body { margin: 0; height: var(--h); min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--tx); overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
h1, h2, h3, p, ol, ul { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .4; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }

/* ---------- Structure ---------- */
/* Position absolue et non fixe : iOS cale le fixe sur une zone parfois plus courte que l'écran. */
body { position: relative; }
#main { position: absolute; inset: 0 0 var(--tabs); display: flex; flex-direction: column; }
#tabs { position: absolute; inset: auto 0 0; height: var(--tabs); padding: 0 8px var(--nav); display: flex; background: #101317; border-top: 1px solid var(--line); z-index: 10; }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--tx3); font-size: 11px; font-weight: 500; position: relative; }
#tabs button.on { color: var(--tx); }
#tabs button.on .ic { color: var(--accent); }
#tabs i { position: absolute; top: 7px; left: calc(50% + 11px); width: 8px; height: 8px; border-radius: 50%; background: var(--ok); border: 2px solid #101317; box-sizing: content-box; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 16px 28px; }
.resting .scroll { padding-bottom: 96px; }
.bar { flex: none; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: calc(var(--st) + 4px) 16px 6px; }
.bar h1 { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar.big h1 { text-align: left; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.bar-end { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 44px; }
.bar-btn, .icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--tx); flex: none; }
.bar > .bar-btn { margin-left: -10px; }
.bar-end .bar-btn:last-child { margin-right: -10px; }
.bar.live { border-bottom: 1px solid var(--line); }
.bar.live h1 span { display: block; overflow: hidden; text-overflow: ellipsis; }
.bar.live h1 small { display: block; font: 500 13px var(--num); font-variant-numeric: tabular-nums; color: var(--tx2); }
.bar.live h1 small span { display: inline; color: var(--ok); }
.page { position: absolute; inset: 0; z-index: 20; background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); }
.page.in { transform: none; }
.page .scroll { padding-bottom: calc(32px + var(--sb)); }
.resting .page .scroll { padding-bottom: calc(140px + var(--sb)); }
.fatal { padding: calc(var(--st) + 80px) 24px; display: grid; gap: 12px; }

/* ---------- Boutons, champs ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 12px; padding: 0 18px; border-radius: 14px; background: var(--s2); font-weight: 600; text-align: center; }
.btn:active, .row:active, .chip:active, .menu-item:active { filter: brightness(1.2); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: none; border: 1px solid var(--s3); color: var(--tx2); }
.btn.danger { background: none; color: var(--red); }
.btn.small { width: auto; min-height: 36px; margin: 0; padding: 0 14px; border-radius: 18px; font-size: 15px; white-space: nowrap; }
.link { color: var(--accent); font-weight: 600; min-height: 44px; padding: 0 4px; }
.field { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid transparent; border-radius: 12px; background: var(--s2); outline: 0; -webkit-appearance: none; appearance: none; resize: none; }
.field:focus { border-color: var(--accent); }
.field::placeholder, .note-in::placeholder, .search input::placeholder { color: var(--tx3); }
.field.code { font: 14px/1.5 ui-monospace, Menlo, monospace; font-size: 16px; margin-top: 12px; }
select.field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3abb7' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; padding-right: 34px; text-overflow: ellipsis; }
.form { display: grid; gap: 14px; margin: 8px 0 18px; }
.form > *, .two > * { min-width: 0; }
.form label, .lbl { display: grid; gap: 6px; font-size: 14px; color: var(--tx2); }
.form label .field { font-size: 16px; color: var(--tx); }
.form label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; color: var(--tx); }
.form label.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.file { position: relative; overflow: hidden; }
.form label.btn.file { display: flex; color: var(--tx); font-size: 16px; margin: 0; }
.file input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 0; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: var(--s3); position: relative; transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(20px); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: var(--s2); color: var(--tx2); }
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; outline: 0; color: var(--tx); -webkit-appearance: none; appearance: none; }
.search:focus-within { box-shadow: 0 0 0 1px var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px -16px; padding: 2px 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; background: var(--s2); color: var(--tx2); font-size: 15px; text-align: center; }
.chip.on { background: var(--tx); color: var(--bg); font-weight: 600; }
.rest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-bottom: 12px; }
.rest-grid .chip { min-height: 48px; border-radius: 12px; font: 500 17px var(--num); }

/* ---------- Listes ---------- */
.sec { margin: 26px 0 10px; font-size: 17px; font-weight: 600; }
.rows { border-radius: var(--r); background: var(--s1); overflow: hidden; margin-top: 10px; }
.sec + .rows, .sec + .stats { margin-top: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; background: var(--s1); position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.row > .ic { color: var(--tx3); width: 18px; height: 18px; }
.row em { font-style: normal; color: var(--tx2); font-family: var(--num); }
.row em.go { color: var(--accent); font-weight: 600; }
.form .row.line { border-radius: 12px; background: var(--s2); font-size: 16px; color: var(--tx); }
label.row.line { font-size: 16px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row-main b { font-weight: 600; overflow-wrap: anywhere; }
.row-main small { color: var(--tx2); font-size: 14px; }
.row-main small.nt { color: var(--tx3); }
.thumb { flex: none; width: 60px; height: 60px; border-radius: 10px; background: #1a1e24; display: grid; place-items: center; overflow: hidden; color: var(--tx3); }
.thumb svg:not(.ic) { width: 100%; height: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ex-row { padding: 8px 14px 8px 8px; }
.tick { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--s3); display: grid; place-items: center; }
.tick.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tick .ic { width: 17px; height: 17px; }
.plate { flex: none; display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 6px solid var(--c); background: var(--bg); vertical-align: -4px; }
.plate.dash { border: 2px dashed var(--c); }
.empty-line { padding: 16px 14px; color: var(--tx2); text-align: center; font-size: 15px; }
.para { color: var(--tx2); margin: 8px 0; white-space: pre-line; }
.lead { margin: 4px 0 14px; color: var(--tx2); display: flex; gap: 8px; align-items: center; }
.over { color: var(--tx2); font-size: 14px; }
.hint { margin: 8px 0; color: var(--tx2); font-size: 14px; white-space: pre-line; }
.quote { margin: 10px 0; padding: 12px 14px; border-radius: 12px; background: var(--s1); white-space: pre-line; }
.stats { display: flex; margin: 14px 0; padding: 14px 0; border-radius: var(--r); background: var(--s1); }
.stats > div { flex: 1; min-width: 0; padding: 0 6px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font: 600 20px var(--num); white-space: nowrap; }
.stats small { color: var(--tx2); font-size: 13px; }
.recs { display: grid; gap: 6px; margin: 12px 0; padding: 12px 14px; border-radius: var(--r); background: rgba(242, 194, 48, .1); }
.recs p { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.recs .ic { width: 16px; height: 16px; color: var(--accent); align-self: center; }
.recs span { flex: 1; min-width: 0; }
.recs b { font-weight: 600; white-space: nowrap; }
.notice { display: grid; gap: 2px; width: 100%; margin-top: 18px; padding: 14px; border-radius: var(--r); border: 1px solid var(--s3); }
.notice span { color: var(--tx2); font-size: 14px; }

/* ---------- Accueil ---------- */
.week { display: flex; justify-content: space-between; margin: 6px 0 18px; }
.week > div { display: grid; justify-items: center; gap: 6px; }
.week small { color: var(--tx3); font-size: 12px; }
.week span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 500 15px var(--num); color: var(--tx2); }
.week .did { border: 4px solid var(--c); color: var(--tx); }
.week .today small { color: var(--accent); font-weight: 600; }
.week .today span:not(.did) { background: var(--s2); color: var(--tx); }
.hero { padding: 18px; border-radius: 20px; background: var(--s1); position: relative; overflow: hidden; }
.hero:not(.empty)::after { content: ""; position: absolute; width: 124px; height: 124px; right: -40px; top: -40px; border-radius: 50%; border: 26px solid var(--c); pointer-events: none; }
.hero .over { padding-right: 78px; }
.hero h2 { margin: 2px 80px 14px 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.hero.empty h2 { margin: 0 0 6px; font-size: 22px; }
.hero.empty p { color: var(--tx2); }
.hero ul { list-style: none; padding: 0; }
.hero li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; }
.hero li + li { border-top: 1px solid var(--line); }
.hero li span { min-width: 0; }
.hero li b { font: 500 15px var(--num); color: var(--tx2); white-space: nowrap; }
.hero li.more { color: var(--tx3); }

/* ---------- Carnet ---------- */
.ex-card { margin: 14px 0; padding: 12px; border-radius: var(--r); background: var(--s1); }
.ex-card header { display: flex; align-items: center; gap: 10px; }
.ex-name { flex: 1; min-width: 0; min-height: 44px; display: grid; align-content: center; }
.ex-name b { font-weight: 600; line-height: 1.2; }
.ex-name small { color: var(--tx2); font-size: 13px; }
.ex-name em { font-style: normal; color: var(--accent); }
.ex-card.complete .ex-name b { color: var(--ok); }
.ex-card .icon-btn { margin-right: -8px; color: var(--tx2); }
.ex-card .hint { margin: 8px 2px 0; }
.hint.last { color: var(--tx3); }
.hint.day { padding: 12px 14px; border-radius: 12px; background: var(--s1); margin-top: 14px; }
.note-in { display: block; width: 100%; margin: 6px 0 4px; padding: 8px 2px; border: 0; background: none; outline: 0; resize: none; overflow: hidden; color: var(--tx); line-height: 1.35; }
.set-head, .set { display: grid; grid-template-columns: 38px minmax(0, 1fr) 72px 64px 46px; gap: 6px; align-items: center; }
.rpe .set-head, .rpe .set { grid-template-columns: 34px minmax(0, 1fr) 62px 54px 46px 44px; gap: 5px; }
.set-head { color: var(--tx3); font-size: 12px; text-align: center; padding-bottom: 4px; }
.set { padding: 4px 0; border-radius: 12px; }
.set-no { height: 44px; text-align: center; font: 600 16px var(--num); color: var(--tx2); }
.set-no.t-E, .t-E .set-no, .no.t-E { color: #fb923c; }
.set-no.t-D, .t-D .set-no, .no.t-D { color: #a78bfa; }
.set-no.t-X, .t-X .set-no, .no.t-X { color: var(--red); }
.set-prev { height: 44px; text-align: center; font: 400 14px var(--num); color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-prev:disabled { opacity: 1; color: var(--tx3); }
.set input { width: 100%; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: var(--s2); text-align: center; font: 600 17px var(--num); outline: 0; -webkit-appearance: none; appearance: none; }
.set input::placeholder { color: #767f8c; font-weight: 400; }
.set input:focus { border-color: var(--accent); }
.set-ok { height: 44px; border-radius: 10px; background: var(--s3); color: var(--tx3); display: grid; place-items: center; }
.set.done { background: rgba(62, 207, 142, .12); }
.set.done input { background: none; }
.set.done .set-ok { background: var(--ok); color: #04150d; }
.add-set { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 6px; border-radius: 10px; color: var(--tx2); font-size: 15px; font-weight: 500; background: var(--s2); }
.add-set .ic { width: 18px; height: 18px; }

#rest { position: absolute; left: 12px; right: 12px; bottom: calc(var(--tabs) + 8px); z-index: 30; display: flex; align-items: center; gap: 4px; height: 64px; padding: 0 8px; border-radius: 18px; background: #2a2f38; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#rest > * { position: relative; }
.rest-fill { position: absolute !important; inset: 0; background: #46505f; transform-origin: left; transition: transform .25s linear; }
#rest button { min-width: 50px; height: 46px; border-radius: 12px; background: rgba(0, 0, 0, .28); text-align: center; font: 600 15px var(--num); padding: 0 8px; }
#rest .skip { font-family: inherit; padding: 0 12px; }
.rest-mid { flex: 1; min-width: 0; text-align: center; }
.rest-mid b { display: block; font: 700 23px/1.1 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rest-mid small { display: block; font-size: 12px; color: #d5dae1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#rest.over { background: var(--ok); color: #04150d; }
#rest.over .rest-mid small { color: #04150d; }
#rest.over .rest-mid b { font-size: 18px; }
#rest.over [data-r="-15"], #rest.over [data-r="15"] { display: none; }

/* ---------- Calendrier ---------- */
.month { display: flex; align-items: center; justify-content: space-between; }
.month h2 { font-size: 18px; font-weight: 600; }
.month .bar-btn:first-child { margin-left: -10px; }
.month .bar-btn:last-child { margin-right: -10px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); justify-items: center; }
.cal-head { color: var(--tx3); font-size: 12px; padding: 2px 0 6px; }
.cal-grid { row-gap: 2px; }
.day { width: 100%; height: 50px; display: grid; place-items: center; position: relative; border-radius: 14px; }
.day span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 500 16px var(--num); color: var(--tx2); }
.day.did span { border: 5px solid var(--c); color: var(--tx); font-weight: 600; }
.day.plan span { border: 1.5px dashed var(--c); }
.day.today span { color: var(--accent); font-weight: 700; }
.day.sel { background: var(--s2); }
.day i { position: absolute; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--tx); }
.date-badge { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--c); display: grid; place-content: center; text-align: center; line-height: 1.1; }
.date-badge b { font: 600 17px var(--num); }
.date-badge small { color: var(--tx2); font-size: 11px; }
.recap { padding: 12px 0; border-top: 1px solid var(--line); }
.recap h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.recap ol { list-style: none; padding: 0; display: grid; gap: 4px; }
.recap li { display: flex; gap: 12px; align-items: baseline; font-family: var(--num); }
.recap .no { width: 22px; color: var(--tx3); text-align: center; }
.recap li b { font-weight: 500; }
.recap li small { color: var(--tx2); }

/* ---------- Programme ---------- */
.prog-head { display: flex; align-items: center; justify-content: space-between; }
.prog h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.prog .icon-btn { margin-right: -10px; }
.prog-bar { height: 6px; margin: 10px 0 4px; border-radius: 3px; background: var(--s3); overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.day-card { display: grid; gap: 6px; width: 100%; margin-top: 12px; padding: 14px; border-radius: var(--r); background: var(--s1); }
.day-card.next { box-shadow: inset 0 0 0 1.5px var(--c); }
.dc-head { display: flex; align-items: center; gap: 10px; }
.dc-head b { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.dc-head em { font-style: normal; font-size: 13px; color: var(--tx2); }
.day-card > small { color: var(--tx2); font-size: 14px; }
.dc-list { display: grid; gap: 5px; margin-top: 4px; font-size: 15px; }
.dc-list span { display: flex; justify-content: space-between; gap: 12px; }
.dc-list i { font-style: normal; color: var(--tx2); min-width: 0; }
.dc-list b { font: 500 15px var(--num); white-space: nowrap; }
.ed-day { margin-top: 16px; padding: 12px; border-radius: var(--r); background: var(--s1); }
.ed-day header { display: flex; align-items: center; gap: 8px; }
.ed-day .icon-btn { margin-right: -8px; color: var(--tx2); }
.field.bare { flex: 1; min-width: 0; background: none; padding: 8px 4px; font-size: 18px; font-weight: 600; }
.wds { display: flex; justify-content: space-between; margin: 6px 0 10px; }
.wds button { width: 42px; height: 42px; border-radius: 50%; background: var(--s2); color: var(--tx2); text-align: center; font-size: 14px; }
.wds .on { background: var(--c); color: #0b0d10; font-weight: 700; }
.ed-item { display: flex; align-items: center; margin-top: 10px; }
.ed-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.ps-head, .ps { display: grid; grid-template-columns: 40px 1fr 1fr 44px; gap: 8px; align-items: center; }
.ps-head { color: var(--tx3); font-size: 12px; text-align: center; padding-bottom: 4px; }
.ps { margin-bottom: 8px; }
.ps .field { text-align: center; padding: 0 6px; font-family: var(--num); font-weight: 600; }
.ps .icon-btn { color: var(--tx3); }
.plan-sets { margin-bottom: 18px; }

/* ---------- Fiche d'exercice ---------- */
.stage { position: relative; border-radius: 20px; background: #14181d; overflow: hidden; }
.stage svg:not(.ic) { display: block; width: 100%; height: auto; padding: 6px 10px; }
.stage img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.stage.small img { max-height: 180px; }
.stage-btn { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.legend { display: flex; align-items: center; gap: 6px; margin: 8px 2px 0; font-size: 13px; color: var(--tx2); }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: #ff5b50; }
.legend .k2 { background: rgba(255, 91, 80, .5); margin-left: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.tag { padding: 5px 11px; border-radius: 13px; background: var(--s2); font-size: 14px; color: var(--tx2); }
.tag.p { background: rgba(255, 91, 80, .18); color: #ff9a92; font-weight: 600; }
.steps { padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; }
.steps li::before { content: counter(s); font: 600 16px/1.4 var(--num); color: var(--accent); }
.tip { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--s1); color: var(--tx2); }
.tip b { display: block; color: var(--tx); font-weight: 600; }

/* ---------- Feuilles ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.sheet { position: relative; width: 100%; max-height: calc(100% - var(--st) - 24px); display: flex; flex-direction: column; border-radius: 22px 22px 0 0; background: #171a20; transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--sb); }
.sheet.tall { height: calc(100% - var(--st) - 24px); }
.in > .scrim { opacity: 1; }
.in > .sheet { transform: none; }
.grab { flex: none; width: 38px; height: 5px; margin: 8px auto 2px; border-radius: 3px; background: var(--s3); }
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 16px 4px; }
.sheet-head h2 { font-size: 19px; font-weight: 600; min-width: 0; }
.sheet .scroll, .resting .sheet .scroll { padding-bottom: 12px; }
.sheet .rows, .sheet .row { background: #171a20; }
.sheet .rows { margin: 0 -16px; border-radius: 0; }
.sheet .stats { background: var(--s2); }
.sheet-foot { flex: none; padding: 0 16px 12px; border-top: 1px solid var(--line); }
.menu-title { text-align: center; font-weight: 600; padding: 4px 0; }
.menu-msg { text-align: center; color: var(--tx2); padding: 0 8px 12px; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 16px; margin-top: 6px; border-radius: 14px; background: var(--s2); font-weight: 500; }
.menu-item span { flex: 1; }
.menu-item.danger { color: var(--red); }
.menu-item.on .ic { color: var(--accent); }
.menu-item.cancel { justify-content: center; background: none; color: var(--tx2); }
.feel { display: flex; gap: 8px; margin-top: 16px; }
.feel button { flex: 1; height: 48px; border-radius: 12px; background: var(--s2); text-align: center; font: 600 17px var(--num); color: var(--tx2); }
.feel .on { background: var(--accent); color: var(--on-accent); }
.feel-label { margin: 6px 0 14px; text-align: center; font-size: 14px; color: var(--tx2); }
#toast { position: absolute; left: 16px; right: 16px; top: calc(var(--st) + 8px); z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 16px; border-radius: 14px; background: #f1f3f5; color: #12151a; font-weight: 500; transform: translateY(-160%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); visibility: hidden; pointer-events: none; }
#toast.in { transform: none; visibility: visible; }
#toast button { pointer-events: auto; font-weight: 700; min-height: 36px; padding: 0 4px; }

@media (min-width: 560px) { #main, .page, #tabs, #rest, .sheet, #toast { max-width: 520px; margin-inline: auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
