/* Relay PWA — "Daylight Amber" visual system (2026-10-26).
   Clean, professional light: warm paper + white surfaces, one ember→amber lamp, soft
   shadows, and per-business colours as the switchboard "jacks". Same layout, refreshed
   palette (replaces the Switchboard neon-noir dark theme). */

:root {
  /* Switchboard foundation — shared by every product in the suite. Neon noir: an ink-navy
     night lit by coloured light from two sides. Colour comes from light, not flat panels. */
  --sb-ink: #110f26; --sb-night: #1c1a4a;
  --sb-violet: #4a36c9; --sb-purple: #8a24a8;
  --sb-magenta: #e0169f; --sb-pink: #ff4fa8;
  --sb-ember: #e8582c; --sb-amber: #f6a94a; --sb-rain: #1f7fe0;

  /* Surfaces & text — violet-leaning neutrals, never gray */
  /* Daylight Amber — clean, professional light. Warm paper + ember/amber lamp. */
  color-scheme: light;
  --background: #FBFAF7;                       /* warm paper */
  --foreground: #1C1A17;                       /* near-black, warm */
  --card:       #FFFFFF;
  --muted:      #F4F1EC;                        /* subtle fill */
  --secondary:  #F4F1EC;                        /* chips / inset fills */
  --muted-foreground: #726B5E;                  /* body copy */
  --jack:       #F7F4EE;                        /* input wells */

  /* Actions — map onto the active product's lamp (set per [data-product]) */
  --primary: var(--product-a);
  --primary-foreground: #ffffff;
  --accent: var(--product-b);
  --destructive: #d64550;
  --success: #15995b;
  --info: var(--sb-rain);

  /* Lines */
  --border: #E8E3DA;                          /* hairlines, form controls */
  --border-soft: color-mix(in oklab, var(--border) 55%, transparent);
  --ring: var(--product-a);

  /* Gradients + brand aliases kept so every existing rule inherits the new lamp colours */
  --brand-orange: var(--product-a);
  --brand-amber: var(--product-b);
  --gradient-brand: var(--product-gradient);
  --gradient-brand-vertical: linear-gradient(135deg, var(--product-a), var(--product-b));

  /* Light theme: no neon environment glow. A whisper-faint warm wash keeps the paper alive. */
  --env-light:
    radial-gradient(90% 70% at 100% 0%, color-mix(in oklab, var(--product-b) 5%, transparent), transparent 60%);

  /* Elevation — three styles only */
  --shadow-card: 0 1px 2px rgb(28 26 23 / 0.05), 0 8px 24px -14px rgb(28 26 23 / 0.14);
  --shadow-glow: 0 10px 30px -14px color-mix(in oklab, var(--product-a) 26%, transparent);
  --shadow-neon: 0 0 0 1px color-mix(in oklab, var(--product-a) 30%, transparent),
                 0 6px 20px -10px color-mix(in oklab, var(--product-a) 24%, transparent);
  --shadow-glow-sm: 0 6px 16px -10px color-mix(in oklab, var(--product-a) 22%, transparent);

  /* Radii */
  --radius-md: 0.375rem;  /* inputs */
  --radius-lg: 0.5rem;    /* buttons */
  --radius-xl: 0.75rem;   /* icon chips */
  --radius-2xl: 1rem;     /* cards */
  --radius-full: 9999px;

  --duration: 200ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all var(--duration) var(--ease);

  --nav-h: 60px;
  --maxw: 820px;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-family: var(--font-sans);
}

/* Relay lamp — Relay's own colour within the shared foundation, taken from its app icon
   ("Ember on night"). Every other Switchboard product defines its own [data-product] lamp
   against this same foundation; nothing else needs to change. */
[data-product="relay"] {
  --product-a: #D9531C;    /* ember — fills, primary */
  --product-b: #F2A33C;    /* amber — accents, gradient partner */
  --product-c: #FDEBD6;    /* light amber tint — weak fills */
  --product-halo: #e0169f; /* magenta — glow behind the hero object */
  --product-gradient: linear-gradient(90deg, var(--product-a), var(--product-b));
  --product-gradient-tip: linear-gradient(180deg, var(--product-c), var(--product-b) 50%, var(--product-a));
  --halo: radial-gradient(closest-side, color-mix(in oklab, var(--product-halo) 40%, transparent), transparent);
}

