/* Inversion Nation. Layout: phone-first single column, tab bar on the bottom edge on phones, under the header on wide screens. */
:root {
  --bg: #f2f3f7;
  --surface: #ffffff;
  --surface-2: #e9ebf3;
  --ink: #141726;
  --muted: #5d6276;
  --line: #d9dce8;
  --accent: #2f45ff;
  --accent-ink: #ffffff;
  --accent-soft: #e3e6ff;
  --ok: #17895a;
  --ok-soft: #dcf3e8;
  --warn: #a8640a;
  --warn-soft: #fbeed6;
  --bad: #c8333a;
  --bad-soft: #fbe2e3;
  --shadow: 0 1px 2px rgb(20 23 38 / 6%), 0 6px 20px rgb(20 23 38 / 6%);
  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --tabbar: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f17;
    --surface: #161925;
    --surface-2: #20243399;
    --ink: #eceef6;
    --muted: #9ca2b9;
    --line: #2a2f43;
    --accent: #8191ff;
    --accent-ink: #0d0f17;
    --accent-soft: #252c5c;
    --ok: #4cc98f;
    --ok-soft: #173a2b;
    --warn: #f0b04d;
    --warn-soft: #3d2c11;
    --bad: #ff7b80;
    --bad-soft: #42191c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f17;
  --surface: #161925;
  --surface-2: #20243399;
  --ink: #eceef6;
  --muted: #9ca2b9;
  --line: #2a2f43;
  --accent: #8191ff;
  --accent-ink: #0d0f17;
  --accent-soft: #252c5c;
  --ok: #4cc98f;
  --ok-soft: #173a2b;
  --warn: #f0b04d;
  --warn-soft: #3d2c11;
  --bad: #ff7b80;
  --bad-soft: #42191c;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-body);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--font-display); font-stretch: 112%; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
p { margin: 0; }
a { color: var(--accent); }
small { font-size: 0.82rem; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.88rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--accent); font-size: 0.75rem; }
.empty { color: var(--muted); padding: 18px 0; }
.notice { background: var(--accent-soft); color: var(--ink); padding: 8px 12px; border-radius: 10px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }

/* brand: the second word hangs upside down */
.brand { font-family: var(--font-display); font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink); white-space: nowrap; }
.brand .flip { display: inline-block; transform: rotate(180deg); color: var(--accent); }
.brand.xl { font-size: clamp(2rem, 9vw, 3.6rem); line-height: 1; white-space: normal; }
.brand.xl .flip { display: inline-block; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 0.95rem var(--font-body); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-style: dashed; color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: default; }
.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.flipx .ico { transform: scaleX(-1); }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 4px; align-items: center; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field legend, .sets-grid span, .four span { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 1rem var(--font-body);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.four { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.four label, .sets-grid label { display: grid; gap: 4px; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.center { justify-content: center; }
.copyline { display: flex; gap: 8px; }
.copyline input { min-width: 0; }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.switch input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; accent-color: var(--accent); flex: none; }
.switch span { display: grid; }
.switch small { color: var(--muted); }
.search { border-radius: 999px; }

/* shell */
.shell { min-height: 100vh; padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 24px); }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.topbar-brand { text-decoration: none; font-size: 1.05rem; }
.who { color: var(--muted); font-size: 0.9rem; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: space-around;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: grid; justify-items: center; gap: 2px; flex: 1; max-width: 120px;
  padding: 6px 4px; border-radius: 12px; border: 0; background: none;
  color: var(--muted); text-decoration: none; font: 700 0.72rem var(--font-body); cursor: pointer;
}
.tab .ico { width: 24px; height: 24px; }
.tab.on { color: var(--accent); }
.badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 0.7rem; display: grid; place-items: center; }
.page {
  max-width: 880px; margin: 0 auto; display: grid; gap: 16px; padding-block: 20px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.page > * { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.9rem; margin-bottom: -6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0; }
.stack { display: grid; gap: 8px; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toolbar .search { flex: 1; max-width: 420px; }

@media (min-width: 900px) {
  .shell { padding-bottom: 32px; }
  .tabs {
    position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); bottom: auto;
    justify-content: center; gap: 6px; border-top: 0; border-bottom: 1px solid var(--line); background: var(--bg); padding: 6px 16px;
  }
  .tab { display: flex; gap: 8px; max-width: none; flex: none; padding: 8px 16px; font-size: 0.9rem; }
  .tab .ico { width: 20px; height: 20px; }
  .tab.on { background: var(--accent-soft); }
  .badge { position: static; }
}

/* rows */
.row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; }
.card-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
a.card-row:hover { border-color: var(--accent); }
.row-main { display: grid; flex: 1; min-width: 0; }
.row-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small, .row-side small { color: var(--muted); }
.row-side { display: grid; justify-items: end; gap: 3px; text-align: right; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 800 1.05rem var(--font-display); flex: none; text-transform: uppercase; }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-2); border: 1.5px solid var(--line); }
.dot.done { background: var(--ok); border-color: var(--ok); }
.dot.missed { border-color: var(--warn); }
.dot.due { border-color: var(--accent); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chips, .segs { display: flex; gap: 6px; flex-wrap: wrap; }
.chipbtn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 700 0.85rem var(--font-body); cursor: pointer; min-height: 36px; }
.chipbtn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.segs { background: var(--surface-2); padding: 4px; border-radius: 999px; width: fit-content; max-width: 100%; }
.seg { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 0.9rem; border: 0; background: none; cursor: pointer; font-family: var(--font-body); }
.seg small { opacity: 0.7; }
.seg.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.logs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.log { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.log .chip { margin-left: 6px; }
.quote { border-left: 3px solid var(--accent); padding: 2px 0 2px 10px; color: var(--ink); font-style: italic; }

/* workout builder */
.builder { gap: 16px; }
.wsection { display: grid; gap: 10px; }
.wsection-head { display: flex; align-items: center; gap: 6px; }
.sec-title { font: 800 0.85rem var(--font-display); font-stretch: 112%; text-transform: uppercase; letter-spacing: 0.08em; border-color: transparent; background: transparent; padding-left: 0; color: var(--muted); }
.sec-title:focus { background: var(--surface); padding-left: 12px; }
.wcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; }
.wcard-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wcard-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wcard-tools { display: flex; flex: none; }
.tag { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--bg); font: 800 0.8rem var(--font-display); flex: none; }
.sets-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sets-grid input, .sets-grid select { padding: 6px 8px; text-align: center; font-variant-numeric: tabular-nums; }
.note-input { font-size: 0.9rem; min-height: 38px; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px) + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px; box-shadow: var(--shadow); width: fit-content; z-index: 4; }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }

/* program calendar */
.calendar { display: grid; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.week { display: grid; gap: 6px; min-width: 620px; }
.wlabel { font: 800 0.75rem var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day {
  display: grid; align-content: start; gap: 4px; min-height: 76px; padding: 8px; text-align: left;
  border-radius: 10px; border: 1.5px dashed var(--line); background: transparent; color: var(--muted); cursor: pointer; font: inherit;
}
.day.has { border-style: solid; border-color: transparent; background: var(--accent-soft); color: var(--ink); }
.day:hover { border-color: var(--accent); }
.dnum { font: 700 0.7rem var(--font-mono); color: var(--muted); }
.dname { font-size: 0.8rem; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* media */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.tile { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface-2); cursor: pointer; max-width: 100%; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-cap { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 60%); color: #fff; font-size: 0.72rem; font-weight: 700; }
.tile-cap .ico { width: 12px; height: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare figure { margin: 0; display: grid; gap: 4px; }
.compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.compare figcaption { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.missing { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 0.75rem; padding: 8px; }
.player { display: grid; gap: 10px; min-width: 0; }
.player video, .viewer video, .viewer img { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; display: block; object-fit: contain; }
.review-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .review-layout { grid-template-columns: 1.1fr 1fr; align-items: start; } }
.feedback { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.fb-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-head small { color: var(--muted); }
.tnote { display: flex; gap: 8px; align-items: baseline; }
.time { border: 0; background: var(--accent-soft); color: var(--accent); font: 700 0.8rem var(--font-mono); padding: 3px 8px; border-radius: 6px; cursor: pointer; flex: none; }
.tnotes { display: grid; gap: 8px; }
.tnote-edit { display: flex; gap: 8px; align-items: center; }
.tnote-edit input { min-width: 0; }

/* sheets */
.scrim { position: fixed; inset: 0; background: rgb(8 10 18 / 50%); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 86vh; overflow-y: auto;
  display: grid; gap: 12px; align-content: start;
  padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
}
@media (min-width: 700px) { .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 24px; border-radius: 20px; } }
.sheet-x { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); }
.pick-list { display: grid; gap: 6px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.pick span:last-child { display: grid; min-width: 0; }
.pick small { color: var(--muted); }
.pick .tick { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); color: transparent; flex: none; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.on .tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick .tick .ico { width: 16px; height: 16px; }
.timer { --pct: 0; width: min(240px, 70vw); aspect-ratio: 1; margin: 6px auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-2) 0); }
.timer span { width: 82%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: clamp(2.6rem, 14vw, 3.6rem); font-weight: 700; }

/* client app */
.hello { display: grid; gap: 2px; }
.weekbar { display: flex; align-items: center; justify-content: space-between; }
.weekbar b { font-family: var(--font-display); font-stretch: 112%; }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.sday { display: grid; justify-items: center; gap: 2px; padding: 8px 0 10px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.sday small { color: var(--muted); font-size: 0.72rem; font-weight: 700; }
.sday b { font: 800 1.1rem var(--font-display); font-variant-numeric: tabular-nums; }
.sday i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.sday.work i { background: var(--accent); }
.sday.done i { background: var(--ok); }
.sday.today { border-color: var(--line); }
.sday.sel { background: var(--ink); color: var(--bg); }
.sday.sel small { color: var(--bg); opacity: 0.75; }
.wohead { display: flex; align-items: center; justify-content: space-between; gap: 12px; grid-template-columns: none; }
.wohead h2 { font-size: 1.4rem; }
.ring { --pct: 0; width: 68px; height: 68px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ok) calc(var(--pct) * 1%), var(--surface-2) 0); }
.ring span { width: 54px; height: 54px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; }
.coachnote { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; font-size: 0.92rem; }
.donebar { display: flex; gap: 8px; align-items: center; background: var(--ok-soft); color: var(--ok); font-weight: 700; padding: 12px 14px; border-radius: 12px; }
.xsection { display: grid; gap: 10px; }
.xcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 12px; transition: border-color 0.2s; }
.xcard.complete { border-color: var(--ok); }
.xcard-head { display: flex; gap: 12px; align-items: center; }
.xcard-title { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; min-width: 0; }
.xcard-title b { font-size: 1.05rem; min-width: 0; }
.xcard-title small { grid-column: 2; color: var(--muted); }
.bigcheck { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.bigcheck .ico { width: 24px; height: 24px; }
.bigcheck.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.setchips { display: flex; gap: 8px; flex-wrap: wrap; }
.setchip { display: grid; justify-items: center; min-width: 64px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; }
.setchip small { font-size: 0.68rem; color: var(--muted); font-weight: 700; }
.setchip b { font: 800 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.setchip.on { background: var(--ok-soft); border-color: var(--ok); }
.setchip.on small { color: var(--ok); }
.timerchip { color: var(--accent); border-style: dashed; align-content: center; gap: 2px; }
.timerchip small { color: var(--accent); }
.howto summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.howto p { margin: 8px 0; color: var(--muted); }
.restcard { text-align: center; padding: 28px 16px; justify-items: center; }
.upsell { background: var(--accent-soft); border-color: transparent; }

/* landing */
.landing { max-width: 880px; margin: 0 auto; display: grid; gap: 28px; padding-block: 48px 32px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.landing-hero { display: grid; gap: 14px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36ch; }
.landing-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }

/* preview banner and toast */
.preview-note {
  display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap;
  padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--ink); color: var(--bg); font-size: 0.8rem; text-align: center;
}
.preview-note .linkish { color: var(--bg); font-size: 0.8rem; }
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translate(-50%, -20px); z-index: 30;
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 520px) {
  h1 { font-size: 1.5rem; }
  .two { grid-template-columns: 1fr; }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-side .dots { display: none; }
  .copyline { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
