/* Tank2 Plugin Hub — console shell.
   Artboard 05 (tokens) and 06 (components) of the design canvas.
   No gradients, no shadows except the focus ring, no pill radii. */

:root {
  /* surfaces */
  --bg:        #0A0C0F;
  --rail:      #0D1014;
  --surface:   #12161C;
  --inset:     #0F1318;
  --selected:  #171D26;
  --line:      #1E242C;
  --line-soft: #171C23;
  --control:   #242B34;

  /* text */
  --text:     #E6EAF0;
  --text-2:   #C4CCD8;
  --muted:    #98A3B2;
  --faint:    #78828F;
  --disabled: #4E5764;

  /* brand */
  --accent:      #00A5FF;
  --accent-soft: rgba(0, 165, 255, 0.13);
  --accent-line: rgba(0, 165, 255, 0.38);
  --accent-ring: rgba(0, 165, 255, 0.35);
  --accent-ink:  #04202E;
  --accent-link: #56C2FF;

  /* status */
  --ok:     #3DD68C;
  --warn:   #F5B740;
  --danger: #FF6B6B;

  /* geometry */
  --r-chip: 5px;
  --r-row: 7px;
  --r-control: 8px;
  --r-card: 9px;
  --r-panel: 10px;
  --rail-w: 232px;
  --list-w: 336px;
  --gutter: 32px;

  --focus: 0 0 0 3px var(--accent-ring);

  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* Author `display` rules otherwise beat the UA stylesheet's [hidden] rule. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-link); text-decoration: none; }
a:hover { color: #8AD4FF; text-decoration: underline; }

button, input, textarea, select { font-family: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
h1 { font-size: 27px; }
h2 { font-size: 23px; }

code, .mono { font-family: var(--mono); }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.grow { flex-grow: 1; }
.mb0 { margin-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Section label — 10 / 600 / 0.1em / caps */
.label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  border: 1px solid #262E38;
  border-radius: 4px;
  padding: 3px 7px;
}

/* ===================================================== shell ============ */

.shell { display: flex; min-height: 100vh; }

.rail {
  width: var(--rail-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--rail);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.rail-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.rail-brand:hover { color: var(--text); text-decoration: none; }
.rail-brand img { width: 30px; height: 30px; display: block; }
.rail-brand b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.rail-brand small {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.rail-group { display: flex; flex-direction: column; gap: 2px; }
.rail-group > .label { padding: 0 10px 8px; }

.rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--r-row);
  color: #9AA5B4;
  transition: background 120ms ease, color 120ms ease;
}
.rail-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-2); text-decoration: none; }
.rail-link > span:first-of-type { flex-grow: 1; }
.rail-link .count { font-family: var(--mono); font-size: 11px; color: #5F6978; }
.rail-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.rail-link.is-active:hover { background: var(--accent-soft); color: var(--accent); }
.rail-link.is-active .count { color: inherit; opacity: 0.8; }

.rail-note { padding: 0 10px; display: flex; flex-direction: column; gap: 8px; }
.rail-note p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.rail-note code {
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.5;
  word-break: break-all;
}

.rail-doclink { font-size: 12.5px; color: var(--accent-link); }

.feed-state { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.15); }
.dot-warn { background: var(--warn); }

.rail-foot {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rail-user { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}
.rail-user b {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rail-user small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.rail-user small.is-client { color: var(--muted); }
.rail-user .who { min-width: 0; }

.signout {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  height: 34px;
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: #9AA5B4;
  border-radius: var(--r-row);
  font-size: 12.5px;
  cursor: pointer;
}
.signout:hover { border-color: var(--control); color: var(--text-2); text-decoration: none; }
.rail-foot form { display: block; }

.rail-locked { opacity: 0.4; pointer-events: none; }
.lock-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--warn);
}

.main {
  flex-grow: 1;
  min-width: 0;
  padding: 26px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.main.is-split { height: 100vh; overflow: hidden; }
.main.narrow { max-width: 1140px; gap: 18px; }

.topbar { display: none; }

/* ===================================================== page head ======== */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.page-head p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); max-width: 76ch; }
.page-head .lead { font-size: 14px; }

