:root {
  color-scheme: dark;
  --bg: #171716;
  --sidebar: #141413;
  --surface: #222220;
  --surface-raised: #292927;
  --surface-hover: #30302d;
  --surface-strong: #383835;
  --fg: #f5f4ed;
  --fg-2: #d7d5cc;
  --muted: #aaa89f;
  --meta: #7f7e78;
  --border: #363633;
  --border-soft: #2b2b28;
  --accent: #d97757;
  --accent-strong: #c96442;
  --accent-on: #171716;
  --success: #42b86a;
  --warn: #e0ae38;
  --danger: #df6a68;
  --overlay: rgba(0, 0, 0, .72);
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
  --font-display: "Anthropic Serif", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Anthropic Sans", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Anthropic Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --sidebar-width: 320px;
  --sidebar-collapsed: 64px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4ed;
  --sidebar: #faf9f5;
  --surface: #faf9f5;
  --surface-raised: #ffffff;
  --surface-hover: #e8e6dc;
  --surface-strong: #dedbd0;
  --fg: #141413;
  --fg-2: #3d3d3a;
  --muted: #5e5d59;
  --meta: #87867f;
  --border: #e8e6dc;
  --border-soft: #f0eee6;
  --accent: #c96442;
  --accent-strong: #b75839;
  --accent-on: #faf9f5;
  --overlay: rgba(20, 20, 19, .48);
  --shadow: 0 22px 70px rgba(35, 31, 25, .14);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 2px;
}
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-strong); border: 3px solid transparent; border-radius: 99px; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; flex: 0 0 auto; }
.brand { font-family: var(--font-display); font-size: 30px; font-weight: 530; letter-spacing: -.035em; }
.brand-mark { display: none; color: var(--accent); font-size: 24px; }

