/* ofork-components.css · ofork design system v1 · 2026-11-08
   Class-based components built only on ofork-tokens.css (load that first).
   Opt a page in with <html class="o-page">. Every class starts with "o-", and
   component-local variables start with "--_", so this file can sit next to
   older CSS in either repo. No literal colours: every colour is a token.
   Shared by ofork.dev and the ofork rooms app. */

/* ================================================================= base */
.o-page {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--o-bg);
  color: var(--o-ink);
}
/* iOS: follow Dynamic Type, so 1rem is the reader's body size (17 px by default). */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  .o-page { font: -apple-system-body; }
}
.o-page body {
  margin: 0;
  background: var(--o-bg);
  color: var(--o-ink);
  font-family: var(--o-font-text);
  font-size: var(--o-text-body);
  line-height: var(--o-leading-body);
  letter-spacing: var(--o-tracking-text);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
.o-page *, .o-page *::before, .o-page *::after { box-sizing: border-box; }
.o-page :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul) { margin: 0; }
.o-page :where(ol, ul) { padding: 0; list-style: none; }   /* add role="list" where list semantics matter (Safari) */
.o-page :where(a) { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.o-page :where(img, svg, video) { display: block; max-width: 100%; }
.o-page :where(button, input, textarea, select) { font: inherit; color: inherit; letter-spacing: inherit; }
.o-page :where(button) { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.o-page :where(h1, h2, h3) { text-wrap: balance; }
.o-page :focus-visible { outline: var(--o-focus-width) solid var(--o-focus); outline-offset: 2px; }
.o-page ::selection { background: var(--o-accent); color: var(--o-on-accent); }
.o-page [hidden] { display: none !important; }

/* ============================================================ utilities */
.o-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.o-mono { font-family: var(--o-font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.o-meta { font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.35; font-variant-numeric: tabular-nums; letter-spacing: 0; color: var(--o-ink-2); }
.o-meta b, .o-meta strong { color: var(--o-ink); font-weight: var(--o-weight-bold); }
.o-muted { color: var(--o-ink-2); }

.o-display  { font-size: var(--o-text-display); font-weight: var(--o-weight-heavy); line-height: var(--o-leading-tight); letter-spacing: var(--o-tracking-display); }
.o-title-1  { font-size: var(--o-text-title-1); font-weight: var(--o-weight-heavy); line-height: var(--o-leading-tight); letter-spacing: -0.04em; }
.o-title-2  { font-size: var(--o-text-title-2); font-weight: var(--o-weight-heavy); line-height: 1.1; letter-spacing: -0.03em; }
.o-title-3  { font-size: var(--o-text-title-3); font-weight: var(--o-weight-bold); line-height: 1.2; letter-spacing: var(--o-tracking-title); }
.o-headline { font-size: var(--o-text-headline); font-weight: var(--o-weight-bold); line-height: var(--o-leading-snug); letter-spacing: -0.012em; }
.o-callout  { font-size: var(--o-text-callout); line-height: 1.4; }
.o-micro    { font-family: var(--o-font-mono); font-size: var(--o-text-micro); font-weight: var(--o-weight-bold); letter-spacing: var(--o-tracking-caps); text-transform: uppercase; }

.o-stack   { display: flex; flex-direction: column; gap: var(--_gap, var(--o-space-3)); }
.o-row     { display: flex; align-items: center; gap: var(--_gap, var(--o-space-2)); min-width: 0; }
.o-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--_gap, var(--o-space-2)); }
.o-grow    { flex: 1 1 auto; min-width: 0; }
.o-end     { margin-left: auto; }
.o-pad     { padding-inline: var(--o-gutter); }
.o-section { padding-top: var(--o-space-6); }
.o-divider { height: 1px; margin: 0; border: 0; background: var(--o-line); }
.o-hscroll {
  display: flex; gap: var(--o-space-3); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--o-gutter); padding-inline: var(--o-gutter);
  scrollbar-width: none;
}
.o-hscroll::-webkit-scrollbar { display: none; }
.o-hscroll > * { flex: none; scroll-snap-align: start; }
.o-chiprow { gap: var(--o-space-2); padding-block: var(--o-space-3); }
.o-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.o-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ================================================================ icons
   Inline SVG, 24 px grid, 1.8 stroke, round caps. <svg class="o-icon"><use href="#o-i-home"/></svg> */
.o-icon { display: inline-block; flex: none; width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.o-icon--sm { width: 1.125rem; height: 1.125rem; stroke-width: 2; }
.o-icon--xs { width: 0.9375rem; height: 0.9375rem; stroke-width: 2.3; }

/* ================================================================= logo */
.o-logo { display: inline-flex; align-items: center; min-height: var(--o-tap); color: var(--o-ink); font-size: min(1.5rem, 26px); font-weight: var(--o-weight-heavy); line-height: 1; letter-spacing: -0.055em; white-space: nowrap; }
.o-logo__cursor { width: 0.42em; height: 0.86em; margin-left: 0.12em; border-radius: 2px; background: var(--o-accent); box-shadow: inset 0 0 0 1px var(--o-fill-edge); transform: translateY(0.04em); }
.o-logo__app { margin-left: 0.45rem; font-family: var(--o-font-mono); font-size: min(0.9375rem, 16px); font-weight: var(--o-weight-medium); letter-spacing: 0; color: var(--o-ink-2); }
.o-logo--sm { font-size: min(1.25rem, 22px); }

/* ============================================================== top bar */
.o-topbar {
  position: sticky; top: 0; z-index: var(--o-z-bar);
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--o-space-1);
  min-height: calc(var(--o-bar) + var(--o-safe-top));
  padding: var(--o-safe-top) var(--o-space-2) 0 var(--o-gutter);
  background: var(--o-bg); border-bottom: 1px solid var(--o-line);
}
.o-topbar__start { display: flex; align-items: center; min-width: 0; margin-right: auto; }
.o-topbar__end { display: flex; align-items: center; gap: var(--o-space-1); }
.o-topbar__end .o-btn { white-space: nowrap; padding-inline: 0.75rem; }
.o-topbar__end .o-btn--primary { padding-inline: 1rem; }
.o-topbar__end .o-btn--primary { margin-left: var(--o-space-1); }
/* pushed screen: back · title · menu */
.o-topbar--nav { display: grid; grid-template-columns: var(--o-tap) minmax(0, 1fr) var(--o-tap); padding-inline: var(--o-space-1); }
.o-topbar__title { min-width: 0; text-align: center; line-height: 1.2; }
.o-topbar__title b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--o-text-headline); font-weight: var(--o-weight-bold); }
.o-topbar__title .o-status { justify-content: center; }
.o-topbar--flow { grid-template-columns: minmax(var(--o-tap), auto) minmax(0, 1fr) minmax(var(--o-tap), auto); }
.o-topbar__step { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); white-space: nowrap; padding-right: var(--o-space-2); }

