/* Formula — dashboard. Exact's grammar: a floating glass bar, generous space, bold headings,
   hairline rows, glass cards, ink pills and mono labels. */

.app { min-height: 100vh; --page: 1240px; --gutter: clamp(16px, 3vw, 32px); }

/* ---------- Top bar: one floating glass pill ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 14px var(--gutter) 0;
  pointer-events: none;
  container: topbar / inline-size;
}
.topbar__bar {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--page);
  min-height: 60px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass-2);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 22px 50px -34px rgba(var(--shadow-rgb), 0.4);
}
.topbar__brand { display: contents; }
.topbar .wordmark { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0;
  border: 1px solid var(--glass-line); border-radius: 50%; background: var(--glass-3); box-shadow: inset 0 1px 0 var(--glass-top), 0 6px 16px -10px rgba(var(--shadow-rgb), 0.6);
  transition: background-color var(--dur) var(--ease); }
.topbar .wordmark:hover { background: var(--glass-top); }
[data-theme="dark"] .topbar .wordmark:hover { background: rgba(255, 255, 255, 0.2); }
/* The ring is drawn at an icon's size, so the logo is one more round button in the bar */
.topbar .ring-mark { width: 20px; height: 20px; }
/* With a Space open, the logo shows and hides Rue; the ring turns as it does */
.wordmark--rue { cursor: pointer; }
.wordmark--rue .ring-mark { transition: transform 0.5s var(--ease), opacity var(--dur) var(--ease); }
.wordmark--rue:hover .ring-mark { transform: scale(1.08); }
.wordmark--rue[aria-expanded="false"] .ring-mark { transform: rotate(180deg); opacity: 0.72; }
.wordmark--rue[aria-expanded="false"]:hover .ring-mark { transform: rotate(180deg) scale(1.08); opacity: 1; }
.wordmark--rue:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar__project { display: flex; align-items: center; min-width: 0; padding-left: 10px; border-left: 1px solid var(--line-2); }
/* The Space switcher: the name and a chevron; it opens .space-menu */
.space-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 240px; min-height: 38px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--fg); font: 600 14.5px/1 var(--font-sans); letter-spacing: -0.01em; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.space-btn:hover, .space-btn[aria-expanded="true"] { background: var(--glass-3); }
.space-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.space-btn__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-btn__chev { flex: none; width: 12px; height: 12px; color: var(--muted); transition: transform var(--dur) var(--ease); }
.space-btn[aria-expanded="true"] .space-btn__chev { transform: rotate(180deg); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }

/* Section links live in the bar */
.rail { display: flex; align-items: center; gap: 2px; min-width: 0; margin-left: 6px; }
/* Every place is an icon now; the rail only says when nothing is being saved */
.rail:empty:not(.is-unsaved) { display: none; }
.rail a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  color: rgba(var(--ink-rgb), 0.68);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.rail a:hover { color: var(--fg); }
.rail a[aria-current="page"] {
  color: var(--fg);
  background: var(--glass-top);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 16px -10px rgba(var(--shadow-rgb), 0.55);
}
[data-theme="dark"] .rail a[aria-current="page"] { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.rail.is-unsaved::after {
  content: "Not saved";
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rec-ink);
  white-space: nowrap;
}

/* No project yet: just the logo and the theme switch */
.no-project #settings-link,
.no-project .rail,
.no-project .topbar__project { display: none; }

/* The bar stays a pill at every width (it keeps --radius-pill). Where it takes two lines its ends are set in further,
   below: a taller pill has wider round ends, and nothing in a corner may cross them. */
@container topbar (max-width: 900px) {
  .topbar__bar { flex-wrap: wrap; row-gap: 6px; }
  /* Section links, if the rail ever carries any again, take a line of their own (set the bar's ends in for it, as
     the narrow layout below does); "Not saved" on its own stays in line */
  .rail:not(:empty) {
    order: 10;
    flex: 1 0 100%;
    margin: 0 -4px;
    padding: 6px 0 0;
    border-top: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 10px 0; }
  .topbar__bar { gap: 6px; padding: 6px; }
  .topbar__project { flex: 1 1 0; min-width: 128px; padding-left: 8px; }
  .space-btn { width: 100%; max-width: none; padding: 0 10px; justify-content: space-between; }
  .topbar__right { margin-left: 0; gap: 4px; }
  .topbar .icon-btn, .topbar .wordmark { width: 36px; height: 36px; }
}
/* Too narrow for the logo, the Space and the five icons on one line (sooner with "Not saved" beside them): the Space
   keeps the top line, the icons take the next, and the pill's ends are set in clear of its rounder corners */
@container topbar (max-width: 400px) {
  .app:not(.no-project) .topbar__bar { padding-inline: 20px; }
  .app:not(.no-project) .topbar__right { flex-basis: 100%; }
}
@container topbar (max-width: 480px) {
  .app:not(.no-project) .topbar__bar:has(> .rail.is-unsaved) { padding-inline: 20px; }
  .app:not(.no-project) .topbar__bar:has(> .rail.is-unsaved) > .topbar__right { flex-basis: 100%; }
}

/* ---------- Page ---------- */
.view { --view-top: clamp(28px, 3.6vw, 48px); display: block; padding: var(--view-top) var(--gutter) 120px; min-width: 0; outline: none; }
.view__inner { max-width: var(--page); margin: 0 auto; }

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.view-head > div:first-child { min-width: 0; }
.view-head p:not(.eyebrow) { margin: 16px 0 0; max-width: 54ch; font-size: 16px; line-height: 1.6; color: rgba(var(--ink-rgb), 0.62); }
.view-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* A place's head is one row: its tabs, and its buttons at the end of the line under them. Where they don't
   fit side by side, the buttons go above the tabs, still at the end. */
.view-head--tabs, .view-head--bare { position: relative; flex-wrap: wrap-reverse; gap: 10px 24px; margin: 0 0 14px; }
.view-head--tabs { box-shadow: inset 0 -1px 0 var(--line); }
.view-head--tabs > .lib-tabs { flex: 1 1 auto; min-width: 0; margin: 0; box-shadow: none; }
.view-head--tabs > .view-head__actions { margin-left: auto; padding-bottom: 8px; }
.view-head--bare { justify-content: flex-end; margin-bottom: 18px; }
.view-head--tabs .view-head__actions .head-icon { width: 36px; height: 36px; }
.view-head--tabs .view-head__actions .head-icon svg { width: 16px; height: 16px; }
/* Small buttons (icons, the Feed's Profile) keep their place at the end of the tabs, which scroll under them */
.view-head--tabs:not(:has(.view-head__actions > :not(.head-icon, .feed-me))) > .lib-tabs { flex-basis: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin: -14px 0 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--fg); }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-title a, .section-title .hud {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.section-title a::after { content: " →"; }
.section-title a:hover { color: var(--fg); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 56px); align-items: start; }
.grid-2--subject { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-2--subject { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 36px; min-width: 0; }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 24px;
  padding: 12px 18px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  font-size: 13.5px;
  color: var(--fg-2);
}
.banner .hud { color: var(--primary-ink); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 28px;
  border: 1px dashed var(--line-3);
  border-radius: var(--radius-xl);
  color: var(--muted);
  font-size: 15px;
}
.empty p { margin: 0; max-width: 52ch; }
.quiet { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.quiet a { color: var(--fg); }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}
.link-btn:hover { color: var(--fg); }
.link-btn--warn:hover, .btn--warn:hover:not([disabled]) { color: var(--rec-ink); }

/* Bare controls that only show an edge on hover or focus */
.select--bare, .input--bare, .textarea--bare { border-color: transparent; background-color: transparent; box-shadow: none; }
.select--bare { min-height: 38px; padding: 6px 30px 6px 10px; border-radius: var(--radius-pill); background-position: right 11px center; }
.select--bare:hover, .input--bare:hover, .textarea--bare:hover { border-color: transparent; background-color: var(--glass-3); }
.input--bare:focus, .textarea--bare:focus { background-color: var(--field-input); }

/* ---------- Glass card ---------- */
.composer, .suggest, .brief-quote, .voice-ref, .feat, .view-slot, .pub, .rule-line, .welcome__form, .decision-bar, .asset-detail__side .tags + .field {
  --card: 1;
}
.composer, .suggest, .brief-quote, .voice-ref, .feat, .view-slot, .pub, .rule-line, .welcome__form {
  border: 1px solid var(--glass-line);
  background: var(--glass);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

/* ---------- Composer ---------- */
.composer {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.composer:focus-within { border-color: rgba(var(--ink-rgb), 0.18); box-shadow: var(--shadow-glass), 0 0 0 4px var(--primary-soft); }
.composer__text {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 26px 28px 10px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: clamp(19px, 1.7vw, 23px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  resize: vertical;
}
.composer__text:focus { outline: none; }
.composer__text::placeholder { color: var(--faint); }
.composer__subjects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 28px 18px; }
.mention-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--glass-3);
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.mention-chip:hover { border-color: var(--primary); color: var(--primary-ink); }
.composer__featuring { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ok); }
.composer__hint { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.composer__hint a { color: var(--fg-2); }
.composer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
  padding: 10px 10px 10px 18px;
  border-top: 1px solid var(--line);
}
.composer__opt { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.composer__opt .select, .composer__opt .input { width: auto; min-height: 38px; font-family: var(--font-sans); font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--fg); }
.composer__opt .input { width: 58px; padding: 6px 4px 6px 10px; border-radius: var(--radius-pill); }
.composer__estimate { margin-left: auto; padding: 0 8px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.composer__estimate b { color: var(--fg); font-weight: 500; }
@media (max-width: 760px) {
  .composer__text { padding: 20px 20px 8px; }
  .composer__subjects { padding: 4px 20px 14px; }
  .composer__bar { padding: 10px; }
  .composer__estimate { order: 5; width: 100%; margin: 0; padding: 4px 10px 0; }
  .composer__bar .btn { order: 6; width: 100%; }
}
@media (max-width: 480px) {
  .composer__opt:first-child { flex: 1 0 100%; }
  .composer__opt:first-child .select { width: 100%; }
}

/* ---------- The week's rows, beside the feed: posts and meetings in time order ---------- */
.home-alt { margin: 12px 0 0; }
.home-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.home-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.home-list li:first-child .home-row { border-top: 1px solid var(--line); }
.home-row:hover .home-row__body b { color: var(--accent); }
.home-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.home-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-row__body b { overflow: hidden; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; transition: color var(--dur) var(--ease); }
.home-row__body small { overflow: hidden; font-size: 12px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.home-row__dots { display: flex; gap: 3px; min-width: 8px; }
.home-row__state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.home-row__state.is-held, .home-row__state.is-due, .home-row__state.is-blocked { color: var(--rec-ink); }

/* The Storyboards tab: the brief box above the list, and what's working below it */
.board-filters { margin-top: 28px; }
.board-learn { margin-top: clamp(40px, 5vw, 60px); max-width: 560px; }
.board-learn__rates { margin: 0 0 12px; font-size: 15px; color: var(--fg-2); }

/* ---------- A picture to open: the feed's images, a profile's tiles ---------- */
.reel__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-sunk);
  cursor: pointer;
  box-shadow: 0 18px 40px -28px rgba(var(--shadow-rgb), 0.7);
}
.reel__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.reel__item:hover img { transform: scale(1.05); }


/* ---------- Rows (Exact's service list) ---------- */
.rows { margin: 0; padding: 0; list-style: none; }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 70px auto minmax(0, 1fr) auto auto 16px;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(var(--ink-rgb), 0.09);
  transition: padding var(--dur) var(--ease);
}
.row:last-child { border-bottom: 1px solid rgba(var(--ink-rgb), 0.09); }
.row__code { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--faint); }
.row__title { min-width: 0; }
.row__title a { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; }
.row__title a::after { content: ""; position: absolute; inset: 0; }
.row__title span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__meta { font-family: var(--font-mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.row__go { display: grid; place-items: center; color: var(--fg); opacity: 0.3; transition: opacity .5s var(--ease), transform .7s var(--ease); }
.row__go svg { width: 14px; height: 14px; }
.row:hover .row__go { opacity: 1; transform: translateX(3px); }
.row:hover .row__title a { color: var(--fg); }
.row .badge { position: relative; }
.strip { display: flex; gap: 3px; }
.strip__cell {
  width: 22px;
  aspect-ratio: var(--ar, 9 / 16);
  border-radius: 4px;
  background: var(--line-2);
  overflow: hidden;
}
.strip__cell img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row__code, .row .strip, .row__meta, .row__go { display: none; }
}

/* ---------- Suggestions and insights ---------- */
.suggestions { display: flex; flex-direction: column; gap: 10px; }
.suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 16px 16px 20px;
  border-radius: var(--radius-xl);
}
.suggest__text { flex: 1 1 240px; min-width: 0; }
.suggest__text p { margin: 0; font-weight: 500; letter-spacing: -0.01em; }
.suggest__text small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; line-height: 1.5; color: var(--muted); }
.suggest__actions { display: flex; gap: 4px; }

.insights { margin: 0; padding: 0; list-style: none; }
.insights li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(var(--ink-rgb), 0.09);
  font-size: 15px;
}
.insights li:last-child { border-bottom: 1px solid rgba(var(--ink-rgb), 0.09); }
.insights li span:last-child { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.insights a { color: var(--fg); text-decoration: none; }
.insights a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Pills: tabs and filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; }
.toolbar .tabs { margin: 0; }
.tabs a, .tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--glass);
  color: var(--fg-2);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.tabs a:hover, .tabs button:hover { border-color: var(--line-3); color: var(--fg); }
.tabs [aria-current="page"], .tabs [aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tabs .count { font-family: var(--font-mono); font-size: 11px; opacity: 0.6; }
.input--search {
  width: 260px;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 16px 8px 38px;
  border-radius: var(--radius-pill);
  background: var(--glass-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A667E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.75' cy='10.75' r='6.25'/%3E%3Cpath d='M15.4 15.4 20 20'/%3E%3C/svg%3E") no-repeat 14px center / 14px;
  font-size: 14px;
}
.collection-actions { display: flex; flex-wrap: wrap; gap: 18px; margin: -10px 0 20px; }

/* ---------- Vault tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 28px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 12px; } }
.tile { position: relative; min-width: 0; }
.tile__open {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.tile__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-sunk);
  box-shadow: 0 18px 40px -30px rgba(var(--shadow-rgb), 0.75);
}
.tile__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.tile__open:hover .tile__media img { transform: scale(1.04); }
.tile__text {
  display: -webkit-box;
  height: 100%;
  padding: 18px;
  overflow: hidden;
  -webkit-line-clamp: 9;
  -webkit-box-orient: vertical;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background: var(--glass-3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--fg-2);
}
.tile__none { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.tile__palette { display: flex; height: 4px; margin-top: 2px; border-radius: 2px; overflow: hidden; }
.tile__palette span { flex: 1; }
.tile__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 500; color: var(--fg); }
.tile__meta { display: flex; align-items: center; gap: 6px; margin-top: -4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: pre; overflow: hidden; }
.tile__dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); }
.media-chips { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.media-chip {
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 26, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 260px;
  padding: 32px;
  border: 1px dashed var(--line-3);
  border-radius: var(--radius-2xl);
  background: var(--glass);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.dropzone b { color: var(--fg); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.dropzone:hover { border-color: var(--primary); }

.drop-overlay {
  position: fixed;
  inset: 12px;
  z-index: 60;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-2xl);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.drop-overlay span { font-size: clamp(24px, 3vw, 40px); font-weight: 700; letter-spacing: -0.04em; }
.show-drop .drop-overlay { opacity: 1; }

/* Asset detail (in the dialog) */
.asset-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; }
.asset-detail__media { display: grid; place-items: center; min-height: 240px; border-radius: var(--radius-lg); background: var(--surface-sunk); overflow: hidden; }
.asset-detail__media img { width: 100%; max-height: 64vh; object-fit: contain; }
.asset-detail__text { margin: 0; padding: 20px; font-family: var(--font-mono); font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.asset-detail__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.asset-detail__palette { display: flex; height: 10px; border-radius: 5px; overflow: hidden; }
.asset-detail__palette span { flex: 1; }
.asset-detail__actions { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -12px; }
.inline-field { display: flex; gap: 8px; }
@media (max-width: 720px) { .asset-detail { grid-template-columns: minmax(0, 1fr); } }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.tag {
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--fg-2);
}

/* ---------- Subjects ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 20px; margin: 0; padding: 0; list-style: none; }
.subject-card { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.subject-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: 0 30px 60px -40px rgba(var(--shadow-rgb), 0.8);
}
.subject-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.subject-card:hover .subject-card__img { transform: scale(1.04); }
.subject-card__img--empty { display: grid; place-items: center; font-size: 96px; font-weight: 700; letter-spacing: -0.06em; color: var(--line-3); }
.subject-card .media-chips { left: 12px; bottom: 12px; }
.subject-card__body { display: flex; flex-direction: column; gap: 6px; }
.subject-card__name { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; }
.subject-card__handle { font-family: var(--font-mono); font-size: 12px; color: var(--primary-ink); }
.subject-card__meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

.coverage { display: flex; gap: 3px; min-width: 60px; }
.coverage span { flex: 1; height: 3px; border-radius: 2px; background: var(--line-2); }
.coverage span.is-on { background: var(--fg); }

.board-title {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
}
.board-title:focus { outline: none; box-shadow: 0 2px 0 var(--primary); }
.subject-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 16px; }
.subject-meta__field { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.subject-meta__field .select { width: auto; min-height: 36px; padding: 6px 32px 6px 12px; border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 14px; letter-spacing: 0; text-transform: none; }
.handle-input {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding-left: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--field-input);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary-ink);
}
.handle-input .input { width: 140px; min-height: 0; height: 34px; padding: 0 12px 0 2px; border: 0; background: none; font-family: var(--font-mono); font-size: 13px; color: var(--primary-ink); }
.handle-input .input:focus { box-shadow: none; }
.handle-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.subject-meta__count { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.subject-meta__count .coverage { width: 90px; }

.views { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.view-slot { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--radius-xl); transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.view-slot.is-empty { border-style: dashed; border-color: var(--line-3); background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.view-slot.is-over { border-color: var(--primary); border-style: solid; background: var(--primary-soft); }
.view-slot__head { display: flex; align-items: center; gap: 6px; }
.view-slot__label {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.view-slot__label:hover { border-color: var(--line-2); }
.view-slot__label:focus { outline: none; border-color: var(--primary); background: var(--field-input); }
.view-slot__count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-slot__refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.view-slot__refs .ref:only-child { grid-column: 1 / -1; }
.view-slot__empty {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-sunk);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
}
.view-slot__empty:hover { color: var(--fg); }
.view-slot__foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 0 4px; }

.ref { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-sunk); }
.ref img { width: 100%; height: 100%; object-fit: cover; }
.ref.is-key { box-shadow: 0 0 0 2px var(--accent); }
.ref__name { display: block; padding: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--muted); word-break: break-all; }
.ref__actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
@media (hover: hover) {
  .ref__actions { opacity: 0; transition: opacity var(--dur) var(--ease); }
  .ref:hover .ref__actions, .ref:focus-within .ref__actions, .ref.is-key .ref__actions { opacity: 1; }
}
.ref-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  cursor: pointer;
}
.ref-btn svg { width: 14px; height: 14px; }
.ref-btn.is-on { background: #FFFFFF; color: #0F1626; }
.ref-btn.is-on svg path { fill: currentColor; }
.ref-key {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 4px 9px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 26, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font: 500 10px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.ref-key.is-on { background: #FFFFFF; color: #0F1626; }
@media (hover: hover) {
  .ref-key:not(.is-on) { opacity: 0; transition: opacity var(--dur) var(--ease); }
  .ref:hover .ref-key, .ref:focus-within .ref-key { opacity: 1; }
}
.ref-btn--plain { width: 30px; height: 30px; background: transparent; color: var(--muted); -webkit-backdrop-filter: none; backdrop-filter: none; }
.ref-btn--plain:hover { color: var(--fg); background: var(--line); }

.view-add form { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius-xl); }
.view-add__row { display: flex; gap: 6px; }
.view-add__row .input { min-height: 38px; padding: 6px 12px; font-size: 14px; }
.field__hint { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.key-image { width: 100%; max-width: 240px; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-sunk); }
.key-image img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Docs: contents, a reading column, related references ---------- */
.docs {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 250px;
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}
.docs__toc {
  position: sticky;
  top: 116px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: none;
}
.docs__group {
  margin: 22px 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}
.docs__aside .docs__group:first-child { margin-top: 0; }
.doc-cast, .doc-refs, .doc-links { margin: 0; padding: 0; list-style: none; }

/* The contents tree. Nested pages hang off a line that curves smoothly into each child. */
.docs__filter {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 38px;
  margin-bottom: 14px;
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius-pill);
  background: var(--glass-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A667E' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10.75' cy='10.75' r='6.25'/%3E%3Cpath d='M15.4 15.4 20 20'/%3E%3C/svg%3E") no-repeat 14px center / 13px;
  font-size: 13.5px;
}
.docs__tree ul { margin: 0; padding: 0; list-style: none; }
.tree__sec + .tree__sec { margin-top: 14px; }
.tree__head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  margin-bottom: 2px;
  padding: 0 4px 0 2px;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  cursor: pointer;
}
.tree__head:hover { color: var(--fg); }
.tree__head svg, .tree__toggle svg { width: 11px; height: 11px; flex: none; transition: transform 200ms var(--ease); }
.tree__head[aria-expanded="true"] svg, .tree__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tree__head .tree__count { margin-left: auto; }
.tree__row { display: flex; align-items: center; min-height: 32px; }
.tree__toggle, .tree__leaf { flex: none; width: 22px; height: 22px; }
.tree__toggle {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.tree__toggle:hover { color: var(--fg); background: var(--glass); }
.tree__row a {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 10px;
  overflow: hidden;
  color: rgba(var(--ink-rgb), 0.66);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tree__row a:hover { color: var(--fg); background: var(--glass); }
.tree__row a[aria-current="page"] {
  color: var(--fg);
  font-weight: 500;
  background: var(--glass-top);
  box-shadow: inset 0 0 0 1px var(--glass-line), 0 6px 16px -12px rgba(var(--shadow-rgb), 0.6);
}
[data-theme="dark"] .tree__row a[aria-current="page"] { background: rgba(255, 255, 255, 0.1); }
.tree__row mark { padding: 0 1px; border-radius: 3px; background: var(--primary-soft); color: inherit; }
.tree__count { flex: none; padding: 0 6px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; color: var(--faint); }
/* The veins: every level hangs off a line that runs down from its section or parent and curves
   into each page. The path to the open page is drawn in the accent, back to its section. */
.docs__tree { --vein: rgba(var(--ink-rgb), 0.22); --vein-on: var(--accent); }
.docs__tree .tree__sec > ul { margin-left: 7px; }
.docs__tree ul ul { margin-left: 10px; }
.docs__tree li { position: relative; padding-left: 14px; }
.docs__tree li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 16px;
  border-left: 1px solid var(--vein);
  border-bottom: 1px solid var(--vein);
  border-bottom-left-radius: 10px;
}
.docs__tree li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--vein);
}
.docs__tree li.is-path::before { border-color: var(--vein-on); }
.docs__tree li:has(~ li.is-path)::after { border-left-color: var(--vein-on); }
.docs__tree li.tree__more::before, .docs__tree li.tree__more::after { content: none; }
.tree__more { padding: 4px 0 4px 32px; }
.tree__found { margin: 0 0 12px 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

/* Breadcrumbs above a page, and previous / next below it */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-bottom: 18px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.crumbs > * + *::before { content: "/"; margin: 0 10px; color: var(--faint); }
.crumbs a { color: var(--fg-2); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.doc-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background: var(--glass);
  color: var(--fg);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
.doc-pager a:hover { border-color: var(--line-3); }
.doc-pager small { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.doc-pager span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.doc-pager__next { grid-column: 2; text-align: right; }

.doc { min-width: 0; max-width: 700px; }
.doc .eyebrow { margin-bottom: 18px; }
.doc__title { margin: 0; font-size: clamp(36px, 3.8vw, 56px); font-weight: 700; line-height: 1; letter-spacing: -0.045em; text-wrap: balance; }
.doc__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-top: 18px; }
.doc__bar .doc__meta { margin: 0; }
.doc-mode {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-top);
}
.doc-mode button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.doc-mode button:hover { color: var(--fg); }
.doc-mode button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.doc__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 18px 0 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); }
.doc__body { margin-top: 36px; font-size: 17.5px; line-height: 1.75; color: rgba(var(--ink-rgb), 0.82); }
.doc__body > :first-child { margin-top: 0; }
.doc__body p { margin: 0 0 1.15em; }
.doc__body h3 { margin: 1.9em 0 0.55em; font-size: 23px; font-weight: 600; line-height: 1.25; letter-spacing: -0.025em; color: var(--fg); }
.doc__body h4 { margin: 1.6em 0 0.5em; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.doc__body ul, .doc__body ol { margin: 0 0 1.2em; padding-left: 1.25em; }
.doc__body li { margin: 0.35em 0; padding-left: 0.25em; }
.doc__body li::marker { color: var(--faint); }
.doc__body blockquote {
  margin: 1.7em 0;
  padding: 2px 0 2px 24px;
  border-left: 2px solid var(--accent);
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.doc__body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line-2); }
.doc__body code { padding: 1px 6px; border-radius: 6px; background: var(--surface-sunk); font-family: var(--font-mono); font-size: 0.84em; }
.doc__body strong { color: var(--fg); font-weight: 600; }
.doc__body a:not(.mention) { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.doc__body a:not(.mention):hover { text-decoration-color: currentColor; }
.doc__body s { color: var(--muted); }
.doc__body .doc-code { margin: 0 0 1.2em; padding: 14px 16px; border-radius: 10px; background: var(--surface-sunk); overflow-x: auto; font-size: 14px; line-height: 1.6; }
.doc__body .doc-code code { padding: 0; background: none; font-size: inherit; }
.doc__body .doc-table { margin: 0 0 1.2em; overflow-x: auto; }
.doc__body .doc-table table { border-collapse: collapse; min-width: 100%; font-size: 15px; line-height: 1.5; }
.doc__body .doc-table th, .doc__body .doc-table td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.doc__body .doc-table th { color: var(--fg); font-weight: 600; }
.doc__body .doc-fig { margin: 1.6em 0; }
.doc__body .doc-fig img { display: block; max-width: 100%; border-radius: 10px; }
.doc__body .doc-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.doc__editor {
  display: block;
  width: 100%;
  min-height: 56vh;
  margin-top: 30px;
  padding: 22px 24px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xl);
  background: var(--glass-3);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  resize: vertical;
  box-shadow: var(--shadow-glass);
}
.doc__editor:focus { outline: none; border-color: var(--primary); box-shadow: var(--shadow-glass), 0 0 0 4px var(--primary-soft); }
.doc__hint { margin: 10px 0 0; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.doc__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc__sub { margin: 44px 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }

.doc-refs__item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-sunk);
  cursor: pointer;
  box-shadow: 0 18px 40px -30px rgba(var(--shadow-rgb), 0.75);
}
.doc-refs__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.doc-refs__item:hover img { transform: scale(1.05); }

.docs__aside { position: sticky; top: 116px; min-width: 0; }
.doc-refs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.doc-cast { display: flex; flex-direction: column; gap: 8px; }
.doc-cast a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
.doc-cast a:hover { border-color: var(--line-3); }
.doc-cast__img { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
/* Scoped to .doc-cast, so the name-and-type rule for spans below doesn't take the letter out of the middle */
.doc-cast .doc-cast__img--empty { display: grid; place-items: center; background: var(--surface-sunk); font-weight: 700; line-height: 1; color: var(--faint); }
.doc-cast span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.doc-cast b { font-size: 14px; font-weight: 600; }
.doc-cast small { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.doc-links li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid rgba(var(--ink-rgb), 0.09); font-size: 14.5px; }
.doc-links li:last-child { border-bottom: 1px solid rgba(var(--ink-rgb), 0.09); }
.doc-links a { color: var(--fg); text-decoration: none; }
.doc-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.doc-links li > span:not(.badge) { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

@media (max-width: 1180px) {
  .docs { grid-template-columns: 190px minmax(0, 1fr); }
  .docs__toc { top: 150px; }
  .docs__aside { grid-column: 2; position: static; }
  .doc-refs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .docs__toc { position: static; max-height: 46vh; padding: 12px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); }
  .docs__aside { grid-column: auto; }
  .doc-refs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Rules ---------- */
.rule-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 36px;
  padding: 8px 8px 8px 24px;
  border-radius: var(--radius-2xl);
}
.rule-line__input {
  min-width: 0;
  min-height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: clamp(18px, 1.6vw, 21px);
  letter-spacing: -0.02em;
}
.rule-line__input:focus { outline: none; }
.rule-line__input::placeholder { color: var(--faint); }
.rule-line:focus-within { box-shadow: var(--shadow-glass), 0 0 0 4px var(--primary-soft); }
.rule-line__opts { grid-column: 1 / -1; padding: 0 0 6px; border-top: 1px solid var(--line); }
.rule-line__opts summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.rule-line__opts summary::-webkit-details-marker { display: none; }
.rule-line__opts summary::after { content: "+"; margin-left: 8px; font-size: 13px; }
.rule-line__opts[open] summary::after { content: "−"; }
.rule-line__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; padding: 4px 16px 10px 0; }
@media (max-width: 640px) {
  .rule-line { grid-template-columns: minmax(0, 1fr); padding: 8px 12px 12px 18px; }
  .rule-line .btn { width: 100%; }
  .rule-line__grid { grid-template-columns: minmax(0, 1fr); }
}
.rules-suggest { margin-bottom: 36px; }

.rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(var(--ink-rgb), 0.09);
}
.rule:last-child { border-bottom: 1px solid rgba(var(--ink-rgb), 0.09); }
.rule__text { min-width: 0; }
.rule__text p { margin: 0; font-size: 17px; letter-spacing: -0.015em; }
.rule__text small { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); }
.rule.is-off .rule__text p { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-3); }
.rule__actions { display: flex; gap: 16px; }
@media (hover: hover) {
  .rule__actions { opacity: 0; transition: opacity var(--dur) var(--ease); }
  .rule:hover .rule__actions, .rule:focus-within .rule__actions { opacity: 1; }
}
.badge--always { background: var(--primary-soft); color: var(--primary-ink); }
.badge--never { background: var(--rec-soft); color: var(--rec-ink); }
.badge--prefer { background: var(--ok-soft); color: var(--ok); }

.switch {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.switch__track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--line-2);
  transition: background-color var(--dur) var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 22, 38, 0.3);
  transition: transform var(--dur) var(--ease);
}
.switch[aria-checked="true"] .switch__track { background: var(--fg); }
.switch[aria-checked="true"] .switch__track::after { transform: translateX(16px); background: var(--bg); }

/* ---------- Storyboard ---------- */
.board-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }
.brief-quote {
  margin-bottom: 28px;
  padding: 20px 24px;
  border-radius: var(--radius-xl);
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.5;
  letter-spacing: -0.015em;
}
.brief-quote .hud { display: block; margin-bottom: 8px; }
.brief-quote ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; color: var(--muted); letter-spacing: 0; }
.mention { color: var(--primary-ink); text-decoration: none; font-weight: 500; }
.mention:hover { text-decoration: underline; text-underline-offset: 3px; }

