/* Maxify Office. Plain CSS, no build step.
   The design system is Maxify ID's (maxify-id's/static/css/input.css): the Maxify palette, Lexend
   throughout on a compact type scale, restrained radii (6px controls, 8px cards, 12px ceiling)
   and quiet elevation where a hairline border does the work. Keep the two products in step. */

/* Lexend — self-hosted variable font (latin subset), no CDN dependency. */
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/lexend-var.7e692144d823.woff2") format("woff2"); }

:root {
  /* Brand / blue scale */
  --primary: #107bef;
  --primary-hover: #0f70d9;
  --primary-subtle: #eff6ff;
  --blue-50: #e7f2fd;
  --blue-100: #b5d6fa;
  --blue-200: #91c2f8;

  /* Semantic. No other hues: reach for a blue shade before introducing a new colour. */
  --success: #049148;
  --error: #ff3b30;
  --warning: #b45309;
  --secondary: #001234;

  /* Neutrals */
  --heading: #121212;
  --body: #333333;
  --muted: #6d6d6d;
  --border: #eaeaea;
  --surface: #ffffff;
  --surface-muted: #f6f6f6;

  /* Tints (Tailwind's colour/10 and colour/5 in Maxify ID) */
  --success-tint: rgba(4, 145, 72, 0.1);
  --error-tint: rgba(255, 59, 48, 0.1);
  --error-wash: rgba(255, 59, 48, 0.05);
  --warning-tint: rgba(180, 83, 9, 0.1);
  --ring: rgba(16, 123, 239, 0.3);

  /* Geometry */
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-surface: 10px;
  --shadow-sm: 0 1px 2px rgba(18, 18, 18, 0.05);
  --shadow-lg: 0 8px 24px -12px rgba(18, 18, 18, 0.2);
  --shadow-xl: 0 18px 48px -16px rgba(18, 18, 18, 0.28);

  --font: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 256px;
  --topbar-h: 61px;
  --control-h: 40px;

  /* Older names still used by a few templates. */
  --brand: var(--primary);
  --brand-hover: var(--primary-hover);
  --brand-subtle: var(--primary-subtle);
  --brand-ring: var(--blue-100);
  --ink: var(--heading);
  --ink-muted: var(--body);
  --ink-subtle: var(--muted);
  --canvas: var(--surface-muted);
  --hairline: var(--border);
  --control: var(--border);
  --danger: var(--error);
  --danger-subtle: var(--error-tint);
  --success-subtle: var(--success-tint);
  --warning-subtle: var(--warning-tint);
}

/* Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 18px;
  color: var(--body);
  background: var(--surface-muted);
  /* Lexend's alternate glyphs (single-storey a/g, straight l) and slightly tightened tracking. */
  letter-spacing: -0.01em;
  font-feature-settings: "cv01", "cv02", "cv03", "cv04";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { letter-spacing: inherit; font-feature-settings: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { color: var(--heading); margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 22px; line-height: 28px; letter-spacing: -0.03em; }
h2 { font-size: 16px; line-height: 24px; }
h3 { font-size: 14px; line-height: 20px; }
p { margin: 0 0 8px; }
code { font-family: var(--mono); font-size: 12px; color: var(--body); }
small, .muted { color: var(--muted); }
.faint { color: var(--muted); }
table, .tabular { font-variant-numeric: tabular-nums; }
[x-cloak] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

ion-icon { font-size: 18px; width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { font-size: 16px; width: 16px; height: 16px; }

/* App shell ------------------------------------------------------------ */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  padding: 20px 20px 16px;
  color: var(--heading); font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.03em;
}
.brand:hover { text-decoration: none; color: var(--heading); }
.brand img, .mobile-brand img, .auth-logo img { display: block; height: auto; max-width: 100%; }
.nav { flex: 1; overflow-y: auto; padding: 0 12px 16px; }
.nav-section {
  font-size: 11px; line-height: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); padding: 20px 12px 4px;
}
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-control);
  color: var(--body); font-weight: 600;
  transition: background-color 0.15s, color 0.15s;
}
.nav a ion-icon { color: currentColor; }
.nav a:hover { background: var(--surface-muted); color: var(--heading); text-decoration: none; }
.nav a.active, .nav a.active:hover { background: var(--primary-subtle); color: var(--primary); }
.nav .count, .chat-group .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px;
  background: var(--primary); color: #fff; font-size: 11px; line-height: 20px; font-weight: 600; text-align: center;
}
.sidebar-foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 12px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-control); color: var(--body); }
.sidebar-user:hover { background: var(--surface-muted); text-decoration: none; }
.sidebar-user .who { min-width: 0; }
.sidebar-user .name { display: block; font-weight: 500; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta { display: block; font-size: 11px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot form { margin: 0; }
.sidebar-foot .side-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: var(--radius-control); background: none;
  font: inherit; font-weight: 600; color: var(--body); cursor: pointer; text-align: left;
}
.sidebar-foot .side-link:hover { background: var(--surface-muted); color: var(--heading); text-decoration: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.topbar .menu-toggle { display: none; }
.topbar .mobile-brand { display: none; }
.role-pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 9999px;
  border: 1px solid rgba(16, 123, 239, 0.4); color: var(--primary); font-size: 11px; font-weight: 500; white-space: nowrap;
}
.content { flex: 1; width: 100%; max-width: 1152px; margin: 0 auto; padding: 24px; }
.app-footer { border-top: 1px solid var(--border); padding: 16px 0; }
.app-footer p { max-width: 1152px; margin: 0 auto; padding: 0 24px; font-size: 11px; line-height: 16px; color: var(--muted); }

/* Page heading (Maxify ID .page-heading) */
.page-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border);
}
.page-head > div:first-child { min-width: 0; flex: 1 1 360px; }
.page-head h1 { margin-top: 4px; font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -0.03em; }
.page-head .sub { display: block; max-width: 672px; margin-top: 4px; font-size: 13px; line-height: 24px; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { font-size: 11px; line-height: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary); }
.eyebrow a { color: inherit; }

