/* ============================================================
   Finvoult — design system
   Palette per spec: green buttons, black foreground, white/grey background.
   Brand navy + teal come from the logo and are used for accents only.
   ============================================================ */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #e2e8ec;
  --line-strong: #cbd5dc;

  --ink: #0d1117;          /* foreground: black */
  --ink-2: #3d4a56;
  --ink-3: #6b7a88;

  --green: #16a34a;        /* buttons */
  --green-dark: #15803d;
  --green-soft: #e8f7ee;
  --green-glow: rgba(22, 163, 74, .35);

  --navy: #17475f;         /* logo */
  --teal: #17807a;
  --navy-soft: #e8f1f5;

  --warn: #d97706;  --warn-soft: #fdf3e3;
  --danger: #dc2626; --danger-soft: #fdeceb;
  --info: #0369a1;  --info-soft: #e6f2fa;

  --shadow-sm: 0 1px 2px rgba(13, 17, 23, .05);
  --shadow: 0 1px 3px rgba(13, 17, 23, .06), 0 8px 24px -14px rgba(13, 17, 23, .22);
  --shadow-lg: 0 24px 60px -24px rgba(13, 17, 23, .3);

  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --sidebar: 252px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #19222c;
  --line: #24303c;
  --line-strong: #33424f;

  --ink: #eef3f7;
  --ink-2: #aebccb;
  --ink-3: #728697;

  --green: #22c55e;
  --green-dark: #16a34a;
  --green-soft: #10291b;
  --green-glow: rgba(34, 197, 94, .45);

  --navy-soft: #112530;
  --warn-soft: #2a2011; --danger-soft: #2c1517; --info-soft: #0d2233;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 12px 32px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 30px 70px -28px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .35s var(--ease), color .35s var(--ease);
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--green); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 13.5px;
  border: 1px solid transparent; transition: .2s var(--ease); white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 18px -10px var(--green-glow); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: 0 12px 24px -10px var(--green-glow); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- shell ---------------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand img, .brand .mark { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 9px; }
.brand .mark { background: linear-gradient(140deg, var(--navy), var(--teal)); display: grid; place-items: center; color: #fff; font-weight: 800; }
.brand b { font-size: 16.5px; font-weight: 800; display: block; line-height: 1.1; letter-spacing: -.03em; }
.brand span { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

.nav-label { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 14px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; transition: .18s var(--ease);
}
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: 0 0 auto; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--green); color: #fff; box-shadow: 0 8px 18px -12px var(--green-glow); }
.nav a.active svg { opacity: 1; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--ink-3); padding: 1px 7px; border-radius: 99px; }
.nav a.active .count { background: rgba(255, 255, 255, .22); color: #fff; }

.side-foot { margin-top: auto; padding-top: 14px; }
.plan-card { background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; border-radius: var(--r); padding: 13px; margin-bottom: 10px; position: relative; overflow: hidden; }
.plan-card::after { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .14); top: -46px; right: -30px; }
.plan-card b { font-size: 12.5px; position: relative; }
.plan-card p { margin: 2px 0 0; font-size: 11px; opacity: .88; position: relative; }
.plan-card .bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); margin-top: 8px; position: relative; overflow: hidden; }
.plan-card .bar i { display: block; height: 100%; background: #fff; border-radius: 99px; }

.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: 0 0 auto; }
.me b { font-size: 12.5px; display: block; }
.me small { color: var(--ink-3); font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
}
.topbar h1 { font-size: 18px; }
.topbar .crumb { font-size: 11px; color: var(--ink-3); }
.spacer { margin-left: auto; }
.content { padding: 22px 24px 60px; max-width: 1540px; width: 100%; }

/* theme switch (spec 1.1) */
.theme-switch { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 3px; gap: 2px; }
.theme-switch button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px;
  font-size: 12px; font-weight: 600; color: var(--ink-3); transition: .2s var(--ease);
}
.theme-switch button svg { width: 14px; height: 14px; }
.theme-switch button.on { background: var(--ink); color: var(--surface); }
html[data-theme="dark"] .theme-switch button.on { background: var(--surface-2); color: var(--ink); }

.icon-btn { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: .2s var(--ease); }
.icon-btn:hover { color: var(--green); border-color: var(--green); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------------- surfaces ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14.5px; }
.card-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); }
.pad { padding: 18px; }
.muted { color: var(--ink-3); }
.grid { display: grid; gap: 16px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head p { margin: 3px 0 0; color: var(--ink-3); font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- forms ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.field label .req { color: var(--danger); }
.input, .select, textarea.input {
  width: 100%; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-2); outline: none; transition: .18s var(--ease);
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--green); background: var(--surface);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.input[readonly] { color: var(--ink-3); }
.hint { font-size: 11px; color: var(--ink-3); }
.error { font-size: 11.5px; color: var(--danger); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--green); }

