/*
 * Voltage: Obsidian is the only background colour, Bone the only text colour
 * (at opacity tiers), Acid Lime the single accent, Ultraviolet atmosphere only
 * and never text or a button. Sections separate with Bone washes and hairlines
 * rather than with colour.
 */

:root {
  --obsidian: #0A0A0C;
  --bone: #F2F0EA;
  --lime: #D4FF3F;
  --violet: #7C3AED;

  --t1: rgba(242, 240, 234, 0.80);
  --t2: rgba(242, 240, 234, 0.62);
  --t3: rgba(242, 240, 234, 0.55);
  --t4: rgba(242, 240, 234, 0.48);

  --wash: rgba(242, 240, 234, 0.03);
  --wash-2: rgba(242, 240, 234, 0.06);
  --line: rgba(242, 240, 234, 0.10);
  --line-2: rgba(242, 240, 234, 0.18);

  --danger: #FF6B5A;
  --sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --sidebar: 248px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--obsidian);
  color: var(--t1);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }

.mono { font-family: var(--mono); }
.muted { color: var(--t4); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.spacer { margin-left: auto; }

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

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

/* -------------------------------------------------------------- sidebar */

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.4rem 0 1rem;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  /*
   * align-self is what makes the sticky work: a flex item stretched to the
   * full height of .shell has no room to stick inside, so it scrolls away.
   */
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

/* Ultraviolet appears once, as atmosphere behind the brand. */
.sidebar::before {
  content: '';
  position: absolute;
  inset: -8rem auto auto -6rem;
  width: 22rem;
  height: 22rem;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.22), transparent 65%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 1.4rem 1.4rem;
  position: relative;
}

.brand-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(212, 255, 63, 0.12);
  flex: none;
}

.brand-name { font-size: 0.95rem; letter-spacing: -0.01em; }
.brand-sub {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t4);
  margin-top: 1px;
}

.nav-group { padding: 0 0.75rem; margin-bottom: 0.4rem; }

.nav-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t4);
  padding: 0.9rem 0.65rem 0.4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--t3);
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: var(--wash); color: var(--t1); }

.nav-item.active {
  background: var(--wash-2);
  color: var(--bone);
}

/* One accent per frame: the lime rail marks the current page and nothing else. */
.nav-item.active { box-shadow: inset 2px 0 0 var(--lime); }

.nav-item svg { width: 15px; height: 15px; flex: none; opacity: 0.75; }
.nav-item.active svg { opacity: 1; }

.nav-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--t4);
  background: var(--wash-2);
  border-radius: 4px;
  padding: 0 0.35rem;
}

.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.4rem 0;
  border-top: 1px solid var(--line);
}

.who { display: flex; align-items: center; gap: 0.6rem; }

.avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t2);
  flex: none;
}

.who-name { font-size: 12.5px; line-height: 1.2; }
.who-mail { font-family: var(--mono); font-size: 10px; color: var(--t4); }

.linkbtn {
  background: none; border: 0; padding: 0;
  color: var(--t4);
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.linkbtn:hover { color: var(--danger); }

/* ------------------------------------------------------------------ main */

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

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.15rem 1.9rem;
  border-bottom: 1px solid var(--line);
}

.topbar h1 { font-size: 1.05rem; }
.topbar .sub { font-size: 12.5px; color: var(--t4); margin-top: 1px; }

.chips { display: flex; gap: 1.1rem; align-items: center; }

.chip {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t4);
}
.chip b { color: var(--t2); font-weight: 500; }
.chip b.on { color: var(--lime); }
.chip b.off { color: var(--danger); }

.content { padding: 1.7rem 1.9rem 3rem; max-width: 1440px; }

/* ==================================================================== bits */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--t1);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn:hover { border-color: var(--bone); background: var(--wash); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--obsidian);
  font-weight: 600;
}
.btn-primary:hover { background: #E3FF6E; border-color: #E3FF6E; }

.btn-sm { padding: 0.25rem 0.6rem; font-size: 12px; }
.btn-danger { color: var(--danger); border-color: rgba(255, 107, 90, 0.35); }
.btn-danger:hover { border-color: var(--danger); background: rgba(255, 107, 90, 0.08); }
.btn-ghost { border-color: transparent; color: var(--t3); }
.btn-ghost:hover { border-color: var(--line-2); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.4rem;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.card-head h2 { font-size: 0.88rem; }
.card-head .hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t4);
}

.card-body { padding: 1.1rem; }
.card-body.tight { padding: 0; }

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.4rem;
}

.stat { background: var(--obsidian); padding: 0.95rem 1.05rem; }

.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t4);
}

.stat-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-top: 0.1rem;
}

.stat-sub { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--t4); }
.stat.accent .stat-value { color: var(--lime); }

