/* Clerity Email Change Tracker — visual system
   Navy, white and fresh green. Built for desktop and tablet. */

:root {
  --navy-900: #071528;
  --navy-800: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1b4079;
  --navy-500: #2a5798;
  --navy-050: #eef3fa;

  --green-700: #12693a;
  --green-600: #16a34a;
  --green-500: #22c55e;
  --green-100: #d6f5e3;
  --green-050: #eefbf3;

  --amber-600: #b45309;
  --amber-100: #fdeccd;
  --amber-050: #fff8ec;

  --red-600: #c02626;
  --red-100: #fbdcdc;
  --red-050: #fef4f4;

  --sky-600: #0369a1;
  --sky-100: #d5ebf8;
  --sky-050: #f0f8fd;

  --ink: #0d1b2a;
  --ink-2: #3b4a5a;
  --ink-3: #667788;
  --line: #dfe6ee;
  --line-2: #eef2f7;
  --paper: #ffffff;
  --canvas: #f4f7fb;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06), 0 1px 3px rgba(11, 37, 69, .04);
  --shadow: 0 2px 6px rgba(11, 37, 69, .07), 0 8px 24px rgba(11, 37, 69, .06);
  --shadow-lg: 0 12px 40px rgba(11, 37, 69, .14);

  --sidebar: 248px;
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; color: var(--navy-800); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .7rem; }

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

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.brand-mark { display: flex; align-items: center; gap: 11px; }
.brand-logo { max-height: 34px; max-width: 150px; display: block; }
.brand-glyph {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  display: grid; place-items: center;
  font-weight: 700; font-size: 1rem; color: #fff;
  box-shadow: 0 2px 10px rgba(34, 197, 94, .35);
}
.brand-word { font-size: 1.2rem; font-weight: 680; letter-spacing: -.02em; color: #fff; }
.brand-sub {
  margin-top: 9px; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}

.nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .76);
  font-size: .9rem; font-weight: 500;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(34, 197, 94, .16); color: #fff; box-shadow: inset 2px 0 0 var(--green-500); }
.nav a .pill {
  margin-left: auto; background: var(--green-600); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: .68rem; font-weight: 650;
}
.nav a .pill.warn { background: var(--amber-600); }

.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .72rem; color: rgba(255, 255, 255, .45);
}
.sidebar-foot strong { color: rgba(255, 255, 255, .72); font-weight: 600; }

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

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 13px 26px;
  display: flex; align-items: center; gap: 18px;
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 640; color: var(--navy-800); font-size: 1.02rem; }
.topbar .spacer { flex: 1; }
.powered { display: flex; align-items: center; gap: 9px; font-size: .76rem; color: var(--ink-3); }
.powered img { max-height: 26px; max-width: 116px; display: block; }
.powered .algoatech { font-weight: 640; color: var(--navy-700); }

.who {
  display: flex; align-items: center; gap: 9px;
  padding-left: 16px; border-left: 1px solid var(--line);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--navy-050); color: var(--navy-700);
  display: grid; place-items: center; font-size: .76rem; font-weight: 680;
}
.who-name { font-size: .82rem; font-weight: 580; line-height: 1.2; }
.who-role { font-size: .7rem; color: var(--ink-3); }

.content { padding: 26px; flex: 1; max-width: 1560px; width: 100%; }

.page-head { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .lede { color: var(--ink-2); font-size: .92rem; margin-top: 5px; max-width: 76ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

.footer {
  padding: 18px 26px 30px;
  color: var(--ink-3); font-size: .76rem;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  border-top: 1px solid var(--line-2);
}
.footer .dot { color: var(--line); }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-head {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: .98rem; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }
.card-note { font-size: .8rem; color: var(--ink-3); }

.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.split { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 16px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--navy-500); }
.stat.good::before { background: var(--green-500); }
.stat.warn::before { background: var(--amber-600); }
.stat.bad::before { background: var(--red-600); }
.stat.info::before { background: var(--sky-600); }
.stat .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 1.85rem; font-weight: 680; color: var(--navy-800); line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; }
.stat .m { font-size: .76rem; color: var(--ink-3); margin-top: 2px; }
.stat.good .v { color: var(--green-700); }
.stat.bad .v { color: var(--red-600); }
.stat.warn .v { color: var(--amber-600); }