.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; display: flex; gap: 9px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.alert-ok { background: var(--green-soft); color: var(--green-dark); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
html[data-theme="dark"] .alert-ok { color: var(--green); }

/* ---------------- table ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
  font-weight: 700; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
table.data tbody tr { transition: .15s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--green-soft); color: var(--green-dark); }
html[data-theme="dark"] .chip-ok { color: var(--green); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-brand { background: var(--navy-soft); color: var(--teal); }
.chip-muted { background: var(--surface-2); color: var(--ink-3); }

.tabs { display: inline-flex; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; }
.tabs a, .tabs button { padding: 6px 13px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); transition: .18s; }
.tabs a.on, .tabs button.on { background: var(--green-soft); color: var(--green-dark); }
html[data-theme="dark"] .tabs a.on, html[data-theme="dark"] .tabs button.on { color: var(--green); }

.pagination { display: flex; gap: 5px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 32px; height: 32px; padding: 0 9px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px;
}
.pagination .current { background: var(--green); color: #fff; border-color: var(--green); }
.pagination .disabled { opacity: .45; }

/* ---------------- stats ---------------- */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; position: relative; overflow: hidden; transition: .25s var(--ease); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 10px; }
.stat .ico svg { width: 17px; height: 17px; }
.stat .label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.stat .value { font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin: 3px 0 4px; }
.stat .sub { font-size: 11.5px; color: var(--ink-3); }

/* ---------------- charts (spec 2.1 / 2.2) ---------------- */
.chart { padding: 16px 18px 6px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar {
  width: 13px; max-width: 40%; border-radius: 4px 4px 2px 2px; height: 0; position: relative;
  transition: height .9s var(--ease); cursor: default;
}
.bar.invoiced { background: linear-gradient(180deg, var(--teal), var(--navy)); }
.bar.collected { background: var(--green); }
.bar:hover::after {
  content: attr(data-label); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--surface); font-size: 10.5px; font-weight: 600; padding: 4px 8px;
  border-radius: 6px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow);
}
.bar-col small { font-size: 10.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }

/* stacked status chart */
.stack-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.stack { width: 26px; display: flex; flex-direction: column-reverse; border-radius: 5px; overflow: hidden; transition: height .9s var(--ease); height: 0; }
.stack span { display: block; width: 100%; position: relative; }
.stack .s-paid { background: var(--green); }
.stack .s-unpaid { background: var(--warn); }
.stack .s-overdue { background: var(--danger); }
.stack .s-draft { background: var(--line-strong); }

