:root {
  --bg: #0b0b0c;        /* the app column */
  --panel: #141416;     /* header, nav, dialogs */
  --sunken: #08080a;    /* inputs and card interiors */
  --raised: #1e1e22;    /* pills and chips */
  --line: #2b2b31;
  /* Cards sit on the ground by being lighter than it, not by being outlined. A hairline on every
     card reads as a wireframe; one flat step up reads as a surface. */
  --surface: #161619;
  --surface-2: #1d1d21;   /* something sitting on a card */
  --text: #f3ede7;
  --muted: #8f8880;
  --accent: #ff7a18;
  --accent-ink: #1c0c00; /* text on an orange fill */
  --card: #b35510;       /* card outline: orange, dimmed so the accent still leads */
  --bar-idle: #5d2f11;   /* a bar that is not this week: the accent burnt down, not grey */
  --r-card: 20px;        /* one radius for anything card-shaped */
  --accent-soft: #ff7a1826;   /* accent at ~15% for the active tab */
  --danger: #ff6b6b;

  /* Outfit for anything that reads as language, Space Grotesk for anything that reads as a
     measurement — its digits are squared and flat-terminalled, which is what makes a readout look
     like an instrument rather than a sentence. */
  --font-ui: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Space Grotesk', ui-monospace, 'Segoe UI', sans-serif;

  /* One scale, eight steps, each about a fifth larger than the last. Before this the stylesheet
     had twenty-one sizes between 9px and 46px, which is why nothing looked related to anything. */
  --t-cap: 10px;    /* uppercase micro-labels */
  --t-xs: 12px;
  --t-sm: 14px;
  --t-base: 15px;   /* body */
  --t-md: 18px;
  --t-lg: 22px;
  --t-xl: 27px;
  --t-hero: 34px;
  --track-cap: .12em;   /* the one tracking every caps label uses */
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* No scrollbar tracks anywhere. A phone does not park a grey bar down the side of a sheet, and
   every scroller in here is driven by touch, wheel or keys — hiding the widget takes none of
   that away. */
* { scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; }
[hidden] { display: none !important; }

body {
  margin: 0; background: #000; color: var(--text);
  font: var(--t-base)/1.5 var(--font-ui);
}
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

#app {
  /* Flex, not grid rows: children come and go here, and positional grid tracks would hand
     "1fr" to the wrong child when one of them is hidden. */
  max-width: 560px; margin: 0 auto; min-height: 100dvh; background: var(--bg);
  display: flex; flex-direction: column;
  border-inline: 1px solid var(--line);
}

.pills {
  display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto;
  background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 900;
}

/* Inside a native full-screen WebView the page runs under the status bar and the Dynamic Island.
   The inset is 0 in a browser tab, so this only ever moves anything when it needs to. */
main { flex: 1; min-height: 0; padding-top: env(safe-area-inset-top); }

/* Members-only and signed out: the app underneath is not merely covered but taken out of the page,
   so nothing in it can load, paint or be tabbed to. */
body.walled main, body.walled .tabbar { display: none; }
#wall {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
}
#wall[hidden] { display: none; }
#wall .muted { margin: 0 0 10px; }
.view { padding: 14px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- controls ---------- */

.pill {
  border: 1px solid var(--line); background: var(--raised); color: var(--text);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: var(--t-sm);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.pill:hover { border-color: var(--accent); }
.pill.icon { padding: 8px 12px; line-height: 1; }
.pill.icon .ico { width: 19px; height: 19px; display: block; }
.composer-row button[type="submit"] { margin-left: auto; }
.pill:focus-within, .pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pill:disabled { opacity: .6; cursor: default; }
.pill.wide { width: 100%; justify-content: center; padding: 10px; }
.linky { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.linky:hover { color: var(--accent); }
.linky.liked { color: var(--accent); }
.chip {
  background: var(--raised); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; font-size: var(--t-xs); cursor: pointer; color: var(--text);
}
.chip:hover { border-color: var(--accent); }

textarea, input, select {
  background: var(--sunken); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px; font: inherit; width: 100%; resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- composer ---------- */

#composer {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 0; border-radius: var(--r-card); padding: 14px;
}
.composer-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer-row select { flex: 1; min-width: 120px; width: auto; }
#activity-fields, #music-fields { display: flex; gap: 8px; flex-wrap: wrap; }
#activity-fields select { flex: 2 1 130px; width: auto; }
#activity-fields input { flex: 1 1 90px; width: auto; }
#music-fields input { flex: 1 1 100%; }
#attachment { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* ---------- feed ---------- */

#feed { display: flex; flex-direction: column; gap: 18px; }

/* One post is one card: header, portrait media, then the text and buttons. */
/* No outline: a hairline round every card reads as a wireframe, so the surface does the separating. */
.post {
  display: flex; flex-direction: column;
  background: var(--surface); border: 0; border-radius: var(--r-card); overflow: hidden;
}
.post-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.post-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-place {
  align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--muted); font: inherit; font-size: var(--t-xs);
}
.post-place:hover { color: var(--accent); }
.post-head .when { margin-left: auto; white-space: nowrap; font-size: var(--t-xs); }
.post-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 14px 4px; }

/* Portrait, the way a phone holds a photo. The composer preview keeps the plain .box look. */
.post .box { border: 0; border-radius: 0; max-height: none; aspect-ratio: 4 / 5; }
/* A post that is only words is only words. It used to be centred in a 130px-minimum well with
   26px of padding and a darker background — a media-sized frame — which put a great deal of
   nothing around a two-word post. Now it sizes to the sentence and sits on the card like text. */
.post .textcard {
  aspect-ratio: auto; border-radius: 0; min-height: 0; background: none;
  display: block; text-align: left; padding: 2px 14px 10px; font-size: var(--t-md);
}
.box {
  display: block; width: 100%; border: 0; border-radius: var(--r-card);
  background: var(--sunken); max-height: 460px; object-fit: cover;
}
video.box { object-fit: contain; background: #000; }
.textcard {
  line-height: 1.45;
  /* Newlines the author typed are theirs to keep, and a pasted URL must not push the card wide. */
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.line { margin: 0; overflow-wrap: anywhere; }
.line.meta { color: var(--muted); font-size: var(--t-sm); }
.line.meta a { color: var(--accent); }
.actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; font-size: var(--t-sm); }
.act {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 12px;          /* 44px keeps it a comfortable tap target */
  background: none; border: 0; border-radius: 12px;
  color: var(--muted); font: inherit; font-size: var(--t-base); cursor: pointer;
}
/* Icons now appear inline in sentences ("[run] Running - 50m - 10 km"), in chips and in list rows.
   Sizing in em keeps each one matched to the text it sits beside instead of needing a rule per
   context, and the baseline nudge stops it riding high. */
svg.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: 0 0 auto; }
/* A chip is an icon and a word; give them a gap rather than relying on a space character. */
.chip { display: inline-flex; align-items: center; gap: 5px; }
.act .ico { width: 20px; height: 20px; display: block; }
/* Pressed is the same shape filled in, so a button never changes what it depicts. */
.act.on .ico { fill: currentColor; }
.act .n { font-variant-numeric: tabular-nums; }
.act:hover { background: var(--raised); color: var(--text); }
.act.on { color: var(--accent); }
.act:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* the time moved up into the header */

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--raised); border: 1px solid var(--accent);
  border-radius: 12px; padding: 8px 12px; font-size: var(--t-sm);
}
#toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 1000;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: var(--t-sm);
  padding: 10px 18px; border-radius: 999px; max-width: 88vw; text-align: center;
}
/* Section labels and stat labels are the same kind of thing — a caption naming what is under it —
   so they share a size and a tracking rather than each having their own. */