* { box-sizing: border-box; }
html { height: 100%; }
/* Lock the app to the viewport (iOS: no document scroll/rubber-band so the top bar stays
   fixed, and the keyboard resizes the content area instead of panning the whole view). */
body {
  margin: 0; position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--background); color: var(--foreground); -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
/* Environment light: a two-sided coloured glow over the ink, behind everything. */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--env-light); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.app { display: flex; flex-direction: column; height: 100%; max-width: 100%; position: relative; z-index: 1; }
.main-col { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }

/* Header */
.header {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  /* clear the device status bar in the installed PWA (min 28px even if the inset is 0) */
  padding-top: calc(max(env(safe-area-inset-top, 0px), 20px) + 10px);
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in oklab, var(--background) 70%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.hbrand { display: flex; align-items: center; gap: 10px; }
.today-date { font-weight: 700; font-size: 16px; color: var(--foreground); letter-spacing: -0.02em; }
.brand-mark { display: inline-block; width: 28px; height: 28px; border-radius: 7px; object-fit: cover; }
.icon-btn {
  background: transparent; color: var(--muted-foreground); border: 0; width: 40px; height: 40px;
  border-radius: var(--radius-lg); cursor: pointer; display: inline-grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--secondary); color: var(--foreground); }

.rail-brand { display: none; }
.rail-brand-name { font-weight: 700; letter-spacing: -0.02em; }
@media (min-width: 820px) {
  .hdr-mark { display: none; }
  /* big, centered logo with the name below it */
  .rail-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px 22px; }
  .rail-brand .brand-mark { width: 64px; height: 64px; border-radius: 15px; }
  .rail-brand-name { font-size: 19px; }
}

/* Content — the only scroll region */
.content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; width: 100%; max-width: var(--maxw); margin: 0 auto; }

/* Nav */
.nav { flex: 0 0 auto; display: flex; border-top: 1px solid var(--border-soft); background: color-mix(in oklab, var(--background) 70%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding-bottom: env(safe-area-inset-bottom); }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: 0; color: var(--muted-foreground); cursor: pointer;
  padding: 8px 0 10px; font-size: 11px; height: var(--nav-h); transition: var(--transition);
}
.nav-item .nav-icon { color: var(--primary); line-height: 0; display: inline-flex; }
.nav-item .nav-icon svg { width: 22px; height: 22px; }
.nav-item[aria-current="true"] .nav-label { color: var(--foreground); }
@media (min-width: 820px) {
  .app { flex-direction: row; }
  .nav { order: -1; flex-direction: column; width: 210px; border-top: 0; border-right: 1px solid var(--border-soft); padding: 12px 8px; }
  .nav-item { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; height: auto; padding: 11px 14px; border-radius: var(--radius-lg); font-size: 15px; }
  .nav-item[aria-current="true"] { background: var(--secondary); }
  /* pin Settings to the bottom-left of the rail */
  .nav-settings { margin-top: auto; }
  /* left-align the capped content next to the rail (was centered) */
  .content { margin: 0; }
}

/* Cards */
.card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius-2xl); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-card); }
.card.compact { padding: 13px 14px; }
/* project colour cue: a left accent stripe (colour set inline per project) */
.card.accent { border-left-width: 4px; border-left-style: solid; }
.card-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card-main { min-width: 0; flex: 1; }
.card-row .icon-actions { margin-top: 0; flex-shrink: 0; }

