/* =====================================================================
   The Office — components (v2). Needs tokens.css first.
   Class names follow the current style.css where a thing already exists
   (.btn, .icon-btn, .room-tab, .person, .chat, .msg, .card, .modal,
   .menu, .toast, .kcol, .kcard, .tray, .habib-panel, .yazan-panel,
   .float-btn, .joy ...). New pieces: .topbar, .dock, .tool, .me-pill,
   .bottom-bar, .tab-item, .sheet, .popover, .seg, .field, .switch,
   .list-row, .empty, .skeleton, .tooltip, .gesture-bar.
   (.paper is a sticky note in this app, so surfaces use .panel.)
   Logical properties (inline-start/end) throughout, so Arabic (dir=rtl)
   mirrors without extra rules.
   ===================================================================== */

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--chrome-text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* focus: blue on paper, gold on the dark chrome. Never removed, only restyled. */
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }
.on-dark :focus-visible, .topbar :focus-visible, .dock :focus-visible, .bottom-bar :focus-visible,
.float-btn:focus-visible, .icon-btn:focus-visible { outline-color: var(--focus-on-dark); }

/* pixel icons: one 9x9 grid in a 10x10 box, drawn at 2x (20px) or 3x (30px) so every pixel is whole */
.px, .px-icon {
  display: block;
  flex: none;
  width: var(--icon);
  height: var(--icon);
  fill: currentColor;
  shape-rendering: crispEdges;
}
.px.lg { width: var(--icon-lg); height: var(--icon-lg); }
.px.sm { width: var(--icon-sm); height: var(--icon-sm); }
.px.accent { color: var(--accent-ink); }
[dir="rtl"] .px-mirror { transform: scaleX(-1); }

/* ------------------------------------------------------------ buttons (paper) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-4);
  border: var(--edge);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .btn:hover { background: var(--surface-input); } }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 rgba(20, 12, 18, 0.45); }
.btn.primary { background: var(--primary); }
@media (hover: hover) { .btn.primary:hover { background: var(--primary-hover); } }
.btn.primary:active { background: var(--primary-press); }
.btn.danger { background: var(--danger); border-color: #7d2328; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink); }
@media (hover: hover) { .btn.ghost:hover { background: var(--surface-2); } }
.btn.ghost:active { transform: none; background: var(--surface-3); }
.btn.on, .btn[aria-pressed="true"] { background: var(--selected); box-shadow: inset 0 -3px 0 var(--selected-edge); }
.btn.small { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-small); }
.btn.tiny { min-height: 32px; padding: 0 var(--s-2); font-size: var(--fs-small); gap: var(--s-1); }
.btn.icon { padding: 0; width: var(--tap); }
.btn.icon.small { width: 36px; }
.btn.block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--surface-2); border-color: var(--surface-3); color: var(--ink-muted);
  box-shadow: none; cursor: not-allowed; transform: none;
}
.btn[aria-busy="true"] { color: transparent; position: relative; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px;
  border: 2px solid var(--ink); border-inline-end-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn .px { width: var(--icon); height: var(--icon); }
/* small buttons may only be this small on a pointer device; a 44px hit area is kept with a halo */
.btn.small, .btn.tiny { position: relative; }
.btn.small::before, .btn.tiny::before { content: ''; position: absolute; inset: -6px -2px; }

/* ------------------------------------------------------------ chrome buttons (dark, around the room) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-width: var(--ctl-h);
  height: var(--ctl-h);
  padding: 0 var(--s-3);
  border: 1px solid var(--chrome-line);
  border-radius: var(--r-sm);
  background: var(--chrome-fill);
  color: var(--chrome-text);
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
  flex: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .icon-btn:hover { background: var(--chrome-fill-hover); } }
.icon-btn:active { background: var(--chrome-fill-press); }
.icon-btn.on, .icon-btn[aria-pressed="true"] {
  background: var(--selected); border-color: var(--selected); color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--selected-edge);
}
.icon-btn.accent { border-color: var(--primary); }
.icon-btn.accent .px { color: var(--primary); }
.icon-btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.icon-btn.icon-only { padding: 0; width: var(--ctl-h); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------ top bar: where you are + talk */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--topbar-h);
  padding: var(--s-2) var(--s-4);
  padding-top: calc(var(--s-2) + var(--safe-t));
}
.office-btn {
  display: inline-flex; align-items: center; gap: var(--s-1);
  height: var(--ctl-h); padding: 0 var(--s-2) 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--chrome-text);
  font-size: var(--fs-body); font-weight: var(--fw-heavy); letter-spacing: 0.01em; white-space: nowrap;
}
@media (hover: hover) { .office-btn:hover { background: var(--chrome-fill-hover); } }
.office-btn .px { width: 20px; height: 20px; color: var(--chrome-muted); }
.office-btn .office-name { display: inline-flex; align-items: center; }
.office-btn .office-logo { display: block; height: 36px; width: auto; }
.office-btn .office-logo.pixel-logo { height: 30px; } /* the wordmark has no padding of its own */
.topbar .spacer { flex: 1; }

.rooms {
  display: flex; gap: var(--s-0); min-width: 0; padding: 3px;
  border: 1px solid var(--chrome-line-soft); border-radius: calc(var(--r-sm) + 3px);
  background: var(--bg-sunk); overflow-x: auto; scrollbar-width: none;
}
.rooms::-webkit-scrollbar { display: none; }
.room-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: calc(var(--ctl-h) - 6px); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-xs); background: transparent; color: var(--chrome-muted);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: 1;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .room-tab:not([aria-current]):hover { background: var(--chrome-fill-hover); color: var(--chrome-text); } }
.room-tab[aria-current], .room-tab.on {
  background: var(--surface); color: var(--ink); font-weight: var(--fw-bold);
  box-shadow: 0 1px 0 rgba(12, 14, 18, 0.5), inset 0 -2px 0 var(--primary);
}
.room-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--chrome-fill-hover); color: var(--chrome-text);
  font-size: var(--fs-caption); font-weight: var(--fw-bold); line-height: 20px; text-align: center;
}
.room-tab[aria-current] .room-count, .room-tab.on .room-count { background: var(--sage); color: var(--ink); }
.room-tab .px { width: 10px; height: 10px; }

.voice-tools { display: flex; align-items: center; gap: var(--s-2); }
.voice-count { display: inline-flex; align-items: center; gap: 6px; color: var(--chrome-muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.speaking { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.speaking i { display: block; width: 3px; border-radius: 2px; background: var(--here); animation: talk 0.9s var(--ease-in-out) infinite; }
.speaking i:nth-child(1) { height: 6px; }
.speaking i:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.speaking i:nth-child(3) { height: 8px; animation-delay: 0.3s; }
@keyframes talk { 50% { transform: scaleY(0.5); } }

/* ------------------------------------------------------------ the dock: what you can do (desktop, under the room) */
.dock {
  display: flex; align-items: center; justify-content: center; gap: var(--s-1);
  padding: var(--s-1);
  border: 1px solid var(--chrome-line-soft); border-radius: var(--r-md);
  background: var(--bg-raised);
  box-shadow: var(--sh-2);
}
.dock .sep { width: 1px; align-self: stretch; margin: var(--s-2) var(--s-1); background: var(--chrome-line-soft); }
.tool {
  position: relative;
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: var(--tap); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--chrome-text);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out);
}
.tool .px { color: var(--chrome-muted); }
@media (hover: hover) { .tool:hover { background: var(--chrome-fill-hover); } .tool:hover .px { color: var(--chrome-text); } }
.tool:active { background: var(--chrome-fill-press); }
.tool.on, .tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--selected); color: var(--ink); box-shadow: inset 0 -3px 0 var(--selected-edge); }
.tool.on .px, .tool[aria-pressed="true"] .px, .tool[aria-expanded="true"] .px { color: var(--ink); }
.tool .badge { margin-inline-start: 2px; }
.tool .hint { color: var(--chrome-muted); font-weight: var(--fw-regular); }
.tool[aria-pressed="true"] .hint, .tool[aria-expanded="true"] .hint, .tool.on .hint { color: var(--ink); }

/* "Me": your face, your status, one tap to everything about you */
.me-pill {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: var(--tap); padding: 0 var(--s-3) 0 var(--s-1);
  border: 1px solid var(--chrome-line); border-radius: var(--r-pill);
  background: var(--chrome-fill); color: var(--chrome-text);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap; max-width: 260px;
}
@media (hover: hover) { .me-pill:hover { background: var(--chrome-fill-hover); } }
.me-pill .avatar { width: 34px; height: 34px; }
.me-pill .me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; text-align: start; }
.me-pill .me-text small { color: var(--chrome-muted); font-weight: var(--fw-regular); font-size: var(--fs-caption); overflow: hidden; text-overflow: ellipsis; }
.me-pill .px { width: 10px; height: 10px; color: var(--chrome-muted); }

/* ------------------------------------------------------------ phone bottom bar */
.bottom-bar {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: calc(var(--bottombar-h) + var(--safe-b));
  padding: 0 calc(var(--s-1) + var(--safe-r)) var(--safe-b) calc(var(--s-1) + var(--safe-l));
  border-top: 1px solid var(--chrome-line-soft);
  background: var(--bg-raised);
}
.tab-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--bottombar-h); padding: 0;
  border: 0; background: transparent; color: var(--chrome-muted);
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); line-height: 1.1;
}
.tab-item .px { width: var(--icon); height: var(--icon); }
.tab-item .avatar { width: 26px; height: 26px; }
.tab-item .tab-ic { position: relative; display: grid; place-items: center; width: 52px; height: 30px; border-radius: var(--r-pill); }
.tab-item[aria-current], .tab-item.on, .tab-item[aria-expanded="true"] { color: var(--chrome-text); }
.tab-item[aria-current] .tab-ic, .tab-item.on .tab-ic, .tab-item[aria-expanded="true"] .tab-ic { background: var(--selected); color: var(--ink); }
.tab-item .badge { position: absolute; top: -4px; inset-inline-end: 4px; box-shadow: 0 0 0 2px var(--bg-raised); }

/* ------------------------------------------------------------ badges, dots, avatars */
.badge {
  display: inline-block; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--rose-ink); color: #fff;
  font-size: var(--fs-caption); font-weight: var(--fw-bold); line-height: 20px; text-align: center;
}
.badge.quiet { background: var(--surface-2); color: var(--ink); }
.badge.dark { background: var(--ink); color: var(--surface); }

