:root {
  color-scheme: dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #eeeeee;
  --muted: #a0a0a0;
  --line: #303030;
  --surface: #111111;
  --canvas: #080808;
  --accent: #f0f0f0;
  --accent-hover: #ffffff;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body, #root { margin: 0; min-height: 100%; }
body { color: var(--ink); background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { color: #0b100d; background: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: #344638 transparent; }

.app-shell { display: flex; height: 100dvh; min-height: 0; overflow: hidden; }
.sidebar { width: 256px; flex: 0 0 256px; display: flex; flex-direction: column; padding: 24px 16px 18px; background: #0e1510; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px 27px; }
.portrait { display: block; overflow: hidden; flex-shrink: 0; background: #1c2a20; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.portrait-fallback { display: grid; place-items: center; width: 100%; height: 100%; font: 700 24px var(--mono); color: var(--accent); }
.brand-mark { width: 41px; height: 44px; border: 1px solid #4a6845; border-radius: 5px; }
.brand strong { display: block; font: 700 21px var(--mono); letter-spacing: -.04em; color: #f0f6ec; }
.brand > div > span { display: block; color: #7c977e; font: 10px var(--mono); margin-top: 4px; }
.brand strong .brand-cursor { display: inline; color: var(--accent); }
.mobile-close { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 5px; padding: 10px 14px; min-height: 39px; font: 600 12px var(--mono); line-height: 1.2; white-space: nowrap; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--accent); color: #13200e; border: 1px solid var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-outline { background: #111a13; color: #c0d1bd; border: 1px solid #354a37; }
.button-outline:hover:not(:disabled) { background: #1c2a1d; border-color: #718e61; }
.button-sidebar { background: #17281a; border: 1px solid #486a3c; color: var(--accent); }
.button-sidebar:hover:not(:disabled) { background: #233b24; }
.new-session { width: 100%; justify-content: flex-start; padding-left: 15px; }
.nav-label, .sidebar-eyebrow { font: 10px var(--mono); letter-spacing: .05em; color: #718873; }
.nav-label { padding: 26px 10px 11px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 5px; color: #8fa591; background: transparent; font-size: 13px; text-align: left; }
.nav-item:hover { background: #17221a; color: #dae8d6; }
.nav-item.active { background: #1a2c1d; border-color: #304c32; color: var(--accent); }
.nav-indicator { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; margin-left: auto; }
.sidebar-bottom { margin-top: auto; }
.session-card { display: grid; gap: 8px; padding: 14px 12px; border-radius: 4px; border: 1px solid #2c3c2e; background: #0b120d; }
.session-card strong { overflow: hidden; text-overflow: ellipsis; font: 12px var(--mono); color: #b6c8af; }
.session-caption { color: #708673; font-size: 11px; }
.sidebar-reset { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; margin-top: 7px; color: #90a08c; border: 0; background: transparent; border-radius: 4px; text-align: left; font-size: 11px; }
.sidebar-reset:hover:not(:disabled) { color: var(--accent); background: #19271b; }
.sidebar-scrim { display: none; }

.workspace { display: flex; flex: 1; flex-direction: column; min-width: 0; background: var(--surface); }
.topbar { display: flex; align-items: center; gap: 16px; height: 74px; min-height: 74px; padding: 0 36px; border-bottom: 1px solid var(--line); background: #0e1510; }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font: 600 14px var(--mono); line-height: 1.15; margin: 0; color: #dce9d5; }
.topbar h1::before { content: '~/ '; color: #6d9e5b; }
.topbar p { margin: 5px 0 0; color: #718674; font-size: 11px; }
.model-status { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #344b32; border-radius: 4px; padding: 7px 10px; font: 10px var(--mono); white-space: nowrap; }
.model-ready { color: var(--accent); background: #152217; }
.model-pending { color: #dfbf74; background: #241e11; border-color: #5a4b29; }
.status-dot, .success-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.model-ready .status-dot { box-shadow: 0 0 8px #a2df6550; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #344b32; border-radius: 4px; color: #9bb195; background: #111a13; font: 10px var(--mono); }
.theme-toggle:hover { color: var(--accent); border-color: #58734e; background: #18231a; }
.mobile-menu { display: none; }

.chat-pane { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.readiness-banner { flex: none; padding: 10px 26px; color: #c4aa77; background: #201c12; border-bottom: 1px solid #403821; font-size: 12px; text-align: center; }
.chat-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; background-image: linear-gradient(#b5eb7803 1px, transparent 1px), linear-gradient(90deg, #b5eb7803 1px, transparent 1px); background-size: 36px 36px; }
.welcome { width: min(100%, 690px); margin: min(8vh, 76px) auto 50px; padding: 0 28px; }
.welcome-identity { display: flex; align-items: center; gap: 25px; margin-bottom: 32px; }
.welcome-portrait { width: 95px; height: 120px; border: 1px solid #739c58; border-radius: 4px; box-shadow: 6px 6px 0 #19271a; }
.welcome-terminal { display: grid; gap: 10px; min-width: 0; }
.terminal-label { color: #75976a; font: 11px var(--mono); }
.terminal-command { display: flex; align-items: center; color: var(--accent); font: 13px var(--mono); }
.terminal-caption { color: #5e7662; font: 10px var(--mono); }
.terminal-cursor { display: inline-block; width: 7px; height: 14px; margin-left: 7px; background: var(--accent); animation: cursor 1.2s step-end infinite; }
@keyframes cursor { 50% { opacity: 0; } }
.welcome h2 { margin: 0 0 13px; color: #e8f1e4; font-size: clamp(28px, 4vw, 37px); font-weight: 650; line-height: 1.15; letter-spacing: -.035em; }
.welcome > p { max-width: 505px; margin: 0; color: #8e9f8d; font-size: 14px; line-height: 1.7; }
.welcome-actions { margin-top: 22px; }
.prompt-label { margin-top: 34px; color: #607e61; font: 10px var(--mono); }
.prompt-list { display: grid; gap: 8px; margin-top: 13px; }
.prompt-list button { display: flex; justify-content: space-between; align-items: center; gap: 14px; width: 100%; padding: 13px 15px; color: #a6bca0; border: 1px solid #293b2c; background: #101912; border-radius: 4px; text-align: left; font-size: 12px; }
.prompt-list button:hover { border-color: #587f48; color: #d1ebbe; background: #18251a; }
.prompt-list svg { color: #668d56; flex: none; }
.message-list { width: min(100%, 880px); margin: 0 auto; padding: 30px 24px 38px; }
.message { display: flex; gap: 15px; padding: 22px 4px; border-bottom: 1px solid #202e23; }
.message:last-child { border-bottom: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 38px; flex: 0 0 34px; border-radius: 4px; font: 700 14px var(--mono); }
.avatar-user { color: var(--accent); background: #1c2e1e; border: 1px solid #3c5734; }
.avatar-assistant { border: 1px solid #58764a; }
.avatar-error { color: #e59c8a; background: #2c1b17; }
.message-body { flex: 1; min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 10px; color: #b1c3a8; font: 600 11px var(--mono); }
.message-meta span { color: #536f57; font-size: 10px; font-weight: 400; }
.message-body p { max-width: 75ch; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #d5dfd0; line-height: 1.75; font-size: 14px; }
.message-user .message-body p { display: inline-block; padding: 10px 14px; border-radius: 4px; border: 1px solid #2a3d2d; background: #142018; }
.message-error .message-body p { color: #e59c8a; }
.thinking { display: flex; align-items: center; gap: 12px; color: #7f9c73; font: 11px var(--mono); }
.typing-dots { display: flex; align-items: center; gap: 4px; height: 16px; }
.typing-dots i { display: block; width: 4px; height: 4px; background: var(--accent); animation: pulse 1s infinite alternate; }
.typing-dots i:nth-child(2) { animation-delay: .2s; }
.typing-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }
.composer-wrap { flex: none; padding: 17px 24px 18px; border-top: 1px solid #233327; background: #0c140f; }
.composer, .composer-hint { width: min(100%, 850px); margin: auto; }
.composer { display: flex; align-items: flex-end; gap: 11px; padding: 10px 10px 10px 16px; background: #101b13; border: 1px solid #49673e; border-radius: 5px; }
.composer::before { content: '>'; align-self: center; color: var(--accent); font: 15px var(--mono); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #b5eb780b; }
.composer textarea { flex: 1; min-width: 0; min-height: 26px; max-height: 180px; border: 0; outline: 0; resize: none; padding: 4px 0; color: #deebd7; background: transparent; line-height: 1.5; font-size: 14px; }
.composer textarea:focus-visible { outline: 0; }
.composer textarea::placeholder { color: #638168; }
.send-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 4px; color: #14200f; border: 0; background: var(--accent); }
.send-button:hover:not(:disabled) { background: var(--accent-hover); }
.composer-hint { display: flex; justify-content: space-between; gap: 15px; padding: 9px 3px 0; color: #58725a; font: 9px var(--mono); }

.page-content { flex: 1; overflow-y: auto; padding: 36px 40px 50px; background: var(--canvas); }
.page-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 28px; }
.eyebrow { color: #78a862; font: 10px var(--mono); letter-spacing: .08em; }
.eyebrow::before { content: '// '; color: #476d3c; }
.page-intro h2 { margin: 9px 0 9px; color: #e3eddd; font-size: 27px; line-height: 1.15; letter-spacing: -.025em; }
.page-intro p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.page-actions { display: flex; gap: 8px; }
.log-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.search-form { display: flex; align-items: center; gap: 9px; flex: 1; max-width: 610px; padding: 5px 5px 5px 13px; border: 1px solid #3c5736; background: #101912; border-radius: 4px; color: #7c9e6c; }
.search-form:focus-within { border-color: var(--accent); }
.search-form input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: 12px var(--mono); }
.search-form input:focus-visible { outline: 0; }
.search-form input::placeholder { color: #5e7660; }
.search-form button { border: 1px solid #3b5733; border-radius: 3px; padding: 8px 13px; background: #21371e; color: var(--accent); font: 11px var(--mono); }
.search-form button:hover { background: #304e29; }
.log-count, .search-summary { color: #6e896e; font: 10px var(--mono); }
.search-summary { margin: -2px 0 14px; }
.inline-error { padding: 12px 14px; margin-bottom: 15px; color: #e6ab96; background: #251913; border: 1px solid #5c382c; border-radius: 4px; font-size: 12px; }
.log-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 17px; align-items: start; }
.log-results, .log-detail { background: #0d150f; border: 1px solid #2a3e2c; border-radius: 4px; overflow: hidden; }
.log-list { max-height: min(60vh, 620px); overflow-y: auto; }
.log-row { display: flex; align-items: baseline; gap: 13px; width: 100%; min-height: 39px; padding: 10px 13px; border: 0; border-bottom: 1px solid #1b2a1e; background: #0d150f; text-align: left; }
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: #152319; }
.log-row.selected { background: #21351d; box-shadow: inset 2px 0 var(--accent); }
.log-line-number { width: 38px; flex: 0 0 38px; color: #526c51; font: 10px var(--mono); text-align: right; }
.log-row-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #a6c297; font: 11px var(--mono); }
.log-time { color: #638c65; }
.empty-result { display: grid; place-items: center; min-height: 250px; padding: 20px; text-align: center; color: var(--muted); font: 12px var(--mono); }
.log-detail { padding: 18px; }
.detail-heading { display: flex; justify-content: space-between; gap: 10px; color: #729568; font: 10px var(--mono); }
.detail-placeholder { margin: 25px 0 6px; color: var(--muted); line-height: 1.65; font-size: 12px; }
.field-list { margin: 17px 0 10px; }
.field-list div { padding: 9px 0; border-top: 1px solid #253628; }
.field-list dt { color: #5f7f60; font: 9px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.field-list dd { margin: 6px 0 0; color: #bad5aa; overflow-wrap: anywhere; font: 12px var(--mono); }
.detail-action { width: 100%; margin-top: 10px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 19px; color: #789473; font: 10px var(--mono); }
.pagination > div { display: flex; align-items: center; gap: 9px; }
.pagination .button { min-height: 34px; padding: 7px 11px; font-size: 10px; }
.page-number { min-width: 56px; text-align: center; }

.snapshot-card, .info-note { width: min(100%, 750px); border: 1px solid #2e4330; border-radius: 5px; background: #0f1912; }
.snapshot-card { padding: 26px; }
.snapshot-card-header { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.snapshot-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #3b5b30; border-radius: 4px; color: var(--accent); background: #1a2a17; }
.snapshot-card-header > div:nth-child(2) { flex: 1; }
.snapshot-card-header strong { color: #cee1c4; font: 600 13px var(--mono); }
.snapshot-card-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.snapshot-badge { border: 1px solid #354736; border-radius: 3px; padding: 6px 9px; color: #82947f; background: #172219; font: 10px var(--mono); white-space: nowrap; }
.snapshot-badge.open { color: var(--accent); border-color: #4a7039; background: #1d3019; }
.snapshot-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.snapshot-form label { display: grid; gap: 9px; color: #9cb495; font: 11px var(--mono); }
.snapshot-form input { width: 100%; min-width: 0; border: 1px solid #3b5438; border-radius: 4px; padding: 12px; color: #d9e8d2; background: #09110c; outline: 0; font: 12px var(--mono); }
.snapshot-form input::placeholder { color: #526e55; }
.snapshot-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #b5eb780a; }
.snapshot-submit { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
.snapshot-success { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 15px; color: var(--accent); background: #192a17; border: 1px solid #3c6030; border-radius: 4px; }
.snapshot-success .success-dot { width: 7px; height: 7px; }
.snapshot-success > div { flex: 1; }
.snapshot-success strong { font-size: 12px; }
.snapshot-success p { margin: 5px 0 0; color: #87a57a; font-size: 11px; }
.snapshot-success .button { background: transparent; border-color: #4d713c; color: var(--accent); }
.info-note { margin-top: 18px; padding: 18px 21px; background: #0c140f; }
.info-note strong { color: #9cb791; font: 11px var(--mono); }
.info-note p { margin: 7px 0 0; color: var(--muted); line-height: 1.65; font-size: 12px; }
.toast { position: fixed; z-index: 20; bottom: 23px; right: 24px; display: flex; align-items: center; gap: 20px; max-width: min(420px, calc(100vw - 32px)); padding: 13px 15px; border: 1px solid #5c8046; border-radius: 4px; box-shadow: 0 12px 40px #0006; color: #c7e7b4; background: #1b2b18; font-size: 12px; line-height: 1.5; }
.toast-error { color: #edb9a7; background: #301d16; border-color: #80533c; }
.toast button { display: grid; place-items: center; flex: none; border: 0; color: inherit; background: transparent; }

html[data-theme="light"] {
  color-scheme: light;
  --ink: #171717;
  --muted: #666666;
  --line: #dddddd;
  --surface: #fafafa;
  --canvas: #f2f2f2;
  --accent: #202020;
  --accent-hover: #000000;
}
html[data-theme="light"] ::selection { color: #fff; background: var(--accent); }
html[data-theme="light"] * { scrollbar-color: #aebca9 transparent; }
html[data-theme="light"] .sidebar,
html[data-theme="light"] .topbar { background: #fbfcfa; }
html[data-theme="light"] .portrait { background: #dce7d9; }
html[data-theme="light"] .brand-mark { border-color: #a8bca1; }
html[data-theme="light"] .brand strong,
html[data-theme="light"] .topbar h1,
html[data-theme="light"] .welcome h2,
html[data-theme="light"] .page-intro h2 { color: #172019; }
html[data-theme="light"] .brand > div > span,
html[data-theme="light"] .nav-label,
html[data-theme="light"] .sidebar-eyebrow,
html[data-theme="light"] .topbar p,
html[data-theme="light"] .terminal-label,
html[data-theme="light"] .terminal-caption,
html[data-theme="light"] .prompt-label,
html[data-theme="light"] .composer-hint,
html[data-theme="light"] .log-count,
html[data-theme="light"] .search-summary,
html[data-theme="light"] .pagination { color: #627264; }
html[data-theme="light"] .button-primary,
html[data-theme="light"] .send-button { color: #fff; }
html[data-theme="light"] .button-outline,
html[data-theme="light"] .theme-toggle { color: #34443a; background: #fff; border-color: #b9c6b7; }
html[data-theme="light"] .button-outline:hover:not(:disabled),
html[data-theme="light"] .theme-toggle:hover { color: #285f20; background: #edf4ea; border-color: #71956a; }
html[data-theme="light"] .button-sidebar { color: #285f20; background: #eaf3e7; border-color: #91ad89; }
html[data-theme="light"] .button-sidebar:hover:not(:disabled) { background: #dcebd8; }
html[data-theme="light"] .nav-item { color: #59695d; }
html[data-theme="light"] .nav-item:hover { color: #213226; background: #edf3eb; }
html[data-theme="light"] .nav-item.active { color: #285f20; background: #e2efdf; border-color: #b9cfb3; }
html[data-theme="light"] .session-card { background: #f3f6f1; border-color: #d0d9ce; }
html[data-theme="light"] .session-card strong { color: #334238; }
html[data-theme="light"] .session-caption { color: #68776b; }
html[data-theme="light"] .sidebar-reset { color: #59685d; }
html[data-theme="light"] .sidebar-reset:hover:not(:disabled) { color: #285f20; background: #e9f1e7; }
html[data-theme="light"] .model-status { border-color: #c1ccc0; }
html[data-theme="light"] .model-ready { color: #2f7023; background: #e8f3e4; }
html[data-theme="light"] .model-pending { color: #755714; background: #fff5d8; border-color: #ddc57f; }
html[data-theme="light"] .readiness-banner { color: #6d5317; background: #fff7df; border-color: #e4d49f; }
html[data-theme="light"] .chat-scroll { background-image: linear-gradient(#387b290a 1px, transparent 1px), linear-gradient(90deg, #387b290a 1px, transparent 1px); }
html[data-theme="light"] .welcome-portrait { border-color: #73996b; box-shadow: 6px 6px 0 #dfe9dc; }
html[data-theme="light"] .welcome > p { color: #59675c; }
html[data-theme="light"] .prompt-list button { color: #3d4c41; border-color: #cbd6c9; background: #fff; }
html[data-theme="light"] .prompt-list button:hover { color: #285f20; border-color: #7b9e73; background: #edf4ea; }
html[data-theme="light"] .prompt-list svg { color: #477c3b; }
html[data-theme="light"] .message { border-color: #dce3da; }
html[data-theme="light"] .avatar-user { color: #285f20; background: #e6f0e3; border-color: #a9c2a3; }
html[data-theme="light"] .avatar-assistant { border-color: #8eaa87; }
html[data-theme="light"] .avatar-error { color: #9b402c; background: #f8e6e0; }
html[data-theme="light"] .message-meta { color: #36463b; }
html[data-theme="light"] .message-meta span { color: #748178; }
html[data-theme="light"] .message-body p { color: #253229; }
html[data-theme="light"] .message-user .message-body p { background: #f7f9f6; border-color: #d5ddd3; }
html[data-theme="light"] .message-error .message-body p { color: #9b402c; }
html[data-theme="light"] .thinking { color: #587151; }
html[data-theme="light"] .composer-wrap { background: #fbfcfa; border-color: #d3ddd1; }
html[data-theme="light"] .composer { background: #fff; border-color: #9eb497; }
html[data-theme="light"] .composer:focus-within { box-shadow: 0 0 0 2px #387b2918; }
html[data-theme="light"] .composer textarea { color: #172019; }
html[data-theme="light"] .composer textarea::placeholder { color: #7a887d; }
html[data-theme="light"] .search-form { color: #53734c; background: #fff; border-color: #afc1aa; }
html[data-theme="light"] .search-form input::placeholder { color: #7b887e; }
html[data-theme="light"] .search-form button { color: #285f20; background: #e4f0e1; border-color: #a5bc9f; }
html[data-theme="light"] .search-form button:hover { background: #d6e8d2; }
html[data-theme="light"] .inline-error { color: #923e2b; background: #fcebe5; border-color: #e3aa9b; }
html[data-theme="light"] .log-results,
html[data-theme="light"] .log-detail { background: #fff; border-color: #cfd8cd; }
html[data-theme="light"] .log-row { background: #fff; border-color: #e4e9e2; }
html[data-theme="light"] .log-row:hover { background: #f0f5ee; }
html[data-theme="light"] .log-row.selected { background: #e2efdf; }
html[data-theme="light"] .log-line-number { color: #7b897d; }
html[data-theme="light"] .log-row-text { color: #344b37; }
html[data-theme="light"] .log-time { color: #39702e; }
html[data-theme="light"] .detail-heading,
html[data-theme="light"] .field-list dt { color: #567151; }
html[data-theme="light"] .field-list div { border-color: #dce4da; }
html[data-theme="light"] .field-list dd { color: #243729; }
html[data-theme="light"] .snapshot-card,
html[data-theme="light"] .info-note { background: #fff; border-color: #cbd6c9; }
html[data-theme="light"] .snapshot-icon { background: #e6f0e3; border-color: #a7bfa1; }
html[data-theme="light"] .snapshot-card-header strong,
html[data-theme="light"] .info-note strong { color: #304437; }
html[data-theme="light"] .snapshot-badge { color: #647167; background: #f2f5f1; border-color: #cbd4ca; }
html[data-theme="light"] .snapshot-badge.open { color: #2d6c22; background: #e5f1e2; border-color: #9ab592; }
html[data-theme="light"] .snapshot-form label { color: #475a4c; }
html[data-theme="light"] .snapshot-form input { color: #172019; background: #fbfcfa; border-color: #aebfaa; }
html[data-theme="light"] .snapshot-form input::placeholder { color: #7b897e; }
html[data-theme="light"] .snapshot-success { color: #2d6c22; background: #e7f3e4; border-color: #a3bd9c; }
html[data-theme="light"] .snapshot-success p { color: #55704f; }
html[data-theme="light"] .toast { color: #244c1d; background: #e4f1e1; border-color: #8dab85; box-shadow: 0 12px 40px #24301f24; }
html[data-theme="light"] .toast-error { color: #843a29; background: #f9e8e2; border-color: #d9a08f; }
html[data-theme="light"] .mobile-menu,
html[data-theme="light"] .mobile-close { color: #425448; }
html[data-theme="light"] .mobile-menu:hover { background: #e6eee3; }

/* Monochrome treatment for both saved themes. */
.app-shell { filter: grayscale(1); }

@media (max-height: 780px) and (min-width: 801px) { .sidebar { padding-top: 19px; } .brand { padding-bottom: 21px; } }
@media (max-width: 1100px) { .log-layout { grid-template-columns: minmax(0, 1fr) 250px; } .page-content { padding: 32px 26px 45px; } }
@media (max-width: 800px) {
  .sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 15px 0 40px #0006; overflow-y: auto; }
  .sidebar-open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; z-index: 29; inset: 0; border: 0; background: #020704a8; }
  .mobile-close { display: grid; place-items: center; margin-left: auto; border: 0; color: #9bb88d; background: transparent; }
  .mobile-menu { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border: 0; border-radius: 4px; color: #9dbb8e; background: transparent; }
  .mobile-menu:hover { background: #20331e; }
  .topbar { padding: 0 20px; }
  .log-layout { grid-template-columns: 1fr; }
  .log-detail { order: -1; }
}
@media (max-width: 600px) {
  .topbar { height: 65px; min-height: 65px; padding: 0 14px; }
  .topbar p { display: none; }
  .model-status { font-size: 9px; padding: 6px 7px; }
  .theme-toggle { width: 32px; height: 32px; justify-content: center; padding: 0; }
  .theme-toggle span { display: none; }
  .welcome { margin-top: 6vh; padding: 0 23px; }
  .welcome-identity { gap: 18px; margin-bottom: 27px; }
  .welcome-portrait { width: 73px; height: 96px; }
  .terminal-label { font-size: 9px; }
  .terminal-command { font-size: 10px; }
  .terminal-caption { font-size: 9px; }
  .terminal-cursor { height: 11px; width: 5px; }
  .welcome h2 { font-size: 29px; }
  .message-list { padding: 14px 16px 25px; }
  .message { gap: 10px; padding: 18px 0; }
  .composer-wrap { padding: 12px 13px 14px; }
  .composer-hint span:first-child { display: none; }
  .composer-hint { justify-content: flex-end; }
  .page-content { padding: 25px 15px 35px; }
  .page-intro { align-items: start; flex-direction: column; }
  .page-intro h2 { font-size: 25px; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .log-toolbar { align-items: stretch; flex-direction: column; gap: 9px; }
  .log-count { text-align: right; }
  .snapshot-card { padding: 18px; }
  .snapshot-card-header { flex-wrap: wrap; }
  .snapshot-badge { margin-left: 56px; }
  .snapshot-form { grid-template-columns: 1fr; }
  .snapshot-submit { grid-column: 1; width: 100%; }
  .snapshot-success { flex-wrap: wrap; }
  .snapshot-success .button { width: 100%; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > div { justify-content: space-between; }
  .toast { bottom: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
