/* Everywhile app styles. Every color, size and radius comes from tokens.css (--ew-*); see build-spec/README.md.
   Instrument Sans ships here at 400 and 700 only (the container that built Beta 1 couldn't download 500/600);
   600 renders as 700 until those files are added. */

@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/fonts/InstrumentSans-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 400 var(--ew-t-body)/1.3 var(--ew-font);
  color: var(--ew-ink);
  background: var(--ew-ground) var(--ew-texture);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation; /* no double-tap zoom */
}
button { font: inherit; color: inherit; }
.tnum { font-variant-numeric: tabular-nums; }
.caps { font-size: var(--ew-t-caps); font-weight: 600; text-transform: uppercase; letter-spacing: var(--ew-caps-tracking); color: var(--ew-ink-2); }
:focus-visible { outline: 2px solid var(--ew-accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- app frame ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: calc(env(safe-area-inset-top) + var(--ew-top-clear)); background: var(--ew-ground) var(--ew-texture); }
/* iOS draws a soft fade under the status bar; the top bar starts below it. */
:root { --ew-top-clear: 6px; }
.boot { margin: auto; color: var(--ew-ink-2); }

/* ---------- top bar ---------- */
.topbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px var(--ew-gutter) 10px; min-height: 52px; }
.avatar {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: var(--c); color: var(--ew-on-accent); font-weight: 700; font-size: 15px; display: grid; place-items: center;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; cursor: default; }
.avatar.preview::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px dashed var(--ew-ink-2); }
.titleblock { flex: 1; min-width: 0; }
.title { font-size: var(--ew-t-title); line-height: 1.05; font-weight: 600; letter-spacing: var(--ew-title-tracking); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtitle { margin-top: 3px; }
.views-btn {
  flex: none; height: 34px; min-width: 44px; padding: 0 12px; border-radius: 17px; background: var(--ew-raised); border: 1px solid var(--ew-edge);
  display: grid; place-items: center; cursor: pointer;
}
.views-btn svg { width: 18px; height: 18px; }
/* something is hidden by the Show filters: a dot, so a hidden layer is never forgotten */
.views-btn { position: relative; }
.views-btn.filtered::after { content: ""; position: absolute; top: 3px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ew-state-ask); box-shadow: 0 0 0 1.5px var(--ew-raised); }
.no-custody .custody, .no-custody .custody-hit, .no-custody .mcustody { display: none; }
.refade { animation: refade var(--ew-dur-glide) var(--ew-ease); }
@keyframes refade { from { opacity: .4; } }
/* test site only: says TEST beside the views button */
.test-chip {
  flex: none; padding: 3px 7px; border-radius: var(--ew-r-chip); background: var(--ew-state-ask-fill); color: var(--ew-on-accent);
  font-size: var(--ew-t-caps); font-weight: 700; letter-spacing: var(--ew-caps-tracking); line-height: 1.2;
}
.preview-banner {
  flex: none; margin: 0 var(--ew-gutter) 8px; padding: 7px 10px; border-radius: var(--ew-r-card); background: var(--ew-surface);
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
}
.preview-banner svg { width: 16px; height: 16px; flex: none; }
.preview-banner button { margin-left: auto; border: 0; background: none; color: var(--ew-accent); font-weight: 700; cursor: pointer; padding: 4px; }

/* ---------- main split ---------- */
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }

/* ---------- timeline ---------- */
.timeline { flex: none; position: relative; background: var(--ew-timeline); display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.tl-head { flex: none; display: flex; height: 38px; }
.tl-corner { flex: none; width: var(--ew-lane-label-w); }
.tl-days { position: relative; flex: 1; overflow: hidden; }
.tl-day { position: absolute; top: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; }
.tl-day .wd { font-size: var(--ew-t-day); font-weight: 600; letter-spacing: var(--ew-caps-tracking); color: var(--ew-ink-2); text-transform: uppercase; }
.tl-day .dn { font-size: 14px; font-weight: 600; line-height: 22px; width: 22px; height: 22px; text-align: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.tl-day.today .dn { background: var(--ew-accent); color: var(--ew-on-accent); font-size: 13px; }
.tl-day.compact { flex-direction: row; align-items: flex-end; justify-content: flex-start; padding: 0 0 6px 3px; }
.tl-day.compact .dn { font-size: 11px; width: auto; height: auto; line-height: 1; border-radius: 0; color: var(--ew-ink-2); }
.tl-day.compact.today .dn { background: none; color: var(--ew-accent); }
.tl-slide { position: absolute; inset: 0; will-change: transform; }
.tl-month.pin { z-index: 1; background: linear-gradient(90deg, var(--ew-timeline) 80%, transparent); padding-right: 10px; }
.tl-month { position: absolute; top: 4px; font-size: var(--ew-t-caps); font-weight: 700; letter-spacing: var(--ew-caps-tracking); text-transform: uppercase; color: var(--ew-ink); white-space: nowrap; padding-left: 3px; }
.tl-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: none; }
.tl-body::-webkit-scrollbar { display: none; }
.tl-grid { position: absolute; top: 0; bottom: 0; left: var(--ew-lane-label-w); right: 0; pointer-events: none; overflow: hidden; }
.tl-grid .gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ew-line); opacity: .7; }
.tl-grid .gl.wk { opacity: 1; }
.tl-grid .todaycol { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ew-accent) 7%, transparent); }
.tl-grid .nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ew-accent); opacity: .7; }
.lane { position: relative; display: flex; height: var(--ew-lane-h); margin-bottom: var(--ew-lane-gap); transition: height var(--ew-dur-glide) var(--ew-ease); }
.lane.mine { background: var(--ew-mine-lane); }
.lane-label { flex: none; width: var(--ew-lane-label-w); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; z-index: 2; }
.lane-name { font-size: var(--ew-t-day); font-weight: 600; color: var(--ew-ink-2); max-width: calc(var(--ew-lane-label-w) - 4px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane.short .lane-name { display: none; }
.lane-more { position: absolute; right: 4px; bottom: 6px; z-index: 1; font-size: var(--ew-t-day); font-weight: 700; color: var(--ew-ink-2); background: var(--ew-timeline); border-radius: var(--ew-r-event); padding: 0 4px; pointer-events: none; }
.lane-track { position: relative; flex: 1; overflow: hidden; }
.ev {
  position: absolute; height: var(--ew-event-h); border-radius: var(--ew-r-event); padding: 0 5px; display: flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, var(--c) var(--ew-event-fill-mix), var(--ew-surface));
  color: color-mix(in srgb, var(--c) var(--ew-event-ink-mix), var(--ew-ink));
  font-size: var(--ew-t-event); font-weight: 600; line-height: 1.05; overflow: hidden; cursor: pointer; border: 0; text-align: left;
}
.ev .lbl { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: normal; /* words are never split mid-word */ }
.ev { transition: top var(--ew-dur-glide) var(--ew-ease), height var(--ew-dur-glide) var(--ew-ease), opacity var(--ew-dur-glide) var(--ew-ease); animation: ev-in var(--ew-dur-glide) var(--ew-ease); }
@keyframes ev-in { from { opacity: 0; } }
.ev.off { opacity: 0; pointer-events: none; }
.ev.slim { padding: 0; }
.ev.slim.point::before { width: 6px; height: 6px; }
.ev.tall .lbl { white-space: normal; }
.ev:not(.tall) .lbl { -webkit-line-clamp: 1; white-space: nowrap; text-overflow: ellipsis; display: block; }
.ev.point { background: none; padding-left: 0; }
.ev.stub { background: none; box-shadow: none; padding-left: calc(var(--bw) + 5px); }
.ev.stub::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--bw); border-radius: var(--ew-r-event); background: color-mix(in srgb, var(--c) var(--ew-event-fill-mix), var(--ew-surface)); }
.ev.stub.busy::before { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--ew-surface)) 0 5px, color-mix(in srgb, var(--c) 10%, var(--ew-surface)) 5px 10px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent); }
.ev.point::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ev.busy {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--ew-surface)) 0 5px, color-mix(in srgb, var(--c) 10%, var(--ew-surface)) 5px 10px);
  color: color-mix(in srgb, var(--c) 60%, var(--ew-ink)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent);
}
.ev.school { --c: var(--ew-ink-2); background: color-mix(in srgb, var(--ew-ink) 9%, var(--ew-surface)); color: var(--ew-ink-2); }
.ev.est { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); background-image: none; }
.ev.stub.busy, .ev.point.busy { background: none; box-shadow: none; }
.ev.est.busy { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--ew-surface)) 0 5px, color-mix(in srgb, var(--c) 10%, var(--ew-surface)) 5px 10px); }
.past { opacity: .5; filter: saturate(.4); }
.custody { position: absolute; left: 0; right: 0; bottom: 5px; height: var(--ew-custody-line); pointer-events: none; }
.custody .seg { position: absolute; top: 0; height: 100%; border-radius: 3px; background: var(--c); }
.custody .seg.other { opacity: .3; }
.custody .diamond {
  position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; transform: rotate(45deg);
  background: var(--ew-timeline); border: 2px solid var(--ew-ink); border-radius: 1.5px;
}
.custody .badge-draft { position: absolute; bottom: 9px; }
/* nights in a stretch, on the custody line in the stretch's color (timeline and month alike) */
.nights {
  position: absolute; top: 50%; height: 16px; margin-top: -8px; min-width: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 8px;
  background: var(--c); color: var(--ew-on-accent); font-size: var(--ew-t-day); font-weight: 700; line-height: 16px; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px var(--ew-timeline); white-space: nowrap;
}
.mline .nights { height: 13px; margin-top: -6.5px; min-width: 13px; padding: 0 3px; border-radius: 6.5px; font-size: var(--ew-t-badge); line-height: 13px; box-shadow: 0 0 0 1.5px var(--ew-ground); }
.mline .nights.before { transform: translateX(-100%); }
.custody-hit { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; cursor: pointer; }
.lane-empty { position: absolute; inset: 0; display: flex; align-items: center; padding-left: 8px; font-size: 12px; color: var(--ew-ink-2); pointer-events: none; }