.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--here); flex: none; }
.dot.idle { background: linear-gradient(90deg, var(--idle) 50%, var(--surface) 50%); }
.dot.away { background: var(--surface); }
.dot.busy { background: var(--danger); }
/* do not disturb: red with a white bar */
.dot.dnd { background: var(--danger); position: relative; }
.dot.dnd::after { content: ''; position: absolute; inset: 3px 1px; background: #fff; border-radius: 1px; }
/* away, as they said themselves (not just out of the office) */
.dot.away-set { background: var(--idle); position: relative; }
.dot.away-set::after { content: ''; position: absolute; inset: 1px 1px 3px 3px; border-inline-start: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
/* offline: hollow, with a cross */
.dot.offline { background: var(--surface); border-color: var(--ink-muted); background-image: linear-gradient(45deg, transparent 42%, var(--ink-muted) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--ink-muted) 42% 58%, transparent 58%); }

.avatar {
  position: relative; display: inline-block; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); box-shadow: 0 0 0 2px var(--ink);
}
.avatar img, .avatar canvas { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; image-rendering: pixelated; }
.avatar .dot { position: absolute; inset-inline-end: -3px; bottom: -3px; }
.avatar.sm { width: 24px; height: 24px; }
.avatar.md { width: 40px; height: 40px; }
.avatar.lg { width: 56px; height: 56px; }
.avatar.yazan { background: var(--yazan-soft); }
.avatar.habib { background: var(--habib-soft); }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-inline-start: -8px; }
.avatar-stack .more { display: grid; place-items: center; font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--ink); background: var(--surface); }
.avatar-stack .avatar.sm + .avatar.sm { margin-inline-start: -6px; }

.crown { color: var(--gold-ink); }
.on-dark .crown, .tag .crown { color: var(--selected); }

/* ------------------------------------------------------------ form fields */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--ink); }
.field .hint { margin: 0; font-size: var(--fs-small); color: var(--ink-muted); }
.field .error { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--danger); }
.field .error .px { width: 20px; height: 20px; margin-top: 0; }
.input, .field input, .field textarea, .field select, textarea.input {
  width: 100%; min-height: var(--tap); padding: 10px var(--s-3);
  border: var(--edge); border-radius: var(--r-sm);
  background: var(--surface-input); color: var(--ink);
  font-size: var(--fs-body); line-height: var(--lh-snug);
}
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-placeholder); opacity: 1; }
.field textarea, textarea.input { min-height: 88px; resize: vertical; }
.input:focus-visible, .field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { outline-offset: 0; }
.input[aria-invalid="true"], .field [aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.input:disabled { background: var(--surface-2); color: var(--ink-muted); border-color: var(--surface-3); }
.input.code { font-family: var(--font-mono); font-size: 1.25rem; letter-spacing: 0.14em; text-transform: uppercase; }
.field-row { display: flex; gap: var(--s-2); align-items: flex-end; }
.field-row > .field { flex: 1; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: var(--s-3); }

/* toggle switch: a real checkbox, shape and position say on/off, the word says it too */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--tap); font-weight: var(--fw-semibold); color: var(--ink); }
.switch input { appearance: none; position: relative; flex: none; width: 48px; height: 28px; margin: 0; border: var(--edge); border-radius: var(--r-pill); background: var(--surface-2); transition: background-color var(--dur-fast) var(--ease-out); }
.switch input::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--ink); transition: inset-inline-start var(--dur-fast) var(--ease-out); }
.switch input:checked { background: var(--selected); }
.switch input:checked::after { inset-inline-start: 22px; background: var(--ink); }
.switch input:disabled { opacity: 0.5; }

/* segmented choice (radio group). Selected = gold + check + inset edge, not colour alone */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(96px, 100%), 1fr)); gap: var(--s-1); padding: var(--s-1); border-radius: var(--r-md); background: var(--surface-2); }
.seg > button, .seg > label {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 var(--s-2);
  border: 2px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--ink);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); text-align: center; line-height: 1.15;
}
.seg > button .px, .seg > label .px { color: var(--accent-ink); }
@media (hover: hover) { .seg > button:hover { background: var(--surface); } }
.seg > [aria-checked="true"], .seg > [aria-pressed="true"], .seg > [aria-selected="true"], .seg > .on {
  background: var(--selected); border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--selected-edge);
}
.seg > [aria-checked="true"] .px, .seg > [aria-pressed="true"] .px, .seg > .on .px { color: var(--ink); }

/* chips: pick one or several. A check appears in the selected one */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-3);
  border: 2px solid var(--surface-3); border-radius: var(--r-pill); background: var(--surface-input); color: var(--ink);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap; position: relative;
}
.chip::before { content: ''; position: absolute; inset: -4px 0; }
.chip .px { width: 20px; height: 20px; color: var(--accent-ink); }
@media (hover: hover) { .chip:hover { border-color: var(--ink-muted); } }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.on { background: var(--selected); border-color: var(--ink); }
.chip[aria-pressed="true"] .px, .chip[aria-checked="true"] .px, .chip.on .px { color: var(--ink); }

/* tabs */
.tabs { display: flex; gap: var(--s-1); border-bottom: 2px solid var(--surface-3); }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 0 var(--s-3); margin-bottom: -2px;
  border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-muted);
  font-size: var(--fs-small); font-weight: var(--fw-semibold);
}
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: var(--fw-bold); }
.tab .badge { min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; }

/* ------------------------------------------------------------ surfaces: card, dialog, sheet, popover */
.panel { background: var(--surface); color: var(--ink); border: var(--edge); border-radius: var(--r-lg); box-shadow: var(--sh-2); }

.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-4);
  background: var(--scrim);
  animation: fade-in var(--dur-fast) var(--ease-out);
}
.card {
  position: relative; display: flex; flex-direction: column;
  width: min(480px, 100%); max-height: calc(100dvh - 32px);
  border: var(--edge); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-4);
  animation: rise-in var(--dur-base) var(--ease-out);
}
.card.wide { width: min(960px, 100%); }
/* a card not built from dialog-head/body/foot (the character maker, the front page, Uno) */
.card:not(.dialog) { display: block; overflow-y: auto; padding: var(--s-5); }
.card:not(.dialog) > .close { position: absolute; top: var(--s-2); inset-inline-end: var(--s-2); z-index: 1; }
.card.mid { width: min(640px, 100%); }
.dialog-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-2); }
.dialog-head h2 { flex: 1; margin: 0; font-size: var(--fs-h2); font-weight: var(--fw-bold); line-height: var(--lh-snug); }
.dialog-head p { margin: 4px 0 0; color: var(--ink-muted); font-size: var(--fs-small); }
.dialog-head .close { margin: -6px -8px 0 0; margin-inline-end: -8px; }
.dialog-body { flex: 1; overflow-y: auto; padding: var(--s-2) var(--s-5) var(--s-4); overscroll-behavior: contain; }
.dialog-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-3) var(--s-5) var(--s-5); border-top: 1px solid var(--surface-3); }
.dialog-foot .grow { flex: 1; }
.dialog-foot > .row { flex: 1; justify-content: flex-end; margin: 0; }
.dialog-foot > .row .btn { flex: 0 1 auto; }

.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-modal);
  display: flex; flex-direction: column; max-height: 88dvh;
  border: var(--edge); border-bottom: 0; border-radius: 20px 20px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-4);
  padding-bottom: var(--safe-b);
  animation: sheet-in var(--dur-slow) var(--ease-out);
}
.sheet .grabber { width: 40px; height: 5px; margin: var(--s-2) auto 0; border-radius: var(--r-pill); background: var(--surface-3); flex: none; }
.sheet .dialog-head { padding-top: var(--s-3); }

.popover, .menu {
  position: fixed; z-index: var(--z-popover);
  min-width: 240px; max-width: min(340px, calc(100vw - 16px));
  padding: var(--s-2);
  border: var(--edge); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-3);
  animation: rise-in var(--dur-fast) var(--ease-out);
}
.menu-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-3); }
.menu-head strong { display: block; font-size: var(--fs-body); }
.menu-head small { display: block; color: var(--ink-muted); font-size: var(--fs-small); }
.menu-sep { height: 1px; margin: var(--s-1) var(--s-2); background: var(--surface-3); }
.menu-head .who { min-width: 0; }
.menu-head small { overflow-wrap: anywhere; }
.popover .list-row:disabled { color: var(--ink-muted); font-weight: var(--fw-regular); cursor: default; }
.popover .list-row:disabled .px { color: var(--ink-muted); }
.popover .list-row:focus-visible { outline-offset: -2px; }

/* list rows: menus, settings, people */
.list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.list-row {
  display: flex; align-items: center; gap: var(--s-3); width: 100%;
  min-height: var(--tap); padding: var(--s-2) var(--s-3);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink);
  font-size: var(--fs-label); font-weight: var(--fw-semibold); text-align: start;
}
.list-row .px { color: var(--accent-ink); }
.list-row > span:not(.meta):not(.tag-lead) { min-width: 0; }
.list-row .meta { margin-inline-start: auto; color: var(--ink-muted); font-size: var(--fs-small); font-weight: var(--fw-regular); }
.list-row .sub { display: block; color: var(--ink-muted); font-size: var(--fs-small); font-weight: var(--fw-regular); }
@media (hover: hover) { button.list-row:hover, a.list-row:hover { background: var(--surface-2); } }
.list-row[aria-checked="true"] { background: var(--selected); }
.list-row[aria-checked="true"] .px { color: var(--ink); }

.section { padding-top: var(--s-4); margin-top: var(--s-4); border-top: 1px solid var(--surface-3); }
.section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.section-title { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.section-title .tag-lead { margin-inline-start: auto; }
.tag-lead { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--warning-soft); color: var(--warning); font-size: var(--fs-caption); font-weight: var(--fw-bold); text-transform: none; letter-spacing: 0; }
.tag-lead .px { width: 10px; height: 10px; color: var(--gold-ink); }

/* ------------------------------------------------------------ feedback: toast, banner, tooltip */
.toasts { position: fixed; z-index: var(--z-toast); top: calc(var(--topbar-h) + var(--s-2) + var(--safe-t)); inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: var(--s-3); max-width: min(440px, calc(100vw - 24px));
  min-height: var(--tap); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border: var(--edge); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-3);
  font-size: var(--fs-small); font-weight: var(--fw-semibold);
  pointer-events: none; /* taps go through to the room; only the buttons catch them */
  animation: toast-in var(--dur-base) var(--ease-pop);
}
.toast > span:not(.actions) { min-width: 0; }
.toast button { pointer-events: auto; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity 0.4s, transform 0.4s; }
/* a longer notice with a few answers: the answers go underneath */
.toast.stack { flex-wrap: wrap; row-gap: var(--s-2); }
.toast.stack > span:not(.actions) { flex: 1 1 calc(100% - 40px); }
.toast.stack .actions { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
.toast .px { color: var(--accent-ink); }
.toast .actions { display: flex; flex: none; gap: var(--s-1); margin-inline-start: auto; }
.toast.success { border-color: var(--success); }
.toast.success .px { color: var(--success); }
.toast.error { background: var(--danger-soft); border-color: var(--danger); }
.toast.error .px { color: var(--danger); }
/* a gentle once-a-day reminder (clock in): a slim pill, out of the way */
.toast.nudge { gap: var(--s-2); padding-block: var(--s-1); border-radius: var(--r-pill); }
.toast.nudge .btn.small { border-radius: var(--r-pill); }

.banner {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: var(--tap); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-md); background: var(--warning-soft); color: var(--ink);
  font-size: var(--fs-small); font-weight: var(--fw-semibold);
  box-shadow: var(--sh-3);
}
.banner .px { color: var(--warning); }
.banner .grow { flex: 1; }
.banner.offline { background: var(--surface); border: var(--edge); }
.banner.live { background: var(--surface); border: var(--edge); }