.o-largetitle { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--o-space-1) var(--o-space-3); padding: var(--o-space-3) var(--o-gutter) 0; }
.o-largetitle h1 { font-size: var(--o-text-title-1); font-weight: var(--o-weight-heavy); line-height: var(--o-leading-tight); letter-spacing: -0.04em; }

/* ============================================================= tab bars */
.o-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--o-z-bar);
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  padding-bottom: var(--o-safe-bottom);
  background: var(--o-bg); border-top: 1px solid var(--o-line);
}
.o-tabbar__item {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: var(--o-tabbar); padding: var(--o-space-1) 2px;
  color: var(--o-ink-2); font-size: 0.6875rem; font-weight: var(--o-weight-semibold); line-height: 1.1; text-align: center;
}
.o-tabbar__item[aria-current="page"] { color: var(--o-ink); }
.o-tabbar__item[aria-current="page"] .o-icon { stroke-width: 2.4; }
.o-tabbar__create { display: grid; place-items: center; width: 3rem; height: 2rem; border-radius: var(--o-radius-md); background: var(--o-accent); color: var(--o-on-accent); box-shadow: inset 0 0 0 1px var(--o-fill-edge); }
.o-tabbar__create .o-icon { stroke-width: 2.4; }
.o-tabbar .o-avatar { --_av: 1.625rem; }
.o-tabbar__item[aria-current="page"] .o-avatar { box-shadow: 0 0 0 2px var(--o-bg), 0 0 0 3.5px var(--o-ink); }
.o-tabbar__item .o-badge { position: absolute; top: 0.3rem; left: calc(50% + 0.45rem); }
.o-has-tabbar { padding-bottom: calc(var(--o-tabbar) + var(--o-safe-bottom) + var(--o-space-6)); }

/* count badge: real counts only, never "99+" filler */
.o-badge { display: inline-grid; place-items: center; min-width: 1.125rem; height: 1.125rem; padding: 0 0.3rem; border-radius: var(--o-radius-full); background: var(--o-accent-mark); color: var(--o-on-accent-mark); box-shadow: 0 0 0 2px var(--o-bg); font-family: var(--o-font-mono); font-size: 0.6875rem; font-weight: var(--o-weight-bold); line-height: 1; font-variant-numeric: tabular-nums; }

/* ============================================================== buttons */
.o-btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--o-space-2);
  min-height: var(--o-tap); padding: 0.5rem 1rem;
  border: 1px solid transparent; border-radius: var(--o-radius-md);
  background: transparent; color: var(--o-ink);
  font-family: var(--o-font-text); font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); line-height: 1.2; letter-spacing: -0.01em;
  text-align: center; text-wrap: balance; cursor: pointer; -webkit-user-select: none; user-select: none;
  transition: transform var(--o-dur-press) var(--o-ease-out);
}
.o-btn::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; background: var(--o-press); opacity: 0; transition: opacity var(--o-dur-press) var(--o-ease-out); pointer-events: none; }
.o-btn:active { transform: scale(0.97); }
.o-btn:active::before { opacity: 1; }
@media (hover: hover) { .o-btn:hover::before { opacity: 0.5; } }
.o-btn .o-icon { width: 1.125rem; height: 1.125rem; stroke-width: 2; }

.o-btn--primary { background: var(--o-accent); color: var(--o-on-accent); box-shadow: inset 0 0 0 1px var(--o-fill-edge); }
.o-btn--secondary { border-color: var(--o-control); }
.o-btn--quiet { padding-inline: 0.625rem; }
.o-btn--muted { color: var(--o-ink-2); font-weight: var(--o-weight-medium); }
.o-btn--destructive { background: var(--o-danger-fill); color: var(--o-on-danger); }
.o-btn--game { background: var(--o-game); color: var(--o-game-on); box-shadow: inset 0 0 0 1px var(--o-fill-edge); }
.o-btn--ink { background: var(--o-ink); color: var(--o-bg); }

.o-btn--sm { min-height: 2.25rem; padding: 0.375rem 0.75rem; font-size: 0.875rem; }
.o-btn--sm::after { content: ""; position: absolute; inset: calc((var(--o-tap) - 100%) / -2) 0; }  /* 44 px hit area */
.o-btn--lg { min-height: max(52px, 3.25rem); padding-inline: 1.25rem; font-size: var(--o-text-headline); }
.o-btn--block { display: flex; width: 100%; }
.o-btn--icon { width: var(--o-tap); padding: 0; }
.o-btn--icon.o-btn--sm { width: 2.25rem; }

.o-btn:disabled, .o-btn[aria-disabled="true"] { background: var(--o-surface-2); color: var(--o-ink-disabled); border-color: transparent; box-shadow: none; cursor: not-allowed; transform: none; }
.o-btn:disabled::before, .o-btn[aria-disabled="true"]::before { display: none; }
.o-btn--quiet:disabled, .o-btn--quiet[aria-disabled="true"] { background: transparent; }

.o-iconbtn { position: relative; display: inline-grid; place-items: center; flex: none; width: var(--o-tap); height: var(--o-tap); border-radius: var(--o-radius-md); color: var(--o-ink); }
.o-iconbtn:active { background: var(--o-press); }

.o-btnrow { display: flex; flex-wrap: wrap; gap: var(--o-space-2); }
.o-btnrow > .o-btn { flex: 1 1 auto; }

.o-spinner { width: 1rem; height: 1rem; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: o-spin 0.7s linear infinite; }
@keyframes o-spin { to { transform: rotate(360deg); } }

.o-link { font-weight: var(--o-weight-semibold); text-decoration: underline; text-decoration-color: var(--o-control); text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* =============================================================== fields */
.o-field { display: grid; gap: var(--o-space-2); }
.o-label { font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); color: var(--o-ink); }
.o-help { font-size: 0.875rem; line-height: 1.4; color: var(--o-ink-2); }
.o-error { display: flex; align-items: flex-start; gap: 6px; font-size: 0.875rem; font-weight: var(--o-weight-semibold); line-height: 1.4; color: var(--o-danger); }
.o-input, .o-textarea {
  width: 100%; min-height: var(--o-tap); padding: 0.625rem 0.875rem;
  border: 1px solid var(--o-control); border-radius: var(--o-radius-md);
  background: var(--o-bg); color: var(--o-ink);
  font-size: max(16px, 1rem); line-height: 1.4;   /* 16 px floor stops iOS zoom on focus */
}
.o-input::placeholder, .o-textarea::placeholder { color: var(--o-ink-3); opacity: 1; }
.o-input:focus-visible, .o-textarea:focus-visible { border-color: var(--o-ink); outline-offset: 1px; }
.o-input[aria-invalid="true"], .o-textarea[aria-invalid="true"] { border-color: var(--o-danger); box-shadow: inset 0 0 0 1px var(--o-danger); }
.o-textarea { min-height: 6.5rem; resize: vertical; }
.o-count { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); text-align: right; }
.o-search { position: relative; display: block; }
.o-search .o-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--o-ink-2); pointer-events: none; }
.o-search .o-input { padding-left: 2.6rem; background: var(--o-surface); border-color: transparent; }

