/* ============================================================================
   Support Ops — design system
   Light is the base; dark restates the same tokens, so every component styles
   itself through variables and never hard-codes a colour for one theme only.
   ========================================================================== */

:root {
  /* neutrals, biased cool toward the accent rather than pure grey */
  --bg:          #F4F6FA;
  --surface:     #FFFFFF;
  --surface-2:   #F7F9FC;
  --surface-3:   #EEF1F7;
  --line:        #E2E7F0;
  --line-strong: #CBD3E1;

  --text:        #131A2B;
  --text-2:      #4A5568;
  --text-3:      #66707F;

  --accent:      #3350C7;
  --accent-hover:#2A43AC;
  --accent-weak: #EBEFFB;
  --accent-line: #C6D1F3;
  --on-accent:   #FFFFFF;

  --ok:          #0F7B4F;
  --ok-weak:     #E4F4EC;
  --warn:        #B45309;
  --warn-weak:   #FCF1E2;
  --danger:      #C22B45;
  --danger-weak: #FCEBEE;

  --sidebar-bg:  #111A30;
  --sidebar-fg:  #AEBBD4;
  --sidebar-fg-2:#8492AD;
  --sidebar-active-bg: rgba(255,255,255,.10);

  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(17,26,48,.06);
  --shadow:    0 1px 2px rgba(17,26,48,.05), 0 6px 16px -10px rgba(17,26,48,.22);
  --shadow-lg: 0 12px 34px -12px rgba(17,26,48,.30);
  --shadow-modal: 0 28px 70px -18px rgba(9,14,28,.45);

  --sidebar-w: 244px;
  --topbar-h: 58px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0C111C;
    --surface:     #141B29;
    --surface-2:   #1A2231;
    --surface-3:   #212B3D;
    --line:        #263043;
    --line-strong: #38455C;

    --text:        #E7ECF5;
    --text-2:      #A6B2C7;
    --text-3:      #8A97AE;

    --accent:      #7D95F0;
    --accent-hover:#94A8F5;
    --accent-weak: #1B2440;
    --accent-line: #33406B;
    --on-accent:   #0B1020;

    --ok:          #4FBF8B;
    --ok-weak:     #12291F;
    --warn:        #E0A65B;
    --warn-weak:   #2C2211;
    --danger:      #F08592;
    --danger-weak: #2E1720;

    --sidebar-bg:  #0A0F1A;
    --sidebar-fg:  #97A5C0;
    --sidebar-fg-2:#7C8AA6;
    --sidebar-active-bg: rgba(255,255,255,.08);

    --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
    --shadow:    0 1px 2px rgba(0,0,0,.35), 0 6px 16px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 12px 34px -12px rgba(0,0,0,.7);
    --shadow-modal: 0 28px 70px -18px rgba(0,0,0,.8);
  }
}

/* An explicit choice from the theme switch beats the operating system, in both
   directions: [data-theme="dark"] here, and the :not([data-theme="light"])
   guard on the media query above. */
:root[data-theme="dark"] {
  --bg:          #0C111C;
  --surface:     #141B29;
  --surface-2:   #1A2231;
  --surface-3:   #212B3D;
  --line:        #263043;
  --line-strong: #38455C;

  --text:        #E7ECF5;
  --text-2:      #A6B2C7;
  --text-3:      #8A97AE;

  --accent:      #7D95F0;
  --accent-hover:#94A8F5;
  --accent-weak: #1B2440;
  --accent-line: #33406B;
  --on-accent:   #0B1020;

  --ok:          #4FBF8B;
  --ok-weak:     #12291F;
  --warn:        #E0A65B;
  --warn-weak:   #2C2211;
  --danger:      #F08592;
  --danger-weak: #2E1720;

  --sidebar-bg:  #0A0F1A;
  --sidebar-fg:  #97A5C0;
  --sidebar-fg-2:#7C8AA6;
  --sidebar-active-bg: rgba(255,255,255,.08);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow:    0 1px 2px rgba(0,0,0,.35), 0 6px 16px -10px rgba(0,0,0,.6);
  --shadow-lg: 0 12px 34px -12px rgba(0,0,0,.7);
  --shadow-modal: 0 28px 70px -18px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

code, .mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: .875em;
}

