* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); line-height: 1.6; }
.environment-banner { position: fixed; inset: 0 0 auto; padding: 5px 12px; color: #fff; background: #825014; font-size: 11px; font-weight: 700; letter-spacing: .11em; text-align: center; text-transform: uppercase; z-index: 100; }
.environment-banner + .app-shell .sidebar { top: 25px; }
.environment-banner + .app-shell .main-content { padding-top: 71px; }
.login-body:has(.environment-banner) { padding-top: 25px; }
button, input, textarea, select { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 32px 22px 24px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); z-index: 20; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand > span:last-child { display: grid; gap: 2px; }
.brand strong { font-size: 14px; font-family: var(--font-heading); font-weight: 400; letter-spacing: -.045em; }
.brand small { color: var(--muted); font-size: 12px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--accent-line); border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-family: var(--font-heading); font-size: 12px; font-weight: 500; }
.brand-mark.large { width: 54px; height: 54px; border-radius: 18px; font-size: 16px; }
.main-nav { display: grid; gap: 7px; margin-top: 46px; }
.nav-link { min-height: 46px; padding: 12px; border-radius: 10px; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; font-weight: 600; transition: background .18s, color .18s; }
.nav-link:hover { background: var(--accent-soft); color: var(--accent-hover); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }
.logout-form { margin: 0; }
.main-content { margin-left: var(--sidebar); min-height: 100vh; padding: 56px clamp(28px, 5vw, 76px) 80px; }
.main-content > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.main-content, .capture-grid > *, .admin-grid > * { min-width: 0; }
.mobile-header { display: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 8px 0 12px; font-family: var(--font-heading); font-weight: 400; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.22; letter-spacing: -.045em; overflow-wrap: anywhere; }
.page-header p:not(.eyebrow) { max-width: 660px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.hero-header { margin-bottom: 22px; }
.content-card, .quick-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.content-card { padding: clamp(20px, 3vw, 32px); }
.quick-card { padding: 22px 26px 20px; margin-bottom: 32px; border-color: var(--accent-line); }
.quick-form textarea { width: 100%; min-height: 120px; padding: 20px 0; resize: vertical; border: 0; background: transparent; color: var(--ink); font-size: 20px; line-height: 1.6; }
.quick-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0 0; border-top: 1px solid var(--line); }
.input-hint { color: var(--subtle); font-size: 12px; }