.crumbs { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.crumbs .sep { opacity: 0.6; }
.crumbs .here { color: var(--text); }

/* ===================================================== status strip ===== */

.statstrip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 11px 15px;
}
.stat .label { margin-bottom: 4px; }
.stat .value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stat .value.is-warn { color: var(--warn); }
.stat .value.is-quiet { color: var(--muted); }
.stat .qualifier { font-family: var(--font); font-size: 12px; color: var(--faint); margin-left: 7px; }

/* ===================================================== split panel ====== */

.split {
  flex-grow: 1;
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-panel);
  display: flex;
  overflow: hidden;
}

.master {
  width: var(--list-w);
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--inset);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.master-head {
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 13px; pointer-events: none; }
.search input[type="search"] {
  width: 100%;
  height: 40px;
  padding: 0 56px 0 34px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
}
.search input[type="search"]::placeholder { color: var(--faint); }
.search input[type="search"]:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--focus); }
.search .kbd { position: absolute; right: 10px; top: 11px; }

.master-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.master-meta .by { font-family: var(--mono); font-size: 11px; letter-spacing: 0; text-transform: none; }

.master-list {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.plugin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 12px;
  border-radius: var(--r-row);
  flex-shrink: 0;
  transition: background 120ms ease;
}
.plugin-row:hover { background: var(--surface); text-decoration: none; }
.plugin-row .who { min-width: 0; flex-grow: 1; }
.plugin-row .name {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plugin-row .sub {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plugin-row .ver { font-family: var(--mono); font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.plugin-row .ver.is-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--warn);
}
.plugin-row .ver.is-warn::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--warn);
}
.plugin-row.is-selected { background: var(--selected); }
.plugin-row.is-selected .name { font-weight: 600; color: var(--accent); }
.plugin-row.is-selected .sub { color: #8B96A5; }
.plugin-row.is-selected .ver { font-weight: 500; color: var(--accent); }
.plugin-row.is-selected .ver.is-warn { color: var(--warn); }
.plugin-row.is-archived .name { color: var(--muted); }

/* ===================================================== detail =========== */

.detail {
  flex-grow: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.detail-title { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.detail-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 11.5px;
  color: #8B96A5;
}
.detail-meta .live { display: flex; align-items: center; gap: 6px; color: var(--ok); }
.detail-meta .live .dot { width: 6px; height: 6px; box-shadow: none; }
.detail-meta .flagged { display: flex; align-items: center; gap: 6px; color: var(--warn); }
.detail-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.detail-desc { margin: 0; font-size: 14px; color: var(--muted); max-width: 76ch; }

.panel {
  border: 1px solid var(--line);
  background: var(--inset);
  border-radius: var(--r-card);
  padding: 15px 17px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-head .note { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 24px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.kv > div { display: flex; gap: 10px; min-width: 0; }
.kv .k { color: var(--faint); flex-shrink: 0; }
.kv .v { color: var(--text-2); overflow-wrap: anywhere; }

.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow input {
  flex-grow: 1;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--bg);
  color: #8B96A5;
  font-family: var(--mono);
  font-size: 12px;
}

.section-bar { display: flex; align-items: center; gap: 11px; }
.section-bar .count { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.section-bar .rule { flex-grow: 1; height: 1px; background: var(--line); }

.builds { display: flex; flex-direction: column; gap: 9px; }

.build {
  border: 1px solid var(--line);
  background: var(--inset);
  border-radius: var(--r-card);
  padding: 12px 17px;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}
.build.is-current {
  border-color: var(--accent-line);
  padding: 15px 17px;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.build-line { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.build .v { font-family: var(--mono); font-size: 14px; font-weight: 500; color: var(--text-2); }
.build.is-current .v { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.build .meta { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.build .spacer { flex-grow: 1; }
.build form { display: inline-flex; }

.notes { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.notes li { margin-bottom: 3px; }

.empty {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  text-align: center;
  padding: 32px 24px;
}
.empty h2 { font-size: 15px; letter-spacing: 0; }
.empty p { margin: 0; font-size: 13px; color: var(--muted); max-width: 50ch; }
.empty .hint {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--faint);
  flex-wrap: wrap;
  justify-content: center;
}
.empty .btn, .empty .btn-primary { margin-top: 6px; }

.panel-empty {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-panel);
  flex-grow: 1;
  min-height: 232px;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  color: var(--faint);
}

/* ===================================================== buttons ========== */

.btn, .btn-primary, .btn-danger, .btn-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--r-control);
  border: 1px solid var(--control);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); text-decoration: none; }

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  padding: 0 18px;
}
.btn-primary:hover { background: #33B8FF; border-color: #33B8FF; color: var(--accent-ink); text-decoration: none; }

.btn-danger {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.18); border-color: var(--danger); text-decoration: none; }

.btn-quiet { border-color: transparent; color: var(--muted); padding: 0 14px; }
.btn-quiet:hover { color: var(--text-2); text-decoration: none; }

.btn-sm { height: 40px; padding: 0 13px; font-size: 13px; border-radius: var(--r-row); }
.btn-sm.btn-primary { font-size: 13px; }

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--r-row);
}

.btn-block { width: 100%; }

.btn-download {
  height: 52px;
  padding: 0 24px;
  border-radius: var(--r-card);
  font-size: 15px;
}

.btn:disabled, .btn-primary:disabled, .btn-danger:disabled, .btn-sm:disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--disabled);
  cursor: not-allowed;
}