/* ------------------------------------------------------------- app shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 18px 12px 12px;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 20px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent); display: grid; place-items: center; color: #fff;
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.brand-text em { font-style: normal; font-size: 11px; color: var(--sidebar-fg-2); }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sidebar-fg-2); padding: 14px 10px 6px;
}
.nav-label:first-child { padding-top: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-fg); font-size: 13.8px; font-weight: 500;
}
.nav a:hover { background: var(--sidebar-active-bg); color: #fff; text-decoration: none; }
.nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav a.active svg { opacity: 1; }

.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; margin-top: 10px; }

.workspace { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 0 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-weight: 600; font-size: 14px; color: var(--text-2); }
.menu-btn { display: none; }

main { padding: 28px 26px 80px; max-width: 1240px; width: 100%; }

/* -------------------------------------------------------------- identity */
.who-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; cursor: pointer;
  padding: 8px; border-radius: var(--radius-sm); color: var(--sidebar-fg);
  font-family: inherit; text-align: left;
}
.who-btn:hover { background: var(--sidebar-active-bg); }
.who-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 650; font-size: 12.5px;
}
.who-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.who-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-size: 11px; color: var(--sidebar-fg-2); }

/* ------------------------------------------------------------ typography */
h1 { font-size: 21px; font-weight: 650; letter-spacing: -.02em; }
h2 { font-size: 15.5px; font-weight: 620; letter-spacing: -.01em; margin-bottom: 12px; }
h3 { font-size: 14.5px; font-weight: 620; }
h2.mt { margin-top: 18px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 5px; max-width: 66ch; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tab-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }

.muted-sm { color: var(--text-3); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; }
.sep-dot { color: var(--line-strong); }
.pre-wrap { white-space: pre-wrap; }
.loading { color: var(--text-3); padding: 56px; text-align: center; font-size: 13.5px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: var(--on-accent); border: 1px solid transparent;
  padding: 8px 15px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: background .13s, border-color .13s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { background: var(--surface-3); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-weak); }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.linkish { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px 20px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.entity-card { cursor: pointer; transition: border-color .13s, box-shadow .13s, transform .13s; }
.entity-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.entity-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.entity-card h3 { font-size: 14.5px; }
.entity-card .url { color: var(--text-3); font-size: 12px; word-break: break-all; margin-top: 3px; }
.entity-card .desc { margin: 10px 0 13px; color: var(--text-2); font-size: 13px; min-height: 19px; }
.entity-card .counts {
  display: flex; gap: 15px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-3);
  border-top: 1px solid var(--line); padding-top: 11px;
}
.entity-card .counts b { color: var(--text); font-weight: 620; font-variant-numeric: tabular-nums; }

.info-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; margin-bottom: 20px; font-size: 12.5px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.info-strip code { background: var(--surface); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; }

/* -------------------------------------------------------------- stat tiles */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat { padding: 15px 17px; }
.stat .num { font-size: 25px; font-weight: 660; letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .lbl { color: var(--text-3); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; margin-top: 3px; }
.stat-note { color: var(--text-3); font-size: 11.5px; margin-top: 5px; }
.stat.alert { border-color: var(--danger); }
.stat.alert .num { color: var(--danger); }
.stat.alert .stat-note { color: var(--danger); font-weight: 550; }

/* ----------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 11px; font-weight: 650;
  border: 1px solid transparent; vertical-align: middle;
}
.badge.neutral         { background: var(--surface-3); color: var(--text-2); border-color: var(--line); }
.badge.env-production  { background: var(--danger-weak); color: var(--danger); border-color: var(--danger); }
.badge.env-staging     { background: var(--warn-weak); color: var(--warn); border-color: var(--warn); }
.badge.env-qa          { background: var(--accent-weak); color: var(--accent); border-color: var(--accent-line); }
.badge.env-development { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }

.badge.risk-read_only   { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }
.badge.risk-reversible  { background: var(--warn-weak); color: var(--warn); border-color: var(--warn); }
.badge.risk-destructive { background: var(--danger-weak); color: var(--danger); border-color: var(--danger); }

.badge.status-active   { background: var(--ok-weak); color: var(--ok); }
.badge.status-paused   { background: var(--warn-weak); color: var(--warn); }
.badge.status-archived { background: var(--surface-3); color: var(--text-2); }
.badge.role-admin      { background: var(--accent-weak); color: var(--accent); border-color: var(--accent-line); }
.badge.role-support    { background: var(--surface-3); color: var(--text-2); border-color: var(--line); }

.method {
  display: inline-block; min-width: 46px; text-align: center;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 6px; border-radius: 5px; border: 1px solid transparent;
}
.method.GET    { background: var(--accent-weak); color: var(--accent); border-color: var(--accent-line); }
.method.POST   { background: var(--ok-weak); color: var(--ok); border-color: var(--ok); }
.method.PUT,
.method.PATCH  { background: var(--warn-weak); color: var(--warn); border-color: var(--warn); }
.method.DELETE { background: var(--danger-weak); color: var(--danger); border-color: var(--danger); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-weight: 620; font-size: 12.5px; white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-pill.ok   { color: var(--ok); }
.status-pill.fail { color: var(--danger); }

/* ----------------------------------------------------------------- tables */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 11px 15px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.3px; }
tbody tr:last-child td { border-bottom: none; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-2); }
.row-actions { text-align: right; white-space: nowrap; display: flex; gap: 6px; justify-content: flex-end; }
.small-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ empty state */
.empty {
  text-align: center; padding: 54px 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface-2); color: var(--text-2);
}
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: .8; }
.empty-title { font-weight: 620; color: var(--text); margin-bottom: 4px; font-size: 14.5px; }
.empty-hint { font-size: 13px; max-width: 46ch; margin: 0 auto; }

