/* ============================================================
   TradeMax 多站点管理系统控制台
   Direction C · Modern Bento (light, warm-green neutrals, ochre accent)
   ============================================================ */

:root {
  --ground:          #f4f5f2;
  --ground-inset:    #eceee7;
  --tile:            #ffffff;
  --tile-quiet:      #fbfcf9;

  --ink:             #23271f;
  --ink-soft:        #454c40;
  --muted:           #737a6c;
  --faint:           #9aa08f;
  --hairline:        #e5e7df;
  --hairline-strong: #d6d9cd;

  --accent:          #c07a1e;
  --accent-strong:   #a5661a;
  --accent-tint:     #f7edda;
  --accent-tint-2:   #efdec1;
  --on-accent:       #fffaf1;

  --good:            #3f8f5f;
  --good-tint:       #e6f1ea;
  --warn:            #b07d1a;
  --warn-tint:       #f6ecd6;
  --critical:        #c0533a;
  --critical-tint:   #f8e8e2;

  --r-hero:  20px;
  --r-tile:  16px;
  --r-inset: 10px;
  --r-btn:   10px;
  --r-pill:  999px;

  --shadow-sm:   0 1px 2px rgba(35,39,31,.05), 0 1px 3px rgba(35,39,31,.04);
  --shadow-md:   0 1px 2px rgba(35,39,31,.05), 0 12px 26px -14px rgba(35,39,31,.20);
  --shadow-hero: 0 2px 6px rgba(120,74,20,.16), 0 22px 44px -18px rgba(120,74,20,.40);

  --font-display: Georgia, "Songti SC", "STSong", "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;

  --nav-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============================================================ SIDEBAR */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--nav-w); height: 100vh;
  background: linear-gradient(180deg, #fbfcf9 0%, #f3f5ee 100%);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  padding: 22px 16px 16px; z-index: 20;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 6px 8px 22px; }
.brand-logo { width: 150px; height: auto; display: block; }
.brand-sub { font-size: 10.5px; letter-spacing: 1.6px; color: var(--muted); padding-left: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--faint); padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-inset);
  color: var(--ink-soft); font-size: 13.5px; font-weight: 500;
  position: relative; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .82; }
.nav-item:hover { background: rgba(120,74,20,.06); color: var(--ink); }
.nav-item:hover svg { opacity: 1; }
.nav-item[aria-current="page"] { background: var(--accent-tint); color: var(--accent-strong); font-weight: 600; }
.nav-item[aria-current="page"] svg { opacity: 1; color: var(--accent); }
.nav-item[aria-current="page"]::before {
  content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 600;
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--critical-tint); color: var(--critical);
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-badge[hidden] { display: none; }

.sidebar-foot { margin-top: auto; }
.operator {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: var(--r-inset); background: var(--tile);
  border: 1px solid var(--hairline); box-shadow: var(--shadow-sm);
}
.avatar {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  background: linear-gradient(150deg, #55604a, #3a4232); color: #f4f5f2;
  font-weight: 600; font-size: 13px; display: grid; place-items: center; font-family: var(--font-display);
}
.operator-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.operator-name { font-size: 12.5px; font-weight: 600; }
.operator-status { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; min-width: 0; }
.operator-status span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-good { background: var(--good); box-shadow: 0 0 0 3px var(--good-tint); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-tint); }
.dot-critical { background: var(--critical); box-shadow: 0 0 0 3px var(--critical-tint); }

/* ============================================================ MAIN */
.main { margin-left: var(--nav-w); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 18px;
  padding: 16px 34px;
  background: rgba(244,245,242,.86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.page-kicker { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); margin: 0 0 1px; }
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: .2px; margin: 0; }
.topbar-spacer { flex: 1; }
.conn-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500; color: var(--ink-soft);
  background: var(--tile); border: 1px solid var(--hairline);
  border-radius: var(--r-pill); padding: 5px 12px; box-shadow: var(--shadow-sm);
}

/* view visibility */
.view { display: none; }
.view.is-active { display: block; animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .view.is-active { animation: none; } }

/* ============================================================ BUTTONS / FORMS */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-btn);
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13.5px;
  cursor: pointer; color: var(--ink);
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 2px 6px -1px rgba(120,74,20,.4); }
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 4px 12px -2px rgba(120,74,20,.5); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: wait; box-shadow: none; }
.btn.ghost { background: var(--tile); border-color: var(--hairline-strong); color: var(--ink-soft); font-weight: 500; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.danger { background: var(--tile); border-color: #e3b8ad; color: #a5432c; font-weight: 600; }
.btn.danger:hover { background: var(--critical-tint); border-color: var(--critical); }
.btn.tiny { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: wait; }

label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 5px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--tile); border: 1px solid var(--hairline-strong); border-radius: 8px;
  padding: 9px 11px;
}
textarea { font-family: var(--font-mono); font-size: 12.5px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192,122,30,.18);
}
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.hint code { font-family: var(--font-mono); font-size: 11.5px; background: var(--accent-tint); padding: .1em .4em; border-radius: 5px; color: var(--accent-strong); }
.row-end { display: flex; justify-content: flex-end; margin-top: 12px; }
.row-gap { display: flex; gap: 8px; align-items: center; }
.row-gap select { width: auto; }

/* ============================================================ BENTO (dashboard) */
.bento {
  display: grid; grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(96px, auto); gap: 16px;
  padding: 24px 34px 40px; max-width: 1320px;
}
.tile {
  background: var(--tile); border: 1px solid var(--hairline);
  border-radius: var(--r-tile); box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px; display: flex; flex-direction: column; min-width: 0;
}
.tile-kicker { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); margin: 0 0 auto; }
.kpi-num { font-size: 34px; font-weight: 650; line-height: 1.05; letter-spacing: -.5px; margin: 10px 0 2px; }
.kpi-num .unit { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.kpi-note { font-size: 11.5px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.delta-good { color: var(--good); }
.delta-critical { color: var(--critical); }

.tile-hero {
  grid-column: 1 / 6; grid-row: 1 / 3;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(158deg, #cf8a2c 0%, var(--accent) 42%, var(--accent-strong) 100%);
  border: none; border-radius: var(--r-hero); box-shadow: var(--shadow-hero);
  color: var(--on-accent); padding: 22px; overflow: hidden;
}
.hero-kicker { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,250,241,.72); margin: 0; }
.hero-cap { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 4px 0 0; color: rgba(255,250,241,.95); }
.hero-figure { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; }
.hero-num { font-size: 62px; font-weight: 680; line-height: .95; letter-spacing: -2px; }
.hero-num .unit { font-size: 28px; font-weight: 600; opacity: .82; letter-spacing: -1px; }
.hero-delta {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,.18); color: var(--on-accent);
  border-radius: var(--r-pill); padding: 3px 10px; margin-bottom: 8px;
}
.hero-compose { display: flex; gap: 3px; height: 10px; margin-top: 20px; }
.hero-compose span { height: 100%; border-radius: 3px; }
.hero-compose .s-active { background: #fffaf1; }
.hero-compose .s-paused { background: rgba(255,250,241,.6); }
.hero-compose .s-quar   { background: rgba(255,250,241,.32); }
.hero-compose .s-empty  { background: rgba(255,250,241,.2); }
.hero-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 12px; font-size: 11.5px; color: rgba(255,250,241,.85); }
.hero-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.hero-legend .lg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

.tile-active    { grid-column: 6 / 9;  grid-row: 1; }
.tile-published { grid-column: 9 / 13; grid-row: 1; }
.tile-indexed   { grid-column: 6 / 9;  grid-row: 2; }
.tile-tasks     { grid-column: 9 / 11; grid-row: 2; }
.tile-cost      { grid-column: 11 / 13; grid-row: 2; }
.tile-fleet     { grid-column: 1 / 9;  grid-row: 3; padding: 0; overflow: hidden; }
.tile-activity  { grid-column: 9 / 13; grid-row: 3; padding: 0; }

.fleet-head, .act-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--hairline);
}
.fleet-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0; }
.fleet-title small { font-family: var(--font-body); font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 8px; }
.act-head h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0; }
.link-quiet {
  font-size: 12.5px; font-weight: 600; color: var(--accent-strong);
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--r-inset);
  transition: background .15s ease;
}
.link-quiet:hover { background: var(--accent-tint); }
.link-quiet svg { width: 13px; height: 13px; }

