/* Art direction: a producer's office at dusk. Walnut and ivory, one brass control
   colour, and the people carry the only vivid hues. The portraits are the interface.
   Square-ish, calm, no shadows. Five places, one rail. */
:root {
  --walnut: #221D19;
  --walnut-2: #2A2420;
  --walnut-3: #332C27;
  --ivory: #F1ECE2;
  --ivory-2: #D8D1C5;
  --smoke: #9A9087;
  --smoke-2: #6B635B;
  --brass: #C8A56B;
  --brass-2: #E0BE85;
  --line: rgba(241, 236, 226, 0.08);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--walnut); color: var(--ivory); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
img { display: block; }
h2, h3 { margin: 0; }

.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100vh; }

/* ---- rail ---- */
.rail { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--walnut-2); overflow: hidden; }
.rail-head { padding: 22px 22px 14px; }
.lockup { display: flex; align-items: center; gap: 10px; color: var(--ivory); }
.lockup-mark { width: 20px; height: 20px; flex: none; }
.lockup-word { font-family: Archivo, "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; }
.product-name { font-family: var(--sans); font-weight: 500; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--brass); margin: 10px 0 0; }

.nav { display: flex; flex-direction: column; padding: 4px 12px; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; background: transparent; border: 0; border-radius: 8px; padding: 9px 12px; color: var(--ivory-2); text-align: left; font-size: 14.5px; }
.nav-item svg { width: 18px; height: 18px; fill: currentColor; opacity: .75; flex: none; }
.nav-item:hover { background: rgba(241, 236, 226, 0.05); color: var(--ivory); }
.nav-item.is-current { background: rgba(200, 165, 107, 0.12); color: var(--ivory); }
.nav-item.is-current svg { opacity: 1; color: var(--brass-2); }
.nav-badge { margin-left: auto; font-size: 11.5px; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--brass); color: #221D19; font-weight: 500; }
.nav-live { margin-left: auto; font-size: 11px; color: var(--brass-2); letter-spacing: .06em; text-transform: uppercase; }
.nav-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brass-2); margin-right: 6px; vertical-align: 1px; animation: breathe 1.4s ease-in-out infinite; }
.rail-sub { margin: 10px 24px 0; font-size: 12.5px; color: var(--smoke); }