/* Pills / chips */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 12px; font-weight: 600; border: 1px solid var(--border-soft); background: var(--secondary); color: var(--foreground); cursor: pointer; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip[aria-pressed="true"] { border-color: color-mix(in oklab, var(--primary) 60%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.btn { background: var(--gradient-brand); color: var(--primary-foreground); border: 0; border-radius: var(--radius-lg); padding: 11px 16px; font-weight: 600; font-size: 15px; cursor: pointer; transition: var(--transition); }
.btn:hover { opacity: .95; box-shadow: var(--shadow-glow-sm); }
.btn:disabled { opacity: .5; box-shadow: none; cursor: default; }
.btn-ghost { background: transparent; color: var(--foreground); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--secondary); box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-icon { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 14px; font-weight: 600; border-radius: var(--radius-lg); cursor: pointer; }
.btn-icon .bi { display: inline-flex; }
.btn-icon .bi svg { width: 16px; height: 16px; }
.field-row { display: flex; gap: 10px; }
.field-row > div { flex: 1; min-width: 0; }

/* Icon action buttons */
.icon-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; }
.iaction { background: transparent; border: 1px solid var(--border-soft); color: var(--muted-foreground); width: 34px; height: 32px; border-radius: var(--radius-lg); display: inline-grid; place-items: center; cursor: pointer; transition: var(--transition); }
.iaction svg { width: 18px; height: 18px; }
.iaction:hover { color: var(--primary); border-color: color-mix(in oklab, var(--primary) 50%, transparent); }
.iaction[data-act="confirm"], .iaction[data-act="complete"], .iaction[data-act="gcomplete"] { color: var(--accent); }
.iaction[data-act="confirm"]:hover, .iaction[data-act="complete"]:hover, .iaction[data-act="gcomplete"]:hover { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
.iaction.on { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 50%, transparent); }
.badge.tag { color: var(--accent); }
.tip { position: fixed; transform: translateX(-50%); background: var(--secondary); color: var(--foreground);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-card); font-size: 12px; padding: 4px 8px;
  border-radius: 6px; white-space: nowrap; z-index: 200; pointer-events: none; }
.tip[hidden] { display: none; }
.iaction.danger { color: var(--destructive); }
.iaction.danger:hover { color: var(--destructive); border-color: color-mix(in oklab, var(--destructive) 50%, transparent); }
.trow-tools { margin-left: auto; display: flex; gap: 6px; }

/* Form controls — full-strength border */
textarea, input, select { width: 100%; background: var(--jack); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; font-size: 16px; font-family: inherit; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--product-b); box-shadow: 0 0 0 2px color-mix(in oklab, var(--product-b) 35%, transparent); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted-foreground); margin: 10px 0 4px; }

/* Type */
h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 4px 0 14px; color: var(--foreground); }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; margin: 22px 0 8px;
  background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.item { border-bottom: 1px solid var(--border-soft); padding: 12px 0; }
.item:last-child { border-bottom: 0; }
.item-title { font-weight: 600; color: var(--foreground); }
.item-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); background: var(--secondary); color: var(--muted-foreground); }
.badge.review { color: var(--accent); }
.badge.filed { color: var(--success); }
.badge.err { color: var(--destructive); }
.blocker { font-size: 11px; color: var(--accent); margin-top: 4px; }
.dedup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px;
  padding: 8px 10px; border: 1px solid var(--border-soft); border-radius: 8px;
  background: color-mix(in oklch, var(--accent) 10%, transparent); font-size: 12px; }
