/* Bossy (formerly Slyde Office Personal) on the web. Tokens from Slyde's design system (Paytera-Website DESIGN.md):
   ink and white, Slyde Blue only for the one action and live state, selection shown in ink,
   pills for everything you tap, Your Office as the one night surface. */

:root {
  --brand-blue: #006FFF;
  --action-blue: #0066F0;
  --action-blue-deep: #005BD6;
  --club-sky: #8DB8FF;
  --ink: #0B0B0F;
  --night: #050507;
  --white: #FFFFFF;
  --mist: #F2F5FB;
  --cloud: #E3ECFC;
  --muted: #555E6C;
  --muted-2: #7D8593;
  --line: rgba(11, 11, 15, 0.1);
  --received: #0A8A4B;
  --owed: #C4271B;
  /* The wordmark's crown: a deeper gold on light surfaces, the icon's gold (#FFD23F) on dark ones. */
  --crown: #F5B400;
  --crown-tips: #FFD23F;

  --ground: var(--mist);
  --surface: var(--white);
  --surface-2: #F7F9FD;
  --text: var(--ink);
  --inverse: var(--ink);
  --on-inverse: var(--white);
  --shadow: 0 1px 2px rgba(11, 11, 15, 0.04), 0 8px 24px rgba(11, 11, 15, 0.06);

  --radius-field: 18px;
  --radius-sticker: 20px;
  --radius-frame: 28px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: var(--night);
    --surface: #121217;
    --surface-2: #18181f;
    --text: #F5F6F8;
    --inverse: #FFFFFF;
    --on-inverse: var(--ink);
    --muted: rgba(255, 255, 255, 0.68);
    --muted-2: rgba(255, 255, 255, 0.5);
    --line: rgba(255, 255, 255, 0.14);
    --cloud: #16233A;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --crown: #FFD23F;
  }
}
:root[data-theme="dark"] {
  --ground: var(--night);
  --surface: #121217;
  --surface-2: #18181f;
  --text: #F5F6F8;
  --inverse: #FFFFFF;
  --on-inverse: var(--ink);
  --muted: rgba(255, 255, 255, 0.68);
  --muted-2: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --cloud: #16233A;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --crown: #FFD23F;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--action-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
::selection { background: var(--brand-blue); color: #fff; }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
img { display: block; }

.boot { display: grid; place-items: center; min-height: 100dvh; }
.boot img { border-radius: 14px; animation: breathe 1.4s ease-in-out infinite; }

/* ─── Layout ─────────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 22px 14px;
  display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--line); background: var(--surface);
}
.sidebar .logo { padding: 4px 10px 18px; }
.sidebar .logo .wordmark { font-size: 25px; }
/* Bossy's wordmark (ui.js): the app icon's crown without its blue square, and the name in Nunito 900. */
.wordmark { display: inline-flex; align-items: center; gap: 0.24em; font-family: Nunito, ui-rounded, system-ui, sans-serif; font-weight: 900; font-size: 26px; line-height: 1; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.wordmark svg { flex: none; width: 1.145em; height: 1em; margin-top: -0.16em; color: var(--crown); }
.wordmark .crown-tips { fill: var(--crown-tips); }
.nav-link {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px;
  border-radius: 999px; color: var(--text); font-weight: 500; background: none; border: 0; cursor: pointer; text-align: left;
}
.nav-link:hover { background: var(--mist); text-decoration: none; }
.nav-link.active { background: var(--inverse); color: var(--on-inverse); }
.nav-link .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand-blue); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.nav-link.active .badge { background: var(--on-inverse); color: var(--inverse); }
.sidebar .spacer { flex: 1; }
.sidebar .me { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; background: var(--surface-2); font-size: 13px; }
.sidebar .me .who { min-width: 0; }
.sidebar .me .who b, .sidebar .me .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .me .who span { color: var(--muted); }

main { padding: 28px 36px 120px; max-width: 1180px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.06; letter-spacing: -0.04em; font-weight: 600; margin: 0; }
h1 .lead { color: var(--muted-2); }
h2 { font-size: 20px; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 16px; letter-spacing: -0.02em; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section { margin-top: 30px; }

/* Bottom tabs on phones. */
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 18px 16px 120px; }
  .grid-2 { grid-template-columns: 1fr; }
  .tabbar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(18px);
    border: 1px solid var(--line); border-radius: 999px; padding: 6px; z-index: 20; justify-content: space-between;
  }
  .tabbar .nav-link { flex: 1; justify-content: center; padding: 0 6px; font-size: 12px; height: 44px; flex-direction: column; gap: 0; line-height: 1.1; }
  .tabbar .nav-link .badge { position: absolute; margin: -6px 0 0 24px; height: 16px; min-width: 16px; font-size: 10px; }
}

/* ─── Controls ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 600; background: var(--action-blue); color: #fff; white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn:hover { background: var(--action-blue-deep); text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; transform: none; }
.btn.lg { height: 56px; padding: 0 28px; font-size: 17px; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--mist); }
.btn.ink { background: var(--inverse); color: var(--on-inverse); }
.btn.danger { background: none; color: var(--owed); border: 1px solid color-mix(in srgb, var(--owed) 30%, transparent); }
/* Ghost and danger buttons set their own colors, which would hide that they're off. */
.btn.ghost:disabled, .btn.danger:disabled { background: var(--line); color: var(--muted); border-color: transparent; }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--mist); }

.field, textarea.field, select.field {
  width: 100%; min-height: 52px; padding: 14px 18px; border-radius: var(--radius-field);
  border: 1px solid var(--line); background: var(--surface); outline: none; resize: vertical;
}
.field:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
textarea.field { min-height: 120px; line-height: 1.5; }
label.label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.check { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--inverse); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.chip.selected { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }

/* ─── Cards and stickers ─────────────────────────────────────────── */

.card { background: var(--surface); border-radius: var(--radius-frame); padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.flat { box-shadow: none; }
/* Settings → Delete account: apart from the other cards, with a red edge. */
.danger-card { border-color: color-mix(in srgb, var(--owed) 35%, var(--line)); }
.stickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; max-width: 640px; }
.sticker { background: var(--surface); border-radius: var(--radius-sticker); padding: 14px 16px; box-shadow: var(--shadow); }
.sticker:nth-child(1) { transform: rotate(-1.5deg); }
.sticker:nth-child(2) { transform: rotate(1deg); }
.sticker:nth-child(3) { transform: rotate(-0.8deg); }
.sticker b { display: block; font-size: 24px; letter-spacing: -0.03em; font-weight: 600; font-variant-numeric: tabular-nums; }
.sticker span { color: var(--muted); font-size: 13px; font-weight: 500; }

.question {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 22px; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--inverse); margin-bottom: 10px; color: var(--text);
}
.question:hover { text-decoration: none; background: var(--surface-2); }
.question .hand { width: 34px; height: 34px; border-radius: 50%; background: var(--inverse); color: var(--on-inverse); display: grid; place-items: center; flex: none; }

.banner { padding: 14px 18px; border-radius: 22px; background: var(--cloud); margin-bottom: 14px; display: flex; gap: 12px; align-items: center; }
.banner.bad { background: color-mix(in srgb, var(--owed) 12%, transparent); }

/* ─── Office floor ───────────────────────────────────────────────── */