.button { min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; font-weight: 650; line-height: 1.4; text-align: center; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.button:hover { transform: none; }
.button-primary { color: var(--on-accent); background: var(--accent); }
.button-primary:hover { color: var(--on-accent); background: var(--accent-hover); }
.button-secondary { color: var(--ink); border-color: var(--control-border); background: var(--surface); }
.button-secondary:hover { background: var(--accent-soft); }
.button-ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
.button-small { min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.button-large { min-height: 52px; font-size: 16px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button-row, .recording-controls { display: flex; gap: 10px; flex-wrap: wrap; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.035em; }
.section-heading a { font-size: 14px; font-weight: 700; }
.note-card { min-height: 260px; }
.markdown-body { color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--ink); font-family: var(--font-body); font-weight: 700; letter-spacing: -.035em; }
.markdown-body h1 { font-size: 30px; }
.markdown-body h2 { margin-top: 1.7em; padding-bottom: .35em; border-bottom: 1px solid var(--line); font-size: 22px; }
.markdown-body pre { overflow: auto; padding: 18px; border-radius: 10px; color: var(--code-ink); background: var(--code-bg); }
.markdown-body code { padding: 2px 6px; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
.markdown-body pre code { padding: 0; color: inherit; background: transparent; }
.markdown-body blockquote { margin-left: 0; padding-left: 18px; border-left: 3px solid var(--accent); color: var(--muted); }
.note-image { max-width: 100%; max-height: 720px; border-radius: 16px; box-shadow: 0 10px 35px rgba(15,23,42,.12); }
.note-pdf { width: 100%; height: min(72vh, 840px); border: 1px solid var(--line); border-radius: 14px; }
.markdown-body audio { width: min(100%, 620px); }
.path-label { font-family: ui-monospace, monospace; font-size: 13px !important; }

.empty-state { min-height: 230px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 9px 0 3px; color: var(--ink); }
.empty-state p { margin: 0; }
.empty-state.compact { min-height: 110px; }
.empty-mark { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 25px; }

.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.capture-card { display: grid; align-content: start; gap: 18px; }
.capture-card.featured { border-color: var(--accent-line); background: var(--surface); }
.capture-card h2 { margin: 0 0 5px; font-size: 22px; }
.capture-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.capture-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; font-weight: 850; }
.capture-icon.blue { color: var(--accent-hover); background: var(--accent-line); }
.capture-icon.violet { color: var(--accent); background: var(--accent-soft); }
.capture-icon.cyan { color: var(--success); background: var(--success-soft); }
.capture-icon.ink { color: var(--surface); background: var(--ink); font-size: 11px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 750; }
.field span small { color: var(--subtle); font-weight: 500; }
.field input, .field textarea, .field select, .filter-bar input, .filter-bar select { width: 100%; padding: 12px 13px; border: 1px solid var(--control-border); border-radius: 9px; color: var(--ink); background: var(--surface); transition: border .15s, box-shadow .15s; }
.field input[type="file"] { padding: 7px; color: var(--muted); font-size: 13px; }
.field input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 11px; border: 0; border-radius: 8px; color: var(--accent-hover); background: var(--accent-soft); cursor: pointer; font-weight: 750; }
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.drop-field { min-height: 108px; padding: 18px; display: grid; place-items: center; border: 1.5px dashed var(--accent-line); border-radius: 16px; color: var(--accent-hover); background: var(--accent-soft); cursor: pointer; text-align: center; }
.drop-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-field span { display: grid; gap: 5px; }
.drop-field small { color: var(--muted); font-weight: 500; }
.recorder { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-alt); }
.recorder-state { margin-bottom: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.record-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--control-border); }
.recorder.recording .record-dot { background: var(--danger); animation: pulse 1.1s infinite; }
.recorder.recording [data-recorder-label] { color: var(--danger); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(239,68,68,.12); } }
.voice-wave { height: 46px; margin-bottom: 10px; padding: 7px 3px; display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; }
.voice-wave span { width: 4px; height: 30px; border-radius: 999px; background: var(--accent); transform: scaleY(.18); transition: transform 80ms linear; transform-origin: center; }
.recorder.recording .voice-wave span:nth-child(3n+1) { animation: fake-wave .72s ease-in-out infinite alternate; }
.recorder.recording .voice-wave span:nth-child(3n+2) { animation: fake-wave .94s .12s ease-in-out infinite alternate-reverse; }
.recorder.recording .voice-wave span:nth-child(3n) { animation: fake-wave .58s .2s ease-in-out infinite alternate; }
@keyframes fake-wave { from { transform: scaleY(.25); } to { transform: scaleY(.92); } }
.recording-preview { width: 100%; margin: 0 0 12px; }
.record-stop { width: 44px; min-height: 43px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--danger-line); border-radius: 13px; cursor: pointer; background: var(--danger-soft); }
.record-stop:hover { background: var(--danger-soft); }
.record-stop:disabled { opacity: .45; cursor: not-allowed; }
.record-stop > span:first-child { width: 12px; height: 12px; border-radius: 2px; background: var(--danger); }
.file-selection { min-height: 64px; padding: 10px 12px; display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px; border: 1px solid var(--accent-line); border-radius: 13px; background: var(--accent-soft); }
.file-selection[hidden] { display: none; }
.file-selection img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; }
.file-selection > span:not(.file-selection-icon) { min-width: 0; display: grid; gap: 3px; }
.file-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-selection small { color: var(--muted); }
.file-selection-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 9px; color: var(--accent-hover); background: var(--surface); font-size: 11px; font-weight: 850; }
.confirm-dialog { width: min(calc(100% - 32px), 460px); padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(15,23,42,.48); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 24px; }
.confirm-dialog h3 { margin: 0 0 8px; font-size: 21px; }
.confirm-dialog p { margin: 0 0 20px; color: var(--muted); line-height: 1.55; }
.toast-region { position: fixed; top: 24px; right: 24px; z-index: 100; width: min(390px, calc(100vw - 32px)); display: grid; gap: 10px; pointer-events: none; }
.toast-region > * { pointer-events: auto; }
.status-card { padding: 16px 18px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 45px rgba(15,23,42,.13); }
.capture-toast { animation: toast-in .18s ease-out both; }
.capture-toast.is-leaving { animation: toast-out .18s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) translateX(10px); } to { opacity: 1; transform: translateY(0) translateX(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) translateX(10px); } }
.status-indicator { width: 11px; height: 11px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--subtle); }
.status-pending .status-indicator, .status-running .status-indicator { background: var(--accent); animation: pulse 1.2s infinite; }
.status-succeeded .status-indicator { background: var(--success); }
.status-failed .status-indicator { background: var(--danger); }
.status-blocked .status-indicator { background: var(--warning); }
.status-copy { display: grid; gap: 3px; }
.status-copy span { color: var(--muted); font-size: 14px; }
.status-copy a { margin-top: 4px; font-size: 13px; font-weight: 750; }
.alert { padding: 14px 16px; display: grid; gap: 3px; border-radius: 13px; font-size: 14px; }
.alert-error { color: var(--danger); border: 1px solid var(--danger-line); background: var(--danger-soft); }