/* ===================================================== forms ============ */

.form { display: flex; flex-direction: column; gap: 20px; }

.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: 24px;
}

.form-cols { display: flex; gap: 24px; align-items: flex-start; }
.form-main { flex: 1 1 700px; min-width: 0; }
.aside {
  width: 300px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--inset);
  border-radius: var(--r-panel);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.aside.wide { width: 360px; }
.aside p { margin: 0; font-size: 12.5px; color: var(--faint); line-height: 1.6; }
.aside p.tail { margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--line); }
.aside-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
}
.aside-item .mark { color: var(--warn); flex-shrink: 0; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .fieldset > legend { font-size: 13.5px; font-weight: 600; }
.field .hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); }
.field-row.date-checks { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.field.tight { max-width: 220px; }

input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="date"], input[type="search"], select {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: var(--r-control);
  border: 1px solid var(--control);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--r-control);
  border: 1px solid var(--control);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: var(--focus);
}

input[readonly], .readonly {
  border-color: var(--line);
  background: var(--rail);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.field.has-error > label { color: var(--danger); }
.field.has-error input, .field.has-error textarea { border-color: rgba(255, 107, 107, 0.55); }

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  flex-wrap: wrap;
}
.form-actions .note { font-size: 12.5px; color: var(--faint); }

/* choices */

.check, .radio { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; font-size: 13.5px; }
.check input, .radio input { margin-top: 3px; flex-shrink: 0; accent-color: var(--accent); }
.check span span, .radio span span { display: block; }
.check small, .radio small { display: block; font-size: 12.5px; color: var(--muted); }
.check.is-disabled, .radio.is-disabled { opacity: 0.45; cursor: not-allowed; }

.radios { display: flex; flex-direction: column; gap: 10px; }
.radio.card-choice {
  border: 1px solid var(--control);
  background: var(--inset);
  border-radius: var(--r-control);
  padding: 13px 15px;
}
.radio.card-choice:hover { border-color: #313A46; }
.radio.card-choice.is-on { border-color: var(--accent-line); background: var(--accent-soft); }
.radio.card-choice strong { display: block; font-weight: 600; }

.fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fieldset > legend { padding: 0 6px; }

.access-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 260px;
  overflow-y: auto;
  padding: 12px;
  border-radius: var(--r-control);
  background: var(--bg);
  border: 1px solid var(--line);
}
.access-list.is-off { opacity: 0.45; pointer-events: none; }

/* ===================================================== drop zone ======== */