/* checkbox, radio, switch: native inputs, restyled */
.o-check, .o-radio, .o-switch { -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer; }
.o-check, .o-radio { display: inline-grid; place-content: center; width: 1.375rem; height: 1.375rem; background: transparent; box-shadow: inset 0 0 0 1.5px var(--o-control); }
.o-check { border-radius: 6px; }
.o-radio { border-radius: 50%; }
.o-check::after { content: ""; width: 0.35rem; height: 0.7rem; margin-top: -0.15rem; border: solid var(--o-on-accent-mark); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); }
.o-check:checked { background: var(--o-accent-mark); box-shadow: none; }
.o-check:checked::after { transform: rotate(45deg) scale(1); }
.o-radio::after { content: ""; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--o-accent-mark); transform: scale(0); }
.o-radio:checked { box-shadow: inset 0 0 0 2px var(--o-accent-mark); }
.o-radio:checked::after { transform: scale(1); }
.o-switch { position: relative; width: 3.25rem; height: 2rem; border-radius: var(--o-radius-full); background: var(--o-surface-2); box-shadow: inset 0 0 0 1.5px var(--o-control); transition: background-color var(--o-dur-quick) var(--o-ease-out); }
.o-switch::after { content: ""; position: absolute; top: 50%; left: 0.4375rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--o-ink-2); transform: translateY(-50%); transition: transform var(--o-dur-quick) var(--o-ease-out), width var(--o-dur-quick), height var(--o-dur-quick); }
.o-switch:checked { background: var(--o-accent-mark); box-shadow: none; }
.o-switch:checked::after { width: 1.5rem; height: 1.5rem; background: var(--o-on-accent-mark); transform: translate(1.0625rem, -50%); }
.o-choice { display: flex; align-items: center; gap: var(--o-space-3); min-height: 3.25rem; padding-block: var(--o-space-2); border-bottom: 1px solid var(--o-line); cursor: pointer; }
.o-choice__text { flex: 1 1 auto; min-width: 0; }
.o-choice__text small { display: block; margin-top: 2px; font-size: 0.875rem; line-height: 1.35; color: var(--o-ink-2); }

/* segmented control (appearance: Light · Dark · System) */
.o-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; border-radius: 10px; background: var(--o-surface-2); }
.o-segmented__opt { position: relative; display: grid; place-items: center; min-height: 2.5rem; padding: 0 0.875rem; border-radius: 7px; color: var(--o-ink-2); font-size: 0.875rem; font-weight: var(--o-weight-semibold); cursor: pointer; }
.o-segmented__opt input { position: absolute; opacity: 0; pointer-events: none; }
.o-segmented__opt:has(input:checked) { background: var(--o-raised); color: var(--o-ink); box-shadow: inset 0 0 0 1px var(--o-control), var(--o-shadow-1); }
.o-segmented__opt:has(input:focus-visible) { outline: var(--o-focus-width) solid var(--o-focus); outline-offset: 1px; }

/* accent swatches (appearance) */
.o-swatches { display: flex; flex-wrap: wrap; gap: var(--o-space-2); }
.o-swatch { position: relative; display: grid; place-items: center; width: var(--o-tap); height: var(--o-tap); border-radius: 50%; cursor: pointer; }
.o-swatch i { width: 2rem; height: 2rem; border-radius: 50%; background: var(--_c); box-shadow: inset 0 0 0 1px var(--o-fill-edge); }
.o-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.o-swatch:has(input:checked) { box-shadow: inset 0 0 0 2px var(--o-ink); }

/* ======================================================== chips and tags */
.o-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  min-height: 2.25rem; padding: 0.375rem 0.875rem; border: 1px solid transparent; border-radius: var(--o-radius-md);
  background: var(--o-surface); color: var(--o-ink);
  font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); line-height: 1.2; white-space: nowrap;
}
.o-chip::after { content: ""; position: absolute; inset: calc((var(--o-tap) - 100%) / -2) 0; }
.o-chip[aria-pressed="true"], .o-chip[aria-current] { background: var(--o-ink); color: var(--o-bg); }
.o-chip--outline { border-color: var(--o-control); background: transparent; font-weight: var(--o-weight-medium); white-space: normal; text-align: left; }

.o-tag {
  display: inline-flex; align-items: center; gap: 4px; min-height: 1.375rem; padding: 0.125rem 0.4375rem;
  border-radius: var(--o-radius-xs); background: var(--o-surface-2); color: var(--o-ink);
  font-family: var(--o-font-mono); font-size: var(--o-text-micro); font-weight: var(--o-weight-bold); line-height: 1.2;
  letter-spacing: var(--o-tracking-caps); text-transform: uppercase; white-space: nowrap;
}
.o-tag .o-icon { width: 0.8125rem; height: 0.8125rem; stroke-width: 2.6; }
.o-tag--plain { text-transform: none; letter-spacing: 0; font-weight: var(--o-weight-medium); font-size: 0.75rem; }
.o-tag--accent { background: var(--o-accent); color: var(--o-on-accent); box-shadow: inset 0 0 0 1px var(--o-fill-edge); }
.o-tag--ok { background: var(--o-ok-tint); color: var(--o-ok); }
.o-tag--warn { background: var(--o-warn-tint); color: var(--o-warn); }
.o-tag--danger { background: var(--o-danger-tint); color: var(--o-danger); }
.o-tag--ink { background: var(--o-ink); color: var(--o-bg); }
.o-tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--o-control); }
.o-tag--game { background: var(--o-game); color: var(--o-game-on); }
.o-tag--media { background: var(--o-media-chip); color: var(--o-on-media-chip); }

/* version chip: the game colour lives here */
.o-ver { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0.125rem 0.4375rem; border-radius: var(--o-radius-xs); background: var(--o-game); color: var(--o-game-on); font-family: var(--o-font-mono); font-size: var(--o-text-meta); font-weight: var(--o-weight-bold); line-height: 1.2; letter-spacing: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

.o-hashtags { display: flex; flex-wrap: wrap; column-gap: var(--o-space-3); font-family: var(--o-font-mono); font-size: var(--o-text-meta); }
.o-hashtags a { display: inline-flex; align-items: center; min-height: var(--o-tap); color: var(--o-ink-2); }

/* =============================================================== status */
.o-status { display: inline-flex; align-items: center; gap: 6px; color: var(--o-ink); font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.2; white-space: nowrap; }
.o-status::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--o-ink-3); }
.o-status--ready::before { background: var(--o-ok); }
.o-status--starting::before { background: var(--o-warn); animation: o-pulse 1.4s ease-in-out infinite; }
.o-status--asleep::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--o-ink-2); }
.o-status--working::before { background: var(--o-accent-mark); animation: o-pulse 1.4s ease-in-out infinite; }
.o-status--failed::before { background: var(--o-danger); }
.o-status--plain { font-family: var(--o-font-text); font-size: var(--o-text-callout); }
@keyframes o-pulse { 50% { opacity: 0.3; } }