.threads { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; border-top: 1px solid var(--line); }
.member { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 10px; border-radius: 8px; transition: background 160ms ease, opacity 200ms ease; }
.member:hover { background: rgba(241, 236, 226, 0.04); }
.member.is-active { background: rgba(200, 165, 107, 0.1); }
.member-text { display: flex; flex-direction: column; min-width: 0; }
.member-name { font-family: var(--serif); font-size: 18px; line-height: 1.1; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-title { font-size: 12px; color: var(--smoke); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-status { color: var(--c); }
.member-fresh { color: var(--ivory); font-style: italic; }
.member-unread { margin-left: auto; flex: none; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--brass); color: #221D19; font-size: 11.5px; font-weight: 500; }
.member.has-unread .member-name { color: var(--ivory); font-weight: 500; }
.from-list { display: flex; flex-direction: column; gap: 8px; }
.from-row { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 14px; background: var(--walnut-2); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px; color: var(--ivory); }
.from-row:hover { background: var(--walnut-3); }
.from-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.from-who { font-weight: 500; }
.from-when { margin-left: 8px; font-size: 12px; color: var(--smoke); font-weight: 400; }
.from-text { font-size: 14px; color: var(--ivory); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.member-status::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; animation: breathe 1.4s ease-in-out infinite; }
.member-team .faces { display: flex; flex: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-wrap: wrap; }
.member-team .faces .portrait { margin: -4px; box-shadow: 0 0 0 2px var(--walnut-2); }
.members-sep { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--smoke-2); padding: 12px 12px 4px; }
.threads:has(.is-speaking) .member:not(.is-speaking):not(:hover) { opacity: 0.6; }

.rail-foot { margin-top: auto; padding: 14px 24px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--smoke); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track { width: 30px; height: 18px; border-radius: 9px; background: var(--walnut-3); position: relative; transition: background 160ms ease; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--smoke); transition: transform 160ms ease, background 160ms ease; }
.toggle input:checked + .toggle-track { background: rgba(200, 165, 107, 0.35); }
.toggle input:checked + .toggle-track::after { transform: translateX(12px); background: var(--brass-2); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---- portraits ---- */
.portrait { position: relative; flex: none; border-radius: 50%; overflow: hidden; background: var(--walnut-3); display: grid; place-items: center; box-shadow: 0 0 0 1.5px rgba(241, 236, 226, 0.08); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait-initials { font-family: var(--serif); color: var(--c); }
.portrait-xs { width: 22px; height: 22px; font-size: 10px; }
.portrait-sm { width: 40px; height: 40px; font-size: 15px; }
.portrait-md { width: 48px; height: 48px; font-size: 18px; }
.portrait-lg { width: 64px; height: 64px; font-size: 22px; }
.portrait-you { background: var(--ivory); color: #221D19; font-family: var(--serif); font-size: 12px; }
.portrait-gap { flex: none; width: 40px; }
.member.is-speaking .portrait, .team-card.is-live .portrait { box-shadow: 0 0 0 2px var(--c), 0 0 24px 0 color-mix(in srgb, var(--c) 45%, transparent); animation: ring 1.6s ease-in-out infinite; }
@keyframes ring { 50% { box-shadow: 0 0 0 3px var(--c), 0 0 34px 2px color-mix(in srgb, var(--c) 55%, transparent); } }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ---- stage and bar ---- */
.stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; background: var(--walnut); }
.bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px clamp(20px, 5vw, 64px) 14px; border-bottom: 1px solid var(--line); }
.bar-title { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; }
.bar-sub { margin: 6px 0 0; color: var(--smoke); font-size: 13.5px; }
.bar-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 14px; font-size: 13.5px; color: var(--ivory-2); }
.btn:hover { background: rgba(241, 236, 226, 0.06); color: var(--ivory); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-brass { background: var(--brass); color: #221D19; border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 500; white-space: nowrap; }
.btn-brass:hover:not(:disabled) { background: var(--brass-2); }
.btn-brass:disabled { opacity: .5; cursor: default; }
.btn-quiet { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--smoke); font-size: 13.5px; }
.btn-quiet:hover { color: var(--ivory); }
.btn-upload { cursor: pointer; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-inline { background: transparent; border: 0; padding: 0; color: var(--brass-2); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.btn-inline:disabled { color: var(--smoke); text-decoration: none; cursor: default; }

.transcript { min-height: 0; overflow-y: auto; padding: 26px clamp(20px, 5vw, 64px) 24px; display: flex; flex-direction: column; gap: 18px; }
.view-chat .msg, .view-chat .msg-event, .view-chat .msg-consult, .view-chat .build-card { max-width: 760px; }
.section-h { font-family: var(--serif); font-weight: 400; font-size: 21px; color: var(--ivory); display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.section-note { margin: 0; color: var(--smoke); font-size: 14px; }
.board-count { font-family: var(--sans); font-size: 12px; color: var(--smoke); }
.board-empty { margin: 4px 0 0; color: var(--smoke-2); font-size: 14px; }

.empty { margin: auto; text-align: center; max-width: 520px; }
.empty-faces { display: flex; justify-content: center; margin-bottom: 26px; }
.empty-faces .portrait { margin: 0 -6px; box-shadow: 0 0 0 3px var(--walnut); }
.empty-lead { font-family: var(--serif); font-size: 36px; line-height: 1.1; margin: 0 0 12px; }
.empty-copy { color: var(--smoke); margin: 0; }
.notice { margin-top: 18px; text-align: left; border-left: 2px solid var(--brass); padding: 10px 14px; background: rgba(200, 165, 107, 0.08); color: var(--ivory-2); font-size: 14px; }

/* ---- messages ---- */
.msg { animation: appear 220ms ease both; }
@keyframes appear { from { opacity: 0; } }
.msg-user { align-self: flex-end; background: var(--ivory); color: #221D19; padding: 11px 16px; border-radius: 18px 18px 4px 18px; max-width: min(560px, 85%); }
.msg-user .msg-text { color: #221D19; }
.msg-agent { display: flex; gap: 14px; align-items: flex-start; }
.msg-agent.is-grouped { margin-top: -8px; }
.msg-agent.is-aside .msg-text { color: var(--ivory-2); }
.msg-body { min-width: 0; padding-top: 2px; }
.msg-who { font-family: var(--serif); font-size: 18px; line-height: 1.2; color: var(--c); margin-bottom: 4px; }
.msg-title { font-family: var(--sans); font-size: 12px; color: var(--smoke-2); margin-left: 10px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ivory); }
.msg-text strong { font-weight: 500; color: var(--ivory); display: inline-block; margin-top: 4px; }
.caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: text-bottom; background: var(--c); margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.dots { display: inline-flex; gap: 4px; align-items: center; height: 1.4em; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c, var(--smoke)); opacity: 0.4; animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 30% { opacity: 1; transform: translateY(-2px); } }
.working { display: block; margin-top: 4px; font-size: 12.5px; color: var(--smoke); }
.msg-agent.is-brief, .session-brief-card { display: flex; gap: 14px; align-items: flex-start; background: rgba(200, 165, 107, 0.07); border: 1px solid rgba(200, 165, 107, 0.25); padding: 16px 18px; border-radius: 12px; }
.msg-agent.is-brief .msg-title, .session-brief-card .msg-title { color: var(--brass-2); }
.msg-event { align-self: center; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--smoke); }
.view-chat .msg-event { align-self: flex-start; margin-left: 54px; }
.msg-consult { margin-left: 54px; border-left: 1px solid var(--line); padding: 4px 0 4px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ivory-2); }
.consult-turn { display: flex; gap: 10px; align-items: flex-start; }
.consult-turn > div { min-width: 0; }
.consult-name { display: block; font-family: var(--serif); font-size: 16px; color: var(--c); margin-bottom: 1px; }
.consult-pending { color: var(--smoke); }
.btn-stop { margin-left: 10px; background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: 11.5px; color: var(--smoke); vertical-align: 1px; }
.btn-stop:hover { color: var(--ivory); border-color: var(--smoke); }
.btn-stop-all { margin-left: 8px; }
.msg-cut { display: block; margin-top: 4px; font-size: 12px; color: var(--smoke-2); }

/* ---- composer ---- */
.composer { padding: 10px clamp(20px, 5vw, 64px) 20px; border-top: 1px solid var(--line); }
.pill { display: flex; align-items: center; gap: 10px; max-width: 760px; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 28px; padding: 8px 8px 8px 8px; transition: border-color 160ms ease; }
.pill:focus-within { border-color: rgba(200, 165, 107, 0.6); }
.input { flex: 1; resize: none; min-height: 26px; max-height: 160px; background: transparent; border: 0; padding: 6px 4px; outline: none; line-height: 1.5; }
.input::placeholder { color: var(--smoke-2); }
.btn-round { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; transition: background 160ms ease, transform 120ms ease; }
.btn-mic, .btn-attach { background: transparent; color: var(--smoke); cursor: pointer; }
.btn-mic:hover, .btn-attach:hover { background: rgba(241, 236, 226, 0.06); color: var(--ivory); }
.btn-mic.is-listening { background: rgba(216, 107, 138, 0.16); color: #E48BA4; }
.btn-send { background: var(--brass); color: #221D19; }
.btn-send:hover { background: var(--brass-2); }
.btn-send:active { transform: scale(0.96); }
.wave { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.wave i { width: 3px; height: 8px; border-radius: 2px; background: currentColor; animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.12s; } .wave i:nth-child(3) { animation-delay: 0.24s; } .wave i:nth-child(4) { animation-delay: 0.36s; }
@keyframes wave { 50% { height: 18px; } }
.composer-hint { max-width: 760px; margin: 8px 0 0 18px; font-size: 12.5px; color: var(--smoke); min-height: 18px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; background: rgba(34, 29, 25, 0.12); color: #221D19; }
.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pending { display: flex; flex-wrap: wrap; gap: 6px; max-width: 760px; margin: 0 0 8px 18px; }
.att-pending { background: rgba(200, 165, 107, 0.16); color: var(--ivory); }
.chip-x { background: transparent; border: 0; padding: 0 2px; color: var(--smoke); font-size: 16px; line-height: 1; }
.chip-x:hover { color: var(--ivory); }

/* ---- home ---- */
.home { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 36px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.live-list { display: flex; flex-direction: column; gap: 6px; }
.live-row { display: flex; align-items: center; gap: 8px; background: rgba(200, 165, 107, 0.08); border: 1px solid rgba(200, 165, 107, 0.25); border-radius: 10px; padding: 8px 12px; color: var(--ivory); text-align: left; }
.live-row .portrait { margin-right: -6px; }
.live-row span:last-child { margin-left: 10px; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.team-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.team-card:hover { background: var(--walnut-3); }
.team-card .portrait { margin-bottom: 6px; }
.team-name { font-family: var(--serif); font-size: 16px; line-height: 1.1; color: var(--ivory); }
.team-title { font-size: 11.5px; color: var(--smoke); line-height: 1.3; }
.team-state { font-size: 11.5px; color: var(--c); margin-top: 2px; }

/* ---- desk board ---- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.board-h { font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--ivory); display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.board-col-done .board-h { cursor: pointer; list-style: none; }
.board-col-done summary::-webkit-details-marker { display: none; }
.desk-item { background: var(--walnut-2); border: 1px solid var(--line); border-radius: 10px; }
.desk-item.is-done, .desk-item.is-dropped { opacity: .6; margin-top: 10px; }
.desk-summary { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; cursor: pointer; list-style: none; }
.desk-summary::-webkit-details-marker { display: none; }
.desk-owner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--smoke); }
.desk-due { margin-left: auto; color: var(--brass-2); }
.desk-title { color: var(--ivory); font-size: 14.5px; line-height: 1.35; }
.desk-detail { color: var(--smoke); font-size: 13px; }
.desk-last { color: var(--ivory-2); font-size: 13px; }
.desk-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.desk-more { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.desk-hist { font-size: 13px; color: var(--ivory-2); }
.desk-hist > span:first-child { color: var(--ivory); font-family: var(--serif); font-size: 15px; }
.desk-hist-when { color: var(--smoke-2); font-size: 12px; margin-left: 6px; }
.desk-warn { color: #D9A441; }
.desk-notes { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.desk-note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ivory-2); }
.desk-note-by { display: block; font-family: var(--serif); font-size: 15px; color: var(--ivory); }

/* ---- library and documents ---- */
.doc-link { background: transparent; border: 1px solid rgba(200, 165, 107, 0.4); color: var(--brass-2); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; text-decoration: none; }
.doc-link:hover { background: rgba(200, 165, 107, 0.12); }
.doc-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.doc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 14px; background: var(--walnut-2); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--brass)); border-radius: 10px; }
.doc-card:hover { background: var(--walnut-3); }
.doc-card-top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--smoke); }
.doc-card-by { color: var(--ivory-2); }
.tag { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; background: rgba(200, 165, 107, 0.16); color: var(--brass-2); }
.doc-card-title { font-family: var(--serif); font-size: 18px; color: var(--ivory); line-height: 1.2; }
.doc-card-meta { font-size: 12px; color: var(--smoke); }
.doc-shelf-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.doc-card-sm .doc-card-title { font-size: 15px; }
.files { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.file-kind { font-size: 10.5px; letter-spacing: .08em; padding: 2px 6px; border-radius: 4px; background: var(--walnut-3); color: var(--smoke); }
.file-name { flex: 1; color: var(--ivory); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--smoke-2); font-size: 12.5px; }
.doc { max-width: 760px; }
.doc-back { margin-bottom: 18px; }
.doc-title { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; margin: 0 0 8px; }
.doc-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--smoke); margin-bottom: 14px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.doc-body { font-size: 15.5px; line-height: 1.6; color: var(--ivory); }
.doc-body p { margin: 0 0 14px; }
.doc-h { font-family: var(--serif); font-weight: 400; font-size: 21px; margin: 22px 0 8px; color: var(--ivory); }
.doc-list { margin: 0 0 14px; padding-left: 22px; }
.doc-list li { margin-bottom: 4px; }
.doc-rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.doc-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.doc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table th { font-weight: 500; color: var(--ivory); border-bottom-color: var(--smoke-2); }

/* ---- room ---- */
.sessions { display: flex; flex-direction: column; gap: 14px; }
.session { border: 1px solid var(--line); border-radius: 10px; background: var(--walnut-2); }
.session-head { display: flex; align-items: baseline; gap: 14px; font-size: 13px; color: var(--smoke); padding: 12px 16px; cursor: pointer; list-style: none; }
.session-head::-webkit-details-marker { display: none; }
.session-when { font-family: var(--serif); font-size: 18px; color: var(--ivory-2); }
.session-live { color: var(--brass-2); }
.session-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--brass-2); margin-right: 6px; vertical-align: 1px; animation: breathe 1.4s ease-in-out infinite; }
.session-toggle { margin-left: auto; font-size: 12px; color: var(--smoke-2); }
.session[open] .session-toggle { color: var(--brass-2); }
.session-entries { display: flex; flex-direction: column; gap: 16px; padding: 4px 16px 16px; border-top: 1px solid var(--line); }
.session-entries .msg { max-width: 760px; }
.session-brief-card { max-width: 760px; margin-top: -4px; }
.build { border: 1px solid var(--line); border-radius: 10px; background: var(--walnut-2); padding: 0 16px 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.build .session-head { padding: 12px 0 0; cursor: default; }
.build-card { margin-left: 54px; border: 1px solid rgba(111, 163, 199, 0.35); border-left: 3px solid var(--c, var(--brass)); border-radius: 10px; padding: 12px 16px; background: var(--walnut-2); }
.home .build-card { margin-left: 0; }
.build-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ivory-2); margin-bottom: 6px; }
.build-head strong { font-weight: 500; color: var(--ivory); }
.build-brief { white-space: pre-wrap; color: var(--ivory); font-size: 14px; }
.build-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.build-state { font-size: 12.5px; color: var(--smoke); margin-top: 8px; }
.build .build-state { margin: 0 0 0 auto; }
.build-state.is-done { color: #8FC49A; }
.commission-card { border-color: rgba(200, 165, 107, 0.35); }
.commission-kinds { margin-left: 8px; font-size: 12px; color: var(--smoke); }
.commission-last { margin-left: 10px; color: var(--smoke); font-size: 12.5px; }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.file-chip { display: inline-flex; align-items: center; gap: 0; }
.file-chip .doc-link:first-child { border-radius: 999px 0 0 999px; border-right: 0; }
.file-chip .doc-link:last-child { border-radius: 0 999px 999px 0; }
.file-row-studio { align-items: flex-start; flex-wrap: wrap; border-left: 3px solid var(--c, var(--brass)); }
.file-row-studio .file-name { display: flex; flex-direction: column; gap: 2px; }
.file-row-studio .file-chips { margin-top: 0; width: 100%; }
.build-state.is-failed, .build-state.is-declined { color: #D98B8B; }
.build-log { font-size: 13px; color: var(--smoke); }
.build-log summary { cursor: pointer; padding: 4px 0; }
.build-lines { margin-top: 6px; border-left: 1px solid var(--line); padding-left: 12px; display: flex; flex-direction: column; gap: 4px; max-height: 360px; overflow-y: auto; }
.build-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.build-line.is-tool { color: var(--smoke-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.build-line.is-blocked { color: #D98B8B; }
.build-line.is-text { color: var(--ivory-2); }
.build-summary { display: flex; gap: 14px; align-items: flex-start; margin-top: 4px; }

/* ---- Yanes Ventures endorsement and sting ---- */
.yv-endorse { display: inline-flex; align-items: center; gap: 6px; color: var(--smoke-2); font-size: 9px; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; font-family: var(--sans); }
.yv-endorse svg { width: 12px; height: 12px; flex: none; opacity: .9; }
.yv-link { cursor: pointer; text-decoration: none; transition: color 120ms cubic-bezier(0.2, 0, 0, 1); }
.yv-link:hover { color: var(--smoke); }
.yv-sting { position: fixed; inset: 0; z-index: 200; background: #191B1F; color: #F5F4F1; display: flex; align-items: center; justify-content: center; }
.yv-sting[hidden] { display: none; }
.yv-sting.out { opacity: 0; transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1); }
.yv-sting-inner { display: flex; align-items: center; gap: 14px; }
.yv-sting-mark { width: 42px; height: 42px; }
.yv-s-whole, .yv-s-top { animation: yv-rise 240ms cubic-bezier(0.2, 0, 0, 1) both; }
.yv-s-base { animation: yv-rise-gap 360ms cubic-bezier(0.2, 0, 0, 1) both; }
.yv-sting-word { font-family: Archivo, "Helvetica Neue", Arial, sans-serif; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; clip-path: inset(0 100% 0 0); animation: yv-wipe 200ms cubic-bezier(0.2, 0, 0, 1) 360ms forwards; }
@keyframes yv-rise { from { transform: translateY(64px); } to { transform: translateY(0); } }
@keyframes yv-rise-gap { 0% { transform: translateY(56px); } 66% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes yv-wipe { to { clip-path: inset(0 0 0 0); } }

/* ---- responsive and motion ---- */
@media (max-width: 1100px) { .home { grid-template-columns: 1fr; } .board { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-head { padding: 12px 16px 4px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 4px 8px; }
  .nav-item span:not(.nav-badge):not(.nav-live) { display: none; }
  .nav-item { width: auto; flex: none; padding: 9px 14px; }
  .nav-item .nav-badge, .nav-item .nav-live { margin-left: 2px; }
  .threads { flex-direction: row; overflow-x: auto; padding: 6px 8px; border-top: 0; }
  .member { width: auto; padding: 4px; }
  .member-text, .members-sep, .rail-foot, .rail-sub { display: none; }
  .bar { padding: 14px 16px 10px; }
  .bar-title { font-size: 24px; }
  .transcript { padding: 16px; }
  .composer { padding: 8px 12px 14px; }
  .view-chat .msg-event, .msg-consult, .build-card { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .member.is-speaking .portrait, .team-card.is-live .portrait, .member-status::before, .nav-live::before, .session-live::before, .caret, .dots i, .wave i, .msg { animation: none; }
  .member, .toggle-track, .toggle-track::after, .pill, .btn-round { transition: none; }
  .yv-s-whole, .yv-s-top, .yv-s-base { animation: none; }
  .yv-sting-word { animation: none; clip-path: none; }
}


/* ---- search and item actions ---- */
.search { padding: 10px 16px 0; }
.search-input { width: 100%; background: var(--walnut); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 13.5px; color: var(--ivory); outline: none; }
.search-input::placeholder { color: var(--smoke-2); }
.search-input:focus { border-color: rgba(200, 165, 107, 0.6); }
.hits { display: flex; flex-direction: column; gap: 6px; max-width: 760px; }
.hit { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--ivory); }
.hit:not(.hit-static):hover { background: var(--walnut-3); }
.hit-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hit-who { font-family: var(--serif); font-size: 16px; color: var(--ivory); }
.hit-where { font-family: var(--sans); font-size: 12px; color: var(--smoke); margin-left: 8px; }
.hit-text { font-size: 13.5px; color: var(--ivory-2); }
.is-found { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 10px; animation: found 2.4s ease-out forwards; }
@keyframes found { to { outline-color: transparent; } }
.item-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.item-answer { width: 100%; resize: vertical; background: var(--walnut); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; color: var(--ivory); outline: none; }
.item-answer:focus { border-color: rgba(200, 165, 107, 0.6); }
.item-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-owner { font-size: 12.5px; color: var(--smoke); margin-left: auto; display: flex; align-items: center; gap: 6px; }
.item-owner select { background: var(--walnut); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--ivory); font-size: 12.5px; }
.threads { max-height: none; }


/* ---- documents delivered in the conversation ---- */
.msg-delivery { margin-left: 54px; max-width: 760px; }
.doc-inline { background: var(--walnut-2); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--brass)); border-radius: 12px; padding: 14px 16px; }
.doc-inline-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--smoke); }
.doc-inline-by { color: var(--ivory-2); }
.doc-inline-kind { letter-spacing: .06em; text-transform: uppercase; font-size: 10.5px; }
.tag-quiet { background: var(--walnut-3); color: var(--smoke); }
.doc-inline-title { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.15; margin: 6px 0 10px; color: var(--ivory); }
.doc-inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-card-body { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.doc-card-body p { margin: 0 0 12px; }
.doc-card-foot { margin-top: 6px; }
@media (max-width: 820px) { .msg-delivery { margin-left: 0; } }

/* ==== Work, Today and the panel (the rework) ====
   One record per piece of work; any record opens in the panel beside the current place. */
a.nav-item, a.member, a.team-card, a.row, a.brief-card, a.chip, a.seg-item, a.back-link, a.attach-title { color: inherit; text-decoration: none; }
.nav-badge.is-quiet { background: var(--walnut-3); color: var(--ivory-2); }
.shell.has-panel { grid-template-columns: 300px minmax(0, 1fr) minmax(400px, 38%); }
.shell.has-panel.is-wide { grid-template-columns: 300px minmax(0, 1fr) minmax(520px, 62%); }
.panel { border-left: 1px solid var(--line); background: var(--walnut-2); overflow-y: auto; min-width: 0; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 6px; padding: 10px 14px; background: var(--walnut-2); border-bottom: 1px solid var(--line); }
.btn-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ivory-2); font-size: 18px; line-height: 1; text-decoration: none; }
.btn-icon:hover { background: rgba(241, 236, 226, 0.06); color: var(--ivory); }
.panel-body { padding: 22px 28px 40px; }

/* rows: the one list element used on every page */
.rows { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--walnut-2); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line)); border-radius: 10px; text-align: left; transition: background 140ms ease; }
a.row:hover, .row-file:hover { background: var(--walnut-3); }
.row.is-open { background: var(--walnut-3); border-color: rgba(200, 165, 107, 0.45); }
.row.is-done, .row.is-dropped { opacity: .78; }
.row.is-dropped .row-title { text-decoration: line-through; text-decoration-color: var(--smoke-2); }
.row-mark { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: var(--c); }
.row.is-awaiting .row-mark { background: var(--brass); box-shadow: 0 0 0 3px rgba(200, 165, 107, 0.2); }
.row.is-done .row-mark { background: #8FC49A; }
.row.is-dropped .row-mark { background: var(--smoke-2); }
.row-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.row-title { font-size: 15px; color: var(--ivory); line-height: 1.35; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.row-line { font-size: 13.5px; color: var(--ivory-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--smoke); margin-top: 2px; }
.row-due { color: var(--brass-2); }
.row-contents { color: var(--ivory-2); }
.row-when { color: var(--smoke-2); font-size: 12px; margin-left: auto; }
.row-title .row-when { margin-left: 0; }
.row-new { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 999px; background: var(--brass); color: #221D19; font-weight: 500; }
.row-count { font-size: 12px; color: var(--smoke); }
.row-hit.is-static { opacity: .85; }
.row-file .file-kind, .attach .file-kind { flex: none; min-width: 74px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-2); padding-top: 3px; }
.row-live { border-left-color: var(--brass); }
.row-live .portrait { margin-right: -6px; }
.row-session .faces .portrait { margin-right: -5px; }

/* Today */
.today { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 1.3fr); gap: 36px; align-items: start; }
.today-main, .today-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.today-main .section-h:not(:first-child) { margin-top: 16px; }
.today-quiet { font-family: var(--serif); font-size: 22px; color: var(--ivory-2); margin: 8px 0; }
.brief-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--walnut-2); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 12px; }
.brief-card:hover { background: var(--walnut-3); }
.brief-text { font-size: 14.5px; color: var(--ivory); line-height: 1.55; }
.has-panel .today { grid-template-columns: 1fr; }
.has-panel .today-side { display: none; }

