/* Theme-independent Fleet content. */
a { color:var(--amber-hi); text-decoration:none; }
button,input,textarea { font:inherit; }
button,summary,a { -webkit-tap-highlight-color:transparent; }
button:disabled { cursor:not-allowed; opacity:.48; }
button:not(.dock button):not(.iconbtn) { min-height:44px; padding:8px 12px; color:var(--amber-hi); background:#211b13; border:1px solid #50402b; border-radius:5px; }
h1 { font-size:.82rem; font-weight:500; margin:0; letter-spacing:.12em; }
h2 { font-size:.92rem; color:var(--amber); font-weight:500; margin:0 0 7px; }
p { line-height:1.5; }
pre { white-space:pre-wrap; overflow-wrap:anywhere; font: .72rem/1.5 var(--mono); }
#panel { padding:0; overflow:hidden; }
#stream { display:none; }
#fleet-view { overflow:hidden; }
#command-result { margin:0; padding:5px 10px; border-top:1px solid var(--rule); color:var(--phos); font-size:.65rem; min-height:25px; flex:none; }
.carrier { color:var(--amber-hi); font-size:1.4rem; text-shadow:0 0 9px var(--amber); }
#stale { color:var(--red); font-size:.64rem; }
#stale[hidden] { display:none; }
.iconbtn { min-width:44px; min-height:44px; font-size:1.5rem; }
.quota { color:var(--ink-soft); padding:12px; border:1px solid var(--rule); font-size:.72rem; }
.quota p { margin:4px 0; }
/* Fleet uses Spend's real-charge warning treatment (SPEND §5). */
#fleet-cards .quota .spend-danger { border:1px solid var(--red); border-left-width:4px; background:#291513; color:var(--ink); padding:12px; border-radius:6px; }
#fleet-cards .quota .spend-danger a { display:inline-flex; align-items:center; min-height:44px; text-decoration:underline; }
.cards { display:grid; gap:12px; margin-top:16px; }
.cards article { padding:16px 12px; border-left:2px solid var(--amber); background:#111814; }
.cards h2 a { display:inline-flex; align-items:center; min-height:44px; }
.meta { display:block; color:var(--ink-soft); font-size:.65rem; line-height:1.5; }
.last-line { font:.9rem/1.5 var(--text-face); overflow-wrap:anywhere; }
.agent-info { padding:8px 10px; border-bottom:1px solid var(--rule); display:flex; justify-content:space-between; align-items:start; gap:8px; font-size:.8rem; flex:none; }
.context { font-size:.62rem; max-width:55%; }
.context summary { min-height:44px; display:flex; align-items:center; gap:6px; cursor:pointer; }
.context-ring { display:block; flex:none; width:34px; height:34px; border-radius:50%; background:conic-gradient(from 225deg,var(--amber) var(--fill,0deg),#30352d 0 270deg,transparent 0); position:relative; }
.context-ring::before { content:''; position:absolute; inset:5px; border-radius:50%; background:var(--screen); }
.context-ring::after { content:''; position:absolute; width:2px; height:7px; top:0; left:16px; background:var(--red); transform-origin:1px 17px; transform:rotate(var(--hard,135deg)); }
#agent-messages { margin-top:auto; }
#agent-messages .bubble { white-space:pre-wrap; }
.revealing .truth { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
#agent-pinned:empty { display:none; }
.pinned { display:block; border-bottom:1px solid #574126; background:#241d12; padding:10px; min-height:44px; font-size:.75rem; }
.tool-card { margin:8px 0; border:1px solid var(--rule); background:#111714; }
summary { padding:8px; min-height:44px; cursor:pointer; }
.tool-card pre { padding:0 10px; }
.composer-modes { display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:3px 7px; border-top:1px solid var(--rule); font-size:.64rem; flex:none; }
.composer-modes span { flex-basis:100%; color:var(--ink-soft); font-size:.57rem; }
#slash-palette { font-size:.65rem; flex:none; max-height:130px; overflow:auto; }
#slash-palette summary { padding:10px; }
.composer textarea { min-width:0; min-height:44px; }
.composer button { width:auto; }
.approval { padding:4px 2px 12px; }
.counter { color:var(--amber); letter-spacing:.1em; font-size:.7rem; }
.approval-input { padding:10px; border:1px solid var(--rule); max-height:190px; overflow:auto; }
.approval-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.deny-note { display:block; color:var(--ink-soft); font-size:.66rem; }
.deny-note textarea,input { display:block; width:100%; min-height:44px; margin-top:5px; background:#0b100e; color:var(--ink); border:1px solid #394238; border-radius:4px; padding:8px; font-size:16px; }
.deny-note textarea { height:48px; resize:vertical; }
.approval-list a { display:block; min-height:44px; padding:12px 4px; border-top:1px solid var(--rule); font-size:.7rem; }
.answered { color:var(--phos); border:1px solid var(--rule); padding:12px; }
.suggestion { width:100%; }
fieldset { border:1px solid var(--rule); margin:10px 0; padding:10px; font-size:.75rem; }
.option { color:var(--ink-soft); font-size:.7rem; }
@media (min-width:900px) and (min-aspect-ratio:13/10) { .cards { grid-template-columns:repeat(2,minmax(0,1fr)); } #conversation { padding-inline:max(18px,calc((100% - 74ch)/2)); } }
/* Keep login usable with the shared content sheet. */
body:not(.themed) { margin:0; background:#0a0d0c; color:#ddd8cc; font:16px monospace; }
body:not(.themed) main { max-width:30rem; margin:10vh auto; padding:24px; }
/* Pinned requests remain reachable without consuming the conversation. */
#agent-pinned { flex:none; max-height:72px; overflow:auto; }

.context[open] { position:absolute; right:10px; top:58px; width:min(430px,calc(100% - 20px)); max-width:none; max-height:65%; overflow:auto; z-index:8; padding:10px; border:1px solid var(--rule); background:var(--screen); box-shadow:0 8px 20px #000a; }
.context[open] p { overflow-wrap:anywhere; }
.cycle-status button { margin:3px; }
.cycle-status label { display:block; margin-top:10px; }
.push-enable { min-width:44px; }


.queue-confirm { display:flex; gap:8px; align-items:center; padding:6px; font-size:.65rem; }
.queue-confirm input { width:24px; flex:none; }

#theme-choice { flex:none; font-size:.7rem; border-bottom:1px solid var(--rule); }
#theme-choice[open] { position:absolute; z-index:9; top:48px; left:10px; width:min(380px,calc(100% - 20px)); padding:8px; background:var(--screen); border:1px solid var(--amber); box-shadow:0 8px 20px #000a; }
#theme-choice button { margin:4px; }
.theme-open { display:block; min-height:44px; padding:12px 8px; }
/* Files, session history and owner settings use the same content surface. */
.surface { width:100%; min-height:0; padding:14px; overflow:auto; font-size:.8rem; }
.surface h2 { margin-top:16px; }
.surface h3 { font-size:.85rem; overflow-wrap:anywhere; }
.surface form { display:flex; flex-wrap:wrap; align-items:end; gap:8px; }
.surface form label { flex:1; min-width:120px; }
.surface label { display:block; margin-block:8px; }
.surface input,.surface textarea,.surface select { min-height:44px; max-width:100%; width:100%; padding:8px; font-size:16px; background:var(--screen); color:var(--ink); border:1px solid var(--ink-soft); }
.surface textarea { min-height:70px; }
.surface-tabs { display:flex; gap:14px; }
.surface a { display:inline-flex; align-items:center; min-height:44px; }
.surface p,.surface .identity { overflow-wrap:anywhere; }
.file-list { padding:0; list-style:none; }
.file-list li { border-bottom:1px solid var(--rule); min-height:44px; }
.file-list a,.file-list span { padding:8px 0; }
.file-lines { border:1px solid var(--rule); overflow:auto; margin-block:12px; }
.file-line { display:flex; gap:12px; min-height:22px; }
.file-line code { white-space:pre-wrap; overflow-wrap:anywhere; min-width:0; }
.line-number { width:32px; flex:none; text-align:right; color:var(--ink-soft); }
.surface article { padding-block:12px; border-bottom:1px solid var(--rule); }
.surface-dialog { position:absolute; z-index:10; inset:15% 8px auto; max-height:65%; overflow:auto; padding:16px; background:var(--screen); border:1px solid var(--amber); box-shadow:0 8px 30px #000; }
.surface .push-class { display:flex; gap:12px; align-items:center; min-height:44px; }
.surface .push-class input { width:26px; flex:none; }
.refused,.link-refused { color:var(--amber); padding:14px; border:1px solid var(--rule); }

/* Spend uses the active theme palette and keeps quota distinct from history. */
.spend{padding:16px}.spend h2{margin-top:24px}.spend article{padding:14px;margin:10px 0;border:1px solid var(--edge,#53606a);border-radius:12px}.spend progress{display:block;width:100%;height:14px}.quota-value{font-size:1.7rem}.quota-gauge[data-status="unavailable"]{opacity:.65}.spend-split{display:flex;height:12px;border-radius:6px;overflow:hidden;background:#5554}.split-input{background:#8dbbff}.split-read{background:#73d8b0}.split-write{background:#d7b779}.split-output{background:#c89ef1}.spend-tabs{display:flex;gap:14px}.spend .meta{font-size:.78rem;overflow-wrap:anywhere}.spend-session p{overflow-wrap:anywhere}.projection{color:#c78d26}.spend textarea{width:100%}

/* Approval forms share the active theme and keep labels above touch controls. */
#approvals-view .approval-field { display:block; margin-block:12px; font-size:.8rem; }
#approvals-view .approval-field textarea,
#approvals-view .approval-field select { display:block; width:100%; min-height:44px; margin-top:6px; padding:10px; border:1px solid var(--ink-soft); border-radius:4px; background:var(--screen); color:var(--ink); font:16px var(--mono); }
#approvals-view .approval-field textarea { min-height:80px; resize:vertical; }
#approvals-view .approval > a { display:inline-flex; align-items:center; min-height:44px; overflow-wrap:anywhere; }

/* The preview has a persistent cue; native disclosure exposes every line. */
#approvals-view .approval-input { overflow-y:scroll; scrollbar-gutter:stable; scrollbar-color:var(--ink-soft) var(--screen-lit); }
#approvals-view .approval-payload summary { min-height:44px; color:var(--amber-hi); font-size:.8rem; }
#approvals-view .approval-full-input { padding:10px; border:1px solid var(--rule); }
#approvals-view .approval-payload:has(details[open]) > .approval-input,
#approvals-view .approval-payload .payload-collapse,
#approvals-view .approval-payload details[open] .payload-expand { display:none; }
#approvals-view .approval-payload details[open] .payload-collapse { display:inline; }
#approvals-view .approval-actions button { max-width:100%; overflow-wrap:anywhere; }
#approvals-view .approval-actions .allow,
#approvals-view .approval-actions [data-decision="accept"] { background:var(--amber-hi); border-color:var(--amber-hi); color:var(--screen); font-weight:700; }

/* Question presets edit the same draft that the signed Answer action sends. */
#approvals-view .question-form .option { display:flex; flex-direction:column; align-items:start; gap:4px; width:100%; min-height:44px; margin-block:8px; text-align:left; white-space:normal; overflow-wrap:anywhere; background:var(--screen-lit); border-color:var(--ink-soft); color:var(--ink); font:inherit; }
#approvals-view .question-form .option span { color:var(--ink-soft); }
#approvals-view .question-form .option[aria-pressed="true"] { border-color:var(--amber-hi); box-shadow:inset 4px 0 var(--amber-hi); }
#approvals-view :is(button,textarea,select,input,summary,pre):focus-visible { outline:2px solid var(--amber-hi); outline-offset:2px; }
/* F11: one connection state; retain server values as explicitly stale history. */
#connection-state {min-width:0;font-size:.72rem;line-height:1.4;}
#connection-state .sig {font-size:inherit;}
#connection-state #stale {font-size:inherit;font-weight:600;}
#connection-state:has(#stale:not([hidden])) .sig {display:none;}
#terminal-link-state {display:none;color:var(--red);font-weight:600;}
#app:has(#stale:not([hidden])) #agent-info .meta::before,
#app:has(#stale:not([hidden])) #terminal-info .meta::before,
#app:has(#stale:not([hidden])) #fleet-cards .cards .meta::before {content:'Stale · last known: ';color:var(--amber-hi);}
#app:has(#stale:not([hidden])) #agent-info .context {color:var(--ink-soft);}
#app:has(#stale:not([hidden])) #agent-info .context-ring {filter:grayscale(1);opacity:.55;}
#app:has(#stale:not([hidden])) #command-result {color:var(--amber-hi);}
#app:has(#stale:not([hidden])) #command-result::before {content:'Stale · last confirmation: ';}
@media (max-width:760px), (max-height:620px) {
 body[data-theme="sekretar-glass"] .screen:has(#connection-state) {
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto auto auto minmax(0,1fr);
  grid-template-areas:"top" "appbar" "search" "hk" "main";
 }
 body[data-theme="sekretar-glass"] .topbar:has(#connection-state) {max-width:none;min-width:0;padding:4px 8px;justify-content:space-between;}
}
#app:has(#stale:not([hidden])) #agent-info .context summary::after {content:' · stale';color:var(--amber-hi);}

/* Cycle details stay inside the Agent pane, below the shell header. */
#fleet-view:has(> #agent-info) { position:relative; }
#agent-info .context[open] { top:8px; max-height:calc(100% - 16px); }
#agent-info .context-close { position:sticky; top:0; display:block; margin-left:auto; min-width:64px; z-index:1; }
#agent-info .cycle-entry { border-top:1px solid var(--rule); }

/* Real charges and active runaway flags have the same urgency in every theme. */
#spend-view .spend-danger { border:1px solid var(--red); border-left-width:4px; background:#291513; color:var(--ink); padding:12px; border-radius:6px; }
#spend-view .spend-danger h3 { margin:0 0 8px; font-weight:700; }
#spend-view .spend-urgent { position:sticky; top:0; z-index:2; max-height:50%; overflow:auto; background:var(--screen); }
#spend-view .spend-urgent:empty { display:none; }
#spend-view .spend-urgent .spend-flag { margin-top:0; }

/* F12: scoped session paths and credential confirmation. */
#sessions-view select { font-family:inherit; }
#sessions-view #session-directory-path { overflow-wrap:anywhere; white-space:normal; font-family:inherit; }
#settings-view .revoke-dialog { margin-top:12px; padding:12px; border:1px solid var(--red); background:var(--screen); }
#settings-view .revoke-dialog h2 { margin-top:0; }
#settings-view .revoke-actions { display:flex; flex-wrap:wrap; gap:12px; }
#settings-view .revoke-actions .confirm-revoke { color:#fff; background:#8c2929; border-color:var(--red); }

/* URL selection controls presentation only; the server still pins the card. */
#approvals-view.approval-inbox { display:flex; flex-direction:column; }
#approvals-view.approval-inbox > :is(article,nav,p) { flex:none; }
#approvals-view.approval-inbox > .approval-list { order:-1; }
/* Keep the 44px hit floor after the glass viewport's fractional coordinates. */
#settings-view button { min-height:45px; min-width:45px; }
/* G5: Codex answers are labelled controls that fill the same signed draft. */
#approvals-view .codex-message { font-size:.85rem; overflow-wrap:anywhere; }
#approvals-view .codex-form { margin:12px 0; padding:10px; font-size:.8rem; color-scheme:dark; }
#approvals-view .codex-form legend { padding:0 4px; color:var(--amber); }
#approvals-view .codex-choice { display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 0; overflow-wrap:anywhere; cursor:pointer; }
#approvals-view .codex-choice input { flex:none; width:24px; height:24px; min-height:0; margin:0; accent-color:var(--amber-hi); }
#approvals-view .approval-field input { display:block; width:100%; min-height:44px; margin-top:6px; padding:10px; border:1px solid var(--ink-soft); border-radius:4px; background:var(--screen); color:var(--ink); font:16px var(--mono); }
#approvals-view .codex-form .required { color:var(--amber-hi); }
#approvals-view .codex-form .approval-field + .meta { margin-top:-6px; }
#approvals-view .codex-expert summary { min-height:44px; color:var(--amber-hi); font-size:.8rem; }
/* The raw housekeeping code is secondary evidence inside an expanded row. */
#agent-info .cycle-code { color:var(--ink-soft); font-family:var(--mono); }

/* Each token mix is readable without distinguishing the segment colours. */
#spend-view .spend-split > span { box-shadow:inset -2px 0 0 #172126; }
#spend-view .spend-split-values { margin-block:8px; font-size:.875rem; line-height:1.5; overflow-wrap:anywhere; }

/* G10: the terminal directory belongs to Fleet's shared content sheet. */
#terminal-cards {margin-top:20px;font-size:.8rem;}
#terminal-cards article {padding:8px 12px;border:1px solid var(--rule);margin:8px 0;}
#terminal-cards a {display:flex;min-width:44px;min-height:44px;align-items:center;}

/* Keep the existing eight keys and two phone rows, with readable legends. */
body[data-theme="sekretar-glass"] .dock button { font-size:clamp(12px,11cqh,14px); letter-spacing:0; }
/* Larger legends cross brighter keycap pixels; retain the 4.5:1 ink floor. */
body[data-theme="sekretar-glass"] .dock button:not(:disabled):not(.on) { color:#d5dbe0; }

/* Current tabs have a non-colour cue and a full touch target. */
#spend-view .spend-tabs a,
#files-view .surface-tabs a { min-width:44px; min-height:44px; justify-content:center; padding-inline:6px; border-bottom:3px solid transparent; }
#spend-view .spend-tabs a[aria-current="true"],
#files-view .surface-tabs a[aria-current="page"] { border-bottom-color:var(--amber-hi); color:var(--ink); }
#fleet-cards .cards h2 a { min-width:44px; }

/* G6 (P13): the strip now holds at most the held note and one request row, so
   it fits them instead of cutting a row off at a fixed height. */
#agent-pinned { max-height:none; }

/* G9 (P16): the notifications control is a bell with a visible label. Its
   status is out of flow while empty and takes its own place in the header
   when an enable failure is reported. */
.topbar .push-enable { display:inline-flex; align-items:center; justify-content:center; gap:6px; flex:none; white-space:nowrap; }
.topbar .push-bell { flex:none; width:20px; height:20px; }
.topbar .push-label { font-size:.7rem; letter-spacing:.04em; }
.topbar .push-status { flex:0 1 auto; min-width:0; max-width:7em; color:var(--amber-hi); font-size:.6rem; line-height:1.3; }
.topbar .push-status:empty { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
/* Glass phones spread the bar; keep the control and its status together at the end. */
@media (max-width:760px), (max-height:620px) { body[data-theme="sekretar-glass"] .topbar .push-enable { margin-left:auto; } }