/* ---------------------------------------------------------------- alerts */

.alert {
  display: flex;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-radius: 8px;
  background: var(--wash);
  margin-bottom: 0.55rem;
  font-size: 13px;
  color: var(--t2);
}

.alert .tag {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--t4);
  flex: none;
  padding-top: 3px;
  min-width: 42px;
}

.alert-error { border-left-color: var(--danger); color: var(--bone); }
.alert-warn { border-left-color: var(--lime); }
.alert-info { border-left-color: var(--line-2); }
.alert pre { margin: 0.4rem 0 0; white-space: pre-wrap; font-family: var(--mono); font-size: 11.5px; color: var(--t3); }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

/*
 * Only the deliberately wide listings get a floor width; everything else stays
 * fluid. A blanket min-width here forces its grid track wide and pushes the
 * sidebar column off screen.
 */
.table-wrap.wide > table { min-width: 860px; }
.table-wrap.wide > table td:first-child { min-width: 170px; }

thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--t4);
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
  white-space: nowrap;
}

tbody td {
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--t2);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--wash); }
tbody td strong { color: var(--bone); font-weight: 500; }
td.num, th.num { text-align: right; font-family: var(--mono); }

.row-link { cursor: pointer; }

.empty {
  padding: 2.6rem 1rem;
  text-align: center;
  color: var(--t4);
  font-family: var(--mono);
  font-size: 12px;
}

/* ----------------------------------------------------------------- pills */

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.42rem;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--t3);
  white-space: nowrap;
}

.pill-good { color: var(--lime); border-color: rgba(212, 255, 63, 0.35); }
.pill-bad { color: var(--danger); border-color: rgba(255, 107, 90, 0.35); }
.pill-mute { color: var(--t4); border-color: var(--line); }

/* ----------------------------------------------------------------- forms */

.field { margin-bottom: 1rem; }

label,
.label {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--t4);
  margin-bottom: 0.3rem;
}

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=url], input[type=search], select, textarea {
  width: 100%;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--bone);
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 13px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--line-2);
  background: var(--wash-2);
}

textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; resize: vertical; }

.help { font-size: 11.5px; color: var(--t4); margin-top: 0.3rem; }
.error { color: var(--danger); font-size: 11.5px; margin-top: 0.3rem; }

.check { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.6rem; }
.check input { width: auto; margin-top: 3px; }
.check label { text-transform: none; font-family: var(--sans); font-size: 13px; letter-spacing: 0; color: var(--t2); margin: 0; }

/*
 * minmax(0, …) on every track: a grid column defaults to a min-width of
 * min-content, so one wide table inside pushes the whole layout past the
 * viewport instead of scrolling within its own .table-wrap.
 */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

/* Grid items default to min-width:auto, i.e. min-content. Without this a wide
 * table inside one column stretches the whole grid instead of scrolling. */
.split > *, .grid-2 > *, .grid-3 > * { min-width: 0; }

@media (max-width: 1080px) {
  .split, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.toolbar { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

/* ----------------------------------------------------------------- chart */

.chart-bars { display: flex; align-items: stretch; gap: 2px; height: 128px; }

.chart-day {
  flex: 1;
  min-width: 4px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1px;
}

/* Percentage heights need a stretched column, or every bar collapses to zero. */
.chart-day span { width: 100%; border-radius: 1px 1px 0 0; min-height: 2px; }
.chart-day .s-sent { background: var(--wash-2); }
.chart-day .s-open { background: rgba(242, 240, 234, 0.22); }
.chart-day .s-reply { background: var(--lime); }
.chart-day:hover .s-sent { background: rgba(242, 240, 234, 0.16); }

.legend {
  display: flex;
  gap: 1.1rem;
  margin-top: 0.8rem;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t4);
}
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

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

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline li {
  display: grid;
  grid-template-columns: 120px 108px 1fr;
  gap: 0.9rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.timeline li:last-child { border-bottom: 0; }
.timeline time { font-family: var(--mono); font-size: 11px; color: var(--t4); }
.timeline .what { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--t3); }
.timeline .detail { color: var(--t2); min-width: 0; }
.timeline .detail small { display: block; color: var(--t4); font-family: var(--mono); font-size: 10.5px; word-break: break-word; }

/* --------------------------------------------------------------- preview */

.mail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.mail-head {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--t3);
  display: grid;
  gap: 0.15rem;
}
.mail-head b { color: var(--bone); font-weight: 500; }

.mail-body {
  padding: 1.2rem 1.3rem;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--t1);
  word-break: break-word;
}

.mail-foot {
  padding: 0.65rem 1.1rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1.1rem;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--t4);
}

/* ============================================================ auth screens */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem;
  position: relative;
}

