/* Coop. Look approved by Knox 2026-10-16 (card coop-room-look-20261016, Astra's mock). Light only for now. */
:root {
  --paper: #fbfaf7;
  --white: #fff;
  --rail: #f1eee7;
  --aside: #f7f6f1;
  --tint: #faf8f3;
  --ink: #292b26;
  --ink-2: #41463b;
  --muted: #60635a;
  --line: #deded5;
  --line-2: #d6d5cb;
  --line-3: #c5c7bd;
  --input-line: #bfc2b6;
  --accent: #96421f;
  --accent-ink: #733717;
  --accent-ink-2: #843815;
  --soft: #f7ebe2;
  --active: #e8dfd2;
  --olive: #48553c;
  --olive-soft: #edf0e7;
  --olive-line: #d4d9ca;
  --clay: #e8ddd1;
  --clay-ink: #623e26;
  --sage: #e3e6db;
  --sage-ink: #3e4933;
  --card-line: #d7bc9f;
  --status-bg: #fbefdf;
  --status-line: #e5cba7;
  --status-ink: #813b1b;
  --summary-bg: #eef0e7;
  --summary-line: #d5d9c9;
  --summary-ink: #414a37;
  --danger: #a1301c;
  --shadow: rgba(41, 43, 38, .08);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: .6; }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
svg.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- shell ---------- */
.app { max-width: 1440px; min-height: 100vh; margin: auto; display: grid; grid-template-columns: 226px minmax(0, 1fr) 254px; }
.rail { background: var(--rail); border-right: 1px solid var(--line); padding: 32px 20px 22px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 29px; letter-spacing: -1.6px; font-weight: 750; }
.brand svg { width: 29px; height: 29px; color: var(--accent); }
.workspace { font-size: 11px; letter-spacing: 1.6px; font-weight: 650; color: var(--muted); margin: 5px 0 33px 49px; }
.switch-wrap { position: relative; }
.switcher { background: var(--white); border: 1px solid var(--line-2); border-radius: 9px; padding: 12px; display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; }
.switcher strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-mark { width: 29px; height: 29px; border: 1px solid var(--line-3); border-radius: 6px; display: grid; place-items: center; font-family: Georgia, serif; font-size: 18px; background: var(--paper); flex-shrink: 0; }
.switcher .icon { margin-left: auto; width: 14px; }
.section-label { font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 1.4px; color: var(--muted); }
.room-label { margin: 29px 12px 10px; display: flex; align-items: center; justify-content: space-between; }
.room-label button { color: var(--muted); padding: 2px; border-radius: 4px; display: grid; place-items: center; }
.room-label button:hover { color: var(--accent); }
.room-label button .icon { width: 16px; height: 16px; }
.rooms { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; }
.rooms a { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--muted); padding: 10px 13px; border-radius: 6px; font-weight: 550; }
.rooms a:hover { background: var(--active); }
.rooms a.active { background: var(--active); color: var(--accent-ink); box-shadow: inset 3px 0 var(--accent); }
.rooms .lock { width: 13px; height: 13px; margin-left: auto; }
.hash { font-size: 19px; font-weight: 400; line-height: 1; }
.dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-left: auto; }
.new-wrap { margin: -14px 0 12px; }
.new-button { width: 100%; padding: 9px 12px; font-size: 13px; }
.tabs { display: grid; grid-template-columns: repeat(4, auto); gap: 2px; margin: 18px 0 8px; padding: 3px; background: var(--active); border-radius: 8px; }
.tab { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 4px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px var(--shadow); }
.tab-count { font-size: 10px; min-width: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--white); line-height: 16px; }
.rooms a.has-unread .room-name { color: var(--ink); font-weight: 700; }
.badge { margin-left: auto; font-size: 10px; font-weight: 700; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; border-radius: 9px; background: var(--accent); color: var(--white); }
.mention-badge { background: var(--accent-ink); }
.rooms .lock + .badge { margin-left: 6px; }
.rail-empty { color: var(--muted); font-size: 12px; padding: 10px 13px; margin: 0; }
.rooms a.mention-item { display: block; padding: 8px 11px; }
.mention-head { display: flex; gap: 4px; align-items: baseline; font-size: 11px; color: var(--muted); }
.mention-head strong { color: var(--ink); font-size: 12px; }
.mention-head time { margin-left: auto; }
.mention-body { display: block; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.mention-item.has-unread .mention-body { font-weight: 650; color: var(--ink); }
.rail-note { margin-top: auto; padding: 18px 12px 24px; color: var(--muted); font-size: 12px; line-height: 1.7; border-bottom: 1px solid var(--line-2); }
.rail-note strong { color: var(--ink); font-weight: 600; display: block; font-size: 13px; margin-bottom: 5px; }
.account-wrap { position: relative; }
.account { display: flex; gap: 10px; align-items: center; padding: 20px 8px 0; width: 100%; text-align: left; }
.account small { display: block; color: var(--muted); font-size: 11px; }
.account .icon { margin-left: auto; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--clay); color: var(--clay-ink); font-size: 11px; font-weight: 700; flex-shrink: 0; }
.avatar.alt { background: var(--sage); color: var(--sage-ink); }
.avatar.agent { border-radius: 8px; background: var(--olive-soft); border: 1px solid var(--olive-line); position: relative; color: var(--olive); }
.avatar.agent .icon { width: 21px; height: 21px; }
.avatar.agent:after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 8px; height: 8px; border: 2px solid var(--paper); background: var(--line-3); border-radius: 2px; }
.avatar.agent.online:after { background: var(--olive); }
.avatar.system { border-radius: 8px; background: var(--rail); border: 1px solid var(--line-2); color: var(--muted); }
.avatar.system .icon { width: 18px; height: 18px; }
.agent-label { font-size: 10px; line-height: 17px; color: var(--olive); background: var(--olive-soft); border: 1px solid var(--olive-line); border-radius: 4px; padding: 0 5px; font-weight: 650; }
.activity { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-top: 2px; color: var(--muted); font-size: 11px; }
.delivery { display: inline-flex; align-items: center; gap: 4px; }
.delivery .icon { width: 13px; height: 13px; color: var(--olive); }
.delivery.failed .icon { color: var(--danger); }
.message.system p { color: var(--muted); font-size: 13px; }
.person.button-like { width: 100%; text-align: left; border-radius: 6px; padding: 4px; margin: -4px -4px 14px; }
.person.button-like:hover { background: var(--rail); }
.aside-sub { display: flex; align-items: center; justify-content: space-between; }
.aside-sub button { color: var(--muted); padding: 2px; border-radius: 4px; display: grid; place-items: center; margin-top: -16px; }
.aside-sub button:hover { color: var(--accent); }
.aside-sub button .icon { width: 16px; height: 16px; }
.steps-box { margin: 0 0 14px; padding-left: 20px; font-size: 13px; }
.steps-box li { margin-bottom: 8px; }
.cmd { display: block; font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; margin-top: 4px; word-break: break-all; }
.device-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.device-row small { color: var(--muted); display: block; }
.device-row .button { margin-left: auto; }