/* =============================================================== avatar */
.o-avatar { display: inline-grid; place-items: center; flex: none; width: var(--_av, 2.25rem); height: var(--_av, 2.25rem); overflow: hidden; border-radius: 50%; background: var(--o-surface-2); color: var(--o-ink); font-size: calc(var(--_av, 2.25rem) * 0.42); font-weight: var(--o-weight-bold); line-height: 1; object-fit: cover; }
.o-avatar--xs { --_av: 1.25rem; }
.o-avatar--sm { --_av: 1.75rem; }
.o-avatar--lg { --_av: 2.5rem; }
.o-avatar--xl { --_av: 5.5rem; }
.o-avatars { display: flex; align-items: center; }
.o-avatars > * + * { margin-left: -0.5rem; }
.o-avatars > * { box-shadow: 0 0 0 2px var(--o-bg); }

/* ================================================================ media */
.o-media { position: relative; display: block; overflow: hidden; border-radius: var(--o-radius-lg); background: var(--o-surface-2); aspect-ratio: var(--_ratio, 16 / 9); }
.o-media > img { width: 100%; height: 100%; object-fit: cover; }
.o-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--o-media-frame); pointer-events: none; }
.o-media--4x3 { --_ratio: 4 / 3; }
.o-media--2x1 { --_ratio: 2 / 1; }
.o-media--1x1 { --_ratio: 1 / 1; }
.o-media--bleed { border-radius: 0; }
.o-media--asleep > img { filter: grayscale(0.85) brightness(0.62); }
.o-media__tl, .o-media__bl, .o-media__br, .o-media__tr { position: absolute; z-index: 1; display: flex; gap: 6px; }
.o-media__tl { left: 0.5rem; top: 0.5rem; }
.o-media__tr { right: 0.5rem; top: 0.5rem; }
.o-media__bl { left: 0.5rem; bottom: 0.5rem; }
.o-media__br { right: 0.5rem; bottom: 0.5rem; }
.o-media__note { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 0.625rem 0.75rem; background: var(--o-media-chip); color: var(--o-on-media-chip); font-family: var(--o-font-mono); font-size: var(--o-text-meta); }

/* ======================================================= section heads */
.o-sechead { display: flex; align-items: center; gap: var(--o-space-2) var(--o-space-3); flex-wrap: wrap; min-height: var(--o-tap); padding-inline: var(--o-gutter); margin-bottom: var(--o-space-2); }
.o-sechead__title { font-size: var(--o-text-title-3); font-weight: var(--o-weight-heavy); line-height: 1.15; letter-spacing: -0.03em; }
.o-sechead__end { margin-left: auto; display: flex; align-items: center; }

/* ==================================================== room tile (shelf) */
.o-tile { display: block; width: var(--_w, 15rem); color: inherit; }
.o-tile__title { margin-top: var(--o-space-2); font-size: var(--o-text-headline); font-weight: var(--o-weight-bold); line-height: 1.25; letter-spacing: -0.015em; }
.o-byline { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 4px; font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.3; color: var(--o-ink-2); }
.o-byline b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--o-weight-medium); color: var(--o-ink); }
.o-byline span { white-space: nowrap; }

/* ====================================================== room card (big) */
.o-roomcard { display: block; overflow: hidden; border-radius: var(--o-radius-lg); background: var(--o-game-tint); color: inherit; box-shadow: inset 0 0 0 1px var(--o-line); }
.o-roomcard .o-media { border-radius: 0; }
.o-roomcard__body { display: grid; gap: 6px; padding: var(--o-space-3) var(--o-space-4) var(--o-space-4); }
.o-roomcard__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--o-space-1) var(--o-space-3); }
.o-roomcard__title { min-width: 0; font-size: var(--o-text-title-2); font-weight: var(--o-weight-heavy); line-height: 1.08; letter-spacing: -0.035em; }
.o-roomcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0.25rem; font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.35; color: var(--o-ink-2); }
.o-roomcard__meta .o-status { color: var(--o-ink); }
.o-roomcard__meta > :not(:last-child)::after { content: "·"; margin-left: 0.5ch; }
.o-roomcard__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.o-roomcard--asleep .o-roomcard__title { color: var(--o-ink-2); }

/* compact room row */
.o-roomrow { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--o-space-3); align-items: center; padding-block: var(--o-space-3); border-bottom: 1px solid var(--o-line); color: inherit; }
.o-roomrow .o-media { border-radius: var(--o-radius-sm); }
.o-roomrow__title { font-size: var(--o-text-headline); font-weight: var(--o-weight-bold); line-height: 1.2; }

/* slots used ("2 of 3 rooms used") */
.o-slots { display: inline-flex; gap: 3px; }
.o-slots i { width: 0.75rem; height: 1.125rem; border-radius: 2px; background: var(--o-accent-mark); }
.o-slots i.is-free { background: transparent; box-shadow: inset 0 0 0 1.5px var(--o-control); }

/* =========================================================== weekly theme */
.o-theme { display: flex; align-items: center; gap: var(--o-space-3); min-height: 4rem; padding: var(--o-space-3) var(--o-space-3) var(--o-space-3) var(--o-space-3); border: 1px solid var(--o-line); border-radius: var(--o-radius-lg); color: inherit; }
.o-theme__mark { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; border-radius: var(--o-radius-md); background: var(--o-game); color: var(--o-game-on); }
.o-theme__text { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.o-theme__title { font-size: var(--o-text-headline); font-weight: var(--o-weight-heavy); line-height: 1.2; letter-spacing: -0.02em; }
.o-theme > .o-icon:last-child { color: var(--o-ink-2); }

/* =================================================== room page head, lists */
.o-roomhead { display: grid; gap: var(--o-space-3); padding: var(--o-space-4) var(--o-gutter) 0; }
.o-roomhead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--o-space-3); font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-roomhead__meta .o-btn { margin-left: auto; }
.o-cardlist { display: grid; gap: var(--o-space-4); padding: var(--o-space-4) var(--o-gutter) 0; }

/* =================================================================== feed */
.o-feed { display: block; }
.o-feed__day { display: flex; align-items: baseline; gap: var(--o-space-2); padding: var(--o-space-5) var(--o-gutter) var(--o-space-1); font-family: var(--o-font-mono); font-size: var(--o-text-meta); font-weight: var(--o-weight-bold); }
.o-feed__day span { font-weight: var(--o-weight-regular); color: var(--o-ink-2); }

