/* =====================================================================
   Group Scheduler — control panel
   A dense operations tool: quiet surfaces, one accent, generous rows.
   ===================================================================== */

:root {
  --bg:        #0A0D13;
  --surface:   #111621;
  --surface-2: #151B27;
  --raise:     #1B2331;
  --line:      #202939;
  --line-soft: #1A212D;

  --fg:    #E6EAF2;
  --dim:   #8E99AD;
  --faint: #5C6678;

  /* Brand. Lives in the chrome — nav, focus, primary buttons. It must not
     appear inside data, or a reader learns nothing from seeing it. */
  --accent:      #6C8CFF;
  --accent-2:    #9AB0FF;
  --accent-soft: rgba(108,140,255,.13);

  /* Data colour is a signal channel, never decoration. Every use of these
     is paired with a word or an icon so hue is never the only cue. */
  --num:      #F2F5FA;   /* a figure with no verdict attached */
  --num-dim:  #6E7889;   /* its unit */

  --ok:   #3DD68C;
  --warn: #F0B429;
  --bad:  #FF6B6B;

  --ok-soft:   rgba(61,214,140,.12);
  --warn-soft: rgba(240,180,41,.12);
  --bad-soft:  rgba(255,107,107,.12);

  --r:    10px;
  --r-lg: 14px;

  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --side-w: clamp(210px, 15.5vw, 290px);
}

* { box-sizing: border-box; }

/* One dial for the whole interface. Everything below is in rem, so the UI
   grows on a big monitor and tightens on a laptop instead of sitting at one
   fixed pixel size that only looks right on the machine it was built on. */
html {
  font-size: clamp(14.5px, 0.42vw + 12.6px, 20px);
  -webkit-text-size-adjust: 100%;
}

html, body { height: 100%; min-height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 0.9375rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); }

/* ------------------------------- shell -------------------------------- */

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

.side {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 40;
}

.brand {
  padding: 22px 20px 18px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -.02em;
  color: var(--fg);
}
.brand span { color: var(--accent); margin-left: 4px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 14px 22px; }

.nav-sep {
  margin: 20px 0 8px;
  padding: 0 12px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--faint);
}

.nav-i {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 2px 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dim);
  font: 500 0.875rem/1 var(--sans);
  letter-spacing: -.005em;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.nav-i.on::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.nav-i:hover { background: var(--surface-2); color: var(--fg); }
.nav-i.on { background: var(--accent-soft); color: var(--accent-2); }

/* every icon occupies the same box, so the labels line up dead straight */
.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  flex: 0 0 18px;
  opacity: .9;
}
.nav-ico svg { display: block; }
.nav-i.on .nav-ico { opacity: 1; }

.nav-tag {
  margin-left: auto;
  font: 500 0.6875rem/1 var(--mono);
  color: var(--faint);
}
.nav-i.on .nav-tag { color: var(--accent-2); }

.side-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--dim);
}
.dot {
  width: 7px; height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--faint);
}
.dot      { background: var(--ok);  box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.bad  { background: var(--bad);  box-shadow: 0 0 0 3px var(--bad-soft); }
.dot.off  { background: var(--faint); box-shadow: none; }

.logout {
  font-size: 0.75rem;
  color: var(--faint);
  text-decoration: none;
  width: fit-content;
}
.logout:hover { color: var(--bad); }

.main { flex: 1; min-width: 0; height: 100vh; overflow-y: auto; }

.wrap {
  width: 100%;
  max-width: 82rem;
  margin: 0 auto;
  padding: 1.9rem clamp(1.1rem, 2.4vw, 2.6rem) 6rem;
}

.topbar, .topbar-inner, .topbar-spacer, .section-title { display: none; }

/* ------------------------------- pages -------------------------------- */

.card.page { display: none; }
.card.page.active { display: block; animation: rise .22s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.card.page > .card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 0 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  cursor: default;
}
.card.page > .card-head .ico,
.card.page > .card-head .caret { display: none; }

.card.page > .card-head .card-title {
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -.02em;
}
.card.page > .card-head .card-sub {
  font-size: 0.8125rem;
  color: var(--dim);
  margin-top: 4px;
}

.card.page > .card-body { display: block; }

/* nested collapsible panel ("More options") */
.card:not(.page) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.card:not(.page) > .card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.card:not(.page) > .card-head:hover { background: var(--surface-2); }
.card:not(.page) > .card-head .ico { font-size: 0.875rem; opacity: .7; }
.card:not(.page) > .card-head .card-title { font-size: 0.8438rem; font-weight: 600; }
.card:not(.page) > .card-head .card-sub { font-size: 0.75rem; color: var(--dim); margin-top: 2px; }
.card:not(.page) > .card-head .caret {
  margin-left: auto;
  font-size: 0.625rem;
  color: var(--faint);
  transition: transform .16s;
}
.card:not(.page).open > .card-head .caret { transform: rotate(180deg); }
.card:not(.page) > .card-body { display: none; padding: 0 14px 14px; }
.card:not(.page).open > .card-body { display: block; }

/* ------------------------------ sections ------------------------------ */

.field { margin-bottom: 26px; }
.field:last-child { margin-bottom: 0; }

.lbl {
  display: block;
  margin-bottom: 9px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}

.meta-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.spacer { flex: 1; }

.hint { font-size: 0.7812rem; color: var(--dim); line-height: 1.6; }
.hint.tight { margin-top: 7px; font-size: 0.75rem; }
.hint code {
  font: 500 0.7188rem var(--mono);
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

.count { font: 500 0.75rem var(--mono); color: var(--accent-2); }

.sep { color: var(--faint); font-size: 0.7812rem; }

/* ------------------------------ controls ------------------------------ */

input[type=text], input[type=search], input[type=number], input[type=time],
input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 400 0.8438rem var(--sans);
  outline: none;
  transition: border-color .12s, background .12s;
}
input:hover, select:hover, textarea:hover { border-color: var(--line); background: var(--raise); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--raise);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--faint); }