/* ---------- status badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 3px; height: 15px; padding: 0 6px 0 4px; border-radius: 8px;
  font-size: var(--ew-t-badge); line-height: 1; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff; white-space: nowrap;
}
.badge svg { width: 10px; height: 10px; }
.badge.draft { background: var(--ew-state-draft); }

/* ---------- zoom strip ---------- */
.zoom { flex: none; height: 30px; display: flex; align-items: center; padding: 0 22px 0 calc(var(--ew-lane-label-w) + 10px); position: relative; }
.zoom-track { position: relative; flex: 1; height: 26px; touch-action: none; cursor: pointer; }
.zoom-track .rail { position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: color-mix(in srgb, var(--ew-ink) 18%, transparent); }
.zoom-track .tick { position: absolute; top: 50%; width: 1.5px; height: 7px; margin: -3.5px 0 0 -.75px; background: color-mix(in srgb, var(--ew-ink) 40%, transparent); }
.zoom-track .tlabel {
  position: absolute; bottom: 100%; transform: translateX(-50%); font-size: 10px; font-weight: 700; color: var(--ew-ink-2);
  padding: 1px 5px; border-radius: 6px; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.zoom-track.dragging .tlabel { opacity: 1; }
.zoom-track .tlabel.on { color: var(--ew-ink); background: var(--ew-ground); }
.zoom-handle {
  position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 5px; background: var(--ew-surface);
  border: 1.5px solid color-mix(in srgb, var(--ew-ink) 55%, transparent); box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: width .12s, height .12s, margin .12s, border-radius .12s;
}
.zoom-track.dragging .zoom-handle { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 7px; }
.zoom-chip { position: absolute; top: -16px; transform: translateX(-50%); font-size: var(--ew-t-day); font-weight: 700; color: var(--ew-ink); background: var(--ew-ground); border-radius: var(--ew-r-chip); padding: 1px 5px; white-space: nowrap; pointer-events: none; }
.zoom-handle.pulse { animation: pulse .22s ease-out; }
@keyframes pulse { 50% { transform: scale(1.25); } }

/* ---------- window bar ---------- */
.windowbar, .timeline, .topbar { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.windowbar {
  flex: none; position: relative; height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--ew-gutter);
  background: var(--ew-window-bar); border-top: 1px solid color-mix(in srgb, var(--ew-ink) 16%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--ew-ink) 16%, transparent); cursor: row-resize; touch-action: none; z-index: 5;
}
.windowbar.searching { height: 44px; cursor: default; gap: 8px; }
/* When the keyboard would cover the search field, the timeline eases shorter just enough to lift it. */
.timeline.lifting { transition: height var(--ew-dur-slide) var(--ew-ease); }
.wb-btn {
  width: 36px; height: 24px; border-radius: 7px; display: grid; place-items: center; cursor: pointer; border: 1px solid var(--ew-edge); background: var(--ew-raised); padding: 0;
}
.wb-btn svg { width: 18px; height: 18px; }
.wb-btn.plus { background: var(--ew-accent); color: var(--ew-on-accent); border-color: transparent; }
.grip { width: 30px; display: grid; gap: 2px; pointer-events: none; }
.grip i { display: block; height: 1px; background: color-mix(in srgb, var(--ew-ink) 35%, transparent); box-shadow: 0 1px 0 rgba(255,255,255,.35); }
.search-field {
  flex: 1; height: 32px; border-radius: 9px; background: var(--ew-raised); border: 1.5px solid var(--ew-accent); display: flex; align-items: center; gap: 6px; padding: 0 8px;
}
.search-field svg { width: 16px; height: 16px; flex: none; color: var(--ew-ink-2); }
.search-field .glass { flex: none; display: grid; place-items: center; margin: -8px -4px -8px -8px; padding: 8px 4px 8px 8px; border: 0; background: none; cursor: pointer; }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; font: 600 16px var(--ew-font); color: var(--ew-ink); outline: none; } /* 16px: smaller makes iOS zoom the page on focus */
.search-field input::placeholder { color: var(--ew-ink-2); font-weight: 400; }
.search-field .clear { width: 17px; height: 17px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--ew-ink) 35%, transparent); color: var(--ew-raised); display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 11px; font-weight: 700; }
.text-btn { border: 0; background: none; color: var(--ew-accent); font-weight: 600; font-size: var(--ew-t-control); padding: 6px 2px; cursor: pointer; }