.tooltip {
  position: absolute; z-index: var(--z-popover);
  padding: 6px 10px; border-radius: var(--r-xs);
  background: var(--ink); color: var(--surface);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); white-space: nowrap;
  box-shadow: var(--sh-1);
  pointer-events: none;
}
.tooltip kbd { margin-inline-start: 6px; padding: 0 4px; border-radius: 4px; background: rgba(255, 246, 232, 0.16); font-family: var(--font-mono); font-size: 12px; }

/* ------------------------------------------------------------ empty, loading */
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-6) var(--s-4); text-align: center; color: var(--ink-muted); }
.empty .px { width: 30px; height: 30px; color: var(--accent-ink); }
.empty strong { color: var(--ink); font-size: var(--fs-body); }
.empty p { margin: 0; max-width: 32ch; font-size: var(--fs-small); }
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2) 0 40%, var(--surface-input) 50%, var(--surface-2) 60% 100%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .spinner { animation-duration: 2.4s; }
}

/* ------------------------------------------------------------ people */
.people { display: flex; flex-direction: column; gap: 2px; }
.person {
  display: flex; align-items: center; gap: var(--s-3); width: 100%;
  min-height: 48px; padding: var(--s-1) var(--s-2);
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-align: start;
}
@media (hover: hover) { .person:hover { background: var(--surface-2); } }
.person .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.person .name { display: flex; align-items: center; gap: 4px; font-weight: var(--fw-bold); font-size: var(--fs-small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .status { font-size: var(--fs-caption); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ chat */
.chat { display: flex; flex-direction: column; min-height: 0; border: var(--edge); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); overflow: hidden; container-type: inline-size; }
.chat-top { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3); border-bottom: 1px solid var(--surface-3); }
.chat-tabs { display: flex; gap: var(--s-1); min-width: 0; overflow-x: auto; scrollbar-width: none; flex: 1; }
.chat-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 var(--s-3) 0 var(--s-2);
  border: 2px solid transparent; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink);
  font-size: var(--fs-small); font-weight: var(--fw-semibold);
}
.chat-tab .avatar { width: 24px; height: 24px; box-shadow: none; }
.chat-tab[aria-selected="true"] { border-color: var(--ink); background: var(--surface-input); font-weight: var(--fw-bold); }
.here-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--surface-3); font-size: var(--fs-small); color: var(--ink-muted); }
.here-row strong { color: var(--ink); }
.here-row .btn { margin-inline-start: auto; }
.here-who { display: flex; align-items: center; gap: var(--s-2); min-width: 0; min-height: 36px; padding: 2px var(--s-2) 2px 2px; margin-inline-start: -2px; border: 0; border-radius: var(--r-pill); background: transparent; color: inherit; font-size: var(--fs-small); text-align: start; }
@media (hover: hover) { .here-who:hover { background: var(--surface-2); } }
.here-who .avatar { box-shadow: 0 0 0 2px var(--surface); }
.here-row .avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink); }
.chat-log { flex: 1; min-height: 60px; margin: 0; padding: var(--s-3); list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-2); overscroll-behavior: contain; }
.msg { display: flex; gap: var(--s-2); align-items: flex-end; max-width: 88%; }
.msg .avatar { width: 28px; height: 28px; }
.msg .body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.msg .meta { margin: 0 4px 2px; font-size: var(--fs-caption); color: var(--ink-muted); }
.msg .meta b { color: var(--ink); font-weight: var(--fw-bold); }
.msg .text { padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface-2); font-size: var(--fs-label); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .body { align-items: flex-end; }
.msg.mine .text { background: #ffe1cf; border-radius: 14px 14px 4px 14px; }
.msg.cont .meta, .msg.cont .avatar { visibility: hidden; }
.sys { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 2px var(--s-2); font-size: var(--fs-caption); color: var(--ink-muted); }
.sys .px { width: 10px; height: 10px; }
.divider { align-self: stretch; display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--accent-ink); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--surface-3); }
.typing { padding: 0 var(--s-3) var(--s-1); font-size: var(--fs-caption); color: var(--ink-muted); }
.voice-note { display: flex; align-items: center; gap: var(--s-2); min-width: 180px; }
.voice-note .play { display: grid; place-items: center; width: 32px; height: 32px; border: var(--edge); border-radius: 50%; background: var(--primary); color: var(--ink); padding: 0; }
.voice-note .play .px { width: 10px; height: 10px; }
.voice-note .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 20px; }
.voice-note .wave i { display: block; width: 3px; border-radius: 2px; background: #c9a79a; }
.voice-note .len { font-size: var(--fs-caption); color: var(--ink-muted); font-variant-numeric: tabular-nums; }

.chat-form { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2); border-top: 1px solid var(--surface-3); }
/* gestures: not messages. They play over your head for the room, so they get their own strip */
.gesture-bar { display: flex; align-items: center; gap: var(--s-1); }
.gesture-bar .gb-label { flex: none; padding: 0 var(--s-1); font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--ink-muted); }
.gesture-bar button {
  flex: 1; display: grid; place-items: center; min-width: 36px; height: 40px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink);
}
.gesture-bar button .px { color: var(--accent-ink); }
@media (hover: hover) { .gesture-bar button:hover { background: var(--surface-2); } }
.gesture-bar button:active .px { transform: scale(1.2); transition: transform var(--dur-press) var(--ease-pop); }
.gesture-bar .more { flex: none; width: 44px; border: 1px dashed var(--surface-3); }
.chat-row { display: flex; gap: var(--s-2); align-items: flex-end; }
/* a textarea that grows with what you type (up to ~5 lines, then scrolls): long messages wrap instead of scrolling out of sight */
.chat-input { flex: 1; min-width: 0; min-height: var(--tap); max-height: 120px; padding: 10px var(--s-3); border: var(--edge); border-radius: var(--r-sm); background: var(--surface-input); color: var(--ink); font: inherit; font-size: var(--fs-body); line-height: 1.35; resize: none; overflow-y: auto; overflow-wrap: anywhere; box-sizing: border-box; }
.chat-input::placeholder { color: var(--ink-placeholder); opacity: 1; }
.btn.send { width: var(--tap); padding: 0; background: var(--primary); }
.btn.mic { width: var(--tap); padding: 0; }
.btn.mic[aria-pressed="true"] { background: var(--danger); color: #fff; border-color: #7d2328; }
.recorder { display: flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-1) 0 var(--s-3); border-radius: var(--r-sm); background: var(--danger-soft); font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--danger); }
.recorder .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); animation: rec 1s infinite; }
.recorder .rec-time { color: var(--ink); font-variant-numeric: tabular-nums; margin-inline-end: auto; }

/* ------------------------------------------------------------ gestures dialog */
.gesture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr)); gap: var(--s-2); }
.gesture-grid > .btn { white-space: normal; min-width: 0; height: auto; padding-block: var(--s-2); text-align: center; overflow-wrap: anywhere; }
.gesture-grid .g {
  position: relative; display: flex; align-items: center; gap: var(--s-2);
  min-height: 52px; padding: 0 var(--s-3);
  border: 2px solid var(--surface-3); border-radius: var(--r-md); background: var(--surface-input); color: var(--ink);
  font-size: var(--fs-small); font-weight: var(--fw-semibold); text-align: start;
}
.gesture-grid .g .px { color: var(--accent-ink); }
@media (hover: hover) { .gesture-grid .g:hover { border-color: var(--ink); } }
.gesture-grid .g .slot { margin-inline-start: auto; min-width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--ink); color: var(--surface); font-size: var(--fs-caption); font-weight: var(--fw-bold); line-height: 22px; text-align: center; }
.gesture-grid .g[aria-pressed="true"] { background: var(--selected); border-color: var(--ink); }
.gesture-grid .g[aria-pressed="true"] .px { color: var(--ink); }
.quick-slots { display: flex; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2); }
.quick-slots .slot-box { flex: 1; display: grid; place-items: center; height: 48px; border: 2px dashed var(--surface-3); border-radius: var(--r-sm); background: var(--surface-input); color: var(--accent-ink); }
.quick-slots .slot-box.filled { border-style: solid; border-color: var(--ink); }

