/* =============================================================================
   Overlap — team timezone visualizer
   Single fixed design system ("Zen"): light, calm paper, sharp corners, one
   sage accent. App-shell layout that fits the viewport — the timeline is the
   stage, the team + meetings live in a side rail. No theme switching.
   ========================================================================== */

:root {
  --font-display: 'Bricolage Grotesque', Georgia, serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* layout metrics */
  --label-w: 196px;     /* sticky name column            */
  --hour-w: 48px;       /* px per hour (zoom; set by JS)  */
  --lane-h: 38px;
  --topbar-h: 60px;
  --pad: 1rem;
  --gap: .85rem;

  /* sharp & flat — zen has no rounded corners */
  --radius: 0; --radius-sm: 0; --pill: 0; --avatar-r: 0;

  /* palette */
  --bg: #f3f1ea;  --bg-2: #fbfaf6;  --bg-3: #ece9e0;
  --line: #e0ddd1;  --line-strong: #cfccbe;
  --text: #23271f;  --muted: #8b8d80;
  --accent: #5f7d63;  --accent-ink: #fbfaf6;  --accent-soft: #e4ece2;
  --band: #6f8f73;  --now: #c2683f;
  --shadow: 0 1px 2px rgba(40,40,30,.05), 0 10px 30px rgba(40,40,30,.06);
}

/* ── base ── */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
  overflow: hidden;                 /* the app fits the screen; panes scroll */
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
b { font-weight: 700; }

/* ── buttons & inputs ── */
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: .84rem;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--text);
  padding: .48rem .8rem; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-3); border-color: var(--accent); }
.btn.sm { padding: .34rem .6rem; font-size: .78rem; }
.btn.block { width: 100%; margin-top: .7rem; }
.btn.danger:hover { border-color: var(--now); color: var(--now); }
.icon-btn { padding: .34rem .55rem; line-height: 1; font-size: 1.05rem; }

input, select, textarea {
  font-family: var(--font-body); font-size: .9rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: .5rem .65rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="date"], input[type="time"] { color-scheme: light; }
textarea { resize: vertical; }


/* ── top bar ── */
.topbar {
  flex: none; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0 1.4rem; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; }