.act-list { list-style: none; margin: 0; padding: 6px; }
.act-item { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 10px 12px; border-radius: var(--r-inset); }
.act-item:hover { background: var(--tile-quiet); }
.act-rail { display: flex; justify-content: center; padding-top: 5px; }
.act-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.act-text b { color: var(--ink); font-weight: 600; }
.act-time { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ============================================================ TABLES (shared) */
.content { padding: 24px 34px 40px; max-width: 1320px; display: flex; flex-direction: column; gap: 18px; }
.settings-savebar {
  position: sticky; top: 78px; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 14px 12px 18px;
  background: rgba(255,255,255,.94);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-tile);
  box-shadow: var(--shadow-md); backdrop-filter: blur(10px);
}
.settings-savebar > div { display: flex; flex-direction: column; min-width: 0; }
.settings-savebar strong { font-family: var(--font-display); font-size: 15px; }
.settings-savebar span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-savebar .btn { flex: none; }
.settings-result { margin: -8px 0 0; }
.panel { padding: 0; }
.panel > h2, .panel > .hint, .panel > label, .panel > input, .panel > textarea,
.panel > select, .panel > .row-end, .panel > .result { margin-left: 20px; margin-right: 20px; }
.panel > input, .panel > textarea, .panel > select { width: calc(100% - 40px); }
.panel > h2 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-top: 18px; margin-bottom: 6px; }
.panel > .hint:first-of-type { margin-top: 0; }
.panel > .row-end { margin-bottom: 18px; }
.panel.accent { border-top: 3px solid var(--accent); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--hairline); margin-bottom: 4px;
}
.panel-head h2 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin: 0; }

.csv-panel-head, .site-onboarding .panel-head { align-items: flex-start; }
.csv-panel-head > div:first-child, .site-onboarding .panel-head > div:first-child { min-width: 0; }
.csv-panel-head p, .site-onboarding .panel-head p {
  margin: 3px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.5;
}
.csv-actions { flex-wrap: wrap; justify-content: flex-end; }
.csv-file-label { margin: 0; cursor: pointer; }
.csv-panel-head .hint code, .panel > .hint code { overflow-wrap: anywhere; }
.csv-file-state {
  margin: -4px 20px 8px; color: var(--muted); font-size: 11px; line-height: 1.5;
}
#csv-input { font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65; }
.site-onboarding-grid {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 28px; padding: 4px 20px 18px;
}
.site-onboarding-grid h3 {
  margin: 0 0 12px; color: var(--ink); font: 650 13px/1.4 var(--font-body);
}
.csv-fields dl { display: grid; gap: 0; margin: 0; }
.csv-fields dl > div {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline);
}
.csv-fields dl > div:last-child { border-bottom: 0; }
.csv-fields dt {
  color: var(--accent-strong); font: 600 10.5px/1.55 var(--font-mono);
  overflow-wrap: anywhere;
}
.csv-fields dd { margin: 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.55; }
.post-create-steps ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.post-create-steps li {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start;
}
.post-create-steps li > span {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-tint); color: var(--accent-strong);
  font: 650 11px/1 var(--font-body);
}
.post-create-steps strong { display: block; color: var(--ink); font-size: 12px; }
.post-create-steps p { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.site-action-guide { padding: 2px 20px 18px; }
.site-action-guide h3 {
  margin: 0 0 10px; color: var(--ink); font: 650 13px/1.4 var(--font-body);
}
.site-action-guide dl {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0;
}
.site-action-guide dl > div {
  min-width: 0; padding: 10px 11px; border-radius: var(--r-inset); background: var(--ground);
}
.site-action-guide dt { color: var(--accent-strong); font-size: 11.5px; font-weight: 650; }
.site-action-guide dd { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }
.site-onboarding-note {
  margin: 0 20px 20px; padding: 10px 12px; border-radius: var(--r-inset);
  background: var(--warn-tint); color: var(--ink-soft); font-size: 11px; line-height: 1.55;
}
.site-onboarding-note code { font-family: var(--font-mono); overflow-wrap: anywhere; }
.site-onboarding-note + .site-onboarding-note { margin-top: -10px; }
.csv-format-note { background: var(--ground); }

@media (max-width: 720px) {
  .settings-savebar { top: 70px; }
  .settings-savebar span { max-width: 48vw; }
  .csv-panel-head, .site-onboarding .panel-head { flex-direction: column; }
  .csv-actions { width: 100%; justify-content: flex-start; }
  .site-onboarding-grid { grid-template-columns: 1fr; gap: 22px; }
  .csv-fields dl > div { grid-template-columns: 100px minmax(0, 1fr); }
  .site-action-guide dl { grid-template-columns: 1fr 1fr; }
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--faint); padding: 10px 20px; white-space: nowrap;
}
thead th.right, tbody td.right { text-align: right; }
tbody tr { border-top: 1px solid var(--hairline); transition: background .12s ease; }
tbody tr:hover { background: rgba(192,122,30,.045); }
tbody tr.is-selected { background: var(--accent-tint); }
tbody td { padding: 12px 20px; vertical-align: middle; }
.site-select-cell { width: 46px; padding-right: 0; }
.site-check {
  display: block; width: 16px; height: 16px; margin: 0;
  padding: 0; border-radius: 4px; accent-color: var(--accent); cursor: pointer;
}
.site-check:disabled { cursor: not-allowed; opacity: .42; }
.site-name, .fleet-name { font-weight: 600; color: var(--ink); }
.site-domain, .mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cost-breakdown summary { cursor: pointer; white-space: nowrap; }
.cost-breakdown > div {
  display: grid;
  gap: 2px;
  padding: 6px 0;
  border-top: 1px solid var(--hairline);
  min-width: 250px;
}
.cost-breakdown > div strong { font-size: 12px; text-transform: capitalize; }
.cost-breakdown .cost-call {
  display: block;
  padding-left: 10px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.setting-key-row { display: flex; align-items: center; gap: 10px; }
.setting-key-row input { flex: 1; min-width: 0; }
.setting-key-row .btn { flex: none; white-space: nowrap; }
td a { color: var(--accent-strong); }
td a:hover { text-decoration: underline; text-underline-offset: 3px; }
.niche-chip {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft);
  background: var(--ground-inset); border: 1px solid var(--hairline-strong); border-radius: var(--r-pill); padding: 2px 9px;
}