.auth::before {
  content: '';
  position: absolute;
  inset: -30vh 0 auto 0;
  height: 70vh;
  background: radial-gradient(50% 100% at 50% 0%, rgba(124, 58, 237, 0.2), transparent 70%);
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  position: relative;
}

.auth-brand { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1.8rem; }
.auth-card h1 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.auth-card .lede { color: var(--t4); font-size: 13px; margin: 0 0 1.5rem; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.4rem; }
.auth-foot { margin-top: 1.4rem; font-family: var(--mono); font-size: 10.5px; color: var(--t4); text-align: center; }

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

.flash { margin-bottom: 1.2rem; }

.pagination { display: flex; gap: 0.3rem; margin-top: 1rem; font-family: var(--mono); font-size: 12px; }
.pagination a, .pagination span {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--t3);
}
.pagination .active span { border-color: var(--lime); color: var(--lime); }
.pagination svg { width: 12px; height: 12px; }

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

/*
 * Below this width the fixed 248px rail eats too much of the viewport, so the
 * sidebar becomes an icon rail. Nothing is hidden that cannot be reached - the
 * labels return via the title attribute and the layout stays two-column.
 */
@media (max-width: 1080px) {
  :root { --sidebar: 62px; }

  .sidebar { padding-top: 1rem; }
  .brand { justify-content: center; padding: 0 0 1.1rem; }
  .brand span:last-child,
  .nav-item span:not(.nav-count),
  .nav-label,
  .who span:last-child { display: none; }

  .nav-item {
    justify-content: center;
    padding: 0.55rem 0;
    font-size: 0;
  }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-count { position: absolute; opacity: 0; pointer-events: none; }

  .nav-group { padding: 0 0.5rem; }
  .nav-label { padding: 0.5rem 0 0; }

  .sidebar-foot { padding: 0.8rem 0.5rem 0; text-align: center; }
  .who { justify-content: center; }
  .linkbtn { font-size: 9px; }

  .topbar { padding: 1rem 1.1rem; flex-wrap: wrap; gap: 0.8rem; }
  .content { padding: 1.2rem 1.1rem 2.5rem; }
  .chips { gap: 0.8rem; }
}

@media (max-width: 720px) {
  .chips { display: none; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .timeline li { grid-template-columns: 84px 1fr; }
  .timeline .what { grid-column: 2; }
}

/* ================================================================== upload */

.dropzone {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem 1.4rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--wash);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  color: var(--t2);
  margin: 0;
}

.dropzone:hover { border-color: var(--bone); background: var(--wash-2); }

/* Acid Lime marks the one active affordance, and only while dragging. */
.dropzone.dragging { border-color: var(--lime); background: rgba(212, 255, 63, 0.05); }
.dropzone.has-file { border-style: solid; border-color: var(--line-2); }

.dropzone-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  color: var(--t3);
}

.dropzone.dragging .dropzone-icon,
.dropzone.has-file .dropzone-icon { color: var(--lime); border-color: rgba(212, 255, 63, 0.4); }

.dropzone-icon svg { width: 18px; height: 18px; }

.dropzone-text { font-size: 13.5px; line-height: 1.4; }
.dropzone-text b { color: var(--bone); font-weight: 500; }
.dropzone-text small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--t4);
}

.nav-count.accent { color: var(--obsidian); background: var(--lime); font-weight: 600; }

/* ============================================================ sequence rail */

.steps-rail { display: flex; gap: 0.5rem; margin-bottom: 1.4rem; flex-wrap: wrap; }

.step-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
  color: var(--t2);
  transition: border-color .15s, background .15s;
}

.step-chip:hover { border-color: var(--line-2); background: var(--wash-2); }
.step-chip.on { border-color: var(--lime); background: rgba(212, 255, 63, 0.05); color: var(--bone); }

.step-num {
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t3);
}
.step-chip.on .step-num { border-color: var(--lime); color: var(--lime); }

.step-chip b { font-weight: 500; font-size: 13px; display: block; }
.step-chip small { font-family: var(--mono); font-size: 10px; color: var(--t4); display: block; }

/* ---------------------------------------------------------------- variables */

.var-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.var {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--wash);
  color: var(--t3);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}

.var:hover { border-color: var(--lime); color: var(--bone); }
.var-cov { font-size: 9.5px; color: var(--t4); }
.var-cov.low { color: var(--danger); }

/* -------------------------------------------------------------------- meter */

.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--wash-2);
  overflow: hidden;
}

.meter-fill { height: 100%; background: var(--lime); border-radius: 3px; }

/* ------------------------------------------------------------------ replies */

.reply-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 1rem; align-items: start; }

.reply-kind {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  color: var(--t3);
  text-align: center;
  display: block;
}

