:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #15181d;
  --muted: #5d6572;
  --faint: #8b929e;
  --border: #e2e5ea;
  --accent: #17845a;
  --accent-hover: #126c49;
  --accent-soft: #e5f4ed;
  --on-accent: #ffffff;
  --warn: #9a6200;
  --warn-soft: #fdf3dc;
  --danger: #c0352b;
  --danger-soft: #fbe9e7;
  --info-soft: #e8eef9;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 1px 3px rgb(16 24 40 / 8%);
  --shadow-lg: 0 12px 32px rgb(16 24 40 / 14%);
  --radius: 10px;
  --radius-sm: 7px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #171a1f;
    --surface-2: #1e2228;
    --text: #e8eaed;
    --muted: #a1a8b3;
    --faint: #737b87;
    --border: #2a2f37;
    --accent: #3cbf87;
    --accent-hover: #55d199;
    --accent-soft: #15322a;
    --on-accent: #08130e;
    --warn: #e3b04b;
    --warn-soft: #2e2615;
    --danger: #ff7b6e;
    --danger-soft: #3a1c19;
    --info-soft: #1b2433;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---- buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 550; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.select { padding-right: 28px; }
.textarea { height: auto; padding: 10px 12px; resize: none; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 99px; background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot-on { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-off { background: var(--danger); }

.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; background: var(--info-soft); }
.notice-warn { background: var(--warn-soft); color: var(--text); }
.notice-error { background: var(--danger-soft); color: var(--text); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- auth pages ---- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: -.01em; }
.auth-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 14px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--faint); text-align: center; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-size: 15px; font-weight: 800;
}

