:root {
  color-scheme: dark;
  --bg: #0e1118;
  --surface: #151923;
  --surface-raised: #1a1f2b;
  --surface-soft: #121620;
  --line: #29303c;
  --line-soft: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #9098a9;
  --subtle: #656d7c;
  --blue: #8ca9ff;
  --blue-bright: #9db6ff;
  --green: #72d7ac;
  --orange: #f0a36c;
  --danger: #f18a96;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.7; }

.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 15%, rgba(116, 144, 255, 0.12), transparent 36%), var(--bg); }
.auth-orbit { position: absolute; border: 1px solid rgba(140, 169, 255, 0.12); border-radius: 50%; pointer-events: none; }
.orbit-one { width: 760px; height: 760px; transform: translate(-20%, -40%); }
.orbit-two { width: 520px; height: 520px; transform: translate(58%, 48%); border-color: rgba(240, 163, 108, 0.12); }
.auth-card { width: min(430px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 28px; background: rgba(21, 25, 35, 0.9); box-shadow: var(--shadow); backdrop-filter: blur(22px); position: relative; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #111521; background: linear-gradient(135deg, #a8baff, #efaa78); font-size: 26px; box-shadow: 0 8px 24px rgba(130, 155, 255, 0.25); }
.brand-mark.small { width: 30px; height: 30px; border-radius: 10px; font-size: 16px; }
.eyebrow { margin: 0; color: var(--subtle); letter-spacing: 0.16em; font-size: 10px; font-weight: 800; }
.auth-card .eyebrow { margin-top: 28px; }
.auth-card h1 { margin: 10px 0 12px; font-size: clamp(28px, 5vw, 38px); letter-spacing: -0.04em; }
.auth-copy { margin: 0 0 28px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.auth-form { display: grid; gap: 11px; }
.auth-form label { color: #d7dce8; font-size: 12px; font-weight: 700; }
.password-wrap { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #10141d; padding: 0 14px; transition: border-color 0.2s, box-shadow 0.2s; }
.password-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(140, 169, 255, 0.12); }
.password-wrap span { color: var(--subtle); }
.password-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; padding: 14px 0; }
.password-wrap input::placeholder { color: #5e6674; }
.primary-button, .secondary-button { border: 0; border-radius: 11px; padding: 13px 16px; font-weight: 800; color: #10131b; background: var(--blue-bright); box-shadow: 0 8px 22px rgba(140, 169, 255, 0.18); transition: transform 0.2s, filter 0.2s; }
.primary-button:hover, .secondary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button span { float: right; font-size: 18px; line-height: 14px; }
.auth-button { margin-top: 12px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 17px; margin: 2px 0 0; }
.auth-footer { display: flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 11px; margin-top: 23px; }
.status-dot, .mini-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(114, 215, 172, 0.1); }

.app-grid { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 26px; border-right: 1px solid var(--line-soft); padding: 26px 15px 18px; background: #11141c; }
.sidebar-brand, .mobile-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; letter-spacing: -0.02em; padding: 0 9px; }
.sidebar-brand em { color: var(--subtle); font-style: normal; font-weight: 500; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; padding: 10px 9px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,0.025); }
.workspace-avatar, .avatar-button, .user-avatar { display: grid; place-items: center; border-radius: 9px; color: #18202f; background: #dce5ff; font-size: 11px; font-weight: 900; }
.workspace-avatar { width: 29px; height: 29px; }
.workspace-meta { display: grid; min-width: 0; flex: 1; gap: 2px; }
.workspace-meta small { color: var(--subtle); font-size: 9px; }
.workspace-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.chevron { color: var(--subtle); }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; position: relative; width: 100%; border: 0; border-radius: 10px; padding: 11px 11px; text-align: left; color: var(--muted); background: transparent; font-size: 13px; transition: background 0.2s, color 0.2s; }
.nav-item:hover, .nav-item.active { color: var(--text); background: rgba(140, 169, 255, 0.1); }
.nav-item.active::before { position: absolute; left: -15px; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--blue); content: ""; }
.nav-icon { width: 18px; text-align: center; font-size: 17px; color: var(--blue); }
.nav-item small { margin-left: auto; color: var(--subtle); font-size: 9px; }
.sidebar-spacer { flex: 1; }
.sidebar-note { display: flex; align-items: center; gap: 9px; padding: 12px 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.live-icon { color: var(--green); font-size: 11px; }
.sidebar-note div { display: grid; gap: 3px; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { color: var(--subtle); font-size: 10px; }
.sidebar-settings { display: flex; gap: 11px; align-items: center; padding: 6px 10px; border: 0; color: var(--muted); background: transparent; font-size: 12px; text-align: left; }
.main-panel { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 70px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line-soft); padding: 0 34px; }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 12px; }
.breadcrumbs i { color: #474f5e; font-style: normal; }
.breadcrumbs strong { color: var(--text); font-weight: 650; }
.mobile-brand { display: none; padding: 0; }
.topbar-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.connection-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--green); border-radius: 20px; padding: 7px 11px; background: rgba(114, 215, 172, 0.08); font-size: 11px; }
.connection-pill.warning { color: var(--orange); background: rgba(240, 163, 108, 0.08); }
.connection-pill.warning .status-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(240, 163, 108, 0.1); }
.avatar-button { width: 30px; height: 30px; border: 0; }
.codex-layout { min-height: 0; flex: 1; display: grid; grid-template-columns: 240px minmax(0, 1fr) 256px; }
.thread-panel, .context-panel { min-width: 0; background: rgba(14, 17, 24, 0.48); }
.thread-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); padding: 28px 15px 14px; }
.panel-heading, .context-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 0 7px; }
.panel-heading h2, .context-heading h2 { margin: 7px 0 0; font-size: 15px; letter-spacing: -0.03em; }
.icon-button, .more-button, .context-action { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); }
.icon-button { width: 30px; height: 30px; font-size: 20px; }
.thread-search { display: flex; align-items: center; gap: 8px; margin: 24px 0 14px; border: 1px solid var(--line-soft); border-radius: 9px; padding: 0 10px; color: var(--subtle); background: rgba(255,255,255,0.02); }
.thread-search input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; padding: 9px 0; font-size: 11px; }
.thread-search input::placeholder { color: var(--subtle); }
.thread-list { display: grid; gap: 4px; overflow: auto; }
.thread-row { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: 9px; padding: 10px 8px; color: var(--muted); background: transparent; text-align: left; }
.thread-row:hover, .thread-row.selected { color: var(--text); background: rgba(140, 169, 255, 0.09); }
.thread-symbol { color: var(--blue); font-size: 15px; }
.thread-info { display: grid; gap: 4px; min-width: 0; flex: 1; }
.thread-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.thread-info small { color: var(--subtle); font-size: 10px; }
.thread-more { align-self: start; color: var(--subtle); font-size: 13px; }
.empty-thread { padding: 30px 12px; text-align: center; color: var(--subtle); }
.empty-thread span { display: block; margin-bottom: 10px; color: var(--blue); font-size: 26px; }
.empty-thread p { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.empty-thread small { font-size: 10px; }
.thread-footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 14px 7px 0; border-top: 1px solid var(--line-soft); color: var(--subtle); font-size: 10px; }
.thread-footer button { margin-left: auto; border: 0; color: var(--subtle); background: transparent; }
.chat-panel { min-width: 0; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 25%, rgba(140, 169, 255, 0.035), transparent 40%); }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px 34px 20px; }
.chat-header h1 { overflow: hidden; max-width: min(460px, 55vw); margin: 7px 0 0; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; letter-spacing: -0.035em; }
.chat-header-meta { display: flex; align-items: center; gap: 12px; }
.model-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); font-size: 10px; }
.more-button { width: 30px; height: 30px; letter-spacing: 2px; }
.message-list { width: min(760px, calc(100% - 68px)); flex: 1; min-height: 270px; align-self: center; overflow: auto; padding: 18px 0 25px; scrollbar-color: #343b4a transparent; }
.message { display: flex; gap: 13px; margin: 0 0 27px; }
.message-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; font-size: 12px; font-weight: 900; }
.user-avatar { background: #dce5ff; }
.codex-avatar { color: #10131b; background: linear-gradient(135deg, #9fb3ff, #ecad7c); }
.message-body { min-width: 0; max-width: calc(100% - 44px); }
.message-meta { display: flex; align-items: center; gap: 9px; margin: 3px 0 8px; }
.message-meta strong { font-size: 12px; }
.message-meta span { color: var(--subtle); font-size: 10px; }
.message-content { color: #cfd4df; font-size: 13px; line-height: 1.75; word-break: break-word; }
.message-user .message-content { color: var(--text); }
.message-content pre { overflow: auto; margin: 13px 0; border: 1px solid var(--line); border-radius: 9px; padding: 13px; color: #dce5ff; background: #0a0e15; font-size: 12px; line-height: 1.6; }
.message-content code { border-radius: 4px; padding: 2px 5px; color: #cbd7ff; background: rgba(140,169,255,0.1); font-size: 0.92em; }
.message-content pre code { padding: 0; background: transparent; }
.welcome-state { max-width: 590px; margin: 6vh auto 0; text-align: center; }
.welcome-icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 20px; border: 1px solid rgba(140,169,255,0.2); border-radius: 17px; color: var(--blue); background: rgba(140,169,255,0.09); font-size: 28px; }
.welcome-state h2 { margin: 11px 0 10px; font-size: 28px; letter-spacing: -0.05em; }
.welcome-copy { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.7; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 31px; }
.prompt-grid button { min-height: 78px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; padding: 11px; color: var(--muted); background: rgba(255,255,255,0.02); text-align: left; font-size: 11px; line-height: 1.45; transition: border-color 0.2s, background 0.2s, transform 0.2s; }
.prompt-grid button span { align-self: flex-end; color: var(--blue); font-size: 15px; }
.prompt-grid button:hover { border-color: rgba(140,169,255,0.45); background: rgba(140,169,255,0.08); transform: translateY(-2px); }
.composer-wrap { width: min(760px, calc(100% - 68px)); align-self: center; padding-bottom: 27px; }
.approval-card { display: flex; align-items: center; gap: 11px; width: min(760px, calc(100% - 68px)); align-self: center; margin: 0 auto 10px; border: 1px solid rgba(240, 163, 108, 0.35); border-radius: 12px; padding: 11px 12px; background: rgba(240, 163, 108, 0.08); }
.approval-mark { display: grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 8px; color: #1b1612; background: var(--orange); font-size: 13px; font-weight: 900; }
.approval-copy { display: grid; min-width: 0; flex: 1; gap: 3px; }
.approval-copy strong { color: #f5d9c5; font-size: 11px; }
.approval-copy span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.approval-copy small { overflow: hidden; color: var(--subtle); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.approval-actions { display: flex; gap: 7px; }
.approval-actions button { border-radius: 8px; padding: 8px 10px; font-size: 10px; font-weight: 700; }
.approval-decline { border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.approval-accept { border: 0; color: #1b1612; background: var(--orange); }
.composer-context { display: flex; align-items: center; gap: 9px; margin: 0 5px 8px; color: var(--subtle); font-size: 10px; }
.context-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.chip-icon { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; color: #0e1118; background: var(--blue); font-size: 10px; font-weight: 800; }
.context-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-spacer { flex: 1; }
.context-action { width: 24px; height: 24px; font-size: 12px; }
.composer { border: 1px solid #3a4352; border-radius: 14px; padding: 12px 12px 9px 15px; background: #171c27; box-shadow: 0 14px 40px rgba(0,0,0,0.2); }
.composer:focus-within { border-color: rgba(140,169,255,0.7); box-shadow: 0 0 0 4px rgba(140,169,255,0.08); }
.composer textarea { display: block; width: 100%; max-height: 180px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; line-height: 1.55; font-size: 13px; }
.composer textarea::placeholder { color: #727b8a; }
.composer-bottom { display: flex; align-items: end; justify-content: space-between; margin-top: 11px; }
.composer-hints { display: flex; gap: 10px; color: var(--subtle); font-size: 9px; }
.send-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 9px; color: #111521; background: var(--blue-bright); font-size: 17px; font-weight: 900; }
.context-panel { border-left: 1px solid var(--line-soft); padding: 28px 17px; }
.context-heading { align-items: center; padding: 0 5px 18px; }
.online-label { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; }
.context-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: rgba(255,255,255,0.025); }
.card-icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; font-size: 15px; }
.card-icon.blue { color: var(--blue); background: rgba(140,169,255,0.12); }
.context-card div:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 4px; }
.context-card strong { font-size: 11px; }
.context-card small { overflow: hidden; color: var(--subtle); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.card-chevron { color: var(--subtle); font-size: 20px; }
.gpu-card { border-top: 1px solid var(--line-soft); padding-top: 18px; }
.gpu-card-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.gpu-card-head button { border: 0; color: var(--blue); background: transparent; font-size: 14px; }
.gpu-state { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; font-weight: 500; }
.gpu-state.muted { color: var(--subtle); }
.gpu-overview { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; margin: 13px 0 11px; }
.gpu-overview strong { grid-row: span 2; color: var(--blue-bright); font-size: 24px; letter-spacing: -0.05em; }
.gpu-overview span { color: var(--muted); font-size: 10px; }
.gpu-overview small { color: var(--subtle); font-size: 9px; }
.gpu-list { display: grid; gap: 9px; }
.gpu-row { display: flex; align-items: center; gap: 7px; }
.gpu-index { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; color: var(--blue); background: rgba(140,169,255,0.1); font-size: 9px; font-weight: 800; }
.gpu-row-main { min-width: 0; flex: 1; }
.gpu-row-main strong { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 600; }
.gpu-bar { height: 4px; margin-top: 4px; overflow: hidden; border-radius: 999px; background: #272e3a; }
.gpu-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #c49cff); }
.gpu-percent { min-width: 26px; color: var(--text); font-size: 9px; text-align: right; }
.gpu-more, .gpu-sample-time { display: block; margin-top: 9px; color: var(--subtle); font-size: 9px; }
.gpu-sample-time button { padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 9px; }
.gpu-empty { margin-top: 12px; color: var(--subtle); font-size: 10px; line-height: 1.55; }
.gpu-unavailable .gpu-card-head { color: var(--orange); }
.gpu-card > .gpu-muted { margin: 9px 0 0; }
.gpu-muted { color: var(--subtle); font-size: 10px; line-height: 1.55; }
.gpu-warning { margin: 10px 0 0; color: var(--orange); font-size: 10px; line-height: 1.5; }
.gpu-text-button { margin-top: 8px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 9px; }
.gpu-page { width: min(1050px, calc(100% - 68px)); margin: 0 auto; padding: 35px 0 46px; }
.gpu-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.gpu-page-heading h1 { margin: 8px 0 8px; font-size: 27px; letter-spacing: -0.05em; }
.gpu-page-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.gpu-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 31px; }
.gpu-schedule { color: var(--green); font-size: 11px; }
.gpu-overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 15px 0 14px; }
.gpu-overview-grid > div { display: grid; gap: 7px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: rgba(255,255,255,0.025); }
.gpu-overview-grid small { color: var(--subtle); font-size: 10px; }
.gpu-overview-grid strong { color: var(--text); font-size: 25px; letter-spacing: -0.05em; }
.gpu-overview-grid strong span { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.gpu-overview-grid .gpu-memory-total { font-size: 17px; }
.gpu-timestamps { margin: 0 0 17px; }
.gpu-device-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.gpu-device-card { border: 1px solid var(--line); border-radius: 14px; padding: 17px; background: var(--surface-soft); }
.gpu-device-card header { display: flex; align-items: center; gap: 9px; margin-bottom: 19px; }
.gpu-device-card header h2 { overflow: hidden; margin: 0; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; }
.gpu-number { display: inline-grid; place-items: center; flex: 0 0 auto; width: 37px; height: 24px; border-radius: 7px; color: #151923; background: var(--blue-bright); font-size: 10px; font-weight: 900; }
.gpu-metric-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.gpu-metric-label strong { color: var(--text); font-size: 12px; }
.gpu-device-card progress { display: block; width: 100%; height: 6px; margin: 7px 0 0; accent-color: var(--blue); }
.gpu-device-card progress::-webkit-progress-bar { border-radius: 99px; background: #2a313d; }
.gpu-device-card progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg, var(--blue), #c49cff); }
.gpu-no-meter { margin-top: 7px; color: var(--subtle); font-size: 10px; }
.gpu-thermal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; border-top: 1px solid var(--line-soft); padding-top: 13px; }
.gpu-thermal div { display: grid; gap: 4px; }
.gpu-thermal small { color: var(--subtle); font-size: 9px; }
.gpu-thermal strong { color: var(--muted); font-size: 12px; }
.gpu-load-panel { margin-top: 18px; border: 1px solid rgba(240,163,108,0.25); border-radius: 14px; padding: 20px; background: linear-gradient(135deg, rgba(240,163,108,0.07), rgba(140,169,255,0.04)); }
.gpu-schedule-panel { margin-top: 16px; border: 1px solid rgba(140,169,255,0.35); border-radius: 14px; padding: 20px; background: var(--surface-soft); }
.gpu-schedule-panel h2 { font-size: 17px; margin: 8px 0; }
.gpu-schedule-panel p { line-height: 1.7; }
#gpu-schedule-form { margin-top: 20px; }
.schedule-enable { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.schedule-enable input { width: 18px; height: 18px; accent-color: var(--blue); }
.schedule-interval { display: flex; align-items: center; gap: 12px; margin: 12px 0; color: var(--muted); font-size: 13px; }
.schedule-interval input { width: 120px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); padding: 12px; font-size: 16px; }
.schedule-state-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px; }
.schedule-state-row strong { color: var(--blue); font-size: 13px; }
.schedule-state-row button { margin: 0; min-height: 44px; }
.schedule-details { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 12px; font-size: 12px; line-height: 1.8; }
.schedule-details dt { color: var(--muted); }
.schedule-details dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .gpu-schedule-panel { padding: 15px; }
  .schedule-details { grid-template-columns: 1fr; gap: 4px; }
  .schedule-details dd { margin-bottom: 12px; }
}
.gpu-load-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.gpu-load-heading h2 { margin: 8px 0 6px; font-size: 17px; letter-spacing: -0.035em; }
.gpu-load-heading p:not(.eyebrow) { max-width: 600px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.load-state { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--subtle); font-size: 10px; }
.load-state.running { color: var(--orange); }
.load-state.running .status-dot { background: var(--orange); box-shadow: 0 0 0 4px rgba(240,163,108,0.1); }
.gpu-load-form { margin-top: 20px; }
.gpu-load-form fieldset { border: 0; margin: 0; padding: 0; }
.gpu-load-form fieldset:disabled { opacity: 0.65; }
.gpu-load-panel input, .gpu-load-panel select { min-height: 42px; }
.gpu-load-panel button { min-height: 42px; }
.gpu-load-form legend { margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.gpu-check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.gpu-check-grid label { display: grid; grid-template-columns: auto 1fr; column-gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 9px; background: rgba(255,255,255,0.025); cursor: pointer; }
.gpu-check-grid label:has(input:checked) { border-color: rgba(140,169,255,0.55); background: rgba(140,169,255,0.1); }
.gpu-check-grid input { accent-color: var(--blue); }
.gpu-check-grid span { color: var(--text); font-size: 10px; font-weight: 700; }
.gpu-check-grid small { grid-column: 2; overflow: hidden; color: var(--subtle); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.gpu-load-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 17px; }
.gpu-load-fields label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.gpu-load-fields input, .gpu-load-fields select { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 7px; outline: 0; padding: 9px; color: var(--text); background: #10141d; font-size: 11px; }
.gpu-load-fields span { color: var(--subtle); font-size: 9px; }
.gpu-load-hint { margin: 12px 0; color: var(--subtle); font-size: 10px; line-height: 1.5; }
.gpu-load-start { margin-top: 2px; }
.gpu-load-running { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-top: 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
.gpu-load-running div { display: grid; gap: 5px; }
.gpu-load-running strong { color: var(--orange); font-size: 11px; }
.gpu-load-running span { color: var(--subtle); font-size: 10px; }
.gpu-load-running .secondary-button { margin: 0; color: #f8d8c0; background: rgba(240,163,108,0.12); }
.gpu-load-output { max-height: 160px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 13px 0 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px; color: var(--muted); background: #0b0f16; font-size: 11px; line-height: 1.6; }
.context-section { margin-top: 30px; }
.section-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 700; }
.section-label button { border: 0; color: var(--blue); background: transparent; font-size: 9px; }
.file-list { display: grid; gap: 8px; margin-top: 13px; }
.file-row { display: flex; align-items: center; gap: 9px; padding: 4px 0; }
.file-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; font-size: 8px; font-weight: 900; }
.file-icon.py { color: #efd17c; background: rgba(239,209,124,0.11); }
.file-icon.md { color: #94c9ff; background: rgba(148,201,255,0.11); }
.file-icon.json { color: #edaa7a; background: rgba(237,170,122,0.11); }
.file-row div { display: grid; min-width: 0; flex: 1; gap: 3px; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.file-row small { color: var(--subtle); font-size: 9px; }
.file-status { color: var(--green); font-size: 12px; }
.activity-section { border-top: 1px solid var(--line-soft); padding-top: 19px; }
.status-row { display: flex; justify-content: space-between; gap: 10px; padding-top: 12px; color: var(--subtle); font-size: 10px; }
.status-row strong { color: var(--muted); font-weight: 600; }
.green-text { color: var(--green) !important; }
.tip-card { display: flex; gap: 10px; margin-top: 30px; border: 1px solid rgba(140,169,255,0.16); border-radius: 10px; padding: 11px; color: var(--muted); background: rgba(140,169,255,0.055); }
.tip-card > span { color: var(--blue); }
.tip-card p { margin: 0; font-size: 10px; line-height: 1.6; }
.mobile-nav { display: none; }
.placeholder-view, .fatal-error { display: grid; place-content: center; justify-items: center; min-height: calc(100dvh - 70px); padding: 30px; text-align: center; }
.placeholder-view h1, .fatal-error h1 { margin: 12px 0 8px; font-size: 28px; letter-spacing: -0.05em; }
.placeholder-view p, .fatal-error p { color: var(--muted); font-size: 13px; }
.secondary-button { margin-top: 15px; color: var(--text); background: var(--surface-raised); box-shadow: none; }
.settings-view { width: min(560px, calc(100% - 44px)); margin: 70px auto; }
.settings-head h1 { margin: 9px 0 7px; font-size: 28px; letter-spacing: -0.05em; }
.settings-head p:last-child { margin: 0; color: var(--muted); font-size: 13px; }
.settings-card { margin-top: 26px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--surface-soft); }
.settings-card + .settings-card { margin-top: 14px; }
.settings-card-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.settings-card-head div { display: grid; gap: 5px; }
.settings-card-head strong { font-size: 13px; }
.settings-card-head small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.switch { position: relative; width: 40px; height: 23px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #303847; transition: background 0.2s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #c9d1df; content: ""; transition: transform 0.2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(17px); background: #111521; }
.gpu-config-form { display: grid; gap: 9px; margin-top: 22px; }
.gpu-config-form label { color: var(--muted); font-size: 11px; font-weight: 700; }
.interval-control { display: flex; align-items: center; gap: 9px; }
.interval-control input { width: 130px; }
.interval-control span { color: var(--subtle); font-size: 11px; }
.settings-hint { margin: 0; color: var(--subtle); font-size: 10px; line-height: 1.5; }
.change-password-form { display: grid; gap: 9px; margin-top: 32px; border: 1px solid var(--line); border-radius: 14px; padding: 20px; background: var(--surface-soft); }
.change-password-form label { color: var(--muted); font-size: 11px; font-weight: 700; }
.change-password-form input { border: 1px solid var(--line); border-radius: 9px; outline: 0; padding: 11px 12px; color: var(--text); background: #10141d; }
.change-password-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(140,169,255,0.1); }
.change-password-form .primary-button { margin-top: 8px; }
.form-success { min-height: 17px; margin: 2px 0 0; color: var(--green); font-size: 12px; }
.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: min(360px, calc(100vw - 48px)); border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px; color: var(--text); background: #1c2230; box-shadow: var(--shadow); font-size: 12px; animation: toast-in 0.25s ease; }
.toast-error { border-color: rgba(241,138,150,0.45); color: #ffd4d9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1180px) {
  .codex-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .context-panel { display: none; }
}

@media (max-width: 760px) {
  .app-grid { display: block; padding-bottom: 66px; }
  .sidebar { display: none; }
  .topbar { min-height: 61px; padding: 0 17px; }
  .mobile-brand { display: flex; }
  .breadcrumbs { display: none; }
  .topbar-actions { gap: 8px; }
  .connection-pill { padding: 6px 8px; font-size: 0; }
  .connection-pill .status-dot { margin-right: 1px; }
  .avatar-button { width: 29px; height: 29px; }
  .codex-layout { display: block; }
  .thread-panel { display: none; }
  .chat-header { padding: 22px 17px 13px; }
  .chat-header h1 { max-width: 64vw; font-size: 16px; }
  .model-chip { display: none; }
  .message-list { width: calc(100% - 34px); min-height: calc(100dvh - 370px); padding-top: 14px; }
  .composer-wrap { width: calc(100% - 26px); padding-bottom: 13px; }
  .gpu-page { width: calc(100% - 34px); padding-top: 25px; }
  .gpu-page-heading { align-items: start; flex-direction: column; gap: 13px; }
  .gpu-page-heading h1 { font-size: 25px; }
  .gpu-page-heading .secondary-button { margin-top: 0; }
  .gpu-overview-grid { grid-template-columns: 1fr 1fr; }
  .gpu-overview-grid > div:last-child { grid-column: span 2; }
  .gpu-device-grid { grid-template-columns: 1fr; }
  .gpu-load-panel { padding: 15px; }
  .gpu-load-heading { flex-direction: column; gap: 10px; }
  .gpu-check-grid { grid-template-columns: repeat(2, 1fr); }
  .gpu-load-fields { grid-template-columns: 1fr; }
  .gpu-load-running { align-items: start; flex-direction: column; }
  .approval-card { width: calc(100% - 26px); align-items: flex-start; }
  .approval-actions { flex-direction: column; }
  .composer-context { margin-left: 2px; }
  .composer-hints { display: none; }
  .prompt-grid { grid-template-columns: 1fr; max-width: 300px; margin: 25px auto 0; }
  .prompt-grid button { min-height: 52px; flex-direction: row; align-items: center; }
  .welcome-state { margin-top: 7vh; }
  .welcome-state h2 { font-size: 25px; }
  .welcome-copy { max-width: 300px; font-size: 12px; }
  .mobile-nav { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; border-top: 1px solid var(--line); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: rgba(17, 20, 28, 0.96); backdrop-filter: blur(18px); }
  .mobile-nav .nav-item { display: grid; justify-items: center; gap: 2px; padding: 5px 3px; font-size: 9px; text-align: center; }
  .mobile-nav .nav-icon { font-size: 16px; }
  .mobile-nav .nav-item.active::before { top: -7px; right: 27%; bottom: auto; left: 27%; width: auto; height: 2px; }
  .mobile-nav .nav-item small { display: none; }
  .auth-card { padding: 30px 24px; border-radius: 23px; }
  .auth-card h1 { font-size: 29px; }
  .toast { right: 13px; bottom: 80px; }
}