/* ------------------------------------------------------------ task board */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); align-items: start; }
.kcol { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2); }
.kcol h3 { display: flex; align-items: center; justify-content: space-between; margin: var(--s-1) var(--s-1) 0; font-size: var(--fs-small); font-weight: var(--fw-bold); }
.kcards { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.kcard { position: relative; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 2px solid rgba(59, 40, 48, 0.22); border-radius: var(--r-sm); background: #fff4c9; box-shadow: var(--sh-1); }
.kcard.p1 { background: #ffd8e1; } .kcard.p2 { background: #d7ecff; } .kcard.p3 { background: #dff2d3; }
.kcard p { margin: 0; font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--ink); overflow-wrap: anywhere; }
.kmeta { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-caption); color: var(--ink-muted); }
.kmeta .avatar { width: 22px; height: 22px; box-shadow: 0 0 0 1.5px var(--ink); }
.kmeta { flex-wrap: wrap; row-gap: var(--s-1); }
.kmeta select { flex: 1 1 96px; min-width: 0; }
.kmeta .move { display: flex; gap: 2px; margin-inline-start: auto; }
.k-done .kcard p { text-decoration: line-through; text-decoration-color: rgba(59, 40, 48, 0.45); color: var(--ink-muted); }
.kadd { display: flex; gap: var(--s-1); }
.kadd .input { min-height: 40px; padding: 6px 10px; font-size: var(--fs-small); border-width: 2px; }
.kadd .btn { min-height: 40px; width: 40px; padding: 0; }

/* ------------------------------------------------------------ meetings */
.cal-list { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.cal-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.cal-row.now { background: var(--warning-soft); box-shadow: inset 0 0 0 2px var(--ink); }
/* narrow: the board's columns stack, and a meeting's time goes above it */
@media (max-width: 700px) { .kanban { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .cal-row { grid-template-columns: minmax(0, 1fr) auto; } .cal-when { grid-column: 1 / -1; } }
.cal-when { display: flex; flex-direction: column; font-size: var(--fs-small); color: var(--ink-muted); }
.cal-when strong { color: var(--ink); font-size: var(--fs-label); }
.cal-what { display: flex; flex-direction: column; min-width: 0; }
.cal-what strong { font-size: var(--fs-label); }
.cal-what span { font-size: var(--fs-small); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: var(--fs-caption); font-weight: var(--fw-bold); }
.live-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: rec 1.4s infinite; }
/* the CEO speaking to the whole office (see pa.js) */
.pa-bar { display: flex; align-items: center; gap: var(--s-2); min-height: var(--ctl-h); padding: 4px 4px 4px var(--s-3); border: 1px solid var(--danger); border-radius: var(--r-sm); background: var(--danger-soft); color: var(--ink); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.pa-bar > .px { flex: none; width: 20px; height: 20px; color: var(--danger); }
.pa-bar .mt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-bar .pa-time { flex: none; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.pa-bar .btn.tiny { flex: none; }
.dock .tool.on-air { background: var(--danger); color: #fff; }
.meeting-bar { display: flex; align-items: center; gap: var(--s-2); min-height: var(--ctl-h); padding: 4px 4px 4px var(--s-3); border: 1px solid var(--chrome-line-soft); border-radius: var(--r-sm); background: var(--bg-sunk); color: var(--chrome-text); font-size: var(--fs-small); font-weight: var(--fw-semibold); }

/* ------------------------------------------------------------ arrange */
.decor-bar { display: flex; flex-direction: column; min-height: 0; border: var(--edge); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); overflow: hidden; }
.decor-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-2); }
.decor-intro { flex: 1; min-width: 0; }
.decor-head h2 { flex: 1; margin: 0; font-size: var(--fs-title); }
.decor-bar > .tabs { flex: none; padding: 0 var(--s-4); overflow-x: auto; scrollbar-width: none; }
.decor-bar > .tabs::-webkit-scrollbar { display: none; }
.decor-bar > .tabs .tab { flex: none; }
.decor-bar > .decor-selected { margin: var(--s-3) var(--s-4) 0; }
.tray-group > h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.decor-hint { margin: 2px 0 0; font-size: var(--fs-small); color: var(--ink-muted); font-weight: var(--fw-regular); }
.decor-hint.ok { color: var(--success); font-weight: var(--fw-bold); }
.decor-hint.blocked { color: var(--danger); font-weight: var(--fw-bold); }
.tray { flex: 1; overflow-y: auto; padding: var(--s-3) var(--s-4) var(--s-4); }
.tray-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--s-2); }
.tray-items button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--s-2) var(--s-1); border: 2px solid var(--surface-3); border-radius: var(--r-md); background: var(--surface-input); color: var(--ink); font-size: var(--fs-caption); font-weight: var(--fw-semibold); line-height: 1.2; text-align: center; }
.tray-items img { width: 60px; height: 40px; border-radius: 4px; image-rendering: pixelated; box-shadow: 0 0 0 1px rgba(59, 40, 48, 0.25); }
@media (hover: hover) { .tray-items button:hover { border-color: var(--ink); } }
.tray-items button[aria-pressed="true"] { border-color: var(--ink); background: var(--selected); }
.piece-bar { display: flex; align-items: center; gap: var(--s-1); padding: var(--s-1); border: var(--edge); border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); }
.piece-bar strong { padding: 0 var(--s-2); font-size: var(--fs-small); }

/* ------------------------------------------------------------ Habib & Yazan over the room */
.habib-status { display: flex; align-items: center; gap: var(--s-2); padding: 4px 4px 4px 4px; padding-inline-end: 4px; border: var(--edge); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: 1.2; }
.habib-status strong { display: block; font-size: var(--fs-caption); color: var(--habib); }
.habib-panel, .yazan-panel { display: flex; flex-direction: column; width: min(380px, calc(100% - 16px)); border: var(--edge); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--sh-3); overflow: hidden; }
.hp-head, .yp-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-2) var(--s-4); }
.hp-head h2, .yp-head h2 { margin: 0; font-size: var(--fs-label); font-weight: var(--fw-bold); line-height: 1.2; }
.hp-head h2 { color: var(--habib); }
.yp-head h2 { display: flex; align-items: center; gap: 6px; color: var(--yazan); }
.hp-head p, .yp-head p { margin: 0; font-size: var(--fs-small); color: var(--ink-muted); }
.ai-tag { padding: 0 6px; border-radius: 4px; background: var(--yazan-soft); color: var(--yazan); font-size: 11px; font-weight: var(--fw-bold); letter-spacing: 0.04em; }
.yp-log { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-2) var(--s-4); overflow-y: auto; }
.yp-q { align-self: flex-end; max-width: 85%; margin: 0; padding: 8px 12px; border-radius: 14px 14px 4px 14px; background: var(--yazan); color: #fbf8f2; font-size: var(--fs-small); }
.yp-a { align-self: flex-start; max-width: 92%; margin: 0; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #eef3fa; font-size: var(--fs-small); }
.yp-offer { align-self: stretch; display: flex; flex-direction: column; gap: 4px; padding: var(--s-2) var(--s-3); border: 1px solid #b6d1f0; border-radius: var(--r-md); background: var(--surface-input); font-size: var(--fs-small); }
.yp-offer.yes { border-color: #9cc49a; }
.yp-offer-head { display: flex; align-items: center; gap: 6px; font-weight: var(--fw-bold); color: var(--yazan); }
.yp-offer-status { display: flex; align-items: center; gap: 6px; color: var(--success); font-weight: var(--fw-semibold); }
.yp-form { display: flex; gap: var(--s-2); align-items: flex-end; padding: var(--s-2) var(--s-3) 0; }
.yp-fine { margin: 0; padding: var(--s-2) var(--s-4) var(--s-3); font-size: var(--fs-caption); color: var(--ink-muted); }

/* ------------------------------------------------------------ over the room on a phone */
.float-btn {
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap); padding: 0;
  border: 1px solid var(--chrome-line); border-radius: 50%;
  background: rgba(30, 34, 42, 0.82); color: var(--chrome-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.float-pill { display: inline-flex; align-items: center; gap: var(--s-2); height: var(--tap); padding: 0 var(--s-3) 0 var(--s-1); border: 1px solid var(--chrome-line); border-radius: var(--r-pill); background: rgba(30, 34, 42, 0.82); color: var(--chrome-text); font-size: var(--fs-small); font-weight: var(--fw-semibold); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.joy { position: relative; flex: none; width: 116px; height: 116px; border: 2px solid rgba(255, 246, 232, 0.4); border-radius: 50%; background: radial-gradient(circle, rgba(30, 34, 42, 0.3) 0 54%, rgba(30, 34, 42, 0.55) 56%); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); touch-action: none; }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border: var(--edge); border-radius: 50%; background: var(--surface); box-shadow: 0 3px 0 rgba(20, 12, 18, 0.55), inset 0 -5px 0 var(--surface-3); }

/* ------------------------------------------------------------ in-room tags (drawn by the overlay, kept as is, tidied) */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(42, 32, 41, 0.78); color: var(--chrome-text); font-size: var(--fs-caption); font-weight: var(--fw-bold); white-space: nowrap; }
.tag.yazan { background: rgba(52, 72, 122, 0.94); }
.tag.habib { background: rgba(31, 92, 79, 0.94); }
.tag.talking { box-shadow: 0 0 0 2px var(--here); }

/* ------------------------------------------------------------ how the app puts these together */
/* dialogs: the title and the line under it share the head with Close */
.dialog-title { flex: 1; min-width: 0; }
.dialog-head .dialog-title h2 { margin: 0; }
.dialog-body > :first-child { margin-top: 0; }
.dialog-body > h3:not(:first-child) { margin-top: var(--s-5); }
.field > label { margin: 0; }
.section > .field { margin-top: var(--s-4); }
.list-row .tag-lead { margin-inline-start: auto; flex: none; }
.list .list-row { min-height: 48px; }

/* the voice: the bars move only while someone is talking */
.speaking.still i { animation: none; transform: scaleY(0.5); }
.tool .hint { max-width: 12em; overflow: hidden; text-overflow: ellipsis; }
.tablet-chat-btn { position: relative; }
.tablet-chat-btn .badge { position: absolute; top: -7px; inset-inline-end: -7px; box-shadow: 0 0 0 2px var(--bg); }

/* the whole team, in a dialog */
.team-row { display: flex; flex-direction: column; align-items: stretch; gap: var(--s-1); padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2); }
.team-row .person { padding-inline: var(--s-1); }
.team-row .person .avatar { margin: 2px; }
.team-row .person .name .px { width: var(--icon-sm); height: var(--icon-sm); }
.team-info, .team-acts { padding-inline-start: 60px; }
.team-info:empty { display: none; }
.team-acts:empty { display: none; }
.team-info .fine { margin: 0; }

/* status and gestures */
.status-h { margin: var(--s-4) 0 var(--s-2); font-size: var(--fs-small); font-weight: var(--fw-semibold); color: var(--ink-muted); }
.status-note { margin-top: var(--s-2); }
/* availability: each icon in the colour of its dot */
.status-avail .chip .px { color: var(--av, var(--ink-muted)); }
.status-avail .chip.avail-available { --av: var(--here); }
.status-avail .chip.avail-busy, .status-avail .chip.avail-dnd { --av: var(--danger); }
.status-avail .chip.avail-away { --av: var(--warning); }
.status-avail .chip.avail-offline { --av: var(--ink-muted); }
.status-avail .chip[aria-checked="true"] .px { color: var(--av); }
.status-clear { margin-top: var(--s-3); }
.status-task { margin-top: var(--s-5); }
.chips .chip { min-height: var(--tap); }
.gesture-pane { padding-top: var(--s-4); }
.gesture-pane .quick-slots { margin-bottom: var(--s-2); }
.gesture-pane .fine { margin: 0 0 var(--s-3); }
.gesture-grid .g:disabled { opacity: 0.45; cursor: not-allowed; }
.dialog-body > .tabs { position: sticky; top: calc(-1 * var(--s-2)); z-index: 1; background: var(--surface); }

/* the chat */
.msg.cont .meta { display: none; }
.msg .avatar { box-shadow: 0 0 0 1.5px var(--ink); }
.chat-log > .empty { margin: auto; padding-block: var(--s-4); }
.chat-log > .empty .btn { margin-top: var(--s-2); }
.chat-tab .px { width: var(--icon); height: var(--icon); color: var(--accent-ink); }
.chat-tab .badge { min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }
.btn.mic .px, .btn.send .px { width: var(--icon); height: var(--icon); }
.here-row { flex: none; }

/* the front page: one box for both codes */
.join-team .field-row .input { flex: 1; min-width: 0; }
.join-team .field-row .btn { flex: none; }
.join-team .field .error { margin-top: 2px; }

/* ------------------------------------------------------------ motion */
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -100% 0; } }
@keyframes rec { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .card, .sheet, .popover, .menu, .toast { animation: fade-in 80ms linear; }
}