/* site fleet bulk operations */
.site-bulkbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 58px; padding: 9px 20px 10px; border-bottom: 1px solid var(--hairline);
  background: var(--tile-quiet);
}
.bulk-selection, .bulk-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.bulk-selection strong { min-width: 82px; color: var(--ink-soft); font-size: 12px; }
.bulk-text-button {
  padding: 3px 2px; border: 0; background: transparent; color: var(--accent-strong);
  font: 600 11.5px/1.4 var(--font-body); cursor: pointer;
}
.bulk-text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.bulk-text-button:disabled { color: var(--faint); cursor: default; text-decoration: none; }
.bulk-concurrency {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  color: var(--muted); white-space: nowrap;
}
.bulk-concurrency select { width: 58px; height: 36px; padding: 6px 8px; font-family: var(--font-mono); }
.bulk-operation {
  padding: 12px 20px 14px; border-bottom: 1px solid var(--hairline); background: var(--ground);
}
.bulk-progress-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px;
}
.bulk-progress-head > div { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.bulk-progress-head strong { font-size: 12px; color: var(--ink); }
.bulk-progress-head span { color: var(--muted); font-size: 11px; }
#bulk-operation-progress {
  display: block; width: 100%; height: 5px; border: 0; border-radius: var(--r-pill);
  overflow: hidden; background: var(--ground-inset); color: var(--accent);
}
#bulk-operation-progress::-webkit-progress-bar { background: var(--ground-inset); }
#bulk-operation-progress::-webkit-progress-value { background: var(--accent); }
#bulk-operation-progress::-moz-progress-bar { background: var(--accent); }
.bulk-result-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px; max-height: 260px; margin-top: 8px; overflow-y: auto;
}
.bulk-result-item {
  display: grid; grid-template-columns: minmax(110px, .8fr) 76px minmax(120px, 1fr);
  align-items: center; gap: 9px; min-width: 0; padding: 8px 0;
  border-bottom: 1px solid var(--hairline); font-size: 11px;
}
.bulk-result-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bulk-result-state { font-family: var(--font-mono); color: var(--muted); }
.bulk-result-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.bulk-result-item.is-failed .bulk-result-state, .bulk-result-item.is-failed .bulk-result-detail {
  color: var(--critical);
}
.bulk-result-item.is-success .bulk-result-state { color: var(--good); }
.bulk-result-item.is-skipped .bulk-result-state { color: var(--warn); }
.bulk-site-state {
  display: block; min-height: 15px; margin-top: 2px; color: var(--muted);
  font-family: var(--font-mono); font-size: 10px;
}
.bulk-confirm-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--hairline-strong);
  border-radius: var(--r-tile); background: var(--tile); color: var(--ink); box-shadow: var(--shadow-md);
}
.bulk-confirm-dialog::backdrop { background: rgba(35,39,31,.42); }
.bulk-confirm-dialog form { padding: 22px; }
.bulk-confirm-dialog h3 { margin: 0 0 8px; font: 700 18px/1.3 var(--font-display); }
.bulk-confirm-dialog p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.bulk-confirm-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* rate cell */
.rate-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.rate-num { font-size: 13px; font-weight: 600; }
.rate-track { width: 96px; height: 5px; border-radius: var(--r-pill); background: var(--ground-inset); overflow: hidden; }
.rate-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); }
.rate-fill.bad { background: var(--critical); }

