/* Camp Constellation 2026 schedule — styles.
   Mobile-first. Colours and layout carried over from the proven production UI. */

* { box-sizing: border-box; }
/* the hidden attribute must always win, even over display:flex rules */
[hidden] { display: none !important; }

/* Handwritten accent font (headers/tabs only — body text stays system).
   Self-hosted for offline; also in the service worker CORE list. */
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/caveat-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/caveat-400.woff2') format('woff2');
}
/* Currently unreferenced (downloads nothing); kept for easy revival */
@font-face {
  font-family: 'Playpen Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/playpen-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Playpen Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/playpen-700.woff2') format('woff2');
}

/* Marker palette: icon teal/purple/orange + the paper schedule's pink/blue.
   Surface/ink tokens carry the light theme; [data-theme="dark"] overrides. */
:root {
  --day-mon: #e94f7a;
  --day-tue: #3f7fd4;
  --day-wed: #2b9aa8;
  --day-thu: #7b4fa0;
  --day-fri: #f0921e;
  --day-sat: #4d9e53;
  --day-sun: #c2519e;

  --bg: #f5f5f7;
  --surface: #fff;
  --ink: #171717;
  --ink2: #444;
  --muted: #666;
  --line: #ddd;
  --line2: #ccc;
  --ctrl: #a0a0a8;
  --frost: #f5f5f7e8;
  --inset: #f5f5f7;
  --btn-bg: #171717;
  --btn-ink: #fff;
}
[data-theme="dark"] {
  --bg: #17171b;
  --surface: #26262c;
  --ink: #ececf0;
  --ink2: #c9c9cf;
  --muted: #9a9aa2;
  --line: #3a3a40;
  --line2: #46464d;
  --ctrl: #6e6e76;
  --frost: #17171be0;
  --inset: #1f1f24;
  --btn-bg: #ececf0;
  --btn-ink: #171717;
}