/* ------------------------------------------------------------ arcade game (full screen, above the office) */
.arcade-view { position: fixed; inset: 0; z-index: calc(var(--z-modal) + 5); background: #000; color: var(--chrome-text); display: flex; align-items: center; justify-content: center; }
.arcade-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.arcade-view .arcade-exit { position: absolute; z-index: 2; top: calc(var(--s-2) + var(--safe-t)); inset-inline-end: var(--s-2); opacity: 0.85; }
.arcade-view .arcade-exit:hover, .arcade-view .arcade-exit:focus-visible { opacity: 1; }
.arcade-status { display: flex; align-items: center; gap: var(--s-2); margin: 0; }
.arcade-hint { position: absolute; z-index: 2; inset-inline-start: var(--s-3); bottom: calc(var(--s-3) + var(--safe-b)); max-width: min(360px, calc(100% - 2 * var(--s-3))); padding: var(--s-2) var(--s-3); background: rgba(35, 40, 48, 0.88); border: 1px solid var(--chrome-line); border-radius: 8px; font-size: var(--fs-small); pointer-events: none; animation: fade-in 0.3s; }
.arcade-hint[hidden] { display: none; }
.arcade-hint ul { margin: var(--s-1) 0 0; padding-inline-start: 1.1em; }
.arcade-error { text-align: center; padding: var(--s-4); max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); }
.arcade-error h2 { margin: 0; }
.arcade-error p { margin: 0 0 var(--s-2); color: var(--chrome-muted); }

/* The AI team: the lead's budget for each colleague (see agents-ui.js) */
.agent-budget .row { display: flex; align-items: center; gap: var(--s-2); }
.agent-budget .row .input { max-width: 140px; }

/* ---------------------------------------------------------- Yazan's notes and the meeting archive (archive-ui.js) */
.scribe-box { margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--yazan-soft); color: var(--ink); }
.scribe-box h3 { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); color: var(--yazan); }
.scribe-box h3 .px { width: 20px; height: 20px; }
.scribe-box p { margin: 0 0 var(--s-2); }
.scribe-box .row { flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); }
.scribe-me { display: flex; align-items: flex-start; gap: var(--s-2); font-size: var(--fs-small); }
.scribe-me .px { flex: none; width: 18px; height: 18px; }
.scribe-me.on .px { color: var(--success); }
.scribe-me.off .px { color: var(--warning); }
.scribe-lang-label { display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-small); }
.scribe-lang { font: inherit; padding: var(--s-1) var(--s-2); border: var(--edge); border-radius: var(--r-sm); background: var(--surface-input); color: var(--ink); }
.scribe-live { margin: 0; padding: var(--s-2) var(--s-2) var(--s-2) var(--s-6); max-height: 180px; overflow-y: auto; border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-small); line-height: var(--lh-snug); overflow-wrap: anywhere; }
.scribe-live li + li { margin-top: var(--s-1); }
.meeting-bar .scribe-chip { flex: none; display: inline-flex; align-items: center; gap: var(--s-1); padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--yazan-soft); color: var(--yazan); font-size: var(--fs-caption); font-weight: var(--fw-semibold); white-space: nowrap; }
.meeting-bar .scribe-chip .px { width: 14px; height: 14px; }
@media (max-width: 699px) { .meeting-bar .scribe-chip { font-size: 0; gap: 0; padding: 2px; } }

.archive { display: flex; flex-direction: column; gap: var(--s-2); }
.arc { border: var(--edge-soft); border-radius: var(--r-md); background: var(--surface-2); }
.arc > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); padding: var(--s-3); cursor: pointer; list-style: none; }
.arc > summary::-webkit-details-marker { display: none; }
.arc > summary::before { content: '▸'; color: var(--accent-ink); }
.arc[open] > summary::before { content: '▾'; }
.arc-title { font-weight: var(--fw-semibold); min-width: 0; overflow-wrap: anywhere; }
.arc-meta { color: var(--ink-muted); font-size: var(--fs-small); }
.arc-chip { margin-left: auto; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--yazan-soft); color: var(--yazan); font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.arc-chip.warn { background: var(--warning-soft); color: var(--warning); }
/* meeting recordings (see rec-ui.js): REC on the meeting bar, the player in the archive */
.meeting-bar .rec-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; white-space: nowrap; }
.meeting-bar .rec-chip.out { background: var(--danger-soft); color: var(--danger); }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: rec-blink 1.6s steps(2, jump-none) infinite; }
@keyframes rec-blink { 50% { opacity: 0.35; } }
.meeting-bar .rec-btn .px { color: var(--danger); }
@media (max-width: 699px) { .meeting-bar .rec-ctl > span, .meeting-bar .rec-chip .rec-more { display: none; } .meeting-bar .rec-ctl { padding-inline: 6px; } }
.arc-chip.rec { display: inline-flex; align-items: center; gap: 4px; background: var(--danger-soft); color: var(--danger); }
.arc-chip.rec + .arc-chip { margin-left: var(--s-1); }
.arc-chip.rec .px { width: 12px; height: 12px; }
.rec-box { margin: var(--s-3) 0; padding: var(--s-3); border: 1px solid var(--chrome-line); border-radius: var(--r-sm); }
.rec-box h4 { display: flex; align-items: center; gap: 6px; margin-top: 0; }
.rec-box h4 .px { color: var(--danger); }
.rec-player { display: flex; flex-direction: column; gap: var(--s-2); align-items: flex-start; }
.rec-video { width: 100%; max-height: 52vh; border-radius: var(--r-sm); background: #000; }
.rec-parts { flex-wrap: wrap; }
.rec-parts button[aria-pressed="true"] { font-weight: var(--fw-bold); }
.rec-jump { margin-right: 6px; padding: 0 6px; border: 1px solid var(--chrome-line); border-radius: var(--r-pill); background: transparent; color: var(--danger); font: inherit; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; cursor: pointer; }
.rec-jump:hover, .rec-jump:focus-visible { background: var(--danger-soft); }
.face-tile.rec-in::before, .face-tile.rec-out::before { content: ''; position: absolute; top: 8px; right: 8px; z-index: 2; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45); }
.face-tile.rec-out::before { background: linear-gradient(135deg, transparent 42%, #fff 42%, #fff 58%, transparent 58%), #6b6f78; }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.arc > :not(summary) { margin-left: var(--s-3); margin-right: var(--s-3); }
.arc > :last-child { margin-bottom: var(--s-3); }
.arc h4 { margin: var(--s-3) var(--s-3) var(--s-1); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.arc-overview { margin-top: 0; }
.arc-list { margin-top: 0; margin-bottom: var(--s-2); padding-left: var(--s-5); }
.arc-list li + li { margin-top: var(--s-1); }
.arc-actions { list-style: none; padding-left: 0; }
.arc-actions li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-sm); background: var(--surface); }
.arc-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.arc-who { display: block; color: var(--ink-muted); font-size: var(--fs-small); }
.arc-added { flex: none; display: inline-flex; align-items: center; gap: var(--s-1); color: var(--success); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.arc-added .px { width: 16px; height: 16px; }
.arc-pri { display: inline-block; margin-left: var(--s-2); padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: var(--fs-caption); font-weight: var(--fw-semibold); background: var(--surface-2); color: var(--ink-muted); }
.arc-pri.high { background: var(--danger-soft); color: var(--danger); }
.arc-all { margin: 0 var(--s-3) var(--s-2); gap: var(--s-2); }
.arc-all .btn { flex: 0 0 auto; }
.arc-drive-why { display: flex; align-items: center; gap: var(--s-1); color: var(--warning); }
.drive-status { display: flex; align-items: flex-start; gap: var(--s-2); }
.drive-status > .px { flex: none; margin-top: 2px; color: var(--success); }
.drive-status.warn > .px { color: var(--warning); }

/* Leave (everyone's own) and HR (the CEO and the lead): see hr-ui.js */
.leave-box, .hr-panel { display: flex; flex-direction: column; gap: var(--s-3); }
.leave-box > h4, .hr-panel > h4 { margin: var(--s-2) 0 0; }
.leave-sum { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-1) var(--s-3); margin: 0; }
.leave-sum dt { font-weight: var(--fw-bold); }
.leave-sum dd { margin: 0; }
.leave-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.leave-req { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: var(--edge-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.leave-what { flex: 1 1 9rem; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.leave-what span { font-size: var(--fs-small); color: var(--ink-muted); }
.leave-chip { flex: none; padding: 0 var(--s-2); border-radius: var(--r-pill); font-size: var(--fs-caption); font-weight: var(--fw-semibold); background: var(--surface-3); color: var(--ink); }
.leave-chip.pending { background: var(--warning-soft); color: var(--warning); }
.leave-chip.approved, .leave-chip.taken { background: var(--success-soft); color: var(--success); }
.leave-chip.declined { background: var(--danger-soft); color: var(--danger); }
.leave-form, .leave-check, .hr-record { display: flex; flex-direction: column; gap: var(--s-3); }
.leave-check { padding: var(--s-3); border: var(--edge-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.leave-check p, .leave-card p { margin: 0; }
.leave-flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); font-size: var(--fs-small); }
.leave-flags li { display: flex; gap: var(--s-2); align-items: flex-start; }
.leave-flags li .px { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.leave-flags li.warn { color: var(--warning); }
.leave-flags li.info { color: var(--ink-muted); }
.leave-card { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); border: var(--edge-soft); border-radius: var(--r-sm); background: var(--surface-2); }
.leave-decide { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-1); }
.leave-agree { display: flex; gap: var(--s-2); align-items: flex-start; font-size: var(--fs-small); }
.leave-agree input { margin-top: 3px; }
.leave-file { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.leave-file > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.leave-doc { flex: none; display: inline-flex; align-items: center; gap: var(--s-1); font-size: var(--fs-caption); color: var(--success); }
.leave-doc .px { width: 16px; height: 16px; }
@media (max-width: 699px) { .arc-actions li { flex-wrap: wrap; } .arc-actions li .arc-what { flex-basis: 100%; } }
.arc-sub { margin-top: var(--s-2); }
.arc-sub > summary { cursor: pointer; color: var(--accent-ink); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.arc-sub > :not(summary) { margin-top: var(--s-2); }
.arc-notes { margin: 0; padding: var(--s-2); border-radius: var(--r-sm); background: var(--surface); font: inherit; font-size: var(--fs-small); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Share screen: what is being shared (sharp text, or smooth motion) */
.share-modes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin: var(--s-3) 0; }
.share-pick { display: grid; grid-template-columns: auto 1fr; gap: var(--s-1) var(--s-2); align-items: center; padding: var(--s-3); border: var(--edge); border-radius: var(--r-sm); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.share-pick .px { width: 20px; height: 20px; }
.share-pick b { font-size: var(--fs-body, 1rem); }
.share-pick span { grid-column: 1 / -1; color: var(--ink-muted); font-size: var(--fs-small); }
.share-pick:hover, .share-pick:focus-visible { background: var(--surface-2); }
.share-pick.on { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
@media (max-width: 599px) { .share-modes { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ clicked views: one level at a time
   A dialog opened from another one has Back in its head; a menu has one
   primary action, groups, and a grid for parallel choices. */
.btn.danger-line { background: var(--surface); border-color: var(--danger); color: var(--danger); }
@media (hover: hover) { .btn.danger-line:hover { background: var(--danger-soft); } }
.btn.wide-btn { display: flex; width: 100%; min-height: 48px; font-size: var(--fs-body); }
.dialog-head .back { flex: none; margin: -6px 0 0; margin-inline-start: -8px; }
[dir="rtl"] .dialog-head .back .px, [dir="rtl"] .px.chev, [dir="rtl"] .kmove .px { transform: scaleX(-1); }
.px.chev { flex: none; margin-inline-start: auto; color: var(--ink-muted); }
.list-row .tag-lead + .px.chev { margin-inline-start: var(--s-2); }
.context-line { display: flex; align-items: center; gap: var(--s-2); margin: 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-small); }
.context-line .px { flex: none; color: var(--accent-ink); }
.context-box { display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-small); }
.context-box p { display: flex; align-items: flex-start; gap: var(--s-2); margin: 0; overflow-wrap: anywhere; }
.context-box .px { flex: none; color: var(--accent-ink); }
.field .label { font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--ink); }

/* the office menu: tiles for what people open most */
.menu-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-bottom: var(--s-4); }
.menu-tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); min-height: 92px; padding: var(--s-3); border: var(--edge); border-radius: var(--r-md); background: var(--surface-input); box-shadow: var(--sh-1); color: var(--ink); text-align: start; }
@media (hover: hover) { .menu-tile:hover { background: var(--surface-2); } }
.menu-tile:active { transform: translateY(2px); box-shadow: none; }
.menu-tile .px { color: var(--accent-ink); }
.menu-tile .tile-name { font-size: var(--fs-label); font-weight: var(--fw-bold); }
.menu-tile .sub { color: var(--ink-muted); font-size: var(--fs-small); line-height: var(--lh-snug); }

/* menus by what was tapped */
.menu .menu-primary { display: flex; width: 100%; min-height: var(--tap); margin: var(--s-1) 0 var(--s-2); justify-content: center; }
.menu-group { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3) var(--s-1); font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.menu-group .tag-lead { text-transform: none; }
.menu-note { margin: var(--s-1) 0 var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--warning-soft); color: var(--warning); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-1); padding: var(--s-1) 0 var(--s-2); }
.menu-choice { min-height: var(--tap); padding: var(--s-1) var(--s-2); border: var(--edge); border-radius: var(--r-sm); background: var(--surface-input); color: var(--ink); font-size: var(--fs-small); font-weight: var(--fw-semibold); text-align: center; }
@media (hover: hover) { .menu-choice:hover:not(:disabled) { background: var(--surface-2); } }
.menu-choice:disabled { border-color: var(--surface-3); background: var(--surface-2); color: var(--ink-muted); cursor: default; }
.menu-quick { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-1) var(--s-3) var(--s-2); }
.menu-status { display: flex; align-items: center; gap: var(--s-3); width: 100%; margin: 0 0 var(--s-1); padding: var(--s-2) var(--s-3); border: var(--edge); border-radius: var(--r-md); background: var(--surface-input); box-shadow: var(--sh-1); color: var(--ink); text-align: start; }
@media (hover: hover) { .menu-status:hover { background: var(--surface-2); } }
.menu-status .px { flex: none; color: var(--accent-ink); }
.menu-status .menu-status-name { display: block; font-size: var(--fs-label); font-weight: var(--fw-bold); }
.menu-status .sub { display: block; color: var(--ink-muted); font-size: var(--fs-small); overflow-wrap: anywhere; }