/* Surfaces ------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; min-height: 24px; flex-wrap: wrap; }
.card-head .right { margin-left: auto; }
.card > h2, .card > h3 { margin-bottom: 16px; }
.card.flush > .card-head { padding: 16px 20px; margin-bottom: 0; border-bottom: 1px solid var(--border); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.section { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.empty { color: var(--muted); padding: 48px 16px; text-align: center; font-size: 13px; }

/* Stats (Maxify ID dashboard tiles) */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--body); }
.stat .value { font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -0.03em; color: var(--heading); font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat .foot { font-size: 11px; line-height: 16px; color: var(--muted); }

/* Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 18px;
  border: 1px solid var(--border); border-radius: var(--radius-control);
  background: var(--surface); color: var(--body);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 18px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.btn ion-icon { font-size: 16px; width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-subtle); }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: var(--error); border-color: var(--error); color: #fff; opacity: 0.9; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--body); }
.btn-ghost:hover { background: var(--surface-muted); border-color: transparent; color: var(--heading); }
.btn-sm { height: 30px; padding: 0 12px; gap: 6px; font-size: 11px; line-height: 16px; font-weight: 500; }
.btn-sm.btn-primary, .btn-sm.btn-danger { font-weight: 600; }
.btn-sm ion-icon { font-size: 14px; width: 14px; height: 14px; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-ghost.btn-icon ion-icon { font-size: 20px; width: 20px; height: 20px; }
.btn[disabled], .btn[disabled]:hover { cursor: not-allowed; background: var(--surface-muted); border-color: var(--border); color: var(--muted); }
/* Segmented toggle (Maxify ID "Today / This week" pills) */
.btn-group { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.btn-group .btn {
  height: 24px; padding: 0 10px; border: 0; border-radius: 9999px; background: transparent;
  color: var(--body); font-size: 11px; line-height: 16px; font-weight: 500;
}
.btn-group .btn:hover { background: transparent; color: var(--primary); }
.btn-group .btn.active, .btn-group .btn.active:hover { background: var(--primary); color: #fff; }
.htmx-request.btn, .htmx-request .btn[type=submit] { opacity: 0.6; pointer-events: none; }

/* Forms ---------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--body); margin-bottom: 6px; }
.field .optional { color: var(--muted); font-weight: 400; }
.field .help { color: var(--muted); font-size: 11px; line-height: 16px; margin-top: 6px; }
.field .help ul { display: block; margin: 0; padding-left: 16px; }
.field .errors { color: var(--error); font-size: 11px; line-height: 16px; font-weight: 500; margin-top: 6px; }
.form-errors {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; padding: 10px 12px;
  background: var(--error-wash); border: 1px solid rgba(255, 59, 48, 0.25); border-radius: var(--radius-control);
  color: var(--error); font-size: 13px; font-weight: 500;
}
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=url], input[type=tel], input[type=file], select, textarea {
  width: 100%; height: var(--control-h); padding: 0 12px;
  font: inherit; font-size: 13px; line-height: 18px; color: var(--body);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control);
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=file] { padding: 8px 12px; height: auto; }
select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23333333' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select[multiple] { height: auto; padding: 4px; background-image: none; }
select[multiple] option { padding: 6px 8px; border-radius: 4px; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.field ul label { font-weight: 400; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--body); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }

/* Filters sit on the page like Maxify ID's search row, not in a box. */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input[type=search], .filters input[type=date] { width: auto; min-width: 160px; }
.filters input[type=search] { flex: 1 1 240px; min-width: 220px; }
.filters .check { margin-left: 4px; }

/* Tables (Maxify ID .data-table) --------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.table th {
  text-align: left; font-size: 11px; line-height: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); background: var(--surface-muted); border-bottom: 1px solid var(--border);
  padding: 10px 16px; white-space: nowrap;
}
.table td { border-bottom: 1px solid var(--border); padding: 10px 16px; vertical-align: middle; color: var(--body); }
.table td strong { color: var(--heading); font-weight: 600; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions-cell { text-align: right; white-space: nowrap; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 20px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 20px; }

/* Badges (Maxify ID .status-chip) -------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
  height: 26px; padding: 0 10px; border: 0; border-radius: 9999px;
  font-size: 11px; line-height: 18px; font-weight: 600; white-space: nowrap;
  background: var(--surface-muted); color: var(--muted);
}
.badge.backlog { background: var(--surface-muted); color: var(--muted); }
.badge.in_progress, .badge.brand { background: var(--primary-subtle); color: var(--primary); }
.badge.in_review { background: var(--primary-subtle); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(16, 123, 239, 0.4); }
.badge.completed, .badge.good { background: var(--success-tint); color: var(--success); }
.badge.deployed_staging { background: var(--success-tint); color: var(--success); box-shadow: inset 0 0 0 1px rgba(4, 145, 72, 0.4); }
.badge.deployed_main { background: var(--success); color: #fff; }
.badge.warn, .badge.high { background: var(--warning-tint); color: var(--warning); }
.badge.bad, .badge.urgent { background: var(--error-tint); color: var(--error); }

.status-mark { width: 8px; height: 8px; border-radius: 9999px; display: inline-block; background: var(--border); flex-shrink: 0; }
.status-mark.working { background: var(--success); }
.status-mark.meeting { background: var(--body); }
.status-mark.focusing { background: var(--primary); }
.status-mark.on_leave { background: var(--warning); }
.status-mark.offline { background: #d4d4d4; }

/* Scores and meters */
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.high { color: var(--success); }
.score.mid { color: var(--warning); }
.score.low { color: var(--error); }
.meter { height: 6px; background: var(--surface-muted); border-radius: 9999px; overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 9999px; background: var(--primary); }
.meter.good > span { background: var(--success); }
.meter.warn > span { background: var(--warning); }
.meter.bad > span { background: var(--error); }

/* Tasks ---------------------------------------------------------------- */
.task-title { font-weight: 600; color: var(--heading); }
a.task-title:hover, .task-title a:hover { color: var(--primary); text-decoration: none; }
.task-meta { color: var(--muted); font-size: 11px; line-height: 16px; }
.overdue { color: var(--error); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.column { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; min-height: 280px; }
.column.drag-over { background: var(--primary-subtle); border-color: var(--primary); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 12px; }
.column-head .n { color: var(--muted); font-size: 11px; margin-left: auto; font-variant-numeric: tabular-nums; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-sm); padding: 12px; margin-bottom: 8px; cursor: grab; }
.task-card:hover { border-color: var(--blue-200); }
.task-card.blocked { box-shadow: inset 3px 0 0 var(--error), var(--shadow-sm); }
.task-card .task-meta { margin-top: 2px; }
.task-card .row { margin-top: 8px; gap: 4px; }

.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); }
.calendar .dow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 10px; background: var(--surface-muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.calendar .day { min-height: 112px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 11px; }
.calendar .dow:nth-child(7n), .calendar .day:nth-child(7n) { border-right: 0; }
.calendar .day.other { background: var(--surface-muted); color: var(--muted); }
.calendar .day .num { display: inline-block; min-width: 22px; height: 22px; line-height: 22px; border-radius: 9999px; text-align: center; font-weight: 600; }
.calendar .day.today .num { background: var(--primary); color: #fff; }
.calendar .chip { display: block; background: var(--primary-subtle); color: var(--primary); border-radius: 4px; padding: 2px 6px; margin-top: 4px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar .chip:hover { text-decoration: none; background: var(--blue-50); }
.calendar .chip.done { background: var(--success-tint); color: var(--success); }
.calendar .chip.late { background: var(--error-tint); color: var(--error); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list .meta { color: var(--muted); font-size: 11px; line-height: 16px; margin-top: 2px; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment:first-child { padding-top: 0; }
.comment:last-child { border-bottom: 0; }
.comment .who { font-weight: 600; font-size: 13px; color: var(--heading); }
.comment .when { color: var(--muted); font-size: 11px; }
.comment .body { white-space: pre-wrap; margin-top: 6px; color: var(--body); }
.attachment { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.checklist li.done span { text-decoration: line-through; color: var(--muted); }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 10px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--heading); font-weight: 500; }
.alert { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: 13px; font-weight: 500; border: 1px solid; border-radius: var(--radius-control); }
.alert-bad { background: var(--error-wash); color: var(--error); border-color: rgba(255, 59, 48, 0.25); }
.alert-warn { background: rgba(180, 83, 9, 0.05); color: var(--warning); border-color: rgba(180, 83, 9, 0.25); }
.alert-info { background: var(--primary-subtle); color: var(--primary); border-color: var(--blue-100); }
.alert .right { margin-left: auto; }
.note { font-size: 11px; line-height: 16px; color: var(--muted); margin-top: 12px; }

/* Top bar controls ------------------------------------------------------ */
.clock { display: flex; align-items: center; gap: 10px; padding-right: 12px; margin-right: 4px; border-right: 1px solid var(--border); }
.clock .timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--heading); }
.clock .state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--success); font-weight: 600; }
.menu-anchor { position: relative; }
.bell-count {
  position: absolute; top: 3px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9999px;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.account-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 9999px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 360px; max-height: 480px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg); z-index: 50;
}
.dropdown-head { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; color: var(--heading); }
.dropdown-head .btn { margin-left: auto; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 16px; border: 0; background: none; text-align: left;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--body); cursor: pointer;
}
.menu-item:hover { background: var(--surface-muted); color: var(--heading); text-decoration: none; }
.menu-item ion-icon { color: var(--muted); }
.menu-divider { border-top: 1px solid var(--border); }
.menu-profile { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.menu-profile .name { font-weight: 600; font-size: 13px; color: var(--heading); }
.menu-profile .meta { font-size: 11px; line-height: 16px; color: var(--muted); }
.notif {
  display: block; width: 100%; padding: 12px 16px;
  border: 0; border-bottom: 1px solid var(--border); background: var(--surface);
  text-align: left; font: inherit; color: var(--body); cursor: pointer;
}
.notif:hover { background: var(--surface-muted); }
.notif.unread { box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-subtle); }
.notif .t { font-weight: 600; font-size: 13px; color: var(--heading); }
.notif .b { color: var(--body); font-size: 11px; line-height: 16px; white-space: pre-line; max-height: 3.2em; overflow: hidden; margin-top: 2px; }
.notif .w { color: var(--muted); font-size: 11px; margin-top: 4px; }
.notif-list .notif:last-child { border-bottom: 0; }
.notif-list .notif .b { max-height: none; }