/* timed floating banner (#139) */
.appbanner {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 10px; right: 10px; z-index: 80;
  display: flex; align-items: center; gap: 10px;
  background: #e94f7a; color: #fff;
  border-radius: 14px; padding: 12px 14px;
  font-weight: 700; font-size: 14px; line-height: 1.35;
  box-shadow: 0 6px 20px #0005;
  animation: banner-in .35s ease;
}
.appbanner span { flex: 1; }
.appbanner button {
  flex: none; border: 0; background: #ffffff2e; color: #fff;
  width: 28px; height: 28px; border-radius: 50%;
  font: inherit; font-size: 14px; cursor: pointer;
}
@keyframes banner-in {
  from { transform: translateY(-16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* per-day announcement link under the day header */
.daylink {
  display: inline-block; margin: 2px 0 8px;
  font-size: 14px; font-weight: 700;
  color: #2b9aa8; text-decoration: none;
}

/* past days fold up (#137): header stays, triangle discloses */
.day.collapsed:not(.search-open) > *:not(h2) { display: none; }
.day.pastday > h2 { cursor: pointer; }
.daychev {
  display: inline-block; margin-left: 9px;
  font-size: 15px; color: var(--muted);
  transform: rotate(90deg);            /* open: pointing down */
  transition: transform .2s;
}
.day.collapsed .daychev { transform: rotate(0deg); }   /* closed: pointing right */

/* navigation veil (#136): twinkling star while the next page loads */
.navveil {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(2px);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.navveil.on { opacity: 1; }
.navveil .nv {
  display: grid; place-items: center; gap: 6px;
  color: var(--muted); font-weight: 700; font-size: 14px;
}
.navveil .nvstar {
  font-size: 36px; color: #2b9aa8; line-height: 1;
  animation: nvtwinkle .9s ease-in-out infinite;
}
@keyframes nvtwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: .5; }
  50% { transform: scale(1.35) rotate(20deg); opacity: 1; }
}

/* link pill to the Yes/No/Maybe list on play-adjacent events (#135) */
.ynmlink {
  display: inline-block;
  border: 1.5px solid #2b9aa8; border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px; font-weight: 700;
  color: #2b9aa8; text-decoration: none;
  white-space: nowrap;
}

/* the schedule scrolls vertically only — clip (not hidden) so position:
   sticky day headers keep working */
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 'Avenir Next', Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
/* "Wiggly" keeps the open handwritten-page layout but speaks Avenir now —
   the base body stack — so only the accents (Caveat headers/tabs) stay
   handwritten. Playpen Sans faces above are dormant, kept for easy revival. */
/* (the old 88px FAB-clearance padding is gone — the bars occupy their
   own flow space at the end of the document now, #56) */

/* ---- header ---------------------------------------------------------- */
/* Title lives on the hero as real text (accessible, crisp); the dark
   fallback background keeps it readable if the image fails to load. */
.hero {
  position: relative;
  background: #101018;
  height: clamp(130px, 36vw, 200px);
  overflow: hidden;
}
.hero img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero h1 {
  pointer-events: none;   /* stars beneath the title stay draggable (#95) */
  position: absolute;
  left: 16px; bottom: 8px; right: 16px;
  margin: 0;
  font-size: clamp(30px, 8.6vw, 42px);
  font-family: 'Caveat', cursive;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 1px 3px #000c, 0 2px 14px #000a;
}
/* Live constellation overlay (issue #77): your met stars over the hero.
   pointer-events none — the four-star secret gesture must keep working. */
.skyov {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
/* friend stars are interactive (#90): hit targets re-enable pointer
   events; taps stop before the .hero gesture listener ever sees them */
.skyov .hsg { pointer-events: auto; cursor: pointer; touch-action: none; }
#herocard {
  max-width: 300px; width: calc(100vw - 64px); text-align: center;
  /* non-modal, JS-positioned at the tap point (#91) */
  position: fixed; margin: 0;
  z-index: 30;
  box-shadow: 0 8px 32px #0005;
}
.hcphoto {
  width: 72px; height: 72px; border-radius: 50%;
  margin: 4px auto 8px;
  border: 2px solid var(--line2);
  background: var(--inset) center/cover no-repeat;
}
#herocard h3 { margin: 0 0 2px; }
.hcmeta { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.hcnote { font-size: 14px; margin: 6px 0 10px; }
#herocard .go { margin-top: 8px; }
/* the app-wide dialog close box (#96): upper-right ✕ on every popup */
.hcx {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: var(--inset); color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
}

/* artwork-matched (issue #83): teal lines, white sparkle stars that
   really twinkle — opacity + scale shimmer, from each star's own center */
.skyov line { stroke: rgba(102, 199, 214, 0.55); stroke-width: 0.28; }
.skyov .hstar {
  fill: rgba(255, 255, 255, 0.95);
  transform-box: fill-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  .skyov .hstar {
    animation: skytw var(--td, 3s) ease-in-out var(--tdel, 0s) infinite alternate;
  }
}
@keyframes skytw {
  from { opacity: 0.35; transform: scale(0.7); }
  to   { opacity: 1;    transform: scale(1.15); }
}

header { padding: 8px 16px 4px; }
.sub { color: var(--muted); font-size: 13px; }

.maplink { color: #2b9aa8; font-weight: 700; text-decoration: none; }

/* header quick-action pills */
.headbtns { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }
.headbtns .fuzzybtn { margin: 0; }
.custombtn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid #2b9aa8;
  border-radius: 999px;
  padding: 4px 12px 5px;
  background: none;
  color: #2b9aa8;
  font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
}

/* Warm-fuzzy quick-jot button under the subtitle */
.fuzzybtn {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 6px 0 2px;
  border: 1.5px solid #e94f7a;
  border-radius: 999px;
  padding: 4px 12px 5px;
  color: #e94f7a;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
}

/* Secondary links: toggled from the subtitle's More links button (#88) */
.morelinks { margin-top: 3px; font-size: 13px; }
.morebtn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; padding: 0;
  font: inherit;
  color: #2b9aa8; font-weight: 700;
  cursor: pointer;
}
.dchev {
  display: inline-block;
  transform: rotate(90deg);
  transition: transform .15s;
  font-weight: 800;
  font-size: 11px;
}
.morebtn[aria-expanded="true"] .dchev { transform: rotate(-90deg); }
.linklist {
  padding: 4px 0 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.linklist a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  min-width: 0;
}
.lico {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, #2b9aa8 12%, transparent);
}
.p { cursor: pointer; }
/* standalone map (#98): tap-through hint */
.maphint {
  margin: 8px 16px 4px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ---- location page (tap a location tag) ------------------------------- */
.lochud {
  position: fixed; inset: 0; z-index: 9;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.lochud[hidden] { display: none; }
.lochud-bar {
  flex: none;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--frost);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.lochud-bar > span {
  flex: 1;
  font-family: 'Caveat', cursive;
  font-size: 26px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-vibe="practical"] .lochud-bar > span { font-family: inherit; font-size: 18px; font-weight: 800; }
.lochud-bar .fab-search { width: 40px; height: 40px; }
.lochud-map {
  flex: none;
  position: relative;
  height: 38vh;
  overflow: hidden;
  background: #b9cbb0;   /* map-green so letterboxing never flashes */
  border-bottom: 1px solid var(--line);
}
.lochud-map img { position: absolute; height: auto; cursor: pointer; }
.lochud-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 16px calc(24px + env(safe-area-inset-bottom));
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.lr-day {
  font-family: 'Caveat', cursive;
  font-size: 24px; font-weight: 700;
  margin: 16px 0 4px;
}
.lr-day small { font-size: 14px; color: var(--muted); font-weight: 400; }
[data-vibe="practical"] .lr-day { font-family: inherit; font-size: 17px; font-weight: 800; }
[data-vibe="practical"] .lr-day small { font-family: inherit; }
.lr {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.lr-t {
  flex: none; width: 86px;
  text-align: right;
  font-size: 13px; font-weight: 700;
  color: var(--ink2);
}
.lr-t .hang { display: inline-block; width: 0; }
.lr-title { flex: 1; font-size: 15px; }
.lr-on { flex: none; color: #2b9aa8; font-weight: 800; }
.lr-empty { color: var(--muted); padding: 18px 0; }

/* highlight ring (shared look with the old map popup) */
.maphud-ring {
  position: absolute;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;   /* center on the spot */
  border: 4px solid #e94f7a;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fff9, 0 0 18px #e94f7ac0;
  pointer-events: none;
  animation: ringpulse 1.6s ease-in-out infinite;
}
@keyframes ringpulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ---- camp map page ---------------------------------------------------- */
/* Top bars must hold still under a drag (#102). Two layers: fixed (not
   sticky) keeps them pinned in normal scroll, and touch-action:none stops
   a pan from ever STARTING on the bar — on iOS even fixed elements ride
   the rubber-band once a document pan begins, so the only winning move is
   not to pan. Taps and clicks are unaffected. */
.mapbar, .set-bar, .lochud-bar { touch-action: none; }
.mappage { padding-bottom: 0; padding-top: calc(51px + env(safe-area-inset-top)); }
.mapbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: baseline; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  line-height: 30px;   /* same bar height in both vibes */
  background: var(--frost);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  font-family: 'Caveat', cursive;
  font-size: 21px; font-weight: 700;
}
.mapbar a { color: #2b9aa8; text-decoration: none; }
.mapbar span { color: var(--ink2); }
.mapimg { display: block; width: 100%; height: auto; }

/* Small tablets and up: center the hero and title instead of stretching */
@media (min-width: 640px) {
  .hero { max-width: 760px; margin: 0 auto; border-radius: 0 0 16px 16px; }
  .hero h1 { text-align: center; }
  header { text-align: center; }
}


/* ---- change history disclosure -------------------------------------- */
/* Lives at the bottom of the page, after the schedule */
.changes {
  max-width: 760px;
  margin: 26px auto 44px;
  padding: 0 10px;
}
.changes > summary {
  list-style: none;
  cursor: pointer;
  position: relative;
  display: inline-block;
  padding: 6px 44px 4px 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
}
.changes > summary::-webkit-details-marker { display: none; }
.changes > summary:after {
  content: "\276F";
  position: absolute;
  right: 14px; top: 50%;
  font-size: 18px; font-weight: 900;
  line-height: 1;
  transform: translateY(-50%) rotate(90deg);
}
.changes[open] > summary:after { transform: translateY(-50%) rotate(-90deg); }
.history { padding: 0 0 8px; }
.release { padding: 11px 0; border-bottom: 1px solid var(--line); }
.release:last-child { border-bottom: 0; }
.release h3 { font-size: 16px; margin: 0 0 4px; }
.release .meta { font-size: 13px; color: var(--muted); }
.release ul { margin: 8px 0 0; padding-left: 20px; }
.release li { margin: 5px 0; }
.baseline { font-size: 14px; color: var(--muted); margin-top: 6px; }

/* ---- sticky day nav --------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 5;
  padding: 8px 0;
  background: var(--frost);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.days {
  display: flex; gap: 7px;
  overflow: auto;
  padding: 0 12px;
  scrollbar-width: none;
}
.days::-webkit-scrollbar { display: none; }
/* Day tabs take their day's marker color and the handwritten font */
.days button {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--dc, #ccc) 55%, var(--surface));
  border-radius: 999px;
  white-space: nowrap;
  font-family: 'Caveat', cursive;
  font-size: 19px; font-weight: 700;
  padding: 5px 12px;
  color: var(--dc, #444);
  cursor: pointer;
  transition: background .2s, color .2s;
}
/* Scroll-synced: the day under the viewport is inverted */
.days button.active {
  background: var(--dc, #444);
  border-color: var(--dc, #444);
  color: #fff;
}

/* ---- schedule body --------------------------------------------------- */
main { max-width: 760px; margin: auto; padding: 10px; }
.day { scroll-margin-top: calc(var(--bar-h, 60px) + 10px); margin-bottom: 38px; }
/* The last day fills the viewport below the bar so its header can also
   reach the sticky position when scrolled to. */
.day:last-of-type { min-height: calc(100vh - var(--bar-h, 60px) - 10px); }
@supports (height: 100dvh) {
  .day:last-of-type { min-height: calc(100dvh - var(--bar-h, 60px) - 10px); }
}
/* Pinned below the sticky .bar so the current day stays visible while
   scrolling. --bar-h is measured from the real bar height in app.js — a
   fixed offset leaves a see-through gap on phones where the bar renders
   shorter. z-index sits under the bar (5) and over the event cards. */
.day h2 {
  font-size: 31px;
  font-family: 'Caveat', cursive;
  position: sticky; top: var(--bar-h, 118px); z-index: 4;
  margin: 0 -10px;
  padding: 8px 14px 6px;
  background: var(--frost);
  backdrop-filter: blur(12px);
}
.day h2 small { font-size: 16px; color: var(--muted); font-weight: 400; font-family: 'Caveat', cursive; }
/* Android photo chooser (#119) */
.pspick { border: 0; border-radius: 14px; padding: 8px; min-width: 240px; }
.pspick button {
  display: block; width: 100%;
  border: 0; background: none;
  padding: 12px 14px;
  font: inherit; font-size: 16px;
  text-align: left; cursor: pointer;
  border-radius: 8px;
}
.pspick button:active { background: var(--inset); }
.pspick [data-c="cancel"] { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0; margin-top: 4px; }

/* opt-in schedule sharing (#116) */
.sharealso {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0 2px;
  font-size: 14px;
  color: var(--ink2);
}
.sharealso input { width: 18px; height: 18px; accent-color: #2b9aa8; }

/* guided swap (#115) */
.swapgot { font-size: 19px; font-weight: 700; color: #2b9aa8; margin: 8px 0 2px; }
#swapDone .go { margin-top: 6px; }

/* weather in the gutter (#112) */
.t .wx-uv {
  display: block;
  margin-top: 1px;
  line-height: 1;
  white-space: nowrap;
}
.t .uvsun { vertical-align: middle; }
.t .uvarrow { color: var(--muted); font-size: 11px; font-weight: 700; margin: 0 1px; vertical-align: middle; }
.t .wx {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* "you are here" (#110): the now line + happening-now accent */
.nowline {
  position: relative;
  height: 2px;
  margin: 12px 2px;
  background: #e94f7a;
  border-radius: 2px;
}
.nowline span {
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  background: #e94f7a; color: #fff;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 1px 8px 2px; border-radius: 999px;
}
.e.now-ev { box-shadow: inset 3px 0 0 #e94f7a; }
/* in whimsy's grouped slots the event body starts at the row's left edge,
   flush against the now-stripe — give it clearance (cards pad themselves) */
[data-vibe="whimsy"] .slot-list .e.now-ev .b { padding-left: 12px; }

/* prompt of the day, revealed under the day name as each day begins */
.dayprompt {
  margin: 6px 0 12px;
  padding: 9px 14px;
  border-left: 3px solid var(--dc, #2b9aa8);
  border-radius: 8px;
  background: color-mix(in srgb, var(--dc, #2b9aa8) 9%, var(--surface));
  font-size: 14.5px;
  line-height: 1.45;
}
.dayprompt b { font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 2px; }
#mon .dayprompt { --dc: var(--day-mon); } #tue .dayprompt { --dc: var(--day-tue); }
#wed .dayprompt { --dc: var(--day-wed); } #thu .dayprompt { --dc: var(--day-thu); }
#fri .dayprompt { --dc: var(--day-fri); } #sat .dayprompt { --dc: var(--day-sat); }
#sun .dayprompt { --dc: var(--day-sun); }

/* Weekday name gets a translucent highlighter swipe in its day's color,
   like the marker underlines on the original paper schedule. */
.dow {
  padding: 0 5px;
  background-image: linear-gradient(color-mix(in srgb, var(--dc, #2b9aa8) 45%, transparent),
                                    color-mix(in srgb, var(--dc, #2b9aa8) 45%, transparent));
  background-repeat: no-repeat;
  background-size: 100% 0.26em;
  background-position: 0 84%;
}
#mon .dow, .days button[data-target="mon"] { --dc: var(--day-mon); }
#tue .dow, .days button[data-target="tue"] { --dc: var(--day-tue); }
#wed .dow, .days button[data-target="wed"] { --dc: var(--day-wed); }
#thu .dow, .days button[data-target="thu"] { --dc: var(--day-thu); }
#fri .dow, .days button[data-target="fri"] { --dc: var(--day-fri); }
#sat .dow, .days button[data-target="sat"] { --dc: var(--day-sat); }
#sun .dow, .days button[data-target="sun"] { --dc: var(--day-sun); }

/* Events are handwritten lines on the page — no cards. Hierarchy comes from
   the handwriting sizes, the highlighter swipes, and whitespace. */
.e {
  position: relative;
  margin: 18px 0;
  min-height: 33px;   /* at least the +/✓ button height, so circles never crowd */
}
.e.plain { display: grid; grid-template-columns: 86px 1fr; }

.t {
  padding: 4px 10px 0 0;
  font-size: 13px; font-weight: 700;
  line-height: 1.25;
  color: var(--ink2);
  text-align: right;
}
/* zero-width so the hyphen hangs into the gutter past the right-aligned edge */
.t .hang { display: inline-block; width: 0; }

/* ---- grouped time blocks (paper-style bullets) ----------------------- */
.slot {
  display: grid; grid-template-columns: 86px 1fr;
  margin: 18px 0;
}
.slot-list .e { margin: 0 0 15px; }
.slot-list .e:last-child { margin-bottom: 0; }
.slot-list .e.plain { grid-template-columns: 1fr; }
.b { padding: 0 82px 0 0; }
/* Titles sit a weight below the times, like relaxed vs. pressed handwriting */
.b b {
  font-size: 16px; font-weight: 400;
  line-height: 1.3;
}

/* Location names: handwriting on a highlighter swipe, like "@dining hall".
   Flows inline after the title; wraps to its own line only when cramped. */
.p {
  display: inline-block;
  margin: 2px 6px 2px 4px;
  padding: 0 7px 1px;
  font-size: 12px; font-weight: 400;
  border-radius: 4px 9px 5px 10px;
  transform: rotate(-1.2deg);
  vertical-align: 1px;
  color: #171717;   /* pill colors are shared across themes; keep ink dark */
}
.f { display: none; }

/* the user's own events */
.minetag {
  display: inline-block;
  border: 1.5px dashed var(--ctrl);
  border-radius: 999px;
  padding: 0 7px 1px;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  vertical-align: 1px;
}
[data-vibe="practical"] .day > .e.custom { border-style: dashed; }
.add.edit { font-size: 15px; }

/* titles are plain in both vibes — the info pill is the only toggle (#140) */
/* Practical ("Zippy"): the classic card layout from the original proven UI
   (13a2a97, pre-whimsy). White bordered cards, an 86px time column behind
   a divider rule, bold titles, straight pill tags, plain system chrome.
   CSS-only: today's DOM, features, and dark-theme tokens throughout. */
[data-vibe="practical"] body {
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));  /* clear the FABs */
}

/* cards */
[data-vibe="practical"] .day > .e,
[data-vibe="practical"] .day > .slot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  margin: 8px 0;
  padding: 0;
}
[data-vibe="practical"] .day > .e.plain,
[data-vibe="practical"] .day > .slot { grid-template-columns: 86px 1fr; }
[data-vibe="practical"] .day > .e > .t,
[data-vibe="practical"] .day > .slot > .t {
  border-right: 1px solid var(--line);
  padding: 12px 10px 12px 0;
  font-size: 14px;
}
[data-vibe="practical"] .b { padding: 11px 82px 11px 12px; }
[data-vibe="practical"] .b b { font-size: 16px; font-weight: 700; }
/* several events sharing one card: hairline rules between them */
[data-vibe="practical"] .slot-list .e { margin: 0; }
[data-vibe="practical"] .slot-list .e + .e {
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
/* buttons/chips sit on the first text line inside the padded card */
[data-vibe="practical"] .e > .add { top: 7px; }
[data-vibe="practical"] .e > .fchip { top: 10px; }

/* location tags: straight outlined pills, classic style */
[data-vibe="practical"] .p {
  margin: 6px 6px 0 0;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid #0002;
  font-weight: 700;
  transform: none;
  vertical-align: 0;
}

/* day headers: plain system type, no highlighter swipe */
[data-vibe="practical"] .day h2 {
  font-family: inherit;
  font-size: 23px;
  padding: 10px 14px 8px;
}
[data-vibe="practical"] .day h2 small { font-family: inherit; font-size: 15px; }
[data-vibe="practical"] .dow { background-image: none; padding: 0; }

/* day tabs: white pills; the active day inverts to ink */
[data-vibe="practical"] .days button {
  font-family: inherit;
  font-size: 15px; font-weight: 400;
  padding: 8px 12px;
  color: var(--ink);
  border-color: var(--line2);
}
[data-vibe="practical"] .days button.active {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
  font-weight: 700;
}

/* display type goes sans too — sized down, since Caveat's script runs
   visually smaller than sans at the same px */
[data-vibe="practical"] .hero h1 {
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(24px, 6.6vw, 33px);
}
[data-vibe="practical"] .mapbar { font-family: inherit; font-size: 16px; }
[data-vibe="practical"] .sp-name { font-family: inherit; font-size: 14.5px; }
[data-vibe="practical"] .set-bar span { font-family: inherit; font-size: 19px; font-weight: 800; }
/* full-page views lead with a back button, not a close box (#103) */
.barback {
  border: 0; background: none; padding: 0;
  color: #2b9aa8; cursor: pointer;
  font-family: 'Caveat', cursive;
  font-size: 22px; font-weight: 700;
}
[data-vibe="practical"] .barback { font-family: inherit; font-size: 15px; font-weight: 800; }
[data-vibe="practical"] #sharesheet h2,
[data-vibe="practical"] #customsheet h2,
[data-vibe="practical"] #addsheet h2,
[data-vibe="practical"] #installhint h2,
[data-vibe="practical"] #useapp h2,
[data-vibe="practical"] #onboard h2 {
  font-family: inherit;
  font-size: 20px; font-weight: 800;
}

/* The Description disclosure pill shows in BOTH vibes (Jessie's nice
   mechanism, adopted by Viona too); Viona's dotted title stays as a
   second way in, both drive the same panel. */
.descbtn {
  display: inline-flex; align-items: center; gap: 5px;
  width: max-content;
  max-width: calc(100vw - 130px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px; margin: 6px 0 0;
  font: inherit; font-size: 12px; font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
[data-vibe="practical"] .d {
  margin: 11px -82px -11px -12px;   /* bleed to the card edges */
  padding: 12px 15px;
  border-left: 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.descbtn[aria-expanded="true"] .dchev { transform: rotate(-90deg); }
/* Description sits inset under the entry, one level down the hierarchy */
.d {
  margin: 4px 0 4px 4px;
  padding: 2px 12px 2px 12px;
  border-left: 2px solid var(--line2);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink2);
}

/* ---- my-schedule add button ------------------------------------------ */
.add {
  position: absolute;
  right: 8px;
  top: -5px;   /* centers the 31px circle on the first text line */
  z-index: 3;
  width: 31px; height: 31px;
  border: 2px solid var(--ctrl); border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: 21px; font-weight: 700; line-height: 1;
  display: grid; place-items: center;
  padding: 0;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.add.on { background: #2b9aa8; border-color: #2b9aa8; color: #fff; }
.add.pop { animation: pop .28s ease; }  /* applied only on tap, not initial paint */
@keyframes pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28) rotate(8deg); }
  100% { transform: scale(1); }
}

/* ---- filter states --------------------------------------------------- */
.hide { display: none !important; }
/* My Schedule choreography: leavers fade, returners ease in */
.fadeout { opacity: 0 !important; transition: opacity .18s ease; }
.preborn { opacity: 0 !important; }
.fadein { animation: rowfade .3s ease; }
@keyframes rowfade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.empty { display: none; padding: 20px; text-align: center; color: var(--muted); }
.empty.show { display: block; }

/* ---- location colours ------------------------------------------------ */
.campfire { background: #f3dfc7; }
.lacasa   { background: #b5a6db; }
.outside  { background: #acd29b; }
.rech     { background: #ef9999; }
.chill    { background: #bd7ca5; }
.dining   { background: #f4ab5c; }  /* orange, matching the paper's highlighter */
.tent     { background: #f3cc43; }
.dungeon  { background: #d32919; color: #fff; }
.water    { background: #9fbff0; }
.stoner   { background: #75a6ad; }
.various  { background: #55c2ca; }
.other    { background: #eee; }

/* ---- bottom floating actions ----------------------------------------- */
/* #56: the bars are position:fixed, but their `top` is written by
   placeBars() in app.js from the visualViewport API — in the installed
   PWA, WebKit's layout viewport (what CSS sticky/fixed/bottom anchor to)
   goes stale and strands anything anchored the pure-CSS way. Start them
   offscreen until first placement. */
.fabs, .searchbar {
  position: fixed;
  top: -200px;
  left: 0; right: 0;
  z-index: 6;
  display: flex; align-items: center; gap: 10px;
  width: fit-content;
  max-width: calc(100vw - 20px);
  margin: 0 auto;
}
/* the bars no longer occupy flow space at the end of the page */
body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.searchbar { width: min(92vw, 560px); }
.searchbar[hidden], .fabs[hidden] { display: none; }
.fab {
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: 999px;
  box-shadow: 0 5px 16px #0004;
  cursor: pointer;
  color: var(--ink2);
}
/* ---- schedules panel --------------------------------------------------- */
.fabs { align-items: flex-end; }
.schedpanel { padding: 0; overflow: hidden; cursor: default; border-radius: 24px; }
.sp-name { font-family: 'Caveat', cursive; font-size: 20px; font-weight: 700; }
/* the solo title is itself a focus toggle, indistinguishable from the label */
.sp-namebtn { background: none; border: 0; padding: 0; margin: 0; color: inherit; cursor: pointer; text-align: left; }
.sp-solo-row {
  display: flex; align-items: center; gap: 9px;
  height: 52px;                 /* exactly the search FAB's height */
  padding: 0 10px 0 16px;
  /* fixed-position ancestors collapse flex rows to min-content — never
     let "My Schedule" break between words */
  white-space: nowrap;
}
.sp-solo .sp-name { flex: none; }
/* bottom "+ Add Friend" row in the solo and expanded states */
.sp-addbtn {
  display: block; width: 100%;
  border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink2);
  font: inherit; font-size: 13.5px; font-weight: 700;
  text-align: center;
  padding: 9px 14px 10px;
  white-space: nowrap;
  cursor: pointer;
}
.sp-dot { width: 9px; height: 9px; border-radius: 50%; background: #2b9aa8; }
/* pick added/removed: the "me" indicator pulses to show the schedule changed */
@keyframes me-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.45); }
  70%  { transform: scale(.92); }
  100% { transform: scale(1); }
}
.pulse { animation: me-pulse .55s ease; }
.sp-icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--bg); color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-size: 13px; font-weight: 700;
}
.sp-icon .brk { opacity: .35; }
.sp-icon.on { color: #2b9aa8; }
.sp-icon.on .brk { opacity: 1; }
.sp-icon[data-act="vis"].on { color: var(--ink2); }
.sp-collapsed {
  display: flex; align-items: center; gap: 10px;
  height: 52px;                 /* exactly the search FAB's height */
  background: none; border: 0; padding: 0 14px 0 16px;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
/* title + pills on ONE row so the panel stays FAB-height; pills compress
   (ellipsizing) rather than wrapping — fixed-position containers collapse
   wrap-enabled flexes to min-content */
.sp-collapsed > span:first-child {
  display: flex; align-items: center; gap: 7px;
  flex-wrap: nowrap;
  min-width: 0;
}
.sp-pills { display: contents; }
.sp-pill {
  font-size: 11.5px; font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--fc, var(--ctrl));
  color: var(--fc, var(--ctrl));
  white-space: nowrap;
  max-width: 74px;
  min-width: 30px;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp-pill.me { --fc: #2b9aa8; font-weight: 800; }
/* the name clips inside its own span (issue #85), so the focused pill's
   overflow:visible (needed for the corner brackets) can't let it spill */
.sp-pill .sp-nm {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sp-pill.me.on {
  background: #2b9aa8; color: #fff;
  position: relative;
  margin: 0 5px;   /* room for the corner brackets */
  overflow: visible;
}
.sp-pill.me svg { vertical-align: -2px; margin-right: 2px; }
/* viewfinder corners on the focused pill, echoing the focus icon */
.spc {
  position: absolute;
  width: 6px; height: 6px;
  border: 2px solid #2b9aa8;
}
.spc.tl { top: -4px; left: -5px; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.spc.tr { top: -4px; right: -5px; border-left: 0; border-bottom: 0; border-top-right-radius: 4px; }
.spc.bl { bottom: -4px; left: -5px; border-right: 0; border-top: 0; border-bottom-left-radius: 4px; }
.spc.br { bottom: -4px; right: -5px; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }
.sp-pill.off { opacity: .45; }
.sp-chev {
  display: inline-block;
  transform: rotate(-90deg);   /* points up: tap to expand */
  transition: transform .15s;
  font-weight: 800; font-size: 12px;
  color: var(--muted);
}
.sp-chev.open { transform: rotate(90deg); }
.sp-expanded { min-width: 272px; animation: sp-fade .22s ease; }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
.sp-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: none; border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 16px 9px;
  font: inherit; font-size: 12px; font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
  cursor: pointer;
}
.sp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px 9px 14px;
}
.sp-row + .sp-row { border-top: 1px solid var(--line); }
.sp-avatar {
  width: 32px; height: 32px; flex: none;
  border: 0; padding: 0;
  border-radius: 50%;
  background: var(--fc, var(--ctrl)); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
button.sp-avatar { cursor: pointer; }
.sp-rename {
  width: 100%;
  border: 0; border-bottom: 2px solid #2b9aa8;
  background: none; color: var(--ink);
  font: inherit; font-size: 16px;   /* ≥16px: no iOS focus-zoom */
  padding: 0 0 2px;
  outline: none;
}
.sp-rowname { flex: 1; font-size: 14.5px; font-weight: 600; }
.sp-rowname small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
/* the user's own row (always topmost) reads a shade bolder than friends */
.merow .sp-rowname { font-weight: 800; }
.fab-search {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 700;
  padding: 0;
}
.searchwrap { position: relative; flex: 1; }
#q {
  width: 100%;
  padding: 13px 40px 13px 14px;
  border: 1px solid var(--line2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 5px 16px #0004;
  /* 16px minimum: below that, focusing an input makes iOS auto-zoom the
     page — and it stays zoomed after the field closes */
  font: inherit; font-size: 16px;
}
#q::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.qclear {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border: 2px solid var(--ctrl); border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 700; line-height: 1;
  display: none; place-items: center;
  padding: 0;
  cursor: pointer;
}
.qclear.show { display: grid; }

/* ---- onboarding dialog ------------------------------------------------ */
#onboard {
  border: 0;
  border-radius: 18px;
  padding: 22px 20px 18px;
  width: min(88vw, 380px);
  box-shadow: 0 12px 40px #0005;
  background: var(--surface);
  color: var(--ink);
}
#onboard::backdrop { background: #0007; backdrop-filter: blur(2px); }
#onboard h2 {
  margin: 0 0 12px;
  font-family: 'Caveat', cursive;
  font-size: 31px; font-weight: 700;
}
#onboard p { margin: 10px 0; font-size: 14px; }
#onboard .fine { font-size: 12.5px; color: var(--muted); }
#onboard .go, #sharesheet .go, #addsheet .go, #customsheet .go {
  margin-top: 8px;
  width: 100%;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink);
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 12px;
  cursor: pointer;
}
/* Looping demo of adding an activity: the + pops into a teal check */
.demo {
  background: var(--inset);
  border-radius: 12px;
  padding: 12px 14px;
}
.demo-row { display: flex; align-items: center; gap: 10px; }
.demo-time { font-size: 13px; font-weight: 700; color: var(--ink2); }
.demo-title { flex: 1; font-size: 15px; }
.demo-add {
  position: relative;
  width: 31px; height: 31px; flex: none;
  border: 2px solid var(--ctrl); border-radius: 50%;
  animation: demo-ring 3.2s infinite;
}
.demo-add .plus, .demo-add .check {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; line-height: 1;
}
.demo-add .plus  { color: #777; animation: demo-plus 3.2s infinite; }
.demo-add .check { color: #fff; opacity: 0; animation: demo-check 3.2s infinite; }
@keyframes demo-ring {
  0%, 34%  { border-color: #a0a0a8; background: transparent; transform: scale(1); }
  40%      { transform: scale(1.28) rotate(8deg); }
  46%, 88% { border-color: #2b9aa8; background: #2b9aa8; transform: scale(1); }
  100%     { border-color: #a0a0a8; background: transparent; }
}
@keyframes demo-plus  { 0%, 34% { opacity: 1; } 44%, 92% { opacity: 0; } 100% { opacity: 1; } }
@keyframes demo-check { 0%, 38% { opacity: 0; } 46%, 88% { opacity: 1; } 96%, 100% { opacity: 0; } }

/* ---- schedule sharing -------------------------------------------------- */
#sharesheet, #addsheet, #customsheet {
  border: 0;
  border-radius: 18px;
  padding: 20px 20px 14px;
  width: min(88vw, 380px);
  box-shadow: 0 12px 40px #0005;
  background: var(--surface);
  color: var(--ink);
}
#sharesheet::backdrop, #addsheet::backdrop, #customsheet::backdrop { background: #0007; backdrop-filter: blur(2px); }
#sharesheet h2, #addsheet h2, #customsheet h2 {
  margin: 0 0 10px;
  font-family: 'Caveat', cursive;
  font-size: 29px; font-weight: 700;
}
#sharesheet h3 { margin: 0 0 6px; font-size: 14px; }
#sharesheet .fine, #addsheet .fine, #customsheet .fine { font-size: 12.5px; color: var(--muted); margin: 10px 0; }
.sharename {
  display: block;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
}
.sharename input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid var(--line2); border-radius: 10px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400;   /* ≥16px: no iOS focus-zoom */
}
.qrbox {
  /* white pad regardless of theme so cameras scan it reliably */
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  width: min(64vw, 230px);
  margin: 12px auto 0;
}
.qrbox svg { display: block; width: 100%; height: auto; }
/* avatar photos (issue #81): stored photo replaces the panel initial */
.sp-avatar.haspic {
  background-size: cover;
  background-position: center;
  color: transparent;
}

/* your own photo (issue #80): circle button in share sheet + settings */
.namerow { display: flex; align-items: flex-end; gap: 10px; }
.namerow .sharename { flex: 1; min-width: 0; }
.mephoto {
  flex: none;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px dashed #bbb;
  background: none center/cover no-repeat;
  color: #888;
  padding: 0;
  display: grid; place-items: center;
}
.mephoto.has { border-style: solid; color: transparent; }
.merow { display: flex; align-items: center; gap: 12px; }
.merow .mephoto { width: 56px; height: 56px; }

/* no-name gate (issue #78): placeholder where the QR will appear */
.qrgate {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  border: 2px dashed #bbb;
  border-radius: 8px;
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}
#sharesheet .go.alt, #addsheet .go.alt, #customsheet .go.alt, #installhint .go.alt, #useapp .go.alt, .movectl .go.alt {
  background: none;
  border: 1.5px solid #2b9aa8;
  color: #2b9aa8;
  margin-top: 4px;
  padding: 10px;
  font-size: 14px;
}

/* ---- in-dialog QR scan viewport (add-a-friend, issue #54) ------------- */
/* Sits where the share sheet's QR pad sits; a tap starts the camera. */
.scanbox {
  display: block;
  width: min(64vw, 230px);
  aspect-ratio: 1;
  margin: 12px auto 0;
  padding: 0;
  border: 2px dashed var(--line2);
  border-radius: 12px;
  background: var(--inset);
  color: var(--muted);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
}
.scanbox video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanph {
  height: 100%;
  display: grid; place-items: center; align-content: center; gap: 8px;
  padding: 14px;
  font-size: 13px;
}
.scanph b { font-size: 13.5px; }
.scanph small { font-size: 11.5px; }

/* ---- Safari → app handoff banner -------------------------------------- */
.pwahint {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 10px; right: 10px;
  z-index: 8;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--ink2);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12.5px;
  box-shadow: 0 6px 20px #0005;
}
.pwahint button {
  flex: none;
  background: var(--btn-bg); color: var(--btn-ink);
  border: 0; border-radius: 999px;
  padding: 7px 12px;
  font: inherit; font-size: 12.5px; font-weight: 700;
  cursor: pointer;
}
.pwahint #pwahintClose, .pwahint #pastehintClose, .pwahint #moveinClose {
  background: none; color: var(--muted);
  padding: 4px;
}

.cfield {
  display: block;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  margin-top: 10px;
}
.cfield .copt { font-weight: 400; }
.cfield input, .cfield textarea, .cfield select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid var(--line2); border-radius: 10px;
  background: var(--bg); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 400;   /* ≥16px: no iOS focus-zoom */
}
.cfield textarea { min-height: 56px; resize: vertical; }
/* two time fields share the row; minmax(0,…) keeps iOS's intrinsically
   wide time inputs from blowing past the dialog edge */
.combo { position: relative; }
.combo input { padding-right: 42px; }
.cbtn {
  position: absolute; right: 6px; bottom: 5px;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: none; color: var(--muted);
  font-size: 13px; font-weight: 800;
  cursor: pointer;
}
.cbtn span { display: inline-block; transform: rotate(90deg); transition: transform .15s; }
.cbtn[aria-expanded="true"] span { transform: rotate(-90deg); }
.cpanel {
  position: absolute; left: 0; right: 0; top: 100%;
  z-index: 5;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--line2); border-radius: 10px;
  box-shadow: 0 8px 24px #0004;
  max-height: 220px; overflow-y: auto;
}
.cpanel button {
  display: block; width: 100%;
  background: none; border: 0;
  padding: 10px 12px;
  font: inherit; font-size: 15px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.cpanel button + button { border-top: 1px solid var(--line); }

.crow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.crow .cfield { min-width: 0; }
.cfield input[type="time"] {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  /* explicit height: an EMPTY iOS time input otherwise collapses to a
     short pill next to its filled twin */
  height: 44px;
}
.cfield input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}

.sharecancel {
  margin-top: 10px;
  width: 100%;
  background: none; border: 0;
  font: inherit; font-size: 14px; font-weight: 700;
  color: var(--muted);
  padding: 8px;
  cursor: pointer;
}

/* friend chips on events (one color per visible friend, stacked) */
.fchip {
  position: absolute;
  top: -3px;   /* centered on the first text line, like the add button */
  width: 27px; height: 27px;
  border-radius: 50%;
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg);
  pointer-events: none;
}

/* ---- pull to refresh --------------------------------------------------- */
.ptr {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  z-index: 8;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 5px 16px #0004;
  white-space: nowrap;
}
.ptr.armed { color: #2b9aa8; border-color: #2b9aa8; }

/* ---- build info -------------------------------------------------------- */
.buildinfo {
  max-width: 760px;
  margin: 0 auto 10px;
  padding: 0 10px;
  font-size: 11.5px;
  color: var(--muted);
}
.toast {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  background: var(--btn-bg); color: var(--btn-ink);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 10;
  box-shadow: 0 6px 20px #0006;
  white-space: nowrap;
  animation: toastfade 2.6s forwards;
}
@keyframes toastfade {
  0%        { opacity: 0; transform: translate(-50%, -10px); }
  12%, 78%  { opacity: 1; transform: translate(-50%, 0); }
  100%      { opacity: 0; transform: translate(-50%, -6px); }
}

/* ---- header gear + settings subpage ----------------------------------- */
.headrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.gear {
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line2); border-radius: 50%;
  background: var(--surface); color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  padding: 0;
}
.settingshud {
  position: fixed; inset: 0; z-index: 9;
  background: var(--bg);
  overflow-y: auto;
}
.set-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: var(--frost);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.set-bar span {
  font-family: 'Caveat', cursive;
  font-size: 26px; font-weight: 700;
}
.set-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px calc(30px + env(safe-area-inset-bottom));
}
.set-body .themectl { max-width: none; margin: 0 0 16px; padding: 0; }
.set-body .changes { max-width: none; margin: 22px 0; padding: 0; }
.set-body .buildinfo { max-width: none; margin: 26px 0 0; padding: 0; }

/* ---- install-nudge dialogs (#51) -------------------------------------- */
#installhint, #useapp {
  border: 0;
  border-radius: 18px;
  padding: 22px 20px 16px;
  width: min(88vw, 380px);
  box-shadow: 0 12px 40px #0005;
  background: var(--surface);
  color: var(--ink);
}
#installhint::backdrop, #useapp::backdrop { background: #0007; backdrop-filter: blur(2px); }
#installhint h2, #useapp h2 {
  margin: 0 0 10px;
  font-family: 'Caveat', cursive;
  font-size: 29px; font-weight: 700;
}
#installhint p, #useapp p { margin: 8px 0; font-size: 14px; }
#installhint .fine { font-size: 12px; color: var(--muted); margin-top: 10px; }
#installhint .go, #useapp .go {
  margin-top: 10px; width: 100%;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink);
  font: inherit; font-size: 15px; font-weight: 700;
  padding: 12px; cursor: pointer;
}
.installsteps {
  margin: 10px 0 0 1.2em;
  font-size: 14px; line-height: 1.7;
}
.installsteps svg { vertical-align: -2px; }
/* carry-your-schedule step, shown only when local picks/friends exist */
.movestep {
  background: var(--inset);
  border-radius: 12px;
  padding: 4px 12px 12px;
  margin: 10px 0 4px;
}
.movestep p { font-size: 13px; }
.movestep .go { margin-top: 2px; width: 100%; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; }

/* settings: move-devices section */
.movectl { margin: 22px 0 16px; font-size: 13px; color: var(--muted); }
.movectl > span { font-weight: 700; }
.movectl .fine { margin: 6px 0 8px; font-size: 12.5px; }
.movectl .go {
  display: block; width: 100%;
  border-radius: 999px;
  font: inherit; font-weight: 700;
  cursor: pointer;
}
.movectl a.go { text-align: center; text-decoration: none; }
/* tiny circled "?" linking a settings control to its help section */
.helplink {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line2); border-radius: 50%;
  font-size: 13px; font-weight: 700;
  text-decoration: none;
}

/* ---- appearance control ----------------------------------------------- */
.themectl {
  max-width: 760px;
  margin: 0 auto 10px;
  padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.themectl button {
  background: var(--surface);
  border: 1px solid var(--line2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.themectl button.on {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-ink);
}
