:root {
  --bg: 238 240 247;
  --surface: 255 255 255;
  --surface-2: 240 242 248;
  --line: 225 229 238;
  --text: 16 20 33;
  --muted: 100 108 130;
  --brand: 91 75 225;
  --brand-soft: 237 235 254;
  --accent: 13 148 136;
  --accent-soft: 220 245 241;
  --danger: 209 61 61;
  --warn: 199 129 20;
  --ok: 34 145 92;
  --shadow: 15 23 42;
}

html.dark {
  --bg: 12 14 20;
  --surface: 20 23 32;
  --surface-2: 29 33 45;
  --line: 43 48 63;
  --text: 232 235 244;
  --muted: 145 154 175;
  --brand: 138 126 255;
  --brand-soft: 39 36 74;
  --accent: 45 212 191;
  --accent-soft: 11 51 48;
  --danger: 241 116 116;
  --warn: 226 168 62;
  --ok: 74 196 138;
  --shadow: 0 0 0;
}

* { -webkit-tap-highlight-color: transparent; }
/* The app is a fixed screen whose panes scroll inside it. On phones (iOS above all) a scroll that reached the end
   of a pane used to carry on to the page itself, which then bounced and dragged the whole app — header, menu and
   all — over the background. The page itself never scrolls or bounces now; each pane keeps its scroll to itself. */
html, body { height: 100%; overscroll-behavior: none; }
body { overflow: hidden; position: fixed; inset: 0; width: 100%; }
/* Each scroll box keeps its scrolling to itself only along the axis it scrolls in (no page bounce on phones). Both
   axes would trap the other direction too: a sideways swipe over a board column must still move the board. */
.overflow-y-auto, .overflow-auto, .overflow-x-auto, .scroll-thin { -webkit-overflow-scrolling: touch; }
.overflow-y-auto { overscroll-behavior-y: contain; }
.overflow-x-auto { overscroll-behavior-x: contain; }
.overflow-auto { overscroll-behavior: contain; }
/* Board columns hand scrolling on at their ends, so the board (and its swimlanes) keeps scrolling past them. */
.board-col { overscroll-behavior: auto; }
/* Screens without panes of their own (sign-in on a small phone with the keyboard open) still scroll, inside the app. */
#app { overflow-y: auto; overscroll-behavior: contain; }

::selection { background: rgb(var(--brand) / 0.22); }