/* Avatars: photo, or the initial on the blue tint. Always round. */
.avatar {
  width: 32px; height: 32px; border-radius: 9999px; background: var(--primary-subtle); color: var(--primary);
  display: inline-grid; place-items: center; font-weight: 600; font-size: 11px; flex-shrink: 0;
}
img.avatar { object-fit: cover; background: var(--surface-muted); border: 1px solid var(--border); }
.avatar.md { width: 36px; height: 36px; font-size: 13px; }
.avatar.lg { width: 96px; height: 96px; font-size: 30px; }
.photo-row { display: flex; align-items: center; gap: 20px; }
.photo-row .photo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person .who { min-width: 0; }
/* Tabs (Maxify ID underline tabs) */
.settings-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.settings-nav a { padding: 8px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.settings-nav a:hover { color: var(--body); text-decoration: none; }
.settings-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.radio-list { display: grid; gap: 8px; }
.radio-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; }

/* Drawer: forms open in a right-anchored sheet, as in Maxify ID ----------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; justify-content: flex-end;
  background: rgba(18, 18, 18, 0.32);
}
.modal {
  display: flex; flex-direction: column;
  width: min(34rem, 100vw); max-width: 100vw; height: 100dvh;
  background: var(--surface); color: var(--body);
  border-left: 1px solid var(--border);
  border-radius: var(--radius-card) 0 0 var(--radius-card);
  box-shadow: var(--shadow-xl); overflow: hidden;
}
.modal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-head { display: flex; align-items: flex-start; gap: 16px; flex-shrink: 0; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 16px; line-height: 24px; }
.modal-head .close { margin: -4px -4px 0 auto; width: 32px; height: 32px; color: var(--muted); }
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.modal-body .form-grid { grid-template-columns: 1fr; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-muted); }
@keyframes drawer-in { from { transform: translateX(1.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop { animation: fade-in 160ms ease-out both; }
.modal { animation: drawer-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }
body:has(.modal-backdrop) { overflow: hidden; }

/* Toasts (Maxify ID: white, top right under the header) ----------------- */
.toasts { position: fixed; top: 68px; right: 24px; width: 384px; display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 8px 12px 14px; background: var(--surface); color: var(--body);
  border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-lg);
  font-size: 13px; line-height: 18px;
}
.toast > ion-icon { color: var(--primary); margin-top: 0; }
.toast.success > ion-icon { color: var(--success); }
.toast.error > ion-icon { color: var(--error); }
.toast.warning > ion-icon { color: var(--warning); }
.toast > span { flex: 1; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
.toast .dismiss { display: grid; place-items: center; width: 32px; height: 32px; margin: -7px 0; border: 0; border-radius: var(--radius-control); background: none; color: var(--muted); cursor: pointer; }
.toast .dismiss:hover { background: var(--surface-muted); color: var(--heading); }
.toast .dismiss ion-icon { font-size: 16px; width: 16px; height: 16px; }

/* Charts --------------------------------------------------------------- */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; height: 160px; }
.bars .bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars .bar .fill { width: 100%; max-width: 44px; background: var(--primary); min-height: 1px; border-radius: 4px 4px 0 0; }
.bars .bar .value { color: var(--body); }
.trend { display: flex; gap: 6px; align-items: end; height: 132px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend .col .fill { width: 100%; background: var(--blue-100); min-height: 1px; border-radius: 4px 4px 0 0; }
.trend .col.current .fill { background: var(--primary); }
.trend .col.none .fill { background: var(--border); }

/* Auth (Maxify ID sign-in: form beside a blue panel) --------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-muted); }
.auth-main { flex: 1; width: 100%; max-width: 1152px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; min-height: 80vh; }
.auth-panel { width: 100%; max-width: 384px; margin: 0 auto; }
.auth-logo { margin-bottom: 32px; }
.auth-panel h1 { font-size: 28px; line-height: 34px; letter-spacing: -0.03em; }
.auth-panel .lead { margin: 8px 0 24px; color: var(--muted); font-size: 13px; }
.auth-panel .field { margin-bottom: 16px; }
.auth-panel .field > label { margin-bottom: 4px; }
.auth-aside { align-self: stretch; display: flex; align-items: flex-end; padding: 40px; border-radius: var(--radius-card); background: var(--primary); }
.auth-aside p { margin: 0; color: #fff; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -0.02em; }
.btn-block { width: 100%; }

/* Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); z-index: 60; transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-xl); }
  .nav-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 18, 52, 0.5); }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .mobile-brand { display: inline-flex; }
  .topbar .page-label { display: none; }
}
@media (max-width: 960px) {
  .grid-2, .grid-3, .split, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 24px 16px; }
  .app-footer p { padding: 0 16px; }
  .topbar { padding: 0 16px; }
  .clock { border-right: 0; padding-right: 0; }
  .dropdown { width: min(360px, calc(100vw - 32px)); }
  .role-pill { display: none; }
}
@media (max-width: 767px) {
  .auth-main { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
  .toasts { left: 16px; right: 16px; width: auto; }
}

/* Compact task tables (overview): title, status, due only. */
.table.compact td:nth-child(3), .table.compact td:nth-child(5), .table.compact td:nth-child(6) { display: none; }

/* Image pins */
.pin-image { margin-top: 10px; }
.pin-frame { position: relative; display: inline-block; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; line-height: 0; }
.pin-frame img { max-width: 100%; max-height: 520px; display: block; }
.pin-frame.placing { cursor: crosshair; outline: 2px solid var(--primary); outline-offset: -2px; }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 9999px; line-height: 18px; text-align: center;
  background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; border: 2px solid #fff;
}
.pin:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.pin-new { background: var(--heading); }

