/* My Body — the same Apple look as the other apps (My Skaters' base styles), with a lime accent: the Today view, the fall ladder, the workout player. */
:root {
  /* Apple's light-mode system colours */
  --bg: #f2f2f7;          /* grouped background */
  --surface: #ffffff;     /* grouped cells */
  --raised: #ffffff;
  --fill: rgba(118, 118, 128, .12);   /* search fields, inputs, segmented controls */
  --hover: #ebebf0;
  --ink: #1d1d1f;
  --muted: #55555a;       /* secondary label (same grey as Our Calendar and Our Flights) */
  --line: #e0e0e5;        /* separators */
  --accent: #007aff;      /* systemBlue */
  --on-accent: #ffffff;
  --mark: #ffe58a;
  --warn: #ff3b30;        /* systemRed */
  --amber: #ff9500;
  --bar: rgba(249, 249, 251, .86);
  --shadow: 0 12px 40px rgba(0, 0, 0, .18);
  --av-blue: #007aff; --av-green: #34c759; --av-indigo: #5856d6; --av-orange: #ff9500;
  --av-pink: #ff2d55; --av-purple: #af52de; --av-red: #ff3b30; --av-teal: #30b0c7;
  --av-yellow: #f2b300; --av-mint: #00c7be; --av-brown: #a2845e; --av-cyan: #32ade6;
  color-scheme: light;
}
/* Dark colours: used when the device is in dark mode (unless Light was chosen under ? → Appearance),
   or always when Dark was chosen. Keep the two blocks below identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1c1c1e; --raised: #2c2c2e; --fill: rgba(118, 118, 128, .24); --knob: #636366; --hover: #2c2c2e;
    --ink: #f5f5f7; --muted: #b5b5ba; --line: #38383a;
    --accent: #0a84ff; --on-accent: #ffffff; --mark: #6b5a12; --warn: #ff453a; --amber: #ff9f0a;
    --bar: rgba(22, 22, 24, .86); --shadow: 0 12px 40px rgba(0, 0, 0, .6);
    --av-blue: #0a84ff; --av-green: #30d158; --av-indigo: #5e5ce6; --av-orange: #ff9f0a;
    --av-pink: #ff375f; --av-purple: #bf5af2; --av-red: #ff453a; --av-teal: #40c8e0;
    --av-yellow: #e6b800; --av-mint: #63e6e2; --av-brown: #ac8e68; --av-cyan: #64d2ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1c1c1e; --raised: #2c2c2e; --fill: rgba(118, 118, 128, .24); --knob: #636366; --hover: #2c2c2e;
  --ink: #f5f5f7; --muted: #b5b5ba; --line: #38383a;
  --accent: #0a84ff; --on-accent: #ffffff; --mark: #6b5a12; --warn: #ff453a; --amber: #ff9f0a;
  --bar: rgba(22, 22, 24, .86); --shadow: 0 12px 40px rgba(0, 0, 0, .6);
  --av-blue: #0a84ff; --av-green: #30d158; --av-indigo: #5e5ce6; --av-orange: #ff9f0a;
  --av-pink: #ff375f; --av-purple: #bf5af2; --av-red: #ff453a; --av-teal: #40c8e0;
  --av-yellow: #e6b800; --av-mint: #63e6e2; --av-brown: #ac8e68; --av-cyan: #64d2ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }
:root { --hair: 1px; }
@media (min-resolution: 2dppx) { :root { --hair: .5px; } }
html, body { margin: 0; height: 100%; }
/* Everything sized in rem scales from here. Text size (? → slider): Small · Medium (default) · Large · Extra large · Largest */
html { font-size: 16.5px; }
html[data-size="small"] { font-size: 15.5px; }
html[data-size="large"] { font-size: 18.5px; }
html[data-size="xlarge"] { font-size: 20.5px; }
html[data-size="xxlarge"] { font-size: 22.5px; }
@media (max-width: 760px) {   /* phones: Medium = iPhone standard reading size */
  html { font-size: 17px; }
  html[data-size="small"] { font-size: 16px; }
  html[data-size="large"] { font-size: 19px; }
  html[data-size="xlarge"] { font-size: 21px; }
  html[data-size="xxlarge"] { font-size: 23px; }
}
body {
  font: 400 1rem/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.01em;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
/* A closed window never shows, whatever its own display (the photo viewer is a flex column on phones) */
dialog:not([open]) { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Buttons: soft grey fill by default, solid blue for the main action, plain blue text for links */
button {
  font: inherit; font-weight: 500; color: var(--accent); background: var(--fill);
  border: 0; border-radius: 10px; padding: 7px 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:hover { filter: brightness(.96); }
button:active { opacity: .7; }
button.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.icon { width: 34px; height: 34px; padding: 0; font-size: 1.1rem; line-height: 1; flex: none; border-radius: 50%; font-weight: 600; }
button.link { background: none; padding: 2px 0; color: var(--accent); text-align: left; border-radius: 0; }
button.link:hover { background: none; text-decoration: underline; filter: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

input, textarea, select {
  font: inherit; color: var(--ink); background: var(--fill);
  border: 0; border-radius: 10px; padding: 8px 11px; min-width: 0;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { resize: vertical; line-height: 1.45; }

/* ── Screens ── */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 16px; color: var(--muted); }
.signin-card {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 36px 28px; text-align: center; max-width: 360px; width: 100%; color: var(--ink);
}
.signin-card h1 { margin: 0 0 6px; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.signin-card p { color: var(--muted); margin: 0 0 22px; }
.signin-card .primary { padding: 10px 22px; border-radius: 99px; }

#app { display: flex; flex-direction: column; height: 100dvh; }
main { flex: 1; min-height: 0; position: relative; display: flex; overflow: hidden; }
/* Pull-to-refresh (home-screen app on phones) */
.ptr { position: absolute; top: 0; left: 50%; width: 30px; height: 30px; margin-left: -15px; z-index: 5;
  opacity: 0; transform: translateY(-40px); pointer-events: none; }
.ptr-ring { width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.15); box-sizing: border-box; }
.ptr.spinning .ptr-ring { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
.ptr.settle, .list.settle { transition: transform .25s ease, opacity .25s ease; }

/* ── Header: translucent bar with a large title, like iOS ── */
.bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: var(--hair) solid var(--line); position: relative; z-index: 3;
}
.app-title { margin: 0; font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; flex: 1; min-width: 0; }
.app-title button { font: inherit; font-weight: 700; color: var(--ink); background: none; border: 0; padding: 0; border-radius: 0;
  display: inline-flex; align-items: center; gap: 10px; }
.app-title button:hover { filter: none; }
.title-icon { width: 32px; height: 32px; border-radius: 22.5%; box-shadow: 0 0 0 .5px var(--line), 0 1px 3px rgba(0,0,0,.12); }
.tools { display: flex; align-items: center; gap: 8px; }
.search { position: relative; }
#search { width: 300px; padding: 8px 12px 8px 32px; }
/* Magnifying glass inside the search box, like Apple's search fields */
.search-icon { position: absolute; left: 10px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  color: var(--muted); pointer-events: none; }
#new-btn { border-radius: 99px; padding: 7px 16px; }

.banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 20px; font-size: .88rem;
  background: color-mix(in srgb, var(--amber) 16%, var(--surface)); border-bottom: var(--hair) solid var(--line);
}
.banner span { flex: 1; min-width: 12rem; }
.banner.update { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.banner.offline { background: var(--surface); color: var(--muted); }
.banner button { padding: 4px 12px; font-size: .85rem; border-radius: 99px; background: var(--surface); }
.banner button.primary { background: var(--accent); }
.banner button.icon { width: 26px; height: 26px; padding: 0; background: var(--fill); color: var(--muted); }

/* ── List: inset grouped sections, one per letter ── */
.list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 0 56px; }
.list > * { width: min(780px, calc(100% - 40px)); margin-left: auto; margin-right: auto; }
.lh {
  position: sticky; top: 0; z-index: 2; margin: 0 auto; padding: 14px 16px 6px;
  font-size: .8rem; font-weight: 600; letter-spacing: .02em; color: var(--muted);
  background: var(--bg);
}
.group { background: var(--surface); border-radius: 12px; overflow: hidden; margin-bottom: 6px; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-radius: 0; padding: 9px 16px; background: var(--surface); color: var(--ink); font-weight: 400;
}
.row:not(:last-child)::after {   /* hairline separator, inset past the icon */
  content: ""; position: absolute; left: calc(16px + 2.1rem + 12px); right: 0; bottom: 0; height: var(--hair); background: var(--line);
}
.row:hover { background: var(--hover); filter: none; }
.row:active { opacity: 1; background: var(--hover); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rn { flex: 1; min-width: 0; }
.rn b { font-weight: 600; }
.rc { display: block; font-size: .8rem; color: var(--muted); margin-top: 1px; }
.rd { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.empty, .count { padding: 24px 16px; color: var(--muted); }
.count .link, .empty .link { margin-left: 6px; font-size: inherit; }
.rc.in-notes { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { padding: 12px 16px 6px; font-size: .82rem; }

/* ── Dialogs ── */
dialog {
  border: 0; border-radius: 16px; padding: 20px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  width: min(600px, 94vw);
}
dialog::backdrop { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 12px; font-size: 1.2rem; font-weight: 700; letter-spacing: -.015em; }
dialog h2[tabindex="-1"]:focus { outline: none; }

/* ── Contact card: centred avatar and name, quick actions, grouped details ── */
.card { width: min(560px, 94vw); max-height: 92vh; background: var(--bg); padding: 14px 20px 20px; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin: 0 -8px 2px; }
.nav-btn { background: none; padding: 6px 8px; font-size: 1rem; font-weight: 500; color: var(--accent); }
.nav-btn:hover { background: var(--fill); filter: none; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 6px; }
.hero h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; margin: 12px 0 0; overflow-wrap: anywhere; }
.sub { margin: 3px 0 0; color: var(--muted); }
.view-body { margin: 16px 0 4px; display: flex; flex-direction: column; gap: 14px; }
.view-body .group, .mini .group, .hv-text .group { margin: 0; }
.cell { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 9px 16px 10px; overflow-wrap: anywhere; }
.cell + .cell::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: var(--hair); background: var(--line); }
.cell .lbl { font-size: .8rem; color: var(--ink); text-transform: lowercase; }
.cell .val { font-size: 1rem; }
.notes { display: block; white-space: normal; font-size: .95rem; max-height: 40vh; overflow-y: auto; }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.card-actions.sticky { position: sticky; bottom: -20px; background: var(--bg); padding: 12px 0 4px; margin-bottom: -4px; border-top: var(--hair) solid var(--line); }
.meta { flex: 1; font-size: .8rem; color: var(--muted); }
#delete-btn { color: var(--warn); }
.note {
  font-size: .85rem; padding: 9px 12px; border-radius: 10px; margin: 0;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

/* Edit form: white grouped fields on the grey card background */
#edit { display: flex; flex-direction: column; gap: 12px; }
#edit h2 { margin-bottom: 0; }
#edit label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
#edit label > input:not([type="radio"]), #edit label > textarea { font-size: 1rem; color: var(--ink); width: 100%; }
#edit input, #edit textarea, #edit select { background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-size: .8rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.rows { display: flex; flex-direction: column; gap: 6px; }
fieldset .link { align-self: flex-start; font-size: .9rem; font-weight: 500; }
.conflict { border-radius: 12px; padding: 14px; background: color-mix(in srgb, var(--amber) 12%, var(--surface)); }
.conflict > p { margin: 0 0 10px; font-weight: 600; }
.conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.history-wrap:has(#history-btn[hidden]) { display: none; }
.history-wrap { margin-top: 10px; }
.history { margin-top: 8px; max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.hv { border-radius: 12px; padding: 10px 12px; background: var(--surface); font-size: .85rem; }
.hv summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.hv-text { margin: 8px 0; }
.hv-text .group { background: var(--bg); }

/* ── Help & import ── */
.help { width: min(640px, 94vw); max-height: 88vh; }
.help h3 { margin: 20px 0 8px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
/* Title row with a Close button that stays pinned while the panel scrolls */
.dialog-head { position: sticky; top: -20px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -20px -20px 0; padding: 16px 20px 12px; background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: var(--hair) solid var(--line); }
.dialog-head h2 { margin: 0; }
#help-close-top { background: none; font-weight: 600; }
/* Appearance choice: an iOS segmented control */
.theme-seg { display: inline-flex; border-radius: 9px; padding: 2px; background: var(--fill); }
.theme-seg button { background: transparent; padding: 5px 16px; font-size: .9rem; font-weight: 500; color: var(--ink); border-radius: 7px; }
.theme-seg button.on { background: var(--knob, var(--raised)); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
/* Text size slider, like iOS: small A — track — big A */
.size-slider { display: flex; align-items: center; gap: 12px; max-width: 360px; }
.size-slider input { flex: 1; accent-color: var(--accent); height: 28px; margin: 0; padding: 0; border: 0; background: none; }
.size-a { font-weight: 700; line-height: 1; color: var(--ink); }
.size-a.small { font-size: 13px; } .size-a.big { font-size: 24px; }
.size-name { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.keys { border-collapse: collapse; font-size: .9rem; }
.keys td { padding: 4px 12px 4px 0; vertical-align: top; }
.keys td:first-child { white-space: nowrap; }
kbd {
  display: inline-block; min-width: 1.6em; text-align: center; font: 600 .8rem ui-monospace, "SF Mono", Menlo, monospace;
  border-radius: 5px; padding: 1px 5px; margin-right: 2px; background: var(--fill); box-shadow: inset 0 -1px 0 var(--line);
}
code { font: .8rem ui-monospace, "SF Mono", Menlo, monospace; }
.toggle { display: inline-flex; gap: 6px; align-items: center; color: var(--ink); }
.toggle input { accent-color: var(--accent); }
.help-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 20px; }

.import { width: min(760px, 94vw); max-height: 90vh; }
.import p { margin: 0 0 12px; font-size: .9rem; }
#import-file { font: inherit; margin-bottom: 8px; max-width: 100%; border: 0; padding: 0; background: none; }
.import-preview { font-size: .9rem; }
.import-preview ul { padding-left: 20px; margin: 8px 0 12px; }
.import-preview li { margin-bottom: 4px; }
.import-preview .warn { color: var(--warn); }
.import-preview .summary { font-size: .95rem; margin-top: 8px; }
.mapping, .samples { margin: 8px 0; }
.mapping summary, .samples summary { cursor: pointer; color: var(--accent); }
.mapping table { border-collapse: collapse; margin-top: 8px; font-size: .85rem; width: 100%; }
.mapping td { padding: 3px 8px 3px 0; vertical-align: middle; }
.mapping td:last-child { overflow-wrap: anywhere; }
.mapping select { padding: 4px 8px; font-size: .85rem; }
.mini { border-radius: 12px; padding: 10px 12px; margin-top: 8px; background: var(--bg); }
.mini .group { margin-top: 6px; }
.mini .notes { max-height: 6rem; }
#import-progress { width: 100%; margin: 8px 0; accent-color: var(--accent); }

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50; bottom: 32px;
  border-radius: 99px; padding: 10px 18px; box-shadow: var(--shadow);
  background: color-mix(in srgb, var(--raised) 92%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  font-size: .9rem; max-width: calc(100vw - 32px);
  display: flex; align-items: center; gap: 14px;
}
.toast[hidden] { display: none; }
.toast-btn { white-space: nowrap; background: none; padding: 2px 4px; color: var(--accent); font-weight: 700; }
.toast-btn:hover { background: none; text-decoration: underline; filter: none; }
.toast.error { color: var(--warn); border-radius: 14px; }

/* ── Desktop / mobile switch ── */
@media (min-width: 761px) { .mobile-only { display: none !important; } }
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  /* Extra room at the top so the title clears the iPhone clock / Dynamic Island area. */
  .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; padding-top: calc(max(10px, env(safe-area-inset-top)) + 14px); }
  .app-title { font-size: 1.75rem; }
  .title-icon { width: 30px; height: 30px; }
  .tools { width: 100%; }
  .search { flex: 1; min-width: 0; }
  #search { width: 100%; font-size: max(16px, 1rem); } /* 16px+ stops iOS zooming */
  input, textarea, select { font-size: max(16px, 1rem); }
    .list > * { width: calc(100% - 24px); }
  dialog.card {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
    margin: 0; border-radius: 0; padding: 12px 16px 16px;
    padding-top: calc(max(12px, env(safe-area-inset-top)) + 10px); padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .grid2 { grid-template-columns: 1fr; }
  .card-actions { flex-wrap: wrap; }
  .meta { width: 100%; flex-basis: 100%; order: 9; }
}
/* Help panel footer (same in all three apps): Sign out, the web address and version, Close */
.help-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.help-who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.help-meta { font-size: .8rem; color: var(--muted); }

/* Sign-in screen, as in Our Calendar */
.signin-card { border-radius: 22px; padding: 36px 30px 30px; }
.signin-icon { width: 76px; height: 76px; border-radius: 22.5%; box-shadow: 0 2px 10px rgba(0,0,0,.15); margin-bottom: 14px; }
.signin-card .primary { width: 100%; padding: 11px 16px; }

/* Help panel: the app's logo, name and author at the top (same in all three apps) */
.help-hero { display: flex; align-items: center; gap: 14px; margin: 18px 0 4px; }
.help-hero-icon { width: 58px; height: 58px; border-radius: 22.5%; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.14); flex: none; }
.help-hero-name { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
.help-hero-by { font-size: .9rem; color: var(--muted); margin-top: 1px; }
/* Sign out: Apple's red on the grey capsule, the same in all three apps */
#signout-btn2 { color: #ff3b30; font-weight: 600; }

/* Sign-in screen: identical in Our Calendar, Our Contacts and Our Flights (fixed sizes, centred in the window) */
#signin .signin-card { box-sizing: border-box; width: 100%; max-width: 360px; padding: 36px 30px 30px; border-radius: 22px; text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px; font-weight: 500; line-height: 1.4; letter-spacing: -.005em; }
#signin .signin-icon { display: block; width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22.5%; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
#signin .signin-card h1 { margin: 0 0 6px; font-size: 29px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
#signin .signin-card p { margin: 0 0 22px; font-size: 16.5px; color: var(--muted); }
#signin .signin-card button { width: 100%; padding: 11px 16px; border: 0; border-radius: 999px; font: inherit; font-weight: 600;
  display: block; text-align: center; }
/* Same spot for the card (and its logo) in every app, however long the line under the name is */
#signin { align-items: start !important; justify-items: center; padding-top: max(16px, calc(50dvh - 150px)) !important; }

/* ── Header: the same in all three apps (logo + name left, search · New · ? right) ── */
.app-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.app-title button { gap: 10px; white-space: nowrap; }
.title-icon { width: 34px; height: 34px; border-radius: 22.5%; flex: none; box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.12); }
#search { width: 260px; }
@media (max-width: 760px) { #search { width: 100%; } .title-icon { width: 30px; height: 30px; } }

/* Sign-in button waits 2s so it does not flash on reload */
#signin-btn { animation: signin-appear .25s ease 2s both; }
@keyframes signin-appear { from { opacity: 0; visibility: hidden; } to { opacity: 1; visibility: visible; } }

/* Big screens (an Apple Studio Display, say): roomier windows */
@media (min-width: 1200px) and (min-height: 700px) {
  dialog.card { width: min(760px, 92vw); }
    .help { width: min(760px, 92vw); }
  .import { width: min(900px, 92vw); }
}

/* Dark mode: windows (a domain's card, a contact) stand out from the page behind them:
   a lighter window, lighter groups inside it, a thin light edge and a darker backdrop. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) dialog { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 24px 70px rgba(0, 0, 0, .7); }
  :root:not([data-theme="light"]) dialog::backdrop { background: rgba(0, 0, 0, .62); }
  :root:not([data-theme="light"]) dialog.card { background: var(--surface); }
  :root:not([data-theme="light"]) dialog.card .group { background: var(--raised); }
}
:root[data-theme="dark"] dialog { box-shadow: 0 0 0 1px rgba(255, 255, 255, .16), 0 24px 70px rgba(0, 0, 0, .7); }
:root[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .62); }
:root[data-theme="dark"] dialog.card { background: var(--surface); }
:root[data-theme="dark"] dialog.card .group { background: var(--raised); }

/* Header: the three views as an iOS segmented control, on their own row */
.bar { flex-wrap: wrap; }
.seg { display: inline-flex; border-radius: 9px; padding: 2px; background: var(--fill); }
.seg button { background: transparent; padding: 5px 16px; font-size: .9rem; font-weight: 500; color: var(--ink); border-radius: 7px; }
.seg button.on { background: var(--knob, var(--raised)); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
.seg button:hover { filter: none; }
.tabs { flex: 0 0 auto; display: flex; width: min(460px, 100%); margin: 0 calc((100% - min(460px, 100%)) / 2); }  /* its own row (the margins fill it), centred, never wider than 460px */
.tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tab-n { min-width: 1.3em; padding: 0 .4em; border-radius: 99px; font-size: .72rem; font-weight: 700; line-height: 1.45; color: #fff; background: var(--warn); }
/* Confetti */
.burst { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.burst i { position: absolute; top: -12px; width: 8px; height: 13px; border-radius: 2px; animation: fall linear forwards; opacity: .95; }
@keyframes fall { to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .7; } }
.hello-done .burst { position: fixed; }
/* Help & settings on a wide screen: two columns, so it reads at a glance instead of scrolling a narrow panel
   (Appearance, Text size and the other settings first, then how it works, the shortcuts and backups) */
@media (min-width: 1000px) {
  dialog.help { width: min(1180px, 94vw); max-height: 92vh; }
  .help-cols { columns: 2; column-gap: 48px; margin-top: 14px; }
  .help-cols > * { break-inside: avoid; }
  .help-cols > h3 { break-after: avoid; }
  .help-cols > :first-child { margin-top: 0; }
}

/* ════════════════ My Body ════════════════ */
:root { --lime: #8bd100; --lime-soft: #e9f7c4; --lime-ink: #3f7a00; --on-lime: #16300a; --gold: #ffcc00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --lime: #a4e31a; --lime-soft: #26330c; --lime-ink: #b6f03a; } }
:root[data-theme="dark"] { --lime: #a4e31a; --lime-soft: #26330c; --lime-ink: #b6f03a; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .82rem; }
.center { text-align: center; }
.tools { margin-left: auto; }
#new-btn { background: var(--lime); color: var(--on-lime); font-weight: 700; }
#new-btn:hover { filter: brightness(1.06); }
.tab-n { display: none; }
.seg button.on { color: var(--ink); }
.list > * { width: min(1240px, calc(100% - 40px)); }
.list { padding-top: 14px; padding-bottom: 64px; }
button.big { padding: 13px 22px; font-size: 1.05rem; border-radius: 14px; }
button.primary { background: var(--accent); }
button.primary.big, .pl-actions .primary { background: var(--lime); color: var(--on-lime); font-weight: 700; }
button:disabled { opacity: .35; pointer-events: none; }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime) 55%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--lime) 0%, transparent); } }
.note { font-size: .88rem; padding: 9px 12px; border-radius: 10px; margin: 8px 0; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.note.ok { background: var(--lime-soft); color: var(--ink); }
.note button.link { font-size: inherit; }

/* Layout: columns on a wide screen */
.cols { display: grid; gap: 14px; align-items: start; grid-template-columns: 1fr; margin-top: 14px; }
.col { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 1000px) { .cols { grid-template-columns: 1fr 1fr; gap: 18px; } .cols.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 761px) and (max-width: 1099px) { .cols.three { grid-template-columns: 1fr 1fr; } }

/* Cards */
.card-box { background: var(--surface); border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 0 0 .5px color-mix(in srgb, var(--line) 80%, transparent); }
.card-box h3 { margin: 0; font-size: 1.1rem; font-weight: 700; letter-spacing: -.015em; }
.card-box h4 { margin: 16px 0 6px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pill { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--fill); color: var(--muted); white-space: nowrap; }
.foot-link { text-align: center; margin: 6px 0 0; }
.foot-link .link { color: var(--muted); font-size: .88rem; }
.plain { margin: 6px 0 12px; padding-left: 1.2rem; } .plain li { margin: 4px 0; }

.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-radius: 22px; padding: 20px 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--lime) 30%, var(--surface)), var(--surface) 70%); box-shadow: 0 0 0 .5px color-mix(in srgb, var(--line) 80%, transparent); }
.hero-card h2 { margin: 2px 0 4px; font-size: 1.8rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.hero-date { margin: 0; font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hero-where { margin: 0 0 6px; font-weight: 600; color: var(--lime-ink); }
.coach { margin: 8px 0 0; font-style: italic; color: var(--muted); max-width: 46ch; }
.hero-card.slim { padding: 16px 22px; } .hero-card.slim h2 { font-size: 1.5rem; }
.hero-card.slim .muted { margin: 4px 0 0; max-width: 70ch; }
.hero-card.welcome { display: block; }
.hero-card.welcome p { max-width: 62ch; }
.start-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 14px 0 4px; }
.start-row label { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
.start-row input { font-size: 1rem; color: var(--ink); background: var(--fill); }

/* Rings */
.ring { position: relative; flex: none; display: inline-block; }
.ring svg { display: block; width: 100%; height: 100%; }
.ring-track { fill: none; stroke: var(--fill); }
.ring-val { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.ring.lime .ring-val { stroke: var(--lime); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; text-align: center; }
.ring-in b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.ring-in small { font-size: .68rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.hero-meter .ring-in b { font-size: 1.5rem; }

/* Checklists */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; background: none; color: var(--ink); font-weight: 400; padding: 9px 4px; border-radius: 12px; }
.check:hover { background: var(--hover); filter: none; }
.box { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: inline-grid; place-items: center; font-size: .8rem; font-weight: 800; color: var(--on-lime); background: transparent; padding: 0; margin-top: 1px; }
button.box { background: transparent; }
.check.on .box, .gates li.on .box { background: var(--lime); border-color: var(--lime); }
.check .ct { display: flex; flex-direction: column; min-width: 0; }
.check .ct b { font-weight: 600; font-size: .98rem; }
.check .ct small { color: var(--muted); font-size: .82rem; margin-top: 1px; }
.check.on .ct b { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.check.on .ct small { display: none; }
.checklist.compact .check { padding: 7px 4px; }
.card-box.before.all { background: var(--lime-soft); }
.tips { margin-top: 8px; } .tips summary { cursor: pointer; color: var(--accent); font-weight: 500; padding: 4px 0; }
.tiplist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tiplist li { display: flex; gap: 10px; font-size: .92rem; line-height: 1.4; } .tiplist li > span { flex: none; font-size: 1.15rem; }

/* Today's card */
.today-card { background: var(--surface); border-radius: 20px; padding: 18px 20px; margin-bottom: 14px; box-shadow: 0 0 0 .5px color-mix(in srgb, var(--line) 80%, transparent), 0 6px 22px rgba(0,0,0,.06); border-top: 5px solid var(--lime); }
.today-card.is-done { border-top-color: var(--accent); }
.tc-head { display: flex; align-items: center; gap: 14px; }
.tc-head h3 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.025em; }
.tc-head p { margin: 2px 0 0; color: var(--muted); }
.tc-emoji { font-size: 2.6rem; line-height: 1; } .tc-emoji.big { font-size: 3.4rem; }
.tc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.today-card .muted { margin: 10px 0 0; }
.done-line { font-size: 1.05rem; font-weight: 600; margin: 10px 0 0; }
.resume { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 16px; background: color-mix(in srgb, var(--gold) 22%, var(--surface)); }
.resume span { flex: 1; min-width: 12rem; }
.ex-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.ex-lines li { display: grid; grid-template-columns: 2rem 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-top: var(--hair) solid var(--line); font-size: .95rem; }
.ex-lines li:first-child { border-top: 0; }
.ex-lines .e { font-size: 1.2rem; text-align: center; }
.ex-lines .n { font-weight: 500; } .ex-lines .t { color: var(--muted); text-align: right; font-size: .9rem; }
.ex-lines .extra .n { color: var(--muted); }
.ex-lines .nil { color: var(--muted); }
.up { color: var(--lime-ink); font-weight: 800; font-size: .8rem; }
.ex-lines.log li { grid-template-columns: 2rem 1fr auto; }

/* The week */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 14px; }
.day { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 12px; background: var(--bg); text-align: center; }
.day .dn { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day .de { font-size: 1.3rem; line-height: 1.3; } .day .dk { font-size: .62rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.day.rest .de { opacity: .55; } .day.missed { opacity: .5; }
.day.today { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--lime); }
.day.done { background: color-mix(in srgb, var(--lime) 18%, var(--surface)); }
.day .skate { position: absolute; top: -5px; right: -2px; font-size: .75rem; font-style: normal; }
.meter-row { display: flex; align-items: flex-start; justify-content: space-around; gap: 8px; }
.meter { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.meter small { color: var(--muted); font-size: .76rem; max-width: 10ch; line-height: 1.2; } .meter .ring-in small { font-size: .56rem; letter-spacing: .03em; }
.meter.streak { justify-content: center; min-height: 84px; } .meter.streak b { font-size: 1.6rem; line-height: 1; font-weight: 800; }
.meter .flame { font-size: 1.7rem; line-height: 1; }
.gates { list-style: none; margin: 6px 0; padding: 0; } .gates li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .92rem; }
.gates .box { width: 22px; height: 22px; } .gates .gl { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-box.gate.ready { background: var(--lime-soft); }
.card-box.due { border-top: 4px solid var(--gold); }
.card-box.rink { border-top: 4px solid var(--accent); }

/* The fall ladder */
.track-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.track-head > div { flex: 1; min-width: 0; } .track-head h3 { font-size: 1.1rem; } .track-head p { margin: 1px 0 0; color: var(--muted); font-size: .88rem; }
.track-emoji { font-size: 2.1rem; line-height: 1; } .lock { font-size: 1.6rem; }
.phase-hint { margin: 0 0 6px; font-size: .82rem; font-weight: 600; color: var(--lime-ink); }
.track { --tc: var(--lime); } .track.t2 { --tc: var(--accent); } .track.t3 { --tc: var(--av-purple); }
.track.t2 .ring-val { stroke: var(--accent); } .track.t3 .ring-val { stroke: var(--av-purple); }
.track.locked { opacity: .8; }
.rungs { list-style: none; margin: 8px 0 12px; padding: 0; position: relative; }
.rungs li { display: flex; gap: 12px; padding: 7px 0; position: relative; }
.rungs li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: -7px; width: 2px; background: var(--line); }
.rungs li.done:not(:last-child)::before { background: var(--tc); }
.rungs .rn { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .82rem; font-weight: 800; background: var(--fill); color: var(--muted); z-index: 1; }
.rungs li.done .rn { background: var(--tc); color: #fff; }
.rungs li.now .rn { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 3px var(--tc); }
.rungs .rb { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rungs .rb b { font-weight: 600; } .rungs .rb small { color: var(--muted); }
.rungs li.next b, .rungs li.next small { color: var(--muted); } .rungs.dim { opacity: .55; } .rungs.dim li { align-items: center; }
.rungs li.now .rb { background: color-mix(in srgb, var(--tc) 10%, var(--surface)); border-radius: 12px; padding: 8px 12px; margin: -4px 0; }
.rungs li.now p { margin: 4px 0 8px; font-size: .9rem; }
.rungs .lockwhy { font-style: italic; }
.dots { display: flex; align-items: center; gap: 6px; } .dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--line); }
.dots i.on { background: var(--tc, var(--lime)); box-shadow: none; } .dots small { margin-left: 6px; color: var(--muted); font-size: .8rem; }
.track-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.adjust { display: flex; gap: 12px; } .adjust .link { font-size: .82rem; color: var(--muted); }
.track .primary { background: var(--tc); color: #fff; }
.track.t1 .primary { color: var(--on-lime); }

/* Progress */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: var(--bg); color: var(--ink); }
.slot small { color: var(--muted); font-weight: 500; } .slot.has { background: var(--lime-soft); } .slot.due { box-shadow: inset 0 0 0 2px var(--gold); }
.table-wrap { overflow-x: auto; }
table.tests { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tests th, table.tests td { padding: 8px 6px; border-top: var(--hair) solid var(--line); text-align: center; vertical-align: middle; }
table.tests thead th { border-top: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.tests tbody th { text-align: left; font-weight: 600; } table.tests tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: .76rem; }
table.tests td { font-weight: 700; font-variant-numeric: tabular-nums; } table.tests td.nil { color: var(--muted); font-weight: 400; } table.tests td small { display: block; font-size: .66rem; font-weight: 500; color: var(--muted); }
.bar-cell { min-width: 70px; } .pbar { height: 10px; border-radius: 99px; background: var(--fill); overflow: hidden; } .pbar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.pbar.met span { background: var(--lime); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: var(--bg); opacity: .6; }
.badge.on { opacity: 1; background: var(--lime-soft); } .badge span { font-size: 1.8rem; line-height: 1.2; } .badge b { font-size: .82rem; } .badge small { color: var(--muted); font-size: .7rem; line-height: 1.25; }
.av { font-size: 1.5rem; width: 2.1rem; text-align: center; }
.row .rd { max-width: 40%; }
.group { margin-bottom: 8px; }

/* Plan */
.sched { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sched th, .sched td { padding: 7px 6px; border-top: var(--hair) solid var(--line); text-align: left; } .sched tr:first-child th, .sched tr:first-child td { border-top: 0; }
.sched th { font-weight: 600; white-space: nowrap; } .sched td.t { color: var(--muted); white-space: nowrap; text-align: right; } .sched tr.now { background: var(--lime-soft); }
.phases { display: grid; gap: 10px; }
.phase { border-radius: 14px; padding: 12px 14px; background: var(--bg); } .phase.now { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--lime); } .phase.past { opacity: .65; }
.ph-head { display: flex; align-items: baseline; gap: 8px; } .ph-head span { font-size: 1.3rem; } .ph-head small { margin-left: auto; color: var(--muted); }
.phase dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 8px 0 4px; font-size: .88rem; } .phase dt { color: var(--muted); font-weight: 600; } .phase dd { margin: 0; }
.stops { border-top: 4px solid var(--warn); }

/* ── The workout player ── */
.player { width: min(720px, 96vw); height: min(880px, 94dvh); padding: 0; background: var(--bg); overflow: hidden; }
.player[open] { display: flex; flex-direction: column; }
.pl-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: var(--hair) solid var(--line); background: var(--surface); flex: none; }
.pl-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; } .pl-progress span { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 99px; transition: width .3s ease; }
.stop-btn { padding: 4px 10px; font-size: 1.1rem; }
.pl-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pl-body { padding: 22px 22px 30px; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; min-height: 100%; justify-content: center; }
.pl-nav { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; padding-bottom: max(8px, env(safe-area-inset-bottom)); border-top: var(--hair) solid var(--line); background: var(--surface); flex: none; }
.pl-nav button { background: none; } .pl-pos { color: var(--muted); font-size: .85rem; font-weight: 600; }
.ex-head { text-align: center; } .ex-head h2 { margin: 6px 0 4px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.ex-emoji { font-size: 3.4rem; line-height: 1.1; display: block; } .ex-emoji.big { font-size: 4.4rem; } .ex-head .muted { margin: 0 auto; max-width: 44ch; font-size: .95rem; }
.set-dots { display: flex; justify-content: center; gap: 8px; } .set-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--line); }
.set-dots i.on { background: var(--lime); box-shadow: none; } .set-dots i.now { box-shadow: inset 0 0 0 3px var(--lime); }
.set-label { margin: 0; font-weight: 700; font-size: 1.1rem; }
.sugg { margin: 0; padding: 9px 13px; border-radius: 12px; font-size: .9rem; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); text-align: center; }
.sugg.up { background: var(--lime-soft); font-weight: 600; }
.steppers { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper > button { width: 64px; height: 64px; border-radius: 50%; font-size: 2rem; font-weight: 500; line-height: 1; padding: 0; background: var(--surface); box-shadow: 0 0 0 .5px var(--line), 0 2px 8px rgba(0,0,0,.08); }
.stepper > div { min-width: 7.5rem; text-align: center; display: flex; flex-direction: column; } .stepper b { font-size: 2.6rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stepper small { color: var(--muted); font-weight: 600; }
.levels { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px; border-radius: 99px; font-size: .9rem; font-weight: 600; background: var(--fill); color: var(--ink); }
.chip.on { background: var(--lime); color: var(--on-lime); }
.pl-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: 4px; } .pl-actions button { width: 100%; }
.pl-actions .big { padding: 16px 22px; font-size: 1.15rem; border-radius: 16px; }
.pl-actions.end, .help-actions.end { justify-content: flex-end; flex-direction: row; }
.big-ok { font-size: 2rem; font-weight: 800; margin: 4px 0 0; }
.feel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.feel button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 16px; background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 0 0 .5px var(--line); }
.feel button span { font-size: 2.1rem; line-height: 1.2; } .feel small { font-weight: 500; color: var(--muted); font-size: .72rem; }
.timer { display: flex; flex-direction: column; align-items: center; gap: 12px; } .timer .pl-actions { width: 100%; }
.timer .ring-in b { font-size: 2.6rem; font-variant-numeric: tabular-nums; } .timer .ring-in small { font-size: .8rem; }
.check-timer { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--surface); border-radius: 16px; padding: 8px 14px; }
.check-timer .ring-in b { font-size: .95rem; } .check-line { display: flex; align-items: center; gap: 6px; }
.check-line .check { flex: 1; } .tbtn { flex: none; padding: 5px 11px; border-radius: 99px; font-size: .85rem; }
.pl-body .checklist { background: var(--surface); border-radius: 16px; padding: 6px 12px; }
.pl-body textarea { width: 100%; background: var(--surface); }
.notes-field { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.sum-grid { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; } .sum-grid > div { min-width: 5.4rem; padding: 12px 10px; border-radius: 16px; background: var(--surface); text-align: center; display: flex; flex-direction: column; }
.sum-grid b { font-size: 2rem; font-weight: 800; line-height: 1.1; } .sum-grid small { color: var(--muted); font-weight: 600; font-size: .75rem; }
.level-up { font-size: 1.15rem; font-weight: 700; margin: 0; color: var(--lime-ink); }
.pl-body .note { text-align: center; }

/* The ladder step */
.lad-grid { display: flex; flex-direction: column; gap: 12px; }
.lad { background: var(--surface); border-radius: 18px; padding: 14px 16px; border-top: 5px solid var(--lime); --tc: var(--lime); } .lad.t2 { border-top-color: var(--accent); --tc: var(--accent); } .lad.t3 { border-top-color: var(--av-purple); --tc: var(--av-purple); }
.lad-head { display: flex; align-items: center; gap: 10px; } .lad-head > span:first-child { font-size: 1.8rem; } .lad-head > div { flex: 1; display: flex; flex-direction: column; } .lad-head small { color: var(--muted); }
.lad-count { font-size: .8rem; font-weight: 700; color: var(--muted); }
.lad h3 { margin: 8px 0 2px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; } .lad h3 small { font-weight: 500; color: var(--muted); font-size: .85rem; margin-left: 4px; }
.lad .muted { margin: 0 0 8px; font-size: .92rem; } .shape { margin: 0 0 8px; padding: 9px 12px; border-radius: 12px; background: var(--lime-soft); font-size: .86rem; }
.dots.big { margin: 4px 0 10px; } .dots.big i { width: 20px; height: 20px; background: var(--fill); }
.dots.big i.on { background: var(--tc); }
.rep-btns { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.rep-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px; font-weight: 700; color: var(--ink); }
.rep-btns button span { font-size: 1.5rem; line-height: 1.2; }
.rep-btns .smooth { background: var(--lime-soft); box-shadow: inset 0 0 0 2px var(--lime); } .rep-btns .rough { background: color-mix(in srgb, var(--gold) 20%, var(--surface)); } .rep-btns .pain { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.climb { margin-top: 10px; width: 100%; animation: pulse 1.8s ease-in-out infinite; }

/* Tests, sessions, stop signs */
.testdlg { width: min(860px, 94vw); max-height: 92vh; background: var(--bg); }
.test-fields { display: grid; gap: 12px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 900px) { .test-fields { grid-template-columns: 1fr 1fr; gap: 12px 22px; } }
.tf { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border-radius: 14px; background: var(--surface); }
.tf.date { background: none; padding: 0 0 2px; font-size: .8rem; color: var(--muted); grid-column: 1 / -1; flex-direction: column; } .tf.date input { max-width: 14rem; color: var(--ink); background: var(--surface); }
.tf label { display: flex; flex-direction: column; gap: 1px; } .tf label b { font-weight: 600; } .tf label .e { display: none; } .tf label small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.tf-in { display: flex; gap: 8px; } .tf-in input[type="number"] { flex: 1; min-width: 0; background: var(--fill); font-size: 1.1rem; font-weight: 600; } .tf-in select { background: var(--fill); }
.sess { width: min(560px, 94vw); }
.stopdlg { width: min(520px, 94vw); } .stopdlg ul { margin: 6px 0 14px; padding-left: 1.2rem; } .stopdlg li { margin: 4px 0; }
.hero.center { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 8px; } .hero h2 { margin: 6px 0 0; }

/* Phones: the player fills the screen */
@media (max-width: 760px) {
  .hero-card { padding: 16px; gap: 10px; } .hero-card h2 { font-size: 1.5rem; } .hero-meter .ring { width: 78px !important; height: 78px !important; } .hero-meter .ring-in b { font-size: 1.2rem; }
  #new-btn { flex: 1; }
  dialog.player { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .pl-top { padding-top: calc(max(12px, env(safe-area-inset-top)) + 4px); }
  .pl-body { padding: 14px 16px 24px; justify-content: flex-start; }
  .stepper > button { width: 60px; height: 60px; }
  dialog.testdlg, dialog.sess { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; padding: 14px 16px; padding-top: calc(max(14px, env(safe-area-inset-top)) + 8px); }
  .week-strip { gap: 3px; } .day .dk { font-size: .56rem; }
  table.tests { font-size: .82rem; } .bar-cell { min-width: 44px; }
  .slots { gap: 6px; }
}
@media (min-width: 1200px) and (min-height: 700px) { dialog.card.sess { width: min(600px, 92vw); } }
@media (prefers-reduced-motion: reduce) { .pulse, .climb { animation: none !important; } }

.skills li span{display:block;margin-top:2px}