/* ---------- Progress ---------- */
.progress { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-500), var(--green-600)); border-radius: 999px; transition: width .4s ease; }
.progress.thin { height: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--ink-2); margin-bottom: 7px; }
.progress-label b { color: var(--navy-800); font-size: 1.05rem; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; line-height: 1.5;
}
.badge.good { background: var(--green-050); color: var(--green-700); border-color: var(--green-100); }
.badge.warn { background: var(--amber-050); color: var(--amber-600); border-color: var(--amber-100); }
.badge.bad { background: var(--red-050); color: var(--red-600); border-color: var(--red-100); }
.badge.info { background: var(--sky-050); color: var(--sky-600); border-color: var(--sky-100); }
.badge.neutral { background: var(--navy-050); color: var(--navy-700); border-color: #dbe5f2; }
.badge.demo { background: #f3e8ff; color: #6b21a8; border-color: #e6d3fb; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th {
  text-align: left; padding: 10px 12px;
  font-size: .71rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 650;
  border-bottom: 1px solid var(--line); background: #fbfcfe;
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: #fafcff; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--ink-3); font-size: .8rem; }
table.data .strong { font-weight: 600; color: var(--navy-800); }
.checkcol { width: 34px; }

.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 1rem; color: var(--ink-2); font-weight: 560; margin-bottom: 4px; }

/* ---------- Forms ---------- */
label { display: block; font-size: .79rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .88rem; color: var(--ink);
  background: #fff; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(42, 87, 152, .13);
}
textarea { resize: vertical; min-height: 110px; font-size: .86rem; line-height: 1.6; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .75rem; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 0 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; }
.check input { margin-top: 3px; flex: 0 0 auto; width: 15px; height: 15px; accent-color: var(--green-600); }
.check label { margin: 0; font-weight: 550; color: var(--ink); font-size: .87rem; }
.check .hint { font-size: .76rem; color: var(--ink-3); font-weight: 400; margin-top: 2px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 16px; }
legend { font-size: .78rem; font-weight: 680; color: var(--navy-700); padding: 0 7px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--navy-700);
  font-family: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: #f7fafd; border-color: #cdd8e6; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.btn.primary:hover { background: var(--navy-600); border-color: var(--navy-600); }
.btn.go { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.btn.go:hover { background: var(--green-700); border-color: var(--green-700); }
.btn.danger { color: var(--red-600); border-color: var(--red-100); background: var(--red-050); }
.btn.danger:hover { background: #fceaea; border-color: #f3c7c7; }
.btn.sm { padding: 5px 11px; font-size: .78rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ---------- Flash ---------- */
.flashes { margin-bottom: 18px; display: grid; gap: 9px; }
.flash {
  padding: 11px 15px; border-radius: var(--radius-sm);
  border: 1px solid; font-size: .87rem; font-weight: 520;
  display: flex; gap: 10px; align-items: flex-start;
}
.flash.success { background: var(--green-050); border-color: var(--green-100); color: var(--green-700); }
.flash.error { background: var(--red-050); border-color: var(--red-100); color: var(--red-600); }
.flash.info { background: var(--sky-050); border-color: var(--sky-100); color: var(--sky-600); }

.notice {
  padding: 12px 15px; border-radius: var(--radius-sm);
  background: var(--amber-050); border: 1px solid var(--amber-100); color: #7c4708;
  font-size: .84rem; line-height: 1.55;
}
.notice.info { background: var(--sky-050); border-color: var(--sky-100); color: #0b4f74; }
.notice.plain { background: var(--navy-050); border-color: #dbe5f2; color: var(--navy-700); }
.notice strong { font-weight: 680; }

/* ---------- Filters ---------- */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 11px; align-items: end; }
.filters .field { margin: 0; }
.filters .wide { grid-column: span 2; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff;
  font-size: .8rem; font-weight: 580; color: var(--ink-2); text-decoration: none;
}
.chip:hover { border-color: var(--navy-500); color: var(--navy-700); text-decoration: none; }
.chip.active { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip .n {
  background: rgba(11, 37, 69, .08); border-radius: 999px;
  padding: 0 7px; font-size: .72rem; font-weight: 680;
}
.chip.active .n { background: rgba(255, 255, 255, .2); }
.chip.has-work .n { background: var(--amber-100); color: var(--amber-600); }
.chip.active.has-work .n { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Definition rows ---------- */
.dl { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 0; font-size: .87rem; }
.dl dt { color: var(--ink-3); padding: 7px 0; border-bottom: 1px solid var(--line-2); font-weight: 550; }
.dl dd { margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); word-break: break-word; }
.dl dt:last-of-type, .dl dd:last-of-type { border-bottom: 0; }

.prov { font-size: .73rem; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }
.prov a { color: var(--navy-600); }
.prov .sep { color: var(--line); margin: 0 5px; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 15px 22px; border-left: 2px solid var(--line-2); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy-500); border: 2px solid #fff;
}
.timeline li.good::before { background: var(--green-500); }
.timeline li.bad::before { background: var(--red-600); }
.timeline li.warn::before { background: var(--amber-600); }
.timeline .when { font-size: .73rem; color: var(--ink-3); }
.timeline .what { font-size: .86rem; font-weight: 560; color: var(--navy-800); }
.timeline .detail { font-size: .81rem; color: var(--ink-2); }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed #c7d5e6; border-radius: var(--radius);
  padding: 40px 22px; text-align: center; background: #fbfdff;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.hover { border-color: var(--green-500); background: var(--green-050); }
.dropzone .big { font-size: 1.02rem; font-weight: 620; color: var(--navy-800); margin-bottom: 5px; }
.dropzone .sub { font-size: .84rem; color: var(--ink-3); }
.dropzone .chosen { margin-top: 12px; font-size: .85rem; color: var(--green-700); font-weight: 600; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center; padding: 26px;
  background: linear-gradient(155deg, var(--navy-800) 0%, var(--navy-900) 55%, #04101f 100%);
}
.login-card {
  width: 100%; max-width: 408px; background: #fff;
  border-radius: 18px; padding: 34px 32px; box-shadow: var(--shadow-lg);
}
.login-card .brand-mark { justify-content: center; margin-bottom: 6px; }
.login-card .brand-word { color: var(--navy-800); }
.login-card .tag { text-align: center; color: var(--ink-3); font-size: .84rem; margin-bottom: 24px; }
.login-foot { text-align: center; margin-top: 20px; font-size: .74rem; color: var(--ink-3); }
.login-page .outside { text-align: center; margin-top: 18px; color: rgba(255, 255, 255, .45); font-size: .74rem; }

/* ---------- Misc ---------- */
.mono { font-family: var(--mono); font-size: .82rem; }
.muted { color: var(--ink-3); }
.small { font-size: .8rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.stack { display: grid; gap: 16px; }
.inline-form { display: inline; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }

.pagination { display: flex; gap: 7px; align-items: center; justify-content: center; padding: 15px; }
.pagination .info { color: var(--ink-3); font-size: .82rem; margin: 0 10px; }

.kv-list { display: grid; gap: 9px; }
.kv-list .row { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.kv-list .row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-list .row .k { color: var(--ink-2); }
.kv-list .row .v { font-weight: 620; color: var(--navy-800); font-variant-numeric: tabular-nums; }

.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 9px; }
.stage {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; background: #fff;
}
.stage .n { font-size: 1.15rem; font-weight: 680; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.stage .l { font-size: .73rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stage.active { border-color: var(--green-500); background: var(--green-050); }

.secret-box {
  font-family: var(--mono); font-size: 1rem; letter-spacing: .04em;
  background: var(--navy-050); border: 1px dashed var(--navy-500);
  padding: 11px 14px; border-radius: var(--radius-sm); color: var(--navy-800);
  word-break: break-all; user-select: all;
}

.preview-body {
  white-space: pre-wrap; font-size: .85rem; line-height: 1.62;
  background: #fbfcfe; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 13px 15px; color: var(--ink);
  max-height: 320px; overflow-y: auto;
}

.sticky-actions {
  position: sticky; bottom: 0; z-index: 12;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line);
  padding: 11px 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 -4px 16px rgba(11, 37, 69, .06);
  border-radius: 0 0 var(--radius) var(--radius);
}
.sticky-actions .count { font-size: .84rem; color: var(--ink-2); font-weight: 580; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 10px; padding: 0 12px;
    overflow-x: auto;
  }
  .brand { border-bottom: 0; border-right: 1px solid rgba(255, 255, 255, .1); padding: 12px 16px 12px 6px; flex: 0 0 auto; }
  .brand-sub { display: none; }
  .nav { display: flex; gap: 4px; padding: 9px 0; overflow-x: auto; flex: 1; }
  .nav a { white-space: nowrap; margin: 0; padding: 7px 11px; font-size: .84rem; }
  .nav a.active { box-shadow: inset 0 -2px 0 var(--green-500); }
  .sidebar-foot { display: none; }
  .content { padding: 18px 16px; }
  .topbar { padding: 11px 16px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl dt { padding-bottom: 0; border-bottom: 0; }
  .dl dd { padding-top: 2px; }
  .form-grid.two { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .topbar .title { display: none; }
  .powered span.label { display: none; }
  .page-head .actions { width: 100%; }
}

@media print {
  .sidebar, .topbar, .sticky-actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* --- Source tags -------------------------------------------------------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }

.badge.tag {
  background: linear-gradient(180deg, rgba(11, 37, 69, .06), rgba(11, 37, 69, .12));
  border: 1px solid rgba(11, 37, 69, .18);
  color: var(--navy-800);
  font-weight: 600;
  letter-spacing: .015em;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
}
a.badge.tag:hover { border-color: var(--green-500); color: var(--green-600); }

@media (prefers-color-scheme: dark) {
  .badge.tag {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .88);
  }
}

/* --- Onboarding progress ------------------------------------------------ */
.timeline li.good .what { color: var(--green-600); }
.timeline li.warn .what { font-weight: 700; }

/* --- Multi-file drop ---------------------------------------------------- */
.file-list { margin-top: 12px; display: grid; gap: 8px; }
.file-list .file {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.file-list .file .name { font-weight: 600; word-break: break-all; }
.file-list .file .meta { color: var(--ink-2); font-size: .82rem; white-space: nowrap; }

/* ==========================================================================
   Campaigns module
   ========================================================================== */

/* Wizard step rail */
.wizard-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.wizard-step {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--line, #e5e7eb); border-radius: 999px;
  background: #fff; color: #6b7280; text-decoration: none; font-size: 13px;
}
.wizard-step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e5e7eb; color: #374151; font-weight: 700; font-size: 11px;
}
.wizard-step.active { border-color: #16a34a; color: #14532d; background: #f0fdf4; }
.wizard-step.active .n { background: #16a34a; color: #fff; }
.wizard-step.done { color: #14532d; }
.wizard-step.done .n { background: #bbf7d0; color: #14532d; }

/* Sender chooser */
.sender-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sender-option {
  display: flex; gap: 10px; padding: 14px; cursor: pointer;
  border: 1px solid var(--line, #e5e7eb); border-radius: 10px; background: #fff;
}
.sender-option.ready:hover { border-color: #16a34a; }
.sender-option.blocked { opacity: .65; cursor: not-allowed; background: #fafafa; }
.sender-option input { margin-top: 3px; }

/* Editor + preview */
.merge-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
#editor-host { background: #fff; min-height: 260px; }
.ql-editor { min-height: 240px; font-family: Arial, Helvetica, sans-serif; }
.preview-frame {
  border: 1px solid var(--line, #e5e7eb); border-radius: 10px;
  background: #f5f6f8; padding: 16px; overflow-x: auto; margin: 0 auto;
}
.preview-frame .preview-body {
  background: #fff; padding: 20px; border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.6;
}
.preview-frame .preview-body img { max-width: 100%; height: auto; }
.plain-preview {
  white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px; padding: 12px; font-size: 12.5px; max-height: 320px; overflow: auto;
}
.sig-preview { max-width: 240px; max-height: 90px; border: 1px solid var(--line, #e5e7eb); border-radius: 6px; }

/* Countdown */
.countdown { display: flex; gap: 14px; flex-wrap: wrap; }
.countdown .unit {
  display: flex; flex-direction: column; align-items: center; min-width: 78px;
  padding: 14px 10px; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0;
}
.countdown .unit .n { font-size: 30px; font-weight: 700; line-height: 1; color: #14532d; }
.countdown .unit .l { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #4b7f5e; margin-top: 6px; }

/* Compact stat row, used inside cards */
.stats.compact { gap: 8px; }
.stats.compact .stat { padding: 10px 12px; }
.stats.compact .stat .v { font-size: 20px; }

/* Small key/value tables */
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 5px 8px; border-bottom: 1px solid var(--line, #eef0f3); }
table.mini td.right { text-align: right; font-variant-numeric: tabular-nums; }

/* Activity feed */
.timeline .tl-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line, #eef0f3); }
.timeline .tl-when { flex: 0 0 130px; font-size: 12px; color: #6b7280; font-variant-numeric: tabular-nums; }
.timeline .tl-what { flex: 1; font-size: 13px; }

.card.inner { border: 1px solid var(--line, #e5e7eb); box-shadow: none; margin: 0; }
.btn.danger { border-color: #fecaca; color: #b91c1c; }
.btn.danger:hover { background: #fef2f2; }
.btn.active { border-color: #16a34a; color: #14532d; background: #f0fdf4; }

/* Public pages: unsubscribe and notices */
.public-page {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  background: #f5f6f8; padding: 24px;
}
.public-card {
  background: #fff; border-radius: 14px; padding: 34px; max-width: 520px; width: 100%;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.public-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.public-brand img { max-height: 40px; }
.public-card h1 { font-size: 22px; margin: 0 0 12px; }
.public-foot {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line, #e5e7eb);
  font-size: 12px; color: #6b7280; line-height: 1.6;
}