/* Approvals */
.approval-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 20px; padding: 16px 20px; border-top: 1px solid var(--border); align-items: start; }
.approval-progress { display: flex; gap: 4px; margin: 8px 0; }
.approval-progress span { flex: 1; height: 6px; border-radius: 9999px; background: var(--surface-muted); }
.approval-progress span.done { background: var(--success); }
@media (max-width: 960px) { .approval-row { grid-template-columns: 1fr; } }

/* Chat */
.chat-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 140px); min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.chat-groups { border-right: 1px solid var(--border); overflow-y: auto; }
.chat-groups-head { display: flex; align-items: center; height: 56px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.chat-groups-head .btn { margin-left: auto; }
.chat-group { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--body); border-bottom: 1px solid var(--border); }
.chat-group:hover { background: var(--surface-muted); text-decoration: none; color: var(--heading); }
.chat-group.active { background: var(--primary-subtle); box-shadow: inset 3px 0 0 var(--primary); }
.chat-group ion-icon { color: var(--muted); }
.chat-group.active ion-icon { color: var(--primary); }
.chat-group .name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: 13px; color: var(--heading); }
.chat-group .name small { color: var(--muted); font-weight: 400; font-size: 11px; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-empty { align-items: center; justify-content: center; }
.chat-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 8px 0; }
.earlier { text-align: center; padding: 8px; }
.msg { position: relative; display: flex; gap: 12px; padding: 8px 20px; }
.msg:hover { background: var(--surface-muted); }
.msg-main { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-head .who { font-weight: 600; font-size: 13px; color: var(--heading); }
.msg-head .when { color: var(--muted); font-size: 11px; }
.msg-body { white-space: pre-wrap; word-wrap: break-word; font-size: 13px; }
.msg-quote { display: block; border-left: 2px solid var(--border); padding: 2px 8px; margin: 4px 0; color: var(--body); font-size: 11px; background: var(--surface-muted); border-radius: 0 4px 4px 0; }
.msg-quote:hover { text-decoration: none; border-left-color: var(--primary); color: var(--heading); }
.msg-actions { position: absolute; right: 16px; top: 4px; display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); box-shadow: var(--shadow-sm); }
.msg:hover .msg-actions { display: flex; }
.mention { color: var(--primary); font-weight: 600; background: var(--primary-subtle); padding: 0 3px; border-radius: 4px; }
.typing { height: 20px; padding: 0 20px; font-size: 11px; color: var(--muted); }
.chat-composer { border-top: 1px solid var(--border); padding: 12px 20px; }
.chat-composer textarea { min-height: 40px; height: 40px; max-height: 160px; resize: vertical; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 8px; background: var(--primary-subtle); border-radius: var(--radius-control); font-size: 11px; color: var(--body); }
.reply-bar .btn { margin-left: auto; }
@media (max-width: 960px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; }
  .chat-groups { border-right: 0; border-bottom: 1px solid var(--border); max-height: 220px; }
  .chat-pane { height: 70vh; }
}

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .topbar { gap: 4px; }
  .topbar .btn-primary { width: var(--control-h); padding: 0; }
  .clock { gap: 6px; }
  .page-head .actions { margin-left: 0; }
}

