/* RevCite design system: one stylesheet for the marketing site and the app. */
:root {
  --ink: #0b1324;
  --ink-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e4e7ec;
  --line-2: #f0f2f5;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --brand: #4338ca;
  --brand-ink: #3730a3;
  --brand-soft: #eef2ff;
  --brand-line: #c7d2fe;
  --navy: #0b1324;
  --good: #067647; --good-bg: #ecfdf3; --good-line: #abefc6;
  --bad: #b42318; --bad-bg: #fef3f2; --bad-line: #fecdca;
  --warn: #93370d; --warn-bg: #fffaeb; --warn-line: #fedf89;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 20px 40px -12px rgba(16, 24, 40, .18);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.55 var(--font); color: var(--ink); background: var(--bg);
       -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 4px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px;
  padding: 0 14px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover, button:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: none; box-shadow: 0 0 0 4px rgba(67, 56, 202, .18); }
.btn.secondary, button.secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.secondary:hover, button.secondary:hover { background: var(--bg); }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover, button.ghost:hover { background: var(--line-2); }
.btn.danger, button.danger { background: var(--surface); color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover, button.danger:hover { background: var(--bad-bg); }
button.link { height: auto; padding: 0; background: none; border: 0; color: var(--muted); font-weight: 500; box-shadow: none; }
button.link:hover { color: var(--bad); background: none; }
.btn.lg, button.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn.sm, button.sm { height: 32px; padding: 0 10px; font-size: 13px; }
button:disabled, .btn[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; font-size: 13px; color: var(--ink-2); margin: 0 0 6px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=file], textarea, select {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 14px var(--font); color: var(--ink); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
input[type=file] { padding: 7px 10px; height: auto; color: var(--muted); }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-line); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; margin: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer; }
.checks input { accent-color: var(--brand); width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.span2 { grid-column: 1 / -1; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 20px; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px 0; }
.card-h p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.card-b { padding: 18px 22px 22px; }
.card-f { padding: 14px 22px; border-top: 1px solid var(--line); background: #fcfcfd; border-radius: 0 0 var(--radius) var(--radius);
  display: flex; justify-content: flex-end; gap: 8px; }
.card.flush .card-b { padding: 0; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: #fcfcfd; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 22px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 22px; }
.row-title { font-weight: 550; color: var(--ink); }

/* ---------- badges, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.badge.good { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 20px;
  border: 1px solid var(--good-line); background: var(--good-bg); color: var(--good); font-weight: 500; }
.alert.err { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad); }
.alert.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.alert svg { flex: none; margin-top: 2px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--surface) 247px, var(--line) 247px, var(--line) 248px, var(--bg) 248px); }
.side { background: var(--surface); border-right: 1px solid var(--line); align-self: start; padding: 20px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo img { width: 28px; height: 28px; }
.side .logo { padding: 0 8px 22px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: var(--line-2); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand-ink); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav .label { font-size: 11.5px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 16px 10px 6px; }
.nav .brand-link { font-weight: 450; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 14px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center;
  font-weight: 600; font-size: 13px; flex: none; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.side-foot .who .muted { font-size: 12px; }
.main { min-width: 0; }
.topbar { display: none; }
.page { max-width: 1120px; padding: 32px 40px 60px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 0 0 24px; overflow-x: auto; }
.tabs a { padding: 0 2px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tabs .count { font-size: 12px; color: var(--faint); margin-left: 4px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.stat .v .badge { font-size: 11.5px; letter-spacing: 0; }

.empty { text-align: center; padding: 44px 20px; }
.empty .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { font-size: 15px; }
.empty p { color: var(--muted); max-width: 380px; margin: 4px auto 16px; }

.conn { display: flex; gap: 14px; align-items: flex-start; }
.conn-logo { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; flex: none; background: #fff; }
.upload-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 16px; align-items: center; padding: 16px 22px; border-top: 1px solid var(--line-2); }
.upload-row:first-child { border-top: 0; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth-panel { background: var(--navy); color: #cbd5e1; padding: 40px 56px; display: flex; flex-direction: column;
  background-image: radial-gradient(circle at 80% 10%, rgba(99, 102, 241, .35), transparent 45%), radial-gradient(circle at 10% 90%, rgba(56, 189, 248, .12), transparent 40%); }
.auth-panel .logo { color: #fff; }
.auth-panel blockquote { margin: auto 0; font-size: 22px; line-height: 1.45; color: #fff; font-weight: 500; letter-spacing: -.01em; max-width: 460px; }
.auth-panel blockquote small { display: block; margin-top: 16px; font-size: 14px; color: #94a3b8; font-weight: 400; }
.auth-panel .foot { font-size: 13px; color: #64748b; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 26px; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin-bottom: 28px; }
.auth-form button[type=submit], .auth-form .full { width: 100%; height: 42px; }
.auth-form .alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* ---------- marketing ---------- */
.mk-nav { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); }
.mk-nav .in { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.mk-nav .links { display: flex; gap: 24px; }
.mk-nav .links a { color: var(--ink-2); font-weight: 500; }
.mk-nav .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.mk-body { background: var(--surface); }
.hero { padding: 80px 0 64px; background: linear-gradient(180deg, #f5f6ff 0%, #fff 70%); border-bottom: 1px solid var(--line-2); }
.hero .grid { display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--brand-ink);
  background: var(--brand-soft); border: 1px solid var(--brand-line); padding: 4px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-size: 50px; line-height: 1.06; letter-spacing: -.035em; font-weight: 700; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); margin-bottom: 28px; max-width: 540px; }
.hero .trust { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 28px; color: var(--muted); font-size: 13.5px; }
.hero .trust span { display: inline-flex; gap: 6px; align-items: center; }
.mock { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mock-top { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: #fcfcfd; align-items: center; }
.mock-top i { width: 10px; height: 10px; border-radius: 50%; background: #e4e7ec; display: block; }
.mock-top span { margin-left: 10px; font-size: 12px; color: var(--muted); }
.mock-b { padding: 22px; }
.mock .kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 18px; }
.mock .kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.mock .kpi .k { font-size: 11.5px; color: var(--muted); }
.mock .kpi .v { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.mock .bars .r { display: grid; grid-template-columns: 84px 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.mock .bars .t { height: 10px; background: var(--line-2); border-radius: 4px; overflow: hidden; }
.mock .bars .f { height: 100%; background: var(--brand); border-radius: 0 4px 4px 0; }
.mock .bars .r:not(:first-child) .f { background: #a5b4fc; }
.mock .lost { border-top: 1px solid var(--line-2); margin-top: 14px; padding-top: 12px; font-size: 12.5px; }
.mock .lost div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
section.mk { padding: 88px 0; border-bottom: 1px solid var(--line-2); }
section.mk.alt { background: var(--bg); }
.mk-h { max-width: 640px; margin-bottom: 44px; }
.mk-h .k { font-size: 13px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.mk-h h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.03em; font-weight: 700; margin-bottom: 14px; }
.mk-h p { font-size: 17px; color: var(--ink-2); }
.feature { padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.feature .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.feature h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature p { color: var(--ink-2); margin: 0; }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 52px; margin-bottom: 26px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { color: var(--ink-2); margin: 0; }
.mtable { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.mtable td { padding: 18px 22px; vertical-align: top; }
.mtable td:first-child { width: 30%; font-weight: 600; }
.cta { background: var(--navy); color: #cbd5e1; border-radius: 20px; padding: 56px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px;
  background-image: radial-gradient(circle at 90% 0%, rgba(99, 102, 241, .4), transparent 50%); }
.cta h2 { color: #fff; font-size: 32px; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 14px; }
.cta ul { padding: 0; margin: 20px 0 0; list-style: none; }
.cta li { display: flex; gap: 10px; margin-bottom: 10px; }
.cta form { background: #fff; border-radius: 14px; padding: 26px; color: var(--ink); }
.mk-foot { padding: 36px 0 44px; color: var(--muted); font-size: 13.5px; }
.mk-foot .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.mk-foot a { color: var(--muted); margin-left: 18px; }
.prose { max-width: 720px; }
.prose h2 { font-size: 17px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .hero .grid, .cta { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .grid4, .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; background: var(--bg); }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5; overflow-x: auto; }
  .topbar .logo { margin-right: auto; }
  .topbar a:not(.logo) { color: var(--ink-2); font-weight: 500; white-space: nowrap; }
  .page { padding: 22px 16px 48px; }
  .auth { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .grid2, .grid3, .upload-row { grid-template-columns: 1fr; }
  .mk-nav .links { display: none; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 34px; }
  section.mk { padding: 56px 0; }
  .mk-h h2 { font-size: 27px; }
  .cta { padding: 28px 20px; border-radius: 16px; }
  .card-h, .card-b { padding-left: 16px; padding-right: 16px; }
  .wrap { padding: 0 16px; }
}
@media (max-width: 520px) {
  .stats, .grid4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mock .kpis { grid-template-columns: 1fr 1fr; }
  .mk-nav .right .secondary { display: none; }
}
[id] { scroll-margin-top: 84px; }