.featuring { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 32px; }
.feat {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 300px;
  max-width: 520px;
  padding: 10px 18px 10px 10px;
  border-radius: var(--radius-xl);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease);
}
.feat:hover { border-color: var(--line-3); }
.feat__avatar { width: 56px; height: 70px; flex: none; border-radius: var(--radius-md); object-fit: cover; }
.feat__avatar--empty { display: grid; place-items: center; background: var(--surface-sunk); font-size: 26px; font-weight: 700; color: var(--faint); }
.feat__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feat__name { font-weight: 600; letter-spacing: -0.01em; }
.feat__type { margin-left: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.feat__notes { font-size: 13px; line-height: 1.45; color: var(--fg-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat__meta { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.feat__meta .coverage { width: 70px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--shot-min, 200px), 1fr)); gap: 32px 18px; }
.shot-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.shot-frame {
  position: relative;
  aspect-ratio: var(--ar, 4 / 5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-sunk);
  box-shadow: 0 24px 50px -34px rgba(var(--shadow-rgb), 0.85);
}
.shot-frame img { width: 100%; height: 100%; object-fit: cover; }
.shot-frame__hud { position: absolute; left: 8px; top: 8px; right: 48px; display: flex; flex-wrap: wrap; gap: 4px; }
.shot-frame__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-3);
  border-radius: inherit;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.shot-frame__cast { position: absolute; left: 8px; bottom: 8px; display: flex; }
.shot-frame__cast img {
  width: 30px;
  height: 30px;
  margin-right: -8px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  object-fit: cover;
}
.frame-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 14, 26, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  cursor: pointer;
}
.frame-btn svg { width: 15px; height: 15px; }
.frame-btn:hover { background: rgba(10, 14, 26, 0.72); }
.shot-card__why { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.shot-card .textarea { min-height: 72px; padding: 8px 10px; margin: -2px -10px 0; width: calc(100% + 20px); font-size: 14px; line-height: 1.5; resize: none; }
.shot-card__secs { display: inline-flex; align-items: center; gap: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.shot-card__secs .input { width: 74px; min-height: 32px; padding: 4px 8px; font-family: var(--font-mono); font-size: 12px; }

.cast { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cast-row { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; }
.cast-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cast-row__ctl { display: flex; align-items: center; gap: 2px; min-width: 0; }
.cast-row__img { width: 26px; height: 26px; flex: none; border-radius: 50%; object-fit: cover; }
.cast-row__img--empty { display: grid; place-items: center; border: 1px dashed var(--line-3); font-size: 11px; color: var(--muted); }
.cast-row .select { flex: 1 1 auto; width: auto; min-width: 0; min-height: 30px; padding: 2px 26px 2px 8px; font-size: 12.5px; background-position: right 8px center; }
.cast-warn { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.5; color: var(--warn); }
.cast-warn a { color: inherit; }

.caption-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; margin-top: 44px; }
@media (max-width: 860px) { .caption-grid { grid-template-columns: minmax(0, 1fr); } }
.voice-ref { padding: 18px 20px; border-radius: var(--radius-xl); font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.voice-ref .hud { display: block; margin-bottom: 8px; }
.voice-ref p { margin: 0; }

/* The decision floats at the bottom of the screen while you review */
.decision-bar {
  position: sticky;
  bottom: 16px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 40px;
  padding: 8px 8px 8px 24px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 26px 60px -30px rgba(var(--shadow-rgb), 0.6);
}
.decision-bar__cost { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.decision-bar__cost b { color: var(--fg); font-weight: 500; }
.decision-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .decision-bar { position: static; border-radius: var(--radius-xl); padding: 14px; }
  .decision-bar__actions { width: 100%; }
  .decision-bar__actions .btn { flex: 1 1 auto; }
}

/* ---------- Publish ---------- */
.pub-list { display: flex; flex-direction: column; gap: 14px; }
.pub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 16px 16px 16px 18px; border-radius: var(--radius-xl); }
.pub .strip { gap: 4px; }
.pub .strip__cell { width: 44px; border-radius: 6px; }
.pub__body h3 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.pub__body p { margin: 6px 0 0; font-size: 14.5px; color: var(--fg-2); white-space: pre-line; }
.pub__body small { display: block; margin-top: 8px; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }
.pub__actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
@media (max-width: 760px) {
  .pub { grid-template-columns: minmax(0, 1fr); }
  .pub__actions { flex-direction: row; flex-wrap: wrap; }
}
.connect { margin-top: 32px; }
.connect p { margin: 0 0 14px; max-width: 60ch; font-size: 15px; color: var(--fg-2); }

/* ---------- Welcome ---------- */
.welcome { max-width: 760px; margin: 6vh auto 0; text-align: center; }
.welcome h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  outline: none;
  text-wrap: balance;
}
.welcome > p { margin: 22px auto 0; max-width: 46ch; font-size: 18px; line-height: 1.6; color: rgba(var(--ink-rgb), 0.62); }
.welcome__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto;
  gap: 10px;
  align-items: end;
  margin-top: 40px;
  padding: 14px;
  border-radius: var(--radius-2xl);
  text-align: left;
}
@media (max-width: 640px) { .welcome__form { grid-template-columns: minmax(0, 1fr); } }
.welcome__alt { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.welcome .banner { text-align: left; }

/* ---------- Dialog ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-2xl);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  backdrop-filter: blur(30px) saturate(160%);
  color: var(--fg);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 40px 100px -40px rgba(var(--shadow-rgb), 0.7);
}
.dialog--wide { width: min(940px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(10, 14, 26, 0.36); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 6px 26px; }
.modal__head h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }
.modal__body { display: flex; flex-direction: column; gap: 18px; max-height: 68vh; padding: 16px 26px 22px; overflow: auto; }
.modal__body p { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.55; }
/* A word typed to confirm (a Space's name): its label is a sentence, so the word shows as it's spelled */
.modal__body .field__label--say { font-family: inherit; font-size: 14px; letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.modal__body .field__label--say b { color: var(--fg); font-weight: 600; }
.modal__foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }
.modal-section { display: flex; flex-direction: column; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-section:first-child { padding-top: 0; border-top: 0; }
.modal-section h3 { margin: 0; font-size: 15px; font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-chip span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  font-size: 14px;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.check-chip span:hover { border-color: var(--line-3); }
.check-chip input:checked + span { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.check-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick__media { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-md); overflow: hidden; background: var(--surface-sunk); }
.pick__media img { width: 100%; height: 100%; object-fit: cover; }
.pick input:checked + .pick__media { box-shadow: 0 0 0 3px var(--fg); }
.pick input:checked + .pick__media::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.pick input:focus-visible + .pick__media { outline: 2px solid var(--primary); outline-offset: 3px; }
.pick__label { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 70;
  /* Its own width, up to the window's: left at 50% alone would let it shrink to half the window, and a long message
     then wrapped into a tall, narrow blob instead of a pill */
  width: max-content;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--fg);
  color: var(--bg);
  font-size: 14px;
  box-shadow: var(--shadow-cta);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 240ms var(--ease), transform 240ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--rec); color: #FFFFFF; }

/* Links in the segmented switch (Vault: Gallery / Docs) look like its buttons */
.doc-mode a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.doc-mode a:hover { color: var(--fg); }
.doc-mode a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.view-head__actions .doc-mode { margin-right: 8px; }
a.tile__open { color: inherit; text-decoration: none; }
.tile__doc { display: block; margin-bottom: 8px; font-family: var(--font-sans); font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; color: var(--fg); }

/* ---------- Vault: one header, a Gallery / Docs switch ---------- */
.lib-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: -8px 0 28px; }
.lib-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.lib-switch a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 18px 0 14px;
  border-radius: var(--radius-pill);
  color: var(--fg-2);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.lib-switch a svg { width: 16px; height: 16px; opacity: 0.7; }
.lib-switch a small { font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; letter-spacing: 0.06em; color: var(--muted); }
.lib-switch a:hover { color: var(--fg); }
.lib-switch a[aria-current="page"] { background: var(--fg); color: var(--bg); }
.lib-switch a[aria-current="page"] small { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.lib-switch a[aria-current="page"] svg { opacity: 1; }
.lib-bar__hint { margin: 0; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--muted); }

/* Sortable collection tabs */
.tabs--sortable { touch-action: pan-y; }
.tabs--sortable li[data-col] { position: relative; }
.tabs--sortable li[data-col] a { cursor: grab; -webkit-user-select: none; user-select: none; }
.tabs--sortable.is-sorting a { cursor: grabbing; }
.tabs--sortable li.is-sorting { z-index: 5; }
.tabs--sortable li.is-sorting a {
  border-color: var(--fg);
  background: var(--glass-top);
  color: var(--fg);
  box-shadow: 0 16px 34px -14px rgba(var(--shadow-rgb), 0.65);
}

/* ---------- Guidance: the menu's workflow groups, getting started, empty states ---------- */
.rail__sep { flex: none; width: 1px; height: 18px; margin: 0 6px; background: var(--line-2); }
@media (max-width: 1180px) { .rail__sep { height: 16px; } }

/* Get started, beside the feed: the four steps as rows like the week's, a done one ticked and quiet */
.guide__n { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-2); border-radius: 50%; font: 500 10.5px/1 var(--font-mono); color: var(--muted); }
.guide .home-row__body small { white-space: normal; line-height: 1.45; }
.guide__step.is-done .home-row { cursor: default; }
.guide__step.is-done .home-row__body b { color: var(--muted); font-weight: 400; }
.guide__step.is-done .guide__n { border-color: var(--fg); background: var(--fg); color: var(--bg); }

.statline dd a { color: inherit; text-decoration: none; }
.statline dd a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(40px, 7vw, 80px) 24px;
  border: 1px dashed var(--line-3);
  border-radius: var(--radius-2xl);
  background: var(--glass);
  text-align: center;
}
.empty-state p { margin: 0; max-width: 46ch; font-size: 15px; line-height: 1.6; color: var(--muted); }
.empty-state .empty-state__title { font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; letter-spacing: -0.04em; color: var(--fg); }
.empty-state .btn { margin-top: 8px; }

/* ---------- Publish: use it on your site (the content package) ---------- */
.site__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .site__grid { grid-template-columns: minmax(0, 1fr); } }
.site__setup { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); box-shadow: var(--shadow-glass); }
.site__setup > .field__label { margin: 6px 0 -4px; }
.site__eps { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site__eps button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: none;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
.site__eps button:hover { background: var(--glass-3); }
.site__eps button[aria-pressed="true"] { border-color: var(--line-2); background: var(--glass-top); color: var(--fg); }
.site__verb { flex: none; padding: 2px 6px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; }
.site__note { margin: 4px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.site__code { min-width: 0; border-radius: var(--radius-xl); background: #0D1222; color: #D9E1F2; box-shadow: var(--shadow-panel); overflow: hidden; }
.site__code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-family: var(--font-mono); font-size: 11px; color: #8FB6E8; }
.site__code-bar .link-btn { color: rgba(255, 255, 255, 0.6); }
.site__code-bar .link-btn:hover { color: #FFFFFF; }
.site__code pre { margin: 0; max-height: 440px; padding: 16px 18px; overflow: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; }

/* ---------- Vault hierarchy: page, then view tabs, then the collection filter ---------- */
.lib-bar, .lib-switch { display: none; }
/* The rule under the tabs is drawn inside the row, so the row can scroll sideways on a phone and keep it */
.lib-tabs { display: flex; align-items: flex-end; gap: 26px; margin: -10px 0 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tabs a {
  position: relative;
  flex: none;
  padding: 8px 0 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.lib-tabs a:hover { color: var(--fg); }
.lib-tabs a[aria-current="page"] { color: var(--fg); }
.lib-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--fg); }
.lib-tabs a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
@media (max-width: 640px) { .lib-tabs { gap: 22px; } }
.lib-tabs__hint { margin-left: auto; padding-bottom: 16px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--faint); }
@media (max-width: 640px) { .lib-tabs__hint { display: none; } }

.toolbar__label { flex: none; margin-right: 2px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.toolbar { justify-content: flex-start; }
.toolbar .input--search { margin-left: auto; }
.toolbar .tabs a { min-height: 34px; padding: 0 14px; font-size: 13.5px; }

/* One plain sentence under the Vault tabs: what this tab is */
.lib-tabs { margin-bottom: 14px; }
.lib-explain { max-width: 70ch; margin: 0 0 26px; font-size: 14.5px; line-height: 1.6; color: rgba(var(--ink-rgb), 0.62); }
/* A file that belongs to a subject says so */
.media-chip--subject { background: rgba(10, 14, 26, 0.62); text-transform: none; letter-spacing: 0.02em; font-size: 10.5px; }

/* ---------- History ---------- */
.hist-group { margin-top: 40px; }
.hist-group + .hist-group { margin-top: 56px; }
.hist__day { margin: 28px 0 8px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.hist-group .section-title + .hist__day { margin-top: 8px; }
/* The vein runs down its own gutter on the left, a node per moment level with its time. The rules between
   moments start after the gutter, so nothing crosses the vein. */
.hist {
  --vein: rgba(var(--ink-rgb), 0.16);
  --gutter-w: 28px;
  --node-y: 27px;
  --rule: linear-gradient(var(--line), var(--line)) var(--gutter-w) 0 / calc(100% - var(--gutter-w)) 1px no-repeat;
  list-style: none;
  margin: 0;
  padding: 0;
  background: linear-gradient(var(--line), var(--line)) var(--gutter-w) 100% / calc(100% - var(--gutter-w)) 1px no-repeat;
}
.hist__item {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 4px 20px;
  align-items: start;
  padding: 16px 0 16px var(--gutter-w);
  background: var(--rule);
}
.hist--saved .hist__item { grid-template-columns: 150px minmax(0, 1fr) auto; }
.hist__item::before { content: ""; position: absolute; left: 5px; top: 0; bottom: 0; border-left: 1px solid var(--vein); }
.hist__item:first-child::before { top: var(--node-y); }
.hist__item:last-child::before { bottom: calc(100% - var(--node-y)); }
.hist__item:only-child::before { display: none; }
.hist__item::after {
  content: "";
  position: absolute;
  left: 1px;
  top: calc(var(--node-y) - 4.5px);
  width: 9px;
  height: 9px;
  box-sizing: border-box;
  border: 1px solid rgba(var(--ink-rgb), 0.32);
  border-radius: 50%;
  background: var(--surface-solid);
}
.hist__item.is-truth::after { border-color: var(--accent); background: var(--accent); }
.hist__item.is-named::after { border: 2px solid var(--accent); background: var(--surface-solid); }
.hist__item.is-now::after { border-color: var(--fg); background: var(--fg); box-shadow: 0 0 0 4px rgba(var(--ink-rgb), 0.08); }
.hist__item.is-viewing { background: var(--rule), linear-gradient(90deg, rgba(var(--accent-rgb), 0.1), transparent 70%); }
.hist__item.is-viewing::after { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.22); }
.hist__time { padding-top: 3px; font: 11px/1.4 var(--font-mono); color: var(--muted); white-space: nowrap; }
.hist__body { min-width: 0; }
.hist__title { margin: 0; font-size: 15.5px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; color: var(--fg); }
.hist__sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.hist__changes { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.hist__change::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 9px 2px 0; border-radius: 50%; background: rgba(var(--ink-rgb), 0.24); }
.hist__change.is-truth::before { background: var(--accent); }
.hist__change a { color: inherit; text-decoration: none; }
.hist__change a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.hist__more summary { display: inline-block; margin-top: 4px; cursor: pointer; list-style: none; font: 11px/1.6 var(--font-mono); color: var(--muted); }
.hist__more summary::-webkit-details-marker { display: none; }
.hist__more summary::after { content: " ↓"; }
.hist__more[open] summary::after { content: " ↑"; }
.hist__more summary:hover { color: var(--fg); }
.hist__actions { display: flex; align-items: center; gap: 14px; min-height: 34px; }
.hist__state { padding: 0 8px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.hist__state.is-on { color: var(--accent); }
@media (max-width: 640px) {
  .hist { --gutter-w: 24px; --node-y: 24px; }
  .hist__item, .hist--saved .hist__item { grid-template-columns: minmax(0, 1fr) auto; }
  .hist__time { grid-column: 1 / -1; padding-top: 0; }
}

/* Looking back: the whole app shows an earlier moment, read-only */
.past-bar { position: fixed; left: 50%; bottom: 20px; z-index: 60; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); }
.past-bar:empty { display: none; }
.past-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* On one line it's as wide as what it says; on two, each line sits in the middle, clear of the pill's round ends */
  justify-content: center;
  gap: 10px 22px;
  padding: 9px 9px 9px 22px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--surface-solid);
  box-shadow: 0 24px 60px -24px rgba(var(--shadow-rgb), 0.6);
}
.past-bar__text { display: flex; align-items: baseline; gap: 10px; min-width: 0; font-size: 14px; }
.past-bar__text .hud { color: var(--accent); }
.past-bar__text b { font-weight: 600; white-space: nowrap; }
.past-bar__title { max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.past-bar__actions { display: flex; gap: 6px; }
body.is-past .atmos { filter: grayscale(0.9); }
body.is-past .view { padding-bottom: 120px; }
body.is-past .toast { bottom: 96px; }
.atmos { transition: filter 600ms var(--ease); }
@media (max-width: 640px) {
  .past-bar__inner { padding: 12px 12px 12px 18px; }
  .past-bar__title { display: none; }
  body.is-past .toast { bottom: 140px; }
}

/* A storyboard made before the truth changed */
.drift { margin: 0 0 24px; padding: 16px 20px; border-radius: var(--radius-lg); background: var(--warn-soft); }
.drift .hud { color: var(--warn); }
.drift p { margin: 6px 0 8px; font-size: 14.5px; color: var(--fg); }
.drift ul { margin: 0 0 14px; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.drift a { color: inherit; }
.row__drift { color: var(--warn); }

/* Earlier versions of one page or subject */
.versions { margin: 0; padding: 0; list-style: none; }
.versions__item { border-top: 1px solid var(--line); }
.versions__item:last-child { border-bottom: 1px solid var(--line); }
.versions__item summary { display: flex; align-items: center; gap: 14px; padding: 14px 2px; cursor: pointer; list-style: none; }
.versions__item summary::-webkit-details-marker { display: none; }
.versions__when { font-size: 15px; font-weight: 500; }
.versions__what { font: 11px var(--font-mono); color: var(--muted); }
.versions__item summary .badge { margin-left: auto; }
.versions__doc { max-height: 300px; overflow: auto; margin: 0 0 14px; padding: 4px 22px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-sunk); font-size: 14px; }
.versions__doc h1, .versions__doc h2 { font-size: 18px; }
.versions__doc h3 { font-size: 15px; }
.versions__notes { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.versions .row-actions { padding-bottom: 14px; }

/* ---------- Rue: the agent beside every view ---------- */

.agent {
  position: fixed;
  top: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 380px;
  border-radius: var(--radius-2xl);
  /* The Space's colour, as the page has it: the atmosphere's base, with some of its light coming through */
  background: color-mix(in srgb, var(--field-panel, var(--surface-solid)) 80%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: 0 40px 90px -40px rgba(var(--shadow-rgb), 0.55);
  overflow: hidden;
}
.agent[hidden], .agent[hidden][data-dock] { display: none; }
/* Hidden with the logo: it slides a little toward its edge as it fades, then stops taking clicks or focus */
.agent { transition: opacity 0.24s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0s; }
.agent.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.2s var(--ease), transform 0.3s var(--ease), visibility 0s linear 0.3s; }
.agent[data-dock="right"].is-away { transform: translateX(24px) scale(0.985); }
.agent[data-dock="left"].is-away { transform: translateX(-24px) scale(0.985); }
.agent[data-dock="bottom"].is-away, .agent[data-dock="sheet"].is-away { transform: translateY(24px); }
.agent[data-dock="float"].is-away { transform: translateY(-8px) scale(0.97); }
/* Where Rue sits: docked right (the default) or left, along the bottom, floating, or on a phone,
   a bar along the bottom that opens when it's used */
.agent[data-dock="right"] { top: 14px; right: 14px; bottom: 14px; left: auto; width: 380px; }
.agent[data-dock="left"] { top: 14px; right: auto; bottom: 14px; left: 14px; width: 380px; }
.agent[data-dock="bottom"] { top: auto; right: 14px; bottom: 14px; left: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); grid-template-rows: auto minmax(0, 1fr); width: auto; height: 300px; }
.agent[data-dock="bottom"] .agent__head { grid-row: 1; grid-column: 1 / -1; }
.agent[data-dock="bottom"] .agent__scroll { grid-row: 2; grid-column: 1; }
.agent[data-dock="bottom"] .agent__form { grid-row: 2; grid-column: 2; overflow-y: auto; border-top: 0; border-left: 1px solid var(--line); }
.agent[data-dock="bottom"] .agent__chats { grid-row: 2; grid-column: 1 / -1; padding: 0 14px 12px; }
.agent[data-dock="bottom"] .agent__chat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 8px; }
.agent[data-dock="bottom"] .agent__needs ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.agent[data-dock="float"] { top: var(--ay, 90px); right: auto; bottom: auto; left: var(--ax, auto); width: 360px; height: min(560px, calc(100vh - 28px)); box-shadow: 0 40px 100px -30px rgba(var(--shadow-rgb), 0.7), 0 0 0 1px var(--glass-line); }
.agent.is-dragging { opacity: 0.94; }
body.is-docking { -webkit-user-select: none; user-select: none; cursor: grabbing; }
.agent__head[data-agent-grip] { cursor: grab; touch-action: none; }
.agent.is-dragging .agent__head { cursor: grabbing; }
/* The handle: a short bar at the top of the panel. The whole header drags; the bar is what a keyboard focuses. */
.agent__grip { position: absolute; top: 2px; left: 50%; width: 48px; height: 14px; margin-left: -24px; border-radius: 7px; cursor: grab; }
.agent__grip::before { content: ""; position: absolute; top: 5px; left: 50%; width: 28px; height: 4px; margin-left: -14px; border-radius: 2px; background: var(--line-2); transition: width var(--dur) var(--ease), margin-left var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.agent__head:hover .agent__grip::before, .agent__grip:focus-visible::before, .agent.is-dragging .agent__grip::before { width: 36px; margin-left: -18px; background: var(--muted); }
.agent__grip:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.agent__tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.agent__new { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.agent__new:hover { background: var(--glass-3); color: var(--fg); }
.agent__new:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.agent__new svg { width: 14px; height: 14px; }
.agent__expand { display: none; flex: none; width: 32px; height: 32px; box-shadow: none; }

/* The open chat's name, in the header: like the Space switcher, a name and a chevron. A click on it turns the panel
   into the list of chats (.agent__chats), and the name reads Chats until a chat is picked. */
.agent__chat { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 7px; min-width: 0; max-width: calc(100% - 44px); height: 32px; padding: 0 11px 0 13px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--fg); font: 600 13.5px/1 var(--font-sans); letter-spacing: -0.005em; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.agent__chat:hover, .agent__chat[aria-expanded="true"] { background: var(--glass-3); }
.agent__chat:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.agent__chat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.agent__chat-chev { flex: none; width: 12px; height: 12px; color: var(--muted); transition: transform 0.24s var(--ease); }
.agent__chat[aria-expanded="true"] .agent__chat-chev { transform: rotate(180deg); }
/* While the list shows, it has New chat at its top, so the header's + steps back */
.agent.is-listing .agent__new { visibility: hidden; }

/* The list of chats takes the panel's body: the chat, Needs you and the box give way to it */
.agent.is-listing .agent__scroll, .agent.is-listing .agent__form { display: none; }
.agent__chats { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 10px 12px; overscroll-behavior: contain; }
.agent__chats[hidden] { display: none; }
.agent__chat-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.agent__row { position: relative; border-radius: 15px; transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.agent__row:hover { background: var(--glass-3); }
[data-theme="dark"] .agent__row:hover { background: rgba(255, 255, 255, 0.07); }
/* the open chat sits on the same raised glass as the open place in the top bar, with a dot in the Space's colour */
.agent__row.is-on { background: var(--glass-top); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 6px 16px -10px rgba(var(--shadow-rgb), 0.55); }
[data-theme="dark"] .agent__row.is-on { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.agent__pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 10px; width: 100%; min-height: 58px; padding: 11px 46px 11px 14px; border: 0; border-radius: 15px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.agent__pick:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.agent__pick-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.3 var(--font-sans); color: var(--fg); }
.agent__row.is-on .agent__pick-name { font-weight: 600; }
.agent__row.is-on .agent__pick-name::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 0 0; border-radius: 50%; background: var(--accent); vertical-align: 0.12em; }
.agent__pick-when { font: 10.5px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; }
.agent__pick-last { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
/* Close: on hover or focus, and always where there's no hover */
.agent__pick-x { position: absolute; top: 50%; right: 10px; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.agent__row:hover .agent__pick-x, .agent__row:focus-within .agent__pick-x { opacity: 1; }
.agent__pick-x:hover { background: rgba(var(--ink-rgb), 0.08); color: var(--fg); }
[data-theme="dark"] .agent__pick-x:hover { background: rgba(255, 255, 255, 0.1); }
.agent__pick-x:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 0; }
.agent__pick-x svg { width: 12px; height: 12px; }
@media (hover: none) { .agent__pick-x { opacity: 1; } }
/* New chat, first: one line, a round + like the header's */
.agent__pick--new { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 8px 14px 8px 10px; color: var(--fg-2); }
.agent__pick--new .agent__pick-name { font-weight: 500; color: inherit; }
.agent__pick-plus { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg-2); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.agent__pick-plus svg { width: 14px; height: 14px; }
.agent__row--new:hover .agent__pick-plus { background: var(--fg); color: var(--bg); box-shadow: none; }
.agent__chats-note { margin: 10px 14px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
/* The turn: the list unfolds from the name, its rows a beat apart; picking one, the chat rises back into place */
.agent__chats:not([hidden]) { animation: agent-list-in 0.22s var(--ease) both; }
.agent__chats.is-entering .agent__row { animation: agent-row-in 0.26s var(--ease) both; animation-delay: calc(min(var(--i, 0), 8) * 18ms); }
.agent.is-back .agent__scroll, .agent.is-back .agent__form { animation: agent-chat-in 0.24s var(--ease) both; }
@keyframes agent-list-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes agent-row-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes agent-chat-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .agent__chats:not([hidden]), .agent__chats.is-entering .agent__row, .agent.is-back .agent__scroll, .agent.is-back .agent__form { animation: none; }
  .agent__chat-chev { transition: none; }
}
.agent__expand svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.agent.is-expanded .agent__expand svg { transform: rotate(180deg); }
@media (min-width: 1180px) {
  body.dock-right .topbar, body.dock-right .view { padding-right: calc(var(--gutter) + 394px); }
  body.dock-left .topbar, body.dock-left .view { padding-left: calc(var(--gutter) + 394px); }
  body.dock-right .past-bar, body.dock-right .toast { left: calc((100% - 394px) / 2); }
  body.dock-left .past-bar, body.dock-left .toast { left: calc((100% + 394px) / 2); }
}
@media (min-width: 761px) {
  body.dock-bottom .view { padding-bottom: 330px; }
  body.dock-bottom .past-bar, body.dock-bottom .toast { bottom: 330px; }
}
/* Docking moves the page with it: as a dock is chosen, the page slides to make room */
body.dock-anim .topbar, body.dock-anim .view { transition: padding 0.32s var(--ease); }
body.dock-anim .past-bar { transition: left 0.32s var(--ease), bottom 0.32s var(--ease); }
body.dock-anim .toast { transition: opacity 240ms var(--ease), transform 240ms var(--ease), left 0.32s var(--ease), bottom 0.32s var(--ease); }
.agent.is-morphing { transition: left 0.32s var(--ease), top 0.32s var(--ease), width 0.32s var(--ease), height 0.32s var(--ease); }
@media (prefers-reduced-motion: reduce) { body.dock-anim .topbar, body.dock-anim .view, body.dock-anim .past-bar, .agent.is-morphing { transition: none; } }
@media (max-width: 760px) {
  .agent, .agent[data-dock] { top: auto; right: 8px; bottom: 8px; left: 8px; display: flex; width: auto; height: auto; max-height: min(78vh, 640px); border-radius: 24px; }
  .agent.is-expanded { height: min(78vh, 640px); }
  .agent:not(.is-expanded) .agent__scroll, .agent:not(.is-expanded) .agent__ctx, .agent:not(.is-expanded) .agent__prompts, .agent:not(.is-expanded) .agent__note { display: none; }
  .agent:not(.is-expanded) .agent__form { border-top: 0; padding-top: 2px; }
  .agent:not(.is-expanded) .agent__chat, .agent:not(.is-expanded) .agent__tools, .agent:not(.is-expanded) .agent__chats { display: none; }
  .agent.is-listing:not(.is-expanded) .agent__form { display: block; }
  .agent:not(.is-expanded) .agent__head { min-height: 0; padding: 16px 0 0; }
  .agent__head { padding: 16px 10px 6px 8px; }
  .agent__expand { display: inline-grid; }
  body.dock-sheet .view { padding-bottom: 150px; }
  body.dock-sheet .toast, body.dock-sheet .past-bar { bottom: 140px; }
  body.dock-sheet.agent-expanded .toast { top: 14px; bottom: auto; }
}
/* While dragging: a short bar marks each dock; the one under the pointer opens into the space it will take */
.agent-zones { position: fixed; inset: 0; z-index: 44; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease); }
.agent-zones.is-on { opacity: 1; }
.agent-zones span {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1.5px solid transparent;
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.45);
  color: transparent;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: top 0.22s var(--ease), right 0.22s var(--ease), bottom 0.22s var(--ease), left 0.22s var(--ease), width 0.22s var(--ease), height 0.22s var(--ease), border-radius 0.22s var(--ease), background-color 0.22s var(--ease), border-color 0.22s var(--ease), color 0.15s var(--ease);
}
.agent-zones [data-zone="left"] { top: calc(50% - 44px); left: 6px; width: 4px; height: 88px; }
.agent-zones [data-zone="right"] { top: calc(50% - 44px); right: 6px; width: 4px; height: 88px; }
.agent-zones [data-zone="bottom"] { bottom: 6px; left: calc(50% - 44px); width: 88px; height: 4px; }
.agent-zones span.is-over { border-color: rgba(var(--accent-rgb), 0.5); border-radius: var(--radius-2xl); background: rgba(var(--accent-rgb), 0.09); color: var(--accent); }
.agent-zones [data-zone="left"].is-over { top: 14px; left: 14px; width: 380px; height: calc(100% - 28px); }
.agent-zones [data-zone="right"].is-over { top: 14px; right: 14px; width: 380px; height: calc(100% - 28px); }
.agent-zones [data-zone="bottom"].is-over { bottom: 14px; left: 14px; width: calc(100% - 28px); height: 300px; }
@media (max-width: 1179px) { .agent-zones [data-zone="left"], .agent-zones [data-zone="right"] { display: none; } }
@media (prefers-reduced-motion: reduce) { .agent-zones span { transition: none; } }
.agent__head { position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 18px 14px 8px 10px; }
.agent__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 14px; overscroll-behavior: contain; }

.agent__needs { margin: 4px 0 8px; }
.agent__needs .hud { margin: 0 0 8px; }
.agent__needs ul { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.agent__need { padding: 12px 14px; border: 1px solid var(--glass-line); border-radius: 16px; background: var(--glass-3); }
.agent__need p { margin: 0; font-size: 14px; font-weight: 500; line-height: 1.4; }
.agent__need p a { color: inherit; text-decoration: none; }
.agent__need p a:hover { text-decoration: underline; text-underline-offset: 3px; }
.agent__need small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.agent__need .agent__acts { margin-top: 10px; }

.agent__log { display: flex; flex-direction: column; gap: 14px; margin: 10px 0 0; padding: 0; list-style: none; }
.agent__msg { font-size: 14.5px; line-height: 1.55; color: var(--fg-2); }
.agent__msg p { margin: 0; }
.agent__msg p + p, .agent__msg p + ul, .agent__msg ul + p { margin-top: 8px; }
.agent__msg ul { margin: 0; padding-left: 18px; }
.agent__msg li { margin: 2px 0; }
.agent__msg a { color: var(--accent); }
.agent__msg b { color: var(--fg); font-weight: 600; }
.agent__msg--you { align-self: flex-end; max-width: 86%; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--fg); color: var(--bg); }
.agent__msg--rue { padding-right: 8px; }
.agent__hello p { font-size: 13.5px; color: var(--muted); }
.agent__hello p:first-child { font-size: 14.5px; }
.agent__hello b { font-weight: 500; }
.agent__when { font: 10.5px var(--font-mono); color: var(--muted); }
.agent__more { font: 10.5px var(--font-mono); color: var(--muted); }
.agent__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px !important; }
.agent__act {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-pill);
  background: var(--glass-3);
  color: var(--fg) !important;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.agent__act:hover { background: var(--fg); color: var(--bg) !important; }
.agent__act.is-done { border-color: transparent; background: transparent; color: var(--muted) !important; cursor: default; }
.agent__act--primary { border-color: transparent; background: var(--fg); color: var(--bg) !important; }
.agent__act--primary:hover { opacity: 0.86; }
.agent__act--quiet { border-color: transparent; background: transparent; color: var(--muted) !important; }
.agent__act--quiet:hover { background: var(--glass-3); color: var(--fg) !important; }
.agent__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0 !important; padding: 0 !important; list-style: none; }
.agent__thumbs li { margin: 0; }
.agent__thumbs button { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--surface-sunk); cursor: pointer; }
.agent__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.agent__thumbs span { display: block; padding: 6px; font: 9.5px/1.3 var(--font-mono); color: var(--muted); word-break: break-all; }
.agent__links { margin-top: 8px !important; padding: 0 !important; list-style: none; }
.agent__links li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.agent__links span { font: 10.5px var(--font-mono); color: var(--muted); }