/* ---------- month calendar ---------- */
.calendar { flex: 1; min-height: 0; overflow-y: auto; position: relative; -webkit-overflow-scrolling: touch; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.calendar.ranging { overflow-y: hidden; }
.calendar .cell.pulse { animation: cellpulse .25s ease-out; }
@keyframes cellpulse { 40% { background: color-mix(in srgb, var(--ew-accent) 22%, transparent); } }
.calendar.ranging .lens { box-shadow: 0 0 0 2px var(--ew-accent); }
.cal-wd { position: sticky; top: 0; z-index: 4; height: var(--ew-cal-wd-h); box-sizing: border-box; display: grid; grid-template-columns: repeat(7, 1fr); padding: 4px 6px 3px; background: var(--ew-ground) var(--ew-texture); border-bottom: 1px solid var(--ew-hairline); }
.cal-wd span { text-align: center; font-size: var(--ew-t-day); font-weight: 600; letter-spacing: var(--ew-caps-tracking); color: var(--ew-ink-2); }
.calendar { --ew-cal-wd-h: 22px; }
.month { padding: 0 6px 14px; }
.month .week:last-of-type { border-bottom: 1px solid var(--ew-cal-grid); }
/* The month name floats under the weekday row until the next month pushes it up. */
.month h2 {
  position: sticky; top: var(--ew-cal-wd-h); z-index: 4; margin: 0 -6px; padding: 8px 10px 6px; height: 36px; box-sizing: border-box;
  font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: var(--ew-title-tracking); background: var(--ew-ground) var(--ew-texture);
}
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--ew-cal-grid); min-height: 58px; transition: min-height var(--ew-dur-glide) var(--ew-ease); }
.cell + .cell { box-shadow: inset 1px 0 0 var(--ew-cal-grid); }
.cell { position: relative; min-width: 0; padding: 3px 2px 2px; cursor: pointer; }
.cell.out { visibility: hidden; }
/* the date row; in a tall week partly scrolled off (.week.stuck) it floats under the month name */
.cell .top { display: flex; align-items: center; gap: 3px; height: 20px; padding-left: 2px; }
/* once a tall week's dates are floating, they get the ground behind them so events slide under, not through */
.week.stuck .cell .top { position: sticky; top: calc(var(--ew-cal-wd-h) + 36px); z-index: 3; margin: 0 -2px; padding-left: 4px; background: var(--ew-ground) var(--ew-texture); box-shadow: 0 1px 0 var(--ew-cal-grid); }
.week.stuck .cell + .cell .top { box-shadow: inset 1px 0 0 var(--ew-cal-grid), 0 1px 0 var(--ew-cal-grid); }
.cell .n { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; }
.cell.today .n { background: var(--ew-accent); color: var(--ew-on-accent); }
.cell.past .n { color: var(--ew-ink-2); }
.kd { width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--ew-ground), 0 0 0 2.5px color-mix(in srgb, var(--c) 50%, transparent); flex: none; }
.kd.other { background: color-mix(in srgb, var(--c) 35%, var(--ew-ground)); }
.hd { width: 7px; height: 7px; transform: rotate(45deg); border: 1.5px solid var(--ew-ink); border-radius: 1px; flex: none; margin-left: 1px; }
.bars { position: absolute; left: 0; right: 0; top: 24px; pointer-events: none; z-index: 2; }
.bars .bar:not(.more) { pointer-events: auto; cursor: pointer; }
.bars .bar.more { pointer-events: auto; cursor: pointer; }
.bar {
  position: absolute; height: 16px; border-radius: 3px; padding: 0 4px 0 5px; font-size: var(--ew-t-month-bar); line-height: 16px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ew-ink);
  background: color-mix(in srgb, var(--c) var(--ew-event-fill-mix), var(--ew-surface)); box-shadow: inset 2.5px 0 0 var(--c), inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