/* ---- app shell ---- */
.shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.crumbs .sep { color: var(--faint); font-weight: 400; }
.crumbs .here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.runtime { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
main { flex: 1; min-height: 0; overflow: auto; }

/* ---- project index ---- */
.page { max-width: 1180px; margin: 0 auto; padding: 28px 16px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; letter-spacing: -.015em; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input { max-width: 320px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.seg button {
  border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 5px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; min-height: 132px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: border-color .12s, box-shadow .12s, transform .12s;
}
.card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; gap: 8px; }
.card h3 { margin: 0; font-size: 15.5px; letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card p {
  margin: 0; font-size: 13.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.card-foot .faint { font-size: 12px; margin-left: auto; }
.card-off { opacity: .72; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); }

/* ---- workspace (project view) ---- */
.ws {
  --chat-w: 380px; --side-w: 340px;
  height: 100%; display: grid; gap: 0; padding: 12px;
  grid-template-columns: minmax(300px, var(--chat-w)) 12px minmax(0, 1fr) 12px var(--side-w);
}
.ws-resizer { position: relative; cursor: col-resize; touch-action: none; }
.ws-resizer::after { content: ""; position: absolute; inset: 0 4px; border-radius: 2px; background: transparent; transition: background .12s; }
.ws-resizer:hover::after, .ws-resizer.is-dragging::after, .ws-resizer:focus-visible::after { background: var(--accent-soft); }
.ws-resizer.is-dragging::after, .ws-resizer:focus-visible::after { background: var(--accent); opacity: .5; }
.panel {
  min-height: 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--border); min-height: 52px;
}
.panel-head .select { height: 32px; font-size: 13.5px; }
.panel-body { flex: 1; min-height: 0; overflow: auto; }

/* chat */
.chat-select { flex: 1; min-width: 0; }
.model-select { width: 104px; flex: none; }
.messages { padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; font-size: 14.5px; }
.msg-user {
  align-self: flex-end; max-width: 88%; background: var(--accent); color: var(--on-accent);
  padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-meta { font-size: 11.5px; color: var(--faint); margin-top: 4px; text-align: right; }
.msg-agent { align-self: stretch; }
.msg-agent .bubble { overflow-wrap: anywhere; }
.msg-agent .bubble p { margin: 0 0 8px; }
.msg-agent .bubble p:last-child { margin-bottom: 0; }
.msg-agent .bubble ul, .msg-agent .bubble ol { margin: 0 0 8px; padding-left: 20px; }
.msg-agent .bubble code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.msg-agent .bubble pre { background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); overflow: auto; margin: 0 0 8px; }
.msg-agent .bubble pre code { background: none; padding: 0; }
.msg-error .bubble { background: var(--danger-soft); padding: 9px 12px; border-radius: var(--radius-sm); }
.steps { margin: 0 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.steps summary { cursor: pointer; padding: 6px 10px; color: var(--muted); list-style: none; display: flex; gap: 6px; align-items: center; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary::before { content: "▸"; font-size: 11px; transition: transform .12s; }
.steps[open] summary::before { transform: rotate(90deg); }
.steps ol { margin: 0; padding: 0 10px 8px 30px; color: var(--muted); }
.steps li { padding: 1px 0; overflow-wrap: anywhere; }
.live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.chat-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.chat-empty h2 { font-size: 16px; color: var(--text); margin: 0 0 6px; }
.suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.suggestion {
  text-align: left; padding: 9px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; font-size: 13.5px; color: var(--text);
}
.suggestion:hover { border-color: var(--accent); background: var(--accent-soft); }

.composer { flex: none; padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.composer .textarea { min-height: 76px; max-height: 220px; }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.composer-row .hint { font-size: 12px; color: var(--faint); margin-right: auto; }
.banner { margin: 10px 12px 0; }

/* preview */
.preview-bar { gap: 6px; flex-wrap: wrap; }
.url-tabs { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.url-tabs button { border: 0; background: transparent; height: 26px; padding: 0 10px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.url-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.addr { flex: 1; min-width: 160px; height: 32px; font-family: var(--mono); font-size: 12.5px; }
.devices { display: inline-flex; gap: 2px; }
.devices .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.stage { flex: 1; min-height: 0; background: var(--surface-2); overflow: auto; display: flex; justify-content: center; }
.frame-wrap { width: 100%; height: 100%; transition: width .2s; background: #fff; }
.frame-wrap[data-device="tablet"] { width: 768px; max-width: 100%; border-inline: 1px solid var(--border); }
.frame-wrap[data-device="mobile"] { width: 390px; max-width: 100%; border-inline: 1px solid var(--border); }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-empty { align-self: center; text-align: center; color: var(--muted); padding: 24px; max-width: 360px; }
.preview-hint { flex: none; padding: 6px 12px; font-size: 12px; color: var(--faint); border-top: 1px solid var(--border); }

/* side */
.side-section { padding: 14px; border-bottom: 1px solid var(--border); }
.side-section:last-child { border-bottom: 0; }
.side-section h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.commit { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.commit-body { flex: 1; min-width: 0; }
.commit-subject { overflow-wrap: anywhere; }
.commit-meta { font-size: 11.5px; color: var(--faint); }
.publish-list { display: flex; flex-direction: column; gap: 8px; }
.publish-list .why { font-size: 12px; color: var(--faint); margin-top: -4px; }
details.log { margin-top: 10px; font-size: 12px; }
details.log pre { max-height: 200px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; }

.mobile-tabs { display: none; }

/* ---- admin ---- */
.admin-grid { display: grid; gap: 18px; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.box-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.box-head h2 { margin: 0; font-size: 16px; }
.box-body { padding: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .select { height: 30px; width: auto; font-size: 13px; }
td .input { height: 30px; font-size: 12.5px; font-family: var(--mono); min-width: 260px; }
.form-row { display: grid; grid-template-columns: 1.2fr 1.4fr 140px auto; gap: 10px; align-items: end; }
.invite-out { margin-top: 12px; display: flex; gap: 8px; }
.invite-out .input { font-family: var(--mono); font-size: 12.5px; }

/* ---- toast & dialog ---- */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 9px;
  font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
}
dialog {
  border: 1px solid var(--border); border-radius: 12px; padding: 0; width: min(440px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgb(10 12 16 / 45%); }
.dialog-body { padding: 20px; }
.dialog-body h2 { margin: 0 0 8px; font-size: 17px; }
.dialog-body p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .ws { gap: 12px; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .ws-resizer { display: none; }
  .ws .side { grid-column: 1 / -1; max-height: 260px; }
  .ws .side .panel-body { display: block; }
}
@media (max-width: 820px) {
  .runtime-label, .who-name { display: none; }
  .mobile-tabs {
    display: flex; gap: 4px; padding: 8px 12px 0; background: var(--bg);
  }
  .mobile-tabs button {
    flex: 1; height: 34px; border: 1px solid var(--border); background: var(--surface);
    border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; color: var(--muted);
  }
  .mobile-tabs button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
  .ws { gap: 12px; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); padding: 8px 12px 12px; }
  .ws .side { max-height: none; grid-column: auto; }
  .ws .side .panel-body { display: block; }
  .ws .side .side-section { border-right: 0; border-bottom: 1px solid var(--border); }
  .ws > [data-pane]:not(.active) { display: none; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---- agent working feedback ---- */
.working {
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent-soft);
  padding: 10px 12px; font-size: 13.5px;
}
.working-head { display: flex; align-items: center; gap: 9px; }
.working-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgb(23 132 90 / 45%); } 50% { box-shadow: 0 0 0 6px rgb(23 132 90 / 0%); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.working-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 180px; overflow: auto; }
.working-steps li { display: flex; gap: 7px; align-items: baseline; color: var(--muted); overflow-wrap: anywhere; }
.working-steps li::before { content: "✓"; color: var(--accent); font-size: 11px; flex: none; }
.working-steps li.now { color: var(--text); font-weight: 550; }
.working-steps li.now::before { content: "›"; font-weight: 700; }
.working-foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.working-slow { color: var(--warn); }
.stage { position: relative; }
.stage-status {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 99px;
  background: var(--text); color: var(--bg); font-size: 13px; box-shadow: var(--shadow-lg); max-width: calc(100% - 24px);
}
.stage-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.banner .btn { margin-top: 8px; }

/* ---- account / model pickers ---- */
.composer-row .pick { height: 30px; font-size: 12.5px; width: auto; max-width: 150px; padding: 0 22px 0 8px; }
.acct-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.acct-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
dialog .seg button { height: 30px; }
.ac-prov { display: flex; flex-wrap: wrap; gap: 6px 16px; border: 0; margin: 0 0 8px; padding: 0; }
.ac-prov legend { padding: 0; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
@media (max-width: 420px) { .composer-row .hint { display: none; } }
.ico { width: 17px; height: 17px; flex: none; display: block; }
.btn-sm .ico { width: 16px; height: 16px; }
.composer-row .hint-locked { color: var(--warn); font-weight: 600; }

/* composer row: pickers share the space, buttons never shrink, hint on its own line */
.composer-row { flex-wrap: wrap; row-gap: 6px; }
.composer-row .pick { flex: 1 1 0; min-width: 0; max-width: none; }
.composer-row .btn { flex: none; }
.composer-row .hint { order: 10; flex-basis: 100%; margin: 0; font-size: 11.5px; line-height: 1.3; }

/* ---- agents indicator ---- */
.agents { position: relative; }
.agents-btn { gap: 7px; }
.agents-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.agents-btn.is-busy { border-color: var(--accent); color: var(--accent); }
.agents-btn.is-busy .agents-dot { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.agents-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: min(360px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.agents-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 8px 4px; display: flex; justify-content: space-between; }
.agent-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 7px; color: var(--text); }
.agent-row:hover { background: var(--surface-2); text-decoration: none; }
.agent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13.5px; }
.agent-main .faint { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; opacity: .5; }
.agent-dot-fail { background: var(--danger); }
.agents-empty { padding: 8px; font-size: 13px; }

/* ---- usage ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12.5px; color: var(--faint); }
.chart-box, .page .box + .box { margin-bottom: 18px; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart text { fill: var(--faint); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .bars path, .chart .bars rect { fill: var(--accent); }
.chart .hits rect { fill: transparent; cursor: default; outline: none; }
.chart .hits rect.on { fill: var(--accent-soft); fill-opacity: .55; }
.chart-tip {
  position: absolute; top: 0; min-width: 140px; pointer-events: none; z-index: 5;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg);
  padding: 8px 10px; font-size: 12.5px; color: var(--text);
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar .select { width: auto; min-width: 180px; flex: 0 0 auto; }
.usage-note { font-size: 12px; margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.chart .bars { pointer-events: none; }
.commit-subject.is-undone { color: var(--faint); text-decoration: line-through; }

/* ---- user menu ---- */
.usermenu { position: relative; }
.who { display: flex; align-items: center; gap: 8px; border: 1px solid transparent; background: transparent; border-radius: 99px; padding: 3px 8px 3px 3px; cursor: pointer; font-size: 14px; }
.who:hover, .who[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 180px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.menu-panel a, .menu-panel button { display: block; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font-size: 14px; cursor: pointer; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel a[hidden] { display: none; }

/* ---- side panel as drawer on medium widths ---- */
.side-toggle, .side-drawer-head { display: none; }
@media (max-width: 1180px) and (min-width: 821px) {
  .ws { gap: 12px; grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .ws .side {
    position: fixed; top: 64px; right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); max-height: none; z-index: 30;
    box-shadow: var(--shadow-lg); transform: translateX(calc(100% + 24px)); transition: transform .18s ease; grid-column: auto;
  }
  .ws.side-open .side { transform: none; }
  .ws .side .panel-body { display: block; }
  .ws .side .side-section { border-right: 0; border-bottom: 1px solid var(--border); }
  .side-toggle { display: inline-flex; }
  .side-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); }
}
@media (prefers-reduced-motion: reduce) { .ws .side { transition: none; } }

/* ---- small screens: compact top bar ---- */
@media (max-width: 820px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand { font-size: 0; gap: 0; }
  .brand .brand-mark { font-size: 15px; }
  .crumbs { flex: 1; min-width: 0; }
  .crumbs .sep { margin-left: 4px; }
  .topbar-right { gap: 6px; }
  .who-name, #who-role, .runtime-label { display: none; }
  .agents-btn #agents-count { font-size: 12px; }
}
@media (max-width: 820px) {
  /* phone: the three panes become one at a time, switched by a bottom tab bar (thumb reach, safe area aware) */
  main { display: flex; flex-direction: column; }
  .mobile-tabs { order: 2; flex: none; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 6px; border-top: 1px solid var(--border); background: var(--surface); }
  .mobile-tabs button { height: 44px; font-size: 14px; border: 0; background: none; border-radius: var(--radius-sm); }
  .mobile-tabs button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
  .mobile-tabs + .ws { order: 1; flex: 1; min-height: 0; height: auto; padding: 8px; }
  .composer { padding-bottom: 10px; }
  .btn, .select, .input { min-height: 40px; }
}
/* installed app: no browser chrome, so keep the top bar below the notch */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
}
.share-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.share-list .card { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.menu-panel button[hidden] { display: none; }
.budget-input { width: 96px; height: 30px; font-size: 13px; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.slack-input { width: 120px; height: 30px; font-family: var(--mono); font-size: 12px; }
.wp-steps { margin: 0 0 10px; padding-left: 18px; font-size: 13px; color: var(--muted); } .wp-steps li { margin-bottom: 4px; }
.import-log { margin-top: 14px; max-height: 280px; overflow: auto; white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; line-height: 1.45; }

/* ---- attachments ---- */
.pending-att { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.att-chip { position: relative; width: 56px; height: 56px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.att-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-chip button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 60%); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.att-chip button .ico { width: 12px; height: 12px; }
.msg-att { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.msg-att img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid rgb(255 255 255 / 30%); }
.composer.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }

/* ---- reviews ---- */
.review-status { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
dialog.dialog-wide { width: min(980px, calc(100% - 32px)); }
pre.diff { font-family: var(--mono); font-size: 12px; line-height: 1.45; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; overflow: auto; max-height: 50vh; white-space: pre; }
pre.diff .d-add { color: var(--accent); background: var(--accent-soft); display: inline-block; min-width: 100%; }
pre.diff .d-del { color: var(--danger); background: var(--danger-soft); display: inline-block; min-width: 100%; }
pre.diff .d-hunk { color: var(--muted); }
pre.diff .d-meta { color: var(--faint); }

/* ---- add project ---- */
.card-add { align-items: center; justify-content: center; text-align: center; gap: 4px; border: 1.5px dashed var(--border); background: transparent; color: var(--muted); }
.card-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.card-add__plus { font-size: 30px; line-height: 1; font-weight: 300; }
.card-add__label { font-weight: 600; font-size: 15px; color: inherit; }
.card-add__hint { font-size: 12.5px; color: var(--faint); }
.add-project[hidden] { display: none; }

/* ---- new project modal ---- */
dialog.np-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); padding: 0; display: flex; flex-direction: column; }
dialog.np-dialog:not([open]) { display: none; }
.np-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.np-head h2 { margin: 0; font-size: 18px; }
.np-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.np-tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.np-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.np-body { padding: 18px 20px 20px; overflow: auto; }
.np-body .form-row { margin-bottom: 4px; }
@media (max-width: 600px) { .np-body .form-row { grid-template-columns: 1fr !important; } }
/* new-project dialog spacing */
.np-body > div > p:first-child { margin: 0 0 18px; }
.np-body form { display: flex; flex-direction: column; gap: 14px; }
.np-body form .form-row { margin: 0; }
.np-body form details { margin: 0; }
.np-body form > .btn { align-self: flex-start; }
.np-body .notice { margin-top: 16px; }
.np-body .notice + div { display: flex; gap: 8px; margin-top: 12px; }
/* templates in the new-project dialog */
.np-body p.muted { margin: 0 0 16px; font-size: 14px; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tpl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.tpl-card:hover { border-color: var(--accent); }
.tpl-card[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl-card__name { font-weight: 650; font-size: 14px; }
.tpl-card__art { width: 100%; height: auto; aspect-ratio: 160 / 84; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 4px; }
.tpl-card__art .a-frame { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; }
.tpl-card__art .a-soft { fill: var(--surface-2); stroke: var(--border); stroke-width: .8; }
.tpl-card__art .a-line { fill: var(--border); }
.tpl-card__art .a-ink { fill: var(--muted); }
.tpl-card__art .a-accent { fill: var(--accent); }
.tpl-card__art .a-accent-soft { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 2; }
.tpl-card__art .a-arrow, .tpl-card__art .a-grip { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tpl-card__art .a-text { font: 600 7px/1 ui-monospace, monospace; fill: var(--muted); }
.tpl-card__art .a-text--ink { fill: var(--text); }
.tpl-card[aria-checked="true"] .tpl-card__art, .tpl-card:hover .tpl-card__art { background: var(--accent-soft); }
.tpl-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; flex: 1; }
.tpl-repo { display: flex; flex-direction: column; }
#tpl-repos { display: flex; flex-direction: column; gap: 10px; }
.np-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.tpl-spec summary { cursor: pointer; font-size: 13.5px; color: var(--muted); }
.tpl-spec pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); max-height: 220px; overflow: auto; margin: 8px 0 0; }

/* History (side panel) */
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.history__item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.35; }
.history__dot { flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.history__dot.is-local { background: transparent; box-shadow: inset 0 0 0 1.5px var(--warn, #b7791f); }
.history__text { display: flex; flex-direction: column; min-width: 0; }
.history__subject { color: var(--text); overflow-wrap: anywhere; }
.history__text .faint { font-size: 12px; }
.history__pushes { font-size: 12px; margin-top: 10px; }

/* What "Push to GitLab" does (side panel) */
.push-effect { font-size: 12.5px; line-height: 1.4; margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.push-effect--staging { background: var(--accent-soft); }
.push-effect--production, .push-effect--check { background: color-mix(in srgb, var(--danger, #c0392b) 12%, transparent); color: var(--text); font-weight: 600; }

/* publish: one target picker, explanation, one action */
.publish { display: flex; flex-direction: column; gap: 8px; }
.publish__pick { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.publish__pick .select { flex: 1; height: 34px; font-size: 13.5px; }
.publish .push-effect { margin-top: 0; }
.publish .why { font-size: 12px; color: var(--faint); margin-top: -2px; }
.wp-state { font-size: 13.5px; margin: 0; display: flex; align-items: center; gap: 6px; }
.dot-ok { background: var(--accent, #2f9e63); }
.publish .btn-block { white-space: normal; height: auto; min-height: 36px; padding: 8px 14px; line-height: 1.25; text-align: center; }

/* ---- content sync (local ↔ peer) ---- */
.side-section--content { container-type: inline-size; container-name: cs; }
.cs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cs-peer { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-note { font-size: 12.5px; margin: 0 0 8px; }
.cs-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 10px; }
.cs-stamp { font-size: 12px; white-space: nowrap; }
.cs-last { font-size: 12.5px; margin: 0 0 10px; padding: 6px 10px; background: var(--surface-2); border-radius: var(--radius-sm); color: var(--muted); }
.cs-last:empty { display: none; }
.cs-bulk { font-size: 12.5px; color: var(--faint); margin-bottom: 8px; }
.cs-l1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cs-l2 { font-size: 12px; }
.cs-dir { margin-top: 2px; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover { text-decoration-thickness: 2px; }
.linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.cs-empty { font-size: 13px; margin: 0; }
.cs-table { display: flex; flex-direction: column; gap: 8px; }
.cs-row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cs-item { min-width: 0; }
.cs-title { font-weight: 600; overflow-wrap: anywhere; }
.cs-badge { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 1px 5px; vertical-align: middle; }
.cs-badge--status { color: var(--warn); background: var(--warn-soft); }
.cs-pill { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 99px; padding: 2px 8px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.cs-pill--local { background: var(--accent-soft); color: var(--accent); }
.cs-pill--remote { background: var(--info-soft); color: #2f5aa8; }
.cs-pill--conflict { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) { .cs-pill--remote { color: #8fb4ff; } }
.cs-seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 2px; max-width: 100%; }
.cs-seg button { border: 0; background: transparent; height: 24px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.cs-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cs-seg button[aria-pressed="true"][data-dir="push"] { color: var(--danger); }
.cs-seg button[aria-pressed="true"][data-dir="pull"] { color: var(--accent); }
.cs-seg button:disabled { opacity: .35; cursor: not-allowed; }
/* content groups: one per post type / taxonomy, or per decision bucket */
.cs-groups { display: flex; flex-direction: column; gap: 8px; }
.cs-group { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.cs-group__head { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; }
.cs-group__toggle { display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; min-width: 0; }
.cs-group__toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cs-group__chev { flex: none; color: var(--muted); transition: transform .15s; }
.cs-group[data-open="false"] .cs-group__chev { transform: rotate(-90deg); }
.cs-group__name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-group__n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cs-group__body { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; }
.cs-meter { display: flex; gap: 1px; height: 5px; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.cs-meter i { display: block; min-width: 3px; }
.cs-meter--conflict { background: var(--warn); }
.cs-meter--local { background: var(--accent); }
.cs-meter--remote { background: #2f5aa8; }
.cs-meter--same { background: var(--border); }
.cs-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11.5px; color: var(--muted); }
.cs-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: var(--border); }
.cs-legend--conflict::before { background: var(--warn) !important; }
.cs-legend--local::before { background: var(--accent) !important; }
.cs-legend--remote::before { background: #2f5aa8 !important; }
@media (prefers-color-scheme: dark) { .cs-meter--remote, .cs-legend--remote::before { background: #8fb4ff !important; } }
.cs-group__ctl { display: flex; }
.cs-same { font-size: 12px; align-self: flex-start; }
/* sync plan from the chat agent: banner in the Pages tab, card under the chat */
.cs-proposal, .cs-propcard { display: flex; flex-direction: column; gap: 6px; padding: 10px; margin-bottom: 10px; border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 12.5px; }
.cs-propcard { margin: 4px 0 12px; max-width: 420px; }
.cs-proposal__t { font-weight: 700; color: var(--accent); }
.cs-proposal__note { margin: 0; white-space: pre-wrap; }
.cs-proposal__warn { margin: 0; padding: 6px 8px; border-radius: 5px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.cs-proposal__act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-proposal__act > span { flex: 1; min-width: 0; }
.cs-cluster { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius-sm); background: var(--warn-soft); }
.cs-cluster__t { font-size: 12.5px; font-weight: 700; color: var(--warn); }
.cs-cluster__p { margin: 0; font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-cluster__act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.cs-cluster .cs-seg { background: var(--surface); align-self: flex-start; }
.cs-cluster .cs-seg button[aria-pressed="true"] { background: var(--surface-2); }
.cs-cluster__items > summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.cs-cluster__items[open] > summary { margin-bottom: 6px; }
.cs-cluster__items .cs-row { background: var(--surface); }
.cs-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.cs-chip-n { font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.cs-chip-n--ok { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .cs-group__chev { transition: none; } }
.cs-bar { display: flex; align-items: center; gap: 10px; position: sticky; bottom: 0; z-index: 2; background: var(--surface); margin-top: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.cs-bar:empty { display: none; }
.cs-sum { flex: 1; min-width: 0; }
.cs-progress { flex: 0 0 96px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.cs-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .cs-progress i { transition: none; } }
.cs-sum--busy { display: flex; align-items: center; gap: 6px; color: var(--text); font-weight: 600; }
#cs-results:not(:empty) { margin-bottom: 10px; }
.cs-run { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.cs-run__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-run__head .btn { margin-left: auto; }
.cs-run__items { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.cs-run__st { display: inline-block; min-width: 54px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--accent); }
.cs-run__items .is-skipped .cs-run__st { color: var(--faint); }
.cs-run__items .is-failed .cs-run__st { color: var(--danger); }
.cs-run__head > span { flex: 1; min-width: 0; }
.cs-run__fail { color: var(--danger); font-weight: 600; }
.cs-run__groups { margin-top: 4px; font-size: 12.5px; }
.cs-run__all { margin-top: 4px; font-size: 12.5px; }
.cs-run__all > summary { cursor: pointer; color: var(--muted); }
.cs-run__all > .cs-run__items { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
#cs-results > .btn { margin-top: 8px; }
.history__runs { margin-top: 12px; }
.history__runs > .faint { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.history__dot.is-fail { background: var(--danger); }
.history__undo { margin-left: auto; height: 24px; padding: 0 8px; font-size: 12px; flex: none; }
/* diff modal: Local | peer, word-level inline diff */
dialog.dialog--wide { width: min(900px, calc(100% - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column; }
dialog.dialog--wide:not([open]) { display: none; }
dialog.dialog--wide .dialog-body { overflow: auto; min-height: 0; }
.cd h2 { display: flex; align-items: center; gap: 8px; }
.cd-grid { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; overflow: hidden; }
.cd-row { display: grid; grid-template-columns: 110px 1fr 1fr; border-top: 1px solid var(--border); }
.cd-row:first-child { border-top: 0; }
.cd-row--head { background: var(--surface-2); }
.cd-row--sub .cd-lbl { font-weight: 700; color: var(--text); }
.cd-row.is-changed .cd-lbl::after { content: " •"; color: var(--warn); }
.cd-lbl { padding: 6px 10px; color: var(--muted); border-right: 1px solid var(--border); overflow-wrap: anywhere; }
.cd-cell { padding: 6px 10px; min-width: 0; overflow-wrap: anywhere; }
.cd-cell + .cd-cell { border-left: 1px solid var(--border); }
.cd-cell--span { grid-column: 2 / -1; }
.cd-row.is-changed .cd-cell { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.cd-text { white-space: pre-wrap; line-height: 1.5; max-height: 50vh; overflow: auto; }
.cd del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; text-decoration-thickness: 1px; border-radius: 3px; }
.cd ins { background: var(--accent-soft); color: var(--accent); text-decoration: none; border-radius: 3px; }
@media (max-width: 640px) { .cd-row { grid-template-columns: 1fr; } .cd-lbl { border-right: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); } .cd-cell + .cd-cell { border-left: 0; border-top: 1px dashed var(--border); } .cd-cell--span { grid-column: auto; } }

/* side panel tabs */
.side-tabs { flex: none; display: flex; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.side-tabs [role="tab"] { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 10px 4px; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.side-tabs [role="tab"]:hover { color: var(--text); }
.side-tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.side-tabs [role="tab"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; }
.side-section[data-spanel]:not(.is-active) { display: none; }
.side-section.is-active:not(.side-section--sub) > h3 { display: none; }
.side-section.is-active { border-bottom: 0; }

/* pinned status strip above the tabs */
.side-strip { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 7px 14px; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.side-strip[hidden] { display: none; }
.side-strip__text { min-width: 0; }
.publish__host { font-size: 12px; margin-top: -4px; }
.publish__xref { margin-top: 2px; }
.wp-box { margin-bottom: 12px; }
.wp-box:empty { display: none; }
.wp-state .dot:not(.dot-ok) { background: var(--faint); }
.cd-internal { margin: 14px 0 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; }
.cd-internal summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.cd-internal__note { font-size: 12.5px; margin: 8px 0; }
.cd-grid--internal .cd-lbl { word-break: break-all; font-size: 11.5px; }
.cd-small { font-size: 11.5px; word-break: break-all; }
.cd-actions { gap: 8px; flex-wrap: wrap; }

/* ---------- feedback ---------- */
#feedback-btn { gap: 6px; }
dialog.fb-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.fb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.fb-kinds { display: flex; width: 100%; margin-bottom: 14px; }
.fb-kinds button { flex: 1; }
.fb-rec { margin-bottom: 12px; }
.fb-rec p { font-size: 12.5px; margin: 6px 0 0; }
.fb-rec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.fb-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--danger); font-variant-numeric: tabular-nums; }
.fb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: fb-blink 1.2s ease-in-out infinite; }
@keyframes fb-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .fb-dot { animation: none; } }
.fb-video { display: block; width: 100%; max-height: 260px; margin-top: 8px; border-radius: var(--radius-sm); background: #000; }
.fb-video[hidden] { display: none; }
.fb-ctx { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.fb-ctx summary { cursor: pointer; }
.fb-ctx dl { margin: 6px 0 0; display: grid; gap: 2px; }
.fb-ctx dl div { display: grid; grid-template-columns: 70px 1fr; gap: 8px; }
.fb-ctx dt { color: var(--faint); }
.fb-ctx dd { margin: 0; overflow-wrap: anywhere; }
.fb-done p { margin: 0 0 8px; color: var(--text); }
.fb-hint { margin-right: auto; font-size: 12px; align-self: center; }
.fb-hint kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.fb-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.fb-cell { min-width: 260px; max-width: 480px; }
.fb-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-meta { font-size: 12px; margin-top: 4px; }
#feedback-open:empty { display: none; }
@media (max-width: 820px) { .feedback-label { display: none; } #feedback-btn { width: 34px; padding: 0; justify-content: center; } .fb-hint { display: none; } }

/* media sync: thumbnail in the row, preview in the diff dialog */
.cs-thumb { display: inline-block; inline-size: 28px; block-size: 28px; border-radius: 4px; object-fit: cover; vertical-align: middle; margin-inline-end: 8px; background: var(--border); flex: none; }
.cs-size { font-size: .85em; margin-inline-start: 6px; white-space: nowrap; }
.cd-img { display: block; max-inline-size: 100%; max-block-size: 220px; border-radius: 6px; object-fit: contain; background: var(--border); }

/* sync history dialog: one sentence per run, details on demand */
.sh > p { margin-bottom: 12px; }
#sh-list { display: flex; flex-direction: column; gap: 10px; }
.sh-run { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.sh-run.is-focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sh-run__head { display: flex; gap: 10px; align-items: flex-start; }
.sh-dir { flex: none; inline-size: 28px; block-size: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.sh-dir--pull { background: var(--info-soft); color: var(--text); }
.sh-run__main { flex: 1; min-width: 0; }
.sh-run__title { margin: 0; font-size: 14px; color: var(--text); line-height: 1.35; }
.sh-run__meta { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.sh-chips { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.sh-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.sh-chip b { color: var(--text); font-weight: 600; }
.sh-badge { flex: none; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.sh-badge--ok { background: var(--accent-soft); color: var(--accent); }
.sh-badge--undone { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.sh-badge--fail { background: var(--danger-soft); color: var(--danger); }
.sh-badge--warn { background: var(--warn-soft); color: var(--warn); }
.sh-run__actions { display: flex; gap: 6px; margin: 10px 0 0 38px; }
.sh-run__detail { margin: 12px 0 0 38px; display: flex; flex-direction: column; gap: 10px; }
.sh-problems { background: var(--danger-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.sh-problems ul { margin: 6px 0 0; padding-left: 18px; }
.sh-group > summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.sh-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sh-entry { border-top: 1px solid var(--border); padding: 6px 10px; font-size: 13px; }
.sh-entry:first-child { border-top: 0; }
.sh-entry__row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sh-entry__title { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.sh-entry__btn { font-size: 12px; }
.sh-entry__cmp { margin: 8px 0 4px; }
.sh-tag { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.sh-tag--new { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.sh-note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.sh-cmp .cd-row { grid-template-columns: 110px 1fr 1fr; }
.sh-tech > summary, .sh-raw > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.sh-dl { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 12.5px; margin: 8px 0; }
.sh-dl dt { color: var(--muted); }
.sh-dl dd { margin: 0; overflow-wrap: anywhere; }
.sh-raw pre { font-family: var(--mono); font-size: 11.5px; max-height: 280px; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 640px) { .sh-run__actions, .sh-run__detail { margin-left: 0; } .sh-dl { grid-template-columns: 1fr; } .sh-cmp .cd-row { grid-template-columns: 1fr; } }
.sh-open { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sh-open a { color: var(--accent); }

/* ClickUp: tickets linked to the chat, agent proposals, @clickup picker */
.cu-tickets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 12px 0; font-size: 12.5px; }
.cu-tickets__l { color: var(--faint); font-weight: 600; }
.cu-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 4px 2px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.cu-chip a { color: var(--text); text-decoration: none; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-chip a:hover { text-decoration: underline; }
.cu-chip button { display: inline-flex; border: 0; background: none; color: var(--faint); padding: 2px; border-radius: 50%; cursor: pointer; }
.cu-chip button:hover, .cu-chip button:focus-visible { color: var(--text); background: var(--surface-2); }
.cu-chip button .ico { width: 13px; height: 13px; }
.cu-chip__st { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--info-soft); color: var(--muted); white-space: nowrap; text-transform: lowercase; }
#cu-cards { display: grid; gap: 8px; margin: 4px 0 8px; }
.cu-card { border: 1px solid var(--border); border-left: 3px solid #7b68ee; border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px; font-size: 13.5px; }
.cu-card--done { border-left-color: var(--accent); color: var(--muted); }
.cu-card__t { font-weight: 600; margin-bottom: 6px; }
.cu-card .textarea { min-height: 0; font-size: 13.5px; }
.cu-card__row { display: flex; align-items: center; gap: 8px; }
.cu-card__row .select { width: auto; }
.cu-card__act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.composer { position: relative; }
.cu-pick { position: absolute; left: 12px; right: 12px; bottom: calc(100% - 4px); z-index: 20; max-height: 300px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.cu-pick__head { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.cu-pick__head .faint { margin-left: auto; }
.cu-pick ul { list-style: none; margin: 0; padding: 4px; overflow: auto; }
.cu-pick li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; }
.cu-pick li[aria-selected="true"], .cu-pick li:hover { background: var(--accent-soft); }
.cu-pick__n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cu-pick li .faint { font-size: 12px; white-space: nowrap; }
.cu-pick__msg { padding: 12px; font-size: 13px; }

.cu-start { display: grid; gap: 6px; max-width: 420px; margin: 18px auto 0; text-align: left; font-size: 13px; }
.cu-start .select { width: 100%; }

/* × in the dialog corner (outside the scrolling body) */
#dialog .dialog-x { position: absolute; top: 12px; right: 12px; z-index: 2; color: var(--muted); }
#dialog .dialog-x:hover { color: var(--text); }
#dialog:has(.dialog-x) h2 { padding-right: 36px; }

/* help */
.help h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 16px 0 6px; }
.help h3 .faint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.help__t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.help__t td { padding: 5px 8px 5px 0; vertical-align: top; border-top: 1px solid var(--border); }
.help__t td:first-child { width: 110px; white-space: nowrap; color: var(--accent); font-weight: 600; }
.help__t tr.is-off { opacity: .55; }

/* plan card (```sitemap) */
.plan-card { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); padding: 10px 12px; margin: 8px 0; }
.plan-card__t { font-weight: 700; margin-bottom: 6px; }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plan-card li { display: flex; align-items: flex-start; gap: 6px; padding-left: calc(var(--d, 0) * 22px); }
.plan-card__item { display: grid; gap: 2px; flex: 1; min-width: 0; }
.plan-card__item .input { padding: 4px 8px; font-size: 13.5px; }
.plan-card__item .faint { font-size: 12px; }
.plan-card__act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }

/* result cards under the agent's reply */
.res-cards { display: grid; gap: 6px; margin-top: 8px; }
.res-card { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); padding: 8px 10px; font-size: 13.5px; }
.res-card.is-undone { border-left-color: var(--border); color: var(--muted); }
.res-card__k { font-weight: 700; }
.res-card__act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }

/* "/" commands */
.cu-pick__thumb { width: 44px; height: 32px; object-fit: cover; border-radius: 4px; flex: none; background: var(--surface-2); }
.cmd-pick__k { width: 70px; flex: none; color: var(--accent); font-weight: 600; }
.cmd-pick li.is-off { opacity: .6; }
.cmd-form__set { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 0 0 12px; display: grid; gap: 6px; }
.cmd-form__set legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.cmd-form .check { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* project details */
.pd h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 18px 0 8px; }
.pd .kv dd { white-space: normal; overflow-wrap: anywhere; }
.pd-info { font-size: 14px; line-height: 1.55; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.pd-info > :first-child { margin-top: 0; } .pd-info > :last-child { margin-bottom: 0; }
.pd .textarea { min-height: 140px; }
.pd .textarea.pd-short { min-height: 0; }
@media (max-width: 640px) { .cu-pick { left: 6px; right: 6px; } .cu-chip a { max-width: 16ch; } }

/* Migration overview */
.mig-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.mig-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 14px; display: flex; flex-direction: column; min-width: 110px; }
.mig-stat strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.mig-stat span { font-size: 12px; color: var(--muted); }
.mig-table td { vertical-align: top; }
.mig-chip { border: 0; cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; }
.mig-chip:disabled { cursor: default; }
.mig-chip.mig-over { outline: 1px dashed currentColor; outline-offset: 1px; }
.chip-todo { background: var(--danger-soft); color: var(--danger); }
.mig-envs { font-size: 12px; margin-top: 4px; color: var(--muted); white-space: nowrap; }
.mig-envs a { color: inherit; }
.mig-complete td:first-child a { color: var(--muted); }
.mig-note { font-size: 13px; min-width: 160px; max-width: 240px; }
.mig-note__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.mig-note__text.open { display: block; }
.mig-note .link-btn { padding: 0; margin-right: 6px; font-size: 12px; }
.link-btn { border: 0; background: none; color: var(--faint); cursor: pointer; font: inherit; padding: 0 4px; }
.link-btn:hover { color: var(--text); }

/* conversion lane on /migration: 12 playbook stations */
.mig-conv { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; flex-wrap: wrap; }
.mig-bar { display: inline-flex; gap: 2px; }
.mig-bar i { width: 7px; height: 7px; border-radius: 2px; background: var(--border); }
.mig-bar i.on { background: var(--accent); }
.mig-bar i.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Sites: maintenance + security status (lib/fleet.js) */
.seg-n { font-size: 11px; color: var(--muted); margin-left: 2px; font-variant-numeric: tabular-nums; }
.site-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.site-list li + li { border-top: 1px solid var(--border); }
.site-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; color: inherit; text-decoration: none; min-height: 52px; }
.site-row:hover { background: var(--accent-soft); }
.site-av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; }
.site-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.site-name strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-name .faint { font-size: 12px; }
.site-checks { display: flex; gap: 6px; flex: none; }
.st { display: inline-flex; align-items: center; gap: 2px; min-width: 26px; height: 26px; justify-content: center; border-radius: 6px; padding: 0 4px; }
.st .ico { width: 16px; height: 16px; }
.st b { font-size: 11px; font-variant-numeric: tabular-nums; }
.st-ok { color: var(--accent); }
.st-warn { color: var(--warn); background: var(--warn-soft); }
.st-crit { color: var(--danger); background: var(--danger-soft); }
.st-none { color: var(--faint); opacity: .6; }
.site-last { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex: none; width: 92px; justify-content: flex-end; }
.site-last .ico { width: 14px; height: 14px; }
@media (max-width: 760px) {
  .site-row { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .site-name { flex-basis: calc(100% - 44px); }
  .site-checks { order: 3; flex-wrap: wrap; }
  .site-last { order: 4; margin-left: auto; width: auto; }
}
.site-h { font-size: 16px; margin: 26px 0 10px; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.site-card { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.site-card .ico { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.site-card div { display: flex; flex-direction: column; font-size: 13px; }
.site-card span { color: var(--muted); }
.site-card.st-warn, .site-card.st-crit { background: var(--surface); border-color: currentColor; }
.site-card.st-none { opacity: 1; color: var(--faint); }
.site-findings { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.run { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.run > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.run-when { font-weight: 600; font-variant-numeric: tabular-nums; }
.run-what { color: var(--muted); flex: 1; min-width: 160px; }
.run-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.run-changes { width: 100%; border-collapse: collapse; font-size: 13px; }
.run-changes th, .run-changes td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.run-changes th { font-size: 12px; color: var(--muted); font-weight: 500; }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.shot { margin: 0; }
.shot figcaption { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.shot img { display: block; width: 100%; max-height: 640px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--border); }
.shot-none { display: grid; place-items: center; min-height: 160px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--faint); font-size: 13px; }
.run-log pre { max-height: 260px; overflow: auto; font-size: 11.5px; background: var(--bg, transparent); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.run-log summary { font-size: 12px; color: var(--muted); cursor: pointer; }
@media (max-width: 600px) { .shots { grid-template-columns: 1fr; } }
.sites-toolbar { flex-wrap: wrap; }
.sites-toolbar #sq { margin-left: auto; width: 240px; }
.sites-toolbar select { width: auto; }
@media (max-width: 760px) {
  .sites-toolbar .seg { contain: inline-size; width: 100%; overflow-x: auto; } /* scrolls instead of widening the page */
  .sites-toolbar .seg button { flex: none; }
  .sites-toolbar #sq { margin-left: 0; flex: 1 1 0; width: auto; min-width: 0; }
}