.agent__form { flex: none; padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.agent__ctx { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: 0 4px 10px; font-size: 13px; color: var(--fg-2); }
.agent__ctx span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent__prompts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.agent__prompts:empty { display: none; }
.agent__prompt { padding: 6px 11px; border: 1px solid var(--glass-line); border-radius: var(--radius-pill); background: transparent; color: var(--fg-2); font: 400 12.5px/1.3 var(--font-sans); text-align: left; cursor: pointer; }
.agent__prompt:hover { color: var(--fg); background: var(--glass-3); }
.agent__box { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--glass-3); transition: border-color var(--dur) var(--ease); }
.agent__box:focus-within { border-color: var(--accent); }
.agent__box textarea { flex: 1 1 auto; min-width: 0; max-height: 160px; padding: 8px 0; border: 0; outline: none; background: transparent; resize: none; color: var(--fg); font: 400 15px/1.45 var(--font-sans); }
.agent__box textarea::placeholder { color: var(--muted); }
.agent__send { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); cursor: pointer; }
.agent__send svg { width: 16px; height: 16px; }
.agent__note { margin: 8px 4px 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* ---------- Tables ---------- */
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: var(--fg-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--fg); }
.tile__table { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--glass-line); border-radius: var(--radius-lg); background: var(--glass-3); overflow: hidden; }
.tmini { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); font: 10.5px/1.3 var(--font-mono); color: var(--fg-2); }
.tmini > span { padding: 5px 6px 5px 0; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmini .tmini__h { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 9.5px; border-bottom-color: var(--line-2); }

.tlist { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.tlist li { border-bottom: 1px solid var(--line); }
.tlist__row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto 20px; gap: 18px; align-items: center; padding: 18px 4px; color: inherit; text-decoration: none; }
.tlist__row:hover .tlist__name { text-decoration: underline; text-underline-offset: 4px; }
.tlist__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--glass-3); border: 1px solid var(--glass-line); color: var(--fg-2); }
.tlist__icon svg { width: 18px; height: 18px; }
.tlist__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tlist__name { font-size: 16px; font-weight: 500; letter-spacing: -0.01em; }
.tlist__cols { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--font-mono); color: var(--muted); }
.tlist__meta { font: 11px var(--font-mono); color: var(--muted); white-space: nowrap; }
@media (max-width: 640px) { .tlist__row { grid-template-columns: 36px minmax(0, 1fr) 20px; } .tlist__meta { display: none; } }

.tgrid-wrap { overflow: auto; max-height: min(70vh, 900px); border: 1px solid var(--glass-line); border-radius: var(--radius-lg); background: var(--glass-3); }
.tgrid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tgrid thead th { position: sticky; top: 0; z-index: 1; padding: 0; background: var(--surface-solid); border-bottom: 1px solid var(--line-2); text-align: left; }
.tgrid__col { display: block; width: 100%; min-width: 120px; padding: 12px 12px 11px; border: 0; background: transparent; text-align: left; font: 500 10.5px/1.2 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.tgrid__col:hover { color: var(--fg); }
.tgrid td { padding: 0; border-bottom: 1px solid var(--line); }
.tgrid tbody tr:last-child td, .tgrid tbody tr:last-child th { border-bottom: 0; }
.tgrid__n { width: 44px; padding: 0 8px 0 14px !important; border-bottom: 1px solid var(--line); text-align: right; font: 10.5px var(--font-mono); color: var(--faint, var(--muted)); font-weight: 400; }
thead .tgrid__n { border-bottom-color: var(--line-2); }
.tgrid__cell { display: block; width: 100%; min-width: 120px; padding: 11px 12px; border: 0; background: transparent; color: var(--fg); font: 400 14px/1.35 var(--font-sans); outline: none; }
.tgrid__cell:focus { background: var(--surface-solid); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 4px; }
.tgrid tbody th { border-bottom: 1px solid var(--line); }
.tgrid__x { width: 40px; text-align: center; }
.tgrid tbody .tgrid__x .ref-btn { opacity: 0; }
.tgrid tbody tr:hover .tgrid__x .ref-btn, .tgrid tbody .tgrid__x .ref-btn:focus-visible { opacity: 1; }
.tgrid__empty { padding: 28px 16px !important; text-align: center; color: var(--muted); }
.tgrid__foot { margin: 12px 2px 0; font: 11px var(--font-mono); color: var(--muted); }
.tgrid__foot:empty { display: none; }
.fact-warn { margin-top: 16px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--rec-soft); }
.fact-warn .hud { color: var(--rec-ink); }
.fact-warn p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--fg); }
.fact-warn a { color: inherit; }
.fact-warn:empty, #fact-warn:empty { display: none; }

/* ---------- Audio ---------- */
.play-btn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); cursor: pointer; transition: transform var(--dur) var(--ease); }
.play-btn:hover { transform: scale(1.06); }
.play-btn svg { width: 14px; height: 14px; }
.play-btn .play-btn__pause, .play-btn.is-playing .play-btn__play { display: none; }
.play-btn.is-playing .play-btn__pause { display: block; }
.play-btn.is-playing { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.22); }
.view-slot__audio { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.aref { display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px; border-radius: var(--radius-md); background: var(--surface-sunk); }
.aref__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.aref__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.aref__meta { font: 10.5px var(--font-mono); color: var(--muted); }
.view-slot__empty--audio { min-height: 76px; }
.asset-detail__audio { display: block; width: 100%; margin-top: 12px; }
.sound { margin: 28px 0 0; }
.sound__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sound__row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.sound__row .hud { flex: none; width: 52px; }
.sound__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.sound__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--fg); }
.sound__meta { font: 10.5px var(--font-mono); color: var(--muted); }
.sound__row.is-missing .sound__body { color: var(--muted); }
.sound__row.is-missing a { color: var(--accent); }

/* ---------- Workspace colour ---------- */
.look { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.look__swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--glass-3);
  color: var(--fg-2);
  font: 400 13.5px/1 var(--font-sans);
  cursor: pointer;
}
.look__swatch > span { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.12); }
.look__swatch--formula > span { background: conic-gradient(from 200deg, #68D6EC, #7EABFF, #AB8AFF, #FFA680, #FF98BE, #68D6EC); }
.look__swatch[aria-checked="true"], .look__custom.is-on { border-color: var(--fg); color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.look__custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.look__custom > span { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.look__custom:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.look__check { margin: 12px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.look__ok { margin-right: 6px; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok); font: 500 10px/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- Templates ---------- */
.tpl-group + .tpl-group { margin-top: 56px; }
.tpl-cats { margin: 0 0 22px; }
.tpl-cats button { min-height: 34px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: transparent; color: var(--fg-2); font: 400 13.5px/1 var(--font-sans); cursor: pointer; }
.tpl-cats button[aria-current="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.tpl { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--glass-line); border-radius: var(--radius-2xl); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 30px 70px -54px rgba(var(--shadow-rgb), 0.7); overflow: hidden; }
.tpl__frames {
  position: relative;
  display: flex;
  gap: 6px;
  height: 196px;
  padding: 14px 14px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent);
  mask-image: linear-gradient(90deg, #000 78%, transparent);
}
.tpl__frames--post { -webkit-mask-image: none; mask-image: none; justify-content: center; }
.tpl__frame { flex: none; height: 100%; aspect-ratio: var(--ar); border-radius: 12px; overflow: hidden; background: var(--surface-sunk); }
.tpl__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.tpl:hover .tpl__frame img { transform: scale(1.05); }
.tpl__frame--empty { width: 40%; }
.tpl__body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; padding: 16px 20px 20px; }
.tpl__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font: 10.5px/1.4 var(--font-mono); letter-spacing: 0.06em; color: var(--muted); }
.tpl__name { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
.tpl__text { font-size: 14.5px; line-height: 1.55; color: var(--fg-2); }
.tpl__beats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tpl__beats span { padding: 4px 9px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); font: 10px/1.3 var(--font-mono); letter-spacing: 0.04em; color: var(--fg-2); }
.tpl__beats span + span::before { content: "→ "; color: var(--muted); }
.tpl__actions { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 14px; }
.tpl-hint { margin: 28px 0 0; font-size: 14px; color: var(--muted); }
.tpl-use__meta { margin: 0 0 6px; font: 11px/1.6 var(--font-mono); color: var(--muted); }
.tpl-chips { margin-top: 8px; }
.tpl-use__preview { margin-top: 4px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface-sunk); }
.tpl-use__preview p { margin: 6px 0 0; font-size: 16px; line-height: 1.5; color: var(--fg); }
.composer-alt { margin: 10px 4px 0; text-align: right; }
.welcome__spaces { margin-top: 28px; }
.welcome__spaces .hud { margin: 0 0 10px; }

/* Space templates: the same short rectangle for every template, the cover beside its name, a few lines and what's inside */
.space-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; container-type: inline-size; }
.space-tpl { min-width: 0; }
.space-tpl__open { display: flex; width: 100%; height: 212px; padding: 0; border: 1px solid var(--glass-line); border-radius: 22px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); overflow: hidden; color: var(--fg); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 24px 60px -48px rgba(var(--shadow-rgb), 0.7); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.space-tpl__open:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 30px 70px -44px rgba(var(--shadow-rgb), 0.75); }
.space-tpl__open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.space-tpl__img { position: relative; flex: 0 0 44%; background: var(--surface-sunk); }
.space-tpl__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.space-tpl__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 5px; min-width: 0; padding: 16px 18px; }
.space-tpl__name { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.space-tpl__text { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.space-tpl__counts { margin-top: auto; padding-top: 6px; font-size: 11.5px; color: var(--muted); }
/* Narrow screens: the cover above, still a rectangle */
@media (max-width: 560px) {
  .space-tpl__open { flex-direction: column; height: auto; }
  .space-tpl__img { flex: none; aspect-ratio: 2 / 1; }
  .space-tpl__text { -webkit-line-clamp: 2; min-height: calc(2 * 1.45em); }
}

.space-tpl__meta { display: inline-flex; align-items: center; gap: 8px; font: 10px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.space-tpl__meta i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--c) 40%, transparent); }
/* A cover for templates without a photo: the Space's own colour as atmosphere, its table and subjects on glass */
.space-tpl__cover { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 14px 16px; overflow: hidden;
  background:
    radial-gradient(60% 55% at 22% 18%, color-mix(in srgb, var(--c) 62%, transparent), transparent 70%),
    radial-gradient(55% 60% at 88% 92%, color-mix(in srgb, var(--c) 46%, transparent), transparent 72%),
    radial-gradient(40% 40% at 90% 10%, color-mix(in srgb, var(--c) 28%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 14%, var(--surface-sunk)), var(--surface-sunk)); }