.dropzone {
  border: 1px dashed #2E3743;
  border-radius: var(--r-control);
  background: var(--inset);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone:hover, .dropzone.is-hover { border-color: var(--accent-line); }
.dropzone.is-filled { border-style: solid; border-color: var(--line); padding: 18px; }
.dropzone input[type="file"] { display: none; }
.dropzone .badge {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--r-control);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone .zone-text { flex-grow: 1; min-width: 0; }
.dropzone .zone-title { display: block; font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.dropzone .zone-title.mono { font-family: var(--mono); font-size: 13px; color: var(--text); }
.dropzone .zone-sub { display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px; }

/* pre-flight result */

.preflight {
  border-radius: var(--r-control);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--inset);
}
.preflight.is-ok { border-color: rgba(61, 214, 140, 0.4); background: rgba(61, 214, 140, 0.05); }
.preflight.is-bad { border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.05); }
.preflight-head { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; }
.preflight.is-ok .preflight-head { color: var(--ok); }
.preflight.is-bad .preflight-head { color: var(--danger); }
.preflight-grid {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 7px 16px;
  font-size: 13px;
}
.preflight-grid dt { color: var(--faint); }
.preflight-grid dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.preflight-grid dd strong { font-family: var(--mono); font-weight: 600; color: var(--text); }
.preflight-grid dd code { font-family: var(--mono); color: var(--text-2); }
.preflight-note { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; }
.preflight-note.err { color: var(--danger); }
.preflight-note.warn { color: var(--warn); }
.preflight-note.info { color: var(--muted); }
.preflight-note .mark { flex-shrink: 0; font-weight: 600; }

/* ===================================================== tags ============= */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  border-radius: var(--r-chip);
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.tag-version { font-family: var(--mono); font-weight: 500; color: var(--accent); background: var(--accent-soft); }
.tag-version.is-warn { color: var(--warn); background: rgba(245, 183, 64, 0.14); }
.tag-warn { color: var(--warn); background: rgba(245, 183, 64, 0.14); }
.tag-code { font-family: var(--mono); font-size: 12px; color: var(--warn); background: rgba(245, 183, 64, 0.12); padding: 4px 10px; }

.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-chip);
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}
.pill-dev { color: var(--accent); background: var(--accent-soft); }
.pill-current { color: var(--accent-ink); background: var(--accent); padding: 3px 8px; }
.pill-warn { color: var(--warn); background: rgba(245, 183, 64, 0.14); }

