:root {
  --ink: #17211d;
  --muted: #6b7771;
  --line: #dfe6e2;
  --paper: #f5f7f4;
  --white: #fff;
  --green: #147a50;
  --green-dark: #0d5d3c;
  --mint: #dff4e8;
  --amber: #9a6300;
  --amber-bg: #fff5d9;
  --red: #a73737;
  --red-bg: #fff0f0;
  --radius: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 68px; padding: 0 4vw; background: #10291f; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { color: #fff; display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand small { opacity: .65; font-weight: 500; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; background: #4ed091; color: #0d3123; font-weight: 900; }
.brand-mark.large { width: 54px; height: 54px; font-size: 24px; margin-bottom: 12px; }
nav { display: flex; align-items: center; gap: 22px; }
nav a, .link-button { color: #dce9e3; font-size: 14px; }
nav form { margin: 0; }
.link-button { border: 0; padding: 0; background: none; cursor: pointer; }
.container { width: min(1180px, 92vw); margin: 42px auto 80px; }
.container.narrow { width: min(440px, 92vw); margin-top: 10vh; }
h1, h2 { margin: 0; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.12; }
h2 { font-size: 21px; }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; color: var(--green); }
.muted, small { color: var(--muted); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.panel, .login-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 22px rgb(28 60 46 / 5%); }
.panel { margin: 22px 0; padding: 24px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.login-card { padding: 38px; }
.login-card h1 { font-size: 30px; }
.login-card .muted { margin-bottom: 28px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats article { background: #fff; border: 1px solid var(--line); padding: 22px; border-radius: var(--radius); }
.stats span { display: block; color: var(--muted); font-size: 13px; }
.stats strong { display: block; margin-top: 5px; font-size: 30px; }
.alert { padding: 13px 16px; margin: 18px 0; border-radius: 11px; border: 1px solid; }
.alert.warning { color: var(--amber); background: var(--amber-bg); border-color: #ecd696; }
.alert.error { color: var(--red); background: var(--red-bg); border-color: #ebc2c2; }
.alert.success { color: var(--green-dark); background: var(--mint); border-color: #b6dec8; }
label { display: grid; gap: 6px; font-weight: 650; color: #35413b; }
input, textarea, select { width: 100%; border: 1px solid #cbd5d0; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink); font: inherit; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
input:focus, textarea:focus { outline: 3px solid rgb(52 168 111 / 18%); border-color: var(--green); }
button, .button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #bdc9c3; border-radius: 10px; padding: 10px 16px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
button.primary, .button.primary { background: var(--green); border-color: var(--green); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--green-dark); text-decoration: none; }
.stack { display: grid; gap: 17px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.form-section { display: grid; gap: 18px; }
.form-section.compact { max-width: 700px; }
.form-actions { position: sticky; bottom: 18px; display: flex; justify-content: flex-end; }
.segmented { display: flex; gap: 8px; }
.segmented label { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.segmented input, .check input { width: auto; }
label.check { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 44px; }
.product-picker { border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.product-picker legend { padding: 0 7px; font-weight: 750; }
.product-picker > div { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; max-height: 320px; overflow: auto; }
.product-picker label { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px; border-radius: 8px; background: var(--paper); }
.product-picker input { width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e9eeeb; vertical-align: top; }
.truncate { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 30px; }
.inline-form { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.inline-form input { min-width: 180px; }
details summary { color: var(--green-dark); cursor: pointer; }
.status { display: inline-block; padding: 3px 8px; border-radius: 99px; background: #edf1ef; font-size: 11px; font-weight: 750; }
.status.captured, .status.done, .status.sent { background: var(--mint); color: var(--green-dark); }
.status.failed, .status.email_failed, .status.reversed { background: var(--red-bg); color: var(--red); }
.status.pending, .status.retry, .status.processing, .status.pending_email { background: var(--amber-bg); color: var(--amber); }
.steps { display: grid; gap: 2px; }
.step { display: grid; grid-template-columns: 48px 1fr; gap: 18px; margin: 8px 0; }
.step > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--green-dark); font-weight: 900; }
.step p { color: var(--muted); }
pre { overflow: auto; padding: 15px; border-radius: 10px; background: #10291f; color: #d9f6e7; white-space: pre-wrap; word-break: break-word; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.urls { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.urls dt { font-weight: 750; }
.urls dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 800px) {
  .topbar { align-items: flex-start; padding-block: 16px; }
  nav { display: none; }
  .stats, .grid.two, .grid.three, .product-picker > div { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .urls { grid-template-columns: 1fr; }
}