/* ---------------- animated sample invoice (spec 1.2) ---------------- */
.preview-panel { position: sticky; top: 74px; }
.paper-frame { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.mini-paper { background: #fff; color: #17202a; padding: 18px 18px 14px; font-size: 10px; line-height: 1.45; position: relative; }
.mini-paper .mp-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--teal); padding-bottom: 9px; }
.mini-paper .mp-logo { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(140deg, var(--navy), var(--teal)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.mini-paper b.mp-co { font-size: 12px; color: #111; display: block; }
.mini-paper .mp-title { font-size: 15px; font-weight: 800; color: var(--teal); text-transform: uppercase; letter-spacing: .03em; }
.mini-paper .mp-meta { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef1f4; color: #55616d; }
.mini-paper table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.mini-paper th { background: var(--teal); color: #fff; font-size: 8px; padding: 5px 6px; text-align: left; font-weight: 600; letter-spacing: .04em; }
.mini-paper td { padding: 5px 6px; border-bottom: 1px solid #f0f3f5; font-size: 9.5px; color: #2c3742; }
.mini-paper tr.row-hi td { background: var(--green-soft); }
.mini-paper .mp-total { display: flex; justify-content: space-between; margin-top: 9px; background: var(--navy); color: #fff; padding: 7px 9px; border-radius: 5px; font-weight: 700; font-size: 11px; }
.mini-paper .mp-foot { margin-top: 9px; display: flex; justify-content: space-between; align-items: flex-end; color: #8c97a2; font-size: 8.5px; }
.mini-paper .mp-sign { text-align: right; }
.mini-paper .mp-sign .line { border-top: 1px solid #b3bcc5; width: 72px; margin-top: 16px; padding-top: 3px; }

/* the scanning beam runs top -> bottom, over and over */
.scan-beam {
  position: absolute; left: 0; right: 0; height: 74px; pointer-events: none; z-index: 3;
  background: linear-gradient(180deg, transparent, var(--green-glow) 55%, transparent);
  opacity: .5; animation: scan 4.5s var(--ease) infinite;
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px; pointer-events: none; z-index: 4;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  box-shadow: 0 0 12px 2px var(--green-glow); animation: scan 4.5s var(--ease) infinite;
}
@keyframes scan {
  0%   { top: -80px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
/* glowing dot trail down the left edge */
.dot-trail { position: absolute; left: 7px; top: 14px; bottom: 14px; width: 3px; z-index: 4; pointer-events: none; }
.dot-trail i {
  position: absolute; left: 0; width: 3px; height: 3px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 6px 1px var(--green-glow); opacity: 0; animation: trail 4.5s linear infinite;
}
@keyframes trail {
  0%   { top: 0; opacity: 0; transform: scale(.6); }
  10%  { opacity: 1; transform: scale(1); }
  85%  { opacity: 1; }
  100% { top: 100%; opacity: 0; transform: scale(.6); }
}
/* blinking green highlight on data points */
.blink { animation: blink 2.6s ease-in-out infinite; border-radius: 3px; }
@keyframes blink {
  0%, 100% { background: transparent; box-shadow: none; }
  45%      { background: var(--green-soft); box-shadow: 0 0 0 2px var(--green-soft); }
}
.live-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; color: var(--green); letter-spacing: .05em; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  .scan-beam, .scan-line, .dot-trail i, .blink, .live-badge i { animation: none; }
  .scan-beam, .scan-line { opacity: 0; }
}

/* ---------------- invoice builder ---------------- */
.builder { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section h4::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--green); }
table.items { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.items th { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; text-align: left; padding: 0 6px 2px; }
table.items td { padding: 0 3px; vertical-align: middle; }
table.items tr.item-row td { background: var(--surface-2); padding: 7px 3px; }
table.items tr.item-row td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); padding-left: 8px; }
table.items tr.item-row td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding-right: 8px; }
table.items .input { padding: 6px 8px; font-size: 12.5px; background: var(--surface); }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; white-space: nowrap; padding-right: 6px; }
.row-del { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: var(--ink-3); transition: .18s; }
.row-del:hover { background: var(--danger-soft); color: var(--danger); }
.row-del svg { width: 14px; height: 14px; }
.totals-box { width: 300px; margin-left: auto; display: flex; flex-direction: column; gap: 7px; }
.total-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.total-line b { font-variant-numeric: tabular-nums; color: var(--ink); }
.total-line.grand { border-top: 2px dashed var(--line-strong); padding-top: 10px; margin-top: 3px; font-size: 16px; font-weight: 800; color: var(--ink); }
.total-line.grand b { color: var(--green); font-size: 18px; }

/* signature pad */
.sign-pad { border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); touch-action: none; display: block; width: 100%; cursor: crosshair; }
.sign-preview { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; background: #fff; display: inline-block; }
.sign-preview img { max-height: 70px; }

/* ---------------- landing ---------------- */
.landing-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.landing-nav .inner { max-width: 1180px; margin: 0 auto; padding: 14px 22px; display: flex; align-items: center; gap: 14px; }
.wrap-narrow { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.hero { padding: 66px 0 56px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--green-dark); background: var(--green-soft); padding: 5px 12px; border-radius: 99px; }
html[data-theme="dark"] .eyebrow { color: var(--green); }
.hero h1 { font-size: 44px; line-height: 1.08; margin: 16px 0 14px; letter-spacing: -.035em; }
.hero h1 .accent { background: linear-gradient(100deg, var(--teal), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 16px; color: var(--ink-2); max-width: 520px; margin: 0 0 24px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.trust { display: flex; gap: 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust svg { width: 15px; height: 15px; color: var(--green); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; transition: .25s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green); }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--green-dark); display: grid; place-items: center; margin-bottom: 12px; }
html[data-theme="dark"] .feature .ico { color: var(--green); }
.feature .ico svg { width: 19px; height: 19px; }
.feature h3 { font-size: 15px; margin-bottom: 5px; }
.feature p { margin: 0; font-size: 13px; color: var(--ink-3); }

.section-title { text-align: center; max-width: 620px; margin: 0 auto 34px; }
.section-title h2 { font-size: 30px; letter-spacing: -.03em; }
.section-title p { color: var(--ink-3); margin: 10px 0 0; font-size: 14.5px; }
.block { padding: 62px 0; }
.block.alt { background: var(--surface); border-block: 1px solid var(--line); }

.step-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; padding-top: 14px; }
.step .n { width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; margin-bottom: 11px; }
.step h4 { font-size: 14.5px; margin-bottom: 4px; }
.step p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.price.featured { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); position: relative; }
.price.featured::before { content: "POPULAR"; position: absolute; top: -10px; left: 24px; background: var(--green); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .1em; padding: 3px 10px; border-radius: 99px; }
.price h3 { font-size: 16px; }
.price .amt { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; }
.price .amt small { font-size: 13px; font-weight: 500; color: var(--ink-3); }
.price ul { list-style: none; margin: 16px 0 20px; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.price li { font-size: 13px; display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); }
.price li svg { width: 15px; height: 15px; color: var(--green); flex: 0 0 auto; margin-top: 2px; }

.footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--ink-3); font-size: 12.5px; }
.footer .inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

/* auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 480px; }
.auth-side { background: linear-gradient(150deg, var(--navy), var(--teal)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(255, 255, 255, .08); bottom: -160px; left: -120px; }
.auth-side h2 { font-size: 32px; letter-spacing: -.03em; line-height: 1.15; position: relative; }
.auth-side p { opacity: .85; font-size: 15px; max-width: 420px; position: relative; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 13px; position: relative; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.auth-points svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; }
.auth-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); overflow-y: auto; }
.auth-form .inner { width: 100%; max-width: 380px; margin: 0 auto; }

/* toasts */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: var(--r-sm); padding: 11px 15px; box-shadow: var(--shadow-lg); font-size: 13px; animation: slide-in .4s var(--ease); max-width: 330px; }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* reveal on load */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }

@media (max-width: 1250px) {
  .builder { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .g2, .g3, .g4, .feature-grid, .step-row, .price-grid { grid-template-columns: 1fr; }
  .content { padding: 18px 16px 50px; }
  .hero h1 { font-size: 32px; }
  .totals-box { width: 100%; }
}

/* ============================================================
   Animated auth banner (login / register left panel)
   ============================================================ */
.auth-stage {
  position: relative; overflow: hidden; height: 100%;
  background: linear-gradient(155deg, #0e3547 0%, #17475f 42%, #17807a 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
  padding: 48px 46px;
}
.auth-stage .aurora { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.auth-stage .aurora i {
  position: absolute; display: block; border-radius: 50%; filter: blur(64px);
  animation: auth-float 20s cubic-bezier(.22,1,.36,1) infinite alternate;
}
.auth-stage .aurora i:nth-child(1) { width: 380px; height: 380px; background: #22c55e; opacity: .32; top: -120px; left: -90px; }
.auth-stage .aurora i:nth-child(2) { width: 320px; height: 320px; background: #38bdf8; opacity: .28; bottom: -110px; right: -70px; animation-delay: -7s; }
.auth-stage .aurora i:nth-child(3) { width: 260px; height: 260px; background: #a7f3d0; opacity: .2; top: 45%; left: 55%; animation-delay: -13s; }
@keyframes auth-float { to { transform: translate3d(50px, -36px, 0) scale(1.18); } }

/* drifting particles */
.auth-stage .particles { position: absolute; inset: 0; pointer-events: none; }
.auth-stage .particles span {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 0 8px rgba(255,255,255,.5);
  animation: particle-rise linear infinite;
}
@keyframes particle-rise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { opacity: .9; }
  85%  { opacity: .7; }
  100% { transform: translateY(-105vh) scale(1.1); opacity: 0; }
}

/* orbiting feature nodes */
.orbit-wrap {
  position: relative; width: 330px; height: 330px; margin: 0 auto 34px;
  display: grid; place-items: center;
}
.orbit-ring {
  position: absolute; border-radius: 50%; border: 1px dashed rgba(255,255,255,.22);
}
.orbit-ring.r1 { width: 220px; height: 220px; animation: spin 26s linear infinite; }
.orbit-ring.r2 { width: 320px; height: 320px; border-style: solid; border-color: rgba(255,255,255,.1); animation: spin 40s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.orbit-core {
  position: relative; z-index: 2; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.28);
  display: grid; place-items: center; color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 0 0 rgba(34,197,94,.45);
  animation: core-pulse 3.4s ease-in-out infinite;
}
.orbit-core svg { width: 66px; height: 66px; }
@keyframes core-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.42); }
  50%      { box-shadow: 0 0 0 20px rgba(34,197,94,0); }
}

.orbit-nodes { position: absolute; inset: 0; }
.orbit-nodes .node {
  position: absolute; top: 50%; left: 50%; width: 0; height: 0;
  transform: rotate(var(--angle)) translate(160px) rotate(calc(-1 * var(--angle)));
  animation: node-bob 5.5s ease-in-out infinite;
}
.node-inner {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.26);
  border-radius: 13px; padding: 9px 11px; backdrop-filter: blur(6px); white-space: nowrap;
}
.node-inner svg { width: 17px; height: 17px; color: #bbf7d0; }
.node-inner span { font-size: 10px; font-weight: 600; letter-spacing: .02em; opacity: .92; }
@keyframes node-bob {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: -9px; }
}

.auth-copy { position: relative; z-index: 3; max-width: 430px; }
.auth-copy h2 { font-size: 28px; line-height: 1.18; letter-spacing: -.03em; }
.auth-copy p { font-size: 14.5px; opacity: .84; margin: 10px 0 0; }

.auth-ticker { margin-top: 22px; height: 26px; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ticker-track { display: flex; gap: 26px; width: max-content; animation: ticker 26s linear infinite; }
.ticker-track span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; opacity: .9; white-space: nowrap; }
.ticker-track svg { width: 14px; height: 14px; color: #86efac; flex: 0 0 auto; }
@keyframes ticker { to { transform: translateX(-50%); } }

.auth-brandline {
  position: absolute; bottom: 26px; left: 46px; right: 46px; z-index: 3;
  font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .55;
}

@media (prefers-reduced-motion: reduce) {
  .auth-stage .aurora i, .auth-stage .particles span, .orbit-ring,
  .orbit-core, .orbit-nodes .node, .ticker-track { animation: none; }
}

/* ============================================================
   Landing page — wider container, tighter vertical rhythm
   (the old 1180px box left too much empty space on big screens)
   ============================================================ */
.wrap-narrow { max-width: 1280px; padding: 0 32px; }
.landing-nav .inner { max-width: 1280px; padding: 14px 32px; }
.hero { padding: 52px 0 46px; }
.hero-grid { gap: 52px; align-items: center; }
.hero h1 { font-size: 46px; }
.hero p.lead { max-width: 560px; }
.block { padding: 54px 0; }
.section-title { margin-bottom: 30px; }

/* contact / enquiry form */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-line { display: flex; gap: 12px; align-items: flex-start; }
.contact-line .ico {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--green-soft); color: var(--green-dark);
}
html[data-theme="dark"] .contact-line .ico { color: var(--green); }
.contact-line .ico svg { width: 18px; height: 18px; }
.contact-line b { display: block; font-size: 13px; }
.contact-line span { font-size: 13px; color: var(--ink-3); }
.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; overflow: hidden; }