/* ------------------------------------------------------------ breadcrumbs */
.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.crumb a { color: var(--text-2); }
.crumb a:hover { color: var(--accent); }
.crumb .sep { color: var(--line-strong); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 18px; }
.tabs button {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 570; color: var(--text-3);
  padding: 9px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 620; }

/* --------------------------------------------------------------- fix cards */
.fix-card { margin-bottom: 12px; transition: border-color .13s, box-shadow .13s; }
.fix-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.fix-card .head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.fix-card h3 { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fix-card .meta { color: var(--text-3); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fix-card .fix-desc { margin-top: 9px; color: var(--text-2); font-size: 13.2px; }
.when {
  background: var(--accent-weak); border: 1px solid var(--accent-line);
  padding: 9px 13px; margin-top: 11px; font-size: 12.8px; border-radius: var(--radius-sm);
  color: var(--text-2);
}
.when.top { margin: 0 0 16px; }
.when b { color: var(--text); }
.warn-strip {
  background: var(--danger-weak); border: 1px solid var(--danger);
  color: var(--danger); padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 550; margin-bottom: 16px;
}
.run-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12.5px; color: var(--text-3); }

/* ------------------------------------------------------------------ modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,15,26,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-modal); animation: rise .16s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { max-width: 760px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@media (prefers-reduced-motion: reduce) { .modal, .toast, .login-card { animation: none; } }

.m-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.m-head h2 { margin: 0; font-size: 15.5px; }
.m-close { background: none; border: none; font-size: 17px; cursor: pointer; color: var(--text-3); line-height: 1; padding: 5px; border-radius: 5px; }
.m-close:hover { background: var(--surface-3); color: var(--text); }
.m-body { padding: 20px 22px; }
.m-foot {
  display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px;
  border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 15px; }
.field label, .field-label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--text); }
.field .hint { font-weight: 400; color: var(--text-3); font-size: 11.8px; margin-top: 5px; line-height: 1.5; }
.field .hint code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

.field input, .field select, .field textarea,
.inline-input, .inline-select, textarea#note-text {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 8px 11px; font-size: 13.5px; font-family: inherit;
  background: var(--surface); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.field textarea { resize: vertical; line-height: 1.55; }
.field input.mono, .field textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--text-3); }
.field input:focus, .field select:focus, .field textarea:focus,
.inline-input:focus, .inline-select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
.field input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-weak); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.thirds { grid-template-columns: 1fr 1fr 1fr; }
.field-row.narrow-first { grid-template-columns: 124px 1fr; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.2px; margin-bottom: 7px; cursor: pointer; }
.check input { width: auto; accent-color: var(--accent); }
.checkbox-field { display: flex; flex-direction: column; justify-content: flex-end; }

.inline-select, .inline-input { width: auto; }
.inline-input { min-width: 230px; }
.inline-select.grow { flex: 1; }
.inline-run { display: flex; gap: 9px; align-items: center; }

.kv-row { display: grid; grid-template-columns: 1fr 1.4fr 32px; gap: 7px; margin-bottom: 7px; }
.kv-row input {
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 12.5px; background: var(--surface); color: var(--text);
  font-family: ui-monospace, Consolas, monospace;
}
.kv-row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.kv-row .rm { background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-3); }
.kv-row .rm:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-weak); }

.param-def { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px; margin-bottom: 10px; background: var(--surface-2); }
.param-def .field { margin-bottom: 9px; }
.param-flags { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.param-flags .check { margin-bottom: 0; }

/* -------------------------------------------------------- recipient picker */
.picker { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); max-height: 208px; overflow-y: auto; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.2px; }
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--surface-2); }
.picker-row input { accent-color: var(--accent); width: auto; margin: 0; }
.picker-row .who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.picker-row .who span { color: var(--text-3); font-size: 11.8px; }
.picker-empty { padding: 14px; color: var(--text-3); font-size: 12.5px; text-align: center; }

