/* Atelier paper. Tokens from the approved v2 mockups. */
:root {
  --paper: #f3f0e8;
  --paper2: #ece8dd;
  --sheet: #fbfaf6;
  --ink: #1a1814;
  --mute: #77716a;
  --rule: #d6d0c2;
  --verm: #d9432b;
  --moss: #4f6b45;
  --ochre: #a87a1e;
  --lane: #e6e1d4;
  --side: 220px;
  --top: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter Tight", sans-serif;
  font-size: 13px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.serif { font-family: Newsreader, serif; font-optical-sizing: auto; font-weight: 400; }
.mono { font-family: "JetBrains Mono", monospace; font-size: 11.5px; font-feature-settings: "zero"; font-variant-numeric: tabular-nums; }
.sc {
  font-variant: all-small-caps;
  letter-spacing: 0.08em;
  font-weight: 500;
  color: var(--mute);
  font-size: 13px;
}
.mute { color: var(--mute); }
.verm { color: var(--verm); }
.moss { color: var(--moss); }
.ink { color: var(--ink); }
.tab { font-variant-numeric: tabular-nums; }

.app { display: flex; height: 100%; min-height: 100vh; }
.side {
  width: var(--side);
  flex: none;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  height: var(--top);
  padding: 18px 20px 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand .word { font-size: 24px; line-height: 1; letter-spacing: -0.02em; }
.org-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 12px 20px;
  display: block;
}
.org-btn .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; }
.nav { padding: 12px 0; overflow: auto; }
.nav-label { padding: 14px 20px 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 20px;
  color: var(--mute);
  text-decoration: none;
}
.nav a.active {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--verm);
}
.nav a .count { margin-left: auto; color: var(--verm); }
.nav a .spacer { margin-left: auto; }
.campaigns { padding: 16px 20px 8px; border-top: 1px solid var(--rule); }
.campaigns .line { display: flex; justify-content: space-between; align-items: center; height: 28px; }
.side-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--rule); }
.spend-row { display: flex; justify-content: space-between; align-items: baseline; }
.track { height: 1px; background: var(--rule); margin-top: 8px; position: relative; }
.track i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--ink); }
.track .warn { position: absolute; top: -6px; width: 1px; height: 14px; background: var(--ochre); }
.track .stop { position: absolute; top: -6px; right: 0; width: 1px; height: 14px; background: var(--verm); }
.who { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.more-nav summary {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 20px;
  color: var(--mute);
  cursor: pointer;
  list-style: none;
}
.more-nav summary::-webkit-details-marker { display: none; }
.more-direct summary { color: var(--mute); }
.thread-form { padding: 8px 20px 0; }
.em-line { font-family: Newsreader, Georgia, serif; font-style: italic; font-size: 16px; }
.plates { display: flex; gap: 12px; margin-top: 12px; }
.plate { width: 150px; }
.swatch { height: 100px; position: relative; overflow: hidden; }
.swatch .shape { position: absolute; right: 12px; bottom: 0; width: 56px; height: 80px; }
.swatch .serif { position: absolute; top: 8px; left: 10px; font-size: 15px; line-height: 16px; }
.plate .cap { display: flex; justify-content: space-between; margin-top: 4px; }
.facts { width: 100%; margin-top: 8px; border-collapse: collapse; }
.facts td { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 16px 6px 0; }
.approval-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }
.hero-art { min-height: 150px; position: relative; overflow: hidden; }
.hero-art .parka { position: absolute; right: 40px; bottom: 0; width: 112px; height: 144px; }
.hero-art .serif { position: absolute; left: 28px; bottom: 20px; font-size: 30px; line-height: 32px; max-width: 340px; }
.sheet .prose p + p { margin-top: 12px; }
.edit-persona { margin-top: 12px; }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.key-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.key-actions input { width: 140px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; height: 32px; font-family: "JetBrains Mono", monospace; font-size: 12px; }
.role-edit summary { cursor: pointer; list-style: none; }
.cal-item .btn { display: none; }
.cal-item:hover .btn, .cal-item:focus-within .btn { display: inline-flex; }
.login { height: 100vh; overflow: hidden; }
.campaigns .line.mute { color: var(--mute); }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.top {
  height: var(--top);
  flex: none;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 32px 12px;
}
.top h1, .login-hero h1, .login-card h2, .detail h2, .persona-head h2 {
  font-family: Newsreader, Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 400;
}
.top h1 { font-size: 26px; line-height: 1; letter-spacing: -0.02em; }
.top .meta { color: var(--mute); padding-bottom: 1px; }
.top .actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.thread-property { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: min(520px, 100%); }
.thread-property select { max-width: 200px; min-width: 0; height: 28px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; }
.thread-property-label { color: var(--mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#view { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.page { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.room, .inbox, .split-page { flex-direction: row; overflow: hidden; }

.btn {
  height: 28px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.btn.ink { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.text { border: 0; background: none; color: var(--verm); height: auto; padding: 0; }
.btn.block { height: 40px; width: 100%; justify-content: flex-start; padding: 0 16px; font-weight: 500; }
kbd, .kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  padding: 0 4px;
  color: var(--mute);
  background: #f8f6f0;
}
.btn.ink kbd, kbd.on-ink {
  background: transparent;
  color: rgba(243, 240, 232, 0.6);
  border-color: rgba(243, 240, 232, 0.3);
}
.tabs { display: flex; gap: 16px; align-items: center; }
.tabs a, .tabs span { color: var(--mute); text-decoration: none; }
.tabs .on { color: var(--ink); border-bottom: 1px solid var(--ink); }

.mark { display: inline-flex; align-items: center; gap: 6px; }
.mark-name { font-weight: 500; }
.glyph, .ico { flex: none; display: block; }
.initials {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--ink);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  flex: none;
}
.initials.buyer-mono {
  width: 14px;
  height: 14px;
  border-color: var(--moss);
  color: var(--moss);
}
.persona-mark { flex-wrap: wrap; align-items: center; row-gap: 2px; max-width: 100%; }
.persona-tag {
  font-size: 9px;
  line-height: 14px;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  color: var(--moss);
  border: 1px solid var(--moss);
  padding: 0 4px;
  flex: none;
}
.msg.buyer-msg { grid-template-columns: 220px minmax(0, 1fr) 56px; }
.persona-card { border-top: 1px solid var(--rule); padding: 16px 0; }
.persona-card .btn { margin-top: 12px; }
.persona-failure { color: var(--verm); margin: 8px 0 0; }
.brand-logo { display: block; max-width: 240px; max-height: 72px; margin: 8px 0; }
.brand-logo-note { color: var(--verm); }
.brand-logo-upload { display: flex; gap: 8px; align-items: center; margin: 8px 0 16px; }
.persona-memories { margin: 8px 0 0; padding-left: 18px; }
.persona-memories li { margin: 4px 0; }
.persona-plan { margin: 8px 0 0; }
.persona-plan ul { margin: 8px 0 0; padding-left: 18px; }
.persona-plan li { margin: 4px 0; }
.persona-card .md { margin-top: 8px; }
.persona-reviews { margin-top: 28px; }
.status { display: inline-flex; align-items: center; gap: 4px; }
.status .pip { font-size: 9px; }
.status.moss { color: var(--moss); }
.status.verm { color: var(--verm); }
.status.mute { color: var(--mute); }
.status.ink { color: var(--ink); }
.at { color: var(--verm); }

.hair { width: 100%; border-collapse: collapse; }
.hair td, .hair th { border-top: 1px solid var(--rule); padding: 6px 8px 6px 0; vertical-align: top; text-align: left; font-weight: 400; }
.hair th { border-top: 0; color: var(--mute); font-weight: 500; }
.right { text-align: right; }

.field { display: block; margin: 10px 0; }
.field .sc { display: block; }
.field input, .field textarea, .field select {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: 6px 0;
  outline: none;
}
.field textarea { min-height: 72px; resize: vertical; }
textarea[name="instructions"] { font-family: Newsreader, serif; font-size: 17px; line-height: 26px; border-left: 2px solid var(--ink); padding-left: 16px; min-height: 140px; }
.field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--ink); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.intel-forms { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; padding: 8px 32px 0; }
.growth-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.growth-plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.growth-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.growth-week { border-top: 1px solid var(--rule, currentColor); padding-top: 10px; min-width: 0; overflow-wrap: anywhere; }
.growth-week ul { padding-left: 18px; margin: 8px 0; }
.goal-measure { font-size: 13px; margin-top: 4px; overflow-wrap: anywhere; }
.plan-sources { padding-left: 22px; margin: 6px 0; overflow-wrap: anywhere; }
.plan-sources li { margin: 6px 0; }
.cite { margin-left: 3px; text-decoration: none; }
.growth-report { border-top: 1px solid var(--rule, currentColor); padding: 10px 0; overflow-wrap: anywhere; }
[data-page="growth"] table.hair { display: block; overflow-x: auto; max-width: 100%; }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }

.room { display: flex; flex: 1; min-height: 0; }
.channels { width: 200px; flex: none; border-right: 1px solid var(--rule); padding: 16px 0; overflow: auto; display: flex; flex-direction: column; }
.channel-label { padding: 0 20px 4px; }
.channel-label-next { padding-top: 24px; }
.channel, .direct {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  height: 28px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--mute);
  text-align: left;
}
.channel.on { color: var(--ink); font-weight: 500; background: var(--paper2); }
.channels .direct:has(.persona-mark) {
  height: auto;
  min-height: 28px;
  align-items: flex-start;
  padding-top: 6px;
  padding-bottom: 6px;
}
.channel .hash { width: 16px; color: var(--mute); }
.channel .n { margin-left: auto; }
.thread-form { margin-top: auto; padding: 12px 20px 0; border-top: 1px solid var(--rule); }
.transcript { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0 40px; position: relative; overflow: hidden; }
.messages { flex: 1; min-width: 0; max-width: 100%; min-height: 0; overflow-x: hidden; overflow-y: auto; padding-top: 16px; }
.room-work {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  min-height: 32px;
  margin: 0 0 4px;
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--rule);
}
.room-work-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
}
.room-work-line + .room-work-line { margin-top: 2px; }
.room-work-line .sc { flex: none; }
.room-work-line .serif { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-work-line .scope { flex: none; max-width: 28%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-work-line .task { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-work-you { background: var(--paper2); box-shadow: inset 2px 0 0 var(--verm); padding: 2px 8px; }
.mention-note { font-variant: small-caps; letter-spacing: 0.08em; color: var(--verm); margin: 0 0 4px; font-size: 12px; }
.at-me { background: var(--paper2); box-shadow: inset 0 -1px 0 var(--verm); }
.close-note { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.close-note .close-clear { margin: 0; }
.close-needs { margin: 4px 0 0; padding-left: 18px; }
.close-needs a { color: inherit; }
.linked-card { box-shadow: inset 3px 0 0 var(--verm); }
.new-pill {
  position: absolute;
  left: 50%;
  bottom: 200px;
  transform: translateX(-50%);
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 14px;
  font-size: 13px;
  line-height: 18px;
  box-shadow: 0 8px 24px rgba(26, 24, 20, 0.16);
}
.tool-msg .copy-body { font-size: 12px; }
.live-msg { background: transparent; }
.activities { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.activity { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; line-height: 18px; color: var(--ink); }
.activity summary { cursor: pointer; }
.activity pre { white-space: pre-wrap; margin: 4px 0 0; font-size: 11px; line-height: 16px; color: var(--mute, #6b6459); }
.activity.running summary::before, .activity.running > div::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--verm); vertical-align: middle; }
.activity.done summary::before, .activity.done > div::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: currentColor; opacity: 0.35; vertical-align: middle; }
.activity.error summary::before, .activity.error > div::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--verm); vertical-align: middle; }
.stop-turn { margin-top: 8px; }
.dayline { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.dayline i { flex: 1; height: 1px; background: var(--rule); }
.msg { display: grid; grid-template-columns: 128px minmax(0, 1fr) 56px; gap: 24px; padding: 12px 0; border-top: 1px solid var(--rule); min-width: 0; max-width: 100%; }
.msg > .who { display: block; margin: 0; width: auto; }
.msg > * { min-width: 0; }
.msg .copy { max-width: 640px; font-size: 14px; line-height: 22px; min-width: 0; }
.msg .copy-body { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.msg .copy-body.md { white-space: normal; }
.md { overflow-wrap: break-word; white-space: normal; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md table { margin: 0 0 10px; }
.md p:last-child, .md ul:last-child, .md ol:last-child, .md blockquote:last-child, .md pre:last-child, .md table:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 12px 0 6px;
}
.md h1 { font-size: 28px; }
.md h2 { font-size: 22px; }
.md h3 { font-size: 18px; }
.md h4, .md h5, .md h6 { font-size: 16px; }
.md a { color: var(--verm); text-decoration: underline; text-underline-offset: 2px; }
.md a:not([href]) { color: inherit; text-decoration: none; pointer-events: none; }
.md strong { font-weight: 600; }
.md em { font-family: Newsreader, Georgia, serif; font-style: italic; }
.md code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; background: var(--paper2); padding: 0 4px; }
.md pre { background: var(--sheet); border: 1px solid var(--rule); padding: 12px 14px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
.md th, .md td { overflow-wrap: anywhere; }
.md pre code { background: none; padding: 0; font-size: 12px; line-height: 18px; }
.md ul, .md ol { padding-left: 18px; }
.md blockquote { border-left: 2px solid var(--rule); margin-left: 0; padding-left: 12px; }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: 12px 0; }
.md table { border-collapse: collapse; width: 100%; }
.md th, .md td { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px 12px 6px 0; text-align: left; vertical-align: top; font-weight: 400; }
.md th { font-weight: 500; }
.approval-copy { font-family: Newsreader, Georgia, serif; font-size: 20px; line-height: 28px; margin-top: 2px; }
.msg .when { text-align: right; padding-top: 2px; }
.msg .role { padding-left: 20px; line-height: 16px; }
.approval-block { margin-top: 12px; border-left: 2px solid var(--verm); padding: 4px 0 4px 16px; }
.approval-block h3 { font-size: 20px; line-height: 28px; margin-top: 2px; }
.composer {
  position: relative;
  width: 100%;
  flex: none;
  border-top: 2px solid var(--ink);
  padding: 12px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: transparent;
}
.composer textarea {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  min-height: 48px;
  max-height: 40vh;
  padding: 12px 0;
  font-family: "Inter Tight", sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}
.composer textarea::placeholder { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-hint { color: var(--mute); font-size: 12px; line-height: 16px; }
.composer-error { color: var(--verm); margin: 0; }
.composer .btn:disabled { opacity: 0.45; cursor: default; }
.mention-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% - 12px);
  z-index: 4;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--sheet);
  border: 1px solid var(--rule);
  max-height: 220px;
  overflow: auto;
}
.mention-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font: inherit;
  font-size: 14px;
}
.mention-menu button.on,
.mention-menu button:hover { background: var(--paper2); }
.rail { width: 300px; flex: none; border-left: 1px solid var(--rule); padding: 20px 24px; overflow: auto; }
.rail-fold > summary { display: none; }
.rail-fold .rail-body { display: block; }
.rail-body .hair { width: 100%; }
.rail-body td { white-space: normal; overflow-wrap: anywhere; }
.big { font-size: 34px; line-height: 40px; letter-spacing: -0.02em; }
.spark { width: 100%; height: 40px; margin-top: 4px; display: block; }

.stats { display: flex; gap: 0; padding: 24px 32px 20px; border-bottom: 1px solid var(--rule); }
.stat { padding-right: 32px; }
.stat + .stat { padding-left: 32px; border-left: 1px solid var(--rule); }
.stat .big { font-size: 34px; }
.work { display: flex; flex: 1; min-height: 0; }
.lanes { flex: 1; min-width: 0; position: relative; overflow: auto; }
.hours { display: flex; height: 32px; align-items: flex-end; padding-bottom: 4px; }
.hours .who { width: 180px; flex: none; margin: 0; padding: 0 24px; }
.hours .scale { flex: 1; display: flex; }
.hours .scale span { flex: 1; border-left: 1px solid var(--rule); padding-left: 6px; }
.lane { display: flex; border-top: 1px solid var(--rule); height: 84px; }
.lane .who { width: 180px; flex: none; padding: 12px 24px 0; margin: 0; display: block; }
.lane .trackpad { flex: 1; position: relative; }
.bar {
  position: absolute;
  top: 16px;
  height: 50px;
  border-left: 2px solid var(--rule);
  background: var(--paper2);
  padding: 4px 10px;
  overflow: hidden;
}
.bar.run { border-color: var(--ink); background: var(--lane); }
.bar.done { border-color: var(--moss); }
.bar.human { border-color: var(--verm); }
.bar .title { font-weight: 500; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .sub { display: flex; justify-content: space-between; font-size: 11.5px; line-height: 16px; }
.now {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--verm);
  pointer-events: none;
}
.now span { position: absolute; top: 4px; left: 6px; color: var(--verm); }
.feed { width: 320px; flex: none; border-left: 1px solid var(--rule); padding: 8px 24px; overflow: auto; }