textarea { min-height: 128px; resize: vertical; line-height: 1.6; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
                    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input[type=file] {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--dim);
  font: 400 0.7812rem var(--sans);
}
input[type=file]::file-selector-button {
  margin-right: 11px;
  padding: 5px 11px;
  background: var(--raise);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 500 0.75rem var(--sans);
  cursor: pointer;
}

input[type=checkbox], input[type=radio] {
  width: 15px; height: 15px;
  flex: 0 0 15px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
}

.row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row-inline > input[type=search],
.row-inline > input[type=text] { flex: 1; min-width: 160px; }
.row-inline > input[type=number] { width: 92px; flex: 0 0 92px; }
.row-inline > input[type=time]   { width: 132px; flex: 0 0 132px; }
.row-inline > select { width: auto; min-width: 150px; flex: 0 1 auto; }

/* ------------------------------ buttons ------------------------------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: #0A0D13;
  font: 600 0.8438rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .12s, background .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { filter: brightness(1.09); }
button:active, .btn:active { filter: brightness(.95); }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }

.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--fg);
}
.ghost:hover { background: var(--surface-2); border-color: var(--line-soft); filter: none; }

.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--dim);
  font-weight: 500;
}
.quiet:hover { background: var(--surface-2); color: var(--fg); filter: none; }

.danger { background: var(--bad); color: #170707; }
.danger.ghost { background: transparent; color: var(--bad); border-color: rgba(255,107,107,.35); }

.sm { padding: 8px 14px; font-size: 0.7812rem; border-radius: 8px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* segmented control */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  flex-wrap: wrap;
}
.seg button {
  background: transparent;
  border: 0;
  color: var(--dim);
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
}
.seg button:hover { color: var(--fg); background: var(--raise); filter: none; }
.seg button.on { background: var(--accent); color: #0A0D13; font-weight: 600; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  font: 500 0.7812rem/1 var(--sans);
  cursor: pointer;
  transition: border-color .12s, color .12s, background .12s;
}
.chip:hover { color: var(--fg); border-color: var(--line-soft); background: var(--raise); filter: none; }
.chip.on {
  background: var(--accent-soft);
  border-color: rgba(108,140,255,.4);
  color: var(--accent-2);
}

/* ----------------------------- pick lists ----------------------------- */

.picklist,
#wave-groups-pick,
#wave-accounts-pick {
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.picklist.short,
#wave-accounts-pick { max-height: min(40vh, 16rem); }

.pick-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .1s;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: var(--raise); }
.pick-item .nm {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-item .tag {
  flex: 0 0 auto;
  font: 400 0.6875rem var(--mono);
  color: var(--faint);
}
.pick-item:has(input:checked) { background: var(--accent-soft); }
.pick-item:has(input:checked) .nm { color: var(--accent-2); }

.split-list { display: grid; gap: 14px; }

.rot-pick { display: flex; flex-wrap: wrap; gap: 7px; }

.empty {
  padding: 16px 14px;
  text-align: center;
  color: var(--faint);
  font-size: 0.8125rem;
}

/* scrollbars */
.picklist::-webkit-scrollbar,
.joinlog::-webkit-scrollbar,
.main::-webkit-scrollbar,
.nav::-webkit-scrollbar,
#wave-groups-pick::-webkit-scrollbar,
#wave-accounts-pick::-webkit-scrollbar { width: 9px; }
.picklist::-webkit-scrollbar-thumb,
.joinlog::-webkit-scrollbar-thumb,
.main::-webkit-scrollbar-thumb,
.nav::-webkit-scrollbar-thumb,
#wave-groups-pick::-webkit-scrollbar-thumb,
#wave-accounts-pick::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px;
}
.picklist::-webkit-scrollbar-thumb:hover,
.main::-webkit-scrollbar-thumb:hover { background: #2E3A4F; }
.picklist::-webkit-scrollbar-track,
.main::-webkit-scrollbar-track { background: transparent; }

/* ----------------------------- campaigns ------------------------------ */

.camp {
  position: relative;
  margin-bottom: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color .12s;
}
.camp:hover { border-color: #2A3446; }

.camp-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--faint);
}
.camp.running   .camp-bar { background: var(--ok); }
.camp.paused    .camp-bar { background: var(--warn); }
.camp.completed .camp-bar { background: var(--faint); }

.camp-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px 13px 18px;
  cursor: pointer;
}
.camp-head:hover { background: var(--surface-2); }

.camp-main { flex: 1; min-width: 0; }
.camp-name {
  font-size: 0.8438rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.camp-line {
  margin-top: 3px;
  font-size: 0.75rem;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camp .caret {
  font-size: 0.5625rem;
  color: var(--faint);
  transition: transform .16s;
}
.camp.open .caret { transform: rotate(180deg); }

.camp-body { display: none; padding: 4px 15px 16px 18px; }
.camp.open .camp-body { display: block; }

.badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  font: 600 0.6562rem/1.6 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--raise);
  color: var(--dim);
}
.badge.running   { background: var(--ok-soft);   color: var(--ok); }
.badge.paused    { background: var(--warn-soft); color: var(--warn); }
.badge.fail      { background: var(--bad-soft);  color: var(--bad); }
.badge.completed { background: var(--raise);     color: var(--faint); }