.segmented { padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.segmented a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-weight: 750; }
.segmented a.active { color: var(--accent-hover); background: var(--accent-soft); }
.tree-card { padding: 12px; }
.vault-tree, .tree-children { display: grid; }
.tree-folder { min-width: 0; }
.tree-folder summary, .tree-file { min-height: 46px; padding: 7px 12px; display: grid; grid-template-columns: 18px 26px minmax(0, 1fr) auto; align-items: center; gap: 7px; border-radius: 10px; color: var(--ink); cursor: pointer; list-style: none; }
.tree-folder summary::-webkit-details-marker { display: none; }
.tree-folder summary:hover, .tree-file:hover { color: var(--accent-hover); background: var(--accent-soft); }
.tree-folder summary { font-weight: 780; }
.tree-folder summary small, .tree-file small { color: var(--subtle); font-size: 11px; font-weight: 600; text-transform: uppercase; }
.tree-chevron { color: var(--subtle); font-size: 22px; line-height: 1; transition: transform .16s ease; }
.tree-folder[open] > summary .tree-chevron { transform: rotate(90deg); }
.tree-children { margin-left: 18px; padding-left: 8px; border-left: 1px solid var(--line); }
.tree-file { grid-template-columns: 18px minmax(0, 1fr) auto; }
.tree-file > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-icon { width: 24px; color: var(--accent); font-size: 12px; font-weight: 850; text-align: center; }