.mark { font-size: 1.6rem; color: var(--accent); }
.ws { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ws-eyebrow { font-size: .58rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.org { background: transparent; border: none; border-bottom: 1.5px solid transparent;
  padding: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.28rem;
  color: var(--text); width: 100%; max-width: 460px; }
.org::placeholder { color: var(--muted); opacity: .7; }
.org:focus { outline: none; border-bottom-color: var(--accent); box-shadow: none; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.url-badge { font-size: .72rem; color: var(--muted); white-space: nowrap; font-family: var(--font-mono); }
.url-badge.warn { color: var(--now); font-weight: 700; }

/* ── app shell ── */
.app {
  flex: 1; min-height: 0; width: 100%; max-width: 1500px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap);
  align-items: start;                /* cards size to content, not the full height */
  overflow-y: auto;                  /* if the whole thing is tall, scroll the app */
  padding: var(--gap) 1.4rem 1.1rem;
}
.app.side-collapsed { grid-template-columns: minmax(0, 1fr); }
.app.side-collapsed .side { display: none; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-head h2 { font-size: 1.02rem; }
.head-actions { display: flex; gap: .45rem; align-items: center; }

/* ── stage (timeline column) ── */
.stage { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 1rem; padding: 1rem 1.05rem; }

.controls { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
input[type="date"] { padding: .3rem .4rem; font-size: .78rem; max-width: 140px; }
.controls .spacer { flex: 1; min-width: .5rem; }

/* visible layer toggles + zoom + accent in the controls bar */
.layer-pills { display: flex; gap: .3rem; flex-wrap: wrap; }
.pill { font-family: var(--font-body); font-size: .72rem; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--muted);
  padding: .28rem .55rem; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.pill:hover { border-color: var(--accent); color: var(--text); }
.pill.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.zoom-group { display: flex; align-items: center; gap: .2rem; }
.accent-swatch { display: inline-flex; cursor: pointer; }
.accent-swatch input[type=color] { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-strong); cursor: pointer; background: none; }

/* settings gear + dropdown */
.settings-wrap { position: relative; }
.settings-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
  background: var(--bg-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  padding: .55rem .65rem; min-width: 180px; display: flex; flex-direction: column; gap: .5rem;
  animation: spFadeIn .12s ease; }
.settings-panel[hidden] { display: none; }
@keyframes spFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.sp-section { display: flex; flex-direction: column; gap: .3rem; }
.sp-label { font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sp-row { display: flex; align-items: center; gap: .35rem; }
.sp-row.toggles { flex-wrap: wrap; }

/* settings → Colours */
.sp-color-row { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text); }
.sp-color-row input[type=color] { width: 30px; height: 20px; padding: 0; border: 1px solid var(--line-strong); cursor: pointer; background: none; }
.sp-team-colors { display: flex; flex-direction: column; gap: .25rem; }
.sp-tc-row { display: flex; align-items: center; gap: .45rem; font-size: .76rem; color: var(--text); }
.sp-tc-row .dot-btn { width: 16px; height: 16px; flex: none; }

/* layers — a clean list of on/off switches */
.layer-list { display: flex; flex-direction: column; }
.layer-toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-family: var(--font-body); font-size: .8rem; font-weight: 500; color: var(--text);
  background: none; border: none; padding: .34rem .1rem; cursor: pointer; width: 100%; }
.layer-toggle:hover { color: var(--accent); }
.layer-toggle .sw { flex: none; width: 30px; height: 17px; border-radius: 999px;
  background: var(--line-strong); position: relative; transition: background .15s; }
.layer-toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.layer-toggle.active .sw { background: var(--accent); }
.layer-toggle.active .sw::after { transform: translateX(13px); }

/* date strip wrap with arrows */
.date-strip-wrap { display: flex; align-items: center; gap: 0; }
.ds-arrow { flex: none; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; padding: .15rem .35rem; font-size: .72rem; line-height: 1; }
.ds-arrow:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ds-arrow:active { transform: translateY(1px); }

/* scrollable date strip */
.date-strip { display: flex; gap: .3rem; overflow-x: auto; padding: .15rem 0 .35rem; scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) transparent; flex: 1; }
.date-strip::-webkit-scrollbar { height: 10px; }
.date-strip::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid var(--bg); border-radius: 0; }
.date-strip::-webkit-scrollbar-track { background: var(--bg-3); }
.day-cell { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: .3rem 0; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer;
  font-family: var(--font-body); transition: border-color .12s, background .12s; }
