/* ───────────────────────────────────────────────────────────────────────────
   The public site.

   Its own stylesheet, not the console's. A marketing page has to render for
   somebody who has never signed in, on a phone, over a bad connection, and
   pulling in the console's layout system to do that would ship a signed-in
   application's CSS to every visitor. The TOKENS are deliberately the same
   values, so the two look like one product — but they are declared here,
   because the alternative is a marketing page that breaks when a console
   screen is restyled.

   Same four sizes as the console (FLAG-061): phone <640, tablet 640–1023,
   laptop 1024–1439, desktop 1440+. Full width, no centred column that throws
   away half a large screen — only the reading column of prose is capped,
   because a 200-character line is unreadable and that is a different rule.
   ─────────────────────────────────────────────────────────────────────────── */

:root {
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --bg: #ffffff;
  --panel: #f8fafc;
  --brand: #128c7e;
  --brand-ink: #0b5f55;
  --brand-wash: #e6f4f1;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --r: 12px;
  --r-sm: 8px;
  --gap: 20px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.04);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf5; --ink-2: #a9b6c9; --muted: #6b7a90;
    --line: #27303f; --line-2: #1b222e;
    --bg: #0d1117; --panel: #151b24;
    --brand: #25d366; --brand-ink: #7ae6a3; --brand-wash: #10251b;
    --shadow: 0 1px 2px rgba(0,0,0,.4);
  }
}
:root[data-theme="dark"] {
  --ink: #e8edf5; --ink-2: #a9b6c9; --muted: #6b7a90;
  --line: #27303f; --line-2: #1b222e;
  --bg: #0d1117; --panel: #151b24;
  --brand: #25d366; --brand-ink: #7ae6a3; --brand-wash: #10251b;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* No sideways scroll at any width. The one rule a marketing page breaks most
   often, usually with a wide table or an unbroken URL. */
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.015em; }
h1 { font-size: 40px; font-weight: 700; }
h2 { font-size: 27px; font-weight: 680; }
h3 { font-size: 18px; font-weight: 650; }
p { margin: 0 0 14px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

/* The page gutter. Full width, with breathing room that grows with the
   screen rather than a fixed column that wastes it. */
.wrap { padding: 0 20px; }
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; }
/* Prose only — see the header. Data and tables stay full width. */
.prose { max-width: 68ch; }

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 15px;
}
.brand .name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.top nav a {
  text-decoration: none; color: var(--ink-2); padding: 7px 11px;
  border-radius: var(--r-sm); font-size: 14px; font-weight: 550;
}
.top nav a:hover { background: var(--panel); color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); background: var(--panel); }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  color: var(--ink); background: var(--bg); cursor: pointer;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.lg { font-size: 16px; padding: 12px 22px; }

/* ── hero ───────────────────────────────────────────────────────────────── */
.hero { padding: 64px 0 48px; }
.hero h1 { max-width: 20ch; }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 60ch; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.hero .cta .muted { font-size: 14px; color: var(--muted); }