.status-word { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.status-word.is-warn { color: var(--warn); }

/* ===================================================== flash ============ */

.flash {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border-radius: var(--r-control);
  padding: 13px 15px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.flash svg { flex-shrink: 0; margin-top: 1px; }
.flash-success { border-color: rgba(61, 214, 140, 0.4); background: rgba(61, 214, 140, 0.07); color: #B7F0D2; }
.flash-error { border-color: rgba(255, 107, 107, 0.45); background: rgba(255, 107, 107, 0.07); color: #FFC9C9; }
.flash-warn { border-color: rgba(245, 183, 64, 0.45); background: rgba(245, 183, 64, 0.07); color: #FFE2AD; }

.doc-source {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--inset);
  border-radius: var(--r-panel);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ===================================================== tables =========== */

.table-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  height: 38px;
  padding: 0 18px;
  text-align: left;
  background: var(--inset);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.table td { padding: 11px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-off { opacity: 0.5; }
.table tr.is-flagged { background: rgba(245, 183, 64, 0.04); }
.table .right { text-align: right; }
.table .who { font-size: 13.5px; font-weight: 500; }
.table .stamp { font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.table .action { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.table .action.is-key { color: var(--accent); }
.table .action.is-bad { color: var(--warn); }
.table .detail-cell { font-size: 12.5px; color: var(--muted); }
.table .detail-cell.is-bad { color: var(--warn); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.row-actions form { display: inline-flex; }

/* filter row (activity) */

.filterbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filterbar .search { flex-grow: 1; max-width: 340px; }
.filterbar .search input[type="search"] { padding-right: 14px; height: 40px; }
.segmented {
  display: flex;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-control);
  padding: 3px;
  gap: 3px;
  flex-wrap: wrap;
}
.segmented button {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.segmented button:hover { color: var(--text-2); }
.segmented button.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ===================================================== disclosure ======= */

.disclosure {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 14px 16px;
}
.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-size: 13.5px;
  font-weight: 600;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .sub { font-weight: 400; font-size: 12.5px; color: var(--faint); }
.disclosure > summary .chev { margin-left: auto; color: var(--faint); transition: transform 120ms ease; }
.disclosure[open] > summary .chev { transform: rotate(90deg); }
.disclosure .body { padding-top: 16px; }

.danger-zone { border-color: rgba(255, 107, 107, 0.3); background: rgba(255, 107, 107, 0.04); }
.danger-zone > summary { color: var(--danger); }
.danger-zone > summary .sub { color: var(--muted); }

.kv-list { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 9px 18px; font-size: 13px; margin: 0; }
.kv-list dt { color: var(--faint); }
.kv-list dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.kv-list dd code { font-family: var(--mono); font-size: 12px; }
.kv-list dd .hash { font-size: 11px; color: var(--faint); }

/* ===================================================== handover ========= */

.handover {
  border: 1px solid var(--accent-line);
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* ===================================================== preview ========== */

.preview-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-control);
  padding: 15px 16px;
}
.preview-card .title { font-size: 13px; font-weight: 600; margin-bottom: 9px; }
.preview-card ul { margin: 0; padding-left: 17px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.preview-card li { margin-bottom: 5px; }
.preview-card li:last-child { margin-bottom: 0; }
.preview-card .none { font-size: 12.5px; color: var(--faint); }

/* strength meter */

.meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width 120ms ease, background 120ms ease; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter-row .meter { flex-grow: 1; }
.meter-row .read { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }

/* ===================================================== sign in ========== */

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 16px; }
.auth { display: flex; flex-direction: column; align-items: center; gap: 26px; width: 100%; }
.auth-card {
  width: 420px;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-panel);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand img { width: 40px; height: 40px; display: block; }
.auth-brand h1 { font-size: 19px; letter-spacing: -0.02em; }
.auth-brand p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.auth-card .form { gap: 16px; }
.auth-foot {
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
  text-align: center;
}
.auth-host { display: flex; align-items: center; gap: 9px; }
.auth-host code { font-size: 11.5px; color: var(--faint); }
.auth-host .dot { width: 6px; height: 6px; box-shadow: none; }

/* ===================================================== error ============ */

.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }

/* ===================================================== responsive ======= */

/* Below 1080 the split panel becomes list, then detail. */
@media (max-width: 1079px) {
  .shell { flex-direction: column; }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    width: 264px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 160ms ease;
  }
  .rail.is-open { transform: translateX(0); }

  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    flex-shrink: 0;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: var(--rail);
    position: sticky;
    top: 0;
    z-index: 30;
  }
  .topbar img { width: 24px; height: 24px; display: block; }
  .topbar .title {
    flex-grow: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .btn-icon { width: 44px; height: 44px; border: 0; color: var(--text-2); text-decoration: none; }
  .topbar .tag-version { flex-shrink: 0; }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.55);
  }

  .main { padding: 20px 16px; }
  .main.is-split { height: auto; overflow: visible; }

  .split { flex-direction: column; border: 0; background: transparent; overflow: visible; }
  .master {
    width: 100%;
    border-right: 0;
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    background: var(--inset);
  }
  .master-list { overflow: visible; }
  .detail {
    border: 1px solid var(--line);
    border-radius: var(--r-panel);
    background: var(--surface);
    overflow: visible;
  }

  /* One pane at a time: the detail pushes over the list, and the list page
     furniture goes with it. */
  .split.has-selection .master { display: none; }
  .split:not(.has-selection) .detail { display: none; }
  .main.has-selection > .page-head,
  .main.has-selection > .statstrip,
  .main.has-selection > .foot { display: none; }

  .plugin-row, .btn-icon, .btn-sm { min-height: 44px; }
  .form-cols { flex-direction: column; }
  .aside, .aside.wide { width: 100%; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }

  .statstrip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 2px;
  }
  .statstrip::-webkit-scrollbar { display: none; }
  .stat { flex: 0 0 auto; min-width: 148px; }

  .page-head { flex-direction: column; gap: 14px; }
  .page-head .btn, .page-head .btn-primary { width: 100%; }
  .detail-actions { width: 100%; }
  .detail-actions .btn, .detail-actions .btn-primary { flex: 1 1 auto; }
  .field-row, .field-row.three, .field-row.date-checks { grid-template-columns: 1fr; }
  .kv, .kv-list, .preflight-grid { grid-template-columns: 1fr; gap: 4px; }
  .kv-list dt, .preflight-grid dt { margin-top: 8px; }
  .card { padding: 18px; }
  .detail { padding: 18px 16px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filterbar .search { max-width: none; }
}
