:root {
  --canvas: #f6f7f2;
  --paper: #fffefa;
  --wash: #eff2eb;
  --sage-soft: #e4ebdf;
  --sage: #536953;
  --sage-dark: #344f3c;
  --ink: #26372e;
  --muted: #68736b;
  --line: #dce2d7;
  --line-strong: #bdc9b8;
  --amber: #896923;
  --amber-soft: #f7efdc;
  --red: #a4433b;
  --red-soft: #f9eae5;
  --radius: 10px;
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .46; cursor: not-allowed; }
a { color: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #93aa88; outline-offset: 3px; }
input:focus, textarea:focus { outline: 2px solid #93aa88; outline-offset: 1px; border-color: var(--sage); }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { line-height: 1.6; }
svg.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.quiet-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.small-text { font-size: 12px; color: var(--muted); line-height: 1.65; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; padding: 8px 14px; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 7px; font-weight: 600; font-size: 12px; line-height: 1.5; white-space: nowrap; text-decoration: none; }
.button:hover:not(:disabled) { filter: brightness(.96); }
.button.primary { background: var(--sage-dark); color: #fff; border-color: var(--sage-dark); box-shadow: 0 1px 1px #20312114; }
.button.secondary { border-color: var(--line-strong); background: var(--paper); }
.button.small { min-height: 32px; padding: 6px 11px; font-size: 12px; }
.button.full { width: 100%; }
.button.text-button { padding-left: 8px; padding-right: 8px; color: var(--muted); }
.button.text-button:hover { background: var(--wash); }
.button.icon-button { padding: 8px; width: 39px; height: 39px; position: relative; }
.button.icon-button.small { width: 30px; height: 30px; min-height: 30px; padding: 5px; }
.button.danger-subtle { color: var(--red); font-weight: 500; font-size: 11px; }
.button.danger-subtle:hover { background: var(--red-soft); }
.button.danger { background: var(--red); color: white; border-color: var(--red); }
.danger-text { color: var(--red) !important; }
.is-busy { cursor: progress !important; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
input, textarea, select { width: 100%; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 12px; line-height: 1.5; }
input, select { min-height: 41px; }
input::placeholder, textarea::placeholder { color: #7d867e; font-weight: 400; }
textarea { resize: vertical; min-height: 80px; }
input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; accent-color: var(--sage-dark); margin: 1px 0 0; flex-shrink: 0; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.65; }
.field-help { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.form-error { color: var(--red); padding: 10px 12px; background: var(--red-soft); border-radius: 6px; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; margin: 12px 0; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; margin: 0 0 18px; line-height: 1.55; }
.badge { display: inline-flex; align-items: center; white-space: nowrap; padding: 4px 9px; border: 1px solid var(--line); border-radius: 5px; font-weight: 500; font-size: 11px; line-height: 1.3; background: var(--wash); }
.badge.quiet { background: var(--wash); color: var(--muted); }
.badge.live { background: var(--sage-soft); color: var(--sage-dark); border-color: #b9cbb0; }
.badge.warning { color: var(--amber); background: var(--amber-soft); border-color: #e2d1a6; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a9b3a6; display: inline-block; flex-shrink: 0; }
.status-dot.running { background: #658858; box-shadow: 0 0 0 3px #65885814; }
.status-dot.paused { background: #b59950; }
.status-dot.danger { background: var(--red); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 13px; color: var(--sage); background: var(--sage-soft); font-size: 12px; font-weight: 600; flex-shrink: 0; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 55px 26px; min-height: 200px; }
.empty-state h3 { font-size: 16px; margin-bottom: 9px; }
.empty-state p { font-size: 12px; color: var(--muted); max-width: 42ch; margin-bottom: 18px; }
.empty-state .button { align-self: center; }
.mobile-only { display: none; }

/* The login has the same materials as the inbox, with one restrained motif. */
.login-shell { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; background: var(--wash); padding: 45px 20px 20px; }
.login-brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 600; margin-bottom: 36px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 31px; height: 31px; border-radius: 10px; color: #fff; background: var(--sage-dark); }
.brand-mark .icon { width: 21px; height: 21px; transform: translate(1px, -1px); stroke-width: 1.55; }
.login-card { width: min(440px, 100%); padding: 40px; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 12px 32px #2e453508; }
.lock-symbol { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--wash); color: var(--sage); margin-bottom: 28px; }
.login-card .quiet-label { margin-bottom: 12px; }
.login-card h1 { font-size: 32px; line-height: 1.22; margin-bottom: 17px; }
.login-description { color: var(--muted); max-width: 32ch; font-size: 13px; margin-bottom: 30px; }
.login-card form .button { margin-top: 17px; min-height: 43px; }
.login-footnote { text-align: center; font-size: 11px; line-height: 1.6; margin: 23px 0 0; color: var(--muted); }
.login-shell footer { font-size: 11px; color: var(--muted); margin: auto 0 0; padding-top: 32px; }

/* Chrome stays compact so the conversation is the primary surface. */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 26px; min-height: 75px; background: var(--paper); border-bottom: 1px solid var(--line); gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 600; text-decoration: none; justify-self: start; }
.brand small { font-size: 10px; color: var(--muted); background: var(--wash); border-radius: 4px; padding: 2px 5px; margin-left: 1px; font-weight: 500; }
.main-nav { display: flex; align-self: stretch; gap: 26px; }
.nav-button { display: flex; align-items: center; gap: 7px; background: transparent; border: 0; padding: 0 2px; position: relative; color: var(--muted); font-size: 13px; font-weight: 500; }
.nav-button.active { color: var(--sage-dark); font-weight: 600; }
.nav-button.active::after { position: absolute; content: ''; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--sage); }
.nav-count { background: var(--wash); color: var(--sage); font-size: 10px; min-width: 18px; text-align: center; line-height: 18px; border-radius: 5px; }
.topbar-tools { display: flex; align-items: center; gap: 10px; justify-self: end; }
.alert-dot { position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; background: var(--red); border-radius: 50%; border: 1px solid var(--paper); }
.control-strip { display: flex; justify-content: space-between; align-items: center; gap: 28px; padding: 20px 27px; min-height: 91px; border-bottom: 1px solid var(--line); background: var(--wash); }
.account-status { display: flex; align-items: center; gap: 10px; min-width: 235px; }
.account-status > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.account-status strong { font-size: 13px; font-weight: 600; }
.account-status div > span { font-size: 11px; color: var(--muted); max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-status > .badge { margin-left: 5px; }
.budget-summary { min-width: 185px; max-width: 260px; flex: 1; }
.budget-summary > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }
.budget-summary strong { font-size: 11px; font-weight: 600; white-space: nowrap; }
.budget-track { height: 4px; width: 100%; background: #d7e0d0; margin: 7px 0 3px; border-radius: 4px; overflow: hidden; }
.budget-track span { display: block; height: 100%; background: #789464; border-radius: 4px; }
.budget-track.near-cap span { background: #b69b51; }
.budget-summary small { font-size: 10px; color: var(--muted); }
.global-actions { display: flex; align-items: center; gap: 7px; }
.global-actions .button { font-size: 11px; min-height: 34px; padding: 7px 10px; }
.global-actions .icon { width: 16px; height: 16px; }
.network-banner, .setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 13px 28px; font-size: 12px; border-bottom: 1px solid var(--line); }
.setup-banner { background: #f1f3e8; }
.setup-banner > div { display: flex; align-items: baseline; gap: 12px; }
.setup-banner strong { font-weight: 600; }
.setup-banner span { color: var(--muted); }
.network-banner { background: var(--red-soft); color: var(--red); }
.app-footer { display: flex; justify-content: space-between; gap: 20px; padding: 12px 27px; font-size: 10px; color: var(--muted); background: var(--canvas); margin-top: auto; border-top: 1px solid var(--line); }

/* Three distinct columns share one continuous inbox, not a card grid. */
.workspace { display: grid; grid-template-columns: 285px minmax(330px, 1fr) 270px; flex: 1; min-height: 530px; height: max(530px, calc(100dvh - 207px)); background: var(--paper); }
.fans-panel { background: #f8f9f4; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 25px 21px 19px; }
.panel-heading h1, .panel-heading h2 { margin: 0; font-size: 17px; }
.panel-heading .quiet-label { font-size: 10px; }
.search-box { margin: 0 18px 16px; position: relative; font-weight: 400; }
.search-box .icon { position: absolute; left: 10px; top: 10px; width: 17px; height: 17px; color: var(--muted); }
.search-box input { padding: 8px 10px 8px 34px; font-size: 12px; min-height: 37px; border-color: var(--line); background: var(--paper); }
.fan-filters { display: flex; gap: 4px; margin: 0 18px 14px; }
.filter-button { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; line-height: 1.6; color: var(--muted); background: transparent; border: 1px solid transparent; padding: 5px 9px; border-radius: 6px; }
.filter-button.active { color: var(--sage-dark); background: var(--sage-soft); }
.fan-list { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.fan-list .empty-state { padding: 44px 26px; justify-content: flex-start; }
.fan-list .empty-state h3 { font-size: 15px; }
.fan-item { display: flex; align-items: flex-start; gap: 11px; width: 100%; border: 0; border-bottom: 1px solid #e5e9e0; padding: 19px 20px; text-align: left; background: transparent; position: relative; }
.fan-item:hover { background: var(--wash); }
.fan-item.selected { background: #eaf0e4; }
.fan-item.selected::before { content: ''; width: 3px; height: 30px; background: var(--sage); position: absolute; left: 0; top: 22px; border-radius: 0 2px 2px 0; }
.fan-item-content { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.fan-item-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fan-item-heading strong { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fan-item-heading time { font-size: 9px; color: var(--muted); flex-shrink: 0; }
.fan-preview { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fan-item-meta { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--muted); padding-top: 2px; gap: 8px; }
.fan-state { color: var(--sage); }
.fan-state.paused { color: var(--amber); }
.local-test-tag { color: var(--sage); background: var(--sage-soft); border-radius: 4px; padding: 1px 4px; font-weight: 500; }
.fan-panel-foot { display: flex; align-items: center; gap: 8px; min-height: 53px; font-size: 10px; color: var(--muted); padding: 9px 18px; border-top: 1px solid var(--line); }
.fan-panel-foot button { margin-left: auto; }
.conversation-panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; background: var(--paper); }
.conversation-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; flex: 1; padding: 50px 35px; }
.conversation-empty h2 { font-size: 26px; margin-bottom: 11px; font-weight: 500; }
.conversation-empty > p { color: var(--muted); font-size: 13px; max-width: 38ch; }
.empty-chat-art { width: 94px; height: 85px; border-radius: 28px; background: var(--wash); display: flex; align-items: center; justify-content: center; color: #94a58c; position: relative; margin-bottom: 30px; }
.empty-chat-art > .icon { width: 51px; height: 51px; stroke-width: .9; }
.empty-chat-art > span { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: var(--sage-soft); border: 4px solid var(--paper); bottom: 5px; right: -5px; }
.empty-next { display: flex; align-items: flex-start; gap: 8px; text-align: left; font-size: 11px; color: var(--sage); max-width: 34ch; margin-top: 31px; padding-top: 24px; border-top: 1px solid var(--line); }
.empty-next .icon { width: 16px; height: 16px; }
.conversation-content { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.conversation-header { display: flex; align-items: center; gap: 11px; min-height: 80px; padding: 20px 25px; border-bottom: 1px solid var(--line); }
.conversation-title { flex: 1; min-width: 0; }
.conversation-title h2 { margin: 0 0 3px; font-size: 16px; overflow-wrap: anywhere; }
.conversation-title span { font-size: 10px; color: var(--muted); }
.conversation-header .button { font-size: 10px; padding-left: 9px; padding-right: 9px; }
.conversation-notice { font-size: 11px; padding: 12px 25px; background: var(--amber-soft); color: var(--amber); border-bottom: 1px solid #e6d9b9; overflow-wrap: anywhere; }
.messages-list { flex: 1; padding: 15px 27px 30px; overflow: auto; min-height: 0; scrollbar-width: thin; }
.day-divider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 18px 0 23px; color: #7b877d; font-size: 10px; }
.day-divider::before, .day-divider::after { content: ''; height: 1px; width: 38px; background: var(--line); }
.message { display: flex; flex-direction: column; align-items: flex-start; max-width: 84%; margin-bottom: 20px; width: fit-content; min-width: 70px; }
.message.outgoing { align-items: flex-end; margin-left: auto; }
.message-bubble { padding: 11px 15px; background: #f0f1eb; border: 1px solid #e5e7df; border-radius: 13px 13px 13px 3px; max-width: 100%; }
.message.outgoing .message-bubble { background: #e4ecdc; border-color: #d8e2ce; border-radius: 13px 13px 3px 13px; }
.message-text { font-size: 13px; line-height: 1.65; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-meta { display: flex; align-items: center; gap: 9px; color: #758072; font-size: 9px; padding: 5px 3px 0; flex-wrap: wrap; }
.message-media { display: block; font-size: 10px; color: var(--sage); margin-top: 9px; }
.message-ppv { display: inline-block; background: #fffefa90; border: 1px solid #ced9c4; color: var(--sage-dark); padding: 4px 8px; border-radius: 5px; margin-top: 9px; font-size: 10px; }
.message-ppv.purchased { background: var(--paper); border-color: #a8bb98; }
.message.unsent { opacity: .55; }
.conversation-footer { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 17px 25px; min-height: 55px; background: #fafbf6; }
.conversation-footer p { font-size: 10px; color: var(--muted); margin: 0; flex: 1; }
#mobile-memory { display: none; }
.loading-note { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 10px; }
.fan-details-panel { padding: 0 22px; border-left: 1px solid var(--line); background: #fafbf7; overflow: auto; }
.fan-details-panel .panel-heading { padding-left: 0; padding-right: 0; }
.details-empty { padding-top: 38px; }
.details-empty .quiet-label { font-size: 11px; margin-bottom: 20px; }
.details-empty h2 { font-size: 21px; line-height: 1.5; font-weight: 500; margin-bottom: 17px; }
.details-empty > p:not(.quiet-label) { color: var(--muted); font-size: 12px; }
.soft-rule { width: 35px; height: 1px; background: var(--line-strong); margin: 32px 0 22px; }
.fan-facts { margin: 0 0 31px; }
.fan-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.fan-facts dt { font-size: 10px; color: var(--muted); }
.fan-facts dd { font-size: 11px; font-weight: 500; margin: 0; text-align: right; }
.memory-heading { display: flex; justify-content: space-between; align-items: baseline; }
.memory-heading h3 { font-size: 14px; margin-bottom: 0; }
.memory-heading .quiet-label { font-size: 10px; }
#memory-form { margin-top: 13px; }
#fan-memory { background: var(--paper); border-color: var(--line); font-size: 12px; line-height: 1.7; }
#memory-form .button { margin-top: 10px; }
.context-note { margin: 25px 0; font-size: 10px; color: var(--muted); }

/* Secondary views use generous single-column reading lengths. */
.outbox-view { padding: 38px 7%; flex: 1; max-width: 1250px; width: 100%; margin: 0 auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading .quiet-label { margin-bottom: 9px; }
.page-heading h1, .page-heading h2 { margin-bottom: 10px; font-size: 28px; font-weight: 500; }
.page-heading p:last-child { color: var(--muted); font-size: 12px; max-width: 65ch; margin-bottom: 0; }
.info-note { font-size: 12px; color: var(--sage); background: var(--sage-soft); border: 1px solid #d6e0ce; padding: 13px 17px; border-radius: 7px; margin-bottom: 26px; line-height: 1.6; }
.info-note strong { font-weight: 600; }
.outbox-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 23px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.outbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.outbox-list > .empty-state { grid-column: 1 / -1; min-height: 330px; }
.outbox-item { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 23px; align-self: start; }
.outbox-item.uncertain { border-color: #decda2; }
.outbox-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.outbox-item-heading > div { display: flex; flex-direction: column; gap: 3px; }
.outbox-item-heading strong { font-size: 14px; overflow-wrap: anywhere; }
.outbox-item-heading .quiet-label { font-size: 10px; }
.outbox-text { font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 18px; }
.outbox-meta { display: flex; gap: 6px 13px; flex-wrap: wrap; color: var(--muted); font-size: 10px; padding-bottom: 14px; }
.outbox-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 13px; border-top: 1px solid var(--line); }
.outbox-actions .text-button { margin-right: auto; padding-left: 0; }
.uncertain-help { padding: 11px 13px; background: var(--amber-soft); font-size: 11px; color: var(--amber); border-radius: 5px; }
.settings-view { display: grid; grid-template-columns: 248px minmax(0, 1fr); width: 100%; max-width: 1300px; margin: 0 auto; flex: 1; }
.playground-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 15px; }
.playground-search { max-width: 560px; margin: 25px 0; }
.playground-list { display: grid; gap: 20px; }
.playground-case { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 23px; }
.playground-case.blocked, .playground-case.error { border-color: #decda2; }
.playground-comparison { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 25px; }
.playground-comparison section { min-width: 0; }
.playground-proposal { background: var(--wash); border-radius: 7px; padding: 17px; }
.playground-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; }
.playground-context { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.playground-context summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.playground-context pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; max-height: 440px; overflow-y: auto; }
.playground-case > .button { margin-top: 17px; }
@media (max-width: 720px) {
  .playground-comparison { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .playground-case { padding: 17px; }
  .playground-view .page-heading { flex-wrap: wrap; }
  .playground-toolbar .button { white-space: normal; }
}
.settings-nav { padding: 37px 28px; border-right: 1px solid var(--line); }
.settings-nav h1 { font-size: 20px; margin-bottom: 13px; }
.settings-nav > p:first-of-type { font-size: 13px; color: var(--muted); margin-bottom: 33px; }
.settings-nav nav { display: flex; flex-direction: column; gap: 5px; margin: 0 -9px 36px; }
.settings-tab { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 12px; padding: 11px 10px; border-radius: 7px; }
.settings-tab.active { color: var(--sage-dark); background: var(--sage-soft); font-weight: 600; }
#setup-progress { font-size: 10px; font-weight: 500; }
.settings-nav > .small-text { margin-top: 8px; font-size: 10px; max-width: 24ch; }
.settings-nav > .button { padding-left: 0; }
.settings-content { padding: 37px 45px 50px; max-width: 875px; width: 100%; }
.settings-block { margin: 0 0 26px; padding: 0 0 26px; border-bottom: 1px solid var(--line); }
.settings-block > h3 { margin: 0 0 8px; }
.settings-block > p { font-size: 12px; color: var(--muted); margin-bottom: 19px; max-width: 66ch; }
.settings-block .field-help { margin-bottom: 0; font-size: 11px; }
.setup-checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; padding: 20px 21px; border: 1px solid var(--line); border-radius: 10px; background: #f0f3ea; margin-bottom: 34px; }
.setup-checklist > div { display: flex; align-items: center; gap: 9px; font-size: 11px; }
.check-mark { display: flex; align-items: center; justify-content: center; width: 19px; height: 19px; border: 1px solid #c7d0be; border-radius: 6px; color: var(--muted); font-size: 11px; }
.check-mark.ready { background: var(--sage-dark); color: white; border-color: var(--sage-dark); }
.inline-form { display: flex; align-items: center; gap: 10px; }
.file-label { margin-bottom: 0; cursor: pointer; }
.file-label input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; padding: 0; }
.file-label:focus-within { outline: 3px solid #93aa88; outline-offset: 3px; }
.connect-footer { display: flex; align-items: center; gap: 25px; padding-bottom: 20px; }
.connect-footer h3 { margin-bottom: 6px; font-size: 15px; }
.connect-footer p { font-size: 11px; color: var(--muted); margin: 0; }
.connect-footer > div { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.settings-block > .form-grid { margin-top: 22px; }
.field { min-width: 0; }
.field.full-field { grid-column: 1 / -1; }
.field label { font-size: 11px; }
.input-unit { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); overflow: hidden; }
.input-unit input { border: 0; border-radius: 0; min-width: 0; padding-right: 5px; }
.input-unit:focus-within { outline: 2px solid #93aa88; outline-offset: 1px; }
.input-unit input:focus { outline: 0; }
.input-unit > span { font-size: 10px; padding: 0 12px 0 8px; color: var(--muted); white-space: nowrap; }
.sticky-save { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 0; margin-bottom: 28px; background: var(--canvas); position: sticky; bottom: 0; border-top: 1px solid var(--line); z-index: 1; }
.sticky-save > span { font-size: 10px; color: var(--muted); max-width: 36ch; }
.advanced-editor { border-top: 1px solid var(--line); padding: 17px 0; font-size: 12px; color: var(--muted); }
.advanced-editor summary { cursor: pointer; color: var(--sage); font-weight: 500; }
.advanced-editor[open] summary { margin-bottom: 20px; }
.advanced-editor textarea { margin-bottom: 15px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .93em; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h3, .section-heading h4 { margin: 0; }
.offers-editor .empty-state { min-height: 180px; padding: 35px 20px; }
.offer-edit-card { padding: 23px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 17px; }
.offer-edit-card .checkbox-row { margin: 19px 0 0; font-size: 11px; }
.offer-edit-card .section-heading { margin-bottom: 20px; }
.offer-edit-card .form-grid { gap: 17px; }
.offer-edit-card input { font-size: 12px; }
.vault-list { max-height: 330px; overflow: auto; margin: 16px 0 28px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.vault-row { display: flex; align-items: center; gap: 20px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.vault-row:last-child { border-bottom: 0; }
.vault-row > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vault-row strong { font-size: 12px; overflow-wrap: anywhere; }
.vault-row .quiet-label { font-size: 10px; }
#test-message-form .button { margin-top: 18px; }
#test-brain-form .button { margin-top: 13px; }
.brain-result { padding: 18px; border: 1px solid var(--line); border-radius: 7px; margin-top: 21px; background: var(--paper); }
.brain-result h4 { margin-bottom: 13px; }
.brain-result pre { color: var(--sage); font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 0; }
.prompt-variables { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 16px; }
.prompt-variables .button { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; }
.prompt-context { margin: 25px 0 20px; }
.brain-result summary { cursor: pointer; font-size: 12px; margin-bottom: 13px; }

/* Dialogs keep consequential choices explicit and reviewable. */
.dialog { border: 1px solid var(--line-strong); border-radius: 15px; background: var(--paper); color: var(--ink); padding: 29px; width: min(510px, calc(100% - 28px)); max-height: min(80dvh, 800px); overflow: auto; box-shadow: 0 20px 80px #243a2524; }
.dialog::backdrop { background: #1d35293b; backdrop-filter: blur(2px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.dialog-heading h2 { font-size: 22px; font-weight: 500; margin: 0; }
.dialog-heading .quiet-label { font-size: 11px; margin-bottom: 8px; }
.dialog-heading .icon-button { margin: -5px -6px 0 0; flex-shrink: 0; }
.dialog > p { font-size: 13px; color: var(--muted); max-width: 53ch; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 23px; margin-top: 20px; border-top: 1px solid var(--line); }
.live-summary { display: flex; flex-direction: column; gap: 9px; font-size: 12px; padding: 16px; background: var(--wash); border-radius: 7px; margin: 20px 0; }
#confirm-extra .checkbox-row { font-size: 12px; margin-bottom: 0; }
.alerts-dialog { width: min(570px, calc(100% - 28px)); }
.alert-item { padding: 18px 0; border-top: 1px solid var(--line); }
.alert-item strong { font-size: 13px; font-weight: 600; }
.alert-item p { font-size: 12px; margin: 7px 0 8px; color: var(--muted); overflow-wrap: anywhere; }
.alert-item.critical strong { color: var(--red); }
.alert-item time { font-size: 10px; }
.alert-item .form-actions { justify-content: flex-end; }
.toast { position: fixed; bottom: 23px; left: 50%; transform: translateX(-50%); background: var(--sage-dark); color: white; border: 1px solid #ffffff38; border-radius: 9px; padding: 13px 19px; font-size: 12px; line-height: 1.5; box-shadow: 0 6px 24px #203c2023; z-index: 10; max-width: min(620px, calc(100% - 28px)); width: max-content; overflow-wrap: anywhere; }
.toast.error { background: #7a3931; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: 320px minmax(330px, 1fr) 310px; }
  .fan-details-panel { padding: 0 28px; }
  .messages-list { padding-left: 9%; padding-right: 9%; }
}
@media (max-width: 1180px) {
  .control-strip { gap: 18px; padding-left: 21px; padding-right: 21px; }
  .account-status { min-width: 215px; gap: 7px; }
  .account-status > .badge { margin-left: 0; }
  .account-status div > span { max-width: 175px; }
  .budget-summary { max-width: 200px; min-width: 165px; }
  .global-actions { gap: 3px; }
  .global-actions .button { padding-left: 8px; padding-right: 8px; font-size: 10px; }
  .workspace { grid-template-columns: 255px minmax(300px, 1fr) 245px; }
  .conversation-header { padding-left: 19px; padding-right: 19px; gap: 9px; flex-wrap: wrap; }
  .conversation-header .avatar { width: 32px; height: 32px; }
  .conversation-title { min-width: 130px; }
  .fan-item { padding-left: 17px; padding-right: 17px; gap: 9px; }
  .fan-details-panel { padding: 0 18px; }
  .setup-banner > div { display: block; }
  .setup-banner span { display: block; margin-top: 2px; }
  .settings-content { padding-left: 33px; padding-right: 33px; }
}
@media (max-width: 980px) {
  .topbar { padding: 0 20px; gap: 14px; }
  .main-nav { gap: 18px; }
  .control-strip { flex-wrap: wrap; gap: 17px; padding-top: 15px; padding-bottom: 15px; }
  .budget-summary { min-width: 200px; max-width: 300px; }
  .global-actions { margin-left: auto; }
  .workspace { grid-template-columns: 270px minmax(0, 1fr); position: relative; height: max(540px, calc(100dvh - 220px)); }
  .fan-details-panel { display: none; }
  #mobile-memory { display: inline-flex; }
  .workspace.show-memory .fan-details-panel { display: block; position: absolute; top: 0; right: 0; bottom: 0; width: 320px; z-index: 2; box-shadow: -10px 0 40px #243a2512; }
  .workspace.show-memory #close-mobile-memory { display: inline-flex; }
  .outbox-view { padding-left: 5%; padding-right: 5%; }
  .outbox-list { grid-template-columns: 1fr; }
  .settings-view { grid-template-columns: 220px minmax(0, 1fr); }
  .settings-nav { padding-left: 21px; padding-right: 21px; }
  .settings-content { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 105px; padding: 12px 17px 0; gap: 11px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 9px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; min-height: 39px; justify-content: center; gap: 35px; }
  .nav-button { font-size: 12px; }
  .topbar-tools { grid-column: 2; grid-row: 1; gap: 3px; }
  .topbar-tools .text-button { font-size: 10px; }
  .control-strip { gap: 13px; padding: 15px 17px; }
  .account-status { min-width: 0; flex: 1; }
  .account-status strong { font-size: 12px; }
  .account-status div > span { max-width: 190px; font-size: 10px; }
  .account-status .badge { font-size: 9px; }
  .budget-summary { min-width: 150px; max-width: 180px; }
  .budget-summary > div:first-child { display: block; }
  .budget-summary > div:first-child > span { display: none; }
  .budget-summary strong { font-size: 10px; }
  .budget-summary small { font-size: 9px; }
  .global-actions { width: 100%; justify-content: space-between; gap: 7px; }
  .global-actions .button { padding: 7px 10px; font-size: 10px; }
  .global-actions .primary { flex: 1; }
  .setup-banner, .network-banner { padding: 13px 17px; gap: 12px; align-items: flex-start; }
  .setup-banner { flex-direction: column; }
  .setup-banner strong { font-size: 12px; }
  .setup-banner span { font-size: 11px; }
  .network-banner span { font-size: 11px; }
  .workspace { display: block; min-height: 530px; height: max(530px, calc(100dvh - 281px)); }
  .fans-panel { height: 100%; border-right: 0; }
  .panel-heading { padding-top: 22px; }
  .fan-item { padding: 17px 22px; gap: 13px; }
  .fan-item-heading strong { font-size: 13px; }
  .fan-preview { font-size: 12px; }
  .fan-item-meta { justify-content: flex-start; gap: 14px; }
  .conversation-panel { display: none; height: 100%; }
  .workspace.has-selection .fans-panel { display: none; }
  .workspace.has-selection .conversation-panel { display: flex; }
  .conversation-header { padding: 15px 14px; min-height: 79px; gap: 8px; }
  .conversation-header .mobile-only { display: inline-flex; width: 25px; padding: 3px; }
  .conversation-header .avatar { display: none; }
  .conversation-title { min-width: 90px; }
  .conversation-title h2 { font-size: 14px; }
  .conversation-header .button:not(.icon-button) { font-size: 9px; min-height: 30px; padding: 5px 8px; }
  .conversation-notice { padding: 11px 19px; font-size: 10px; }
  .messages-list { padding-left: 18px; padding-right: 18px; }
  .message { max-width: 91%; }
  .message-text { font-size: 12px; }
  .conversation-footer { padding: 12px 17px; }
  .conversation-footer p { font-size: 9px; }
  #mobile-memory { font-size: 10px; }
  .workspace.show-memory .fan-details-panel { width: 100%; background: var(--paper); padding: 0 25px; border: 0; }
  .workspace.show-memory .conversation-panel { visibility: hidden; }
  .app-footer { padding: 11px 17px; font-size: 9px; }
  .app-footer { flex-direction: column; gap: 4px; }
  .app-footer > span:last-child { font-size: 9px; }
  .outbox-view { padding: 29px 20px; }
  .page-heading { gap: 15px; align-items: flex-start; }
  .page-heading h1, .page-heading h2 { font-size: 24px; }
  .page-heading .button { font-size: 10px; }
  .outbox-item { padding: 20px; }
  .outbox-actions .button { font-size: 10px; }
  .settings-view { display: block; }
  .settings-nav { padding: 22px 20px 13px; border-right: 0; border-bottom: 1px solid var(--line); }
  .settings-nav h1 { font-size: 20px; margin-bottom: 14px; }
  .settings-nav > p, .settings-nav > .button { display: none; }
  .settings-nav nav { flex-direction: row; gap: 5px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 5px; }
  .settings-tab { width: auto; white-space: nowrap; font-size: 11px; padding: 8px 10px; }
  .settings-content { padding: 26px 20px 35px; }
  .settings-content .page-heading { flex-direction: column; }
  .settings-block { margin-bottom: 22px; padding-bottom: 22px; }
  .form-grid { gap: 17px 15px; }
  .field label { font-size: 10px; }
  .setup-checklist { padding: 17px; gap: 15px 10px; }
  .setup-checklist > div { font-size: 10px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { flex: 1; min-width: 180px; }
  .connect-footer { flex-direction: column; align-items: flex-start; gap: 17px; }
  .sticky-save { gap: 15px; }
  .sticky-save > span { font-size: 9px; }
  .sticky-save .button { font-size: 10px; }
  .offer-edit-card { padding: 17px; }
  .offer-edit-card .form-grid { grid-template-columns: 1fr; }
  .dialog { padding: 24px; }
  .dialog-heading h2 { font-size: 20px; }
}
@media (max-width: 400px) {
  .login-card { padding: 31px 25px; }
  .login-card h1 { font-size: 29px; }
  .control-strip .budget-summary { min-width: 118px; max-width: 128px; }
  .account-status div > span { max-width: 125px; }
  .account-status > .badge { display: none; }
  .main-nav { gap: 25px; }
  .global-actions .button { padding-left: 7px; padding-right: 7px; font-size: 9px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full-field { grid-column: auto; }
  .outbox-filters { gap: 2px; }
  .filter-button { font-size: 10px; }
  .dialog-actions .button { font-size: 11px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: dialog-enter .15s ease-out; }
  @keyframes dialog-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
.model-comparison-toolbar { flex-wrap: wrap; }
.model-comparison-toolbar select { max-width: 260px; }
.model-comparison-toolbar .field-help { flex-basis: 100%; }
.playground-variant { margin: 18px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.playground-variant h3 { overflow-wrap: anywhere; font-size: 13px; margin-bottom: 8px; }
.texting-bubble { max-width: 560px; background: #eff3ed; border-radius: 13px 13px 13px 3px; padding: 10px 14px; margin: 9px 0; }
.texting-bubble .playground-text { margin: 0 0 6px; }
.texting-bubble .quiet-label { display: block; font-size: 10px; }

/* Suivi des échanges : l'état d'envoi reste lisible au plus près du texte. */
.fan-filters { flex-wrap: wrap; gap: 3px; }
.fan-filters .filter-button { padding: 6px 9px; font-size: 11px; }
.fan-item-meta { flex-wrap: wrap; gap: 5px 10px; }
.ai-count { color: #45618a; font-weight: 600; }
.needs-review { color: var(--red); font-weight: 600; }
.thread-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 20px 4px; }
.thread-toolbar > div { display: flex; gap: 4px; }
.thread-toolbar .filter-button, .thread-toolbar .button { font-size: 11px; }
.thread-summary { padding: 3px 25px 12px; font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--line); }
.message.ai-message .message-bubble { background: #edf3fa; border-color: #d4e0ed; }
.delivery-label { display: block; font-size: 10px; font-weight: 650; color: #405d83; margin-bottom: 6px; }
.message.delivery-draft .message-bubble, .message.delivery-planned .message-bubble { background: #fcf8eb; border: 1px dashed #c6af76; }
.message.delivery-cancelled .message-bubble { background: var(--wash); border-style: dashed; }
.message.delivery-uncertain .message-bubble, .message.delivery-failed .message-bubble, .message.delivery-delete_failed .message-bubble { background: var(--red-soft); border-color: #dfb2ab; }
.delivery-error { font-size: 11px; color: var(--red); margin: 9px 0 0; }
.message-meta .button { font-size: 10px; padding: 2px 5px; min-height: 25px; }
.assistant-watch { padding: 16px; border: 1px solid #d4e0ed; border-radius: 10px; background: #f4f7fb; margin-bottom: 25px; }
.watch-heading { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.assistant-watch > p { font-size: 11px; color: var(--muted); margin: 10px 0 14px; }
.watch-counts { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #dce4ee; padding-top: 13px; }
.watch-counts > div { display: flex; flex-direction: column; gap: 2px; }
.watch-counts strong { font-size: 21px; font-weight: 550; color: #405d83; }
.watch-counts span { font-size: 10px; color: var(--muted); }
.assistant-watch .watch-model { font-size: 10px; padding-top: 10px; }
.fan-context-heading { font-size: 14px; margin-bottom: 16px; }
@media (max-width: 720px) {
  .thread-toolbar { padding: 8px 12px 3px; gap: 2px; }
  .thread-toolbar .filter-button, .thread-toolbar .button { font-size: 10px; padding: 5px 7px; }
  .thread-summary { padding: 4px 19px 10px; }
  .fan-filters { flex-wrap: nowrap; }
}

/* Le fil défile seul ; la navigation et la supervision restent à l'écran. */
.app-shell:has(#inbox-view:not([hidden])) { height: 100dvh; min-height: 0; overflow: hidden; }
.app-shell > :not(main) { flex-shrink: 0; }
#inbox-view { min-height: 0; height: auto; grid-template-rows: minmax(0, 1fr); }
.fan-details-panel { min-height: 0; }
.thread-legend { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 11px; }
.thread-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.fan { background: #b9beb3; }
.legend-dot.account { background: #8ca37a; }
.legend-dot.ai { background: #6287b6; }

/* PPV : progression commerciale et aperçu concret avant mise en file. */
.ppv-dialog { width: min(930px, calc(100% - 28px)); }
.ppv-dialog .dialog-heading p { margin: 8px 0 0; }
.ppv-ladder { display: flex; gap: 8px; padding: 0 0 6px; margin: 22px 0 10px; list-style: none; overflow-x: auto; }
.ppv-ladder li { display: flex; flex-direction: column; flex: 1; min-width: 116px; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.ppv-ladder span, .ppv-ladder small { font-size: 10px; color: var(--muted); }
.ppv-ladder strong { font-size: 18px; font-weight: 550; }
.ppv-ladder .completed { background: var(--sage-soft); }
.ppv-ladder .next { border-color: var(--sage); background: #f3f6ef; }
.ppv-ladder .locked { opacity: .7; }
.ppv-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 25px; align-items: start; }
.ppv-layout h3, .ppv-purchases h3 { font-size: 15px; }
.ppv-layout .section-heading { gap: 8px; }
.ppv-offers { display: flex; flex-direction: column; gap: 12px; }
.ppv-offer { padding: 15px; border: 1px solid var(--line); border-radius: 9px; }
.ppv-offer.selected { border-color: var(--sage); background: #f3f6ef; }
.ppv-offer .section-heading { margin-bottom: 7px; }
.ppv-offer .section-heading strong { font-size: 12px; }
.ppv-offer .ppv-price { white-space: nowrap; }
.ppv-offer p { margin: 6px 0 10px; }
.ppv-unavailable { font-size: 11px; color: var(--amber); }
.ppv-compose { position: sticky; top: 0; padding: 18px; background: var(--wash); border-radius: 10px; }
.ppv-compose .info-note { margin: 12px 0 18px; font-size: 12px; background: var(--paper); }
.ppv-last-message { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ppv-purchases { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.ppv-history-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ppv-history-row strong { font-size: 12px; }
.ppv-history-row p { margin: 4px 0 0; }
@media (max-width: 720px) {
  .ppv-layout { grid-template-columns: 1fr; gap: 18px; }
  .ppv-compose { position: static; }
  .ppv-dialog { padding: 20px; }
  .ppv-ladder li { min-width: 105px; }
  .conversation-header #open-ppv { padding-left: 7px; padding-right: 7px; }
}

/* Sylkchat : contraste calme, chrome aubergine et lecture claire du fil. */
:root { --canvas: #f5f4f7; --paper: #ffffff; --wash: #f0eef3; --sage-soft: #eee8f0; --sage: #725573; --sage-dark: #493449; --ink: #302e38; --muted: #74707c; --line: #e6e2e9; --line-strong: #cdc5d1; }
:focus-visible { outline-color: #9b82ae; }
input:focus, textarea:focus { outline-color: #c5b4d3; }
.topbar { background: #352d3c; color: #fff; border-bottom: 0; }
.topbar .brand small, .topbar .button.text-button { color: #d4cbdc; }
.topbar .nav-button { color: #c9c0d0; }
.topbar .nav-button.active { color: #fff; border-bottom-color: #d6b8e3; }
.topbar .nav-count { background: #5b4a65; color: #fff; }
.brand { letter-spacing: -.055em; font-size: 24px; }
.brand-mark { background: #6d537a; }
.brand-mark svg { display: none; }
.brand-mark::after { content: 'S'; font-size: 22px; font-weight: 700; font-style: italic; }
.control-strip { background: var(--paper); }
.account-status strong { font-weight: 650; }
#concurrency-status { max-width: none; font-variant-numeric: tabular-nums; color: #725573; }
.budget-summary strong, .ppv-price { font-variant-numeric: tabular-nums; }
.fan-item.active { background: #f0eaf3; box-shadow: inset 3px 0 #79598c; }
.fan-item:hover:not(.active) { background: #f7f5f9; }
.fan-item-heading strong { font-weight: 650; }
.fan-preview { color: #6e6875; }
.conversation-header { background: #fff; }
.messages-list { background: #faf9fb; }
.message.outgoing:not(.ai-message) .message-bubble { background: #eee8f2; border-color: #e0d5e7; }
.message.ai-message .message-bubble { background: #eaf2fc; border-color: #cedff4; }
.message.incoming .message-bubble { background: #fff; border-color: #e7e3ec; }
.message-bubble { box-shadow: 0 2px 5px #302e3804; }
.message-meta { color: #827989; }
.delivery-label { letter-spacing: .015em; }
.fan-details-panel { background: #fff; }
.ppv-ladder .next, .ppv-offer.selected { background: #f3edf6; }
.login-shell { background: #f0edf4; position: relative; justify-content: center; padding: 40px 20px; }
.login-brand { color: #493449; font-size: 28px; letter-spacing: -.045em; margin-bottom: 28px; }
.login-card { border-radius: 20px; padding: 36px 40px; box-shadow: 0 18px 70px #4934490c; }
.login-card h1 { font-size: 32px; letter-spacing: -.045em; }
.login-card #login-username { margin-bottom: 18px; }
.login-card .lock-symbol { margin-bottom: 20px; }
.login-shell footer { margin-top: 28px; }
.team-dialog { width: min(570px, calc(100% - 28px)); }
.team-member { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.team-member .button { margin-left: auto; }
#team-form { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
#team-form > button { margin-top: 18px; }
#team-created { margin-top: 20px; }
body[data-role='viewer'] #fan-pause, body[data-role='viewer'] #takeover-button, body[data-role='viewer'] #open-ppv, body[data-role='viewer'] #memory-form button, body[data-role='viewer'] .message-meta button, body[data-role='viewer'] .outbox-actions button { display: none !important; }
body[data-role='viewer'] #fan-memory { pointer-events: none; }
body[data-role='viewer'] .global-actions, body[data-role='operator'] .global-actions,
body[data-role='viewer'] [data-view='settings'], body[data-role='operator'] [data-view='settings'],
body[data-role='viewer'] [data-view='playground'], body[data-role='operator'] [data-view='playground'],
body[data-role='viewer'] #team-button, body[data-role='operator'] #team-button,
body[data-role='viewer'] #ppv-catalog, body[data-role='operator'] #ppv-catalog,
body[data-role='viewer'] .alert-item .form-actions, body[data-role='operator'] .alert-item .form-actions { display: none !important; }
@media (max-width: 720px) { .login-card { padding: 28px; } .brand { font-size: 21px; } .main-nav { gap: 25px; } #concurrency-status { font-size: 9px; white-space: normal; } .topbar-tools { gap: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
.topbar .icon-button { color: #eee8f2; }
.topbar .brand small { background: #51465b; color: #e4dce9; border-color: #6a5a76; }
.fans-panel, .conversation-footer { background: #fdfcfe; }
.setup-banner { background: #f2eef5; }
body[data-role='viewer'] .notes-form button { display: none !important; }

/* V1.1: operator work stays in the conversation. */
.reply-composer { padding: 12px 20px; border-top: 1px solid #e5dfeb; background: #fff; flex-shrink: 0; }
.composer-heading, .composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reply-composer textarea { width: 100%; min-height: 54px; max-height: 120px; margin: 7px 0; resize: vertical; }
.composer-heading label { font-weight: 600; font-size: 12px; }
.composer-actions .field-help { margin: 0; flex: 1; font-size: 11px; }
.supervision-panel { margin: 18px 0; border-top: 1px solid #e5dfeb; padding-top: 12px; }
.supervision-panel summary { font-size: 12px; font-weight: 600; cursor: pointer; margin-bottom: 10px; }
.supervision-panel label { display: block; font-size: 11px; margin: 10px 0 5px; }
.supervision-panel input:not([type='checkbox']), .supervision-panel textarea, .supervision-panel select { width: 100%; }
.supervision-panel .check-field { display: flex; gap: 8px; align-items: center; }
.fact-entry { border-bottom: 1px solid #e5dfeb; padding: 6px 0; font-size: 12px; }
.fact-entry small { color: #797180; }
.response-diagnostic { margin-top: 10px; border-top: 1px solid #d8e3f2; padding-top: 8px; font-size: 10px; overflow-wrap: anywhere; }
.response-diagnostic summary { cursor: pointer; }
.response-diagnostic blockquote { margin: 6px 0; padding-left: 8px; border-left: 2px solid #bacbe1; }
body[data-role='viewer'] .reply-composer, body[data-role='viewer'] #supervision-form, body[data-role='viewer'] #fact-form { display: none; }
@media (max-width: 700px) {
  .reply-composer { padding: 8px 12px; }
  .composer-actions { flex-wrap: wrap; }
  .composer-actions .field-help { flex-basis: 100%; }
  .composer-heading .quiet-label { font-size: 9px; }
  .conversation-footer { padding: 6px 12px; min-height: 30px; }
  body:has(#inbox-view.has-selection) .setup-banner { display: none; }
  .response-diagnostic { max-width: 260px; }
}

#cost-dialog { width: min(620px, 92vw); max-height: 85vh; padding: 22px; border: 1px solid #e5dfeb; border-radius: 16px; }
#cost-dialog::backdrop { background: #211b2955; }
.cost-row { padding: 12px 0; border-bottom: 1px solid #e5dfeb; font-size: 12px; overflow-wrap: anywhere; }
.cost-row p { margin: 5px 0; color: #797180; }
@media (max-width: 700px) {
  body:has(#inbox-view.has-selection) .topbar { padding-top: 6px; padding-bottom: 6px; }
  body:has(#inbox-view.has-selection) .global-status { padding-top: 6px; padding-bottom: 6px; }
}
/* Contain off-screen accessible labels inside the scrolling workspace. */
.app-shell { position: relative; }
.fan-details-panel { position: relative; }

@media (max-width: 700px) {
  body:has(#inbox-view.has-selection) .topbar { display: none; }
  body:has(#inbox-view.has-selection) .control-strip { padding: 8px 12px; gap: 8px; }
  body:has(#inbox-view.has-selection) .conversation-header { min-height: 68px; padding: 10px 12px; }
  body:has(#inbox-view.has-selection) .thread-toolbar { padding-top: 6px; padding-bottom: 6px; }
  .composer-actions .field-help:not(.danger-text) { display: none; }
  .reply-composer textarea { min-height: 44px; height: 50px; }
}