/* ── the split card: Meta's charge beside ours ──────────────────────────── */
.split {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.split > div { background: var(--bg); padding: 18px; }
.split .k { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.split .v { font-size: 26px; font-weight: 680; margin-top: 4px; font-variant-numeric: tabular-nums; }
.split .n { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.split .ours .v { color: var(--brand); }

/* ── feature grid ───────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  border: 1px solid var(--line); border-radius: var(--r); padding: 20px;
  background: var(--bg);
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-2); font-size: 15px; margin: 0; }
.card .tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-ink); background: var(--brand-wash);
  padding: 3px 7px; border-radius: 5px; margin-bottom: 9px;
}

/* ── plans ──────────────────────────────────────────────────────────────── */
.plans { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.plan {
  border: 1px solid var(--line); border-radius: var(--r); padding: 20px;
  display: flex; flex-direction: column; gap: 10px; background: var(--bg);
}
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan .pname { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.plan .price { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan .price span { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14px; color: var(--ink-2); }
.plan li::before { content: '✓'; color: var(--brand); font-weight: 700; margin-right: 7px; }
.plan .markup {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.plan .markup strong { color: var(--ink); }

/* ── the calculator ─────────────────────────────────────────────────────── */
.calc { display: grid; gap: var(--gap); grid-template-columns: minmax(260px, 340px) 1fr; align-items: start; }
/* A grid track refuses to shrink below the intrinsic width of its content
   unless it is told it may. Without this, the money table's own min-width
   pushes the track wider than the phone and takes the whole page sideways
   with it — the .scroll-x wrapper around the table does nothing, because the
   track never got narrow enough to need it. */
.calc > * { min-width: 0; }
.calc .controls { display: grid; gap: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field input, .field select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

table.bill { width: 100%; border-collapse: collapse; font-size: 15px; }
table.bill th, table.bill td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
table.bill td.n, table.bill th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.bill tr.total td { font-weight: 700; font-size: 17px; border-bottom: 0; }
table.bill tr.ours td { color: var(--brand); }
table.bill .why { font-size: 13px; color: var(--muted); display: block; font-weight: 400; }

.note {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--r-sm); padding: 13px 15px; font-size: 14px; color: var(--ink-2);
}
.note strong { color: var(--ink); }

/* ── the exit promise ───────────────────────────────────────────────────── */
.promise-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.promise-list li { padding-left: 30px; position: relative; }
.promise-list li::before {
  content: '→'; position: absolute; left: 0; top: 0;
  color: var(--brand); font-weight: 700;
}
.promise-list strong { display: block; }
.promise-list span { color: var(--ink-2); font-size: 15px; }

.foot {
  border-top: 1px solid var(--line); padding: 32px 20px 44px;
  color: var(--muted); font-size: 14px;
  display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline;
}
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--brand); }
.foot .sp { margin-left: auto; }

/* ── four sizes (FLAG-061) ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .calc { grid-template-columns: 1fr; }
}
@media (min-width: 1024px) {
  .wrap { padding: 0 40px; }
  .top { padding: 16px 40px; }
  .foot { padding: 36px 40px 48px; }
}
@media (min-width: 1440px) {
  .wrap { padding: 0 72px; }
  .top { padding: 18px 72px; }
  .foot { padding: 40px 72px 56px; }
  h1 { font-size: 48px; }
}
@media (max-width: 639px) {
  h1 { font-size: 30px; }
  h2 { font-size: 22px; }
  .hero { padding: 36px 0 28px; }
  .hero .lede { font-size: 17px; }
  .section { padding: 36px 0; }
  .top nav { width: 100%; margin-left: 0; order: 3; }
  .top nav a { padding: 6px 9px; font-size: 13px; }
  /* A money table on a 360px phone scrolls inside its own box rather than
     taking the page sideways with it. */
  .scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.bill { min-width: 420px; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  .hero h1 { max-width: 24ch; }
}

/* ── the status page ────────────────────────────────────────────────────────
   One state per component, said in a word and a sentence. The colour is never
   the only signal: every row carries its own text ("Operational", "Degraded"),
   because a page that distinguishes up from down by green and red alone is
   unreadable to the one visitor in twelve who cannot tell them apart — and
   because it still has to make sense printed or screenshotted into an email.
   ─────────────────────────────────────────────────────────────────────────── */
.eyebrow {
  margin: 0 0 6px; font-size: 13px; font-weight: 650; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.sub { color: var(--ink-2); margin: 0 0 var(--gap); font-size: 15px; }
.muted { color: var(--muted); font-size: 14px; }

.status-hero { padding: 40px 0 24px; }
.status-hero h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.dot {
  width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto;
  background: var(--muted); display: inline-block;
}
.lv-operational .dot { background: var(--good); }
.lv-degraded .dot    { background: var(--warn); }
.lv-outage .dot      { background: var(--bad); }
.lv-unknown .dot     { background: var(--muted); }

.comp {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--r); padding: 16px 18px;
  /* FLAG-061: a grid track will not shrink below its content without this,
     which is how a long component note takes the page sideways at 360px. */
  min-width: 0;
}
.comp .head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.comp h3 { margin: 0; font-size: 17px; }
.comp .state {
  margin-left: auto; font-size: 13px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.comp.lv-operational .state { color: var(--good); }
.comp.lv-degraded .state    { color: var(--warn); }
.comp.lv-outage .state      { color: var(--bad); }
.comp.lv-unknown .state     { color: var(--muted); }
.comp .note-line { margin: 0; color: var(--ink); font-size: 15px; }
.comp .what { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.bad-note {
  border-color: var(--bad); background: transparent; margin-bottom: var(--gap);
}
.bad-note strong { color: var(--bad); }

.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.notice-list li {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  border-radius: var(--r-sm); padding: 14px 16px; background: var(--panel);
  min-width: 0;
}
.notice-list li.sv-outage      { border-left-color: var(--bad); }
.notice-list li.sv-degraded    { border-left-color: var(--warn); }
.notice-list li.sv-maintenance { border-left-color: var(--brand); }
.notice-list li.closed { background: transparent; opacity: .82; }
.notice-list h3 { margin: 0 0 4px; font-size: 16px; }
.notice-list .when { font-size: 13px; color: var(--muted); }
.notice-list p { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }
.notice-list .fixed { margin-top: 8px; font-size: 14px; color: var(--ink); }
.notice-list .fixed strong { color: var(--good); }

@media (max-width: 639px) {
  .comp .state { margin-left: 0; }
  .status-hero { padding: 28px 0 20px; }
}

/* ── the help centre ────────────────────────────────────────────────────────
   A list of articles and one article at a time. The search box is the primary
   way in — a help centre people reach by browsing eleven collections is one
   where the answer is always two clicks further than their patience.
   ─────────────────────────────────────────────────────────────────────────── */
.help-hero { padding: 40px 0 24px; }

.search-wrap { position: relative; max-width: 620px; margin-top: 18px; }
.search-wrap input {
  width: 100%; padding: 13px 15px; font-size: 16px; font-family: inherit;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.search-wrap input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 4px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
  /* Scrollable rather than clipped: a suggestion list that silently drops its
     last entries is a list that hides the answer. */
  max-height: 60vh; overflow-y: auto;
}
.suggest li { margin: 0; }
.suggest li.empty { padding: 10px 11px; color: var(--muted); font-size: 14px; }
.suggest a {
  display: block; padding: 9px 11px; border-radius: 6px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.suggest a:hover, .suggest a:focus { background: var(--panel); }
.suggest .t { display: block; font-weight: 600; font-size: 15px; }
.suggest .c { display: block; font-size: 12px; color: var(--muted); }

.collection + .collection { margin-top: 36px; }
.article-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.article-list li { min-width: 0; }
.article-list a {
  display: block; height: 100%; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); text-decoration: none; color: var(--ink);
}
.article-list a:hover { border-color: var(--brand); }
.article-list .t { display: block; font-weight: 620; margin-bottom: 3px; }
.article-list .s { display: block; font-size: 14px; color: var(--ink-2); }

#article-view { max-width: 72ch; }
#article-view h1 { font-size: 32px; margin-bottom: 6px; }
#article-view h2 { font-size: 21px; margin: 28px 0 8px; }
#article-view h3 { font-size: 17px; margin: 22px 0 6px; }
#article-view p { font-size: 16px; color: var(--ink); margin: 0 0 14px; }
#article-view code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 5px;
}
.prose-list { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 7px; }
.prose-list li { font-size: 16px; }
#article-view .note { margin: 18px 0; }
#article-foot { margin-top: 32px; }
.back {
  display: inline-block; margin-bottom: 16px; font-size: 14px;
  text-decoration: none; color: var(--ink-2);
}
.back:hover { color: var(--brand); }

@media (max-width: 639px) {
  .help-hero { padding: 28px 0 18px; }
  #article-view h1 { font-size: 26px; }
  .search-wrap input { font-size: 16px; }
}

/* ── the roadmap ───────────────────────────────────────────────────────────
   Four groups, each with its heading and its meaning above the cards. The
   shipped group is the only one that carries a line about WHERE and WHEN —
   everywhere else the absence of a date is the page's argument, so there is
   deliberately no style for one. */
.rm-head { margin-bottom: 14px; }
.rm-head h2 { margin-bottom: 4px; }
.rm-card { display: flex; flex-direction: column; gap: 8px; }
.rm-since {
  margin-top: auto; padding-top: 8px; font-size: 13px; color: var(--ink-2);
  border-top: 1px solid var(--line); display: flex; align-items: center;
  flex-wrap: wrap; gap: 6px;
}
.rm-since .pill {
  font-size: 11.5px; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.rm-since .pill.ok { color: var(--brand); border-color: var(--brand); }
/* The groups that are not shipped read quieter, so the eye lands on what
   exists before it lands on what is promised. */
.rm-building .card, .rm-next .card, .rm-considering .card { background: transparent; }

/* ── the free tools ─────────────────────────────────────────────────────── */
/* A label that IS the field, so the control and its caption cannot be
   separated by a later edit — and so tapping the caption focuses the input,
   which on a phone is most of the target. */
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--ink-2); }
.field textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); resize: vertical;
}
.field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.tool { display: grid; gap: 14px; border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px; background: var(--bg); }
.tool > * { min-width: 0; }
.tool .row { display: grid; gap: 14px; grid-template-columns: 120px 1fr; }
.tool .row:has(.grow ~ .grow) { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
#link-problems:empty, #link-notes:empty { display: none; }
#link-problems > * + *, #link-notes > * + * { margin-top: 10px; }

.result { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); padding: 12px 14px; }
/* The link is the deliverable, so it wraps rather than scrolling out of
   sight: somebody is going to read it back against what they typed. */
.result code { flex: 1 1 260px; font-size: 14px; word-break: break-all; color: var(--ink); }
.copy {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); padding: 8px 14px;
}
.copy:disabled { opacity: .5; cursor: default; }

.qr-wrap { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 220px) 1fr;
  align-items: start; }
.qr-box { width: 100%; }
/* White behind the code in every theme. A QR inverted by a dark background
   is a QR that half the scanners on earth will not read. */
.qr-box svg { width: 100%; height: auto; display: block; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm); }
.qr-side { display: grid; gap: 10px; justify-items: start; }

.warnings { margin: 0; padding-left: 20px; display: grid; gap: 8px;
  font-size: 14px; color: var(--ink-2); }

.note.bad { border-color: var(--bad, #b42318); }

@media (max-width: 639px) {
  .tool .row { grid-template-columns: 100px 1fr; }
  .qr-wrap { grid-template-columns: 1fr; }
  .qr-box { max-width: 280px; }
}
