/*
 * ThinkPilot design system.
 * Colours, spacing and component states are intentionally kept as readable CSS.
 * No preprocessing, generated class names, external fonts or minified assets.
 */
:root {
  --paper: #f7f6f2;
  --surface: #ffffff;
  --ink: #262821;
  --muted: #72756b;
  --line: #e6e7df;
  --line-strong: #d1d4c6;
  --accent: #d96b32;
  --accent-dark: #aa4a19;
  --accent-soft: #fcf0e7;
  --green: #386457;
  --green-soft: #eef5ee;
  --red: #a44338;
  --shadow: 0 8px 30px #25292108;
  --radius: 12px;
  --sidebar: 230px;
  font-family: 'Inter', 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, textarea, select { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-weight: 500; font-size: 40px; line-height: 1.18; letter-spacing: -1.6px; }
h2 { font-weight: 550; font-size: 22px; letter-spacing: -.65px; }
h3 { font-size: 16px; font-weight: 550; line-height: 1.4; }
p { line-height: 1.65; }
small { line-height: 1.5; }
[hidden] { display: none !important; }
svg { flex-shrink: 0; vertical-align: middle; }
textarea { resize: vertical; }
.boot-message { padding: 20vh 12vw; color: var(--muted); }
.skip-link { position: fixed; top: -80px; left: 12px; z-index: 1000; padding: 12px; background: white; }
.skip-link:focus { top: 10px; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 1.6px; font-size: 10px; font-weight: 650; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.button, .icon-button, .nav-item, .mode-button, .purpose-card, .space-card, .text-button, .tab {
  border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: none; transition: background .15s, border-color .15s, transform .15s; text-align: left;
}
.button { min-height: 38px; padding: 9px 14px; border-radius: 8px; font-size: 12px; font-weight: 550; border-color: var(--line); background: white; }
.button:hover:not(:disabled) { background: var(--paper); border-color: var(--line-strong); }
.button-primary { background: var(--ink); color: white; border-color: var(--ink); }
.button-primary:hover:not(:disabled) { background: #43483c; border-color: #43483c; }
.button-accent { background: var(--accent); color: white; border-color: var(--accent); }
.button-accent:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.button-danger { color: var(--red); }
.button-small { min-height: 31px; padding: 6px 10px; font-size: 11px; }
.full-width { width: 100%; }
.icon-button { width: 34px; height: 34px; border-radius: 7px; color: var(--muted); padding: 0; flex-shrink: 0; }
.icon-button:hover:not(:disabled) { background: #eeefe7; color: var(--ink); }
.text-button { padding: 4px 0; color: var(--muted); font-size: 12px; }
.text-button:hover { color: var(--accent-dark); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 550; padding: 5px 8px; border-radius: 5px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.pill-accent { color: var(--accent-dark); background: var(--accent-soft); }
.pill-green { color: var(--green); background: var(--green-soft); }
.status-dot { height: 6px; width: 6px; display: inline-block; background: var(--green); border-radius: 100%; }
.input { width: 100%; background: white; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font-size: 13px; min-width: 0; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #d96b3210; }
.input::placeholder { color: #94988b; }
.textarea { line-height: 1.6; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field label { font-size: 12px; font-weight: 550; }
.field small { font-size: 11px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error { color: var(--red); background: #fbefed; border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.6; }
.notice { border: 1px solid #edd9b9; background: #fffbf2; color: #7b6643; padding: 12px 14px; border-radius: 8px; font-size: 11px; line-height: 1.65; }
.notice-neutral { background: var(--paper); border-color: var(--line); color: var(--muted); }
.empty-state { text-align: center; padding: 48px 28px; color: var(--muted); }
.empty-state svg { margin-bottom: 14px; color: var(--accent); }
.empty-state h3 { color: var(--ink); }
.empty-state p { font-size: 12px; max-width: 360px; margin: 0 auto 20px; }
.is-busy { opacity: .65; }
.is-busy::after { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 100%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Persistent application shell. */
.shell { min-height: 100vh; }
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar); padding: 27px 16px 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; background: var(--paper); }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 9px 31px; }
.brand-name { font-size: 22px; letter-spacing: -1px; font-weight: 550; }
.workspace-label { display: flex; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; margin-bottom: 21px; gap: 8px; }
.workspace-avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; font-size: 10px; background: #e8e9df; border-radius: 6px; }
.nav-item { width: 100%; justify-content: flex-start; padding: 10px 11px; margin: 2px 0; border-radius: 7px; color: var(--muted); font-size: 12px; }
.nav-item:hover { background: #efefe7; color: var(--ink); }
.nav-item.active { background: #eaece2; color: var(--ink); font-weight: 550; }
.nav-item.active svg { color: var(--accent); }
.sidebar-section { margin: 29px 11px 11px; }
.space-nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; min-height: 0; }
.space-nav .nav-item { font-size: 11px; line-height: 1.4; }
.space-nav .nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-bullet { width: 6px; height: 6px; border: 1px solid #999e8b; border-radius: 2px; margin: 0 5px; flex-shrink: 0; }
.sidebar-bottom { margin-top: auto; padding-top: 25px; }
.sidebar-note { padding: 12px; font-size: 10px; color: var(--muted); line-height: 1.7; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 13px; }
.account { padding: 12px 6px 0; display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--line); }
.account-name { font-size: 11px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.account small { font-size: 9px; display: block; margin-top: 3px; }
.main-wrap { margin-left: var(--sidebar); }
.topbar { height: 73px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 34px; gap: 12px; background: #fbfbf8; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; flex: 1; }
.breadcrumb strong { font-weight: 500; color: var(--ink); }
.search-trigger { display: flex; align-items: center; gap: 9px; border: none; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
kbd { border: 1px solid var(--line); padding: 3px 5px; font-size: 9px; border-radius: 4px; font-family: inherit; }
.mobile-menu { display: none; }

/* Authentication and first-run experience. */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-story { padding: 50px 10vw 60px 6vw; display: flex; flex-direction: column; justify-content: space-between; background: #eeeee5; }
.auth-story .brand { padding: 0; }
.auth-story h1 { font-size: 53px; max-width: 450px; margin-bottom: 23px; letter-spacing: -2.1px; }
.auth-story p { max-width: 360px; color: var(--muted); font-size: 14px; }
.auth-story footer { font-size: 10px; color: var(--muted); }
.auth-concept { display: flex; gap: 10px; align-items: center; margin-top: 44px; font-size: 11px; }
.auth-concept span { background: #ffffffa0; padding: 9px 14px; border: 1px solid #dfe1d6; border-radius: 8px; }
.auth-form-wrap { padding: 50px; display: flex; align-items: center; justify-content: center; background: #fff; }
.auth-form { max-width: 370px; width: 100%; }
.auth-form h2 { font-size: 29px; margin: 12px 0; }
.auth-form > p { font-size: 12px; color: var(--muted); margin-bottom: 31px; }
.auth-form .field { margin-bottom: 18px; }
.auth-form .input { padding: 12px 13px; }
.auth-switch { text-align: center; margin: 20px 0; font-size: 12px; }
.auth-switch button { color: var(--accent-dark); margin-left: 5px; }
.auth-privacy { font-size: 10px; text-align: center; color: var(--muted); line-height: 1.8; padding-top: 18px; }

/* Home: a spacious, purposeful blank state, not a blank chat transcript. */
.home { max-width: 1180px; margin: auto; padding: 56px 60px 50px; }
.home-heading { margin: 0 0 32px; }
.home-heading .eyebrow { margin-bottom: 19px; }
.home-heading h1 { margin-bottom: 14px; }
.home-heading p { font-size: 13px; color: var(--muted); }
.composer { background: #fff; border: 1px solid var(--line-strong); border-radius: 13px; box-shadow: var(--shadow); padding: 19px 20px 15px; }
.composer textarea { background: none; border: none; resize: none; width: 100%; min-height: 82px; font-size: 17px; line-height: 1.65; padding: 0 2px; }
.composer textarea::placeholder { color: #a2a498; }
.composer textarea:focus { outline: none; }
.composer-footer { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 13px; }
.composer-footer small { color: var(--muted); font-size: 10px; flex: 1; }
.purpose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.purpose-card { border: 1px solid var(--line); padding: 15px 13px; border-radius: 9px; align-items: flex-start; justify-content: flex-start; gap: 10px; background: #fafaf6; }
.purpose-card svg { color: #7c8171; margin-top: 2px; }
.purpose-card.active { background: white; border-color: #b3b9a1; }
.purpose-card.active svg { color: var(--accent); }
.purpose-card:hover { background: white; border-color: var(--line-strong); }
.purpose-card strong { display: block; font-size: 11px; font-weight: 550; }
.purpose-card small { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }
.example-invite { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 20px; color: var(--muted); font-size: 11px; }
.example-invite button { color: var(--accent-dark); }
.home-stats { display: flex; gap: 35px; border-bottom: 1px solid var(--line); padding: 16px 0 23px; margin-top: 14px; }
.stat { font-size: 11px; color: var(--muted); }
.stat strong { color: var(--ink); font-size: 21px; font-weight: 500; margin-right: 7px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 31px 0 15px; }
.section-heading h2 { font-size: 15px; margin: 0; letter-spacing: -.2px; }
.section-heading small { color: var(--muted); font-size: 10px; }
.space-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.space-card { padding: 20px; background: white; border-color: var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.space-card:hover { border-color: #b5bda8; transform: translateY(-2px); box-shadow: var(--shadow); }
.space-card .eyebrow { font-size: 9px; margin: 0; letter-spacing: 1px; }
.space-card h3 { margin: 23px 0 18px; min-height: 45px; font-size: 15px; }
.space-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); }

/* Thoughtspace chrome and right-hand thinking panel. */
.editor { height: calc(100vh - 73px); display: flex; flex-direction: column; background: #fcfcf9; }
.editor-heading { padding: 23px 25px 17px; display: flex; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); min-height: 91px; background: #fff; }
.editor-title { overflow-wrap: anywhere; border: none; background: none; font-size: 21px; padding: 0; letter-spacing: -.7px; text-align: left; font-weight: 500; max-width: 650px; }
.editor-subtitle { display: flex; gap: 9px; align-items: center; font-size: 10px; color: var(--muted); margin-top: 9px; }
.editor-actions { display: flex; align-items: center; gap: 5px; }
.editor-tabs { min-width: 0; overflow-x: auto; height: 49px; min-height: 49px; display: flex; align-items: stretch; gap: 21px; padding: 0 26px; background: #fff; border-bottom: 1px solid var(--line); }
.tab { padding: 0; color: var(--muted); border-bottom: 2px solid transparent; font-size: 11px; border-radius: 0; }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { font-size: 9px; background: var(--paper); padding: 2px 5px; border-radius: 4px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 326px; flex: 1; min-height: 0; }
.editor-main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.editor-side { border-left: 1px solid var(--line); background: white; min-height: 0; display: flex; flex-direction: column; }
.side-tabs { min-height: 43px; border-bottom: 1px solid var(--line); display: flex; gap: 18px; padding: 0 21px; }
.side-tabs .tab { font-size: 11px; }
.side-body { padding: 24px 20px; overflow-y: auto; flex: 1; }
.side-intro { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid #efd9c6; background: var(--accent-soft); border-radius: 11px; color: var(--accent); margin-bottom: 18px; }
.side-body h2 { font-size: 19px; letter-spacing: -.6px; margin-bottom: 9px; }
.side-body > p, .side-description { color: var(--muted); font-size: 11px; line-height: 1.75; }
.selection-summary { border: 1px solid var(--line); border-radius: 7px; padding: 10px; background: #fcfcf9; font-size: 10px; line-height: 1.6; margin: 19px 0; }
.selection-summary strong { color: var(--ink); display: block; margin-bottom: 3px; font-weight: 550; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 18px; }
.mode-button { border: 1px solid var(--line); border-radius: 7px; padding: 12px 10px; justify-content: flex-start; font-size: 11px; color: #646b5c; }
.mode-button.active { background: var(--accent-soft); border-color: #e9c1a5; color: var(--accent-dark); }
.mode-button:hover { border-color: #c8cdbb; }
.mode-help { min-height: 36px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.more-modes { font-size: 10px; color: var(--muted); }
.more-modes summary { cursor: pointer; padding: 0 0 10px; }
.more-modes .mode-grid { margin-top: 0; }
.side-footnote { padding-top: 16px; margin-bottom: 0; font-size: 10px; color: var(--muted); line-height: 1.7; }
.health-box { border-top: 1px solid var(--line); margin-top: 25px; padding-top: 19px; }
.health-box .eyebrow { font-size: 9px; }
.health-row { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 13px; }
.health-row strong { font-weight: 550; color: var(--ink); }
.proposal-summary { margin-top: 15px; padding-bottom: 10px; font-size: 12px; line-height: 1.7; }
.proposal-card { border: 1px solid var(--line); padding: 12px; border-radius: 9px; margin-bottom: 9px; }
.proposal-card .row { align-items: flex-start; }
.proposal-card input[type=checkbox] { accent-color: var(--accent); margin: 2px 0; }
.proposal-card .kind-badge { margin-bottom: 8px; }
.proposal-card .input { font-size: 11px; padding: 7px; margin-top: 7px; }
.proposal-card summary { font-size: 10px; color: var(--muted); cursor: pointer; margin-top: 9px; }
.proposal-card .proposal-title { font-size: 12px; line-height: 1.5; font-weight: 550; }
.proposal-actions { position: sticky; bottom: -24px; background: white; padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 14px; }
.side-body .notice { font-size: 10px; padding: 10px; }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.inspector .input { font-size: 12px; }
.provenance { font-size: 10px; padding: 13px; background: var(--paper); border-radius: 8px; line-height: 1.8; color: var(--muted); }
.relation-row { display: flex; align-items: center; gap: 5px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.relation-row strong { font-size: 11px; display: block; margin-top: 4px; font-weight: 500; }
.citation-link { border: 1px solid var(--line); width: 100%; border-radius: 7px; padding: 10px; font-size: 10px; display: flex; align-items: center; gap: 8px; background: white; margin-top: 7px; }
.activity-item { border-left: 1px solid var(--line); padding: 0 0 22px 15px; margin-left: 6px; position: relative; }
.activity-item::before { content: ''; width: 6px; height: 6px; border-radius: 100%; position: absolute; left: -4px; top: 3px; background: #b6c0a2; }
.activity-item p { font-size: 11px; margin-bottom: 6px; }
.activity-item small { font-size: 9px; color: var(--muted); }
.conflict-banner { padding: 12px 22px; background: #fff2dc; font-size: 12px; display: flex; gap: 12px; align-items: center; }

/* Spatial graph. Nodes are accessible DOM elements; relationships are SVG. */
.canvas { flex: 1; position: relative; min-height: 280px; overflow: hidden; background-color: #fafbf7; background-image: radial-gradient(#cdd3c3 0.75px, transparent .75px); background-size: 22px 22px; touch-action: none; cursor: grab; }
.canvas.panning { cursor: grabbing; }
.graph-world { position: absolute; inset: 0 auto auto 0; transform-origin: 0 0; will-change: transform; }
.edge-layer { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; width: 1px; height: 1px; }
.graph-edge { stroke: #bfc8b0; stroke-width: 1.6; fill: none; pointer-events: stroke; cursor: pointer; }
.graph-edge:hover { stroke: var(--accent); stroke-width: 3; }
.graph-edge-label { font-size: 10px; fill: #858f79; paint-order: stroke; stroke: #fafbf7; stroke-width: 7; stroke-linejoin: round; pointer-events: none; }
.thought-card { position: absolute; width: 270px; min-height: 152px; padding: 16px 17px 13px; background: white; border: 1px solid #d9ded0; border-radius: 10px; box-shadow: 0 3px 9px #35422b05; cursor: default; touch-action: none; }
.thought-card:hover { border-color: #a9b797; box-shadow: 0 4px 14px #35422b0c; }
.thought-card.selected { border: 1.5px solid #72835d; box-shadow: 0 0 0 3px #72835d16; padding: 15.5px 16.5px 12.5px; }
.thought-card.kind-question { background: #f4f6ed; border-color: #a8b691; }
.thought-card.kind-decision { background: #f1f6ef; border-color: #8faa80; }
.card-drag-handle { display: flex; justify-content: space-between; align-items: center; cursor: grab; margin-bottom: 12px; min-height: 19px; }
.kind-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; font-weight: 650; text-transform: uppercase; letter-spacing: 1px; color: #727b64; }
.kind-evidence .kind-badge { color: #557865; }
.kind-assumption .kind-badge { color: #a67c3c; }
.kind-unknown .kind-badge { color: #857458; }
.kind-insight .kind-badge { color: var(--accent-dark); }
.thought-card h3 { font-size: 15px; line-height: 1.45; margin: 0 0 8px; letter-spacing: -.2px; font-weight: 550; }
.thought-card h3[contenteditable=true] { outline: 1px solid var(--accent); padding: 3px; cursor: text; }
.thought-card p { font-size: 10px; color: #858b7b; line-height: 1.6; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-footer { display: flex; align-items: center; gap: 8px; margin-top: 13px; font-size: 9px; color: #939989; }
.card-footer .source-indicator { color: #557865; display: inline-flex; align-items: center; gap: 4px; }
.card-connect { position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; padding: 0; border-radius: 100%; border: 1.5px solid #a5b696; background: white; }
.card-connect:hover { background: var(--accent); border-color: var(--accent); }
.canvas-controls { position: absolute; bottom: 18px; left: 20px; display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 3px; box-shadow: var(--shadow); z-index: 2; }
.zoom-label { font-size: 10px; color: var(--muted); min-width: 37px; text-align: center; }
.canvas-guide { position: absolute; top: 15px; left: 20px; color: #909682; font-size: 9px; pointer-events: none; display: flex; gap: 6px; align-items: center; background: #fafbf7df; padding: 5px; border-radius: 4px; }
.canvas-key { position: absolute; bottom: 27px; right: 17px; font-size: 9px; color: #9a9f8f; pointer-events: none; }
.composer-bar { border-top: 1px solid var(--line); padding: 13px 18px; background: #fff; display: flex; align-items: center; gap: 9px; }
.composer-bar .input { background: #fafbf7; border-color: var(--line); font-size: 11px; }
.composer-bar select { width: 110px; flex-shrink: 0; }
.composer-bar .icon-button { background: var(--ink); color: white; }

/* Alternate graph views, source library and decision memory. */
.outline { overflow-y: auto; padding: 27px; flex: 1; background: #fbfcf8; }
.outline-group { margin-bottom: 25px; }
.outline-group > summary { cursor: pointer; padding: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.outline-item { padding: 14px 15px; border: 1px solid var(--line); border-radius: 8px; background: white; margin-bottom: 7px; cursor: pointer; display: flex; gap: 12px; }
.outline-item.selected { border-color: #8c9c77; background: #f4f7ed; }
.outline-item input { accent-color: #74895f; }
.outline-item h3 { margin-bottom: 5px; font-size: 13px; }
.outline-item p { margin-bottom: 6px; font-size: 11px; color: var(--muted); white-space: pre-wrap; }
.outline-item small { font-size: 9px; color: var(--muted); }
.content-panel { overflow-y: auto; padding: 30px; flex: 1; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.panel-title h2 { margin-bottom: 6px; }
.panel-title p { color: var(--muted); font-size: 11px; margin: 0; }
.source-row { display: flex; gap: 15px; align-items: center; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 10px; }
.source-row > svg { color: #8a957d; }
.source-row h3 { font-size: 13px; margin: 0 0 5px; }
.source-row small { font-size: 10px; color: var(--muted); }
.source-row .source-error { color: var(--red); display: block; font-size: 11px; padding-top: 5px; }
.file-input { display: none; }
.source-chunk { padding: 17px; border: 1px solid var(--line); border-radius: 8px; margin: 13px 0; }
.source-chunk pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.8; font-family: inherit; color: #52594a; margin: 12px 0; }
.source-chunk .eyebrow { font-size: 9px; }
.source-quote { white-space: pre-wrap; line-height: 1.8; font-size: 12px; padding: 17px; background: #f6f8f1; border-left: 2px solid #a7b793; margin: 16px 0; }
.library { padding: 42px; max-width: 1220px; margin: auto; }
.library-heading { margin-bottom: 30px; }
.library-heading h1 { font-size: 33px; margin-bottom: 12px; }
.library-heading p { color: var(--muted); font-size: 12px; }
.decision-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: white; margin-bottom: 13px; }
.decision-card h3 { font-size: 17px; margin: 13px 0 9px; }
.decision-card > p { font-size: 12px; color: var(--muted); }
.decision-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 17px; }
.decision-section { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 23px; }
.decision-section h3 { font-size: 13px; margin-bottom: 10px; }
.decision-section p { font-size: 12px; white-space: pre-wrap; color: #5e6557; }
.decision-check { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; font-size: 12px; line-height: 1.6; }
.decision-check input { margin-top: 3px; accent-color: var(--accent); }
.snapshot-hash { font-family: monospace; font-size: 9px; overflow-wrap: anywhere; color: var(--muted); padding: 13px; background: var(--paper); border-radius: 8px; }
.registry-table { width: 100%; border-collapse: collapse; font-size: 12px; background: white; }
.registry-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 10px; padding: 13px; border-bottom: 1px solid var(--line-strong); }
.registry-table td { padding: 17px 13px; border-bottom: 1px solid var(--line); line-height: 1.5; }
.registry-table td:first-child { max-width: 430px; }
.registry-table tr[data-clickable] { cursor: pointer; }
.registry-table tr[data-clickable]:hover { background: #fbfcf8; }

/* Dialogs, searching and notifications. */
.modal { background: #fff; color: var(--ink); width: min(520px, calc(100vw - 30px)); max-height: 88vh; border: 1px solid var(--line); border-radius: 15px; padding: 0; box-shadow: 0 35px 100px #20251822; }
.modal-wide { width: min(830px, calc(100vw - 30px)); }
.modal::backdrop { background: #22271c4d; backdrop-filter: blur(3px); }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 25px 26px 20px; border-bottom: 1px solid var(--line); }
.modal-heading h2 { font-size: 21px; margin: 0 0 6px; }
.modal-heading p { font-size: 11px; margin: 0; }
.close-button { font-size: 27px; line-height: 1; margin-top: -5px; }
.modal-body { padding: 23px 26px 26px; }
.modal > .form-error { margin: 0 26px 25px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 23px; }
.modal-body > .notice { margin-bottom: 18px; }
.search-input { padding: 14px; font-size: 15px; }
.search-results { margin-top: 15px; max-height: 52vh; overflow: auto; }
.search-result { display: flex; width: 100%; flex-direction: column; text-align: left; padding: 13px; border: 0; border-bottom: 1px solid var(--line); background: white; border-radius: 6px; gap: 6px; }
.search-result:hover { background: var(--paper); }
.search-result strong { font-size: 13px; font-weight: 500; }
.search-result small { font-size: 11px; color: var(--muted); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.member-row strong { font-size: 12px; font-weight: 550; }
.member-row small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.notifications { position: fixed; right: 24px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { background: #293324; color: #fff; border-radius: 10px; box-shadow: 0 6px 24px #1c231b20; padding: 13px 18px; font-size: 12px; line-height: 1.6; max-width: min(420px, calc(100vw - 32px)); }
.toast-error { background: #773a2c; }
.print-only { display: none; }
.mobile-side-toggle { display: none; }

@media (min-width: 1650px) {
  :root { --sidebar: 246px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 354px; }
  .side-body { padding: 28px 25px; }
  .home { padding-top: 68px; }
}
@media (max-width: 1250px) {
  :root { --sidebar: 205px; }
  .home { padding: 40px 32px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 285px; }
  .editor-heading { padding: 19px; }
  .editor-title { font-size: 18px; }
  .editor-actions .action-label { display: none; }
  .side-body { padding: 20px 16px; }
  .canvas-key { display: none; }
  .space-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1050px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-side { display: none; }
  .editor.show-side .editor-side { display: flex; position: fixed; right: 12px; top: 85px; bottom: 12px; width: 320px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 70px #26311e35; z-index: 40; }
  .mobile-side-toggle { display: inline-flex; }
  .purpose-card { padding: 13px 10px; }
  .purpose-card small { display: none; }
  .auth-story { padding: 42px; }
  .auth-story h1 { font-size: 43px; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; width: 245px; box-shadow: 0 0 0 100vw #1d231a44; }
  .shell.sidebar-open .sidebar { display: flex; }
  .mobile-menu { display: inline-flex; }
  .topbar { height: 61px; padding: 0 15px; }
  .topbar .breadcrumb { font-size: 10px; }
  .topbar .search-trigger span, .topbar kbd { display: none; }
  .editor { height: calc(100dvh - 61px); }
  .home { padding: 35px 21px; }
  h1 { font-size: 33px; letter-spacing: -1.2px; }
  .home-heading p { font-size: 12px; }
  .purpose-grid { grid-template-columns: repeat(2, 1fr); }
  .space-grid { grid-template-columns: 1fr; }
  .composer { padding: 15px; }
  .composer textarea { font-size: 15px; }
  .composer-footer small { display: none; }
  .composer-footer { justify-content: space-between; }
  .example-invite { padding: 17px 0; font-size: 10px; }
  .home-stats { gap: 18px; }
  .stat { font-size: 9px; }
  .stat strong { font-size: 18px; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { padding: 27px; }
  .auth-story .auth-message, .auth-story footer { display: none; }
  .auth-story .brand { padding: 0; }
  .auth-form-wrap { padding: 36px 26px 60px; align-items: flex-start; }
  .editor-heading { padding: 15px; min-height: 90px; align-items: flex-start; }
  .editor-title { font-size: 17px; }
  .editor-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 125px; gap: 2px; }
  .editor-actions > .button { padding: 7px; min-height: 31px; }
  .editor-actions > .icon-button { height: 28px; width: 28px; }
  .editor-tabs { padding: 0 12px; gap: 12px; }
  .editor-tabs .tab { font-size: 10px; }
  .editor-tabs .tab svg { display: none; }
  .editor-tabs .tab { gap: 4px; flex-shrink: 0; }
  .notifications { right: 16px; bottom: 16px; }
  .editor-subtitle { font-size: 9px; flex-wrap: wrap; }
  .composer-bar { padding: 10px; gap: 6px; }
  .composer-bar select { width: 88px; }
  .composer-bar .input { font-size: 10px; padding: 10px 7px; }
  .content-panel { padding: 23px 17px; }
  .panel-title { flex-direction: column; gap: 12px; }
  .source-row { padding: 13px; flex-wrap: wrap; }
  .library { padding: 32px 19px; }
  .registry-table th, .registry-table td { padding: 12px 8px; font-size: 10px; }
  .registry-table th:last-child, .registry-table td:last-child { display: none; }
  .modal-heading { padding: 20px; }
  .modal-body { padding: 20px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}
@media print {
  :root { background: white; font-size: 11pt; }
  .sidebar, .topbar, .editor-heading, .editor-tabs, .editor-grid, .notifications, .skip-link, dialog { display: none !important; }
  .main-wrap { margin: 0; }
  .editor { height: auto; display: block; }
  .print-only { display: block; padding: 20px; }
  .print-only h1 { font-size: 24pt; }
  .print-only h2 { break-after: avoid; font-size: 17pt; margin-top: 28px; }
  .print-only article { break-inside: avoid; margin-bottom: 20px; }
  .print-only p { white-space: pre-wrap; font-size: 10pt; }
}