.inbox { display: flex; flex: 1; min-height: 0; }
.inbox-list { width: 460px; flex: none; border-right: 1px solid var(--rule); overflow: auto; }
.inbox-list button.row {
  display: grid;
  grid-template-columns: 3px 1fr auto;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  padding: 0;
  color: inherit;
}
.inbox-list button.row.on { background: var(--paper2); }
.inbox-list button.row.on .edge { box-shadow: inset 2px 0 0 var(--verm); }
.inbox-list .body { padding: 12px 8px 12px 28px; }
.inbox-list .side { width: auto; height: auto; border: 0; position: static; padding: 12px 24px 12px 0; text-align: right; }
.detail { flex: 1; min-width: 0; padding: 32px 48px; overflow: auto; }
.detail h2 { font-size: 36px; line-height: 42px; letter-spacing: -0.02em; margin-top: 8px; max-width: 760px; }
.sheet { background: var(--sheet); border: 1px solid var(--rule); margin-top: 28px; }
.sheet .hero {
  min-height: 120px;
  padding: 28px;
  background: var(--paper2);
  border-bottom: 1px solid var(--rule);
}
.sheet .hero p, .sheet .prose { font-family: Newsreader, serif; font-size: 16px; line-height: 25px; padding: 20px 28px; }
.checks { width: 280px; }

.cal-wrap { padding: 20px 32px 32px; }
.cal {
  display: grid;
  grid-template-columns: 170px repeat(7, minmax(0, 1fr));
}
.cal-head, .cal-prop, .cal-cell { min-height: 0; }
.cal-head { padding: 0 12px 8px; border-left: 1px solid var(--rule); }
.cal-head .n { font-size: 22px; line-height: 24px; }
.cal-head.today, .cal-head.today .sc { color: var(--verm); }
.cal-prop { border-top: 1px solid var(--rule); padding: 12px 12px 12px 0; }
.cal-prop .serif { font-size: 17px; line-height: 20px; }
.cal-cell {
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  min-height: 148px;
  padding: 6px;
}
.cal-cell.today { background: color-mix(in srgb, var(--paper2) 70%, transparent); }
.cal-cell.drop { outline: 1px dashed rgba(26, 24, 20, 0.5); outline-offset: -4px; }
.cal-item { display: flex; gap: 6px; padding: 6px 4px; cursor: grab; touch-action: none; }
.cal-days { display: none; }
.cal-empty { margin: 0 0 8px; }
.cal-item.dragging { opacity: 0.55; }
.cal-item .grip { color: #b8b1a3; padding-top: 3px; }
.post-form { padding: 16px 32px 0; }

.staff { width: 330px; flex: none; border-right: 1px solid var(--rule); overflow: auto; padding-top: 16px; }
.staff button.person, .staff a.person {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  padding: 8px 24px 8px 24px;
  color: inherit;
  text-decoration: none;
}
.staff a.on { background: var(--paper2); box-shadow: inset 2px 0 0 var(--verm); }
.persona { flex: 1; min-width: 0; overflow: auto; padding: 32px 48px; }
.persona-head { display: flex; align-items: flex-end; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.persona-head h2 { font-size: 44px; line-height: 44px; letter-spacing: -0.02em; }
.quote { font-size: 17px; line-height: 26px; border-left: 2px solid var(--ink); padding-left: 16px; margin-top: 4px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 20px; }
.radio {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--mute);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: -1px;
}
.radio.on { border-color: var(--verm); background: var(--verm); box-shadow: inset 0 0 0 2px var(--paper); }
.model-row { display: contents; }
.model-pick {
  display: table-row;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
}
.models { width: 100%; }
.models button {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  width: 100%;
  background: none;
  border: 0;
  border-top: 1px solid var(--rule);
  padding: 8px 0;
  text-align: left;
}

.kpis { display: flex; padding: 24px 32px 20px; border-bottom: 1px solid var(--rule); }
.kpi { padding-right: 32px; }
.kpi + .kpi { padding-left: 32px; border-left: 1px solid var(--rule); }
.kpi .big { font-size: 38px; line-height: 44px; }
.chart { width: 100%; height: auto; display: block; }
.chart .tick { font-family: "JetBrains Mono", monospace; font-size: 10.5px; fill: #77716a; }
.chart .tick.ink { fill: #1a1814; font-family: "Inter Tight", sans-serif; font-size: 12px; }
.barline { height: 6px; background: var(--ink); }
.barline.low { background: var(--verm); }
.outcome-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 40px; padding: 20px 32px 0; }
.section-title { font-size: 20px; }

.switcher {
  position: fixed;
  left: 12px;
  top: 104px;
  z-index: 40;
  width: 340px;
  background: var(--sheet);
  border: 1px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.switcher .search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  color: var(--mute);
}
.switcher .search input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  outline: none;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#palette { max-height: min(70vh, 520px); overflow: auto; width: min(420px, calc(100vw - 24px)); }
#palette a.hit {
  height: auto;
  min-height: 40px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  text-decoration: none;
  color: inherit;
}
#palette a.hit .mute { font-size: 12px; }
.switcher button.org, .switcher a.org, .switcher .new-org {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  padding: 0 16px;
  gap: 8px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--rule);
  text-align: left;
}
.switcher button.org.on { background: var(--paper2); font-weight: 500; }
.switcher .key { width: 24px; color: var(--mute); }
.switcher .role { margin-left: auto; color: var(--mute); }