.day-cell:hover { border-color: var(--accent); }
.day-cell .dc-dow { font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.day-cell .dc-day { font-size: 1rem; font-weight: 800; font-family: var(--font-display); line-height: 1; }
.day-cell .dc-mon { font-size: .56rem; text-transform: uppercase; color: var(--muted); }
.day-cell.today { border-color: var(--now); }
.day-cell.today .dc-day { color: var(--now); }
.day-cell.sel { background: var(--accent); border-color: var(--accent); }
.day-cell.sel .dc-dow, .day-cell.sel .dc-day, .day-cell.sel .dc-mon { color: var(--accent-ink); }
.day-cell .dc-dot { font-size: .4rem; color: var(--now); line-height: 1; }
.day-cell.sel .dc-dot { color: var(--accent-ink); }

.filters { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.filters-label { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.team-filter { display: flex; gap: .35rem; flex-wrap: wrap; }
.tf-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--bg-2); color: var(--muted);
  padding: .26rem .6rem; border-radius: var(--pill); cursor: pointer; transition: all .12s; }
.tf-chip:hover { border-color: var(--accent); color: var(--text); }
.tf-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tf-chip.active .dot { box-shadow: 0 0 0 1.5px var(--accent-ink); }
.scrub-readout { margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-size: .84rem; color: var(--accent); white-space: nowrap; }

/* compact rows — denser timeline, hide the secondary meta line */
.compact-mode { --lane-h: 26px; }
.compact-mode .who .meta { display: none; }
.compact-mode .off-pill { font-size: .56rem; }

/* ── celestial glow effects ── */
.celestial { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: .9rem; line-height: 1; pointer-events: none;
  z-index: 2; }
.celestial.sun { color: #ffe066;
  text-shadow: 0 0 4px rgba(255,200,50,.9), 0 0 12px rgba(255,180,30,.6), 0 0 24px rgba(255,150,20,.3); }
.celestial.moon { color: #ffffff; font-size: 1rem;
  text-shadow: 0 0 4px rgba(255,255,255,.9), 0 0 12px rgba(220,235,255,.7), 0 0 24px rgba(180,210,255,.4), 0 0 40px rgba(140,180,255,.2); }
.celestial.dawn { color: #d4c8c0; font-size: .6rem;
  text-shadow: 0 0 4px rgba(200,190,180,.5); }
.celestial.dusk { color: #b8b0b8; font-size: .6rem;
  text-shadow: 0 0 4px rgba(180,170,185,.5); }

/* per-person expand toggle */
.lane-expand { flex: none; background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: .55rem; padding: 0 2px; opacity: .5; transition: opacity .12s, transform .2s; line-height: 1; }
.lane:hover .lane-expand { opacity: 1; }
.lane-expand:hover { color: var(--accent); opacity: 1; }
.lane-expand.expanded { transform: rotate(90deg); }

/* drag-to-reorder grip */
.lane-grip { flex: none; cursor: grab; color: var(--muted); font-size: .8rem; line-height: 1; opacity: .35;
  user-select: none; transition: opacity .12s; }
.lane:hover .lane-grip { opacity: .9; }
.lane-grip:active { cursor: grabbing; }
.lane.dragging { opacity: .5; }
.lane.drop-above .tl-label { box-shadow: inset 0 2px 0 var(--accent); }
.lane.drop-below .tl-label { box-shadow: inset 0 -2px 0 var(--accent); }

/* lane actions (POV + delete) — revealed on hover, anchored right, occluding the meta */
.lane-actions { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: flex; gap: 1px;
  align-items: center; background: var(--bg); padding-left: 4px; opacity: 0; transition: opacity .12s; }
.lane:hover .lane-actions, .lane.pov .lane-actions { opacity: 1; }
.lane-del { flex: none; background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: .8rem; padding: 0 3px; border-radius: 2px; line-height: 1; }
.lane-del:hover { color: #fff; background: var(--now); }

/* expanded lane detail row */
.lane-detail { display: none; font-size: .62rem; color: var(--muted); background: var(--bg-3);
  border-bottom: 1px solid var(--line); }
.lane-detail.open { display: grid; }
.lane-detail .tl-label { background: var(--bg-3); }
.lane-detail .tl-track { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; padding: .2rem .5rem .28rem; }
.lane-detail span { white-space: nowrap; display: inline-flex; align-items: center; gap: .25rem; }
.lane-detail .utc-big { font-family: var(--font-mono); font-weight: 700; font-size: .7rem;
  color: var(--accent); background: var(--accent-soft); padding: 0 6px; }
.lane-detail .local-clock { font-family: var(--font-mono); font-weight: 700; color: var(--text); }

/* ── timeline board ── */
/* sizes to the lanes it holds, capped — then scrolls vertically (no dead space) */
.board { flex: none; min-height: 96px; max-height: 48vh; overflow: auto; border: 1px solid var(--line);
  background: var(--bg); scrollbar-color: var(--line-strong) transparent; }
.board::-webkit-scrollbar { height: 12px; width: 10px; }
.board::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid var(--bg); border-radius: 0; }
.board::-webkit-scrollbar-track { background: var(--bg-3); }
.board-inner { position: relative; width: calc(var(--label-w) + var(--hour-w) * var(--total-h, 24)); min-width: 100%; }
.tl-row { display: grid; grid-template-columns: var(--label-w) calc(var(--hour-w) * var(--total-h, 24)); }
.tl-label { position: sticky; left: 0; z-index: 4; background: var(--bg);
  display: flex; align-items: center; gap: .5rem; padding: 0 .7rem; border-right: 1px solid var(--line); }
.axis { position: sticky; top: 0; z-index: 6; background: var(--bg); border-bottom: 1px solid var(--line-strong); }
.axis .tl-label { z-index: 7; }
.axis-label { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }
.tl-track { position: relative; }
.axis-track { display: flex; height: 46px; position: relative; }
/* day-header strip (one label per day, spanning its width) */
.axis-day { position: absolute; top: 0; height: 17px; line-height: 17px; font-size: .64rem; font-weight: 700;
  color: var(--muted); padding-left: 5px; border-left: 2px solid var(--line-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.axis-day.sel { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.tick { width: var(--hour-w); flex: none; border-left: 1px solid var(--line); font-family: var(--font-mono);
  font-size: .62rem; color: var(--muted); padding: 23px 0 0 4px; }
.tick:first-child { border-left: none; }
.tick.daybreak { border-left: 2px solid var(--line-strong); }
.tick.focus-day { color: var(--text); background: color-mix(in srgb, var(--accent) 6%, transparent); }

.lane { align-items: stretch; }
.lane:hover .tl-label { background: var(--bg-3); }
.lane .tl-label { height: var(--lane-h); }
.dot { width: 9px; height: 9px; border-radius: var(--avatar-r); flex: none; }
.who { min-width: 0; flex: 1; overflow: hidden; }
.tl-label { overflow: hidden; }   /* clip any actions/labels to the sticky column */
.who .name { font-weight: 600; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .meta { font-size: .65rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-off { font-size: .56rem; background: var(--line); color: var(--muted); padding: 0 5px; margin-left: 4px; }

.tl-track.work { height: var(--lane-h); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(var(--hour-w) - 1px), var(--line) calc(var(--hour-w) - 1px), var(--line) var(--hour-w)); }
/* roster multi-select */
.select-bar { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; margin-bottom: .5rem;
  background: var(--accent-soft); border: 1px solid var(--accent); }
.sel-count { font-size: .78rem; font-weight: 700; color: var(--accent); flex: 1; }
.person-check { accent-color: var(--accent); cursor: pointer; flex: none; margin-right: 1px; }
.person.selected { box-shadow: 0 0 0 2px var(--accent); }
#bulkText { width: 100%; font-family: var(--font-mono); font-size: .82rem; }

/* inline add-a-teammate row */
.add-row { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border: 1px dashed var(--line-strong);
  background: color-mix(in srgb, var(--accent) 3%, transparent); flex: none; }
.add-row-plus { color: var(--accent); font-weight: 700; font-size: 1rem; flex: none; }
.add-name { flex: 1.2; min-width: 0; border: none; background: transparent; font-size: .85rem; padding: .25rem; }
.add-name:focus { outline: none; box-shadow: none; }
.add-combo { flex: 1; min-width: 120px; }
.add-combo .combo-input { padding: .3rem .5rem; font-size: .8rem; }
.add-row-hint { flex: none; }
@media (max-width: 700px) { .add-row-hint { display: none; } }

.band { position: absolute; top: 6px; bottom: 6px; background: var(--bc, var(--band)); opacity: .92; }
/* drag handles to resize working hours on the focused day */
.band-handle { position: absolute; top: 3px; bottom: 3px; width: 10px; margin-left: -5px; cursor: ew-resize;
  z-index: 3; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.band-handle::after { content: ''; width: 3px; height: 60%; background: var(--text); border: 1px solid var(--bg); border-radius: 2px; }
.lane:hover .band-handle { opacity: .65; }
.band-handle:hover { opacity: 1; }
.lane.off .band { opacity: .25; }
.lane.off .tl-track.work { background-color: color-mix(in srgb, var(--muted) 8%, transparent); }

/* day/night view — gradient ramp; bands stay visible, outlined for contrast */
.tl-track.dn .band { opacity: .7; border-top: 2px solid rgba(255,255,255,.75); border-bottom: 2px solid rgba(255,255,255,.75); }
.lane.off .tl-track.dn { filter: saturate(.4) brightness(.9); }

.off-pill { font-size: .58rem; font-weight: 700; color: var(--muted); background: var(--bg-3);
  border: 1px solid var(--line); padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.lane-tz { margin-left: auto; flex: none; background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: .9rem; padding: 0 3px; transition: color .12s, background .12s;
  border-radius: 2px; }
.lane-tz:hover { color: var(--accent); background: var(--accent-soft); }
.lane-tz.active { color: var(--accent-ink); background: var(--accent); }
.lane-tz.active:hover { filter: brightness(1.1); }

/* highlight the lane of the active POV person */
.lane.pov { background: var(--accent-soft); }
.lane.pov .tl-label { background: var(--accent-soft); }
/* live local-time chip — rides the vertical scrubber line at each person's row */
.live { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: .6rem; font-weight: 700; padding: 1px 4px; white-space: nowrap;
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 1px 3px rgba(0,0,0,.22); }
.live.working { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.live:empty { display: none; }

.marker { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 5; }
.marker.now { background: var(--now); opacity: .65; pointer-events: none; }
.marker.now span { position: absolute; top: 1px; left: 3px; font-size: .55rem; font-weight: 700; color: var(--now); }
.marker.scrub { background: var(--accent); cursor: ew-resize; }
.marker.scrub::after { content: ""; position: absolute; top: 22px; left: -4px; width: 10px; height: 10px; background: var(--accent); }
.marker.scrub:focus { outline: none; }
.marker.scrub:focus::after { box-shadow: 0 0 0 3px var(--accent-soft); }

.hover-tip { position: absolute; top: 4px; z-index: 8; transform: translateX(-50%); pointer-events: none;
  font-family: var(--font-mono); font-size: .64rem; font-weight: 700; color: var(--accent-ink);
  background: var(--accent); padding: 2px 6px; white-space: nowrap; box-shadow: var(--shadow); }

.empty { padding: 1.4rem; text-align: center; color: var(--muted); }

/* meeting blocks drawn across the timeline */
.block-span { position: absolute; top: 30px; bottom: 0; z-index: 3; pointer-events: none;
  background: color-mix(in srgb, var(--now) 13%, transparent);
  border-left: 2px solid var(--now); border-right: 1px dashed color-mix(in srgb, var(--now) 55%, transparent); }
.block-span span { position: absolute; top: 2px; left: 5px; font-size: .57rem; font-weight: 700; color: var(--now); white-space: nowrap; }

/* ── planner strip ── */
.planner-strip { flex: none; border-top: 1px solid var(--line); padding-top: .65rem; }
.stage.daynight-active .planner-strip { display: none; }
.planner-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.planner-head h2 { font-size: 1rem; }
.planner-head p { margin: .1rem 0 0; }
.scope-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .6rem; }
.scope-sep { font-size: .62rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 .15rem 0 .5rem; }
.scope-bar .filters-label { margin-right: .1rem; }
.tf-chip.person-chip { padding: .22rem .55rem; }
.planner { display: flex; flex-wrap: wrap; gap: .6rem; align-items: stretch; }
.off-note, .block-note { margin: 0; flex-basis: 100%; }
.no-overlap { color: var(--now); }
.slots { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; flex-basis: 100%; }
.slot { font-family: var(--font-mono); font-weight: 700; font-size: .78rem; color: var(--accent);
  background: var(--bg-2); border: 1px solid var(--accent); padding: .2rem .5rem; cursor: pointer; }
.slot:hover { background: var(--accent); color: var(--accent-ink); }

/* ── side rail ── */
.side { min-height: 0; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap); padding-right: 2px; }
.side .card { padding: var(--pad); }
.roster-card .card-head { margin-bottom: .55rem; }
.mini-search { padding: .34rem .5rem; font-size: .8rem; max-width: 130px; }
.mini-select { padding: .34rem .5rem; font-size: .8rem; }

.roster { display: flex; flex-direction: column; gap: .5rem; }
.team-group { border: 1px dashed transparent; padding: .3rem; transition: border-color .12s, background .12s; }
.team-group.drop { border-color: var(--accent); background: var(--accent-soft); }
.group-head { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; padding: .1rem .2rem .3rem; }
.group-head .count { font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; min-height: 26px; }
.person { display: inline-flex; align-items: center; gap: .4rem; background: var(--bg-3); border: 1px solid var(--line);
  padding: .26rem .6rem .26rem .35rem; cursor: grab; font-size: .8rem; transition: border-color .12s; }
.person:hover { border-color: var(--accent); }
.person:active { cursor: grabbing; }
.person.dragging { opacity: .4; }
.person .avatar { width: 20px; height: 20px; border-radius: var(--avatar-r); display: grid; place-items: center;
  color: #fff; font-size: .68rem; font-weight: 700; }
.person .ptz { color: var(--muted); font-size: .68rem; }

/* ── meetings ── */
.collapser { background: none; border: none; cursor: pointer; text-align: left; padding: 0; color: inherit;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.collapser .chevron { display: inline-block; transition: transform .2s; }
.meetings-card .card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.meetings-card .card-head .btn.primary.sm { flex: none; }
.meetings-card.collapsed .chevron { transform: rotate(-90deg); }
.meetings-card.collapsed .meetings { display: none; }
.count { font-size: .8rem; color: var(--muted); font-family: var(--font-mono); }
.meetings { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.mtg { border: 1px solid var(--line); padding: .6rem .7rem; background: var(--bg-3);
  display: flex; flex-direction: column; gap: .3rem; }
.mtg.booked { border-color: var(--accent); }
.mtg-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.status-pill { font-size: .58rem; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; background: var(--line); color: var(--muted); }
.status-pill.booked { background: var(--accent-soft); color: var(--accent); }
.mtg-notes { font-size: .76rem; white-space: pre-wrap; background: color-mix(in srgb, var(--bg) 60%, transparent);
  padding: .4rem .5rem; max-height: 7rem; overflow: auto; }
.mtg-actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.mtg-actions .btn { padding: .26rem .5rem; font-size: .73rem; text-decoration: none; }

/* ── combobox (timezone search) ── */
.combo { position: relative; display: flex; align-items: center; min-width: 200px; }
.home-combo { min-width: 150px; max-width: 190px; }
.home-combo .combo-input { padding-top: .3rem; padding-bottom: .3rem; font-size: .8rem; }
.combo-icon { position: absolute; left: .55rem; pointer-events: none; opacity: .7; }
.combo-input { width: 100%; padding-left: 1.9rem; padding-top: .42rem; padding-bottom: .42rem; font-size: .84rem; }
.combo-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; margin: 0; padding: 4px;
  list-style: none; background: var(--bg-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.cb-item { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  padding: .42rem .55rem; cursor: pointer; font-size: .84rem; }
.cb-item.active, .cb-item:hover { background: var(--accent-soft); }
.cb-item .cb-tz { font-family: var(--font-mono); font-size: .66rem; color: var(--muted); }

/* ── team colour picker ── */
.dot-btn { border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.dot-btn:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
.color-pop { position: fixed; z-index: 90; background: var(--bg-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); padding: .55rem; display: flex; flex-direction: column; gap: .5rem; }
.cp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
.cp-swatch { width: 22px; height: 22px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.cp-swatch:hover { transform: scale(1.12); }
.cp-swatch.sel { box-shadow: 0 0 0 2px var(--text); }
.cp-custom { display: flex; align-items: center; gap: .4rem; font-size: .72rem; color: var(--muted); }
.cp-custom input[type=color] { width: 28px; height: 22px; padding: 0; border: 1px solid var(--line-strong); cursor: pointer; background: none; }

/* ── drawer ── */
.scrim { position: fixed; inset: 0; background: rgba(20,20,12,.4); z-index: 50; backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); z-index: 60;
  background: var(--bg-2); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 50px rgba(0,0,0,.2);
  padding: 1.2rem; overflow-y: auto; animation: slideIn .22s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.drawer-section { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.drawer-section h4 { font-size: .92rem; margin-bottom: .55rem; }

.form { display: flex; flex-direction: column; gap: .65rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; color: var(--muted); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.row-3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: .55rem; }
.checkbox { flex-direction: row !important; align-items: center; gap: .5rem; color: var(--text); }
.checkbox input { accent-color: var(--accent); }
.error { color: var(--now); font-size: .8rem; margin: 0; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* quick-hours presets + always-available */
.hours-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.hours-presets { display: flex; gap: .3rem; }
.chip-btn { font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border: 1px solid var(--line-strong);
  background: var(--bg-3); color: var(--text); cursor: pointer; }
.chip-btn:hover:not(:disabled) { border-color: var(--accent); }
.chip-btn:disabled { opacity: .4; cursor: default; }
.checkbox.inline { font-size: .78rem; margin: 0; }
.row-2.disabled { opacity: .4; pointer-events: none; }

.days-off { display: flex; flex-direction: column; gap: .3rem; }
.days-off-label { font-size: .76rem; color: var(--muted); }
.day-toggles { display: flex; gap: .3rem; }
.day-toggle { width: 30px; height: 30px; border: 1px solid var(--line-strong); background: var(--bg-3);
  color: var(--muted); cursor: pointer; font-size: .76rem; font-weight: 600; }
.day-toggle.on { background: var(--now); border-color: var(--now); color: #fff; }

.team-form { display: flex; gap: .5rem; }
.team-form input { flex: 1; }
.team-list { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.team-list li { display: flex; align-items: center; gap: .5rem; background: var(--bg-3); padding: .4rem .6rem; }
.team-list .tname { font-weight: 600; flex: 1; }
.icon { background: transparent; border: none; cursor: pointer; font-size: .85rem; padding: 3px 5px; color: var(--muted); }
.icon:hover { background: var(--bg-2); color: var(--text); }

/* ── dialog ── */
.dialog { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong);
  padding: 1.3rem; width: min(460px, 94vw); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(20,20,12,.5); backdrop-filter: blur(3px); }
.dialog h3 { margin-bottom: .25rem; }
.dialog form { display: flex; flex-direction: column; gap: .65rem; }
.dialog label { display: flex; flex-direction: column; gap: .25rem; font-size: .76rem; color: var(--muted); }

/* ── toast ── */
.toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-2); border: 1px solid var(--accent); color: var(--text); padding: .65rem 1.05rem;
  box-shadow: var(--shadow); opacity: 0; transition: all .25s; z-index: 80; max-width: 90vw; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── first-visit onboarding ─────────────────────────────────── */
.onboard-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.onboard-overlay[hidden] { display: none !important; }
.onboard-modal {
  background: var(--bg-2); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 32px 28px; max-width: 620px; width: 100%;
  position: relative;
}
.onboard-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; font-size: 16px;
  cursor: pointer; color: var(--muted); line-height: 1;
  font-family: var(--font-body);
}
.onboard-close:hover { color: var(--text); }
.onboard-panels { display: flex; gap: 0; }
.onboard-panel {
  flex: 1; text-align: center; padding: 16px 14px;
}
.onboard-panel + .onboard-panel {
  border-left: 1px solid var(--line);
}
.onboard-icon {
  display: block; font-size: 30px; margin-bottom: 6px;
  color: var(--accent);
}
.onboard-heading {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; margin-bottom: 6px; letter-spacing: -.01em;
  color: var(--text);
}
.onboard-text {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  font-family: var(--font-body);
}
.onboard-divider {
  height: 1px; background: var(--line); margin: 12px 0 16px;
}
.onboard-cta {
  display: block; margin: 0 auto;
  padding: 8px 32px; font-size: 14px;
}

/* ── ＋Person pulse after onboarding ────────────────────────── */
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(95,125,99,.5); }
  70% { box-shadow: 0 0 0 10px rgba(95,125,99,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,125,99,0); }
}
.pulse { animation: pulse-ring 1.5s ease-out 3; position: relative; }
.pulse-tooltip {
  position: absolute;
  bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  padding: 4px 10px; white-space: nowrap;
  pointer-events: none;
}

/* ── onboarding: mobile — stack panels vertically ── */
@media (max-width: 600px) {
  .onboard-modal { padding: 24px 18px; }
  .onboard-panels { flex-direction: column; }
  .onboard-panel + .onboard-panel { border-left: none; border-top: 1px solid var(--line); }
  .onboard-heading br { display: none; }
}

/* ── responsive: below the app-shell breakpoint, let the page scroll ── */
@media (max-width: 980px) {
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; }
  .stage { min-height: auto; }
  .board { height: 58vh; }
  .planner-strip { max-height: none; }
  .side { overflow: visible; }
}

/* ── respect users who ask for less motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