/* Assets */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.asset-card { display: block; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); color: var(--body); }
.asset-card:hover { border-color: var(--primary); text-decoration: none; color: var(--body); }
.asset-thumb { position: relative; height: 150px; background: var(--surface-muted); display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb ion-icon { font-size: 40px; width: 40px; height: 40px; color: var(--muted); }
.asset-flag { position: absolute; top: 8px; left: 8px; }
.asset-info { padding: 12px; }
.asset-preview { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-control); overflow: hidden; display: grid; place-items: center; min-height: 220px; }
.asset-preview img, .asset-preview video { max-width: 100%; max-height: 520px; display: block; }
.prompt-snippet { align-self: stretch; justify-self: stretch; padding: 12px; font-family: var(--mono); font-size: 11px; line-height: 16px; letter-spacing: 0; color: var(--body); white-space: pre-wrap; overflow: hidden; text-align: left; }
.prompt-text { margin: 0; padding: 14px 16px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-control); font-family: var(--mono); font-size: 13px; line-height: 20px; letter-spacing: 0; color: var(--heading); white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow: auto; }
textarea.mono { font-family: var(--mono); font-size: 13px; line-height: 20px; letter-spacing: 0; }
details summary { cursor: pointer; }

/* Sales */
.badge.stage-new { background: var(--surface-muted); color: var(--muted); }
.badge.stage-contacted { background: var(--primary-subtle); color: var(--primary); }
.badge.stage-qualified { background: var(--primary-subtle); color: var(--primary); box-shadow: inset 0 0 0 1px rgba(16, 123, 239, 0.4); }
.badge.stage-proposal { background: var(--primary); color: #fff; }
.badge.stage-won { background: var(--success-tint); color: var(--success); }
.badge.stage-lost { background: var(--error-tint); color: var(--error); }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 60px 56px; gap: 12px; align-items: center; padding: 6px 0; }
.funnel-label { font-size: 13px; font-weight: 500; }
.funnel-bar { height: 22px; background: var(--surface-muted); border-radius: 4px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--primary); }
.funnel-count { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--heading); }
.funnel-rate { text-align: right; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.money { font-variant-numeric: proportional-nums; letter-spacing: 0; white-space: nowrap; }

/* Meetings */
.join-when { padding: 4px 0 20px; }
.join-date { font-size: 18px; line-height: 24px; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; }
.join-time { font-size: 14px; margin-top: 2px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; margin-bottom: 16px; }
.countdown div { padding: 16px 8px; text-align: center; border-right: 1px solid var(--border); background: var(--surface-muted); }
.countdown div:last-child { border-right: 0; }
.countdown span { display: block; font-size: 36px; line-height: 40px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--heading); }
.countdown small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.btn-join { height: 48px; padding: 0 28px; font-size: 14px; }
.meeting-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); }
.meeting-date { text-align: center; border: 1px solid var(--border); border-radius: var(--radius-control); padding: 6px 0; }
.meeting-date .d { font-size: 22px; font-weight: 800; line-height: 26px; color: var(--heading); letter-spacing: -0.03em; }
.meeting-date .m { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.badge.att-attended { background: var(--success-tint); color: var(--success); }
.badge.att-late { background: var(--warning-tint); color: var(--warning); }
.badge.att-absent { background: var(--error-tint); color: var(--error); }
.badge.att-excused { background: var(--surface-muted); color: var(--muted); }
.badge.att-invited { background: var(--primary-subtle); color: var(--primary); }
.people-pick { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-control); }
.people-pick .team-head { position: sticky; top: 0; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-muted); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.people-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.people-pick label:hover { background: var(--surface-muted); }
@media (max-width: 640px) { .countdown span { font-size: 28px; } .meeting-row { grid-template-columns: 72px minmax(0, 1fr); } }

