/* xcode Cloud remote console: the page looks like the xcode CLI: black, see-through panels, blue sweep.
   The palette and the type come from the CLI theme (packages/tui/src/theme/assets/v2/minimal.json);
   every rule is scoped to .remote-page so the /history page keeps its own look. */

.remote-page {
  --bg: #000000;
  /* Dialogs sit on top of live text: near-black, not see-through, or the chat shows through. */
  --sheet: #06080b;
  --panel: rgba(255, 255, 255, 0.025);
  --card: rgba(255, 255, 255, 0.045);
  --hover: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #e4e4e4;
  --ink-2: #c9c9c9;
  --muted: #8a8a8a;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --sweep: linear-gradient(90deg, #38bdf8, #3b82f6 40%, #6366f1 75%, #22d3ee);
  --accent-soft: rgba(56, 189, 248, 0.08);
  --accent-line: rgba(56, 189, 248, 0.45);
  --accent-fill: rgba(56, 189, 248, 0.1);
  --accent-on: #000000;
  --danger: #ef8f8f;
  --ok: #6fcf8a;
  --radius: 10px;
  --radius-sm: 6px;
  --sans: "JetBrains Mono", ui-monospace, monospace;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
}

.remote-page h1,
.remote-page h2,
.remote-page .signin-copy h1 {
  letter-spacing: 0;
  font-family: var(--mono);
}
.remote-page .who { min-width: 0; }

/* ---- top bar ---------------------------------------------------------- */
.remote-page .bar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  height: 44px;
  padding: 0 12px;
}
.remote-page .brand { font-weight: 600; font-size: 13px; gap: 8px; }
.remote-page .brand img { width: 16px; height: 16px; }
.remote-page .crumb { color: var(--muted); border-left-color: var(--line); padding-left: 8px; }
.remote-page .who { font-family: var(--mono); font-size: 12px; }

/* ---- buttons: flat, no shadow ----------------------------------------- */
.remote-page .btn {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink);
  font: 500 12px/1 var(--mono);
  letter-spacing: 0;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.remote-page .btn:hover { background: var(--hover); }
.remote-page .btn:active { transform: none; }
.remote-page .btn.primary {
  background: var(--accent-fill);
  border-color: var(--accent-line);
  color: var(--accent);
  height: 30px;
  padding: 0 12px;
}
.remote-page .btn.primary:hover { background: rgba(56, 189, 248, 0.18); border-color: var(--accent); }
.remote-page .btn.ghost { background: transparent; }
.remote-page .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.remote-page :focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; border-radius: var(--radius-sm); }

/* ---- app frame: chat rail | transcript | status line ------------------ */
.remote-page main { min-height: 0; }
.remote-app {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.remote-app .list {
  grid-column: 1;
  grid-row: 1;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.remote-app .reader {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}
.remote-app .status-line {
  grid-column: 1 / -1;
  grid-row: 2;
}

/* ---- the chat rail ---------------------------------------------------- */
.remote-app .list-head {
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}
.remote-app #search {
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  padding: 0 8px;
  font: 12px var(--mono);
}
.remote-page #search::placeholder { color: var(--muted); }
.remote-app #count { font: 11px/1.4 var(--mono); color: var(--muted); margin: 0; }
.remote-app .computer-status {
  margin: 0;
  font: 11px/1.4 var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remote-app .computer-status.is-online { color: var(--ok); }
.remote-app .computer-status.is-offline { color: var(--danger); }
.remote-app .new-chat { margin: 8px 12px; height: 30px; }
.remote-app #sessions {
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.remote-app #sessions .item {
  position: relative;
  display: grid;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.remote-app #sessions .item:hover { background: var(--hover); }
.remote-app #sessions .item.active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.remote-app #sessions .item.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(#38bdf8, #6366f1); }
.remote-app #sessions .item .t {
  font: 500 12.5px/1.4 var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remote-app #sessions .item .m {
  font: 11px/1.4 var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remote-app #sessions .chat-row { position: relative; }
.remote-app #sessions .item.has-pin { padding-right: 34px; }
.remote-app #sessions .pin-tip {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 15px/1 var(--mono);
  cursor: pointer;
}
.remote-app #sessions .pin-tip:hover { background: var(--hover); color: var(--ink); }
.remote-app #sessions .pin-tip.on { color: var(--accent); }
.remote-app #sessions .pin-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.remote-app #sessions .item.muted .t { color: var(--muted); }
.remote-app #sessions .item[aria-disabled="true"] { cursor: default; }
.remote-app #sessions .item .m .run { color: var(--accent); }
.remote-app #listError { padding: 0 12px 14px; margin: 0; }
.remote-app .empty { padding: 18px 12px; display: grid; gap: 6px; color: var(--muted); }
.remote-app .empty h2 { font-size: 13px; color: var(--ink); }
.remote-app .empty p { font-size: 12px; }

/* ---- the chat view: title and actions above a terminal window ---------- */
.remote-app .reader-empty { height: 100%; display: grid; place-items: center; padding: 24px; }
.remote-app .reader-empty p { font-size: 12px; }
.remote-app .chat-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px 16px;
  max-width: 1100px;
  margin: 0 auto;
}
.remote-app .chat-view[hidden] { display: none; }
.remote-app .back {
  display: none;
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 13px/1.4 var(--ui);
  cursor: pointer;
}
.remote-app .back:hover { color: var(--ink); }
.remote-app .chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  flex: none;
  position: static;
  padding: 0;
  background: none;
  backdrop-filter: none;
  border: 0;
}
.remote-app .chat-title { flex: 1 1 240px; min-width: 0; display: grid; gap: 4px; }
.remote-app .chat-title h1 {
  font: 650 20px/1.3 var(--ui);
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.remote-app .chat-title p { font: 12px/1.5 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the actions (model / agent / commands / stop / compact) as pills --- */
.remote-app .chat-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.remote-app .chat-tools .btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border-color: var(--line-2);
  font: 600 12.5px/1 var(--ui);
}
.remote-app .chat-tools .btn:hover { border-color: #4a4a4a; }
.remote-app .chat-tools .model-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  text-align: left;
}
.remote-app .model-btn .pick-label { flex: none; font: 500 12px/1 var(--ui); color: var(--muted); }
.remote-app .model-btn .pick-value {
  min-width: 0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 12.5px var(--ui);
  color: var(--ink);
}
.remote-app .model-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---- the terminal window ------------------------------------------------ */
.remote-app .term {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.remote-app .term-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  padding: 0 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font: 12px/1 var(--mono);
  color: var(--muted);
}
.remote-app .term-dots { display: inline-flex; gap: 6px; flex: none; }
.remote-app .term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a3a; }
.remote-app .term-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-app .term-live { flex: none; }
.remote-app .term-live.is-online { color: var(--ok); }
.remote-app .term-live.is-running { color: var(--accent); }
.remote-app .term-live.is-offline { color: var(--danger); }
.remote-app .term-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 22px;
}
.remote-app .term-body .messages { padding: 0; max-width: none; margin: 0; }
.remote-app .term-body .turn-empty { text-align: center; padding-top: 48px; font: 13px/1.5 var(--mono); }
.remote-app .turn-user .user-body { border-left-color: var(--accent-line); background: var(--card); }
.remote-app .term-body .turn:first-child { margin-top: 0; }
.remote-app .term-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font: 12px/1.4 var(--mono);
  color: var(--muted);
}
.remote-app .term-conn,
.remote-app .term-model { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remote-app .term-conn.is-online { color: var(--ok); }
.remote-app .term-conn.is-offline { color: var(--danger); }

/* ---- permission prompts and questions --------------------------------- */
.remote-app .pending { margin: 0 0 16px; display: grid; gap: 8px; }
.remote-app .pending[hidden] { display: none; }
.remote-app .prompt-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--card);
  padding: 12px;
}
.remote-app .prompt-title { margin: 0; font: 500 12.5px/1.4 var(--mono); }
.remote-app .prompt-res {
  margin: 0;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: 11.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.remote-app .prompt-field { display: grid; gap: 5px; font: 12px/1.4 var(--mono); }
.remote-app .prompt-label { font-weight: 600; }
.remote-app .prompt-card input[type="text"],
.remote-app .prompt-card input[type="number"],
.remote-app .prompt-card select,
.remote-app .prompt-card textarea {
  width: 100%;
  min-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font: 12px var(--mono);
  padding: 5px 8px;
}
.remote-app .prompt-options { display: grid; gap: 6px; }
.remote-app .prompt-option { display: flex; align-items: center; gap: 8px; }
.remote-app .prompt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.remote-app .btn.small { height: 28px; padding: 0 9px; font-size: 11.5px; }

/* ---- the composer: the prompt line of the terminal ---------------------- */
.remote-app .composer {
  flex: none;
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.remote-app .composer-row { display: flex; align-items: center; gap: 10px; }
.remote-app .prompt-mark { flex: none; font: 700 14px/1 var(--mono); background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; }
.remote-app .composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 30vh;
  field-sizing: content;
  resize: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 3px 0;
  font: 13px/1.5 var(--mono);
}
.remote-app .composer textarea::placeholder { color: #6f6f6f; }
.remote-app .composer textarea:focus-visible { outline: none; }
.remote-app .composer-row .btn { flex: none; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 12px; }
.remote-app .composer-row .file { cursor: pointer; display: inline-flex; align-items: center; }
.remote-app .composer input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
}
.remote-app .composer-row:has(input[type="file"]:focus-visible) .file { outline: 1px solid var(--accent); outline-offset: 1px; }
.remote-app .composer-row .btn.primary { border: 1px solid transparent; background: linear-gradient(#000, #000) padding-box, var(--sweep) border-box; color: var(--accent); }
.remote-app .composer-row .btn.primary:hover { background: linear-gradient(rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0.12)) padding-box, var(--sweep) border-box; }
.remote-app .composer-row .btn.danger { border: 1px solid var(--danger); background: transparent; color: var(--danger); }
.remote-app .composer-row .btn.danger:hover { background: rgba(239, 143, 143, 0.12); }
.remote-app .composer-row .btn.danger[hidden] { display: none; }
.remote-app .composer-row .btn.primary[disabled] { opacity: 0.5; cursor: not-allowed; }
.remote-app .term:has(.composer textarea:focus-visible) { border-color: #4a4a4a; }
.remote-app .composer p[role="status"] { margin: 0; min-height: 16px; color: var(--muted); font-size: 11.5px; }
.remote-app .composer p[role="status"]:empty { display: none; }

/* ---- photo tray: small thumbnails only, × on the corner ---------------- */
.remote-app .photo-tray { display: flex; align-items: center; gap: 10px; min-width: 0; }
.remote-app .photo-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.remote-app .photo-item { position: relative; flex: none; }
.remote-app .photo-thumb,
.remote-app .photo-thumb-fallback {
  width: 44px;
  height: 44px;
  display: block;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--card);
  object-fit: cover;
}
.remote-app .photo-meta { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.remote-app .photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: #000;
  color: var(--ink);
  font: 10px/1 var(--mono);
  cursor: pointer;
  opacity: 0.85;
}
.remote-app .photo-remove:hover { opacity: 1; border-color: var(--accent); color: var(--accent); }
.remote-app #clearPhotos { height: auto; padding: 0; border: 0; background: none; color: var(--muted); font-size: 11.5px; }
.remote-app #clearPhotos:hover { color: var(--ink); }
.remote-app .term.is-dropping { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }

/* ---- the status line: the CLI footer ---------------------------------- */
.remote-app .status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font: 11px/1.4 var(--mono);
  overflow-x: auto;
  white-space: nowrap;
}
.remote-app .status-line .status-part { display: inline-flex; gap: 6px; align-items: center; }
.remote-app .status-line .status-key { color: var(--muted); }
.remote-app .status-line .status-value { color: var(--ink-2); }
.remote-app .status-line .status-value.is-online { color: var(--ok); }
.remote-app .status-line .status-value.is-offline { color: var(--danger); }
.remote-app .status-line .status-message { color: var(--ink-2); }

/* ---- the work line: the AI is working, for how long ---- */
.remote-app .work-bar { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-top: 1px solid var(--line); font: 12px/1.4 var(--mono); }
.remote-app .work-bar[hidden] { display: none; }
.remote-app .work-spin { flex: none; width: 1.2ch; text-align: center; font-weight: 700; background: var(--sweep); -webkit-background-clip: text; background-clip: text; color: transparent; }
.remote-app .work-label { background: var(--sweep); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; animation: work-sweep 2.4s linear infinite; }
.remote-app .work-time { color: var(--muted); margin-left: auto; white-space: nowrap; }
@keyframes work-sweep { to { background-position: -200% 0; } }

/* ---- the usage bar: cached / context / model, live like the CLI footer ---- */
.remote-app .usage-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 12px;
  border-top: 1px solid var(--line);
  font: 11px/1.4 var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow-x: auto;
}
.remote-app .usage-bar[hidden] { display: none; }
.remote-app .usage-gauge { display: inline-flex; align-items: center; gap: 6px; }
.remote-app .usage-track { display: inline-block; width: 48px; height: 3px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.remote-app .usage-fill { display: block; height: 100%; background: var(--accent); transition: width 0.4s ease; }
.remote-app .usage-fill.is-warm { background: #e5c07b; }
.remote-app .usage-fill.is-hot { background: var(--danger); }
.remote-app .usage-text { color: var(--ink-2); }
.remote-app .usage-text.is-warm { color: #e5c07b; }
.remote-app .usage-text.is-hot { color: var(--danger); }
.remote-app .usage-model { margin-left: auto; color: var(--ink-2); }

/* ---- dialogs: model / agent / commands -------------------------------- */
.remote-page .new-chat-dialog,
.remote-page .model-dialog {
  width: min(480px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(78vh, 640px);
  max-height: min(78dvh, 640px);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--sheet);
  color: var(--ink);
  padding: 0;
  overflow: hidden;
}
.remote-page .new-chat-dialog::backdrop,
.remote-page .model-dialog::backdrop { background: rgba(0, 0, 0, 0.62); }
.remote-page .new-chat-form { display: grid; gap: 10px; padding: 16px; }
.remote-page .new-chat-form h2 { font-size: 14px; }
.remote-page .new-chat-form label { display: grid; gap: 5px; font: 500 11.5px/1.3 var(--mono); color: var(--muted); }
.remote-page .new-chat-form .field { display: grid; gap: 5px; min-width: 0; }
.remote-page .new-chat-form .field-label { font: 500 11.5px/1.3 var(--mono); color: var(--muted); }
.remote-page .new-chat-form .model-btn { justify-content: flex-start; height: 30px; }
.remote-page .new-chat-form input,
.remote-page .new-chat-form textarea,
.remote-page .new-chat-form select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font: 12px var(--mono);
  padding: 7px 8px;
}
.remote-page .new-chat-form textarea { resize: vertical; min-height: 68px; }
.remote-page .new-chat-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.remote-page #newError:empty { display: none; }

.remote-page .model-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  min-height: 0;
  max-height: min(78vh, 640px);
  max-height: min(78dvh, 640px);
}
.remote-page .model-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.remote-page .model-head h2 { font-size: 13px; }
.remote-page .model-head .btn { height: 28px; }
.remote-page .model-sheet input[type="search"] {
  width: 100%;
  height: 30px;
  flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--bg);
  color: var(--ink);
  font: 12px var(--mono);
  padding: 0 8px;
}
.remote-page .model-hint { margin: 0; flex: none; font-size: 11px; }
.remote-page .model-list {
  list-style: none;
  margin: 0;
  padding: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.remote-page .model-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.remote-page .model-row:hover { background: var(--hover); }
.remote-page .model-row.is-active { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
.remote-page .model-row[aria-selected="true"] { background: var(--accent-soft); }
.remote-page .model-row .model-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 12px var(--mono);
}
.remote-page .model-row .model-provider {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font: 10.5px var(--mono);
}
.remote-page .model-row .model-check { flex: none; color: var(--ok); }
.remote-page .account-group { padding: 8px 8px 2px; color: var(--muted); font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.remote-page .account-row { align-items: flex-start; }
/* The Coarena pool: green means the key can answer, red means it cannot. */
.remote-page .account-summary { margin: 0 0 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); font: 11px/1.5 var(--mono); }
.remote-page .account-summary.is-out { border-color: rgba(248, 113, 113, 0.35); }
.remote-page .account-summary:not(.is-out) { border-color: rgba(74, 222, 128, 0.3); }
.remote-page .account-state.is-ready { color: #4ade80; }
.remote-page .account-state.is-used, .remote-page .account-state.is-revoked { color: #f87171; }
.remote-page .account-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.remote-page .account-detail { color: var(--muted); font: 10.5px var(--mono); overflow-wrap: anywhere; }
.remote-page .account-add { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.remote-page .account-add-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.remote-page .account-login { display: flex; flex-direction: column; gap: 6px; }
.remote-page .account-login input { width: 100%; }
.remote-page .model-empty { margin: 0; padding: 14px 8px; text-align: center; color: var(--muted); font-size: 11.5px; }

/* ---- sign-in and the shared transcript -------------------------------- */
.remote-page .signin { max-width: 960px; }
.remote-page .signin-copy h1 { font-size: 24px; }
.remote-page .signin-steps { border-radius: var(--radius); }
.remote-page .state { font-family: var(--mono); }

@media (max-width: 860px) {
  .remote-page { height: 100dvh; }
  .remote-page main { min-height: 0; }
  .remote-app { grid-template-columns: minmax(0, 1fr); }
  .remote-app .list { grid-column: 1; grid-row: 1; border-right: 0; }
  .remote-app .reader { grid-column: 1; grid-row: 1; }
  .remote-app .reader { display: none; }
  .remote-app.reading .list { display: none; }
  .remote-app.reading .reader { display: block; }
  .remote-app .back { display: inline-flex; }
  .remote-app .chat-view { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .remote-app .chat-title h1 { font-size: 17px; }
  .remote-app .chat-tools { justify-content: flex-start; gap: 6px; }
  .remote-app .chat-tools .btn { height: 30px; padding: 0 12px; }
  .remote-app .term-body { padding: 14px; }
  .remote-app .composer { padding: 8px 10px; }
  .remote-app .term-foot { padding: 8px 12px; }
}

/* Phones and tablets: the footer has to be read, not scrolled sideways. The gauges wrap
   and the agent · model · effort is dropped here (the header buttons already show it). */
@media (max-width: 860px) {
  .remote-app .usage-bar {
    flex-wrap: wrap;
    white-space: normal;
    overflow-x: hidden;
    padding: 6px 8px;
    row-gap: 3px;
    column-gap: 8px;
  }
  .remote-app .usage-gauge { gap: 4px; }
  .remote-app .usage-track { width: 28px; }
  /* The model, agent and effort still sit in the header buttons: repeating them here
     only left a truncated "build · (op…" on the narrow footer. */
  .remote-app .usage-model { display: none; }
  .remote-app .work-bar { padding: 5px 10px; font-size: 11px; }
}

@media (min-width: 861px) {
  .remote-app { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .remote-page .btn { transition: none; }
  .remote-app .work-label { animation: none; }
}
