/* Fanout: one small stylesheet for the marketing pages and the app. No framework, no build step. */
:root {
  --brand: #168aad; --brand-dark: #0e6a87; --brand-tint: #e8f5f9;
  --ink: #1b2430; --muted: #5b6675; --line: #e3e8ee; --bg: #f7f9fb; --card: #fff;
  --ok: #1f8a4c; --ok-bg: #e9f7ef; --bad: #c0392b; --bad-bg: #fdecea; --warn: #8a5a00; --warn-bg: #fff6e0;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 14px rgba(16,24,40,.05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4cc0df; --brand-dark: #7fd3ea; --brand-tint: #14323b;
    --ink: #e8edf2; --muted: #9aa7b5; --line: #263340; --bg: #0f151b; --card: #161e26;
    --ok: #4cc382; --ok-bg: #12301f; --bad: #ff8b7e; --bad-bg: #3a1a17; --warn: #f0c36a; --warn-bg: #352a10;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.6;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
img, svg { max-width: 100%; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); letter-spacing: -.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { background: var(--brand-tint); padding: .1em .35em; border-radius: 5px; }
pre { background: #0f1720; color: #e6edf3; padding: 14px 16px; border-radius: 10px; overflow-x: auto; margin: 0 0 1em; line-height: 1.5; }
pre code { background: none; padding: 0; color: inherit; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 740px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* header / footer */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); text-decoration: none; font-size: .93rem; padding: 4px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a.btn, .nav a.btn:hover { color: #fff; }
@media (prefers-color-scheme: dark) { .nav a.btn, .nav a.btn:hover { color: #07202a; } }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 34px 0 40px; color: var(--muted); font-size: .9rem; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 24px; margin-bottom: 20px; }
.site-footer h4 { margin: 0 0 8px; color: var(--ink); font-size: .9rem; }
.site-footer a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.site-footer a:hover { color: var(--ink); }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); background: var(--brand);
  color: #fff; font: inherit; font-weight: 600; font-size: .95rem; padding: 10px 18px; border-radius: 10px; cursor: pointer; text-decoration: none; }
@media (prefers-color-scheme: dark) { .btn { color: #07202a; } }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--brand-tint); color: var(--ink); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 5px 11px; font-size: .84rem; border-radius: 8px; }
.btn.big { padding: 13px 24px; font-size: 1.02rem; border-radius: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.gbtn { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.gbtn:hover { background: #f6f8fa; color: #1f1f1f; border-color: #c6c9cc; }
label.field { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input[type=text], textarea, select { width: 100%; font: inherit; font-size: .95rem; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }

/* sections and cards */
.hero { padding: 64px 20px 40px; text-align: center; }  /* keep the 20px side gutter that .wrap gives */
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.4em; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.pill { display: inline-block; background: var(--brand-tint); color: var(--brand-dark); font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; margin-bottom: 14px; }
section.block { padding: 40px 0; }
section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 6px; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps { counter-reset: s; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); padding: 0; list-style: none; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 10px; }
@media (prefers-color-scheme: dark) { .steps li::before { color: #07202a; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--bg); }
td.yes { color: var(--ok); font-weight: 600; } td.no { color: var(--bad); }
.crumbs { font-size: .85rem; color: var(--muted); padding: 22px 0 0; }
.crumbs a { color: var(--muted); }
article.prose { padding: 8px 0 0; }
article.prose h1 { margin: 12px 0 8px; }
article.prose h2 { margin-top: 1.8em; }
article.prose ul, article.prose ol { padding-left: 1.3em; margin: 0 0 1em; }
article.prose li { margin-bottom: .35em; }
.byline { color: var(--muted); font-size: .88rem; margin-bottom: 1.4em; }
.callout { background: var(--brand-tint); border-radius: 12px; padding: 14px 18px; margin: 0 0 1.2em; }
.callout.warn { background: var(--warn-bg); color: var(--warn); }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 14px 18px; list-style-position: inside; }
details.faq div { padding: 0 18px 14px; color: var(--muted); }
details.faq div p:last-child { margin-bottom: 0; }
.cta-band { text-align: center; padding: 44px 20px; background: var(--brand-tint); border-radius: 18px; }

/* app */
.app-wrap { max-width: 860px; margin: 0 auto; padding: 22px 18px 0; }
.view { display: none; } .view.on { display: block; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-size: .93rem; color: var(--muted); padding: 10px 16px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.seg button { border: 0; background: none; font: inherit; font-size: .88rem; color: var(--muted); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 38px 20px; text-align: center; cursor: pointer; background: var(--card); }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-tint); }
.quota { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); }
.meter { width: 90px; height: 6px; background: var(--line); border-radius: 9px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 9px; transition: width .3s; }
.meter.low i { background: var(--bad); }
.user { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.user img { width: 28px; height: 28px; border-radius: 50%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; background: var(--brand-tint); color: var(--brand-dark); border: 0; border-radius: 99px; padding: 4px 11px; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--brand-tint); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; color: var(--brand-dark); line-height: 1.2; }
.stat span { font-size: .78rem; color: var(--muted); }
.notice { border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: .9rem; background: var(--brand-tint); }
.notice.ok { background: var(--ok-bg); color: var(--ok); } .notice.bad { background: var(--bad-bg); color: var(--bad); } .notice.warn { background: var(--warn-bg); color: var(--warn); }
.bar { height: 10px; background: var(--line); border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .25s; }
.log { background: #0f1720; border-radius: 10px; padding: 10px 12px; font: .78rem/1.5 ui-monospace, Menlo, monospace; max-height: 240px; overflow: auto; margin-top: 12px; color: #9fb0bf; }
.log .ok { color: #4cc382; } .log .bad { color: #ff8b7e; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #1b2430; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: .9rem; max-width: min(92vw, 420px); z-index: 50; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.bad { background: #b3261e; }
iframe.preview { width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 8px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .hero { padding: 40px 20px 28px; }
  .site-header .wrap { padding: 8px 16px; flex-wrap: wrap; }
  .quota .meter, #who { display: none; }
  #userbar { gap: 8px; margin-left: auto; }
}

/* landing: CSV -> template -> emails, three equal-height steps */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.flow-step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; position: relative; box-shadow: var(--shadow); }
.flow-label { margin: 0; font-weight: 600; font-size: .92rem; display: flex; align-items: center; gap: 8px; }
.flow-label span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .78rem; }
@media (prefers-color-scheme: dark) { .flow-label span { color: #07202a; } }
.flow-step pre { flex: 1; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); display: flex; flex-direction: column; justify-content: center; }
.mail b { font-size: .92rem; }
.mail small { color: var(--muted); font-size: .76rem; margin-bottom: 4px; overflow-wrap: anywhere; }
.mail p { margin: 0; font-size: .86rem; color: var(--ink); }
@media (min-width: 861px) { .flow-step + .flow-step::before { content: "\203A"; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 1.6rem; line-height: 1; } }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr; } }

/* sign-in card: even breathing room around the Google button */
.signin { max-width: 520px; margin: 40px auto; padding: 32px 24px; display: grid; justify-items: center; gap: 22px; text-align: center; }
.signin h1, .signin p { margin: 0; }
.signin .notice { width: 100%; }
@media (max-width: 640px) { .signin { margin: 24px 0; padding: 28px 20px; } }

@media (max-width: 640px) { br.wide-only { display: none; } }