.dedup-actions { display: flex; gap: 6px; margin-left: auto; }
.collapse-h { cursor: pointer; user-select: none; }
.collapse-h .chev { display: inline-block; font-size: 12px; color: var(--muted-foreground); transition: transform .15s ease; }
.collapse-h.open .chev { transform: rotate(90deg); }
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 10px 12px; }
.search-bar:focus-within { border-color: var(--primary); }
.search-ico { display: inline-flex; color: var(--muted-foreground); }
.search-ico svg { width: 18px; height: 18px; }
.search-bar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; font-size: 16px; color: var(--foreground); }
.search-bar input:focus { outline: none; }
.search-clear { border: 0; background: transparent; color: var(--muted-foreground); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.search-clear[hidden] { display: none; }
details.filters { margin: 0 0 14px; }
details.filters > summary { cursor: pointer; color: var(--muted-foreground); font-size: 13px; padding: 4px 2px; list-style: none; user-select: none; }
details.filters > summary::-webkit-details-marker { display: none; }
details.filters > summary::before { content: '▸ '; font-size: 11px; }
details.filters[open] > summary::before { content: '▾ '; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 10px; }
.filter-grid > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted-foreground); }
.filter-grid select { width: 100%; }
.filter-grid > label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--foreground); }
.filter-grid > label.chk input { width: auto; }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type="color"] { width: 42px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches .sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-soft); cursor: pointer; padding: 0; }
.swatches .sw:hover { transform: scale(1.12); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.seg button { border: 0; background: transparent; color: var(--muted-foreground); padding: 7px 18px; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--secondary); color: var(--foreground); font-weight: 600; }
.wk-head { font-weight: 700; font-size: 14px; margin: 16px 0 6px; color: var(--foreground); }
.wk-day:first-child .wk-head { margin-top: 2px; }
.wk-time { color: var(--muted-foreground); font-weight: 600; min-width: 62px; font-variant-numeric: tabular-nums; }
.wk-range { flex: 1; text-align: center; font-weight: 600; }
.wk-filter-row { display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }
.wk-filter-row input { flex: 1; }
details.undated { margin: 4px 0 12px; }
.seg button { padding: 7px 16px; }
.card.slip { position: relative; }
.card.slip.pinned { border-left: 3px solid var(--accent); }
.slip-row { display: flex; align-items: flex-start; gap: 10px; }
.slip-main { flex: 1; min-width: 0; }
.slip-tools { display: flex; gap: 6px; flex-shrink: 0; }
.slip-title { font-weight: 600; color: var(--foreground); margin-top: 3px; }
.slip-cal { position: relative; overflow: hidden; }
.slip-cal input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; }
/* Cross-account conflict callout */
.cx-card { border-left: 3px solid var(--product-b); }
.cx-title { font-weight: 700; color: var(--product-b); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cx-title svg { width: 15px; height: 15px; }
.cx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0; font-size: 14px; }
.cx-ev { display: inline-flex; align-items: center; gap: 6px; }
.cx-x { color: var(--muted-foreground); font-size: 12px; font-style: italic; margin: 0 2px; }
.wk-cx { color: var(--product-b); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 5px; margin: 2px 0 6px; }
.wk-cx svg { width: 13px; height: 13px; }
.route-why { font-size: 12px; color: var(--muted-foreground); margin-top: 3px; }
.od-head { display: flex; align-items: center; gap: 12px; margin: 22px 0 8px; }
.od-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-foreground); cursor: pointer; user-select: none; }
.od-toggle input { width: auto; margin: 0; }
/* Overdue aging cue */
.age { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-full); white-space: nowrap; }
.age-1 { color: var(--product-b); background: color-mix(in oklab, var(--product-b) 16%, transparent); }
.age-2 { color: var(--product-a); background: color-mix(in oklab, var(--product-a) 18%, transparent); }
.age-3 { color: var(--destructive); background: color-mix(in oklab, var(--destructive) 20%, transparent); }
/* Quick-reschedule chips */
.resched-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; }
.resched-row .chip { cursor: pointer; }
.resched-pick { display: inline-flex; align-items: center; gap: 4px; }
.resched-pick input { width: auto; border: 0; background: transparent; padding: 0; color: var(--foreground); font-size: 12px; }
/* Today status hero */
.sh-card { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 16px; }
.sh-stat { font-size: 14px; color: var(--muted-foreground); }
.sh-stat b { color: var(--foreground); font-size: 16px; font-variant-numeric: tabular-nums; margin-right: 3px; }
.sh-warn b { color: var(--product-a); }
.sh-sep { color: var(--border-soft); }
/* Inline Board quick-capture */
.cap-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.cap-bar input { flex: 1; }
/* Time-blocked day timeline */
.tl-allday { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.timeline { position: relative; margin: 2px 0 4px; }
.tl-hour { position: absolute; left: 0; width: 40px; text-align: right; font-size: 11px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; transform: translateY(-7px); }
.tl-line { position: absolute; left: 48px; right: 0; border-top: 1px solid var(--border-soft); }
.tl-events { position: absolute; left: 48px; right: 4px; top: 0; bottom: 0; }
.tl-free { position: absolute; left: 0; right: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.tl-free span { font-size: 10px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-foreground); opacity: .4; }
/* Event block: a tint of the project color with a solid left edge in the full color. */
.tl-ev { position: absolute; overflow: hidden; border-radius: 7px; border: 1px solid var(--border-soft);
  border-left: 3px solid var(--muted-foreground); background: var(--secondary); box-shadow: var(--shadow-card);
  box-sizing: border-box; padding: 2px 7px; }
.tl-ev-title { font-size: 12px; font-weight: 600; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-ev-title a { color: var(--foreground); text-decoration: none; }
.tl-ev-meta { font-size: 10px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Time-blocked week grid (wide screens) — Google-Calendar style */
.content.board-wide { max-width: none; }     /* the grid fills the full desktop / iPad width */
.wg { display: flex; margin: 2px 0 16px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; background: var(--card); }
.wg-col { flex: 1 1 0; min-width: 0; border-left: 1px solid var(--border-soft); }
.wg-axiscol { flex: 0 0 52px; border-left: 0; }
.wg-today { background: color-mix(in oklab, var(--product-b) 7%, transparent); }
/* Day header: weekday small-caps over a big date number, task count + conflict flag tucked in corners. */
.wg-head { position: relative; height: 50px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: transparent; border: 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.wg-head:not(.wg-headspacer):hover { background: color-mix(in oklab, var(--secondary) 55%, transparent); }
.wg-headspacer { cursor: default; }
.wg-wd { font-size: 10px; letter-spacing: .09em; color: var(--muted-foreground); }
.wg-dn { font-size: 19px; font-weight: 600; line-height: 1; color: var(--foreground); font-variant-numeric: tabular-nums; }
.wg-today .wg-wd { color: var(--product-b); }
.wg-today .wg-dn { color: var(--product-b); }
.wg-taskbadge { position: absolute; top: 5px; right: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--secondary); border: 1px solid var(--border-soft); color: var(--muted-foreground); font-size: 10px; font-weight: 700; cursor: pointer; line-height: 16px; }
.wg-taskbadge:hover { color: var(--product-b); border-color: var(--product-b); }
.wg-cxflag { position: absolute; top: 6px; left: 6px; color: var(--product-b); display: inline-flex; }
.wg-cxflag svg { width: 12px; height: 12px; }
/* All-day band: stacked full-width colored pills, height shared across days so timelines align. */
.wg-ad-sec { display: flex; flex-direction: column; gap: 2px; padding: 2px; overflow: hidden; border-bottom: 1px solid var(--border-soft); }
.wg-ad { height: 20px; line-height: 18px; padding: 0 7px; border-radius: 4px; border-left: 3px solid var(--muted-foreground);
  background: var(--secondary); color: var(--foreground); font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.wg-track { position: relative; }
.wg-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border-soft); opacity: .5; }
.wg-hour { position: absolute; right: 6px; font-size: 10px; color: var(--muted-foreground); transform: translateY(-6px); font-variant-numeric: tabular-nums; }
.wg-track .tl-events { left: 2px; right: 2px; }
.wg .tl-ev { padding: 1px 6px; box-shadow: none; }
.wg .tl-ev-title { font-size: 11px; white-space: normal; line-height: 1.2; }
.wg .tl-ev-meta { font-size: 9px; }
/* drag-to-reschedule */
.tl-ev[data-drag="ev"], .wg-ad[data-drag="ad"] { cursor: grab; touch-action: none; }
.tl-ev.dragging { opacity: .35; }
.drag-ghost { position: fixed; z-index: 1200; opacity: .92; pointer-events: none; cursor: grabbing; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); }
.wg-col.drop { background: color-mix(in oklab, var(--product-b) 13%, transparent); box-shadow: inset 0 0 0 2px var(--product-b); }
.tl-guide { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--product-b); z-index: 6; pointer-events: none; }
.tl-guide span { position: absolute; top: -9px; left: 0; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
details.undated > summary { cursor: pointer; color: var(--muted-foreground); font-size: 13px; padding: 8px 2px; list-style: none; user-select: none; }
details.undated > summary::-webkit-details-marker { display: none; }
details.undated > summary::before { content: '▸ '; font-size: 11px; }
details.undated[open] > summary::before { content: '▾ '; }
.ptr { position: fixed; top: calc(env(safe-area-inset-top) + 6px); left: 50%; transform: translateX(-50%);
  z-index: 60; width: 38px; height: 38px; border-radius: 50%; background: var(--background);
  border: 1px solid var(--border-soft); box-shadow: var(--shadow-card);
  display: flex; align-items: center; justify-content: center; color: var(--primary); }
.ptr[hidden] { display: none; }
.ptr svg { width: 18px; height: 18px; }
.ptr.ready { color: var(--accent); }
.ptr.spin svg { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

.center { text-align: center; padding: 40px 16px; }
.brief :where(h2) { margin-top: 18px; }
.brief ul { padding-left: 18px; } .brief li { margin: 3px 0; }
.done { text-decoration: line-through; color: var(--muted-foreground); }

/* Today date navigation */
.today-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.today-nav input[type="date"] { width: auto; flex: 1; min-width: 0; }
.proj-edit:not(:empty) { margin-top: 4px; }

/* Today rows + groups */
.trow { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.trow:last-child { border-bottom: 0; }
.ev-title { flex: 1; min-width: 0; }
.ev-proj { margin-left: auto; flex-shrink: 0; }
.ev-cal { color: var(--muted-foreground); font-size: 12px; margin-left: 6px; white-space: nowrap; }
.ev-link { color: var(--foreground); text-decoration: none; }
.ev-link:hover { text-decoration: underline; }
.ev-link .ext { display: inline-flex; vertical-align: middle; margin-left: 4px; opacity: .55; }
.ev-link .ext svg { width: 12px; height: 12px; }
.gt-title { flex: 1; min-width: 0; }
/* Task actions: full toolbar on desktop; a ⋯ overflow on phones keeps rows uncluttered. */
.kebab { display: none; font-size: 20px; line-height: 1; }
@media (max-width: 819px) {
  .gtask .trow-tools { display: none; }
  .gtask .kebab { display: inline-flex; margin-left: auto; }
  .gtask.tools-open .trow-tools { display: flex; }
  .gtask.tools-open .kebab { display: none; }
}
.grp-list { font-size: 11px; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: .12em; margin: 12px 0 2px; }

/* Chat */
.content.chat { padding: 0; overflow: hidden; display: flex; flex-direction: column; max-width: var(--maxw); }
.chat-top { flex: 0 0 auto; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); text-align: right; }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; }
.chat-compose { flex: 0 0 auto; border-top: 1px solid var(--border-soft); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { min-height: 44px; max-height: 140px; }
.chat-empty { color: var(--muted-foreground); text-align: center; margin-top: 30px; position: relative; }
/* One halo per screen: a soft magenta glow behind the hero empty state. */
.chat-empty::before { content: ''; position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; transform: translate(-50%, -55%); background: var(--halo); pointer-events: none; z-index: -1; }
.msg { margin: 12px 0; display: flex; }
.msg.user { justify-content: flex-end; }
.bubble { padding: 10px 13px; border-radius: var(--radius-2xl); max-width: 86%; line-height: 1.55; }
.msg.user .bubble { background: var(--gradient-brand); color: var(--primary-foreground); border-bottom-right-radius: 4px; }
.msg.assistant .bubble { background: var(--card); border: 1px solid var(--border-soft); border-bottom-left-radius: 4px; color: var(--foreground); }
.bubble :where(h2) { margin: 10px 0 4px; } .bubble ul { padding-left: 18px; margin: 4px 0; }
.proposal { border: 1px solid color-mix(in oklab, var(--primary) 45%, transparent); border-radius: var(--radius-lg); padding: 10px 12px; margin: 8px 0 0; background: var(--secondary); }
.trail { margin: 0 0 8px; padding-left: 2px; border-left: 2px solid var(--border-soft); padding-left: 8px; }
.trail-step { font-size: 12px; color: var(--muted-foreground); line-height: 1.7; }
.trail-step::before { content: '▸ '; opacity: .7; }
.proposal .p-sum { font-size: 14px; margin-bottom: 8px; }
.proposal .p-row { font-size: 13px; margin: 2px 0; color: var(--foreground); }
.proposal .p-k { color: var(--muted-foreground); font-weight: 600; margin-right: 6px; }
.proposal .p-to { font-weight: 700; color: var(--foreground); }
.proposal .rcpt { display: inline-block; font-weight: 700; padding: 1px 7px; border-radius: 6px; }
.proposal .rcpt.internal { background: color-mix(in oklab, var(--product-b) 16%, transparent); color: var(--foreground); }
.proposal .rcpt.external { background: color-mix(in oklab, var(--destructive) 20%, transparent); color: var(--foreground); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--destructive) 55%, transparent); }
.proposal .p-warn { margin: 7px 0 4px; font-size: 12.5px; font-weight: 600; color: var(--destructive); }
.proposal .p-body { white-space: pre-wrap; font-size: 13px; line-height: 1.45; margin: 8px 0; padding: 10px 12px; background: var(--background); border: 1px solid var(--border-soft); border-radius: 8px; color: var(--foreground); }
.typing { color: var(--muted-foreground); font-size: 13px; padding: 4px 2px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%);
  background: var(--card); color: var(--foreground); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card);
  padding: 10px 16px; border-radius: var(--radius-lg); font-size: 14px; z-index: 50; max-width: 90%; }