.scroll-thin { scrollbar-width: thin; scrollbar-color: rgb(var(--muted) / 0.35) transparent; }
.scroll-thin::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: rgb(var(--muted) / 0.3); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: rgb(var(--muted) / 0.5); background-clip: content-box; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--brand));
  outline-offset: 2px;
  border-radius: 6px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 2.25rem; padding: 0 0.75rem; border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .06s ease;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-brand { background: rgb(var(--brand)); color: #fff; }
.btn-brand:hover:not(:disabled) { background: rgb(var(--brand) / 0.88); }
.btn-accent { background: rgb(var(--accent)); color: #fff; }
.btn-accent:hover:not(:disabled) { background: rgb(var(--accent) / 0.88); }
.btn-default { background: rgb(var(--surface)); color: rgb(var(--text)); border-color: rgb(var(--line)); }
.btn-default:hover:not(:disabled) { background: rgb(var(--surface-2)); }
.btn-ghost { background: transparent; color: rgb(var(--muted)); }
.btn-ghost:hover:not(:disabled) { background: rgb(var(--surface-2)); color: rgb(var(--text)); }
.btn-danger { background: rgb(var(--danger)); color: #fff; }
.btn-danger:hover:not(:disabled) { background: rgb(var(--danger) / 0.88); }
.btn-sm { height: 1.75rem; padding: 0 0.5rem; font-size: 0.75rem; border-radius: 0.4rem; }
.btn-icon { width: 2.25rem; padding: 0; }
.btn-icon.btn-sm { width: 1.75rem; }

.input, .select, .textarea {
  width: 100%; background: rgb(var(--surface)); color: rgb(var(--text));
  border: 1px solid rgb(var(--line)); border-radius: 0.5rem;
  padding: 0.45rem 0.6rem; font-size: 0.8125rem; line-height: 1.35;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.input::placeholder, .textarea::placeholder { color: rgb(var(--muted) / 0.8); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgb(var(--brand)); box-shadow: 0 0 0 3px rgb(var(--brand) / 0.16);
}
.select { appearance: none; padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23838ba0'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%23838ba0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 1rem;
}
.textarea { resize: vertical; min-height: 5rem; }

.card { background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 0.75rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600; line-height: 1.5;
  border: 1px solid transparent; white-space: nowrap;
}
.chip-muted { background: rgb(var(--surface-2)); color: rgb(var(--muted)); border-color: rgb(var(--line)); }
.chip-brand { background: rgb(var(--brand-soft)); color: rgb(var(--brand)); }
.chip-accent { background: rgb(var(--accent-soft)); color: rgb(var(--accent)); }
.chip-danger { background: rgb(var(--danger) / 0.12); color: rgb(var(--danger)); }
.chip-warn { background: rgb(var(--warn) / 0.14); color: rgb(var(--warn)); }
.chip-ok { background: rgb(var(--ok) / 0.14); color: rgb(var(--ok)); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
  border: 1px solid rgb(var(--line)); border-bottom-width: 2px; border-radius: 0.3rem;
  background: rgb(var(--surface-2)); color: rgb(var(--muted));
  font-size: 0.6875rem; font-weight: 600; font-family: inherit;
}

.nav-link {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.6rem; border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 500; color: rgb(var(--muted));
  cursor: pointer; transition: background-color .12s ease, color .12s ease;
}
.nav-link:hover { background: rgb(var(--surface-2)); color: rgb(var(--text)); }
.nav-link.active { background: rgb(var(--brand-soft)); color: rgb(var(--brand)); font-weight: 600; }
.nav-link.active svg { color: rgb(var(--brand)); }

.tab {
  padding: 0.5rem 0.15rem; margin-right: 1.1rem;
  font-size: 0.8125rem; font-weight: 600; color: rgb(var(--muted));
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: rgb(var(--text)); }
.tab.active { color: rgb(var(--brand)); border-bottom-color: rgb(var(--brand)); }

.task-card { transition: box-shadow .12s ease, border-color .12s ease, transform .06s ease; }
.task-card:hover { border-color: rgb(var(--brand) / 0.45); box-shadow: 0 2px 8px -2px rgb(var(--shadow) / 0.12); }
.task-card.dragging { opacity: .45; }
/* Sidebar projects being reordered: a line where the dragged one will land. */
[data-project-row].drop-above { box-shadow: inset 0 2px 0 rgb(var(--brand)); }
[data-project-row].drop-below { box-shadow: inset 0 -2px 0 rgb(var(--brand)); }
.drop-target { background: rgb(var(--brand) / 0.06); box-shadow: inset 0 0 0 2px rgb(var(--brand) / 0.35); }

.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgb(var(--accent) / 0.55); animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgb(var(--accent) / 0); } 100% { box-shadow: 0 0 0 0 rgb(var(--accent) / 0); } }

.fade-in { animation: fade-in .16s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pop-in { animation: pop-in .16s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.sheet-cell {
  width: 100%; height: 2.25rem; text-align: center; background: transparent;
  border: 1px solid transparent; border-radius: 0.4rem; color: rgb(var(--text));
  font-size: 0.8125rem; font-variant-numeric: tabular-nums;
}
.sheet-cell:hover { border-color: rgb(var(--line)); }
.sheet-cell:focus { outline: none; border-color: rgb(var(--brand)); box-shadow: 0 0 0 3px rgb(var(--brand) / 0.16); background: rgb(var(--surface)); }
.sheet-cell.weekend { background: rgb(var(--surface-2) / 0.7); }
.sheet-cell.filled { font-weight: 600; }

.prose-mini p { margin: 0 0 0.6rem; }
.prose-mini p:last-child { margin-bottom: 0; }
.prose-mini ul { margin: 0 0 0.6rem 1.1rem; list-style: disc; }
.prose-mini code { font-family: ui-monospace, monospace; font-size: .8em; background: rgb(var(--surface-2)); padding: 0.05rem 0.3rem; border-radius: 0.25rem; }
.mention { color: rgb(var(--brand)); background: rgb(var(--brand-soft)); padding: 0 0.25rem; border-radius: 0.25rem; font-weight: 600; }

.stripe { background-image: repeating-linear-gradient(45deg, rgb(var(--muted) / .14) 0 6px, transparent 6px 12px); }

/* Touch screens: iOS zooms the page in when a field under 16px gets focus, and the zoomed page then slides
   sideways and hides pop-ups like the @-mention list. 16px fields keep it at its size. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select { font-size: 16px !important; }
}

@media (max-width: 767px) {
  /* Nothing may make a phone's page wider than the screen; long content scrolls inside its own box. */
  #app { overflow-x: clip; }
  #sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    transform: translateX(-101%);
    transition: transform .2s ease;
    box-shadow: 0 0 40px rgb(15 23 42 / .2);
  }
  #app[data-nav="open"] #sidebar { transform: none; }
  #app[data-nav="open"]::before {
    content: ''; position: fixed; inset: 0; z-index: 55;
    background: rgb(15 23 42 / .45);
  }
}

/* The sidebar narrowed to icons (burger at its top; wide screens only — phones keep the slide-in menu). */
#sidebar { transition: width .15s ease; }
@media (min-width: 768px) {
  #app[data-sidebar="compact"] #sidebar { width: 60px; }
  #app[data-sidebar="compact"] #sidebar .nav-text,
  #app[data-sidebar="compact"] #sidebar .nav-logo,
  #app[data-sidebar="compact"] #sidebar .nav-group p,
  #app[data-sidebar="compact"] #sidebar .nav-group button,
  #app[data-sidebar="compact"] #sidebar .nav-sub,
  #app[data-sidebar="compact"] #sidebar .nav-dot,
  #app[data-sidebar="compact"] #sidebar [data-search] { display: none; }
  #app[data-sidebar="compact"] #sidebar .nav-head { justify-content: center; padding: 0; }
  #app[data-sidebar="compact"] #sidebar .nav-head [data-sidebar-toggle] { margin: 0; }
  #app[data-sidebar="compact"] #sidebar .nav-actions { padding: 0.625rem 0.5rem; }
  #app[data-sidebar="compact"] #sidebar .nav-actions [data-create] { padding-left: 0; padding-right: 0; gap: 0; }
  #app[data-sidebar="compact"] #sidebar nav { padding-left: 0.5rem; padding-right: 0.5rem; }
  #app[data-sidebar="compact"] #sidebar .nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
  /* Projects by their key in their colour: a dot alone does not tell them apart. */
  #app[data-sidebar="compact"] #sidebar .nav-key { color: var(--project); font-weight: 700; font-size: 11px; }
  /* Group names give way to a thin line between the groups. */
  #app[data-sidebar="compact"] #sidebar .nav-group { border-top: 1px solid rgb(var(--line)); margin: 0.5rem 0.25rem; padding: 0; }
  #app[data-sidebar="compact"] #sidebar .nav-group:first-child { display: none; }
  #app[data-sidebar="compact"] #sidebar > div:last-child { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* Documentation pages rendered from Markdown */
.prose-doc { font-size: 14px; line-height: 1.65; color: rgb(var(--text)); overflow-wrap: anywhere; }
.prose-doc > :first-child { margin-top: 0; }
.prose-doc h1, .prose-doc h2, .prose-doc h3, .prose-doc h4 { font-weight: 650; line-height: 1.3; margin: 1.6em 0 0.6em; scroll-margin-top: 1rem; }
.prose-doc h1 { font-size: 1.6rem; }
.prose-doc h2 { font-size: 1.25rem; padding-bottom: 0.3em; border-bottom: 1px solid rgb(var(--line)); }
.prose-doc h3 { font-size: 1.05rem; }
.prose-doc h4 { font-size: 0.95rem; }
.prose-doc p, .prose-doc ul, .prose-doc ol, .prose-doc pre, .prose-doc table, .prose-doc blockquote { margin: 0 0 1em; }
.prose-doc ul { list-style: disc; padding-left: 1.4em; }
.prose-doc ol { list-style: decimal; padding-left: 1.4em; }
.prose-doc li { margin: 0.2em 0; }
.prose-doc li > ul, .prose-doc li > ol { margin: 0.2em 0 0; }
.prose-doc a { color: rgb(var(--brand)); font-weight: 500; }
.prose-doc a:hover { text-decoration: underline; }
.prose-doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: rgb(var(--surface-2)); padding: 0.1rem 0.35rem; border-radius: 0.3rem; }
.prose-doc pre { background: rgb(var(--surface-2)); border: 1px solid rgb(var(--line)); border-radius: 0.5rem; padding: 0.8rem 1rem; overflow-x: auto; }
.prose-doc pre code { background: none; padding: 0; font-size: 12.5px; line-height: 1.55; }
.prose-doc blockquote { border-left: 3px solid rgb(var(--line)); padding-left: 1em; color: rgb(var(--muted)); }
.prose-doc table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 13px; }
.prose-doc th, .prose-doc td { border: 1px solid rgb(var(--line)); padding: 0.4rem 0.7rem; text-align: left; vertical-align: top; }
.prose-doc th { background: rgb(var(--surface-2)); font-weight: 600; }
.prose-doc hr { border: 0; border-top: 1px solid rgb(var(--line)); margin: 1.5em 0; }
.prose-doc img { max-width: 100%; border-radius: 0.4rem; }
.prose-doc input[type="checkbox"] { margin-right: 0.4em; }
.prose-doc.prose-task { font-size: 13px; line-height: 1.6; }
.prose-task h1, .prose-task h2, .prose-task h3, .prose-task h4 { margin: 1.1em 0 0.5em; }
.prose-task h1 { font-size: 1.15rem; }
.prose-task h2 { font-size: 1.05rem; }
.prose-task h3, .prose-task h4 { font-size: 0.95rem; }
.prose-task > :last-child { margin-bottom: 0; }

