/* Sapheron Partners — partner.sapheron.com, in the Sapheron V2 design (the
   app's shell-v2 / overview-v2 tokens: Geist, olive frame, white rounded
   panel, soft cards). Self-contained so the partner site never breaks when
   an app page's CSS changes. */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --frame: #31372b; --frame-text: #f4f2e9; --frame-muted: #b9bcae; --frame-icon: #c6c9ba; --frame-hover: rgba(250,247,238,.08);
  --on: linear-gradient(180deg, #7b7f4e, #6d7044);
  --on-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 1px rgba(109,112,68,.35), 0 1px 2px rgba(0,0,0,.45);
  --text: #101010; --muted: #4a4a4a; --subtle: #616161; --line: #ebebeb; --card: #fff; --hover: rgba(0,0,0,.05);
  --canvas: #f6f6f1; --action: #6d7044; --action-hover: #5c5f39; --ring: rgba(109,112,68,.16); --ring-line: #a9ab7c;
  --count-bg: #eeefdc; --count: #55582f; --bad-bg: #fee9e7; --bad: #b42318; --good-bg: #e7f4ea; --good: #1f7a3a;
  --warn-bg: #fff4e0; --warn: #8a5a00;
  --shadow: 0 0 2px rgba(0,0,0,.24), 0 2px 12px rgba(0,0,0,.02), 0 4px 16px rgba(0,0,0,.02);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --text: #ededed; --muted: #c4c4c4; --subtle: #a0a0a0; --line: #363636; --card: #232323; --hover: rgba(255,255,255,.07);
  --canvas: #1a1a1a; --action: #7b7f4e; --action-hover: #8a8e5a; --ring: rgba(190,192,146,.2); --ring-line: #8a8e5a;
  --count-bg: #3b3d24; --count: #dfe1b5; --bad-bg: rgba(248,113,113,.18); --bad: #fca5a5; --good-bg: rgba(74,222,128,.14); --good: #86efac;
  --warn-bg: rgba(251,191,36,.15); --warn: #fcd34d;
  --shadow: 0 0 0 1px rgba(255,255,255,.07), 0 2px 12px rgba(0,0,0,.28);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 13px; line-height: 20px; letter-spacing: -.01em; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0; }
img { max-width: 100%; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; }
.muted { color: var(--subtle); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── buttons, inputs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--card); color: var(--text); font: 500 13px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.08); }
:root[data-theme="dark"] .btn { box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.btn:hover { background: var(--hover); }
.btn--primary { background: var(--action); color: #fff; box-shadow: none; }
.btn--primary:hover { background: var(--action-hover); }
.btn--danger { color: var(--bad); }
.btn--lg { height: 40px; padding: 0 20px; font-size: 14px; }
.btn--sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field__l { font-size: 12px; font-weight: 550; color: var(--muted); }
.field__h { font-size: 12px; color: var(--subtle); }
.in, .sel, .area { width: 100%; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 10px; background: var(--card); color: var(--text);
  font: 400 13px/20px var(--font); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.04); }
.area { min-height: 84px; resize: vertical; }
.in:focus, .sel:focus, .area:focus { outline: 0; box-shadow: 0 0 0 1px var(--ring-line), 0 0 0 4px var(--ring); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--action); }
.row2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { display: inline-flex; gap: 6px; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--card);
  box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.radios input { accent-color: var(--action); }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }

/* ── cards, tables, chips ── */
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 16px; }
.card__h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card__h h2 { font-size: 14px; font-weight: 550; }
.card__sub { font-size: 12px; color: var(--subtle); }
.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid--2, .grid--4 { grid-template-columns: 1fr 1fr; gap: 8px; } }
.stat { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px 18px; }
.stat__k { font-size: 12px; color: var(--subtle); }
.stat__v { margin-top: 4px; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.02em; }
.stat__s { margin-top: 2px; font-size: 12px; color: var(--subtle); }
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--subtle); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 8px; background: var(--count-bg); color: var(--count);
  font-size: 12px; font-weight: 450; white-space: nowrap; }