.kv {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: 6px 14px;
  margin: 4px 0 14px;
  font-size: 0.7812rem;
}
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--fg); word-break: break-word; }

.quote {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 0.7812rem;
  color: var(--dim);
  white-space: pre-wrap;
  max-height: 12rem;
  overflow-y: auto;
}

.errbox {
  margin-top: 11px;
  padding: 11px 13px;
  background: var(--bad-soft);
  border: 1px solid rgba(255,107,107,.25);
  border-radius: 8px;
  font: 400 0.7188rem/1.7 var(--mono);
  color: #FFA8A8;
  max-height: 11rem;
  overflow-y: auto;
  word-break: break-word;
}

/* bulk-select bar */
.sel-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 13px;
  margin-bottom: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.sel-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.7812rem;
  color: var(--dim);
}
.sel-bar .sel-count {
  margin-right: auto;
  font: 500 0.7812rem var(--mono);
  color: var(--accent-2);
}
.camp-check { width: 15px; height: 15px; flex: 0 0 15px; cursor: pointer; }

/* ---------------------------- join progress --------------------------- */

.notice {
  padding: 11px 14px;
  margin-bottom: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 0.8125rem;
}
.notice.ok { border-left-color: var(--ok); background: var(--ok-soft); }

.pbar {
  height: 6px;
  margin: 11px 0 8px;
  background: var(--raise);
  border-radius: 99px;
  overflow: hidden;
}
.pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width .4s ease;
}

.joinlog {
  max-height: min(45vh, 18rem);
  overflow-y: auto;
  margin-top: 12px;
  padding: 11px 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 400 0.75rem/1.85 var(--mono);
}

/* ------------------------------- health ------------------------------- */

.health { display: grid; gap: 9px; }
.health-top {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8125rem;
}
.acct-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 0.8125rem;
}
.acct-check .ok  { color: var(--ok); }
.acct-check .no  { color: var(--bad); }
.ok  { color: var(--ok); }
.no  { color: var(--bad); }

/* ------------------------------- modals ------------------------------- */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5,7,11,.72);
  backdrop-filter: blur(3px);
  padding: 24px;
  overflow-y: auto;
}
.modal.show { display: flex; align-items: center; justify-content: center; }

.modal-box {
  width: 100%;
  max-width: 30rem;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: rise .18s ease;
}
.modal-box h3 {
  margin: 0 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -.015em;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

/* ------------------------------- toasts ------------------------------- */

#toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#toasts > div, #toasts .toast {
  padding: 11px 16px;
  background: var(--raise);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 0.8125rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  animation: rise .2s ease;
}
#toasts .toast.ok  { border-left-color: var(--ok); }
#toasts .toast.bad { border-left-color: var(--bad); }

/* ------------------------------ responsive ---------------------------- */

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side {
    width: 100%;
    flex: none;
    height: auto;
    position: sticky;
    top: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { padding: 14px 18px 10px; }
  .nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0 12px 12px;
  }
  .nav-sep { display: none; }
  .nav-i { width: auto; white-space: nowrap; padding: 8px 13px; }
  .nav-tag { margin-left: 6px; }
  .side-foot { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 18px; }
  .main { height: auto; overflow: visible; }
  .wrap { padding: 22px 18px 70px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
}

/* ---------------------------- overview stats -------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.4rem, 1fr));
  gap: 10px;
}

.stat {
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.stat-n {
  font: 600 1.625rem/1.1 var(--sans);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.stat-l {
  margin-top: 5px;
  font-size: 0.7188rem;
  color: var(--dim);
}
.stat.good .stat-n { color: var(--ok); }
.stat.warn .stat-n { color: var(--warn); }
.stat.bad  .stat-n { color: var(--bad); }

/* one-line rows: next runs, limits, activity */
.line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 13px;
  margin-bottom: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 8px;
  font-size: 0.7812rem;
}
.line.good { border-left-color: var(--ok); }
.line.warn { border-left-color: var(--warn); }
.line.bad  { border-left-color: var(--bad); }

.line-a { flex: 1; min-width: 0; }
.line-v { color: var(--faint); }
.line-b {
  flex: 0 0 auto;
  font: 400 0.7188rem var(--mono);
  color: var(--faint);
}
.line-d {
  flex-basis: 100%;
  margin-top: 3px;
  font: 400 0.7188rem/1.6 var(--mono);
  color: var(--bad);
  word-break: break-word;
}

/* ---------------------------- account board --------------------------- */

.board { display: grid; gap: 7px; }