.login { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(320px, 640px); }
.login-hero { padding: 56px 64px; display: flex; flex-direction: column; border-right: 1px solid var(--rule); }
.login-hero h1 { font-size: clamp(56px, 6vw, 88px); line-height: 0.95; letter-spacing: -0.02em; max-width: 780px; margin-top: 12px; }
.login-hero em { font-style: italic; color: var(--verm); }
.login-hero .lede { font-size: 17px; line-height: 27px; color: var(--mute); margin-top: 24px; max-width: 520px; }
.steps { margin-top: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--rule); padding-top: 16px; }
.login-card { padding: 0 80px; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 36px; line-height: 42px; margin-top: 4px; }
.underline {
  height: 48px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  width: 100%;
  font-size: 18px;
  outline: none;
  border-radius: 0;
}
.send {
  height: 48px;
  margin-top: 24px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-weight: 500;
  font-size: 15px;
}
.sent { margin-top: 24px; border-left: 2px solid var(--moss); padding-left: 16px; color: var(--moss); }
.sent p { color: var(--mute); }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: start center; padding: 24px 16px; overflow: auto; }
.gate form, .gate .panel { width: min(480px, 100%); }
.gate .panel { width: min(720px, 100%); }
.gate #view { overflow: visible; display: block; height: auto; }
.review { width: 100%; min-width: 0; }
.review-studio { font-size: 22px; line-height: 1.2; margin: 0 0 4px; }
.review-studio .sc { margin-right: 8px; }
.review h2, .review h3, .review p, .review blockquote { overflow-wrap: anywhere; }
.review h2 { font-size: clamp(28px, 8vw, 40px); line-height: 1.15; margin: 8px 0; }
.review h3 { font-size: 22px; line-height: 1.3; margin: 4px 0 8px; }
.review-target { background: #f4e3b2; border-left-color: var(--verm, #b8321c); }
.review-empty { margin: 0; padding: 12px 14px; background: var(--paper2, #ece8dd); }
.review-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-actions .btn, .review-actions a.btn {
  min-height: 44px;
  height: auto;
  padding: 10px 16px;
  white-space: normal;
  justify-content: center;
}
.review-actions .btn.text { padding: 10px 16px; }
.review > a.btn { min-height: 44px; height: auto; padding: 10px 16px; }
@media (max-width: 640px) {
  .gate { padding: 12px; }
  .review-actions { flex-direction: column; }
  .review-actions .btn, .review-actions a.btn, .review > a.btn { width: 100%; }
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  background: var(--sheet);
  border: 1px solid var(--ink);
  padding: 8px 12px;
}
.error { color: var(--verm); padding: 24px 32px; }
.empty { color: var(--mute); padding: 8px 0; }
.note { color: var(--mute); }
.diff { font-family: "JetBrains Mono", monospace; font-size: 12px; white-space: pre-wrap; }
.secret { font-family: "JetBrains Mono", monospace; word-break: break-all; padding: 8px 0; }

.menu-btn { display: none; }
.demo-banner { background: var(--sheet); border-bottom: 1px solid var(--rule); padding: 8px 32px; color: var(--mute); }
.tester-banner { position: sticky; top: 0; z-index: 5; background: var(--sheet); border-bottom: 1px solid var(--ink); padding: 8px 32px; color: var(--ink); }
.tabs button { background: transparent; border: 0; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.tabs button.on { color: var(--ink); }

@media (max-width: 1100px) {
  .tester-banner { padding: 8px 16px; }
  .menu-btn { display: inline-flex; margin-left: 12px; }
  .side .org-btn, .side .nav, .side .campaigns, .side .side-foot { display: none; }
  .side.open .org-btn, .side.open .nav, .side.open .campaigns, .side.open .side-foot { display: block; }
  .stage { min-height: 100vh; }
  .cal { overflow-x: auto; }
  .login { grid-template-columns: 1fr; }
  .login-hero { border-right: 0; border-bottom: 1px solid var(--rule); min-height: auto; }
  .login-card { padding: 40px 32px 64px; }
  .steps { margin-top: 32px; }
  .feed { width: auto; max-width: 100%; border-left: 0; border-top: 1px solid var(--rule); }
  .inbox { flex-direction: column; }
  .inbox-list { width: auto; border-right: 0; border-bottom: 1px solid var(--rule); }
  .cols, .outcome-grid, .split, .intel-forms, .focus-grid, .variant-pair, .growth-weeks { grid-template-columns: 1fr; }
  .staff { width: 100%; border-right: 0; border-bottom: 1px solid var(--rule); }
  .split-page { flex-direction: column; overflow: auto; }
  .room, .work, .inbox { flex-direction: column; }
  .channels {
    width: auto;
    max-height: none;
    flex: none;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 0;
    overflow: visible;
  }
  .channels [data-section="channels"] {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
  }
  .channels .channel-label,
  .channels .channel-label-next { padding: 0 4px; white-space: nowrap; flex: none; }
  .channels .channel,
  .channels .direct,
  .channels .direct:has(.persona-mark) {
    width: auto;
    flex: none;
    height: 32px;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    white-space: nowrap;
    border: 1px solid var(--rule);
    border-radius: 999px;
  }
  .channels .note { flex: none; margin: 0; padding: 0 8px; white-space: nowrap; }
  .channels .empty-state { flex: none; border-top: 0; padding: 0 8px; max-width: none; }
  .channels .empty-state h2 { font-size: 14px; line-height: 32px; margin: 0; white-space: nowrap; }
  .channels .empty-copy { display: none; }
  .channels .thread-form,
  .channels .more-direct { position: relative; flex: none; margin: 0; }
  .channels .thread-form > summary,
  .channels .more-direct > summary { list-style: none; }
  .channels .thread-form[open] > form,
  .channels .more-direct[open] > button.direct {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 120px;
    z-index: 30;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 0;
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 8px 12px;
  }
  .channels .thread-form[open] > form {
    display: block;
    max-height: 60vh;
    overflow: auto;
    padding: 12px 16px 16px;
  }
  .top {
    height: auto;
    min-height: var(--top);
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 12px 8px;
    gap: 6px 12px;
    overflow: visible;
  }
  .top h1 { font-size: 22px; line-height: 28px; min-width: 0; flex: 1 1 100%; }
  .top .meta { min-width: 0; overflow-wrap: anywhere; }
  .top .actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; }
  .transcript { padding: 0 16px; flex: 1; min-height: 0; min-width: 0; max-width: 100%; }
  .room-tool { position: relative; flex: none; margin: 0; border-top: 1px solid var(--rule); }
  .room-tool summary { display: block; padding: 8px 0; }
  .room-tool > summary { position: relative; z-index: 32; background: var(--paper); }
  .room-tool[open] form {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    bottom: auto;
    z-index: 30;
    max-height: calc(100vh - 250px);
    overflow: auto;
    margin: 0;
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 16px 16px 24px;
  }
  .rail {
    display: block;
    width: auto;
    flex: none;
    max-height: none;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding: 0 16px;
    overflow: visible;
  }
  .rail-fold > summary {
    display: block;
    position: relative;
    z-index: 32;
    padding: 10px 0;
    cursor: pointer;
    white-space: nowrap;
    background: var(--paper);
  }
  .rail-fold:not([open]) .rail-body { display: none; }
  .rail-fold[open] .rail-body {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    bottom: 252px;
    z-index: 30;
    display: block;
    max-height: none;
    overflow: auto;
    background: var(--sheet);
    border: 1px solid var(--ink);
    padding: 16px 16px 28px;
  }
  .composer textarea { min-height: 48px; }
  .app:has([data-page="room"]) .brand { height: 44px; }
  .app:has([data-page="room"]) .top {
    height: 44px;
    min-height: 44px;
    flex-wrap: nowrap;
    padding: 0 12px;
    gap: 8px;
  }
  .app:has([data-page="room"]) .top h1 {
    flex: 1 1 auto;
    font-size: 18px;
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .app:has([data-page="room"]) .top .meta { display: none; }
  .app:has([data-page="room"]) .top .actions { flex-wrap: nowrap; }
  .app:has([data-page="room"]) .top:has(.thread-property) {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
  }
  .app:has([data-page="room"]) .thread-property { flex: 1 1 100%; order: 5; max-width: 100%; }
  .app:has([data-page="room"]) .channels [data-section="channels"] { padding: 4px 8px; }
  .app:has([data-page="room"]) .channels .channel,
  .app:has([data-page="room"]) .channels .direct,
  .app:has([data-page="room"]) .channels .direct:has(.persona-mark) {
    height: 28px;
    min-height: 28px;
  }
  .app:has([data-page="room"]) {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
  }
  .app:has([data-page="room"]) .stage { height: auto; min-height: 0; flex: 1; overflow: hidden; }
  .md table { table-layout: fixed; }
  .msg, .msg.buyer-msg { grid-template-columns: minmax(0, 1fr); width: 100%; gap: 8px; }
  .msg > :first-child:not(.copy):not(.when) { grid-column: 1; grid-row: 1; min-width: 0; padding-right: 4.75rem; }
  .msg > .copy { grid-column: 1; grid-row: 2; max-width: none; width: 100%; }
  .msg > .copy:first-child { grid-row: 1; }
  .msg > .when { grid-column: 1; grid-row: 1; justify-self: end; align-self: start; padding-top: 0; }
  .msg .copy pre, .msg .copy code { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }
  .persona-mark, .mark { max-width: 100%; min-width: 0; }
  .mark-name { min-width: 0; overflow-wrap: anywhere; }
  .activity { min-width: 0; }
  .cal { grid-template-columns: 120px repeat(7, minmax(0, 1fr)); }
  .side { display: flex; position: relative; height: auto; width: 100%; border-right: 0; border-bottom: 1px solid var(--rule); }
  .app { flex-direction: column; }
  .stage { height: auto; }
}
@media (max-width: 720px) {
  .app:has([data-page="room"]) .thread-property { flex-wrap: wrap; }
  .app:has([data-page="room"]) .thread-property-label { flex: 1 1 100%; white-space: normal; }
  .hair { table-layout: fixed; }
  .hair td, .hair th { overflow-wrap: anywhere; }
  .stats, .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px; }
  .stat, .kpi, .stat + .stat, .kpi + .kpi { min-width: 0; padding: 0; border-left: 0; }
  .stat .big, .kpi .big { font-size: 28px; line-height: 32px; overflow-wrap: anywhere; }
  .cal-wrap { padding: 12px 16px 24px; }
  .cal { display: none; }
  .cal-days { display: block; }
  .cal-day { border-top: 1px solid var(--rule); padding: 12px 0 4px; }
  .cal-day .cal-head { border-left: 0; padding: 0 0 8px; }
  .cal-days .cal-item { cursor: default; touch-action: manipulation; overflow-wrap: anywhere; }
  .cal-days .cal-item .btn { display: inline-flex; }
  .detail { padding: 16px; }
  .detail h2 { font-size: 28px; line-height: 32px; overflow-wrap: anywhere; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .checks { display: block; width: auto; max-width: 100%; }
  .persona { padding: 16px; }
  .persona-head h2 { font-size: 32px; line-height: 36px; overflow-wrap: anywhere; }
}

.suggest-page { padding: 8px 32px 48px; }
.suggest-card { border-top: 1px solid var(--rule); padding: 22px 0 8px; }
.suggest-card h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; font-weight: 400; margin-top: 4px; }
.suggest-card .artifact.md, .artifact.md { white-space: normal; }
.suggest-card .artifact, .suggest-card textarea.artifact-edit {
  background: var(--sheet);
  border: 1px solid var(--rule);
  padding: 16px 18px;
  margin: 12px 0;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 22px;
  max-width: 720px;
}
.suggest-card textarea.artifact-edit { width: 100%; max-width: 720px; min-height: 96px; resize: vertical; }
.suggest-card .evidence { display: flex; flex-wrap: wrap; gap: 8px 18px; max-width: 720px; }
.suggest-card .evidence a { color: var(--ink); }
.suggest-card .alts { margin-top: 14px; max-width: 720px; }
.suggest-card .alt { border-left: 2px solid var(--rule); padding: 2px 0 8px 12px; margin-top: 8px; }
.suggest-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.feedback-line { display: flex; gap: 8px; align-items: center; margin-top: 10px; max-width: 720px; }
.feedback-line input { width: 280px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; padding: 6px 0; outline: none; }
.cadence { display: flex; align-items: center; gap: 8px; }
.cadence input { width: 48px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; text-align: right; outline: none; }

.focus-page { padding: 4px 32px 48px; }
.focus-grid { display: grid; grid-template-columns: 1.35fr 0.75fr; gap: 36px; align-items: start; }
.focus-page h2 { font-size: 32px; line-height: 36px; letter-spacing: -0.02em; margin-top: 4px; }
.focus-summary { margin: 10px 0 16px; max-width: 68ch; }
.variant-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.variant { background: var(--sheet); border: 1px solid var(--rule); padding: 12px 14px; }
.variant.win { border-color: var(--ink); }
.variant p { margin-top: 8px; }
.focus-score { font-size: 36px; line-height: 1; letter-spacing: -0.03em; }
.focus-split { margin-top: 16px; }
.revisions { margin: 6px 0 12px; padding-left: 18px; max-width: 68ch; }
.revisions li { margin: 2px 0; }
.panel-line { display: flex; gap: 10px; align-items: baseline; margin: 10px 0; max-width: 720px; }
.panel-line a { color: inherit; text-decoration: none; }
.panel-line .mute { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.focus-gate { margin-top: 12px; }
.focus-lower { margin-top: 8px; }
.focus-library { margin-top: 0; }
.focus-fold { margin-top: 12px; }
.focus-fold summary { cursor: pointer; color: var(--mute); }
.buyer-form { display: grid; gap: 8px; max-width: 520px; margin-top: 10px; }
.buyer-form .check { display: flex; gap: 8px; align-items: center; }
.room-tool { margin: 0 0 12px; }
.room-tool summary { cursor: pointer; }
.room-tool form { margin-top: 10px; }
.consensus-card { display: grid; gap: 8px; margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--rule); }
.consensus-card pre, .consensus-card ol { margin: 0; }
.consensus-card pre { white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px; line-height: 18px; }
.asset-card { margin: 12px 0 0; }
.asset-card img, .asset-card video { display: block; width: 100%; height: auto; object-fit: cover; background: var(--sheet); }
.video-progress { display: grid; gap: 8px; margin: 12px 0 0; max-width: 320px; }
.video-stage, .still-stage { position: relative; width: 100%; background: var(--sheet); overflow: hidden; }
.video-stage { max-width: 280px; }
.video-stage[data-aspect="16:9"] { aspect-ratio: 16 / 9; max-width: 420px; }
.video-stage[data-aspect="9:16"], .video-stage:not([data-aspect]) { aspect-ratio: 9 / 16; }
.video-stage[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.still-stage { width: 160px; }
.still-stage[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.still-stage[data-aspect="9:16"] { aspect-ratio: 9 / 16; }
.still-stage[data-aspect="16:9"] { aspect-ratio: 16 / 9; width: 220px; }
.still-stage[data-aspect="4:5"] { aspect-ratio: 4 / 5; }
.video-stage video, .video-stage img, .still-stage img, .video-skeleton, .still-skeleton, .still-ready {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--sheet);
}
.video-skeleton, .still-skeleton { background: var(--paper2); }
.still-ready { display: grid; place-items: center; background: var(--paper2); }
.video-badge { position: absolute; left: 8px; bottom: 8px; z-index: 1; background: var(--paper); border: 1px solid var(--rule); padding: 2px 6px; font-size: 12px; }
.media-duration { position: absolute; right: 8px; bottom: 8px; z-index: 2; font-size: 12px; letter-spacing: 0.02em; background: var(--paper); border: 1px solid var(--rule); padding: 2px 6px; pointer-events: none; }
.media-duration[hidden] { display: none; }
video:not(.has-duration)::-webkit-media-controls-current-time-display,
video:not(.has-duration)::-webkit-media-controls-time-remaining-display { display: none; }
.asset-card img.end-card, img.end-card, .logo-end-card img { display: block; width: auto; max-width: min(100%, 280px); height: auto; max-height: 160px; object-fit: contain; margin-top: 8px; }
.logo-end-card { display: block; max-width: min(100%, 280px); }
.end-card-cta { margin: 8px 0 0; max-width: min(100%, 280px); font-weight: 600; }
.video-details { margin-top: 4px; }
.video-details pre { white-space: pre-wrap; overflow-wrap: break-word; font-size: 12px; }
.pack-pieces { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.still-card { margin: 0; }
@media (max-width: 420px) {
  .video-progress, .video-stage, .still-stage { max-width: 100%; }
  .still-stage { width: 46%; }
}
@media (max-width: 1100px) {
  .msg .video-progress,
  .msg .video-stage,
  .msg .asset-card .video-stage,
  .msg .asset-card .still-stage {
    width: 100%;
    max-width: 100%;
  }
}
.asset-card figcaption { display: grid; gap: 6px; margin-top: 8px; }
.asset-card pre { white-space: pre-wrap; overflow-wrap: break-word; margin: 8px 0 0; font-size: 12px; line-height: 18px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.gallery-import { margin-top: 28px; }
.gallery-import > summary { width: fit-content; cursor: pointer; list-style: none; }
.gallery-import > summary::-webkit-details-marker { display: none; }

.front-pref, .front-composer { display: grid; gap: 12px; max-width: 640px; margin: 8px 0 20px; }
.front-log { display: grid; gap: 12px; max-width: 640px; }
.front-msg { padding: 12px 14px; border: 1px solid #3a3328; }
.front-msg p { margin: 0; white-space: pre-wrap; }
.front-msg .lbl { margin-bottom: 6px; }

.connect-page { padding: 8px 32px 48px; max-width: 1080px; }
.connect-lead, .connect-empty { color: var(--mute); margin: 0 0 18px; }
.connect-section { margin-top: 8px; }
.connect-section h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.02em; font-weight: 400; margin: 18px 0 12px; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 28px; }
.connect-card { border-top: 1px solid var(--rule); padding: 14px 0 8px; min-width: 0; }
.connect-card h3 { font-size: 26px; line-height: 30px; letter-spacing: -0.02em; font-weight: 400; margin: 6px 0; }
.connect-card p { overflow-wrap: anywhere; margin: 0 0 8px; }
.connect-kicker { min-height: 18px; }
.connect-error { color: var(--verm); }
.connect-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.connect-owner { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.connect-owner select { background: transparent; border: 0; border-bottom: 1px solid var(--rule); padding: 4px 0; max-width: 100%; }
.connect-card .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.skills-page { padding: 8px 32px 48px; max-width: 800px; }
.skill-families { margin: 8px 0 18px; padding-left: 18px; }
.skill-card textarea { width: 100%; min-height: 140px; border: 1px solid var(--rule); background: var(--sheet); padding: 12px; resize: vertical; }
@media (max-width: 720px) {
  .skills-page { padding: 4px 16px 32px; }
}
@media (max-width: 720px) {
  .connect-page { padding: 4px 16px 32px; }
  .connect-grid { grid-template-columns: 1fr; }
  .connect-section h2 { font-size: 22px; line-height: 28px; }
  .connect-card h3 { font-size: 22px; line-height: 26px; }
}
.gallery .asset-card { margin: 0; border-top: 1px solid var(--rule); padding-top: 12px; }

.skeleton { display: grid; gap: 14px; padding: 8px 0 24px; }
.skeleton-row { height: 18px; background: var(--paper2); border-top: 1px solid var(--rule); }
.skeleton-row:nth-child(odd) { width: 92%; }
.skeleton-row:nth-child(even) { width: 70%; }
.skeleton[data-kind="cards"] .skeleton-row,
.skeleton[data-kind="gallery"] .skeleton-row,
.skeleton[data-kind="panel"] .skeleton-row { height: 72px; width: 100%; background: var(--sheet); }
.skeleton[data-kind="thread"] .skeleton-row { height: 36px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton-row { animation: skeleton-pulse 1.6s ease-in-out infinite; }
}
@keyframes skeleton-pulse { 50% { background: var(--sheet); } }

.empty-state { border-top: 1px solid var(--ink); padding: 28px 0 8px; max-width: 42rem; }
.empty-state h2 { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; margin: 6px 0 8px; }
.empty-copy { color: var(--mute); max-width: 40ch; margin: 0 0 16px; }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-error { border-top: 1px solid var(--verm); padding: 16px 0; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.section-error p { margin: 0; font-size: 22px; }

.property-page { padding: 8px 32px 48px; }
.property-link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.persona-tools { display: grid; gap: 12px; margin: 8px 0 4px; }
.persona-search { max-width: 280px; }
.disc-filter, .persona-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.disc-badge { font-variant: small-caps; letter-spacing: 0.08em; border: 1px solid var(--ink); min-width: 28px; height: 28px; display: inline-grid; place-items: center; font-size: 13px; }
.persona-row { width: 100%; display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--rule); padding: 14px 4px; cursor: pointer; color: inherit; font: inherit; }
.persona-row.on { background: var(--sheet); }
.persona-editor, .persona-editor-wrap { border-top: 1px solid var(--ink); margin-top: 20px; padding-top: 16px; }
.form-error { color: var(--verm); margin: 8px 0; }
.form-error[hidden] { display: none; }
.disc-scores { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.disc-scores input { width: 52px; }
.chapters { display: grid; gap: 8px; }

.story-page { padding: 8px 32px 64px; max-width: 46rem; }
.story-search { max-width: 360px; margin-bottom: 8px; }
.story-sheet { border-top: 1px solid var(--ink); padding: 28px 0 8px; min-width: 0; }
.story-sheet h2 { font-size: 40px; line-height: 44px; letter-spacing: -0.03em; font-weight: 400; margin: 4px 0 8px; overflow-wrap: anywhere; }
.story-jump { margin: 0 0 8px; }
.story-jump a { color: inherit; }
.story-incomplete { color: var(--verm); margin: 0 0 12px; }
.story-identity { margin: 0 0 16px; max-width: 420px; }
.disc-assignment { margin: 0 0 20px; max-width: 720px; }
.disc-assignment ul { list-style: none; margin: 8px 0 0; padding: 0; }
.disc-assignment li { margin: 8px 0; }
.disc-balance { margin: 8px 0 0; }
.story-triggers { margin: 0; padding-left: 1.2rem; list-style: disc; }
.story-triggers li { margin: 4px 0; }
.story-field { border-top: 1px solid var(--rule); padding: 14px 0 4px; min-width: 0; }
.story-value, .story-prose { margin: 6px 0 0; overflow-wrap: anywhere; }
.story-prose { font-family: Newsreader, Georgia, serif; font-size: 21px; line-height: 32px; white-space: pre-wrap; }
.story-chapter { font-family: Newsreader, Georgia, serif; font-weight: 400; font-size: 22px; line-height: 28px; margin: 16px 0 0; overflow-wrap: anywhere; }
.story-prior { margin-top: 28px; padding-top: 8px; border-top: 1px solid var(--ink); }
.story-lock { border-top: 1px solid var(--rule); margin-top: 16px; padding-top: 8px; }
.story-lock .btn { margin-top: 12px; }

@media (max-width: 720px) {
  .story-page { padding: 8px 16px 48px; }
  .story-sheet h2 { font-size: 32px; line-height: 36px; }
  .story-prose { font-size: 18px; line-height: 28px; }
}
/* panel62: at 390 the tester banner, tools and a four-line composer left the thread a sliver. */
@media (max-width: 720px) {
  .app:has([data-page="room"]) .tester-banner {
    padding: 4px 12px;
    font-size: 12px;
    line-height: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .app:has([data-page="room"]) .channels { flex: none; max-height: 48px; }
  .app:has([data-page="room"]) .transcript { flex: 1 1 auto; }
  .app:has([data-page="room"]) .room-tool summary { padding: 4px 0; }
  .app:has([data-page="room"]) .composer { padding: 6px 0 8px; gap: 4px; }
  .app:has([data-page="room"]) .composer textarea { min-height: 48px; height: 48px; max-height: 30vh; padding: 4px 0; }
}

/* Lightbox and share dialog: paper sheet over an ink scrim. */
dialog.lightbox { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); padding: 0; width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; }
dialog.lightbox[data-kind="share"] { width: min(560px, calc(100vw - 32px)); }
dialog.lightbox::backdrop { background: rgba(26, 24, 20, 0.72); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.lightbox-nav, .lightbox-tools { display: flex; align-items: center; gap: 8px; }
.lightbox-stage { display: grid; place-items: center; padding: 16px; min-height: 240px; background: var(--paper2); }
.lightbox-stage > * { grid-area: 1 / 1; }
.lightbox-stage[data-state="loading"] .lightbox-media { visibility: hidden; }
.lightbox-stage:not([data-state="loading"]) .skeleton { display: none; }
.lightbox-stage .skeleton { width: 100%; }
.lightbox-stage[data-state="error"] .lightbox-media { display: none; }
.lightbox-media { max-width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; display: block; }
.still-stage img[data-action="lightbox"] { cursor: zoom-in; }
.asset-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-dialog > :not(.lightbox-bar) { margin: 16px; }
.share-fresh input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--rule); background: var(--paper); margin: 6px 0 8px; }
.share-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.share-dialog > table.share-links { width: calc(100% - 32px); }
.share-links td { padding: 8px 6px; border-top: 1px solid var(--rule); }

/* One-on-one persona chat. */
.pchat { border-top: 1px solid var(--rule); margin-top: 32px; padding-top: 20px; max-width: 760px; }
.pchat-head h2 { font-size: 24px; line-height: 30px; margin: 2px 0 12px; }
.pchat-log { display: grid; gap: 12px; max-height: 460px; overflow-y: auto; padding-bottom: 8px; }
.pchat-turn { border-left: 2px solid var(--rule); padding: 4px 0 4px 12px; }
.pchat-turn[data-role="persona"] { border-left-color: var(--ink); }
.pchat-turn p { white-space: pre-wrap; overflow-wrap: anywhere; }
.pchat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; margin-top: 12px; }
.pchat-form textarea { width: 100%; min-height: 48px; resize: vertical; padding: 8px 10px; border: 1px solid var(--rule); background: var(--sheet); }
@media (max-width: 420px) {
  .pchat-form { grid-template-columns: 1fr; }
  .lightbox-bar { padding: 10px 12px; }
  .lightbox-stage { padding: 8px; }
}

/* Public share landing page. */
.share-body { background: var(--paper); }
.share-page { max-width: 880px; margin: 0 auto; padding: 40px 24px 64px; }
.share-head { border-bottom: 1px solid var(--rule); padding-bottom: 16px; margin-bottom: 24px; }
.share-head h1 { font-size: 36px; line-height: 42px; margin-top: 6px; overflow-wrap: anywhere; }
.share-figure { margin: 0; }
.share-media { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; background: var(--paper2); }
.share-figure figcaption { margin-top: 12px; }
.share-section { border-top: 1px solid var(--rule); padding: 12px 0; }
.share-section ul { margin: 4px 0 0; padding-left: 18px; }
.share-foot { margin-top: 32px; border-top: 1px solid var(--rule); padding-top: 12px; }
@media (max-width: 420px) {
  .share-page { padding: 24px 16px 48px; }
  .share-head h1 { font-size: 28px; line-height: 34px; }
}

/* Approval modes */
.grant-note { margin-top: 6px; font-size: 12px; }
.grant-note a { color: inherit; text-decoration: underline; }
.grants { max-width: 960px; }
.grant-table { overflow-x: auto; margin-top: 16px; }
.grant-table table { width: 100%; min-width: 0; }
.grant-table td { vertical-align: top; padding: 10px 8px; overflow-wrap: anywhere; }
.creative-modes { margin-top: 8px; }
@media (max-width: 420px) {
  .approval-actions .btn { flex: 1 1 100%; justify-content: center; }
  .grant-table tr:not(.sc) { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 0; border-bottom: 1px solid var(--hair, #d9d2c3); }
  .grant-table tr.sc { display: none; }
  .grant-table td { padding: 0; }
  .grant-table td:first-child { grid-column: 1 / -1; }
}

/* Intel feed errors */
.feed-health { margin: 16px 32px 0; padding: 12px 16px; border: 1px solid var(--rule, #d8d2c4); border-left: 3px solid var(--rust, #b5542c); background: var(--paper, #fbf8f1); }
.feed-health ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.feed-health .feed-error { overflow-wrap: anywhere; line-height: 1.4; }
@media (max-width: 420px) { .feed-health { margin: 12px 16px 0; padding: 10px 12px; } }
/* Incidents */
.incidents { max-width: 960px; }
.incidents-intro { margin: 0 0 16px; max-width: 70ch; }
.incidents-clear { margin: 8px 0 20px; font-size: 20px; }
.incident-group { margin: 24px 0 0; }
.incident-list { display: grid; gap: 12px; margin-top: 10px; }
.incident { border: 1px solid var(--rule, #d8d2c4); background: var(--paper, #fbf8f1); padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.incident[data-state="needs"] { border-left: 3px solid var(--rust, #b5542c); }
.incident[data-state="resolved"] { opacity: 0.8; }
.incident-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.incident-head h3 { margin: 2px 0 0; font-size: 20px; }
.incident-tag { flex: none; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 8px; border: 1px solid currentColor; }
.incident-tag.needs { color: var(--rust, #b5542c); }
.incident-tag.fixing { color: var(--ink-2, #6b6457); }
.incident-tag.ok { color: var(--moss, #4f6b3a); }
.incident-diagnosis { margin: 8px 0 4px; line-height: 1.45; }
.incident-evidence, .incident-actions, .stale-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.incident details summary { cursor: pointer; margin-top: 6px; font-size: 13px; }
.incident-action { font-weight: 600; }
.incident-buttons { margin-top: 8px; display: flex; justify-content: flex-end; }
.feed-calls { overflow-x: auto; margin-top: 10px; }
.feed-calls table { width: 100%; }
.feed-calls td { padding: 6px 8px; overflow-wrap: anywhere; }
.feed-calls td.bad { color: var(--rust, #b5542c); }
@media (max-width: 420px) {
  .incident { padding: 12px; }
  .incident-head h3 { font-size: 18px; }
  .feed-calls td { padding: 6px 4px; }
}
/* Signals */
.signals { max-width: 960px; }
.signals-intro { margin: 0 0 16px; max-width: 72ch; }
.signals-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.scout-sources { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.scout-source { border: 1px solid var(--rule, #d8d2c4); padding: 10px 12px; background: var(--paper, #fbf8f1); min-width: 0; overflow-wrap: anywhere; display: grid; gap: 4px; }
.scout-source[data-state="error"] { border-left: 3px solid var(--rust, #b5542c); }
.scout-state { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2, #6b6457); margin-left: 6px; }
.signal-group { margin-top: 24px; }
.signal-list { display: grid; gap: 12px; margin-top: 10px; }
.signal, .plan-update { border: 1px solid var(--rule, #d8d2c4); background: var(--paper, #fbf8f1); padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.signal[data-strong="1"], .plan-update[data-status="suggested"] { border-left: 3px solid var(--rust, #b5542c); }
.signal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.signal-head h3, .plan-update h3 { margin: 2px 0 0; font-size: 19px; }
.signal-tag { flex: none; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border: 1px solid currentColor; color: var(--ink-2, #6b6457); }
.signal-tag.strong { color: var(--rust, #b5542c); }
.signal-detail { margin: 8px 0; line-height: 1.45; }
.signal-score { display: flex; align-items: center; gap: 10px; }
.signal-score .bar { position: relative; flex: 1; max-width: 320px; height: 6px; background: var(--rule, #d8d2c4); }
.signal-score .bar span { position: absolute; inset: 0 auto 0 0; background: var(--ink, #2a2722); }
.signal-score .bar i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--rust, #b5542c); }
.signal-parts { margin: 6px 0 0; font-size: 12px; }
.signal-discussion, .signal-thresholds { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.signal-discussion .persona { font-weight: 600; }
.signal details summary { cursor: pointer; margin-top: 6px; font-size: 13px; }
.signal-buttons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 420px) {
  .signal, .plan-update { padding: 12px; }
  .signal-head h3, .plan-update h3 { font-size: 17px; }
  .scout-sources { grid-template-columns: 1fr; }
}

/* Agent limits */
.agent-limits { max-width: 860px; }
.limits-intro { margin: 0 0 16px; max-width: 72ch; }
.limit-list { display: flex; flex-direction: column; gap: 12px; }
.limit-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--line, #ddd); border-radius: 10px; min-width: 0; }
.limit-text { min-width: 0; flex: 1 1 auto; }
.limit-text p { margin: 4px 0; overflow-wrap: anywhere; }
.limit-control { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.limit-input { width: 88px; }
.limit-usage { font-size: 12px; text-align: right; max-width: 180px; }
.limit-actions { display: flex; justify-content: flex-end; }
@media (max-width: 600px) {
  .limit-row { flex-direction: column; }
  .limit-control { align-items: flex-start; }
  .limit-usage { text-align: left; max-width: none; }
}

/* Panel run history */
.panel-runs { margin: 24px 0 0; }
.panel-run-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.panel-run { border-top: 1px solid var(--rule, #d8d0c0); padding: 12px 0 0; min-width: 0; }
.panel-run-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.panel-run-line, .panel-run-steer { margin: 6px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.panel-run-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: flex-start; }
.panel-steer { flex: 1 1 260px; min-width: 0; }
.panel-steer summary { list-style: none; display: inline-block; cursor: pointer; }
.panel-steer summary::-webkit-details-marker { display: none; }
.panel-steer form { display: grid; gap: 8px; margin-top: 8px; }
.panel-steer textarea { width: 100%; box-sizing: border-box; font: inherit; }

/* Channel controls: create, rename, delete (archive). */
.channel-row { display: flex; align-items: center; position: relative; }
.channel-row .channel { flex: 1; min-width: 0; }
.channel-row .channel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.channel-default { margin-left: 6px; font-size: 10px; color: var(--mute); }
.channel-manage { flex: none; }
.channel-manage > summary { list-style: none; cursor: pointer; padding: 4px 12px; color: var(--mute); min-width: 32px; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.channel-manage > summary::-webkit-details-marker { display: none; }
.channel-manage[open] > summary { color: var(--ink); }
.channel-manage-body { position: absolute; left: 12px; right: 12px; top: 100%; z-index: 20; background: var(--paper); border: 1px solid var(--rule); padding: 12px; display: grid; gap: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.channel-edit { display: grid; gap: 8px; }
.channel-edit input { width: 100%; box-sizing: border-box; }
.channel-delete { border-top: 1px solid var(--rule); padding-top: 12px; }
.channel-error { color: #9b2c1f; font-size: 13px; margin: 0; }
.channel-note { margin: 0; }
.btn.danger { color: #9b2c1f; border-color: #9b2c1f; }
.btn.danger:disabled { opacity: .45; cursor: not-allowed; }
.channel-sheet-head { display: none; }
@media (max-width: 720px) {
  /* Bottom sheet: fixed to the viewport so the channel strip and transcript cannot clip it. */
  .channel-manage[open]::before { content: ""; position: fixed; inset: 0; background: rgba(20, 18, 14, .32); z-index: 900; }
  .channel-manage-body { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 901; max-height: 85vh; overflow-y: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-width: 1px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.16); box-sizing: border-box; }
  .channels .channel-manage-body, .channels .channel-manage-body .channel-edit { grid-template-columns: minmax(0, 1fr); }
  .channels .channel-manage-body .note { white-space: normal; padding: 0; }
  .channel-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .channel-sheet-head .sc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}
.channels .thread-form form, .channels .channel-edit { display: grid; gap: 8px; }
.channels .thread-form .field, .channels .channel-edit .field { display: grid; gap: 4px; min-width: 0; }
.channels .thread-form input, .channels .thread-form select { width: 100%; box-sizing: border-box; min-width: 0; }
.channels .thread-form .btn, .channels .channel-edit .btn { justify-self: start; max-width: 100%; }
.channels .empty-state, .channels .section-error { padding-left: 16px; padding-right: 16px; box-sizing: border-box; max-width: 100%; }
.channels .empty-state .btn, .channels .section-error .btn { max-width: 100%; }
.channels .section-error { flex-wrap: wrap; }
.channels .section-error p { font-size: 17px; overflow-wrap: anywhere; min-width: 0; }

/* Weekly digest settings */
.digest-settings { margin-top: 32px; border-top: 1px solid var(--rule); padding-top: 16px; max-width: 720px; }
.digest-form { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 12px 0; }
.digest-form .field { display: grid; gap: 4px; min-width: 0; }
.digest-form select { width: 100%; max-width: 280px; box-sizing: border-box; }
.digest-toggle { display: flex; gap: 8px; align-items: center; }
.digest-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.digest-sample { margin-top: 12px; border: 1px solid var(--rule); padding: 12px 16px; background: var(--paper); overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto; }

/* Channel list header: Channels label and an obvious + New channel button, first in the column and the phone strip. */
.channel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 6px 20px; }
.channel-head .channel-label { padding: 0; }
.channel-new { flex: none; min-height: 28px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.channel-create { margin: 0 12px 10px; padding: 12px; border: 1px solid var(--ink); background: var(--sheet); display: grid; gap: 8px; }
.channel-create[hidden] { display: none; }
.channel-create .field input, .channel-create .field select { width: 100%; min-width: 0; }
.channel-create [aria-invalid="true"] { border-color: var(--danger, #a33); }
.channel-create-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .channels .channel-head { flex: none; padding: 0; gap: 6px; }
  .channels .channel-new { min-height: 32px; border-radius: 999px; }
  .channels .channel-create:not([hidden]) {
    position: fixed; left: 12px; right: 12px; top: 120px; z-index: 30; margin: 0;
    max-height: 60vh; overflow: auto; white-space: normal; padding: 12px 16px 16px;
  }
}

/* Attention rows expand inline into a paper box with the full text, context, and actions. */
.room-work-item + .room-work-item, .room-work-item + .room-work-line, .room-work-line + .room-work-item { margin-top: 2px; }
.room-work-item > .room-work-line { cursor: pointer; }
.room-work-item > .room-work-line:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.room-work-item.is-open > .room-work-line .task { white-space: normal; }
.room-work-open { flex: none; font-size: 12px; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.room-work-detail { margin: 0 0 6px; padding: 12px 14px; background: var(--sheet); border: 1px solid var(--rule); border-left: 2px solid var(--verm); }
.room-work-full { margin: 0 0 8px; font-size: 15px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.room-work-context { margin: 0 0 10px; font-size: 12px; letter-spacing: 0.06em; overflow-wrap: anywhere; }
.room-work-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.room-work-actions textarea { flex: 1 1 100%; min-width: 0; box-sizing: border-box; font: inherit; padding: 8px; background: var(--paper); border: 1px solid var(--rule); resize: vertical; }
.room-work-edit { flex: 1 1 100%; display: grid; gap: 4px; }
.room-work-choices { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; }
.room-work-error { margin: 8px 0 0; font-size: 13px; }
.room-work-hint { margin: 0; font-size: 13px; }
@media (max-width: 480px) {
  .room-work-detail { padding: 10px; }
  .room-work-actions .btn { flex: 1 1 auto; }
}

.try-v2 { display: block; padding: 10px 20px; border-top: 1px solid var(--rule); color: var(--verm); text-decoration: none; font-weight: 500; }

/* Narrow screens: long URLs, emails, and slugs wrap; rows and controls fit the width. */
body { overflow-wrap: anywhere; }
.mono, .hair td, .hair th, a { overflow-wrap: anywhere; word-break: break-word; }
.brand-logo-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
.brand-logo-upload input[type="file"] { min-width: 0; max-width: 100%; }
@media (max-width: 480px) {
  .hair { table-layout: fixed; }
  .hours, .hours .scale { min-width: 0; overflow: hidden; }
  .hours .scale span { min-width: 0; padding-left: 2px; font-size: 10px; }
  .status { white-space: normal; }
}
.split > * { min-width: 0; }
.lane .trackpad { overflow: hidden; }
.bar .sub { min-width: 0; overflow: hidden; }
#invite-form { flex-wrap: wrap; }
#invite-form input { min-width: 0; }
@media (max-width: 480px) {
  :root { --who-w: 96px; }
  .lane .who { width: var(--who-w); padding: 12px 8px 0; }
  .hours .who { width: var(--who-w); padding: 0 8px; }
  .bar .sub .mono { display: none; }
}
.now.late span { left: auto; right: 6px; }

/* Board at ≤480: the now clock stays on one line (overflow-wrap:anywhere was stacking
   "23:41" inside the 1px .now containing block), and task bars keep a single-line subrow
   so overflow:hidden does not clip the card. */
.now span { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.bar .title, .bar .sub, .bar .status, .bar .mono { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.lane .who .sc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; word-break: normal; }

/* Before 09 / after 18 the line pins to an edge — hide the clock so it does not cover hour labels. */
.now.off-scale span { display: none; }
.now.early:not(.off-scale) span { left: 6px; right: auto; }

/* Narrow task bars: status ellipsizes; under ~96px it hides so "• Done" does not become "• Do". */
.bar { container-type: inline-size; }
.bar .sub { gap: 4px; overflow: hidden; }
.bar .status {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@container (max-width: 96px) {
  .status { display: none; }
}

.reply-block { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; min-width: 0; }
.reply-kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute, #6b655d); }
.reply-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; }
.reply-meta a { overflow-wrap: anywhere; }
.reply-original { margin: 0; padding: 12px 14px; background: var(--paper2, #ece8dd); border-left: 3px solid var(--ink, #1a1814); white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-original.review-target { background: #f4e3b2; border-left-color: var(--verm, #b8321c); }
.reply-draft { width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; background: var(--sheet, #fbfaf6); color: inherit; border: 1px solid var(--ink, #1a1814); }
.reply-status, .reply-note { color: var(--verm-ink, #b8321c); }
.reply-quiet { color: var(--mute, #6b655d); }
.reply-context { border-top: 1px solid var(--rule, #d6d0c2); padding-top: 8px; }
.reply-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.reply-acts .btn, .reply-acts a.btn, .room-work-actions .btn, .room-work-actions a.btn { min-height: 44px; height: auto; }

/* Phone: the menu overlays the room instead of pushing it down, and the week is a day list. */
@media (max-width: 1100px) {
  .side.open {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 100%);
    height: 100vh;
    height: 100dvh;
    z-index: 40;
    background: var(--paper);
    overflow: auto;
    border-right: 1px solid var(--rule);
  }
}
@media (max-width: 900px) {
  .cal { display: none; }
  .cal-days { display: block; }
  .cal-wrap { padding: 12px 16px 24px; overflow-x: hidden; }
}