/* Work */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ivory-2); }
.chip:hover { background: rgba(241, 236, 226, 0.06); color: var(--ivory); }
.chip.is-on { background: rgba(200, 165, 107, 0.16); border-color: rgba(200, 165, 107, 0.5); color: var(--ivory); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg-item { padding: 6px 14px; border-radius: 999px; font-size: 13.5px; color: var(--smoke); }
.seg-item:hover { color: var(--ivory); }
.seg-item.is-on { background: var(--brass); color: #221D19; }
.work-group { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
details.work-group > summary { cursor: pointer; list-style: none; }
details.work-group > summary::-webkit-details-marker { display: none; }

/* Room */
.room { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 1.3fr); gap: 36px; align-items: start; }
.room > section, .room > aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.has-panel .room { grid-template-columns: 1fr; }

/* the record pages inside the panel */
.kicker { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--smoke); }
.kicker.is-awaiting { color: var(--brass-2); }
.kicker.is-done { color: #8FC49A; }
.page-title { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.12; margin: 0 0 10px; color: var(--ivory); }
.page-detail { margin: 0 0 12px; color: var(--ivory-2); font-size: 14.5px; }
.page-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; color: var(--smoke); margin-bottom: 14px; }
.page-cta { margin: 0 0 8px; }
.page-h { font-family: var(--serif); font-weight: 400; font-size: 20px; margin: 22px 0 10px; color: var(--ivory); }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--brass-2); }
.back-link::before { content: "\2190  "; }
.back-link:hover { text-decoration: underline; }
.work-actions { display: flex; flex-direction: column; gap: 10px; }
.item-answer { width: 100%; resize: vertical; min-height: 64px; background: var(--walnut); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ivory); }
.item-answer:focus { outline: none; border-color: rgba(200, 165, 107, 0.6); }
.item-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-owner { margin-left: auto; font-size: 13px; color: var(--smoke); display: flex; align-items: center; gap: 8px; }
.item-owner select { background: var(--walnut); color: var(--ivory); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.attachments { display: flex; flex-direction: column; gap: 10px; }
.attach { padding: 12px 14px; background: var(--walnut); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; }
.attach-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.attach-title { font-family: var(--serif); font-size: 18px; color: var(--ivory); line-height: 1.2; }
a.attach-title:hover { color: var(--brass-2); }
.attach-head .build-state { margin: 0 0 0 auto; }
.attach-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--smoke); }
.attach-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 16px; }
.attach .attach-actions { margin: 0; }
.attach-note { margin: 0; font-size: 13px; color: var(--smoke); }
.attach .build-actions { margin-top: 2px; }
details.brief > summary, details.versions > summary, details.hq-details > summary { cursor: pointer; font-size: 12.5px; color: var(--smoke); }
details.brief > summary:hover, details.versions > summary:hover, details.hq-details > summary:hover { color: var(--ivory); }
details.versions { display: flex; flex-direction: column; gap: 6px; }
details.versions[open] > a { margin: 6px 6px 0 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); margin-left: 10px; }
.tl-item { display: flex; gap: 10px; align-items: flex-start; margin-left: -11px; font-size: 13.5px; color: var(--ivory-2); }
.tl-item.is-status { color: var(--smoke); }
.tl-body { min-width: 0; }
.tl-who { color: var(--ivory); font-weight: 500; }
.tl-when { display: block; font-size: 12px; color: var(--smoke-2); }
.doc-page .doc-body { font-size: 15px; }
.session-page .session-entries { display: flex; flex-direction: column; gap: 14px; }
.msg-event a.doc-link { margin-left: 2px; }