.board-row {
  display: grid;
  grid-template-columns: 1.4fr auto repeat(3, minmax(74px, .6fr));
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.board-name { font-size: 0.8438rem; font-weight: 600; }

.board-num {
  font: 600 0.9375rem/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.board-num span {
  display: block;
  margin-top: 3px;
  font: 400 0.6562rem var(--sans);
  color: var(--faint);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font: 600 0.6562rem/1.6 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--raise);
  color: var(--dim);
}
.pill.good { background: var(--ok-soft);   color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad  { background: var(--bad-soft);  color: var(--bad); }

@media (max-width: 700px) {
  .board-row { grid-template-columns: 1fr auto; row-gap: 10px; }
  .board-num { text-align: left; }
}

/* ---------------------------- coverage grid --------------------------- */

.grid-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.grid-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  min-width: max-content;
}
.grid-row:last-child { border-bottom: 0; }
.grid-row:hover { background: var(--surface-2); }

.grid-head {
  position: sticky;
  top: 0;
  background: var(--raise);
  border-bottom: 1px solid var(--line);
}
.grid-head .grid-c {
  font: 600 0.6562rem var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
}

.grid-g {
  flex: 0 0 clamp(11rem, 18vw, 16rem);
  padding: 9px 13px;
  font-size: 0.7812rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  position: sticky;
  left: 0;
  background: inherit;
}
.grid-head .grid-g { background: var(--raise); }

.grid-c {
  flex: 0 0 2.7rem;
  text-align: center;
  padding: 9px 0;
  font-size: 0.8125rem;
  cursor: default;
}
.grid-c.yes { color: var(--ok); }
.grid-c.no  { color: #3A4356; }

/* ------------------------------ timeline ------------------------------ */

.tl-hour {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.tl-hour:first-child { border-top: 0; }
.tl-h {
  flex: 0 0 58px;
  padding-top: 9px;
  font: 600 0.75rem var(--mono);
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.tl-items { flex: 1; min-width: 0; }

.line .line-b button { margin-left: 4px; }


/* ================================ hero ================================= */

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 32px;
  align-items: center;
  padding: 30px 32px;
  margin-bottom: 22px;
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(108,140,255,.10), transparent 62%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 1.6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.hero p {
  margin: 0 0 20px;
  max-width: 46ch;
  font-size: 0.8438rem;
  line-height: 1.65;
  color: var(--dim);
}

.bignum { margin: 0 0 20px; }
.bignum-n {
  display: block;
  font: 600 2.75rem/1 var(--sans);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-2);
}
.bignum-l {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--dim);
}

.hero-art { min-height: 170px; }

/* ============================ live columns ============================= */

.live-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 26px 0;
}
.live-col { min-width: 0; }

/* ============================ feature grid ============================= */

.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 11px;
}

.feat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 17px 17px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: border-color .14s, transform .14s, background .14s;
}
.feat:hover {
  border-color: rgba(108,140,255,.42);
  background: var(--surface-2);
  transform: translateY(-2px);
  filter: none;
}

.feat-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin-bottom: 13px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-2);
}
.feat-t { font-size: 0.8438rem; font-weight: 600; margin-bottom: 6px; }
.feat-d { font-size: 0.75rem; line-height: 1.6; color: var(--dim); }
.feat-go {
  margin-top: 12px;
  font-size: 0.7188rem;
  font-weight: 600;
  color: var(--faint);
  transition: color .14s;
}
.feat:hover .feat-go { color: var(--accent-2); }

/* icon beside every page title */
.head-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-2);
  align-self: center;
}

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(8.6rem, 1fr)); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 24px 22px; }
  .hero-art { display: none; }
  .live-cols { grid-template-columns: 1fr; gap: 18px; }
  .wrap { padding: 22px 18px 70px; }
}

.live-col .empty, #ov-feed .empty { text-align: left; padding: 12px 0; }
.hero p { max-width: 52ch; }

/* buttons default to nowrap; feature cards are prose and must wrap */
.feat, .feat * { white-space: normal; }
.feat-d { overflow-wrap: anywhere; }

/* base button centres its content; these are cards, so pin to the top
   and let the "Open" line settle at the bottom of every card equally */
.feat { justify-content: flex-start; }
.feat-go { margin-top: auto; padding-top: 12px; }


/* ============================== landing ================================ */

body.landing-on { overflow: hidden; }

.landing {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 7vh, 5rem) 1.75rem 4rem;
  overflow-y: auto;
  background: #070910;
  transition: opacity .4s ease, transform .4s ease;
}
.landing.gone { opacity: 0; transform: scale(1.015); pointer-events: none; }

.landing-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 55% at 50% -8%, rgba(108,140,255,.20), transparent 68%),
    radial-gradient(46% 40% at 88% 105%, rgba(61,214,140,.10), transparent 70%);
}
.landing-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 62px 62px;
  opacity: .35;
  mask-image: radial-gradient(64% 58% at 50% 42%, #000 30%, transparent 100%);
}

.landing-inner {
  position: relative;
  width: 100%;
  max-width: 60rem;
  text-align: center;
  animation: land .55s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes land {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

.landing-mark {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--dim);
  margin-bottom: 1.8rem;
}
.landing-mark span { color: var(--accent); margin-left: 5px; }

.landing-h {
  margin: 0 0 18px;
  font-size: clamp(34px, 5.6vw, 60px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.landing-p {
  max-width: 54ch;
  margin: 0 auto 1.9rem;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--dim);
  text-wrap: pretty;
}

.landing-num { margin-bottom: 1.4rem; }
.landing-n {
  display: block;
  font: 600 clamp(52px, 9vw, 84px)/1 var(--sans);
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-nl {
  display: block;
  margin-top: 10px;
  font-size: 0.75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}

.landing-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.8rem;
}
.land-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 20px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 118px;
}
.land-chip b {
  font: 600 1.1875rem/1 var(--sans);
  font-variant-numeric: tabular-nums;
}
.land-chip span { font-size: 0.6875rem; color: var(--faint); }

.landing-cta {
  padding: 15px 30px;
  font-size: 0.9375rem;
  border-radius: 11px;
  box-shadow: 0 12px 34px rgba(108,140,255,.28);
}
.landing-cta:hover { transform: translateY(-1px); }

.landing-art {
  max-width: 22rem;
  margin: 1.8rem auto 0;
  opacity: .7;
}

@media (max-width: 700px) {
  .landing { padding: 32px 20px; align-items: flex-start; }
  .landing-art { display: none; }
  .landing-chips { gap: 8px; }
  .land-chip { min-width: 0; flex: 1 1 44%; padding: 10px 14px; }
}

/* the brand is a button now */
.brand {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  padding: 22px 20px 18px;
  font: 700 1rem/1.2 var(--sans);
  letter-spacing: -.02em;
  color: var(--fg);
  cursor: pointer;
}
.brand:hover { filter: none; color: var(--accent-2); }

/* =========================== dead-group panel ========================== */

.panel {
  padding: 20px 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.bad-panel { border-color: rgba(255,107,107,.3); background: linear-gradient(var(--bad-soft), transparent 60%), var(--surface); }
.panel-t { font-size: 0.9375rem; font-weight: 600; }
.panel-s { margin-top: 4px; font-size: 0.7812rem; color: var(--dim); }
.panel-h { margin-bottom: 15px; }

.dead-list {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  max-height: min(50vh, 22rem);
  overflow-y: auto;
}
.panel-actions { margin: 15px 0 10px; }

/* ============================ grid legend ============================== */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}
.legend-i {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.7188rem;
  color: var(--dim);
}
.legend-i b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-2);
  font: 600 0.6562rem var(--mono);
}
.grid-head .grid-c { font: 600 0.6875rem var(--mono); color: var(--accent-2); }