/* Authentication */
.auth-screen { width: 100%; height: 100dvh; overflow: auto; background: var(--bg); }
.auth-header { height: 76px; padding: 22px 32px; display: flex; align-items: center; transition: opacity .28s ease, transform .28s ease; }
.auth-main { min-height: calc(100dvh - 76px); display: grid; place-items: center; padding: 36px 24px 72px; }
.auth-panel { width: min(100%, 430px); display: flex; flex-direction: column; align-items: stretch; }
.auth-copy { margin-bottom: 34px; }
.auth-copy .eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 14px; font-weight: 530; letter-spacing: .01em; }
.auth-copy h1 { margin: 0; font-family: var(--font-display); font-size: clamp(48px, 7vw, 66px); line-height: 1; font-weight: 430; letter-spacing: -.045em; }
.auth-copy > p:last-child { max-width: 420px; margin: 17px 0 0; color: var(--muted); font-size: 17px; }
.auth-form { display: grid; gap: 18px; }
.auth-form label, .field-label { display: grid; gap: 8px; color: var(--fg-2); font-size: 14px; font-weight: 530; }
.auth-form input, .signup-input, .form-input, .form-textarea, .form-select {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface);
  color: var(--fg); padding: 14px 15px; box-shadow: none; transition: border-color .16s, background .16s;
}
.auth-form input { height: 52px; }
.auth-form input::placeholder, .signup-input::placeholder, .form-input::placeholder, .form-textarea::placeholder { color: var(--meta); }
.auth-form input:focus, .signup-input:focus, .form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--muted); background: var(--surface-raised); outline: none; }
.form-error { min-height: 18px; margin: -6px 0 0; color: var(--danger); font-size: 13px; }
.primary-button, .secondary-button, .danger-button, .quiet-button {
  min-height: 42px; border: 0; border-radius: 10px; padding: 10px 17px; cursor: pointer; font-weight: 650;
  transition: background .16s, color .16s, transform .16s, opacity .16s;
}
.primary-button { background: var(--fg); color: var(--bg); }
.primary-button:hover { background: var(--fg-2); }
.primary-button.accent { background: var(--accent); color: #fff; }
.primary-button.accent:hover { background: var(--accent-strong); }
.secondary-button { background: var(--surface-strong); color: var(--fg); }
.secondary-button:hover { background: color-mix(in srgb, var(--surface-strong) 76%, var(--fg) 10%); }
.quiet-button { border: 1px solid var(--border); background: transparent; color: var(--fg-2); }
.quiet-button:hover { background: var(--surface-hover); color: var(--fg); }
.danger-button { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); color: var(--danger); }
.danger-button:hover { background: color-mix(in srgb, var(--danger) 25%, var(--surface)); }
.full { width: 100%; }
button:disabled { cursor: not-allowed; opacity: .48; }
.text-link { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.auth-create { align-self: center; margin: 28px 0 10px; font-size: 16px; }
.auth-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; margin-top: 25px; }
.auth-links button, .auth-consent button { border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.auth-links button { font-size: 13px; }
.auth-consent { margin: 28px auto 0; max-width: 420px; color: var(--meta); font-size: 11px; line-height: 1.55; text-align: center; }
.auth-consent button { font-size: inherit; }
.signup-panel { width: min(100%, 760px); align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.back-link { position: fixed; top: 28px; left: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; }
.signup-stage { width: min(100%, 620px); margin: auto; }
.signup-stage .eyebrow { color: var(--accent); margin: 0 0 14px; font-size: 14px; }
.signup-stage h1 { margin: 0 0 38px; max-width: 650px; font-family: var(--font-display); font-size: clamp(42px, 7vw, 68px); font-weight: 430; line-height: 1.02; letter-spacing: -.045em; }
.signup-input { height: 58px; font-size: 18px; }
.signup-actions { display: flex; gap: 12px; margin-top: 24px; }
.signup-actions .primary-button { min-width: 150px; }
.signup-stage-note { margin: 15px 0 0; color: var(--meta); font-size: 13px; }
.tour-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 28px; }
.tour-card { min-height: 180px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 22px; background: var(--surface); }
.tour-card svg { color: var(--accent); margin-bottom: 28px; }
.tour-card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 24px; font-weight: 430; }
.tour-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tour-skip { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--meta); cursor: pointer; font-size: 12px; text-decoration: underline; }
.auth-fade { animation: fadeSlide .28s ease both; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Shell */
.app-shell { width: 100%; height: 100dvh; display: flex; background: var(--bg); }
.sidebar {
  width: var(--sidebar-width); height: 100%; flex: 0 0 var(--sidebar-width); display: flex; flex-direction: column;
  border-right: 1px solid var(--border-soft); background: var(--sidebar); transition: width .2s ease, flex-basis .2s ease, transform .2s ease;
  position: relative; z-index: 30;
}
.sidebar-head { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 9px 19px; }
.brand-button { border: 0; background: transparent; cursor: pointer; padding: 0; display: flex; align-items: center; gap: 4px; }
.brand-button .brand { font-size: 28px; }
.sidebar-head-actions { display: flex; gap: 2px; }
.icon-button, .tiny-icon, .modal-close {
  display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--fg-2); cursor: pointer;
}
.icon-button { width: 38px; height: 38px; }
.icon-button:hover, .tiny-icon:hover, .modal-close:hover { background: var(--surface-hover); color: var(--fg); }
.tiny-icon { width: 28px; height: 28px; }
.tiny-icon svg { width: 15px; height: 15px; }
.primary-nav { display: grid; gap: 2px; padding: 6px 10px; }
.nav-item {
  width: 100%; min-height: 42px; display: flex; align-items: center; gap: 13px; border: 0; border-radius: 9px;
  padding: 8px 12px; background: transparent; color: var(--fg-2); cursor: pointer; text-align: left; font-size: 15px;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { background: var(--surface); color: var(--fg); }
.nav-item.active { background: var(--surface); color: var(--fg); font-weight: 650; }
.nav-item.compact { min-height: 38px; font-size: 14px; }
.sidebar-section { padding: 14px 10px 0; }
.section-label { color: var(--meta); font-size: 12px; }
.tools-section .section-label { display: block; padding: 0 10px 8px; }
.section-row { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 7px 10px; }
.recent-section { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.recent-list { min-height: 0; overflow-y: auto; }
.recent-item { width: 100%; border: 0; border-radius: 8px; padding: 7px 10px; background: transparent; color: var(--fg-2); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13px; }
.recent-item:hover { background: var(--surface); color: var(--fg); }
.recent-empty { padding: 10px; color: var(--meta); font-size: 12px; }
.account-button {
  width: 100%; min-height: 74px; display: flex; align-items: center; gap: 12px; border: 0; border-top: 1px solid var(--border-soft);
  padding: 12px 18px; background: transparent; color: var(--fg); cursor: pointer; text-align: left;
}
.account-button:hover { background: var(--surface); }
.account-button > svg { width: 18px; margin-left: auto; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--fg-2); color: var(--bg); font-weight: 630; }
.account-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.account-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.account-copy small { color: var(--meta); font-size: 12px; }
.sidebar.collapsed { width: var(--sidebar-collapsed); flex-basis: var(--sidebar-collapsed); }
.sidebar.collapsed .brand-button .brand, .sidebar.collapsed .sidebar-head-actions > :first-child, .sidebar.collapsed .nav-item span,
.sidebar.collapsed .section-label, .sidebar.collapsed .section-row, .sidebar.collapsed .recent-list, .sidebar.collapsed .account-copy,
.sidebar.collapsed .account-button > svg { display: none; }
.sidebar.collapsed .brand-mark { display: inline; }
.sidebar.collapsed .sidebar-head { justify-content: center; padding-inline: 6px; }
.sidebar.collapsed .brand-button { display: none; }
.sidebar.collapsed .sidebar-head-actions { display: block; }
.sidebar.collapsed .sidebar-head-actions .desktop-only { display: grid; }
.sidebar.collapsed .primary-nav, .sidebar.collapsed .sidebar-section { padding-inline: 8px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .tools-section { padding-top: 10px; }
.sidebar.collapsed .recent-section { display: none; }
.sidebar.collapsed .account-button { justify-content: center; padding: 10px; }
.sidebar.collapsed .avatar { width: 38px; height: 38px; }
.main-area { min-width: 0; flex: 1; height: 100%; overflow: hidden; background: var(--bg); }
.app-view { height: 100%; overflow: auto; }
.mobile-header { display: none; }
.sidebar-scrim { display: none; }

/* Shared page patterns */
.page { width: min(100%, 1100px); min-height: 100%; margin: 0 auto; padding: 42px 44px 80px; }
.page.wide { width: min(100%, 1240px); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.page-title { margin: 0; font-family: var(--font-display); font-size: 34px; font-weight: 530; letter-spacing: -.035em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); }
.page-actions { display: flex; align-items: center; gap: 10px; }
.toolbar-search { position: relative; display: flex; align-items: center; }
.toolbar-search svg { position: absolute; left: 12px; width: 17px; color: var(--muted); }
.toolbar-search input { width: 240px; height: 42px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px 0 38px; background: var(--surface); color: var(--fg); }
.empty-state { min-height: 440px; display: grid; place-items: center; text-align: center; }
.empty-inner { max-width: 430px; }
.empty-glyph { width: 80px; height: 80px; margin: 0 auto 25px; display: grid; place-items: center; color: var(--fg-2); }
.empty-glyph svg { width: 62px; height: 62px; stroke-width: 1.2; }
.empty-inner h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 28px; font-weight: 430; }
.empty-inner p { margin: 0 0 22px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.workspace-card { min-height: 190px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 20px; background: var(--surface); cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.workspace-card:hover { border-color: var(--border); background: var(--surface-raised); transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-icon { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.card-icon svg { width: 21px; }
.card-menu { width: 32px; height: 32px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.card-menu:hover { background: var(--surface-hover); color: var(--fg); }
.workspace-card h3 { margin: 26px 0 6px; font-size: 16px; }
.workspace-card p { margin: 0; min-height: 42px; color: var(--muted); font-size: 13px; }
.card-meta { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--meta); font-size: 11px; }
.card-meta svg { width: 14px; height: 14px; }
.list-table { border-top: 1px solid var(--border-soft); }
.list-row { min-height: 62px; display: grid; grid-template-columns: minmax(0, 1fr) 180px 42px; align-items: center; gap: 20px; border-bottom: 1px solid var(--border-soft); padding: 8px 2px 8px 14px; cursor: pointer; }
.list-row:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.list-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.list-row-meta { color: var(--meta); font-size: 13px; text-align: right; }
.row-action { width: 34px; height: 34px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.row-action:hover { background: var(--surface-hover); color: var(--fg); }
.row-action svg { width: 17px; height: 17px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 4px 9px; background: var(--surface-hover); color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--meta); }
.status-badge.connected .status-dot { background: var(--success); }
.status-badge.error .status-dot { background: var(--danger); }

/* New chat and conversations */
.new-chat-page { height: 100%; min-height: 650px; display: flex; flex-direction: column; }
.chat-topline { min-height: 54px; display: flex; align-items: center; justify-content: center; padding: 10px 24px; }
.mode-pill { border: 1px solid var(--border-soft); border-radius: 9px; padding: 7px 11px; background: color-mix(in srgb, var(--sidebar) 80%, transparent); color: var(--muted); font-size: 12px; }
.new-chat-center { width: min(100% - 32px, 850px); margin: auto; padding: 20px 0 11vh; }
.greeting { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 0 42px; color: var(--fg-2); }
.greeting-mark { color: var(--accent); font-size: 44px; line-height: 1; }
.greeting h1 { margin: 0; font-family: var(--font-display); font-size: clamp(38px, 4.2vw, 58px); line-height: 1.05; font-weight: 400; letter-spacing: -.045em; text-align: center; }
.composer { border: 1px solid var(--border); border-radius: 24px; background: var(--surface-raised); box-shadow: 0 10px 35px rgba(0,0,0,.11); overflow: hidden; transition: border-color .16s, box-shadow .16s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--muted) 68%, var(--border)); box-shadow: 0 12px 38px rgba(0,0,0,.15); }
.composer textarea { width: 100%; min-height: 92px; max-height: 230px; resize: none; border: 0; outline: 0; padding: 22px 24px 10px; background: transparent; color: var(--fg); font-size: 16px; line-height: 1.5; }
.composer textarea::placeholder { color: var(--muted); }
.composer-bottom { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 11px 14px; }
.composer-tools { min-width: 0; display: flex; align-items: center; gap: 7px; }
.composer-icon { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--fg-2); cursor: pointer; }
.composer-icon:hover { background: var(--surface-hover); color: var(--fg); }
.composer-icon svg { width: 19px; height: 19px; }
.composer-mode { height: 34px; border: 0; border-radius: 8px; padding: 0 8px; background: transparent; color: var(--fg-2); cursor: pointer; font-size: 13px; }
.composer-mode:hover { background: var(--surface-hover); }
.send-button { width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--fg); color: var(--bg); cursor: pointer; }
.send-button:hover { opacity: .85; }
.send-button svg { width: 18px; }
.attachment-chip { max-width: 260px; display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 6px 9px; background: var(--surface-hover); color: var(--fg-2); font-size: 11px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer; }
.composer-footnote { margin: 10px 0 0; color: var(--meta); font-size: 11px; text-align: center; }
.quick-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick-chip { min-height: 36px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--border-soft); border-radius: 9px; padding: 7px 11px; background: var(--surface); color: var(--fg-2); cursor: pointer; font-size: 13px; }
.quick-chip:hover { background: var(--surface-hover); color: var(--fg); }
.quick-chip svg { width: 16px; height: 16px; color: var(--muted); }
.chat-page { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-soft); padding: 9px 18px; }
.chat-heading { min-width: 0; display: flex; align-items: center; gap: 9px; }
.chat-heading strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.chat-back { width: 36px; height: 36px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; cursor: pointer; }
.chat-back:hover { background: var(--surface); }
.chat-back svg { transform: rotate(180deg); }
.chat-messages { min-height: 0; flex: 1; overflow-y: auto; padding: 34px 24px 120px; }
.message-stack { width: min(100%, 790px); margin: 0 auto; }
.message { margin-bottom: 38px; }
.message.user { display: flex; justify-content: flex-end; }
.message.user .message-body { max-width: 80%; border-radius: 18px; padding: 12px 16px; background: var(--surface-raised); white-space: pre-wrap; }
.message.assistant .message-body { color: var(--fg-2); font-family: var(--font-display); font-size: 17px; line-height: 1.68; }
.message.assistant .message-body h1, .message.assistant .message-body h2, .message.assistant .message-body h3 { color: var(--fg); font-family: var(--font-body); line-height: 1.25; }
.message.assistant .message-body h2 { margin: 28px 0 10px; font-size: 18px; }
.message.assistant .message-body pre { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px; background: var(--sidebar); font: 13px/1.6 var(--font-mono); }
.message.assistant .message-body code { font-family: var(--font-mono); font-size: .88em; }
.message-tools { display: flex; gap: 4px; margin-top: 10px; }
.message-tools button { width: 32px; height: 32px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.message-tools button:hover { background: var(--surface); color: var(--fg); }
.message-tools svg { width: 16px; height: 16px; }
.thinking-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.thinking-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.chat-composer-wrap { position: absolute; right: 0; bottom: 0; left: 0; padding: 16px 24px 22px; pointer-events: none; background: linear-gradient(transparent, var(--bg) 35%); }
.chat-composer-wrap .composer { width: min(100%, 820px); margin: auto; pointer-events: auto; border-radius: 20px; }
.chat-composer-wrap .composer textarea { min-height: 64px; padding-top: 16px; }

/* Capabilities and project details */
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.capability-card { min-height: 210px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 24px; background: var(--surface); cursor: pointer; }
.capability-card:hover { border-color: var(--border); background: var(--surface-raised); }
.capability-card svg { color: var(--accent); }
.capability-card h3 { margin: 42px 0 8px; font-family: var(--font-display); font-size: 25px; font-weight: 430; }
.capability-card p { margin: 0; color: var(--muted); font-size: 14px; }
.methodology-panel { margin-top: 20px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.methodology-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border-soft); }
.methodology-head h2 { margin: 0; font-family: var(--font-display); font-size: 26px; }
.methodology-body { display: grid; grid-template-columns: 220px 1fr; min-height: 360px; }
.methodology-steps { padding: 14px; border-right: 1px solid var(--border-soft); }
.methodology-step { width: 100%; border: 0; border-radius: 8px; padding: 11px 12px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.methodology-step.active, .methodology-step:hover { background: var(--surface-hover); color: var(--fg); }
.methodology-copy { padding: 34px; }
.methodology-copy h3 { margin: 0 0 14px; font-family: var(--font-display); font-size: 29px; font-weight: 430; }
.methodology-copy p { color: var(--fg-2); }
.methodology-copy ul { padding-left: 20px; color: var(--muted); }
.detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; }
.detail-main, .detail-side { border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--surface); }
.detail-main { min-height: 500px; padding: 24px; }
.detail-side { padding: 20px; }
.detail-section + .detail-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border-soft); }
.detail-section h3 { margin: 0 0 10px; font-size: 14px; }
.detail-section p { margin: 0; color: var(--muted); font-size: 13px; }
.source-list { display: grid; gap: 8px; margin-top: 14px; }
.source-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: 9px; padding: 10px 12px; color: var(--fg-2); font-size: 13px; }
.source-item svg { width: 17px; color: var(--muted); }
.source-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: var(--overlay); backdrop-filter: blur(5px); animation: modalFade .16s ease both; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.settings-modal { width: min(1200px, 96vw); height: min(870px, 92dvh); display: grid; grid-template-columns: 240px 1fr; overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: var(--surface-raised); box-shadow: var(--shadow); }
.settings-nav { padding: 16px; border-right: 1px solid var(--border-soft); background: var(--sidebar); overflow-y: auto; }
.settings-search { height: 42px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; padding: 0 10px; background: var(--surface); }
.settings-search svg { width: 18px; color: var(--muted); }
.settings-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); }
.settings-search input::placeholder { color: var(--muted); }
.settings-label { display: block; margin: 28px 10px 8px; color: var(--meta); font-size: 12px; }
.settings-label.second { margin-top: 34px; }
.settings-tab { width: 100%; min-height: 41px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--fg-2); cursor: pointer; text-align: left; font-size: 14px; }
.settings-tab:hover, .settings-tab.active { background: var(--surface-hover); color: var(--fg); }
.settings-tab.active { font-weight: 650; }
.settings-tab svg { width: 19px; height: 19px; }
.settings-content-shell { position: relative; min-width: 0; overflow: hidden; }
.settings-content { height: 100%; overflow-y: auto; padding: 64px 34px 70px; }
.modal-close { position: absolute; z-index: 2; top: 17px; right: 18px; width: 38px; height: 38px; }
.settings-mobile-title { display: none; }
.settings-page { width: min(100%, 880px); margin: 0 auto; }
.settings-page > h2 { margin: 0 0 25px; font-size: 18px; }
.settings-page > p.lead { margin: -12px 0 28px; color: var(--muted); font-size: 14px; }
.settings-section { margin: 0 0 42px; }
.settings-section h3 { margin: 0 0 14px; font-size: 16px; }
.setting-row { min-height: 66px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 25px; border-bottom: 1px solid var(--border-soft); padding: 12px 0; }
.setting-row:first-of-type { border-top: 1px solid var(--border-soft); }
.setting-copy strong { display: block; font-size: 14px; }
.setting-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.segmented { display: inline-flex; border-radius: 9px; padding: 3px; background: var(--surface); }
.segmented button { min-width: 42px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.segmented button.active { background: var(--surface-strong); color: var(--fg); }
.switch { position: relative; width: 44px; height: 25px; border: 0; border-radius: 99px; padding: 0; background: var(--surface-strong); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--muted); transition: transform .16s, background .16s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(19px); background: #fff; }
.inline-input { width: min(360px, 42vw); height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--fg); }
.inline-select { min-width: 150px; height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--fg); }
.setting-row.vertical { grid-template-columns: 1fr; align-items: stretch; gap: 12px; padding-block: 18px; }
.setting-row.vertical .form-textarea { min-height: 125px; }
.profile-setting { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.profile-setting .avatar.large { width: 54px; height: 54px; font-size: 20px; }
.profile-setting strong, .profile-setting small { display: block; }
.profile-setting small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.settings-actions { display: flex; justify-content: flex-end; padding-top: 16px; }
.mode-summary { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.mode-summary span { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-soft); border-radius: 10px; padding: 13px; background: var(--surface); color: var(--fg-2); font-size: 13px; }
.mode-summary svg { width: 18px; height: 18px; color: var(--accent); }
.legal-row { width: 100%; min-height: 58px; display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--border-soft); padding: 10px 2px; background: transparent; color: var(--fg); cursor: pointer; text-align: left; }
.legal-row:first-of-type { border-top: 1px solid var(--border-soft); }
.legal-row:hover { color: var(--accent); }
.connectors-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.connector-card { min-height: 94px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--border-soft); border-radius: 12px; padding: 16px; background: var(--surface); }
.connector-logo { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-hover); font-weight: 730; }
.connector-logo.google { color: #6aa6ff; }
.connector-logo.gmail { color: #e36e62; }
.connector-logo.slack { color: #d58bc8; }
.connector-logo.github { color: var(--fg); }
.connector-copy { min-width: 0; flex: 1; }
.connector-copy strong { display: block; font-size: 14px; }
.connector-copy small { color: var(--muted); font-size: 11px; }
.connector-card button { min-height: 34px; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--surface-strong); color: var(--fg); cursor: pointer; font-size: 12px; font-weight: 650; }
.connector-card button:hover { background: var(--fg); color: var(--bg); }
.setup-callout { margin-top: 20px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 12px; padding: 17px 18px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.setup-callout strong { display: block; font-size: 13px; }
.setup-callout p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.memory-list { display: grid; gap: 8px; margin-top: 18px; }
.memory-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: start; gap: 12px; border: 1px solid var(--border-soft); border-radius: 10px; padding: 13px; background: var(--surface); }
.memory-item svg { width: 17px; margin-top: 2px; color: var(--accent); }
.memory-item p { margin: 0; color: var(--fg-2); font-size: 13px; }
.memory-item button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.memory-item button:hover { color: var(--danger); }
.memory-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 10px; margin-top: 20px; }
.memory-form .form-textarea { min-height: 82px; }
.memory-actions { display: flex; align-items: center; gap: 2px; }
.memory-actions button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; }
.memory-actions button:hover { background: var(--surface-hover); }
.soft-empty { border: 1px dashed var(--border); border-radius: 10px; padding: 24px; color: var(--meta); font-size: 13px; text-align: center; }
.archived-list { display: grid; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border)); border-radius: 12px; padding: 0 18px; }