/* 404: the lost compass */
.lost-art { overflow: visible; }
.lost-shadow { fill: rgb(var(--line) / 0.6); }
.lost-trail { fill: none; stroke: rgb(var(--muted) / 0.35); stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.lost-steps ellipse { fill: rgb(var(--muted) / 0.45); }
.lost-compass { transform-origin: 120px 92px; animation: lost-bob 3.2s ease-in-out infinite; }
.lost-rim { fill: rgb(var(--brand)); }
.lost-face { fill: rgb(var(--surface)); stroke: rgb(var(--brand) / 0.25); stroke-width: 3; }
.lost-ticks { stroke: rgb(var(--muted) / 0.6); stroke-width: 2.5; stroke-linecap: round; }
.lost-n { font: 700 12px system-ui, sans-serif; fill: rgb(var(--muted)); text-anchor: middle; }
.lost-needle { transform-origin: 120px 92px; animation: lost-spin 4.5s cubic-bezier(.5,0,.3,1) infinite; }
.lost-needle-n { fill: rgb(var(--danger)); }
.lost-needle-s { fill: rgb(var(--muted) / 0.55); }
.lost-pin { fill: rgb(var(--text)); }
.lost-q { font: 700 26px system-ui, sans-serif; fill: rgb(var(--brand) / 0.7); animation: lost-float 2.8s ease-in-out infinite; }
.lost-q2 { font-size: 20px; animation-delay: -.9s; fill: rgb(var(--muted) / 0.6); }
.lost-q3 { font-size: 16px; animation-delay: -1.8s; }
@keyframes lost-spin {
  0% { transform: rotate(0deg); } 18% { transform: rotate(140deg); } 26% { transform: rotate(110deg); }
  44% { transform: rotate(-200deg); } 52% { transform: rotate(-170deg); } 70% { transform: rotate(35deg); }
  80% { transform: rotate(10deg); } 90% { transform: rotate(25deg); } 100% { transform: rotate(0deg); }
}
@keyframes lost-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes lost-float { 0%, 100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(-8px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lost-compass, .lost-needle, .lost-q { animation: none; } }

/* Support portal */
.sp-hero, .sp-subhero {
  --sp-color: rgb(var(--brand));
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(60rem 22rem at 110% -10%, rgb(255 255 255 / 0.22), transparent 60%),
    radial-gradient(40rem 20rem at -10% 120%, rgb(var(--accent) / 0.55), transparent 60%),
    linear-gradient(135deg, var(--sp-color), color-mix(in srgb, var(--sp-color) 55%, rgb(var(--accent))));
}
.sp-hero::after, .sp-subhero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: .18;
  background-image: radial-gradient(rgb(255 255 255 / 0.9) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}
.dark .sp-hero, .dark .sp-subhero { filter: saturate(.9) brightness(.85); }
.sp-hero-chip {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.1rem; padding: 0 .9rem; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff; background: rgb(255 255 255 / 0.18);
  border: 1px solid rgb(255 255 255 / 0.3); backdrop-filter: blur(6px); transition: background .15s;
}
.sp-hero-chip:hover { background: rgb(255 255 255 / 0.28); }
.sp-card {
  background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 8px 24px -12px rgb(15 23 42 / 0.12);
}
.sp-lift { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.sp-lift:hover {
  transform: translateY(-2px); border-color: color-mix(in srgb, var(--sp-color, rgb(var(--brand))) 45%, rgb(var(--line)));
  box-shadow: 0 2px 4px rgb(15 23 42 / 0.05), 0 18px 36px -16px rgb(15 23 42 / 0.25);
}
.sp-tile {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: .9rem;
  --sp-c: var(--sp-color, rgb(var(--brand)));
  background: linear-gradient(135deg, color-mix(in srgb, var(--sp-c) 22%, transparent), color-mix(in srgb, var(--sp-c) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp-c) 25%, transparent);
}
.sp-tile svg { color: var(--sp-c); }
.sp-tile.text-white { background: linear-gradient(135deg, var(--sp-c), color-mix(in srgb, var(--sp-c) 60%, rgb(var(--accent)))); box-shadow: none; }
.sp-tile.text-white svg { color: #fff; }
.sp-arrow {
  display: inline-flex; color: rgb(var(--muted)); transition: transform .18s ease, color .18s ease;
}
.group:hover .sp-arrow { transform: translateX(3px); color: var(--sp-color, rgb(var(--brand))); }
.sp-search {
  display: flex; align-items: center; gap: .6rem; max-width: 28rem; height: 2.9rem; padding: 0 1rem; border-radius: .9rem;
  background: rgb(var(--surface)); box-shadow: 0 10px 30px -12px rgb(15 23 42 / 0.35);
}
.sp-search input { flex: 1; min-width: 0; background: transparent; outline: none; font-size: 14px; color: rgb(var(--text)); }
.sp-search-card { max-width: none; border: 1px solid rgb(var(--line)); box-shadow: 0 1px 2px rgb(15 23 42 / 0.04); }
.sp-pill {
  display: inline-flex; align-items: center; gap: .4rem; height: 1.6rem; padding: 0 .65rem; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--sp-tone); background: color-mix(in srgb, var(--sp-tone) 12%, transparent);
}
.sp-dot { width: .45rem; height: .45rem; border-radius: 999px; background: currentColor; }
.sp-tone-open { --sp-tone: rgb(var(--brand)); }
.sp-tone-doing { --sp-tone: rgb(var(--warn)); }
.sp-tone-done { --sp-tone: rgb(var(--ok)); }
.sp-tone-cancelled { --sp-tone: rgb(var(--muted)); }
.sp-tone-team { --sp-tone: rgb(var(--brand)); height: 1.25rem; font-size: 10.5px; padding: 0 .5rem; }
.sp-row { border-left: 3px solid var(--sp-tone); }
.sp-segment { display: inline-flex; padding: .2rem; border-radius: .8rem; background: rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.25); backdrop-filter: blur(6px); }
.sp-segment button { height: 1.8rem; padding: 0 .8rem; border-radius: .6rem; font-size: 13px; font-weight: 600; color: rgb(255 255 255 / 0.85); }
.sp-segment button span { opacity: .7; font-weight: 500; margin-left: .2rem; }
.sp-segment button.is-on { background: #fff; color: rgb(15 23 42); box-shadow: 0 1px 3px rgb(15 23 42 / 0.2); }
.sp-segment-sm { background: rgb(var(--surface-2)); border-color: rgb(var(--line)); }
.sp-segment-sm button { height: 1.6rem; padding: 0 .55rem; font-size: 11px; font-weight: 700; color: rgb(var(--muted)); }
.sp-segment-sm button.is-on { background: rgb(var(--surface)); color: rgb(var(--text)); }
.sp-glass { background: rgb(var(--surface) / 0.82); backdrop-filter: saturate(1.4) blur(12px); }
.sp-nav {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.1rem; padding: 0 .85rem; border-radius: .7rem;
  font-size: 13px; font-weight: 600; color: rgb(var(--muted)); transition: background .15s, color .15s;
}
.sp-nav:hover { color: rgb(var(--text)); background: rgb(var(--surface-2)); }
.sp-nav.is-on { color: rgb(var(--brand)); background: rgb(var(--brand) / 0.1); }
.sp-count { min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem; border-radius: 999px; font-size: 11px; line-height: 1.2rem; text-align: center; color: #fff; background: rgb(var(--brand)); }
.sp-step {
  width: 1.9rem; height: 1.9rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  color: rgb(var(--muted)); background: rgb(var(--surface-2)); border: 1px solid rgb(var(--line));
}
.sp-step-on { color: #fff; background: rgb(var(--brand)); border-color: transparent; }
.sp-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: rgb(var(--muted)); margin-bottom: .4rem; }
.sp-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.sp-progress-step span { display: block; height: .4rem; border-radius: 999px; background: rgb(var(--surface-2)); }
.sp-progress-step.is-on span { background: linear-gradient(90deg, rgb(var(--brand)), rgb(var(--accent))); }
.sp-progress-step p { margin-top: .4rem; font-size: 11px; font-weight: 600; color: rgb(var(--muted)); }
.sp-progress-step.is-on p { color: rgb(var(--text)); }
.sp-bubble { padding: .65rem .9rem; border-radius: 1rem; border-top-left-radius: .35rem; background: rgb(var(--surface-2)); border: 1px solid rgb(var(--line)); }
.sp-bubble-team { background: rgb(var(--brand) / 0.07); border-color: rgb(var(--brand) / 0.2); }
.sp-bubble-mine { border-top-left-radius: 1rem; border-top-right-radius: .35rem; background: rgb(var(--brand) / 0.12); border-color: rgb(var(--brand) / 0.25); }
@media (prefers-reduced-motion: reduce) { .sp-lift, .sp-arrow { transition: none; } .sp-lift:hover { transform: none; } }

/* GIFs (GIPHY) in comments and descriptions: shown as the GIF, never too big. */
.gif-embed { display: inline-block; margin: .35rem 0; border-radius: .6rem; overflow: hidden; line-height: 0; }
.gif-embed img, .prose-doc img[src*="giphy.com"], .prose-mini img[src*="giphy.com"] { max-height: 220px; max-width: min(100%, 360px); width: auto; border-radius: .6rem; }

/* Comments use the description's Markdown styles, a little tighter. */
.prose-comment > :first-child { margin-top: 0; }
.prose-comment > :last-child { margin-bottom: 0; }
.prose-comment p { margin: 0 0 .4rem; }
.prose-comment h1, .prose-comment h2, .prose-comment h3 { font-size: 14px; margin: .5rem 0 .25rem; }
.prose-comment { font-size: 13px; line-height: 1.6; }
.prose-comment ul, .prose-comment ol, .prose-comment pre, .prose-comment blockquote, .prose-comment table { margin: 0 0 .4rem; }

/* Pages: reading a page. The text sits on a "paper" with a comfortable line length, larger type and more air;
   a bold line on its own (a heading typed as **bold**) reads as a subheading. */
.page-paper {
  background: rgb(var(--surface)); border: 1px solid rgb(var(--line)); border-radius: 1.1rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 12px 32px -18px rgb(15 23 42 / 0.18);
  padding: 1.5rem 1.25rem 2rem; max-width: 52rem; margin: 0 auto;
}
@media (min-width: 640px) { .page-paper { padding: 2.75rem 3.5rem 3.25rem; } }
.page-paper-head { padding-bottom: 1.5rem; margin-bottom: 2rem; border-bottom: 1px solid rgb(var(--line)); }
.page-emoji {
  width: 3rem; height: 3rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.6rem; border-radius: 0.9rem;
  background: color-mix(in srgb, var(--page-color) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--page-color) 22%, transparent);
}
.page-title { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1.2; font-weight: 750; letter-spacing: -0.02em; overflow-wrap: anywhere; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.prose-page { font-size: 16.5px; line-height: 1.75; color: rgb(var(--text) / 0.9); max-width: 44rem; }
.prose-page p, .prose-page ul, .prose-page ol, .prose-page pre, .prose-page table, .prose-page blockquote { margin: 0 0 1.25em; }
.prose-page h1, .prose-page h2, .prose-page h3, .prose-page h4 { color: rgb(var(--text)); letter-spacing: -0.01em; scroll-margin-top: 1.5rem; }
.prose-page h1 { font-size: 1.75rem; margin: 2.2em 0 .6em; }
.prose-page h2 { font-size: 1.4rem; margin: 2em 0 .6em; padding-bottom: .35em; }
.prose-page h3 { font-size: 1.15rem; margin: 1.8em 0 .5em; }
/* A paragraph that is only bold text (or starts with a bold line) stands out like a subheading. */
.prose-page p > strong:only-child, .prose-page p > strong:first-child:has(+ br) {
  display: block; font-size: 1.12rem; line-height: 1.4; font-weight: 700; color: rgb(var(--text)); margin: 1.6em 0 .35em;
}
.prose-page p > strong:first-child:has(+ br) + br { display: none; }
.prose-page > p:first-child > strong:only-child, .prose-page > p:first-child > strong:first-child:has(+ br) { margin-top: 0; }
.prose-page strong { color: rgb(var(--text)); font-weight: 650; }
.prose-page a { text-decoration: underline; text-decoration-color: rgb(var(--brand) / 0.35); text-underline-offset: 3px; }
.prose-page a:hover { text-decoration-color: rgb(var(--brand)); }
.prose-page li { margin: .35em 0; }
.prose-page li::marker { color: rgb(var(--muted)); }
.prose-page blockquote {
  border-left: 3px solid rgb(var(--brand) / 0.55); background: rgb(var(--brand) / 0.05); color: rgb(var(--text) / 0.85);
  padding: .8em 1.1em; border-radius: 0 .6rem .6rem 0;
}
.prose-page blockquote > :last-child { margin-bottom: 0; }
.prose-page hr { border: 0; border-top: 1px solid rgb(var(--line)); margin: 2.5em 0; }
.prose-page img { border-radius: .7rem; border: 1px solid rgb(var(--line)); }
.prose-page pre { font-size: 13.5px; border-radius: .7rem; }
.prose-page code { font-size: .86em; }
.prose-page table { font-size: 14px; }
.page-child {
  display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .75rem 1rem; border-radius: .8rem;
  border: 1px solid rgb(var(--line)); background: rgb(var(--surface-2) / 0.5); transition: border-color .15s, background .15s;
}
.page-child:hover { border-color: rgb(var(--brand) / 0.45); background: rgb(var(--surface)); }
.page-toc { display: flex; flex-direction: column; gap: .15rem; border-left: 1px solid rgb(var(--line)); }
.page-toc a { font-size: 12.5px; line-height: 1.35; color: rgb(var(--muted)); padding: .25rem .75rem; margin-left: -1px; border-left: 2px solid transparent; }
.page-toc a:hover { color: rgb(var(--text)); }
.page-toc a.level-3 { padding-left: 1.5rem; }
.page-toc a.is-on { color: rgb(var(--brand)); border-left-color: rgb(var(--brand)); font-weight: 600; }
.page-reading { background: rgb(var(--bg)); scroll-behavior: smooth; }

/* A comment reached from a quote or a reply count: a short highlight, so the eye finds it. */
@keyframes comment-flash { 0%, 30% { background: rgb(var(--brand) / 0.14); } 100% { background: transparent; } }
.comment-flash { animation: comment-flash 1.6s ease-out; }

/* People pickers: the chosen person's avatar at the left of the field (see peopleAttrs in ui.js). */
.select[data-people] { padding-left: 2.1rem; background-image: var(--who, none), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23838ba0'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%23838ba0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: left 0.55rem center, right 0.5rem center; background-size: 1.25rem, 1rem; }
.select[data-people="everyone"] { padding-left: 0.75rem; }
.select[data-people="everyone"][data-chosen] { padding-left: 2.1rem; }
/* Type and project pickers: the chosen type's icon or project's colour at the left (see leadAttrs in widgets/combo.js). */
.select[data-lead] { padding-left: 2.1rem; background-image: var(--lead, none), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23838ba0'%3E%3Cpath d='M4.5 6.5L8 10l3.5-3.5' stroke='%23838ba0' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: left 0.6rem center, right 0.5rem center; background-size: 1.1rem, 1rem; }

/* Emoji (widgets/emoji.js): Google's animated ones sit in the text like the characters they replace; a comment that
   is only one to three emoji is shown big. */
.emoji-anim, .prose-doc img.emoji-anim { border-radius: 0; display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin: 0 0.03em; }
.reaction-emoji .emoji-anim { width: 1.25em; height: 1.25em; vertical-align: -0.25em; margin: 0; }
.prose-doc.emoji-jumbo { font-size: 2.25rem; line-height: 1.25; }
.emoji-jumbo .emoji-anim { width: 1.15em; height: 1.15em; vertical-align: -0.15em; }
