/* Brand: Talk · Brand book · Moodboard, plus the Brand entry in the workspace tabs. */
.workspace-section-nav .workspace-brand-link{display:inline-flex;align-items:center;gap:8px;margin-left:auto;padding-bottom:12px}
.workspace-brand-photo{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;overflow:hidden;background:var(--raised);color:var(--muted);font-size:9px;font-weight:600;letter-spacing:.02em}
.workspace-brand-photo img{width:100%;height:100%;object-fit:cover}

.brand-shell-head{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--space-5);flex-wrap:wrap;margin-bottom:var(--space-6)}
.brand-shell-head h1{margin:0 0 6px;font-size:var(--type-title);font-weight:600;letter-spacing:-.035em;line-height:1.07}
.brand-shell-head p{margin:0;color:var(--muted);font-size:14px;max-width:58ch}
.brand-views{display:inline-flex;padding:3px;border-radius:999px;background:var(--raised);border:1px solid var(--line)}
.brand-views button{min-height:32px;padding:0 16px;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:13px;font-weight:500;cursor:pointer;transition:background var(--motion-fast) ease,color var(--motion-fast) ease,box-shadow var(--motion-fast) ease}
.brand-views button[aria-selected="true"]{background:var(--panel);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.18)}
.brand-views button:focus-visible{outline:2px solid var(--focus,#0a84ff);outline-offset:2px}
.brand-view{animation:assist-in 180ms var(--motion-ease) both}
.brand-earlier{margin-top:var(--space-6);color:var(--muted);font-size:13px}
.brand-earlier summary{cursor:pointer;width:max-content}
.brand-earlier[open]>div{margin-top:var(--space-4)}

/* Talk */
.assist-brand{max-width:760px}
.assist-progress{display:flex;flex-wrap:wrap;gap:4px 6px;margin:0 0 var(--space-5)}
.assist-progress button{display:inline-flex;align-items:center;gap:7px;min-height:30px;padding:0 11px;border:1px solid transparent;border-radius:999px;background:transparent;color:var(--muted);font-size:12px;cursor:pointer;transition:background var(--motion-fast) ease,color var(--motion-fast) ease}
.assist-progress button:hover,.assist-progress button[aria-current]{background:var(--raised);color:var(--text)}
.assist-progress button[aria-current]{border-color:var(--line)}
.assist-dot{width:7px;height:7px;border-radius:50%;border:1.5px solid var(--muted);flex:none}
.assist-dot[data-state="part"]{background:linear-gradient(90deg,var(--text) 50%,transparent 50%);border-color:var(--text)}
.assist-dot[data-state="done"]{background:var(--text);border-color:var(--text)}
.assist-question{margin:var(--space-3) 0 0;font-size:19px!important;font-weight:600;line-height:1.35!important;letter-spacing:-.015em;text-wrap:pretty}
.assist-reply>.assist-question:first-child{margin-top:0}
.assist-upload{display:flex;gap:var(--space-4);align-items:flex-start}
.assist-upload h3{margin-bottom:var(--space-2)}
.assist-thumb{width:64px;height:64px;flex:none;border-radius:12px;object-fit:cover;background:var(--raised);border:1px solid var(--line)}
.assist-choices{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.assist-choices .quiet{min-height:34px;padding:0 14px;border-radius:999px}
.assist-palette{display:flex;flex-direction:column;gap:2px}
.assist-palette li{display:flex;align-items:center;gap:var(--space-3);min-height:40px}
.assist-palette input{width:18px;height:18px;margin:0;accent-color:var(--focus,#0a84ff)}
.assist-swatch{width:28px;height:28px;border-radius:8px;background:var(--swatch);border:1px solid color-mix(in srgb,var(--text) 14%,transparent)}
.assist-palette code{font:12px var(--font-data);color:var(--muted);min-width:64px}
.assist-palette select{width:auto;min-width:150px;min-height:32px;font-size:13px}
.assist-composer.is-drop{border-color:var(--focus,#0a84ff);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus,#0a84ff) 22%,transparent)}

/* Brand book */
.bible-layout.is-book{display:block}
.bible-layout.is-book .bible-index{display:none}
.book-heading{justify-content:flex-end;margin:0 0 var(--space-2)}
.book{max-width:860px}
.book-group{padding:var(--space-6) 0 var(--space-2);border-top:1px solid var(--line)}
.book-group:first-of-type{margin-top:var(--space-6)}
.book-group>h3{margin:0 0 var(--space-4);font-size:var(--type-section);font-weight:600;letter-spacing:-.025em}
.book-section{position:relative;padding:var(--space-2) 0 var(--space-4)}
.book-section h4{margin:0 0 var(--space-2);font-size:15px;font-weight:600}
.book-section+.book-section{border-top:1px solid color-mix(in srgb,var(--line) 60%,transparent);padding-top:var(--space-4)}
.book-edit{position:absolute;top:0;right:0;font-size:13px;opacity:.72;transition:opacity var(--motion-fast) ease}
.book-section:hover .book-edit,.book-edit:focus-visible{opacity:1}
.book-section:has(h4) .book-edit{top:var(--space-4)}
.book-section:first-child .book-edit{top:var(--space-2)}
.book-read{padding-right:56px}
.book-facts{display:grid;gap:var(--space-3);margin:0}
.book-facts>div{display:grid;grid-template-columns:150px minmax(0,1fr);gap:var(--space-4)}
.book-facts dt{color:var(--muted);font-size:13px;padding-top:2px}
.book-facts dd{margin:0;font-size:15px;line-height:1.55}
.book-facts dd p{margin:0 0 6px}
.book-facts dd p:last-child{margin-bottom:0}
.book-facts dd strong{font-weight:600}
.book-empty{margin:0;color:var(--muted);font-size:14px}
.book-empty .text-button{display:inline;min-height:0;padding:0;font-size:14px;color:var(--text);text-decoration:underline;text-underline-offset:3px;text-decoration-color:var(--line)}
.book-story{padding:var(--space-3) 0}
.book-story+.book-story{border-top:1px solid color-mix(in srgb,var(--line) 60%,transparent)}
.book-story>strong{display:block;font-size:15px}
.book-story>small{display:block;margin:2px 0 var(--space-3);color:var(--muted);font-size:12px}
.book-tiles{display:flex;flex-wrap:wrap;gap:var(--space-3)}
.book-tiles img{width:112px;height:112px;object-fit:contain;padding:10px;border-radius:14px;background:var(--raised);border:1px solid var(--line)}
.book-swatches{display:flex;flex-wrap:wrap;gap:var(--space-3)}
.book-swatches span{display:flex;flex-direction:column;justify-content:flex-end;width:132px;height:96px;padding:10px 12px;border-radius:14px;background:var(--swatch);color:var(--swatch-ink);border:1px solid color-mix(in srgb,var(--text) 10%,transparent)}
.book-swatches b{font-size:13px;font-weight:600}
.book-swatches small{font:11px var(--font-data);opacity:.8}
.book-font{display:flex;align-items:baseline;gap:var(--space-3);margin:0 0 var(--space-2)}
.book-font span{font-size:28px;letter-spacing:-.01em}
.book-font small{color:var(--muted);font-size:12px}
.book-section.is-editing{margin:var(--space-2) calc(-1 * var(--space-5));padding:var(--space-4) var(--space-5);border-radius:var(--radius-panel);background:var(--panel);border:1px solid var(--line);animation:assist-in 180ms var(--motion-ease) both}
.book-editor .bible-section-head h3{display:none}
.book-editor .bible-section-head p{margin-top:0}
.book-done{display:flex;justify-content:flex-end;padding-top:var(--space-3)}
.book-done .quiet{min-height:36px;padding:0 18px;border-radius:999px}

:root[data-theme="light"] .brand-views{background:#eef0f3;border-color:#e3e6ea}
:root[data-theme="light"] .brand-views button[aria-selected="true"]{background:#fff;box-shadow:0 1px 3px rgba(40,52,70,.12)}
:root[data-theme="light"] .book-section.is-editing{background:rgba(255,255,255,.9);border-color:var(--glass-line);box-shadow:var(--glass-shadow)}

@media (max-width:720px){
 .brand-shell-head{margin-bottom:var(--space-5)}
 .brand-views{width:100%}
 .brand-views button{flex:1;padding:0 8px}
 .book-heading{margin:0 0 var(--space-3)}
 .book-facts>div{grid-template-columns:1fr;gap:2px}
 .book-read{padding-right:0}
 .book-edit{position:static;display:inline-block;margin-bottom:var(--space-2)}
 .book-section.is-editing{margin-left:calc(-1 * var(--space-3));margin-right:calc(-1 * var(--space-3));padding:var(--space-3)}
 .workspace-section-nav .workspace-brand-link{margin-left:0}
}
@media (prefers-reduced-motion:reduce){
 .brand-view,.book-section.is-editing{animation:none}
 .brand-views button,.assist-progress button,.book-edit{transition:none}
}

/* Stacked header like a project page, pinned while the page scrolls. */
.brand-shell-head.is-stacked{position:sticky;top:0;z-index:6;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:12px;margin-bottom:var(--space-5);padding:4px 0 14px;background:var(--bg)}
.brand-shell-head.is-stacked::after{content:"";position:absolute;left:0;right:0;top:100%;height:18px;background:linear-gradient(var(--bg),transparent);pointer-events:none}
.brand-shell-head.is-stacked h1{margin:0}
.brand-shell-head.is-stacked .brand-views{align-self:flex-start}

/* Brand book progress, centred above the brand kit card. */
.book-progress{justify-content:center;max-width:860px;margin:0 0 var(--space-4)}

/* Header tab row: views on the left; the current view's status and actions (Saved on this Mac · Share) on the right. */
.brand-shell-head.is-stacked .brand-head-row{display:flex;align-items:center;justify-content:space-between;gap:16px;align-self:stretch;flex-wrap:wrap}
.brand-view-actions{display:flex;align-items:center;gap:12px;margin-left:auto;min-height:36px}
.brand-view-actions:empty{display:none}
.brand-view-actions .bible-heading-actions{gap:12px;flex-wrap:nowrap}
.brand-view-actions .bible-save,.brand-view-actions .board-status{font-size:12.5px;color:var(--muted);white-space:nowrap}
/* The Brand book fills the page up to 1240px and sits centred in it, like Projects and the Planner. */
.bible:has(.bible-layout.is-book){max-width:none}
.book,.book-progress{max-width:1240px;margin-inline:auto}
.brand-view-actions details{margin:0}
/* A failed save stays red in the header, and long messages shorten instead of pushing the row wider (full text on hover). */
.brand-view-actions .bible-save.bible-save-error{color:var(--danger,#c2410c)}
.brand-view-actions{min-width:0;max-width:100%}
.brand-view-actions .bible-heading-actions{min-width:0}
.brand-view-actions .bible-save,.brand-view-actions .board-status{min-width:0;overflow:hidden;text-overflow:ellipsis}