/* Checkbox and radio groups (Django renders each option in its own div) */
.field > div[id]:has(input[type=checkbox], input[type=radio]) { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.field > div[id] > div > label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; cursor: pointer; }

/* Boosted-style loading bar while HTMX requests run. */
html::before { content: ""; position: fixed; inset: 0 auto auto 0; z-index: 300; height: 2px; width: 0; background: var(--primary); opacity: 0; pointer-events: none; }
html.htmx-loading::before { opacity: 1; width: 85%; transition: width 8s cubic-bezier(0.08, 0.6, 0.2, 1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* People picker (Assign to, Collaborators) and @mention suggestions -------------------------------------
   One search box instead of a list of every member: type a name or email, pick from the best matches. */
.picker { position: relative; }
.picker-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: var(--control-h); padding: 4px 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control);
  cursor: text; transition: border-color 0.15s, box-shadow 0.15s;
}
.picker-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); }
.picker.invalid .picker-box { border-color: var(--error); }
.picker-box input[type=search] {
  flex: 1 1 140px; min-width: 120px; height: 30px; padding: 0 6px;
  border: 0; background: transparent; box-shadow: none;
}
.picker-box input[type=search]:focus, .picker-box input[type=search]:focus-visible { box-shadow: none; }
.picker-box input[type=search]::-webkit-search-cancel-button { display: none; }
.picker-icon { color: var(--muted); font-size: 16px; margin-left: 4px; flex-shrink: 0; }
.picker-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  height: 30px; padding: 0 4px 0 3px;
  background: var(--primary-subtle); color: var(--heading); border-radius: 9999px;
  font-weight: 500; font-size: 12px;
}
.picker-chip .avatar { width: 24px; height: 24px; font-size: 10px; }
.picker-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chip button {
  display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0;
  border: 0; border-radius: 9999px; background: transparent; color: var(--muted); cursor: pointer;
}
.picker-chip button:hover { background: var(--blue-50); color: var(--heading); }
.picker-chip button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ring); }
.picker-chip.solo { height: 32px; padding-right: 8px; background: transparent; gap: 8px; }
.picker-chip.solo .avatar { width: 28px; height: 28px; font-size: 11px; }
.picker-chip.solo .chip-detail { color: var(--muted); font-weight: 400; }
.picker-change { margin-left: auto; }