.reply-kind.positive, .reply-kind.referral { color: var(--lime); border-color: rgba(212, 255, 63, 0.4); }
.reply-kind.negative, .reply-kind.unsubscribe { color: var(--danger); border-color: rgba(255, 107, 90, 0.35); }
.reply-kind.auto { color: var(--t4); border-color: var(--line); }

.reply-body { min-width: 0; }
.reply-body .who { font-size: 13px; color: var(--bone); margin-bottom: 2px; display: block; }
.reply-body .subject { font-size: 13px; color: var(--t2); }
.reply-body .snippet { color: var(--t4); font-size: 12.5px; margin-top: 3px; }
.reply-body .meta { font-family: var(--mono); font-size: 10.5px; color: var(--t4); margin-top: 4px; }

.reply-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 0.3rem; margin-bottom: 1.1rem; flex-wrap: wrap; }

.tab {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--t3);
  background: var(--wash);
}
.tab:hover { border-color: var(--line-2); color: var(--t1); }
.tab.on { border-color: var(--lime); color: var(--lime); }
.tab span { font-family: var(--mono); font-size: 10.5px; opacity: .7; margin-left: 3px; }

/* ------------------------------------------------------------------ scores */

.score-ring {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  border: 2px solid var(--line-2);
  flex: none;
}
.score-ring.good { border-color: var(--lime); color: var(--lime); }
.score-ring.mid { border-color: var(--line-2); color: var(--t1); }
.score-ring.bad { border-color: var(--danger); color: var(--danger); }

.check-row { display: flex; gap: 0.7rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-mark { flex: none; width: 16px; font-family: var(--mono); font-size: 13px; }
.check-mark.pass { color: var(--lime); }
.check-mark.fail { color: var(--danger); }
.check-row .label-text { font-size: 13px; color: var(--bone); }
.check-row .detail { font-size: 12px; color: var(--t4); margin-top: 2px; }

/* --------------------------------------------------------------- bar table */

.bar-cell { position: relative; min-width: 90px; }
.bar-cell .bar {
  position: absolute; inset: 2px auto 2px 0;
  background: rgba(212, 255, 63, 0.14);
  border-radius: 3px;
}
.bar-cell span { position: relative; font-family: var(--mono); }

.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }
@media (max-width: 1080px) { .two-up { grid-template-columns: minmax(0, 1fr); } }

/* =================================================================== chain */

.chain { list-style: none; margin: 0; padding: 0; }

.chain-item {
  display: flex;
  gap: 0.9rem;
  padding: 0 0 1.1rem 0;
  position: relative;
}

.chain-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.chain-dot {
  flex: none;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--obsidian);
  position: relative;
  z-index: 1;
}

.chain-item.running .chain-dot { background: var(--lime); border-color: var(--lime); }
.chain-item.completed .chain-dot { background: var(--line-2); border-color: var(--line-2); }

.chain-body { flex: 1; min-width: 0; }
.chain-top { display: flex; align-items: center; gap: 0.5rem; }
.chain-top strong { color: var(--bone); font-weight: 500; font-size: 13px; }
.chain-meta { font-family: var(--mono); font-size: 11px; color: var(--t4); margin-top: 2px; }

/* ========================================================== format picker */

.format-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
@media (max-width: 720px) { .format-picker { grid-template-columns: minmax(0, 1fr); } }

.format-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
  cursor: pointer;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  transition: border-color .15s, background .15s;
}

.format-option:hover { border-color: var(--line-2); }
.format-option.on { border-color: var(--lime); background: rgba(212, 255, 63, 0.05); }
.format-option input { width: auto; margin-top: 3px; accent-color: var(--lime); }
.format-option b { display: block; font-size: 13px; font-weight: 500; color: var(--bone); }
.format-option small { display: block; font-family: var(--mono); font-size: 10px; color: var(--t4); margin-top: 1px; }

/* ================================================================ composer */

.composer {
  margin-top: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--wash);
}

.composer[hidden] { display: none; }

.composer-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.composer-head select { width: auto; max-width: 220px; font-size: 12px; padding: 0.25rem 0.5rem; }
.composer textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.65; min-height: 150px; }

.composer-foot {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--t2);
  cursor: pointer;
}
.inline-check input { width: auto; accent-color: var(--lime); }

/* ============================================================ suggestions */

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: 2px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--obsidian);
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
}

.suggestions[hidden] { display: none; }

.suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--t2);
  cursor: pointer;
  font-family: var(--sans);
}

.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover { background: var(--wash-2); }
.suggestions button b { display: block; font-size: 13px; font-weight: 500; color: var(--bone); }
.suggestions button span { font-family: var(--mono); font-size: 10.5px; color: var(--t4); }
