/* HGB Mates console — HGB brand (amber on charcoal and cream), Apple-style restraint and motion.
   Montserrat (SIL Open Font License) is self-hosted for headings; the system font carries the UI text. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/montserrat-latin.woff2") format("woff2");
}

:root {
  /* Brand */
  --amber: #be7914;
  --amber-press: #af7014;
  --amber-soft: #be79141f;
  --charcoal: #242424;
  --cream: #faf6f0;

  /* Surfaces and text (light) */
  --bg: var(--cream);
  --surface: #ffffff;
  --surface-2: #f4efe7;
  --text: #1d1b18;
  --muted: #6e675d;
  --faint: #a39b8f;
  --line: #e9e1d4;
  --accent: var(--amber);
  --accent-press: var(--amber-press);
  --on-accent: #ffffff;
  --accent-text: #9a6210; /* amber text with AA contrast on light surfaces */
  --ok: #2f7d4f;
  --ok-soft: #2f7d4f1a;
  --danger: #b3372b;
  --danger-soft: #b3372b14;
  --sidebar: var(--charcoal);
  --sidebar-text: #f1ece4;
  --sidebar-muted: #a8a197;
  --shadow-sm: 0 1px 2px #2424240f, 0 1px 1px #2424240a;
  --shadow-md: 0 1px 2px #24242414, 0 8px 24px -8px #24242426;
  --shadow-lg: 0 2px 6px #2424241a, 0 24px 60px -12px #24242440;
  --glass: #faf6f0b8;
  --scrim: #2424244d;

  /* Shape, rhythm, motion */
  --radius-sm: 0.5rem;
  --radius: 0.875rem;
  --radius-lg: 1.25rem;
  --ease: cubic-bezier(0.32, 0.72, 0, 1); /* critically damped feel: fast out, soft settle */
  --ease-in: cubic-bezier(0.72, 0, 1, 0.32); /* the mirrored curve for the way back */
  --dur: 0.4s;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", var(--font-ui);

  color-scheme: light;
  font: 100%/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1918;
    --surface: #242322;
    --surface-2: #2c2a28;
    --text: #f1ece4;
    --muted: #a8a197;
    --faint: #756f66;
    --line: #36332f;
    --accent: #d18a22;
    --accent-press: #be7914;
    --on-accent: #1a1308;
    --accent-text: #e3a24a;
    --amber-soft: #d18a2224;
    --ok: #6cc08e;
    --ok-soft: #6cc08e1f;
    --danger: #f08a7e;
    --danger-soft: #f08a7e1a;
    --sidebar: #121211;
    --shadow-sm: 0 1px 2px #0000004d;
    --shadow-md: 0 1px 2px #00000059, 0 8px 24px -8px #00000080;
    --shadow-lg: 0 2px 6px #00000066, 0 24px 60px -12px #000000a6;
    --glass: #1a1918b8;
    --scrim: #0000008c;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
img { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ---------- Type: size-specific tracking and leading ---------- */
h1, h2, h3, .display { font-family: var(--font-display); color: var(--text); margin: 0; }
.display { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
h1 { font-size: 1.75rem; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h2 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.01em; font-weight: 650; }
h3 { font-size: 0.9375rem; line-height: 1.35; font-weight: 650; }
p { margin: 0; }
.lede { font-size: 1.0625rem; line-height: 1.55; color: var(--muted); max-width: 40rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; line-height: 1.45; letter-spacing: 0.005em; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons: feedback on press, instantly ---------- */
.btn {
  --b-bg: var(--accent); --b-fg: var(--on-accent); --b-line: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.5rem; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-fg); font: 600 0.9375rem/1 var(--font-ui); letter-spacing: -0.005em;
  cursor: pointer; white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 0.1s ease-out, background-color 0.15s ease-out, opacity 0.15s ease-out;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn.primary:active, .btn:not(.secondary):not(.ghost):not(.danger):active { --b-bg: var(--accent-press); }
.btn.secondary { --b-bg: var(--surface); --b-fg: var(--text); --b-line: var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:active { --b-bg: var(--surface-2); }
.btn.ghost { --b-bg: transparent; --b-fg: var(--text); padding: 0 0.75rem; }
.btn.ghost:hover { --b-bg: var(--surface-2); }
.btn.danger { --b-bg: transparent; --b-fg: var(--danger); --b-line: var(--line); }
.btn.danger:active { --b-bg: var(--danger-soft); }
.btn.small { min-height: 2rem; padding: 0 0.85rem; font-size: 0.8125rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

/* ---------- Fields: validated inline ---------- */
.field { display: grid; gap: 0.375rem; }
.field + .field, .field + .grid-2, .grid-2 + .field { margin-top: 1rem; }
label, .label { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.hint { font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.field-error { font-size: 0.8125rem; color: var(--danger); min-height: 0; }
.field-error:empty { display: none; }
input, select, textarea {
  font: inherit; font-size: 0.9375rem; color: var(--text); width: 100%;
  min-height: 2.75rem; padding: 0.625rem 0.875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
textarea { line-height: 1.55; resize: vertical; min-height: 10rem; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.875rem; }
select { appearance: none; padding-right: 2.25rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 50%, calc(100% - 0.8rem) 50%; background-size: 0.3rem 0.3rem; background-repeat: no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--amber-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--danger); }
input[type="range"] { min-height: 0; padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { display: none; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 14rem; min-width: 0; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 1.5rem; }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card-head p { margin-top: 0.25rem; }
.stack > * + * { margin-top: 1rem; }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; }

.pill { display: inline-flex; align-items: center; gap: 0.375rem; height: 1.625rem; padding: 0 0.625rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.live { background: var(--amber-soft); color: var(--accent-text); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.plain::before { display: none; }

.notice { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.875rem 1rem; border-radius: var(--radius);
  background: var(--surface-2); font-size: 0.875rem; line-height: 1.5; }
.notice.warn { background: var(--amber-soft); }
.notice.error { background: var(--danger-soft); color: var(--danger); }

.avatar { width: 2.75rem; height: 2.75rem; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--amber), #8f5a0e); color: #fff; font: 700 1rem/1 var(--font-display); letter-spacing: -0.02em; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 4.5rem; height: 4.5rem; font-size: 1.625rem; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 0.25rem; }

/* ---------- App shell: a heavy structural sidebar, a light content area ---------- */
.shell { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.5rem;
  padding: 1.5rem 1rem; background: var(--sidebar); color: var(--sidebar-text); }
.wordmark { display: flex; align-items: center; gap: 0.625rem; padding: 0 0.5rem; color: inherit; font: 700 1rem/1.2 var(--font-display); letter-spacing: -0.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark .mark { width: 2rem; height: 2rem; border-radius: 0.625rem; background: var(--amber); display: grid; place-items: center; flex: none; }
.wordmark .mark svg { width: 100%; height: 100%; }
.wordmark small { display: block; font: 500 0.75rem/1.3 var(--font-ui); color: var(--sidebar-muted); letter-spacing: 0; }
.nav { display: grid; gap: 0.125rem; }
.nav a { display: flex; align-items: center; gap: 0.75rem; min-height: 2.5rem; padding: 0 0.75rem; border-radius: 0.625rem;
  color: var(--sidebar-muted); font-weight: 550; font-size: 0.9375rem; transition: background-color 0.15s ease-out, color 0.15s ease-out; }
.nav a:hover { color: var(--sidebar-text); background: #ffffff0d; text-decoration: none; }
.nav a:active { background: #ffffff14; }
.nav a[aria-current="page"] { color: var(--sidebar-text); background: #ffffff17; }
.nav a[aria-current="page"] svg { color: var(--amber); }
.nav svg { width: 1.125rem; height: 1.125rem; flex: none; }
.nav .badge { margin-left: auto; min-width: 1.25rem; height: 1.25rem; padding: 0 0.375rem; border-radius: 999px; background: var(--amber); color: #fff;
  font-size: 0.6875rem; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: 0.75rem; padding: 0.75rem 0.5rem 0; border-top: 1px solid #ffffff14; }
.sidebar-foot select { background: #ffffff0f; border-color: #ffffff1a; color: var(--sidebar-text); min-height: 2.25rem; font-size: 0.8125rem; }
.me { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.me .avatar { width: 2rem; height: 2rem; font-size: 0.8125rem; background: #ffffff1f; }
.me-text { min-width: 0; font-size: 0.8125rem; line-height: 1.35; }
.me-text strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text span { color: var(--sidebar-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .btn.ghost { --b-fg: var(--sidebar-muted); justify-content: flex-start; padding: 0 0.5rem; min-height: 2rem; font-size: 0.8125rem; }
.sidebar .btn.ghost:hover { --b-bg: #ffffff0d; --b-fg: var(--sidebar-text); }

.content { min-width: 0; padding: 2.5rem clamp(1rem, 4vw, 3rem) 4rem; }
.view { max-width: 60rem; margin: 0 auto; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.view-head p { margin-top: 0.375rem; }
.view[data-entering] { animation: view-in 0.35s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Employees ---------- */
.employee-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.employee-card { position: relative; display: flex; flex-direction: column; gap: 1rem; text-align: left; width: 100%; padding: 1.25rem;
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: transform 0.1s ease-out, box-shadow 0.2s ease-out, border-color 0.2s ease-out; }
.employee-card:hover { box-shadow: var(--shadow-md); border-color: #be791440; }
.employee-card:active { transform: scale(0.985); }
.employee-card .who { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.employee-card .who > div { min-width: 0; }
.employee-card h3 { font-size: 1.0625rem; letter-spacing: -0.01em; }
.employee-card .role { font-size: 0.875rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.employee-card .meta { display: flex; gap: 0.375rem; flex-wrap: wrap; margin-top: auto; }
.employee-card.new { align-items: center; justify-content: center; min-height: 9.5rem; border-style: dashed; box-shadow: none; background: transparent; color: var(--muted); font-weight: 600; }
.employee-card.new:hover { color: var(--accent-text); border-color: var(--accent); }
.employee-card.new .plus { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--amber-soft); color: var(--accent-text); font-size: 1.5rem; line-height: 1; }

/* ---------- Sheet: in from the right, out to the right; dims to focus ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none;
  transition: opacity var(--dur) var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(36rem, 100vw); display: flex; flex-direction: column;
  background: var(--bg); box-shadow: var(--shadow-lg); transform: translateX(104%); visibility: hidden;
  transition: transform var(--dur) var(--ease-in), visibility 0s linear var(--dur); will-change: transform; }
.sheet.open { transform: none; visibility: visible; transition: transform var(--dur) var(--ease), visibility 0s; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem;
  background: var(--glass); backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.sheet-head .title { min-width: 0; flex: 1; }
.sheet-head h2 { font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0.5rem 1.5rem 1.5rem; }
.sheet-body .card { padding: 1.25rem; }
.sheet-body .card h3 { margin-bottom: 0.875rem; }
.sheet-foot { display: flex; gap: 0.5rem; align-items: center; padding: 1rem 1.5rem; border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .spacer { flex: 1; }
.icon-btn { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; flex: none;
  background: var(--surface-2); color: var(--text); transition: transform 0.1s ease-out, background-color 0.15s ease-out; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 1rem; height: 1rem; }

.photo { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.photo-frame { width: 12rem; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--charcoal); flex: none;
  display: grid; place-items: center; color: var(--sidebar-muted); font-size: 0.75rem; }
/* avatarFrame stores a 640×360 camera image with a 312×312 photo at (24, 24).
   Employee previews show only that photo, including for already saved camera images. */
.employee-photo { position: relative; }
.employee-photo > img { position: absolute; width: calc(100% * 640 / 312); height: calc(100% * 360 / 312);
  max-width: none; left: calc(-100% * 24 / 312); top: calc(-100% * 24 / 312); }
.rate { display: flex; align-items: center; gap: 0.75rem; }
.rate output { min-width: 3rem; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 0.875rem; }

/* ---------- Meetings ---------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 12rem auto; gap: 0.625rem; align-items: end; }
.meeting-list { display: grid; gap: 1rem; margin-top: 1.25rem; }
.meeting { display: grid; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); animation: rise 0.4s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
.meeting-top { display: flex; align-items: center; gap: 0.875rem; }
.meeting-top .grow { min-width: 0; }
.meeting-top h3 { font-size: 1rem; }
.meeting-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); }
.meeting-stats strong { display: block; color: var(--text); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.approval { display: grid; gap: 0.75rem; padding: 1rem; border-radius: var(--radius); background: var(--amber-soft); border: 1px solid #be791433; }
.approval p { font-size: 0.9375rem; line-height: 1.5; }
.lat { font-variant-numeric: tabular-nums; }
.lat.ok { color: var(--ok); }
.lat.slow { color: var(--danger); }

/* ---------- Lists (integrations, platform, audit) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.provider { display: flex; gap: 1rem; align-items: center; }
.provider-mark { width: 3rem; height: 3rem; border-radius: 0.875rem; flex: none; display: grid; place-items: center; background: #0c66e4; color: #fff; }
.provider-mark.github { background: #24292f; }
.provider-mark.teams { background: #4b53bc; }
.provider-mark.zoom { background: #0b5cff; }
.check { display: flex; gap: 0.625rem; align-items: flex-start; font-size: 0.9375rem; line-height: 1.4; cursor: pointer; }
.check input { width: 1.125rem; height: 1.125rem; min-height: 0; margin: 0.1rem 0 0; padding: 0; border: 0; box-shadow: none; background: none; accent-color: var(--accent); flex: none; }
.check + .check { margin-top: 0.75rem; }
.platform-settings { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.platform-settings .grid-2 { margin-top: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: start; }
.grid-2 > .field + .field { margin-top: 0; }
.always { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.25rem; font-size: 0.8125rem; color: var(--muted); }
.always li::before { content: "✓  "; color: var(--ok); }
.row.spaced { margin-top: 1rem; }
.provider-mark svg { width: 1.5rem; height: 1.5rem; }
.integration-group { margin-top: 2rem; }
.integration-group > .stack { margin-top: 1rem; }
.integration-group h2, .integration-card { scroll-margin-top: 10rem; }
.integration-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; cursor: pointer; list-style: none; }
.integration-card > summary::-webkit-details-marker { display: none; }
.integration-card .provider { min-width: 0; flex-basis: 16rem; }
.integration-card .provider > div { min-width: 0; overflow-wrap: anywhere; }
.integration-actions { margin-left: auto; }
.integration-manage { display: inline-flex; padding: 0.375rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 600; }
.integration-card .when-open, .integration-card[open] .when-closed { display: none; }
.integration-card[open] .when-open { display: inline; }
.settings-scope { margin: 0.25rem 0 1rem; }
.result { font-size: 0.875rem; }
.result.error { color: var(--danger); }

.meter { height: 0.5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 0.75rem; }
.meter > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.6s var(--ease); }
.meter.full > span { background: var(--danger); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.stat .value { font: 700 1.75rem/1.1 var(--font-display); letter-spacing: -0.02em; margin-top: 0.25rem; font-variant-numeric: tabular-nums; }

.workspace-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem 1rem; align-items: center; width: 100%; }
.workspace-row .controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.workspace-row select { width: auto; min-height: 2.25rem; font-size: 0.8125rem; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.875rem 0; border-top: 1px solid var(--line); font-size: 0.875rem; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
.timeline .what { display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.timeline .detail { color: var(--muted); margin-top: 0.25rem; overflow-wrap: anywhere; }

/* ---------- Toasts: status, completion, warning, error ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 1.5rem; transform: translateX(-50%); display: grid; gap: 0.5rem; justify-items: center;
  width: min(28rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { display: flex; gap: 0.625rem; align-items: center; padding: 0.75rem 1.125rem; border-radius: 999px; pointer-events: auto;
  background: var(--charcoal); color: #f6f1e9; font-size: 0.875rem; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toast-in 0.4s var(--ease) both; }
.toast.leaving { animation: toast-out 0.25s var(--ease-in) both; }
.toast.error { background: #7e2219; }
.toast::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--amber); flex: none; }
.toast.ok::before { background: #6cc08e; }
.toast.error::before { background: #ffb4a9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px) scale(0.96); } }

/* ---------- Sign-in and pricing (public pages) ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.875rem clamp(1rem, 4vw, 2.5rem); background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
.public-bar .wordmark { color: var(--text); padding: 0; }
.public-bar .wordmark small { color: var(--muted); }
.public-main { flex: 1; display: grid; place-items: center; padding: 2rem 1rem 4rem; }
.auth { width: min(26rem, 100%); }
.auth .card { padding: 2rem; box-shadow: var(--shadow-md); }
.auth h1 { margin-bottom: 0.5rem; }
.auth form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.step { animation: step-in 0.4s var(--ease) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(16px); } }
.code-input { text-align: center; font: 600 1.75rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.5em; padding-left: 1.25rem; min-height: 3.5rem; }
.auth .error { color: var(--danger); font-size: 0.875rem; }
.fine { margin-top: 1.25rem; text-align: center; font-size: 0.8125rem; color: var(--muted); }

.pricing { width: min(68rem, 100%); }
.pricing-head { text-align: center; display: grid; gap: 1rem; justify-items: center; margin-bottom: 2.5rem; }
.segmented { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 0.25rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.segmented button { position: relative; z-index: 1; min-height: 2.25rem; padding: 0 1.25rem; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 0.875rem/1 var(--font-ui); color: var(--muted); transition: color 0.2s ease-out; }
.segmented button[aria-checked="true"] { color: var(--text); }
.segmented .thumb { position: absolute; z-index: 0; top: 0.25rem; bottom: 0.25rem; left: 0.25rem; width: calc(50% - 0.25rem); border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease); }
.segmented[data-value="yearly"] .thumb { transform: translateX(100%); }
.segmented .save { color: var(--accent-text); font-size: 0.75rem; margin-left: 0.25rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem; }
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.plan .tag { position: absolute; top: -0.75rem; left: 1.75rem; }
.plan .tag.pill { background: var(--accent); color: var(--on-accent); }
.plan .price { font: 700 2.5rem/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan .price small { font: 500 0.9375rem/1 var(--font-ui); letter-spacing: 0; color: var(--muted); margin-left: 0.25rem; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; font-size: 0.9375rem; }
.plan li { display: flex; gap: 0.625rem; align-items: flex-start; }
.plan li::before { content: ""; flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; border-radius: 50%;
  background: var(--amber-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.5l2.2 2.2 4.8-5' fill='none' stroke='%23be7914' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.875rem no-repeat; }
.plan .btn { margin-top: auto; }
.pricing-foot { text-align: center; margin-top: 2rem; display: grid; gap: 0.5rem; }

/* ---------- Small screens: the sidebar becomes a translucent top bar ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
    padding: 0.75rem 1rem; background: color-mix(in srgb, var(--sidebar) 88%, transparent);
    backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%); }
  /* Phones show which workspace this is (and can switch), like the sidebar does on larger screens. */
  .wordmark small { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { order: 3; width: 100%; display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; margin: 0 -0.25rem; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; min-height: 2.25rem; font-size: 0.875rem; }
  .sidebar-foot { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; align-items: center; gap: 0.5rem; }
  .sidebar-foot .me-text { display: none; }
  .sidebar-foot select { max-width: 9.5rem; min-height: 2rem; padding-block: 0; }
  .content { padding-top: 1.5rem; }
  .composer { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .workspace-row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .sheet, .sheet.open { transform: none; opacity: 0; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
  .sheet.open { opacity: 1; transition: opacity 0.2s ease, visibility 0s; }
  .btn:active, .employee-card:active, .icon-btn:active { transform: none; }
  .segmented .thumb, .meter > span { transition-duration: 0.01ms; }
}
@media (prefers-reduced-transparency: reduce) {
  .sheet-head, .public-bar { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .sidebar { background: var(--sidebar) !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root { --line: #8c8478; --muted: #4d473f; }
  .card, .employee-card, .meeting { box-shadow: none; }
  .sheet-head, .public-bar { background: var(--bg); backdrop-filter: none; border-bottom: 1px solid var(--line); }
}
.auth .error { margin-top: 1rem; }
.stat-grid > .card + .card, .plans > .card + .card { margin-top: 0; }
.view > .notice { margin-bottom: 1rem; }
.view > .notice + .stat-grid, .stat-grid + .notice { margin-top: 1rem; }
.composer + .hint { margin-top: 0.75rem; padding: 0 0.25rem; }
.meeting-composer { grid-template-columns: minmax(0, 1fr) auto; }
.picker { grid-column: 1 / -1; border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.5rem; }
.picker legend { padding: 0; margin-bottom: 0.5rem; }
.picker legend .muted { font-weight: 400; margin-left: 0.375rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; padding: 0 0.875rem 0 0.375rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); font-weight: 500; cursor: pointer; user-select: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.1s var(--ease); }
.chip:active { transform: scale(0.97); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--amber-soft); }
.chip:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip .order { width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.6875rem; font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.chip:has(input:checked) .order { background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) { .chip { transition: none; } .chip:active { transform: none; } }
.view-head .row select { width: auto; min-width: 11rem; }
.timeline li.empty { display: block; }

/* ---------- Legal pages ---------- */
.legal { flex: 1; padding: 2rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.legal article { width: min(46rem, 100%); margin: 0 auto; }
.legal .display { margin: 0.5rem 0 1rem; }
.legal .lede { margin-bottom: 0.75rem; }
.legal h2 { font-size: 1.25rem; margin: 2.5rem 0 0.75rem; scroll-margin-top: 5rem; }
.legal h3 { font-size: 1rem; margin: 1.5rem 0 0.5rem; }
.legal p, .legal li { font-size: 1rem; line-height: 1.65; }
.legal p + p { margin-top: 0.75rem; }
.legal ul { padding-left: 1.25rem; margin: 0.5rem 0 0; display: grid; gap: 0.5rem; }
.legal .toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.75rem 0 0.5rem; padding: 1rem; border-radius: var(--radius); background: var(--surface-2); }
.legal .toc a { font-size: 0.8125rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--surface); }
.legal .contact { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0.75rem 0 1.5rem; }
.legal .contact dt { font-weight: 600; }
.legal .contact dd { margin: 0; }
.site-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 1.5rem 1rem 2rem; font-size: 0.8125rem; }
.site-foot a { color: var(--muted); }
.fine a { color: var(--muted); text-decoration: underline; text-underline-offset: 0.15em; }
.legal-links { font-size: 0.75rem; color: var(--sidebar-muted); padding: 0 0.5rem; }
.legal-links a { color: var(--sidebar-muted); }
.app-version { font-variant-numeric: tabular-nums; color: var(--faint); }
.app-version:empty { display: none; }
.legal-links .app-version { color: inherit; }
.legal-links .app-version::before { content: "· "; }
@media (max-width: 860px) { .legal-links { display: none; } }
.composer.invite { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 9rem auto; }
.member { display: flex; gap: 0.875rem; align-items: center; min-width: 0; }
.member .avatar { width: 2.25rem; height: 2.25rem; font-size: 0.875rem; }
.list select { width: auto; min-height: 2.25rem; font-size: 0.8125rem; }
@media (max-width: 860px) { .composer.invite { grid-template-columns: minmax(0, 1fr); } }
.card .row select { width: auto; min-width: 9rem; }
.hint + .card, .card + .card { margin-top: 1rem; }
.workspace-members { width: 100%; margin-top: 0.5rem; }
.workspace-members summary { cursor: pointer; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }

