:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --border: #2d3a4f;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #3d9cf0;
  --accent-dim: #1e4f7a;
  --ok: #3ecf8e;
  --warn: #f0b429;
  --err: #f07178;
  --font: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a3a5c 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #1a2f28 0%, transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}
.wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
header {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.75rem;
}
h1 { margin: 0 0 0.25rem; font-size: 1.75rem; letter-spacing: -0.02em; }
h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.1rem;
  backdrop-filter: blur(8px);
}
.auth-box { display: flex; gap: 0.5rem; align-items: end; flex-wrap: wrap; }
.auth-box label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); }
input, textarea, button {
  font: inherit; border-radius: 8px; border: 1px solid var(--border);
  background: #0c1118; color: var(--text); padding: 0.55rem 0.75rem;
}
input, textarea { min-width: 220px; }
textarea { width: 100%; resize: vertical; }
button {
  background: var(--accent-dim); border-color: var(--accent);
  color: #fff; cursor: pointer; font-weight: 600;
}
button:hover { background: var(--accent); }
button.danger { background: #4a1f24; border-color: var(--err); }
button.ghost { background: transparent; }
.form { display: grid; gap: 0.75rem; }
.form label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.row { display: flex; gap: 0.5rem; align-items: center; }
.row.between { justify-content: space-between; }
/* ----------------------------------------------------------- profiles board */
.count-pill {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: #0c1118;
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}
.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.live-toggle input { min-width: auto; width: auto; margin: 0; }
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #33415a;
}
.live-toggle input:checked ~ .live-dot {
  background: var(--ok);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55); }
  50% { box-shadow: 0 0 0 4px rgba(62, 207, 142, 0); }
}

.monitor {
  display: grid;
  grid-template-columns: minmax(260px, 350px) 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
@media (max-width: 860px) {
  .monitor { grid-template-columns: 1fr; }
}
.monitor-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #121925;
  padding: 0.65rem 0.75rem 0.6rem;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.panel-title { font-size: 0.82rem; font-weight: 650; }
.panel-sub, .panel-note {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}
.panel-note.hot { color: var(--accent); }
.job-panel { margin-bottom: 0.9rem; }
.job-panel-controls {
  align-items: center;
  gap: 0.6rem;
}
.job-panel-controls .activity-stats { margin-top: 0; }
.job-progress {
  height: 6px;
  background: #1c2433;
  border-radius: 99px;
  overflow: hidden;
  margin: 0.5rem 0 0.4rem;
}
.job-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ok);
  transition: width 0.2s ease;
}
.job-panel.stopping .job-progress-bar { background: var(--warn); }
.job-now {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.15rem 0 0.45rem;
  font-size: 0.78rem;
}
.job-stop-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.job-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .job-split { grid-template-columns: 1fr; }
}
.job-subhead {
  font-size: 0.78rem;
  font-weight: 650;
  margin: 0.15rem 0 0.35rem;
}
.report-table .blocked { color: var(--err); font-weight: 600; }
.report-table .retrying { color: var(--warn); font-weight: 600; }
.report-table .job-drop {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
}
.job-now-row { color: var(--text); }
.job-now-row .mono { font-size: 0.72rem; color: var(--muted); }