/* the task board: a card opens; one button moves it on */
.board-filter { max-width: 280px; margin-bottom: var(--s-3); }
.kcard { flex-direction: row; align-items: flex-start; gap: var(--s-1); padding: 0; }
.kcard .kopen { display: flex; flex: 1; flex-direction: column; gap: var(--s-2); min-width: 0; min-height: var(--tap); padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); text-align: start; }
@media (hover: hover) { .kcard .kopen:hover { background: rgba(255, 255, 255, 0.35); } }
.kcard .kmove { flex: none; width: 36px; margin: var(--s-2); margin-inline-start: 0; padding: 0; }
.kadd .btn.primary { width: auto; padding: 0 var(--s-3); }
.kadd-open { justify-content: center; border: 2px dashed var(--surface-3); color: var(--ink-muted); }
.kdetail { display: flex; flex-direction: column; gap: var(--s-4); }

/* meetings: by day; one meeting; past ones */
.meetings-acts { display: flex; gap: var(--s-2); margin: 0 0 var(--s-3); }
.meetings-acts .btn { flex: 1; }
.calendar > .tabs { margin-bottom: var(--s-3); }
.cal-day { margin: var(--s-3) 0 0; font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.cal-list > .cal-day:first-child { margin-top: 0; }
button.cal-row { grid-template-columns: 76px minmax(0, 1fr) auto; width: 100%; border: 0; color: var(--ink); text-align: start; }
@media (hover: hover) { button.cal-row:hover { background: var(--surface-3); } }
@media (max-width: 600px) { button.cal-row { grid-template-columns: 64px minmax(0, 1fr) auto; } button.cal-row .cal-when { grid-column: auto; } }
.cal-info { display: flex; flex-direction: column; gap: var(--s-3); }
.cal-info h3 { margin: var(--s-2) 0 0; font-size: var(--fs-label); }
.cal-info .agenda { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cal-form { display: flex; flex-direction: column; gap: var(--s-3); }
.cal-form .cal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin: 0; }
.cal-past > .fine { margin: 0 0 var(--s-2); }
/* my own calendar: private events, my leave, and the team's meetings among them */
.cal-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2); }
.cal-share p { margin: 0; }
.cal-row.cal-mine { box-shadow: inset 4px 0 0 var(--accent); }
.cal-row.cal-mine.kind-focus { box-shadow: inset 4px 0 0 var(--ink-muted); }
.cal-row.cal-away, .cal-row.cal-mine.kind-away { box-shadow: inset 4px 0 0 var(--warning, var(--ink-muted)); }
div.cal-row.cal-away { grid-template-columns: 76px minmax(0, 1fr) auto; }
@media (max-width: 600px) { div.cal-row.cal-away { grid-template-columns: 64px minmax(0, 1fr) auto; } div.cal-row.cal-away .cal-when { grid-column: auto; } }
.cal-busy { margin: 0; color: var(--ink); }
.cal-invitees { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s-1) var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
.cal-links { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-3); }
.cal-feed h3 { margin: 0; font-size: var(--fs-label); }
.cal-feed { display: flex; flex-direction: column; gap: var(--s-2); }
.cal-feed p { margin: 0; }
.cal-feed .feed-url { font-family: ui-monospace, monospace; font-size: var(--fs-small); overflow-wrap: anywhere; user-select: all; }
.arc-row { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-2) var(--s-3); border: var(--edge-soft); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); text-align: start; }
@media (hover: hover) { .arc-row:hover { background: var(--surface-3); } }
.arc-row .arc-what { display: flex; flex-direction: column; }
.arc-row .arc-chip { margin-left: 0; }
.arc-entry > :not(.row) { margin-left: 0; margin-right: 0; }
.arc-entry h4 { margin: var(--s-3) 0 var(--s-1); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.arc-entry .arc-all { margin: 0 0 var(--s-2); }

/* the meeting: the next thing to do, then one part at a time */
.meeting { display: flex; flex-direction: column; gap: var(--s-3); }
.meeting-tabs .tab { display: inline-flex; align-items: center; gap: var(--s-1); }
.meeting-tabs .live-dot.writing { width: 8px; height: 8px; background: var(--success); box-shadow: none; }
.meeting-pane { display: flex; flex-direction: column; gap: var(--s-2); }
.meeting-pane h4 { margin: var(--s-2) 0 0; font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink); }
.meeting-pane .minutes { min-height: 200px; }
.minutes-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin: 0; }
.minutes-foot .fine { margin: 0; }
.minutes-foot .btn { flex: none; }
.btn-row { border: var(--edge-soft); background: var(--surface-input); }

/* Yazan: Start over sits with the chat */
.yp-again-row { flex: none; display: flex; justify-content: center; padding: 0 var(--s-3); }
.yp-task-acts .yp-task-more { width: 32px; padding: 0; }
.yp-fold > summary { cursor: pointer; padding: var(--s-1) 0; color: var(--yazan); font-weight: var(--fw-bold); }
.yp-fold .yp-count { color: var(--ink-muted); font-weight: var(--fw-regular); }
.yp-fold > :not(summary) { margin-top: var(--s-2); }
.yp-fold .yp-desk-list { max-height: none; padding: 0; }

/* the team: Message to hand, the rest one tap away */
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; flex-direction: row; align-items: center; gap: var(--s-2); }
.team-row > .px.chev { margin: 0 var(--s-1); }
.person-detail { display: flex; flex-direction: column; gap: var(--s-3); }
.person-face { display: flex; justify-content: center; }
.list.manage .list-row.danger, .list.manage .list-row.danger .px { color: var(--danger); }
.person-detail .section-title { margin-top: var(--s-2); }