.space-tpl__sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow: hidden; transform: rotate(-3deg); box-shadow: 0 24px 50px -30px rgba(var(--shadow-rgb), 0.7); }
.space-tpl__sheet b { grid-column: 1 / -1; padding: 10px 12px 8px; font-size: 13px; font-weight: 600; color: var(--fg); border-bottom: 1px solid var(--glass-line); }
.space-tpl__sheet span { padding: 7px 12px; font: 10px/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--glass-line); }
.space-tpl__sheet span:nth-child(even) { border-right: 1px solid var(--glass-line); }
.space-tpl__chips { display: flex; flex-wrap: wrap; gap: 6px; transform: rotate(-3deg); }
.space-tpl__chips span { padding: 4px 10px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 12px; color: var(--fg); }
.tpl-cats__n { margin-left: 2px; font: 10px/1 var(--font-mono); color: var(--muted); }
.tpl-cats button[aria-current="true"] .tpl-cats__n { color: inherit; opacity: 0.7; }
.welcome__group { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--line); }
.welcome__cat { font: 10px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) { .welcome__group { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* ---- publishing calendar */
.cal { margin: 6px 0 36px; }
.cal-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 14px 0; font-size: 14px; color: var(--fg-2); }
.cal-summary b { color: var(--fg); font-weight: 600; }
.cal-flag { font-size: 13px; font-weight: 500; }
.cal-flag + .cal-flag::before { content: "·"; margin-right: 8px; color: var(--faint); }
.cal-flag--held, .cal-flag--due { color: var(--warn); }
.cal-flag--warn { color: var(--rec-ink); }

.cal-tz { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }



.cal-thumb { display: block; width: 34px; aspect-ratio: var(--ar, 1); max-height: 46px; border-radius: 6px; background: var(--surface-sunk); overflow: hidden; }
.cal-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cal-thumb--page { display: grid; place-items: center; height: 40px; color: var(--fg-2); }
.cal-thumb--page svg { width: 16px; height: 16px; }
.cal-state { padding: 3px 9px; border-radius: var(--radius-pill); font-size: 12px; white-space: nowrap; background: var(--primary-soft); color: var(--accent); }
.cal-state--held, .cal-state--due { background: var(--warn-soft); color: var(--warn); }
.cal-state--blocked { background: var(--rec-soft); color: var(--rec-ink); }
.cal-state--posted { background: var(--ok-soft); color: var(--ok); }
.cal-empty { padding: 40px 20px; text-align: center; color: var(--fg-2); }

/* Laid out like Formula's Mac calendar: ‹ month year › with Today, Month / Agenda and a few toggles, then an
   open grid (no boxes, no rules: the day's number and a dot per post) with the picked day beside it */
.cal-top { display: flex; align-items: center; gap: 6px; margin: 0 0 16px; }
/* The month and year, on one line in the room the longest takes: the h2 and an unseen "September" with the same year
   share one grid cell (a year's figures are all one width), so neither arrow moves from month to month. It never
   shrinks; a shorter month sits in the middle of the room. */
.cal-top__name { display: grid; flex: none; margin: 0 4px; font-size: 26px; font-weight: 650; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-top__name > * { grid-area: 1 / 1; }
.cal-top__title { margin: 0; font: inherit; text-align: center; color: var(--fg); }
.cal-top__fit { visibility: hidden; }
.cal-nav, .cal-today { display: inline-grid; place-items: center; height: 32px; border: 0; background: transparent; color: var(--accent); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.cal-nav { flex: none; width: 32px; padding: 0; border-radius: 50%; }
.cal-nav svg { width: 15px; height: 15px; }
.cal-top__acts { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
/* The buttons go under the month once the calendar itself is too narrow for one line (whatever the window and dock),
   before anything has to shrink: squeezed, the round arrows turned into ellipses */
@container cal (max-width: 860px) { .cal-top { flex-wrap: wrap; } .cal-top__acts { order: 9; flex: 1 0 100%; flex-wrap: wrap; justify-content: flex-end; margin: 10px 0 0; } }
.cal-today { margin-left: auto; padding: 0 12px; border-radius: var(--radius-pill); font: 600 14px/1 var(--font-sans); }
.cal-nav:hover, .cal-today:hover { background: rgba(var(--accent-rgb), 0.1); }
.cal-nav:focus-visible, .cal-today:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; }
.cal-chips__group { display: flex; flex-wrap: wrap; gap: 6px; }
/* Month / Agenda, as a segmented control */
.cal-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); }
.cal-seg .cal-chip { height: 28px; padding: 0 16px; border: 0; background: transparent; color: var(--fg-2); }
.cal-seg .cal-chip[aria-pressed="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
[data-theme="dark"] .cal-seg { background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .cal-seg .cal-chip[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); box-shadow: none; }
/* The toggles: quiet until they're on, then tinted */
.cal-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--muted); font: 500 12.5px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.cal-chip:hover { background: rgba(var(--ink-rgb), 0.05); color: var(--fg); }
.cal-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-chips__group .cal-chip[aria-pressed="true"] { background: rgba(var(--accent-rgb), 0.14); color: var(--accent); }
.cal-chip--outlet i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.cal-chips__group .cal-chip--outlet[aria-pressed="true"] { background: transparent; color: var(--fg-2); }
.cal-chips__group .cal-chip--outlet[aria-pressed="true"]:hover { background: rgba(var(--ink-rgb), 0.05); }
.cal-chip--outlet[aria-pressed="false"] { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(var(--ink-rgb), 0.3); }
.cal-chip--outlet[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.cal-pane { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; }
.cal-pane.is-agenda { grid-template-columns: minmax(0, 680px) 300px; justify-content: space-between; }
.cal-month { min-width: 0; }
.cal-month__head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0 0 6px; }
.cal-month__head span { font: 500 11px/1 var(--font-sans); text-align: center; color: var(--muted); }
.cal-month__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 64px; gap: 4px; }
.cal-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 10px 0 0; border: 0; border-radius: 12px; background: transparent; color: var(--fg); font: inherit; cursor: pointer; transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cal-cell:hover { background: rgba(var(--ink-rgb), 0.04); }
.cal-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal-cell__n { font: 400 14px/1.2 var(--font-sans); font-variant-numeric: tabular-nums; }
.cal-cell.is-out .cal-cell__n { color: var(--muted); opacity: 0.45; }
.cal-cell.is-today .cal-cell__n { color: var(--accent); font-weight: 700; }
.cal-cell.is-today:not(.is-sel) { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.5); }
.cal-cell.is-sel { background: rgba(var(--accent-rgb), 0.16); }
.cal-cell__dots { display: flex; align-items: center; justify-content: center; gap: 3px; height: 6px; }
.cal-cell__dots i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-cell__dots i.is-posted { opacity: 0.4; }
.cal-cell__dots i.is-held { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.cal-cell__dots i.is-blocked { opacity: 0.3; }
.cal-cell__dots b { margin-left: 1px; font: 600 9.5px/1 var(--font-sans); color: var(--muted); }
.cal-cell__warn { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--rec); }
.cal-cell.is-over, .cal-ag__day.is-over { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-dp.is-over { border-radius: 14px; background: var(--primary-soft); box-shadow: 0 0 0 8px var(--primary-soft); }
/* The picked day, beside the grid: its name, what goes out, then what's ready to schedule */
.cal-dp { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cal-dp__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.cal-dp__wd { margin: 0; font-size: 14px; font-weight: 600; color: var(--fg); }
.cal-dp__add { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent); font: 400 20px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.cal-dp__add:hover { background: rgba(var(--accent-rgb), 0.1); }
.cal-dp__none { margin: 0; font-size: 13px; color: var(--muted); }
.cal-dp__ready { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.cal-dp__label { margin: 0 0 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cal-dp__hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.cal-ready { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.cal-ready__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 6px; border-radius: 12px; cursor: grab; transition: background-color var(--dur) var(--ease); }
.cal-ready__item:hover { background: rgba(var(--ink-rgb), 0.04); }
.cal-ready__item .strip { gap: 2px; }
.cal-ready__item .strip__cell { width: 16px; border-radius: 4px; }
.cal-ready__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ready__title { font-size: 13.5px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ready__meta { font-size: 11.5px; color: var(--muted); }
/* A post: a colour rule, its title, then what it is, where and when, as on the Mac */
.cal-evs { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cal-ev { cursor: grab; }
.cal-ev:active { cursor: grabbing; }
.cal-ev__btn { display: grid; grid-template-columns: 3px auto minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 12px; background: rgba(var(--ink-rgb), 0.04); color: var(--fg); font: inherit; text-align: left; cursor: inherit; transition: background-color var(--dur) var(--ease); }
[data-theme="dark"] .cal-ev__btn { background: rgba(255, 255, 255, 0.05); }
.cal-ev__btn:hover { background: rgba(var(--ink-rgb), 0.07); }
[data-theme="dark"] .cal-ev__btn:hover { background: rgba(255, 255, 255, 0.08); }
.cal-ev__rule { width: 3px; height: 30px; border-radius: 2px; background: var(--c); }
.cal-ev .cal-thumb { width: 24px; max-height: 32px; }
.cal-ev .cal-thumb--page { height: 28px; }
.cal-ev__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-ev__title { overflow: hidden; font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 11.5px; color: var(--muted); }
.cal-ev__state { font-weight: 600; color: var(--accent); }
.cal-ev.is-held .cal-ev__state, .cal-ev.is-due .cal-ev__state { color: var(--warn); }
.cal-ev.is-blocked .cal-ev__state { color: var(--rec-ink); }
.cal-ev.is-posted .cal-ev__state { color: var(--ok); }
.cal-ev.is-posted .cal-ev__title { color: var(--muted); text-decoration: line-through; }
.cal-ev.is-blocked .cal-ev__btn { opacity: 0.55; }
.cal-ev__out { display: inline-flex; align-items: center; gap: 4px; }
.cal-ev__out i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.cal-ev__warn { font-size: 11.5px; line-height: 1.4; color: var(--rec-ink); }
/* Agenda: each day under a small heading, today in the accent */
.cal-ag { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cal-ag__day { padding: 2px; border-radius: 14px; }
.cal-ag__head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--fg); }
.cal-ag__wd { color: var(--muted); font-weight: 500; }
.cal-ag__day.is-today .cal-ag__wd, .cal-ag__day.is-today .cal-ag__date { color: var(--accent); }
.cal-ag__today { color: var(--accent); font-size: 12px; font-weight: 600; }
.cal-ag__day.is-past .cal-ag__date { color: var(--muted); }
body.is-planning .cal-cell { cursor: copy; }

.outlets { margin: 0 0 36px; }
.outlets__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.outlets__head .section-title { margin: 0; }
.outlets__lede, .outlets__none { max-width: 70ch; margin: 8px 0 14px; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.outlet-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.outlet { display: grid; grid-template-columns: 12px minmax(130px, 1fr) minmax(120px, 1fr) minmax(0, 2fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.outlet__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.outlet__name { display: flex; flex-direction: column; min-width: 0; }
.outlet__name b { font-weight: 600; }
.outlet__name span, .outlet__takes, .outlet__count { font-size: 12.5px; color: var(--muted); }
.outlet__handle { color: var(--fg-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.outlet__conn { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); font: 10px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.field__opt { font-weight: 400; color: var(--muted); }

.pf-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--surface-sunk); font-size: 14px; color: var(--fg-2); }
.pf-status__acts { display: flex; flex-wrap: wrap; gap: 6px 16px; width: 100%; }
.pf-preview { display: flex; align-items: center; gap: 12px; margin: -4px 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.pf-preview .strip { gap: 3px; }
.pf-preview .strip__cell { width: 28px; border-radius: 5px; }
.pf-preview__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pf-preview__body b { font-size: 14.5px; font-weight: 600; }
.pf-preview__body span, .pf-preview__none { margin: 0; font-size: 12.5px; color: var(--muted); }
.pf-outlets { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.pf-outlets__list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pf-outlet { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); font-size: 14px; cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.pf-outlet input { width: 15px; height: 15px; margin: 0; accent-color: var(--fg); }
.pf-outlet i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.pf-outlet:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.pf-outlet.is-off { opacity: 0.5; cursor: not-allowed; }
.pf-outlet__why { font: 10px/1.4 var(--font-mono); color: var(--muted); }
.pf-outlet__why:empty { display: none; }
.pf-none { margin: 6px 0 0; font-size: 14px; color: var(--fg-2); }
.pf-when { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pf-caption { min-height: 92px; resize: vertical; font: inherit; line-height: 1.5; }
#pf-count.is-over { color: var(--rec-ink); }
.pf-checks:empty { display: none; }
.pf-checks { margin-top: 4px; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--warn-soft); }
.pf-checks .hud { margin: 0 0 6px; color: var(--warn); }
.pf-checks ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--fg); }

/* The picked day goes under the grid when the calendar itself is narrow, whatever the window and dock */
.cal { container: cal / inline-size; }
@container cal (max-width: 820px) {
  .cal-pane, .cal-pane.is-agenda { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 1100px) {
  .outlet { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .outlet__handle, .outlet__takes { grid-column: 2 / -1; }
  .outlet__count, .outlet__conn { display: none; }
  .outlet .link-btn { grid-column: 3; grid-row: 1; }
}
@media (max-width: 640px) {
  .cal-top__name { font-size: 21px; }
  .cal-month__days { grid-auto-rows: 50px; gap: 2px; }
  .cal-cell { gap: 5px; padding-top: 8px; border-radius: 10px; }
  .cal-cell__n { font-size: 13px; }
  .cal-cell__dots { gap: 2px; }
  .cal-cell__dots i { width: 5px; height: 5px; }
  .cal-cell__warn { top: 6px; right: 6px; width: 5px; height: 5px; }
  .pf-when { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
/* Narrower than a 320px phone (a folded one is 280px): the month a little smaller, so it still fits between the arrows */
@container cal (max-width: 255px) { .cal-top__name { font-size: 18px; } }

/* ---- template search and filters: one slim row */
.tpl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 30px; }
.tpl-search { position: relative; flex: 0 1 260px; min-width: 180px; }
.tpl-search > svg { position: absolute; top: 50%; left: 12px; width: 14px; height: 14px; margin-top: -7px; color: var(--muted); pointer-events: none; }
.tpl-search__input { width: 100%; height: 34px; padding: 0 30px 0 32px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--glass); color: var(--fg); font: 400 13.5px/1 var(--font-sans); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tpl-search__input::placeholder { color: var(--muted); }
.tpl-search__input:hover { border-color: var(--line-3); }
.tpl-search__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tpl-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.tpl-search kbd { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); min-width: 18px; padding: 1px 5px; border: 1px solid var(--line-2); border-radius: 5px; font: 10px/1.4 var(--font-mono); text-align: center; color: var(--muted); pointer-events: none; }
.tpl-search__input:focus + kbd, .tpl-search__input:not(:placeholder-shown) + kbd { display: none; }
.tpl-bar__filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tpl-select { -webkit-appearance: none; appearance: none; field-sizing: content; max-width: 240px; height: 34px; padding: 0 28px 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--fg-2); font: 400 13.5px/1 var(--font-sans); cursor: pointer;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A8499' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5 12 15l5.5-5.5'/%3E%3C/svg%3E") no-repeat right 10px center / 10px;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.tpl-select:hover { border-color: var(--line-3); color: var(--fg); }
.tpl-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tpl-select.is-set { border-color: var(--fg); background-color: rgba(var(--ink-rgb), 0.05); color: var(--fg); }
.tpl-select option { color: var(--fg); background: var(--surface-solid); }
.tpl-bar__count { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: 0 0 0 auto; font-size: 13px; color: var(--muted); }
.tpl-bar__count a { color: var(--accent); }
.tpl-bar__sep { padding: 0 6px; color: var(--faint); }
.tpl-group__lede { margin: -8px 0 16px; font-size: 14px; color: var(--muted); }
.tpl-group + .tpl-hint { margin-top: 28px; }

.tpl__goal { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-2); }
.tpl__goal i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.tpl__fit { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--primary-soft); color: var(--accent); font: 500 11px/1.5 var(--font-sans); letter-spacing: 0; vertical-align: 3px; }
.tpl__cost { font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.tpl__frame--sketch { position: relative; display: grid; place-items: center; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, var(--surface-solid)), color-mix(in srgb, var(--c) 9%, var(--surface-solid))); color: color-mix(in srgb, var(--c) 72%, var(--fg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
.tpl__glyph { width: 34%; max-width: 46px; height: auto; margin-bottom: 18px; }
.tpl__cue { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 1px; font: 9px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
.tpl__cue b { color: color-mix(in srgb, var(--c) 78%, var(--fg)); font-weight: 600; }
.tpl:hover .tpl__frame--sketch .tpl__glyph { transform: scale(1.06); transition: transform 0.6s var(--ease-out); }

.tpl-use { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.tpl-use__side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tpl-use__side .tpl-use__preview { margin-top: 0; }
.tpl-use__cap { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg); }
.tpl-use__preview .fact-warn { margin-top: 10px; }
.tpl-use__shots { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.45; }
.tpl-use__shots li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 1px 8px; }
.tpl-use__shots b { grid-column: 2; font-weight: 600; color: var(--fg); }
.tpl-use__shots li > span:last-child { grid-column: 2; color: var(--fg-2); }
.tpl-use__n { grid-row: span 2; font: 10px/1.9 var(--font-mono); color: var(--muted); }
.welcome__all { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--accent); }
@media (max-width: 760px) { .tpl-use { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .tpl-search { flex: 1 1 100%; } .tpl-search kbd { display: none; } .tpl-bar__count { margin-left: 0; width: 100%; } }

/* ---------- Recipes ---------- */
/* Recipes or Spaces, beside the search: a small switch rather than a second row of tabs */
.tpl-kinds { display: inline-flex; flex: none; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); }
.tpl-kinds a { display: inline-flex; align-items: center; height: 28px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--fg-2); font-size: 13.5px; text-decoration: none; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tpl-kinds a:hover { color: var(--fg); }
.tpl-kinds a[aria-current="page"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
.tpl-kinds a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A recipe's card: its steps where a storyboard shows its frames, the same height */
.rc-chain { position: relative; display: flex; gap: 6px; height: 196px; padding: 14px 14px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
.rc-chain__step { position: relative; display: grid; place-items: center; flex: none; width: 104px; height: 100%; border-radius: 12px; color: color-mix(in srgb, var(--c) 72%, var(--fg));
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 26%, var(--surface-solid)), color-mix(in srgb, var(--c) 8%, var(--surface-solid))); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 22%, transparent); }
.rc-chain__step.is-rue { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--surface-solid)), var(--surface-solid)); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent); }
.rc-chain__icon { display: block; width: 34px; margin-bottom: 30px; }
.rc-chain__icon svg { display: block; width: 100%; height: auto; }
.tpl:hover .rc-chain__icon { transform: scale(1.06); transition: transform 0.6s var(--ease-out); }
.rc-chain__by { position: absolute; top: 8px; right: 8px; padding: 1px 6px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--accent) 16%, transparent); font: 600 9px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.rc-chain__step.is-rue .tpl__cue b { color: var(--accent); }

/* Recent runs: one line each */
.rc-runs__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.rc-run { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; width: 100%; padding: 12px 16px; border: 1px solid var(--glass-line); border-radius: var(--radius-lg); background: var(--glass); color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.rc-run:hover { border-color: var(--line-2); transform: translateY(-1px); }
.rc-run:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-run b { overflow: hidden; font-size: 14.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rc-run > span:nth-child(2) { font: 10.5px/1.9 var(--font-mono); color: var(--muted); }
.rc-run__state { grid-column: 1 / -1; font-size: 12.5px; color: var(--fg-2); }
.rc-run__state.is-waiting { color: var(--accent); }

/* The runner: what you give it on the left, what it does on the right */
.rc { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 22px; align-items: start; margin-top: 8px; }
.rc__inputs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc__inputs .field { margin: 0 0 12px; }
.rc__flow { min-width: 0; padding: 14px 14px 6px; border-radius: var(--radius-lg); background: var(--surface-sunk); }
.rc__flow > .hud { margin: 0 0 10px; }
.rc-outlets { display: flex; flex-wrap: wrap; gap: 6px; }
.rc-outlet { position: relative; cursor: pointer; }
.rc-outlet input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rc-outlet span { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); font-size: 13px; color: var(--fg-2); transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.rc-outlet input:checked + span { border-color: var(--fg); background: var(--surface-solid); color: var(--fg); }
.rc-outlet input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rc-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* The steps, numbered down a thin line */
.rc-steps { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.rc-step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; }
.rc-step:not(:last-child)::before { content: ""; position: absolute; top: 26px; bottom: -10px; left: 10.5px; width: 1px; background: var(--line-2); }
.rc-step__n { display: grid; place-items: center; width: 22px; height: 22px; margin-top: 10px; border-radius: 50%; background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line-2); font: 600 10px/1 var(--font-mono); color: var(--fg-2); }
.rc-step--rue .rc-step__n { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.rc-step__card { min-width: 0; padding: 10px 12px 12px; border-radius: 12px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.08), 0 8px 24px -20px rgba(var(--shadow-rgb), 0.6); }
.rc-step__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rc-step__head b { flex: 1 1 auto; min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rc-step__icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); }
.rc-step__icon svg { width: 15px; height: 15px; }
.rc-step--rue .rc-step__icon { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rc-by { flex: none; padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); font: 500 10px/1.5 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); }
.rc-step--rue .rc-by { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rc-step__say { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.rc-step__say a { color: var(--accent); }
.rc-step__note { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rc-step__note.is-warn { padding: 8px 10px; border-radius: 9px; background: var(--rec-soft); color: var(--rec-ink); }
.rc-step__still .tpl__frames { height: 112px; padding: 10px 0 0; gap: 5px; }
.rc-step__still .tpl__frame { border-radius: 8px; }
.rc-step__still .tpl__cue { left: 6px; bottom: 6px; font-size: 8px; }
.rc-step__out { margin-top: 8px; }
.rc-step__out:empty { display: none; }
.rc-step__out .tpl-use__shots { margin-top: 8px; font-size: 12.5px; }
.rc-step__out .fact-warn { margin-top: 8px; padding: 10px 12px; }
.rc-step__out .fact-warn p { font-size: 13px; }
.rc-brief { margin-top: 8px; }
.rc-brief summary { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); cursor: pointer; list-style: none; }
.rc-brief summary::-webkit-details-marker { display: none; }
.rc-brief summary::before { content: ""; width: 5px; height: 5px; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.rc-brief[open] summary::before { transform: rotate(45deg); }
.rc-brief pre { max-height: 220px; margin: 8px 0 0; padding: 10px 12px; overflow: auto; border-radius: 9px; background: var(--surface-sunk); font: 11.5px/1.55 var(--font-mono); font-variant-ligatures: none; color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-note { margin: 12px 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rc-state { flex: none; padding: 2px 8px; border-radius: var(--radius-pill); font: 500 10px/1.5 var(--font-mono); letter-spacing: 0.04em; }
.rc-state--done { background: var(--ok-soft); color: var(--ok); }
.rc-state--waiting { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rc-state--skipped { background: rgba(var(--ink-rgb), 0.06); color: var(--muted); }
.rc-state--failed { background: var(--rec-soft); color: var(--rec-ink); }
.rc-steps--ran { margin-top: 6px; }
.rc-given { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 14px; }
.rc-given div { min-width: 0; }
.rc-given dt { font: 10px/1.6 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rc-given dd { margin: 0; font-size: 13.5px; color: var(--fg); }

/* ---------- Recipe builder ---------- */
/* Quiet by default: words in sentence case, one panel for each list with hairlines between its rows,
   and fields that show an edge only once they're used. The recipe running sits beside it, past a line. */
.rb-wrap { container: rb / inline-size; }
.rb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr); gap: clamp(28px, 3.4vw, 52px); align-items: start; margin-top: 8px; }
.rb__edit { min-width: 0; }
.rb__preview { position: sticky; top: 96px; min-width: 0; max-height: calc(100vh - 116px); overflow: auto; padding: 2px 2px 12px clamp(20px, 2.4vw, 32px); border-left: 1px solid var(--line); scrollbar-width: thin; }
.rb-preview__head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.rb-preview__head .hud { margin: 0; font: 600 13px/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--fg); }
.rb-preview__head .tpl-use__meta { margin: 0; font: 12.5px/1.5 var(--font-sans); letter-spacing: 0; color: var(--muted); }
/* Fields: soft until you use them */
.rb .input, .rb .select, .rb .textarea { min-height: 36px; padding: 7px 11px; border-color: transparent; border-radius: 10px; background-color: var(--surface-sunk); font-size: 13.5px; box-shadow: none; }
.rb .select { padding-right: 32px; background-position: right 11px center; }
.rb .textarea { min-height: 0; padding: 8px 11px; line-height: 1.55; resize: vertical; }
.rb .input:hover, .rb .select:hover, .rb .textarea:hover { border-color: var(--line-2); }
.rb .input:focus, .rb .select:focus, .rb .textarea:focus { border-color: var(--primary); background-color: var(--field-input); box-shadow: 0 0 0 3px var(--primary-soft); }
/* The head: its name, what it's for, and two actions */
.rb-name { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--fg); font: 600 clamp(30px, 3.6vw, 44px)/1.1 var(--font-sans); letter-spacing: -0.035em; }
.rb-text { display: block; width: 100%; margin: 10px 0 0; padding: 0; border: 0; background: none; resize: none; field-sizing: content; min-height: 1.55em; color: var(--fg-2); font: 400 16px/1.55 var(--font-sans); }
.rb-name::placeholder, .rb-text::placeholder { color: var(--faint); }
.rb-name:focus, .rb-text:focus { outline: none; }
.rb-name:focus-visible, .rb-text:focus-visible { box-shadow: 0 2px 0 -0.5px var(--accent); }
.rb-head__note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.rb-head__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.rb-head__row .select { width: auto; min-height: 32px; padding-top: 5px; padding-bottom: 5px; border-radius: 999px; font-size: 13px; }
.rb-head__acts { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.rb .link-btn { font: 500 13px/1 var(--font-sans); letter-spacing: 0; text-transform: none; }
.rb-head .rb-warn { margin: 14px 0 0; }
/* Each list is one panel, with a hairline between its rows */
.rb-sec { margin-top: 36px; }
.rb-sec__title { margin: 0 0 10px; font: 600 13px/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.rb-empty { margin: 0 0 4px; font-size: 13.5px; color: var(--muted); }
.rb-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); overflow: hidden; }
.rb-list > li + li { box-shadow: inset 0 1px 0 var(--line); }
.rb-sec > .rb-card { border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.rb-card { min-width: 0; transition: background-color var(--dur) var(--ease); }
.rb-list .rb-card.is-open { background: color-mix(in srgb, var(--accent) 3%, var(--surface-solid)); }
.rb-card__head { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 6px 8px 6px 14px; }
.rb-card__icon { flex: none; display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); }
.rb-card__icon svg { width: 16px; height: 16px; }
.rb-step__n { flex: none; width: 16px; font: 500 11px/1 var(--font-mono); color: var(--faint); text-align: right; }
.rb-card__title { flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--fg); font: 500 14.5px/1 var(--font-sans); transition: background-color var(--dur) var(--ease); }
.rb-card__title::placeholder { color: var(--faint); }
.rb-card__title:hover { background: rgba(var(--ink-rgb), 0.035); }
.rb-card__title:focus { outline: none; background: rgba(var(--ink-rgb), 0.05); }
.rb-token { flex: none; max-width: 30%; overflow: hidden; font: 11px/1 var(--font-mono); font-variant-ligatures: none; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity var(--dur) var(--ease); }
.rb-card:hover .rb-token, .rb-card.is-open .rb-token, .rb-card:focus-within .rb-token { opacity: 1; }
.rb-more { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; }
.rb-more svg { width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }
.rb-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.rb-more:hover { background: rgba(var(--ink-rgb), 0.05); color: var(--fg); }
.rb-more:focus-visible, .rb-btn:focus-visible, .rb-by button:focus-visible, .rb-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rb-card__sum { display: -webkit-box; overflow: hidden; margin: -8px 16px 13px 50px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rb-card__body { display: flex; flex-direction: column; gap: 14px; padding: 2px 16px 16px 50px; }
.rb-step .rb-card__sum, .rb-step .rb-warn { margin-left: 74px; }
.rb-step .rb-card__body { padding-left: 74px; }
.rb-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.rb-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rb-field__label { font: 500 12px/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--muted); }
.rb-field__hint { font-size: 12px; line-height: 1.45; color: var(--faint); }
.rb-use { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rb-use .rb-field__label { margin-right: 4px; }
.rb-chip { height: 22px; padding: 0 8px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font: 11px/1 var(--font-mono); font-variant-ligatures: none; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.rb-chip:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.rb-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--fg-2); cursor: pointer; }
.rb-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.rb-key { display: flex; align-items: center; gap: 3px; font: 13px/1 var(--font-mono); color: var(--faint); }
.rb .rb-key .input { font-family: var(--font-mono); font-size: 12.5px; font-variant-ligatures: none; }
.rb-foot { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.rb-foot__remove { margin-left: auto; }
.rb-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.rb-btn svg { width: 12px; height: 12px; }
.rb-btn:hover:not(:disabled) { background: rgba(var(--ink-rgb), 0.05); color: var(--fg); }
.rb-btn:disabled { opacity: 0.3; cursor: default; }
/* A problem is one quiet line on the row it's about */
.rb-warn { margin: -6px 16px 12px 50px; font-size: 12.5px; line-height: 1.45; color: var(--warn); }
.rb-warn::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border-radius: 50%; background: currentColor; vertical-align: middle; }
.rb-warn[hidden] { display: none; }
/* Who does a step */
.rb-by { flex: none; display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.05); }
.rb-by button { height: 22px; padding: 0 9px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 500 11.5px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.rb-by button:hover { color: var(--fg); }
.rb-by button[aria-pressed="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.16), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
.rb-by--fixed { padding: 4px 9px; font: 500 11.5px/1 var(--font-sans); color: var(--faint); }
.rb-step.is-rue .rb-by button[data-by="rue"][aria-pressed="true"], .rb-step.is-rue .rb-card__icon { color: var(--accent); }
.rb-pairs { display: flex; flex-direction: column; gap: 6px; }
.rb-pair { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) 30px; gap: 6px; align-items: center; }
.rb-pairs__add { align-self: flex-start; color: var(--accent); }
.rb-multi { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-multi .rc-outlet span { height: 28px; padding: 0 11px; font-size: 12.5px; }
/* Adding: a quiet line under the list that opens what it can be */
.rb-add { margin-top: 8px; }
.rb-add > summary { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 8px; border-radius: 8px; color: var(--accent); font-size: 13.5px; font-weight: 500; cursor: pointer; list-style: none; transition: background-color var(--dur) var(--ease); }
.rb-add > summary::-webkit-details-marker { display: none; }
.rb-add > summary svg { width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }
.rb-add[open] > summary svg { transform: rotate(45deg); }
.rb-add > summary:hover, .rb-add[open] > summary { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rb-add > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-add__menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 2px; margin-top: 6px; padding: 6px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 18px 40px -28px rgba(var(--shadow-rgb), 0.8); }
.rb-add__menu button { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 1px 10px; align-items: center; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.rb-add__menu button svg { grid-row: span 2; width: 17px; height: 17px; color: var(--muted); transition: color var(--dur) var(--ease); }
.rb-add__menu b { font-size: 13px; font-weight: 500; }
.rb-add__menu small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.rb-add__menu button:hover { background: rgba(var(--ink-rgb), 0.04); }
.rb-add__menu button:hover svg { color: var(--accent); }
.rb-add__menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* The preview's form: each question with what it starts as */
.rb-form { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; }
.rb-form__field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rb-form__field > span { font-size: 12px; color: var(--muted); }
.rb-form__field b { color: var(--accent); font-weight: 600; }
.rb-form__field i { display: block; overflow: hidden; padding: 7px 10px; border-radius: 9px; background: var(--surface-sunk); font-style: normal; font-size: 13px; color: var(--faint); text-overflow: ellipsis; white-space: nowrap; }
.rb-form__field i.is-set { color: var(--fg-2); }
.tpl__edit { margin-left: auto; }
@container rb (max-width: 860px) {
  .rb { grid-template-columns: minmax(0, 1fr); }
  .rb__preview { position: static; max-height: none; padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}
@container rb (max-width: 520px) {
  .rb-card__body, .rb-step .rb-card__body { padding-left: 16px; }
  .rb-card__sum, .rb-warn, .rb-step .rb-card__sum, .rb-step .rb-warn { margin-left: 16px; }
  .rb-grid { grid-template-columns: minmax(0, 1fr); }
  .rb-token { display: none; }
  .rb-head__row .rb-inline { flex: 1 1 auto; }
  .rb-head__row .select { width: 100%; }
}

/* ---------- Automations ---------- */
/* A switch: on is the accent, off is quiet */
.au-switch { position: relative; flex: none; width: 38px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: rgba(var(--ink-rgb), 0.16); cursor: pointer; transition: background-color var(--dur) var(--ease); }
.au-switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-solid); box-shadow: 0 1px 3px rgba(var(--shadow-rgb), 0.35); transition: transform var(--dur) var(--ease-out, var(--ease)); }
.au-switch[aria-checked="true"] { background: var(--accent); }
.au-switch[aria-checked="true"] i { transform: translateX(16px); }
.au-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.au-intro { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; }
.au-intro .lib-explain { flex: 1 1 420px; margin-bottom: 0; }
.au-list { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.au-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 10px 28px -24px rgba(var(--shadow-rgb), 0.7); }
.au-card__main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; color: var(--fg); text-decoration: none; }
.au-card__main b { font-size: 15px; font-weight: 600; }
.au-card__main:hover b { color: var(--accent); }
.au-card__when { font-size: 13.5px; color: var(--fg-2); }
.au-card__when i { font-style: normal; color: var(--fg); }
.au-card__meta { font: 10.5px/1.6 var(--font-mono); letter-spacing: 0.02em; color: var(--muted); }
.au-card:not(.is-on) .au-card__main b { color: var(--fg-2); }
.au-described { margin-top: 44px; }
.au-state { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--fg-2); }
.rb-card__body.au-body { padding: 16px; }
.au-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.au-conds { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.au-cond { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1fr) 30px; gap: 6px; align-items: center; }
.au-match { margin-bottom: 2px; }
.rb-add-btn.au-add { align-self: flex-start; margin: -4px 0 0 -8px; }
.au-map__title { margin: 4px 0 -4px; }
.au-limit { max-width: 120px; }
.rb-auto { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; padding: 0 8px; color: var(--fg); text-decoration: none; }
.rb-auto b { font-size: 14px; font-weight: 500; }
.rb-auto small { overflow: hidden; font-size: 12px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.rb-auto:hover b { color: var(--accent); }
.rb-add-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; margin-top: 8px; padding: 0 10px 0 8px; border: 0; border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.rb-add-btn svg { width: 12px; height: 12px; }
.rb-add-btn:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.rb-add-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The preview: the event, its conditions, the form it fills, and what it would do */
.au-event { margin: 0 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-sunk); }
.au-event p { margin: 4px 0 0; font-size: 14px; line-height: 1.45; color: var(--fg); }
.au-checks { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; }
.au-checks li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 9px; background: var(--ok-soft); color: var(--ok); font-size: 12.5px; }
.au-checks li.is-no { background: var(--rec-soft); color: var(--rec-ink); }
.au-checks em { font-style: normal; font: 11px/1.4 var(--font-mono); opacity: 0.85; }
.au-skip { margin: 0 0 10px; font-size: 12.5px; color: var(--rec-ink); }
.au-given { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-sunk); }
.au-runs { margin-top: 16px; }
.au-runs .rb-field__label { display: block; margin-bottom: 8px; }
.au-runs .rc-runs__list { grid-template-columns: minmax(0, 1fr); }
.rc-run__state.is-bad { color: var(--rec-ink); }
.rc-byline { margin: -2px 0 12px; font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.sk-note { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); }
.sk-note b { font-size: 13px; font-weight: 500; color: var(--fg); }
@container rb (max-width: 520px) {
  .au-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
  .au-cond > :nth-child(3) { grid-column: 1 / 3; }
  .au-grid3 { grid-template-columns: minmax(0, 1fr); }
  .rb-card__body.au-body { padding: 12px; }
}

/* What a step will make, sketched */
.sk-page { display: flex; flex-direction: column; gap: 7px; padding: 10px 12px; border-radius: 9px; background: var(--surface-sunk); }
.sk-page b { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.sk-page span { display: flex; flex-direction: column; gap: 4px; }
.sk-page i { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--fg-2); }
.sk-page em { display: block; height: 5px; border-radius: 3px; background: rgba(var(--ink-rgb), 0.08); }
.sk-page em + em { width: 72%; }
.sk-page small { font-size: 11.5px; color: var(--muted); }
.sk-brief { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fg); }
.sk-meta { margin: 6px 0 0; font: 10.5px/1.5 var(--font-mono); color: var(--muted); }
.sk-caption { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fg); }
.sk-caption--empty { color: var(--muted); }
.sk-rows { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 9px; background: var(--line); font-size: 12px; }
.sk-rows span { overflow: hidden; padding: 6px 8px; background: var(--surface-solid); text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.sk-rows .sk-rows__h { background: var(--surface-sunk); font: 10px/1.5 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); }
.sk-post { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 12px; border-radius: 9px; background: var(--surface-sunk); font-size: 12.5px; color: var(--fg-2); }
.sk-post b { font-weight: 600; color: var(--fg); }
.sk-post__outs { display: flex; flex-wrap: wrap; gap: 4px 10px; flex-basis: 100%; }
.sk-post__outs span { display: inline-flex; align-items: center; gap: 6px; }
.sk-post small { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }
.sk-check { margin: 0; padding: 8px 12px; border-radius: 9px; background: var(--ok-soft); font-size: 12.5px; color: var(--ok); }
.sk-check.is-bad { background: var(--rec-soft); color: var(--rec-ink); }

@media (max-width: 760px) { .rc { grid-template-columns: minmax(0, 1fr); } }


/* ---- places in the top bar: Inbox, the Vault and the calendar, as icons */
.topbar__places { display: contents; }
.topbar .icon-btn { position: relative; text-decoration: none; }
.topbar .icon-btn svg { width: 18px; height: 18px; }
.topbar .icon-btn[aria-current="page"] { background: var(--fg); border-color: var(--fg); color: var(--bg); box-shadow: 0 6px 16px -10px rgba(var(--shadow-rgb), 0.7); }
.icon-btn__badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--rec); box-shadow: 0 0 0 2px var(--surface-solid); color: #FFFFFF; font: 600 10px/17px var(--font-sans); text-align: center; pointer-events: none; }

/* ---- inbox: one list on the left (what needs you, then conversations), what's open on the right.
   Quiet panels like the builder's: solid, hairline rows, sentence-case labels. */
.mx { display: grid; grid-template-columns: minmax(300px, 384px) minmax(0, 1fr); gap: 20px; align-items: start; }
.mx__list { min-width: 0; }
.mx__pane { min-width: 0; border-radius: 20px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 18px 44px -32px rgba(var(--shadow-rgb), 0.7); overflow: hidden; }
/* On a wide screen the Inbox is an app: the page holds still, and the list and what's open scroll on their own.
   It fills the window between the top bar and whatever Rue keeps below the page (--mx-below). */
body { --mx-below: 20px; }
@media (min-width: 761px) { body.dock-bottom { --mx-below: 330px; } }
@media (max-width: 760px) { body.dock-sheet { --mx-below: 140px; } }
@media (min-width: 901px) {
  .view:has(.mx) { padding-bottom: var(--mx-below); }
  .view__inner:has(> .mx) { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h, 74px) - var(--mx-below) - var(--view-top)); height: calc(100dvh - var(--topbar-h, 74px) - var(--mx-below) - var(--view-top)); min-height: 440px; }
  .view__inner:has(> .mx) > .view-head { margin-bottom: 16px; }
  .view__inner:has(> .mx) > .mx { flex: 1; min-height: 0; align-items: stretch; }
  .mx__list { display: flex; flex-direction: column; min-height: 0; }
  #mx-results { flex: 1; min-height: 0; margin: 0 -6px; padding: 0 6px 24px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .mx__pane { height: 100%; min-height: 0; }
}
.mx-btn .i { flex: none; width: 14px; height: 14px; margin-left: -3px; }