/* ============================================================ CHIPS / PILLS */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 3px 10px;
  background: var(--ground-inset); color: var(--ink-soft); border: 1px solid var(--hairline-strong);
}
.chip-agent { background: var(--accent-tint); border-color: transparent; color: var(--accent-strong); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 3px 10px 3px 8px; }
.pill .dot { width: 6px; height: 6px; box-shadow: none; }
.pill-good { background: var(--good-tint); color: #2f7a4e; } .pill-good .dot { background: var(--good); }
.pill-critical { background: var(--critical-tint); color: #a5432c; } .pill-critical .dot { background: var(--critical); }
.pill-warn { background: var(--warn-tint); color: #8a6314; } .pill-warn .dot { background: var(--warn); }

/* job/site state chips (JS emits chip st-<state>) */
.chip.st-deployed, .chip.st-submitted, .chip.st-active { background: var(--good-tint); color: #2f7a4e; border-color: transparent; }
.chip.st-failed, .chip.st-rejected, .chip.st-quarantined { background: var(--critical-tint); color: #a5432c; border-color: transparent; }
.chip.st-queued, .chip.st-researching, .chip.st-drafting, .chip.st-reviewing, .chip.st-persisted, .chip.st-paused
  { background: var(--warn-tint); color: #8a6314; border-color: transparent; }

/* ============================================================ STAT GRID (index view) */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); padding: 4px 20px 20px; }
.stat { background: var(--tile-quiet); border: 1px solid var(--hairline); border-radius: var(--r-inset); padding: 14px 16px; }
.stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat .lbl { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.good .num { color: var(--good); }
.stat.bad .num { color: var(--critical); }
.stat.gold .num { color: var(--accent); }

/* ============================================================ RESULTS / UTIL */
.result {
  padding: 12px 14px; border-radius: 8px; font-family: var(--font-mono); font-size: 12px;
  white-space: pre-wrap; word-break: break-all; background: var(--good-tint);
  border: 1px solid var(--hairline); max-height: 220px; overflow-y: auto; color: var(--ink-soft);
}
.result.err { background: var(--critical-tint); color: #a5432c; }
.muted { color: var(--faint); }
.err { color: var(--critical); }
.key-state { font-size: 11px; font-weight: 500; color: var(--good); }
.failure-list { list-style: none; margin: 0; padding: 0; }
.fid { font-family: var(--font-mono); color: var(--critical); margin-right: 6px; }

/* ============================================================ AI OPERATOR */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ai-badge { margin-left: auto; background: var(--accent-tint); color: var(--accent-strong); }
#view-operator { background: #f8f9f7; }
.operator-layout {
  position: relative; display: grid; grid-template-columns: 218px minmax(0, 1fr);
  height: calc(100dvh - 76px); min-height: 620px; max-width: 1120px;
  padding: 0 26px 18px; margin: 0 auto;
  transition: grid-template-columns .18s ease;
}
.operator-layout.history-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.operator-layout.history-collapsed .operator-history {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.operator-history {
  min-width: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f4f5f2; border: 1px solid var(--hairline); border-top: 0; border-right: 0;
  border-radius: 0 0 0 18px; opacity: 1; transition: opacity .15s ease;
}
.operator-history-head {
  min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px 12px 17px; border-bottom: 1px solid #e7e9e4;
}
.operator-history-head h2 { margin: 0; font: 650 13px/1.3 var(--font-body); }
.operator-history-head button {
  padding: 5px 7px; border: 0; border-radius: 7px; background: transparent;
  color: var(--accent-strong); font: 600 11px/1 var(--font-body); cursor: pointer;
}
.operator-history-head button:hover { background: var(--accent-tint); }
.operator-history-list { overflow-y: auto; padding: 8px; }
.operator-history-empty { margin: 12px 9px; color: var(--faint); font-size: 11px; line-height: 1.5; }
.history-item {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; border-radius: 9px;
}
.history-item:hover, .history-item.is-current { background: #e9ebe6; }
.history-open {
  min-width: 0; padding: 9px 7px 9px 9px; border: 0; background: transparent;
  text-align: left; cursor: pointer;
}
.history-open strong, .history-open span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-open strong { color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.history-open span { margin-top: 2px; color: var(--faint); font-size: 9.5px; }
.history-delete {
  opacity: .5; margin-right: 5px; padding: 5px 6px; border: 0; border-radius: 6px;
  background: transparent; color: var(--critical); font: 500 10px/1 var(--font-body); cursor: pointer;
}
.history-item:hover .history-delete, .history-delete:hover, .history-delete:focus-visible { opacity: 1; }
.history-delete:hover { background: var(--critical-tint); }
.operator-history-note {
  margin: 0; padding: 11px 15px 13px; border-top: 1px solid #e7e9e4;
  color: var(--faint); font-size: 9.5px; line-height: 1.5;
}
.operator-chat {
  height: 100%; min-width: 0; overflow: hidden; display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fbfcfa; border: 1px solid var(--hairline); border-top: 0;
  border-radius: 0 0 18px 18px; box-shadow: 0 16px 42px -36px rgba(46,53,42,.3);
}
.operator-chat-head {
  min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 12px 28px; border-bottom: 1px solid #eceee9; background: rgba(251,252,250,.94);
}
.operator-head-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.history-toggle {
  height: 28px; padding: 0 8px; border: 1px solid var(--hairline); border-radius: 7px;
  background: transparent; color: var(--muted); font: 550 10.5px/1 var(--font-body); cursor: pointer;
}
.history-toggle:hover { border-color: var(--hairline-strong); color: var(--ink); }
.ai-orb {
  width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  color: var(--on-accent); font: 700 10px/1 var(--font-body);
  background: linear-gradient(145deg, #d18a31, var(--accent-strong));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.operator-head-identity h2 { margin: 0; font: 650 14px/1.3 var(--font-body); }
.operator-head-identity p {
  max-width: 430px; margin: 2px 0 0; color: var(--muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.operator-head-state { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 11px; }
.operator-live { display: inline-flex; align-items: center; gap: 7px; color: var(--good); font-weight: 600; }
.operator-messages {
  overflow-y: auto; padding: 30px clamp(24px, 6vw, 74px) 34px; scroll-behavior: smooth;
  background: #fbfcfa; scrollbar-color: #cfd3cb transparent; scrollbar-width: thin;
}
.operator-welcome { max-width: 680px; margin: 9vh auto 0; text-align: left; }
.welcome-mark {
  width: 42px; height: 42px; display: grid; place-items: center; margin: 0 0 18px;
  border: 1px solid var(--hairline-strong); background: var(--tile); border-radius: 50%;
  color: var(--accent); font-size: 18px; box-shadow: var(--shadow-sm);
}
.operator-welcome h3 { font-family: var(--font-body); font-size: 24px; line-height: 1.25; margin: 0 0 9px; letter-spacing: -.4px; }
.operator-welcome > p { color: var(--muted); line-height: 1.65; margin: 0 0 24px; max-width: 580px; font-size: 13px; }
.operator-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.operator-prompts button {
  border: 1px solid var(--hairline); background: transparent; color: var(--ink-soft);
  border-radius: 12px; padding: 12px 14px; text-align: left; font: 500 12px/1.45 var(--font-body);
  cursor: pointer; transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.operator-prompts button:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }

.chat-message { margin: 0 auto 30px; max-width: 880px; }
.chat-message.user { display: flex; justify-content: flex-end; }
.chat-bubble {
  color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; overflow-wrap: anywhere;
}
.chat-message.user .chat-bubble {
  max-width: min(760px, 88%); padding: 13px 17px; border-radius: 16px 16px 4px 16px;
  background: #eef0ed; color: #30352e; border: 0;
}
.chat-message.assistant .chat-bubble { margin: 10px 0 0 44px; }
.assistant-identity { display: flex; align-items: center; gap: 10px; }
.assistant-avatar {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 50%; color: var(--accent-strong); background: var(--accent-tint);
  border: 1px solid var(--accent-tint-2); font-size: 9.5px; font-weight: 750;
}
.assistant-identity > div { display: flex; flex-direction: column; line-height: 1.35; }
.assistant-identity strong { color: var(--ink); font-size: 13px; }
.assistant-identity span { color: var(--faint); font-size: 10.5px; }
.chat-message.system {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px;
  border-radius: 10px; background: var(--accent-tint); color: var(--accent-strong);
}
.system-mark {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center;
  border: 1px solid currentColor; border-radius: 50%; font-size: 11px; font-weight: 700;
}
.chat-message.system .chat-bubble { color: inherit; }
.chat-plain { white-space: pre-wrap; }
.message-controls {
  min-height: 28px; display: flex; align-items: center; gap: 14px; margin-top: 13px;
  color: var(--faint);
}
.message-controls button, .message-details summary {
  padding: 0; border: 0; background: transparent; color: var(--muted);
  font: 500 11px/1.4 var(--font-body); cursor: pointer;
}
.message-controls button:hover, .message-details summary:hover { color: var(--ink); }
.message-details { position: relative; }
.message-details summary { list-style: none; }
.message-details summary::-webkit-details-marker { display: none; }
.message-details[open] { width: 100%; margin-top: 4px; }
.message-details[open] summary { color: var(--ink); }
.message-details > div {
  margin-top: 9px; padding: 11px 12px;
  border-left: 2px solid var(--hairline-strong); background: #f6f7f4; color: var(--muted);
}
.run-trace { display: grid; gap: 11px; }
.run-trace-step { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px; }
.trace-indicator {
  width: 7px; height: 7px; margin-top: 4px; border-radius: 50%;
  background: var(--hairline-strong); box-shadow: 0 0 0 3px #eef0ec;
}
.run-trace-step.success .trace-indicator, .run-trace-step.completed .trace-indicator {
  background: var(--good); box-shadow: 0 0 0 3px var(--good-tint);
}
.run-trace-step.warning .trace-indicator {
  background: var(--warn); box-shadow: 0 0 0 3px var(--warn-tint);
}
.run-trace-step.error .trace-indicator, .run-trace-step.failed .trace-indicator {
  background: var(--critical); box-shadow: 0 0 0 3px var(--critical-tint);
}
.run-trace-step strong { display: block; color: var(--ink-soft); font-size: 11px; }
.run-trace-step p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.run-usage {
  display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 8px;
  border-top: 1px solid var(--hairline); font: 10px/1.4 var(--font-mono);
}
.run-context {
  display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted);
  font: 10px/1.4 var(--font-mono);
}
.evidence-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px;
  width: fit-content; max-width: 100%; margin-top: 13px; padding: 6px 9px;
  border: 1px solid var(--hairline); border-radius: 7px; background: var(--tile-quiet);
  font-size: 10.5px; line-height: 1.4;
}
.evidence-status strong { color: var(--ink-soft); }
.evidence-status span { color: var(--muted); }
.evidence-status.is-grounded { border-color: #bfd9c8; background: var(--good-tint); }
.evidence-status.is-grounded strong { color: var(--good); }
.evidence-status.is-blocked { border-color: #e4cea1; background: var(--warn-tint); }
.evidence-status.is-blocked strong { color: var(--warn); }
.trace-note { margin: 0; color: var(--faint); font-size: 9.5px; line-height: 1.45; }

.markdown-body { color: var(--ink-soft); line-height: 1.72; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 11px; }
.markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5 {
  color: var(--ink); font-family: var(--font-display); line-height: 1.3;
  letter-spacing: .1px; margin: 19px 0 8px;
}
.markdown-body h2 { font-size: 18px; }
.markdown-body h3 { font-size: 16px; }
.markdown-body h4, .markdown-body h5 { font-size: 14px; }
.markdown-body strong { color: var(--ink); font-weight: 700; }
.markdown-body em { color: var(--ink-soft); }
.markdown-body del { color: var(--muted); }
.markdown-body a {
  color: var(--accent-strong); font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(165,102,26,.35); text-underline-offset: 3px;
}
.markdown-body a:hover { text-decoration-color: currentColor; }
.markdown-body ul, .markdown-body ol { margin: 6px 0 13px; padding-left: 23px; }
.markdown-body li { margin: 4px 0; padding-left: 2px; }
.markdown-body li::marker { color: var(--accent); font-weight: 700; }
.markdown-body .md-task { list-style: none; display: flex; gap: 7px; margin-left: -20px; }
.markdown-body .md-task > span { color: var(--accent-strong); }
.markdown-body blockquote {
  margin: 12px 0; padding: 9px 13px; border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; background: var(--accent-tint); color: var(--ink-soft);
}
.markdown-body hr { border: 0; border-top: 1px solid var(--hairline); margin: 17px 0; }
.markdown-body code {
  font-family: var(--font-mono); font-size: .9em; color: #835115;
  background: var(--accent-tint); border: 1px solid var(--accent-tint-2);
  border-radius: 5px; padding: .12em .38em;
}
.md-code {
  margin: 12px 0 15px; overflow: hidden; border: 1px solid #343a32;
  border-radius: 10px; background: #232820;
}
.md-code-head {
  height: 34px; padding: 0 10px 0 13px; display: flex; align-items: center;
  justify-content: space-between; background: #30362d; color: #bfc8b8;
  font-family: var(--font-mono); font-size: 10.5px; text-transform: lowercase;
}
.md-code-head button {
  border: 0; border-radius: 5px; padding: 4px 8px; color: #dce4d7;
  background: rgba(255,255,255,.08); font: inherit; cursor: pointer;
}
.md-code-head button:hover { background: rgba(255,255,255,.15); }
.md-code pre { margin: 0; padding: 14px; overflow-x: auto; }
.md-code pre code {
  padding: 0; border: 0; border-radius: 0; background: transparent;
  color: #edf2e9; font-size: 12px; line-height: 1.6; white-space: pre;
}
.md-table-wrap {
  margin: 12px 0 15px; overflow-x: auto; border: 1px solid var(--hairline);
  border-radius: 9px;
}
.markdown-body table { min-width: 420px; background: var(--tile); }
.markdown-body thead { background: var(--ground-inset); }
.markdown-body th, .markdown-body td {
  padding: 8px 11px; border-top: 1px solid var(--hairline);
  font-size: 12px; text-align: left; vertical-align: top;
}
.markdown-body thead th {
  border-top: 0; color: var(--ink); font-size: 10px; letter-spacing: .6px;
}
.thinking-status { color: var(--muted); font-size: 12px; }
.thinking-dots { display: inline-flex; gap: 4px; margin-left: 5px; }
.thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: ai-pulse 1.1s infinite; }
.thinking-dots i:nth-child(2) { animation-delay: .15s; }
.thinking-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-pulse { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.thinking-skeleton { display: grid; gap: 8px; margin-top: 14px; }
.thinking-skeleton span {
  height: 8px; border-radius: 4px; background: #e9ebe6; animation: skeleton-breathe 1.4s ease-in-out infinite;
}
.thinking-skeleton span:nth-child(2) { width: 84%; animation-delay: .12s; }
.thinking-skeleton span:nth-child(3) { width: 62%; animation-delay: .24s; }
@keyframes skeleton-breathe { 50% { opacity: .42; } }

.operator-actions-stack { max-width: 836px; margin: 8px auto 0; }
.operator-actions-title { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 650; }
.operator-action {
  margin: 0 0 12px; padding: 14px 15px;
  border: 1px solid rgba(192,122,30,.35); border-left: 3px solid var(--accent);
  border-radius: 12px; background: #fffaf2;
}
.operator-action.done { border-color: rgba(50,139,91,.3); border-left-color: var(--good); background: var(--good-tint); }
.operator-action.failed { border-color: rgba(184,75,51,.3); border-left-color: var(--critical); background: var(--critical-tint); }
.action-kicker {
  display: flex; justify-content: space-between; gap: 10px; font-size: 9.5px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--accent-strong); font-weight: 700;
}
.operator-action p { margin: 7px 0 10px; font-size: 13px; color: var(--ink); }
.action-args {
  margin: 0 0 11px; padding: 8px 10px; border-radius: 7px; background: rgba(255,255,255,.65);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); white-space: pre-wrap; word-break: break-word;
  max-height: 120px; overflow: auto;
}
.action-buttons { display: flex; justify-content: flex-end; gap: 8px; }

.operator-composer {
  position: relative; margin: 0 26px 18px; padding: 12px 14px 10px;
  border: 1px solid #dfe2dc; border-radius: 18px; background: rgba(255,255,255,.97);
  box-shadow: 0 16px 38px -24px rgba(39,45,35,.34), 0 2px 8px rgba(39,45,35,.04);
}
.operator-composer textarea {
  width: 100%; min-height: 70px; max-height: 180px; resize: vertical; padding: 4px 3px 10px;
  border: 0; border-radius: 0; background: transparent;
  font: 13.5px/1.6 var(--font-body); color: var(--ink); outline: none; box-shadow: none;
}
.operator-composer textarea::placeholder { color: #969c92; opacity: 1; }
.operator-composer:focus-within { border-color: #bfc4ba; box-shadow: 0 18px 42px -24px rgba(39,45,35,.38), 0 0 0 3px rgba(192,122,30,.1); }
.operator-compose-foot { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.operator-compose-left, .operator-compose-right { display: flex; align-items: center; gap: 10px; }
.operator-compose-right { margin-left: auto; }
.composer-tool {
  height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-soft); font: 550 11.5px/1 var(--font-body); cursor: pointer;
}
.composer-tool:hover { background: var(--ground-inset); color: var(--ink); }
.composer-permission {
  padding-left: 10px; border-left: 1px solid var(--hairline); color: var(--muted);
  font-size: 11px; white-space: nowrap;
}
.operator-model-select {
  width: auto; max-width: 190px; height: 30px; padding: 0 24px 0 9px;
  border: 0; border-radius: 8px; background-color: transparent;
  color: var(--ink-soft); font: 600 11px/1 var(--font-body); cursor: pointer;
}
.operator-model-select:hover { background-color: var(--ground-inset); }
.operator-model-select:focus { box-shadow: 0 0 0 2px rgba(192,122,30,.16); }
.composer-shortcut { color: var(--faint); font-size: 10px; white-space: nowrap; }
.operator-send {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; justify-content: center;
  font-size: 19px; line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dots i, .thinking-skeleton span { animation: none; }
  .operator-messages { scroll-behavior: auto; }
  .operator-layout, .operator-history { transition: none; }
}

/* ============================================================ RESPONSIVE */
@media (max-width: 1000px) {
  .bento { grid-template-columns: 1fr; }
  .tile-hero, .tile-active, .tile-published, .tile-indexed, .tile-tasks, .tile-cost,
  .tile-fleet, .tile-activity { grid-column: auto; grid-row: auto; }
  .operator-layout { grid-template-columns: 196px minmax(0, 1fr); padding: 0 16px 16px; }
}
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .bento, .content { padding: 16px; }
  .topbar { padding: 14px 16px; }
  .operator-layout { display: block; height: calc(100dvh - 72px); min-height: 560px; padding: 0 8px 8px; }
  .operator-history {
    position: absolute; inset: 0 auto 8px 8px; width: min(280px, calc(100vw - 32px));
    z-index: 12; border-right: 1px solid var(--hairline); border-radius: 0 0 16px 16px;
    box-shadow: 18px 0 40px rgba(39,45,35,.14);
  }
  .operator-layout.history-collapsed .operator-history { transform: translateX(-105%); }
  .operator-chat { height: 100%; min-height: 0; border-radius: 0 0 16px 16px; }
  .operator-chat-head { padding: 10px 14px; }
  .operator-head-state > span:not(.operator-live) { display: none; }
  .operator-messages { padding: 18px 12px; }
  .operator-prompts { grid-template-columns: 1fr; }
  .operator-composer { margin: 0 10px 10px; }
  .composer-permission, .composer-shortcut { display: none; }
  .operator-compose-left, .operator-compose-right { gap: 4px; }
  .operator-model-select { max-width: 138px; }
  .chat-message.assistant .chat-bubble { margin-left: 0; }
}

/* ============================================================ GUIDE (操作手册) */
.guide-intro .guide-lead { font-size: 15px; line-height: 1.7; color: var(--ink-soft); margin: 0 20px 8px; }
.guide-intro > .hint { margin-top: 0; }

/* 五步流程 */
.steps { list-style: none; margin: 0; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 4px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--hairline); }
.step:first-child { border-top: none; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  color: var(--accent-strong); background: var(--accent-tint); border: 1px solid var(--accent-tint-2);
}
.step-body h3 { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 3px 0 5px; }
.step-body p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.step-jump { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--accent-strong); margin-left: 8px; white-space: nowrap; }
.step-jump:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 模块卡片网格 */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; padding: 6px 20px 22px; }
.guide-card { background: var(--tile-quiet); border: 1px solid var(--hairline); border-radius: var(--r-inset); padding: 16px 18px; }
.guide-card h3 { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.guide-card .gc-ico {
  width: 26px; height: 26px; flex: none; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-strong); font-size: 14px;
}
.guide-card p { margin: 0 0 8px; color: var(--ink-soft); line-height: 1.6; font-size: 13.5px; }
.guide-card p:last-child { margin-bottom: 0; }

/* 定义列表 */
.defs { margin: 4px 0 8px; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
.defs dt { font-weight: 600; color: var(--ink); white-space: nowrap; }
.defs dd { margin: 0; color: var(--ink-soft); font-size: 13.5px; }

/* 内联标记 */
.kbd {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink);
  background: var(--ground-inset); border: 1px solid var(--hairline-strong);
  border-radius: 5px; padding: 1px 6px; white-space: nowrap;
}
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  background: var(--ground-inset); color: var(--ink-soft); border-radius: var(--r-pill); padding: 2px 9px;
}
.tag.good { background: var(--good-tint); color: #2f7a4e; }
.tag.bad { background: var(--critical-tint); color: #a5432c; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 6px 0 8px; }
.flow .arrow { color: var(--faint); font-size: 12px; }

/* 提示框 */
.callout { border-radius: var(--r-inset); padding: 13px 16px; margin: 0 20px 12px; font-size: 13.5px; line-height: 1.6; border: 1px solid; }
.callout:last-child { margin-bottom: 20px; }
.callout b { color: var(--ink); }
.callout-warn { background: var(--warn-tint); border-color: #e8d3a0; color: #6f5311; }
.callout-critical { background: var(--critical-tint); border-color: #eec4b7; color: #8a3a26; }
.callout-info { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-strong); }

/* FAQ */
.faq { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 0; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; list-style: none; padding: 13px 26px 13px 0; position: relative;
  font-weight: 600; color: var(--ink); font-size: 13.5px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 18px; font-weight: 400; color: var(--accent); line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--accent-strong); }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); line-height: 1.65; font-size: 13.5px; }

/* section checkbox toggle in the batch form */
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; margin-top: 10px; }
label.check input { width: auto; margin: 0; }

/* ============================================================ CONTENT MANAGEMENT */
#view-content { min-height: calc(100dvh - 76px); }
.content-manager { max-width: 1580px; }
.content-workbench {
  display: grid; grid-template-columns: minmax(300px, 350px) minmax(0, 1fr);
  align-items: start; gap: 18px;
}
.content-library {
  position: sticky; top: 94px; min-width: 0; height: calc(100dvh - 118px);
  display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.content-library-head, .content-editor-head, .content-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.content-library-head { padding: 18px 18px 13px; border-bottom: 1px solid var(--hairline); }
.content-library-head h2, .content-editor-head h2, .content-panel-head h3,
.content-action-sections h3, .content-bulk-panel h2 {
  margin: 0; font-family: var(--font-display); font-weight: 700;
}
.content-library-head h2 { font-size: 18px; }
.content-eyebrow {
  margin: 0 0 2px; color: var(--faint); font: 600 9px/1.3 var(--font-mono); letter-spacing: 1.2px;
}
.content-library-filters { display: grid; gap: 7px; padding: 13px 18px; border-bottom: 1px solid var(--hairline); }
.content-library-filters > label { margin: 0; color: var(--muted); font-size: 10px; font-weight: 600; }
.content-library-filters input, .content-library-filters select { width: 100%; height: 36px; }
.content-filter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.content-bulkbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 39px; padding: 7px 18px; background: var(--tile-quiet); border-bottom: 1px solid var(--hairline);
}
.content-select-all { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ink-soft); font-size: 11px; }
.content-select-all input { width: auto; }
.content-article-list { min-height: 0; overflow-y: auto; }
.content-article-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 12px; }
.content-article-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px;
  padding: 12px 18px; border-bottom: 1px solid var(--hairline); cursor: pointer;
  transition: background .12s ease;
}
.content-article-row:hover { background: var(--tile-quiet); }
.content-article-row.is-current { background: var(--accent-tint); box-shadow: inset 3px 0 var(--accent); }
.content-article-row.is-selected { background-color: #faf4e8; }
.content-article-row input { width: auto; margin: 3px 0 0; align-self: start; }
.content-article-copy { min-width: 0; }
.content-article-copy strong {
  display: block; overflow: hidden; color: var(--ink); font-size: 12.5px; line-height: 1.45;
  text-overflow: ellipsis; white-space: nowrap;
}
.content-article-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--faint); font-size: 10px; }
.content-article-meta code { min-width: 0; overflow: hidden; font-family: var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.content-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 18px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 10.5px;
}

.content-editor { min-width: 0; min-height: 620px; overflow: hidden; }
.content-empty {
  min-height: 620px; display: grid; place-items: center; align-content: center;
  padding: 40px; text-align: center;
}
.content-empty[hidden] { display: none; }
.content-empty > span { color: var(--accent); font: 42px/1 var(--font-display); }
.content-empty h2 { margin: 16px 0 7px; font: 700 20px/1.3 var(--font-display); }
.content-empty p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.7; }
.content-editor-head { min-height: 95px; padding: 17px 22px; border-bottom: 1px solid var(--hairline); }
.content-editor-title { min-width: 0; }
.content-title-line { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.content-title-line .chip[hidden], .content-operation[hidden], .content-operation .btn[hidden] { display: none; }
.content-editor-head h2 {
  max-width: 720px; overflow: hidden; font-size: 20px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap;
}
.content-editor-head p { margin: 5px 0 0; color: var(--faint); font: 10.5px/1.4 var(--font-mono); }
.content-save-area { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.content-save-area > span { width: 100%; color: var(--muted); font-size: 10.5px; text-align: right; }
.content-save-area > span.is-dirty { color: var(--warn); }
.content-save-area > span.is-good { color: var(--good); }
.content-save-area > span.is-error { color: var(--critical); }
.content-tabs {
  display: flex; align-items: center; gap: 2px; overflow-x: auto;
  padding: 0 16px; border-bottom: 1px solid var(--hairline); background: var(--tile-quiet);
}
.content-tabs button {
  height: 42px; padding: 0 11px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font: 600 11.5px/1 var(--font-body);
  white-space: nowrap; cursor: pointer;
}
.content-tabs button:hover { color: var(--ink); }
.content-tabs button.is-active { border-bottom-color: var(--accent); color: var(--accent-strong); }
.content-tab-panel { display: none; min-height: 520px; padding: 22px; }
.content-tab-panel.is-active { display: block; }
.content-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.content-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.content-field > span { color: var(--muted); font-size: 10.5px; font-weight: 600; }
.content-field input, .content-field textarea, .content-field select { width: 100%; }
.content-field-wide { grid-column: 1 / -1; }
#content-edit-markdown { min-height: 440px; tab-size: 2; }
#content-edit-slug { color: var(--faint); background: var(--ground); }
.content-preview { min-height: 500px; max-width: 800px; padding: 10px 12px 42px; margin: 0 auto; font-size: 14px; }
.content-panel-head { padding-bottom: 15px; border-bottom: 1px solid var(--hairline); }
.content-panel-head h3, .content-action-sections h3 { font-size: 16px; }
.content-panel-head p, .content-action-sections p {
  margin: 4px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6;
}
.content-diff {
  min-height: 430px; max-height: 62vh; margin: 15px 0 0; padding: 16px;
  overflow: auto; border: 1px solid var(--hairline); border-radius: var(--r-inset);
  background: #282c26; color: #e8eae4; font: 11.5px/1.6 var(--font-mono); white-space: pre;
}
.content-diff .diff-add { color: #9ce0b5; }
.content-diff .diff-del { color: #f4ab9b; }
.content-diff .diff-head { color: #e8c787; }
.content-revisions { display: flex; flex-direction: column; }
.content-revision {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid var(--hairline);
}
.content-revision-no { color: var(--accent-strong); font: 700 11px/1 var(--font-mono); }
.content-revision-copy { min-width: 0; }
.content-revision-copy strong { display: block; font-size: 12px; }
.content-revision-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.content-revision-actions { display: flex; gap: 6px; }
.content-media-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 16px;
}
.content-media-item { min-width: 0; padding: 9px; border: 1px solid var(--hairline); border-radius: var(--r-inset); }
.content-media-item img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; background: var(--ground-inset);
}
.content-media-item strong {
  display: block; margin-top: 7px; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap;
}
.content-media-meta { color: var(--faint); font-size: 9.5px; }
.content-media-actions { display: flex; gap: 5px; margin-top: 7px; }
.content-upload-label { cursor: pointer; }
.content-ai-presets { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0; }
.content-ai-presets button {
  padding: 6px 10px; border: 1px solid var(--hairline-strong); border-radius: var(--r-pill);
  background: var(--tile); color: var(--ink-soft); font: 500 11px/1.2 var(--font-body); cursor: pointer;
}
.content-ai-presets button:hover { border-color: var(--accent); color: var(--accent-strong); }
.content-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.content-action-row > span { color: var(--muted); font-size: 11px; }
.content-action-sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.content-action-sections > section { padding: 4px 20px 20px; border-left: 1px solid var(--hairline); }
.content-action-sections > section:first-child { padding-left: 0; border-left: 0; }
.content-action-sections .content-field { margin-top: 15px; }
.content-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.content-operation {
  margin: 0 22px 22px; padding: 13px 15px; border: 1px solid var(--hairline);
  border-radius: var(--r-inset); background: var(--tile-quiet);
}
.content-operation > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.content-operation strong { font-size: 12px; }
.content-operation span { color: var(--muted); font: 10.5px/1.3 var(--font-mono); }
.content-operation progress { width: 100%; height: 5px; margin-top: 8px; accent-color: var(--accent); }
.content-operation p { margin: 6px 0 0; color: var(--muted); font-size: 10.5px; }
.content-operation.is-failed { border-color: #e3b8ad; background: var(--critical-tint); }
.content-operation.is-success { border-color: #bcdac6; background: var(--good-tint); }

.content-bulk-panel {
  position: sticky; bottom: 14px; z-index: 7;
  display: grid; grid-template-columns: minmax(150px, .8fr) minmax(180px, 1fr) minmax(160px, 1fr) 80px minmax(320px, 2fr);
  align-items: end; gap: 13px; padding: 14px 17px; box-shadow: var(--shadow-md);
}
.content-bulk-panel[hidden] { display: none; }
.content-bulk-panel h2 { font-size: 14px; }
.content-bulk-panel p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.content-bulk-panel label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.content-bulk-panel label > span { color: var(--muted); font-size: 9.5px; }
.content-bulk-panel input, .content-bulk-panel select { width: 100%; height: 32px; padding: 5px 8px; font-size: 11px; }
.content-bulk-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.content-bulk-result { grid-column: 1 / -1; }

@media (max-width: 1180px) {
  .content-workbench { grid-template-columns: 300px minmax(0, 1fr); }
  .content-action-sections { grid-template-columns: 1fr; }
  .content-action-sections > section { padding: 16px 0; border-left: 0; border-top: 1px solid var(--hairline); }
  .content-action-sections > section:first-child { padding-top: 4px; border-top: 0; }
  .content-bulk-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-bulk-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 880px) {
  .content-workbench { grid-template-columns: 1fr; }
  .content-library { position: static; height: 520px; }
  .content-editor-head { align-items: flex-start; flex-direction: column; }
  .content-save-area { justify-content: flex-start; }
  .content-save-area > span { text-align: left; }
  .content-fields { grid-template-columns: 1fr; }
  .content-field-wide { grid-column: auto; }
}
@media (max-width: 620px) {
  .content-manager { padding: 12px; }
  .content-tab-panel { padding: 16px; }
  .content-revision { grid-template-columns: 44px minmax(0, 1fr); }
  .content-revision-actions { grid-column: 2; }
  .content-bulk-panel { position: static; grid-template-columns: 1fr; }
  .content-bulk-actions { grid-column: auto; }
}

/* ============================================================ ALERTS + GROUPS (M4) */
.alerts-strip { display: flex; flex-direction: column; gap: 8px; padding: 20px 34px 0; max-width: 1320px; }
.alert { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: var(--r-inset);
         font-size: 13.5px; font-weight: 500; border: 1px solid; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.alert-critical { background: var(--critical-tint); border-color: #eec4b7; color: #8a3a26; }
.alert-critical .alert-dot { background: var(--critical); }
.alert-warn { background: var(--warn-tint); border-color: #e8d3a0; color: #6f5311; }
.alert-warn .alert-dot { background: var(--warn); }
.alert-info { background: var(--accent-tint); border-color: var(--accent-tint-2); color: var(--accent-strong); }
.alert-info .alert-dot { background: var(--accent); }

.groups-list { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 20px 20px; }
.group-chip { display: inline-flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px;
              background: var(--tile-quiet); border: 1px solid var(--hairline); border-radius: var(--r-pill); font-size: 13px; }
.group-chip .muted { font-size: 11.5px; }
select.row-group { width: auto; min-width: 96px; height: 30px; padding: 2px 8px; font-size: 12px; }
#batch-spread-opts[hidden] { display: none; }

@media (max-width: 720px) {
  .site-bulkbar { align-items: flex-start; flex-direction: column; }
  .bulk-actions { width: 100%; }
  .bulk-result-list { grid-template-columns: 1fr; }
  .bulk-result-item { grid-template-columns: minmax(100px, .8fr) 68px minmax(100px, 1fr); }
}

/* ============================================================ CONTENT STRATEGIES */
.strategy-workbench {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.strategy-library { position: sticky; top: 20px; padding-bottom: 14px; }
.strategy-library .panel-head p,
.strategy-editor .panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.strategy-list { display: grid; gap: 7px; padding: 0 14px; }
.strategy-list-item {
  width: 100%;
  border: 1px solid var(--hairline);
  border-radius: var(--r-inset);
  background: transparent;
  color: var(--ink);
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
}
.strategy-list-item:hover,
.strategy-list-item.is-active { border-color: var(--ink); background: var(--tile-quiet); }
.strategy-list-item strong,
.strategy-list-item span { display: block; }
.strategy-list-item span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.strategy-editor { display: grid; gap: 18px; }
.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 20px 20px;
}
.strategy-grid label,
.strategy-preview label { display: grid; gap: 7px; }
.strategy-grid label > span,
.strategy-preview label > span { color: var(--muted); font-size: 12px; }
.strategy-grid .strategy-wide { grid-column: 1 / -1; }
.strategy-bind-head { align-items: center; }
.strategy-site-manager {
  container-type: inline-size;
  margin: 0 20px 18px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--r-inset);
  background: var(--tile);
}
.strategy-site-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, .55fr) minmax(140px, .45fr) 94px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  background: var(--tile-quiet);
}
.strategy-site-controls label { display: grid; gap: 6px; }
.strategy-site-controls label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}
.strategy-site-controls input,
.strategy-site-controls select { min-width: 0; height: 36px; }
.strategy-selection-bar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.strategy-selection-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 13px;
}
.strategy-page-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.strategy-selection-bar .bulk-text-button {
  padding-block: 5px;
  white-space: nowrap;
}
.strategy-selection-bar [aria-pressed="true"] {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#strategy-selection-summary {
  flex: none;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.strategy-site-columns,
.strategy-site-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.35fr) minmax(150px, .8fr) 90px minmax(150px, .8fr);
  gap: 16px;
  align-items: center;
}
.strategy-site-columns {
  padding: 9px 14px 9px 48px;
  color: var(--muted);
  background: var(--tile);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
}
.strategy-sites { min-height: 82px; }
.strategy-site-row {
  position: relative;
  min-height: 58px;
  padding: 8px 14px 8px 48px;
  border-top: 1px solid var(--hairline);
  cursor: pointer;
}
.strategy-site-row:hover { background: var(--tile-quiet); }
.strategy-site-row.is-selected {
  background: color-mix(in srgb, var(--accent-tint) 58%, var(--tile));
  box-shadow: inset 3px 0 0 var(--accent);
}
.strategy-site-row > input {
  position: absolute;
  top: 19px;
  left: 16px;
}
.strategy-site-row span,
.strategy-site-row strong,
.strategy-site-row small { display: block; min-width: 0; }
.strategy-site-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-style: normal;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-site-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.strategy-status {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--tile-quiet);
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}
.strategy-status.status-active { background: var(--good-tint); color: var(--good); }
.strategy-status.status-paused { background: var(--warn-tint); color: var(--warn); }
.strategy-status.status-quarantined { background: var(--critical-tint); color: var(--critical); }
.strategy-site-binding.is-other strong { color: var(--warn); }
.strategy-site-empty {
  margin: 0;
  padding: 26px 16px;
  color: var(--muted);
  text-align: center;
}
.strategy-pagination {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.strategy-pagination > div { display: flex; align-items: center; gap: 10px; }
.strategy-preview {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .7fr) auto;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--hairline);
  padding: 18px 20px;
}
.job-link-audit { margin-top: 7px; color: var(--muted); font-size: 11px; }
.job-link-audit span { display: block; margin-top: 4px; overflow-wrap: anywhere; }

@container (max-width: 760px) {
  .strategy-site-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .strategy-site-search { grid-column: 1 / -1; }
  .strategy-selection-bar { flex-wrap: wrap; }
  #strategy-selection-summary {
    width: 100%;
    order: -1;
  }
  .strategy-site-columns,
  .strategy-site-row {
    grid-template-columns: minmax(180px, 1.1fr) minmax(100px, .65fr) 64px minmax(110px, .7fr);
    gap: 10px;
  }
}

@media (max-width: 1360px) {
  .strategy-workbench { grid-template-columns: 1fr; }
  .strategy-library { position: static; }
  .strategy-list {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}
@media (max-width: 980px) {
  .strategy-site-controls { grid-template-columns: 1fr 1fr; }
  .strategy-site-search { grid-column: 1 / -1; }
  .strategy-site-columns,
  .strategy-site-row { grid-template-columns: minmax(180px, 1.1fr) minmax(100px, .65fr) 64px minmax(110px, .7fr); gap: 10px; }
}
@media (max-width: 680px) {
  .strategy-grid,
  .strategy-preview { grid-template-columns: 1fr; }
  .strategy-grid .strategy-wide { grid-column: auto; }
  .strategy-bind-head { align-items: flex-start; }
  .strategy-bind-head .btn { width: 100%; }
  .strategy-site-manager { margin-inline: 12px; }
  .strategy-site-controls { grid-template-columns: 1fr 1fr; }
  .strategy-site-search { grid-column: 1 / -1; }
  .strategy-page-size { min-width: 0; }
  .strategy-selection-bar,
  .strategy-pagination { align-items: flex-start; flex-direction: column; }
  .strategy-site-columns { display: none; }
  .strategy-site-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-block: 12px;
  }
  .strategy-site-classification { grid-row: 2; }
  .strategy-site-row > span:nth-of-type(3) { grid-column: 2; grid-row: 1; }
  .strategy-site-binding { grid-column: 2; grid-row: 2; text-align: right; }
}