/* A date you tap (datepicker.js): the day in words, and a month of big days under it */
.datepick { min-width: 0; }
.field:has(.datepick.open) { grid-column: 1 / -1; }
.datepick-btn { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); width: 100%; min-height: var(--tap); padding: 10px var(--s-3); border: var(--edge); border-radius: var(--r-sm); background: var(--surface-input); color: var(--ink); font: inherit; font-size: var(--fs-body); line-height: var(--lh-snug); text-align: start; cursor: pointer; }
.datepick-btn > span:first-child { flex: 1; min-width: 0; text-align: start; }
.datepick-btn .blank { color: var(--ink-placeholder); }
.datepick-btn .px { flex: none; color: var(--accent-ink); }
.datepick.open .datepick-btn { background: var(--selected); }
.datepick-cal { margin-top: var(--s-2); padding: var(--s-2); border: var(--edge-soft); border-radius: var(--r-md); background: var(--surface-input); }
.datepick-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-1); }
.datepick-nav { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); border: var(--edge); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.datepick-week, .datepick-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.datepick-week span { padding: var(--s-1) 0; text-align: center; font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--ink-muted); }
.datepick-day { min-height: 44px; border: 2px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.datepick-day:hover:not(:disabled) { background: var(--surface-2); }
.datepick-day.rest { color: var(--ink-muted); }
.datepick-day.between { background: var(--surface-2); }
.datepick-day.today { border-color: var(--accent-ink); font-weight: var(--fw-bold); }
.datepick-day.chosen { background: var(--selected); border-color: var(--ink); font-weight: var(--fw-bold); color: var(--ink); }
.datepick-day:disabled { opacity: 0.35; cursor: default; }
.datepick-quick { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.datepick-title { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-1); min-width: 0; }
.datepick-title select { min-height: var(--tap); padding: 0 var(--s-2); border: var(--edge); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font: inherit; font-weight: var(--fw-bold); }


/* ------------------------------------------------------------ the camera (meeting room only) */
.cam-split { display: inline-flex; flex: none; }
.cam-split[hidden] { display: none; }
.cam-split #btn-cam { border-start-end-radius: 0; border-end-end-radius: 0; }
.cam-split .cam-pick { width: 28px; min-width: 28px; padding: 0; border-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.cam-split.on .cam-pick { background: var(--selected); border-color: var(--selected); color: var(--ink); box-shadow: inset 0 -3px 0 var(--selected-edge); }
.cam-split .cam-pick .px { width: 14px; height: 14px; }

.cam-check { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--bg-sunk); aspect-ratio: 16 / 9; }
.cam-preview { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-preview.mirror, .face-tile.mirror .face-video { transform: scaleX(-1); }
.cam-preview-tag { position: absolute; inset-inline-start: var(--s-2); bottom: var(--s-2); padding: 3px var(--s-2); border-radius: var(--r-pill); background: rgba(28, 32, 38, 0.85); color: var(--chrome-text); font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.card .check-row { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-2) 0 0; font-size: var(--fs-small); font-weight: var(--fw-regular); color: var(--ink-muted); min-height: var(--tap); }
.card .check-row input[type="checkbox"] { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; appearance: auto; accent-color: var(--accent-ink); }
ol.steps { margin: 0; padding-inline-start: var(--s-5); line-height: var(--lh-body); }
.cam-toggles { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cam-blur { margin-top: var(--s-3); }
.cam-blur[hidden] { display: none; }
.cam-blur .bg-label { margin: var(--s-2) 0 var(--s-1); }
.bg-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.bg-pick {
  position: relative; display: block; min-height: 0; padding: 0; aspect-ratio: 16 / 9; overflow: hidden;
  border: 2px solid transparent; border-radius: var(--r-sm); background: var(--bg-sunk); cursor: pointer;
}
.bg-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bg-pick:hover { border-color: var(--chrome-line); }
.bg-pick:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.bg-pick.on { border-color: var(--selected-edge); box-shadow: 0 0 0 1px var(--selected-edge); }
.bg-pick .px { position: absolute; top: 3px; inset-inline-end: 3px; width: 16px; height: 16px; padding: 1px; border-radius: var(--r-pill); background: var(--selected); color: var(--ink); }
@media (max-width: 420px) { .bg-picks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* the faces panel */
.faces {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding: var(--s-3); box-sizing: border-box;
  border-radius: var(--r-lg); background: var(--bg-sunk); color: var(--chrome-text);
  box-shadow: var(--sh-2); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  line-height: var(--lh-snug);
}
.faces[hidden] { display: none; }
.faces-head { display: flex; align-items: center; gap: var(--s-2); }
.faces-head h2 { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-bold); }
.faces-head .spacer { flex: 1; }
.faces-count { font-size: var(--fs-small); color: var(--chrome-muted); }
.faces-ctl { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--chrome-muted); }
.faces-ctl[hidden] { display: none; }
@media (hover: hover) { .faces-ctl:hover { background: var(--chrome-fill-hover); color: var(--chrome-text); } }
.faces-ctl[aria-pressed="true"] { background: var(--selected); color: var(--ink); }
.faces-ctl.to-chat { width: auto; gap: 6px; padding: 0 var(--s-2); border: 1px solid var(--chrome-line); color: var(--chrome-text); font: inherit; font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.faces-ctl.to-chat .px { width: 16px; height: 16px; }
.faces-ctl .badge { position: static; }
.faces-self-hidden { align-self: flex-start; padding: 3px var(--s-2); border-radius: var(--r-pill); background: var(--live); color: #fff; font-size: var(--fs-caption); font-weight: var(--fw-bold); }
.faces-self-hidden[hidden] { display: none; }

.faces-grid { display: grid; gap: var(--s-2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.faces-grid[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.faces-grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.faces-grid[data-cols="auto"] { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.faces-grid:empty { display: none; }

.face-tile {
  position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-raised); box-shadow: var(--sh-2);
}
.face-tile.new { animation: face-in var(--dur-base) var(--ease-out); }
@keyframes face-in { from { opacity: 0; transform: scale(0.96); } }
.face-video { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-raised); }
.face-tile.no-video .face-video { visibility: hidden; }
.face-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.face-over:empty { display: none; }
.face-px { image-rendering: pixelated; }
.face-tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 0 var(--selected); transition: box-shadow var(--dur-fast) var(--ease-out); }
.face-tile.talking::after { box-shadow: inset 0 0 0 3px var(--selected); }
.face-tag {
  position: absolute; inset-inline-start: 6px; bottom: 6px; max-width: calc(100% - 12px);
  display: inline-flex; align-items: center; gap: 4px; padding: 3px var(--s-2);
  border-radius: var(--r-pill); background: rgba(28, 32, 38, 0.85); color: var(--chrome-text);
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.face-tag .px { width: 12px; height: 12px; color: var(--primary); flex: none; }
.face-badge { position: absolute; top: 6px; inset-inline-end: 6px; padding: 2px var(--s-2); border-radius: var(--r-pill); background: var(--warning-soft); color: var(--warning); font-size: var(--fs-caption); font-weight: var(--fw-bold); }
.face-badge[hidden] { display: none; }
.face-you { position: absolute; top: 6px; inset-inline-start: 6px; padding: 2px 7px; border-radius: var(--r-pill); background: var(--live); color: #fff; font-size: 10px; font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; }
.face-acts { position: absolute; inset-inline-end: 6px; bottom: 6px; display: flex; gap: var(--s-1); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.face-tile.me:hover .face-acts, .face-tile.me:focus-within .face-acts { opacity: 1; }
@media (hover: none) { .face-acts { opacity: 1; } }
.face-act { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: rgba(28, 32, 38, 0.85); color: var(--chrome-text); font: inherit; font-size: var(--fs-caption); font-weight: var(--fw-semibold); }
.face-act .px { width: 16px; height: 16px; }

.faces-sub { display: flex; align-items: center; gap: 6px; font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--chrome-muted); }
.faces-sub[hidden] { display: none; }
.faces-sub .px { width: 14px; height: 14px; }
.faces-sub .px-wrap { display: inline-flex; }
.faces-chips { display: flex; flex-direction: column; gap: 6px; }
.face-chip { display: flex; align-items: center; gap: var(--s-2); padding: 6px var(--s-3) 6px 6px; border-radius: var(--r-md); background: var(--bg-raised); }
.face-chip.talking { box-shadow: inset 0 0 0 3px var(--selected); }
.chip-face { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--chrome-fill-hover); }
.face-chip.ai .chip-face { background: var(--yazan); }
.chip-text { display: flex; flex-direction: column; min-width: 0; }
.chip-text b { font-size: var(--fs-small); font-weight: var(--fw-semibold); display: flex; align-items: center; gap: 6px; }
.chip-text small { font-size: var(--fs-caption); color: var(--chrome-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-ai { padding: 0 5px; border-radius: var(--r-xs); background: var(--yazan-soft); color: var(--yazan); font-size: 10px; font-weight: var(--fw-bold); }

.faces-note { display: none; align-items: center; gap: var(--s-2); margin-top: auto; padding: 6px var(--s-3); border-radius: var(--r-sm); background: var(--bg-raised); font-size: var(--fs-caption); color: var(--chrome-text); }
.faces-note.on { display: flex; }
.faces-wave { margin-inline-start: auto; border: 0; background: transparent; color: var(--focus-on-dark); font: inherit; font-weight: var(--fw-semibold); padding: 4px 6px; border-radius: var(--r-xs); }
.faces button:focus-visible, .cam-split button:focus-visible { outline: var(--focus-width) solid var(--focus-on-dark); outline-offset: var(--focus-offset); }

/* ClickUp's cards on the task board, and the line saying they are there */
.ksrc { margin-inline-start: auto; padding: 0 var(--s-1); border-radius: 4px; background: #7b68ee; color: #fff; font-size: 11px; line-height: 16px; letter-spacing: .02em; }
.clickup-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.clickup-line .btn { margin: 0; }
p.fine.warn { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--warning); }
ul.plain-list { list-style: none; padding: 0; margin: 0 0 var(--s-2); }
ul.plain-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: var(--s-1) 0; }
/* with ClickUp as the board's base, ClickUp's columns: side by side, scrolling sideways */
.kanban.cu { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); overflow-x: auto; padding-bottom: var(--s-2); }
.kstatus { display: inline-block; padding: 1px var(--s-2); border-radius: 4px; background: var(--st, #7b68ee); color: #fff; font-size: 11px; letter-spacing: .03em; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80%; }
@media (max-width: 700px) { .kanban.cu { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; } }
.clickup-who ul.plain-list li select { max-width: 60%; }

/* ------------------------------------------------------------ task board, laid out for work */
.card.board-card { width: min(1180px, 100%); }
.card.board-card.board-cu { width: min(1440px, 100%); }
.board-intro { margin-top: 0; }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.board-bar .board-filter { margin: 0; }
.board-search { flex: 1 1 200px; max-width: 340px; min-height: 40px; padding: 6px 12px; font-size: var(--fs-small); border-width: 2px; }
.kanban { margin-top: var(--s-2); }
/* ClickUp's columns side by side, with a shade where there are more to scroll to */
.kanban.cu { grid-auto-columns: minmax(250px, 1fr); scroll-snap-type: x proximity; }
.kanban.cu .kcol { scroll-snap-align: start; }
.kanban.cu.more-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.kanban.cu.more-start.more-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
.kanban.cu.more-start:not(.more-end) { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px); mask-image: linear-gradient(to right, transparent, #000 48px); }
.kcol h3 { gap: var(--s-2); min-height: 24px; }
.kcol h3 > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kstatus { max-width: none; }
/* each column scrolls on its own, so its name and "Add a card" stay in sight */
.kanban .kcards { max-height: min(58vh, 640px); min-height: 12px; overflow-y: auto; padding: 2px; margin: -2px; }
/* the board fits the window, so its sideways scrollbar is always in view (no need to scroll down to go right) */
.kanban.cu .kcards { max-height: max(220px, calc(100vh - 430px)); }
.kanban.cu { scrollbar-width: auto; scrollbar-color: var(--ink-muted) var(--surface-2); }
.kanban.cu::-webkit-scrollbar { height: 14px; }
.kanban.cu::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 7px; }
.kanban.cu::-webkit-scrollbar-thumb { background: var(--ink-muted); border-radius: 7px; border: 3px solid var(--surface-2); }
.kempty { margin: 0; padding: var(--s-3) var(--s-2); border: 2px dashed var(--surface-3); border-radius: var(--r-sm); color: var(--ink-muted); font-size: var(--fs-caption); text-align: center; }
/* ClickUp's cards: plain paper, with their column's colour down the side */
.board-cu .kcard { background: #fffdf8; border-inline-start: 5px solid var(--st, var(--surface-3)); }
.kcard .kopen p { line-height: 1.35; }
.kcard .kopen { gap: var(--s-1); }
/* the "move on" arrow: quiet until the card is pointed at (always there on touch) */
.kcard .kmove { align-self: flex-start; }
@media (hover: hover) and (pointer: fine) {
  .kcard .kmove { opacity: 0.35; transition: opacity 0.12s; }
  .kcard:hover .kmove, .kcard .kmove:focus-visible { opacity: 1; }
  .kcard[draggable="true"] { cursor: grab; }
}
/* dragging a card */
.kcard.dragging { opacity: 0.35; }
.kcard.drop-before::before { content: ''; position: absolute; inset-inline: 0; top: -7px; height: 3px; border-radius: 2px; background: var(--ink); }
.kcol.drop-end .kcards::after { content: ''; display: block; flex: none; height: 3px; border-radius: 2px; background: var(--ink); }
.kcol.drop-end { box-shadow: inset 0 0 0 2px var(--ink-muted); }
/* adding a card */
.kadd .kadd-close { width: 40px; flex: none; }
.kadd .input { flex: 1; min-width: 0; }
/* a card's own page */
.kcard-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 0; color: var(--ink-muted); }
.kcols-pick { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.kcols-pick .chip { min-height: 36px; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st, var(--ink-muted)); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.15); flex: none; }
.kcard-actions { justify-content: space-between; flex-wrap: wrap; gap: var(--s-2); }
/* on a phone: one column at a time, picked from tabs */
.klanes { display: none; }
@media (max-width: 700px) {
  .board-search { max-width: none; flex-basis: 100%; }
  .klanes { display: flex; gap: var(--s-2); overflow-x: auto; margin: var(--s-2) calc(-1 * var(--s-1)) 0; padding: 4px var(--s-1); scrollbar-width: none; }
  .klanes::-webkit-scrollbar { display: none; }
  .klanes .chip { flex: none; text-transform: none; }
  .klanes .chip[aria-selected="true"] { background: var(--selected); border-color: var(--ink); }
  .klanes .count { padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-caption); }
  .kanban, .kanban.cu { display: block; overflow: visible; -webkit-mask-image: none !important; mask-image: none !important; }
  .kanban .kcol:not(.on) { display: none; }
  .kanban .kcol h3 { display: none; }
  .kanban .kcards, .kanban.cu .kcards { max-height: none; overflow: visible; }
}
.board-bar .board-filter { flex: 0 1 260px; min-width: 220px; }
/* ClickUp's state above the board: one quiet line */
.clickup-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin: var(--s-2) 0 0; font-size: var(--fs-caption); color: var(--ink-muted); }
.clickup-line .cu-state { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: auto; min-width: 0; }
.cu-dot { width: 8px; height: 8px; border-radius: 50%; background: #2fa84f; flex: none; }
.cu-dot.bad { background: var(--warning); }
.clickup-line .btn.small { min-height: 32px; }
.kanban.cu { grid-auto-columns: minmax(232px, 1fr); }
@media (max-width: 700px) { .clickup-line .cu-state { flex-basis: 100%; } }
.kcol.is-done .kcard p { text-decoration: line-through; text-decoration-color: rgba(59, 40, 48, 0.45); color: var(--ink-muted); }
.kmeta .kby { font-style: italic; }

/* the clock chip: clock in or out in one click; its ▾ opens the time clock */
.clock-split { display: inline-flex; flex: none; }
.clock-split #btn-clock { border-start-end-radius: 0; border-end-end-radius: 0; }
.clock-split .clock-pick { width: 28px; min-width: 28px; padding: 0; border-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.clock-split .clock-pick .px { width: 14px; height: 14px; }
.clock-split button:focus-visible { outline: var(--focus-width) solid var(--focus-on-dark); outline-offset: var(--focus-offset); }
.clock-btn.running.armed .label { display: inline; }

/* the voice, compact: Mute with its microphone ▾, Share screen as an icon
   (its words come back while sharing), and the count as a small badge */
.mic-split { display: inline-flex; flex: none; }
.mic-split.split #btn-mute { border-start-end-radius: 0; border-end-end-radius: 0; }
.mic-split .mic-pick { width: 28px; min-width: 28px; padding: 0; border-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.mic-split .mic-pick .px { width: 14px; height: 14px; }
.mic-split button:focus-visible { outline: var(--focus-width) solid var(--focus-on-dark); outline-offset: var(--focus-offset); }
#btn-share:not([aria-pressed="true"]) .label { display: none; }
#btn-share:not([aria-pressed="true"]) { padding: 0; width: var(--ctl-h); }
.voice-count:not([hidden]) { min-height: 28px; padding: 0 var(--s-2); border-radius: var(--r-pill); background: var(--chrome-fill-hover); color: var(--chrome-text); font-variant-numeric: tabular-nums; }
.voice-count.name-ear:not([hidden]) { background: none; padding: 0; }
/* the lead's own office, on its tab */
.room-mine { display: inline-flex; color: var(--selected); }
/* the chat with only the team in it: a title, not a lone tab */
.chat-title { display: inline-flex; align-items: center; gap: 6px; height: 36px; margin: 0; font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--ink); }
.chat-title .px { width: var(--icon); height: var(--icon); color: var(--accent-ink); }
.btn.gesture-btn .px { width: var(--icon); height: var(--icon); color: var(--accent-ink); }

.office-btn .office-ic { display: none; }
.office-btn .office-ic .px { width: 22px; height: 22px; color: var(--chrome-text); }
/* the gesture button: quieter than the mic and Send beside it */
.btn.gesture-btn { width: 36px; border-color: transparent; background: transparent; box-shadow: none; }
@media (hover: hover) { .btn.gesture-btn:hover { background: var(--surface-2); } }

/* the emoji picker (the smile at the start of the message box): the system's own emoji in a
   scrolling grid, a bar of kinds under it to jump between, like an iPhone's keyboard */
.popover.emoji-pop { display: flex; flex-direction: column; width: min(340px, calc(100vw - 16px)); min-width: 0; max-width: none; padding: 0; overflow: hidden; }
/* (a solid surface, not the glass of the other menus: the kinds' names stick to it as it scrolls) */
.popover.emoji-pop { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
/* four things share the message row now: a little less air between and inside them keeps the placeholder readable */
.chat-row { gap: var(--s-1); }
.chat-row .btn.gesture-btn, .chat-row .btn.mic { width: 34px; }
.chat-row .chat-input { padding-inline: var(--s-2); }
.emo-scroll { flex: 1; min-height: 0; padding: 0 var(--s-2) var(--s-2); overflow-y: auto; overscroll-behavior: contain; scroll-padding-top: 30px; scrollbar-width: thin; }
.emo-head { position: sticky; top: 0; z-index: 1; margin: 0 calc(-1 * var(--s-2)); padding: var(--s-2) var(--s-3) var(--s-1); background: var(--surface); color: var(--ink-muted); font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.emo, .emo-kind { padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; line-height: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.emo { height: 40px; min-width: 0; font-size: 26px; }
@media (hover: hover) { .emo:hover, .emo-kind:hover { background: var(--surface-2); } }
.emo:active { transform: scale(1.25); transition: transform var(--dur-press) var(--ease-pop); }
.emo:focus-visible, .emo-kind:focus-visible { outline-offset: -2px; }
.emo-bar { flex: none; display: flex; gap: 2px; padding: var(--s-1) var(--s-2); border-top: 1px solid var(--surface-3); }
.emo-kind { flex: 1; min-width: 0; min-height: 40px; font-size: 18px; opacity: 0.55; }
.emo-kind[data-on] { background: var(--surface-2); opacity: 1; }
.chat-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Deleting your own account (Settings → Account & sign-in): out of the way until asked for */
.delete-account summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; color: var(--danger); font-weight: var(--fw-semibold); }
.delete-account[open] summary { margin-bottom: var(--s-2); }
.delete-account ul { margin: 0 0 var(--s-3); padding-inline-start: var(--s-5); }
.delete-account .login-form, .delete-account .field { margin-bottom: var(--s-3); }

/* An address nobody confirmed, claimed by proving it (sign-up and Settings → Email) */
.claim { margin: var(--s-3) 0; padding: var(--s-3); background: var(--chrome-fill); border: 1px solid var(--chrome-line-soft); border-radius: var(--r-md); }
.claim .row { margin-top: var(--s-2); }
.claim-code[hidden] { display: none; }

.row.end { justify-content: flex-end; }

.lang-line { text-align: end; margin: 0; }

/* Two-step sign-in (Settings → Account & sign-in) */
.two-factor .qr { display: block; margin: var(--s-3) auto; border-radius: var(--r-md); max-width: 100%; image-rendering: pixelated; }
.two-factor .tf-secret, .recovery-codes code { font-family: var(--font-mono); letter-spacing: .08em; word-break: break-all; }
.recovery-codes { list-style: none; margin: var(--s-3) 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.recovery-codes li { padding: var(--s-2) var(--s-3); background: var(--chrome-fill); border: 1px solid var(--chrome-line-soft); border-radius: var(--r-sm); text-align: center; direction: ltr; }
.second-step[hidden] { display: none; }

/* Invite by email (the Invite panel): the box for the address, what became of each, and who is still to come */
.invite-mail input { width: 100%; }
.invite-results, .invite-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.invite-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.invite-list li span { min-width: 0; overflow-wrap: anywhere; }

/* Paying for the office (billing.js): the four plans to pick from, the card form, the payments */
.card.hero.wide { max-width: min(720px, 100%); }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--s-2, 8px); margin: var(--s-2, 8px) 0; }
.plan-card {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: start;
  padding: 12px; border-radius: var(--r-md, 12px); border: 2px solid var(--surface-3); background: var(--surface-input); color: var(--ink); cursor: pointer; font: inherit;
}
.plan-card:hover { border-color: var(--ink-muted); }
.plan-card.on, .plan-card[aria-checked="true"] { border-color: var(--selected-edge); background: var(--selected); }
/* ink on the gold, in either theme (9.15:1) */
.plan-card.on, .plan-card.on *, .plan-card[aria-checked="true"] * { color: #3b2830 !important; }
.plan-card:disabled { opacity: .5; cursor: not-allowed; }
.plan-card .plan-size { font-size: .9em; }
.plan-card .plan-price { font-weight: 700; }
.card-form { display: grid; gap: var(--s-1, 4px); width: min(420px, 100%); margin-inline: auto; text-align: start; }
.card-form .card-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2, 8px); }
.billing-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.billing-list li { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
