/* lincor web. Dark only, one screen, no page scroll (PRD §4.12).
   Calm and plain: one sans family, mono only for real code; brass for the main action, patina for "online". */
:root {
  --ground: #0B1517;
  --panel: #111E21;
  --raised: #182A2E;
  --line: #213539;
  --line-strong: #2E474C;
  --text: #E9E5DA;
  --dim: #9AAEA9;
  --faint: #667D78;
  --brass: #D8AD5E;
  --brass-deep: #8F6E33;
  --brass-ink: #1A1305;
  --patina: #5FC8B1;
  --alert: #F0938C;

  --mono: "Martian Mono", ui-monospace, monospace;
  --sans: "Instrument Sans", system-ui, sans-serif;

  --s-xs: 0.8rem;
  --s-sm: 0.875rem;
  --s-md: 1rem;
  --s-lg: 1.25rem;
  --s-2xl: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);

  --r-control: 8px;
  --r-block: 12px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--s-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--patina); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Static instructions for agents (visible without JavaScript only) */
.agent-note { max-width: 46rem; margin: 0 auto; padding: 32px 16px 16px; display: grid; gap: 12px; }
.agent-note h1 { margin: 0; font-size: var(--s-lg); line-height: 1.25; }
.agent-note p { margin: 0; color: var(--dim); }
.agent-note pre {
  margin: 0; padding: 12px 14px; background: var(--panel); border-radius: var(--r-control);
  font-family: var(--mono); font-size: 0.78rem; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
.js .agent-note { display: none; }
html:not(.js), html:not(.js) body { height: auto; overflow: auto; }
.noscript {
  max-width: 46rem; margin: 0 auto 32px; padding: 12px 14px; border-radius: var(--r-control);
  background: rgba(216, 173, 94, 0.1); color: var(--brass); font-size: var(--s-sm);
}

.wordmark { font-weight: 700; font-size: var(--s-lg); letter-spacing: -0.02em; color: var(--text); text-decoration: none; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0 1.1rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: transparent;
  font-weight: 600; font-size: var(--s-sm);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--raised); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn--primary { background: var(--brass); border-color: var(--brass); color: var(--brass-ink); }
.btn--primary:hover { background: #E6BD70; border-color: #E6BD70; }
.btn--primary:disabled:hover { background: var(--brass); }
.btn--quiet { border-color: transparent; color: var(--dim); padding: 0 0.6rem; }
.btn--quiet:hover { color: var(--text); background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn--small { min-height: 34px; padding: 0 0.75rem; font-size: var(--s-xs); }
.btn--danger { border-color: rgba(240, 147, 140, 0.45); color: var(--alert); }
.btn--danger:hover { background: rgba(240, 147, 140, 0.1); }
.btn--danger-solid { background: var(--alert); border-color: var(--alert); color: #2B0F0D; }
.btn--danger-solid:hover { background: #F6A7A2; }
.btn.is-done { color: var(--patina); border-color: rgba(95, 200, 177, 0.5); }
.btn--primary.is-done { color: var(--brass-ink); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: var(--r-control); border: 1px solid transparent; background: transparent; color: var(--dim); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--raised); }
.link-btn {
  border: 0; background: transparent; padding: 2px 4px; border-radius: 4px;
  color: var(--faint); font-size: var(--s-xs); cursor: pointer;
}
.link-btn:hover { color: var(--text); text-decoration: underline; }

input[type="text"], select {
  width: 100%; min-height: 40px; padding: 8px 10px;
  background: var(--ground); border: 1px solid var(--line-strong); border-radius: var(--r-control);
}
input[type="text"]::placeholder, textarea::placeholder { color: var(--faint); }
input[type="text"]:focus-visible, select:focus-visible { outline: 2px solid var(--patina); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--patina); flex: none; }
.field { display: grid; gap: 4px; font-size: var(--s-xs); color: var(--dim); min-width: 0; }
.field input { font-size: var(--s-sm); color: var(--text); }
.hint { margin: 4px 0 0; font-size: var(--s-xs); color: var(--faint); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input[type="text"], .row select { flex: 1 1 12rem; width: auto; }
textarea {
  width: 100%; resize: none;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-control);
  padding: 10px 12px; line-height: 1.45;
}
.pill { color: var(--faint); font-size: var(--s-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Home: the link, right away ---------- */
.home {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: clamp(16px, 3vh, 32px) clamp(16px, 4.5vw, 64px);
}
.home__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 0; }
.home__top-actions { display: flex; align-items: center; gap: 4px; }
.home__body { display: grid; place-items: center; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.home__body::-webkit-scrollbar { display: none; }
.start { width: min(640px, 100%); display: grid; gap: clamp(14px, 2.6vh, 24px); }
.start h1 { margin: 0; font-size: var(--s-2xl); line-height: 1.05; font-weight: 600; letter-spacing: -0.025em; }
.start__lead { margin: 0; color: var(--dim); font-size: var(--s-lg); line-height: 1.5; text-wrap: pretty; }
.linkbox {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-block); background: var(--panel);
}
.linkbox__url { margin: 0; font-size: var(--s-md); color: var(--text); overflow-wrap: anywhere; line-height: 1.4; user-select: all; }
.start__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.start__note { margin: 0; font-size: var(--s-sm); color: var(--faint); }
.facts {
  list-style: none; margin: clamp(4px, 1.5vh, 16px) 0 0; padding: clamp(14px, 2.4vh, 22px) 0 0;
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.facts li { display: grid; gap: 4px; align-content: start; }
.facts b { font-size: var(--s-sm); font-weight: 600; }
.facts span { font-size: var(--s-xs); color: var(--dim); line-height: 1.45; }
.facts a { font-size: var(--s-xs); color: var(--patina); text-underline-offset: 2px; justify-self: start; }
.error-note {
  margin: 0; padding: 12px 14px; border-radius: var(--r-control);
  background: rgba(240, 147, 140, 0.08); color: var(--alert); font-size: var(--s-sm);
}

.connect { display: grid; gap: 10px; }
.connect__note { margin: 0; font-size: var(--s-sm); color: var(--dim); }
.cmd {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 2px;
  background: var(--ground); border: 1px solid var(--line); border-radius: var(--r-control); padding: 8px 8px 8px 12px;
}
.cmd__label { grid-column: 1 / -1; font-size: var(--s-xs); color: var(--dim); }
.cmd code {
  font-family: var(--mono); font-size: 0.68rem; font-variation-settings: "wdth" 75;
  white-space: nowrap; overflow-x: auto; scrollbar-width: none; color: var(--text);
}
.cmd code::-webkit-scrollbar { display: none; }

/* ---------- Dialogs ---------- */
dialog {
  border: 1px solid var(--line); border-radius: var(--r-block); padding: 20px;
  background: var(--panel); color: var(--text);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
dialog::backdrop { background: rgba(4, 10, 11, 0.7); }
.dialog--wide { width: min(800px, calc(100vw - 32px)); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dialog__head h2 { margin: 0; font-size: var(--s-lg); min-width: 0; overflow-wrap: anywhere; }

.rooms { display: grid; gap: 2px; }
.rooms__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; }
.rooms__item + .rooms__item { border-top: 1px solid var(--line); }
.rooms__name { font-weight: 600; font-size: var(--s-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rooms__item .row { flex-wrap: nowrap; gap: 4px; }

.settings { display: grid; gap: 18px; }
.settings__group { display: grid; gap: 6px; margin: 0; }
.settings__group.row { display: flex; }
.settings__danger { border-top: 1px solid var(--line); padding-top: 16px; justify-items: start; }
.confirm { display: grid; gap: 10px; padding: 12px 14px; border-radius: var(--r-control); background: rgba(240, 147, 140, 0.08); }
.confirm p { margin: 0; font-size: var(--s-sm); color: var(--alert); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--s-sm); cursor: pointer; }

.contract { display: grid; gap: 12px; min-width: 0; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; }
.versions button {
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 3px 10px;
  font-size: var(--s-xs); color: var(--dim); cursor: pointer;
}
.versions button[aria-pressed="true"] { background: var(--raised); color: var(--text); border-color: var(--raised); }
.contract__meta { margin: 0; font-size: var(--s-xs); color: var(--dim); }
.contract__content {
  margin: 0; padding: 12px 14px; max-height: 55dvh; overflow: auto; min-height: 4rem;
  background: var(--ground); border-radius: var(--r-control);
  font-family: var(--mono); font-variation-settings: "wdth" 87.5; font-size: 0.74rem; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text);
}
.contract__edit { display: grid; gap: 8px; }
.contract__edit textarea { font-family: var(--mono); font-size: 0.8rem; font-variation-settings: "wdth" 87.5; min-height: 32vh; max-height: 50vh; resize: vertical; }
.contract__edit input[type="text"] { width: 100%; }

/* ---------- Room ---------- */
.room { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px clamp(12px, 2vw, 20px);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.bar .wordmark { font-size: var(--s-md); }
.bar__name { font-weight: 600; font-size: var(--s-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bar__lock { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: var(--s-xs); white-space: nowrap; border-radius: 4px; }
.bar__lock[data-rejected]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.bar__spacer { flex: 1; }
.bar__conn { font-size: var(--s-xs); color: var(--brass); white-space: nowrap; }
.bar__conn:empty { display: none; }
.bar__actions { display: flex; gap: 8px; align-items: center; flex: none; }

.room__main { display: grid; grid-template-columns: 264px minmax(0, 1fr) 320px; min-height: 0; }
.people, .side { background: var(--panel); min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.pane-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 16px 8px; }
.pane-head h2 { margin: 0; font-size: var(--s-sm); font-weight: 600; }
.pane-head span { color: var(--faint); font-size: var(--s-xs); }
.scroll { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scroll:focus { outline: none; }

.person { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 10px 16px; }
.person--left { opacity: 0.6; }
.person__main { min-width: 0; }
.avatar {
  width: 36px; height: 36px; display: grid; place-items: center;
  font-weight: 600; font-size: var(--s-sm);
  background: var(--raised); color: var(--patina); border-radius: 50%; position: relative;
}
.avatar--human { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.avatar::after {
  content: ""; position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--panel); background: var(--faint);
}
.avatar[data-presence="online"]::after, .avatar[data-presence="listening"]::after { background: var(--patina); }
.person__name { font-weight: 600; font-size: var(--s-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__you { color: var(--faint); font-weight: 400; }
.person__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 2px; font-size: var(--s-xs); color: var(--dim); }
.person__status { font-size: var(--s-xs); color: var(--faint); margin-top: 3px; overflow-wrap: anywhere; }
.presence { font-size: var(--s-xs); color: var(--faint); }
.presence--live { color: var(--patina); }

.feed { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.banner {
  grid-row: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 10px clamp(14px, 3vw, 40px) 0; padding: 10px 14px; border-radius: var(--r-control);
  background: rgba(240, 147, 140, 0.08); color: var(--alert); font-size: var(--s-sm);
}
.banner p { margin: 0; flex: 1 1 16rem; }
.feed__list { grid-row: 2; padding: 8px clamp(14px, 3vw, 40px) 16px; display: flex; flex-direction: column; }
.feed__inner { max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 2px; }
.day { align-self: center; color: var(--faint); font-size: var(--s-xs); padding: 14px 0 6px; }
.msg { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-radius: var(--r-control); }
.msg .avatar::after { display: none; }
.msg__main { min-width: 0; }
.msg--for-me { margin: 0 -10px; padding: 10px; background: rgba(216, 173, 94, 0.07); }
.msg.is-flash { background: rgba(95, 200, 177, 0.1); transition: background 600ms ease; }
.msg__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; min-width: 0; }
.msg__name { font-weight: 600; font-size: var(--s-sm); overflow-wrap: anywhere; }
.msg__what { color: var(--dim); font-size: var(--s-xs); }
.msg__time { color: var(--faint); font-size: var(--s-xs); }
.msg__actions { margin-left: auto; opacity: 0; transition: opacity 120ms ease; }
.msg:hover .msg__actions, .msg:focus-within .msg__actions { opacity: 1; }
@media (hover: none) { .msg__actions { opacity: 1; } }
.msg__reply {
  display: flex; gap: 6px; align-items: baseline; max-width: 100%; margin-bottom: 2px; padding: 0;
  border: 0; background: transparent; text-align: left; cursor: pointer;
  color: var(--faint); font-size: var(--s-xs);
}
.msg__reply b { color: var(--dim); font-weight: 600; white-space: nowrap; }
.msg__reply span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg__reply:hover b { text-decoration: underline; }
.msg__body { margin: 3px 0 0; max-width: 68ch; text-wrap: pretty; overflow-wrap: anywhere; }
.msg__body p, .task-card__desc p { margin: 0; }
.msg__body p + p, .msg__body pre + p, .msg__body p + pre { margin-top: 0.5em; }
.msg__body code, .task-card__desc code {
  font-family: var(--mono); font-variation-settings: "wdth" 87.5; font-size: 0.8em;
  background: var(--raised); padding: 1px 5px; border-radius: 5px;
}
.msg__body pre {
  margin: 6px 0 0; padding: 10px 12px; background: var(--panel); border-radius: var(--r-control);
  overflow-x: auto; font-size: 0.8rem; line-height: 1.55; white-space: pre;
}
.msg__body pre code { background: none; padding: 0; font-size: 0.74rem; }
.msg__body a, .task-card__desc a { color: var(--patina); text-underline-offset: 2px; }
.mention { color: var(--patina); font-weight: 600; }
.mention--me { color: var(--brass); }

.activity { display: flex; gap: 10px; padding: 4px 0 4px 48px; color: var(--faint); font-size: var(--s-xs); overflow-wrap: anywhere; }
.activity time { white-space: nowrap; }

.task-card {
  margin-top: 8px; padding: 14px 16px; border-radius: var(--r-block);
  background: var(--panel); display: grid; gap: 8px; max-width: 560px;
}
.task-card h3 { margin: 0; font-size: var(--s-md); font-weight: 600; overflow-wrap: anywhere; }
.task-card p, .task-card__desc { margin: 0; color: var(--dim); font-size: var(--s-sm); overflow-wrap: anywhere; }
.task-card ul { margin: 0; padding-left: 1.1rem; color: var(--dim); font-size: var(--s-sm); }
.task-card__top { display: flex; gap: 10px; align-items: center; }
.task-card .chip { margin-top: 0; background: var(--raised); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--s-xs); font-weight: 600; color: var(--dim); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status--in_progress, .status--accepted { color: var(--brass); }
.status--done { color: var(--patina); }
.status--blocked, .status--rejected { color: var(--alert); }

.chip {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; max-width: 100%;
  padding: 6px 10px; border-radius: var(--r-control); background: var(--panel); font-size: var(--s-sm);
  color: var(--text);
}
.chip svg { color: var(--dim); flex: none; }
.chip small { color: var(--faint); font-size: var(--s-xs); white-space: nowrap; }
.chip__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chip--file { padding-right: 6px; }
.chip--file .btn--small { min-height: 28px; padding: 0 0.6rem; margin-left: 4px; }
.chip--btn { border: 0; cursor: pointer; text-align: left; }
.chip--btn:hover { background: var(--raised); }
.chip--btn b { font-weight: 600; }

.empty { margin: auto; text-align: center; max-width: 26rem; display: grid; gap: 14px; justify-items: center; padding: 24px 0; }
.empty h3 { margin: 0; font-size: var(--s-lg); }
.empty p { margin: 0; color: var(--dim); font-size: var(--s-sm); }
.empty--small { padding: 16px; text-align: left; justify-items: start; margin: 0; }
.feed__inner.is-empty { min-height: 100%; }

.composer { grid-row: 3; padding: 10px clamp(14px, 3vw, 40px) 14px; min-width: 0; }
.composer__inner { max-width: 760px; margin: 0 auto; display: grid; gap: 8px; min-width: 0; }
.composer__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.composer__context { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--s-xs); color: var(--dim); }
.composer__context > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.composer__context b { color: var(--text); font-weight: 600; }
.attach__name { color: var(--text); }
.composer__box { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 6px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-block); padding: 6px; }
.composer__box textarea { border: 0; background: transparent; padding: 9px 4px; max-height: 30vh; }
.composer__box textarea:focus-visible { outline: none; }
.composer__box:focus-within { border-color: var(--dim); }
.composer.is-busy .composer__box { opacity: 0.7; }
.segment { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-control); background: var(--panel); justify-self: start; }
.segment button { border: 0; background: transparent; padding: 4px 10px; border-radius: 6px; font-size: var(--s-xs); color: var(--dim); cursor: pointer; }
.segment button[aria-pressed="true"] { background: var(--raised); color: var(--text); }

.joinform {
  display: grid; gap: 10px; padding: 12px; border-radius: var(--r-block);
  background: var(--panel); border: 1px solid var(--brass-deep);
}
.joinform__title { margin: 0; font-size: var(--s-sm); font-weight: 600; }
.joinform__row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.joinform__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.joinform__note { font-size: var(--s-xs); color: var(--faint); }

.tabs { display: flex; gap: 4px; padding: 12px 12px 4px; }
.tabs button { border: 0; background: transparent; padding: 6px 10px; border-radius: var(--r-control); font-size: var(--s-sm); color: var(--dim); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--raised); color: var(--text); }
.item { padding: 12px 16px; display: grid; gap: 4px; min-width: 0; }
.item + .item { border-top: 1px solid var(--line); }
.item__title { font-size: var(--s-sm); font-weight: 600; overflow-wrap: anywhere; }
.item--file .item__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--faint); font-size: var(--s-xs); }
.item__desc {
  margin: 0; color: var(--dim); font-size: var(--s-xs); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item__actions .btn--small { min-height: 30px; padding: 0 0.65rem; }
.item__dl { margin-left: auto; min-height: 28px; }
.item--btn {
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; color: inherit;
  border-top: 0;
}
.item--btn + .item--btn { border-top: 1px solid var(--line); }
.item--btn:hover { background: var(--raised); }
.item--btn .item__meta, .item--btn .item__title { display: flex; }
.item--add { padding-bottom: 4px; }

.nav { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  max-width: calc(100vw - 32px); width: max-content;
  background: var(--text); color: var(--ground); padding: 8px 14px; border-radius: var(--r-control);
  font-size: var(--s-sm); font-weight: 600; pointer-events: none; z-index: 10;
}
.toast[data-kind="error"] { background: var(--alert); color: #2B0F0D; }

/* ---------- Tablet and phone: one pane at a time ---------- */
@media (max-width: 1099px) {
  .room__main { grid-template-columns: minmax(0, 1fr); }
  .room .people, .room .feed, .room .side { display: none; }
  .room[data-view="chat"] .feed { display: grid; }
  .room[data-view="people"] .people { display: grid; }
  .room[data-view="tasks"] .side, .room[data-view="contracts"] .side, .room[data-view="files"] .side { display: grid; }
  .room .side .tabs { display: none; }
  .room .side { grid-template-rows: minmax(0, 1fr); }
  .people, .side { background: var(--ground); }
  .avatar::after { border-color: var(--ground); }
  .nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line); background: var(--panel);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .nav button { border: 0; background: transparent; color: var(--dim); font-size: var(--s-xs); padding: 12px 0; cursor: pointer; }
  .nav button[aria-selected="true"] { color: var(--text); box-shadow: inset 0 2px 0 var(--patina); }
  .toast { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

@media (max-width: 760px) {
  .start__lead { font-size: var(--s-md); }
  .start h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .linkbox { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .linkbox .btn { width: 100%; }
  .linkbox__url { font-size: var(--s-sm); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .facts li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
  .facts span { display: none; }
  .bar { gap: 10px; }
  .bar__lock-text, .bar .copy-link, .bar .wordmark { display: none; }
  .joinform__note { display: none; }
}
@media (max-width: 420px) {
  .bar { padding-inline: 10px; gap: 8px; }
  .bar__actions { gap: 2px; }
  .bar .invite { padding: 0 0.6rem; }
  .composer { padding-inline: 10px; }
  .feed__list { padding-inline: 12px; }
  .start__actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