.quick-capture-shell { width: min(100%, 680px); margin: 0 auto; padding: 0 0 48px; }
.quick-intro { margin: 12px 0 32px; text-align: center; }
.quick-intro h1 { margin: 10px 0 16px; font-family: var(--font-heading); font-size: clamp(28px, 5vw, 42px); font-weight: 400; line-height: 1.3; letter-spacing: -.04em; }
.quick-intro > p:last-child { margin: 0; color: var(--muted); }
.quick-mode-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.quick-mode-buttons[hidden], .quick-panel[hidden] { display: none; }
.quick-mode { min-height: 190px; border: 1px solid var(--line); border-radius: 16px; display: grid; place-items: center; align-content: center; gap: 18px; cursor: pointer; background: var(--surface); color: var(--ink); transition: border-color .16s, background .16s; }
.quick-mode span { width: 60px; height: 60px; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 24px; font-weight: 600; }
.quick-mode.voice span { color: var(--accent); background: var(--accent-soft); }
.quick-mode strong { font-size: 19px; }
.quick-panel { padding: clamp(20px, 5vw, 30px); border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.quick-panel h2 { margin: 10px 0 22px; font-size: 27px; letter-spacing: -.035em; }
.quick-back { padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-weight: 700; }
.quick-minimal-form { display: grid; gap: 14px; }
.quick-minimal-form textarea { min-height: 190px; padding: 12px; border: 1px solid var(--control-border); border-radius: 9px; resize: vertical; color: var(--ink); background: var(--surface); font-size: 18px; line-height: 1.6; }
.quick-result { margin-top: 14px; }

.danger-card { margin-bottom: 18px; border-color: var(--danger-line); }
.compact-callout { margin-bottom: 18px; }
.dirty-paths { max-height: 300px; margin: 0; padding: 0; overflow: auto; list-style: none; }
.dirty-paths li { padding: 10px 2px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.dirty-paths li:last-child { border: 0; }
.dirty-paths span { color: var(--muted); white-space: nowrap; }
.diff-view { max-height: 520px; margin: 0; padding: 18px; overflow: auto; border-radius: 14px; color: var(--accent-soft); background: var(--code-bg); font-size: 12px; line-height: 1.55; }
.resolution-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.resolution-card { display: grid; align-content: start; gap: 12px; }
.resolution-card.recommended { border-color: var(--accent-line); background: var(--surface); }
.resolution-card h2, .resolution-card p { margin: 0; }
.resolution-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.resolution-card form { margin-top: auto; padding-top: 14px; }
.warning-text { color: var(--warning); }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 145px; padding: 20px; display: flex; flex-direction: column; color: var(--ink); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.metric-card:hover { color: var(--ink); border-color: var(--accent-line); background: var(--surface-alt); }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { margin: auto 0 2px; font-size: 35px; letter-spacing: -.04em; }
.metric-card strong.metric-code { font-size: 17px; }
.metric-code { overflow-wrap: anywhere; }
.metric-danger { color: var(--danger); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); gap: 18px; }
.action-row { padding: 15px 2px; display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); border-bottom: 1px solid var(--line); }
.action-row:last-child { border-bottom: 0; }
.action-row span { display: grid; gap: 4px; }
.action-row small { color: var(--muted); }
.action-row b { color: var(--accent); }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { padding: 9px 11px; color: var(--subtle); font-size: 11px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 11px; border-top: 1px solid var(--line); }
.data-table td:first-child { display: grid; gap: 2px; }
.data-table td small { color: var(--subtle); font-size: 11px; }
.badge { width: fit-content; padding: 5px 8px; border-radius: 999px; color: var(--muted); background: var(--surface-alt); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.badge.large { padding: 8px 13px; font-size: 12px; }
.badge-succeeded, .badge-ok { color: var(--success); background: var(--success-soft); }
.badge-failed, .badge-error { color: var(--danger); background: var(--danger-soft); }
.badge-blocked, .badge-conflict { color: var(--warning); background: var(--warning-soft); }
.badge-pending, .badge-running { color: var(--accent-hover); background: var(--accent-soft); }
.filter-bar { margin-bottom: 20px; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-bar label { flex: 1 1 180px; min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.detail-card { display: grid; gap: 24px; }
.detail-list { margin: 0; display: grid; }
.detail-list > div { padding: 13px 0; display: grid; grid-template-columns: minmax(120px, .35fr) 1fr; gap: 18px; border-bottom: 1px solid var(--line); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-list code { color: var(--accent); }
.callout { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--accent-line); border-radius: 16px; background: var(--accent-soft); }
.callout p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.manual-retry-callout { border-color: var(--danger-line); background: var(--danger-soft); }
.status-poll { padding: 12px; color: var(--muted); text-align: center; }
.spinner { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; border: 2px solid var(--accent-line); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.content-card + .timeline-card { margin-top: 20px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; min-height: 72px; padding: 2px 140px 20px 28px; border-left: 1px solid var(--line); }
.timeline li:last-child { border-left-color: transparent; }
.timeline-dot { position: absolute; left: -6px; top: 2px; width: 11px; height: 11px; border: 3px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.event-warning .timeline-dot { background: var(--warning); box-shadow: 0 0 0 1px var(--warning); }
.event-error .timeline-dot { background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.timeline p { margin: 4px 0; color: var(--muted); font-size: 13px; }
.timeline small { color: var(--subtle); }
.timeline time { position: absolute; top: 0; right: 0; color: var(--subtle); font-size: 12px; }
.sync-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; }
.sync-state strong { color: var(--accent-hover); font-size: 25px; }.sync-state span { color: var(--muted); }.sync-state code { color: var(--muted); }
.api-list { display: grid; }
.api-row { min-height: 66px; display: grid; grid-template-columns: 60px minmax(240px,.8fr) 1fr auto; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.method { padding: 5px 7px; border-radius: 7px; color: var(--accent-hover); background: var(--accent-soft); font: 800 11px ui-monospace, monospace; text-align: center; }
.method-post { color: var(--accent); background: var(--accent-soft); }
.api-row p { color: var(--muted); }
.api-note { margin-top: 22px; }

.toggle-row { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 13px; font-weight: 700; }
.toggle-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.file-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.markdown-editor-card form { display: grid; gap: 12px; }
.markdown-editor-card label { color: var(--ink); font-size: 13px; font-weight: 750; }
.markdown-editor-card textarea { width: 100%; min-height: 62vh; padding: 16px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface-alt); font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; tab-size: 2; }
.markdown-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.markdown-editor-actions small { color: var(--muted); }

.login-body { min-height: 100dvh; display: grid; place-items: center; padding: 92px 24px 48px; background: var(--canvas); }
.login-card { width: min(100%, 500px); padding: clamp(28px, 6vw, 48px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.login-brand { margin-bottom: 42px; }
.login-copy { margin-bottom: 26px; }
.login-copy h1 { margin: 12px 0 20px; font-family: var(--font-heading); font-weight: 400; font-size: 31px; line-height: 1.35; letter-spacing: -.045em; }
.login-copy p:not(.eyebrow), .login-note { color: var(--muted); line-height: 1.6; }
.login-note { margin: 22px 0 0; font-size: 12px; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { padding-bottom: env(safe-area-inset-bottom); background: var(--canvas); }
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 0 16px 36px; }
  .environment-banner + .app-shell .main-content { padding-top: 25px; }
  .mobile-header { position: sticky; top: 0; max-width: none; margin: 0 -16px 24px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; justify-content: space-between; background: var(--surface); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); z-index: 30; }
  .brand.compact { gap: 8px; font-size: 14px; }.brand.compact .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 10px; }
  .page-header { align-items: flex-start; margin-bottom: 20px; }
  .page-header h1 { font-size: 28px; }.page-header p:not(.eyebrow) { font-size: 14px; }
  .desktop-only { display: none; }
  .content-card { padding: 20px; border-radius: 18px; }
  .quick-card { padding: 18px; border-radius: 16px; }
  .input-hint { display: none; }.quick-actions { justify-content: flex-end; }
  .capture-grid { grid-template-columns: 1fr; }
  .capture-card { gap: 15px; }
  .toast-region { top: calc(12px + env(safe-area-inset-top)); right: 16px; }
  .segmented { align-self: flex-start; }
  .file-heading { display: grid; }
  .markdown-editor-actions { align-items: stretch; flex-direction: column; }
  .tree-folder summary, .tree-file { padding-left: 8px; }.tree-folder summary small, .tree-file small { display: none; }.tree-children { margin-left: 10px; padding-left: 3px; }
  .quick-capture-shell { padding-top: 0; }
  .quick-intro { margin-top: 12px; }
  .quick-mode { min-height: 155px; }
  .resolution-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .metric-card { min-height: 125px; padding: 15px; }.metric-card strong { font-size: 30px; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }.filter-bar label { min-width: 0; }.filter-bar button { grid-column: 1 / -1; }
  .data-table th:nth-child(2), .data-table td:nth-child(2), .data-table th:nth-child(4), .data-table td:nth-child(4) { display: none; }
  .detail-list > div { grid-template-columns: 1fr; gap: 5px; }
  .callout { align-items: stretch; flex-direction: column; }
  .timeline li { padding-right: 0; padding-bottom: 32px; }.timeline time { position: static; display: block; margin-top: 5px; }
  .api-row { padding: 14px 0; grid-template-columns: 60px 1fr; }.api-row p { grid-column: 1/-1; margin: 0; }.api-row .button { grid-column: 1/-1; }
  .login-card { border-radius: 16px; }.login-copy h1 { font-size: 26px; }
}


/* Shared navigation and theme controls, including standalone screens. */
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--accent-line); }
::placeholder { color: var(--subtle); opacity: 1; }
input, textarea, select { accent-color: var(--accent); }
textarea:focus-visible, .drop-field:focus-within { outline: 2px solid var(--accent); outline-offset: 4px; }
button:disabled { cursor: not-allowed; }
.skip-link { position: fixed; left: 16px; top: -100px; padding: 12px 20px; z-index: 200; color: var(--on-accent); background: var(--accent); border-radius: 9px; }
.skip-link:focus { top: 16px; }
.nav-index { color: var(--subtle); font: 11px ui-monospace, monospace; }
.nav-link.active .nav-index { color: var(--accent); }
.sidebar-footer { margin-top: auto; padding-top: 32px; display: grid; gap: 16px; }
.sidebar-footer .logout-form .button { width: 100%; }
.theme-control { display: flex; padding: 3px; gap: 3px; width: fit-content; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-alt); }
.theme-control button { min-height: 38px; min-width: 40px; flex: 1; padding: 8px 10px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.theme-control button[aria-pressed="true"] { color: var(--accent); background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.theme-control button:hover { color: var(--ink); }
.theme-control button > span:first-child { font-size: 17px; line-height: 1; }
.sidebar-footer .theme-control { width: 100%; }
.login-theme { position: absolute; top: 24px; right: 24px; }
.login-body:has(.environment-banner) .login-theme { top: 44px; }
.login-body:has(.environment-banner) { padding-top: 110px; }
.composer-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.composer-heading .eyebrow { margin: 0; }
.composer-heading a { font-size: 12px; font-weight: 650; }
.quick-mode:hover { border-color: var(--accent); background: var(--accent-soft); }
.quick-other { margin: 28px 0 0; text-align: center; font-size: 13px; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body a { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 3px; }
.markdown-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.markdown-body th, .markdown-body td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.markdown-body th { background: var(--surface-alt); }
.page-header > div, .section-heading > div, .status-copy { min-width: 0; }
.path-label, .api-row code { overflow-wrap: anywhere; }
.capture-grid .attachment-card { grid-column: 1 / -1; }
.status-card { color: var(--ink); }
@media (max-width: 760px) {
  .mobile-header .theme-label, .quick-capture-header .theme-label { display: none; }
  .mobile-header .theme-control button, .quick-capture-header .theme-control button { min-height: 38px; }
  .page-header { flex-wrap: wrap; gap: 16px; }
  .page-header > div { flex: 1 1 100%; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; }
  .quick-form textarea { min-height: 132px; font-size: 18px; }
  .brand.compact strong { font-size: 12px; }
  .brand.compact .brand-mark { font-size: 11px; border-radius: 8px; }
  .login-body { padding: 100px 16px 32px; }
  .login-theme { right: 16px; top: 20px; }
  .theme-control { flex-shrink: 0; }
  .composer-heading { gap: 8px; }
  .dirty-paths li { flex-wrap: wrap; gap: 4px; }
}

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

/* One navigation list on desktop and in the mobile drawer. */
.menu-toggle { width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); font-size: 22px; cursor: pointer; }
.mobile-menu { position: fixed; inset: 0 auto 0 0; margin: 0; padding: 0; width: min(340px, calc(100vw - 32px)); height: 100dvh; max-height: none; border: 0; border-right: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.mobile-menu::backdrop { background: rgba(0,0,0,.45); }
.mobile-menu-content { display: flex; flex-direction: column; min-height: 100%; padding: max(20px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.mobile-menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-menu-heading strong { font-family: var(--font-heading); font-size: 14px; font-weight: 400; }
html:has(.mobile-menu[open]) { overflow: hidden; }
@media (max-width: 760px) {
  .mobile-header { gap: 10px; }
  .mobile-header .brand { margin-right: auto; }
  .mobile-header .brand-mark { display: none; }
}