.member-list { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 230px; overflow-y: auto; }
.member-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 13.2px; }
.member-row:last-child { border-bottom: none; }

/* ----------------------------------------------------------------- result */
.result-box { border-radius: var(--radius); padding: 15px 17px; margin-top: 18px; font-size: 13.2px; border: 1px solid var(--line); background: var(--surface-2); }
.result-box.ok   { background: var(--ok-weak); border-color: var(--ok); }
.result-box.fail { background: var(--danger-weak); border-color: var(--danger); }
.result-box.dry  { background: var(--surface-2); border-color: var(--line-strong); }
.result-head { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; font-size: 13.2px; }
.result-head .muted { color: var(--text-3); font-size: 12px; }
.result-message { margin-top: 7px; font-weight: 620; color: var(--ok); }
.result-error { margin-top: 7px; font-weight: 600; color: var(--danger); }
.result-note { margin-top: 7px; color: var(--text-2); }
.result-box .req { color: var(--text-3); font-size: 12px; word-break: break-all; margin-top: 9px; }
.result-box details { margin-top: 11px; }
.result-box summary { cursor: pointer; color: var(--text-3); font-size: 12.2px; }

pre {
  background: #0C1220; color: #CBD8F5;
  padding: 13px 15px; border-radius: var(--radius-sm);
  overflow: auto; font-size: 12.2px; line-height: 1.55;
  margin: 11px 0 0; max-height: 320px;
  font-family: ui-monospace, Consolas, monospace;
}
.exec-detail pre.small { max-height: 170px; margin: 0; font-size: 11.8px; }

.detail-list { display: grid; grid-template-columns: 128px 1fr; gap: 9px 16px; }
.detail-list dt { color: var(--text-3); font-weight: 600; font-size: 12px; }
.detail-list dd { margin: 0; font-size: 13.2px; word-break: break-word; }

/* ------------------------------------------------------------ login screen */
#login-root {
  display: none; min-height: 100vh; align-items: center; justify-content: center;
  padding: 24px; background: var(--sidebar-bg);
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 34px; width: 100%; max-width: 396px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.6); animation: rise .2s cubic-bezier(.2,.8,.3,1);
}
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 660; letter-spacing: -.02em; margin-bottom: 6px; }
.login-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.login-mark svg { width: 17px; height: 17px; }
.login-sub { color: var(--text-3); font-size: 13.2px; margin-bottom: 24px; }
.login-note { background: var(--warn-weak); color: var(--warn); padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.8px; margin-bottom: 16px; border: 1px solid var(--warn); }
.login-error { background: var(--danger-weak); border: 1px solid var(--danger); color: var(--danger); padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 15px; }
.login-btn { width: 100%; padding: 10px; margin-top: 8px; font-size: 14px; }

/* ----------------------------------------------------------------- toasts */
#toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--text); color: var(--surface);
  padding: 11px 17px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13.3px; font-weight: 500;
  max-width: 400px; animation: rise .16s cubic-bezier(.2,.8,.3,1);
}
.toast.error   { background: var(--danger); color: #fff; }
.toast.success { background: var(--ok); color: #fff; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .menu-btn { display: grid; }
  main { padding: 22px 18px 70px; }
}
@media (max-width: 640px) {
  .field-row, .field-row.thirds, .field-row.narrow-first { grid-template-columns: 1fr; }
  .detail-list { grid-template-columns: 1fr; gap: 3px 0; }
  .detail-list dd { margin-bottom: 8px; }
  .inline-input { min-width: 0; width: 100%; }
  .page-head { flex-direction: column; }
  .topbar { padding: 0 16px; }
}

/* ------------------------------------------------- project notifications */
.notify-card { margin-bottom: 6px; }
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.recipients { display: flex; flex-wrap: wrap; gap: 8px; }
.recipient {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 5px 11px 5px 5px; border-radius: 20px; font-size: 12.8px;
}
.recipient-dot {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 650; flex-shrink: 0;
}

.theme-btn { margin-left: auto; flex-shrink: 0; }