h3.section {
  margin: 22px 0 0; font-size: var(--t-xs); font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: var(--track-cap);
}
#saved-feed { display: flex; flex-direction: column; gap: 22px; }
.muted { color: var(--muted); font-size: var(--t-sm); }
.err { color: var(--danger); font-size: var(--t-sm); margin: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

.comments { display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--line); padding: 4px 0 4px 10px; }
.comment { font-size: var(--t-sm); }
.comment b { font-size: var(--t-sm); }
.comment-form { display: flex; gap: 6px; }

/* ---------- places ---------- */

#map-wrap { position: relative; }
#map { height: 52vh; min-height: 280px; border-radius: 16px; background: var(--panel); }

/* Google-Maps-style expand: the wrapper takes the whole viewport, nav and all. */
#map-wrap.expanded {
  position: fixed; inset: 0; z-index: 1200; margin: 0;
}
#map-wrap.expanded #map { height: 100%; border-radius: 0; }
#map-wrap.expanded .map-search { top: 12px; }
#map-wrap.expanded .zone-key { bottom: calc(12px + env(safe-area-inset-bottom)); }
body.map-open { overflow: hidden; }

.map-search { position: absolute; z-index: 600; top: 12px; left: 12px; right: 12px; }
.map-search input { background: var(--panel); box-shadow: 0 2px 8px #0008; }
#search-results {
  margin-top: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; max-height: 46vh; overflow-y: auto; box-shadow: 0 6px 18px #000a;
}
.sresult {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: var(--t-sm); padding: 9px 11px; cursor: pointer;
}
.sresult:hover { background: var(--raised); }
.sname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sempty { padding: 7px 11px 4px; margin: 0; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-cap); }
.sname { display: flex; flex-direction: column; }
.ssub { font-size: var(--t-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sresult .chip { flex-shrink: 0; }
.addrow { color: var(--accent); }
.sfar { font-size: var(--t-xs); color: var(--accent); font-weight: 600; white-space: nowrap; }

#dir {
  position: absolute; z-index: 700; left: 12px; right: 12px; bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
  max-height: 62%; overflow-y: auto; box-shadow: 0 8px 24px #000b;
}
.dir-head { display: flex; align-items: center; justify-content: space-between; }
.dir-modes { display: flex; gap: 8px; }
.dir-modes .pill { flex: 1; justify-content: center; }
#dir-summary { margin: 0; font-size: var(--t-base); color: var(--text); font-weight: 600; }
#dir-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--t-sm); }
#dir-steps li::marker { color: var(--accent); }
#dir-sug {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; max-height: 34vh; overflow-y: auto;
}
#dir-external { align-self: flex-start; }

/* navigation overlay */
#nav { position: absolute; inset: 0; z-index: 800; pointer-events: none; }
/* You, under navigation. The beam is a 70° wedge pointing up, fading out from the dot, turned by
   the heading — the cone Google Maps draws for the way the phone is facing. */
.nav-me { pointer-events: none; }
.nav-me .nav-dot {
  position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45);
}
.nav-me .nav-beam {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -35deg, rgba(255, 122, 24, .6) 0deg 70deg, transparent 70deg);
  -webkit-mask: radial-gradient(circle, #000 14%, rgba(0, 0, 0, .55) 40%, transparent 70%);
  mask: radial-gradient(circle, #000 14%, rgba(0, 0, 0, .55) 40%, transparent 70%);
  transition: transform .12s linear;
}
.nav-me .nav-beam[hidden] { display: none; }
.nav-banner {
  pointer-events: auto; position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 14px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 16px; padding: 14px 16px; box-shadow: 0 6px 20px #000a;
}
#nav-icon { font-size: var(--t-hero); line-height: 1; }
.nav-text { min-width: 0; }
#nav-dist { font-size: var(--t-lg); font-weight: 800; display: block; line-height: 1.1; }
#nav-instruction { margin: 2px 0 0; font-size: var(--t-base); font-weight: 600; }
#nav-then { margin: 2px 0 0; font-size: var(--t-xs); color: #5a2a00; }
.nav-foot {
  pointer-events: auto; position: absolute; left: 12px; right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 10px; box-shadow: 0 6px 20px #000a;
}
#nav-remaining { flex: 1; font-size: var(--t-sm); color: var(--text); font-weight: 600; }
.pill.danger { background: var(--danger); color: #1a0000; border-color: var(--danger); font-weight: 600; }

.popup-acts { margin-top: 8px; flex-wrap: wrap; gap: 6px; }

/* place detail */
#place-view { width: min(520px, 96vw); max-height: 88dvh; overflow-y: auto; padding: 0 0 18px; }
#place-view .x { z-index: 2; background: #000a; border-radius: 50%; width: 30px; height: 30px; color: #fff; }
#pv-body { padding: 0 18px; }
#pv-body h2 { margin: 14px 0 2px; font-size: var(--t-lg); }
#pv-body > p { margin: 2px 0; }
.pv-gallery {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -18px 4px; padding: 0 18px;
  scroll-snap-type: x mandatory;
}
.pv-gallery img {
  flex: 0 0 78%; height: 200px; object-fit: cover; border-radius: 14px; scroll-snap-align: center;
}
.pv-gallery.empty-gal {
  height: 130px; display: grid; place-items: center; font-size: 46px;
  background: var(--raised); border-radius: 14px; margin: 14px 0 4px; padding: 0;
}
.pv-score { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--t-sm); }
.stars { color: var(--accent); letter-spacing: 1px; }
.stars.sm { font-size: var(--t-xs); }
.pv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
#pv-review { display: flex; flex-direction: column; gap: 8px; }
.rate { display: flex; gap: 4px; }
.star {
  background: none; border: 0; color: var(--accent); font-size: var(--t-xl); line-height: 1;
  cursor: pointer; padding: 0 2px;
}
#pv-preview { border-radius: 10px; max-height: 160px; object-fit: cover; width: 100%; }
.pv-reviews { display: flex; flex-direction: column; gap: 14px; }
.pv-review { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.pv-rshot { border-radius: 10px; max-height: 200px; width: 100%; object-fit: cover; margin-top: 6px; }

/* action sheet */
dialog.sheet { width: min(340px, 92vw); padding: 20px; text-align: center; }
dialog.sheet h2 { margin: 0 0 6px; font-size: var(--t-md); }
#ask-msg { white-space: pre-line; }
dialog.sheet .muted { margin: 0 0 14px; }
#ask-options { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
#ask-options .pill.danger { background: var(--danger); color: #1a0000; border-color: var(--danger); font-weight: 600; }
#ask-input { margin-bottom: 4px; }
#ask-cancel { color: var(--muted); }
#lists { display: flex; flex-direction: column; gap: 8px; }
/* Search gets its own full-width row; the tools sit on the row beneath so they never collide. */
.map-tools { position: absolute; z-index: 500; top: 58px; right: 12px; display: flex; gap: 8px; }
#hint {
  position: absolute; z-index: 500; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px;
  border-radius: 999px; font-weight: 600; font-size: var(--t-sm);
}
.zone-key {
  position: absolute; z-index: 500; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 4px;
  background: #000000a8; padding: 5px 9px; border-radius: 999px;
}
.zone-key .sw { width: 14px; height: 9px; border-radius: 2px; }
.zone-key .s1 { background: #ffc98a; } .zone-key .s2 { background: #ff9838; } .zone-key .s3 { background: #ff5a00; }
.zone-key .muted { font-size: var(--t-xs); }

/* Airbnb-ish category rails above the map */
#rails { display: flex; flex-direction: column; gap: 14px; }
.rail .section { margin: 0 0 8px; }
#rails { margin-top: 14px; }
.rail-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }

.lists-link {
  font: inherit; font-size: var(--t-base); font-weight: 700; color: var(--text);
  background: none; border: 0; padding: 0; cursor: pointer;
}
.lists-link:hover { color: var(--accent); }
.lists-link .badge { margin-left: 6px; }
.rcard.invite .rcover { border-color: var(--accent); border-style: dashed; }

/* Keep display off the base rule — an author display declaration on a closed <dialog> is what
   the !important backstop at the bottom of this file guards against. */
dialog.full {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh;
  border-radius: 0; padding: 0; flex-direction: column;
}
dialog.full[open] { display: flex; }

/* A sheet that rises from the bottom, the way a mobile app does it: rounded top, a grip to
   say it is draggable-looking, and enough of the page left showing to tap out of. */
dialog.sheet-up {
  width: min(560px, 100vw); max-width: 100vw;
  /* fit-content, not auto: a modal dialog has inset-block: 0, so an auto height fills the whole
     band and every sheet comes out exactly max-height tall no matter how little is in it. */
  height: fit-content; max-height: 86dvh;
  margin: auto auto 0; border-radius: 20px 20px 0 0; padding: 0;
  flex-direction: column; overflow: hidden;
}
dialog.sheet-up[open] { display: flex; }
.grip {
  width: 38px; height: 4px; border-radius: 2px; background: var(--line);
  margin: 8px auto 0; flex-shrink: 0;
}
@media (min-width: 640px) {
  dialog.sheet-up { margin: auto; border-radius: 20px; max-height: 80dvh; }
}
.lv-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.lv-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.lv-titles b { font-size: var(--t-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-titles .muted { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* flex: 0 1 auto so a landscape phone shrinks the map instead of squeezing the list to a slit. */
#lv-map { height: 30dvh; min-height: 0; flex: 0 1 auto; background: var(--panel); }
@media (max-height: 520px) { #lv-map { display: none; } }
#lv-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
/* Top level of the Account tab, so an underlined bar rather than more pills — the pills inside
   Saved are a level down and have to read that way. */
.acct-tabs { display: flex; gap: 0; margin: 18px 0 12px; border-bottom: 1px solid var(--line); }
.ac-tab {
  flex: 1; padding: 11px 4px; background: none; border: 0; margin-bottom: -1px;
  border-bottom: 2px solid transparent; cursor: pointer;
  font-family: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--muted);
}
.ac-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.goal-by { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-size: var(--t-sm); }
.goal-by input { flex: 1; min-width: 0; }
.goal-by.needed #goal-by-label::after { content: ' *'; color: var(--accent); }
/* A sheet option is an icon and a label on one line, the icon held at the text's own weight. */
#ask-options .pill { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
#ask-options .pill svg { width: 19px; height: 19px; flex: 0 0 auto; }
/* The gear sits in the account header's top corner without being in its flow. */
.account { position: relative; }
.acct-gear { position: absolute; top: 0; right: 0; }

#settings-body .section:first-child { margin-top: 4px; }
.slist {
  display: flex; flex-direction: column; gap: 1px; margin-top: 8px;
  background: var(--surface); border-radius: var(--r-card); overflow: hidden;
}
.srow {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 13px 14px; background: var(--surface); border: 0; color: var(--text);
  font: inherit; font-size: var(--t-sm);
}
.srow svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); }
.srow-l { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.srow-v { color: var(--muted); font-size: var(--t-xs); white-space: nowrap; }
.srow.tap { cursor: pointer; }
.srow.tap:hover { background: var(--surface-2); }
/* A row for something that does not exist is dimmed and inert, and says why underneath. */
.srow.off { color: var(--muted); }
.srow-why { font-size: var(--t-xs); color: var(--muted); opacity: .8; white-space: normal; }

/* A row of sub-tabs at the head of a tab. Pills rather than the account tab's underline bar, so
   the two levels of tabbing never read as the same control. */
.subtabs { display: flex; gap: 8px; padding: 12px 0 6px; overflow-x: auto; }
.pill.sub { flex: 1; justify-content: center; white-space: nowrap; }
.pill.sub.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pane > .empty { padding: 48px 20px; }
/* A row of sub-tabs at the head of a tab. Pills rather than the account tab's underline bar, so
   the two levels of tabbing never read as the same control. */
.subtabs { display: flex; gap: 8px; padding: 12px 0 6px; overflow-x: auto; }
.pill.sub { flex: 1; justify-content: center; white-space: nowrap; }
.pill.sub.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.pane > .empty { padding: 48px 20px; }
.saved-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sv-tab { padding: 7px 13px; font-size: var(--t-sm); }
#saved-feed .lgrid { padding-bottom: 6px; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.lgrid .rcard { flex: none; width: auto; }
.lgrid-item { display: flex; flex-direction: column; gap: 4px; }
.lv-del { display: block; margin-top: 18px; }

/* goals */
.goalpost {
  display: flex; flex-direction: column; gap: 8px; margin: 0 14px 10px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.goalpost-top { display: flex; align-items: center; gap: 10px; }
.goalpost-ico { font-size: var(--t-xl); }
.goalpost-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.goalpost-list li { font-size: var(--t-sm); }
.goalpost-list .muted { font-size: var(--t-xs); }
#goals, #account-goals { display: flex; flex-direction: column; gap: 12px; }
.goal {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 0; border-radius: var(--r-card); padding: 16px;
}
.goal.done { box-shadow: inset 0 0 0 1px var(--accent); }
/* Past its day and not hit. Dimmed rather than red: it is a deadline that went by, not an error. */
.goal.missed { opacity: .62; }
.goal.missed .gt-bar span { background: var(--muted); }
.goal-head { display: flex; align-items: center; gap: 8px; }
.goal-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; flex: 1; }
.goal-name .muted { font-size: var(--t-xs); }
.effort { align-items: center; gap: 6px; flex-wrap: wrap; }
.effort-label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-cap); }
.effort .pill { padding: 6px 12px; font-size: var(--t-sm); }
.gt { display: flex; flex-direction: column; gap: 7px; }
.gt-top { display: flex; align-items: baseline; gap: 7px; font-size: var(--t-sm); }
.gt-top .muted { font-size: var(--t-xs); flex: 1; }
.gt-top b {
  font-family: var(--font-num); font-size: var(--t-lg); font-weight: 300;
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.gt-tick { color: var(--accent); font-weight: 700; }
.gt-bar { height: 5px; border-radius: 99px; background: #ffffff10; overflow: hidden; }
.gt-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
/* A finished target was green, which is the only green in the app and reads as a different brand.
   Full-strength accent against the half-lit bars around it says "done" just as loudly. */
.gt.done .gt-bar span { background: var(--accent); box-shadow: 0 0 10px #ff7a1866; }
#goal-pop { width: min(420px, 94vw); }
#goal-pop[open] { display: flex; flex-direction: column; gap: 10px; }
#goal-targets:empty { display: none; }
#rb {
  position: absolute; z-index: 700; left: 12px; right: 12px; bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
#rb[hidden] { display: none; }
#rb .row { display: flex; gap: 8px; }
#rb .row .pill { flex: 1; justify-content: center; }
#gt-set { max-height: 42vh; overflow-y: auto; }
.setg { margin-bottom: 8px; }
.setg-name { margin: 0 0 4px; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-cap); }
.setg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chipx { padding: 6px 10px; font-size: var(--t-xs); }

/* the story viewer */
#snap-viewer { background: #000; }
/* The inset belongs on the edge it names. As a three-value shorthand the TOP inset was landing
   on the BOTTOM padding, which left ✕ and ··· with 10px of clearance and put them under the
   status bar on a notched phone — the one place this viewer is meant to be used. */
.sv-head { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; flex-shrink: 0; }
.sv-bars { display: flex; gap: 4px; }
.sv-bar { flex: 1; height: 3px; border-radius: 2px; background: #ffffff30; }
.sv-bar.done { background: #ffffff90; }
.sv-bar.now { background: var(--accent); }
.sv-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sv-who b { font-size: var(--t-base); }
.sv-who .muted { font-size: var(--t-xs); }
/* One group pinned right, so hiding ··· does not leave ✕ stranded next to the name. */
.sv-tools { display: flex; gap: 6px; margin-left: auto; }
.sv-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.sv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sv-tap { position: absolute; top: 0; bottom: 0; width: 34%; background: none; border: 0; cursor: pointer; }
.sv-tap.prev { left: 0; }
.sv-tap.next { right: 0; }
.sv-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
}
.sv-reacts { display: flex; gap: 4px; flex: 1; }
.sv-react {
  display: inline-flex; align-items: center; gap: 3px; min-height: 44px; padding: 0 9px;
  background: none; border: 0; border-radius: 12px; font-size: var(--t-lg); cursor: pointer;
  color: var(--text);
}
.sv-react:hover { background: #ffffff14; }
.sv-react.on { background: var(--accent-soft); }
.sv-n { font-size: var(--t-xs); color: var(--muted); }
.sv-acts { display: flex; gap: 8px; }
.snap .ring.stack { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.snap { position: relative; }
.snap-n {
  position: absolute; top: -2px; right: 2px; min-width: 18px; height: 18px;
  border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font-size: var(--t-xs); font-weight: 700; line-height: 18px; text-align: center;
}

dialog.cam { background: #000; }
.cam-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.cam-stage video { width: 100%; height: 100%; object-fit: contain; }
.cam-dot {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  background: #000a; color: var(--danger); font-size: var(--t-xs); font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.cam-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); flex-shrink: 0;
}
.cam-shutter {
  width: 64px; height: 64px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 4px solid #fff6; box-shadow: 0 0 0 2px #0006 inset;
}
.cam-shutter:disabled { opacity: .35; cursor: default; }
dialog.cam.recording .cam-shutter { background: var(--danger); border-radius: 18px; }
.rcard {
  flex: 0 0 148px; scroll-snap-align: start; background: none; border: 0; padding: 0;
  cursor: pointer; text-align: left; color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.rcover {
  display: grid; place-items: center; height: 104px; border-radius: 14px; overflow: hidden;
  background: var(--raised); border: 1px solid var(--line);
}
.rcover img { width: 100%; height: 100%; object-fit: cover; }
.rcover-icon { font-size: var(--t-hero); }
.rcard:hover .rcover { border-color: var(--accent); }
.rname { font-weight: 600; font-size: var(--t-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .muted { font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pin-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: var(--t-base);
  border: 2px solid var(--bg); box-shadow: 0 2px 6px #000a; cursor: pointer;
}
#filter {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--raised); border: 1px solid var(--accent); border-radius: 12px; padding: 8px 12px; font-size: var(--t-sm);
}
#place-feed { display: flex; flex-direction: column; gap: 22px; }

.marker { font-size: var(--t-lg); line-height: 1; text-shadow: 0 1px 3px #000; cursor: pointer; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); }
.leaflet-popup-content { margin: 12px 14px; }
.leaflet-popup-content b { display: block; margin-bottom: 4px; }
.leaflet-container { background: var(--sunken); border-radius: 16px; }
.leaflet-tile { filter: invert(1) hue-rotate(180deg) saturate(.28) brightness(.86) contrast(.95) sepia(.35); }
.map-dropping { cursor: crosshair; }
/* Leaflet's own chrome ships light — repaint it so it does not glare against the black. */
.leaflet-control-attribution { background: #000000a8; color: var(--muted); }
.leaflet-control-attribution a { color: var(--accent); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--panel); color: var(--text); border-bottom-color: var(--line); }
.leaflet-bar a:hover { color: var(--accent); }

/* ---------- friends: snaps, chats, people ---------- */

.friends-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}
.friends-head .section { margin: 0; }
#activity-summary .friends-head { margin-bottom: 0; }
#people-btn { position: relative; }
#req-dot { position: absolute; top: 4px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

#snap-tray { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
.snap {
  background: none; border: 0; padding: 0; cursor: pointer; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 72px;
}
.ring {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%;
  border: 3px solid var(--accent); overflow: hidden; background: var(--raised);
}
.ring.seen { border-color: var(--line); }
.ring img { width: 100%; height: 100%; object-fit: cover; }
.snap.add .bubble { font-size: var(--t-xl); color: var(--accent); }
.snap-name {
  font-size: var(--t-xs); color: var(--muted); max-width: 72px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

#chat-list { display: flex; flex-direction: column; }
.chat-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; padding: 11px 2px; cursor: pointer;
}
.chat-row:hover { background: var(--raised); }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.sm { width: 42px; height: 42px; font-size: var(--t-md); flex-shrink: 0; }
.avatar.photo { background: var(--raised); overflow: hidden; padding: 0; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  background: var(--accent); color: var(--accent-ink); border-radius: 999px;
  min-width: 22px; padding: 1px 7px; font-size: var(--t-xs); font-weight: 700; text-align: center;
}

#view-chat { flex: 1; min-height: 0; }
#chat-thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.msg {
  max-width: 78%; padding: 8px 12px; border-radius: 16px; font-size: var(--t-base);
  background: var(--raised); overflow-wrap: anywhere;
}
.bubble-row.mine .msg { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.bubble-row.theirs .msg { border-bottom-left-radius: 5px; }
.msg-at { display: block; font-size: var(--t-cap); opacity: .65; margin-top: 3px; }
#chat-form { display: flex; gap: 8px; }

.person { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.person b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.person-acts { display: flex; gap: 6px; flex-shrink: 0; }
.chip.go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
#people { width: min(460px, 94vw); }
#people-list { max-height: 46vh; overflow-y: auto; margin-top: 10px; }
#people-tabs { padding: 10px 0; background: none; border: 0; position: static; }
#people-search { margin-top: 4px; }
#snap-viewer { width: min(420px, 94vw); }
#snap-img { width: 100%; border-radius: 14px; display: block; }
#snap-viewer .muted { text-align: center; margin: 8px 0 12px; }

/* ---------- activity log ---------- */

#activity-summary { display: flex; flex-direction: column; gap: 10px; }
/* The screen names itself before anything else on it, the way a page title should. */
.page-title { margin: 4px 0 0; font-size: var(--t-hero); font-weight: 700; letter-spacing: -.02em; }
.page-date { margin: 0; font-size: var(--t-xs); color: var(--muted); }

/* The streak: how many weeks running you have trained, then the week you are in day by day.
   The teardrop is a circle with one corner squared off — no image, no icon font. */
.streak {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--r-card); padding: 14px 16px;
}
.flame {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; height: 58px; background: var(--accent); color: var(--accent-ink);
  border-radius: 50% 50% 50% 14px;
}
.flame b { font-family: var(--font-num); font-size: var(--t-lg); font-weight: 700; line-height: 1; }
.flame span { font-size: var(--t-cap); text-transform: uppercase; letter-spacing: var(--track-cap); opacity: .75; }

.sdays { display: flex; gap: 4px; flex: 1; justify-content: space-between; min-width: 0; }
.sd { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.sd-l { font-size: var(--t-cap); color: var(--muted); letter-spacing: var(--track-cap); }
.sd-n {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-family: var(--font-num); font-size: var(--t-xs); font-variant-numeric: tabular-nums;
  background: #ffffff0f; color: var(--muted);
}
.sd.done .sd-n { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
/* Today is outlined rather than filled: the ring says "you are here", the fill says "done". */
.sd.today .sd-n { background: none; box-shadow: inset 0 0 0 2px var(--accent); color: var(--text); }
.sd.today.done .sd-n { background: var(--accent); color: var(--accent-ink); }
.sd.ahead .sd-n { opacity: .45; }

/* Readings stacked down the card rather than across it: each one gets a full line, its label
   under it, and the target it is measured against off to the right. */
/* Two columns: the week's three numbers down the left, the eight weeks behind them down the
   right. The numbers never fill their line, so the chart costs no height at all. */
.readouts {
  display: flex; gap: 14px;
  background: var(--surface); border-radius: var(--r-card); padding: 18px 16px;
}
.ro-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ro { display: flex; align-items: flex-start; gap: 12px; }
.ro-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ro-main b {
  font-family: var(--font-num);
  font-size: clamp(24px, 6.4vw, 34px); font-weight: 300; line-height: 1; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ro-label { font-size: var(--t-cap); color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-cap); }
.ro-target {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-size: var(--t-xs); color: var(--muted); white-space: nowrap; text-align: right;
}
.ro-t-top { display: flex; align-items: center; }
.ro-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 2px;
  background: var(--accent); margin-right: 5px; vertical-align: middle;
}
.ro-t-val { font-family: var(--font-num); color: var(--text); font-variant-numeric: tabular-nums; }
#activity-summary .section { margin: 0; }
.stats.wide { justify-content: space-between; gap: 12px; margin: 0; }
.stats.wide div { flex: 1; align-items: flex-start; }

/* Beside the numbers, behind a rule: same card, still clearly the history rather than more of
   this week's numbers. Centred, because the chart is shorter than the column it sits in. */
.ro-chart {
  flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  border-left: 1px solid var(--line); padding-left: 14px;
}
.chart { display: flex; align-items: flex-end; gap: 6px; height: 108px; }
.bar-slot { flex: 1; height: 100%; display: flex; align-items: flex-end; }
/* Fully rounded tops and a floor under every bar, so an empty week still reads as a week rather
   than as a gap in the chart. */
.bar {
  width: 100%; border-radius: 7px; background: var(--bar-idle); min-height: 6px;
  transition: background .2s;
}
.bar.now { background: var(--accent); }

#log-form { display: flex; flex-direction: column; gap: 10px; }

/* ---- tracking ---- */
#tk-idle, #tk-live { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tk-clock {
  margin: 0; font-family: var(--font-num); font-size: var(--t-hero); font-weight: 300;
  line-height: 1; letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.tk-head .muted { margin: 4px 0 0; }
/* The one thing on the screen that says "this is still running" while your phone is in a
   pocket and the clock is not moving in view. */
.tk-rec { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
@media (prefers-reduced-motion: no-preference) { .tk-rec { animation: tk-pulse 2s ease-in-out infinite; } }
@keyframes tk-pulse { 50% { opacity: .25; } }
.tk-acts { display: flex; align-items: center; gap: 12px; }
.tk-acts .pill.primary { flex: 1; justify-content: center; }

/* The workout cards. Tinted with the accent the way Apple tints its green, so the list reads as
   a set of things you can start rather than a wall of the same grey as every other card. */
#wk-list { display: flex; flex-direction: column; gap: 12px; }
.wk {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  border-radius: var(--r-card); background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.wk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wk-go { display: flex; align-items: center; gap: 8px; }
/* The timer sits beside play because it is set in the same breath: how long, then go. An icon
   alone until it is set, then the icon and the time in the accent. */
.wk-timer {
  height: 40px; min-width: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: center;
  gap: 6px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--muted); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer;
}
.wk-timer .ico { width: 19px; height: 19px; }
.wk-timer.on { color: var(--accent); }
.wk-ico { font-size: 38px; line-height: 1; }
.wk-play {
  width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.wk-play .ico { width: 22px; height: 22px; fill: currentColor; margin-left: 2px; }
.wk-name { margin: 0; font-size: var(--t-lg); font-weight: 600; letter-spacing: -.01em; }
.wk-sub { margin: -8px 0 0; font-size: var(--t-xs); color: var(--muted); }

#tk-goal { display: flex; flex-direction: column; gap: 6px; }
.tk-goal-bar { height: 8px; border-radius: 999px; background: var(--bar-idle); overflow: hidden; }
.tk-goal-fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .4s; }
#tk-goal-txt { margin: 0; font-size: var(--t-xs); }

.tk-block { background: var(--surface); border-radius: var(--r-card); padding: 14px; }
.tk-block + .tk-block { margin-top: 10px; }
.tk-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tk-block-head b { font-size: var(--t-base); font-weight: 600; }
.tk-gear { font-size: var(--t-cap); color: var(--muted); text-transform: uppercase; letter-spacing: var(--track-cap); }
.tk-sets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tk-set {
  display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px;
  background: var(--raised); font-family: var(--font-num); font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
}
.tk-set button { border: 0; background: none; color: var(--muted); padding: 0; cursor: pointer; font-size: var(--t-xs); }
.tk-new { display: flex; gap: 8px; }
.tk-new input { flex: 1 1 60px; width: auto; }
.tk-new .pill { flex: 0 0 auto; }

/* The picker is a long list in a short sheet, so the search and the group chips stay put
   while the results move under them. */
.ex-groups { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.ex-groups .pill { flex: 0 0 auto; }
.ex-groups .pill.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
#ex-list { display: flex; flex-direction: column; }
.ex-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 11px 2px; background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.ex-row:last-child { border-bottom: 0; }
.ex-row .tk-gear { flex: 0 0 auto; }

.arow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.arow-ico { font-size: var(--t-xl); line-height: 1; }
.arow-main { flex: 1; min-width: 0; }
.arow-main .note { opacity: .8; }
.arow .vis-chip { margin: 0; flex-shrink: 0; }
#log-form .row { display: flex; gap: 8px; flex-wrap: wrap; }
#log-form select { flex: 2 1 140px; width: auto; }
#log-form .row input { flex: 1 1 90px; width: auto; }
.visibility { gap: 8px; }
.vis { flex: 1; justify-content: center; }
.vis.on[data-vis="private"] { background: var(--raised); color: var(--text); border-color: var(--accent); }
#vis-help { margin: -4px 0 0; }
#activity-log { display: flex; flex-direction: column; gap: 22px; }
.vis-chip { margin-left: 6px; }
.vis-chip.private { border-color: var(--accent); color: var(--accent); }

/* ---------- account ---------- */

#signin-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
  font-size: var(--t-sm); color: var(--muted);
}
.account { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 8px; text-align: center; }
.account h2 { margin: 0; font-size: var(--t-lg); }
.account p { margin: 0; }
.account .pill { margin-top: 14px; max-width: 260px; }
.avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--t-hero); font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
}
.stats { display: flex; gap: 26px; margin: 12px 0 4px; }
/* Five readings wrapped 4+1 and the orphan looked like a mistake. A three-column grid breaks
   them 3+2, and gives the wider values ("103 km") a column to sit in rather than a gap to fight for. */
.stats.wrap {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 10px; justify-items: center;
}
.avatar-set { position: relative; background: none; border: 0; padding: 0; cursor: pointer; }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--raised); border: 2px solid var(--bg);
  display: grid; place-items: center; font-size: var(--t-sm);
}
.avatar-set:hover .avatar-cam { border-color: var(--accent); }
.stats div { display: flex; flex-direction: column-reverse; gap: 4px; }
/* The reading is the thing on the page — big, light and widely tracked, with the label shrunk to a
   caption under it. Bold and small makes a number look like a form field; light and large makes it
   look like a readout, which is what it is. Tabular figures so columns of them line up. */
.stats dt {
  color: var(--muted); font-size: var(--t-cap); text-transform: uppercase; letter-spacing: var(--track-cap);
}
.stats dd {
  font-family: var(--font-num);
  margin: 0; font-size: var(--t-hero); font-weight: 300; line-height: 1; letter-spacing: .02em;
  font-variant-numeric: tabular-nums; color: var(--text);
  /* Every reading carries its unit inline, so none of them may wrap — a value broken over two
     lines drops its own baseline out of the row it belongs to. */
  white-space: nowrap;
}
.stats.wrap dd { font-size: clamp(20px, 6.2vw, 30px); }
/* Three readings across a phone, and ours carry their unit inline ("4h 25m", "60 km") rather than
   in a caption the way the reference does. Nowrap keeps the three baselines on one line; clamp lets
   the type give way instead of the layout. */
.stats.wide dd { font-size: clamp(22px, 7.4vw, 34px); white-space: nowrap; }

/* ---------- bottom nav ---------- */

.tabbar {
  position: sticky; bottom: 0; z-index: 900;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 56px; padding: 8px 2px 6px; font: inherit; line-height: 1;
  /* Stroked icons take `color`, so the whole tab tints at once and needs no opacity trick and no
     filled block behind it — the colour IS the state. */
  color: var(--muted);
}
.tabbar button svg { width: 23px; height: 23px; display: block; }
.tabbar button i { font-style: normal; font-size: var(--t-cap); letter-spacing: .02em; line-height: 1; }
/* No indicator dot. Once the icons took `color` the dot was saying a second time what the tint
   already says, and the heavier label covers anyone who cannot rely on the colour alone. */
.tabbar button.on { color: var(--accent); }
.tabbar button.on i { font-weight: 600; }
/* The centre button performs an action rather than switching tabs, so it is filled, never "selected". */
.tabbar button.action { opacity: 1; }
.tabbar button.action span {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--accent); font-size: var(--t-lg);
}
.tabbar button.action:hover span { filter: brightness(1.12); }
.tabbar button:hover { color: var(--text); }
.tabbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- dialogs ---------- */

dialog {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 16px; padding: 22px; width: min(380px, 92vw);
  /* Every dialog is a scroll container in its own right, rather than leaving it to whatever the
     browser happens to default to. overscroll-behavior stops a drag past the end from grabbing the
     page underneath, which is the thing that makes a sheet feel like a web page instead of an app. */
  max-height: 86dvh; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
dialog::backdrop { background: #000a; }

/* Popups rise into place instead of appearing. display and overlay have to be in the
   transition with allow-discrete, or the dialog is simply gone before the fade can run. */
dialog {
  opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity .2s ease, transform .2s ease,
    overlay .2s ease allow-discrete, display .2s ease allow-discrete;
}
dialog[open] { opacity: 1; transform: none; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(10px) scale(.98); } }

/* Only the bottom-anchored sheet slides up; above 639px it is a centred modal and takes the
   same fade as everything else. The open state has to out-rank the base rule, or it parks
   below the screen. */
@media (max-width: 639px) {
  dialog.sheet-up { transform: translateY(100%); }
  dialog.sheet-up[open] { transform: none; }
  @starting-style { dialog.sheet-up[open] { opacity: 1; transform: translateY(100%); } }
}

dialog::backdrop {
  background: #0000;
  transition: background .2s ease, overlay .2s ease allow-discrete, display .2s ease allow-discrete;
}
dialog[open]::backdrop { background: #000a; }
@starting-style { dialog[open]::backdrop { background: #0000; } }

@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition: none; }
  dialog { transform: none; }
}
dialog h2 { margin: 0 0 14px; font-size: var(--t-md); }
dialog form:not(:first-child) { display: flex; flex-direction: column; gap: 10px; }
.x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--muted); font-size: var(--t-base); cursor: pointer; }
dialog a { color: var(--accent); }
dialog .muted { margin: 12px 0 0; }

/* end-of-session summary */
#session[open] { display: flex; flex-direction: column; gap: 10px; }
#session { width: min(400px, 94vw); }
#session h2 { margin: 0; font-size: var(--t-lg); }
#session .muted { margin: 0; }
#ss-stats { display: flex; flex-wrap: wrap; gap: 16px 22px; margin: 6px 0; }
#ss-stats div { display: flex; flex-direction: column-reverse; gap: 2px; }
#ss-stats dt { color: var(--muted); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: var(--track-cap); }
#ss-stats dd { margin: 0; font-size: var(--t-lg); font-weight: 700; }
#ss-preview { border-radius: 10px; max-height: 170px; object-fit: cover; width: 100%; }
.ss-acts { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ss-acts .pill { flex: 1; justify-content: center; }
.ss-acts .linky { flex: 0; white-space: nowrap; }
#log-music { display: flex; gap: 8px; flex-wrap: wrap; }
#log-music input { flex: 1 1 100%; }
#log-attachment { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
#log-attachment .box { max-height: 200px; }

/* composer place picker */
#picker { width: min(420px, 94vw); }
#picker h2 { margin: 0 0 12px; font-size: var(--t-md); }
#picker-list {
  margin: 10px 0; max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 12px;
}
#picker-list:empty { display: none; }
.place-btn { max-width: 190px; }
.place-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* music: picked track chip, search rows, and the play button on a card */
#tunes { width: min(440px, 94vw); }
#tunes h2 { margin: 0 0 12px; font-size: var(--t-md); }
#tunes-list { margin: 10px 0; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
#tunes-list:empty { display: none; }
.track, .track-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px; background: var(--sunken);
}
.track-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.track img, .track-row img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.track-ph {
  width: 40px; height: 40px; border-radius: 8px; background: var(--raised);
  display: grid; place-items: center; font-size: var(--t-md); flex-shrink: 0;
}

/* an activity, place or list shared into a chat */
.shared {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 6px;
  background: #ffffff10; border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 10px; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.shared[disabled] { cursor: default; }
.shared:not([disabled]):hover { border-color: var(--accent); }
.shared-ico { font-size: var(--t-xl); width: 34px; text-align: center; flex-shrink: 0; }
.shared-route { width: 42px; height: 42px; flex-shrink: 0; }
.shared-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.shared-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-main .muted { font-size: var(--t-xs); }
#chat-share { flex-shrink: 0; }

.songline { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--t-sm); }
.songnote { color: var(--accent); font-size: var(--t-base); flex-shrink: 0; }
.songline .sname { color: var(--muted); }
.songline .sname a { color: var(--muted); }
.songline .sname a:hover { color: var(--accent); }
.act.mute { margin-left: auto; padding: 0 8px; min-height: 36px; }
/* first in the row, pushed left so the reactions stay on the thumb side */
.act.post-menu { margin-right: auto; letter-spacing: 1px; }
.post .box.art { aspect-ratio: 1 / 1; }
.pplay {
  flex-shrink: 0; width: 38px; height: 38px; padding: 0; justify-content: center;
  border-radius: 50%; font-size: var(--t-sm);
}
.pplay.playing { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* clip trimmer */
.trim { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.trim-bar {
  position: relative; height: 34px; border-radius: 8px; overflow: hidden;
  background: repeating-linear-gradient(90deg, var(--raised) 0 3px, transparent 3px 6px);
  border: 1px solid var(--line);
}
.trim-win {
  position: absolute; top: 0; bottom: 0; background: var(--accent-soft);
  border: 2px solid var(--accent); border-radius: 8px;
}
#trim-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.trim-read { margin: -4px 0 0; }
.trim-read b { color: var(--text); }
.trim .row { display: flex; gap: 8px; }
.trim-len { flex: 1; justify-content: center; }
input[type=range] { accent-color: var(--accent); padding: 0; }
#activity-chip .track-ph, #place-chip .track-ph, #log-place-chip .track-ph { font-size: var(--t-lg); }
#act-pop[open] { display: flex; flex-direction: column; gap: 10px; }
#act-pop { width: min(400px, 94vw); }
#act-pop h2 { margin: 0; font-size: var(--t-md); }
#act-pop .row { display: flex; gap: 8px; flex-wrap: wrap; }
#act-pop select { flex: 2 1 140px; width: auto; }
#act-pop .row input { flex: 1 1 90px; width: auto; }

/* A closed <dialog> is hidden by a user-agent rule, which ANY author rule outranks. Setting
   `display` on a dialog therefore keeps it on screen after close(). This is the backstop. */
dialog:not([open]) { display: none !important; }
#pop-list { display: flex; flex-direction: column; gap: 6px; }
#pop-list:empty { display: none; }
.poprow {
  display: flex; align-items: center; gap: 8px; font-size: var(--t-sm);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px;
}
.poprow .muted { margin-left: auto; }
#activity-chip { display: flex; flex-direction: column; gap: 6px; }