/* Dialogs */
.dialog-card { width: min(100%, 610px); max-height: min(820px, 92dvh); overflow-y: auto; border: 1px solid var(--border); border-radius: 16px; padding: 28px; background: var(--surface-raised); box-shadow: var(--shadow); }
.dialog-card.wide { width: min(100%, 860px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-size: 31px; font-weight: 480; letter-spacing: -.03em; }
.dialog-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.dialog-head button { width: 36px; height: 36px; border: 0; border-radius: 8px; display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer; }
.dialog-head button:hover { background: var(--surface-hover); color: var(--fg); }
.dialog-form { display: grid; gap: 17px; }
.form-field { display: grid; gap: 7px; }
.form-field > span { color: var(--fg-2); font-size: 13px; font-weight: 620; }
.form-textarea { min-height: 110px; resize: vertical; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 7px; }
.legal-copy { color: var(--fg-2); font-size: 14px; line-height: 1.7; }
.legal-copy h3 { margin: 28px 0 8px; color: var(--fg); font-size: 16px; }
.legal-copy p, .legal-copy li { color: var(--muted); }
.legal-copy a { color: var(--accent); }
.legal-copy code { font-family: var(--font-mono); font-size: 12px; }
.code-copy { display: flex; align-items: center; gap: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; padding: 9px 10px; background: var(--surface); }
.code-copy code { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.code-copy button { border: 0; border-radius: 7px; padding: 6px 9px; background: var(--surface-strong); color: var(--fg); cursor: pointer; font-size: 12px; }
.dialog-search { height: 48px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 0 13px; background: var(--surface); }
.dialog-search svg { color: var(--muted); }
.dialog-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); }
.search-results { min-height: 150px; display: grid; align-content: start; gap: 3px; margin-top: 14px; }
.search-result { width: 100%; min-height: 53px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-radius: 9px; padding: 9px 12px; background: transparent; color: var(--fg); cursor: pointer; text-align: left; }
.search-result:hover { background: var(--surface-hover); }
.search-result > span { min-width: 0; display: flex; align-items: center; gap: 11px; }
.search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.search-result small { color: var(--meta); font-size: 11px; }
.search-result svg { width: 18px; height: 18px; color: var(--muted); }