@media (min-width: 820px) { .toast { bottom: 24px; left: calc(50% + 105px); } }
.toast-action { margin-left: 14px; background: transparent; border: 0; color: var(--accent); font-weight: 700; font-size: 14px; cursor: pointer; }

/* bulk-select bar (review queue) */
.bulkbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px);
  background: var(--card); border: 1px solid var(--border-soft); box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg); padding: 10px 14px; display: flex; align-items: center; gap: 10px; z-index: 60; }
@media (min-width: 820px) { .bulkbar { bottom: 24px; left: calc(50% + 105px); } }
.bulkbar[hidden] { display: none; }   /* the display:flex above would otherwise override [hidden] */
.bulk-check { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.btn-danger { background: transparent; color: var(--destructive); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-danger:hover { border-color: var(--destructive); }

/* Clear the Drop — focused review burn-down overlay */
#drop-overlay { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 20px;
  background: rgba(28, 26, 23, 0.40); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease; }
#drop-overlay.on { opacity: 1; }
.drop-stage { width: 100%; max-width: 440px; transition: transform .16s ease, opacity .16s ease; }
.drop-stage.leaving { transform: translateX(-28px) scale(.98); opacity: 0; }
.drop-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.drop-count { font-size: 13px; font-weight: 600; color: var(--muted-foreground); letter-spacing: .04em; }
.drop-card { background: var(--card); border: 1px solid var(--border-soft); border-radius: var(--radius-2xl);
  padding: 22px; box-shadow: var(--shadow-neon); }
.drop-kind { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--product-b); margin-bottom: 10px; }
.drop-text { font-size: 19px; line-height: 1.45; color: var(--foreground); }
.drop-why { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); font-size: 13px; color: var(--muted-foreground); }
.drop-q { margin: 22px 0 10px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.drop-projs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drop-proj { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: var(--radius-lg);
  background: var(--secondary); border: 1px solid var(--border-soft); color: var(--foreground); font-size: 14px; font-weight: 600; cursor: pointer;
  text-align: left; transition: var(--transition); }
.drop-proj:hover { border-color: var(--product-b); transform: translateY(-1px); }
.drop-proj .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.drop-proj.suggested { border-color: var(--product-b); box-shadow: inset 0 0 0 1px var(--product-b); }
.drop-hint { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--product-b); }
.drop-actions { display: flex; gap: 10px; margin-top: 16px; }
.drop-actions .btn-ghost { flex: 1 1 0; justify-content: center; }
.drop-actions .btn-ghost.danger { color: var(--destructive); }
.drop-done { text-align: center; padding: 28px 10px; }
.drop-done-mark { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--product-gradient); box-shadow: var(--shadow-neon); animation: dropPop .4s ease; }
.drop-done-mark svg { width: 38px; height: 38px; stroke-width: 2.4; }
.drop-done h2 { margin: 0 0 4px; }
.drop-done .btn { margin-top: 18px; }
@keyframes dropPop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 420px) { .drop-projs { grid-template-columns: 1fr; } }