.health-bar, .platform-bar {
  display: flex;
  gap: 2px;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #0c1118;
}
.health-bar .seg, .platform-bar .seg { min-width: 2px; }
.seg.ok { background: var(--ok); }
.seg.warn { background: var(--warn); }
.seg.down { background: var(--err); }
.seg.off { background: #33415a; }
.seg.warming { background: #5a6578; }
.seg.dead { background: #000; }
.health-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend-item b { color: var(--text); }
.swatch {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.swatch.ok { background: var(--ok); }
.swatch.warn { background: var(--warn); }
.swatch.down { background: var(--err); }
.swatch.off { background: #33415a; }
.swatch.warming { background: #5a6578; }
.swatch.dead { background: #000; box-shadow: inset 0 0 0 1px #444; }
.platform-health { display: grid; gap: 0.35rem; margin-top: 0.6rem; }
.platform-row {
  display: grid;
  grid-template-columns: 6.2rem 1fr 3.2rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
}
.platform-name { display: inline-flex; align-items: center; gap: 0.35rem; }
.platform-bar { height: 6px; }
.platform-count { text-align: right; font-family: var(--mono); }
.platform-count small { color: var(--muted); }

.activity-chart { display: block; width: 100%; height: 132px; }
.activity-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.35rem;
}
.stat {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.stat b { font-size: 0.95rem; font-family: var(--mono); color: var(--text); text-transform: none; }

.grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}
.tool-input {
  min-width: 0;
  padding: 0.38rem 0.55rem;
  font-size: 0.8rem;
}
#profileSearch { flex: 1 1 170px; }
.selection-acts {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-left: auto;
}
.selection-acts button { min-width: auto; }
.selection-acts button.debug-on,
button.debug-on {
  border-color: var(--warn);
  color: var(--warn);
}
.selection-acts button.temp-on,
button.temp-on {
  border-color: var(--ok, #3d9a6a);
  color: var(--ok, #3d9a6a);
}
.selection-acts button.ai-on {
  border-color: var(--ok, #3d9a6a);
  color: var(--ok, #3d9a6a);
}
.tile.debug {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 70%, transparent);
}
.tile-debug {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--warn);
  opacity: 0.9;
  pointer-events: none;
}
.tile-debug.hidden { display: none; }
.tile-temp {
  position: absolute;
  right: 4px;
  bottom: 16px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ok, #3d9a6a);
  opacity: 0.9;
  pointer-events: none;
}
.tile-temp.hidden { display: none; }
.tile-captcha {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--err);
  pointer-events: none;
}
.tile-captcha.hidden { display: none; }
.tile.captcha {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 70%, transparent);
}
.captcha-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: #2a1418;
  color: var(--err);
  font-size: 0.82rem;
}
.captcha-banner .captcha-url {
  flex: 1 1 12rem;
  word-break: break-all;
  font-size: 0.72rem;
  color: #f3c4c8;
}
.captcha-banner button { margin-left: auto; }
.view-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.seg-btn {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.38rem 0.7rem;
  font-size: 0.78rem;
}
.seg-btn.active { background: var(--accent-dim); }
.backend-switch { margin-right: 0.4rem; }

.tile-be {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.72;
  margin-left: 0.15rem;
}
.tile-be.ap { color: var(--accent); }
.lr-be {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.7;
  margin-left: 0.35rem;
}

/* ------------------------------------------------------------ profile tiles */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.4rem;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 0.15rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.25rem;
  min-height: 78px;
  padding: 0.32rem 0.38rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: #121925;
  border: 1px solid var(--border);
  border-left: 3px solid #33415a;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.tile:hover { background: #182231; border-color: var(--accent); }
.tile.h-ok { border-left-color: var(--ok); }
.tile.h-warn { border-left-color: var(--warn); }
.tile.h-down { border-left-color: var(--err); }
.tile.h-off { border-left-color: #33415a; }
.tile.h-warming { border-left-color: #5a6578; }
.tile.h-dead {
  background: #050505;
  border-color: #1a1a1a;
  border-left-color: #000;
  color: #6a6a6a;
}
.tile.h-dead .tile-idx,
.tile.h-dead .tile-stat,
.tile.h-dead .tile-ip,
.tile.h-dead .tile-load { color: #444; }
.tile.filtered-out, .list-row.filtered-out { display: none; }
.tile.selected, .list-row.selected { background: #152536; }
.list-row.selected { box-shadow: inset 3px 0 0 var(--accent); }
.tile-check {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 3;
  display: flex;
  margin: 0;
  padding: 1px;
  cursor: pointer;
}
.tile-check input,
.list-check input {
  min-width: 0;
  width: 13px;
  height: 13px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}
.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.25rem;
  padding-right: 14px;
}
.tile-idx, .tile-stat, .tile-load {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--muted);
}
.tile-idx { font-weight: 700; color: #6f819d; }
.tile-stat.good { color: var(--ok); }
.tile-stat.bad { color: var(--err); }
.tile-spark { width: 44px; height: 14px; flex: 0 0 auto; }
.tile .tile-spark {
  width: 100%;
  height: 18px;
  border-bottom: 1px solid #1e2938;
}
.tile-spark polyline {
  fill: none;
  stroke: #46587a;
  stroke-width: 1.3;
  stroke-linejoin: round;
}
.tile.active .tile-spark polyline, .list-row.active .tile-spark polyline {
  stroke: var(--accent);
  stroke-width: 1.8;
}
.tile-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.25rem; }
.tile-ip {
  font-family: var(--mono);
  font-size: 0.58rem;
  line-height: 1.25;
  color: var(--muted);
  overflow: hidden;
}
.tile-ip.changed { color: var(--warn); }
.tile.ip-changed::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16px;
  border: 6px solid transparent;
  border-top-color: var(--warn);
  border-right-color: var(--warn);
}
.tile.active { border-color: var(--accent); animation: tilePulse 1.5s ease-in-out infinite; }
.tile.active .tile-load { color: var(--accent); }
.tile.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: tileScan 1.2s linear infinite;
}
@keyframes tilePulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(61, 156, 240, 0.35), 0 0 10px -4px rgba(61, 156, 240, 0.5); }
  50% { box-shadow: 0 0 0 1px rgba(61, 156, 240, 0.85), 0 0 16px -2px rgba(61, 156, 240, 0.8); }
}
@keyframes tileScan {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* Per-platform traffic light: G = Gemini, C = ChatGPT, A = Claude */
.dots { display: inline-flex; gap: 2px; }
.dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  font-style: normal;
  font-family: var(--mono);
  background: #0c1118;
  color: #4a5a72;
  box-shadow: inset 0 0 0 1px #263349;
}
.dot.ok { color: var(--ok); background: #122b21; box-shadow: inset 0 0 0 1px #1f6047; }
.dot.warn { color: var(--warn); background: #2e2410; box-shadow: inset 0 0 0 1px #6b5218; }
.dot.down { color: var(--err); background: #2e1418; box-shadow: inset 0 0 0 1px #6b2830; }

/* ------------------------------------------------------------- profile list */
.profile-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  max-height: 540px;
}
.list-head, .list-row {
  display: grid;
  grid-template-columns: 1.35rem 2rem minmax(110px, 1fr) 3.4rem 5.2rem minmax(140px, 1.15fr) 3.4rem 6.6rem 3rem 4.6rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  min-width: 800px;
  font-size: 0.78rem;
}
.list-check {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}
.lr-status .badge {
  font-size: 0.62rem;
  padding: 0.1rem 0.4rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.list-head {
  background: #0c1118;
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.list-row { border-top: 1px solid var(--border); cursor: pointer; }
.list-row:hover { background: #182231; }
.lr-idx, .lr-load, .lr-req { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.lr-proxy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
}
.lr-proxy.changed, .lr-proxy.changed .lr-ips { color: var(--warn); }
.lr-ips {
  font-size: 0.62rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row.active .lr-load { color: var(--accent); }
.health-pip {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: #33415a;
}
.health-pip.ok { background: var(--ok); }
.health-pip.warn { background: var(--warn); }
.health-pip.down { background: var(--err); }
.health-pip.warming { background: #5a6578; }
.health-pip.dead { background: #000; box-shadow: inset 0 0 0 1px #444; }
.list-row.h-dead { background: #080808; }

/* ----------------------------------------------------- profile details modal */
.profile-dialog { max-width: 720px; }
.dlg-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.85rem; }
.dlg-head h3 { margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dlg-sub { margin-top: 0.3rem; font-size: 0.78rem; color: var(--muted); }
.dlg-sub .mono, .meta-value.mono { font-family: var(--mono); }
.icon-btn { padding: 0.25rem 0.55rem; font-size: 0.85rem; align-self: flex-start; }
.dlg-body { display: grid; gap: 0.8rem; }
.health-chip {
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #33415a;
  color: #cbd6e6;
}
.health-chip.ok { background: #143528; color: var(--ok); }
.health-chip.warn { background: #3a2e10; color: var(--warn); }
.health-chip.down { background: #3a181c; color: var(--err); }
.health-chip.warming { background: #2a3140; color: #9aa8bd; }
.health-chip.dead { background: #111; color: #888; }
.issue-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--warn);
  font-size: 0.8rem;
}
.issue-list li { margin: 0.15rem 0; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.45rem;
}
.meta-cell {
  display: grid;
  gap: 0.15rem;
  padding: 0.4rem 0.55rem;
  background: #0c1118;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.meta-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.meta-value { font-size: 0.82rem; word-break: break-word; }
.meta-value.mono { font-size: 0.76rem; }
.dlg-error {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: #2a1418;
  color: var(--err);
  font-size: 0.8rem;
}
.dlg-warn {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: #3a2e10;
  color: var(--warn);
  font-size: 0.8rem;
}
.proxy-panel {
  display: grid;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  background: #0c1118;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.proxy-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.proxy-current { font-size: 0.78rem; }
.proxy-assign-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.proxy-combobox {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}
.proxy-combobox .proxy-input {
  width: 100%;
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}
.proxy-suggest {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #121925;
  border: 1px solid var(--border);
  border-radius: 8px;
  max-height: 180px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.proxy-suggest li {
  padding: 0.35rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
}
.proxy-suggest li.active, .proxy-suggest li:hover { background: #182231; }
.proxy-ips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  align-items: baseline;
  font-size: 0.78rem;
}
.proxy-ips .meta-label { margin-right: 0.25rem; }
.proxy-checked { color: var(--muted); font-size: 0.72rem; }
.proxy-test-result { margin: 0; font-size: 0.75rem; }
.proxy-assign-row button { padding: 0.4rem 0.65rem; font-size: 0.8rem; }
.provider-actions { display: grid; gap: 0.4rem; }
.provider-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.provider-name {
  min-width: 9rem;
  font-size: 0.85rem;
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}
.provider-row button { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.provider-row button:disabled { opacity: 0.45; cursor: not-allowed; }
.provider-row.is-disabled { opacity: 0.85; }
.provider-note { font-size: 0.7rem; color: var(--muted); }
.provider-load {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.provider-load.hot { color: var(--text); }
.concurrent-row { gap: 0.65rem; flex-wrap: wrap; }
.concurrent-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.concurrent-input {
  min-width: 4.5rem;
  width: 4.5rem;
  padding: 0.35rem 0.45rem;
}
.model-override-input,
.model-default-input {
  min-width: 12rem;
  max-width: 18rem;
  padding: 0.35rem 0.45rem;
}
.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge.ready { background: #143528; color: var(--ok); }
.badge.logging_in, .badge.pending_login { background: #3a2e10; color: var(--warn); }
.badge.error, .badge.cookie_expired, .badge.disabled { background: #3a181c; color: var(--err); }
.badge.warming { background: #2a3140; color: #9aa8bd; }
.badge.unusable { background: #111; color: #888; }
.import-head { margin: 1.25rem 0 0.4rem; font-size: 1rem; }
.import-opts { flex-wrap: wrap; gap: 0.85rem 1.25rem; }
.import-conc {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}
input.narrow { min-width: 4.5rem; width: 5.5rem; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.login-report-dialog {
  max-width: min(1100px, calc(100vw - 2rem));
  width: min(1100px, calc(100vw - 2rem));
}
.el-keys-dialog {
  max-width: min(1100px, calc(100vw - 2rem));
  width: min(1100px, calc(100vw - 2rem));
}
.report-table-wrap {
  max-height: min(60vh, 28rem);
  overflow: auto;
  margin: 0 0 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.report-table-wrap.job-table-wrap {
  max-height: 12rem;
  margin: 0;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  user-select: text;
}
.report-table th,
.report-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.55rem;
  text-align: left;
  vertical-align: top;
}
.report-table th {
  position: sticky;
  top: 0;
  background: #121925;
  color: var(--muted);
  font-weight: 600;
}
.report-table .ok { color: var(--ok); font-weight: 600; }
.report-table .fail,
.report-table .invalid { color: var(--err); font-weight: 600; }
.report-table .skipped { color: var(--warn); }
.report-table .stopped { color: var(--warn); }
.report-table td.when { white-space: nowrap; }
.report-table .queued,
.report-table .running { color: var(--muted); }
.report-table td.msg { max-width: 28rem; word-break: break-word; }
.report-table .mono { font-family: var(--mono); font-size: 0.78rem; }
.report-table td.el-key {
  font-family: var(--mono);
  font-size: 0.75rem;
  max-width: 28rem;
  word-break: break-all;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.actions button { font-size: 0.85rem; padding: 0.4rem 0.65rem; }
.result {
  margin-top: 0.85rem; padding: 0.85rem; background: #0c1118;
  border-radius: 8px; border: 1px solid var(--border);
  white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 0.82rem; max-height: 320px; overflow: auto;
}
.hidden { display: none; }
.endpoints code {
  display: inline-block; padding: 0.4rem 0.65rem; background: #0c1118;
  border-radius: 6px; font-family: var(--mono); color: var(--accent);
}
.hint { color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }
.settings-form .check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--text);
}
.settings-form .check input {
  min-width: auto;
  width: auto;
  margin-top: 0.2rem;
}
.gemini-api-key-list {
  display: grid;
  gap: 0.65rem;
}
.gemini-api-key-grid {
  max-height: 320px;
  min-height: 0;
}
.gemini-api-key-grid .tile-be {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.gemini-api-key-grid .tile-be.vx { color: #8fd3ff; }
.gak-monitor { margin: 0.75rem 0 0.85rem; }
.gak-dialog { max-width: 860px; }
.gak-dialog input,
.gak-dialog textarea {
  min-width: 0;
}
.gemini-api-key-card {
  display: grid;
  gap: 0.75rem;
}
.gak-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: stretch;
}
.gak-stats {
  display: contents;
}
.gak-save-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: end;
}
.gak-save-flash {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.1rem;
  font-size: 0.8rem;
  font-weight: 650;
}
.gak-save-flash.ok { color: var(--ok); }
.gak-save-flash.err { color: var(--err); }
.gak-field {
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 0;
}
.gak-field input[type="text"],
.gak-field input[type="number"] {
  min-width: 0;
  width: 100%;
  min-height: 2.55rem;
}
.gak-save-bar .concurrent-input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.7rem;
}
.gak-save-btn {
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 7.25rem;
  min-height: 2.55rem;
  padding: 0 1.35rem;
}
.gak-section {
  display: grid;
  gap: 0.7rem;
  padding: 0.75rem 0.85rem;
  background: #0c1118;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.gak-section.is-on {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}
.gak-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.gak-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}
.gak-switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
  cursor: pointer;
}
.gak-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0.01;
  width: 100%;
  height: 100%;
  min-width: 0;
  cursor: pointer;
}
.gak-switch-ui {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #243044;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.gak-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #c5d0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.16s ease, background 0.16s ease;
}
.gak-switch input:checked + .gak-switch-ui {
  background: color-mix(in srgb, var(--accent) 55%, #14305a);
  border-color: var(--accent);
}
.gak-switch input:checked + .gak-switch-ui::after {
  transform: translateX(20px);
  background: #fff;
}
.gak-switch input:focus-visible + .gak-switch-ui {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gak-section.is-off .gak-vertex-body {
  opacity: 0.48;
}
.gak-option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.gak-option-title {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
}
.gemini-api-key-grid .tile-be.prio {
  color: #ffd27a;
}
.gak-vertex-body {
  display: grid;
  gap: 0.65rem;
  transition: opacity 0.15s ease;
}
.gak-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 0.55rem;
  align-items: end;
}
.gak-sa-box {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.65rem;
  background: #121925;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gak-sa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.gak-reactivate-slot:empty {
  display: none;
}
.gak-reactivate {
  font-weight: 700;
}
.gak-footer {
  display: flex;
  justify-content: flex-end;
}
.gak-tile-reactivate {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  min-width: 0;
  line-height: 1.15;
  z-index: 2;
}
.gak-tile-reactivate[hidden] {
  display: none;
}
@media (min-width: 600px) {
  .gak-top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .gak-save-bar {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .gak-save-flash {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .gak-field-row,
  .gak-save-bar {
    grid-template-columns: 1fr;
  }
  .gak-save-btn {
    width: 100%;
  }
}
.gak-sa-pick {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  min-width: 0;
}
.gak-sa-pick input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.gemini-api-key-detail {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  background: #0c1118;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.gemini-api-key-detail.hidden { display: none; }
.gemini-api-key-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
  justify-content: space-between;
}
.gemini-api-key-meta {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.gemini-api-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.gemini-api-status.live { color: var(--ok); }
.gemini-api-status.cooling { color: var(--warn); }
.gemini-api-status.dead { color: var(--err); }
.gemini-api-key-detail .proxy-panel {
  padding: 0.45rem 0.5rem;
}
.gak-error {
  margin: 0;
  max-height: 14rem;
  overflow: auto;
  padding: 0.5rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--err) 35%, var(--border));
  border-radius: 6px;
  background: #1a1012;
  color: #f3c4c8;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.empty { color: var(--muted); padding: 0.5rem 0; }
.steps { margin: 0.4rem 0 0.8rem 1.1rem; color: var(--muted); padding: 0; }
.steps li { margin: 0.35rem 0; }
.steps code { color: var(--accent); font-family: var(--mono); font-size: 0.85rem; }
.chat-controls {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.75rem;
}
.chat-controls .meta {
  grid-column: 1 / -1;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .chat-controls { grid-template-columns: 1fr; }
}
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0.9rem;
  align-items: stretch;
}
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; }
}
.conv-list-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #121925;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 560px;
}
.conv-list-head {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.conv-list-head .tiny {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.conv-list {
  overflow: auto;
  flex: 1;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.conv-item {
  text-align: left;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  font-weight: 500;
}
.conv-item:hover { background: #182231; border-color: var(--border); }
.conv-item.active { background: #1a4a73; border-color: var(--accent); }
.conv-item .title {
  display: block;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item .sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
}
.conv-item .row-acts {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.conv-item .row-acts button {
  flex: 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
}
.chat-main { min-width: 0; }
select {
  font: inherit; border-radius: 8px; border: 1px solid var(--border);
  background: #0c1118; color: var(--text); padding: 0.55rem 0.75rem;
}
.chat-log {
  min-height: 220px; max-height: 480px; overflow: auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: #0c1118; padding: 0.85rem; margin-bottom: 0.75rem;
  display: flex; flex-direction: column; gap: 0.65rem;
}
.bubble {
  max-width: 92%; padding: 0.65rem 0.8rem; border-radius: 10px;
  word-break: break-word; line-height: 1.5;
  font-size: 0.92rem;
}
.bubble.user { align-self: flex-end; background: #1a4a73; }
.bubble.assistant { align-self: flex-start; background: #182231; border: 1px solid var(--border); }
.bubble .who {
  display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
  font-size: 0.72rem; color: var(--muted);
  margin-bottom: 0.35rem; font-family: var(--mono);
}
.bubble-tool {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #243044;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 650;
  text-transform: none;
}
.bubble .md {
  white-space: normal;
}
.bubble .md > :first-child { margin-top: 0; }
.bubble .md > :last-child { margin-bottom: 0; }
.bubble .md p { margin: 0.45rem 0; }
.bubble .md h1, .bubble .md h2, .bubble .md h3,
.bubble .md h4, .bubble .md h5, .bubble .md h6 {
  margin: 0.7rem 0 0.35rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.bubble .md h1 { font-size: 1.2rem; }
.bubble .md h2 { font-size: 1.1rem; }
.bubble .md h3 { font-size: 1.02rem; }
.bubble .md h4, .bubble .md h5, .bubble .md h6 { font-size: 0.95rem; }
.bubble .md ul, .bubble .md ol {
  margin: 0.4rem 0;
  padding-left: 1.25rem;
}
.bubble .md li { margin: 0.2rem 0; }
.bubble .md blockquote {
  margin: 0.5rem 0;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid var(--accent);
  color: #c5d0e0;
  background: rgba(61, 156, 240, 0.08);
  border-radius: 0 6px 6px 0;
}
.bubble .md hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.75rem 0;
}
.bubble .md code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: #0a0f16;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.bubble .md pre.md-code {
  margin: 0.5rem 0;
  padding: 0.65rem 0.75rem;
  background: #0a0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}
.bubble .md pre.md-code code {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 0.82rem;
  white-space: pre;
}
.bubble .md a { color: #7ec4ff; }
.bubble .md .empty-inline {
  margin: 0;
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
}

.msg-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.media-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #0c1118;
  display: flex;
  flex-direction: column;
}
.media-card img,
.media-card video {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
  background: #000;
}
.media-card audio {
  width: 100%;
  margin: 0.5rem 0.4rem 0;
}
.media-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
}
.media-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.media-card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-card-meta a.dl {
  color: var(--accent);
  text-decoration: none;
  font-weight: 650;
  flex-shrink: 0;
}
.media-card-meta a.dl:hover { text-decoration: underline; }

.composer {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #121925;
  padding: 0.65rem 0.7rem 0.55rem;
}
.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  padding: 0.35rem 0.65rem;
  font-weight: 600;
}
.tool-btn .icon { opacity: 0.9; }
.tool-btn .caret { font-size: 0.7rem; opacity: 0.7; }
.tool-menu-wrap { position: relative; }
.tools-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: #152033;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tools-menu.hidden {
  display: none;
}
.tools-menu button {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 550;
  font-size: 0.86rem;
  padding: 0.45rem 0.65rem;
}
.tools-menu button:hover {
  background: #1a4a73;
  border-color: var(--accent);
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border-radius: 999px;
  background: #1e4f7a;
  color: #dff0ff;
  font-size: 0.75rem;
  font-weight: 650;
  border: 0;
  cursor: pointer;
}
.tool-badge.hidden {
  display: none;
}
.tool-badge .x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  font-size: 0.85rem;
  line-height: 1;
  font-weight: 700;
}
.tool-badge:hover .x { background: rgba(0,0,0,0.45); }
.tiny-btn {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  font-weight: 600;
}
.tiny-btn.hidden {
  display: none;
}
.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.pending-files.hidden {
  display: none;
}
.pending-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.3rem 0.45rem 0.3rem 0.55rem;
  border-radius: 999px;
  background: #0c1118;
  border: 1px solid var(--border);
  font-size: 0.78rem;
}
.pending-chip .name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.pending-chip .meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}
.pending-chip button {
  padding: 0 0.35rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}
.pending-chip button:hover { color: var(--err); }
.composer-hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.composer-hint code {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.72rem;
}
.chat-form { grid-template-columns: 1fr auto; align-items: end; margin: 0; }
.chat-form textarea { min-width: 0; }
#proxyPoolText { font-family: var(--mono); font-size: 0.82rem; white-space: pre; }
#proxyForm .proxy-actions { flex-wrap: wrap; }
dialog {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); color: var(--text); padding: 1.1rem 1.2rem;
  max-width: 560px; width: calc(100% - 2rem);
}
dialog::backdrop { background: rgba(0,0,0,0.55); }

/* ------------------------------------------------- remote browser login view */
.remote-dialog {
  box-sizing: border-box;
  width: min(1360px, calc(100vw - 2rem));
  max-width: min(1360px, calc(100vw - 2rem));
}
.remote-toolbar {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.remote-toolbar input {
  flex: 1 1 220px;
  min-width: 120px;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.remote-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05070d;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
/* Size from the frame's intrinsic dimensions so nothing is letterboxed: a
   letterbox would offset every click relative to the painted image. */
.remote-stage canvas {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 240px);
  cursor: default;
  outline: none;
}
.remote-stage canvas:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.remote-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
  background: rgba(5, 7, 13, 0.75);
}
.remote-status { margin: 0.55rem 0 0; font-size: 0.8rem; color: var(--muted); min-height: 1.1rem; }
.remote-status.ok { color: var(--ok); }
.remote-status.warn { color: var(--warn); }
.remote-status.bad { color: var(--err); }
.key-dialog { display: grid; gap: 0.75rem; margin: 0; }
.key-dialog h3 { margin: 0; }
.key-dialog input { width: 100%; font-family: var(--mono); font-size: 0.85rem; }
.auto-login-dialog { max-width: 560px; }
.auto-login-dialog .hint { margin: 0; }
.auto-login-status { min-height: 1.2rem; }
.auto-login-status.ok { color: var(--ok); }
.auto-login-status.bad { color: var(--err); }

.logout-form { margin: 0; }
.logout-form button { min-width: auto; }

body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}
.login-card {
  width: min(420px, 100%);
  margin: 0;
}
.login-card h1 { margin-bottom: 0.35rem; }
.login-card .sub { margin-bottom: 1.1rem; }
.login-card button { width: 100%; }
.login-error {
  margin: 0 0 0.85rem;
  color: var(--err);
  font-size: 0.9rem;
}