.bar.busy { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 22%, var(--ew-surface)) 0 4px, color-mix(in srgb, var(--c) 10%, var(--ew-surface)) 4px 8px); }
.bar.school { --c: var(--ew-ink-2); background: color-mix(in srgb, var(--ew-ink) 13%, var(--ew-surface)); color: var(--ew-ink-2); }
.bar.more { background: none; box-shadow: none; color: var(--ew-ink-2); padding-left: 3px; }
.bar.past { opacity: .5; }
/* custody in the month: one thin line per kid under the dates, colored by who has them; the night of day d runs
   from midday d to midday d+1, as on the timeline */
.mcustody { position: absolute; left: 0; right: 0; top: 24px; z-index: 2; cursor: pointer; }
.mline { position: absolute; left: 0; right: 0; height: 4px; pointer-events: none; }
.mline .seg { position: absolute; top: 0; height: 100%; border-radius: 2px; background: var(--c); }
.mline .seg.other { opacity: .35; }
.mline .diamond {
  position: absolute; top: 50%; width: 7px; height: 7px; margin: -4.5px 0 0 -4.5px; transform: rotate(45deg);
  background: var(--ew-ground); border: 1.5px solid var(--ew-ink); border-radius: 1px;
}
.lens { position: absolute; top: 0; bottom: 0; background: var(--ew-timeline); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ew-ink) 22%, transparent); border-radius: 6px; z-index: 0; pointer-events: none; }
.cal-end { padding: 18px; text-align: center; color: var(--ew-ink-2); font-size: 12.5px; }

