:root {
  color-scheme: dark;
  --bg: #101114;
  --side: #15161a;
  --surface: #191b20;
  --raised: #202227;
  --border: #2b2d34;
  --border-light: #373a44;
  --text: #f0f0f1;
  --muted: #a1a3ad;
  --subtle: #868995;
  --accent: #caf48a;
  --accent-hover: #dcffac;
  --accent-ink: #18240d;
  --green-bg: #26331e;
  --danger: #ffa5a8;
  --radius: 12px;
  --rail: 262px;
  --activity: 255px;
  --control-size: 38px;
  --chat-gap: 13px;
  --panel-bg: #131419;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
}
:root[data-theme="ink"] { --bg: #0b1019; --side: #101825; --surface: #152131; --raised: #1e2c40;
  --border: #25354a; --border-light: #344762; --panel-bg: #0f1724; }
:root[data-theme="contrast"] { --bg: #09090b; --side: #111115; --surface: #18181e; --raised: #25252e;
  --border: #3a3a47; --border-light: #535363; --muted: #c1c2cc; --subtle: #a5a6b2; --panel-bg: #111115; }
:root[data-accent="blue"] { --accent: #9cddff; --accent-hover: #c4edff; --accent-ink: #112b3b; --green-bg: #1e3440; }
:root[data-accent="violet"] { --accent: #d1b8ff; --accent-hover: #e4d5ff; --accent-ink: #28183d; --green-bg: #322742; }
:root[data-accent="amber"] { --accent: #ffcf82; --accent-hover: #ffe0a8; --accent-ink: #372508; --green-bg: #3f311e; }
:root[data-density="compact"] { --chat-gap: 8px; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
button, input, textarea, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .44; cursor: default; }
a { color: inherit; }
button, input, textarea, select, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; width: 18px; height: 18px; flex: 0 0 auto; }
[data-icon] { flex-shrink: 0; }
pre, code, .picker, .editor-bar { font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .83rem; }
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  height: 100vh; height: 100dvh; overflow: hidden; }

.button, .icon-button, .nav-row, .thread-row, .plain-button, .activity-row, .job-row, .suggestion, .dropdown button {
  border: 1px solid transparent; background: transparent; text-align: left;
}
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 8px 13px; min-height: var(--control-size);
  max-width: 100%; border-color: var(--border-light); background: var(--surface); border-radius: 9px;
  font-size: .875rem; font-weight: 600; text-align: center; text-decoration: none; }
.button:not(:disabled):hover { background: var(--raised); border-color: #565965; }
.button.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button.accent:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.icon-button { display: inline-grid; place-items: center; width: var(--control-size); height: var(--control-size);
  flex: none; padding: 0; color: var(--muted); border-radius: 8px; }
.icon-button:hover, .icon-button[aria-pressed="true"], .icon-button[aria-expanded="true"] { color: var(--text); background: var(--raised); }
.icon-button.danger:hover { color: var(--danger); }
.plain-button { padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: .83rem; }
.plain-button:hover { color: var(--text); background: var(--raised); }

.sidebar { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(14rem, 1fr) auto;
  min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; background: var(--side); border-right: 1px solid var(--border); }
.sidebar > * { min-inline-size: 0; }
.brand { display: flex; align-items: center; gap: 11px; padding: 24px 22px 25px; }
.brand-logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px #e3ffb1; }
.brand-logo svg { width: 22px; height: 22px; }
.brand strong, .brand div span, .account strong, .account div span { display: block; overflow-wrap: anywhere; }
.brand strong { font-size: 1.08rem; letter-spacing: -.035em; line-height: 1.25; }
.brand div span { font-size: .78rem; color: var(--muted); }
.primary-nav { display: grid; gap: 4px; padding: 0 15px 21px; }
.new-chat { color: var(--accent); justify-content: flex-start; background: #20271c; border-color: #3c4a31;
  margin: 0 0 9px; min-height: max(43px, var(--control-size)); }
.new-chat:not(:disabled):hover { background: #2a3820; border-color: #526841; }
.nav-row, .thread-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  min-height: var(--control-size); border-radius: 8px; color: var(--muted); }
.nav-row { font-size: .9rem; }
.nav-row:hover, .thread-row:hover { background: var(--raised); color: var(--text); }
.nav-row.selected, .thread-row.selected { background: #262b24; border-color: #343e2f; color: var(--accent); }
.chat-nav { border-top: 1px solid var(--border); padding: 12px 15px 12px; display: flex; flex-direction: column; min-height: 0; }
.section-label { display: flex; align-items: center; justify-content: space-between; min-height: 25px; gap: 8px; color: var(--subtle); text-transform: uppercase; letter-spacing: .075em; font-weight: 700; font-size: .73rem; }
.chat-nav > :not(.thread-list) { flex-shrink: 0; }
.chat-nav .section-label { margin: 0 0 8px 7px; }
.search { display: flex; align-items: center; gap: 8px; background: #111216; border: 1px solid var(--border); border-radius: 8px; padding: 6px 9px; color: var(--subtle); }
.search:focus-within { border-color: #7d9a60; }
.search input { width: 100%; min-width: 0; background: transparent; color: var(--text); border: 0; padding: 2px 0; font-size: .85rem; outline: none; }
.search svg, .thread-row svg { width: 16px; height: 16px; }
.thread-list { flex: 1; min-height: 0; min-width: 0; margin-top: 9px;
  overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
.thread-row { font-size: .84rem; }
.thread-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.thread-dot { margin-left: auto; padding: 3px; border-radius: 50%; background: var(--accent); }
.empty-list, .quiet { color: var(--muted); font-size: .84rem; padding: 9px 7px; overflow-wrap: anywhere; }
#more-chats { align-self: flex-start; margin-top: 7px; }
.account { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; border-top: 1px solid var(--border); padding: 15px 15px calc(15px + env(safe-area-inset-bottom)); }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; background: #323c31; border: 1px solid #485546; border-radius: 50%; color: #daedcd; font-size: .88rem; font-weight: 700; }
.account strong { font-size: .87rem; }
.account div span { color: var(--muted); font-size: .75rem; }

.main { display: grid; min-width: 0; min-height: 0; grid-template-rows: 64px minmax(0, 1fr); }
.topbar { display: flex; gap: 12px; align-items: center; min-width: 0; padding: 0 24px; border-bottom: 1px solid var(--border); }
.breadcrumb { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: .87rem; }
.breadcrumb > span:first-child { white-space: nowrap; }
.breadcrumb svg { width: 14px; height: 14px; }
.breadcrumb strong { color: var(--text); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mobile-menu, .sidebar-close, .veil { display: none; }
.active-toggle { flex: none; color: var(--muted); background: transparent; padding: 6px 10px; font-weight: 500; font-size: .81rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #797d88; }
.has-active .status-dot { background: var(--accent); box-shadow: 0 0 0 3px #c2ed7b20; }
.thread-menu { position: relative; }
.dropdown { position: absolute; z-index: 4; right: 0; top: calc(100% + 5px); border: 1px solid var(--border-light); border-radius: 10px; padding: 5px; min-width: 180px; background: var(--surface); box-shadow: 0 15px 45px #0008; }
.dropdown button { width: 100%; min-height: var(--control-size); display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; font-size: .88rem; }
.dropdown button:hover { background: var(--raised); }

.workbench { display: flex; position: relative; min-height: 0; min-width: 0; }
.view { flex: 1 1 0; min-width: 0; min-height: 0; }
.activity { display: none; width: var(--activity); flex: 0 0 var(--activity); min-height: 0; overflow-y: auto; background: var(--panel-bg); border-left: 1px solid var(--border); }
.activity.open { display: block; }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px 12px; }
.activity-head h2 { font-size: .94rem; }
.activity-section { margin: 0 16px; padding: 12px 2px 17px; border-top: 1px solid var(--border); }
.activity-section .quiet { padding: 8px 0 0; font-size: .82rem; }
.activity-section progress { display: block; width: 100%; height: 7px; margin: 7px 0; accent-color: var(--accent); }
.usage-limit { margin-top: 10px; font-size: .83rem; overflow-wrap: anywhere; }
.usage-caption { display: block; margin-top: 7px; color: var(--muted); font-size: .76rem; }
#usage-refresh { height: 31px; width: 31px; }
#usage-refresh svg { height: 15px; width: 15px; }
.count { background: var(--raised); color: var(--muted); border-radius: 6px; padding: 1px 6px; font-size: .75rem; }
.activity-row { display: flex; justify-content: space-between; gap: 7px; align-items: center; width: 100%; padding: 7px 4px; border-radius: 7px; }
.activity-row:hover { background: var(--raised); }
.activity-task { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.context dl { margin: 7px 0 0; font-size: .82rem; }
.context dt { display: flex; align-items: center; gap: 7px; color: var(--muted); margin: 13px 0 4px; }
.context dt svg { width: 15px; height: 15px; }
.context dd { margin: 0; padding-left: 22px; overflow-wrap: anywhere; }

.chat-view { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.chat-scroll { overflow: auto; min-height: 0; scrollbar-width: thin; }
.chat-scroll:focus-visible, .thread-list:focus-visible { outline-offset: -2px; }
.chat-content { width: min(100%, 882px); margin: 0 auto; padding: 0 28px 22px; }
.chat-content:has(.welcome:not([hidden])) { display: flex; justify-content: safe center; flex-direction: column; min-height: 100%; }
.welcome { text-align: center; padding: 38px 0 20px; }
.welcome-icon { display: inline-grid; place-items: center; height: 58px; width: 58px; color: var(--accent); background: #222b1d; border: 1px solid #3b4a32; border-radius: 17px; margin-bottom: 20px; }
.welcome-icon svg { width: 30px; height: 30px; }
.welcome h1, .page-heading h1, .login-card h1 { font-size: clamp(1.9rem, 4vw, 3rem); color: #f5f5f7; font-weight: 620; line-height: 1.15; letter-spacing: -.058em; }
.welcome p { color: var(--muted); margin-top: 11px; font-size: .96rem; }
.suggestions { width: min(100%, 740px); margin: 30px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.suggestion { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 9px; align-items: start; border-radius: 11px; padding: 11px; border-color: var(--border); background: #14161a; min-height: 72px; }
.suggestion:hover { background: #1d221b; border-color: #47583b; }
.suggestion-icon { padding: 5px; border-radius: 7px; color: var(--accent); background: #243020; }
.suggestion-icon svg { width: 15px; height: 15px; }
.suggestion strong, .suggestion small { display: block; }
.suggestion strong { font-size: .82rem; line-height: 1.25; margin-top: 2px; letter-spacing: -.015em; font-weight: 650; }
.suggestion small { color: var(--muted); font-size: .76rem; margin-top: 3px; line-height: 1.23; }
.suggestion-go { display: none; }
.composer-wrap { width: min(100%, 882px); margin: 0 auto; padding: 0 28px calc(10px + env(safe-area-inset-bottom)); }
.composer { display: flex; flex-direction: column; padding: 11px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 16px; box-shadow: 0 4px 30px #0002; }
.composer:focus-within { border-color: #5d6d4e; }
.composer textarea { min-height: 46px; max-height: min(180px, 26dvh); width: 100%; resize: vertical; padding: 4px 6px; outline: none; border: 0; background: transparent; }
.composer textarea::placeholder, .search input::placeholder { color: var(--subtle); }
.composer-bar { display: flex; gap: 8px; align-items: end; justify-content: space-between; }
.composer-options { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.picker { display: inline-flex; align-items: center; gap: 5px; padding: 0 6px 0 7px; min-height: 32px; max-width: 100%; border: 1px solid #30323a; color: var(--muted); background: #202228; border-radius: 7px; font-size: .73rem; }
.picker select { max-width: 155px; min-width: 0; font-size: inherit; }
.permission-picker select { max-width: 205px; }
.picker > span svg { width: 14px; height: 14px; }
select { appearance: none; border: 0; background: transparent;
  background-image: url("/chevron.svg"); background-position: right 3px center; background-repeat: no-repeat; background-size: 12px;
  padding: 3px 18px 3px 2px; }
select option { background: var(--surface); }
.button.send-button { height: var(--control-size); width: var(--control-size); padding: 0; border-radius: 10px;
  border-color: var(--accent); background: var(--accent); color: var(--accent-ink); flex: none; margin-left: auto; }
.button.send-button:not(:disabled):hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.button.stop-button { border-color: var(--border-light); background: var(--raised); color: var(--text); }
.button.stop-button:not(:disabled):hover { color: var(--accent-ink); }
.button.send-button.full-access, .button.send-button.full-access:hover { background: #ffd18e; border-color: #ffd18e; color: #392511; }
.permission-note { margin: 8px 4px 0; color: var(--muted); font-size: .77rem; }
.permission-note.full-access-note { color: #ffd18e; }
.composer-footer { min-height: 32px; display: grid; place-items: center; margin-top: 4px; }
.composer-note { display: flex; justify-content: center; align-items: center; gap: 6px; color: var(--subtle); font-size: .75rem; text-align: center; }
.composer-note svg { width: 14px; height: 14px; }
.work-mascot { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.mascot-stage { position: relative; display: inline-block; width: 62px; height: 32px; color: var(--accent); }
.mascot-robot { position: absolute; left: 12px; bottom: 5px; width: 29px; height: 19px; border: 1px solid currentColor;
  border-radius: 6px; background: var(--green-bg); box-shadow: 0 2px 0 var(--bg); transform-origin: 50% 100%; }
.mascot-antenna { position: absolute; left: 9px; top: -5px; width: 2px; height: 5px; background: currentColor; }
.mascot-antenna::before { content: ""; position: absolute; left: -1px; top: -2px; width: 4px; height: 4px;
  border-radius: 50%; background: currentColor; }
.mascot-face { position: absolute; inset: 3px; border-radius: 3px; background: var(--bg); }
.mascot-face::before { content: ""; position: absolute; left: 5px; top: 4px; width: 3px; height: 5px; border-radius: 2px;
  background: currentColor; box-shadow: 8px 0 currentColor; animation: mascot-blink 4s infinite; }
.mascot-hands::before, .mascot-hands::after { content: ""; position: absolute; top: 12px; width: 5px; height: 3px;
  border-radius: 2px; background: currentColor; }
.mascot-hands::before { left: -4px; transform: rotate(-28deg); }
.mascot-hands::after { right: -4px; transform: rotate(28deg); }
.mascot-prop { position: absolute; right: 3px; bottom: 5px; }
.work-mascot[data-move="typing"] .mascot-robot { animation: mascot-type .32s steps(2, jump-none) infinite; }
.work-mascot[data-move="typing"] .mascot-prop { width: 17px; height: 5px; right: 7px; bottom: 2px;
  border: 1px solid currentColor; border-radius: 2px; background: repeating-linear-gradient(90deg, transparent 0 3px, currentColor 3px 4px); }
.work-mascot[data-move="scanning"] .mascot-robot { animation: mascot-scan 1s ease-in-out infinite alternate; }
.work-mascot[data-move="scanning"] .mascot-prop { width: 11px; height: 11px; right: 5px; bottom: 12px;
  border: 2px solid currentColor; border-radius: 50%; animation: mascot-scan 1s ease-in-out infinite alternate; }
.work-mascot[data-move="scanning"] .mascot-prop::after { content: ""; position: absolute; right: -5px; bottom: -4px; width: 6px;
  height: 2px; background: currentColor; transform: rotate(50deg); }
.work-mascot[data-move="stacking"] .mascot-prop { width: 7px; height: 7px; right: 7px; bottom: 4px; border: 1px solid currentColor;
  border-radius: 2px; box-shadow: 0 -8px var(--green-bg); }
.work-mascot[data-move="stacking"] .mascot-prop::before { content: ""; position: absolute; inset: -1px; border: 1px solid currentColor;
  border-radius: 2px; animation: mascot-stack 1.2s ease-in infinite; }
.work-mascot[data-move="coffee"] .mascot-prop { width: 11px; height: 9px; right: 7px; border: 1px solid currentColor; border-radius: 0 0 4px 4px; }
.work-mascot[data-move="coffee"] .mascot-prop::before { content: ""; position: absolute; width: 5px; height: 5px; right: -5px; top: 1px;
  border: 1px solid currentColor; border-left: 0; border-radius: 0 3px 3px 0; }
.work-mascot[data-move="coffee"] .mascot-prop::after { content: ""; position: absolute; width: 6px; height: 7px; left: 2px; top: -9px;
  border-left: 1px solid currentColor; border-radius: 50%; animation: mascot-steam 1.4s ease-out infinite; }
@keyframes mascot-blink { 0%, 91%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes mascot-type { to { transform: translateY(-2px) rotate(-3deg); } }
@keyframes mascot-scan { to { transform: translateY(-3px) rotate(-10deg); } }
@keyframes mascot-stack { from { transform: translate(-8px, -20px); opacity: 0; } 28% { opacity: 1; }
  72%, 100% { transform: translateY(-8px); opacity: 1; } }
@keyframes mascot-steam { from { opacity: 0; transform: translateY(2px); } 42% { opacity: .9; } to { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .mascot-stage *, .mascot-stage *::before, .mascot-stage *::after { animation: none !important; }
}
.transcript { display: flex; flex-direction: column; gap: var(--chat-gap); padding-top: 24px; }
:root[data-density="compact"] .brand { padding-block: 15px; }
:root[data-density="compact"] .message.userMessage { padding-block: 8px; }
:root[data-density="compact"] .schedule { padding-block: 10px; }
.transcript:empty { padding-top: 0; }
.message { overflow-wrap: anywhere; min-width: 0; }
.message-byline { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: .85rem; font-weight: 700; }
.message-byline svg { color: var(--accent); width: 18px; height: 18px; }
.message.userMessage { align-self: flex-end; width: fit-content; max-width: min(90%, 660px); background: #222725; border: 1px solid #353d34; border-radius: 15px 15px 5px 15px; padding: 12px 15px; }
.userMessage .message-byline { color: #bdc8b8; font-size: .76rem; margin-bottom: 3px; }
.user-text, .rich-text p { white-space: pre-wrap; }
.rich-text { display: flow-root; }
.rich-text p, .rich-text h3 { margin: 0 0 8px; }
.rich-text h3 { font-size: 1.03rem; margin-top: 7px; }
.rich-text p > code { font-size: .88em; background: #202329; border-radius: 4px; padding: 1px 4px; color: var(--accent); }
.code-block, .tool-message { margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 9px; background: #141519; overflow: hidden; font-size: .86rem; }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 9px; background: var(--surface); color: var(--muted); }
.code-language { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-bar button { flex: none; }
.code-block pre, .tool-message pre, .approval pre { margin: 0; overflow: auto; padding: 11px 12px; font-size: .82rem; max-height: 350px; }
.tool-message summary { display: flex; gap: 8px; align-items: center; padding: 8px 10px; cursor: pointer; font-size: .8rem; color: var(--muted); }
.tool-message summary > span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool-message summary svg { width: 15px; height: 15px; }
.tool-message[open] summary { border-bottom: 1px solid var(--border); }
.message.plan { padding: 10px 14px; border-left: 2px solid #50683a; background: #171b18; border-radius: 4px 9px 9px 4px; }
.older { display: block; margin: 14px auto 0; }
.run-status { margin-top: 16px; color: var(--accent); font-size: .88rem; }
.run-status.error { color: var(--danger); }
.approval { padding: 16px; margin-top: 13px; }
.approval h3 { font-size: 1rem; margin-bottom: 8px; }
.approval pre { background: var(--bg); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }

.page-view { overflow: auto; padding: 32px clamp(19px, 4vw, 54px) 35px; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 23px; }
.page-heading h1 { font-size: clamp(1.85rem, 3.6vw, 2.62rem); }
.page-heading p { color: var(--muted); margin-top: 6px; font-size: .94rem; }
.page-view h2 { font-size: 1.04rem; margin: 24px 0 10px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.schedule-list { display: grid; gap: 9px; }
.schedule { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 14px; }
.schedule-icon { display: grid; place-items: center; width: 35px; height: 35px; color: var(--accent); background: var(--green-bg); border-radius: 8px; }
.schedule-title { display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: center; }
.schedule-title h3 { font-size: .97rem; overflow-wrap: anywhere; }
.schedule-meta, .schedule-next { color: var(--muted); margin-top: 4px; font-size: .82rem; }
.schedule-meta { overflow-wrap: anywhere; }
.schedule-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.status-tag { display: inline-block; color: var(--muted); font-size: .72rem; white-space: nowrap; background: var(--raised); border: 1px solid var(--border); padding: 2px 7px; border-radius: 16px; }
.status-running, .status-active, .status-completed { color: var(--accent); background: var(--green-bg); border-color: #3e4b35; }
.status-failed { color: var(--danger); background: #362428; border-color: #4c3035; }
.status-paused, .status-queued { color: #f0cf9b; background: #322b20; border-color: #443a2b; }
.empty-state { text-align: center; padding: 38px 14px; }
.empty-state svg { width: 24px; height: 24px; margin: 0 auto 9px; color: var(--accent); }
.empty-state h3 { font-size: 1rem; margin-bottom: 5px; }
.empty-state p { font-size: .86rem; }
#job-history { overflow: hidden; }
#job-history .quiet { padding: 15px; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 10px 13px; width: 100%; }
.job-row + .job-row { border-top: 1px solid var(--border); }
.job-row:hover { background: var(--raised); }
.job-row > svg { color: var(--muted); width: 15px; }
.job-name strong, .job-name small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.job-name strong { font-size: .9rem; }
.job-name small { font-size: .78rem; }
.notice { color: #e2cca5; background: #2b261c; border: 1px solid #453d2f; padding: 9px 13px; border-radius: 8px; margin-bottom: 12px; font-size: .85rem; }
.editor { overflow: hidden; }
.editor-bar, .editor-footer { display: flex; align-items: center; padding: 9px 11px; gap: 10px; }
.editor-bar { border-bottom: 1px solid var(--border); color: var(--muted); font-size: .8rem; }
.editor-bar > svg { color: var(--accent); }
.editor-bar code { overflow-wrap: anywhere; }
#editor-state { margin-left: auto; text-align: right; }
.editor textarea { width: 100%; min-height: 260px; height: min(52dvh, 560px); resize: vertical; padding: 14px; display: block; background: #111216; border: 0; font: .89rem/1.6 "IBM Plex Mono", Consolas, monospace; }
.editor-footer { flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--border); }
dialog { width: min(100% - 26px, 520px); max-height: calc(100dvh - 24px); padding: 20px; overflow-y: auto; border-radius: 15px; border: 1px solid var(--border-light); color: var(--text); background: var(--surface); box-shadow: 0 18px 90px #0009; }
dialog::backdrop { background: #060709bd; }
.dialog-head, .dialog-footer { display: flex; gap: 9px; align-items: center; }
.dialog-head { justify-content: space-between; margin-bottom: 11px; }
.dialog-head h2 { font-size: 1.18rem; letter-spacing: -.02em; }
.dialog-footer { flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.field { display: grid; gap: 6px; color: var(--muted); font-size: .87rem; margin: 12px 0; min-width: 0; }
.field input, .field textarea, .field select { color: var(--text); background-color: #111216; border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 9px; width: 100%; min-height: 41px; min-width: 0; font-size: 1rem; }
.field select { background-position: right 9px center; padding-right: 26px; }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 10px; }
.field-row .field { margin-top: 0; }
.toast { position: fixed; z-index: 10; right: 17px; bottom: calc(17px + env(safe-area-inset-bottom)); max-width: min(85vw, 420px); padding: 11px 14px; background: #253222; border: 1px solid #485d3f; color: #ebf5e5; border-radius: 10px; box-shadow: 0 12px 36px #0007; font-size: .91rem; }
.toast.error { background: #392527; border-color: #78484d; color: #ffe6e6; }
.login-page { display: grid; min-height: 100dvh; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 24%, #22291e 0, transparent 53%), var(--bg); }
.login-card { width: min(100%, 405px); padding: 34px 25px; border: 1px solid var(--border); background: #15171a; text-align: center; border-radius: 18px; box-shadow: 0 20px 65px #0005; }
.login-logo { margin: 0 auto 20px; width: 49px; height: 49px; border-radius: 13px; }
.login-logo svg { width: 27px; height: 27px; }
.login-card h1 { font-size: 2.15rem; }
.login-card p { margin: 10px 0 22px; color: var(--muted); }
.login-card .button { min-height: 43px; }

@media (max-width: 1109px) {
  .activity { position: absolute; inset: 0 0 0 auto; z-index: 3; width: min(310px, 88vw); box-shadow: -15px 0 48px #0008; }
}
@media (max-width: 760px) {
  :root { --control-size: 44px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .main { grid-template-rows: 56px minmax(0, 1fr); }
  .sidebar { display: none; position: fixed; inset: 0 auto 0 0; width: min(315px, 88vw); z-index: 7;
    padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); overscroll-behavior: contain;
    box-shadow: 14px 0 45px #0005; }
  .sidebar.open { display: grid; }
  .veil { display: block; position: fixed; inset: 0; z-index: 6; border: 0; background: #0009; }
  .mobile-menu, .sidebar-close { display: grid; }
  .sidebar-close { margin-left: auto; }
  .topbar { gap: 7px; padding: 0 11px; }
  .breadcrumb { gap: 4px; }
  .breadcrumb > span { display: none; }
  .chat-content { padding: 0 16px 15px; }
  .composer-wrap { padding: 0 12px calc(8px + env(safe-area-inset-bottom)); }
  .composer textarea { resize: none; }
  .composer-note { font-size: .72rem; }
  .welcome { padding: 22px 0 12px; }
  .welcome-icon { margin-bottom: 14px; width: 49px; height: 49px; }
  .welcome p { font-size: .88rem; }
  .suggestions { max-width: 425px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 19px; }
  .suggestion { min-height: 50px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding: 7px 10px; }
  .suggestion-go { display: block; color: var(--subtle); }
  .suggestion-go svg { width: 15px; height: 15px; }
  .suggestion small { margin-top: 1px; }
  .page-view { padding: 22px 15px 28px; }
  .schedule { grid-template-columns: auto minmax(0, 1fr); }
  .schedule-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .picker { min-height: var(--control-size); }
  .picker select { max-width: 104px; }
  .permission-picker select { max-width: min(43vw, 166px); }
}
@media (max-width: 385px) {
  .field-row { display: block; }
  .page-heading p { font-size: .88rem; }
  .welcome p { margin-top: 7px; }
}
@media (max-height: 620px) {
  .brand { padding: 14px 16px; }
  .primary-nav { padding-bottom: 10px; }
  .new-chat { margin-bottom: 4px; }
  .chat-nav { padding-block: 8px; }
  .chat-nav .section-label { margin-bottom: 4px; }
  .thread-list { margin-top: 5px; }
  .account { padding-block: 9px calc(9px + env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) {
  .sidebar { grid-template-rows: auto auto auto auto; align-content: start; }
  .thread-list { flex: none; overflow: clip; }
}
@media (max-height: 570px) and (max-width: 760px) {
  .welcome-icon { width: 42px; height: 42px; margin-bottom: 8px; }
  .welcome-icon svg { width: 24px; height: 24px; }
  .welcome { padding-top: 12px; }
  .suggestions { margin-top: 11px; }
}
