:root {
  --canvas: #fafaf7;
  --sidebar: #efefea;
  --surface: #ffffff;
  --surface-soft: #f5f5f2;
  --ink: #20201e;
  --muted: #73736d;
  --faint: #9a9a93;
  --line: #e4e4df;
  --line-strong: #d6d6cf;
  --accent: #343632;
  --accent-soft: #ecece7;
  --success: #287a55;
  --warning: #9a6319;
  --danger: #b54747;
  --sidebar-width: 264px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); }
body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.app-sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-width); display: flex;
  flex-direction: column; padding: 20px 13px 15px; background: var(--sidebar); border-right: 1px solid rgba(32,32,30,.07);
}
.sidebar-topline { display: flex; align-items: center; justify-content: space-between; padding: 0 9px 16px; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 600; letter-spacing: -.55px; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.icon-button:hover { background: rgba(0,0,0,.055); }
.sidebar-close, .sidebar-open { display: none; }
.new-thread, .nav-item { display: flex; align-items: center; gap: 10px; min-height: 39px; padding: 0 11px; border-radius: 9px; color: #4d4d48; font-weight: 520; }
.new-thread { margin-bottom: 10px; color: var(--ink); background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.04); }
.new-thread:hover, .nav-item:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.primary-nav { display: grid; gap: 2px; }
.nav-item.active { color: var(--ink); background: rgba(255,255,255,.82); box-shadow: 0 1px 2px rgba(0,0,0,.04), inset 0 0 0 1px rgba(0,0,0,.025); }
.nav-item svg, .new-thread svg { flex: none; color: #6e6e68; }
.sidebar-recents { min-height: 0; flex: 1; margin-top: 22px; overflow: hidden; }
.sidebar-label { margin: 0 11px 8px; color: var(--faint); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.conversation-list { height: calc(100% - 26px); overflow-y: auto; }
.conversation-list button { display: block; width: 100%; padding: 8px 11px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.conversation-list button:hover { background: rgba(255,255,255,.72); }
.conversation-list button span { display: block; overflow: hidden; color: #55554f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-workspaces { min-height: 0; flex: 1; margin-top: 20px; overflow-y: auto; scrollbar-width: thin; }
.sidebar-section-title { display: flex; align-items: center; justify-content: space-between; }
.sidebar-section-title .sidebar-label { margin-bottom: 5px; }
.sidebar-section-title > button { display: grid; width: 26px; height: 26px; margin-right: 5px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #666660; cursor: pointer; font-size: 19px; line-height: 1; }
.sidebar-section-title > button:hover { background: rgba(255,255,255,.7); }
.project-list { display: grid; gap: 1px; }
.project-list a { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 7px 11px; border-radius: 8px; color: #55554f; font-size: 13px; }
.project-list a:hover { background: rgba(255,255,255,.7); color: var(--ink); }
.project-list svg { width: 16px; height: 16px; flex: none; color: #777770; }
.project-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-heading { margin-top: 18px; }
.pinned-list { height: auto; overflow: visible; }
.sidebar-workspaces .conversation-list { height: auto; overflow: visible; }
.conversation-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; border-radius: 8px; }
.conversation-row:hover { background: rgba(255,255,255,.68); }
.conversation-list .conversation-open { min-width: 0; padding-right: 3px; }
.conversation-list .conversation-open:hover { background: transparent; }
.conversation-list .conversation-more { display: grid; width: 25px; height: 25px; padding: 0; place-items: center; color: #777771; font-size: 10px; letter-spacing: 1px; opacity: 0; }
.conversation-row:hover .conversation-more, .conversation-more:focus { opacity: 1; }
.conversation-menu { position: absolute; z-index: 60; top: 31px; right: 3px; width: 174px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.98); box-shadow: 0 16px 38px rgba(35,35,31,.16); backdrop-filter: blur(16px); }
.conversation-menu[hidden] { display: none; }
.conversation-list .conversation-menu button { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 9px; color: #393936; font-size: 12px; }
.conversation-list .conversation-menu button:hover { background: #f1f1ed; }
.conversation-list .conversation-menu button span { width: 14px; color: #797972; font-size: 14px; text-align: center; }
.conversation-list .conversation-menu .menu-danger { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; color: var(--danger); }
.sidebar-empty { margin: 0 11px; color: var(--faint); font-size: 12px; }
.local-state { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line-strong); }
.local-state strong, .local-state small { display: block; }
.local-state strong { font-size: 12px; font-weight: 600; }
.local-state small { max-width: 170px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(40,122,85,.1); }
.sidebar-scrim { display: none; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-width); }

/* Conversation */
.chat-workspace { position: relative; display: grid; grid-template-rows: 58px minmax(0,1fr) auto; height: 100vh; overflow: hidden; }
.chat-header { z-index: 8; display: flex; align-items: center; justify-content: space-between; padding: 0 27px; background: rgba(250,250,247,.9); border-bottom: 1px solid rgba(32,32,30,.055); backdrop-filter: blur(18px); }
.chat-title strong, .chat-title span { display: block; }
.chat-title strong { font-size: 14px; font-weight: 620; }
.chat-title span { color: var(--muted); font-size: 11px; }
.workspace-state { display: flex; align-items: center; gap: 8px; }
.workspace-state > span { width: 6px; height: 6px; border-radius: 50%; background: #4e7561; box-shadow: 0 0 0 4px rgba(78,117,97,.08); }
.workspace-state strong, .workspace-state small { display: block; line-height: 1.15; }
.workspace-state strong { color: #4f4f49; font-size: 10px; font-weight: 680; letter-spacing: .06em; text-transform: uppercase; }
.workspace-state small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.messages { min-height: 0; overflow-y: auto; padding: 58px max(24px, calc((100% - 790px) / 2)) 46px; scroll-behavior: smooth; scrollbar-color: #d0d0ca transparent; scrollbar-width: thin; }
.welcome { display: flex; min-height: calc(100vh - 300px); flex-direction: column; justify-content: center; padding-bottom: 8vh; animation: rise-in .42s ease-out both; }
.welcome-kicker { margin: 0 0 14px !important; color: var(--faint) !important; font-size: 10px !important; font-weight: 720; letter-spacing: .13em; text-transform: uppercase; }
.welcome h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(39px,5vw,57px); font-weight: 500; line-height: .98; letter-spacing: -.048em; }
.welcome > p:not(.welcome-kicker) { max-width: 570px; margin: 20px 0 34px; color: var(--muted); font-size: 14px; }
.suggestions { border-top: 1px solid var(--line-strong); }
.suggestions button { display: grid; width: 100%; grid-template-columns: 155px 1fr auto; align-items: center; gap: 18px; min-height: 57px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; transition: padding .18s ease, background .18s ease; }
.suggestions button:hover { padding-inline: 11px; background: rgba(255,255,255,.62); }
.suggestions button span { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; }
.suggestions button b { font-size: 12px; font-weight: 560; }
.suggestions button i { color: var(--faint); font-size: 10px; font-style: normal; }
.message { position: relative; width: 100%; margin: 0 auto 38px; animation: message-in .28s cubic-bezier(.2,.75,.3,1) both; }
.message.user { display: flex; flex-direction: column; align-items: flex-end; }
.bubble { max-width: min(78%, 620px); padding: 11px 16px; border-radius: 18px 18px 4px 18px; background: #ededE9; color: #292925; }
.message-files { display: flex; max-width: 80%; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-bottom: 7px; }
.message-files > span { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 7px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.message-files b { max-width: 230px; overflow: hidden; font-size: 12px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.message.assistant { padding-left: 20px; }
.message.assistant::before { position: absolute; top: 5px; bottom: 2px; left: 0; width: 1px; background: linear-gradient(to bottom, #b7b7af, transparent 76%); content: ''; }
.message.assistant::after { position: absolute; top: 5px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: #60615c; content: ''; }
.assistant-label { margin-bottom: 11px; font-family: Georgia, "Times New Roman", serif; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.message-content { color: #292925; font-size: 15px; line-height: 1.72; }
.message-content:empty { display: none; }
.message-content code { padding: 2px 5px; border-radius: 5px; background: #efefeb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.message-content h2, .message-content h3, .message-content h4 { margin: 20px 0 7px; color: var(--ink); line-height: 1.25; }
.message-content h2 { font-family: Georgia, "Times New Roman", serif; font-size: 22px; font-weight: 550; }
.message-content h3 { font-size: 16px; font-weight: 650; }
.message-content h4 { font-size: 14px; font-weight: 650; }
.inline-citation { color: #292925; text-decoration: underline; text-decoration-color: #a7a79f; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.inline-citation:hover { text-decoration-color: #292925; }
.code-artifact, .writing-artifact { margin: 18px 0 14px; overflow: hidden; border-radius: 15px; }
.code-artifact { border: 1px solid #30312e; background: #20211f; color: #eeeee8; box-shadow: 0 10px 28px rgba(31,32,29,.1); }
.code-artifact header, .writing-artifact header { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 0 13px 0 15px; }
.code-artifact header { border-bottom: 1px solid #363733; color: #aaa9a2; }
.code-artifact header span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: .04em; text-transform: lowercase; }
.code-artifact button, .writing-artifact button { min-height: 28px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 10px; font-weight: 620; }
.code-artifact button { color: #c8c8c1; }
.code-artifact button:hover { background: #343531; color: white; }
.code-artifact pre { max-height: 520px; margin: 0; overflow: auto; padding: 18px; }
.code-artifact pre code { padding: 0; background: transparent; color: inherit; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12.5px; line-height: 1.65; white-space: pre; }
.writing-artifact { border: 1px solid #deded8; background: rgba(255,255,255,.76); box-shadow: 0 10px 30px rgba(43,43,38,.045); }
.writing-artifact header { border-bottom: 1px solid #e9e9e4; }
.writing-artifact header > span { color: var(--muted); font-size: 10px; font-weight: 690; letter-spacing: .065em; text-transform: uppercase; }
.writing-artifact header div { display: flex; gap: 2px; }
.writing-artifact button { color: #55554f; }
.writing-artifact button:hover { background: #efefeb; color: var(--ink); }
.writing-artifact .artifact-body { min-height: 120px; margin: 0; padding: 20px 22px 23px; outline: none; color: #292925; font-family: inherit; font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.writing-artifact.editing { border-color: #bdbdb5; box-shadow: 0 12px 34px rgba(43,43,38,.07), 0 0 0 3px rgba(52,54,50,.035); }
.folder-guidance { max-width: 600px; padding: 15px 17px; border: 1px solid #deded7; border-radius: 12px; background: rgba(255,255,255,.66); }
.folder-guidance strong { display: block; font-size: 13px; font-weight: 650; }
.folder-guidance p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.work-status, .upload-activity { display: flex; align-items: center; gap: 11px; padding: 4px 0; color: #4d4d48; }
.work-status[hidden] { display: none; }
.work-status strong, .work-status small, .upload-activity strong, .upload-activity small { display: block; }
.work-status strong, .upload-activity strong { font-size: 13px; font-weight: 570; }
.work-status small, .upload-activity small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.work-spinner { width: 15px; height: 15px; flex: none; border: 1.5px solid #c7c7c0; border-top-color: #4e4e49; border-radius: 50%; animation: spin .8s linear infinite; }
.work-check, .work-error { position: relative; width: 16px; height: 16px; flex: none; border-radius: 50%; background: #e5f2e9; }
.work-check::after { position: absolute; top: 3px; left: 5px; width: 4px; height: 7px; border: solid var(--success); border-width: 0 1.5px 1.5px 0; content: ''; transform: rotate(45deg); }
.work-error { background: #f8eaea; }
.work-error::after { position: absolute; inset: 0; display: grid; place-items: center; color: var(--danger); content: '!'; font-size: 10px; font-weight: 700; }
.upload-activity { max-width: 760px; margin: 0 auto 22px; padding: 12px 14px; border-left: 2px solid var(--line-strong); animation: message-in .22s ease-out both; }
.upload-activity.complete { border-left-color: #a9cfb9; }
.upload-activity.failed { border-left-color: #dfb3b3; }
.answer-meta { margin-top: 13px; }
.answer-meta span { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 10px; letter-spacing: .025em; }
.answer-meta span::before { width: 4px; height: 4px; border-radius: 50%; background: #94948d; content: ''; }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 13px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.sources p { margin: 0; color: var(--faint); font-size: 9px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.sources > span, .sources a { display: inline-flex; align-items: center; gap: 4px; padding: 1px 0; border: 0; background: transparent; color: #666660; font-size: 10px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: color .15s ease, text-decoration-color .15s ease; }
.sources a:hover { color: var(--ink); text-decoration-color: #9a9a93; }
.sources a svg { width: 10px; height: 10px; color: var(--faint); }
.trace { margin-top: 10px; color: var(--muted); font-size: 12px; }
.trace summary { width: max-content; cursor: pointer; }
.trace pre { overflow-x: auto; padding: 12px; border-radius: 10px; background: #f0f0ec; color: #55554f; font-size: 11px; white-space: pre-wrap; }

.composer-dock { z-index: 7; width: min(808px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 14px; background: linear-gradient(to bottom, rgba(251,251,249,0), var(--canvas) 20%); }
.composer { padding: 13px 14px 11px; border: 1px solid #cfcfc7; border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 16px 48px rgba(43,43,38,.09), 0 2px 5px rgba(43,43,38,.04); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.composer:focus-within { border-color: #aaa9a1; box-shadow: 0 20px 54px rgba(43,43,38,.11), 0 0 0 3px rgba(52,54,50,.035); transform: translateY(-1px); }
.composer textarea { display: block; width: 100%; min-height: 32px; max-height: 180px; resize: none; padding: 4px 3px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.5; }
.composer textarea::placeholder { color: #a2a29b; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.composer-actions > div { display: flex; align-items: center; gap: 9px; }
.composer-icon, .send-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; }
.composer-icon { background: #f2f2ee; color: #55554f; }
.composer-icon:hover { background: #e8e8e3; }
.tool-toggle { display: inline-flex; min-height: 30px; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #6a6a64; cursor: pointer; font-size: 10px; font-weight: 620; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.tool-toggle svg { width: 14px; height: 14px; }
.tool-toggle:hover { background: #f1f1ed; color: var(--ink); }
.tool-toggle.active { border-color: #cfcfc8; background: #e8e8e3; color: #292a27; }
.tool-toggle.active::after { width: 4px; height: 4px; border-radius: 50%; background: #4e7561; content: ''; }
.send-button { background: var(--ink); color: white; }
.send-button:hover { background: #3b3b37; }
.model-note { color: var(--faint); font-size: 10px; }
.composer-disclaimer { margin: 7px 0 0; color: var(--faint); font-size: 10px; text-align: center; }
.attachment-shelf { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 10px; }
.attachment-chip { display: flex; min-width: 215px; max-width: 290px; align-items: center; gap: 9px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fafaf8; }
.attachment-chip > span:not(.file-type) { min-width: 0; flex: 1; }
.attachment-chip strong, .attachment-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip strong { font-size: 11px; font-weight: 580; }
.attachment-chip small { color: var(--faint); font-size: 10px; }
.attachment-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.attachment-chip button:hover { background: #ecece7; }
.file-type { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .03em; }
.drop-overlay { position: absolute; z-index: 20; inset: 70px 18px 18px; display: grid; visibility: hidden; place-items: center; border: 1.5px dashed #a7b5df; border-radius: 20px; background: rgba(247,248,252,.94); opacity: 0; pointer-events: none; transform: scale(.99); transition: opacity .14s ease, transform .14s ease, visibility .14s; }
.drop-overlay.visible { visibility: visible; opacity: 1; transform: scale(1); }
.drop-overlay div { text-align: center; }
.drop-overlay strong, .drop-overlay span { display: block; }
.drop-overlay strong { font-family: Georgia, "Times New Roman", serif; font-size: 23px; font-weight: 500; }
.drop-overlay span { margin-top: 5px; color: var(--muted); font-size: 12px; }

/* Operational pages */
.page-canvas, .page-header, .metric-band, .split-section, .capacity-hero, .capacity-grid, .method-note { width: min(1160px, calc(100% - 64px)); margin-inline: auto; }
.page-canvas { padding: 48px 0 64px; }
.page-canvas .page-header { width: 100%; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 48px 0 26px; border-bottom: 1px solid var(--line); }
.page-header h1 { margin: 2px 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 38px; font-weight: 500; letter-spacing: -.03em; }
.page-header p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); }
.eyebrow, .section-label { margin: 0; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.primary { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--ink); color: white; font-weight: 600; cursor: pointer; }
.primary:hover { background: #3a3a35; }
.primary:disabled { cursor: wait; opacity: .65; }
.notice { display: flex; align-items: center; justify-content: space-between; margin: 18px 0; padding: 12px 14px; border-radius: 9px; }
.notice.success { background: #edf5f0; color: #2d674b; }
.notice span { font-weight: 600; }
.notice small { color: #60806f; }
.actions { display: flex; align-items: center; gap: 8px; }
.actions a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: white; color: #565650; font-size: 12px; font-weight: 560; }
.actions a:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.policy-strip { display: grid; grid-template-columns: 230px 1fr; align-items: center; gap: 28px; margin: 22px 0 4px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.policy-strip strong, .policy-strip small { display: block; }
.policy-strip strong { font-size: 13px; font-weight: 630; }
.policy-strip small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.policy-items { display: flex; flex-wrap: wrap; gap: 7px; }
.policy-items span { padding: 6px 9px; border-radius: 7px; background: #f0f0ec; color: #66665f; font-size: 11px; }
.command-panel { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; margin-top: 22px; border: 1px solid var(--line); border-radius: 12px; background: white; overflow: hidden; }
.command-panel > div { min-width: 0; padding: 17px 18px; }
.command-panel > div + div { border-left: 1px solid var(--line); }
.command-panel span, .command-panel code { display: block; }
.command-panel span { margin-bottom: 8px; color: var(--faint); font-size: 9px; font-weight: 720; letter-spacing: .08em; text-transform: uppercase; }
.command-panel code { overflow-x: auto; color: #484843; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: nowrap; }
.danger { padding: 6px 9px; border: 1px solid #ead3d3; border-radius: 7px; background: white; color: var(--danger); font-size: 11px; cursor: pointer; }
.danger:hover { background: #fbefef; }
.table-action { text-align: right; }
.table-wrap { overflow-x: auto; margin-top: 20px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 14px; color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
td { padding: 15px 14px; border-top: 1px solid var(--line); color: #575751; vertical-align: middle; }
td strong, td small { display: block; }
td strong { color: var(--ink); font-weight: 580; }
td small { margin-top: 2px; color: var(--faint); }
.table-empty { padding: 40px; color: var(--muted); text-align: center; }
.doc-status, .status-badge { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #eeeeea; color: #65655f; font-size: 9px; font-weight: 750; letter-spacing: .05em; }
.doc-status.approved, .status-badge.healthy { background: #e8f3ec; color: var(--success); }
.doc-status.archived { background: #f1ece6; color: #806b50; }
.status-badge.warning { background: #fbf1dd; color: var(--warning); }
.status-badge.critical { background: #faeaea; color: var(--danger); }

dialog { padding: 0; border: 0; border-radius: 18px; background: white; box-shadow: 0 30px 90px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(30,30,27,.28); backdrop-filter: blur(3px); }
.upload-dialog { width: min(620px, calc(100% - 28px)); }
.dialog-x { position: absolute; top: 13px; right: 13px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f1f1ed; color: var(--muted); font-size: 20px; cursor: pointer; }
.upload-form { display: grid; gap: 17px; padding: 30px; }
.upload-form h2 { margin: -10px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 27px; font-weight: 500; }
.dialog-copy { margin: -11px 0 2px; color: var(--muted); }
.upload-form label { display: grid; gap: 6px; color: #5d5d57; font-size: 11px; font-weight: 650; }
.upload-form input, .upload-form select { width: 100%; min-height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: white; color: var(--ink); }
.upload-form input:focus, .upload-form select:focus { border-color: #9caee8; box-shadow: 0 0 0 3px var(--accent-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.file-field { padding: 14px; border: 1px dashed #bdbdb5; border-radius: 11px; background: #fafaf8; }
.file-field input { min-height: 28px; padding: 0; border: 0; background: transparent; }
.file-field small { color: var(--faint); font-weight: 450; }
.upload-form label small { color: var(--faint); font-weight: 450; }
.compact-dialog { width: min(460px, calc(100% - 28px)); }

/* Roster and projects */
.roster-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 28px; }
.person-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 13px; min-height: 88px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.65); transition: border-color .16s ease, transform .16s ease; }
.person-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.person-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #e7e7e1; color: #55554e; font-family: Georgia,serif; font-size: 13px; font-weight: 600; }
.person-copy { min-width: 0; }
.person-copy strong, .person-copy span, .person-copy a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-copy strong { font-size: 13px; font-weight: 650; }
.person-copy span { color: var(--muted); font-size: 11px; }
.person-copy a { margin-top: 3px; color: #55554f; font-size: 11px; text-decoration: underline; text-decoration-color: #c1c1ba; text-underline-offset: 2px; }
.presence { align-self: start; padding: 4px 7px; border-radius: 999px; background: #ededE8; color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .06em; }
.presence.active { background: #e7f2eb; color: var(--success); }
.directory-note { display: grid; grid-template-columns: 180px minmax(0,620px); gap: 30px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); }
.directory-note span { color: var(--faint); font-size: 10px; font-weight: 720; letter-spacing: .07em; text-transform: uppercase; }
.directory-note p { margin: 0; color: var(--muted); }
.project-header { display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 17px; padding: 18px 0 30px; border-bottom: 1px solid var(--line); }
.projects-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 28px; }
.project-card { display: grid; grid-template-columns: 50px minmax(0,1fr) 20px; align-items: center; gap: 15px; min-height: 116px; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.66); transition: border-color .16s ease, transform .16s ease; }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.project-card strong { font-family: Georgia,serif; font-size: 18px; font-weight: 550; }
.project-card p { margin: 2px 0 7px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-card span { color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.project-card > b { color: #777770; font-weight: 400; }
.projects-empty { grid-column: 1/-1; }
.project-mark { display: grid; width: 50px; height: 50px; place-items: center; border: 1px solid var(--line); border-radius: 14px; background: white; }
.project-mark svg { width: 23px; height: 23px; }
.project-header h1 { margin: 1px 0 2px; font-family: Georgia,serif; font-size: 35px; font-weight: 500; letter-spacing: -.025em; }
.project-header p:not(.eyebrow) { margin: 0; color: var(--muted); }
.secondary-button { min-height: 39px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: white; cursor: pointer; font-weight: 600; }
.secondary-button:hover { background: var(--surface-soft); }
.project-columns { display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 55px; padding-top: 38px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.section-heading h2, .project-members h2 { margin: 2px 0 0; font-family: Georgia,serif; font-size: 24px; font-weight: 500; }
.section-heading a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 11px; font-weight: 600; }
.project-chat-list { border-top: 1px solid var(--line); }
.project-chat-list > a { display: grid; grid-template-columns: minmax(0,1fr) auto 20px; align-items: center; gap: 14px; min-height: 58px; padding: 0 5px; border-bottom: 1px solid var(--line); }
.project-chat-list > a:hover { padding-inline: 11px; background: rgba(255,255,255,.55); }
.project-chat-list span { overflow: hidden; font-weight: 580; text-overflow: ellipsis; white-space: nowrap; }
.project-chat-list small { color: var(--faint); }
.project-chat-list b { font-weight: 400; }
.empty-panel { display: flex; min-height: 230px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-panel strong, .empty-panel span { display: block; }
.empty-panel strong { color: var(--ink); }
.empty-panel span { margin-top: 4px; font-size: 11px; }
.project-members { padding-left: 28px; border-left: 1px solid var(--line); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.person-avatar.small { width: 34px; height: 34px; font-size: 10px; }
.member-row strong, .member-row small { display: block; }
.member-row strong { font-size: 12px; }
.member-row small { color: var(--muted); font-size: 10px; }
.app-toast { position: fixed; z-index: 100; bottom: 24px; left: calc(50% + var(--sidebar-width)/2); padding: 10px 14px; border: 1px solid #343531; border-radius: 10px; background: #242522; color: white; box-shadow: 0 12px 35px rgba(0,0,0,.2); opacity: 0; transform: translate(-50%,8px); transition: opacity .18s ease, transform .18s ease; }
.app-toast.visible { opacity: 1; transform: translate(-50%,0); }
.app-toast.error { background: #743b3b; border-color: #743b3b; }

.metric-band { display: grid; grid-template-columns: repeat(4,1fr); border-bottom: 1px solid var(--line); }
.metric-band > div { min-height: 155px; padding: 27px 24px; border-left: 1px solid var(--line); }
.metric-band > div:first-child { border-left: 0; }
.metric-band span, .metric-band small { display: block; color: var(--muted); }
.metric-band strong { display: block; margin: 12px 0 5px; font-family: Georgia, serif; font-size: 31px; font-weight: 500; }
.split-section { display: grid; grid-template-columns: 1.3fr 1fr; gap: 70px; padding: 48px 0; }
.split-section h2 { margin: 5px 0 24px; font-family: Georgia,serif; font-size: 26px; font-weight: 500; }
.resource-list > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.resource-list progress { grid-column: 1/-1; width: 100%; height: 4px; border: 0; accent-color: var(--accent); }
.resource-list small { grid-column: 1/-1; color: var(--muted); }
.facts { margin: 0; }
.facts div { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 560; }
.capacity-hero { display: flex; align-items: center; gap: 50px; padding: 42px 0; border-bottom: 1px solid var(--line); }
.capacity-ring { display: grid; width: 170px; height: 170px; flex: none; place-items: center; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--score)*1%), #e7e7e2 0); }
.capacity-ring::before { position: absolute; width: 140px; height: 140px; border-radius: 50%; background: var(--canvas); content: ''; }
.capacity-ring div { z-index: 1; text-align: center; }
.capacity-ring strong, .capacity-ring span { display: block; }
.capacity-ring strong { font-family: Georgia,serif; font-size: 36px; font-weight: 500; }
.capacity-ring span { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.capacity-hero h2 { margin: 12px 0 6px; font-family: Georgia,serif; font-size: 29px; font-weight: 500; }
.capacity-hero ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.capacity-grid { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--line); }
.capacity-grid > div { padding: 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capacity-grid span, .capacity-grid strong { display: block; }
.capacity-grid span { color: var(--muted); }
.capacity-grid strong { margin-top: 8px; font-family: Georgia,serif; font-size: 26px; font-weight: 500; }
.method-note { padding: 30px 0 60px; color: var(--muted); }
.method-note strong { color: var(--ink); }
.method-note p { max-width: 780px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

@media (max-width: 900px) {
  .app-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .app-main { margin-left: 0; }
  .sidebar-open, .sidebar-close { display: grid; }
  .sidebar-scrim { position: fixed; z-index: 35; inset: 0; display: block; visibility: hidden; background: rgba(0,0,0,.25); opacity: 0; transition: opacity .2s, visibility .2s; }
  .sidebar-visible .app-sidebar { transform: translateX(0); }
  .sidebar-visible .sidebar-scrim { visibility: visible; opacity: 1; }
  .chat-header { padding: 0 14px; }
  .chat-title { margin-right: auto; }
  .workspace-state { display: none; }
  .metric-band { grid-template-columns: 1fr 1fr; }
  .metric-band > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-band > div:nth-child(4) { border-top: 1px solid var(--line); }
  .split-section { grid-template-columns: 1fr; gap: 30px; }
  .project-columns { grid-template-columns: 1fr; gap: 35px; }
  .projects-grid { grid-template-columns: 1fr; }
  .project-members { padding: 25px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .app-toast { left: 50%; }
}

@media (max-width: 640px) {

  .chat-header { height: 62px; }

  .chat-title span { display: none; }

  .messages { padding: 34px 16px 30px; }

  .welcome { min-height: calc(100vh - 280px); }

  .welcome h1 { font-size: 33px; }

  .suggestions button {
    grid-template-columns: 1fr;
    gap: 3px;
    min-height: 72px;
    padding-block: 10px;
  }

  .suggestions button i { display: none; }

  .bubble { max-width: 90%; }

  .composer-dock {
    width: calc(100% - 18px);
    padding-bottom: 8px;
  }

  .composer-disclaimer { display: none; }

  .model-note { display: none; }

  .tool-toggle span { display: none; }

  .tool-toggle {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .code-artifact,
  .writing-artifact {
    margin-inline: -4px;
    border-radius: 12px;
  }

  .writing-artifact .artifact-body {
    padding: 17px;
  }

  .page-canvas,
  .page-header,
  .metric-band,
  .split-section,
  .capacity-hero,
  .capacity-grid,
  .method-note {
    width: calc(100% - 32px);
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 28px;
  }

  .page-header h1 { font-size: 32px; }

  .form-grid { grid-template-columns: 1fr; }

  .page-header .actions { width: 100%; }

  .page-header .actions a {
    flex: 1;
    text-align: center;
  }

  .policy-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .command-panel {
    grid-template-columns: 1fr;
  }

  .command-panel > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .upload-form {
    padding: 25px 20px;
  }

  .metric-band {
    grid-template-columns: 1fr;
  }

  .metric-band > div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .capacity-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .capacity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .roster-grid {
    grid-template-columns: 1fr;
  }

  .directory-note {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .project-header {
    grid-template-columns: 42px 1fr;
  }

  .project-header .secondary-button {
    grid-column: 1 / -1;
  }

}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
  margin: 0;
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 18% 15%,
      rgba(52, 54, 50, .045),
      transparent 32%
    ),
    var(--canvas);

  color: var(--ink);
}

.login-shell {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 40px;
}


/* Main login container */

.login-panel {
  width: min(980px, 100%);
  min-height: 610px;

  display: grid;
  grid-template-columns: .92fr 1.08fr;

  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 30px;

  background: var(--surface);

  box-shadow:
    0 4px 12px rgba(32, 32, 30, .035),
    0 28px 90px rgba(32, 32, 30, .10);
}


/* =========================================================
   LEFT SIDE
   ========================================================= */

.login-brand-side {
  position: relative;

  display: flex;
  flex-direction: column;

  padding: 42px;

  background:
    linear-gradient(
      145deg,
      #f0f0eb 0%,
      #e8e8e2 100%
    );

  border-right: 1px solid rgba(32, 32, 30, .06);
}

.login-brand-side::before {
  position: absolute;

  width: 340px;
  height: 340px;

  top: -150px;
  left: -140px;

  border: 1px solid rgba(32,32,30,.07);
  border-radius: 50%;

  content: "";
}

.login-brand-side::after {
  position: absolute;

  width: 260px;
  height: 260px;

  right: -150px;
  bottom: -130px;

  border: 1px solid rgba(32,32,30,.055);
  border-radius: 50%;

  content: "";
}


.login-wordmark {
  position: relative;
  z-index: 1;

  font-family: Georgia, "Times New Roman", serif;

  font-size: 24px;
  font-weight: 600;

  letter-spacing: -.6px;
}


.login-brand-copy {
  position: relative;
  z-index: 1;

  margin-top: auto;
  margin-bottom: auto;

  padding: 30px 0;
}

.login-kicker {
  display: block;

  margin-bottom: 14px;

  color: var(--faint);

  font-size: 10px;
  font-weight: 720;

  letter-spacing: .13em;

  text-transform: uppercase;
}

.login-brand-copy h1 {
  margin: 0;

  font-family: Georgia, "Times New Roman", serif;

  font-size: clamp(37px, 4vw, 48px);
  font-weight: 500;

  line-height: 1.02;

  letter-spacing: -.045em;

  color: var(--ink);
}

.login-brand-copy p {
  max-width: 330px;

  margin: 24px 0 0;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.65;
}

.login-brand-footer {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;

  gap: 8px;

  color: var(--muted);

  font-size: 10px;
}

.login-status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--success);

  box-shadow:
    0 0 0 4px rgba(40, 122, 85, .08);
}


/* =========================================================
   RIGHT SIDE
   ========================================================= */

.login-form-side {
  display: flex;

  align-items: center;
  justify-content: center;

  padding: 60px 56px;

  background: rgba(255,255,255,.96);
}

.login-form-wrap {
  width: min(390px, 100%);
}

.login-mobile-brand {
  display: none;
}


/* Heading */

.login-heading {
  text-align: center;

  margin-bottom: 34px;
}

.login-heading .login-kicker {
  margin-bottom: 9px;
}

.login-heading h2 {
  margin: 0;

  font-family: Georgia, "Times New Roman", serif;

  font-size: 38px;
  font-weight: 500;

  line-height: 1.05;

  letter-spacing: -.045em;
}

.login-heading p {
  margin: 11px 0 0;

  color: var(--muted);

  font-size: 13px;
}


/* Form */

.login-form {
  display: flex;
  flex-direction: column;

  gap: 19px;
}

.login-field {
  display: flex;
  flex-direction: column;

  gap: 7px;
}

.login-field label {
  padding-left: 3px;

  color: #565650;

  font-size: 11px;
  font-weight: 650;
}


/* Inputs */

.login-input {
  position: relative;

  display: flex;
  align-items: center;
}

.login-input svg {
  position: absolute;

  left: 16px;

  width: 17px;
  height: 17px;

  color: #96968f;

  pointer-events: none;

  transition:
    color .16s ease,
    transform .16s ease;
}

.login-input input {
  width: 100%;
  height: 52px;

  padding:
    0
    16px
    0
    45px;

  border:
    1px solid
    var(--line-strong);

  border-radius: 14px;

  outline: none;

  background: #f8f8f5;

  color: var(--ink);

  font-size: 13px;

  transition:
    border-color .16s ease,
    box-shadow .16s ease,
    background .16s ease,
    transform .16s ease;
}

.login-input input::placeholder {
  color: #a2a29b;
}

.login-input:hover input {
  border-color: #c5c5be;
}

.login-input:focus-within input {
  background: white;

  border-color: #a8a8a0;

  box-shadow:
    0 0 0 4px rgba(52,54,50,.045);

  transform: translateY(-1px);
}

.login-input:focus-within svg {
  color: var(--ink);

  transform: scale(1.04);
}


/* Button */

.login-submit {
  width: 100%;
  height: 52px;

  margin-top: 5px;

  display: flex;

  align-items: center;
  justify-content: center;

  gap: 9px;

  border: 0;

  border-radius: 14px;

  background: var(--ink);

  color: white;

  font: inherit;

  font-size: 13px;
  font-weight: 650;

  cursor: pointer;

  box-shadow:
    0 8px 18px rgba(32,32,30,.12);

  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease;
}

.login-submit svg {
  width: 15px;
  height: 15px;

  transition: transform .16s ease;
}

.login-submit:hover {
  background: #363733;

  transform: translateY(-2px);

  box-shadow:
    0 12px 26px rgba(32,32,30,.16);
}

.login-submit:hover svg {
  transform: translateX(3px);
}

.login-submit:active {
  transform: translateY(0);
}


/* Bottom */

.login-security {
  margin-top: 28px;

  color: var(--faint);

  font-size: 9px;

  letter-spacing: .03em;

  text-align: center;
}


/* Error */

.login-error {
  margin: -12px 0 22px;

  padding: 11px 13px;

  border:
    1px solid
    #ead3d3;

  border-radius: 12px;

  background: #f9ecec;

  color: var(--danger);

  font-size: 11px;

  text-align: center;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {

  .login-shell {
    padding: 20px;
  }

  .login-panel {
    width: min(500px, 100%);
    min-height: auto;

    display: block;

    border-radius: 25px;
  }

  .login-brand-side {
    display: none;
  }

  .login-form-side {
    padding: 42px 30px 34px;
  }

  .login-mobile-brand {
    display: block;

    margin-bottom: 38px;

    font-family: Georgia, "Times New Roman", serif;

    font-size: 22px;
    font-weight: 600;

    text-align: center;
  }

}


@media (max-width: 480px) {

  .login-shell {
    padding: 12px;
  }

  .login-panel {
    border-radius: 21px;
  }

  .login-form-side {
    padding:
      35px
      22px
      28px;
  }

  .login-heading h2 {
    font-size: 33px;
  }

}