/* ======================================================= release post card */
.o-post { padding-block: var(--o-space-4); border-bottom: 1px solid var(--o-line); }
.o-post > * { margin-inline: var(--o-gutter); }
.o-post__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--o-space-3); align-items: center; }
.o-post__who { min-width: 0; line-height: 1.25; }
.o-post__who b { font-size: var(--o-text-callout); font-weight: var(--o-weight-bold); }
.o-post__who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-post__time { align-self: start; padding-top: 2px; font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); white-space: nowrap; }
.o-post__what { margin-top: var(--o-space-2); font-size: var(--o-text-callout); color: var(--o-ink-2); }
.o-post__what b { color: var(--o-ink); font-weight: var(--o-weight-bold); }
.o-post .o-media { margin-top: var(--o-space-3); }
.o-post__title { display: flex; align-items: baseline; gap: var(--o-space-2); margin-top: var(--o-space-3); font-size: var(--o-text-title-3); font-weight: var(--o-weight-heavy); line-height: 1.2; letter-spacing: -0.025em; }
.o-post__title .o-ver { position: relative; top: -0.15em; }
.o-post__text { margin-top: var(--o-space-1); color: var(--o-ink); }
.o-changes { margin-top: var(--o-space-2); }
.o-changes li { display: grid; grid-template-columns: 1.375rem minmax(0, 1fr); padding: 3px 0; line-height: 1.4; }
.o-changes li::before { content: "+"; font-family: var(--o-font-mono); font-weight: var(--o-weight-bold); color: var(--o-accent-mark); }
.o-shots { display: grid; grid-template-columns: 1fr 1fr; gap: var(--o-space-2); margin-top: var(--o-space-3); }
.o-shots .o-media { margin: 0; --_ratio: 4 / 3; border-radius: var(--o-radius-md); }
.o-credit { display: flex; align-items: center; gap: var(--o-space-2); margin-top: var(--o-space-3); font-size: var(--o-text-callout); }
.o-credit a { font-weight: var(--o-weight-bold); }
.o-post__proof { display: flex; flex-wrap: wrap; align-items: center; gap: var(--o-space-2); margin-top: var(--o-space-3); }
.o-post__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--o-space-2); margin-top: var(--o-space-3); }
.o-post__counts { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--o-space-3); font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-post__counts a, .o-post__counts span { display: inline-flex; align-items: center; gap: 5px; min-height: var(--o-tap); }
.o-post--compact .o-post__body { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--o-space-3); margin-top: var(--o-space-3); }
.o-post--compact .o-post__body .o-media { margin: 0; --_ratio: 4 / 3; border-radius: var(--o-radius-md); }
.o-post--compact .o-post__title { margin-top: 0; font-size: var(--o-text-headline); }

/* "Drafted with AI" label (EU AI Act Art. 50) */
.o-ai { display: inline-flex; align-items: center; gap: var(--o-space-2); min-height: 1.875rem; padding: 0.25rem 0.625rem 0.25rem 0.375rem; border: 1px solid var(--o-control); border-radius: var(--o-radius-xs); font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.2; color: var(--o-ink); }
.o-ai b { padding: 2px 4px; border-radius: 2px; background: var(--o-ink); color: var(--o-bg); font-size: 0.625rem; letter-spacing: 0.04em; }

/* verified build receipt: proof first */
.o-receipt { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--o-line); border-radius: var(--o-radius-sm); background: var(--o-surface); font-family: var(--o-font-mono); font-size: var(--o-text-meta); line-height: 1.2; }
.o-receipt__stub { display: flex; align-items: center; gap: 4px; padding: 0.375rem 0.625rem; background: var(--o-accent); color: var(--o-on-accent); font-weight: var(--o-weight-bold); }
.o-receipt__stub .o-icon { width: 0.875rem; height: 0.875rem; stroke-width: 2.8; }
.o-receipt__body { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--o-space-2); padding: 0.375rem 0.625rem; color: var(--o-ink-2); border-left: 2px dashed var(--o-line); }
.o-receipt__body b { color: var(--o-ink); letter-spacing: 0.02em; }

/* creator line on a room page */
.o-creator { display: flex; align-items: center; gap: var(--o-space-3); min-height: var(--o-tap); color: inherit; }
.o-creator__text { display: grid; gap: 2px; min-width: 0; }
.o-creator__name { font-size: var(--o-text-callout); font-weight: var(--o-weight-bold); line-height: 1.25; }
.o-creator__handle { margin-left: 0.25rem; font-family: var(--o-font-mono); font-size: var(--o-text-meta); font-weight: var(--o-weight-regular); color: var(--o-ink-2); }
.o-signed { display: inline-flex; align-items: center; gap: 4px; font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-signed .o-icon { color: var(--o-ok); width: 0.9375rem; height: 0.9375rem; }

/* release timeline on a room page */
.o-timeline { position: relative; padding-left: 1.5rem; }
.o-timeline::before { content: ""; position: absolute; left: 0.3rem; top: 0.5rem; bottom: 0; width: 1px; background: var(--o-line); }
.o-timeline__node { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--o-space-2); padding-top: var(--o-space-4); font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-timeline__node::before { content: ""; position: absolute; left: -1.5rem; top: calc(var(--o-space-4) + 0.2rem); width: 0.6875rem; height: 0.6875rem; background: var(--o-accent-mark); }
.o-timeline__node b { color: var(--o-ink); font-size: 0.875rem; }

/* ============================================================== stats */
.o-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); border-block: 1px solid var(--o-line); }
.o-stat { padding: var(--o-space-3) 0 var(--o-space-3) var(--o-space-3); border-left: 1px solid var(--o-line); }
.o-stat:first-child { padding-left: 0; border-left: 0; }
.o-stat b { display: block; font-size: 1.75rem; font-weight: var(--o-weight-heavy); line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.o-stat span { display: block; margin-top: 4px; font-family: var(--o-font-mono); font-size: 0.75rem; line-height: 1.25; color: var(--o-ink-2); }

/* ==================================================================== meters */
.o-meter { position: relative; height: 0.5rem; overflow: hidden; border-radius: var(--o-radius-full); background: var(--o-surface-2); box-shadow: inset 0 0 0 1px var(--o-control); }
.o-meter > span { position: absolute; inset: 0 auto 0 0; width: calc(var(--_value, 0) * 100%); border-radius: inherit; background: var(--o-accent-mark); }
.o-blocks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; min-width: 0; }
.o-blocks i { height: 0.75rem; border-radius: 1px; background: transparent; box-shadow: inset 0 0 0 1px var(--o-control); }
.o-blocks i.is-ok { background: var(--o-ok); box-shadow: none; }
.o-blocks i.is-fail { background: var(--o-danger); box-shadow: none; }
.o-blocks i.is-on { background: var(--o-accent-mark); box-shadow: none; }

