:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #28262c;
  --muted: #6f6b76;
  --line: #e2e0e6;
  --code: #f5f5f6;
  --sidebar: #f6f6f7;
  --accent: #2459c9;
  --soft: #ebf1ff;
  --on-accent: #ffffff;
  --success: #0b7552;
  --success-soft: #e9f5ee;
  --blue: #2663ab;
  --blue-soft: #eaf2ff;
  --amber: #8a5708;
  --amber-soft: #fff3d9;
  --danger: #b3394b;
  --danger-soft: #ffeef1;
}
:root[data-palette="teal"] { --accent: #0b7779; --soft: #e8f5f4; }
:root[data-palette="green"] { --accent: #1b754c; --soft: #eaf4ec; }
:root[data-palette="rose"] { --accent: #ad304c; --soft: #faedf1; }
:root[data-palette="graphite"] { --accent: #424850; --soft: #eef0f2; }
:root[data-palette="amber"] { --accent: #aa4b17; --soft: #fff1e8; }
:root[data-theme="dark"] {
  --bg: #161819;
  --paper: #1c1f20;
  --ink: #e6eaeb;
  --muted: #a0aaad;
  --line: #343b3e;
  --code: #25292b;
  --sidebar: #1c1f20;
  --on-accent: #162127;
  --accent: #98bcf4;
  --soft: #283344;
  --success: #93d5ae;
  --success-soft: #263a2e;
  --blue: #98bcf4;
  --blue-soft: #283344;
  --amber: #f0c780;
  --amber-soft: #3e3426;
  --danger: #f49cab;
  --danger-soft: #3c2930;
}
:root[data-theme="dark"][data-palette="teal"] { --accent: #6ac7c9; --soft: #203e40; }
:root[data-theme="dark"][data-palette="green"] { --accent: #89ccab; --soft: #233e2f; }
:root[data-theme="dark"][data-palette="rose"] { --accent: #ef9eb1; --soft: #422b35; }
:root[data-theme="dark"][data-palette="graphite"] { --accent: #c0c6cf; --soft: #33383f; }
:root[data-theme="dark"][data-palette="amber"] { --accent: #f1b184; --soft: #433224; }
dialog:has(#job-form) { width: min(940px, calc(100vw - 32px)); }
#job-form fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
#job-form legend { padding: 0; margin: 0 0 14px; font-size: 14px; font-weight: 600; }
#job-form label { font-size: 13px; }
#job-form input, #job-form select, #job-form textarea { font-size: 13px; }
#job-form .job-content { max-width: 560px; }
#job-form .task-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
#job-form .task-configuration { border-left: 1px solid var(--line); padding-left: 24px; }
#job-form .task-content textarea { min-height: 160px; }
#job-form .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.model-control { display: flex; gap: 8px; align-items: center; }
.model-control select { min-width: 0; flex: 1; }
.model-control button { flex: 0 0 36px; }
.model-status { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.execution-notice { display: flex; align-items: flex-start; gap: 10px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: var(--amber); padding: 12px 14px; margin: 16px 0; font-size: 13px; }
.execution-notice > svg { width: 18px; height: 18px; flex: 0 0 18px; }
.execution-notice p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  #job-form .task-columns { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #job-form .task-configuration { border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  #job-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  #job-form .task-content textarea { min-height: 100px; }
}
button.primary { color: var(--on-accent); }
button, input, select, textarea { transition: border-color 120ms; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
svg { stroke-width: 1.7; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shell { grid-template-columns: 192px minmax(0,1fr); }
.shell > main { min-width: 0; outline: none; }
.sidebar { padding: 20px 12px 16px; background: var(--sidebar); gap: 20px; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { gap: 8px; font-size: 15px; }
.brand-mark { width: 25px; height: 25px; background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; }
.brand-mark svg { width: 17px; height: 17px; color: inherit; }
#nav-toggle { display: none; }
.workspace-label { display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 10px; font-size: 12px; }
.workspace-label svg { width: 15px; height: 15px; color: var(--muted); }
.sidebar nav { gap: 5px; }
.nav-section-label { font-size: 10px; color: var(--muted); padding: 8px 10px 3px; }
.sidebar nav button { font-size: 12px; padding: 9px 10px; min-height: 38px; color: var(--muted); }
.sidebar nav button.active { background: var(--paper); border-color: var(--line); color: var(--accent); font-weight: 600; }
.sidebar-footer { padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.topbar { height: 54px; padding: 0 24px; font-size: 12px; }
.topbar .toolbar { gap: 10px; }
#username { font-size: 11px; }
.page-head { padding: 24px; }
h1 { font-size: 22px; }
.page-head p { font-size: 11px; }
.page-head button { font-size: 12px; }
.compact-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 30px; margin: 0 24px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; }
.compact-summary div { display: flex; align-items: baseline; gap: 8px; }
.compact-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.compact-summary small { font-size: 10px; color: var(--muted); font-weight: 400; }
.compact-summary span { font-size: 10px; color: var(--muted); }
.view { margin: 0 24px 28px; }
.download-page { max-width: 720px; }
.download-platforms { gap: 4px; margin-bottom: 24px; }
.download-platforms button { display: inline-flex; align-items: center; gap: 6px; }
.download-panel { padding: 0 0 24px; }
.download-app-icon { flex-shrink: 0; }
.ios-install ol { padding-left: 24px; }
.ios-install li { padding: 8px 0; line-height: 1.7; }
.ios-install li svg { vertical-align: middle; }
#companion-install > label { margin-top: 16px; }
#companion-install details { margin-top: 20px; }
.download-intro { display: flex; align-items: flex-start; gap: 16px; }
.download-intro h2 { margin: 0 0 5px; font-size: 18px; }
.download-intro p { margin: 0; }
.download-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 8px; background: var(--soft); color: var(--accent); }
.download-icon svg { width: 22px; height: 22px; }
.download-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.download-actions .button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; color: inherit; text-decoration: none; }
.download-actions .button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.download-note { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.download-release { margin-top: 14px; font-size: 12px; }
.download-release p { white-space: pre-line; color: var(--muted); }
.console-grid { grid-template-columns: 320px minmax(0,1fr); gap: 24px; border: 0; border-radius: 0; background: transparent; overflow: visible; min-height: 0; }
.console-overview { min-width: 0; }
.job-list { border: 0; overflow: visible; max-height: none; }
.section-label { padding: 0 0 14px; border: 0; color: var(--ink); font-weight: 600; font-size: 12px; align-items: center; }
.section-label > span { color: var(--muted); font-size: 10px; font-weight: 400; }
.task-filters { display: flex; gap: 8px; margin: 0 0 12px; }
.task-search { position: relative; flex: 1; margin: 0; }
.task-search > svg { position: absolute; top: 10px; left: 10px; width: 14px; height: 14px; color: var(--muted); }
.task-search input { padding: 7px 10px 7px 32px; min-height: 34px; font-size: 11px; }
.task-filters select { width: 116px; min-height: 34px; font-size: 11px; padding: 7px; }
.task-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.task-table th { padding: 10px 12px; font-size: 10px; font-weight: 400; color: var(--muted); background: var(--code); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; }
.task-table th:first-child { width: 72%; }
.task-table th:nth-child(2) { width: 28%; }
.task-table th:nth-child(3) { width: 27%; }
.task-table th:nth-child(4) { width: 18%; }
.task-table .task-row { display: table-row; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; }
.task-row td { border-bottom: 1px solid var(--line); padding: 12px; overflow-wrap: anywhere; }
.task-row.active td { background: var(--soft); }
.task-row td:first-child { border-left: 2px solid transparent; }
.task-row.active td:first-child { border-left-color: var(--accent); }
.task-row:hover td { background: var(--code); }
.task-row.active:hover td { background: var(--soft); }
.task-select { width: 100%; display: flex; justify-content: flex-start; text-align: left; background: transparent; border: 0; padding: 0; min-height: 30px; font-size: 12px; }
.task-select:hover { background: transparent; }
.task-row small { font-size: 10px; font-weight: 400; }
.task-device, .task-project { font-size: 10px; color: var(--muted); }
.device-inventory { margin-top: 28px; }
.device-inventory > h2 { margin: 0; }
.agents { display: block; margin: 0; }
.agent { display: grid; grid-template-columns: minmax(0,1fr) 52px 28px; align-items: center; gap: 8px; background: transparent; padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.agent-identity { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.agent-identity > svg { width: 15px; height: 15px; color: var(--muted); margin-top: 3px; }
.agent-identity strong { font-size: 12px; overflow-wrap: anywhere; }
.agent-identity p { font-size: 10px; color: var(--muted); }
.agent-capacity { display: none; text-align: center; font-variant-numeric: tabular-nums; }
.agent-capacity strong { font-size: 12px; }
.agent-capacity small { display: block; color: var(--muted); font-size: 9px; }
.agent .icon-button { width: 30px; height: 30px; min-height: 30px; border: 0; background: transparent; }
.badge { font-size: 10px; border: 0; border-radius: 4px; padding: 3px 7px; display: inline-flex; align-items: center; justify-content: center; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.dot.online { background: var(--success); }
.task-workspace { border-left: 1px solid var(--line); padding-left: 22px; min-width: 0; }
.task-heading { padding: 0 0 16px; border-bottom: 0; align-items: flex-start; flex-direction: column; min-height: 0; }
.task-heading strong { font-size: 15px; }
.task-heading p { font-size: 11px; }
.task-heading .toolbar { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
.task-heading .toolbar > .badge { margin-right: auto; }
.task-heading .toolbar button { font-size: 11px; min-height: 30px; }
.task-heading .inline-help { font-size: 11px; margin-bottom: 0; }
.tabs { padding: 0; gap: 17px; }
.tabs button { font-size: 11px; min-width: 0; padding: 10px 0; }
.task-output { padding: 18px 0; flex: none; height: max(440px, calc(100dvh - 385px)); min-height: 440px; max-height: none; }
.task-inspection { display: flex; justify-content: flex-end; padding-top: 12px; }
.task-inspection select { width: min(100%, 280px); font-size: 12px; }
.task-output pre, .message p { font-size: 14px; }
.message p { line-height: 1.75; }
.conversation-filter { margin-bottom: 12px; }
.conversation-turn { padding-bottom: 20px; }
.turn-label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); padding-top: 16px; }
.local-history-label { font-size: 12px; color: var(--muted); padding-bottom: 12px; }
:root[data-chat-expanded="true"] .console-grid { grid-template-columns: minmax(0,1fr); }
:root[data-chat-expanded="true"] .console-overview { display: none; }
:root[data-chat-expanded="true"] .task-workspace { border: 0; padding: 0; }
:root[data-chat-expanded="true"] #console-summary { display: none; }
:root[data-chat-expanded="true"] .task-output { height: max(480px, calc(100dvh - 310px)); }
.message.user p { color: var(--ink); }
.message { padding: 16px 0; }
.composer { padding: 12px 0; gap: 8px; }
.composer textarea { font-size: 14px; min-height: 96px; max-height: 260px; }
.composer button { min-width: 54px; font-size: 11px; }
.approvals { padding: 0 0 16px; }
.approval { padding: 12px; }
.approval .toolbar { gap: 7px; }
.approval label { font-size: 12px; }
.approval .command-help { font-size: 11px; }
.filterbar label { width: 240px; }
.data-row { gap: 14px; padding: 16px 0; }
.data-row > svg { color: var(--muted); }
.data-row button, .settings-line button { font-size: 12px; }
.settings-line { padding: 18px 0; }
.settings-line h2 { font-size: 15px; }
.account-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 48px; max-width: 1120px; }
.account-password { max-width: none; border-top: 1px solid var(--line); padding-top: 22px; }
.account-password h2 { margin: 0 0 20px; font-size: 15px; }
.account-details .settings-line { align-items: flex-start; border-top: 1px solid var(--line); }
.appearance-form { margin-top: 30px; }
.appearance-form h2 { font-size: 15px; margin: 0 0 20px; }
.appearance-form fieldset { padding: 0; border: 0; margin: 0 0 20px; min-width: 0; }
.appearance-form legend { padding: 0; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.palette-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.color-choice, .theme-choice { position: relative; margin: 0; cursor: pointer; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; color: var(--muted); }
.color-choice input, .theme-choice input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.color-choice:has(input:checked), .theme-choice:has(input:checked) { border-color: var(--accent); color: var(--ink); background: var(--soft); }
.color-choice:has(input:focus-visible), .theme-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.color-choice:has(input:disabled), .theme-choice:has(input:disabled) { opacity: .6; cursor: wait; }
.color-choice:hover, .theme-choice:hover { border-color: var(--accent); }
.color-swatch { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: white; flex-shrink: 0; }
.color-swatch svg { width: 12px; height: 12px; stroke-width: 2.4; visibility: hidden; }
.color-choice:has(input:checked) .color-swatch svg { visibility: visible; }
.color-choice[data-color="blue"] .color-swatch { background: #2459c9; }
.color-choice[data-color="teal"] .color-swatch { background: #0b7779; }
.color-choice[data-color="green"] .color-swatch { background: #1b754c; }
.color-choice[data-color="rose"] .color-swatch { background: #ad304c; }
.color-choice[data-color="graphite"] .color-swatch { background: #424850; }
.color-choice[data-color="amber"] .color-swatch { background: #aa4b17; }
.theme-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.theme-choice svg { width: 15px; height: 15px; }
.appearance-status { font-size: 11px; min-height: 18px; margin: 0; }
.account-user .grow { min-width: 200px; }
.account-user strong { font-size: 13px; }
.auth-links { flex-wrap: wrap; }
.mail-settings { border-bottom: 1px solid var(--line); padding: 16px 0; margin-bottom: 16px; }
.mail-settings > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.mail-settings form { max-width: 860px; margin-top: 20px; }
.mail-settings .form-grid > label { min-width: 0; }
.login { background: var(--paper); }
.login-form .brand { font-size: 23px; gap: 10px; }
.login-form h1 { font-size: 24px; }
.login-form > .brand svg { width: 30px; height: 30px; }
.toast { box-shadow: 0 4px 20px #0002; }
@media (min-width:1600px) { .console-grid { grid-template-columns: 360px minmax(0,1fr); gap: 30px; } }
@media (max-width:1180px) {
  .console-grid { grid-template-columns: 280px minmax(0,1fr); gap: 20px; }
  .task-workspace { padding-left: 18px; }
  .task-project { display: none; }
  .task-table th:first-child { width: 72%; }
  .task-table th:nth-child(2) { width: 28%; }
  .task-table th:nth-child(3) { width: 31%; }
  .task-row td, .task-table th { padding: 10px 8px; }
  .agent { grid-template-columns: minmax(0,1fr) 52px 28px; gap: 8px; }
  .agent-capacity { display: none; }
}
@media (max-width:1000px) {
  .shell { grid-template-columns: 178px minmax(0,1fr); }
  .console-grid { grid-template-columns: 1fr; }
  .task-workspace { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .console-overview { display: contents; }
  .job-list { grid-row: 1; }
  .task-workspace { grid-row: 2; }
  .device-inventory { grid-row: 3; margin-top: 10px; }
  .account-layout { grid-template-columns: 1fr; gap: 30px; }
  .account-password { max-width: 460px; }
  .account-details { max-width: 560px; }
}
@media (max-width:700px) {
  .shell { display: block; }
  .sidebar { position: relative; padding: 12px 16px; gap: 0; }
  .sidebar .brand { font-size: 16px; }
  .sidebar-brand { min-height: 36px; }
  #nav-toggle { display: inline-flex; border: 0; background: transparent; }
  .workspace-label { display: none; }
  .sidebar-footer { position: absolute; top: 12px; right: 58px; border: 0; padding: 0; }
  .sidebar nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; gap: 8px; padding-top: 14px; }
  :root[data-nav-open="false"] .sidebar nav { display: none; }
  .nav-section-label { display: none; }
  .sidebar nav button { font-size: 12px; min-height: 44px; padding: 10px; }
  .topbar { height: 48px; padding: 0 16px; font-size: 11px; }
  .topbar .toolbar { gap: 5px; }
  #username { max-width: 120px; font-size: 10px; }
  .page-head { padding: 22px 16px 18px; gap: 12px; }
  .page-head button { font-size: 12px; min-height: 40px; }
  .compact-summary { margin: 0 16px 20px; gap: 12px 20px; padding: 13px 0; }
  .compact-summary strong { font-size: 18px; }
  .compact-summary div { gap: 5px; }
  .view { margin: 0 16px 24px; }
  .console-grid { display: flex; flex-direction: column; min-height: 0; gap: 22px; }
  .job-list { order: 0; max-height: 280px; overflow-y: auto; }
  .task-workspace { order: 1; padding: 22px 0 0; }
  .device-inventory { order: 2; margin-top: 10px; }
  .section-label { padding-bottom: 12px; }
  .task-search input { font-size: 16px; min-height: 44px; }
  .task-search > svg { top: 15px; }
  .task-filters select { font-size: 13px; min-height: 44px; width: 108px; }
  .task-device, .task-project { display: none; }
  .task-table th:first-child { width: 70%; }
  .task-table th:nth-child(2) { width: 30%; }
  .task-select { font-size: 13px; min-height: 44px; }
  .task-row small { font-size: 10px; }
  .task-row td { padding: 12px 8px; }
  .task-heading strong { font-size: 16px; }
  .task-heading .toolbar button { min-height: 40px; font-size: 12px; }
  .tabs button { font-size: 12px; min-height: 44px; }
  .task-output { padding: 20px 0; height: 65dvh; min-height: 420px; max-height: none; }
  .message p { font-size: 16px; }
  .composer { padding: 12px 0; }
  .composer textarea { font-size: 16px; }
  .composer button { min-height: 44px; font-size: 12px; }
  .agents { display: block; margin: 0; overflow: visible; }
  .agent { padding: 15px 0; grid-template-columns: minmax(0,1fr) 56px 36px; gap: 8px; }
  .agent-identity strong { font-size: 13px; }
  .agent .icon-button { width: 36px; height: 44px; }
  .filterbar { flex-wrap: wrap; align-items: center; }
  .filterbar label { width: 100%; }
  input, textarea, select { font-size: 16px; min-height: 44px; }
  button { min-height: 40px; }
  .data-row button, .settings-line button { min-height: 44px; }
  .palette-choices { gap: 8px; }
  .color-choice, .theme-choice { min-height: 44px; font-size: 12px; }
  .theme-choices { gap: 6px; }
  .theme-choice { gap: 5px; }
  .color-choice input, .theme-choice input { min-height: 0; }
  .account-user .grow { min-width: min(240px,100%); }
  .account-user .toolbar { width: 100%; }
  .account-layout { display: grid; gap: 30px; }
  .login-form .brand { margin-bottom: 40px; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
 .local-device-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0 24px 12px; color: var(--muted); font-size: 13px; }
 .local-device-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
 .local-device-identity > span { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
 .local-device-identity svg { flex-shrink: 0; }
 .local-device-bar > button, .local-device-identity > button { flex-shrink: 0; }
 .device-name-heading { display: flex; align-items: center; gap: 8px; }
 .device-name-heading h2 { overflow-wrap: anywhere; }
 .device-name-heading .icon-button { flex-shrink: 0; width: 30px; height: 30px; }
 .detected-profiles > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
 .detected-profiles .device-path { width: 100%; font-size: 12px; }
 .remote-file-row { display: flex; align-items: center; width: 100%; gap: 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; padding: 9px; }
 .remote-file-row span { flex: 1; overflow-wrap: anywhere; min-width: 0; }
 .remote-file-row small { flex-shrink: 0; color: var(--muted); }
 #remote-file-list { max-height: 340px; overflow: auto; margin: 12px 0; }
 #remote-content { font-family: monospace; font-size: 13px; }
 #remote-terminal-output { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow: auto; }
 @media (max-width: 600px) { .local-device-bar { align-items: flex-start; flex-direction: column; margin-left: 16px; margin-right: 16px; } }
/* Version information remains visible without competing with device status. */
.app-version { display: block; margin-top: 4px; font-size: 11px; }
.login-version { text-align: center; margin: 16px 0 0; font-size: 12px; }