/* ---------- dropdown (one treatment for every menu) ---------- */
.menu {
  position: fixed; z-index: 50; min-width: 220px; max-width: calc(100vw - 24px); padding: 4px; border-radius: var(--ew-r-menu);
  background: var(--ew-menu-fill); -webkit-backdrop-filter: var(--ew-blur-menu); backdrop-filter: var(--ew-blur-menu);
  border: 1px solid color-mix(in srgb, var(--ew-ink) 10%, transparent); box-shadow: var(--ew-shadow-menu);
  max-height: 70vh; overflow-y: auto;
}
.menu .sec { font-size: var(--ew-t-micro-caps); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ew-ink-2); padding: 8px 10px 4px; }
.menu .row {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: var(--ew-r-row); border: 0; background: none;
  font-size: var(--ew-t-control); font-weight: 600; text-align: left; cursor: pointer; color: var(--ew-ink);
}
.menu .row svg { width: 16px; height: 16px; color: var(--ew-ink-2); flex: none; }
.menu .row .detail { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--ew-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu .row:hover, .menu .row.on, .menu .row:focus-visible { background: var(--ew-accent-wash); outline: none; }
.menu .row.picked { background: var(--ew-accent); color: var(--ew-on-accent); }
.menu .row.picked svg, .menu .row.picked .detail { color: var(--ew-on-accent); }
.menu .row[disabled] { color: color-mix(in srgb, var(--ew-ink) 45%, transparent); cursor: default; background: none; }
.menu .row .soon { margin-left: auto; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ew-ink-2); }
.menu .sep { height: 1px; margin: 4px 6px; background: color-mix(in srgb, var(--ew-ink) 9%, transparent); }
.menu .row .check { margin-left: auto; color: var(--ew-accent); }
.menu { transform-origin: top center; animation: menu-in 200ms var(--ew-ease); }
.menu.up { transform-origin: bottom center; animation-name: menu-in-up; }
.menu.out { opacity: 0; transform: translateY(-4px) scale(.98); transition: opacity 150ms ease-in, transform 150ms ease-in; }
.menu.up.out { transform: translateY(4px) scale(.98); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
@keyframes menu-in-up { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.menu-catch { position: fixed; inset: 0; z-index: 49; cursor: pointer; }

/* ---------- sheet ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 64vh; display: flex; flex-direction: column;
  background: var(--ew-sheet) var(--ew-texture); border-radius: var(--ew-r-sheet) var(--ew-r-sheet) 0 0; box-shadow: var(--ew-shadow-sheet);
  padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); transition: transform var(--ew-dur) var(--ew-ease);
}
.sheet.open { transform: none; }
.sheet .grab, .sheet-head { touch-action: none; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ew-ink) 22%, transparent); margin: 7px auto 6px; flex: none; }
.sheet-head { flex: none; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 2px var(--ew-sheet-gutter) 12px; }
.sheet-title { text-align: center; min-width: 0; }
.sheet-title .t { font-size: var(--ew-t-sheet-title); line-height: 1.2; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sheet-title .d { font-size: var(--ew-t-secondary); font-weight: 600; color: var(--ew-sheet-ink-2); margin-top: 2px; }
.btn-outline { height: 32px; padding: 0 12px; border-radius: var(--ew-r-button); border: 0; background: none; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ew-ink) 30%, transparent); font-size: var(--ew-t-control); font-weight: 600; cursor: pointer; }
.btn-primary { height: 32px; padding: 0 13px; border-radius: var(--ew-r-button); border: 0; background: var(--ew-accent-sheet); color: var(--ew-on-accent); font-size: var(--ew-t-control); font-weight: 600; cursor: pointer; }
.btn-primary[disabled] { opacity: .45; cursor: default; }
.btn-wide { width: 100%; height: 44px; font-size: var(--ew-t-field); }
.head-spacer { width: 60px; }
.sheet-body { overflow-y: auto; padding: 0 var(--ew-sheet-gutter) 18px; display: grid; gap: 14px; }
.facts { display: grid; gap: 10px; }
.fact { display: grid; grid-template-columns: 74px 1fr; gap: 10px; align-items: baseline; }
.fact .k { font-size: var(--ew-t-caps); font-weight: 600; text-transform: uppercase; letter-spacing: var(--ew-caps-tracking); color: var(--ew-sheet-ink-2); }
.fact .v { font-size: var(--ew-t-body); line-height: 1.35; }
.fact .v small { display: block; color: var(--ew-sheet-ink-2); font-size: 12.5px; margin-top: 2px; }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.note { font-size: 13px; line-height: 1.4; color: var(--ew-sheet-ink-2); margin: 0; }
.field { display: flex; align-items: center; gap: 8px; background: var(--ew-sheet-surface); box-shadow: inset 0 0 0 1px var(--ew-sheet-line); border-radius: var(--ew-r-card); padding: 0 12px; height: 44px; }
.field input { flex: 1; min-width: 0; border: 0; background: none; font: 600 var(--ew-t-field) var(--ew-font); color: var(--ew-ink); outline: none; }
.field input::placeholder { font-weight: 400; color: var(--ew-sheet-ink-2); }
.card { background: var(--ew-sheet-surface); border-radius: var(--ew-r-card); box-shadow: inset 0 0 0 1px var(--ew-hairline); padding: 12px 14px; display: grid; gap: 10px; }
.person-row { display: flex; align-items: center; gap: 10px; }
.person-row .nm { font-weight: 600; font-size: 15px; }
.person-row .rl { font-size: 12.5px; color: var(--ew-sheet-ink-2); }
.linkbox { font: 500 12px ui-monospace, Menlo, monospace; word-break: break-all; color: var(--ew-sheet-ink-2); background: var(--ew-sheet-surface); border-radius: var(--ew-r-card); padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--ew-sheet-line); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.msg { font-size: 12.5px; color: var(--ew-sheet-ink-2); min-height: 1em; }
.msg.err { color: var(--ew-state-needs); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; z-index: 60;
  background: var(--ew-surface); border-radius: var(--ew-r-card); padding: 11px 13px; font-size: 13.5px; box-shadow: var(--ew-shadow-toast);
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign in ---------- */
.signin { margin: auto; width: 100%; max-width: 380px; padding: 24px var(--ew-gutter) 40px; display: grid; gap: 14px; }
.lockup { display: block; width: 168px; height: auto; } /* brand/everywhile, stacked lockup with the Mossmatica credit */
.signin p { margin: 0; color: var(--ew-ink-2); font-size: 14.5px; line-height: 1.4; }
.signin .field { background: var(--ew-raised); box-shadow: inset 0 0 0 1px var(--ew-edge); }
.signin .code input { letter-spacing: .3em; font-size: 22px; font-variant-numeric: tabular-nums; }
.signin .btn-primary { background: var(--ew-accent); }

@media (prefers-reduced-motion: reduce) {
  .zoom-handle.pulse, .calendar .cell.pulse { animation: none; }
  .sheet, .toast { transition: none; }
}