.floor {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px; padding: 16px; border-radius: 32px; border: 1px solid var(--line);
}
.room {
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 18px; cursor: pointer;
  display: flex; flex-direction: column; gap: 14px; min-height: 190px; color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.room:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.room.night { background: var(--night); color: #fff; border-color: color-mix(in srgb, var(--club-sky) 35%, transparent); }
.room .room-name { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.room.night .room-name { color: var(--club-sky); }
.room .head { display: flex; gap: 12px; align-items: center; }
.room .head .who b { display: block; font-size: 16px; letter-spacing: -0.02em; }
.room .head .who span { font-size: 13px; color: var(--muted); }
.room.night .head .who span { color: rgba(255, 255, 255, 0.68); }
.room .team { display: flex; margin-top: auto; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.room.night .team { color: rgba(255, 255, 255, 0.6); }
.room .team .faces { display: flex; }
.room .team .faces .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.room.night .team .faces .avatar { border-color: var(--night); }
.room .team .faces .avatar:first-child { margin-left: 0; }
.you-desk { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); font-size: 13px; }
.you-desk .plate { background: #3a2412; color: #f2d173; font-weight: 800; font-size: 10px; letter-spacing: 0.1em; padding: 2px 6px; border-radius: 3px; }

/* ─── Avatars and status ─────────────────────────────────────────── */

.avatar {
  --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: calc(var(--size) * 0.38); letter-spacing: -0.02em;
  position: relative;
}
.avatar.sm { --size: 28px; }
.avatar.xs { --size: 18px; }
.avatar.md { --size: 48px; }
.avatar.lg { --size: 64px; }
/* An agent's symbol on its color (the apps' SF Symbols, drawn as strokes). */
.agent-avatar svg { width: 54%; height: 54%; display: block; }
/* Slyde's close-friends ring: blue around whoever is live right now. */
.avatar.live { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--brand-blue); animation: ring 1.6s ease-in-out infinite; }
.room.night .avatar.live { box-shadow: 0 0 0 2px var(--night), 0 0 0 4.5px var(--brand-blue); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-working { color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 12%, transparent); }
.s-queued, .s-waitingOnTeam, .s-stopped, .s-interrupted, .s-idle { color: var(--muted); background: var(--surface-2); }
.s-needsYou { color: var(--on-inverse); background: var(--inverse); }
.s-done { color: var(--received); background: color-mix(in srgb, var(--received) 12%, transparent); }
.s-failed { color: var(--owed); background: color-mix(in srgb, var(--owed) 12%, transparent); }
.room.night .s-idle, .room.night .s-waitingOnTeam { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); }
.room.night .s-needsYou { background: #fff; color: var(--ink); }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

/* ─── Desks inside a department ──────────────────────────────────── */

.desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.desk { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; color: var(--text); }
.desk:hover { box-shadow: var(--shadow); text-decoration: none; }
.desk.head-desk { border-color: var(--inverse); }
.desk .top { display: flex; gap: 12px; align-items: center; }
.desk .top b { display: block; letter-spacing: -0.02em; }
.desk .top span { font-size: 13px; color: var(--muted); }
.desk .now { font-size: 13px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); min-height: 44px; }
.tag-head { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 999px; background: var(--inverse); color: var(--on-inverse); margin-left: 6px; vertical-align: 2px; }
.subroom { margin-top: 26px; }
.subroom .subroom-name { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }

/* ─── Lists ──────────────────────────────────────────────────────── */

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.list-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--text); cursor: pointer; }
.list-row:first-child { border-top: 0; }
.list-row:hover { background: var(--surface-2); text-decoration: none; }
.list-row .main { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.list-row .meta { font-size: 13px; color: var(--muted); }
.group-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 24px 4px 10px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ─── Task detail ────────────────────────────────────────────────── */

.timeline { display: grid; gap: 12px; }
.event { display: flex; gap: 12px; font-size: 14px; }
.event .ico { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 12px; }
.event .body { flex: 1; min-width: 0; }
.event .body .t { white-space: pre-wrap; overflow-wrap: anywhere; }
.event.thinking .t { color: var(--muted); font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.event.thinking.open .t { -webkit-line-clamp: unset; }
.event .when { font-size: 12px; color: var(--muted-2); }

.markdown { overflow-wrap: anywhere; }
.markdown > :first-child { margin-top: 0; }
.markdown h1, .markdown h2, .markdown h3 { font-size: 17px; margin: 18px 0 8px; letter-spacing: -0.02em; }
.markdown table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.markdown code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: 0.92em; }
.markdown pre { background: var(--surface-2); padding: 12px; border-radius: 12px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; }

.composer { position: sticky; bottom: 16px; display: flex; gap: 10px; align-items: flex-end; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 26px; padding: 8px; margin-top: 18px; }
.composer textarea { flex: 1; border: 0; background: none; outline: none; resize: none; padding: 10px 12px; min-height: 44px; max-height: 200px; }
@media (max-width: 860px) { .composer { bottom: 90px; } }

/* ─── Chat ───────────────────────────────────────────────────────── */

.chat { display: grid; gap: 10px; max-width: 760px; }
.bubble { max-width: 82%; padding: 12px 16px; border-radius: 22px; overflow-wrap: anywhere; }
.bubble.you { justify-self: end; background: var(--action-blue); color: #fff; border-bottom-right-radius: 8px; white-space: pre-wrap; }
.bubble.them { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 8px; }
.action-chip { justify-self: start; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 5px 12px; margin-left: 6px; }
.suggestions { display: grid; gap: 8px; max-width: 560px; }
.suggestion { text-align: left; padding: 14px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.suggestion:hover { background: var(--cloud); }
/* Pause and edit your last message */
.edit-last { justify-self: end; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; margin: -4px 6px 0; padding: 4px 6px; border-radius: 8px; }
.edit-last:hover { color: var(--text); background: var(--surface-2); }
.event .edit-last, .card > .edit-last { margin: 6px 0 0 -6px; }
.pause-hint { display: flex; align-items: center; gap: 8px; margin: 0 0 8px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
@media (max-width: 560px) {
  .composer .send-btn { width: 44px; padding: 0; flex: none; }
  .composer .send-btn span { display: none; }
}

/* ─── Sign in ────────────────────────────────────────────────────── */

.signin { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: var(--surface); }
.signin .box { width: 100%; max-width: 420px; text-align: center; display: grid; gap: 18px; }
.signin .signin-mark { font-size: 40px; justify-self: center; margin-bottom: 8px; }
.signin h1 { font-size: clamp(34px, 6vw, 46px); }
.segments { display: flex; gap: 4px; margin-bottom: 18px; }
.segments i { flex: 1; height: 3px; border-radius: 99px; background: var(--line); }
.segments i.on { background: var(--inverse); }
.google-btn { height: 56px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; font-size: 17px; cursor: pointer; width: 100%; }
.google-btn:hover { background: var(--mist); }
.signin-note { justify-content: center; gap: 8px; margin: 0; }

/* ─── Connect Google (google.js): one line, one button ───────────── */
.gconnect { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin: 0 0 18px; border-radius: var(--radius-frame); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gconnect-mark { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); }
.gconnect-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.gconnect-text b { font-size: 16px; }
.gconnect-text > span { color: var(--muted); font-size: 14px; }
.gconnect-text > .gconnect-hint { color: var(--text); font-size: 13px; font-weight: 600; }
.gconnect .btn { flex: none; }
.gconnect.again { border-color: color-mix(in srgb, #F4B400 60%, var(--line)); }
.gconnect.compact { padding: 12px 14px 12px 16px; border-radius: 22px; gap: 12px; }
.gconnect.compact .gconnect-mark { width: 36px; height: 36px; }
.gconnect.compact .gconnect-text b { font-size: 15px; }
.gconnect.bare { padding: 0; margin: 0; border: 0; box-shadow: none; background: none; }
[data-gconnect="assistant"] { max-width: 760px; }
.gconnect-first { order: -1; } /* Settings: Google goes first while it isn't connected */
.drive-state .gconnect { width: min(640px, 100%); margin: 0; text-align: left; }
@media (max-width: 560px) { .gconnect { flex-wrap: wrap; } .gconnect .btn { width: 100%; } }
.person-google { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.person-google .person-label { margin: 0; }
.person-google.ok > span:last-child { color: var(--received); font-weight: 600; }
.person-google.ok .muted { font-weight: 400; }
.person-google.warn > span:last-child { color: #A15C00; font-weight: 600; }
.person-google.off > span:last-child { color: var(--muted); }
.google-summary { margin-left: 10px; text-transform: none; letter-spacing: 0; font-weight: 600; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .person-google.warn > span:last-child { color: #F4B400; } }
:root[data-theme="dark"] .person-google.warn > span:last-child { color: #F4B400; }

/* ─── Usage ──────────────────────────────────────────────────────── */

.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand-blue); border-radius: 99px; }
.meter.warn i { background: var(--inverse); }
.meter.bad i { background: var(--owed); }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--inverse); color: var(--on-inverse); padding: 12px 18px; border-radius: 22px; text-align: center; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: 0.2s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (max-width: 860px) { #toast { bottom: 96px; } }

dialog { border: 0; border-radius: 28px; padding: 26px; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(5, 5, 7, 0.45); backdrop-filter: blur(4px); }
dialog h2 { margin-bottom: 16px; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

@keyframes ring { 50% { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px color-mix(in srgb, var(--brand-blue) 45%, transparent); } }
@keyframes typing { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes breathe { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Living office scene (ported from the iPhone app) ───────────── */

.scene { position: relative; width: 100%; overflow: hidden; border-radius: 26px; background: var(--surface); border: 1px solid var(--line);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 28px 28px; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage > * { position: absolute; }
.sc-hall { top: 0; background: color-mix(in srgb, var(--cloud) 75%, transparent); border-radius: 26px; }
.sc-door { width: 64px; height: 30px; border-radius: 15px; background: var(--inverse); color: var(--on-inverse); font-size: 7px; font-weight: 900; letter-spacing: 0.06em; display: grid; place-items: center; }
.sc-room { background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; }
.sc-room[data-room]:not([data-room=""]) { cursor: pointer; }
.sc-room[data-room]:not([data-room=""]):hover { border-color: var(--muted-2); }
.sc-room.night { background: var(--night); border-color: color-mix(in srgb, var(--club-sky) 35%, transparent); }
.sc-room.lounge { background: var(--cloud); }
.sc-label { position: absolute; left: 12px; top: 8px; font-size: 8px; font-weight: 800; letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.sc-room.night .sc-label { color: var(--club-sky); }
.sc-doorgap { position: absolute; width: 6px; height: 22px; background: inherit; }
.sc-room.night .sc-doorgap { background: var(--night); }
.sc-room .sc-doorgap { background: var(--surface); }
.sc-room.lounge .sc-doorgap { background: var(--cloud); }
.sc-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 8px; color: var(--muted-2); }
.sc-sofa { position: absolute; left: 50%; top: 48px; width: 96px; height: 30px; margin-left: -48px; border-radius: 8px; background: color-mix(in srgb, #5856D6 55%, transparent); box-shadow: inset 0 12px 0 color-mix(in srgb, #5856D6 70%, transparent); }
.sc-rug { position: absolute; left: 50%; top: 92px; width: 80px; height: 22px; margin-left: -40px; border-radius: 9px; background: color-mix(in srgb, var(--brand-blue) 14%, transparent); }
.sc-window { position: absolute; left: 14px; bottom: 3px; width: 56px; height: 4px; border-radius: 2px; background: color-mix(in srgb, #32ADE6 55%, transparent); }
.sc-plant { width: 18px; height: 24px; pointer-events: none; background:
  radial-gradient(circle at 50% 35%, #34C759cc 0 6px, transparent 7px), radial-gradient(circle at 25% 50%, #34C759bb 0 6px, transparent 7px),
  radial-gradient(circle at 75% 50%, #34C759bb 0 6px, transparent 7px), linear-gradient(#a2845e, #a2845e) bottom / 12px 9px no-repeat; }

.sc-desk { border-radius: 5px; background: #CCA880; border: 1px solid #9E7A57; cursor: pointer; z-index: 1; }
.sc-desk .lid { position: absolute; left: 50%; top: -6px; width: 22px; height: 12px; margin-left: -11px; border-radius: 2px; background: #595959; transition: 0.3s; }
.sc-desk.on .lid { background: var(--agent); box-shadow: 0 0 8px var(--agent); }
.sc-desk .mug { position: absolute; right: 7px; top: 5px; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.85); }
.sc-plate { position: absolute; left: 50%; top: calc(100% + 2px); transform: translateX(-50%); font-size: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sc-plate.night { color: var(--club-sky); }

.sc-owner { cursor: pointer; display: flex; flex-direction: column; align-items: center; z-index: 2; }
.sc-you { position: relative; width: 28px; height: 42px; margin-bottom: -8px; }
.sc-you .head { position: absolute; left: 4px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #E8B88F; box-shadow: inset 0 7px 0 #26190F; }
.sc-you .suit { position: absolute; left: 1px; top: 18px; width: 26px; height: 18px; border-radius: 7px; background: #2e2e2e; box-shadow: inset 0 0 0 9px #2e2e2e, inset 11px 0 0 -8px #fff; }
.sc-bigdesk { position: relative; width: 100%; border-radius: 8px; background: linear-gradient(#80543a, #66402a); border: 1.5px solid #4d2e1a; display: flex; justify-content: center; gap: 10px; }
.sc-bigdesk .mon { width: 22px; height: 12px; margin-top: -6px; border-radius: 2px; background: #333; box-shadow: inset 0 0 0 2px #333, inset 0 0 0 9px color-mix(in srgb, var(--brand-blue) 40%, #333); }
.sc-bigdesk b { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); font-size: 7px; letter-spacing: 0.1em; background: #3a2412; color: #f2d173; padding: 1px 5px; border-radius: 2px; }
.sc-status { position: absolute; right: 6px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: #FF3B30; box-shadow: 0 0 0 1.5px #4d2e1a; }
.sc-owner.online .sc-status { background: #34C759; }
/* Someone away from their desk: the chair is empty. */
.sc-owner.person:not(.online) .sc-you { visibility: hidden; }
.sc-owner.person:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; border-radius: 8px; }

.ch { position: absolute; left: 0; top: 0; width: 70px; height: 80px; border: 0; background: none; padding: 0; cursor: pointer; will-change: transform; }
.ch:focus-visible { outline: 2px solid var(--brand-blue); border-radius: 12px; }
.sc-top { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: center; }
.sc-bubble { height: 15px; padding: 0 6px; border-radius: 99px; font-size: 7.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.sc-bubble .typing i { width: 4px; height: 4px; }
.sc-bubble.working { background: color-mix(in srgb, currentColor 16%, transparent); }
.sc-bubble.needs { background: var(--inverse); color: var(--on-inverse); animation: bounce 1.2s ease-in-out infinite; }
.sc-bubble.done { background: color-mix(in srgb, var(--received) 16%, transparent); color: var(--received); }
.sc-bubble.failed { background: color-mix(in srgb, var(--owed) 16%, transparent); color: var(--owed); }
.sc-bubble.note { background: var(--cloud); color: var(--text); }
.sc-bubble.chat { background: none; font-size: 13px; }
.sc-fx { position: absolute; inset: 0; pointer-events: none; }
.sc-fx i { position: absolute; bottom: 52px; font-size: 9px; font-style: normal; font-weight: 800; animation: float 1.8s ease-out forwards; }

.sc-fig { position: absolute; left: 18px; top: 18px; width: 34px; height: 44px; }
.sc-fig .shadow { position: absolute; left: 7px; bottom: -2px; width: 20px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, 0.12); }
.sc-fig .leg { position: absolute; bottom: 1px; left: 11px; width: 5px; height: 10px; border-radius: 3px; background: #3d3d4d; }
.sc-fig .leg.r { left: 18px; }
.sc-fig .torso { position: absolute; left: 8px; bottom: 9px; width: 18px; height: 15px; border-radius: 6px; background: var(--agent); }
.sc-fig .arm { position: absolute; left: -4px; top: 1px; width: 4px; height: 10px; border-radius: 3px; background: var(--agent); filter: brightness(0.9); transform-origin: top center; }
.sc-fig .arm.r { left: 18px; }
.sc-fig .doc { position: absolute; top: 3px; width: 8px; height: 10px; border-radius: 1.5px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.sc-fig .head { position: absolute; left: 9px; bottom: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--skin); box-shadow: inset 0 6px 0 var(--hair); }
.sc-fig .eye { position: absolute; top: 9px; width: 2.2px; height: 2.2px; border-radius: 50%; background: rgba(0, 0, 0, 0.75); }
.sc-fig.sitting .torso { bottom: 2px; }
.sc-fig.sitting .head { bottom: 15px; }
.sc-fig.walking .leg { animation: step 0.42s ease-in-out infinite; }
.sc-fig.walking .leg.r { animation-delay: -0.21s; }
.sc-fig.walking .arm { animation: swing 0.42s ease-in-out infinite; }
.sc-fig.walking .arm.r { animation-delay: -0.21s; }
.sc-fig.walking { animation: bob 0.21s ease-in-out infinite alternate; }
.sc-fig.is-typing .arm { animation: type 0.22s ease-in-out infinite alternate; }
.sc-fig.is-typing .arm.r { animation-delay: -0.11s; }
.sc-fig.waving .arm.r { animation: wave 0.5s ease-in-out infinite alternate; }
.sc-name { position: absolute; left: 0; right: 0; top: 66px; text-align: center; font-size: 8px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sc-name.night { color: var(--club-sky); }

@keyframes step { 50% { transform: translateY(-2.5px); } }
@keyframes swing { 0% { transform: rotate(22deg); } 100% { transform: rotate(-22deg); } }
@keyframes bob { to { transform: translateY(-1.2px); } }
@keyframes type { to { transform: translateY(1.5px); } }
@keyframes wave { from { transform: rotate(140deg); } to { transform: rotate(170deg); } }
@keyframes float { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
@keyframes bounce { 50% { transform: translateY(-3px); } }
.sc-room.locked { cursor: not-allowed; background: color-mix(in srgb, var(--surface) 70%, var(--mist)); }
.sc-room.locked .sc-label { color: var(--muted-2); }

/* Attachments */
.attach-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.attach-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.attach-chips:empty { display: none; }
.plus-wrap { position: relative; flex: none; align-self: flex-end; }
.plus-btn { width: 44px; height: 44px; }
.plus-btn[aria-expanded="true"] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.plus-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.16); display: grid; gap: 2px; }
.plus-menu[hidden] { display: none; }
.plus-menu button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; font-weight: 500; white-space: nowrap; }
.plus-menu button:hover, .plus-menu button:focus-visible { background: var(--mist); outline: none; }
.line-input { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line); border-radius: var(--radius-field); padding: 6px; background: var(--surface); }
.line-input:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.line-input textarea { flex: 1; border: 0; outline: none; background: none; resize: none; min-height: 150px; padding: 8px 6px; line-height: 1.5; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; max-width: 260px; }
.attach-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 15px; }
.attach-chip.uploading { opacity: 0.6; }
.drive-list { max-height: 360px; overflow: auto; display: grid; gap: 4px; }
.drive-file { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.drive-file:hover { background: var(--mist); }
.drive-file img { width: 16px; height: 16px; }
.drive-file .meta { font-size: 12px; color: var(--muted); }
.bubble.files { background: none; border: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; justify-self: end; }
.org-room { padding: 12px 16px; border-top: 1px solid var(--line); }
.org-room:first-child { border-top: 0; }
.org-agent { display: flex; gap: 10px; align-items: center; padding: 6px 0 6px 18px; }
.org-agent select, .org-room select { min-height: 34px; padding: 4px 10px; border-radius: 12px; width: auto; max-width: 240px; font-size: 13px; }

/* ─── Members ────────────────────────────────────────────────────── */

fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.people { display: grid; gap: 12px; }
.person { padding: 18px 20px; }
.person-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.person-head .who { min-width: 0; }
.person-head .name-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person-head .email { overflow-wrap: anywhere; margin-left: 16px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: none; opacity: 0.6; }
.online-dot.on { background: #34C759; opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, #34C759 20%, transparent); }
.role-badge { height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; display: inline-flex; align-items: center; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.role-badge.r-owner { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.role-badge.r-admin { color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 10%, transparent); border-color: transparent; }
.role-badge.r-lead { color: var(--received); background: color-mix(in srgb, var(--received) 10%, transparent); border-color: transparent; }
.spend { margin-top: 12px; display: grid; gap: 6px; max-width: 360px; }
.meter.thin { height: 4px; }
.person-controls { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.person-controls label { display: flex; gap: 8px; align-items: center; }
.person-controls .field { min-height: 36px; padding: 6px 12px; border-radius: 12px; width: auto; font-size: 14px; }
.person-controls input.field { width: 110px; }
/* A limit's dollars beside its token field (the owner only). */
.person-controls .limit-usd { align-self: center; margin-left: -6px; }
.chip:disabled { cursor: default; opacity: 0.75; }
/* Classes like .stack set display, which would beat the hidden attribute. */
#invite [hidden] { display: none; }
.person-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.person-label { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.person-controls .field.office-name { width: 240px; max-width: 100%; }
.invite-row.editing { box-shadow: inset 3px 0 0 var(--inverse); background: var(--surface-2); }
.invite-row { cursor: default; flex-wrap: wrap; }
.invite-row .actions { flex: none; }
.invite-problem { flex-wrap: wrap; justify-content: space-between; margin-top: 14px; }
@media (max-width: 860px) {
  .invite-row .actions { width: 100%; }
  .person { padding: 16px; }
}

/* ─── Mail ───────────────────────────────────────────────────────── */

.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a { flex: none; height: 36px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.segmented a:hover { background: var(--mist); text-decoration: none; }
.segmented a.on { background: var(--inverse); color: var(--on-inverse); }
.segmented .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand-blue); color: #fff; font-size: 11px; display: grid; place-items: center; }
.mail-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.mail-search { flex: 1; min-width: 220px; display: flex; gap: 8px; }
.mail-search .field { min-height: 44px; padding: 10px 18px; border-radius: 999px; }
.mail-row { display: flex; align-items: flex-start; gap: 4px; border-top: 1px solid var(--line); }
.mail-row:first-child { border-top: 0; }
.mail-row:hover { background: var(--surface-2); }
.mail-row .main { flex: 1; min-width: 0; padding: 12px 18px 12px 0; color: var(--text); display: grid; gap: 1px; }
.mail-row .main:hover { text-decoration: none; }
.mail-row .line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.mail-row .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-row .n { color: var(--muted); font-size: 12px; flex: none; }
.mail-row .date { margin-left: auto; color: var(--muted); font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.mail-row .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .snippet { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .from, .mail-row.unread .subject, .mail-row.unread .date { font-weight: 700; color: var(--text); }
.mail-row.unread { box-shadow: inset 3px 0 0 var(--brand-blue); }
.star { flex: none; width: 40px; height: 44px; margin-top: 4px; border: 0; background: none; cursor: pointer; color: var(--muted-2); font-size: 18px; line-height: 1; border-radius: 12px; }
.star:hover { color: var(--text); }
.star.on { color: #F4B400; }
/* List actions: checkboxes and the bulk bar, quick actions on hover, a ⋯ menu on touch, Undo. */
.mail-list { overflow: visible; }
.mail-list .mail-row:first-child { border-radius: 22px 22px 0 0; }
.mail-list .mail-row:last-child { border-radius: 0 0 22px 22px; }
.mail-list .mail-row:only-child { border-radius: 22px; }
.mail-row { position: relative; }
.mail-row.selected { background: color-mix(in srgb, var(--brand-blue) 8%, var(--surface)); }
.mail-check { flex: none; width: 40px; height: 44px; display: grid; place-items: center; cursor: pointer; }
.mail-row .mail-check { margin: 4px -8px 0 4px; }
.mail-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--inverse); cursor: pointer; }
.mail-bulk { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; margin: 0 0 8px; padding: 0 4px; }
.mail-bulk.on { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 4px 8px 4px 4px; }
.mail-bulk-count { font-weight: 700; font-size: 14px; margin-right: 6px; }
.mail-row-actions { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; padding: 3px; border-radius: 14px; background: var(--surface-2); }
.mail-row.selected .mail-row-actions { background: color-mix(in srgb, var(--brand-blue) 8%, var(--surface)); }
.mail-act { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.mail-act:hover, .mail-act:focus-visible { background: var(--line); color: var(--text); outline: none; }
.mail-more { position: relative; flex: none; align-self: center; margin-right: 6px; }
.mail-more .icon-btn { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); }
.mail-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 210px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.16); display: grid; gap: 2px; }
.mail-menu[hidden] { display: none; }
.mail-menu button { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text); cursor: pointer; text-align: left; font: inherit; font-weight: 500; white-space: nowrap; }
.mail-menu button:hover, .mail-menu button:focus-visible { background: var(--mist); outline: none; }
@media (hover: hover) {
  .mail-row:hover .mail-row-actions, .mail-row:focus-within .mail-row-actions { display: flex; }
  .mail-row:hover .date, .mail-row:focus-within .date { visibility: hidden; }
  .mail-more { display: none; }
}
@media (max-width: 560px) {
  .mail-bulk.on { gap: 2px; }
  .mail-bulk .btn { width: 36px; height: 36px; padding: 0; border: 0; }
  .mail-bulk .btn span { display: none; }
  .mail-row .mail-check { width: 34px; margin-right: -10px; }
}
#undo-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 49; display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  background: var(--inverse); color: var(--on-inverse); padding: 6px 6px 6px 18px; border-radius: 22px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
#undo-toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
#undo-toast button { border: 0; border-radius: 999px; padding: 8px 14px; background: color-mix(in srgb, var(--on-inverse) 16%, transparent); color: inherit; font: inherit; cursor: pointer; }
@media (max-width: 860px) { #undo-toast { bottom: 96px; } }
/* Address suggestions in To and Cc */
.addr-wrap { position: relative; }
.addr-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5; max-height: 290px; overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.16); }
.addr-menu[hidden] { display: none; }
.addr-option { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.addr-option.on { background: var(--mist); }
.addr-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 60%; }
.addr-email { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.mail-msg { padding: 18px 20px; margin-bottom: 12px; }
.mail-msg .head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.mail-msg .who { min-width: 0; overflow-wrap: anywhere; }
.mail-msg .who .addr { color: var(--muted); font-size: 13px; }
.mail-msg .rcpt { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.mail-msg .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.mail-msg .files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
/* Email HTML renders in a shadow root (its own styles can't reach the page) on white, like Gmail. */
.mail-body { display: block; margin-top: 14px; border-radius: 14px; background: #fff; color: #202124; overflow: auto; contain: content; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mail-body { padding: 14px 16px; } }
:root[data-theme="dark"] .mail-body { padding: 14px 16px; }
.compose .field { min-height: 44px; padding: 10px 16px; }
.compose textarea.field { min-height: 220px; }
@media (max-width: 860px) {
  .mail-msg { padding: 14px; }
  .mail-actions .btn { padding: 0 12px; }
  .mail-search { min-width: 0; width: 100%; }
}

/* ─── Requests ───────────────────────────────────────────────────── */

.money-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  color: var(--received); background: color-mix(in srgb, var(--received) 12%, transparent); }
.request-row .main { display: grid; gap: 2px; }
.request-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.request-meta span { display: inline-flex; gap: 4px; align-items: center; }
.request-tags { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }
.request-head { margin-top: 6px; }
.request-title { font-size: clamp(24px, 2.6vw, 32px); margin: 0 0 6px; overflow-wrap: anywhere; }
.money-fields[hidden] { display: none; }
button.attach-chip, a.attach-chip { cursor: pointer; color: var(--text); }
a.attach-chip:hover { text-decoration: none; background: var(--mist); }
.thread { display: grid; gap: 10px; max-width: 760px; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px 16px; display: grid; gap: 6px; }
.comment.mine { background: var(--surface-2); }
.history { font-size: 12px; color: var(--muted); padding: 0 16px; }
@media (max-width: 860px) {
  .request-row { flex-wrap: wrap; }
  .request-row .main { flex-basis: 100%; }
  .request-tags { flex-direction: row; align-items: center; }
}

/* ─── Agenda calendar ────────────────────────────────────────────── */

.cal-head-bar { flex-wrap: wrap; }
.cal-controls { gap: 8px; }
.cal-controls .icon-btn { font-size: 20px; line-height: 1; }
.cal-title { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 12px; }
.cal-title h2 { margin: 0; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.cal-card { padding: 0; overflow: hidden; }
.cal-tasks { position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow: auto; }
.cal-tasks h2 { margin: 0 0 4px; }
.cal-tasks .group-title { margin: 16px 0 6px; }
.cal-tasks .group-title.overdue { color: var(--owed); }
.cal-task-list { display: grid; }
.cal-task-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cal-task-row:first-child { border-top: 0; }
.cal-task-row input, .cal-task input { accent-color: var(--inverse); flex: none; }
.cal-task-row input { width: 18px; height: 18px; margin-top: 2px; }

/* Day and week: hour grid. Columns: hour labels, then one per day. */
.cal-scroll { overflow-x: auto; }
.cal-time { --gutter: 56px; min-width: 100%; }
.cal-time.multi { min-width: calc(var(--gutter) + var(--days) * 72px); }
.cal-row { display: grid; grid-template-columns: var(--gutter) repeat(var(--days), minmax(0, 1fr)); }
.cal-heads { border-bottom: 1px solid var(--line); }
.cal-dayhead { border: 0; background: none; cursor: pointer; padding: 10px 4px; display: grid; justify-items: center; gap: 2px; color: var(--text); border-left: 1px solid var(--line); }
.cal-dayhead span { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.cal-dayhead b { font-size: 20px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; }
.cal-dayhead.today b { background: var(--inverse); color: var(--on-inverse); }
.cal-dayhead:hover { background: var(--surface-2); }
.cal-allday { border-bottom: 1px solid var(--line); min-height: 34px; }
.cal-gutter-label { font-size: 11px; color: var(--muted); padding: 8px 6px 0 0; text-align: right; }
.cal-allday-cell { border-left: 1px solid var(--line); padding: 4px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.cal-allday-cell.today, .cal-col.today { background: color-mix(in srgb, var(--brand-blue) 4%, transparent); }
.cal-body { height: clamp(420px, calc(100dvh - 330px), 900px); overflow-y: auto; overscroll-behavior: contain; }
.cal-hours { position: relative; }
.cal-hour { position: relative; }
.cal-hour span { position: absolute; top: -8px; right: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-col { position: relative; border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.cal-event { position: absolute; border: 0; border-radius: 8px; padding: 4px 6px; text-align: left; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 1px; font-size: 12px; line-height: 1.25; box-shadow: 0 0 0 1px var(--surface); }
.cal-event b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-event span { opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.short { flex-direction: row; gap: 6px; padding: 2px 6px; align-items: center; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #FF3B30; z-index: 3; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #FF3B30; }
.cal-chip { border: 0; border-radius: 6px; padding: 2px 6px; font-size: 12px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.cal-chip b { font-weight: 600; }
.cal-task { display: flex; gap: 5px; align-items: center; font-size: 12px; padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--line); background: var(--surface); cursor: pointer; min-width: 0; }
.cal-task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
/* Shared agendas: the tabs above the calendar, the color picker and the about panel */
.agenda-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.agenda-dot.big { width: 14px; height: 14px; margin-right: 8px; }
.cal-title .agenda-overlay { margin-left: auto; padding: 0; align-self: center; }
.agenda-about .member-list { margin-top: 4px; }
.color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { position: relative; width: 30px; height: 30px; cursor: pointer; }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }

/* Month */
.cal-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month-head { padding: 10px 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line); }
.cal-month-cell { min-height: 112px; padding: 6px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 3px; align-content: start; cursor: pointer; min-width: 0; }
.cal-month-cell:nth-child(7n + 1) { border-left: 0; }
.cal-month-cell:hover { background: var(--surface-2); }
.cal-month-cell.outside { background: var(--surface-2); }
.cal-month-cell.outside > * { opacity: 0.5; }
.cal-date { font-size: 13px; font-weight: 600; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.cal-month-cell.today .cal-date { background: var(--inverse); color: var(--on-inverse); }
.cal-more { font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 4px; white-space: nowrap; }

@media (max-width: 860px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-tasks { position: static; max-height: none; }
  .cal-time { --gutter: 46px; }
  .cal-time.multi { min-width: calc(var(--gutter) + var(--days) * 84px); }
  .cal-body { height: clamp(380px, calc(100dvh - 380px), 700px); }
  .cal-month-cell { min-height: 72px; padding: 3px; }
  .cal-month-cell .cal-chip, .cal-month-cell .cal-task { font-size: 10px; padding: 1px 4px; }
  .cal-month-cell .cal-chip b { display: none; }
  .cal-month-head { padding: 8px 4px; font-size: 10px; }
  .cal-more { font-size: 10px; padding-left: 2px; }
}

/* ─── Board ──────────────────────────────────────────────────────── */

.board-head { flex-wrap: wrap; }
.board-head .row { gap: 8px; }
.board-filters { margin: 0 0 14px; gap: 8px; }
.board-filters .field { min-height: 38px; padding: 6px 12px; border-radius: 999px; width: auto; font-size: 14px; }
/* The board scrolls sideways on its own; the page never does. */
.board-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px 12px; overscroll-behavior-x: contain; }
.board { display: flex; gap: 14px; align-items: flex-start; width: max-content; }
.board-col { width: 286px; flex: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; padding: 10px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100dvh - 240px); }
.board-col.done { background: color-mix(in srgb, var(--received) 5%, var(--surface-2)); }
.board-col header { display: flex; align-items: center; gap: 8px; padding: 4px 6px; }
.board-col header b { font-size: 15px; }
.board-col .count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.board-col .done-mark { color: var(--received); font-weight: 700; }
.col-menu { margin-left: auto; width: 30px; height: 30px; font-size: 16px; }
.board-cards { display: grid; gap: 8px; min-height: 44px; overflow-y: auto; border-radius: 14px; padding: 2px; }
.board-cards.over { background: color-mix(in srgb, var(--brand-blue) 6%, transparent); }
.drop-marker { height: 4px; border-radius: 99px; background: var(--brand-blue); }
.board-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; cursor: pointer; box-shadow: 0 1px 2px rgba(11, 11, 15, 0.04); }
.board-card:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.board-card:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.board-card.dragging { opacity: 0.4; }
.board-card.is-done .card-title { color: var(--muted); }
.card-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; }
.label-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.label-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }
.card-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.card-meta > span:not(.avatar) { display: inline-flex; gap: 3px; align-items: center; }
.card-meta .spacer { flex: 1; }
.card-meta .all-done { color: var(--received); }
.due.overdue { color: var(--owed); font-weight: 600; }
.due.soon { color: #B26A00; font-weight: 600; }
.money-badge.pending { color: #8A5A00; background: color-mix(in srgb, #F2B200 18%, transparent); }
.agent-badge { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--brand-blue); }
.agent-badge.done { color: var(--received); }
.agent-badge.ask { color: var(--text); }
.agent-badge.failed { color: var(--owed); }
.person-avatar { background: var(--inverse); color: var(--on-inverse); }
.add-card-btn { border: 0; background: none; color: var(--muted); font-weight: 600; text-align: left; padding: 8px 6px; border-radius: 12px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.add-card-btn:hover { background: var(--surface); color: var(--text); }
.add-card { display: grid; gap: 8px; }
.add-card textarea.field { min-height: 64px; padding: 10px 12px; border-radius: 14px; }
.board-sub { margin-top: 4px; }
/* Picking people (boards, agendas) and the members list in their settings */
.people-picker { display: grid; gap: 8px; }
.label.heading { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
.people-picker .label { margin: 0; }
.pick-row .pick-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.pick-row .pick-viewonly { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.pick-row .pick-viewonly input { width: 16px; height: 16px; }
.pick-viewonly:has(input:disabled) { opacity: 0.4; cursor: default; }
.member-head { justify-content: space-between; margin-bottom: 4px; }
.member-head .label { margin: 0; }
.member-list { display: grid; gap: 2px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.member-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.member-row .check { padding: 0; }
.settings-foot { justify-content: space-between; gap: 8px; }
.my-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.my-card { display: grid; gap: 4px; }

/* Card dialog */
.card-dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; display: none; flex-direction: column; }
.card-dialog[open] { display: flex; }
.cd-top { display: flex; gap: 10px; align-items: center; padding: 18px 20px 6px; }
.cd-title { flex: 1; min-width: 0; font: inherit; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; border: 1px solid transparent; border-radius: 12px; padding: 6px 10px; background: none; color: var(--text); }
.cd-title:hover, .cd-title:focus { border-color: var(--line); outline: none; background: var(--surface-2); }
.cd-scroll { overflow-y: auto; padding: 0 20px 22px; }
.cd-sub { padding: 0 10px 14px; }
.cd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.cd-main, .cd-side { grid-template-columns: minmax(0, 1fr); }
.cd-main > *, .cd-side > * { min-width: 0; }
.cd-label { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.cd-label .btn, .cd-label .pill { letter-spacing: 0; text-transform: none; }
.cd-label a.btn { margin-left: auto; }
.cd-side .field, .small-field { min-height: 40px; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.cd-side .check { padding: 4px 0; }
.checklist { display: grid; }
.check-item { display: flex; align-items: center; gap: 6px; }
.check-item .check { flex: 1; padding: 5px 0; }
.check-item.done span { text-decoration: line-through; color: var(--muted); }
.icon-btn.mini { width: 26px; height: 26px; font-size: 14px; border: 0; }
.cd-agent { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: var(--surface-2); }
.cd-composer textarea { min-height: 44px; }
.card-dialog .thread { gap: 8px; }

@media (max-width: 860px) {
  /* Phones: one column at a time, swiped sideways. */
  .board-scroll { scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; }
  .board-col { width: calc(100vw - 48px); scroll-snap-align: start; max-height: none; }
  .board-cards { overflow: visible; }
  .card-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .cd-grid { grid-template-columns: minmax(0, 1fr); }
  .cd-side { order: -1; }
  .cd-top { padding: 12px 12px 4px; }
  .cd-scroll { padding: 0 12px 22px; }
}

/* Agenda: adding events and the event box */
.cal-col { cursor: cell; }
.event-join { justify-content: center; font-size: 16px; padding: 12px 18px; }
.event-link { margin-top: -6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-guests { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.event-status { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--cloud); font-size: 11px; font-weight: 700; }
.event-status.accepted { background: color-mix(in srgb, var(--received, #0A8A4B) 18%, transparent); color: var(--received, #0A8A4B); }
.event-status.declined { background: color-mix(in srgb, var(--owed, #C4271B) 15%, transparent); color: var(--owed, #C4271B); }
.event-notes { max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.ev-time[hidden] { display: none; }

/* ─── Team chat ──────────────────────────────────────────────────── */

.sidebar .nav-links { display: flex; flex-direction: column; gap: 4px; }
/* Pages that fill the window (Chat) and scroll inside their own panes. */
main.full { max-width: none; padding: 0; }

/* More (the phone's fifth tab) */
.more-groups { display: grid; gap: 14px; max-width: 640px; }
.more-row { align-items: center; min-height: 56px; }
.more-row .title { font-weight: 500; }
.more-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.more-row .badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--brand-blue); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.more-row .chev { color: var(--muted-2); display: grid; }

.chat-app { --hover: color-mix(in srgb, var(--text) 6%, transparent); position: relative; display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100dvh; background: var(--surface); }

/* ─── The side list: Chat, Office, Calendars and Boards share it ───── */
.side-list { --hover: color-mix(in srgb, var(--text) 6%, transparent); background: var(--ground); border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; padding: 22px 10px 28px; }
.side-head { padding: 0 8px 6px; }
.side-head h1 { font-size: 28px; }
.side-section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 8px 6px; min-height: 26px; }
.side-section-title .icon-btn.mini { background: none; color: var(--muted); }
.side-section-title .icon-btn.mini:hover { background: var(--hover); color: var(--text); }
.side-empty { font-size: 13px; color: var(--muted); padding: 4px 10px; }
.side-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; color: var(--text); min-height: 48px; }
.side-row:hover { background: var(--hover); text-decoration: none; }
.side-row.active { background: var(--inverse); color: var(--on-inverse); }
button.side-row { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.side-row.side-quiet { color: var(--muted); min-height: 40px; }
.side-row.side-quiet:hover { color: var(--text); }
.side-row-icon { width: 28px; flex: none; display: grid; place-items: center; color: var(--muted); }
.side-row.active .side-row-icon { color: inherit; }
.side-row.active .person-avatar { background: var(--on-inverse); color: var(--inverse); }
.side-row-main { flex: 1; min-width: 0; display: grid; }
.side-row-name, .side-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-row-name { font-weight: 500; }
.side-row-sub { font-size: 12.5px; color: var(--muted); }
.side-row.active .side-row-sub, .side-row.active .side-row-meta { color: color-mix(in srgb, var(--on-inverse) 70%, transparent); }
.side-row.unread .side-row-name { font-weight: 700; }
.side-row.unread .side-row-sub { color: var(--text); }
.side-row .badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand-blue); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.side-row-meta { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.side-row-lock { flex: none; display: grid; color: var(--muted-2); }
.side-row.locked .side-row-name { color: var(--muted); }
.side-row.active .side-row-lock { color: inherit; }
.side-dot { width: 10px; height: 10px; border-radius: 50%; display: block; }
.side-row.active .side-dot { box-shadow: 0 0 0 2px var(--on-inverse); }
/* Folders: an arrow in front folds what's inside; rows inside step in. */
.side-tree-row { position: relative; }
.side-node .side-row { min-height: 40px; padding-left: calc(30px + var(--depth, 0) * 14px); }
.side-twisty { position: absolute; z-index: 1; top: 50%; left: calc(6px + var(--depth, 0) * 14px); width: 22px; height: 22px; margin-top: -11px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.side-twisty:hover { background: var(--hover); color: var(--text); }
.side-twisty svg { transform: rotate(90deg); transition: transform 0.15s; }
.side-node.closed > .side-tree-row .side-twisty svg { transform: none; }
.side-node.closed > .side-children { display: none; }
.side-tree-row.active .side-twisty { color: var(--on-inverse); }
.side-tree-row.active .side-twisty:hover { background: color-mix(in srgb, var(--on-inverse) 16%, transparent); }
@media (prefers-reduced-motion: reduce) { .side-twisty svg { transition: none; } }

/* A page beside its side list (Office, Calendars, Boards). The page scrolls with the window, so live
   re-renders keep your place; the list stays put. */
.side-app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100dvh; }
.side-app > .side-list { position: sticky; top: 0; height: 100dvh; }
.side-pane { min-width: 0; max-width: 1180px; padding: 28px 36px 120px; }
.side-back { display: none; align-items: center; gap: 4px; margin: 0 0 10px -6px; padding: 6px 10px 6px 4px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.side-back:hover { background: var(--mist); color: var(--text); text-decoration: none; }
@media (max-width: 1279px) and (min-width: 861px) {
  .side-app { grid-template-columns: 250px minmax(0, 1fr); }
  .side-pane { padding: 24px 24px 120px; }
}
/* Phones: the list first, then the page, like Chat. */
@media (max-width: 860px) {
  .side-app { grid-template-columns: minmax(0, 1fr); }
  .side-app[data-show="list"] > .side-pane, .side-app[data-show="page"] > .side-list { display: none; }
  .side-app[data-show="list"] > .side-list { position: static; height: auto; border: 0; overflow: visible; padding: 18px 8px 120px; }
  .side-pane { padding: 14px 16px 120px; }
  .side-back { display: inline-flex; }
}
.nc-name { display: flex; align-items: center; gap: 8px; }
.nc-name span { font-weight: 700; color: var(--muted); font-size: 18px; }
.chat-join { flex: none; display: flex; align-items: center; gap: 14px; margin: 0 20px 18px; padding: 12px 12px 12px 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.chat-join-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.chat-join-text .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-list { display: grid; gap: 2px; max-height: 420px; overflow-y: auto; }
.browse-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 12px; }
.browse-row[hidden] { display: none; }
.browse-main { flex: 1; min-width: 0; }
.browse-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .chat-join { margin: 0 10px max(10px, env(safe-area-inset-bottom)); } }
.group-avatar { font-size: 12px; }

.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; min-height: 68px; border-bottom: 1px solid var(--line); flex: none; }
.chat-title { flex: 1; min-width: 0; }
.chat-title h2 { margin: 0; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title .hash { color: var(--muted-2); margin-right: 2px; font-weight: 600; }
.chat-sub { display: flex; align-items: center; gap: 6px; min-width: 0; }
.chat-sub > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A conversation's agents: small overlapping faces, then "+N". */
.agent-stack { display: inline-flex; align-items: center; flex: none; }
.agent-stack .avatar { margin-left: -5px; box-shadow: 0 0 0 1.5px var(--surface); }
.agent-stack .avatar:first-child { margin-left: 0; }
.agent-stack .more { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
/* A chat with an agent: its face beside its name and title. */
.chat-title-btn.chat-title-agent { display: flex; align-items: center; gap: 10px; }
.chat-title-agent .avatar { --size: 36px; }
.chat-title-text { min-width: 0; display: grid; }
.chat-back { display: none; flex: none; }
.chat-people { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); flex: none; }
.chat-people:hover { background: var(--hover); }
.chat-people .faces { display: flex; }
.chat-people .faces .avatar { --size: 26px; margin-left: -8px; border: 2px solid var(--surface); }
.chat-people .faces .avatar:first-child { margin-left: 0; }
.chat-placeholder { margin: auto; display: grid; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 40px; }

.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 0 14px; }
.chat-msgs { display: flex; flex-direction: column; }
.chat-loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.chat-start { padding: 12px 24px 12px; color: var(--muted); display: grid; gap: 4px; }
.chat-start b { color: var(--text); }
.agent-start { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; max-width: 640px; }
.chat-older { display: flex; justify-content: center; padding: 12px; }

.msg { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; padding: 6px 24px 6px 20px; transition: background-color 0.6s ease-out; }
/* The original of a quote you clicked, lit up for a moment. */
.msg.flash { background: color-mix(in srgb, var(--brand-blue) 10%, transparent); transition-duration: 0.15s; }
.msg.touched { background: var(--hover); }
.msg.compact { padding-top: 1px; padding-bottom: 1px; }
.msg-gutter { padding-top: 2px; min-width: 0; }
.msg-gutter .avatar { --size: 36px; }
.msg-hover-time { display: block; visibility: hidden; font-size: 11px; line-height: 23px; color: var(--muted-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg.touched .msg-hover-time { visibility: visible; }
.msg-main { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.msg-head b { font-weight: 700; }
.msg-head time { font-size: 12px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.msg-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; background: var(--cloud); color: var(--text); align-self: center; }
.msg-text { overflow-wrap: anywhere; }
.msg-text p { margin: 0 0 6px; }
.msg-text > :last-child { margin-bottom: 0; }
.msg-text ul, .msg-text ol { margin: 4px 0 6px; padding-left: 22px; }
.msg-edited { font-size: 12px; color: var(--muted-2); }
.deleted-note { color: var(--muted); font-style: italic; }
.msg.pending { opacity: 0.55; }
.msg.failed .msg-text { color: var(--owed); }
.msg-failed { margin-top: 4px; font-size: 13px; color: var(--owed); }
.msg-failed button { border: 0; background: none; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.mention { padding: 0 3px; border-radius: 5px; font-weight: 600; color: var(--action-blue); background: color-mix(in srgb, var(--brand-blue) 10%, transparent); }
.mention.me { color: var(--text); background: color-mix(in srgb, #F2B200 28%, transparent); }
.msg-working { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--brand-blue); }
.msg-working.ask { color: var(--text); }
.msg-working { flex-wrap: wrap; }
.msg-working.paused { color: var(--muted); gap: 6px; }
.msg-pause { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.msg-pause:hover { background: var(--surface-2); }
.msg-working.paused .msg-pause { border: 0; background: none; padding: 0; color: var(--action-blue); font-size: 13px; }
.msg-working.paused .msg-pause:hover { text-decoration: underline; }
.msg-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.msg-image { border: 1px solid var(--line); padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; max-width: min(360px, 100%); }
.msg-image img { display: block; max-width: 100%; max-height: 280px; min-width: 96px; min-height: 72px; object-fit: cover; }
.msg-image.broken img { visibility: hidden; }
.msg-files { margin-top: 6px; }

.msg-reactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.reaction { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; color: var(--text); }
.reaction span { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.reaction:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.reaction.mine { border-color: color-mix(in srgb, var(--brand-blue) 55%, transparent); background: color-mix(in srgb, var(--brand-blue) 10%, var(--surface)); }
.reaction.mine span { color: var(--brand-blue); }
.reaction.add { color: var(--muted); opacity: 0; }
.msg.touched .reaction.add, .reaction.add:focus-visible { opacity: 1; }
/* A reply's quote: who wrote the original and how it starts, in the author's color (an agent's own,
   Slyde blue for people). Click it to jump to the original. */
.msg-quote { --q: var(--brand-blue); display: grid; gap: 1px; width: max-content; max-width: min(320px, 100%); margin: 3px 0 5px; padding: 5px 10px 6px 12px;
  border: 0; border-radius: 8px; box-shadow: inset 3px 0 0 var(--q); background: color-mix(in srgb, var(--q) 8%, transparent); font: inherit; text-align: left; cursor: pointer; color: var(--text); }
.msg-quote:hover { background: color-mix(in srgb, var(--q) 14%, transparent); }
.msg-quote b { font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--q) 82%, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-quote span, .reply-text { font-size: 13px; line-height: 1.35; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.msg-quote .gone, .reply-text.gone { font-style: italic; }
/* "Valeria is typing…" at the bottom of the conversation while an agent works on a message. */
.msg-typing { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; align-items: center; padding: 6px 24px 8px 20px; }
.msg-typing .msg-gutter { padding: 0; }
.typing-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.typing-bubble { --q: var(--brand-blue); display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 12px; border-radius: 16px; background: color-mix(in srgb, var(--cloud) 70%, transparent); font-size: 13px; color: var(--muted); }
.typing-bubble .typing { color: var(--q); }
/* Replying: the message you're answering, above the message box. */
.reply-bar { --q: var(--brand-blue); display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 8px 8px 8px 14px; border-radius: 14px; box-shadow: inset 3px 0 0 var(--q); background: var(--surface-2); border: 1px solid var(--line); border-left: 0; }
.reply-icon { flex: none; display: grid; color: color-mix(in srgb, var(--q) 82%, var(--text)); }
.reply-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.reply-main b { font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--q) 82%, var(--text)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-hint { font-size: 12px; color: var(--muted-2); }
.reply-bar .icon-btn.mini { flex: none; background: none; color: var(--muted); }
.reply-bar .icon-btn.mini:hover { background: var(--hover); color: var(--text); }
/* Who reacted: a tooltip on hover, a small popover on a long press. */
.reactors-tip { position: fixed; z-index: 70; max-width: 280px; padding: 6px 10px; border-radius: 10px; background: var(--inverse); color: var(--on-inverse); font-size: 13px; line-height: 1.35;
  box-shadow: 0 8px 24px rgba(11, 11, 15, 0.18); pointer-events: none; overflow-wrap: anywhere; }
.reactors-tip.touch { pointer-events: auto; padding: 10px 14px; border-radius: 14px; font-size: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.reaction { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

.msg-actions { position: absolute; top: -12px; right: 20px; z-index: 2; display: none; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(11, 11, 15, 0.1); }
.msg.touched .msg-actions, .msg-actions:focus-within { display: flex; }
/* Hover only where there is one: on touch screens a tap would leave it stuck on. */
@media (hover: hover) {
  .msg:hover { background: var(--hover); }
  .msg:hover .msg-hover-time { visibility: visible; }
  .msg:hover .reaction.add { opacity: 1; }
  .msg:hover .msg-actions { display: flex; }
}
.msg-actions button { width: 32px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.msg-actions button:hover { background: var(--hover); color: var(--text); }
.msg-edit { display: grid; gap: 8px; }
.msg-edit textarea.field { min-height: 70px; padding: 10px 14px; border-radius: 14px; }

.msg-day, .msg-new { display: flex; align-items: center; gap: 10px; margin: 14px 20px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.msg-day::before, .msg-day::after, .msg-new::before, .msg-new::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg-day span { padding: 2px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.msg-new { color: var(--owed); margin: 6px 20px; }
.msg-new::before, .msg-new::after { background: color-mix(in srgb, var(--owed) 45%, transparent); }
.msg-new::before { display: none; }

.chat-compose { position: relative; flex: none; padding: 0 20px 18px; }
.chat-composer { position: static; margin: 0; }
.chat-compose .attach-chips { margin: 0 0 8px; }
.mention-menu { position: absolute; left: 20px; bottom: calc(100% - 10px); z-index: 5; width: min(420px, calc(100% - 40px)); display: grid; gap: 2px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.16); }
.mention-menu[hidden] { display: none; }
.mention-menu button { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; min-width: 0; }
.mention-menu button b { white-space: nowrap; }
.mention-menu button span:last-child { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-menu button.on, .mention-menu button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }

.emoji-picker { position: fixed; z-index: 60; display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); }
.emoji-picker button { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; font-size: 20px; line-height: 1; cursor: pointer; }
.emoji-picker button:hover, .emoji-picker button:focus-visible { background: color-mix(in srgb, var(--text) 8%, transparent); outline: none; }

.pick-list { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.pick-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.pick-row[hidden] { display: none; }
.pick-row input { width: 18px; height: 18px; accent-color: var(--inverse); flex: none; }
/* The agent picker: grouped by room, your assistant first. */
.pick-group[hidden] { display: none; }
.pick-group-title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 10px 10px 4px; }
.pick-group:first-child .pick-group-title { margin-top: 2px; }
.pick-who { min-width: 0; display: grid; }
.pick-who .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A change to the conversation ("Luis added Miguel"): a quiet line, not a message. */
.msg-event { display: flex; justify-content: center; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 6px 24px; font-size: 13px; color: var(--muted); text-align: center; }
.msg-event b { color: var(--text); font-weight: 600; }
.msg-event time { font-size: 11px; color: var(--muted-2); }

.chat-title-btn { display: block; border: 0; background: none; padding: 4px 8px; margin: -4px -8px; border-radius: 12px; color: inherit; text-align: left; cursor: pointer; min-width: 0; }
.chat-title-btn:hover { background: var(--hover); }
.chat-title-btn h2 { display: flex; align-items: center; gap: 4px; }
.title-chev { display: inline-grid; color: var(--muted); transform: rotate(90deg); flex: none; }

.chat-settings { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; display: none; flex-direction: column; }
.chat-settings[open] { display: flex; }
.cs-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 12px; border-bottom: 1px solid var(--line); }
.cs-title { flex: 1; min-width: 0; }
.cs-title h2 { margin: 0; overflow-wrap: anywhere; }
.cs-body { overflow-y: auto; padding: 16px 20px 22px; display: grid; gap: 18px; }
.cs-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.cs-name-row .field { min-height: 44px; padding: 10px 14px; border-radius: 14px; }
.cs-about { margin: 0; color: var(--muted); }
.cs-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; min-height: 34px; }
.cs-section-title .btn { letter-spacing: 0; text-transform: none; }
.cs-people { display: grid; gap: 2px; }
.cs-person { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 12px; }
.cs-who { flex: 1; min-width: 0; display: grid; }
.cs-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The toast is a popover (so it shows above open dialogs): undo the browser's popover box. */
#toast[popover] { inset: auto auto 28px 50%; margin: 0; border: 0; overflow: visible; height: auto; width: max-content; }
@media (max-width: 860px) { #toast[popover] { bottom: 96px; } }
.cs-person .team-face .online-dot { width: 10px; height: 10px; }
.cs-note { margin-top: 8px; }
.cs-foot { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 860px) {
  .chat-settings { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .cs-head { padding-top: max(16px, env(safe-area-inset-top)); }
}

@media (max-width: 1279px) and (min-width: 861px) {
  .chat-app { grid-template-columns: 250px minmax(0, 1fr); }
}

/* Phones: the list, then a conversation. */
@media (max-width: 860px) {
  .chat-app { grid-template-columns: minmax(0, 1fr); }
  .chat-app[data-view="list"] { height: auto; min-height: 100dvh; }
  .chat-app[data-view="list"] .chat-side { border: 0; overflow: visible; padding: 18px 8px 120px; }
  .chat-app[data-view="list"] .chat-pane, .chat-app[data-view="channel"] .chat-side { display: none; }
  body.chat-focus .tabbar { display: none; }
  .chat-back { display: grid; }
  .chat-head { padding: max(10px, env(safe-area-inset-top)) 12px 10px; min-height: 60px; gap: 10px; }
  .chat-people { padding: 0 10px 0 4px; }
  .msg, .msg-typing { grid-template-columns: 32px minmax(0, 1fr); gap: 0 10px; padding: 6px 12px; }
  .msg-gutter .avatar { --size: 32px; }
  .msg-actions { right: 12px; }
  .msg-day, .msg-new { margin-left: 12px; margin-right: 12px; }
  .chat-title-agent .avatar { --size: 32px; }
  .reply-bar .icon-btn.mini { width: 36px; height: 36px; }
  .agent-start .avatar { --size: 40px; }
  .chat-start { padding: 22px 14px 10px; }
  .chat-compose { padding: 0 10px max(10px, env(safe-area-inset-bottom)); }
  .chat-compose .send-btn { width: 44px; padding: 0; }
  .chat-compose .send-btn span { display: none; }
  .mention-menu { left: 10px; width: calc(100% - 20px); }
}

/* ─── Team: people, agents and the org chart ─────────────────────── */

.team-tabs { margin-bottom: 18px; width: max-content; }
.segmented .count.muted-count { background: var(--surface-2); color: var(--muted); }
.segmented a.on .count.muted-count { background: color-mix(in srgb, var(--on-inverse) 20%, transparent); color: var(--on-inverse); }
.team-note { margin: 0 4px 14px; max-width: 640px; }
.team-face { position: relative; display: inline-flex; flex: none; }
.team-face .online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; opacity: 1; border: 2px solid var(--surface); box-shadow: none; }

.team-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.team-person { padding: 18px; display: grid; gap: 14px; align-content: start; }
.team-person .team-face .avatar { --size: 48px; }
.tp-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.tp-who { flex: 1; min-width: 0; }
.tp-who .name-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-who .name-line b { font-size: 16px; letter-spacing: -0.02em; }
.tp-title { color: var(--muted); font-size: 14px; }
.tp-title-input { width: 100%; margin: 2px 0 0 -7px; padding: 2px 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); font-size: 14px; outline: none; }
.tp-title-input:hover { border-color: var(--line); }
.tp-title-input:focus { border-color: var(--brand-blue); background: var(--surface); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.tp-facts { margin: 0; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 14px; }
.tp-facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.tp-facts dt { color: var(--muted); font-size: 13px; }
.tp-facts dd { margin: 0; overflow-wrap: anywhere; }

.org-tree { --org-line: color-mix(in srgb, var(--text) 22%, transparent); }
.org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-node { position: relative; width: 208px; padding: 10px; display: grid; gap: 8px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.org-node.open { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.org-card { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px; border: 0; border-radius: 14px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.org-card:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, transparent); }
.org-card:disabled { cursor: default; }
.org-who { flex: 1; min-width: 0; display: grid; }
.org-who b, .org-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-who span { font-size: 13px; color: var(--muted); }
.org-toggle { color: var(--muted); display: grid; transition: transform 0.15s; }
.org-node.open .org-toggle { transform: rotate(90deg); }
.org-group-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--cloud); flex: none; }
.org-depts { display: grid; gap: 4px; }
.org-dept { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.org-dept-name { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-dept-name svg { flex: none; color: var(--muted); }
.org-faces { display: flex; align-items: center; flex: none; }
.org-faces .avatar { --size: 22px; margin-left: -6px; border: 2px solid var(--surface-2); font-size: 9px; }
.org-faces > span:first-child .avatar { margin-left: 0; }
.org-more { margin-left: 4px; font-size: 11px; font-weight: 700; color: var(--muted); }
.org-sum { padding: 0 6px; }
.org-details { display: grid; gap: 10px; padding: 10px 4px 2px; border-top: 1px solid var(--line); }
.org-detail-title { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.org-detail-title a { color: inherit; }
.org-agent { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; min-width: 0; }
.org-agent > span:last-child { min-width: 0; }
.org-agent .muted { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-agent .tag-head { font-size: 9px; padding: 1px 6px; vertical-align: 1px; }

/* A top-down chart joined by lines, scrolling sideways inside itself when it's wider than the page
   (on phones too: people stay in rows by who they report to). */
@media all {
  /* The chart uses the page's side margins too, so a wide company still fits on a laptop. */
  .org-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding: 4px 36px 24px; margin: 0 -36px; }
  .org-tree { width: max-content; min-width: 100%; }
  .org-tree ul { display: flex; justify-content: center; position: relative; padding-top: 26px; }
  .org-tree > ul { padding-top: 0; }
  .org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 5px 0; }
  .org-tree > ul > li { padding-top: 0; }
  .org-tree li::before, .org-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 1.5px solid var(--org-line); }
  .org-tree li::after { right: auto; left: 50%; border-left: 1.5px solid var(--org-line); }
  .org-tree li:only-child::before, .org-tree li:only-child::after, .org-tree > ul > li::before, .org-tree > ul > li::after { display: none; }
  .org-tree li:only-child { padding-top: 0; }
  .org-tree li:first-child::before, .org-tree li:last-child::after { border: 0; }
  .org-tree li:last-child::before { border-right: 1.5px solid var(--org-line); border-radius: 0 12px 0 0; }
  .org-tree li:first-child::after { border-radius: 12px 0 0 0; }
  .org-tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 1.5px solid var(--org-line); }
}

/* Phones: the same hierarchy as an indented list. */
@media (max-width: 860px) {
  .team-tabs { width: auto; }
  .team-people { grid-template-columns: minmax(0, 1fr); }
  .org-scroll { padding: 4px 16px 20px; margin: 0 -16px; }
  .org-node { width: 168px; }
}

/* ─── Docs (an Outline-style wiki) ───────────────────────────────── */

.code-docs[hidden] { display: none; }
.docs-app { --hover: color-mix(in srgb, var(--text) 6%, transparent); --picked: color-mix(in srgb, var(--text) 9%, transparent); display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100dvh; }
.docs-side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 22px 10px 40px; background: var(--ground); border-right: 1px solid var(--line); }
.docs-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 12px; }
.docs-side-head b { font-size: 24px; letter-spacing: -0.03em; }
.docs-close { display: none; }
.docs-nav { display: grid; gap: 1px; }
.tree-link { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 14px; min-width: 0; }
.tree-link:hover { background: var(--hover); text-decoration: none; }
.tree-link.active { background: var(--picked); font-weight: 600; }
.tree-link .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.starred-link { padding-left: 22px; min-height: 32px; font-weight: 400; }
.docs-section-title { display: flex; align-items: center; justify-content: space-between; min-height: 28px; margin: 22px 10px 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.docs-section-title .icon-btn.mini { background: none; color: var(--muted); }
.docs-section-title .icon-btn.mini:hover { background: var(--hover); color: var(--text); }
.tree { display: grid; gap: 1px; }
.tree-row { position: relative; display: flex; align-items: center; gap: 2px; min-height: 34px; padding: 0 4px 0 calc(4px + var(--depth, 0) * 16px); border-radius: 10px; }
.tree-row:hover { background: var(--hover); }
.tree-row.active { background: var(--picked); }
.tree-row.active .tree-label { font-weight: 600; }
.tw { width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.tw svg { transition: transform 0.15s; }
.tw.open svg { transform: rotate(90deg); }
.tw.leaf { visibility: hidden; }
.tw:hover { background: var(--hover); color: var(--text); }
.tree-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 2px; color: var(--text); font-size: 14px; }
.tree-label:hover { text-decoration: none; }
.tree-label .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-node .tree-label { font-weight: 600; }
.tree-icon { width: 20px; flex: none; display: grid; place-items: center; font-size: 15px; color: var(--muted); }
.coll-icon { width: 22px; height: 22px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 13px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.coll-icon.big { width: 56px; height: 56px; border-radius: 16px; font-size: 30px; }
.tree-actions { display: none; gap: 2px; flex: none; }
.tree-row:hover .tree-actions, .tree-row:focus-within .tree-actions { display: flex; }
@media (hover: none) { .tree-actions { display: flex; } }
.tree-actions button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.tree-actions button:hover { background: var(--hover); color: var(--text); }
.tree-empty { padding: 4px 10px 4px calc(32px + var(--depth, 0) * 16px); font-size: 13px; color: var(--muted); }
.tree-row.dragging { opacity: 0.4; }
.tree-row.drop-inside { background: color-mix(in srgb, var(--brand-blue) 14%, transparent); box-shadow: inset 0 0 0 1.5px var(--brand-blue); }
.tree-row.drop-before::before, .tree-row.drop-after::after { content: ""; position: absolute; left: calc(8px + var(--depth, 0) * 16px); right: 8px; height: 2px; border-radius: 2px; background: var(--brand-blue); }
.tree-row.drop-before::before { top: -1px; }
.tree-row.drop-after::after { bottom: -1px; }

.docs-main { min-width: 0; background: var(--surface); }
.docs-page { max-width: 860px; margin: 0 auto; padding: 34px 36px 120px; }
.docs-phone-bar { display: none; }
.doc-list-row { align-items: center; }
.doc-list-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 18px; color: var(--muted); }
.docs-page .segmented { margin-bottom: 16px; width: max-content; max-width: 100%; }
.docs-search { position: relative; margin-bottom: 18px; }
.docs-search .field { min-height: 52px; padding-left: 48px; border-radius: 999px; }
.docs-search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: grid; }
.search-snippet { margin-top: 4px; font-size: 13px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-snippet mark { padding: 0 2px; border-radius: 3px; color: var(--text); background: color-mix(in srgb, #F2B200 35%, transparent); }
.coll-hero { display: grid; gap: 14px; }
.coll-hero .page-head { margin-bottom: 0; }
.coll-desc { margin-top: 14px; max-width: 680px; }
.coll-vis { display: flex; align-items: center; gap: 6px; margin-top: 10px; }

.doc-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 24px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); }
.docs-menu-btn { display: none; flex: none; }
.doc-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; font-size: 14px; color: var(--muted); }
.doc-crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.doc-crumbs a:hover { color: var(--text); text-decoration: none; }
.doc-crumbs .sep { color: var(--muted-2); flex: none; }
.crumb-icon { flex: none; }
.doc-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.doc-tools .icon-btn { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 16px; }
.doc-tools .icon-btn:hover { background: var(--hover); color: var(--text); }
.doc-tools .icon-btn.starred { color: #E8A400; }
.doc-status { margin-right: 6px; font-size: 13px; color: var(--muted-2); white-space: nowrap; }
.doc-status.held, .doc-status.error { color: var(--owed); font-weight: 600; }
.doc-retry { border: 0; padding: 0; background: none; color: var(--action-blue); font: inherit; cursor: pointer; text-decoration: underline; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; gap: 56px; padding: 26px 36px 160px; }
.doc-layout.with-toc { grid-template-columns: minmax(0, 760px) 200px; }
.doc-toc { position: sticky; top: 84px; align-self: start; display: grid; gap: 1px; max-height: calc(100dvh - 120px); overflow-y: auto; }
.doc-toc[hidden], .doc-toc-inline[hidden], .doc-revision[hidden], .doc-current[hidden], .doc-history[hidden] { display: none; }
.toc-title { margin: 0 8px 6px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc-link { border: 0; background: none; text-align: left; padding: 4px 8px; border-radius: 8px; font-size: 13px; line-height: 1.35; color: var(--muted); cursor: pointer; }
.toc-link.l2 { padding-left: 18px; }
.toc-link.l3 { padding-left: 28px; }
.toc-link:hover { background: var(--hover); color: var(--text); }
.doc-toc-inline { margin: 0 0 20px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; }
.doc-toc-inline summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.doc-toc-inline .toc-list { display: grid; margin-top: 6px; }
.doc-emoji { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px -8px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; font-size: 44px; line-height: 1; cursor: pointer; }
.doc-emoji:hover { background: var(--hover); }
.doc-emoji.empty { font-size: 13px; color: var(--muted); opacity: 0; transition: opacity 0.15s; }
.doc-article:hover .doc-emoji.empty, .doc-emoji.empty:focus-visible { opacity: 1; }
@media (hover: none) { .doc-emoji.empty { opacity: 1; } }
.doc-title { display: block; width: 100%; margin: 0; padding: 0; border: 0; outline: none; background: none; resize: none; overflow: hidden; font: inherit; font-size: clamp(32px, 4vw, 44px); font-weight: 700; line-height: 1.12; letter-spacing: -0.035em; color: var(--text); }
.doc-title::placeholder { color: var(--muted-2); }
.doc-title.static { margin-bottom: 8px; }
.doc-meta { margin: 10px 0 24px; font-size: 13px; color: var(--muted); }
.doc-banner { flex-wrap: wrap; margin-bottom: 20px; }
.doc-banner > div:nth-child(2) { flex: 1; min-width: 220px; }
.doc-children { display: grid; gap: 10px; justify-items: start; margin-top: 56px; }
.doc-children .list { width: 100%; }
.doc-children .group-title { margin: 0 4px; }

/* Text in the editor, in old versions and in the Markdown preview. */
.doc-prose { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; outline: none; min-height: 260px; }
.doc-prose > :first-child { margin-top: 0; }
.doc-prose p { margin: 0 0 0.8em; }
.doc-prose h1, .doc-prose h2, .doc-prose h3 { line-height: 1.25; letter-spacing: -0.025em; margin: 1.5em 0 0.45em; }
.doc-prose h1 { font-size: 28px; }
.doc-prose h2 { font-size: 22px; }
.doc-prose h3 { font-size: 18px; }
.doc-prose ul, .doc-prose ol { margin: 0 0 0.8em; padding-left: 1.4em; }
.doc-prose li > p { margin: 0 0 0.2em; }
.doc-prose ul[data-type="taskList"] { list-style: none; padding-left: 0.1em; }
.doc-prose ul[data-type="taskList"] > li { display: flex; gap: 8px; align-items: flex-start; }
.doc-prose ul[data-type="taskList"] > li > label { flex: none; margin-top: 4px; }
.doc-prose ul[data-type="taskList"] > li > div { flex: 1; min-width: 0; }
.doc-prose ul[data-type="taskList"] input { width: 16px; height: 16px; accent-color: var(--inverse); }
.doc-prose li[data-checked="true"] > div { color: var(--muted); text-decoration: line-through; }
.doc-prose blockquote { margin: 0 0 0.8em; padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); }
.doc-prose code { padding: 1px 5px; border-radius: 6px; background: var(--surface-2); font-size: 0.9em; }
.doc-prose pre { margin: 0 0 0.9em; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); overflow-x: auto; font-size: 14px; line-height: 1.5; }
.doc-prose pre code { padding: 0; background: none; }
.doc-prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.doc-prose table { width: 100%; margin: 0 0 1em; border-collapse: collapse; table-layout: fixed; }
.doc-prose th, .doc-prose td { position: relative; padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-prose th { background: var(--surface-2); font-weight: 600; }
.doc-prose th p, .doc-prose td p { margin: 0; }
.doc-prose .tableWrapper { overflow-x: auto; }
.doc-prose .selectedCell::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--brand-blue) 12%, transparent); pointer-events: none; }
.doc-prose img { max-width: 100%; height: auto; border-radius: 10px; }
.doc-prose img.ProseMirror-selectednode { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.doc-prose a { color: var(--action-blue); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--action-blue) 40%, transparent); }
.doc-prose p.is-editor-empty:first-child::before, .ProseMirror-focused .is-empty::before { content: attr(data-placeholder); float: left; height: 0; pointer-events: none; color: var(--muted-2); }

.format-bar { position: fixed; z-index: 60; display: flex; align-items: stretch; gap: 2px; padding: 4px; border-radius: 12px; background: var(--inverse); color: var(--on-inverse); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22); }
.format-bar[hidden] { display: none; }
.format-bar button { min-width: 32px; height: 32px; padding: 0 6px; border: 0; border-radius: 8px; background: none; color: inherit; font-size: 14px; cursor: pointer; display: inline-grid; place-items: center; }
.format-bar button:hover, .format-bar button.on { background: color-mix(in srgb, var(--on-inverse) 18%, transparent); }
.format-bar button.text { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; font-size: 13px; font-weight: 600; }
.format-bar button.danger { color: #FF8A80; }
.format-bar .sep { width: 1px; margin: 6px 3px; background: color-mix(in srgb, var(--on-inverse) 25%, transparent); }
.slash-menu { position: fixed; z-index: 60; width: 290px; max-height: 340px; overflow-y: auto; display: grid; gap: 2px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); }
.slash-menu[hidden] { display: none; }
.slash-menu button { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.slash-menu button.on, .slash-menu button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.slash-menu .glyph { width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.slash-menu b { display: block; font-size: 14px; font-weight: 600; }
.slash-menu b + span { display: block; font-size: 12px; color: var(--muted); }
.md-note { margin-bottom: 10px; }
.md-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.md-source { min-height: 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; resize: none; }
.md-preview { padding: 6px 4px; }
.md-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.md-source-mode .md-source { min-height: 360px; }

/* Wiki extras: highlighted code (GitHub's colors), diagrams, callouts, footnotes, links, tables. */
:root { --hl-keyword: #CF222E; --hl-title: #8250DF; --hl-attr: #0550AE; --hl-string: #0A3069; --hl-built: #953800; --hl-comment: #6E7781; --hl-name: #116329; --hl-bullet: #953800; --hl-add: #116329; --hl-add-bg: #DAFBE1; --hl-del: #82071E; --hl-del-bg: #FFEBE9; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-keyword: #FF7B72; --hl-title: #D2A8FF; --hl-attr: #79C0FF; --hl-string: #A5D6FF; --hl-built: #FFA657; --hl-comment: #8B949E; --hl-name: #7EE787; --hl-bullet: #F2CC60; --hl-add: #AFF5B4; --hl-add-bg: rgba(46, 160, 67, 0.18); --hl-del: #FFDCD7; --hl-del-bg: rgba(248, 81, 73, 0.18); } }
:root[data-theme="dark"] { --hl-keyword: #FF7B72; --hl-title: #D2A8FF; --hl-attr: #79C0FF; --hl-string: #A5D6FF; --hl-built: #FFA657; --hl-comment: #8B949E; --hl-name: #7EE787; --hl-bullet: #F2CC60; --hl-add: #AFF5B4; --hl-add-bg: rgba(46, 160, 67, 0.18); --hl-del: #FFDCD7; --hl-del-bg: rgba(248, 81, 73, 0.18); }
.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-variable.language_ { color: var(--hl-keyword); }
.hljs-title, .hljs-title.class_, .hljs-title.function_ { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, .hljs-operator, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-variable { color: var(--hl-attr); }
.hljs-string, .hljs-regexp, .hljs-meta .hljs-string { color: var(--hl-string); }
.hljs-built_in, .hljs-symbol { color: var(--hl-built); }
.hljs-comment, .hljs-code, .hljs-formula { color: var(--hl-comment); font-style: italic; }
.hljs-name, .hljs-quote, .hljs-selector-tag, .hljs-selector-pseudo { color: var(--hl-name); }
.hljs-section { color: var(--hl-attr); font-weight: 700; }
.hljs-bullet { color: var(--hl-bullet); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-addition { color: var(--hl-add); background: var(--hl-add-bg); }
.hljs-deletion { color: var(--hl-del); background: var(--hl-del-bg); }

.doc-prose .code-block { position: relative; margin: 0 0 0.9em; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.doc-prose .code-block pre { margin: 0; padding: 4px 16px 14px; border-radius: 0 0 12px 12px; background: none; }
.cb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px 0; font-size: 12px; line-height: 1; user-select: none; -webkit-user-select: none; }
.cb-gap { flex: 1; }
/* Phones: the header's buttons keep their icons and lose their words, so it fits. */
@media (max-width: 560px) { .cb-text { display: none; } .cb-head button { padding: 0 7px; } }
.cb-head button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cb-head button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.cb-btn { opacity: 0; transition: opacity 0.12s; }
.code-block:hover .cb-btn, .code-block.is-editing .cb-btn, .code-block.is-mermaid .cb-btn, .cb-head :focus-visible { opacity: 1; }
@media (hover: none) { .cb-btn { opacity: 1; } }
.cb-toggle { display: inline-flex; padding: 2px; border-radius: 9px; background: color-mix(in srgb, var(--text) 6%, transparent); }
.cb-toggle button { height: 22px; }
.cb-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11, 11, 15, 0.14); }
.code-block.is-editing .cb-toggle, .code-block.is-editing [data-cb="edit"] { display: none; }
.code-block.is-mermaid:not(.is-editing):not(.show-code):not(.has-error) pre { display: none; }
.code-block.is-mermaid.show-code:not(.is-editing) .cb-diagram { display: none; }
.code-block.is-mermaid.is-editing { box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-blue) 35%, transparent); }
.cb-diagram { display: grid; justify-items: center; overflow-x: auto; padding: 10px 16px 16px; cursor: pointer; }
.code-block.is-editing .cb-diagram { cursor: default; border-top: 1px dashed var(--line); }
.cb-diagram svg, .mermaid-view svg { max-width: 100%; height: auto; }
.mermaid-empty { padding: 14px; font-size: 13px; color: var(--muted); }
.mermaid-error { width: 100%; display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--owed) 9%, transparent); color: var(--owed); font-size: 13px; text-align: left; }
.mermaid-error pre { margin: 0; padding: 0; border-radius: 0; background: none; color: inherit; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.mermaid-view { display: grid; justify-items: center; overflow-x: auto; margin: 0 0 0.9em; padding: 14px; border-radius: 12px; background: var(--surface-2); }
.mermaid-view.loading { min-height: 120px; }
.mermaid-source[hidden] { display: none; }
.lang-pop { position: fixed; z-index: 70; width: 230px; display: grid; gap: 6px; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); }
.lang-pop .field { min-height: 36px; height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.lang-list { max-height: 260px; overflow-y: auto; display: grid; gap: 1px; }
.lang-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.lang-list button.on, .lang-list button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.lang-list b { color: var(--brand-blue); }

.doc-prose blockquote.callout, .markdown blockquote.callout { margin: 0 0 0.9em; padding: 12px 16px; border: 0; border-radius: 12px; color: var(--text); background: color-mix(in srgb, var(--c) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); }
.callout > :last-child { margin-bottom: 0; }
.callout-info { --c: var(--brand-blue); }
.callout-warning { --c: #E8A400; }
.callout-success { --c: var(--received); }
.footnote-ref { font-size: 0.72em; font-weight: 600; color: var(--action-blue); }
.footnote-def { margin: 0 0 0.4em; font-size: 14px; color: var(--muted); }
.footnote-def::before { content: "[" attr(data-footnote) "] "; font-weight: 600; color: var(--text); }
.details-block, .markdown details { margin: 0 0 0.9em; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; }
.details-block > :last-child { margin-bottom: 0; }
.details-summary, .markdown summary { font-weight: 600; }
.details-summary::before { content: "▸ "; color: var(--muted); }
.markdown summary { cursor: pointer; }
.doc-prose mark, .markdown mark { padding: 0 2px; border-radius: 3px; color: inherit; background: color-mix(in srgb, #F2B200 38%, transparent); }
.doc-prose a[href^="#/doc/"], .markdown a[href^="#/doc/"] { padding: 0 3px; border-radius: 5px; text-decoration: none; background: color-mix(in srgb, var(--action-blue) 9%, transparent); }
.doc-prose .tableWrapper { margin: 0 0 1em; }
.doc-prose .tableWrapper table { margin: 0; }
.doc-prose.markdown table { display: block; overflow-x: auto; table-layout: auto; }
.doc-prose.markdown th, .doc-prose.markdown td { min-width: 100px; }

.format-bar { max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
.format-bar::-webkit-scrollbar { display: none; }
.format-bar button, .format-bar .sep { flex: none; }
.slash-menu .menu-title { padding: 4px 8px 2px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.slash-menu .menu-empty { padding: 6px 8px 8px; font-size: 13px; color: var(--muted); }
.slash-menu .glyph svg { color: var(--muted); }
.slash-menu.grid-mode { width: auto; }
.table-grid { display: grid; grid-template-columns: repeat(var(--cols), 18px); gap: 3px; padding: 4px 8px; }
.table-grid span { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.table-grid span.head { border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.table-grid span.on { border-color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 22%, var(--surface)); }
.table-grid-size { padding: 2px 8px 4px; font-size: 12px; color: var(--muted); }
.link-pop { position: fixed; z-index: 65; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); }
.link-pop[hidden] { display: none; }
.link-pop.view { display: flex; align-items: center; gap: 4px; max-width: min(440px, calc(100vw - 16px)); padding: 4px 4px 4px 12px; }
.lp-url { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--action-blue); }
.lp-tools { display: flex; flex: none; gap: 2px; }
.lp-tools button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer; }
.lp-tools button:hover, .lp-pages button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.link-pop.edit { width: min(340px, calc(100vw - 16px)); padding: 10px; }
.lp-form { display: grid; gap: 8px; }
.lp-form .field { height: 38px; min-height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; }
.lp-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lp-pages { display: grid; gap: 1px; margin-top: -4px; }
.lp-pages[hidden] { display: none; }
.lp-pages button { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.choice-list { display: grid; }

.doc-history { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: 340px; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(11, 11, 15, 0.1); }
.doc-history header { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 10px; }
.doc-history h2 { margin: 0; }
.hist-list { overflow-y: auto; padding: 4px 8px 24px; display: grid; gap: 2px; align-content: start; }
.hist-row { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.hist-row span { font-size: 12.5px; color: var(--muted); }
.hist-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.hist-row.on { background: color-mix(in srgb, var(--text) 9%, transparent); }
.hist-note { padding: 6px 16px; margin: 0; }
.revision-body { margin-top: 14px; }
/* Wide screens make room for the history panel instead of covering the page. */
@media (min-width: 1100px) {
  .docs-app.history-open .docs-main { margin-right: 340px; }
  .docs-app.history-open .doc-layout.with-toc { grid-template-columns: minmax(0, 760px); }
  .docs-app.history-open .doc-toc { display: none !important; }
}

.pop-menu { position: fixed; z-index: 60; min-width: 210px; display: grid; gap: 2px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.16); }
.pop-menu button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; }
.pop-menu button:hover, .pop-menu button:focus-visible { background: color-mix(in srgb, var(--text) 7%, transparent); outline: none; }
.pop-menu button.danger { color: var(--owed); }
.emoji-picker.wide .remove { grid-column: 1 / -1; width: auto; height: 32px; font-size: 13px; color: var(--muted); }

.coll-form-top { display: flex; gap: 12px; align-items: flex-end; }
.coll-icon-input { width: 76px; text-align: center; font-size: 22px; }
.icon-picks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -6px; }
.icon-picks button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 18px; cursor: pointer; }
.icon-picks button:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--brand-blue); outline-offset: 4px; }
.coll-people[hidden] { display: none; }

@media (max-width: 1199px) {
  .doc-layout.with-toc { grid-template-columns: minmax(0, 760px); }
  .doc-toc { display: none !important; }
}
@media (min-width: 1200px) { .doc-toc-inline { display: none !important; } }
@media (max-width: 860px) {
  .docs-app { grid-template-columns: minmax(0, 1fr); }
  .docs-side { display: none; }
  .docs-app.nav-open .docs-side { display: block; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 10px 120px; }
  .docs-close { display: grid; }
  .docs-phone-bar { display: block; padding: 14px 16px 0; }
  .docs-menu-btn { display: grid; }
  .docs-page { padding: 14px 16px 120px; }
  .doc-top { padding: 8px 12px; gap: 6px; }
  .doc-tools { gap: 0; }
  .doc-tools .icon-btn { width: 34px; height: 34px; }
  .doc-layout { padding: 16px 16px 160px; }
  .doc-history { width: 100%; }
  .md-panes { grid-template-columns: minmax(0, 1fr); }
  .coll-form-top { flex-wrap: wrap; }
}

/* Room: add someone, and who's here */
.add-choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; font: inherit; }
.add-choice:hover { border-color: var(--brand-blue); }
.add-choice > span { display: grid; gap: 2px; }
.room-people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.room-person { display: inline-flex; align-items: center; gap: 6px; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 2px; }

/* ─── AI services: Settings card, agent form, Design with AI, answers ── */
.ai-list { display: grid; }
.ai-service { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.ai-service:first-child { border-top: 0; padding-top: 4px; }
.ai-service-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-service-head .pill { margin-left: auto; }
.ai-service code { font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.ai-spend { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.ai-error { color: var(--owed); overflow-wrap: anywhere; }
.ai-budget .label { margin-bottom: 4px; }
.ai-budget-row { display: flex; gap: 8px; align-items: center; }
.ai-budget-row .field { max-width: 160px; height: 40px; }
.ai-note b { font-weight: 600; color: var(--text); }
.abilities .check.off { color: var(--muted-2); cursor: default; }
.hire-toggle .check { padding-bottom: 2px; }
.hire-toggle .check.off { color: var(--muted-2); cursor: default; }
.abilities-note { margin-top: 2px; }
.abilities-note[hidden], .design-reason[hidden] { display: none; }
.hire-grid { align-items: start; }
.hire-grid .design-ai { position: sticky; top: 24px; }
.design-title { display: flex; align-items: center; gap: 8px; }
.design-title svg { color: var(--brand-blue); }
.design-status { display: inline-flex; align-items: center; gap: 8px; }
.design-status .typing { color: var(--brand-blue); }
.design-reason { display: grid; gap: 4px; padding: 14px 16px; border-radius: 18px; background: color-mix(in srgb, var(--brand-blue) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand-blue) 25%, transparent); }
.design-reason b { display: flex; align-items: center; gap: 6px; color: var(--brand-blue); font-size: 13px; }
@media (max-width: 860px) {
  .hire-grid .design-ai { order: -1; position: static; }
}

/* Images that agents make, and the sources other services cite. */
.markdown img, .msg-text img { display: block; width: auto; height: auto; max-width: min(100%, 520px); max-height: 480px; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0; background: var(--surface-2); }
.msg-text img { max-width: min(100%, 360px); max-height: 280px; }
a.md-image { display: inline-block; max-width: 100%; }
/* Videos and voice-overs that agents make, played in place. */
.md-media { display: grid; justify-items: start; gap: 6px; margin: 8px 0; }
.md-media video { display: block; width: auto; height: auto; max-width: min(100%, 520px); max-height: 480px; border-radius: 14px; border: 1px solid var(--line); background: #000; }
.md-media audio { display: block; width: min(100%, 420px); height: 40px; }
.md-media figcaption { font-size: 12px; }
.md-media .md-download { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.md-media .md-download:hover { color: var(--brand-blue); }
.msg-text .md-media video { max-width: min(100%, 360px); max-height: 280px; }
.msg-text .md-media audio { width: min(100%, 320px); }
.sources { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.sources-title { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sources ol { margin: 0; padding-left: 24px; display: grid; gap: 4px; }
.sources li { overflow-wrap: anywhere; }
.sources li::marker { color: var(--muted); }
.sources li span { color: var(--muted-2); }
sup.cite { line-height: 0; }
sup.cite a { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 1px; border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; background: var(--surface-2); color: var(--muted); text-decoration: none; }
sup.cite a:hover { background: var(--cloud); color: var(--brand-blue); }
.svc-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 2px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.ai-fields .span-2 { grid-column: 1 / -1; }

/* ─── Drive (Google Drive, laid out like drive.google.com) ──────────── */
.drive-app { --hover: color-mix(in srgb, var(--text) 6%, transparent); --picked: color-mix(in srgb, var(--brand-blue) 13%, transparent); display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.drive-side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; padding: 22px 10px 40px; background: var(--ground); border-right: 1px solid var(--line); }
.drive-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 14px; }
.drive-side-head b { font-size: 24px; letter-spacing: -0.03em; }
.drive-close { display: none; }
.drive-new { margin: 0 4px 16px; box-shadow: var(--shadow); }
.drive-nav { display: grid; gap: 1px; }
.drive-link { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 36px 0 12px; border-radius: 999px; color: var(--text); font-weight: 500; font-size: 14px; min-width: 0; }
.drive-link:hover { background: var(--hover); text-decoration: none; }
.drive-link.active { background: var(--picked); color: var(--brand-blue); font-weight: 600; }
.drive-link svg { flex: none; }
.drive-link .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-link-row { position: relative; }
.drive-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); z-index: 1; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.drive-toggle:hover { background: var(--hover); color: var(--text); }
.drive-toggle svg { transition: transform 0.15s ease; }
.drive-toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.drive-drives .drive-link { padding-left: 42px; min-height: 34px; font-weight: 400; }
.drive-drives .drive-link.active { font-weight: 600; }
.drive-sub { padding: 6px 12px 6px 42px; overflow-wrap: anywhere; }

.drive-main { position: relative; min-width: 0; padding: 22px 32px 120px; }
.drive-phone-bar { display: none; }
.drive-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.drive-search { position: relative; flex: 1; max-width: 720px; }
.drive-search input { width: 100%; height: 46px; padding: 0 18px 0 46px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.drive-search input:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.drive-search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.drive-tools { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.drive-layout { display: flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.drive-layout button { width: 38px; height: 32px; border: 0; border-radius: 999px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.drive-layout button.on { background: var(--inverse); color: var(--on-inverse); }
.drive-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-height: 44px; margin: 8px 0 14px; }
.drive-crumbs > a, .drive-crumbs > span:not(.sep), .drive-here { padding: 2px 8px; border-radius: 10px; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.drive-crumbs > a, .drive-crumbs > span:not(.sep) { color: var(--muted); }
.drive-crumbs > a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.drive-crumbs .sep { display: flex; color: var(--muted-2); }
.drive-here { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.drive-table { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.drive-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 150px 200px 90px 44px; align-items: center; gap: 12px; min-height: 52px; padding: 0 6px 0 16px; border-top: 1px solid var(--line); font-size: 14px; }
.drive-row:first-child { border-top: 0; }
.drive-head { min-height: 42px; font-size: 12px; font-weight: 700; color: var(--muted); }
@media (hover: hover) { .drive-row:not(.drive-head):not(.skeleton):hover, .drive-tile:hover, .drive-card:hover { background: var(--hover); } }
.drive-name { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 500; }
.drive-label { display: grid; min-width: 0; }
.drive-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.drive-meta { display: none; font-size: 12px; font-weight: 400; color: var(--muted); }
.drive-open { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
/* The name's link covers its whole row or card; the ⋯ button sits above it. */
.drive-open::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.drive-open:hover { text-decoration: none; }
.drive-open:focus-visible { outline: none; }
.drive-open:focus-visible::after { box-shadow: inset 0 0 0 2px var(--brand-blue); }
.drive-more-btn { position: relative; z-index: 1; width: 34px; height: 34px; background: none; color: var(--muted); }
.drive-more-btn:hover { background: var(--hover); color: var(--text); }
.drive-owner, .drive-date, .drive-size { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.drive-date .muted { color: var(--muted-2); }
.drive-star { display: flex; flex: none; color: #F4B400; }
.drive-shared { display: flex; flex: none; color: var(--muted-2); }
.ftype { display: inline-flex; flex: none; width: var(--size, 20px); height: var(--size, 20px); }
.ftype.folder { color: var(--muted); }
.drive-row.skeleton .sk { display: block; width: 70%; height: 10px; border-radius: 6px; background: var(--surface-2); animation: breathe 1.4s ease-in-out infinite; }
.drive-row.skeleton .sk-icon { flex: none; width: 20px; height: 20px; }
.drive-row.skeleton .sk-text { width: 40%; }

.drive-group-title { margin: 4px 4px 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.drive-tiles, .drive-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 22px; }
.drive-tile { position: relative; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 6px 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; }
.drive-tile .drive-open, .drive-card-foot .drive-open { flex: 1; }
.drive-card { position: relative; display: grid; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.drive-card-art { height: 128px; display: grid; place-items: center; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.drive-card-foot { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 4px 0 12px; font-size: 14px; font-weight: 500; }
.drive-card-meta { padding: 0 12px 10px 40px; font-size: 12px; color: var(--muted); }

.drive-state { display: grid; justify-items: center; gap: 10px; padding: 70px 20px; text-align: center; }
.drive-state h2 { margin: 0; font-size: 20px; }
.drive-state p { margin: 0; max-width: 440px; }
.drive-state-icon { width: 64px; height: 64px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.drive-more { min-height: 20px; padding: 16px; text-align: center; }

.drive-drop { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-blue) 12%, transparent); box-shadow: inset 0 0 0 3px var(--brand-blue); }
.drive-drop[hidden] { display: none; }
.drive-drop > div { display: grid; justify-items: center; gap: 10px; max-width: calc(100vw - 48px); padding: 22px 28px; border-radius: 22px; background: var(--brand-blue); color: #fff; font-weight: 600; text-align: center; pointer-events: none; }

.drive-uploads { position: fixed; right: 20px; bottom: 20px; z-index: 46; width: min(360px, calc(100vw - 32px)); overflow: hidden; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); }
.drive-uploads header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.drive-uploads header div { display: grid; min-width: 0; }
.drive-uploads ul { list-style: none; margin: 0; padding: 6px 0; max-height: 240px; overflow-y: auto; }
.drive-uploads li { display: flex; align-items: center; gap: 10px; padding: 6px 16px; font-size: 14px; }
.drive-uploads .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-uploads .state { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.drive-uploads li.failed .state { color: var(--owed); }
.drive-uploads .ok { display: flex; color: var(--received); }

.drive-menu hr { margin: 4px 6px; border: 0; border-top: 1px solid var(--line); }
.drive-menu button:disabled { color: var(--muted-2); background: none; cursor: default; }
.move-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: -6px; }
.link-like { padding: 0; border: 0; background: none; color: var(--brand-blue); font: inherit; cursor: pointer; }
.move-list { display: grid; gap: 2px; max-height: 320px; margin: 0 -8px; overflow-y: auto; }
.move-row { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.move-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.move-row svg { flex: none; color: var(--muted); }
.move-row:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
.move-note { padding: 12px; }

@media (max-width: 860px) {
  .drive-app { grid-template-columns: minmax(0, 1fr); }
  .drive-side { display: none; }
  .drive-app.nav-open .drive-side { display: block; position: fixed; inset: 0; z-index: 40; width: 100%; height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 10px 120px; }
  .drive-close { display: grid; }
  .drive-side .drive-new { display: none; }
  .drive-phone-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
  .drive-phone-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
  .drive-main { padding: 14px 16px 120px; }
  .drive-search input { height: 42px; }
  .drive-tools [data-act="refresh"] { display: none; }
  .drive-crumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 4px 0 10px; }
  .drive-crumbs::-webkit-scrollbar { display: none; }
  .drive-crumbs > a, .drive-crumbs > span:not(.sep), .drive-here { flex: none; font-size: 18px; white-space: nowrap; }
  .drive-row { grid-template-columns: minmax(0, 1fr) 40px; min-height: 60px; padding-left: 12px; }
  .drive-row > :nth-child(2), .drive-row > :nth-child(3), .drive-row > :nth-child(4), .drive-head { display: none; }
  .drive-meta { display: block; }
  .drive-tiles, .drive-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .drive-card-art { height: 96px; }
  .drive-uploads { right: 16px; bottom: 96px; }
}

/* ─── Office, people first: my desk, the floor, my agents, the room picker ─── */
.desk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-bottom: 8px; }
.desk-card { display: grid; align-content: start; gap: 10px; padding: 18px; min-width: 0; }
.desk-card-head { display: flex; align-items: center; gap: 8px; }
.desk-card-head h2 { margin: 0; font-size: 17px; }
.desk-card-head .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand-blue); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.desk-link { margin-left: auto; }
.desk-list { display: grid; gap: 2px; margin: 0 -8px; }
.desk-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border-radius: 12px; color: var(--text); }
.desk-row:hover { background: var(--surface-2); text-decoration: none; }
.desk-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.desk-ico.hand { background: var(--inverse); color: var(--on-inverse); }
.desk-main { display: grid; flex: 1; min-width: 0; }
.desk-main > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-time { flex: none; width: 62px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.agenda-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.due-chip { flex: none; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.due-chip.late { background: color-mix(in srgb, var(--owed) 12%, transparent); color: var(--owed); }
.desk-empty { margin: 4px 0; font-size: 14px; }
.desk-more { padding: 6px 8px; font-size: 13px; }
.desk-agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin: 0 -6px; }
.desk-agent { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px; border-radius: 12px; color: var(--text); }
.desk-agent:hover { background: var(--surface-2); text-decoration: none; }
.desk-agent > span:last-child { display: grid; min-width: 0; }
.desk-agent b, .desk-agent .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-agent.main .small { color: #B98900; font-weight: 600; }
.desk-card.loading { min-height: 140px; }
.sk-line { height: 12px; border-radius: 6px; background: var(--surface-2); animation: breathe 1.4s ease-in-out infinite; }
.sk-line.short { width: 60%; }

/* The living floor, people first: HEAD tags under heads' desks, and assistants' stools beside desks. */
.sc-headtag { margin-top: 3px; padding: 1px 4px; border-radius: 3px; font-size: 6.5px; font-weight: 900; letter-spacing: 0.08em; background: var(--inverse); color: var(--on-inverse); pointer-events: none; }
.sc-desk.beside { border-radius: 4px; }
.sc-desk.beside .lid { width: 12px; height: 7px; margin-left: -6px; top: -4px; }
.sc-owner.person.me .sc-status { background: #34C759; }
.sc-owner.person.head .sc-bigdesk { background: linear-gradient(#80543a, #66402a); }
.sc-owner.person:not(.head) .sc-bigdesk { background: #CCA880; border-color: #9E7A57; }
.sc-owner.person:not(.head) .sc-bigdesk b { font-size: 6.5px; }

/* Agents I manage. */
.agent-row { align-items: center; flex-wrap: wrap; cursor: default; }
.agent-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; color: var(--text); }
.agent-open:hover { text-decoration: none; }
.agent-open .main { display: grid; min-width: 0; }
.agent-open .title { font-weight: 600; }
.agent-open .meta { font-size: 13px; color: var(--muted); }
.agent-row .actions { gap: 6px; }
.agent-row.main-agent { background: color-mix(in srgb, #F4B400 7%, var(--surface)); }
.main-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-left: 8px; border-radius: 99px; font-size: 11px; font-weight: 700; vertical-align: 2px; color: #8a6700; background: color-mix(in srgb, #F4B400 20%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .main-tag, :root:not([data-theme="light"]) .desk-agent.main .small { color: #F4B400; } }
:root[data-theme="dark"] .main-tag, :root[data-theme="dark"] .desk-agent.main .small { color: #F4B400; }

/* Room pages and the Organization panel. */
.room-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; font-size: 14px; }
.type-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.type-badge.department { color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 10%, transparent); border-color: transparent; }
.type-badge.office { color: var(--received); background: color-mix(in srgb, var(--received) 10%, transparent); border-color: transparent; }
.org-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.picker-btn { max-width: 280px; gap: 6px; justify-content: flex-start; }
.picker-btn svg { flex: none; color: var(--muted); }
.picker-btn .picker-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The room picker (folders). */
.picker-field { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer; }
.picker-field .picker-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-field svg { flex: none; color: var(--muted); }
.picker-field:disabled { cursor: default; opacity: 0.7; }
.picker-dialog { width: min(520px, calc(100vw - 32px)); }
.pk-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 4px; margin-top: -6px; font-size: 14px; }
.pk-crumbs b { font-weight: 700; }
.pk-sep { display: flex; color: var(--muted-2); }
.pk-list { display: grid; gap: 2px; max-height: min(360px, 50vh); margin: 0 -10px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 0; }
.pk-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px; border: 0; border-radius: 14px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pk-row:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 6%, transparent); }
.pk-row:disabled { opacity: 0.45; cursor: default; }
.pk-row.current { background: color-mix(in srgb, var(--brand-blue) 8%, transparent); }
.pk-row > svg { flex: none; color: var(--muted-2); }
.pk-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.pk-icon.department { color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 10%, transparent); }
.pk-icon.office { color: var(--received); background: color-mix(in srgb, var(--received) 10%, transparent); }
.pk-name { display: grid; flex: 1; min-width: 0; }
.pk-name b, .pk-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-empty { padding: 18px 12px; }
.pk-new { display: flex; gap: 8px; align-items: center; }
.pk-new[hidden] { display: none; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 24px; }
.pk-new-btn { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.pk-new-btn[hidden] { display: none; }
.cal-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cal-name .agenda-dot.big { width: 16px; height: 16px; margin: 0; }
/* Beside a side list the calendar has less room: a slimmer panel on the right, which moves under the
   calendar when a week wouldn't fit next to it. */
.side-pane .cal-layout { grid-template-columns: minmax(0, 1fr) 260px; }
@media (max-width: 1429px) {
  .side-pane .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .side-pane .cal-tasks { position: static; max-height: none; }
}

/* Attached videos (tasks, the assistant chat, team chat) and archive chips */
.task-files { display: grid; gap: 10px; margin-top: 12px; justify-items: start; }
.task-files .attach-bar { margin: 0; }
.att-video { margin: 0; }
.att-video.small video, .msg-video video { max-width: min(100%, 360px); max-height: 280px; }
.msg-video { margin: 6px 0 0; }
.md-media.broken video { display: none; }
.bubble.files { display: grid; gap: 6px; justify-items: end; }

/* ─── Office: what's going on, above the floor ───────────────────── */
.office-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -6px 0 16px; }
.stat { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 12px 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
a.stat:hover { text-decoration: none; border-color: color-mix(in srgb, var(--text) 28%, transparent); }
.stat-label, .stat-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label { font-weight: 600; }
.stat-value { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value .typing { color: var(--brand-blue); }
.stat .meter { margin-top: 6px; }
.stat.warn .meter i { background: var(--inverse); }
.stat.bad .meter i { background: var(--owed); }
.stat.alert { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.stat.alert .stat-label, .stat.alert .stat-sub { color: color-mix(in srgb, var(--on-inverse) 72%, transparent); }
@media (max-width: 860px) {
  .office-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: -8px 0 14px; }
  .stat { padding: 10px 14px; border-radius: 18px; }
  .stat-value { font-size: 19px; }
}

/* Heads' titles under their desks on the floor. */
.sc-ptitle { margin-top: 2px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-size: 6.5px; font-weight: 600; color: var(--muted); white-space: nowrap; pointer-events: none; }

/* The Desk: Google Tasks, and questions with answers to pick. */
.desk-task { cursor: pointer; }
.desk-task input { flex: none; width: 18px; height: 18px; margin: 0 6px 0 4px; accent-color: var(--inverse); cursor: pointer; }
.desk-task.done .desk-main > span:first-child { text-decoration: line-through; color: var(--muted); }
.desk-add { display: flex; gap: 8px; }
.desk-add .field { min-height: 38px; padding: 6px 14px; border-radius: 14px; font-size: 14px; }
.desk-add-btn { flex: none; width: 38px; height: 38px; background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.desk-add-btn:hover { background: var(--inverse); opacity: 0.88; }
.desk-q { display: grid; gap: 2px; }
.desk-q .mcq { margin: 0 8px 8px 48px; }
.desk-q-text { white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Multiple-choice answers to an agent's question (questions.js). */
.mcq { display: grid; gap: 12px; margin: 0 0 14px; }
.mcq-q { display: grid; gap: 8px; }
.mcq-text { font-weight: 600; }
.mcq-header { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; vertical-align: 1px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.mcq-hint { margin-top: -4px; }
.mcq-options { display: flex; flex-wrap: wrap; gap: 8px; }
.mcq-option { min-height: 40px; max-width: 100%; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
button.mcq-option { display: inline-grid; gap: 1px; }
label.mcq-option { display: inline-flex; align-items: flex-start; gap: 10px; }
label.mcq-option > span { display: grid; gap: 1px; }
.mcq-option b { font-weight: 600; }
.mcq-option span span, button.mcq-option > span { font-size: 13px; color: var(--muted); }
.mcq-option input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--brand-blue); }
.mcq-option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 45%, transparent); }
.mcq-option:has(input:checked) { border-color: var(--inverse); box-shadow: inset 0 0 0 1px var(--inverse); }
.mcq-option.sending, button.mcq-option:active { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.mcq-option.sending > span { color: color-mix(in srgb, var(--on-inverse) 72%, transparent); }
.mcq-option:disabled, .mcq-option:has(input:disabled) { cursor: default; }
.mcq.busy { opacity: 0.75; }
.mcq-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mcq-else { border: 0; background: none; padding: 6px 2px; color: var(--action-blue); font: inherit; font-weight: 600; cursor: pointer; }
.mcq-else:hover { text-decoration: underline; }
.mcq.tap .mcq-foot { margin-top: -4px; }
.mcq.compact { gap: 8px; }
.mcq.compact .mcq-options { gap: 6px; }
.mcq.compact .mcq-option { min-height: 34px; padding: 6px 12px; border-radius: 17px; font-size: 14px; }
.mcq.compact .mcq-option span span, .mcq.compact button.mcq-option > span { font-size: 12px; }
.mcq.compact .mcq-else { font-size: 14px; padding: 2px; }
.bubble.them.asking { display: grid; gap: 12px; max-width: min(82%, 640px); }
.bubble.asking .mcq { margin: 0; }
.cd-question { display: grid; gap: 8px; padding: 12px 14px; border-radius: 18px; border: 1.5px solid var(--inverse); }
.cd-question .mcq { margin: 0; }
.cd-question > .btn { justify-self: start; }
.design-clock { color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* The org chart, people only: drag someone onto their new manager; open roles are dashed boxes. */
.org-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.org-bar .team-note { margin: 0 4px; }
.org-node { padding: 6px; gap: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s; }
.org-node .org-who b { display: block; }
.org-node.me { border-color: var(--inverse); box-shadow: 0 0 0 1px var(--inverse), var(--shadow); }
.org-you { flex: none; align-self: center; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--inverse); color: var(--on-inverse); }
.org-manual { flex: none; display: grid; color: var(--muted-2); }
.org-node.role { background: none; border: 1.5px dashed color-mix(in srgb, var(--text) 32%, transparent); box-shadow: none; }
.org-role-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1.5px dashed color-mix(in srgb, var(--text) 32%, transparent); color: var(--muted); }
.org-node.role .org-who b { font-weight: 600; }
.org-node[data-drag] { cursor: grab; }
.org-node.holding { transform: scale(1.04); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18); }
.org-node.dragging { opacity: 0.35; }
.org-node.drop-ok { border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 28%, transparent); }
.org-node.drop-no { opacity: 0.6; }
.org-ghost { position: fixed; left: 0; top: 0; z-index: 1000; margin: 0; pointer-events: none; rotate: -2deg; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28); }
body.org-dragging, body.org-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) { .org-node { transition: none; } .org-ghost { rotate: none; } }

/* Someone's card (clicking them on the chart). */
dialog.person-card { width: min(480px, calc(100vw - 32px)); }
.pc { display: grid; gap: 16px; }
.pc-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.pc-head .team-face .avatar { --size: 56px; }
.pc-who { display: grid; gap: 2px; min-width: 0; }
.pc-who .name-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pc-who .name-line b { font-size: 20px; letter-spacing: -0.02em; }
.pc-seen { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); overflow-wrap: anywhere; }
.pc-facts .sk-line { display: block; width: 90px; margin-top: 5px; }
.pc-facts div { grid-template-columns: 110px minmax(0, 1fr); }
.pc-manage { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.pc-manage label.label { margin: 0; }
.pc-manage .row { flex-wrap: nowrap; }
.pc-manage select { flex: 1; min-width: 0; min-height: 40px; padding: 8px 14px; border-radius: 14px; }
.pc-manage .link-btn, .pc-auto .link-btn { justify-self: start; display: inline-flex; align-items: center; gap: 4px; padding: 0; font-size: 14px; font-weight: 600; color: var(--action-blue); }
.pc-notes:empty { display: none; }
.pc-notes { white-space: pre-wrap; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* In dark mode every room is dark, so your own office keeps apart by its edge. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sc-room.night { border-color: color-mix(in srgb, var(--club-sky) 65%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--club-sky) 12%, transparent); } }
:root[data-theme="dark"] .sc-room.night { border-color: color-mix(in srgb, var(--club-sky) 65%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--club-sky) 12%, transparent); }
/* Phones: narrower boxes, names on up to two lines; your box keeps its ink edge instead of the tag. */
@media (max-width: 860px) {
  .org-node { width: 152px; }
  .org-node .org-card { gap: 8px; padding: 2px; }
  .org-node .avatar { --size: 32px; }
  .org-node .org-who b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; line-height: 1.2; }
  .org-node .org-who span { font-size: 12px; }
  .org-node .org-you { display: none; }
  .org-role-icon { width: 32px; height: 32px; }
}

/* ─── Plan, and the bar while agents can't start work ────────────── */
/* The bar runs across the top of the page, edge to edge, above whatever the page shows. */
.paywall { display: flex; align-items: center; gap: 12px; margin: -28px -36px 22px; padding: 10px 36px; background: var(--inverse); color: var(--on-inverse); font-size: 14px; font-weight: 600; }
.paywall > span { flex: 1; min-width: 0; }
.paywall .btn { flex: none; }
main.full > .paywall-slot > .paywall { margin: 0; padding: 10px 24px; }
@media (max-width: 860px) {
  .paywall { margin: -18px -16px 16px; padding: 10px 16px; font-size: 13px; }
  main.full > .paywall-slot > .paywall { margin: 0; padding: 10px 16px; }
}
/* A toast with a way forward (the Plan page) can be tapped while it shows. */
#toast.has-action { display: flex; align-items: center; gap: 14px; text-align: left; }
#toast.has-action.show { pointer-events: auto; }
.toast-action { flex: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.plan-paid { align-items: center; }
.plan-card { display: grid; gap: 18px; }
.plan-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-left { display: grid; gap: 6px; }
.plan-big { font-size: clamp(36px, 5vw, 52px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.plan-left .meter { max-width: 420px; }
.plan-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.plan-offer { display: grid; gap: 10px; align-content: start; }
.plan-offer.current { border-color: var(--inverse); box-shadow: 0 0 0 1px var(--inverse), var(--shadow); }
.plan-offer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-offer-head h2 { margin: 0; }
.plan-amount { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan-offer .btn { justify-self: start; margin-top: 4px; }
.plan-foot { margin: 16px 4px 0; }
@media (max-width: 860px) {
  .plan-offers { grid-template-columns: minmax(0, 1fr); }
  .plan-offer .btn { justify-self: stretch; }
}

/* Paying by bank transfer (SPEI): the tiers' tokens, a transfer waiting on a tier, and the note while
   one waits for approval (said without the red: there's nothing to fix). */
.plan-tokens { font-weight: 600; font-variant-numeric: tabular-nums; }
.plan-request { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.plan-waiting-note .typing { flex: none; color: var(--brand-blue); }
.plan-closed { margin-top: 18px; }
.s-pay-awaiting_proof { color: var(--on-inverse); background: var(--inverse); }
.s-pay-pending { color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 12%, transparent); }
.s-pay-approved { color: var(--received); background: color-mix(in srgb, var(--received) 12%, transparent); }
.s-pay-rejected { color: var(--owed); background: color-mix(in srgb, var(--owed) 12%, transparent); }
.s-pay-canceled, .s-pay-no-picture { color: var(--muted); background: var(--surface-2); }

/* Your payments */
.pay-row { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.pay-row:first-child { border-top: 0; }
.pay-row .main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pay-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-row .meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pay-note { justify-self: start; padding: 6px 12px; border-radius: 12px; background: var(--surface-2); overflow-wrap: anywhere; }
.pay-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .pay-row { flex-direction: column; align-items: stretch; }
  .pay-actions { justify-content: flex-start; }
}

/* The transfer: numbered steps, the details with Copy, the picture, then thanks. */
.pay-dialog { width: min(520px, calc(100vw - 32px)); }
.pay-dialog [hidden] { display: none; }
.pay-dialog h2:focus { outline: none; }
.pay-what { margin-top: -10px; color: var(--muted); font-weight: 600; }
.pay-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 16px; }
.pay-steps > li { counter-increment: step; position: relative; display: grid; gap: 8px; padding-left: 34px; }
.pay-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--inverse); color: var(--on-inverse); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.pay-steps p { margin: 1px 0 0; font-weight: 600; }
.pay-details { border: 1px solid var(--line); border-radius: 18px; background: var(--surface-2); }
.pay-detail { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.pay-detail:first-child { border-top: 0; }
.pay-detail-text { flex: 1; min-width: 0; display: grid; }
.pay-detail .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.pay-detail .v { font-weight: 600; overflow-wrap: anywhere; }
.pay-detail .v.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 16px; letter-spacing: 0.04em; }
.pay-detail .btn { flex: none; }
/* Phones: Copy is just its icon, so an 18-digit CLABE fits on one line. */
@media (max-width: 560px) { .pay-detail .btn { width: 34px; padding: 0; } .pay-detail .btn span { display: none; } }
.pay-file { display: grid; gap: 8px; justify-items: start; }
.pay-preview { max-width: 100%; max-height: 160px; border-radius: 12px; border: 1px solid var(--line); }
.pay-done { display: grid; justify-items: center; gap: 12px; padding: 12px 0 4px; text-align: center; }
.pay-done p { margin: 0; max-width: 34ch; font-size: 17px; font-weight: 600; }
.pay-done-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: var(--received); background: color-mix(in srgb, var(--received) 14%, transparent); }

/* The admin's Payments: one card per transfer, its picture on the left. */
.pay-tabs { width: max-content; margin-bottom: 18px; }
.pay-admin { display: grid; gap: 14px; }
.pay-admin-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; align-items: start; }
.proof-thumb { width: 132px; aspect-ratio: 3 / 4; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
a.proof-thumb:hover { border-color: var(--inverse); text-decoration: none; }
.proof-thumb.image img { width: 100%; height: 100%; object-fit: cover; }
.proof-thumb.broken { opacity: 0.6; }
.pay-admin-main { display: grid; gap: 14px; min-width: 0; }
.pay-admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pay-admin-who { display: grid; min-width: 0; }
.pay-admin-who b { font-size: 17px; letter-spacing: -0.02em; }
.pay-admin-who span { overflow-wrap: anywhere; }
.pay-admin-what { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.pay-admin-what b { font-size: 22px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pay-admin-what span { font-weight: 600; }
.pay-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 18px; margin: 0; }
.pay-facts dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.pay-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.pay-facts dd.code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; letter-spacing: 0.02em; }
@media (max-width: 560px) {
  .pay-admin-card { grid-template-columns: minmax(0, 1fr); }
  .proof-thumb { width: 100%; aspect-ratio: 4 / 3; }
}
/* The chat's header opens the agent's page. */
a.chat-title-btn:hover { text-decoration: none; }

/* ─── Studio ─────────────────────────────────────────────────────────
   Your AI workspace: the side list (your assistant pinned, projects, chats), the conversation
   with its message box and switches, and the panel beside it (documents, work mode's plan and files). */

/* While agents can't start work, the bar stays at the top of Studio, which fits below it: a chat
   opens at its newest message and would scroll the bar away. --paywall is the bar's height (app.js). */
main.full:has(> .studio-app) > .paywall-slot { position: sticky; top: 0; z-index: 8; }
.studio-app { min-height: calc(100dvh - var(--paywall, 0px)); }
.studio-app > .side-list { top: var(--paywall, 0px); height: calc(100dvh - var(--paywall, 0px)); }
.studio-app[data-panel="open"] { grid-template-columns: 280px minmax(0, 1fr) clamp(380px, 34vw, 720px); }
.studio-side-btn { display: none; flex: none; }
.studio-pane { max-width: none; }
.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.studio-new-btn { height: 34px; padding: 0 12px 0 10px; gap: 4px; }
.studio-new-btn:hover { text-decoration: none; }
.studio-pin { margin-top: 10px; }
.studio-pin-mark { flex: none; display: grid; color: var(--muted-2); }
.side-row.active .studio-pin-mark { color: inherit; }
.studio-search { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; height: 40px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.studio-search:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.studio-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font-size: 14px; }
.studio-row { position: relative; }
.studio-row > .side-row { padding-right: 38px; }
.studio-row-menu { position: absolute; right: 6px; top: 50%; margin-top: -13px; background: none; color: var(--muted); opacity: 0; }
.studio-row:hover .studio-row-menu, .studio-row:focus-within .studio-row-menu, .studio-row-menu[aria-expanded="true"] { opacity: 1; }
.studio-row.active .studio-row-menu { color: var(--on-inverse); }
.studio-row.active .studio-row-menu:hover { background: color-mix(in srgb, var(--on-inverse) 16%, transparent); }
@media (hover: none) { .studio-row-menu { opacity: 1; } }
.studio-row .typing, .studio-pin .typing { flex: none; color: var(--brand-blue); }
.studio-row.active .typing { color: inherit; }
.studio-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-blue); }
.studio-dot.bad { background: var(--owed); }
.studio-side mark { background: color-mix(in srgb, var(--brand-blue) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.studio-folder { display: inline-grid; place-items: center; color: var(--c, var(--brand-blue)); }
.side-row.active .studio-folder { color: inherit; }
.studio-folder.big { width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--c) 14%, transparent); margin-right: 12px; vertical-align: -6px; }

/* Menus (a chat's ⋯, the model picker) */
.studio-menu { position: fixed; z-index: 60; min-width: 230px; max-width: min(340px, calc(100vw - 16px)); padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 36px rgba(11, 11, 15, 0.18); display: grid; gap: 2px; }
.studio-menu .menu-label { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.studio-menu .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; cursor: pointer; text-align: left; color: var(--text); }
.studio-menu .menu-item:hover:not(:disabled), .studio-menu .menu-item:focus-visible { background: var(--mist); outline: none; }
.studio-menu .menu-item:disabled { cursor: not-allowed; opacity: 0.5; }
.studio-menu .menu-item.danger { color: var(--owed); }
.studio-menu .menu-check { width: 18px; flex: none; display: grid; place-items: center; color: var(--action-blue); }
.studio-menu .menu-item.danger .menu-check { color: inherit; }
.studio-menu .menu-main { display: grid; min-width: 0; }
.studio-menu .menu-main b { font-weight: 600; font-size: 14px; }
.studio-menu .menu-main span { font-size: 12.5px; color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .studio-menu .menu-item:hover:not(:disabled) { background: var(--surface-2); } }

/* A chat */
.studio-chat { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100dvh - 148px - var(--paywall, 0px)); }
.studio-chat-head { position: sticky; top: var(--paywall, 0px); z-index: 6; display: flex; align-items: center; gap: 12px; margin: -28px 0 18px; padding: 16px 0 12px; background: color-mix(in srgb, var(--ground) 90%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.studio-chat-head .side-back { margin: 0; }
.studio-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.studio-title h2 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-sub { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.studio-sub > * { white-space: nowrap; }
.studio-sub > span:not(.studio-chip) + span:not(.studio-chip)::before { content: "·"; margin-right: 8px; color: var(--muted-2); }
.studio-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; }
a.studio-chip:hover { background: var(--mist); text-decoration: none; }
.studio-chip.work { color: var(--action-blue); border-color: color-mix(in srgb, var(--brand-blue) 30%, transparent); background: color-mix(in srgb, var(--brand-blue) 8%, var(--surface)); }
.studio-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.btn .count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11px; display: inline-grid; place-items: center; }
.studio-panel-btn.on { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.studio-panel-btn.on .count { background: color-mix(in srgb, var(--on-inverse) 20%, transparent); color: var(--on-inverse); }
.studio-msgs { max-width: none; flex: 1; align-content: start; }
.studio-msgs .bubble.them { max-width: 92%; }
.studio-typing { display: inline-flex; align-items: center; gap: 8px; }

/* The message box: your words on top, its switches underneath. */
.studio-compose { position: sticky; bottom: 16px; z-index: 5; margin-top: 18px; }
.studio-compose .attach-chips { margin: 0 0 8px; }
.composer.studio-composer { position: static; margin: 0; flex-direction: column; align-items: stretch; gap: 2px; border-radius: 26px; box-shadow: var(--shadow); }
.studio-input-row { display: flex; gap: 10px; align-items: flex-end; }
.studio-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 4px 2px 54px; }
.studio-model, .studio-toggle { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.studio-model { color: var(--text); }
.studio-model svg:last-child { transform: rotate(90deg); color: var(--muted); }
.studio-model:hover, .studio-toggle:hover:not(:disabled) { background: var(--mist); color: var(--text); }
.studio-model[aria-expanded="true"] { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); }
.studio-model[aria-expanded="true"] svg:last-child { color: inherit; }
.studio-model[aria-busy="true"] { cursor: progress; opacity: 0.6; }
.studio-toggle.on { color: var(--action-blue); background: color-mix(in srgb, var(--brand-blue) 12%, var(--surface)); border-color: color-mix(in srgb, var(--brand-blue) 40%, transparent); }
.studio-toggle.on:hover { background: color-mix(in srgb, var(--brand-blue) 18%, var(--surface)); color: var(--action-blue); }
.studio-toggle:disabled { opacity: 0.45; cursor: not-allowed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .studio-toggle.on, :root:not([data-theme="light"]) .studio-toggle.on:hover { color: var(--club-sky); } :root:not([data-theme="light"]) .studio-model:hover, :root:not([data-theme="light"]) .studio-toggle:hover:not(:disabled) { background: var(--surface-2); } }
:root[data-theme="dark"] .studio-toggle.on { color: var(--club-sky); }
.studio-hint { display: flex; align-items: flex-start; gap: 6px; margin: 8px 8px 0; }
.studio-hint[hidden] { display: none; }
.studio-hint svg { flex: none; margin-top: 2px; }

/* A new chat */
.studio-new { max-width: 760px; margin: max(6vh, 24px) auto 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.studio-new .project-chip { justify-self: start; height: 30px; font-size: 13px; }
.studio-greeting { font-size: clamp(30px, 3.4vw, 44px); }
.studio-lede { margin: -4px 0 6px; }
.studio-new .studio-compose, .studio-project .studio-compose { position: static; margin-top: 0; }
.studio-ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; margin-top: 6px; }
.studio-ideas .suggestion { font-size: 14px; color: var(--muted); }
.studio-ideas .suggestion:hover { color: var(--text); }

/* In the conversation: documents, files, thinking and the plan */
.studio-doc-card, .studio-plan-line { justify-self: start; display: flex; align-items: center; gap: 12px; width: min(460px, 100%); padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.studio-doc-card:hover, .studio-plan-line:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 18%, transparent); }
.studio-doc-card.pending { cursor: default; opacity: 0.7; }
.sdc-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-blue) 12%, transparent); color: var(--action-blue); }
.sdc-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.sdc-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdc-open { flex: none; font-size: 13px; font-weight: 600; color: var(--action-blue); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sdc-icon, :root:not([data-theme="light"]) .sdc-open { color: var(--club-sky); } }
.studio-file { justify-self: start; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; width: min(520px, 100%); padding: 10px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.studio-file .sdc-main { flex: 1 1 150px; }
.studio-file.pending { opacity: 0.7; }
.studio-file-actions { display: flex; gap: 6px; flex: none; }
.studio-file-actions .btn svg { transform: rotate(180deg); }
.studio-file-actions a.btn svg { transform: none; }
.file-ext { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 10px; font-weight: 800; letter-spacing: 0.02em; color: #fff; background: var(--muted-2); }
.file-ext.ext-docx, .file-ext.ext-doc { background: #2B66D9; }
.file-ext.ext-xlsx, .file-ext.ext-xls, .file-ext.ext-csv { background: #0A8A4B; }
.file-ext.ext-pptx, .file-ext.ext-ppt { background: #D35230; }
.file-ext.ext-pdf { background: #C4271B; }
.file-ext.ext-md, .file-ext.ext-txt { background: #555E6C; }
.file-ext.ext-zip { background: #8A6D1F; }
.studio-thinking { justify-self: start; max-width: 92%; color: var(--muted); }
.studio-thinking summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 10px; list-style: none; }
.studio-thinking summary::-webkit-details-marker { display: none; }
.studio-thinking summary:hover { background: var(--surface-2); color: var(--text); }
.studio-thinking .markdown { padding: 6px 12px 4px; border-left: 2px solid var(--line); margin: 4px 0 0 10px; }
.plan-ring { flex: none; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--brand-blue) calc(var(--p) * 1%), var(--line) 0); -webkit-mask: radial-gradient(circle 11px, transparent 98%, #000); mask: radial-gradient(circle 11px, transparent 98%, #000); }

/* The panel beside the chat */
.studio-panel { position: sticky; top: var(--paywall, 0px); height: calc(100dvh - var(--paywall, 0px)); display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-left: 1px solid var(--line); }
.studio-panel[hidden] { display: none; }
.sp-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.sp-head .icon-btn.mini { width: 32px; height: 32px; background: none; }
.sp-head .icon-btn.mini:hover { background: var(--mist); }
.sp-title { flex: 1; min-width: 0; display: grid; }
.sp-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-bar { flex: none; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 18px 0; }
.sp-actions { flex: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 12px; border-bottom: 1px solid var(--line); }
.sp-actions .btn.small { height: 32px; padding: 0 11px; gap: 6px; }
.sp-views { width: max-content; }
.segmented button { flex: none; height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; }
.segmented button:hover { background: var(--mist); }
.segmented button.on { background: var(--inverse); color: var(--on-inverse); }
.sp-version select.field { min-height: 36px; height: 36px; padding: 4px 34px 4px 14px; font-size: 13px; width: auto; max-width: 260px; border-radius: 999px; }
.sp-saved { display: flex; align-items: center; gap: 6px; padding: 10px 18px 0; color: var(--received); font-weight: 600; }
.sp-old { margin: 12px 18px 0; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
.sp-old span { flex: 1 1 200px; }
.sp-old .link-btn { font-size: 13px; font-weight: 600; color: var(--action-blue); }
.sp-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 18px; }
.sp-body.kind-html { padding: 0; display: flex; }
.sp-frame { flex: 1; width: 100%; min-height: 420px; border: 0; background: #fff; }
.sp-body .markdown pre { margin: 0; }
.sp-code pre, .sp-diagram pre { border-radius: 14px; }
.sp-diagram .mermaid-view { display: flex; justify-content: safe center; overflow-x: auto; padding: 8px 0; }
.sp-diagram .mermaid-view svg { flex: none; max-width: 100%; height: auto; }
.sp-doc table { display: block; max-width: 100%; overflow-x: auto; }
.sp-doc th, .sp-doc td { overflow-wrap: normal; word-break: normal; }
.sp-editor { display: block; width: 100%; height: 100%; min-height: 360px; resize: none; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: var(--text); padding: 14px 16px; font-size: 14px; line-height: 1.6; outline: none; }
.sp-editor:focus { border-color: var(--brand-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.sp-editor.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; tab-size: 2; white-space: pre; }
.sp-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; max-height: calc(100dvh - 230px); }
.sp-table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-table th, .sp-table td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.sp-table th { position: sticky; top: 0; background: var(--surface-2); font-weight: 700; }
.sp-table td.num { text-align: right; }
.sp-table tbody tr:hover td { background: var(--surface-2); }
.sp-section + .sp-section { margin-top: 24px; }
.sp-section h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.sp-section .studio-doc-card, .sp-files .studio-file { width: 100%; }
.sp-section .studio-doc-card + .studio-doc-card { margin-top: 8px; }
.sp-files { display: grid; gap: 8px; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plan-step { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px; border-radius: 14px; }
.plan-step.doing { background: color-mix(in srgb, var(--brand-blue) 8%, transparent); }
.plan-mark { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.plan-step.done .plan-mark { background: var(--received); border-color: var(--received); color: #fff; }
.plan-step.doing .plan-mark { border-color: var(--brand-blue); border-top-color: transparent; animation: spin 0.9s linear infinite; }
.plan-step.skipped .plan-mark { border-style: dashed; }
.plan-step.skipped .plan-text > span:first-child { text-decoration: line-through; color: var(--muted); }
.plan-text { display: grid; gap: 1px; min-width: 0; }
.plan-step.doing .plan-text > span:first-child { font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .plan-step.doing .plan-mark { animation: none; border-top-color: var(--brand-blue); } }

/* A project */
.studio-project { max-width: 1120px; margin: 0 auto; }
.studio-project-head h1 { display: flex; align-items: center; }
.studio-project-desc { margin: 8px 0 0; max-width: 640px; }
.studio-project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.studio-h2 { margin: 28px 0 12px; }
.studio-project-chats .list-row { align-items: center; }
.studio-project-chats .main { display: grid; gap: 2px; }
.studio-project-chats .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-project-aside { display: grid; gap: 14px; }
.sp-card { padding: 18px; border-radius: 22px; }
.sp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sp-card-head .link-btn { font-size: 14px; font-weight: 600; color: var(--action-blue); }
.studio-instructions { max-height: 260px; overflow: auto; }
.studio-instructions > :first-child { margin-top: 0; }
.sp-project-files { display: grid; }
.sp-project-file { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sp-project-file:first-child { border-top: 0; padding-top: 0; }
.sp-project-file .file-ext { width: 32px; height: 32px; border-radius: 9px; font-size: 9px; }
.sp-file-name { flex: 1; min-width: 0; text-align: left; font-size: 14px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-file-name:hover { color: var(--action-blue); text-decoration: underline; }

/* Laptops: with the panel open, the chat keeps its room and the list folds away (its button brings it back over the chat). */
@media (max-width: 1699px) and (min-width: 861px) {
  .studio-app[data-panel="open"] { grid-template-columns: minmax(0, 1fr) clamp(380px, 40vw, 680px); }
  .studio-app[data-panel="open"] > .studio-side { display: none; }
  .studio-app[data-panel="open"][data-side="open"] > .studio-side { display: block; position: fixed; z-index: 30; top: var(--paywall, 0px); left: 240px; width: 290px; height: calc(100dvh - var(--paywall, 0px)); box-shadow: 0 20px 60px rgba(11, 11, 15, 0.22); }
  .studio-app[data-panel="open"] .studio-side-btn { display: grid; }
  .studio-app[data-panel="open"] .studio-pane { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 1279px) and (min-width: 861px) {
  .studio-project-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .studio-app[data-panel="open"] .studio-tools { padding-left: 0; }
}
/* Phones: the list, then a chat; documents open over the chat. */
@media (max-width: 860px) {
  .studio-app[data-panel="open"] { grid-template-columns: minmax(0, 1fr); }
  .studio-chat { min-height: calc(100dvh - 140px - var(--paywall, 0px)); }
  .studio-chat-head { margin: -14px -16px 14px; padding: 10px 16px; gap: 8px; }
  .studio-chat-head .side-back { flex-basis: 100%; margin: 0 0 2px -6px; }
  .studio-head-actions .studio-panel-btn span:not(.count) { display: none; }
  .studio-head-actions .studio-panel-btn { width: auto; padding: 0 10px; }
  .studio-compose { bottom: 90px; }
  .studio-compose .send-btn { width: 44px; padding: 0; flex: none; }
  .studio-compose .send-btn span { display: none; }
  .studio-tools { padding-left: 0; }
  .studio-ideas { grid-template-columns: 1fr; }
  .studio-new { margin-top: 8px; }
  .studio-panel { position: fixed; inset: 0; z-index: 45; height: 100dvh; border: 0; }
  body.studio-panel-open { overflow: hidden; }
  body.studio-panel-open .tabbar { display: none; }
  .studio-project-grid { grid-template-columns: minmax(0, 1fr); }

  .studio-file { flex-wrap: wrap; }
  .studio-file-actions { margin-left: 52px; }
  .sp-actions .btn.small span { display: none; }
  .sp-actions .btn.small { width: 36px; padding: 0; }
}