@media (max-width: 1250px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .wrap-narrow, .landing-nav .inner { padding-left: 18px; padding-right: 18px; }
  .hero { padding: 34px 0 30px; }
  .orbit-wrap { display: none; }
}

/* the banner paints its own background now */
.auth-side { padding: 0; background: none; display: block; }
.auth-side::after { content: none; }

/* ============================================================
   Uploaded logo
   A wide logo squeezed into a 36px square looks blurry and cramped.
   When the admin uploads one, keep its aspect ratio and give it room.
   ============================================================ */
.brand img { object-fit: contain; }

.brand-custom { gap: 11px; }
.brand-custom img {
  width: auto;
  height: var(--header-logo-h, 52px);
  max-width: var(--header-logo-w, 210px);
  border-radius: 0;
  image-rendering: -webkit-optimize-contrast;
}
.landing-nav .brand-custom img { height: calc(var(--header-logo-h, 52px) * 1.15); max-width: var(--header-logo-w, 210px); }
.auth-form .brand-custom img { height: calc(var(--header-logo-h, 52px) * 1.05); max-width: var(--header-logo-w, 210px); }
.sidebar .brand-custom img { height: calc(var(--header-logo-h, 52px) * .92); max-width: var(--header-logo-w, 210px); }

@media (max-width: 900px) {
  .landing-nav .brand-custom img { height: calc(var(--header-logo-h, 52px) * .8); max-width: 170px; }
}

/* ============================================================
   Site footer — dark band with detail cards
   ============================================================ */
