/* Payment Follow-up — approval app styles */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e5e8f0;
  --border-strong: #d5dae6;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --brand: #1e2a5a;
  --brand-2: #2f45b5;
  --brand-50: #eef1ff;
  --green: #15803d; --green-500: #16a34a; --green-50: #ecfdf3; --green-100: #d1fadf;
  --amber: #b45309; --amber-500: #f59e0b; --amber-50: #fffaeb; --amber-100: #fef0c7;
  --red: #b91c1c; --red-500: #dc2626; --red-50: #fef3f2; --red-100: #fee4e2;
  --blue: #1d4ed8; --blue-500: #2563eb; --blue-50: #eff4ff; --blue-100: #dbe7ff;
  --violet: #6d28d9; --violet-500: #7c3aed; --violet-50: #f4f3ff; --violet-100: #e9e5ff;
  --gray: #475569; --gray-50: #f2f4f7; --gray-100: #e7eaf0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --page-max: 2200px;  /* fill the screen; only very wide monitors get side margins */
  --gutter: 32px;
  --side: 380px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 10px; }
.i { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; background: var(--brand); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06), var(--shadow);
}
.topbar-inner { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 22px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #4f6bff, #22c55e); color: #fff;
}
.logo small { display: block; font-weight: 500; font-size: 11px; color: rgba(255, 255, 255, .6); letter-spacing: .02em; margin-top: -2px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 9px; color: rgba(255, 255, 255, .78);
  font-size: 14px; font-weight: 550; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav .count { background: var(--amber-500); color: #1f1300; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.user { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: #ffffff1f; color: #fff; border: 1px solid #ffffff33;
}
.user-meta { line-height: 1.2; font-size: 13px; }
.user-meta small { display: block; color: rgba(255, 255, 255, .6); font-size: 11.5px; }
.user a.signout { color: rgba(255, 255, 255, .7); padding: 6px; border-radius: 8px; display: flex; }
.user a.signout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- banners ---------- */
.banner { font-size: 13.5px; }
.banner-inner { max-width: var(--page-max); margin: 0 auto; padding: 9px var(--gutter); display: flex; gap: 10px; align-items: center; }
.banner.test { background: var(--amber-100); color: #7a4100; border-bottom: 1px solid #f7d58a; }
.banner.paused { background: var(--red-100); color: var(--red); border-bottom: 1px solid #fbc4bf; }
.banner.stopped { background: var(--red-500); color: #fff; }
.banner b { font-weight: 650; }
.banner a { color: inherit; text-decoration: underline; }

/* ---------- layout ---------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: 26px var(--gutter) 80px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 22px; align-items: start; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); grid-template-rows: auto 1fr; grid-template-areas: "email side" "hist side"; gap: 16px 22px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-head h2, .card-head h3 { flex: 1; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.section-title h2 { flex: 1; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- flash ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; border: 1px solid; animation: drop .25s ease-out; }
.flash.ok { background: var(--green-50); color: var(--green); border-color: #a6efc4; }
.flash.error { background: var(--red-50); color: var(--red); border-color: #fbc4bf; }
.flash.info { background: var(--blue-50); color: var(--blue); border-color: #c4d7ff; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 10px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; border-color: #c3cad9; }
.btn:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 1px; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.primary:hover { background: #2639a0; }
.btn.approve { background: var(--green-500); border-color: var(--green-500); color: #fff; box-shadow: 0 1px 2px rgba(22, 163, 74, .3); }
.btn.approve:hover { background: var(--green); }
.btn.danger { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.btn.danger:hover { background: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--gray-50); color: var(--text); }
.btn.big { padding: 13px 18px; font-size: 15.5px; border-radius: 12px; width: 100%; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }

/* ---------- pills & chips ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; white-space: nowrap; line-height: 1.6;
}
.pill.amber { background: var(--amber-50); color: var(--amber); box-shadow: inset 0 0 0 1px #fde3a7; }
.pill.blue { background: var(--blue-50); color: var(--blue); box-shadow: inset 0 0 0 1px #cfe0ff; }
.pill.green { background: var(--green-50); color: var(--green); box-shadow: inset 0 0 0 1px #b7f0cf; }
.pill.red { background: var(--red-50); color: var(--red); box-shadow: inset 0 0 0 1px #fecdca; }
.pill.violet { background: var(--violet-50); color: var(--violet); box-shadow: inset 0 0 0 1px #ddd6fe; }
.pill.gray { background: var(--gray-50); color: var(--gray); box-shadow: inset 0 0 0 1px var(--gray-100); }
.type-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, white); padding: 3px 10px 3px 8px; border-radius: 99px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, white);
}
.type-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; padding: 3px 9px; border-radius: 8px; }
.flag.warn { background: var(--amber-50); color: var(--amber); }
.flag.block { background: var(--red-50); color: var(--red); }
.flag.note { background: var(--gray-50); color: var(--gray); }
.count-badge { background: var(--gray-100); color: var(--gray); font-size: 12px; font-weight: 650; border-radius: 99px; padding: 0 8px; }

/* ---------- hero ---------- */
.hero { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.hero > div:first-child { flex: 1; min-width: 260px; }
.hero h1 { font-size: 28px; }
.lead { font-size: 16px; color: var(--muted); margin: 6px 0 0; }
.lead b { color: var(--text); }

/* ---------- workflow strip ---------- */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px; gap: 0; }
.flow-step { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 14px; border-radius: 11px; color: inherit; }
.flow-step:hover { background: var(--surface-2); text-decoration: none; }
.flow-step + .flow-step::before {
  content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; margin-top: -6px;
  border-top: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); transform: rotate(45deg);
}
.flow-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--gray-50); color: var(--gray); }
.flow-num { font-size: 22px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.flow-label { font-size: 13px; font-weight: 650; color: var(--text-2); margin-top: 3px; }
.flow-sub { font-size: 11.5px; color: var(--faint); }
.flow-step.s-sheet .flow-ico { background: #e8f5ee; color: #0f7b45; }
.flow-step.s-draft .flow-ico { background: var(--violet-50); color: var(--violet); }
.flow-step.s-review .flow-ico { background: var(--amber-100); color: var(--amber); }
.flow-step.s-queue .flow-ico { background: var(--blue-50); color: var(--blue); }
.flow-step.s-sent .flow-ico { background: var(--green-50); color: var(--green); }
.flow-step.hot { background: var(--amber-50); box-shadow: inset 0 0 0 1px #fde3a7; }

/* ---------- alerts ---------- */
.alert-list { display: grid; gap: 8px; }
.alert-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--amber-50); border: 1px solid #fde3a7; color: #7a4100; font-size: 14px; }
.alert-item .i { color: var(--amber-500); }
.alert-item p { margin: 0; flex: 1; }
.alert-item.red { background: var(--red-50); border-color: #fecdca; color: var(--red); }
.alert-item.red .i { color: var(--red-500); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 24px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; gap: 8px; align-items: center; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.tabs a.active .count-badge { background: var(--brand-50); color: var(--brand-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); }
.chip:hover { color: var(--text); text-decoration: none; border-color: var(--border-strong); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

/* ---------- draft list ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); cursor: pointer; }
.draft-list { display: grid; gap: 10px; }
.draft-card {
  --accent: #64748b; position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px;
  align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px 16px 14px; box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s, transform .15s;
}
.draft-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.draft-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.draft-card .check { display: flex; align-items: flex-start; padding: 2px 0 0 6px; }
.draft-card input[type=checkbox], .toolbar input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green-500); cursor: pointer; }
.draft-main { color: inherit; min-width: 0; }
.draft-main:hover { text-decoration: none; }
.draft-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.draft-top .tone { font-size: 12.5px; color: var(--muted); }
.draft-top .age { font-size: 12.5px; color: var(--faint); margin-left: auto; }
.party { font-size: 16.5px; font-weight: 700; color: var(--text); }
.party .ref { font-size: 13px; font-weight: 550; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.subject-line { font-size: 13.5px; color: var(--text-2); margin-top: 2px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview { font-size: 13.5px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.draft-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.draft-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; min-width: 130px; }
.amount-big { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.2; }
.amount-cap { font-size: 12px; color: var(--muted); text-align: right; }
.empty { text-align: center; padding: 56px 20px; }
.empty .big-ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--green-50); color: var(--green-500); }
.empty h2 { margin-bottom: 6px; }

/* ---------- draft detail ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.detail-head > div:first-child { flex: 1; min-width: 240px; }
.detail-head h1 { margin: 3px 0 8px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pager { display: flex; gap: 6px; }

.journey { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 18px 10px 14px; margin-bottom: 18px; }
.j-step { position: relative; text-align: center; padding: 0 6px; }
.j-step::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--border); }
.j-step:last-child::after { display: none; }
.j-step.done::after { background: var(--green-500); }
.j-dot { width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; background: var(--gray-50); color: var(--faint); border: 2px solid var(--border); }
.j-step.done .j-dot { background: var(--green-500); border-color: var(--green-500); color: #fff; }
.j-step.now .j-dot { background: #fff; border-color: var(--amber-500); color: var(--amber); box-shadow: 0 0 0 5px var(--amber-100); }
.j-step.now.blue .j-dot { border-color: var(--blue-500); color: var(--blue); box-shadow: 0 0 0 5px var(--blue-100); }
.j-step.stop .j-dot { background: var(--red-500); border-color: var(--red-500); color: #fff; }
.j-step.skip .j-dot { background: var(--gray-100); border-color: var(--gray-100); color: var(--gray); }
.j-title { font-size: 13px; font-weight: 650; color: var(--text-2); }
.j-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }

.callout { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; font-size: 14px; margin-bottom: 12px; border: 1px solid; }
.callout p { margin: 0; }
.callout.warn { background: var(--amber-50); border-color: #fde3a7; color: #7a4100; }
.callout.warn .i { color: var(--amber-500); }
.callout.block { background: var(--red-50); border-color: #fecdca; color: var(--red); }
.callout.note { background: var(--blue-50); border-color: #cfe0ff; color: #1e3a8a; }
.callout.note .i { color: var(--blue-500); }
.callout.good { background: var(--green-50); border-color: #b7f0cf; color: var(--green); }

.email { overflow: hidden; }
.email-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.email-head h3 { flex: 1; display: flex; gap: 8px; align-items: center; }
.versions { display: flex; gap: 4px; flex-wrap: wrap; }
.versions a { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; color: var(--muted); border: 1px solid var(--border); background: #fff; }
.versions a:hover { text-decoration: none; color: var(--text); }
.versions a.active { background: var(--text); color: #fff; border-color: var(--text); }
.email-fields { padding: 14px 20px 6px; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 7px 12px; font-size: 14px; }
.email-fields dt { color: var(--faint); font-weight: 550; }
.email-fields dd { margin: 0; color: var(--text-2); word-break: break-word; }
.email-fields dd.subject { font-weight: 650; color: var(--text); }
.thread-line { margin: 8px 20px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13.5px; color: var(--text-2); display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.thread-line .i { color: var(--muted); }
.email-body { max-width: 900px; padding: 18px 22px 8px; font-size: 15px; line-height: 1.65; color: #1f2937; }
.email-body p { margin: 0 0 14px; }
mark.fig { background: #fff4c2; color: inherit; padding: 1px 3px; border-radius: 4px; box-shadow: inset 0 -2px 0 #f5c542; }
.attach-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 20px 16px; }
.att { display: inline-flex; align-items: center; gap: 10px; padding: 7px 8px 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; max-width: 100%; }
.att-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue); flex: none; }
.att-ico.pdf { background: var(--red-50); color: var(--red-500); }
.att-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.att-text a { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.att-x { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 4px; border-radius: 6px; display: flex; }
.att-x:hover { background: var(--red-50); color: var(--red); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; border: 2px dashed var(--border-strong); border-radius: 12px; background: #fff; text-align: center; cursor: pointer; font-size: 14px; color: var(--text-2); transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-2); background: var(--brand-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone .dz-ico { color: var(--brand-2); }
.dropzone .picked { font-size: 13px; font-weight: 600; color: var(--green); }
.dropzone.small-dz { padding: 12px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); margin-top: 10px; cursor: pointer; }
.check-line input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand-2); }
.email-foot { padding: 12px 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.edit-form { padding: 16px 20px 20px; display: none; }
.editing .edit-form { display: block; }
.editing .email-view { display: none; }

.decision { padding: 18px; }
.decision h3 { margin-bottom: 4px; }
.decision .when { font-size: 13px; color: var(--muted); margin: 8px 0 14px; display: flex; gap: 6px; align-items: center; justify-content: center; }
.actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.act:hover { background: var(--surface-2); border-color: var(--border-strong); }
.act.on { border-color: var(--brand-2); color: var(--brand-2); background: var(--brand-50); }
.act.reject:hover, .act.reject.on { color: var(--red); border-color: #fecdca; background: var(--red-50); }
.panel { display: none; margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.panel.open { display: block; animation: drop .2s ease-out; }
.panel h4 { font-size: 13.5px; margin-bottom: 8px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.quick button { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--border-strong); background: #fff; color: var(--text-2); cursor: pointer; }
.quick button:hover { border-color: var(--brand-2); color: var(--brand-2); }

.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 16px; font-size: 14px; padding: 16px 20px; align-items: center; }
.facts dt { color: var(--muted); white-space: nowrap; }
.facts dd .ladder { justify-content: flex-end; }
.facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-word; }
.facts dd.big { font-size: 17px; }
.ladder { display: flex; gap: 4px; align-items: center; }
.ladder span { width: 22px; height: 8px; border-radius: 4px; background: var(--gray-100); }
.ladder span.sent { background: var(--c); }
.ladder span.next { background: #fff; box-shadow: inset 0 0 0 2px var(--c); }

.timeline { list-style: none; margin: 0; padding: 4px 20px 16px; }
.timeline li { position: relative; padding: 8px 0 8px 26px; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline li:first-child::before { top: 14px; }
.timeline li:last-child::before { bottom: calc(100% - 14px); }
.timeline .dot { position: absolute; left: 1px; top: 11px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--faint); }
.timeline .dot.green { border-color: var(--green-500); }
.timeline .dot.amber { border-color: var(--amber-500); }
.timeline .dot.blue { border-color: var(--blue-500); }
.timeline .dot.red { border-color: var(--red-500); }
.timeline .dot.violet { border-color: var(--violet-500); }
.timeline .t-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.timeline .t-act { font-weight: 650; }
.timeline .t-time { color: var(--faint); font-size: 12px; margin-left: auto; white-space: nowrap; }
.timeline .t-det { color: var(--muted); }

/* ---------- forms ---------- */
label.field { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 12px; }
label.field span { display: block; margin-bottom: 5px; }
input[type=text], input[type=date], input[type=email], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--text); padding: 9px 11px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: #fff; transition: border-color .12s, box-shadow .12s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
textarea.body-edit { min-height: 320px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px #c7d2fe; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.search { position: relative; max-width: 320px; flex: 1; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { padding-left: 36px; }

/* ---------- how it works ---------- */
.how-hero { text-align: center; max-width: 720px; margin: 10px auto 30px; }
.how-hero h1 { font-size: 32px; }
.how-hero .lead { font-size: 17px; }
.steps8 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; counter-reset: s; }
.step8 { padding: 18px; position: relative; }
.step8 .n { position: absolute; top: 14px; right: 16px; font-size: 32px; font-weight: 800; color: var(--gray-100); line-height: 1; }
.step8 .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 12px; }
.step8 h3 { margin-bottom: 4px; }
.step8 p { font-size: 13.5px; color: var(--muted); margin: 0; }
.step8 .who { display: inline-block; margin-top: 10px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.ladder-visual { padding: 26px 24px 18px; }
.axis { position: relative; height: 4px; background: linear-gradient(90deg, #0ea5e9, #2563eb 25%, #d97706 55%, #ea580c 75%, #dc2626); border-radius: 4px; margin: 64px 4% 76px; }
.axis .m { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.axis .m .pin { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--c); box-shadow: var(--shadow); }
.axis .m .lbl { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; text-align: center; font-size: 12.5px; }
.axis .m .lbl.up { bottom: 28px; }
.axis .m .lbl.down { top: 28px; color: var(--muted); }
.axis .m .lbl b { display: block; font-size: 15px; color: var(--c); }
.axis .due { position: absolute; top: -34px; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cards3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mini-card { padding: 18px; }
.mini-card .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 10px; background: var(--brand-50); color: var(--brand-2); }
.mini-card h3 { margin-bottom: 4px; }
.mini-card p, .mini-card li { font-size: 13.5px; color: var(--muted); }
.mini-card ul { padding-left: 18px; margin: 6px 0 0; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.checklist li { display: flex; gap: 10px; font-size: 14px; color: var(--text-2); }
.checklist .i { color: var(--green-500); margin-top: 2px; }

/* ---------- setup ---------- */
.setup-row { display: flex; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.setup-row:last-of-type { border-bottom: 0; }
.setup-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.setup-dot.ok { background: var(--green-500); color: #fff; }
.setup-dot.bad { background: var(--red-50); color: var(--red-500); box-shadow: inset 0 0 0 2px #fecdca; }
.setup-dot.warn { background: var(--amber-100); color: var(--amber); }
.setup-dot.opt { background: var(--gray-50); color: var(--faint); box-shadow: inset 0 0 0 2px var(--gray-100); }
.setup-text { flex: 1; min-width: 0; }
.setup-steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text-2); }
.setup-steps li { margin-bottom: 8px; }
.setup-steps code, .codeline { font-size: 12.5px; background: var(--gray-50); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; word-break: break-all; }
.code-box { margin: 0; max-height: 340px; overflow: auto; white-space: pre; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text-2); }

/* ---------- settings ---------- */
.kv { display: grid; grid-template-columns: minmax(0, 1fr); }
.kv-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-row:last-child { border-bottom: 0; }
.kv-row .k { color: var(--text-2); font-weight: 600; }
.kv-row .v { font-weight: 600; white-space: pre-line; }
.kv-row .h { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; white-space: normal; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: radial-gradient(1200px 600px at -10% -20%, #3b54d6 0%, transparent 60%), linear-gradient(160deg, #1e2a5a, #111a3d); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h1 { font-size: 36px; line-height: 1.15; margin: 28px 0 14px; max-width: 460px; }
.login-side p { color: rgba(255, 255, 255, .75); font-size: 16px; max-width: 440px; }
.login-points { display: grid; gap: 14px; margin-top: 30px; }
.login-points div { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .85); font-size: 15px; }
.login-points .i { color: #86efac; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: #fff; font: inherit; font-weight: 600; font-size: 15px; color: var(--text); cursor: pointer; box-shadow: var(--shadow-sm); }
.gbtn:hover { background: var(--surface-2); text-decoration: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 22px 0 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-user { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font: inherit; text-align: left; cursor: pointer; margin-bottom: 8px; }
.demo-user:hover { border-color: var(--brand-2); background: var(--brand-50); }
.demo-user .avatar { background: var(--brand-50); color: var(--brand-2); border-color: #dfe4ff; }
.demo-user b { display: block; font-size: 14.5px; }
.demo-user small { color: var(--muted); }

/* ---------- demo page ---------- */
.try { counter-reset: t; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.try li { counter-increment: t; display: flex; gap: 12px; font-size: 14px; color: var(--text-2); }
.try li::before { content: counter(t); width: 24px; height: 24px; border-radius: 50%; background: var(--violet-50); color: var(--violet); font-weight: 700; font-size: 12.5px; display: grid; place-items: center; flex: none; }
.outbox-item { border-bottom: 1px solid var(--border); }
.outbox-item summary { list-style: none; cursor: pointer; padding: 12px 20px; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.outbox-item summary::-webkit-details-marker { display: none; }
.outbox-item pre { margin: 0 20px 14px; white-space: pre-wrap; font: inherit; font-size: 13.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: var(--text-2); }
.chat-msg { margin: 0 20px 10px; padding: 10px 14px; background: #f0f7f4; border-radius: 12px 12px 12px 4px; font-size: 13.5px; white-space: pre-wrap; color: #14532d; }
.chat-msg small { display: block; color: var(--faint); margin-bottom: 2px; }

footer.foot { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) 30px; color: var(--faint); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (min-width: 1600px) {
  :root { --side: 440px; --gutter: 40px; }
}
@media (max-width: 1080px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "email" "side" "hist"; }
  .alert-item { flex-wrap: wrap; }
  .alert-item form { margin-left: 30px; }
  .steps8 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(5, minmax(140px, 1fr)); overflow-x: auto; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 10px 16px 0; gap: 10px; }
  .logo { flex: 1; }
  .user-meta { display: none; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  :root { --gutter: 16px; }
  .page { padding: 18px 16px 70px; }
  .hero h1 { font-size: 23px; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .flow-step + .flow-step::before { display: none; }
  .draft-card { grid-template-columns: auto minmax(0, 1fr); padding: 14px 14px 14px 10px; }
  .draft-side { grid-column: 2; flex-direction: row; align-items: center; min-width: 0; }
  .amount-big, .amount-cap { text-align: left; }
  .journey { grid-template-columns: repeat(5, minmax(64px, 1fr)); overflow-x: auto; padding: 14px 4px 10px; }
  .j-title { font-size: 11.5px; }
  .j-sub { display: none; }
  .cards3, .cards4, .steps8, .checklist { grid-template-columns: minmax(0, 1fr); }
  .kv-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-side { padding: 28px 22px; }
  .login-side h1 { font-size: 26px; margin-top: 18px; }
  .login-points { display: none; }
  .axis { margin: 64px 6% 80px; }
  .axis .m .lbl.down { display: none; }
  table.data.cards thead { display: none; }
  table.data.cards tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 0; }
  table.data.cards td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 14px; }
  table.data.cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; }
  table.data.cards td.num { text-align: right; }
}

/* ---------- preview (preview.bat only) ---------- */
.banner.preview-bar { background: var(--violet-50); color: #4c1d95; border-bottom: 1px solid var(--violet-100); }
.banner.preview-bar .banner-inner { flex-wrap: wrap; row-gap: 8px; }
.banner.preview-bar > .banner-inner > .i { color: var(--violet-500); }
.pv-text { flex: 1; min-width: 220px; }
.pv-links { display: flex; gap: 8px; flex-wrap: wrap; }
.banner a.pv-link { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; background: #fff; color: var(--violet); font-weight: 650; text-decoration: none; box-shadow: inset 0 0 0 1px #ddd6fe; white-space: nowrap; }
.banner a.pv-link:hover { background: var(--violet-100); }
.banner a.pv-link.on { background: var(--violet-500); color: #fff; box-shadow: none; }

.try-cards { margin-bottom: 4px; }
.try-cards .mini-card p { margin: 0 0 8px; }
.try-cards .mini-card p.result { margin: 0; color: var(--green); font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.try-cards .mini-card p.result .i { margin-top: 3px; }

.sheet-card { overflow: hidden; }
.sheet-scroll { overflow-x: auto; }
table.sheet { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
table.sheet th, table.sheet td { border: 1px solid var(--border); padding: 0; height: 34px; white-space: nowrap; }
table.sheet thead th { background: var(--surface-2); color: var(--faint); font-size: 11.5px; font-weight: 600; height: 24px; text-align: center; padding: 0 8px; }
table.sheet thead th.sys { background: var(--gray-100); }
table.sheet tr.hdr td { background: var(--surface-2); font-weight: 650; color: var(--text-2); padding: 0 10px; font-size: 12.5px; }
table.sheet tr.hdr td.sys { background: var(--gray-100); color: var(--gray); }
table.sheet .rn { background: var(--surface-2); color: var(--faint); font-size: 11.5px; text-align: center; min-width: 38px; padding: 0 6px; position: sticky; left: 0; z-index: 1; }
table.sheet td input[type=text] { width: 120px; border: 0; border-radius: 0; background: transparent; font: inherit; padding: 7px 10px; color: var(--text); box-shadow: none; }
table.sheet td input.wide { width: 220px; }
table.sheet td input[type=text]:focus { outline: 2px solid var(--brand-2); outline-offset: -2px; background: #fff; box-shadow: none; }
table.sheet td input::placeholder { color: var(--faint); font-style: italic; }
table.sheet td.sys { background: var(--gray-50); color: var(--muted); padding: 0 10px; font-size: 12.5px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
table.sheet td.ck { text-align: center; padding: 0 12px; }
table.sheet td.ck input { width: 16px; height: 16px; accent-color: var(--brand-2); vertical-align: middle; }
table.sheet tr.new td:not(.rn):not(.sys) { background: #fcfdff; }
table.sheet .dirty, table.sheet td:has(> input.dirty) { background: var(--amber-100); }
table.sheet tr.deleting td:not(.rn) { background: var(--red-50); text-decoration: line-through; color: var(--red); }
.sheet-foot { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.key-sys { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--gray-100); border: 1px solid var(--border-strong); vertical-align: -1px; margin-right: 4px; }
input.dirty, textarea.dirty { border-color: var(--amber-500); background: var(--amber-50); }

.outbox-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.outbox-item:last-child { border-bottom: 0; }
.outbox-item summary .mail-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--blue-50); color: var(--blue); }
.outbox-item summary .mail-head { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.outbox-item .mail-extra { margin: -4px 20px 14px; }
.chat-list { padding-top: 14px; }
.chat-list .chat-msg { overflow-wrap: anywhere; }

@media (max-width: 1080px) {
  .outbox-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .banner.preview-bar .pv-text { min-width: 0; flex-basis: calc(100% - 30px); }
  .outbox-item summary { flex-wrap: wrap; padding: 12px 16px; }
  .outbox-item pre { margin: 0 16px 14px; }
}

/* ---------- sheet review running ---------- */
.banner.reviewing { background: var(--blue-50); color: #1e3a8a; border-bottom: 1px solid #cfe0ff; }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; flex: none; vertical-align: -2px; }
.spin.dark { color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- editable addresses on a draft ---------- */
.addr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.addr-note { display: flex; gap: 6px; align-items: flex-start; margin: -2px 0 14px; }
.addr-note .i { margin-top: 3px; flex: none; }
input.locked { background: var(--gray-50); color: var(--muted); cursor: not-allowed; }
.pill.hand { font-size: 11px; padding: 0 8px; vertical-align: 1px; }
@media (max-width: 760px) { .addr-grid { grid-template-columns: minmax(0, 1fr); } }