.chip--good { background: var(--good-bg); color: var(--good); }
.chip--bad { background: var(--bad-bg); color: var(--bad); }
.chip--warn { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 28px 10px; text-align: center; color: var(--subtle); }
.note { padding: 12px 16px; border-radius: 14px; background: var(--count-bg); color: var(--count); }
.note--bad { background: var(--bad-bg); color: var(--bad); }
.note + * { margin-top: 16px; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy .in { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--subtle); }
.kv dd { margin: 0; word-break: break-word; }
.list { margin: 0; padding-left: 18px; color: var(--muted); }
.list li + li { margin-top: 6px; }

/* ── toasts ── */
.toasts { position: fixed; z-index: 99; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: #1f2219; color: #f4f2e9; box-shadow: 0 8px 30px rgba(0,0,0,.25); font-size: 13px; }
.toast--bad { background: var(--bad); color: #fff; }

/* ── the app frame (dashboard + admin) ── */
.shell { display: flex; min-height: 100vh; background: var(--frame); }
.side { position: sticky; top: 0; width: 220px; height: 100vh; flex: none; display: flex; flex-direction: column; padding: 14px 10px 14px 12px; color: var(--frame-text); }
.side__mark { display: flex; align-items: center; gap: 1px; height: 32px; padding: 0 6px; margin-bottom: 14px; color: var(--frame-text); text-decoration: none; font-size: 17px; font-weight: 600; letter-spacing: -.03em; }
.side__mark img { height: 18px; }
.side__tag { margin-left: 8px; padding: 1px 7px; border-radius: 6px; background: var(--frame-hover); color: var(--frame-muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.side__id { padding: 10px; margin-bottom: 12px; border-radius: 12px; background: var(--frame-hover); }
.side__name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__sub { color: var(--frame-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: grid; gap: 2px; }
.nav__item { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 10px; color: var(--frame-text); text-decoration: none; font-weight: 450; }
.nav__item svg { width: 16px; height: 16px; color: var(--frame-icon); flex: none; }
.nav__item:hover { background: var(--frame-hover); }
.nav__item.is-on { background: var(--on); box-shadow: var(--on-shadow); }
.nav__item.is-on svg { color: #fff; }
.nav__sep { margin: 12px 10px 6px; color: var(--frame-muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.nav__count { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--frame); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.side__foot { margin-top: auto; display: grid; gap: 2px; }
.side__foot form { margin: 0; }
.side__foot button.nav__item { width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.main { flex: 1; min-width: 0; margin: 4px 4px 4px 0; border-radius: 16px; background: var(--canvas); overflow: hidden; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.topbar h1 { font-size: 14px; font-weight: 550; letter-spacing: -.01em; }
.topbar__acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: var(--subtle); cursor: pointer; }
.iconbtn:hover { background: var(--hover); color: var(--text); }
.burger { display: none; }
.content { padding: 20px; overflow: auto; }
.content > h2.sec { margin: 22px 0 10px; font-size: 13px; font-weight: 550; }
.drawer-back { display: none; }
@media (max-width: 860px) {
  .side { position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%); transition: transform 200ms cubic-bezier(.4,0,1,1); width: 264px; }
  .side.is-open { transform: none; transition: transform 250ms cubic-bezier(.22,1,.36,1); }
  .drawer-back.is-open { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); }
  .main { margin: 0; border-radius: 0; }
  .burger { display: inline-flex; }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
}

/* ── public pages (landing, sign-in, apply, agreement) ── */
.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pub__bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 max(16px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.pub__mark { display: flex; align-items: center; gap: 1px; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 600; letter-spacing: -.03em; }
.pub__mark img { height: 19px; }
.pub__mark .side__tag { background: var(--count-bg); color: var(--count); }
.pub__acts { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.pub__foot { margin-top: auto; padding: 28px 16px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; }
.pub__foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; }
.pub__foot a { color: var(--subtle); text-decoration: none; margin-left: 16px; }
.pub__foot a:hover { color: var(--text); }

.hero { background: var(--frame); color: var(--frame-text); padding: 72px 0 64px; }
.hero__eyebrow { display: inline-flex; gap: 8px; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px; background: var(--frame-hover); color: var(--frame-muted); font-size: 12px; font-weight: 500; }
.hero h1 { margin-top: 18px; font-size: clamp(32px, 5vw, 54px); line-height: 1.06; letter-spacing: -.035em; max-width: 780px; }
.hero h1 em { font-style: normal; color: #d8dab0; }
.hero p.lead { margin-top: 18px; max-width: 620px; font-size: 17px; line-height: 27px; color: var(--frame-muted); }
.hero__cta { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { box-shadow: none; }
.hero .btn:not(.btn--primary) { background: var(--frame-hover); color: var(--frame-text); }
.hero .btn--primary { background: #f4f2e9; color: var(--frame); }
.hero .btn--primary:hover { background: #fff; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 48px; border-radius: 18px; overflow: hidden; background: rgba(250,247,238,.12); }
.facts > div { padding: 18px 20px; background: var(--frame); }
.facts b { display: block; font-size: 24px; line-height: 30px; letter-spacing: -.02em; }
.facts span { color: var(--frame-muted); font-size: 12px; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } .hero { padding: 48px 0 40px; } }

.sect { padding: 64px 0 0; }
.sect h2 { font-size: clamp(22px, 3vw, 30px); line-height: 1.15; letter-spacing: -.03em; }
.sect p.sub { margin-top: 10px; max-width: 640px; color: var(--muted); font-size: 15px; line-height: 24px; }
.sect .grid { margin-top: 24px; }
.feat h3 { font-size: 15px; margin: 10px 0 6px; }
.feat p { color: var(--muted); }
.feat__n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; background: var(--count-bg); color: var(--count); font-weight: 600; }
.calc { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.calc__out { padding: 24px; border-radius: 18px; background: var(--frame); color: var(--frame-text); }
.calc__out b { display: block; font-size: 34px; line-height: 40px; letter-spacing: -.03em; }
.calc__out span { color: var(--frame-muted); }
.calc input[type=range] { width: 100%; accent-color: var(--action); }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.terms td:first-child { color: var(--subtle); width: 42%; }
.faq details { padding: 14px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 550; font-size: 14px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--subtle); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 8px; color: var(--muted); max-width: 820px; }
.cta-band { margin: 64px 0; padding: 36px; border-radius: 24px; background: var(--frame); color: var(--frame-text); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.cta-band h2 { font-size: 24px; }
.cta-band .btn--primary { background: #f4f2e9; color: var(--frame); }

.auth { flex: 1; display: grid; place-items: center; padding: 40px 16px; }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 22px; letter-spacing: -.03em; }
.auth__card p.sub { margin: 6px 0 20px; color: var(--subtle); }
.code-in { font-size: 22px; letter-spacing: .4em; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.formpage { padding: 40px 0 64px; }
.formpage .card { max-width: 760px; }
.formpage h1 { font-size: 26px; letter-spacing: -.03em; margin-bottom: 6px; }
.formpage .lead { color: var(--muted); margin-bottom: 22px; font-size: 14px; }
.formpage h2 { font-size: 14px; margin: 22px 0 12px; }
.legal { max-width: 820px; padding: 40px 0 64px; }
.legal h1 { font-size: 28px; letter-spacing: -.03em; }
.legal h2 { font-size: 16px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--muted); font-size: 14px; line-height: 23px; }
.legal p + p { margin-top: 10px; }
.legal ol, .legal ul { padding-left: 20px; margin: 8px 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.qr { width: 132px; height: 132px; border-radius: 12px; background: #fff; padding: 6px; box-shadow: 0 0 0 1px var(--line); }