/* Toast */
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: min(390px, calc(100vw - 32px)); border: 1px solid var(--border); border-radius: 11px; padding: 12px 15px; background: var(--surface-strong); color: var(--fg); box-shadow: var(--shadow); font-size: 13px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
.toast.success { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }

@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { order: -1; }
  .settings-modal { grid-template-columns: 210px 1fr; }
}

@media (max-width: 760px) {
  body { overflow: hidden; }
  .auth-header { height: 64px; padding: 18px 20px; }
  .auth-header .brand { font-size: 25px; }
  .auth-main { min-height: calc(100dvh - 64px); padding: 28px 20px 58px; }
  .auth-copy { margin-bottom: 28px; }
  .auth-copy h1 { font-size: 52px; }
  .back-link { position: absolute; top: 23px; left: 20px; }
  .signup-panel { justify-content: flex-start; padding-top: 70px; }
  .signup-stage h1 { margin-bottom: 30px; font-size: 44px; }
  .tour-grid { grid-template-columns: 1fr; }
  .tour-card { min-height: 130px; }
  .tour-card svg { margin-bottom: 17px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, 330px); flex-basis: auto; transform: translateX(-102%); box-shadow: var(--shadow); }
  .sidebar.mobile-open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 29; border: 0; background: rgba(0,0,0,.55); }
  .sidebar.mobile-open + .main-area { pointer-events: none; }
  .sidebar-scrim.show { display: block; }
  .desktop-only { display: none !important; }
  .main-area { width: 100%; }
  .mobile-header { height: 58px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); padding: 7px 10px; }
  .mobile-header .brand { font-size: 24px; }
  .app-view { height: calc(100% - 58px); }
  .page { padding: 26px 18px 70px; }
  .page-head { align-items: flex-start; margin-bottom: 28px; }
  .page-title { font-size: 30px; }
  .page-actions .toolbar-search { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .capability-grid { grid-template-columns: 1fr; }
  .list-row { grid-template-columns: minmax(0,1fr) 34px; padding-left: 2px; }
  .list-row-meta { display: none; }
  .new-chat-page { min-height: 560px; }
  .chat-topline { display: none; }
  .new-chat-center { width: calc(100% - 28px); padding-bottom: 6vh; }
  .greeting { gap: 10px; margin-bottom: 30px; }
  .greeting-mark { font-size: 32px; }
  .greeting h1 { font-size: clamp(34px, 10vw, 45px); }
  .composer { border-radius: 19px; }
  .composer textarea { min-height: 86px; padding: 18px 17px 8px; }
  .quick-actions { margin-inline: -5px; }
  .quick-chip:nth-child(n+4) { display: none; }
  .chat-composer-wrap { left: 0 !important; bottom: 0; padding: 12px 12px calc(14px + env(safe-area-inset-bottom)); }
  .chat-messages { padding: 26px 16px 130px; }
  .message.user .message-body { max-width: 90%; }
  .message.assistant .message-body { font-size: 16px; }
  .methodology-body { grid-template-columns: 1fr; }
  .methodology-steps { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .methodology-step { min-width: max-content; }
  .methodology-copy { padding: 24px 20px; }
  .modal-overlay { padding: 0; }
  .settings-modal { width: 100%; height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .settings-nav { padding-top: 70px; border-right: 0; }
  .settings-content-shell { display: none; }
  .settings-modal.mobile-content .settings-nav { display: none; }
  .settings-modal.mobile-content .settings-content-shell { display: block; }
  .settings-mobile-title { position: absolute; z-index: 2; top: 0; right: 0; left: 0; height: 58px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-soft); padding: 0 12px; background: var(--surface-raised); font-weight: 650; }
  .settings-content { padding: 76px 18px 60px; }
  .modal-close { top: 10px; right: 10px; }
  .inline-input { width: 48vw; }
  .setting-row { grid-template-columns: minmax(0,1fr); }
  .setting-row > :last-child { justify-self: start; }
  .inline-input, .inline-select { width: 100%; }
  .mode-summary { grid-template-columns: 1fr; }
  .memory-form { grid-template-columns: 1fr; }
  .connectors-grid { grid-template-columns: 1fr; }
  .setting-row { gap: 12px; }
  .dialog-card { width: 100%; max-height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; padding: 22px 18px 44px; }
  .dialog-head h2 { font-size: 28px; }
  .toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

html.reduced-motion *, html.reduced-motion *::before, html.reduced-motion *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

/* 2026 interface refinement: Giorgio's own Claude-inspired workspace language. */
:root {
  --bg: #1b1b1a;
  --sidebar: #151514;
  --surface: #242422;
  --surface-raised: #30302d;
  --surface-hover: #343431;
  --surface-strong: #41413d;
  --fg: #f4f2ea;
  --fg-2: #d9d6cc;
  --muted: #aaa79d;
  --meta: #77766f;
  --border: #454541;
  --border-soft: #30302d;
  --accent: #d97757;
  --accent-strong: #c96442;
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Geist", Arial, system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;
  --sidebar-width: 300px;
}

body, button, input, textarea, select { font-weight: 430; }
strong, b, .primary-button, .secondary-button, .danger-button, .quiet-button,
.nav-item.active, .settings-tab.active, .connector-card button { font-weight: 530; }
.brand, h1, h2, h3, .auth-copy h1, .signup-stage h1, .page-title,
.greeting h1, .dialog-head h2, .capability-card h3, .methodology-copy h3 { font-weight: 430; }
.auth-form label, .field-label, .form-field > span { font-weight: 430; }
.section-kicker { display: block; margin-bottom: 8px; color: var(--accent); font-size: 12px; letter-spacing: .02em; }
.sun-mark { color: var(--accent); font-family: var(--font-body); font-size: 30px; font-weight: 400; line-height: 1; }
.auth-leave { opacity: 0 !important; transform: translateY(-8px) !important; pointer-events: none; }

/* Authentication landing */
.auth-screen { background: #111110; }
.auth-header {
  position: sticky; top: 0; z-index: 10; height: 94px; display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  padding: 0 clamp(24px, 4.2vw, 80px); border-bottom: 1px solid #252523;
  background: color-mix(in srgb, #111110 94%, transparent); backdrop-filter: blur(16px);
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-header .brand { font-size: 37px; color: #f6f4ee; letter-spacing: -.045em; }
.auth-primary-links { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2vw, 32px); padding-inline: 26px; }
.auth-primary-links > a, .auth-primary-links > button, .auth-menu > summary {
  border: 0; padding: 9px 0; background: transparent; color: #c7c4bb; cursor: pointer;
  font: 430 14px var(--font-body); text-decoration: none; list-style: none;
}
.auth-primary-links > a:hover, .auth-primary-links > button:hover, .auth-menu > summary:hover { color: #fff; }
.auth-menu > summary::-webkit-details-marker { display: none; }
.auth-menu > summary span { margin-left: 3px; color: #7f7d77; }
.auth-menu[open] > summary { color: #fff; }
.auth-mega-menu {
  position: absolute; top: 76px; left: 50%; width: min(890px, calc(100vw - 80px));
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; transform: translateX(-50%);
  overflow: hidden; border: 1px solid #2c2c2a; border-radius: 15px; padding: 20px;
  background: #171716; box-shadow: 0 28px 70px rgba(0,0,0,.48);
}
.auth-mega-menu > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 24px 10px; border-right: 1px solid #2b2b29; }
.auth-mega-menu > div:last-child { border-right: 0; }
.auth-mega-menu small { margin-bottom: 10px; color: #77756f; font-size: 10px; }
.auth-mega-menu button { border: 0; border-radius: 7px; padding: 9px 8px; background: transparent; color: #eeeae1; cursor: pointer; text-align: left; font-size: 14px; }
.auth-mega-menu button:hover { background: #252523; }
.auth-header-links { display: flex; align-items: center; gap: 12px; }
.auth-header-links button { min-height: 44px; border: 0; border-radius: 10px; padding: 0 18px; background: transparent; color: #d1cec5; cursor: pointer; }
.auth-header-links button:hover { background: #252523; color: #fff; }
.auth-header-links .auth-header-cta { background: #f4f2ea; color: #171716; }
.auth-header-links .auth-header-cta:hover { background: #dedbd2; color: #171716; }
.auth-main { min-height: calc(100dvh - 94px); display: block; padding: 0; }
.auth-panel { width: 100%; max-width: none; align-items: stretch; transition: opacity .22s ease, transform .22s ease; }
.login-hero {
  width: min(100%, 1530px); min-height: calc(100dvh - 94px); margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(420px, .76fr); align-items: center; gap: clamp(48px, 8vw, 140px);
  padding: 72px clamp(28px, 6vw, 108px) 88px;
}
.login-column { width: min(100%, 590px); }
.auth-copy { margin-bottom: 34px; }
.auth-copy .eyebrow { margin-bottom: 18px; color: var(--accent); font-size: 15px; font-weight: 430; }
.auth-copy h1 { max-width: 670px; color: #f7f5ef; font-size: clamp(58px, 5.2vw, 82px); line-height: .98; letter-spacing: -.052em; }
.auth-copy > p:last-child { max-width: 570px; margin-top: 22px; color: #d0cdc4; font-family: var(--font-display); font-size: 24px; line-height: 1.25; }
.login-card { width: min(100%, 560px); border: 1px solid #30302e; border-radius: 32px; padding: 28px 34px 25px; background: #131312; }
.login-card h2 { margin: 0 0 22px; color: #f5f3ec; font-family: var(--font-display); font-size: 31px; }
.auth-form { gap: 15px; }
.auth-form input { height: 50px; border-color: #393936; background: #1c1c1b; color: #f5f3ec; }
.auth-form input:focus { border-color: #73716a; background: #20201f; }
.login-card .primary-button { min-height: 50px; border-radius: 11px; background: #f6f4ee; color: #171716; }
.login-card .primary-button:hover { background: #dedbd2; }
.login-card .auth-create { margin: 20px auto 0; color: var(--accent); }
.login-card .auth-links { margin-top: 17px; }
.login-card .auth-consent { margin-top: 20px; }
.auth-photo { position: relative; width: 100%; max-width: 590px; margin: 0; justify-self: end; overflow: hidden; border-radius: 25px; background: #242422; aspect-ratio: 4 / 5; }
.auth-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 62%, rgba(0,0,0,.55)); pointer-events: none; }
.auth-photo img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.78) contrast(.94) brightness(.8); }
.auth-photo figcaption { position: absolute; z-index: 1; right: 17px; bottom: 13px; color: rgba(255,255,255,.7); font-size: 10px; }
.auth-photo a { color: inherit; }
.auth-faq { min-height: 560px; padding: 90px max(24px, calc((100vw - 900px) / 2)); border-top: 1px solid #252523; background: #111110; }
.auth-faq > h2 { margin: 0 0 46px; color: #f4f2ea; font-family: var(--font-display); font-size: clamp(36px, 4vw, 54px); text-align: center; }
.auth-faq details { border-bottom: 1px solid #2f2f2c; }
.auth-faq summary { position: relative; padding: 21px 48px 21px 4px; color: #dedbd2; cursor: pointer; list-style: none; font-family: var(--font-display); font-size: 25px; }
.auth-faq summary::-webkit-details-marker { display: none; }
.auth-faq summary::after { content: "+"; position: absolute; right: 9px; top: 17px; color: #aaa79d; font: 28px/1 var(--font-body); }
.auth-faq details[open] summary::after { content: "−"; }
.auth-faq details p { max-width: 720px; margin: 0 0 24px 4px; color: #aaa79d; line-height: 1.65; }
.auth-footer { display: grid; grid-template-columns: 1.35fr repeat(4, 1fr); gap: 46px; padding: 72px clamp(28px, 6vw, 100px) 88px; background: #2b2b29; }
.auth-footer > div { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.auth-footer > div > span { color: #c4c1b7; font-size: 12px; }
.auth-footer button, .auth-footer a { border: 0; padding: 0; background: none; color: #f1efe8; cursor: pointer; text-decoration: none; text-align: left; }
.auth-footer button:hover, .auth-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-footer small { color: #8d8b84; font-size: 11px; line-height: 1.5; }
.auth-footer-brand { gap: 8px !important; }
.auth-footer-brand .brand { color: #f4f2ea; font-size: 34px; }
.auth-footer-brand .sun-mark { font-size: 26px; }
.signup-panel { width: min(100%, 900px); min-height: 100dvh; margin: auto; padding: 90px 32px; }
.signup-stage h1 { font-size: clamp(44px, 6vw, 66px); }
.tour-lead { max-width: 690px; margin: -22px 0 28px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.tour-grid { grid-template-columns: repeat(2, 1fr); }
.tour-card { min-height: 165px; }
.tour-card h3 { font-weight: 430; }

/* App shell */
.sidebar { box-shadow: none; }
.sidebar-head { height: 64px; }
.brand-button .brand { font-size: 27px; }
.nav-item { min-height: 40px; font-size: 14px; }
.nav-item.active { background: #0f0f0e; }
.account-button { min-height: 78px; }
.avatar { font-weight: 530; }
.list-row-title { font-weight: 490; }
.connector-logo { font-weight: 730; }
.settings-mobile-title { font-weight: 580; }
.page { padding-top: 38px; }
.page-title { font-size: 35px; }
.page-subtitle { font-size: 14px; }
.new-chat-center { width: min(100% - 36px, 842px); }
.greeting { margin-bottom: 38px; }
.greeting-mark { color: var(--accent); font-size: 46px; }
.greeting h1 { max-width: 780px; font-size: clamp(42px, 4.3vw, 61px); letter-spacing: -.048em; }
.composer { border: 0; border-radius: 24px; background: #383834; box-shadow: none; }
.composer:focus-within { border: 0; box-shadow: 0 0 0 1px #53534e; }
.composer textarea { min-height: 94px; }
#attachment-area { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px; }
.attachment-chip { background: #484843; }
.quick-chip { border: 0; background: #30302d; }
.quick-chip:hover { background: #3a3a36; }
.message.assistant .message-body { font-size: 17px; }
.settings-modal { background: #2d2d2a; }
.settings-content { padding-top: 70px; }

/* Forensic workbench */
.forensic-page { width: min(100%, 1280px); min-height: 100%; margin: auto; padding: 42px 42px 74px; }
.forensic-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.forensic-head h1 { margin: 0; font-family: var(--font-display); font-size: 48px; letter-spacing: -.04em; }
.forensic-head p { margin: 8px 0 0; color: var(--muted); }
.forensic-seal { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; color: var(--muted); font-size: 12px; }
.forensic-seal svg { width: 17px; color: var(--accent); }
.forensic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.forensic-workbench, .forensic-protocol { border: 1px solid var(--border-soft); border-radius: 18px; background: var(--surface); }
.forensic-workbench { min-height: 560px; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 58px); }
.forensic-intro { display: flex; align-items: center; gap: 18px; margin: 0 auto 30px; max-width: 720px; }
.forensic-intro .empty-glyph { width: 58px; height: 58px; flex: 0 0 auto; margin: 0; }
.forensic-intro .empty-glyph svg { width: 44px; }
.forensic-intro h2 { margin: 0 0 5px; font-family: var(--font-display); font-size: 31px; }
.forensic-intro p { margin: 0; color: var(--muted); font-size: 13px; }
.forensic-workbench .composer { width: 100%; max-width: 760px; margin: 0 auto; }
.forensic-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.forensic-prompts button { border: 0; border-radius: 8px; padding: 8px 11px; background: var(--surface-hover); color: var(--muted); cursor: pointer; font-size: 12px; }
.forensic-prompts button:hover { color: var(--fg); }
.forensic-protocol { padding: 26px 24px; }
.forensic-protocol h2 { margin: 0 0 20px; font-family: var(--font-display); font-size: 27px; }
.forensic-protocol ol { margin: 0; padding: 0; list-style: none; counter-reset: protocol; }
.forensic-protocol li { position: relative; padding: 0 0 20px 38px; counter-increment: protocol; }
.forensic-protocol li::before { content: counter(protocol); position: absolute; top: 0; left: 0; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--fg-2); font-size: 11px; }
.forensic-protocol li:not(:last-child)::after { content: ""; position: absolute; top: 26px; bottom: 2px; left: 12px; border-left: 1px solid var(--border-soft); }
.forensic-protocol li strong, .forensic-protocol li span { display: block; }
.forensic-protocol li strong { margin-bottom: 3px; font-size: 13px; }
.forensic-protocol li span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.forensic-warning { margin: 8px 0 22px; border-top: 1px solid var(--border-soft); padding-top: 18px; color: var(--meta); font-size: 11px; line-height: 1.55; }

/* Giorgio Code */
.code-home .page-head { margin-bottom: 24px; }
.code-hero { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 42px; border: 1px solid var(--border-soft); border-radius: 18px; padding: 30px; margin-bottom: 24px; background: var(--surface); }
.code-hero-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 13px; margin-bottom: 24px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); color: var(--accent); }
.code-hero h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 31px; }
.code-hero p { margin: 0; max-width: 510px; color: var(--muted); font-size: 13px; }
.code-hero-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.code-hero-grid > span { min-height: 130px; display: flex; flex-direction: column; border-radius: 12px; padding: 16px; background: var(--surface-raised); }
.code-hero-grid svg { width: 19px; color: var(--muted); }
.code-hero-grid strong { margin-top: auto; font-size: 13px; }
.code-hero-grid small { margin-top: 4px; color: var(--meta); font-size: 10px; line-height: 1.45; }
.code-workspace-card > .status-badge { margin-top: 16px; }
.code-workspace-card h3 { margin-top: 12px; }
.code-page { height: 100%; min-height: 620px; display: flex; flex-direction: column; overflow: hidden; }
.code-workspace-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--border-soft); padding: 9px 16px; }
.code-workspace-title { min-width: 0; display: flex; align-items: center; gap: 9px; }
.code-workspace-title .icon-button svg { transform: rotate(180deg); }
.code-workspace-title > div { min-width: 0; }
.code-workspace-title strong, .code-workspace-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-workspace-title strong { font-size: 14px; }
.code-workspace-title span { margin-top: 2px; color: var(--meta); font-size: 10px; }
.code-workspace-head .primary-button, .code-workspace-head .secondary-button, .code-workspace-head .quiet-button { min-height: 38px; padding-block: 8px; font-size: 12px; }
.code-shell { min-height: 0; flex: 1; display: grid; grid-template-columns: 220px minmax(360px, 1fr) 340px; }
.code-file-panel, .code-agent { min-height: 0; background: var(--sidebar); }
.code-file-panel { display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); }
.code-panel-label { padding: 16px 15px 8px; color: var(--meta); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.code-file-tree { min-height: 0; flex: 1; overflow: auto; padding: 4px 8px 12px; }
.code-file-item { width: 100%; min-height: 34px; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; padding: 6px 8px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-family: var(--font-mono); font-size: 11px; }
.code-file-item:hover, .code-file-item.active { background: var(--surface); color: var(--fg); }
.code-file-item svg { width: 15px; height: 15px; }
.code-file-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-files-empty { padding: 12px 8px; color: var(--meta); font-size: 11px; }
.code-add-file { min-height: 42px; display: flex; align-items: center; gap: 8px; border: 0; border-top: 1px solid var(--border-soft); padding: 9px 14px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-size: 11px; }
.code-add-file:hover { color: var(--fg); background: var(--surface); }
.code-add-file svg { width: 15px; }
.code-editor-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #1d1d1c; }
.code-editor-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border-soft); padding: 8px 13px 8px 18px; }
.code-editor-head > div { display: flex; align-items: center; gap: 5px; }
.code-editor-head > div:first-child { min-width: 0; display: block; }
.code-editor-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px var(--font-mono); }
.code-editor-head span { display: block; margin-top: 3px; color: var(--meta); font-size: 9px; }
.code-editor-head .secondary-button { min-height: 34px; padding: 7px 12px; font-size: 11px; }
.danger-icon:hover { color: var(--danger); }
.code-editor { width: 100%; min-height: 0; flex: 1; resize: none; border: 0; outline: 0; padding: 22px 24px 70px; background: #1d1d1c; color: #e9e6dc; caret-color: var(--accent); font: 13px/1.65 var(--font-mono); tab-size: 2; }
.code-editor-empty { height: 100%; display: grid; place-content: center; justify-items: center; padding: 30px; color: var(--muted); text-align: center; }
.code-editor-empty > svg { width: 52px; height: 52px; margin-bottom: 20px; stroke-width: 1.2; }
.code-editor-empty h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 26px; }
.code-editor-empty p { max-width: 420px; margin: 0 0 20px; color: var(--meta); font-size: 12px; }
.code-agent { display: flex; flex-direction: column; border-left: 1px solid var(--border-soft); padding: 18px 16px; }
.code-agent-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.code-agent-head .sun-mark { font-size: 23px; }
.code-agent-head strong, .code-agent-head span { display: block; }
.code-agent-head strong { font-size: 13px; }
.code-agent-head span { margin-top: 2px; color: var(--meta); font-size: 10px; }
.code-agent textarea { width: 100%; min-height: 170px; flex: 1; resize: none; border: 1px solid var(--border); border-radius: 13px; outline: 0; padding: 13px; background: var(--surface); color: var(--fg); font-size: 13px; line-height: 1.55; }
.code-agent textarea:focus { border-color: var(--muted); }
.code-agent-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.code-agent-presets button { border: 0; border-radius: 7px; padding: 6px 8px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 9px; }
.code-agent-presets button:hover { color: var(--fg); background: var(--surface-hover); }
.code-agent .primary-button { display: flex; align-items: center; justify-content: center; gap: 8px; }
.code-agent .primary-button svg { width: 16px; }
.code-agent > p { margin: 10px 2px 0; color: var(--meta); font-size: 9px; line-height: 1.45; }

@media (max-width: 1120px) {
  .login-hero { grid-template-columns: minmax(0, 1fr) minmax(350px, .7fr); gap: 46px; }
  .auth-copy h1 { font-size: clamp(52px, 6vw, 70px); }
  .code-shell { grid-template-columns: 190px minmax(340px, 1fr) 300px; }
  .forensic-layout { grid-template-columns: 1fr 290px; }
}

@media (max-width: 900px) {
  .login-hero { grid-template-columns: 1fr; padding-top: 52px; }
  .login-column { margin: auto; }
  .auth-photo { max-width: 590px; justify-self: center; aspect-ratio: 16 / 11; }
  .auth-primary-links { display: none; }
  .auth-footer { grid-template-columns: repeat(3, 1fr); }
  .code-hero { grid-template-columns: 1fr; }
  .code-shell { grid-template-columns: 190px minmax(0, 1fr); overflow: auto; }
  .code-agent { grid-column: 1 / -1; min-height: 330px; border-top: 1px solid var(--border-soft); border-left: 0; }
  .code-agent textarea { min-height: 130px; }
  .forensic-layout { grid-template-columns: 1fr; }
  .forensic-protocol { order: -1; }
}

@media (max-width: 760px) {
  .auth-header { height: 68px; padding: 0 18px; }
  .auth-header .brand { font-size: 28px; }
  .auth-header .sun-mark { font-size: 23px; }
  .auth-primary-links { display: none; }
  .auth-header-links > button:first-child { display: none; }
  .auth-header-links .auth-header-cta { min-height: 38px; padding-inline: 13px; font-size: 12px; }
  .auth-main { min-height: calc(100dvh - 68px); padding: 0; }
  .login-hero { min-height: auto; gap: 42px; padding: 45px 18px 58px; }
  .auth-copy { margin-bottom: 27px; }
  .auth-copy .eyebrow { font-size: 12px; }
  .auth-copy h1 { font-size: clamp(38px, 11vw, 52px); }
  .auth-copy > p:last-child { margin-top: 16px; font-size: 17px; }
  .login-card { border-radius: 22px; padding: 24px 18px 21px; }
  .login-card h2 { font-size: 28px; }
  .auth-photo { border-radius: 18px; aspect-ratio: 4 / 3; }
  .auth-faq { min-height: 0; padding: 58px 19px; }
  .auth-faq > h2 { margin-bottom: 30px; text-align: left; }
  .auth-faq summary { font-size: 21px; }
  .auth-footer { grid-template-columns: 1fr; gap: 34px; padding: 52px 20px 70px; }
  .signup-panel { min-height: 100dvh; padding: 88px 20px 50px; }
  .tour-grid { grid-template-columns: 1fr; }
  .tour-lead { margin-top: -16px; }
  .forensic-page { padding: 28px 16px 60px; }
  .forensic-head { align-items: flex-start; flex-direction: column; }
  .forensic-head h1 { font-size: 39px; }
  .forensic-workbench { min-height: 480px; padding: 25px 14px; }
  .forensic-intro { align-items: flex-start; padding-inline: 8px; }
  .forensic-intro .empty-glyph { display: none; }
  .forensic-intro h2 { font-size: 26px; }
  .forensic-prompts { justify-content: flex-start; padding-inline: 4px; }
  .code-home .page-head { gap: 16px; }
  .code-home .page-head > .primary-button { width: 100%; }
  .code-hero { padding: 22px 17px; }
  .code-hero-grid { grid-template-columns: 1fr; }
  .code-hero-grid > span { min-height: 100px; }
  .code-workspace-head { align-items: flex-start; flex-direction: column; padding: 10px 12px; }
  .code-workspace-head .page-actions { width: 100%; overflow-x: auto; }
  .code-shell { display: flex; flex-direction: column; overflow: auto; }
  .code-file-panel { min-height: 190px; max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .code-editor-panel { min-height: 520px; }
  .code-editor { min-height: 460px; padding: 17px 15px 56px; font-size: 12px; }
  .code-agent { min-height: 390px; }
}