@media (max-width: 1100px) {
  .shell.has-panel, .shell.has-panel.is-wide { grid-template-columns: 300px minmax(0, 1fr); }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); z-index: 20; }
  .today, .room { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell.has-panel, .shell.has-panel.is-wide { grid-template-columns: 1fr; }
  .panel { width: 100%; }
  .panel-body { padding: 18px 16px 32px; }
  .row-when { margin-left: 0; }
  .item-owner { margin-left: 0; }
}

.msg-user.is-failed .msg-text { opacity: .6; }
.msg-failed { margin-top: 6px; max-width: 460px; font-size: 13px; line-height: 1.45; color: #E3A08F; text-align: right; }

/* proposals, browser runs, connections */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--smoke); }
.field input, .field textarea { background: var(--walnut-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ivory); font-size: 14px; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(200, 165, 107, 0.6); }
.proposal-line { margin: 0; color: var(--ivory); font-size: 14.5px; }
.attach-proposal.is-proposed { border-color: rgba(200, 165, 107, 0.45); }
.proposal-card { max-width: 640px; }
.proposal-card .attach { background: transparent; border: 0; padding: 0; }
.connection { flex-direction: row; align-items: flex-start; gap: 10px; }
.connection-body { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.build-state.is-sent, .build-state.is-scheduled, .build-state.is-submitted { color: #8FC49A; }
.build-state.is-ready, .build-state.is-proposed { color: var(--brass-2); }

/* the company: groups, operations, usage */
.team-group { margin: 6px 0 2px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--smoke-2); }
.today-foot { margin: 8px 0 0; }
.ops { gap: 6px; }
.ops-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; }
.ops-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--smoke-2); flex: none; }
.ops-row.is-up .ops-dot { background: #8FC49A; }
.ops-row.is-down .ops-dot { background: #D98B8B; box-shadow: 0 0 0 3px rgba(217, 139, 139, .25); }
.ops-row.is-checking .ops-dot { background: var(--brass-2); }
.ops-name { color: var(--ivory); }
.ops-state { color: var(--ivory-2); }
.ops-row.is-down .ops-state { color: #E3A08F; }
.usage-table th .portrait { display: inline-grid; vertical-align: middle; margin-right: 6px; }
.usage-bar { width: 140px; height: 6px; border-radius: 999px; background: var(--walnut-3); overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--brass); }
.usage-bar.is-high span { background: #D98B8B; }
.usage-pct { display: block; font-size: 11.5px; color: var(--smoke); margin-top: 3px; }

/* ==== conversations-first rail (the second rework) ====
   The rail is the list of conversations, like a messaging app; the stage is the one that is open. */
.threads { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px 12px; margin-top: 4px; border-top: 1px solid var(--line); overflow-y: auto; flex: 1; }
.conv { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--ivory-2); text-decoration: none; position: relative; }
.conv:hover { background: rgba(241, 236, 226, 0.05); }
.conv.is-active { background: rgba(200, 165, 107, 0.13); color: var(--ivory); }
.conv-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.conv-top { display: flex; align-items: baseline; gap: 8px; }
.conv-name { font-size: 14.5px; color: var(--ivory); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.has-unread .conv-name { font-weight: 500; }
.conv-when { margin-left: auto; font-size: 11.5px; color: var(--smoke-2); flex: none; }
.conv.has-unread .conv-when { color: var(--brass-2); }
.conv-line { font-size: 12.5px; color: var(--smoke); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.has-unread .conv-line { color: var(--ivory-2); }
.conv-unread { flex: none; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--brass); color: #221D19; font-size: 11.5px; font-weight: 500; }
.conv-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--walnut-3); color: var(--brass-2); }
.conv-icon svg { width: 18px; height: 18px; fill: currentColor; }
.conv-inbox .conv-icon { background: rgba(200, 165, 107, 0.18); }
.conv .faces { width: 40px; height: 40px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; }
.conv .faces .portrait { width: 19px; height: 19px; margin: 0; box-shadow: none; }
.conv.is-live::after { content: ""; position: absolute; left: 38px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--brass-2); box-shadow: 0 0 0 2px var(--walnut-2); animation: breathe 1.4s ease-in-out infinite; }
.foot-links { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.foot-link { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--smoke); font-size: 12.5px; text-decoration: none; }
.foot-link:hover, .foot-link.is-current { color: var(--ivory); background: rgba(241, 236, 226, 0.05); }
.foot-count { font-size: 11px; color: var(--brass-2); }
.bar-back { display: none; align-items: center; gap: 6px; color: var(--brass-2); font-size: 13.5px; text-decoration: none; margin-bottom: 8px; }
.meeting-live { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.meeting-live .section-h .session-live { margin-left: 10px; }
.meeting-entries { display: flex; flex-direction: column; gap: 16px; }

/* Narrow windows, including the app's side pane: one screen at a time. The conversation list is its
   own screen (#/chats); every other place fills the window with a way back. */
@media (max-width: 820px) {
  .shell, .shell.has-panel, .shell.has-panel.is-wide { grid-template-columns: 1fr; grid-template-rows: 1fr; height: 100vh; }
  .rail { display: none; border-right: 0; }
  .shell.view-chats .rail { display: flex; height: 100vh; border-bottom: 0; }
  .shell.view-chats .stage { display: none; }
  .rail-head { padding: 18px 18px 10px; }
  .threads { flex-direction: column; overflow-y: auto; padding: 6px 8px 12px; border-top: 1px solid var(--line); }
  .conv { width: 100%; padding: 10px; }
  .conv-text, .members-sep, .rail-foot { display: flex; }
  .members-sep { display: block; }
  .rail-foot { flex-direction: column; }
  .bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .bar-back { display: inline-flex; }
  .bar-actions { flex-wrap: wrap; }
}

/* the team at work */
.team-page { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); gap: 32px; align-items: start; }
.team-now, .team-mapbox { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.team-map { width: 100%; max-width: 520px; height: auto; }
.team-map .map-live { animation: breathe 1.4s ease-in-out infinite; }
.row-thread .pair { display: flex; flex: none; }
.row-thread .pair .portrait + .portrait { margin-left: -8px; box-shadow: 0 0 0 2px var(--walnut-2); }
.conv-team .conv-icon { background: rgba(200, 165, 107, 0.12); }
.has-panel .team-page { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .team-page { grid-template-columns: 1fr; } }

/* ---- HQ: the company's own records. The same walnut room, the figures set in the serif. ---- */
.hq { display: flex; flex-direction: column; gap: 22px; }
.hq-seg { flex-wrap: wrap; border-radius: 14px; }
.hq-notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: rgba(200, 165, 107, 0.12); border: 1px solid rgba(200, 165, 107, 0.35); color: var(--ivory); font-size: 14px; }
.hq-notice.is-error { background: rgba(194, 100, 60, 0.14); border-color: rgba(194, 100, 60, 0.5); }
.hq-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.hq-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 12px; color: var(--ivory); text-decoration: none; min-width: 0; }
a.hq-tile:hover { background: var(--walnut-3); }
.hq-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--smoke); }
.hq-figure { font-family: var(--serif); font-size: 26px; line-height: 1.15; color: var(--ivory); overflow-wrap: anywhere; }
.hq-note { font-size: 12.5px; color: var(--smoke); }
.hq-columns { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; }
.hq-section { display: flex; flex-direction: column; gap: 10px; }
.hq-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hq-section-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hq-row .row-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hq-row.is-done { opacity: .62; }
.hq-sub { font-family: var(--sans); font-size: 13px; color: var(--smoke); }
.hq-tag { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; background: var(--walnut-3); color: var(--ivory-2); white-space: nowrap; }
.hq-tag.is-active, .hq-tag.is-paid, .hq-tag.is-done, .hq-tag.is-signed, .hq-tag.is-won, .hq-tag.is-released, .hq-tag.is-completed, .hq-tag.is-subscribed { background: rgba(127, 183, 126, 0.16); color: #A9D3A8; }
.hq-tag.is-urgent, .hq-tag.is-critical, .hq-tag.is-high, .hq-tag.is-blocked, .hq-tag.is-churned, .hq-tag.is-failed, .hq-tag.is-lost { background: rgba(194, 100, 60, 0.18); color: #E8A07E; }
.hq-tag.is-open, .hq-tag.is-in-progress, .hq-tag.is-fixing, .hq-tag.is-sent, .hq-tag.is-trial, .hq-tag.is-awaiting-approval, .hq-tag.is-part-paid { background: rgba(200, 165, 107, 0.16); color: var(--brass-2); }
.hq-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hq-product { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 12px; color: var(--ivory); text-decoration: none; }
.hq-product:hover { background: var(--walnut-3); }
.hq-product-name { font-family: Archivo, "Helvetica Neue", Arial, sans-serif; font-weight: 600; font-size: 13px; letter-spacing: 0.12em; }
.hq-bar { display: block; height: 4px; border-radius: 2px; background: var(--walnut-3); overflow: hidden; margin: 4px 0; }
.hq-bar > span { display: block; height: 100%; background: var(--brass); }
.hq-stage { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.hq-stage-h { margin: 6px 0 0; font-family: var(--sans); font-weight: 500; font-size: 14px; color: var(--ivory); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hq-page .page-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hq-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 18px; margin: 14px 0; }
.hq-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hq-fact dt { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--smoke); }
.hq-fact dd { margin: 0; color: var(--ivory); overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; }
.hq-long { font-size: 14.5px; }
.hq-related { margin-top: 10px; }
.hq-related .rows { margin-top: 6px; }
.hq-edit { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
.hq-edit > summary { cursor: pointer; list-style: none; }
.hq-edit > summary::-webkit-details-marker { display: none; }
.hq-edit > summary::after { content: " \2192"; color: var(--smoke); }
.hq-edit[open] > summary::after { content: " \2193"; }
.hq-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 10px 0; }
.hq-form .field-wide, .hq-form .item-buttons { grid-column: 1 / -1; }
.hq-form.hq-inline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field select { background: var(--walnut-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ivory); font: inherit; font-size: 14px; cursor: pointer; }
.field select:focus { outline: none; border-color: rgba(200, 165, 107, 0.6); }
.field-hint { font-size: 11.5px; color: var(--smoke-2); line-height: 1.4; }
.hq-thread { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.hq-msg { padding: 10px 14px; border-radius: 10px; background: var(--walnut-2); border: 1px solid var(--line); }
.hq-msg.is-customer { border-left: 3px solid var(--ivory-2); }
.hq-msg.is-us { border-left: 3px solid var(--brass); }
.hq-msg.is-note { border-left: 3px solid var(--smoke-2); background: transparent; }
.hq-msg-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--smoke); margin-bottom: 4px; }
.hq-msg-who { display: flex; align-items: center; gap: 6px; color: var(--ivory-2); }
.hq-msg-body { font-size: 14.5px; color: var(--ivory); }
.hq-lines input { width: 100%; background: var(--walnut-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--ivory); font-size: 13.5px; }
.hq-lines .hq-total th, .hq-lines .hq-total td { font-weight: 500; color: var(--ivory); border-bottom-color: var(--smoke-2); }
.hq-transcript { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.hq-line { margin: 0; font-size: 14px; }
.hq-line-who { display: inline-block; min-width: 72px; color: var(--smoke); font-size: 12.5px; margin-right: 8px; }
.hq-line.is-us .hq-line-who { color: var(--brass-2); }
.btn-quiet.is-armed, .btn-brass.is-armed { background: rgba(194, 100, 60, 0.22); color: #F2C3A9; border-color: rgba(194, 100, 60, 0.6); }
.members-fold > summary { cursor: pointer; list-style: none; }
.members-fold > summary::-webkit-details-marker { display: none; }
.members-fold > summary::after { content: " \2192"; }
.members-fold[open] > summary::after { content: " \2193"; }
.conv-hq .conv-icon { color: var(--brass-2); }

/* The app's own dropdown menu, opened in place of the system's. */
.dd-menu { position: fixed; z-index: 50; max-height: 320px; overflow-y: auto; padding: 4px; background: var(--walnut-3); border: 1px solid rgba(241, 236, 226, 0.14); border-radius: 10px; display: flex; flex-direction: column; }
.dd-option { text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 7px 12px; font-size: 14px; color: var(--ivory-2); white-space: nowrap; }
.dd-option:hover, .dd-option:focus-visible { background: rgba(200, 165, 107, 0.18); color: var(--ivory); outline: none; }
.dd-option.is-selected { color: var(--brass-2); }

@media (max-width: 1100px) { .hq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hq-columns { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .hq-form, .hq-form.hq-inline { grid-template-columns: 1fr; } .hq-figure { font-size: 22px; } }
/* HQ's section navigation sits on its own line under the title, so the title never narrows. */
.shell.view-hq .bar { flex-wrap: wrap; align-items: flex-start; }
.shell.view-hq .bar-text { flex: 1 1 100%; }
.shell.view-hq .bar-actions { flex: 1 1 100%; flex-wrap: wrap; }

/* ==== The command layout: hubs in the rail, the owner's desk beside every hub ==== */
:root { --ember: #D2754E; --moss: #7FB77E; }
.shell { grid-template-columns: 248px minmax(0, 1fr); }
.shell.has-panel { grid-template-columns: 248px minmax(0, 1fr) minmax(400px, 36%); }
.shell.has-panel.is-wide { grid-template-columns: 248px minmax(0, 1fr) minmax(520px, 60%); }

.hubs { flex: 1; overflow-y: auto; padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); margin-top: 10px; }
.hub-group { display: flex; flex-direction: column; gap: 1px; }
.hub-group-label { margin: 8px 10px 4px; font-size: 12px; color: var(--smoke-2); letter-spacing: 0.01em; }
.hub-link { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: var(--ivory-2); text-decoration: none; font-size: 14.5px; }
.hub-link:hover { background: rgba(241, 236, 226, 0.05); color: var(--ivory); }
.hub-link.is-current { background: rgba(200, 165, 107, 0.13); color: var(--ivory); }
.hub-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: none; }
.hub-icon svg { width: 18px; height: 18px; fill: currentColor; opacity: .7; }
.hub-link.is-current .hub-icon svg { opacity: 1; fill: var(--brass-2); }
.hub-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-count { flex: none; min-width: 20px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--brass); color: #221D19; font-size: 11.5px; font-weight: 500; }
.hub-live { width: 7px; height: 7px; border-radius: 50%; background: var(--brass-2); flex: none; animation: breathe 1.4s ease-in-out infinite; }

.rail-team { padding: 6px 14px 10px; border-top: 1px solid var(--line); }
.rail-team .hub-group-label { margin: 6px 0 8px; }
.team-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.team-face { position: relative; border-radius: 50%; display: block; }
.team-face .portrait { box-shadow: 0 0 0 1.5px rgba(241, 236, 226, 0.08); transition: box-shadow 160ms ease; }
.team-face:hover .portrait, .team-face.is-current .portrait { box-shadow: 0 0 0 2px var(--c); }
.team-face.is-live .portrait { box-shadow: 0 0 0 2px var(--c); animation: breathe 1.6s ease-in-out infinite; }
.team-face.has-unread::after { content: ""; position: absolute; top: -1px; right: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--brass); border: 2px solid var(--walnut-2); }
.rail-team .members-fold > summary { margin: 10px 0 8px; }

/* The header of a hub: name, one line, actions, then its sections on their own row. */
.bar { flex-wrap: wrap; align-items: flex-end; }
.bar-text { flex: 1 1 auto; min-width: 0; }
.hub-tabs { flex: 1 1 100%; flex-wrap: wrap; border-radius: 14px; margin-top: 4px; align-self: flex-start; width: fit-content; }

/* A hub: its records, and the desk of whoever runs it. */
.hub { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.hub.has-desk { grid-template-columns: minmax(0, 1fr) 300px; }
.hub-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hub-desk { position: sticky; top: 0; display: flex; flex-direction: column; gap: 14px; }
.desk-card { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 12px; background: var(--walnut-2); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.desk-who { display: flex; align-items: center; gap: 12px; }
.desk-id { display: flex; flex-direction: column; min-width: 0; }
.desk-name { font-family: var(--serif); font-size: 21px; line-height: 1.1; color: var(--ivory); text-decoration: none; }
.desk-name:hover { color: var(--brass-2); }
.desk-title { font-size: 12.5px; color: var(--smoke); }
.desk-status { margin: 0; font-size: 13px; color: var(--smoke); display: flex; align-items: center; gap: 7px; }
.desk-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--smoke-2); flex: none; }
.desk-status.is-busy { color: var(--ivory-2); }
.desk-status.is-busy::before { background: var(--c, var(--brass-2)); animation: breathe 1.4s ease-in-out infinite; }
.desk-label { margin: 0 0 4px; font-size: 12px; color: var(--smoke-2); display: block; }
.desk-last { display: block; text-decoration: none; padding: 8px 10px; border-radius: 8px; background: rgba(241, 236, 226, 0.03); }
.desk-last:hover { background: rgba(241, 236, 226, 0.06); }
.desk-quote { display: block; font-size: 13.5px; color: var(--ivory-2); line-height: 1.45; }
.desk-ask textarea { width: 100%; background: var(--walnut); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ivory); font-size: 13.5px; resize: vertical; line-height: 1.45; }
.desk-ask textarea:focus { outline: none; border-color: rgba(200, 165, 107, 0.6); }
.desk-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.desk-reply { border-left: 2px solid var(--c); padding: 4px 0 2px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.desk-q { margin: 0; color: var(--smoke); font-size: 12.5px; }
.rows-tight .row { padding: 8px 10px; }
.rows-tight .row-meta { display: none; }

/* Command and the hub sections */
.hq-tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hq-day { margin: 10px 0 2px; font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--ivory-2); }
.hq-day.is-late { color: #E8A07E; }
.hq-inline-bar { display: inline-flex; align-items: center; gap: 6px; }
.hq-inline-bar .hq-bar { width: 70px; margin: 0; }
.hq-health { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); margin: 6px 0 10px; font-size: 13.5px; color: var(--ivory-2); }
.hq-health strong { font-weight: 500; color: var(--ivory); }
.hq-health.is-at-risk { border-color: rgba(210, 117, 78, 0.6); }
.hq-health.is-watch { border-color: rgba(200, 165, 107, 0.6); }
.hq-tag.is-good { background: rgba(127, 183, 126, 0.16); color: #A9D3A8; }
.hq-tag.is-at-risk, .hq-tag.is-overdue, .hq-tag.is-off-track { background: rgba(194, 100, 60, 0.18); color: #E8A07E; }
.hq-tag.is-watch, .hq-tag.is-drafting, .hq-tag.is-in-negotiation, .hq-tag.is-out-for-signature, .hq-tag.is-due, .hq-tag.is-planned, .hq-tag.is-evaluating, .hq-tag.is-proposed { background: rgba(200, 165, 107, 0.16); color: var(--brass-2); }
.hq-tag.is-published, .hq-tag.is-registered, .hq-tag.is-on-track, .hq-tag.is-achieved, .hq-tag.is-decided, .hq-tag.is-accepted, .hq-tag.is-shipped, .hq-tag.is-filed, .hq-tag.is-resolved { background: rgba(127, 183, 126, 0.16); color: #A9D3A8; }
.hq-budget tr.is-over td, .hq-budget tr.is-over th { color: #E8A07E; }
.hq-steps { list-style: none; margin: 6px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.hq-step { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ivory-2); font-size: 14px; }
.hq-step:hover { background: rgba(241, 236, 226, 0.05); color: var(--ivory); }
.hq-check { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--smoke); flex: none; display: grid; place-items: center; }
.hq-step.is-done { color: var(--smoke); }
.hq-step.is-done .hq-check { background: var(--brass); border-color: var(--brass); }
.hq-step.is-done .hq-check::after { content: ""; width: 8px; height: 4px; border-left: 2px solid #221D19; border-bottom: 2px solid #221D19; transform: rotate(-45deg) translate(1px, -1px); }
.hq-label { text-transform: none; letter-spacing: 0.01em; font-size: 12.5px; }
.members-sep { text-transform: none; letter-spacing: 0.01em; font-size: 12px; }

/* The organisation */
.org { display: flex; flex-direction: column; gap: 26px; }
.org-top { display: flex; }
.org-branch { display: flex; flex-direction: column; gap: 12px; padding-left: 18px; border-left: 1px solid var(--line); }
.org-branch.is-paused { opacity: .72; }
.org-level { display: flex; }
.org-children { display: flex; flex-direction: column; gap: 16px; padding-left: 18px; border-left: 1px solid var(--line); }
.org-group .hub-group-label { margin: 0 0 8px; }
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.org-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); border-left: 3px solid var(--c, var(--brass)); background: var(--walnut-2); text-decoration: none; color: var(--ivory); min-width: 0; }
a.org-card:hover { background: var(--walnut-3); }
.org-card.is-paused { border-left-color: var(--smoke-2); }
.org-principal { border-left-color: var(--brass); }
.org-text { display: flex; flex-direction: column; min-width: 0; }
.org-name { font-family: var(--serif); font-size: 19px; line-height: 1.15; }
.org-title { font-size: 12.5px; color: var(--smoke); }
.org-doing { font-size: 12px; color: var(--ivory-2); margin-top: 2px; }

/* A member, in full */
.member-head { display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.member-head .page-detail { margin: 2px 0 6px; }

.messages-list { display: flex; flex-direction: column; gap: 2px; max-width: 760px; }

@media (max-width: 1240px) {
  .hub.has-desk { grid-template-columns: minmax(0, 1fr); }
  .hub-desk { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (max-width: 1100px) {
  .shell.has-panel, .shell.has-panel.is-wide { grid-template-columns: 248px minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell.view-messages { grid-template-rows: auto auto; height: auto; min-height: 100vh; }
  .shell.view-messages .rail { display: flex; height: auto; }
  .shell.view-messages .hubs { overflow: visible; }
  .shell.view-messages .stage { display: grid; }
  .shell.view-messages .bar-back { display: none; }
  .hq-tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .org-branch, .org-children { padding-left: 10px; }
}
/* The rail scrolls as one column, so every hub stays reachable on a short window. */
.rail { overflow-y: auto; }
.hubs { flex: none; overflow: visible; }
.hub-link { padding: 6px 10px; }
.rail-team .portrait-sm { width: 30px; height: 30px; font-size: 12px; }
.hub-tabs-row { flex: 1 1 100%; display: flex; }
.hub-tabs { flex: 0 1 auto; width: auto; margin-top: 2px; }
/* With a record open beside the page, the owner's desk moves below the records rather than squeezing them. */
.has-panel .hub.has-desk { grid-template-columns: minmax(0, 1fr); }
.has-panel .hub-desk { position: static; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* Narrow windows, including phones: one column, the menu one tap away. Declared last so it wins. */
@media (max-width: 820px) {
  .shell, .shell.has-panel, .shell.has-panel.is-wide { grid-template-columns: minmax(0, 1fr); }
  .bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .bar-back { display: inline-flex; align-self: flex-start; }
  .hub-tabs-row { overflow-x: auto; }
  .hub-tabs { flex-wrap: nowrap; }
  .hq-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hq-columns { grid-template-columns: minmax(0, 1fr); }
  .hub-desk { grid-template-columns: minmax(0, 1fr); }
  .shell.view-messages .rail { overflow: visible; }
}
@media (max-width: 820px) { .hub-tabs-row, .bar-text, .bar-actions { flex: none; } .bar-actions:empty { display: none; } }
/* Company knowledge */
.knowledge-text, .hq-pre { white-space: pre-wrap; word-break: break-word; font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.55; color: var(--ivory-2); background: var(--walnut); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 60vh; overflow: auto; }
.study-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.study-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; color: var(--ivory-2); }
.study-chip span:last-child { color: var(--smoke); }
.study-chip.is-done { border-color: rgba(127, 183, 126, 0.5); }
.study-chip.is-reading { border-color: rgba(200, 165, 107, 0.6); }
/* Signing in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--walnut); }
.signin-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--walnut-2); }
.signin-card .product-name { margin: 0 0 6px; }
.signin-title { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 4px 0 0; color: var(--ivory); }
.signin-note { margin: 0; color: var(--smoke); font-size: 14px; }
.signin-card .btn-brass { align-self: flex-start; }
/* Deploying */
.deploy-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--smoke-2); flex: none; margin-top: 6px; }
.deploy-dot.is-done { background: var(--moss); }
.deploy-dot.is-running { background: var(--brass-2); animation: breathe 1.4s ease-in-out infinite; }
.deploy-dot.is-failed { background: var(--ember); }
.mono-cell { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; }
.setup-url { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--walnut); color: var(--ivory); user-select: all; }
/* Autopilot */
.authority { display: flex; flex-direction: column; gap: 8px; }
.authority-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto; gap: 10px 14px; align-items: end; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--smoke-2); border-radius: 10px; background: var(--walnut-2); }
.authority-row.is-delegated { border-left-color: var(--moss); }
.authority-text { display: flex; flex-direction: column; gap: 2px; }
.authority-label { color: var(--ivory); font-size: 14.5px; }
.desk-routine { display: block; font-size: 13px; color: var(--ivory-2); text-decoration: none; padding: 2px 0; }
.desk-routine:hover { color: var(--brass-2); }
/* Metrics */
.metrics { display: flex; flex-direction: column; }
.metric-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 120px; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.metric-label { color: var(--ivory-2); font-size: 14px; }
.metric-value { font-family: var(--serif); font-size: 20px; color: var(--ivory); }
.metric-cmp { display: flex; flex-direction: column; font-size: 13px; }
.metric-change { color: var(--ivory-2); }
.metric-change.is-good { color: #A9D3A8; }
.metric-change.is-bad { color: #E8A07E; }
.spark { width: 120px; height: 28px; }
.forecast-chart { width: 100%; height: auto; margin: 6px 0 12px; }
@media (max-width: 820px) {
  .authority-row { grid-template-columns: minmax(0, 1fr); }
  .metric-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .metric-row .spark { display: none; }
}
.authority-row { grid-template-columns: minmax(0, 2fr) minmax(210px, 1.4fr) minmax(0, 0.7fr) minmax(0, 0.8fr) auto; }
@media (max-width: 820px) { .authority-row { grid-template-columns: minmax(0, 1fr); } }

/* ---- the books, the walkthrough, rollouts ---- */
.books-table th { font-weight: 500; }
.books-table td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.books-table tr.is-group th { padding-top: 14px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--smoke); }
.books-table tr.is-total th, .books-table tr.is-total td { border-top: 1px solid var(--line); }
.books-table tr.is-strong th, .books-table tr.is-strong td { font-weight: 600; }
.books-table .is-muted, .books-table tr.is-muted td { color: var(--smoke); }
.books-table tr.is-over th, .books-table tr.is-over td { color: var(--ember, #D2754E); }
.books-ledger td:first-child { text-align: left; }
.books-exports { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.books-accounts { flex-wrap: wrap; }
.walk-findings { margin: 8px 0 12px 18px; padding: 0; line-height: 1.5; }
.walk-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.walk-shot { display: flex; flex-direction: column; gap: 4px; color: var(--smoke); font-size: 11px; text-decoration: none; }
.walk-shot img { width: 100%; aspect-ratio: 1366 / 860; object-fit: cover; border: 1px solid var(--line); background: var(--panel, transparent); }
.walk-shot:hover img { border-color: var(--brass); }
.rollout-steps { margin: 4px 0 12px 18px; padding: 0; line-height: 1.6; }
@media (max-width: 760px) { .books-table td { white-space: normal; } .walk-shots { grid-template-columns: repeat(2, 1fr); } }
.demo-connect { display: inline-block; vertical-align: middle; }
.demo-connect > summary { cursor: pointer; color: var(--smoke); font-size: 13px; list-style: none; padding: 6px 10px; }
.demo-connect > summary:hover { color: var(--brass); }
.demo-connect[open] > summary { color: var(--brass); }
.demo-password { align-items: flex-end; }
.demo-password .btn-sm { align-self: flex-end; height: auto; }
.demo-url code { word-break: break-all; display: inline; }
.mfa-qr svg { width: 180px; height: 180px; display: block; }
.mfa-enrol { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.mfa-codes { columns: 2; margin: 10px 0 12px 18px; padding: 0; line-height: 1.8; }
.signin-card .mfa-qr { display: flex; justify-content: center; margin: 6px 0 10px; }
.access-table td { text-align: left; white-space: normal; }

/* The operating switch and the morning brief */
.operating-line { border-left: 3px solid var(--moss, #7FB77E); padding-left: 14px; margin-bottom: 18px; }
.operating-line.is-building { border-left-color: var(--brass); }
.brief-block { margin: 0 0 16px; }
.brief-block .rollout-steps { margin: 6px 0 8px; }

/* The AI cost meter */
.cost-days { display: flex; align-items: flex-end; gap: 3px; height: 70px; padding: 4px 0; }
.cost-day { flex: 1; min-width: 4px; background: var(--brass); opacity: .75; }
.cost-day:hover { opacity: 1; }

/* Days for calls */
.check-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 4px; }
.check-row .check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ivory-2); }
fieldset.field { border: 0; padding: 0; margin: 0; }