.site-footer {
  background: linear-gradient(160deg, #0b1f33 0%, #0d2740 55%, #0a1c2e 100%);
  color: #e8eef5;
  padding: 44px 0 26px;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}
.site-footer::after {
  content: "";
  position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: rgba(23, 128, 122, .18); filter: blur(70px);
  top: -170px; right: -90px; pointer-events: none;
}
.footer-cards {
  display: grid;
  grid-template-columns: 1.45fr 1fr 1fr 1.25fr;
  gap: 16px;
  position: relative;
}
.fcard {
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  padding: 18px 20px;
}
.fcard .flabel {
  display: block;
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: #8fa7bd; font-weight: 600; margin-bottom: 7px;
}
.fcard b { display: block; font-size: 14px; line-height: 1.45; color: #fff; font-weight: 700; }
.fcard b.fmuted { font-weight: 500; color: #cdd9e5; margin-top: 2px; }
.fcard a { color: inherit; }
.fcard a:hover { color: var(--green); }

.fcard-brand .flogo {
  display: block; height: var(--footer-logo-h, 54px); width: auto; max-width: var(--footer-logo-w, 200px);
  object-fit: contain; margin-bottom: 12px;
  /* the footer is dark, so a dark logo needs lifting off the background */
  background: #fff; border-radius: 10px; padding: 7px 10px;
}
.fcard-brand p { margin: 4px 0 0; font-size: 13px; color: #9fb3c6; }

.footer-base {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  text-align: center; font-size: 12.5px; color: #93a8bd;
  position: relative;
}
.footer-base .fmade { margin-top: 5px; font-size: 12px; color: #7e93a8; }
.footer-base .fmade span { color: var(--green); font-weight: 600; }

@media (max-width: 1100px) { .footer-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .footer-cards { grid-template-columns: 1fr; } }

/* ============================================================
   RESPONSIVE
   Two-column page layouts. These used to be inline styles, which a
   media query can never override — that is why phones kept the
   desktop shape.
   ============================================================ */
.split { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

@media (max-width: 1150px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .check-grid { grid-template-columns: 1fr; }
}

/* ---------- mobile top bar + sidebar drawer ---------- */
.mobile-bar { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 900px) {
  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 60;
    padding: 9px 14px;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand span { display: none; }
  .mobile-bar .spacer { margin-left: auto; }

  .burger {
    width: 40px; height: 40px; border-radius: var(--r-sm); flex: 0 0 auto;
    border: 1px solid var(--line); background: var(--surface);
    display: grid; place-items: center;
  }
  .burger svg { width: 19px; height: 19px; }

  /* the sidebar becomes a drawer */
  .sidebar {
    display: flex !important;
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 272px; max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .28s var(--ease);
    z-index: 80; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }

  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 70;
    background: rgba(8, 12, 18, .5);
    opacity: 0; pointer-events: none; transition: opacity .28s var(--ease);
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }

  .shell { grid-template-columns: 1fr; }

  /* the desktop topbar loses the duplicated title row */
  .topbar { padding: 10px 14px; flex-wrap: wrap; row-gap: 8px; }
  .topbar h1 { font-size: 16.5px; }
  .topbar .crumb { display: none; }
  .theme-switch button span { display: none; }

  .content { padding: 14px 14px 46px; }
  .page-head { margin-bottom: 14px; }
  .page-head h2 { font-size: 18px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; justify-content: center; }
}

/* ---------- landing nav ---------- */
.nav-toggle { display: none; }
.landing-nav .nav-links { display: flex; align-items: center; gap: 8px; }

@media (max-width: 960px) {
  .landing-nav .inner { flex-wrap: wrap; gap: 10px; }
  .nav-toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 40px; height: 40px; border-radius: var(--r-sm);
    border: 1px solid var(--line); background: var(--surface);
  }
  .nav-toggle svg { width: 19px; height: 19px; }

  .landing-nav .nav-links {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 8px; padding: 6px 0 4px;
  }
  .landing-nav .nav-links.open { display: flex; }
  .landing-nav .nav-links .btn { width: 100%; justify-content: center; }
}

/* ---------- phone-sized tweaks ---------- */
@media (max-width: 620px) {
  .brand b { font-size: 15px; }
  .brand span { display: none; }
  .brand-custom img { max-width: 140px; }

  .hero { padding: 26px 0 24px; }
  .hero h1 { font-size: 30px; line-height: 1.12; }
  .hero p.lead { font-size: 14.5px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .trust { gap: 10px; font-size: 12px; }

  .section-title h2 { font-size: 23px; }
  .block { padding: 36px 0; }

  .stat .value { font-size: 21px; }
  .totals-box { width: 100%; }
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .tabs { flex-wrap: wrap; }

  /* filter bars and toolbars stack instead of squeezing */
  .toolbar .sel, .toolbar .input { width: 100%; }

  .site-footer { padding: 32px 0 20px; }
  .footer-base { font-size: 12px; }
}

/* Nothing may push the page sideways. Wide things scroll inside their own box. */
html, body { max-width: 100%; overflow-x: hidden; }
.table-wrap { -webkit-overflow-scrolling: touch; }
img, svg, canvas, video { max-width: 100%; }
.mini-paper table, table.items { min-width: 0; }

/* The mobile bar already carries the theme switch — one is enough. */
@media (max-width: 900px) {
  .topbar .theme-switch { display: none; }
  .topbar { padding-top: 8px; padding-bottom: 8px; }
}

/* Stat tiles pair up on a phone instead of becoming a long column. */
@media (max-width: 620px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px; }
  .stat .ico { width: 30px; height: 30px; margin-bottom: 8px; }
  .stat .value { font-size: 18px; margin: 2px 0 3px; }
  .stat .label { font-size: 10px; }
  .stat .sub { font-size: 10.5px; }
}
@media (max-width: 380px) {
  .g4 { grid-template-columns: 1fr; }
}

/* ---------- Google sign-in ---------- */
.google-btn { gap: 10px; font-weight: 600; }
.google-btn:hover { border-color: var(--line-strong); color: var(--ink); }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--ink-3); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* ============================================================
   Grid items default to min-width:auto, so one wide child (a table)
   stretches its whole column past the screen. Letting them shrink is
   what makes the inner .table-wrap actually scroll.
   ============================================================ */
.split > *, .two > *, .grid > *, .g2 > *, .g3 > *, .g4 > *,
.shell > *, .builder > *, .cust > *, .price-grid > *,
.feature-grid > *, .step-row > *, .footer-cards > * { min-width: 0; }

.card, .stat, .fcard { min-width: 0; }

/* A table that cannot fit should scroll inside its own box, not clip. */
.table-wrap { overflow-x: auto; max-width: 100%; }

/* ============================================================
   Brand placement
   The logo artwork already carries the name, so the text beside it is
   a duplicate wherever space is tight.
   ============================================================ */

/* Login / register / forgot: centred logo only */
.auth-form .brand { justify-content: center; gap: 0; }
.auth-form .brand > div { display: none; }
.auth-form .brand img { height: 62px; max-width: 230px; }

/* Mobile top bar: logo sits left, next to the menu button */
.mobile-bar .brand > div { display: none; }
.mobile-bar .brand { margin-right: auto; }
.mobile-bar .brand img { height: 38px; max-width: 150px; }

@media (max-width: 960px) {
  /* Landing: logo left, menu button right, nothing in between */
  .landing-nav .brand > div { display: none; }
  .landing-nav .brand { margin-right: auto; }
  .landing-nav .inner .spacer { display: none; }
}

@media (max-width: 620px) {
  .auth-form .brand img { height: 54px; max-width: 200px; }
}

/* ============================================================
   Auth pages on small screens
   The animated banner is decoration; on a phone the form should lead.
   (An earlier `.auth-side { display: block }` was overriding the older
   media query — this restores the intent explicitly.)
   ============================================================ */
@media (max-width: 1100px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { padding: 30px 20px; }
  .auth-form .inner { max-width: 420px; }
}

/* ============================================================
   Landing container width
   1280px left wide monitors with large empty bands on both sides.
   The container now grows with the screen — clamp keeps the side
   gutter proportional instead of fixed, so it fills a 1080p or 1440p
   display while still leaving breathing room.
   ============================================================ */
.wrap-narrow,
.landing-nav .inner {
  width: 100%;
  max-width: 1800px;
  margin-inline: auto;
  padding-inline: clamp(18px, 2.4vw, 44px);
}
.landing-nav .inner { padding-block: 14px; }
.wrap-narrow { padding-block: 0; }

/* Long lines are hard to read, so body copy keeps its own limit
   even though the container is wider. */
.hero p.lead { max-width: 620px; }
.section-title { max-width: 680px; }

/* Six feature cards look better as 3 × 2 on a wide screen than stretched. */
@media (min-width: 1500px) {
  .feature-grid { gap: 20px; }
  .hero-grid { gap: 64px; }
}

@media (max-width: 900px) {
  .wrap-narrow, .landing-nav .inner { padding-inline: 18px; }
}


/* ============================================================
   Lead modal — first thing an ad visitor sees
   ============================================================ */
.lead-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lead-modal[hidden] { display: none; }
.lead-modal-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 22, .62); backdrop-filter: blur(5px); animation: fade .3s; }
.lead-modal-box {
  position: relative; z-index: 2; width: 100%; max-width: 880px; max-height: 92vh; overflow: auto;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1fr 1fr; animation: zoom .36s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes zoom { from { opacity: 0; transform: scale(.95) translateY(14px) } to { opacity: 1; transform: none } }

.lead-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: #0d1117; box-shadow: var(--shadow-sm);
}
.lead-modal-close svg { width: 17px; height: 17px; }

.lead-modal-side {
  background: linear-gradient(155deg, #0e3547, #17475f 45%, #17807a);
  color: #fff; padding: 30px 28px; display: flex; flex-direction: column; justify-content: center;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}
.lead-modal-side h3 { font-size: 23px; line-height: 1.2; margin: 12px 0 8px; letter-spacing: -.02em; }
.lead-modal-side p { font-size: 13.5px; opacity: .88; margin: 0; }
.lead-modal-points { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 10px; }
.lead-modal-points li { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; }
.lead-modal-points svg { width: 15px; height: 15px; color: #86efac; flex: 0 0 auto; margin-top: 2px; }

.lead-modal-form { padding: 28px 26px; }
.lead-modal-alt { display: block; text-align: center; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.lead-modal-alt:hover { color: var(--green); }

@media (max-width: 760px) {
  .lead-modal { padding: 0; align-items: flex-end; }
  .lead-modal-box { grid-template-columns: 1fr; max-height: 94vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .lead-modal-side { border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 22px 20px 18px; }
  .lead-modal-side h3 { font-size: 19px; }
  .lead-modal-points { display: none; }
  .lead-modal-form { padding: 20px; }
}

/* ============================================================
   Video slider
   ============================================================ */
.vslider { position: relative; display: flex; align-items: center; gap: 10px; }
.vtrack {
  display: flex; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; padding: 4px; flex: 1;
  scrollbar-width: none;
}
.vtrack::-webkit-scrollbar { display: none; }

.vcard {
  flex: 0 0 clamp(260px, 32%, 380px); scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: .25s var(--ease);
}
.vcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.vframe { position: relative; aspect-ratio: 16 / 9; background: #0b1016; }
.vframe video, .vframe iframe { width: 100%; height: 100%; border: 0; display: block; object-fit: cover; }
.vplay {
  width: 100%; height: 100%; display: grid; place-items: center;
  background-size: cover; background-position: center; cursor: pointer;
}
.vplay-icon {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: #0d1117; box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: transform .2s var(--ease);
}
.vplay:hover .vplay-icon { transform: scale(1.1); }
.vplay-icon svg { width: 26px; height: 26px; margin-left: 3px; }
.vmeta { padding: 14px 16px; }
.vmeta b { font-size: 14px; display: block; }
.vmeta p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }

.vnav {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: .2s var(--ease);
}
.vnav:hover { border-color: var(--green); color: var(--green); }
.vnav svg { width: 18px; height: 18px; }
/* `display: grid` above would beat the browser's own [hidden] rule, so the
   script could not hide the arrows when there is nothing to scroll. */
.vnav[hidden] { display: none; }

@media (max-width: 760px) {
  .vnav { display: none; }
  .vcard { flex-basis: 84%; }
}

/* ============================================================
   Blog
   ============================================================ */
.post-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; transition: .25s var(--ease); display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--green); }
.post-cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.post-body h3 { font-size: 16px; line-height: 1.3; }
.post-body h3 a:hover { color: var(--green); }
.post-body p { margin: 0; font-size: 13px; color: var(--ink-3); flex: 1; }
.post-meta { font-size: 11.5px; color: var(--ink-3); }

.post-content { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.post-content b, .post-content strong { color: var(--ink); }

/* third-party embed */
.lead-embed iframe { width: 100%; min-height: 460px; border: 0; }

/* ============================================================
   Clicks & traffic (admin)
   ============================================================ */
.barrow {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; margin-bottom: 6px; overflow: hidden;
  background: var(--surface-2);
}
.barrow:last-child { margin-bottom: 0; }
.barrow-fill {
  position: absolute; inset: 0 auto 0 0; background: rgba(16, 150, 94, .14);
  border-radius: 9px; transition: width .4s var(--ease);
}
.barrow-name {
  position: relative; flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barrow-total { position: relative; font-size: 13px; font-weight: 700; color: var(--ink-2); }

.daybars { display: flex; align-items: flex-end; gap: 4px; height: 170px; overflow-x: auto; }
.daybar { flex: 1 0 22px; min-width: 22px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.daybar-stack {
  flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  gap: 2px; min-height: 0;
}
.daybar-stack span { display: block; width: 100%; border-radius: 3px; min-height: 2px; }
.daybar-clicks { background: var(--teal); }
.daybar-views { background: var(--green); }
.daybar small { font-size: 10px; color: var(--ink-3); white-space: nowrap; }

.daybar-key { display: flex; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.daybar-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.daybar-key .k-views { background: var(--green); }
.daybar-key .k-clicks { background: var(--teal); }

@media (max-width: 760px) {
  .daybars { height: 140px; }
  .daybar small { display: none; }
}