/* Event editor sheet */
#ev-editor { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 20px;
  background: rgba(28, 26, 23, 0.40); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease; }
#ev-editor.on { opacity: 1; }
#ev-editor .sheet { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl); padding: 20px; box-shadow: var(--shadow-neon); transform: translateY(8px); transition: transform .2s ease; }
#ev-editor.on .sheet { transform: translateY(0); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 14px; }
.fld { display: block; font-size: 12px; color: var(--muted-foreground); margin-top: 12px; }
.fld input { display: block; width: 100%; box-sizing: border-box; margin-top: 5px; padding: 10px 12px; font-size: 15px;
  background: var(--jack); color: var(--foreground); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); }
.fld-row { display: flex; gap: 10px; }
.fld-row .fld { flex: 1 1 0; }
.sheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.sheet-actions .btn { margin-left: auto; }
.sheet-actions .btn-ghost.danger { color: var(--destructive); }
.tapedit { cursor: pointer; }
.scope-seg { display: inline-flex; margin-bottom: 4px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; }
.scope-seg button { background: transparent; border: 0; color: var(--muted-foreground); font-size: 13px; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.scope-seg button.on { background: var(--secondary); color: var(--foreground); }
#ev-time.disabled { opacity: .4; pointer-events: none; }

/* All-clear state — the router at rest */
.card.allclear { text-align: center; padding: 40px 24px; }
.allclear .ac-mark { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center;
  color: var(--product-b); border: 1.5px solid color-mix(in oklab, var(--product-b) 45%, transparent);
  background: color-mix(in oklab, var(--product-b) 10%, transparent); }
.allclear .ac-mark svg { width: 34px; height: 34px; }
.allclear .ac-title { font-size: 20px; font-weight: 600; color: var(--foreground); }
.allclear .ac-sub { margin-top: 6px; font-size: 14px; color: var(--muted-foreground); max-width: 320px; margin-inline: auto; }

/* Neon flicker-on: the switchboard lamp warming up, once on cold load */
@keyframes relayFlicker {
  0% { opacity: .12; filter: none; }
  9% { opacity: .85; }
  13% { opacity: .18; }
  22% { opacity: 1; filter: drop-shadow(0 0 6px var(--product-b)); }
  28% { opacity: .45; }
  36% { opacity: 1; filter: drop-shadow(0 0 5px var(--product-b)); }
  64% { filter: drop-shadow(0 0 2px color-mix(in oklab, var(--product-b) 45%, transparent)); }
  100% { opacity: 1; filter: none; }
}
.brand-mark { animation: relayFlicker 1.15s ease-out both; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .brand-mark { animation: none; } }

/* Billing — paywall, trial/past-due banner, Settings subscription */
.billing-banner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 16px; font-size: 13px; font-weight: 600; background: var(--product-c); color: var(--foreground);
  border-bottom: 1px solid var(--border); }
.billing-banner.warn { background: color-mix(in oklab, var(--destructive) 16%, var(--background)); }
.billing-banner .link-btn { background: none; border: none; padding: 0; font: inherit; font-weight: 700;
  color: var(--primary); text-decoration: underline; cursor: pointer; }
.pay-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