.menu { position: absolute; z-index: 20; left: 0; right: 0; background: var(--white); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.menu.down { top: calc(100% + 6px); }
.menu.up { bottom: calc(100% + 6px); }
.menu button { text-align: left; padding: 8px 10px; border-radius: 5px; display: flex; align-items: center; gap: 9px; }
.menu button:hover { background: var(--rail); }
.menu button.current { font-weight: 650; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }

/* ---------- main ---------- */
.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.room-header { min-height: 99px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; gap: 16px; flex-shrink: 0; }
.eyebrow { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 4px; }
.room-header h1 { font-size: 20px; letter-spacing: -.5px; font-weight: 650; margin: 0; }
.room-header h1 span { font-weight: 400; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 20px; }
.members-count { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line-3); border-radius: 6px; padding: 7px 13px; background: var(--white); font-size: 12px; font-weight: 600; white-space: nowrap; }
.button:hover { border-color: var(--muted); }
.button.primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-ink); }
.button.big { padding: 11px 16px; font-size: 14px; width: 100%; }
.link { color: var(--accent-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; padding: 0; }

.conversation { padding: 0 32px 12px; flex: 1; overflow-y: auto; }
.date-rule { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 11px; margin: 19px 0 23px; }
.date-rule:before, .date-rule:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.message { display: flex; gap: 12px; margin-bottom: 22px; position: relative; }
.message:hover .msg-actions, .message:focus-within .msg-actions { visibility: visible; }
.message:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.content { min-width: 0; flex: 1; }
.byline { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 4px; }
.byline strong { font-size: 13px; font-weight: 650; }
.role, .byline time, .edited { font-size: 11px; color: var(--muted); }
.byline time { margin-left: 5px; }
.message p { margin: 0 0 8px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message p.deleted { color: var(--muted); font-style: italic; }
.reply-ref { font-size: 11px; color: var(--muted); margin: -2px 0 4px; display: flex; gap: 5px; align-items: center; }
.reply-ref .icon { width: 12px; height: 12px; }
.mention { display: inline-block; background: var(--soft); color: var(--accent-ink-2); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.msg-actions { position: absolute; right: 0; top: -6px; display: flex; gap: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 2px; visibility: hidden; }
.msg-actions button { font-size: 11px; color: var(--muted); padding: 3px 8px; border-radius: 4px; }
.msg-actions button:hover { background: var(--rail); color: var(--ink); }
.edit-box textarea { width: 100%; min-height: 60px; border: 1px solid var(--input-line); border-radius: 6px; padding: 7px 9px; resize: vertical; background: var(--white); }
.edit-box .row { display: flex; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.empty-room { text-align: center; color: var(--muted); margin: 60px auto; max-width: 340px; font-size: 13px; }
.empty-room strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; font-weight: 650; }

.composer-area { padding: 0 32px 17px; flex-shrink: 0; }
.replying { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); padding: 0 4px 6px; }
.replying button { color: var(--accent-ink); font-weight: 600; font-size: 11px; }
.composer { border: 1px solid var(--input-line); border-radius: 8px; background: var(--white); padding: 11px 13px 8px; box-shadow: 0 2px 4px var(--shadow); position: relative; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { width: 100%; min-height: 29px; max-height: 180px; resize: none; border: 0; padding: 0; background: none; font-size: 13px; display: block; }
.composer textarea:focus-visible { outline: none; }
.compose-label { position: absolute; left: 13px; top: 11px; font-size: 13px; color: var(--muted); pointer-events: none; }
.compose-tools { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.icon-button { padding: 3px; display: grid; place-items: center; border-radius: 4px; }
.icon-button:hover { color: var(--ink); }
.at-icon { font-size: 18px; line-height: 20px; }
.compose-hint { font-size: 10px; margin-left: auto; margin-right: 5px; }
.send { border-radius: 5px; background: var(--rail); padding: 5px; color: var(--sage-ink); }
.send:not(:disabled):hover { background: var(--accent); color: var(--white); }
.composer-caption { margin-top: 7px; text-align: center; font-size: 10px; color: var(--muted); }
.form-error { color: var(--danger); font-size: 12px; margin: 6px 0 0; }

/* ---------- aside ---------- */
.aside { border-left: 1px solid var(--line); padding: 35px 22px; background: var(--aside); height: 100vh; position: sticky; top: 0; overflow-y: auto; }
.aside-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; font-weight: 600; font-size: 13px; }
.aside h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--muted); margin: 0 0 18px; }
.aside h2 span { font-weight: 400; letter-spacing: 0; margin-left: 6px; }
.person { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.person .name { font-size: 12px; font-weight: 600; }
.person small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.aside-divider { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.summary { border: 1px solid var(--summary-line); background: var(--summary-bg); border-radius: 8px; padding: 14px; }
.summary-head { display: flex; gap: 7px; align-items: center; font-weight: 600; font-size: 12px; color: var(--sage-ink); }
.summary .icon { width: 16px; height: 16px; }
.summary small { display: block; color: var(--muted); font-size: 10px; margin: 5px 0 12px; }
.summary p { font-size: 12px; line-height: 1.7; margin: 0; color: var(--summary-ink); white-space: pre-wrap; }

/* ---------- sign-in, join, empty states ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--rail); }
.gate-card { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--line-2); border-radius: 12px; padding: 32px 30px 28px; box-shadow: 0 12px 40px var(--shadow); }
.gate-card .brand { padding: 0; }
.gate-card .workspace { margin: 4px 0 26px 39px; }
.gate-card h1 { font-size: 20px; letter-spacing: -.4px; margin: 0 0 6px; font-weight: 650; }
.gate-card .lead { color: var(--muted); margin: 0 0 22px; font-size: 13px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; margin: 18px 0; }
.or:before, .or:after { content: ""; height: 1px; flex: 1; background: var(--line); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.field small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--input-line); border-radius: 6px; padding: 9px 10px; background: var(--white); }
.field textarea { min-height: 80px; resize: vertical; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; letter-spacing: 1px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; word-break: break-all; margin: 0 0 14px; }
.field-error { display: block; color: var(--danger); font-size: 12px; margin-top: 4px; }
.field-error:empty { display: none; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 2px 0 16px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.qr { display: block; width: 200px; height: 200px; margin: 4px auto 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.secret.inline { display: inline-block; margin: 4px 0 0; padding: 3px 7px; font-size: 12px; }
.fine { color: var(--muted); font-size: 11px; margin: 18px 0 0; line-height: 1.6; }
.center-empty { flex: 1; display: grid; place-items: center; padding: 40px 32px; }
.center-empty .gate-card { box-shadow: none; }

/* ---------- dialogs ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 12px; padding: 26px 26px 22px; width: min(440px, calc(100vw - 32px)); background: var(--white); color: var(--ink); box-shadow: 0 20px 60px var(--shadow); }
dialog::backdrop { background: rgba(41, 43, 38, .35); }
dialog h2 { margin: 0 0 16px; font-size: 17px; font-weight: 650; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; border: 1px solid var(--input-line); border-radius: 6px; padding: 8px 9px; font-size: 12px; background: var(--paper); }

@media (max-width: 1200px) { .app { grid-template-columns: 200px minmax(0, 1fr); } .aside { display: none; } }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .workspace, .rail-note { display: none; }
  .brand { font-size: 24px; padding: 0; }
  .room-label { display: none; }
  .new-wrap, .tabs { grid-column: 1 / -1; margin: 0; }
  .switch-wrap { min-width: 0; }
  .rooms { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; }
  .rooms a { padding: 7px 11px; white-space: nowrap; }
  .account-wrap { grid-column: 1 / -1; }
  .account { padding: 4px 0 0; }
  .main { height: auto; min-height: 70vh; }
  .room-header, .conversation { padding-left: 16px; padding-right: 16px; }
  .room-header { min-height: 72px; }
  .composer-area { padding: 0 16px 16px; }
  .header-actions .members-count { display: none; }
}