/* keep the failing-group reasons readable rather than terminal-ish */
.pick-item .tag { font-family: var(--sans); font-size: 0.7188rem; }
.line-d { font-family: var(--sans); font-size: 0.75rem; color: #FF9A9A; }
.dead-list .pick-item { padding: 11px 14px; }
.panel { padding: 22px 22px 20px; }

/* buttons centre their contents by default; nav rows must start hard left,
   otherwise every label sits at a different indent depending on its width */
.nav-i { justify-content: flex-start; }
.sel-bar label, .pick-item, .line { justify-content: flex-start; }

/* ============================ small screens ============================ */

.mobilebar { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .app { flex-direction: row; }

  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.7rem clamp(0.9rem, 3vw, 1.2rem);
    background: rgba(10,13,19,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mobilebar-t {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.3rem; height: 2.3rem;
    flex: 0 0 auto;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 9px;
  }
  .burger span {
    display: block;
    width: 15px; height: 1.6px;
    margin: 0 auto;
    border-radius: 2px;
    background: var(--fg);
  }

  /* the sidebar slides in over the page instead of squashing it */
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(19rem, 84vw);
    flex: none;
    height: 100dvh;
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.3,.8,.3,1);
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  body.nav-open .side { transform: none; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(5,7,11,.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .26s;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .nav { display: block; padding: 6px 14px 22px; overflow-y: auto; }
  .nav-sep { display: block; }
  .nav-i { width: 100%; }
  .side-foot { flex-direction: column; align-items: flex-start; }

  .app { display: block; }
  .main { height: auto; overflow: visible; }
  .wrap { padding: 1.4rem clamp(0.9rem, 3.5vw, 1.4rem) 4.5rem; }

  .card.page > .card-head .card-title { font-size: 1.3rem; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr)); }
  .feat-grid { grid-template-columns: 1fr; }
  .board-row { grid-template-columns: 1fr auto; row-gap: .7rem; }
  .board-num { text-align: left; }
  .kv { grid-template-columns: 1fr; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; }
  .btn-row { gap: .5rem; }
  .btn-row > button, .btn-row > .btn { flex: 1 1 auto; }
  .line { flex-wrap: wrap; }
  .line-b { flex-basis: 100%; margin-top: 3px; }
}

@media (min-width: 1800px) {
  .wrap { max-width: 90rem; }
  .feat-grid { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
}

/* touch targets stay comfortable on a phone */
@media (pointer: coarse) {
  .nav-i, .pick-item, .chip { min-height: 2.75rem; }
  .sm { padding: 0.6rem 0.95rem; }
}

/* an empty status box should not draw a box */
.notice:empty, .errbox:empty, .quote:empty, .joinlog:empty { display: none; }

/* =============================== reach ================================= */

.reach {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.reach-main,
.reach-side > div {
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.reach-h {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.reach-t { font-size: 0.95rem; font-weight: 600; }
.reach-s { margin-top: 0.2rem; font-size: 0.75rem; color: var(--dim); }

.reach-pct {
  margin-left: auto;
  font: 600 1.9rem/1 var(--sans);
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.reach-pct.good { color: var(--ok); }
.reach-pct.warn { color: var(--warn); }
.reach-pct.bad  { color: var(--bad); }

.pbar.big { height: 0.6rem; margin: 0 0 1.1rem; }
.pbar-fill.good { background: linear-gradient(90deg, var(--ok), #7BE8B6); }
.pbar-fill.warn { background: linear-gradient(90deg, var(--warn), #FFD37A); }
.pbar-fill.bad  { background: linear-gradient(90deg, var(--bad), #FFA1A1); }

.reach-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}
.reach-facts b {
  display: block;
  font: 600 1.1rem/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
}
.reach-facts span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  color: var(--faint);
}

.reach-side { display: grid; gap: 1rem; align-content: start; }

.reach-lbl {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.reach-big {
  margin-top: 0.5rem;
  font: 600 2.1rem/1 var(--sans);
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.reach-big span {
  display: block;
  margin-top: 0.3rem;
  font: 400 0.72rem/1.3 var(--sans);
  letter-spacing: 0;
  color: var(--dim);
}
.reach-big.up { color: var(--accent-2); }
.reach-sub { margin-top: 0.55rem; font-size: 0.75rem; color: var(--dim); }

.reach-up {
  background: linear-gradient(var(--accent-soft), transparent 70%), var(--surface) !important;
  border-color: rgba(108,140,255,.34) !important;
}
.reach-up.done {
  background: linear-gradient(var(--ok-soft), transparent 70%), var(--surface) !important;
  border-color: rgba(61,214,140,.3) !important;
}
.reach-gain { margin: 0.55rem 0 0.85rem; font-size: 0.8rem; color: var(--fg); }
.reach-gain b { color: var(--accent-2); }

@media (max-width: 900px) {
  .reach { grid-template-columns: 1fr; }
}

/* ================================ tips ================================= */

.tip {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--faint);
  border-radius: var(--r);
}
.tip.bad  { border-left-color: var(--bad);  background: linear-gradient(90deg, var(--bad-soft), transparent 30%), var(--surface); }
.tip.warn { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), transparent 30%), var(--surface); }
.tip.good { border-left-color: var(--ok); }
.tip.dim  { border-left-color: var(--accent); }

.tip-b { flex: 1; min-width: 0; }
.tip-t { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.3rem; }
.tip-d { font-size: 0.8rem; line-height: 1.65; color: var(--dim); }
.tip-b button { margin-top: 0.75rem; }

.stat-n .of { font-size: 0.6em; color: var(--faint); font-weight: 500; }

/* =============================== engine ================================ */

.engine {
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) 1fr;
  gap: 2.2rem;
  align-items: center;
}

.engine-art { position: relative; }
.engine-rpm {
  position: absolute;
  left: 50%;
  bottom: -0.2rem;
  transform: translateX(-50%);
  font: 500 0.7rem var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.engine-state {
  font: 600 1.6rem/1.15 var(--sans);
  letter-spacing: -.035em;
}
.engine-state.on  { color: var(--ok); }
.engine-state.off { color: var(--bad); }
.engine-sub { margin-top: 0.5rem; font-size: 0.85rem; color: var(--dim); }
.engine-panel .btn-row { margin-top: 1.3rem; }
.engine-panel button { padding: 0.85rem 1.5rem; font-size: 0.95rem; }

@media (max-width: 820px) {
  .engine { grid-template-columns: 1fr; gap: 1.4rem; }
  .engine-art { max-width: 16rem; margin: 0 auto; }
}

/* ========================== motion & polish ============================ */

@media (prefers-reduced-motion: no-preference) {

  /* lists arrive in sequence instead of all at once */
  .line, .camp, .feat, .tip, .board-row, .stat {
    animation: pop .34s cubic-bezier(.2,.7,.3,1) both;
  }
  .line:nth-child(1),.camp:nth-child(1),.feat:nth-child(1),.tip:nth-child(1),.board-row:nth-child(1),.stat:nth-child(1){animation-delay:.02s}
  .line:nth-child(2),.camp:nth-child(2),.feat:nth-child(2),.tip:nth-child(2),.board-row:nth-child(2),.stat:nth-child(2){animation-delay:.05s}
  .line:nth-child(3),.camp:nth-child(3),.feat:nth-child(3),.tip:nth-child(3),.board-row:nth-child(3),.stat:nth-child(3){animation-delay:.08s}
  .line:nth-child(4),.camp:nth-child(4),.feat:nth-child(4),.tip:nth-child(4),.board-row:nth-child(4),.stat:nth-child(4){animation-delay:.11s}
  .line:nth-child(5),.camp:nth-child(5),.feat:nth-child(5),.tip:nth-child(5),.board-row:nth-child(5),.stat:nth-child(5){animation-delay:.14s}
  .line:nth-child(6),.camp:nth-child(6),.feat:nth-child(6),.tip:nth-child(6),.board-row:nth-child(6),.stat:nth-child(6){animation-delay:.17s}
  .line:nth-child(n+7),.camp:nth-child(n+7),.feat:nth-child(n+7),.tip:nth-child(n+7),.board-row:nth-child(n+7),.stat:nth-child(n+7){animation-delay:.2s}

  @keyframes pop {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
  }

  /* a bar that is still filling should look like it is working */
  .pbar-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
    animation: sweep 1.9s linear infinite;
  }
  .pbar-fill { position: relative; overflow: hidden; }
  @keyframes sweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
  }

  .stat, .board-row, .land-chip { transition: border-color .16s, transform .16s; }
  .stat:hover, .board-row:hover { border-color: #2C3648; transform: translateY(-1px); }

  .head-i { animation: spin-in .45s cubic-bezier(.2,.8,.3,1) both; }
  @keyframes spin-in {
    from { opacity: 0; transform: rotate(-25deg) scale(.85); }
    to   { opacity: 1; transform: none; }
  }
}

/* a live dot that actually looks live */
.dot { position: relative; }
.dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .dot:not(.bad):not(.off)::after { animation: ping 2.4s ease-out infinite; }
  @keyframes ping {
    0%   { transform: scale(.7); opacity: .7; }
    70%  { transform: scale(2.1); opacity: 0; }
    100% { opacity: 0; }
  }
}

/* every page title sits on a soft accent wash */
.card.page > .card-head {
  position: relative;
}
.card.page > .card-head::before {
  content: "";
  position: absolute;
  left: -1.2rem; right: 0; top: -1.2rem; bottom: 0;
  background: radial-gradient(60% 130% at 0% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
  border-radius: var(--r-lg);
}

.pick-item a { color: var(--accent-2); text-decoration: none; }
.pick-item a:hover { text-decoration: underline; }

/* ============================ live indicator =========================== */

.live-badge {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 0.62rem/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.live-badge i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ok);
}
@media (prefers-reduced-motion: no-preference) {
  .live-badge i { animation: blink 2.2s ease-in-out infinite; }
  @keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
}

/* a figure that just moved */
.bump { animation: bump .5s cubic-bezier(.2,.8,.3,1); }
@keyframes bump {
  0%   { transform: none; }
  35%  { transform: translateY(-3px) scale(1.05); color: var(--accent-2); }
  100% { transform: none; }
}


/* =====================================================================
   Redesign pass — verdict first, fewer boxes, states that are designed
   ===================================================================== */

/* ---- one verdict per screen ---- */

.verdict {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  margin: 0 0 1.6rem;
  padding: 0 0 1.4rem;
  border-bottom: 1px solid var(--line-soft);
}
.verdict-n {
  font: 600 clamp(2.1rem, 4.2vw, 3.1rem)/0.95 var(--sans);
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  color: var(--num);
}
.verdict-n.good { color: var(--ok); }
.verdict-n.warn { color: var(--warn); }
.verdict-n.bad  { color: var(--bad); }
.verdict-b { flex: 1; min-width: 0; padding-top: .3rem; }
.verdict-t { font-size: 1rem; font-weight: 600; letter-spacing: -.015em; }
.verdict-d { margin-top: .35rem; font-size: .8rem; line-height: 1.6; color: var(--dim); max-width: 52ch; }
.verdict-b button { margin-top: .8rem; }

/* ---- stat tiles: space and weight do the grouping, not borders ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stat {
  padding: 1.05rem 1.2rem 1rem;
  background: none;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-radius: 0;
}
.stat:first-child { border-left: 0; padding-left: 0; }
.stat:hover { transform: none; border-color: var(--line-soft); background: rgba(255,255,255,.014); }

.stat-n {
  font: 600 1.6rem/1.05 var(--sans);
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: var(--num);
}
/* colour only where the figure is a verdict, and always with a word beside it */
.stat.good .stat-n { color: var(--ok); }
.stat.warn .stat-n { color: var(--warn); }
.stat.bad  .stat-n { color: var(--bad); }
.stat-l {
  margin-top: .4rem;
  font-size: .7rem;
  letter-spacing: .01em;
  color: var(--num-dim);
}
.stat-n .of, .stat-n .u {
  font-size: .55em;
  font-weight: 500;
  color: var(--num-dim);
  letter-spacing: 0;
}

/* ---- designed empty states ---- */

.blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .2rem;
  padding: 2.6rem 1.5rem;
}
.blank svg { color: var(--line); margin-bottom: .9rem; }
.blank-t { font-size: .9rem; font-weight: 600; }
.blank-d { font-size: .78rem; color: var(--dim); max-width: 34ch; line-height: 1.6; }
.blank button { margin-top: 1rem; }

/* ---- skeletons instead of the word "Loading" ---- */

.skel { display: grid; gap: .45rem; }
.skel i {
  display: block;
  height: 2.6rem;
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--surface) 0%, var(--raise) 40%, var(--surface) 80%);
  background-size: 300% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skel i { animation: shim 1.25s ease-in-out infinite; }
  @keyframes shim { from { background-position: 160% 0; } to { background-position: -60% 0; } }
}

/* ---- keyboard users get a visible path ---- */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.nav-i:focus-visible, .feat:focus-visible { outline-offset: -2px; }

/* ---- density is a setting, not a decision made for you ---- */

body.compact { --r: 8px; --r-lg: 11px; }
body.compact .wrap { padding-top: 1.2rem; }
body.compact .field { margin-bottom: 1.4rem; }
body.compact .pick-item { padding: .42rem .8rem; min-height: 0; }
body.compact .camp-head { padding: .55rem .8rem .55rem 1rem; }
body.compact .line { padding: .45rem .8rem; margin-bottom: .25rem; }
body.compact .board-row { padding: .6rem .9rem; }
body.compact .stat { padding: .75rem .9rem .7rem; }
body.compact .stat-n { font-size: 1.35rem; }
body.compact .card.page > .card-head { padding-bottom: .9rem; margin-bottom: 1.1rem; }
body.compact .verdict { margin-bottom: 1.1rem; padding-bottom: 1rem; }

.density {
  display: flex;
  gap: .25rem;
  padding: .2rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.density button {
  flex: 1;
  padding: .38rem .5rem;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--faint);
  font: 500 .68rem/1 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.density button.on { background: var(--raise); color: var(--fg); }

/* ---- fewer boxes: panels lose their outline unless they need action ---- */

.line {
  background: none;
  border: 0;
  border-left: 2px solid var(--line-soft);
  border-radius: 0;
  padding: .6rem 0 .6rem .85rem;
  margin-bottom: .15rem;
}
.line:hover { background: rgba(255,255,255,.02); }

.board-row { background: none; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: rgba(255,255,255,.02); transform: none; }

/* the accent wash behind page titles was decoration; drop it */
.card.page > .card-head::before { display: none; }

/* the running total sits under the verdict as supporting evidence,
   not as a competing headline */
.ov-total {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  flex-wrap: wrap;
  margin: -0.6rem 0 1.5rem;
}
.ov-total-n {
  font: 600 1.35rem/1 var(--sans);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--num);
}
.ov-total-l { font-size: .78rem; color: var(--num-dim); }
.ov-total .spacer { flex: 1; }

/* =========================== failure breakdown ========================= */

.why { margin: 0 0 1.6rem; }
.why-h {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .7rem;
}
.why-r {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .42rem 0;
}
.why-l { font-size: .82rem; }
.why-bar { height: .42rem; background: var(--line-soft); border-radius: 99px; overflow: hidden; }
.why-bar i { display: block; height: 100%; background: var(--bad); border-radius: 99px; opacity: .8; }
.why-n {
  text-align: right;
  font: 600 .95rem/1.1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--num);
}
.why-n span { display: block; margin-top: .15rem; font: 400 .66rem var(--sans); color: var(--num-dim); }

@media (max-width: 700px) {
  .why-r { grid-template-columns: 1fr auto; }
  .why-bar { grid-column: 1 / -1; }
}

/* Compact turns the master dial down, so every size in the interface
   follows — not just a few paddings. */
html.compact { font-size: clamp(12.5px, 0.34vw + 11.2px, 16.5px); }
html.compact body.compact .wrap { max-width: 88rem; }

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

.ov-cols {
  display: grid;
  grid-template-columns: 1fr minmax(15rem, 20rem);
  gap: 2.6rem;
  margin-top: 2rem;
  align-items: start;
}
.ov-main { min-width: 0; }

.ov-side {
  display: grid;
  gap: 1.6rem;
  padding-left: 2.2rem;
  border-left: 1px solid var(--line-soft);
}
.ov-block { min-width: 0; }

.ov-h {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .7rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.ov-h button { margin-left: auto; padding: .2rem .5rem; font-size: .66rem; }

.ov-none { font-size: .78rem; color: var(--faint); padding: .2rem 0; }

/* the side column runs narrow, so its rows drop the second line */
.ov-side .line { padding: .38rem 0 .38rem .7rem; margin-bottom: .1rem; font-size: .78rem; }
.ov-side .line-b { flex-basis: 100%; margin-top: .1rem; font-size: .66rem; }
.ov-side .line-d { display: none; }

@media (max-width: 1100px) {
  .ov-cols { grid-template-columns: 1fr; gap: 2rem; }
  .ov-side { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-soft); padding-top: 1.6rem; }
}

/* the feature list is a sales surface, so it lives on the landing screen */
.landing-feats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: .6rem;
  margin-top: 3rem;
  text-align: left;
}
.landing-feats .feat { padding: 1rem 1.1rem .95rem; background: rgba(255,255,255,.022); }
.landing-feats .feat-i { width: 2rem; height: 2rem; margin-bottom: .7rem; }
.landing-feats .feat-t { font-size: .82rem; }
.landing-feats .feat-d { font-size: .72rem; }
.landing-feats .feat-go { display: none; }

/* ============================= page artwork ============================ */

.card.page > .card-head { position: relative; overflow: hidden; }

.head-art {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(12rem, 28vw, 23rem);
  height: 8rem;
  pointer-events: none;
  opacity: .95;
  mask-image: linear-gradient(90deg, transparent, #000 38%);
}
.head-art svg { width: 100%; height: 100%; display: block; }

/* the live badge shares that corner, so it sits above the drawing */
.live-badge { position: relative; z-index: 2; background: var(--bg); }

@media (prefers-reduced-motion: no-preference) {
  .card.page.active .head-art { animation: art-in .6s cubic-bezier(.2,.8,.3,1) both; }
  @keyframes art-in {
    from { opacity: 0; transform: translate(14px, -52%); }
    to   { opacity: .5; transform: translateY(-52%); }
  }
}

@media (max-width: 820px) { .head-art { display: none; } }


/* the page header now carries a drawing, so it needs the room */
.card.page > .card-head { min-height: 4.8rem; align-items: center; padding-right: 0; }

/* one live dot, in the sidebar, for the whole app */
.side-foot .live-badge { margin-left: 0; padding: .18rem .5rem; font-size: .58rem; }
.card.page.active .head-art { animation-fill-mode: both; }


/* the drawing sits on its own soft field so it reads as artwork rather
   than a stray line hiding in the background */
.head-art::before {
  content: "";
  position: absolute;
  inset: -20% -10% -20% 10%;
  background: radial-gradient(60% 70% at 70% 50%, var(--accent-soft), transparent 72%);
  border-radius: 50%;
}
.head-art svg { position: relative; }

.line a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.line a:hover { color: var(--accent-2); border-bottom-color: var(--accent); }
.pick-item .nm a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.pick-item .nm a:hover { color: var(--accent-2); border-bottom-color: var(--accent); }


/* ---- the pitch ---- */

.landing-feats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 2.2rem;
  text-align: left;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.sell {
  padding: 1.5rem 1.5rem 1.4rem;
  background: #090C13;
}
.sell .feat-i {
  width: 2.1rem; height: 2.1rem;
  margin-bottom: .9rem;
}
.sell-t {
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: -.012em;
  margin-bottom: .45rem;
}
.sell-d {
  font-size: .78rem;
  line-height: 1.65;
  color: var(--dim);
}

.landing-also {
  margin: 1.4rem auto 0;
  max-width: 56ch;
  font-size: .74rem;
  line-height: 1.7;
  color: var(--faint);
}

@media (max-width: 900px) {
  .landing-feats { grid-template-columns: 1fr; margin-top: 2.2rem; }
}
@media (min-width: 901px) and (max-width: 1200px) {
  .landing-feats { grid-template-columns: repeat(2, 1fr); }
}

/* on a short screen the drawing is the first thing that can go */
@media (max-height: 780px) { .landing-art { display: none; } }