/* =============================================== conversation (Build / Chat) */
.o-convo { display: grid; gap: var(--o-space-5); padding: var(--o-space-4) var(--o-gutter); }
.o-msg { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.625rem; }
.o-msg__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--o-space-2); font-family: var(--o-font-mono); font-size: 0.75rem; color: var(--o-ink-2); }
.o-msg__meta b { font-family: var(--o-font-text); font-size: 0.875rem; font-weight: var(--o-weight-bold); color: var(--o-ink); }
.o-msg__text { margin-top: 2px; line-height: 1.45; }
.o-msg .o-result { margin-top: var(--o-space-2); }
.o-builder { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 6px; background: var(--o-surface-2); box-shadow: inset 0 0 0 1px var(--o-line); }
.o-builder::before { content: ""; width: 0.4375rem; height: 0.875rem; border-radius: 1px; background: var(--o-accent-mark); }
.o-event { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--o-space-2); padding: var(--o-space-2) var(--o-space-3); border-radius: var(--o-radius-md); background: var(--o-surface); font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-event b { color: var(--o-ink); }
.o-event .o-icon { color: var(--o-ok); }

/* ============================================================ result card
   One card per builder request, built from our own records.
   data-state: working | empty | failed | stale | ready | kept | built */
.o-result { --_tone: var(--o-ink-2); --_tint: var(--o-surface-2); overflow: hidden; border: 1px solid var(--o-line); border-radius: var(--o-radius-lg); background: var(--o-surface); }
.o-result__head { display: flex; align-items: center; gap: 0.625rem; min-height: 3rem; padding: 0.5rem 0.875rem; border-bottom: 1px solid var(--o-line); }
.o-result__state { display: grid; place-items: center; flex: none; width: 1.625rem; height: 1.625rem; border-radius: 6px; background: var(--_tint); color: var(--_tone); }
.o-result__state .o-icon { width: 1rem; height: 1rem; stroke-width: 2.6; }
.o-result__title { min-width: 0; font-size: var(--o-text-callout); font-weight: var(--o-weight-bold); line-height: 1.25; }
.o-result__time { margin-left: auto; padding-left: var(--o-space-2); font-family: var(--o-font-mono); font-size: 0.75rem; color: var(--o-ink-2); white-space: nowrap; }
.o-result__row { padding: 0.625rem 0.875rem; border-bottom: 1px solid var(--o-line); line-height: 1.4; }
.o-result__row:last-child { border-bottom: 0; }
.o-result__row small { display: block; margin-top: 2px; font-size: 0.875rem; color: var(--o-ink-2); }
.o-result__files { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-family: var(--o-font-mono); font-size: var(--o-text-meta); }
.o-result__files li { display: inline-flex; align-items: center; gap: 4px; min-height: 1.5rem; }
.o-result__files .o-icon { width: 1rem; height: 1rem; color: var(--o-ink-2); }
.o-result__checks { display: grid; grid-template-columns: auto minmax(3rem, 1fr) auto; gap: var(--o-space-3); align-items: center; font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); }
.o-result__checks .o-mono { font-size: var(--o-text-meta); font-weight: var(--o-weight-bold); color: var(--_tone); }
.o-result__actions { display: flex; flex-wrap: wrap; gap: var(--o-space-2); padding: 0.75rem 0.875rem 0.875rem; }
.o-result__actions .o-btn { flex: 1 1 auto; }
.o-result__note { font-size: 0.875rem; color: var(--o-ink-2); }
.o-result[data-state="working"] { --_tone: var(--o-accent-mark); --_tint: var(--o-accent-tint); }
.o-result[data-state="empty"]   { --_tone: var(--o-ink-2); --_tint: var(--o-surface-2); }
.o-result[data-state="failed"]  { --_tone: var(--o-danger); --_tint: var(--o-danger-tint); }
.o-result[data-state="stale"]   { --_tone: var(--o-warn); --_tint: var(--o-warn-tint); }
.o-result[data-state="ready"],
.o-result[data-state="kept"]    { --_tone: var(--o-ok); --_tint: var(--o-ok-tint); }
.o-result[data-state="built"] .o-result__head { background: var(--o-accent); color: var(--o-on-accent); border-bottom-color: var(--o-fill-edge); }
.o-result[data-state="built"] .o-result__time { color: var(--o-on-accent); }
.o-result[data-state="built"] .o-result__state { background: var(--o-on-accent); color: var(--o-accent); }

/* suggestions under a finished result ("Try next") */
.o-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: var(--o-space-2); }
.o-suggest > span { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }

/* ============================================================= game strip */
.o-gamestrip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--o-space-3); padding: var(--o-space-2) var(--o-gutter) var(--o-space-3); }
.o-gamestrip__info { display: flex; align-items: center; gap: var(--o-space-3); flex: 1 1 100%; min-width: 0; }
.o-gamestrip__info .o-media { width: 3.5rem; flex: none; --_ratio: 1 / 1; border-radius: var(--o-radius-sm); }
.o-gamestrip__ver { font-size: 1.375rem; font-weight: var(--o-weight-heavy); line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.o-gamestrip__actions { display: flex; flex: 1 1 14rem; gap: var(--o-space-2); }
.o-gamestrip__actions > .o-btn { flex: 1 1 0; padding-inline: 0.5rem; }

/* =============================================================== tabs */
.o-tabs { display: flex; gap: 2px; overflow-x: auto; padding-inline: var(--o-space-2); border-bottom: 1px solid var(--o-line); background: var(--o-bg); scrollbar-width: none; }
.o-tabs::-webkit-scrollbar { display: none; }
.o-tabs__tab { position: relative; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--o-tap); padding: 0 0.75rem; color: var(--o-ink-2); font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); line-height: 1; white-space: nowrap; }
.o-tabs--start .o-tabs__tab { flex-grow: 0; }
.o-tabs__tab[aria-selected="true"], .o-tabs__tab[aria-current="page"] { color: var(--o-ink); }
.o-tabs__tab[aria-selected="true"]::after, .o-tabs__tab[aria-current="page"]::after { content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--o-ink); }
.o-tabs__count { font-family: var(--o-font-mono); font-size: 0.75rem; font-weight: var(--o-weight-regular); }
.o-tabs--sticky { position: sticky; top: calc(var(--o-bar) + var(--o-safe-top)); z-index: var(--o-z-sticky); }

/* ============================================================ stepper */
.o-stepper { display: grid; gap: 6px; }
.o-stepper__bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.o-stepper__bars i { height: 4px; border-radius: 2px; background: var(--o-line); }
.o-stepper__bars i.is-done { background: var(--o-ink); }
.o-stepper__label { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }

/* ============================================================ stickers
   Earned from real events only. role="img" + aria-label on each. */
.o-sticker {
  --_fill: var(--o-accent); --_on: var(--o-on-accent);
  position: relative; display: inline-grid; place-content: center; flex: none;
  width: var(--_size, 4.25rem); height: var(--_size, 4.25rem); padding: 0.25rem;
  border-radius: 50%; background: var(--_fill); color: var(--_on); text-align: center;
  box-shadow: 0 0 0 3px var(--o-sticker-cut), 0 0 0 4px var(--o-fill-edge), var(--o-sticker-shadow);
  transform: rotate(var(--_tilt, -5deg));
}
.o-sticker b { display: block; font-size: calc(var(--_size, 4.25rem) * 0.3); font-weight: var(--o-weight-heavy); line-height: 0.95; letter-spacing: -0.04em; }
.o-sticker small { display: block; margin-top: 2px; font-size: calc(var(--_size, 4.25rem) * 0.15); font-weight: var(--o-weight-bold); line-height: 1.05; }
.o-sticker--square { border-radius: 22%; }
.o-sticker--ticket { width: auto; height: auto; min-height: 2.75rem; padding: 0.375rem 0.875rem; border-radius: 10px; display: inline-flex; align-items: center; gap: var(--o-space-2); }
.o-sticker--ticket b { font-size: 1rem; }
.o-sticker--ticket small { margin: 0; font-size: 0.75rem; }
.o-sticker--game { --_fill: var(--o-game); --_on: var(--o-game-on); }
.o-sticker--sm { --_size: 2.75rem; }
.o-sticker--locked { --_fill: transparent; --_on: var(--o-ink-2); box-shadow: none; transform: none; border: 1.5px dashed var(--o-control); }
.o-stickers { display: flex; flex-wrap: wrap; gap: var(--o-space-5) var(--o-space-3); padding: var(--o-space-2) 4px; }
.o-stickers figure { display: grid; justify-items: center; align-content: start; gap: var(--o-space-3); width: 4.5rem; text-align: center; }
.o-stickers figcaption { font-size: 0.75rem; line-height: 1.25; color: var(--o-ink-2); }

/* milestone progress */
.o-milestone { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--o-space-2) var(--o-space-4); align-items: center; padding: var(--o-space-3) var(--o-space-4); border: 1px solid var(--o-line); border-radius: var(--o-radius-lg); }
.o-milestone__title { font-size: var(--o-text-callout); font-weight: var(--o-weight-bold); }
.o-milestone .o-meter { margin-top: var(--o-space-2); }

/* ============================================================= comments */
.o-comment { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: var(--o-space-3); padding-block: var(--o-space-4) var(--o-space-1); border-bottom: 1px solid var(--o-line); }
.o-comment__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--o-space-2); font-size: var(--o-text-callout); line-height: 1.3; }
.o-comment__head b { font-weight: var(--o-weight-bold); }
.o-comment__head time { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-comment__body { margin-top: 4px; line-height: 1.45; overflow-wrap: anywhere; }
.o-comment__actions { display: flex; flex-wrap: wrap; margin-left: -0.625rem; }
.o-comment__actions .o-btn--end { margin-left: auto; }
.o-comment__note { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin-bottom: -4px; font-family: var(--o-font-mono); font-size: 0.75rem; color: var(--o-ink-2); }
.o-comment--pinned { margin-inline: calc(var(--o-gutter) * -1); padding-inline: var(--o-gutter); background: var(--o-surface); box-shadow: inset 3px 0 0 var(--o-ink); }
.o-comment--hidden .o-comment__body { color: var(--o-ink-2); }
.o-locked { display: grid; gap: var(--o-space-3); justify-items: start; padding: var(--o-space-4); border-radius: var(--o-radius-lg); background: var(--o-surface); }
.o-locked p { display: flex; gap: var(--o-space-2); align-items: flex-start; color: var(--o-ink-2); }
.o-locked b { color: var(--o-ink); }

/* ===================================================== sheets and dialogs */
.o-scrim { position: fixed; inset: 0; z-index: var(--o-z-scrim); background: var(--o-scrim); }
.o-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--o-z-sheet);
  display: flex; flex-direction: column; max-height: calc(100% - 3rem);
  padding: var(--o-space-2) var(--o-gutter) calc(var(--o-space-4) + var(--o-safe-bottom));
  border-radius: var(--o-radius-xl) var(--o-radius-xl) 0 0; background: var(--o-raised); box-shadow: var(--o-shadow-3);
  animation: o-slide-up var(--o-dur-base) var(--o-ease-out);
}
@keyframes o-slide-up { from { transform: translateY(2.5rem); } }   /* slides only: no fade */
.o-sheet__grabber { flex: none; width: 2.25rem; height: 5px; margin: 0 auto var(--o-space-2); border-radius: 3px; background: var(--o-control); }
.o-sheet__head { display: flex; align-items: center; gap: var(--o-space-2); min-height: var(--o-tap); }
.o-sheet__title { font-size: var(--o-text-title-3); font-weight: var(--o-weight-heavy); line-height: 1.15; letter-spacing: -0.02em; }
.o-sheet__head .o-iconbtn { margin-left: auto; margin-right: -0.625rem; }
.o-sheet__sub { margin-top: 2px; color: var(--o-ink-2); font-size: var(--o-text-callout); }
.o-sheet__body { min-height: 0; overflow: auto; margin-inline: calc(var(--o-gutter) * -1); padding-inline: var(--o-gutter); }
.o-sheet__foot { display: grid; gap: var(--o-space-2); padding-top: var(--o-space-3); }

.o-dialog { position: fixed; inset: 0; z-index: var(--o-z-dialog); display: grid; place-items: center; padding: var(--o-gutter); background: var(--o-scrim); }
.o-dialog__card { width: min(100%, 22rem); padding: var(--o-space-5); border-radius: var(--o-radius-xl); background: var(--o-raised); box-shadow: var(--o-shadow-3); }
.o-dialog__title { font-size: var(--o-text-title-3); font-weight: var(--o-weight-heavy); line-height: 1.2; letter-spacing: -0.02em; }
.o-dialog__text { margin-top: var(--o-space-2); color: var(--o-ink-2); }
.o-dialog__actions { display: flex; flex-wrap: wrap; gap: var(--o-space-2); margin-top: var(--o-space-5); }
.o-dialog__actions .o-btn { flex: 1 1 auto; }

.o-menu { display: grid; }
.o-menu__item { display: flex; align-items: center; gap: var(--o-space-3); min-height: 3.25rem; padding-inline: 2px; border-bottom: 1px solid var(--o-line); color: var(--o-ink); font-size: var(--o-text-body); font-weight: var(--o-weight-medium); text-align: left; }
.o-menu__item .o-icon { color: var(--o-ink-2); }
.o-menu__item small { margin-left: auto; font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-menu__item--danger, .o-menu__item--danger .o-icon { color: var(--o-danger); }

/* ================================================================ toast */
.o-toast {
  position: fixed; left: var(--o-gutter); right: var(--o-gutter); z-index: var(--o-z-toast);
  bottom: calc(var(--o-tabbar) + var(--o-safe-bottom) + var(--o-space-3));
  display: flex; align-items: center; gap: var(--o-space-3); min-height: 3rem; padding: 0.375rem 0.375rem 0.375rem 0.875rem;
  border-radius: var(--o-radius-md); background: var(--o-inverse); color: var(--o-on-inverse); box-shadow: var(--o-shadow-2);
  font-size: var(--o-text-callout); font-weight: var(--o-weight-semibold); line-height: 1.3;
  animation: o-toast-in var(--o-dur-base) var(--o-ease-out);
}
@keyframes o-toast-in { from { transform: translateY(1rem); } }
.o-toast > span { flex: 1 1 auto; min-width: 0; }
.o-toast .o-btn { color: var(--o-on-inverse); text-decoration: underline; text-underline-offset: 3px; }

/* =============================================================== notice */
.o-notice { --_tone: var(--o-ink-2); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--o-space-3); align-items: start; padding: var(--o-space-3) var(--o-space-4); border-radius: var(--o-radius-md); background: var(--_tint, var(--o-surface)); color: var(--o-ink); }
.o-notice > .o-icon { grid-row: span 3; margin-top: 1px; color: var(--_tone); }
.o-notice__title { font-weight: var(--o-weight-bold); line-height: 1.3; }
.o-notice__text { font-size: var(--o-text-callout); line-height: 1.4; }
.o-notice__actions { display: flex; flex-wrap: wrap; gap: var(--o-space-2); margin-top: var(--o-space-2); }
.o-notice--ok { --_tone: var(--o-ok); --_tint: var(--o-ok-tint); }
.o-notice--warn { --_tone: var(--o-warn); --_tint: var(--o-warn-tint); }
.o-notice--danger { --_tone: var(--o-danger); --_tint: var(--o-danger-tint); }

/* ========================================================== empty state */
.o-empty { display: grid; justify-items: start; gap: var(--o-space-2); padding: var(--o-space-5) var(--o-space-4); border: 1px dashed var(--o-control); border-radius: var(--o-radius-lg); }
.o-empty__title { font-size: var(--o-text-headline); font-weight: var(--o-weight-bold); line-height: 1.25; }
.o-empty__text { max-width: var(--o-measure); color: var(--o-ink-2); }
.o-empty .o-btn { margin-top: var(--o-space-2); }

/* ============================================================== skeleton
   Static blocks, no shimmer. Container gets aria-busy="true". */
.o-skel { display: block; border-radius: var(--o-radius-xs); background: var(--o-surface-2); }
.o-skel--text { height: 0.875rem; width: var(--_w, 100%); }
.o-skel--title { height: 1.25rem; width: var(--_w, 60%); }
.o-skel--media { aspect-ratio: 16 / 9; border-radius: var(--o-radius-lg); }
.o-skel--avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }

/* ============================================================ list rows */
.o-list { border-top: 1px solid var(--o-line); }
.o-listrow { display: flex; align-items: center; gap: var(--o-space-3); min-height: 3.25rem; padding-block: var(--o-space-2); border-bottom: 1px solid var(--o-line); color: inherit; }
.o-listrow > .o-icon:first-child { color: var(--o-ink-2); }
.o-listrow__text { flex: 1 1 auto; min-width: 0; }
.o-listrow__text small { display: block; margin-top: 2px; font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); }
.o-listrow__value { font-family: var(--o-font-mono); font-size: var(--o-text-meta); color: var(--o-ink-2); white-space: nowrap; }
.o-listrow > .o-icon:last-child { color: var(--o-ink-3); }

/* ============================================================== composer */
.o-composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--o-z-bar); padding: var(--o-space-2) var(--o-space-3) calc(var(--o-space-2) + var(--o-safe-bottom)); background: var(--o-bg); border-top: 1px solid var(--o-line); }
.o-composer__box { display: flex; align-items: flex-end; gap: var(--o-space-2); padding: 4px 4px 4px 0.875rem; border: 1px solid var(--o-control); border-radius: var(--o-radius-lg); background: var(--o-surface); }
.o-composer__box:focus-within { outline: var(--o-focus-width) solid var(--o-focus); outline-offset: 1px; }
.o-composer__input { flex: 1 1 auto; min-width: 0; min-height: var(--o-tap); max-height: 9rem; padding: 0.625rem 0; border: 0; background: transparent; color: var(--o-ink); font-size: max(16px, 1rem); line-height: 1.4; resize: none; field-sizing: content; }
.o-composer__input::placeholder { color: var(--o-ink-3); opacity: 1; white-space: nowrap; text-overflow: ellipsis; }
.o-composer__input:focus-visible { outline: none; }
.o-composer__line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--o-space-2); min-height: 1.75rem; padding: var(--o-space-1) var(--o-space-1) 0; font-family: var(--o-font-mono); font-size: 0.75rem; color: var(--o-ink-2); }
.o-composer__line b { color: var(--o-ink); }
.o-composer__line .o-status { font: inherit; }
.o-has-composer { padding-bottom: calc(8.5rem + var(--o-safe-bottom)); }

/* ================================================================ footer */
.o-footer { margin-top: var(--o-space-8); padding: var(--o-space-5) var(--o-gutter) var(--o-space-10); border-top: 1px solid var(--o-line); color: var(--o-ink-2); font-size: 0.875rem; }
.o-footer nav { display: flex; flex-wrap: wrap; column-gap: var(--o-space-5); }
.o-footer nav a { display: inline-flex; align-items: center; min-height: var(--o-tap); color: var(--o-ink); font-weight: var(--o-weight-medium); }
.o-footer p { margin-top: var(--o-space-2); font-family: var(--o-font-mono); font-size: 0.75rem; line-height: 1.5; }

/* ======================================================= motion guard */
@media (prefers-reduced-motion: reduce) {
  .o-status--starting::before, .o-status--working::before { animation: none; }
  .o-spinner { animation: none; border-right-color: currentColor; opacity: 0.55; }
  .o-sheet, .o-toast { animation: none; }
  .o-btn:active { transform: none; }
}

/* ====================================================== forced colours */
@media (forced-colors: active) {
  .o-btn, .o-chip, .o-tag, .o-ver, .o-result, .o-roomcard, .o-sticker { border: 1px solid CanvasText; }
  .o-status::before, .o-slots i, .o-blocks i, .o-meter > span, .o-badge { forced-color-adjust: none; }
}