.field ul.suggest, .suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  display: block; max-height: 296px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
}
.suggest.up { top: auto; bottom: calc(100% + 4px); }
.suggest-option {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px;
  border-radius: var(--radius-control); cursor: pointer;
}
.suggest-option .avatar { width: 28px; height: 28px; font-size: 11px; }
.suggest-option .who { min-width: 0; display: flex; flex-direction: column; }
.suggest-option .name { color: var(--heading); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-option .meta { color: var(--muted); font-size: 11px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-option .meta b { font-weight: 500; color: var(--body); }
.suggest-option.active { background: var(--primary-subtle); }
.suggest-option.active .name { color: var(--primary); }
.suggest-note { padding: 10px 8px; color: var(--muted); font-size: 12px; }
.mention-box { position: relative; flex: 1 1 auto; min-width: 0; }

/* People on a task */
.people-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.people-list .person .who strong { display: block; color: var(--heading); font-weight: 500; }
.people-list .tag { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.people-more { color: var(--primary); background: none; border: 0; padding: 0; font: inherit; font-weight: 500; cursor: pointer; }
.people-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.people-more:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ring); border-radius: 4px; }
.people-sub { margin: 20px 0 12px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--heading); font-weight: 600; font-size: 13px; }
.people-sub .faint { font-weight: 500; margin-left: 4px; }

/* Staging marker: a quiet fixed tag so a demo session is never mistaken for the live office. */
.env-flag {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  padding: 8px 14px; border-radius: 9999px;
  background: var(--secondary); color: #fff; font-size: 12px; line-height: 16px;
  box-shadow: var(--shadow-lg); pointer-events: none;
}
.env-flag strong { font-weight: 600; }
.env-flag ion-icon { font-size: 15px; color: var(--blue-200); flex-shrink: 0; }
.env-flag a { color: var(--blue-100); text-decoration: underline; text-underline-offset: 3px; pointer-events: auto; }
.env-flag a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ring); border-radius: 4px; }