.mx-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.mx-seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.05); }
.mx-seg button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 13px/1 var(--font-sans); white-space: nowrap; cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.mx-seg button:hover { color: var(--fg); }
.mx-seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.1), 0 3px 8px -4px rgba(var(--shadow-rgb), 0.45); }
.mx-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-seg b { font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
/* On a phone the four filters and their counts only just fit: a little less room each, so the last doesn't run past the pill's end */
@media (max-width: 400px) { .mx-seg button { padding: 0 7px; } }
.mx-search { width: 100%; }

.mx-group + .mx-group { margin-top: 22px; }
.mx-label { margin: 0 0 8px 4px; font: 600 13px/1.4 var(--font-sans); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.mx-none { margin: 8px 4px; font-size: 14px; color: var(--muted); }
.mx-foot { margin: 14px 4px 0; font-size: 13.5px; color: var(--muted); }
.mx-empty { padding: 28px 22px; border-radius: 16px; background: rgba(var(--ink-rgb), 0.035); text-align: center; }
.mx-empty p { max-width: 40ch; margin: 0 auto; font-size: 14px; line-height: 1.55; color: var(--muted); }
.mx-empty .mx-empty__title { margin-bottom: 6px; font-size: 16px; font-weight: 600; color: var(--fg); }

/* What needs you: a coloured mark for the kind, then what it is and what to do */
.inbox, .mx-convs, .cp-list, .ct-list { margin: 0; padding: 0; list-style: none; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); overflow: hidden; }
.inbox__item { --k: var(--accent); display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
.inbox__item + .inbox__item { box-shadow: inset 0 1px 0 var(--line); }
.inbox__item--missed, .inbox__item--check, .inbox__item--failed { --k: var(--rec-ink); }
.inbox__item--drift, .inbox__item--approve { --k: var(--warn); }
.inbox__item--ready, .inbox__item--ran { --k: var(--ok); }
.inbox__item--rule, .inbox__item--flag { --k: var(--muted); }
.inbox__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--k) 12%, transparent); color: var(--k); }
.inbox__icon .i { width: 16px; height: 16px; }
.inbox__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inbox__kind { font: 500 10.5px/1.7 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--k); }
.inbox__title { font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--fg); text-decoration: none; overflow-wrap: anywhere; }
a.inbox__title:hover { text-decoration: underline; text-underline-offset: 2px; }
.inbox__detail { font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.inbox__acts { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
/* The title is the way in: the whole row opens it, and its buttons sit above that */
.inbox__item { position: relative; transition: background-color var(--dur) var(--ease); }
button.inbox__title { padding: 0; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.inbox__title:is([href], button)::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.inbox__item:has(.inbox__title:is([href], button)):hover { background: rgba(var(--ink-rgb), 0.025); }
.inbox__title:is([href], button):focus-visible { outline: none; }
.inbox__item:has(.inbox__title:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent); }
.inbox__acts .btn--sm { min-height: 30px; padding: 0 13px; }

/* Conversations: who, when, the subject for mail, the last words, a dot while unread */
.mx-convs > li + li .mx-conv { box-shadow: inset 0 1px 0 var(--line); }
.mx-conv { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 13px 16px; color: inherit; text-decoration: none; transition: background-color var(--dur) var(--ease); }
.mx-conv:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface-solid)); }
.mx-conv[aria-current="true"] { background: color-mix(in srgb, var(--accent) 9%, var(--surface-solid)); }
.mx-conv:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mx-conv__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mx-conv__top { display: flex; align-items: baseline; gap: 10px; }
.mx-conv__who { flex: 1; min-width: 0; overflow: hidden; font-size: 14.5px; font-weight: 500; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.mx-conv__top time { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mx-conv__subj { overflow: hidden; font-size: 13.5px; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.mx-conv__snip { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.mx-conv__subj + .mx-conv__snip { -webkit-line-clamp: 1; }
.mx-conv.is-unread .mx-conv__who, .mx-conv.is-unread .mx-conv__subj { font-weight: 650; }
.mx-conv.is-unread .mx-conv__top time { color: var(--accent); font-weight: 600; }
.mx-conv__dot { position: absolute; top: 50%; left: 5px; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--accent); }

/* People: soft initials, a colour each; someone by email wears a small envelope */
.av { --av: #3074CC; position: relative; flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--av) 14%, var(--surface-solid)); color: color-mix(in srgb, var(--av) 78%, var(--fg)); font: 600 12.5px/1 var(--font-sans); letter-spacing: 0.02em; user-select: none; }
.av--t0 { --av: #3074CC; } .av--t1 { --av: #7A5AF8; } .av--t2 { --av: #0F8A65; } .av--t3 { --av: #D46A2E; }
.av--t4 { --av: #C2417F; } .av--t5 { --av: #1F8FB3; } .av--t6 { --av: #9A6B3F; } .av--t7 { --av: #5B6475; }
[data-theme="dark"] .av { background: color-mix(in srgb, var(--av) 30%, var(--surface-solid)); color: color-mix(in srgb, var(--av) 38%, #FFFFFF); }
.av--me, [data-theme="dark"] .av--me { background: rgba(var(--ink-rgb), 0.08); color: var(--fg-2); }
.av--me .i { width: 17px; height: 17px; }
.av--tel .i { width: 16px; height: 16px; }
.av--sm.av--tel .i { width: 12px; height: 12px; }
.av--sm { width: 26px; height: 26px; font-size: 10px; }
.av--sm.av--me .i { width: 13px; height: 13px; }
.av__mail { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-solid); color: var(--muted); box-shadow: 0 0 0 1px var(--line-2); }
.av__mail .i { width: 10px; height: 10px; }
.av--sm .av__mail { right: -3px; bottom: -3px; width: 13px; height: 13px; }
.av--sm .av__mail .i { width: 8px; height: 8px; }
.av-pair { position: relative; width: 36px; height: 36px; }
.av-pair .av { position: absolute; }
.av-pair .av:first-child { top: 0; left: 0; }
.av-pair .av + .av { right: 0; bottom: 0; box-shadow: 0 0 0 2px var(--surface-solid); }

/* The open conversation: who's in it, the messages by day, the reply box */
.mx-rest { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; padding: 32px; text-align: center; }
.mx-rest__icon { width: 56px; height: 56px; margin-bottom: 4px; color: var(--faint); }
.mx-rest__title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
.mx-rest p:not(.mx-rest__title) { max-width: 44ch; margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.mx-rest .btn { margin-top: 8px; }
.mx-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.mx-head { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px 24px; box-shadow: inset 0 -1px 0 var(--line); }
.mx-head__main { flex: 1; min-width: 0; }
.mx-head__title { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; color: var(--fg); overflow-wrap: anywhere; }
.mx-head__acts { flex: none; display: flex; gap: 2px; margin-top: -4px; }
.mx-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.mx-icon:hover { background: rgba(var(--ink-rgb), 0.06); color: var(--fg); }
.mx-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mx-icon .i { width: 18px; height: 18px; }
.mx-back { display: none; }
.mx-people { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; padding: 0; list-style: none; }
.mx-chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 13px; color: var(--fg-2); }
.mx-chip__name { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 500; }
button.mx-chip__name { cursor: pointer; }
button.mx-chip__name:hover { text-decoration: underline; text-underline-offset: 2px; }
.mx-chip__sub { color: var(--muted); }
.mx-chip__add { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.mx-chip__add:hover { text-decoration: underline; text-underline-offset: 2px; }
.mx-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 18px; overscroll-behavior: contain; scrollbar-width: thin; }
.mx-msgs { margin: 0; padding: 0; list-style: none; }
.mx-day { display: flex; justify-content: center; margin: 18px 0 4px; }
.mx-day span { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.mx-msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 0 2px; }
.mx-msg.is-cont { padding-top: 4px; }
.mx-msg__main { min-width: 0; }
.mx-msg__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 1px 0 3px; font-size: 12.5px; color: var(--muted); }
.mx-msg__meta b { font-size: 14px; font-weight: 600; color: var(--fg); }
.mx-via { display: inline-flex; align-items: center; gap: 4px; }
.mx-via .i { width: 13px; height: 13px; }
.mx-msg__text { font-size: 14.5px; line-height: 1.6; color: var(--fg); overflow-wrap: anywhere; }
.mx-msg__text p { margin: 0; }
.mx-msg__text p + p { margin-top: 0.7em; }
.mx-msg__text a { color: var(--accent); }
.mx-msg__state { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.mx-msg__state .i { width: 13px; height: 13px; }
.mx-reply { flex: none; padding: 10px 14px 12px; box-shadow: inset 0 1px 0 var(--line); }
.mx-box { display: flex; align-items: flex-end; gap: 8px; padding: 5px 5px 5px 16px; border-radius: 22px; background: rgba(var(--ink-rgb), 0.04); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.mx-box:focus-within { background: var(--field-input); box-shadow: inset 0 0 0 1px var(--primary), 0 0 0 3px var(--primary-soft); }
.mx-box__text { flex: 1; min-width: 0; min-height: 22px; max-height: 220px; margin: 6px 0; padding: 0; border: 0; background: transparent; color: var(--fg); font: 14.5px/1.5 var(--font-sans); resize: none; outline: none; }
.mx-box__text::placeholder, .mx-write__text::placeholder, .mx-line input::placeholder { color: var(--faint); }
.mx-box__send { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); cursor: pointer; transition: transform 220ms var(--ease); }
.mx-box__send:hover { transform: translateY(-1px); }
.mx-box__send:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mx-box__send .i { width: 16px; height: 16px; }
.mx-reply__note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 8px 8px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.mx-keys { color: var(--faint); }
@media (hover: none) and (pointer: coarse) { .mx-keys { display: none; } }

/* Writing something new: To and (for mail) Subject as lines, then the page */
.mx-fields { flex: none; padding: 2px 24px; box-shadow: inset 0 -1px 0 var(--line); }
.mx-line { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; }
.mx-line + .mx-line { box-shadow: inset 0 1px 0 var(--line); }
.mx-line > label { flex: none; width: 58px; font-size: 13.5px; color: var(--muted); }
.mx-line > input, .mx-to__box input { flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent; color: var(--fg); font: 14.5px var(--font-sans); outline: none; }
.mx-to__box { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding: 7px 0; }
.mx-to__box input { flex: 1 1 140px; min-width: 120px; height: 30px; }
.mx-to__chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 3px 0 11px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--fg); font-size: 13.5px; }
.mx-to__chip.is-mail { background: rgba(var(--ink-rgb), 0.07); }
.mx-to__chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.mx-to__chip button:hover { background: rgba(var(--ink-rgb), 0.08); color: var(--fg); }
.mx-to__chip .i { width: 12px; height: 12px; }
.mx-suggest { position: absolute; z-index: 5; top: calc(100% - 2px); right: 0; left: 70px; margin: 0; padding: 6px; list-style: none; border-radius: 14px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.12), 0 18px 40px -18px rgba(var(--shadow-rgb), 0.55); }
.mx-suggest[hidden] { display: none; }
.mx-suggest button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.mx-suggest [aria-selected="true"] button, .mx-suggest button:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.mx-suggest b { display: block; font-size: 13.5px; font-weight: 500; }
.mx-suggest small { display: block; font-size: 12px; color: var(--muted); }
.mx-write { flex: 1; min-height: 0; display: flex; padding: 16px 24px; }
.mx-write__text { flex: 1; width: 100%; min-height: 120px; padding: 0; border: 0; background: transparent; color: var(--fg); font: 15px/1.6 var(--font-sans); resize: none; outline: none; }
.mx-compose__foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px 12px 24px; box-shadow: inset 0 1px 0 var(--line); }
.mx-compose__foot .mx-reply__note { margin: 0; }


/* ---- campaigns */
.cp-group + .cp-group { margin-top: 26px; }
.cp-list > li + li .cp-row { box-shadow: inset 0 1px 0 var(--line); }
.cp-row { display: grid; grid-template-columns: 34px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.9fr) auto; align-items: center; gap: 16px; padding: 14px 18px; color: inherit; text-decoration: none; transition: background-color var(--dur) var(--ease); }
.cp-row:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface-solid)); }
.cp-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cp-row__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.cp-row__icon .i { width: 17px; height: 17px; }
.cp-row__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cp-row__body b, .cp-row__body small, .cp-row__who, .cp-row__when { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row__body b { font-size: 15px; font-weight: 600; color: var(--fg); }
.cp-row__body small { font-size: 13.5px; color: var(--muted); }
.cp-row__who { font-size: 13.5px; color: var(--fg-2); }
.cp-row__when { font-size: 13px; color: var(--muted); }
.cp-pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.cp-pill--scheduled { background: var(--primary-soft); color: var(--accent); }
.cp-pill--sent { background: var(--ok-soft); color: var(--ok); }
.cp-pill--due { background: var(--rec-soft); color: var(--rec-ink); }
.cp .rb-sec:first-child { margin-top: 0; }
.cp-card { display: flex; flex-direction: column; padding: 2px 18px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.cp-field { padding: 14px 0; }
.cp-field + .cp-field { box-shadow: inset 0 1px 0 var(--line); }
.cp-field__label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.cp-field > .input, .cp-field > .select, .cp-field > .textarea { width: 100%; }
.cp-field__hint { margin: 7px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cp-field__hint a { color: var(--accent); }
.cp .textarea.cp-body { min-height: 240px; font: 14px/1.6 var(--font-sans); }
.cp-tools { margin-top: 8px; }
.cp-page { margin-left: auto; }
.cp-page .select { min-height: 28px; padding: 2px 30px 2px 10px; font-size: 12.5px; }
.cp-probs { margin: 14px 0 10px; padding: 0 0 0 18px; font-size: 13.5px; line-height: 1.6; color: var(--warn); }
.cp-ready { display: flex; align-items: center; gap: 8px; margin: 14px 0 10px; font-size: 14px; color: var(--ok); }
.cp-ready .i { width: 16px; height: 16px; }
.cp-when { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.cp-sched { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 12px; }
.cp-sched .cp-field__label { width: 100%; margin: 0; }
.cp-sched .input { flex: 1 1 210px; width: auto; }
#cp-send > .cp-field__hint { margin: 0 0 14px; }
.cp-prev__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cp-prev__bar .mx-label { margin: 0; }
.cp-as { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cp-as .select { min-height: 30px; padding: 2px 30px 2px 10px; font-size: 12.5px; }
.cp-inbox { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; margin-bottom: 14px; padding: 13px 16px; border-radius: 14px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09); }
.cp-inbox__text { min-width: 0; }
.cp-inbox__text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-inbox__top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--fg); }
.cp-inbox__top span { overflow: hidden; font-size: 12px; color: var(--muted); text-overflow: ellipsis; }
.cp-inbox__subj { font-size: 14px; font-weight: 600; color: var(--fg); }
.cp-inbox__pre { font-size: 13px; color: var(--muted); }
/* The email itself, as people get it: on white whatever the theme */
.cp-mail { overflow: hidden; border-radius: 14px; background: #FFFFFF; color: #1B2230; box-shadow: 0 0 0 0.5px rgba(15, 22, 38, 0.12), 0 20px 44px -30px rgba(20, 38, 80, 0.6); }
[data-theme="dark"] .cp-mail { background: #F2F4F8; }
.cp-mail__brand { padding: 24px 28px 0; font: 700 15px/1 var(--font-sans); letter-spacing: -0.01em; color: #0F1626; }
.cp-mail__body { padding: 14px 28px 22px; font: 15px/1.65 var(--font-sans); color: #1B2230; overflow-wrap: anywhere; }
.cp-mail__body p { margin: 0 0 14px; }
.cp-mail__body h2 { margin: 18px 0 10px; font-size: 20px; line-height: 1.3; letter-spacing: -0.02em; color: #0F1626; }
.cp-mail__body ul { margin: 0 0 14px; padding-left: 20px; }
.cp-mail__body a { color: #2963AD; }
.cp-mail__body .cp-mail__cta a { display: inline-block; padding: 11px 20px; border-radius: 999px; background: #0F1626; color: #FFFFFF; font-size: 14px; font-weight: 600; text-decoration: none; }
.cp-mail__empty { color: #8A93A6; }
.cp-mail__foot { padding: 16px 28px 22px; border-top: 1px solid rgba(15, 22, 38, 0.08); font-size: 12px; line-height: 1.6; color: #6B7488; }
.cp-mail__foot p { margin: 0; }
.cp-mail__link { color: #1B2230; text-decoration: underline; }

/* ---- contacts: segments down the side, the people in one beside them */
.ct { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.ct__segs { position: sticky; top: 92px; min-width: 0; }
.ct__segs ul { display: flex; flex-direction: column; gap: 1px; margin: 0 0 6px; padding: 0; list-style: none; }
.ct__segs a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 10px; color: var(--fg-2); font-size: 14px; text-decoration: none; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.ct__segs a:hover { background: rgba(var(--ink-rgb), 0.05); color: var(--fg); }
.ct__segs a[aria-current="page"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 6px 16px -12px rgba(var(--shadow-rgb), 0.6); }
.ct__segs a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ct__segs a .i { flex: none; width: 16px; height: 16px; color: var(--muted); }
.ct__segs a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct__segs a b { font-size: 12.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct__main { min-width: 0; }
.ct__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 16px; margin-bottom: 18px; }
.ct__head-main { flex: 1 1 260px; min-width: 0; }
.ct__title, .ct__title-input { margin: 0; font: 600 22px/1.3 var(--font-sans); letter-spacing: -0.02em; color: var(--fg); }
.ct__title-input { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; outline: none; }
.ct__title-input:focus { box-shadow: 0 2px 0 var(--primary); }
.ct__stat { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.ct__why { max-width: 60ch; margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.ct__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-rules { flex-basis: 100%; padding: 14px 16px 8px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.seg-rules__lead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13.5px; color: var(--fg-2); }
.seg-conds { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.seg-cond { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) 30px; gap: 8px; align-items: center; }
.seg-cond__val { display: flex; align-items: center; gap: 8px; min-width: 0; }
.seg-cond__val .input { flex: 1; min-width: 0; }
.seg-cond__unit { font-size: 13.5px; color: var(--muted); }
.seg-rules .select, .seg-rules .input { min-height: 36px; padding: 6px 12px; border-color: transparent; border-radius: 10px; background-color: rgba(var(--ink-rgb), 0.04); font-size: 13.5px; box-shadow: none; }
.seg-rules .select { padding-right: 32px; background-position: right 12px center; }
.seg-rules .select:focus, .seg-rules .input:focus { border-color: var(--primary); background-color: var(--field-input); box-shadow: 0 0 0 3px var(--primary-soft); }
.seg-match { width: auto; }
.ct-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ct-tools .input--search { flex: 1 1 240px; width: auto; }
.ct-list > li + li .ct-row { box-shadow: inset 0 1px 0 var(--line); }
.ct-row { display: grid; grid-template-columns: 36px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 118px; align-items: center; gap: 14px; width: 100%; padding: 11px 16px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color var(--dur) var(--ease); }
.ct-row:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface-solid)); }
.ct-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ct-row__who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ct-row__who b, .ct-row__who small, .ct-row__co { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-row__who b { font-size: 14.5px; font-weight: 500; color: var(--fg); }
.ct-row__who small { font-size: 13px; color: var(--muted); }
.ct-row__co { font-size: 13.5px; color: var(--fg-2); }
.ct-row__tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-height: 22px; overflow: hidden; }
.ct-row__tags i { padding: 2px 8px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); font-size: 12px; font-style: normal; white-space: nowrap; }
.ct-status { justify-self: end; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ct-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); }
.ct-status--subscribed { color: var(--ok); }
.ct-status--subscribed::before { background: var(--ok); }
.ct-status--unsubscribed::before { background: var(--muted); }
.ct-status--bounced { color: var(--rec-ink); }
.ct-status--bounced::before { background: var(--rec-ink); }
.ct-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ct-form .field { margin: 0; }
.ct-form > .field__hint { margin-top: 12px; }
.ct-form__meta { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.ct-activity { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ct-activity ul { margin: 6px 0 12px; padding: 0; list-style: none; }
.ct-activity a { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; color: var(--fg); font-size: 14px; text-decoration: none; }
.ct-activity a:hover { background: rgba(var(--ink-rgb), 0.05); }
.ct-activity a .i { width: 16px; height: 16px; color: var(--muted); }
.ct-activity a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-activity a time { font-size: 12.5px; color: var(--muted); }
.ct-activity__acts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.tlist__tag { margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--accent); font: 500 10px/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }

/* ---- the Inbox with recipes and automations: drafts they write, recipes on a conversation, calls to make */
.inbox__item--call { --k: var(--ok); }
.mx-by { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); }
.mx-by .i { width: 12px; height: 12px; }
.mx-msg.is-draft .mx-msg__text { padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 5%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.mx-msg__rue { margin: 0; color: var(--muted); }
.mx-draft { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.mx-draft__label { margin-right: 2px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.mx-draft .btn--sm { min-height: 30px; padding: 0 13px; }
.sk-msg { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); }
.sk-msg b { font-size: 13px; font-weight: 600; color: var(--fg); }
.sk-msg p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--fg-2); white-space: pre-line; }
.sk-note small { font-size: 12px; color: var(--fg-2); }
.au-server { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; line-height: 1.5; }
.au-server .i { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.rx-lede { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.si-lede { margin: 0 0 14px; font-size: 14px; line-height: 1.55; color: var(--fg-2); }
.ac-who { margin: 0 0 18px; display: flex; flex-direction: column; gap: 2px; }
.ac-who small { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); }
.ac-head { margin: 22px 0 8px; font-size: 13px; font-weight: 600; color: var(--fg); }
.ac-keys { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ac-keys li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ac-keys small { color: var(--muted); }
.ac-add { margin-top: 6px; }
.ac-codes { margin: 0 0 12px; padding-left: 22px; font-family: var(--font-mono); font-size: 14px; line-height: 1.8; columns: 2; }
.rx-list { margin: 0; padding: 0; list-style: none; border-radius: 14px; box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.12); overflow: hidden; }
.rx-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; }
.rx-list li + li { box-shadow: inset 0 1px 0 var(--line); }
.rx-list__icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.rx-list__icon .i { width: 16px; height: 16px; }
.rx-list__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rx-list__body b { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.rx-list__body small { font-size: 13px; line-height: 1.45; color: var(--muted); }
.rx-list__acts { display: flex; align-items: center; gap: 10px; }
.rx-list__acts .btn--sm { min-height: 32px; }
.ct-group { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
.ct-group legend { margin: 0 0 8px; padding: 0; font: 600 13px/1.4 var(--font-sans); color: var(--fg-2); }
.ct-field--wide { grid-column: 1 / -1; }
.ct-phone { display: flex; align-items: center; gap: 6px; }
.ct-phone .i { flex: none; width: 14px; height: 14px; }
.ct-recipes { margin: 4px 0 14px; }
.ct-recipes .rb-use { gap: 6px; margin-top: 6px; }
.ct-recipes .rb-chip { height: 26px; padding: 0 11px; font-size: 11.5px; }
@media (max-width: 900px) { .rx-list li { grid-template-columns: 32px minmax(0, 1fr); } .rx-list__acts { grid-column: 2; } }

/* ---- calls: the log, a call (voicemail, Rue's notes, transcript), and your numbers */
.inbox__item--missedcall { --k: var(--rec-ink); }
.inbox__item--voicemail { --k: var(--accent); }
.cl-what { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--fg-2); }
.cl-dir { display: inline-grid; place-items: center; width: 15px; height: 15px; color: var(--muted); }
.cl-dir .i { width: 14px; height: 14px; }
.cl-dir--missed { color: var(--rec-ink); }
.cl-dir--voicemail { color: var(--accent); }
.cl-dir--answered { color: var(--ok); }
.mx-conv.is-unread .cl-what { color: var(--fg); font-weight: 600; }
.cl-ai { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-size: 11.5px; font-weight: 500; }
.cl-ai .i { width: 11px; height: 11px; }
.cl-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 18px; margin: 16px 0 0; }
.cl-facts div { min-width: 0; }
.cl-facts dt { margin-bottom: 2px; font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cl-facts dd { margin: 0; font-size: 14px; line-height: 1.4; color: var(--fg); }
.cl-sec { margin-top: 20px; padding: 16px 18px; border-radius: 16px; background: rgba(var(--ink-rgb), 0.035); }
.cl-sec__title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--fg); }
.cl-sec__title .i { width: 16px; height: 16px; color: var(--accent); }
.cl-player { display: flex; align-items: center; gap: 12px; }
.cl-play { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fg); color: var(--bg); }
.cl-play:disabled { opacity: 0.4; cursor: not-allowed; }
.cl-play .i { width: 13px; height: 13px; margin-left: 2px; }
.cl-wave { flex: 1; display: flex; align-items: center; gap: 2px; min-width: 0; height: 32px; overflow: hidden; }
.cl-wave i { flex: 1 1 0; min-width: 2px; max-width: 4px; height: var(--h); border-radius: 2px; background: color-mix(in srgb, var(--fg) 26%, transparent); }
.cl-len { flex: none; font: 500 12px/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.cl-quote { margin: 12px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--fg); }
.cl-bullets { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.6; color: var(--fg); }
.cl-bullets li + li { margin-top: 4px; }
.cl-sub { margin: 14px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.cl-todo { margin: 0; padding: 0; list-style: none; font-size: 14.5px; line-height: 1.6; color: var(--fg); }
.cl-todo li { position: relative; padding-left: 24px; }
.cl-todo li::before { content: ""; position: absolute; top: 5px; left: 0; width: 13px; height: 13px; border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--line-3); }
.cl-by { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.cl-none { margin: 18px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.cl-none a, .cl-hint a { color: var(--accent); }
.cl-transcript { margin-top: 18px; }
.cl-transcript summary { font-size: 14px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.cl-transcript ol { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.cl-transcript li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.5; color: var(--fg); }
.cl-transcript li b { font-weight: 600; color: var(--fg-2); }
.cl-related { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--accent); font-size: 14px; text-decoration: none; }
.cl-related .i { flex: none; width: 15px; height: 15px; }
.cl-related:hover span { text-decoration: underline; text-underline-offset: 2px; }
.cl-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-head-sub { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.cl-lines, .ph-lines { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.ph-lines { margin: 0 0 18px; }
.cl-line { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); color: inherit; text-decoration: none; transition: background-color var(--dur) var(--ease); }
.cl-pane .cl-line { background: rgba(var(--ink-rgb), 0.035); box-shadow: none; }
.cl-line:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface-solid)); }
.cl-line:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cl-line__icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 13%, transparent); color: var(--ok); }
.cl-line__icon .i { width: 17px; height: 17px; }
.cl-line__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cl-line__body b { font: 600 15px/1.35 var(--font-sans); color: var(--fg); font-variant-numeric: tabular-nums; }
.cl-line__body span { font-size: 13.5px; color: var(--fg-2); }
.cl-line__body small { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.cl-hint { margin: 16px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.ph-tags { display: flex; gap: 6px; }
.ph-tags i { padding: 2px 8px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); font: 500 10.5px/1.5 var(--font-mono); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; }
.ph-tags i.is-warn { background: var(--warn-soft); color: var(--warn); }
.ph-get__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.ph-get__form .input { flex: 1 1 220px; width: auto; }
.ph-get__form .select { width: auto; }

/* Settings → Phone: a number's page, its call chain as numbered steps */
.ph-edit { max-width: 760px; }
.ph-edit .rb-sec:first-child { margin-top: 4px; }
.ph-sentence { margin: 0 0 12px; font-size: 15px; line-height: 1.55; color: var(--fg); }
.ph-flow { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: none; }
.ph-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; }
.ph-step__n { display: grid; place-items: center; width: 26px; height: 26px; margin-top: 12px; border-radius: 50%; background: var(--fg); color: var(--bg); font: 600 12px/1 var(--font-sans); }
.ph-step__card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.ph-step__head { display: flex; align-items: center; gap: 10px; }
.ph-step__head b { flex: 1; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.ph-step__acts { display: flex; align-items: center; gap: 4px; }
.ph-step__acts .link-btn { margin-left: 8px; }
.ph-who, .ph-days { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-secs { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg-2); }
.ph-secs .input { width: 84px; }
.ph-edit .cp-field__hint, .ph-step__card .cp-field__hint { margin: 0; }
.ph-step__card .input, .ph-step__card .textarea { width: 100%; }
.ph-step__card .ph-secs .input { width: 84px; }
.ph-add { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 12px; }
.ph-add .rb-field__label { margin-right: 4px; }
.ph-add .rb-add-btn { margin-top: 0; }
.ph-times { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.ph-times label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg-2); }
.ph-times .input { width: 156px; }
.ph-days { margin-top: 12px; }
.ph-disc-label { margin-top: 14px; }

/* Settings → Connectors: what Rue can reach outside Formula */
.cn-sec + .cn-sec { margin-top: 28px; }
/* Connectors run both ways: what Rue uses, then what uses this Space */
.cn-part + .cn-part { margin-top: clamp(40px, 5vw, 56px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line-2); }
.cn-part__head { margin-bottom: 20px; }
.cn-part__head h2 { margin: 0 0 6px; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; color: var(--fg); }
.cn-part__head p { max-width: 66ch; margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.cn-part__head .row-actions { margin-top: 16px; align-items: center; }
.cn-pack { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--muted); }
.cn-part .mcp + .site { margin-top: 14px; }
.cn-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cn-card { padding: 16px 18px; border-radius: 18px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.cn-card__head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.cn-card__head .link-btn { margin-left: 4px; }
/* What Rue may do: one switch, like the AI tools' clients, and what the choice means under it */
.cn-access { margin-top: 14px; }
.cn-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); }
.cn-seg__opt { position: relative; display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: var(--radius-pill); color: var(--fg-2); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.cn-seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cn-seg__opt:hover { color: var(--fg); }
.cn-seg__opt.is-on { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
.cn-seg__opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.cn-seg__opt.is-off { opacity: 0.45; }
.cn-seg__opt.is-off, .cn-seg__opt.is-off input { cursor: default; }
[data-theme="dark"] .cn-seg { background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .cn-seg__opt.is-on { background: rgba(255, 255, 255, 0.16); box-shadow: none; }
.cn-seg__say { margin: 8px 2px 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cn-only { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cn-only__chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); color: var(--fg); font: 500 12.5px/1 var(--font-sans); }
.cn-only__chip .i { width: 13px; height: 13px; }
[data-theme="dark"] .cn-only__chip { background: rgba(255, 255, 255, 0.08); }
/* Signing in, and what it keeps: cards inside the card */
.cn-wait { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cn-signin, .cn-keep { margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(var(--ink-rgb), 0.03); box-shadow: inset 0 0 0 1px var(--line); }
.cn-signin__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cn-signin__row small { font-size: 12.5px; color: var(--muted); }
.cn-signin__again { margin: 0 0 10px; font-size: 13px; color: var(--warn); }
.cn-keys__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.cn-keys__row .field { flex: 1 1 210px; min-width: 0; margin: 0; }
.cn-keys__row .btn { flex: none; min-height: 44px; }
.cn-keys__help { margin: 10px 0 0; max-width: 76ch; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.cn-keep__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cn-keep__head b { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.cn-keep__ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cn-keep__ctl .select { width: auto; min-height: 32px; padding-block: 4px; font-size: 13px; }
.cn-keep .row-actions { margin-top: 12px; }
.cn-keep .cn-none { margin: 0; }
.cn-kept { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cn-kept__item { position: relative; min-width: 0; border-radius: 12px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.1); transition: box-shadow var(--dur) var(--ease); }
.cn-kept__item:hover { box-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.2); }
.cn-kept__link { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 34px 10px 12px; border-radius: inherit; color: inherit; text-decoration: none; }
.cn-kept__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cn-kept__link b { overflow: hidden; font-size: 13.5px; font-weight: 600; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.cn-kept__link small { overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.cn-kept__item.is-bad small { color: var(--warn); }
.cn-kept__x { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: pointer; opacity: 0; transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.cn-kept__item:hover .cn-kept__x, .cn-kept__x:focus-visible { opacity: 1; }
.cn-kept__x:hover { background: rgba(var(--ink-rgb), 0.07); color: var(--fg); }
.cn-kept__x .i { width: 12px; height: 12px; }
@media (hover: none) { .cn-kept__x { opacity: 1; } }
.cn-chips, .cn-more-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cn-more-row { margin-top: 10px; }
.cn-more-row__label { margin-right: 4px; font-size: 12.5px; color: var(--muted); }
.cn-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg-2); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: box-shadow var(--dur) var(--ease), color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.cn-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cn-chip:hover { color: var(--fg); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.24); }
.cn-chip.is-on { color: var(--fg); background: color-mix(in srgb, var(--accent) 9%, var(--surface-solid)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cn-chip:has(input:focus-visible), .cn-chip--add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cn-chip .i { width: 12px; height: 12px; }
.cn-chip.is-on .i { color: var(--accent); }
/* The catalogue: a row a group, its name on the left */
.cn-cat { display: flex; flex-direction: column; gap: 12px; }
.cn-group { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: start; gap: 8px 16px; }
.cn-group__title { margin: 0; padding: 18px 0 0 2px; font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.cn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.cn-app { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09); }
.cn-app__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.cn-app__icon .i { width: 16px; height: 16px; }
.cn-app__body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cn-app__body b { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.cn-app__body small { overflow: hidden; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-overflow: ellipsis; }
.cn-app__have { font-size: 12.5px; color: var(--ok); }
.cn-app .cn-app__icon { width: 30px; height: 30px; }
.cn-app .cn-app__body b { font-size: 14px; }
.cn-app .cn-app__body small { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cn-app__act { display: inline-flex; align-items: center; gap: 6px; }
.cn-app .btn--sm { min-height: 30px; }
.cn-more { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.cn-more:hover { background: rgba(var(--ink-rgb), 0.11); color: var(--fg); }
.cn-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cn-more .i { width: 13px; height: 13px; }
[data-theme="dark"] .cn-more { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 760px) {
  .cn-group { grid-template-columns: minmax(0, 1fr); }
  .cn-group__title { padding-top: 0; }
  .cn-card__head { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .cn-card__head .dm__state { grid-column: 2; grid-row: 2; margin-left: 0; }
  .cn-card__head .link-btn { grid-column: 3; grid-row: 1; }
}
/* What Rue did outside, folded like Try a tool */
.cn-logfold { margin-top: 28px; }
.cn-log { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.cn-log li { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) auto; gap: 4px 14px; padding: 8px 2px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.cn-log li:last-child { border-bottom: 0; }
.cn-log b { font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-log span { color: var(--fg-2); }
.cn-log small { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.cn-log li.is-bad span { color: var(--warn); }
@media (max-width: 760px) { .cn-log li { grid-template-columns: minmax(0, 1fr); } }
.tgrid__ro { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); cursor: default; }
.tgrid__ro.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tgrid__col--sync { cursor: default; }
.rc-ro { margin: 0; padding: 8px 0 2px; font-size: 14.5px; color: var(--fg); overflow-wrap: anywhere; }
.rc-ro__none { color: var(--faint); }

/* Settings → Domains */
.dm-list { display: flex; flex-direction: column; gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.dm { padding: 16px 18px; border-radius: 16px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09), 0 12px 32px -28px rgba(var(--shadow-rgb), 0.7); }
.dm__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.dm__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.dm__icon .i { width: 17px; height: 17px; }
.dm__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); overflow-wrap: anywhere; }
.dm__tag { padding: 2px 8px; border-radius: 999px; background: var(--fg); color: var(--bg); font: 500 10px/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.dm__state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dm__state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); }
.dm__state--ok { color: var(--ok); }
.dm__state--ok::before { background: var(--ok); }
.dm__state--wait { color: var(--warn); }
.dm__state--wait::before { background: var(--warn); }
.dm__about { margin: 10px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.dm__uses { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.dm__records { margin-top: 14px; }
.dm__records summary { font-size: 13.5px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.dm-table-wrap { margin-top: 10px; overflow-x: auto; }
.dm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dm-table th { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; font: 500 10.5px/1.5 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.dm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--fg); }
.dm-table code { font: 12.5px/1.5 var(--font-mono); overflow-wrap: anywhere; }
.dm-later { color: var(--muted); }
.dm__acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; margin-top: 12px; }
.dm-add__form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.dm-add__form .input { flex: 1 1 240px; width: auto; }
/* The sign-in page (login.html): the ring, then one glass card in the middle of the atmosphere, as the earlier
   Formula's was */
body.signin { min-height: 100vh; }
.signin__main { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; }
.signin__card { display: grid; gap: 16px; justify-items: center; width: min(420px, 100%); padding: 36px 32px 28px; border: 1px solid var(--glass-line); border-radius: 28px; background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%); box-shadow: 0 40px 90px -40px rgba(var(--shadow-rgb), 0.45); text-align: center; }
.signin__mark { width: 52px; height: 52px; }
.signin__title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
.signin__form { display: grid; gap: 14px; width: 100%; text-align: left; }
.signin__form[hidden] { display: none; }
.signin__lede { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); text-align: center; }
.signin__go { justify-content: center; width: 100%; }
.signin__alt, .signin__new { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.signin__alt[hidden] { display: none; }
.signin__new { padding-top: 14px; border-top: 1px solid var(--line); width: 100%; }

/* Settings → Keys: a new key, shown once, and the form that makes one */
.key-made { display: grid; gap: 10px; justify-items: start; margin: 0 0 18px; padding: 16px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(var(--ink-rgb), 0.035); }
.key-made p { margin: 0; font-size: 14px; color: var(--fg-2); }
.key-made__key { max-width: 100%; font: 13.5px/1.5 var(--font-mono); color: var(--fg); overflow-wrap: anywhere; user-select: all; }
.key-new { display: grid; gap: 14px; max-width: 480px; }
.key-new fieldset { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.key-new .btn { justify-self: start; }
@media (max-width: 900px) {
  .cl-line { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .ph-tags { display: none; }
}

@media (max-width: 900px) {
  /* One pane at a time: the list, or what's open, with a way back */
  .mx { display: block; }
  .mx__pane { display: none; }
  .mx.is-open .mx__list { display: none; }
  .view:has(.mx.is-open) { padding-top: 12px; padding-bottom: var(--mx-below); }
  .view__inner:has(.mx.is-open) > .view-head { display: none; }
  .mx.is-open .mx__pane { display: block; height: calc(100vh - var(--topbar-h, 104px) - 12px - var(--mx-below)); height: calc(100dvh - var(--topbar-h, 104px) - 12px - var(--mx-below)); min-height: 320px; }
  .mx-back { display: inline-flex; flex: none; align-items: center; gap: 2px; height: 32px; margin: -3px 2px 0 -10px; padding: 0 8px 0 4px; border-radius: 999px; color: var(--accent); font-size: 14px; text-decoration: none; }
  .mx-back .i { width: 18px; height: 18px; }
  .mx-head { padding: 12px 10px 12px 16px; }
  .mx-head__title { font-size: 17px; }
  .mx-scroll { padding: 2px 16px 14px; }
  .mx-fields { padding: 2px 16px; }
  .mx-write { padding: 14px 16px; }
  .mx-compose__foot { padding: 10px 12px 10px 16px; }
  .ct { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ct__segs { position: static; }
  .ct__segs .mx-label { display: none; }
  .ct__segs ul { flex-direction: row; gap: 6px; margin: 0 -16px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
  .ct__segs ul::-webkit-scrollbar { display: none; }
  .ct__segs li { flex: none; }
  .ct__segs a { min-height: 34px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.05); }
  .ct-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .ct-row__co, .ct-row__tags { display: none; }
  .cp-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .cp-row__who, .cp-row__when { display: none; }
  .ct-form__grid { grid-template-columns: minmax(0, 1fr); }
  .seg-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; }
  .seg-cond__val { grid-column: 1 / 3; }
}

/* ---- settings */
.set-section { padding: 22px 24px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.set-section + .set-section { margin-top: 14px; }
.set-section h2, .set-section h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--fg); }
/* A Settings section an old tab's link opens at clears the top bar */
.set-section, .cn-part { scroll-margin-top: calc(var(--topbar-h, 64px) + 16px); }
.set-section > p { max-width: 66ch; margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.set-section > p:last-child { margin-bottom: 0; }
.set-section .look { margin-top: 4px; }
.set-section--danger { border-color: rgba(229, 19, 29, 0.24); }
.set-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; max-width: 640px; }
.set-big { font-size: 20px; font-weight: 600; color: var(--fg); }

/* A setting as one row: what it is on the left, its control on the right, rows split by a hairline */
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 32px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-section > h2 + .set-row, .set-section > .set-row:first-child { border-top: 0; padding-top: 6px; }
.set-section > .set-row:last-child { padding-bottom: 0; }
.set-row__text { display: grid; gap: 3px; min-width: 0; }
.set-row__text b, .set-row__text b label { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.set-row__text b .set-big { font-size: 20px; margin-right: 2px; }
.set-row__text span { max-width: 62ch; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.set-row__ctl { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; }
.set-row__ctl .input, .set-row__ctl .select { width: min(380px, 52vw); }
.set-row--block { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.set-row--block .look { margin-top: 0; }
.set-section > .set-foot { max-width: none; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.set-row--block .look__check { margin-top: 2px; }
.set-section--danger .set-row { padding: 0; }
@media (max-width: 640px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-row__ctl { justify-content: flex-start; }
  .set-row__ctl .input, .set-row__ctl .select { width: 100%; }
}
/* A section that folds away: its heading row opens it */
.set-fold > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.set-fold > summary::-webkit-details-marker { display: none; }
.set-fold[open] > summary { margin-bottom: 10px; }
.set-fold > summary h3 { flex: 1 1 auto; }
.set-fold__caret { display: inline-flex; color: var(--muted); transition: transform 0.2s var(--ease); }
.set-fold__caret svg { width: 16px; height: 16px; }
.set-fold[open] > summary .set-fold__caret { transform: rotate(180deg); }
.set-fold > summary:hover .set-fold__caret { color: var(--fg); }
.set-fold > summary:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 4px; border-radius: 8px; }
.cn-none { margin: 0; padding: 2px 4px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.ph-release { margin-top: 28px; max-width: 760px; }
@media (max-width: 640px) { .set-fields { grid-template-columns: minmax(0, 1fr); } }
/* MCP: three steps to connect, then the tools, any of which runs right here */
.mcp code { font-family: var(--font-mono); font-size: 0.88em; }
/* Code shows every character as typed: no ligatures (Geist Mono would join a space and "--") */
.mcp code, .site__code pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.mcp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.mcp-head h2, .mcp-head h3 { margin: 0 !important; }
.mcp-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-pill); background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 600; }
.mcp-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.mcp-count { font-size: 12.5px; color: var(--muted); }
.mcp-steps { display: flex; flex-direction: column; gap: 22px; margin: 20px 0 18px; padding: 0; list-style: none; counter-reset: mcp-step; }
.mcp-steps > li { position: relative; min-width: 0; padding-left: 40px; counter-increment: mcp-step; }
.mcp-steps > li::before { content: counter(mcp-step); position: absolute; top: -2px; left: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(var(--ink-rgb), 0.07); color: var(--fg); font: 600 11.5px/1 var(--font-sans); }
.mcp-step__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 10px; }
.mcp-step__head b { font-size: 14.5px; font-weight: 600; color: var(--fg); }
.mcp-step__head span { font-size: 13px; color: var(--muted); }
.mcp-connect { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.mcp-folder { font-family: var(--font-mono); font-size: 13px; }
/* The client, as a segmented control like the calendar's */
/* One line at any width, scrolling sideways when the clients don't all fit, so it stays a pill (wrapped, it was a
   lumpy two- or three-line capsule with the buttons crossing its ends) */
.mcp-seg { display: inline-flex; flex-wrap: nowrap; align-self: flex-start; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); }
.mcp-seg::-webkit-scrollbar { display: none; }
.mcp-seg button { flex: none; height: 30px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--fg-2); font: 500 13px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.mcp-seg button:hover { color: var(--fg); }
.mcp-seg button[aria-pressed="true"] { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
.mcp-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[data-theme="dark"] .mcp-seg { background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .mcp-seg button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); box-shadow: none; }
.mcp-code { max-width: 720px; border-radius: 16px; box-shadow: none; }
.mcp-code .site__code-bar { padding: 8px 8px 8px 16px; }
.mcp-code pre { max-height: 360px; padding: 14px 16px; }
.mcp-code pre code { font-size: 12.5px; white-space: pre; }
.mcp-code--line { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.mcp-code--line pre { flex: 1 1 auto; min-width: 0; padding: 12px 16px; }
.mcp-copy { flex: none; height: 26px; padding: 0 10px; border: 0; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.72); font: 500 11.5px/1 var(--font-sans); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.mcp-copy:hover { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.mcp-copy.is-done { background: rgba(34, 197, 94, 0.2); color: #86EFAC; }
.mcp-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.set-section .mcp-note { max-width: 72ch; margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
/* The tools, which double as the picker for trying one */
.mcp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 16px; }
.mcp-tool { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 10px 12px; border: 0; border-radius: 12px; background: rgba(var(--ink-rgb), 0.04); color: var(--fg); text-align: left; cursor: pointer; transition: background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
[data-theme="dark"] .mcp-tool { background: rgba(255, 255, 255, 0.05); }
.mcp-tool:hover { background: rgba(var(--ink-rgb), 0.07); }
.mcp-tool code { font-size: 12.5px; color: var(--fg); }
.mcp-tool span { font-size: 12px; color: var(--muted); }
.mcp-tool[aria-pressed="true"] { background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 0 0 0 1.5px rgba(var(--accent-rgb), 0.55); }
.mcp-tool[aria-pressed="true"] code { color: var(--accent); }
.mcp-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mcp-try { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 16px; align-items: start; margin-bottom: 14px; }
.mcp-try__in { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.set-section .mcp-desc { margin: 0 0 6px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.mcp-args { min-height: 104px; font: 12.5px/1.55 var(--font-mono); }
.mcp-run { align-self: flex-start; margin-top: 4px; }
.mcp-try__out { max-width: none; }
.mcp-try__out pre { min-height: 196px; }
@media (max-width: 900px) {
  .mcp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mcp-try { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) { .mcp-steps > li { padding-left: 34px; } }
.set-bar { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; margin-bottom: 8px; }
.set-bar .lib-explain { flex: 1 1 420px; margin: 0; }

/* ---------- The Space menu, under the switcher ---------- */
.space-menu {
  position: fixed;
  z-index: 90;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--field-panel, var(--surface-solid)) 90%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: inset 0 1px 0 var(--glass-top), 0 30px 70px -28px rgba(var(--shadow-rgb), 0.55);
  transform-origin: top left;
  animation: space-menu-in 0.16s var(--ease);
}
@keyframes space-menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.space-menu__label { margin: 8px 10px 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
/* Where the list of Spaces is kept, and whether it's synced (Spaces themselves, in js/app.js) */
.space-menu__where { margin: 8px 10px 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.space-menu__item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 6px 10px; border: 0; border-radius: 13px; background: transparent; color: var(--fg); font: 500 14px/1.25 var(--font-sans); text-align: left; cursor: pointer; }
.space-menu__item:hover, .space-menu__item:focus-visible { outline: none; background: var(--glass-3); }
[data-theme="dark"] .space-menu__item:hover, [data-theme="dark"] .space-menu__item:focus-visible { background: rgba(255, 255, 255, 0.09); }
.space-menu__item[aria-checked="true"] { font-weight: 600; }
.space-menu__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-menu__meta { flex: none; font: 11px/1 var(--font-mono); color: var(--muted); }
.space-menu__check { flex: none; width: 15px; height: 15px; color: var(--accent); opacity: 0; }
.space-menu__item[aria-checked="true"] .space-menu__check { opacity: 1; }
.space-menu__icon { flex: none; width: 15px; height: 15px; color: var(--muted); }
.space-menu__item--act { color: var(--fg-2); }
.space-menu__item--act:hover .space-menu__icon { color: var(--fg); }
.space-menu__rule { margin: 6px 6px; border: 0; border-top: 1px solid var(--line); }
.space-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(var(--ink-rgb), 0.1); }
.space-dot--ring { background: conic-gradient(from 0deg, #8C5CFF, #4D80FA, #29CCDB, #8C5CFF); box-shadow: none; -webkit-mask: radial-gradient(farthest-side, transparent calc(58% - 0.5px), #000 58%); mask: radial-gradient(farthest-side, transparent calc(58% - 0.5px), #000 58%); }
@media (prefers-reduced-motion: reduce) { .space-menu { animation: none; } }


/* ---------- A template, opened: everything in the pack, then where it goes ---------- */
.pack { display: flex; flex-direction: column; gap: 20px; }
.pack__top { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 22px; align-items: center; }
.pack__top .space-tpl__img { aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; }
.pack__top .space-tpl__cover { gap: 12px; padding: 20px; }
.pack__intro { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pack__intro .space-tpl__meta { align-self: flex-start; }
.modal__body .pack__text { font-size: 15.5px; line-height: 1.55; color: var(--fg); }
.modal__body .pack__sum { font-size: 13px; color: var(--muted); }
.modal__body .pack__warn { padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 13px; }
.pack-sec { padding-top: 14px; border-top: 1px solid var(--line); }
.pack-sec h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--fg); }
.pack-sec h3 span { font: 500 11px/1 var(--font-mono); color: var(--muted); }
.pack-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pack-table b { font-size: 13.5px; font-weight: 600; }
.pack-table__grid { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line-2); border-radius: 12px; }
.pack-table__grid span { min-height: 30px; padding: 7px 10px; overflow: hidden; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-2); white-space: nowrap; text-overflow: ellipsis; }
.pack-table__grid .pack-table__h { border-top: 0; background: rgba(var(--ink-rgb), 0.04); font: 500 10px/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.pack-table small, .modal__body .pack-note { font-size: 12px; color: var(--muted); }
.pack-docs, .pack-rules { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pack-docs li { display: flex; flex-direction: column; gap: 2px; }
.pack-docs b { font-size: 13.5px; font-weight: 600; color: var(--fg); }
.pack-docs span { font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.pack-rules li { font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.pack-rules b { display: inline-block; min-width: 56px; margin-right: 8px; font: 600 10px/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.pack-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.pack-files li { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pack-files img { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: var(--surface-sunk); }
.pack-files span { overflow: hidden; font: 10.5px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; text-overflow: ellipsis; }
.pack-auto { margin-bottom: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(var(--ink-rgb), 0.04); }
[data-theme="dark"] .pack-auto { background: rgba(255, 255, 255, 0.05); }
.pack-auto > b { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.auto__lines { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.auto__lines div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; font-size: 13px; line-height: 1.5; }
.auto__lines dt { padding-top: 2px; font: 600 10px/1.6 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.auto__lines dd { display: flex; flex-direction: column; gap: 2px; margin: 0; color: var(--fg-2); }
.auto__lines em { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-style: normal; }
.modal__body .pack-line { font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.pack-where { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
.pack-where legend { padding: 0; margin-bottom: 8px; }
.pack-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; cursor: pointer; }
.pack-opt:has(input:checked) { border-color: rgba(var(--accent-rgb), 0.6); background: rgba(var(--accent-rgb), 0.07); }
.pack-opt input { margin-top: 3px; accent-color: var(--accent); }
.pack-opt span { display: flex; flex-direction: column; gap: 2px; }
.pack-opt b { font-size: 14px; font-weight: 600; color: var(--fg); }
.pack-opt small { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pack-name { max-width: 420px; margin: 4px 0 0; }
.modal__body .pack-own { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.tpl-own { margin: -8px 0 22px; font-size: 13.5px; color: var(--fg-2); }
.tpl-own .link-btn { margin-left: 6px; }
@media (max-width: 720px) { .pack__top { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Settings → Automations ---------- */
.autos { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.auto { padding: 16px 18px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.auto__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.auto__head b { font-size: 15px; font-weight: 600; }
.auto__state { padding: 3px 9px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); font-size: 11.5px; color: var(--muted); }
.auto__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- Make a template: pick what it carries ---------- */
.pick-meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin: 14px 0 6px; }
.pick-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 22px; margin-top: 10px; }
.pick-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.pick-group legend { display: flex; align-items: baseline; gap: 10px; width: 100%; margin-bottom: 6px; padding: 0; font: 500 10.5px/1.6 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pick { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 4px 0; font-size: 13.5px; line-height: 1.4; color: var(--fg); cursor: pointer; }
.pick input { accent-color: var(--accent); }
.pick small { color: var(--muted); }
.pick > span { flex: 1 1 0; min-width: 0; }
.pick--sub { padding: 0 0 4px 24px; font-size: 12.5px; color: var(--fg-2); }
.pick-scan { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--rec-soft); color: var(--rec-ink); font-size: 13px; line-height: 1.5; }
.pick-scan ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 720px) { .pick-meta, .pick-groups { grid-template-columns: minmax(0, 1fr); } }

/* The round buttons in the top bar: on hover, a faint wash of the accent and a lift of a pixel */
.topbar .icon-btn, .topbar .wordmark { transition: background-color 220ms var(--ease), border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease); }
.topbar .icon-btn:not([aria-current="page"]):hover, .topbar .wordmark:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--glass-top));
  border-color: color-mix(in srgb, var(--accent) 16%, var(--glass-line));
  box-shadow: inset 0 1px 0 var(--glass-top), 0 10px 20px -12px rgba(var(--shadow-rgb), 0.55);
  transform: translateY(-1px);
}
[data-theme="dark"] .topbar .icon-btn:not([aria-current="page"]):hover, [data-theme="dark"] .topbar .wordmark:hover { background: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.12)); }
.topbar .icon-btn:active, .topbar .wordmark:active { transform: translateY(0); transition-duration: 80ms; }
@media (prefers-reduced-motion: reduce) { .topbar .icon-btn:hover, .topbar .wordmark:hover { transform: none; } }

/* ---------- Settings: a section's head with its action, and a line under it ---------- */
.set-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 6px; }
.set-head h2 { margin: 0 !important; }
.set-head__switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.set-section > .set-lede { max-width: 66ch; margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.set-section .outlet-list { margin-top: 4px; }

/* ---------- Settings → Calendar: meeting types, hours, other calendars ---------- */
.bk-types { margin: 2px 0 4px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.bk-types li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.bk-type__icon { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(var(--ink-rgb), 0.05); color: var(--fg-2); }
.bk-type__icon svg { width: 16px; height: 16px; }
.bk-type__body { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.bk-type__body b { font-size: 14px; font-weight: 600; }
.bk-type__body small { overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.bk-times { flex-wrap: wrap; }
.bk-zone .select { width: auto; max-width: 260px; }
.bk-busy { font-size: 13px; }

/* ---------- Meetings: the list, the pane, the form ---------- */
.mt-date { display: inline-grid; place-items: center; flex: none; width: 38px; height: 40px; border-radius: 10px; background: rgba(var(--ink-rgb), 0.05); line-height: 1; }
.mt-date b { font-size: 15px; font-weight: 650; }
.mt-date small { margin-top: -4px; font: 600 9.5px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mt-row.is-past .mx-conv__who { color: var(--fg-2); font-weight: 500; }
.mt-state { flex: none; align-self: center; padding: 3px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); }
.mt-state--live, .mt-state--now { background: var(--ok-soft); color: var(--ok); }
.mt-state--canceled { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }
.mt-join { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 18px; }
.mt-join__state { padding: 0; background: none; font-size: 13px; font-weight: 500; color: var(--muted); }
.mt-join__state.mt-state--live, .mt-join__state.mt-state--now { color: var(--ok); }
.mt-switch { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; }
.mt-switch span { display: grid; gap: 2px; }
.mt-switch b { font-size: 14px; font-weight: 600; }
.mt-switch small { font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.mt-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: rgba(var(--ink-rgb), 0.05); font-size: 13.5px; color: var(--fg-2); }
.mt-foot { display: flex; gap: 16px; margin-top: 22px; }
.mt-form { display: grid; align-content: start; gap: 14px; padding: 18px 20px 28px; }
.mt-when { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.mt-when .field, .mt-form > .field { margin: 0; }
.mt-form__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.mt-form__acts .field__hint { margin: 0; }
.mt-notes-check { align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
@media (max-width: 640px) { .mt-when { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .mt-when .field:first-child { grid-column: 1 / -1; } }
/* the chip a meeting leaves in its conversation */
.mx-meet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; max-width: 420px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(var(--ink-rgb), 0.03); }
.mx-meet > svg { width: 18px; height: 18px; color: var(--accent); }
.mx-meet > span { display: grid; flex: 1 1 140px; gap: 1px; min-width: 0; }
.mx-meet b { font-size: 13.5px; font-weight: 600; }
.mx-meet small { font-size: 12px; color: var(--muted); }
/* on the calendar */
.cal-cell__dots i.is-meet { border-radius: 2px; background: var(--accent); }
.cal-ev--meet { --c: var(--accent); cursor: pointer; }
.cal-ev--meet .cal-ev__btn { grid-template-columns: 3px auto minmax(0, 1fr); color: inherit; text-decoration: none; }
.cal-ev__icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(var(--ink-rgb), 0.05); color: var(--accent); }
.cal-ev__icon svg { width: 14px; height: 14px; }
.cal-ev--meet.is-ended { opacity: 0.6; }

/* ---------- The meeting room: on the page, or small in the corner ---------- */
.room { position: fixed; inset: calc(var(--topbar-h, 64px) + 18px) 24px 24px; z-index: 60; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; gap: 14px; padding: 18px 20px 20px; border-radius: 24px; background: #0E1220; color: #EDF1FA; box-shadow: 0 30px 80px rgba(6, 10, 24, 0.45); }
.room__head { display: flex; align-items: center; gap: 12px; }
.room__live { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: rgba(52, 211, 153, 0.14); color: #6EE7B7; font-size: 12px; font-weight: 600; }
.room__live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: room-pulse 1.6s ease-in-out infinite; }
@keyframes room-pulse { 50% { opacity: 0.35; } }
.room__title { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.room__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-auto-rows: minmax(150px, 1fr); gap: 12px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.room__tile { position: relative; display: grid; place-items: center; overflow: hidden; border-radius: 18px; background: #1A2033; }
.room__tile.is-you { box-shadow: inset 0 0 0 1.5px rgba(143, 182, 232, 0.5); }
.room__tile video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.room__av { width: 76px !important; height: 76px !important; font-size: 26px !important; }
.room__av.av--me { background: rgba(143, 182, 232, 0.16) !important; color: #CFE0F7 !important; }
.room__av svg { width: 34px; height: 34px; }
.room__name { position: absolute; left: 12px; bottom: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(6, 10, 24, 0.55); font-size: 12.5px; font-weight: 500; }
.room__wait { position: absolute; top: 10px; right: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(6, 10, 24, 0.4); font-size: 12px; color: rgba(237, 241, 250, 0.7); }
.room__notes { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: #C7B8FF; }
.room__notes svg { width: 15px; height: 15px; }
.room__note { margin: 0; font-size: 12.5px; color: rgba(237, 241, 250, 0.55); }
.room__bar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.room__btn { display: inline-grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #EDF1FA; cursor: pointer; transition: background 0.15s; }
.room__btn:hover { background: rgba(255, 255, 255, 0.18); }
.room__btn svg { width: 20px; height: 20px; }
.room__btn[aria-pressed="false"] { background: rgba(255, 255, 255, 0.92); color: #0E1220; }
.room__btn--notes[aria-pressed="false"] { background: rgba(255, 255, 255, 0.1); color: #EDF1FA; }
.room__btn--notes[aria-pressed="true"] { background: #7C5CFF; color: #fff; }
.room__btn--quiet { width: 36px; height: 36px; background: transparent; }
.room__leave { height: 46px; padding: 0 22px; border: 0; border-radius: 999px; background: #E5131D; color: #fff; font: 600 14px/1 var(--font-sans); cursor: pointer; }
.room__leave:hover { background: #C40F18; }
.room :focus-visible { outline: 2px solid #8FB6E8; outline-offset: 2px; }
.room.is-small { inset: auto 20px 20px auto; width: 300px; grid-template-rows: auto auto auto; gap: 10px; padding: 12px; border-radius: 20px; }
.room.is-small .room__tiles { grid-template-columns: 1fr; grid-auto-rows: 150px; }
.room.is-small .room__tile:not(.is-you), .room.is-small .room__note, .room.is-small .room__notes { display: none; }
.room.is-small .room__btn { width: 38px; height: 38px; }
.room.is-small .room__leave { height: 38px; padding: 0 16px; }
@media (max-width: 760px) {
  .room { inset: 12px 10px calc(var(--mx-below, 0px) + 10px); padding: 14px; border-radius: 20px; }
  .room__tiles { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(120px, 1fr); }
  .room.is-small { inset: auto 10px calc(var(--mx-below, 0px) + 10px) auto; width: 220px; }
}
.home-row__meet { color: var(--accent); }
.home-row__meet svg { width: 16px; height: 16px; }

/* A head action as one round icon, like the top bar's; the main one is filled */
.view-head__actions .head-icon { width: 42px; height: 42px; }
.view-head__actions .head-icon svg { width: 18px; height: 18px; }
.head-icon--primary { background: var(--fg); color: var(--bg); box-shadow: none; }
.head-icon--primary:hover { background: rgba(var(--ink-rgb), 0.86); }
.view-head__actions { gap: 8px; }

/* ---------- Who a doc is for: a chip on a top-level page, followed by everything inside it ---------- */
.doc-reach { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: none; font-size: 12.5px; color: var(--fg-2); text-decoration: none; cursor: pointer; }
.doc-reach svg { width: 14px; height: 14px; }
.doc-reach.is-out { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.doc-reach--in { border-style: dashed; color: var(--muted); }
.tree__reach { display: inline-flex; margin-left: 4px; color: var(--ok); }
.tree__reach svg { width: 12px; height: 12px; }
.ds-reach { align-items: flex-start; margin: 6px 0; }
.ds-reach small { color: var(--muted); }
.pr-path { display: flex; align-items: center; gap: 6px; }
.pr-path span { font-size: 13.5px; color: var(--muted); white-space: nowrap; }

/* ---------- Tables: typed cells, a column's type, and a row as a card ---------- */
.tgrid__open { width: 100%; min-width: 28px; padding: 4px 6px; border: 0; border-radius: 8px; background: none; font: inherit; color: inherit; cursor: pointer; }
.tgrid__open:hover, .tgrid__open:focus-visible { background: rgba(var(--ink-rgb), 0.07); color: var(--fg); }
.tgrid__col { display: inline-flex; align-items: center; gap: 6px; }
.tgrid__type { display: inline-flex; flex: none; color: var(--muted); }
.tgrid__type svg { width: 13px; height: 13px; }
.tgrid__cell.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.tgrid__cell.is-bad { box-shadow: inset 0 -2px 0 rgba(229, 19, 29, 0.45); }
.tgrid__sel { appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.tgrid__c { text-align: center; }
.tgrid__check, .rc-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.row-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.row-card__f { margin: 0; }
.row-card__f .field__label { display: inline-flex; align-items: center; gap: 6px; }
.row-card__f.is-check { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
.row-card__f .input.is-bad { box-shadow: inset 0 0 0 1px rgba(229, 19, 29, 0.45); }
.row-card__del { margin-top: 16px; }
@media (max-width: 560px) { .row-card { grid-template-columns: minmax(0, 1fr); } }
.field[hidden] { display: none !important; }
.tgrid th.is-num { text-align: right; }
.tgrid th.is-num .tgrid__col { flex-direction: row; justify-content: flex-end; width: 100%; }

/* ---------- The Personal Space's feed, while it's the only Space: starting the next one, beside the feed ---------- */
.fd-start__lede { margin: -4px 0 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.fd-start .welcome__form { grid-template-columns: minmax(0, 1fr) auto; margin-top: 14px; }
.fd-start .welcome__form > .field:first-child { grid-column: 1 / -1; }
.fd-start .welcome__alt { justify-content: flex-start; gap: 8px 12px; margin-top: 12px; }

/* ---------- Settings → Space → Storage: one bar of everything Formula keeps here ---------- */
.storage { --st-image: #4D80FA; --st-video: #8C5CFF; --st-audio: #29CCDB; --st-writing: #3FAE7A; --st-history: #E0A23A; --st-deleted: #E0567A; --st-others: rgba(var(--ink-rgb), 0.16); padding: 4px 0 16px; }
.storage__total { margin: 0 0 12px; font-size: 14.5px; color: var(--fg-2); }
.storage__bar { display: flex; gap: 2px; height: 12px; overflow: hidden; border-radius: 999px; background: rgba(var(--ink-rgb), 0.07); }
.storage__seg { flex: 0 0 0; min-width: 4px; height: 100%; background: var(--c); transition: flex-grow 0.5s var(--ease); }
.storage__seg:first-child { border-radius: 999px 0 0 999px; }
.storage__seg:last-child { border-radius: 0 999px 999px 0; }
.storage__seg:only-child { border-radius: 999px; }
.storage__seg--image { --c: var(--st-image); }
.storage__seg--video { --c: var(--st-video); }
.storage__seg--audio { --c: var(--st-audio); }
.storage__seg--writing { --c: var(--st-writing); }
.storage__seg--history { --c: var(--st-history); }
.storage__seg--deleted { --c: var(--st-deleted); }
.storage__seg--others { --c: var(--st-others); }
.storage__key { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--fg-2); }
.storage__key li { display: inline-flex; align-items: center; gap: 7px; }
.storage__key b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.storage__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.storage__all { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.storage__files { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.storage__file { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-md, 10px); background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.storage__file:hover, .storage__file:focus-visible { background: rgba(var(--ink-rgb), 0.05); }
.storage__thumb { width: 36px; height: 36px; overflow: hidden; border-radius: 8px; background: rgba(var(--ink-rgb), 0.07); }
.storage__thumb img { width: 100%; height: 100%; object-fit: cover; }
.storage__name { overflow: hidden; font-size: 13.5px; white-space: nowrap; text-overflow: ellipsis; }
.storage__size { font: 12px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }


/* ---------- The feed, the Vault's first tab: one column you read, a quiet one beside it ---------- */
.feed-wrap { display: grid; grid-template-columns: minmax(0, 640px) minmax(240px, 300px); gap: 48px; justify-content: space-between; align-items: start; margin-top: 8px; }
/* Narrower, it's one stream: the composer, a new Space's first steps as its first card, then the feed.
   The rest of what's beside it stays out of the way. */
@media (max-width: 1100px) {
  .feed-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .feed { display: contents; }
  .feed > * { order: 2; }
  .feed > .fd-compose { order: 0; }
  .feed-side { order: 1; margin: 28px 0 8px; }
  .feed-side > :not(.guide):not(.fd-start), .feed-side:not(:has(> .guide, > .fd-start)) { display: none; }
}
.feed { min-width: 0; }
.feed-side { display: grid; gap: 30px; min-width: 0; }

/* The composer: your avatar, a line to write on, images from the Vault */
.fd-compose { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 16px 18px; border: 1px solid var(--glass-line); border-radius: var(--radius-2xl); background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 0 var(--glass-top); }
.fd-compose__av { width: 40px; height: 40px; }
.fd-compose__main { display: grid; gap: 10px; min-width: 0; }
.fd-compose__text { width: 100%; min-height: 40px; max-height: 260px; padding: 9px 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: 16px; line-height: 1.5; resize: none; field-sizing: content; outline: none; }
.fd-compose__text::placeholder { color: var(--muted); }
.fd-compose__media { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fd-compose__media li { position: relative; width: 84px; height: 84px; overflow: hidden; border-radius: 14px; background: rgba(var(--ink-rgb), 0.06); }
.fd-compose__media img { width: 100%; height: 100%; object-fit: cover; }
.fd-compose__x { position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: #fff; cursor: pointer; }
.fd-compose__x .i { width: 13px; height: 13px; }
.fd-compose__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.fd-compose__tool { flex: none; }
.fd-compose__tool .i { width: 20px; height: 20px; }
.fd-compose .btn[disabled] { opacity: 0.4; pointer-events: none; }

/* An item: avatar, then who and what, the thing itself, and four quiet actions */
.feed__list { margin-top: 6px; }
.feed > .empty-state { margin-top: 20px; }
.fd { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 20px 2px; border-bottom: 1px solid var(--line); }
.fd--new { animation: fd-in 0.5s var(--ease) both; }
@keyframes fd-in { from { opacity: 0; transform: translateY(-6px); } }
.fd__av { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.fd__av .av { width: 40px; height: 40px; font-size: 14px; }
.fd__main { min-width: 0; }
.fd__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; min-height: 22px; }
.fd__who { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; cursor: pointer; }
.fd__who:hover { text-decoration: underline; text-underline-offset: 3px; }
.fd__what { font-size: 14.5px; color: var(--fg-2); }
.fd__what a { color: var(--fg); font-weight: 550; text-decoration: none; }
.fd__what a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fd__when { font-size: 13.5px; color: var(--muted); text-decoration: none; }
.fd__when::before { content: '·'; margin-right: 7px; }
.fd__when:hover { color: var(--fg); }
.fd__menu { margin-left: auto; width: 30px; height: 30px; min-height: 0; color: var(--muted); }
.fd__text { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--fg); overflow-wrap: anywhere; }
.fd__text .mention { color: var(--accent); font-weight: 550; text-decoration: none; }

/* Media: one large, two side by side, three or four in a grid, more as a reel */
.fd-media { display: grid; gap: 4px; margin-top: 12px; overflow: hidden; border-radius: 20px; }
.fd-media__item { position: relative; display: block; width: 100%; padding: 0; border: 0; background: rgba(var(--ink-rgb), 0.06); cursor: zoom-in; overflow: hidden; }
.fd-media__item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.fd-media__item:hover img { transform: scale(1.02); }
.fd-media--1 .fd-media__item { aspect-ratio: 4 / 3; max-height: 560px; }
.fd-media--2 { grid-template-columns: 1fr 1fr; }
.fd-media--2 .fd-media__item { aspect-ratio: 4 / 5; }
.fd-media--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; aspect-ratio: 3 / 2; }
.fd-media--3 .fd-media__item:first-child { grid-row: 1 / 3; }
.fd-media--4 { grid-template-columns: 1fr 1fr; }
.fd-media--4 .fd-media__item { aspect-ratio: 1; }
.fd-media--reel { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 0; scrollbar-width: none; }
.fd-media--reel::-webkit-scrollbar { display: none; }
.fd-media--reel .fd-media__item { flex: 0 0 min(220px, 42%); aspect-ratio: 4 / 5; border-radius: 16px; scroll-snap-align: start; }
.fd-media__rest { flex: 0 0 90px; display: grid; place-items: center; border-radius: 16px; background: rgba(var(--ink-rgb), 0.06); font-weight: 600; color: var(--fg-2); }
.fd-media__play { position: absolute; inset: auto auto 10px 10px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff; }
.fd-media__play .i { width: 14px; height: 14px; }

/* Cards for what isn't a picture: a page, a table, a storyboard, a post going out, a recipe's run */
.fd-cards { display: grid; gap: 8px; margin-top: 12px; }
.fd-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; width: 100%; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--glass-line); border-radius: 18px; background: var(--glass); color: var(--fg); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.fd-cards .fd-card { margin-top: 0; }
.fd-card:hover { border-color: var(--line-3, var(--glass-line)); background: var(--glass-2); }
.fd-card b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.fd-card small, .fd-card > span > span:not(.badge) { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.fd-card--page { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 16px 18px; }
.fd-card--page > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.55; color: var(--fg-2); }
.fd-card--page small { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.fd-card--board { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
.fd-card--board .strip { height: 150px; gap: 4px; overflow: hidden; }
.fd-card--board .strip__cell { width: auto; height: 100%; border-radius: 10px; }
.fd-card__line { padding: 0 6px 2px; }
.fd-card--more { grid-template-columns: minmax(0, 1fr); justify-items: center; color: var(--fg-2); font-size: 13.5px; }
.fd-card__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); }
.fd-card__thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.fd-card--sched .strip { width: 84px; }
.fd-subjects { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.fd-subjects a { display: grid; justify-items: center; gap: 6px; width: 64px; color: var(--fg-2); font-size: 12px; text-align: center; text-decoration: none; }
.fd-subjects a span { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fd-subjects__img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: rgba(var(--ink-rgb), 0.06); box-shadow: 0 0 0 2px var(--glass-top); }
.fd-subjects__img--empty { display: grid; place-items: center; font-weight: 650; color: var(--fg-2); }
.fd-subjects__more a { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: rgba(var(--ink-rgb), 0.06); font-weight: 600; }

/* Four quiet actions, a heart that fills, a bookmark that fills */
.fd__acts { display: flex; gap: 22px; margin-top: 12px; margin-left: -8px; }
.fd-act { display: inline-flex; align-items: center; gap: 5px; min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; cursor: pointer; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.fd-act .i { width: 19px; height: 19px; }
.fd-act:hover { color: var(--fg); background: rgba(var(--ink-rgb), 0.05); }
.fd-act--like:hover, .fd-act--like.is-on { color: #E0456B; }
.fd-act--like.is-on .i path { fill: currentColor; }
.fd-act--save.is-on { color: var(--fg); }
.fd-act--save.is-on .i path { fill: currentColor; }
.fd-act.is-pop .i { animation: fd-pop 0.38s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes fd-pop { 40% { transform: scale(1.28); } }
.fd-act span:empty { display: none; }

/* Comments: a thread under each item. Answers hang off their veins the way pages do in the Docs tree:
   a line runs down from under a comment's avatar and curves into each answer's, and the path to where
   you're writing is drawn in the accent. */
.fd__replies { --vein: rgba(var(--ink-rgb), 0.2); --vein-on: var(--accent); display: grid; gap: 12px; margin-top: 12px; }
.fd__all { justify-self: start; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.fd__all:hover { color: var(--fg); }
.fdt { display: grid; margin: 0; padding: 0; list-style: none; }
.fdt > li + li { margin-top: 14px; }
.fdt .fdt { margin-left: 13px; }
.fdt .fdt .fdt { margin-left: 11px; }
.fdt .fdt > li { position: relative; margin-top: 0; padding: 12px 0 0 22px; }
.fdt .fdt > li::before { content: ""; position: absolute; left: 0; top: 0; width: 18px; height: 24px; border-left: 1px solid var(--vein); border-bottom: 1px solid var(--vein); border-bottom-left-radius: 12px; transition: border-color var(--dur) var(--ease); }
.fdt .fdt > li:not(:last-child)::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1px solid var(--vein); transition: border-color var(--dur) var(--ease); }
.fdt .fdt > li.fdt__box::before { height: 31px; }
.fdt__item.has-kids > .fdc::before { content: ""; position: absolute; left: 13px; top: 34px; bottom: 0; border-left: 1px solid var(--vein); transition: border-color var(--dur) var(--ease); }
.fdt .fdt .fdt__item.has-kids > .fdc::before { left: 11px; top: 30px; }
.fdt li.is-path::before { border-color: var(--vein-on); }
.fdt li:has(~ li.is-path)::after { border-left-color: var(--vein-on); }
.fdt__item:has(> .fdt > li.is-path) > .fdc::before { border-left-color: var(--vein-on); }
.fdt__open { height: 24px; padding: 0; border: 0; background: none; color: var(--fg-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fdt__open:hover { color: var(--fg); }

/* A comment: its avatar, who and when, what they said, reactions, and what you can do with it */
.fdc { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.fdt .fdt .fdc { grid-template-columns: 24px minmax(0, 1fr); gap: 9px; }
.fdc__av { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.fdc .av--sm { width: 28px; height: 28px; font-size: 11px; }
.fdt .fdt .fdc__av, .fdt .fdt .fdc .av--sm { width: 24px; height: 24px; font-size: 10px; }
.fdc__av--gone { display: block; border: 1px dashed var(--line-2); cursor: default; }
.fdc__body { min-width: 0; padding-bottom: 2px; }
.fdc__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px; margin: 0; font-size: 13.5px; line-height: 1.35; }
.fdc__who { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; font-weight: 650; cursor: pointer; }
.fdc__who:hover { text-decoration: underline; text-underline-offset: 3px; }
.fdc.is-to .fdc__who { color: var(--accent); }
.fdc__to { display: inline-flex; align-items: center; gap: 3px; color: var(--fg-2); }
.fdc__to .i { width: 12px; height: 12px; color: var(--muted); }
.fdc__when, .fdc__edited { color: var(--muted); }
.fdc__edited { font-size: 12px; }
.fdc__text { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--fg); overflow-wrap: anywhere; }
.fdc__text .mention { color: var(--accent); font-weight: 550; text-decoration: none; }
.fdc__text.is-jumbo { font-size: 30px; line-height: 1.2; letter-spacing: 0.02em; }
.fd__text.is-jumbo { font-size: 46px; line-height: 1.15; letter-spacing: 0.02em; }
.fdc__gone { margin: 5px 0 0; font-size: 13.5px; font-style: italic; color: var(--muted); }
.fdc.is-new { animation: fdc-in 0.36s var(--ease); }
@keyframes fdc-in { from { opacity: 0; transform: translateY(6px); } }
.fdc__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 5px; }
.fdc__reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.fdc-react { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px 0 7px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); color: var(--fg-2); font: inherit; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.fdc-react:hover { border-color: rgba(var(--ink-rgb), 0.22); color: var(--fg); }
.fdc-react.is-on { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); }
.fdc-react__e { display: inline-block; font-size: 15px; line-height: 1; }
.fdc-react.is-pop .fdc-react__e { animation: fd-pop 0.38s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fdc__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.fdc__acts:first-child { margin-left: -7px; }
.fdc-act { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 7px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.fdc-act:hover, .fdc-act[aria-expanded="true"] { color: var(--fg); background: rgba(var(--ink-rgb), 0.05); }
.fdc-act .i { width: 17px; height: 17px; }
.fdc-react:focus-visible, .fdc-act:focus-visible, .fdt__open:focus-visible, .fdc__who:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fdc__edit { display: grid; gap: 8px; margin-top: 6px; }
.fdc__edit-acts { display: flex; justify-content: flex-end; gap: 8px; }

/* The box to write in, a new comment or an answer: it grows with what's written, with emoji at its end */
.fd-reply { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.fd-reply .av--sm { align-self: start; width: 28px; height: 28px; margin-top: 5px; font-size: 11px; }
.fd-reply > .btn { margin-bottom: 2px; }
.fd-reply--to { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; }
.fd-reply--to .av--sm { width: 24px; height: 24px; margin-top: 7px; font-size: 10px; }
.fd-reply__field { position: relative; min-width: 0; }
.fd-reply__field .emo-btn { position: absolute; right: 3px; bottom: 3px; width: 32px; height: 32px; border: 0; background: none; box-shadow: none; color: var(--muted); }
.fd-reply__field .emo-btn:hover, .fd-reply__field .emo-btn[aria-expanded="true"] { color: var(--fg); background: rgba(var(--ink-rgb), 0.06); }
.fd-reply__field .emo-btn .i { width: 19px; height: 19px; }
.fd-reply__input { display: block; width: 100%; min-height: 38px; max-height: 168px; padding: 9px 42px 9px 14px; border: 1px solid var(--glass-line); border-radius: 20px; background: var(--field-input, var(--glass)); color: var(--fg); font: inherit; font-size: 14.5px; line-height: 1.35; resize: none; field-sizing: content; overflow-y: auto; outline: none; }
.fd-reply__input:focus { border-color: var(--primary); }
/* Empty, the box is one line at any width (it sizes to its placeholder, so a long one mustn't wrap): a pill until you write more */
.fd-reply__input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__more { display: flex; justify-content: center; margin: 22px 0 0; }

/* Beside the feed */
.feed-side .section-title { margin-bottom: 12px; }
.feed-side .home-list { margin: 0; }
.fd-people { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.fd-people li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fd-people__who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 0; border: 0; background: none; color: var(--fg); font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }
.fd-follow { height: 30px; padding: 0 14px; border: 1px solid var(--fg); border-radius: 999px; background: var(--fg); color: var(--bg, #fff); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.fd-follow.is-on { border-color: var(--glass-line); background: transparent; color: var(--fg); }

/* You, in Formula's colours */
.fd .av--me, .fd-compose .av--me { background: linear-gradient(135deg, #8C5CFF, #4D80FA 55%, #29CCDB); color: #fff; }

/* Rue's avatar, and picking images for a post */
.av--rue { display: inline-grid; place-items: center; background: var(--glass-3, rgba(255, 255, 255, 0.6)); box-shadow: inset 0 0 0 1px var(--glass-line); }
.av--rue .ring-mark { width: 52%; height: 52%; }
.fd-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.fd-pick__item { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: rgba(var(--ink-rgb), 0.06); cursor: pointer; }
.fd-pick__item img { width: 100%; height: 100%; object-fit: cover; }
.fd-pick__item input { position: absolute; opacity: 0; }
.fd-pick__tick { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #fff; background: rgba(0, 0, 0, 0.25); color: transparent; }
.fd-pick__tick .i { width: 14px; height: 14px; }
.fd-pick__item input:checked ~ .fd-pick__tick { border-color: var(--primary); background: var(--primary); color: #fff; }
.fd-pick__item input:checked ~ img { opacity: 0.85; }
.fd-pick__item input:focus-visible ~ .fd-pick__tick { outline: 2px solid var(--primary); outline-offset: 2px; }


/* ---------- Dashboards: a grid of cards, each kind drawn one way, in the Space's colour ---------- */
.dash-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.dash-tile { display: grid; gap: 14px; height: 100%; padding: 16px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); color: var(--fg); text-decoration: none; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.dash-tile:hover { border-color: var(--line-3, var(--glass-line)); transform: translateY(-1px); }
.dash-tile__peek { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 30px; gap: 4px; }
.dash-peek { display: grid; place-items: center; border-radius: 8px; background: rgba(var(--ink-rgb), 0.05); color: var(--accent); }
.dash-peek .i { width: 15px; height: 15px; }
.dash-peek--m { grid-column: span 2; } .dash-peek--l { grid-column: span 3; } .dash-peek--w { grid-column: span 4; }
.dash-tile__body { display: grid; gap: 4px; }
.dash-tile__body b { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.dash-tile__fig { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.dash-tile__fig small, .dash-tile__body > small { font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
/* Vault → Apps: a dashboard's tile, with the app's icon beside it; a published app's tile opens its site */
.app-tile { grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
.app-tile__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--surface-sunk); font-size: 22px; line-height: 1; color: var(--muted); }
.app-tile__icon .i { width: 22px; height: 22px; }
.app-tile__about { font-size: 14px; line-height: 1.45; color: var(--fg-2); }
.app-tile--off:hover { border-color: var(--glass-line); transform: none; }
.dash-sub { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }

/* Cards sit in the order they're arranged, row by row, the same order a phone stacks them in */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.dc { display: grid; grid-template-rows: auto 1fr auto; min-width: 0; min-height: 168px; padding: 16px 18px 14px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 var(--glass-top); }
.dc--s { grid-column: span 3; } .dc--m { grid-column: span 6; } .dc--l { grid-column: span 9; } .dc--w { grid-column: span 12; }
@media (max-width: 1100px) { .dc--s { grid-column: span 6; } .dc--m, .dc--l { grid-column: span 12; } }
@media (max-width: 620px) { .dc--s, .dc--m, .dc--l, .dc--w { grid-column: span 12; } }
.dc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.dc__head h3 { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; color: var(--fg-2); letter-spacing: 0; }
.dc__tools { display: flex; flex: none; gap: 2px; margin: -4px -6px 0 0; }
.dc__grip, .dc__edit { width: 28px; height: 28px; min-height: 0; color: var(--muted); opacity: 0; transition: opacity var(--dur) var(--ease); }
.dc:hover :is(.dc__grip, .dc__edit), .dc :is(.dc__grip, .dc__edit):focus-visible { opacity: 1; }
@media (hover: none) { .dc__grip, .dc__edit { opacity: 1; } }

/* Arranging: the mouse picks a card up from anywhere on it, a finger from its grip. The card lifts and
   follows; a slot in the Space's colour shows where it lands; the others glide out of its way. */
.dash[data-arrange] > .dc { position: relative; cursor: grab; transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.dash[data-arrange] > .dc :is(a, button, input, select, textarea, label) { cursor: pointer; }
.dash[data-arrange] .dc__grip { cursor: grab; touch-action: none; }
@media (hover: none) { .dash[data-arrange] > .dc { cursor: auto; } }
.dc:has(.dc__grip:focus-visible) { box-shadow: 0 0 0 2px var(--accent), inset 0 1px 0 var(--glass-top); }
.dc.is-slot { border-style: dashed; border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.dc.is-slot > * { visibility: hidden; }
.dc--ghost { position: fixed; z-index: 90; margin: 0; pointer-events: none; will-change: transform; transition: scale 180ms var(--ease-out), box-shadow 180ms var(--ease-out); }
.dc--ghost.is-lifted { scale: 1.025; box-shadow: 0 30px 60px -26px rgba(var(--shadow-rgb), 0.6), inset 0 1px 0 var(--glass-top); }
.dc--ghost.is-landing { transition: transform 230ms cubic-bezier(0.2, 0.8, 0.2, 1), scale 230ms var(--ease-out), box-shadow 230ms var(--ease-out); }
body.is-arranging, body.is-arranging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
body.is-sizing, body.is-sizing * { cursor: ew-resize !important; -webkit-user-select: none; user-select: none; }
/* Its right edge is a handle: pulled, the card steps through the four sizes, its label saying which */
.dc__size { position: absolute; top: 0; right: -10px; bottom: 0; z-index: 2; display: grid; place-items: center; width: 20px; cursor: ew-resize; touch-action: none; transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.dc__size::before { content: ""; width: 4px; height: 34px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.3); opacity: 0; transition: opacity var(--dur) var(--ease), height 200ms var(--ease-out), background-color var(--dur) var(--ease); }
.dc:hover .dc__size::before { opacity: 1; }
.dc__size:hover::before, .dc.is-sizing .dc__size::before { height: 52px; background: var(--accent); opacity: 1; }
.dc.is-sizing .dc__size { transition: none; }
.dc.is-sizing { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 1px 0 var(--glass-top); }
.dc__badge { position: absolute; top: 50%; right: 22px; padding: 5px 11px; border-radius: 999px; background: var(--fg); color: var(--bg, #fff); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; translate: 6px -50%; transition: opacity 160ms var(--ease), translate 160ms var(--ease-out); }
.dc.is-sizing .dc__badge { opacity: 1; translate: 0 -50%; }
.dc.is-slot .dc__size, .dc--ghost .dc__size { display: none; }
@media (max-width: 1100px) { .dc__size { display: none; } }
.dc__body { min-width: 0; padding: 12px 0 6px; }
.dc__foot { padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.4; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dc-line { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }

/* Number */
.dc-num { display: grid; gap: 6px; }
.dc-num > b { font-size: clamp(30px, 3.2vw, 42px); font-weight: 700; line-height: 1; letter-spacing: -0.035em; color: var(--fg); font-variant-numeric: tabular-nums; }
.dc-delta { font-size: 13px; font-weight: 600; }
.dc-delta small { font-weight: 400; color: var(--muted); }
.dc-delta.is-up { color: #138A5B; } .dc-delta.is-down { color: #D2425C; }
[data-theme="dark"] .dc-delta.is-up { color: #4CD39A; } [data-theme="dark"] .dc-delta.is-down { color: #FF7A90; }
.dc-spark { width: 100%; height: 34px; margin-top: 4px; }

/* Trend */
.dc-trend { display: grid; gap: 8px; }
.dc-trend__now { display: flex; align-items: baseline; gap: 8px; }
.dc-trend__now b { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dc-trend__now span { font-size: 13px; color: var(--muted); }
.dc-trend__plot { position: relative; height: 150px; }
.dc-trend__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dc-trend__dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface-solid, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.dc-trend__axis { display: flex; justify-content: space-between; font: 10.5px var(--font-mono); color: var(--muted); }

/* Ring: Share and Progress */
.dc-ring { position: relative; width: 132px; aspect-ratio: 1; flex: none; }
.dc-ring svg { width: 100%; height: 100%; }
.dc-ring__track { stroke: rgba(var(--ink-rgb), 0.08); }
.dc-ring__mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dc-ring__mid b { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dc-ring__mid small { font-size: 11px; color: var(--muted); }
.dc-share { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.dc-key { display: grid; gap: 7px; flex: 1 1 120px; min-width: 0; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.dc-key li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.dc-key i { width: 9px; height: 9px; border-radius: 50%; }
.dc-key span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--fg-2); }
.dc-key b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-prog { display: flex; align-items: center; gap: 18px; }
.dc-prog p { margin: 0; font-size: 13.5px; color: var(--fg-2); }
.dc-prog p b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }

/* Bars and List */
.dc-bars { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dc-bars li { display: grid; grid-template-columns: minmax(70px, 32%) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.dc-bars__label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--fg-2); }
.dc-bars__track { height: 10px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.06); overflow: hidden; }
.dc-bars__bar { display: block; width: var(--w); height: 100%; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, transparent), var(--accent)); }
.dc-bars b, .dc-list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.dc-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.dc-list li:first-child { border-top: 0; }
.dc-list__n { font: 11px var(--font-mono); color: var(--muted); }
.dc-list__label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* Table, Note, and a card that waits */
.dc-table { overflow-x: auto; }
.dc-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dc-table th { padding: 0 10px 8px 0; font: 10.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: left; white-space: nowrap; }
.dc-table td { padding: 8px 10px 8px 0; border-top: 1px solid var(--line); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.dc-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.dc-more { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.dc-note { font-size: 14.5px; line-height: 1.6; }
.dc-note > :first-child { margin-top: 0; }
.dc-wait { display: grid; justify-items: start; gap: 6px; color: var(--muted); }
.dc-wait .i { width: 20px; height: 20px; }
.dc-wait p { margin: 0; font-size: 14px; color: var(--fg-2); }
.dc-empty { margin: 0; font-size: 13.5px; color: var(--muted); }

/* The card's dialog */
.dc-form { display: grid; gap: 14px; }
.dc-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.dc-kinds legend { margin-bottom: 8px; }
@media (max-width: 640px) { .dc-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dc-kind { position: relative; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--glass-line); border-radius: 14px; cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.dc-kind input { position: absolute; opacity: 0; }
.dc-kind__icon { color: var(--accent); }
.dc-kind__icon .i { width: 20px; height: 20px; }
.dc-kind b { font-size: 13.5px; font-weight: 650; }
.dc-kind small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.dc-kind:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.dc-kind:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.dc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dc-row--3 { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 640px) { .dc-row, .dc-row--3 { grid-template-columns: minmax(0, 1fr); } }
.dc-row[hidden], .dc-form .field[hidden] { display: none !important; }
.dc-formula { font-family: var(--font-mono); font-size: 13.5px; }
.dc-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; }
.dc-sizes legend { width: 100%; margin-bottom: 8px; }
.dc-size input { position: absolute; opacity: 0; }
.dc-size span { display: inline-block; padding: 6px 14px; border: 1px solid var(--glass-line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.dc-size input:checked + span { border-color: var(--fg); background: var(--fg); color: var(--bg, #fff); }
.dc-size input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.dc-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.dc-form__foot .select { width: auto; }
.dc-form__foot .link-btn { margin-left: auto; }


/* ---------- Who it's for: one quiet chip, one ladder ---------- */
.aud-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; max-width: 100%; padding: 0 13px 0 11px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); color: var(--fg-2); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.aud-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.aud-chip .i { flex: none; width: 15px; height: 15px; }
.aud-chip:hover { border-color: var(--line-3, var(--glass-line)); color: var(--fg); }
.aud-chip.is-out { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-line)); color: var(--fg); }
.aud-chip.is-out .i { color: var(--accent); }
.aud-chip--in { cursor: pointer; }
.aud-what { margin: 0 0 14px; font-weight: 600; color: var(--fg); }
.aud-what small { font-weight: 400; color: var(--muted); }
.aud-ladder { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.aud-rung { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--glass-line); border-radius: 14px; cursor: pointer; transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.aud-rung input { position: absolute; opacity: 0; }
.aud-rung__icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(var(--ink-rgb), 0.05); color: var(--fg-2); }
.aud-rung__icon .i { width: 17px; height: 17px; }
.aud-rung__text { display: grid; gap: 1px; }
.aud-rung__text b { font-size: 14px; font-weight: 600; }
.aud-rung__text small { font-size: 12.5px; color: var(--muted); }
.aud-rung:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.aud-rung:has(input:checked) .aud-rung__icon { background: var(--primary); color: var(--on-accent, #fff); }
.aud-rung:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.aud-more { display: grid; gap: 10px; margin-top: 12px; }
.aud-more[hidden] { display: none; }
.aud-people { display: flex; flex-wrap: wrap; gap: 8px; }
.aud-person { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--glass-line); border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.aud-person input { position: absolute; opacity: 0; }
.aud-person:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.doc__acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tile__aud { display: inline-flex; margin-right: 6px; color: var(--accent); vertical-align: -2px; }
.tile__aud .i { width: 13px; height: 13px; }
.asset-detail__share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Posting ---------- */
.post-dlg__what { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 14px; }
.post-dlg__img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; }
.post-dlg__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 14px; background: rgba(var(--ink-rgb), 0.06); color: var(--accent); }
.post-dlg__icon .i { width: 26px; height: 26px; }
.post-dlg__what b { display: block; font-size: 15px; font-weight: 650; }
.post-dlg__what small { color: var(--muted); }
.post-dlg__caption { font-size: 15px; }
.post-dlg__to { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; }
.post-dlg__to legend { width: 100%; margin-bottom: 8px; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border: 1px solid var(--glass-line); border-radius: 999px; font-size: 13.5px; cursor: pointer; }
.seg .i { width: 16px; height: 16px; }
.seg input:checked + span { border-color: var(--fg); background: var(--fg); color: var(--bg, #fff); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
#post-note { margin-top: 10px; }

/* The composer's Post to, and the feeds' marks */
/* Too narrow for all of it on one line (a phone's 320px), Post goes under, at the end, rather than the round tools squashing */
.fd-compose__bar { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.fd-compose__to { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.05); }
.fd-to { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.fd-to .i { width: 14px; height: 14px; }
.fd-to span { max-width: 140px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fd-to.is-on { background: var(--surface-solid, #fff); color: var(--fg); box-shadow: 0 1px 3px rgba(var(--shadow-rgb, 0, 0, 0), 0.12); }
[data-theme="dark"] .fd-to.is-on { background: rgba(255, 255, 255, 0.12); }
.fd-compose__note { margin: 0; font-size: 12.5px; color: var(--muted); }
.fd__space { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-2); font-size: 13.5px; text-decoration: none; }
.fd__space:hover { color: var(--fg); }
.fd__aud { display: inline-flex; color: var(--muted); }
.fd__aud .i { width: 13px; height: 13px; }
.fd-act--elsewhere { text-decoration: none; }
.feed__end { margin: 24px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.fd-card--dash { grid-template-columns: 120px minmax(0, 1fr); }
.fd-card--dash .dash-tile__peek { grid-auto-rows: 22px; }
.fd-viewer { display: grid; place-items: center; }
.fd-viewer img, .fd-viewer video { max-width: 100%; max-height: 72vh; border-radius: 16px; }

/* A Space as an avatar: its colour, its initials */
.sp-av { --c: #4D80FA; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 82%, #fff), var(--c)); color: #fff; font: 650 13px/1 var(--font-sans); letter-spacing: 0.02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.sp-av--xs { width: 18px; height: 18px; font-size: 7.5px; }
.sp-av--sm { width: 26px; height: 26px; font-size: 10px; }
.sp-av--xl { width: 96px; height: 96px; font-size: 32px; }

/* ---------- A file's page ---------- */
.item { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .item { grid-template-columns: minmax(0, 1fr); } }
.item__media { display: grid; place-items: center; min-height: 320px; overflow: hidden; border-radius: 24px; background: rgba(var(--ink-rgb), 0.05); }
.item__media img, .item__media video { display: block; width: 100%; max-height: 78vh; object-fit: contain; }
.item__audio { display: flex; align-items: center; gap: 12px; padding: 40px; font-size: 15px; color: var(--fg-2); }
.item__side { display: grid; gap: 18px; min-width: 0; }
.item__title { margin: 0; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; outline: none; }
.item__share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item__desc { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.item__subjects { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; font-size: 14px; }
.item__sec .section-title { margin-bottom: 10px; }
.item__posts { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.item__posts a { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--fg); font-size: 14px; text-decoration: none; }
.item__posts li:first-child a { border-top: 0; }
.item__posts .i { width: 15px; height: 15px; color: var(--muted); }
.item__posts span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.item__posts small { color: var(--muted); }
.item__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.item__facts div { display: grid; gap: 2px; }
.item__facts dt { font: 10.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.item__facts dd { margin: 0; font-size: 13.5px; color: var(--fg); }
.item__more { margin: 0; }

/* ---------- A person's profile ---------- */
.av--prof { width: 96px; height: 96px; font-size: 30px; }
.av--prof.av--me .i { width: 40px; height: 40px; }
.prof .av--me, .av--named { background: linear-gradient(135deg, #8C5CFF, #4D80FA 55%, #29CCDB); color: #fff; }
.fd-pill { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border: 1px solid var(--glass-line); border-radius: 999px; color: var(--fg); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.fd-pill:hover { border-color: var(--line-3, var(--glass-line)); }
.prof__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.prof__bio { max-width: 52ch; margin: 10px 0 0; font-size: 15px; line-height: 1.55; color: var(--fg); }
.lib-tabs button { position: relative; flex: none; padding: 8px 0 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; cursor: pointer; }
.lib-tabs button:hover, .lib-tabs button[aria-current="page"] { color: var(--fg); }
.lib-tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--fg); }
.lib-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.prof__people { display: flex; gap: 6px; margin: -10px 0 22px; padding: 0; list-style: none; }
.prof__people button { padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }

/* ---------- A Space's profile ---------- */
.prof { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 24px; margin: 8px 0 26px; }
@media (max-width: 640px) { .prof { grid-template-columns: auto minmax(0, 1fr); } .prof__acts { grid-column: 1 / -1; } }
.prof h1 { margin: 0; font-size: clamp(32px, 4.6vw, 56px); font-weight: 700; line-height: 1; letter-spacing: -0.04em; outline: none; }
.prof__handle { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.prof__counts { display: flex; gap: 18px; margin: 10px 0 0; font-size: 14px; color: var(--fg-2); }
.prof__counts b { font-weight: 700; color: var(--fg); }
.prof__feed { max-width: 640px; }
.prof__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.prof__tile { display: block; width: 100%; aspect-ratio: 1; padding: 0; overflow: hidden; border: 0; border-radius: 14px; background: rgba(var(--ink-rgb), 0.06); cursor: zoom-in; }
.prof__tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.prof__tile:hover img { transform: scale(1.03); }
.prof__card { display: grid; align-content: end; gap: 4px; aspect-ratio: 1; padding: 16px; border: 1px solid var(--glass-line); border-radius: 14px; background: var(--glass); color: var(--fg); text-decoration: none; }
.prof__glyph { margin-bottom: auto; color: var(--accent); }
.prof__glyph .i { width: 26px; height: 26px; }
.prof__card b { font-size: 14.5px; font-weight: 650; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.prof__card small { font-size: 12px; color: var(--muted); }


/* ---------- The feed is the Vault's first tab: its scopes, a quiet row of pills under the tabs ---------- */
.feed-scopes { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 22px; }
.feed-scopes a { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 1px solid var(--glass-line); border-radius: 999px; color: var(--fg-2); font-size: 13.5px; text-decoration: none; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.feed-scopes a:hover { color: var(--fg); border-color: var(--line-3, var(--glass-line)); }
.feed-scopes a[aria-current="page"] { border-color: var(--fg); background: var(--fg); color: var(--bg, #fff); }
.feed-scopes a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.feed-me { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 5px; border: 1px solid var(--glass-line); border-radius: 999px; background: var(--glass); color: var(--fg); font-size: 13.5px; font-weight: 550; text-decoration: none; }
.feed-me:hover { border-color: var(--line-3, var(--glass-line)); }
/* On a phone: the scopes scroll, and Post to is its icons */
@media (max-width: 560px) {
  .feed-scopes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .feed-scopes::-webkit-scrollbar { display: none; }
  .feed-scopes a { flex: none; }
  .fd-to span { display: none; }
  .fd-to { padding: 0 10px; }
}

/* ---------- Emoji: the picker beside a box, six reactions to hand, and :name suggestions ---------- */
.emo { position: fixed; z-index: 95; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--glass-line); border-radius: 20px; background: color-mix(in srgb, var(--field-panel, var(--surface-solid)) 94%, transparent); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); box-shadow: inset 0 1px 0 var(--glass-top), 0 30px 70px -28px rgba(var(--shadow-rgb), 0.55); animation: space-menu-in 0.16s var(--ease); }
.emo.is-sheet { border-radius: 24px; animation: emo-up 0.22s var(--ease); }
@keyframes emo-up { from { opacity: 0; transform: translateY(16px); } }
.emo__top { padding: 10px 10px 6px; }
.emo__q { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--field-input, var(--glass)); color: var(--fg); font: inherit; font-size: 14px; outline: none; }
.emo__q:focus { border-color: var(--primary); }
.emo__body { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 8px 8px; overscroll-behavior: contain; outline: none; scrollbar-width: thin; }
.emo__h { margin: 0; padding: 10px 4px 6px; font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.emo__grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; }
.emo__e { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 10px; background: none; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 23px; line-height: 1; cursor: pointer; transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.emo__e:hover, .emo__e:focus-visible { outline: none; background: var(--glass-3); transform: scale(1.14); }
.emo__note { margin: 0; padding: 30px 12px; font-size: 14px; text-align: center; color: var(--muted); }
.emo__tabs { display: flex; gap: 2px; padding: 6px 8px 8px; border-top: 1px solid var(--line); }
.emo__tabs[hidden] { display: none; }
.emo__tab { display: grid; flex: 1 1 0; place-items: center; height: 32px; min-width: 0; padding: 0; border: 0; border-radius: 9px; background: none; color: var(--muted); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 17px; filter: grayscale(1); opacity: 0.55; cursor: pointer; transition: opacity var(--dur) var(--ease), filter var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.emo__tab .i { width: 17px; height: 17px; }
.emo__tab:hover { opacity: 0.9; }
.emo__tab[aria-current="true"] { background: var(--glass-3); color: var(--fg); filter: none; opacity: 1; }
.emo__tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.emo--tray { flex-direction: row; align-items: center; gap: 2px; padding: 5px; border-radius: 999px; animation: emo-tray 0.18s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes emo-tray { from { opacity: 0; transform: translateY(6px) scale(0.92); } }
.emo--tray .emo__e { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; }
.emo__more { display: grid; place-items: center; width: 34px; height: 34px; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: rgba(var(--ink-rgb), 0.06); color: var(--fg-2); cursor: pointer; }
.emo__more:hover, .emo__more:focus-visible { outline: none; background: var(--glass-3); color: var(--fg); }
.emo__more .i { width: 17px; height: 17px; }
.emo-sug { position: fixed; z-index: 96; margin: 0; padding: 5px; list-style: none; border: 1px solid var(--glass-line); border-radius: 14px; background: color-mix(in srgb, var(--field-panel, var(--surface-solid)) 94%, transparent); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); box-shadow: inset 0 1px 0 var(--glass-top), 0 22px 50px -26px rgba(var(--shadow-rgb), 0.5); animation: space-menu-in 0.14s var(--ease); }
.emo-sug__i { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 10px; border-radius: 9px; color: var(--fg); font-size: 13.5px; cursor: pointer; }
.emo-sug__i[aria-selected="true"], .emo-sug__i:hover { background: var(--glass-3); }
.emo-sug__e { flex: none; width: 24px; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 19px; line-height: 1; text-align: center; }
.emo-sug__n { overflow: hidden; color: var(--fg-2); text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .emo, .emo--tray, .emo-sug, .fdc.is-new, .fdc-react.is-pop .fdc-react__e { animation: none; } .emo__e:hover, .emo__e:focus-visible { transform: none; } }

/* ---- Settings → Team */
.tm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.tm-head h2 { margin: 0; }
.tm-list { margin: 0; padding: 0; list-style: none; }
.tm-person { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.tm-list > .tm-person:first-child { border-top: 0; }
.tm-person .av { width: 36px; height: 36px; }
.tm-person__body { min-width: 0; }
.tm-person__body b { display: block; overflow: hidden; font-size: 14.5px; font-weight: 600; color: var(--fg); text-overflow: ellipsis; white-space: nowrap; }
.tm-person__body small { display: block; overflow: hidden; font-size: 12.5px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.tm-person .select { width: auto; min-height: 34px; padding-block: 4px; font-size: 13.5px; }
.tm-acts { display: inline-flex; align-items: center; gap: 14px; }
.tm-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.06); color: var(--fg); font: 500 12.5px/1 var(--font-sans); white-space: nowrap; }
.tm-chip .i { width: 12px; height: 12px; }
[data-theme="dark"] .tm-chip { background: rgba(255, 255, 255, 0.08); }
.tm-sub { margin: 18px 0 0; }
.tm-intro { margin: 2px 0 14px; max-width: 72ch; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.tm-roles { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tm-role { border-radius: 14px; background: var(--surface-solid); box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.09); }
.tm-role > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: inherit; list-style: none; cursor: pointer; }
.tm-role > summary::-webkit-details-marker { display: none; }
.tm-role > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tm-role[open] > summary .set-fold__caret { transform: rotate(180deg); }
.tm-role__name { min-width: 0; }
.tm-role__name b { display: block; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.tm-role__name small { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.tm-count { font: 500 11px/1 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.tm-role__body { padding: 0 14px 14px; }
.tm-role__rename { max-width: 320px; margin: 0 0 10px; }
.tm-matrix { display: flex; flex-direction: column; }
.tm-matrix__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.tm-matrix__area b { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.tm-matrix__area small { display: block; margin-top: 1px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.tm-levels { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.05); }
.tm-lv { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--radius-pill); color: var(--faint); font: 500 12.5px/1 var(--font-sans); white-space: nowrap; }
.tm-lv.is-on { background: var(--surface-solid); color: var(--fg); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18), 0 0 0 0.5px rgba(var(--ink-rgb), 0.06); }
[data-theme="dark"] .tm-levels { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .tm-lv.is-on { background: rgba(255, 255, 255, 0.16); box-shadow: none; }
.tm-seg .cn-seg__opt { height: 26px; padding: 0 11px; font-size: 12.5px; }
.tm-role__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; }
/* What a role can't do, turned off, saying why when you point at it */
button.is-locked, a.is-locked, select.is-locked, label.is-locked, form.is-locked button, input[type="checkbox"].is-locked, input[type="radio"].is-locked { opacity: 0.42 !important; cursor: not-allowed !important; }
button.is-locked *, a.is-locked *, label.is-locked * { cursor: not-allowed !important; }
input.is-locked:not([type="checkbox"]):not([type="radio"]), textarea.is-locked { cursor: default; }
@media (max-width: 760px) {
  .tm-person { grid-template-columns: 36px minmax(0, 1fr); }
  .tm-person > .tm-role-ctl, .tm-person > .tm-acts { grid-column: 2; }
  .tm-matrix__row { grid-template-columns: minmax(0, 1fr); }
  .tm-role > summary { grid-template-columns: minmax(0, 1fr) auto; }
  .tm-role > summary .tm-count { grid-column: 1; grid-row: 2; }
}

/* ---------- Tasks through the engine (#/tasks, js/tasks.js) ---------- */
.tasks { max-width: 640px; margin: 32px auto; padding: 0 16px; }
.tasks__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tasks__h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; color: var(--fg); }
.tasks__status { margin: 0; font-size: 13px; color: var(--muted); }
.tasks__status--ok { color: var(--ok); }
.tasks__status--warn { color: var(--warn, #9A5B00); }
.tasks__signin, .tasks__add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.tasks__signin .field { flex: 1 1 200px; }
.tasks__add .input { flex: 1 1 auto; }
.tasks__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.tasks__item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tasks__title { flex: 1 1 200px; }
.tasks__conflict { flex: 1 0 100%; font-size: 13px; color: var(--fg-2); padding-left: 28px; }
.tasks__private { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); align-self: center; }
.tasks__lock { font-size: 12px; color: var(--muted); }
.tasks__more { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; padding-left: 28px; }
.tasks__who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); }
.tasks__assignee { width: 130px; }
.tasks__note { flex: 1 1 220px; min-height: 34px; resize: vertical; font: inherit; font-size: 13px; }
.tasks__picture { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tasks__img { max-width: 180px; max-height: 120px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; }
.tasks__pic-status { font-size: 12px; color: var(--muted); }

/* ---------- v2 (app-v2.html): chats side by side, Sessions, Rue on the web, Bookmarks ---------- */

.v2-pill { display: inline-grid; place-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--glass-3); color: var(--fg-2); font: 600 11px/1 var(--font-mono); letter-spacing: 0.04em; text-decoration: none; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.v2-pill:hover { background: var(--fg); color: var(--bg); }
.v2-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A pane: one chat, or one page. In the panel it sits in the panel's own glass; on Sessions each is a panel */
.agent__beside { display: flex; min-width: 0; min-height: 0; }
.agent__beside:empty, .agent.is-listing .agent__beside { display: none; }
.rue-pane { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; }
.rue-pane__head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 6px 18px; }
.rue-pane__tile { display: flex; flex: none; }
.rue-pane__name { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13.5px/1.25 var(--font-sans); letter-spacing: -0.005em; color: var(--fg); outline: none; }
.rue-pane__tools { display: flex; flex: none; align-items: center; gap: 2px; margin-left: auto; }
.rue-pane__btn, .web-mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.rue-pane__btn:hover, .web-mark:hover { background: var(--glass-3); color: var(--fg); }
.rue-pane__btn:focus-visible, .web-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rue-pane__btn svg, .web-mark svg { width: 14px; height: 14px; }
.web-mark.is-on, .web-mark.is-on:hover { color: var(--accent); }
.rue-pane__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 20px 14px; overscroll-behavior: contain; }
.rue-pane__log { margin-top: 2px; }
.rue-pane__form { flex: none; padding: 8px 12px 12px; }
.rue-pane__form .agent__box { padding-left: 14px; }
.rue-pane__form textarea { font-size: 14px; }
.rue-pane__form .agent__send { width: 32px; height: 32px; }

/* In a side dock the panes stack: the open chat above, the one beside it below */
.agent[data-dock="right"] .agent__beside, .agent[data-dock="left"] .agent__beside { flex: 1 1 0; border-top: 1px solid var(--line); }
.agent[data-dock="right"]:is([data-beside="1"], [data-beside="2"]) .agent__scroll, .agent[data-dock="left"]:is([data-beside="1"], [data-beside="2"]) .agent__scroll { flex: 1 1 0; }
.agent:is([data-beside="1"], [data-beside="2"]) .agent__note { display: none; }
.agent[data-dock="right"]:is([data-beside="1"], [data-beside="2"]) .agent__form, .agent[data-dock="left"]:is([data-beside="1"], [data-beside="2"]) .agent__form { padding-bottom: 12px; }
/* At the bottom, and floating, they go across: the open chat first, then each beside it in a column */
.agent[data-dock="bottom"][data-beside="1"] { grid-template-columns: minmax(0, 1fr) minmax(360px, 400px) minmax(0, 1fr); }
.agent[data-dock="bottom"][data-beside="2"] { grid-template-columns: minmax(0, 1fr) 360px minmax(0, 2fr); }
.agent[data-dock="bottom"]:is([data-beside="1"], [data-beside="2"]) .agent__head { grid-column: 1 / 3; }
.agent[data-dock="bottom"] .agent__beside { grid-row: 1 / -1; grid-column: 3; }
.agent[data-dock="bottom"] .rue-pane + .rue-pane, .agent[data-dock="bottom"] .agent__beside, .agent[data-dock="float"] .rue-pane + .rue-pane, .agent[data-dock="float"] .agent__beside { border-left: 1px solid var(--line); }
.agent[data-dock="float"][data-beside="1"], .agent[data-dock="float"][data-beside="2"] { display: grid; grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.agent[data-dock="float"][data-beside="1"] { width: 700px; }
.agent[data-dock="float"][data-beside="2"] { width: 1040px; }
.agent[data-dock="float"]:is([data-beside="1"], [data-beside="2"]) > :not(.agent__beside) { grid-column: 1; }
.agent[data-dock="float"]:is([data-beside="1"], [data-beside="2"]) .agent__head { grid-row: 1; }
.agent[data-dock="float"]:is([data-beside="1"], [data-beside="2"]) .agent__scroll { grid-row: 2; }
.agent[data-dock="float"]:is([data-beside="1"], [data-beside="2"]) .agent__form { grid-row: 3; }
.agent[data-dock="float"]:is([data-beside="1"], [data-beside="2"]) .agent__chats { grid-row: 2 / -1; }
.agent[data-dock="float"] .agent__beside { grid-row: 1 / -1; grid-column: 2; }

/* The list of chats: Open beside, left of the round × */
.agent__row--beside .agent__pick { padding-right: 82px; }
.agent__pick-beside { position: absolute; top: 50%; right: 42px; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.agent__row:hover .agent__pick-beside, .agent__row:focus-within .agent__pick-beside { opacity: 1; }
.agent__pick-beside:hover { background: rgba(var(--ink-rgb), 0.08); color: var(--fg); }
.agent__pick-beside:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 0; }
.agent__pick-beside svg { width: 14px; height: 14px; }
@media (hover: none) { .agent__pick-beside { opacity: 1; } }

/* Sessions: every chat in a list beside up to four, side by side */
.view__inner:has(> .rue-page) { max-width: none; }
.rue-page { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 14px; height: calc(100dvh - var(--view-top) - 96px); min-height: 440px; }
.rue-side, .rue-panes > .rue-pane { border-radius: var(--radius-2xl); background: color-mix(in srgb, var(--field-panel, var(--surface-solid)) 80%, transparent); -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5); box-shadow: 0 30px 70px -40px rgba(var(--shadow-rgb), 0.5); overflow: hidden; }
.rue-side { display: flex; flex-direction: column; min-height: 0; padding: 14px 8px 12px; }
.rue-side__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 8px 10px 14px; }
.rue-side__title { margin: 0; font: 600 15px/1.2 var(--font-sans); letter-spacing: -0.01em; color: var(--fg); }
.rue-side__back { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 10px 0 6px; border-radius: var(--radius-pill); color: var(--muted); font-size: 12.5px; text-decoration: none; }
.rue-side__back:hover { background: var(--glass-3); color: var(--fg); }
.rue-side__back svg { width: 13px; height: 13px; }
.rue-side__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.rue-panes { display: grid; gap: 14px; min-width: 0; min-height: 0; }
.rue-panes[data-n="1"] { grid-template-columns: minmax(0, 860px); justify-content: center; }
.rue-panes[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rue-panes[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rue-panes[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
.rue-panes > .rue-pane { transition: box-shadow var(--dur) var(--ease); }
.rue-panes > .rue-pane:focus-within { box-shadow: 0 30px 70px -40px rgba(var(--shadow-rgb), 0.5), 0 0 0 1.5px rgba(var(--accent-rgb), 0.45); }
.rue-panes > .rue-pane .rue-pane__head { padding-top: 12px; }
@media (max-width: 1100px) { .rue-page { grid-template-columns: 220px minmax(0, 1fr); } .rue-panes[data-n="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* A phone: the chats in a row along the top, and the panes one at a time, a swipe apart */
@media (max-width: 760px) {
  .rue-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--view-top) - 84px); }
  .rue-side { padding: 10px 6px 6px; }
  .rue-side__head { padding: 0 6px 6px 10px; }
  .rue-side__list { flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; }
  .rue-side__list > li { flex: 0 0 210px; scroll-snap-align: start; }
  .rue-side .agent__chats-note { display: none; }
  .rue-panes, .rue-panes[data-n] { display: flex; grid-template-columns: none; grid-template-rows: none; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
  .rue-panes > .rue-pane { flex: 0 0 100%; scroll-snap-align: start; }
}

/* Rue on the web: the search as a step, then its sources */
.web-step { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px !important; font: 11.5px/1.35 var(--font-mono); color: var(--muted); }
.web-step svg { width: 14px; height: 14px; color: var(--accent); }
.web-step__tag { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--glass-3); }
.web-cite { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin: 0 1px 0 4px; padding: 0 5px; border: 0; border-radius: 9px; background: var(--glass-3); color: var(--fg-2); font: 600 10px/1 var(--font-mono); vertical-align: 0.12em; cursor: pointer; }
.web-cite:hover { background: var(--fg); color: var(--bg); }
.web-cite:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.web-cards { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0 !important; padding: 0 !important; list-style: none; }
.web-cards li { margin: 0; }
.web-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 10px 6px 10px 12px; border: 1px solid var(--glass-line); border-radius: 16px; background: var(--glass-3); }
.web-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.web-card__title { padding: 0; border: 0; background: none; color: var(--fg); font: 500 13.5px/1.35 var(--font-sans); text-align: left; cursor: pointer; }
.web-card__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.web-card__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.web-card__n { margin-right: 7px; font: 600 10px/1 var(--font-mono); color: var(--muted); vertical-align: 0.1em; }
.web-card__site { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.web-card__snip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.web-card .web-mark { margin-top: -4px; }
.web-tile { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 9px; background: hsl(var(--h) 60% 92%); color: hsl(var(--h) 45% 30%); font: 600 13px/1 var(--font-sans); }
[data-theme="dark"] .web-tile { background: hsl(var(--h) 30% 24%); color: hsl(var(--h) 70% 82%); }
/* What waits for you: a form ready to send, or something ready to buy */
.web-ask { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(var(--accent-rgb), 0.35); border-radius: 16px; background: rgba(var(--accent-rgb), 0.06); }
.web-ask__head { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--fg); }
.web-ask__head svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.web-ask__lines { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; margin: 10px 0 0; font-size: 13px; line-height: 1.4; }
.web-ask__lines > div { display: contents; }
.web-ask__lines dt { color: var(--muted); }
.web-ask__lines dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }
.web-ask__note { margin-top: 10px !important; font-size: 12px; color: var(--muted); }
.web-ask__done { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px !important; font-size: 12.5px; color: var(--fg-2); }
.web-ask__done svg { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--accent); }
.web-ask__done.is-off svg { color: var(--muted); }
.web-ask.is-approved, .web-ask.is-declined { border-color: var(--glass-line); background: var(--glass-3); }

/* A page as Rue reads it */
.reader { font-size: 14px; line-height: 1.62; color: var(--fg-2); }
.reader p { margin: 0; }
.reader p + p { margin-top: 10px; }
.reader__meta, .reader__by { font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.reader__title { margin: 6px 0 2px; font: 600 19px/1.3 var(--font-sans); letter-spacing: -0.015em; color: var(--fg); }
.reader__by { margin-bottom: 14px !important; }
.reader__box { margin-top: 16px; padding: 14px; border: 1px solid var(--glass-line); border-radius: 16px; background: var(--glass-3); }
.reader__box-head { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.reader__box-head svg { flex: none; width: 16px; height: 16px; color: var(--accent); }
.reader__price { margin-left: auto; font: 600 13px var(--font-mono); }
.reader__fields { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; }
.reader__fields span { padding: 3px 9px; border: 1px dashed var(--line-2); border-radius: 8px; font-size: 12px; color: var(--muted); }
.reader__note { margin-top: 10px !important; font-size: 12px; color: var(--muted); }
.reader__box .agent__act { margin-top: 10px; }
.reader__src { margin-top: 18px !important; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.reader--sheet { max-height: 60vh; overflow-y: auto; }
.reader__sheet-mark { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--fg-2); }

/* Bookmarks, in the Vault */
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.mk-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 1px solid var(--glass-line); border-radius: var(--radius-xl); background: var(--glass); transition: border-color var(--dur) var(--ease); }
.mk-card:hover { border-color: var(--line-3, var(--glass-line)); }
.mk-card__top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mk-card__site { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.mk-card__site small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.mk-card__x { display: grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.mk-card:hover .mk-card__x, .mk-card:focus-within .mk-card__x, .mk-card__x:focus-visible { opacity: 1; }
.mk-card__x:hover { background: var(--glass-3); color: var(--fg); }
.mk-card__x svg { width: 12px; height: 12px; }
@media (hover: none) { .mk-card__x { opacity: 1; } }
.mk-card__title { padding: 0; border: 0; background: none; color: var(--fg); font: 600 15px/1.35 var(--font-sans); letter-spacing: -0.01em; text-align: left; cursor: pointer; }
.mk-card__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.mk-card__title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mk-card__desc { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.5; color: var(--muted); }
.mk-card__note { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--glass-3); font-size: 13px; line-height: 1.45; color: var(--fg-2); }
.mk-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 4px; }
.mk-card__by { font: 10.5px/1.4 var(--font-mono); color: var(--muted); }
.mk-card__foot .link-btn { margin-left: auto; font-size: 12.5px; }
.mk-none { color: var(--muted); }

/* Docked at a side (v2), the chats are an accordion. The open one is raised and fills what's left of the
   panel; the rest are rows: a glyph in the chat's colour, its name and when, a line of the last exchange.
   Everything moves on one curve, quick to start and soft to land. Rows are a fixed height, so opening,
   folding, arriving and leaving are all the same two numbers easing (the room it takes, and its share) */
.agent { --acc-ease: cubic-bezier(0.32, 0.72, 0, 1); --acc-row: 62px; }
.agent__acc, .agent__acc-title { display: none; }
.agent.is-acc .agent__chat, .agent.is-acc .agent__chats { display: none; }
.agent.is-acc .agent__acc-title { display: flex; align-items: baseline; gap: 8px; margin-left: 8px; font: 600 14px/1.25 var(--font-sans); letter-spacing: -0.01em; color: var(--fg); }
.agent__acc-title small { font: 500 10.5px/1 var(--font-mono); color: var(--muted); letter-spacing: 0; }
.agent.is-acc .agent__acc { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-height: 0; padding: 4px 10px 12px; overflow-y: auto; overscroll-behavior: contain; scroll-padding: 8px; scrollbar-width: thin; }
.agent.is-acc:is([data-beside="1"], [data-beside="2"]) .agent__acc { flex-grow: 1.15; }
/* A soft edge where there's more to scroll to */
.agent__acc.is-more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); }
.agent__acc.is-more-above { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); }
.agent__acc.is-more-above.is-more-below { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 28px), transparent); }

.acc { position: relative; display: flex; flex-direction: column; flex: 0 0 0; min-height: var(--acc-row); border-radius: 20px; overflow: hidden;
  transition: flex-grow 0.46s var(--acc-ease), min-height 0.46s var(--acc-ease), transform 0.3s var(--acc-ease), opacity 0.28s var(--ease), background-color 0.2s var(--ease), box-shadow 0.3s var(--ease); }
.acc:not(.is-open):hover { background: var(--glass-3); }
[data-theme="dark"] .acc:not(.is-open):hover { background: rgba(255, 255, 255, 0.06); }
/* The open chat takes the room there is, but leaves two folded rows in sight, so the rest are never out of mind */
.acc.is-open { flex: 1 1 0; min-height: min(440px, max(240px, calc(100% - 2 * var(--acc-row) - 8px))); background: var(--glass-top); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 0 0 1px rgba(var(--ink-rgb), 0.04), 0 14px 32px -18px rgba(var(--shadow-rgb), 0.55); }
[data-theme="dark"] .acc.is-open { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 32px -18px rgba(0, 0, 0, 0.6); }
.acc.is-entering, .acc.is-leaving { flex-grow: 0; min-height: 0; opacity: 0; }
.acc.is-leaving { pointer-events: none; }
/* Lifted and following the pointer; the others slide aside on the same curve */
.acc.is-dragging { z-index: 3; background: var(--glass-top); box-shadow: 0 0 0 1px rgba(var(--ink-rgb), 0.06), 0 22px 44px -18px rgba(var(--shadow-rgb), 0.6); transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease); cursor: grabbing; }
[data-theme="dark"] .acc.is-dragging { background: rgba(48, 56, 86, 0.96); }
.agent__acc.is-sorting { cursor: grabbing; -webkit-user-select: none; user-select: none; }
.agent__acc.is-sorting .acc:not(.is-dragging):hover { background: transparent; }

.acc__head { position: relative; flex: none; }
.acc__btn { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: 12px; row-gap: 1px; width: 100%; height: var(--acc-row); padding: 0 42px 0 12px; border: 0; border-radius: 20px; background: transparent; color: var(--fg); font: inherit; text-align: left; cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; }
.acc__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc.is-open .acc__btn { cursor: default; }
.acc__glyph { position: relative; grid-row: 1 / span 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: hsl(var(--h, 220) 70% 94%); color: hsl(var(--h, 220) 48% 38%); transition: transform 0.3s var(--acc-ease), box-shadow 0.3s var(--ease); }
[data-theme="dark"] .acc__glyph { background: hsl(var(--h, 220) 34% 24%); color: hsl(var(--h, 220) 75% 80%); }
.acc.is-open .acc__glyph { box-shadow: 0 0 0 2px var(--glass-top), 0 0 0 3.5px hsl(var(--h, 220) 60% 62%); }
.acc__glyph .i { width: 16px; height: 16px; }
.acc__icon { display: grid; place-items: center; transition: opacity 0.16s var(--ease), transform 0.2s var(--acc-ease); }
.acc__dots { position: absolute; inset: 0; margin: auto; opacity: 0; transform: scale(0.8); transition: opacity 0.16s var(--ease), transform 0.2s var(--acc-ease); }
/* Over a chat, its glyph turns into the grip that moves it */
@media (hover: hover) {
  .acc__head:hover .acc__icon { opacity: 0; transform: scale(0.8); }
  .acc__head:hover .acc__dots { opacity: 1; transform: none; }
  .acc__head:hover .acc__glyph { cursor: grab; }
}
.acc.is-dragging .acc__icon { opacity: 0; }
.acc.is-dragging .acc__dots { opacity: 1; transform: none; }
.acc__name { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.3 var(--font-sans); letter-spacing: -0.006em; }
.acc.is-open .acc__name { font-weight: 600; }
.acc__when { grid-column: 3; font: 10.5px/1.3 var(--font-mono); color: var(--muted); white-space: nowrap; }
.acc__last { grid-column: 2 / -1; min-width: 0; max-height: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; line-height: 1.5; color: var(--muted); transition: opacity 0.22s var(--ease), max-height 0.36s var(--acc-ease); }
.acc.is-open .acc__last { max-height: 0; opacity: 0; }
.acc__badge { display: none; grid-column: 3; grid-row: 2; justify-self: end; padding: 2px 7px; border-radius: var(--radius-pill); background: rgba(var(--accent-rgb), 0.13); color: var(--accent); font: 600 10px/1.4 var(--font-sans); letter-spacing: 0.01em; white-space: nowrap; }
.acc.has-badge .acc__badge { display: block; }
.acc.has-badge .acc__last { grid-column: 2; }
.acc__x { position: absolute; top: 50%; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -14px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); opacity: 0; cursor: pointer; transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease); }
.acc__head:hover .acc__x, .acc__head:focus-within .acc__x, .acc__x:focus-visible { opacity: 1; }
.agent__acc.is-sorting .acc__x { opacity: 0; }
.acc__x:hover { background: rgba(var(--ink-rgb), 0.08); color: var(--fg); }
.acc__x:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.acc__x svg { width: 12px; height: 12px; }
@media (hover: none) { .acc__x { opacity: 1; } }
/* Renaming: the name becomes a field, in place */
.acc__rename { position: absolute; top: 50%; left: 56px; right: 40px; height: 32px; margin-top: -16px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--surface-solid); color: var(--fg); font: 600 14px/1 var(--font-sans); outline: none; box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15); }
.acc.is-renaming .acc__name, .acc.is-renaming .acc__when, .acc.is-renaming .acc__last, .acc.is-renaming .acc__badge, .acc.is-renaming .acc__x { visibility: hidden; }

.acc__body { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
/* A row's size never comes from what's in it (it's the room it's given), so it can be asked how tall it is:
   an open chat kept short, under a page, gives its prompts' room back to the conversation */
.acc { container: acc / size; }
@container acc (max-height: 380px) { .acc__body .agent__ctx, .acc__body .agent__prompts { display: none; } }
.acc.is-open > .acc__body > .agent__scroll, .acc.is-open > .acc__body > .agent__form { animation: acc-open 0.42s var(--acc-ease) both; }
.acc.is-open > .acc__body > .agent__form { animation-delay: 0.04s; }
@keyframes acc-open { from { opacity: 0; transform: translateY(10px); } }
/* The chat being left keeps what it held while it folds, then lets it go */
.acc__ghost { pointer-events: none; animation: acc-ghost 0.36s var(--ease) both; }
@keyframes acc-ghost { to { opacity: 0; } }
.acc__body .agent__scroll { padding: 8px 16px 10px; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }
.acc__body .agent__log { margin-top: 4px; }
.acc__body .agent__form { padding: 10px 10px 10px; border-top-color: rgba(var(--ink-rgb), 0.06); }
.acc__body .agent__prompt { border-color: var(--line-2); }
[data-theme="dark"] .acc__body .agent__prompt { border-color: var(--glass-line); }
@media (prefers-reduced-motion: reduce) {
  .acc, .acc__last, .acc__glyph, .acc__icon, .acc__dots { transition: none; }
  .acc.is-open > .acc__body > .agent__scroll, .acc.is-open > .acc__body > .agent__form, .acc__ghost { animation: none; }
}

/* An app, opened (#/apps/<id>): its preview on a canvas, narrowed by pulling its right edge or by the sizes above it */
.ap-head { align-items: center; }
.ap-head__name { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0; }
.ap-head__name b { display: block; font-size: 17px; letter-spacing: -0.01em; }
.ap-head__name small { font-size: 13.5px; color: var(--muted); }
.ap-sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 12px; }
.ap-width { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.ap-canvas { display: flex; justify-content: center; padding: 16px 24px; border-radius: var(--radius-xl); background: rgba(var(--ink-rgb), 0.04); }
[data-theme="dark"] .ap-canvas { background: rgba(255, 255, 255, 0.04); }
.ap-stage { position: relative; width: 100%; min-width: 0; }
.ap-frame { display: block; width: 100%; height: 72vh; min-height: 420px; border: 0; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 0 0 0.5px rgba(var(--ink-rgb), 0.12), 0 18px 40px -30px rgba(var(--shadow-rgb), 0.8); }
.ap-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: 14px; color: var(--muted); pointer-events: none; }
.ap-wait[hidden] { display: none; }
.ap-grip { position: absolute; top: 50%; right: -17px; width: 10px; height: 64px; margin-top: -32px; border-radius: var(--radius-pill); background: rgba(var(--ink-rgb), 0.2); cursor: col-resize; touch-action: none; transition: background-color var(--dur) var(--ease); }
.ap-grip::before { content: ""; position: absolute; inset: -12px -10px; }
.ap-grip:hover, .ap-grip:focus-visible { background: var(--accent); outline: none; }
.is-resizing-app, .is-resizing-app * { cursor: col-resize !important; user-select: none; }
.is-resizing-app .ap-frame { pointer-events: none; }
@media (max-width: 620px) { .ap-canvas { padding: 10px 18px; } .ap-frame { height: 64vh; } }
.dm-list--compact { margin: 14px 0; }
/* Deploying an app: its address at Formula, the part you choose then the part Formula gives */
.dp-addr { display: flex; align-items: center; gap: 6px; }
.dp-addr .input { flex: 1 1 auto; min-width: 0; }
.dp-addr__base { font-size: 14px; color: var(--muted); white-space: nowrap; }
/* Your name: first and last, side by side, then Save */
.name-pair { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.name-pair .input { flex: 1 1 140px; min-width: 0; }

/* Finance (reference/finance.md): a Space's books, read only. Cards four to a row, then what's owed and what's wrong */
.fin-periods { display: flex; gap: 8px; margin: 0 0 14px; }
.fin-period { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: none; font: inherit; font-size: 13px; color: inherit; cursor: pointer; }
.fin-period[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.fin-period:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fin-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 22px; font-size: 13px; color: rgba(var(--ink-rgb), 0.7); }
.fin-chip { padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; }
.fin-chip.is-off { background: rgba(var(--ink-rgb), 0.06); color: var(--warn); }
.fin-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.fin-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.fin-card__title { font-size: 13px; color: rgba(var(--ink-rgb), 0.62); }
.fin-card__value { font-size: 22px; font-variant-numeric: tabular-nums; }
.fin-card.is-missing .fin-card__value { font-size: 16px; color: rgba(var(--ink-rgb), 0.55); }
.fin-card__extra { font-size: 13px; color: var(--warn); }
.fin-card__note { font-size: 12px; color: rgba(var(--ink-rgb), 0.55); }
.fin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.fin-list h2 { margin: 0 0 8px; font-size: 15px; }
.fin-list ul { margin: 0 0 24px; padding: 0; list-style: none; }
.fin-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.fin-list__amount { font-variant-numeric: tabular-nums; text-align: right; }
.fin-list__when.is-late { color: var(--warn); }
.fin-exceptions li { grid-template-columns: auto minmax(0, 1fr) auto; }
.fin-list__next, .fin-list__none, .fin-review { color: rgba(var(--ink-rgb), 0.55); font-size: 13px; }
@media (max-width: 900px) { .fin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fin-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .fin-cards { grid-template-columns: minmax(0, 1fr); } .fin-exceptions li { grid-template-columns: minmax(0, 1fr); } }
