:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --subtle: #86868b;
  --paper: #f5f5f7;
  --surface: #ffffff;
  --line: #d2d2d7;
  --soft-line: #e8e8ed;
  --green: #267a64;
  --green-soft: #eaf5f0;
  --accent: #0071e3;
  --accent-soft: #eaf3ff;
  --blue: #4271a4;
  --blue-soft: #eaf1f8;
  --amber: #c47b28;
  --amber-soft: #fff3e1;
  --coral: #b85f53;
  --coral-soft: #faece9;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(66, 113, 164, 0.28); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 258px; flex: 0 0 258px; background: rgba(245,245,247,0.88); border-right: 1px solid var(--line); padding: 25px 16px 18px; display: flex; flex-direction: column; }
.brand-lockup { display: flex; align-items: center; gap: 11px; padding: 0 11px 24px; }
.brand-mark { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px; background: var(--ink); color: white; font-weight: 800; letter-spacing: 0.05em; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: 0.15em; }
.brand-subtitle { margin-top: 3px; color: var(--muted); font-size: 10px; letter-spacing: 0.02em; }
.workspace-chip { display: flex; align-items: center; gap: 8px; padding: 10px 11px; margin: 0 0 22px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.72); color: #536168; font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); display: inline-block; }
.status-dot.green { background: #4a9d7d; }
.chip-lock { margin-left: auto; padding: 3px 6px; border: 1px solid #d9e1db; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.nav-list { display: grid; gap: 4px; }
.nav-button { display: flex; align-items: center; gap: 11px; min-width: 0; border: 0; border-left: 2px solid transparent; border-radius: 8px; background: transparent; color: #59666b; padding: 10px 11px; text-align: left; font-size: 13px; overflow-wrap: anywhere; transition: background-color .2s ease, color .2s ease, transform .2s ease; }
.nav-button:hover { background: #e9e9ee; color: var(--ink); transform: translateX(1px); }
.nav-button.active { background: #e2e2e7; border-left-color: var(--accent); color: var(--ink); font-weight: 700; }
.nav-icon { width: 19px; color: #80908d; text-align: center; font-size: 15px; }
.nav-button.active .nav-icon { color: var(--green); }
.nav-count { margin-left: auto; min-width: 19px; padding: 2px 5px; border-radius: 10px; background: #dbe9e2; color: #317261; text-align: center; font-size: 10px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 13px; padding: 18px 11px 0; border-top: 1px solid var(--line); }
.system-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.storage-quota-meter { color: var(--muted); font-size: 10px; line-height: 1.4; }
.storage-quota-meter.warning { color: var(--coral); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--muted); font-size: 11px; text-align: left; }
.text-button:hover { color: var(--coral); }
.recovery-button { color: var(--amber); }

.main-area { min-width: 0; flex: 1; }
.topbar { position: sticky; top: 0; z-index: 5; height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 39px; border-bottom: 1px solid rgba(210,210,215,0.8); background: rgba(245,245,247,0.88); backdrop-filter: saturate(180%) blur(18px); }
.breadcrumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--subtle); font-size: 12px; }
.crumb-separator { color: #c5cbc6; }
.breadcrumbs strong { color: var(--ink); font-size: 13px; }
.topbar-actions { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; }
.search-box { display: flex; align-items: center; gap: 7px; min-width: 225px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.78); color: var(--subtle); transition: border-color .2s ease, box-shadow .2s ease; }
.search-box:focus-within { border-color: #8abcf0; box-shadow: 0 0 0 3px rgba(0,113,227,0.12); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box kbd { border: 1px solid var(--line); padding: 1px 5px; color: var(--subtle); font-size: 10px; }
.search-results { position: absolute; top: 43px; right: 52px; z-index: 8; width: min(390px, 56vw); max-height: 380px; overflow: auto; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.97); box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.search-results[hidden] { display: none; }
.search-result { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { outline: 0; background: #f3f6f3; }
.search-result-kind { color: var(--subtle); font-size: 10px; }
.search-result-text { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.capture-button, .primary-button, .secondary-button { border: 0; border-radius: 8px; padding: 9px 13px; font-size: 12px; font-weight: 700; transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.capture-button, .primary-button { background: var(--accent); color: white; box-shadow: 0 1px 1px rgba(0,0,0,0.06); }
.capture-button:hover, .primary-button:hover { background: #0077ed; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0,113,227,0.18); }
.capture-button span { color: #b8ddc9; font-size: 16px; vertical-align: -1px; }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,0.78); color: #526168; }
.secondary-button:hover { background: white; border-color: #b9b9c0; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #dbe6ee; color: #3e5d75; font-size: 11px; font-weight: 800; }
.content { max-width: 1320px; margin: 0 auto; padding: 44px 40px 78px; animation: content-in .35s ease both; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { margin-top: 8px; font-size: 38px; letter-spacing: 0; line-height: 1.1; }
h2 { margin-top: 6px; font-size: 20px; letter-spacing: 0; }
h3 { font-size: 14px; }
.heading-copy { max-width: 700px; }
.heading-note { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.date-note { color: var(--subtle); font-size: 11px; }
.heading-actions { display: flex; gap: 8px; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); background: white; color: var(--muted); font-size: 20px; line-height: 1; }
.icon-button:hover { color: var(--ink); background: #f4f7f3; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-card { padding: 18px 19px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.82); box-shadow: 0 1px 1px rgba(0,0,0,0.02); }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-value { margin-top: 9px; font-size: 25px; font-weight: 750; letter-spacing: 0; }
.stat-meta { margin-top: 5px; color: var(--subtle); font-size: 10px; }
.stat-meta.positive { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(280px, .68fr); gap: 16px; }
.stack { display: grid; gap: 16px; align-content: start; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.86); box-shadow: 0 1px 1px rgba(0,0,0,0.02); overflow: hidden; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 19px 14px; border-bottom: 1px solid var(--soft-line); }
.panel-title { font-size: 14px; font-weight: 750; }
.panel-subtitle { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.panel-action { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.panel-body { padding: 17px 19px; }
.focus-card { padding: 22px; border-radius: 8px; background: #1d1d1f; color: white; box-shadow: var(--shadow); }
.focus-card .eyebrow { color: #a9dac6; }
.focus-title { max-width: 680px; margin-top: 9px; font-size: 20px; line-height: 1.26; letter-spacing: 0; }
.focus-copy { margin-top: 9px; color: #c0d4cf; font-size: 12px; line-height: 1.6; }
.focus-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,0.17); color: #bbd6ce; font-size: 11px; }
.focus-footer strong { color: white; }
.action-list { display: grid; gap: 2px; }
.action-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--soft-line); }
.action-row:last-child { border-bottom: 0; padding-bottom: 0; }
.action-check { width: 17px; height: 17px; border: 1px solid #b4c0b9; border-radius: 50%; background: white; flex: 0 0 auto; }
.action-check:hover { border-color: var(--green); background: var(--green-soft); }
.action-check.done { display: inline-grid; place-items: center; border-color: var(--green); background: var(--green); color: white; }
.action-check.done::after { content: '✓'; font-size: 11px; line-height: 1; }
.action-row.is-done { opacity: .58; }
.action-row.is-done .action-name { text-decoration: line-through; }
.action-row.is-verified { opacity: .8; }
.action-row.is-verified .action-name { text-decoration: none; }
.result-button { margin-left: auto; }
.action-state { min-width: 84px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: 10px; }
.action-main { min-width: 0; flex: 1; }
.action-name { color: var(--ink); font-size: 12px; line-height: 1.4; }
.action-context { margin-top: 3px; color: var(--muted); font-size: 10px; }
.action-tag { padding: 4px 7px; background: var(--amber-soft); color: var(--amber); font-size: 10px; white-space: nowrap; }
.pulse-list { display: grid; gap: 12px; }
.pulse-item { display: grid; grid-template-columns: 9px 1fr; gap: 10px; }
.pulse-line { width: 2px; margin-left: 3px; background: #b8d4c8; }
.pulse-item.warn .pulse-line { background: #e1b36c; }
.pulse-item.info .pulse-line { background: #9ebbd6; }
.pulse-title { font-size: 12px; line-height: 1.4; }
.pulse-meta { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.review-card { display: flex; align-items: flex-start; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.review-card:last-child { padding-bottom: 0; border-bottom: 0; }
.review-icon { width: 28px; height: 28px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 800; }
.review-main { min-width: 0; flex: 1; }
.review-title { font-size: 12px; line-height: 1.4; }
.review-meta { margin-top: 4px; color: var(--muted); font-size: 10px; }
.review-history-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.review-history-row:last-child { border-bottom: 0; }
.link-button { border: 0; padding: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }

.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.three-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.object-card { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.86); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.object-card:hover { border-color: #b9b9c0; box-shadow: 0 9px 28px rgba(0,0,0,0.06); transform: translateY(-2px); }
.object-top { display: flex; justify-content: space-between; gap: 12px; }
.object-title { font-size: 14px; font-weight: 750; line-height: 1.4; }
.object-desc { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.badge { display: inline-flex; align-items: center; padding: 4px 7px; font-size: 10px; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.coral { background: var(--coral-soft); color: var(--coral); }
.object-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--soft-line); color: var(--muted); font-size: 10px; }
.goal-signals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.goal-signals > div { min-width: 0; padding: 9px 10px; border: 1px solid var(--soft-line); background: #fafbf9; }
.goal-signals span { display: block; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.goal-signals strong { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 600; line-height: 1.4; }
.inline-editor { margin-top: 13px; border-top: 1px solid var(--soft-line); padding-top: 11px; }
.inline-editor summary { cursor: pointer; color: var(--green); font-size: 10px; font-weight: 700; list-style: none; }
.inline-editor summary::-webkit-details-marker { display: none; }
.inline-editor form { display: grid; gap: 10px; margin-top: 11px; }
.inline-editor label { display: grid; gap: 5px; color: var(--subtle); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.inline-editor input, .inline-editor textarea, .inline-editor select { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: white; color: var(--ink); font-size: 11px; line-height: 1.45; text-transform: none; letter-spacing: 0; }
.inline-editor textarea { resize: vertical; }
.editor-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.project-controls { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: 14px; }
.project-controls label, .detail-form label { display: grid; gap: 5px; color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.inline-select { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font-size: 11px; text-transform: none; letter-spacing: 0; }
.progress-track { height: 5px; margin-top: 13px; background: #edf1ed; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); }
.progress-bar.blue { background: var(--blue); }
.progress-label { display: flex; justify-content: space-between; margin-top: 6px; color: var(--subtle); font-size: 10px; }
.empty-state { grid-column: 1 / -1; padding: 42px 20px; border: 1px dashed #cfd8d0; border-radius: 8px; background: #fbfcfa; color: var(--muted); text-align: center; }
.empty-title { color: var(--ink); font-size: 14px; font-weight: 700; }
.empty-copy { max-width: 420px; margin: 8px auto 0; font-size: 12px; line-height: 1.6; }

.inbox-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.inbox-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 16px 17px; border-bottom: 1px solid var(--soft-line); }
.inbox-row:last-child { border-bottom: 0; }
.inbox-marker { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.inbox-marker.idea { background: var(--blue); }
.inbox-marker.note { background: var(--green); }
.inbox-marker.link { background: var(--coral); }
.inbox-copy { min-width: 0; }
.inbox-text { font-size: 13px; line-height: 1.5; }
.inbox-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.row-actions { display: flex; gap: 7px; }
.inbox-status { min-width: 83px; padding: 6px 7px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: 10px; }
.small-button { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: white; color: #55636a; font-size: 10px; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.small-button:hover { border-color: #bad0c5; color: var(--green); }
.small-button.primary { border-color: var(--accent); background: var(--accent); color: white; }

.table-list { display: grid; border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.table-row { display: grid; grid-template-columns: minmax(210px, 1.4fr) .8fr .8fr 1fr; gap: 14px; align-items: center; padding: 14px 17px; border-bottom: 1px solid var(--soft-line); }
.table-row:last-child { border-bottom: 0; }
.table-head { color: var(--subtle); background: #f6f8f5; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.table-cell { min-width: 0; font-size: 11px; line-height: 1.45; }
.table-cell.primary { font-size: 12px; font-weight: 700; }
.decision-detail { padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.72); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 17px; }
.detail-item { padding-top: 10px; border-top: 1px solid var(--line); }
.detail-label { color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.detail-value { margin-top: 5px; font-size: 12px; line-height: 1.5; }
.detail-form { display: grid; gap: 12px; margin-top: 17px; }
.decision-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-form input, .detail-form textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: white; color: var(--ink); font-size: 12px; line-height: 1.5; text-transform: none; letter-spacing: 0; }
.detail-form textarea { resize: vertical; }
.detail-form input:focus, .detail-form textarea:focus, .inline-select:focus { border-color: #9fc0b0; }

.review-tabs { display: flex; gap: 5px; margin-bottom: 17px; }
.tab-button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: rgba(255,255,255,0.78); color: var(--muted); font-size: 11px; transition: background-color .2s ease, border-color .2s ease; }
.tab-button.active { border-color: #9cc5ee; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 16px; }
.review-sheet { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 1px 1px rgba(0,0,0,0.02); }
.review-sheet h3 { margin-top: 20px; font-size: 14px; }
.review-sheet h3:first-child { margin-top: 0; }
.review-sheet ul { display: grid; gap: 10px; margin: 11px 0 0; padding-left: 18px; color: #4e5b60; font-size: 12px; line-height: 1.55; }
.approval-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--soft-line); }
.approval-note { color: var(--muted); font-size: 11px; }
.memory-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.memory-row:last-child { border-bottom: 0; }
.memory-copy { min-width: 0; }
.memory-name { font-size: 12px; line-height: 1.45; }
.memory-source { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.memory-edit-input { width: 100%; min-width: 0; padding: 6px 7px; border: 1px solid var(--soft-line); border-radius: 6px; outline: 0; background: #fff; color: var(--ink); font: inherit; font-size: 12px; line-height: 1.45; }
.memory-edit-input:focus { border-color: #9fc0b0; }
.memory-edit-input:disabled { color: var(--subtle); background: #f6f7f6; }
.memory-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.memory-actions .small-button { padding: 4px 6px; }
.ai-disposition { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--soft-line); }
.result-row:last-child { border-bottom: 0; }
.result-marker { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.result-copy { min-width: 0; flex: 1; }
.result-title { font-size: 11px; line-height: 1.5; }
.result-meta { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.ask-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr); gap: 16px; align-items: start; }
.ask-panel { border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 1px 1px rgba(0,0,0,0.02); overflow: hidden; }
.ask-messages { min-height: 355px; display: grid; align-content: start; gap: 16px; padding: 20px; }
.message { max-width: 92%; padding: 13px 15px; font-size: 12px; line-height: 1.65; }
.message.ai { border: 1px solid var(--line); border-radius: 8px; background: #f5f5f7; }
.message.user { border-radius: 8px; }
.message.user { margin-left: auto; background: var(--ink); color: white; }
.message-label { margin-bottom: 5px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user .message-label { color: #b7d8ca; }
.answer-qualification { display: flex; align-items: flex-start; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.source-chip { padding: 4px 7px; border: 1px solid #d7e4db; background: white; color: #47705f; font-size: 10px; }
.ask-form { display: flex; gap: 9px; padding: 14px 16px; border-top: 1px solid var(--soft-line); }
.ask-form input { min-width: 0; flex: 1; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; outline: 0; font-size: 12px; }
.ask-form input:focus { border-color: #a5c3b4; }
.provider-consent { display: grid; gap: 7px; padding: 14px 16px; border-top: 1px solid var(--soft-line); background: #fbfcfa; color: var(--muted); font-size: 11px; line-height: 1.55; }
.provider-consent strong { color: var(--ink); font-size: 12px; }
.provider-consent .primary-button { justify-self: start; }
.context-list { display: grid; gap: 10px; }
.context-item { padding: 12px; border: 1px solid var(--soft-line); border-radius: 8px; background: #fafafa; }
.context-item strong { display: block; font-size: 11px; }
.context-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.capture-drawer { position: fixed; inset: 0; z-index: 10; display: none; }
.capture-drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(25, 37, 38, 0.26); }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(480px, 100%); height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 32px; background: var(--paper); box-shadow: -14px 0 50px rgba(0,0,0,0.14); animation: drawer-in .28s ease both; }
.drawer-header { display: flex; justify-content: space-between; gap: 14px; }
.drawer-hint { margin-top: 11px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.drawer-panel textarea { width: 100%; resize: vertical; margin-top: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; color: var(--ink); line-height: 1.6; }
.drawer-panel textarea:focus { border-color: #9fc0b0; }
.result-fields { display: grid; gap: 10px; margin-top: 14px; }
.result-fields[hidden] { display: none; }
.result-fields label { display: grid; gap: 5px; color: var(--subtle); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.result-fields input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: white; color: var(--ink); font-size: 12px; text-transform: none; letter-spacing: 0; }
.result-fields input:focus { border-color: #9fc0b0; }
.capture-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.capture-meta label { display: flex; align-items: center; gap: 7px; }
.capture-meta select { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; background: white; color: var(--ink); font-size: 11px; }
.capture-shortcut { color: var(--subtle); font-size: 10px; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 25px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; transform: translateY(12px); opacity: 0; pointer-events: none; padding: 11px 14px; border-radius: 8px; background: var(--ink); color: white; font-size: 12px; transition: .2s ease; box-shadow: var(--shadow); }
.toast.show { transform: translateY(0); opacity: 1; }
button:disabled { cursor: default; opacity: .64; transform: none !important; box-shadow: none !important; }

@keyframes content-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes drawer-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 980px) {
  .sidebar { width: 218px; flex-basis: 218px; }
  .topbar { padding: 0 25px; }
  .content { padding: 28px 25px 55px; }
  .dashboard-grid, .review-layout, .ask-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; padding: 15px 14px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-lockup { padding: 0 4px 13px; }
  .workspace-chip { margin: 0 0 11px; }
  .nav-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .nav-button { flex-direction: column; justify-content: center; gap: 3px; padding: 8px 3px; border-left: 0; border-bottom: 2px solid transparent; font-size: 11px; line-height: 1.2; }
  .nav-button.active { border-bottom-color: var(--green); border-left-color: transparent; }
  .nav-icon { width: auto; font-size: 13px; }
  .nav-count { display: none; }
  .sidebar-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 4px 0; }
  .sidebar-footer .text-button { min-height: 36px; padding: 8px 6px; }
  .sidebar-footer .system-status { grid-column: 1 / -1; }
  .topbar { height: auto; min-height: 64px; padding: 13px 16px; }
  .breadcrumbs { display: none; }
  .topbar-actions { width: 100%; min-width: 0; }
  .search-box { min-width: 0; flex: 1; }
  .search-results { top: 51px; right: 62px; width: min(390px, calc(100vw - 92px)); }
  .capture-button { padding: 9px 10px; white-space: nowrap; }
  .avatar { display: none; }
  .content { padding: 24px 16px 48px; }
  h1 { font-size: 30px; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 14px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-grid, .three-grid { grid-template-columns: 1fr; }
  .table-row { grid-template-columns: minmax(0, 1fr) auto; }
  .table-head { display: none; }
  .table-row .table-cell:nth-child(3), .table-row .table-cell:nth-child(4) { text-align: right; }
  .row-actions { flex-wrap: wrap; justify-content: flex-end; }
  .inbox-row { grid-template-columns: 8px minmax(0, 1fr); }
  .inbox-row .row-actions { grid-column: 2; width: 100%; justify-content: flex-start; align-items: center; }
  .inbox-row .row-actions .small-button, .inbox-row .row-actions .inbox-status { min-height: 34px; }
  .memory-row { flex-direction: column; }
  .memory-actions { justify-content: flex-start; }
  .memory-actions .small-button { min-height: 36px; padding: 8px 10px; }
  .project-controls { align-items: stretch; flex-direction: column; }
  .editor-row { grid-template-columns: 1fr; }
  .decision-field-grid { grid-template-columns: 1fr; }
  .approval-bar { flex-wrap: wrap; }
  .approval-note { flex: 1 1 100%; }
  .review-tabs { flex-wrap: wrap; }
  .inbox-text, .focus-title, .action-name, .object-title, .detail-value, .review-title, .result-title, .context-item span, .memory-source { overflow-wrap: anywhere; word-break: break-word; }
  .object-top > div, .object-footer > span { min-width: 0; }
  .drawer-panel { padding: 23px 18px; }
}
