/* The public trust pages, /status and /changelog, rendered by src/status.ts and src/changelog.ts.
   Tokens come from base.css. Calm and plain: one column, state always named in words as well as colour,
   the 90-day bars are decoration over a text summary. No scripts on these pages. */

:root {
  --st-ok: var(--ok);
  --st-slow: var(--warn);
  --st-down: var(--danger);
  --st-none: var(--raised);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --st-slow: #a86a00; --st-none: #dfe1e5; }
}
:root[data-theme="light"] { --st-slow: #a86a00; --st-none: #dfe1e5; }

/* header and footer, matching the content pages */
.tp-bar { position: sticky; top: 0; z-index: 100; background: color-mix(in srgb, var(--ground) 86%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--line); }
.tp-bar-in { display: flex; align-items: center; gap: var(--s-4); height: 64px; }
.tp-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: -0.01em; }
.tp-brand img { width: 20px; height: 22px; }
.tp-nav { display: flex; gap: var(--s-1); margin-left: auto; }
.tp-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-control); font-size: 13.5px; font-weight: 500; color: var(--body); transition: color var(--t-1) var(--ease); }
.tp-nav a:hover, .tp-nav a[aria-current="page"] { color: var(--text); }
/* on a phone the way into the builder stays: the mark stands for the name, and Status and Changelog wait in the footer */
@media (max-width: 480px) { .tp-bar-in { gap: var(--s-2); } .tp-brand span { display: none; } .tp-nav a { padding: 0 8px; } .tp-nav a:nth-last-child(-n+2) { display: none; } }

.tp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-4); padding-top: var(--s-6); padding-bottom: var(--s-7); border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.tp-foot nav { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.tp-foot a:hover { color: var(--text); }

.tp-page { max-width: 820px; padding-top: var(--s-7); padding-bottom: var(--s-8); }
.tp-head { margin-bottom: var(--s-7); }
.tp-head h1 { margin: 0 0 var(--s-4); font-size: clamp(38px, 5.6vw, 64px); line-height: 1; letter-spacing: -0.022em; font-weight: 500; }
.lede { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.55; max-width: 62ch; }
.tp-note { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: 16px; line-height: 1.6; max-width: 64ch; }
.tp-note h2 { font-size: 20px; margin-bottom: var(--s-3); }
.tp-note p + p { margin-top: var(--s-3); }
.tp-note a, .lede a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.tp-note a:hover { text-decoration-color: var(--text); }

/* ---------------- status ---------------- */
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
/* the dot sits in the title's first line, so a title that wraps on a phone lines up with the text under it */
.st-title { display: block; }
.st-title .st-dot { width: 14px; height: 14px; margin-right: 16px; vertical-align: 0.18em; }
.st-title.st-operational .st-dot { color: var(--st-ok); box-shadow: 0 0 0 6px color-mix(in srgb, var(--st-ok) 18%, transparent); }
.st-title.st-degraded .st-dot { color: var(--st-slow); box-shadow: 0 0 0 6px color-mix(in srgb, var(--st-slow) 18%, transparent); }
.st-title.st-down .st-dot { color: var(--st-down); box-shadow: 0 0 0 6px color-mix(in srgb, var(--st-down) 18%, transparent); }

.st-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.st-row { padding: var(--s-5) 0; }
.st-row + .st-row { border-top: 1px solid var(--line); }
.st-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.st-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.005em; }
.st-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: var(--r-control); background: var(--raised); color: var(--text); font-size: 13.5px; font-weight: 500; }
.st-pill.st-operational .st-dot { color: var(--st-ok); }
.st-pill.st-degraded .st-dot { color: var(--st-slow); }
.st-pill.st-down .st-dot { color: var(--st-down); }
.st-ms { color: var(--muted); font-weight: 400; }
.st-what { margin-top: var(--s-2); font-size: 14.5px; color: var(--muted); max-width: 64ch; }

.st-bar { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 32px; margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.st-bar li { border-radius: 3px; background: var(--st-none); }
.st-bar .st-operational { background: var(--st-ok); }
.st-bar .st-degraded { background: var(--st-slow); }
.st-bar .st-down { background: var(--st-down); }
@media (max-width: 560px) { .st-bar { gap: 1px; height: 28px; } }
.st-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.st-sum { margin-top: var(--s-2); font-size: 14.5px; color: var(--body); font-variant-numeric: tabular-nums; }

.st-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-4) 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); }
.st-legend li { display: inline-flex; align-items: center; gap: 8px; }
.st-key { width: 12px; height: 12px; border-radius: 4px; background: var(--st-none); }
.st-key.st-operational { background: var(--st-ok); }
.st-key.st-degraded { background: var(--st-slow); }
.st-key.st-down { background: var(--st-down); }

/* ---------------- changelog ---------------- */
.cl-feed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin-top: var(--s-5); font-size: 13.5px; color: var(--muted); }
.cl-day { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--s-5); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.cl-day + .cl-day { margin-top: var(--s-7); }
.cl-day > h2 { position: sticky; top: 88px; align-self: start; font-size: 14.5px; font-weight: 500; color: var(--muted); }
@media (max-width: 720px) { .cl-day { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); } .cl-day > h2 { position: static; } }
.cl-entry { scroll-margin-top: 88px; font-size: 16.5px; line-height: 1.6; }
.cl-entry + .cl-entry { margin-top: var(--s-7); }
.cl-entry h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.25; letter-spacing: -0.01em; margin-bottom: var(--s-2); }
.cl-entry h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.cl-entry ul { margin: var(--s-3) 0 0; padding-left: 1.2em; }
.cl-entry li + li { margin-top: var(--s-2); }
.cl-entry li::marker { color: var(--muted); }
.cl-tag { display: inline-flex; align-items: center; min-height: 26px; margin-bottom: var(--s-3); padding: 0 10px; border-radius: var(--r-control); font-size: 12.5px; font-weight: 500; color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--hair-2), var(--edge); }

@media (prefers-reduced-motion: reduce) { .tp-nav a { transition: none; } }

/* the business pages (src/legal.ts): pricing plans, long-form legal text, the contact form */
/* /pricing follows x.ai's: a centred title, an Individual / Teams switch, then the plans as cards in one row,
   each with its price and a full-width button on top and what it adds below. The switch is radios + :has(). */
.tp-wide { max-width: var(--col); }
.tp-wide > .tp-note { max-width: 820px; margin-inline: auto; }
.pr-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: var(--s-6); }
.pr-head h1 { margin-bottom: var(--s-3); }
.pr-sub { font-size: clamp(17px, 1.6vw, 19px); color: var(--text); }
.pr-head .lede { margin-top: var(--s-4); font-size: 15px; color: var(--muted); max-width: 60ch; }
.pr-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: max-content; margin: 0 auto var(--s-6); padding: 4px; border: 1px solid var(--hair-2); border-radius: var(--r-control); }
.pr-seg label { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 20px; border-radius: var(--r-control); font-size: var(--fs-1); font-weight: 500; color: var(--muted); cursor: pointer; transition: color var(--t-2) var(--ease); }
.pr-seg label:hover { color: var(--text); }
.pr-seg input:checked + label { color: var(--btn1-text); }
.pr-seg input:focus-visible + label { outline: 2px solid var(--text); outline-offset: 2px; }
/* the white pill slides under the chosen side; both sides are the same width, so it moves by its own width */
.pr-seg::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: var(--r-control); background: var(--btn1-face); -webkit-backdrop-filter: var(--btn-glass); backdrop-filter: var(--btn-glass); box-shadow: var(--btn1-ring); transition: translate var(--t-3) var(--ease-snap); }
.pr-seg:has(#pr-for-team:checked)::before { translate: 100% 0; }
@supports not selector(:has(*)) { .pr-seg::before { display: none; } .pr-seg input:checked + label { background: var(--btn1-face); -webkit-backdrop-filter: var(--btn-glass); backdrop-filter: var(--btn-glass); box-shadow: var(--btn1-ring); } }
.pr-switch:has(#pr-for-you:checked) .pr-team, .pr-switch:has(#pr-for-team:checked) .pr-you { display: none; }
/* switching rows: the cards that appear rise and fade in, one after another. Only while the switch has focus
   (clicking a side focuses its radio; tabbing on to a card stops it, with no visible change), so the first paint on page load never waits on an animation. */
@keyframes pr-card-in { from { opacity: 0; translate: 0 14px; filter: blur(4px); } }
.pr-switch:has(.pr-seg input:focus) .pr-plan { animation: pr-card-in var(--t-3) var(--ease-reveal) both; }
.pr-switch:has(.pr-seg input:focus) .pr-plan:nth-child(2) { animation-delay: 50ms; }
.pr-switch:has(.pr-seg input:focus) .pr-plan:nth-child(3) { animation-delay: 100ms; }
@media (prefers-reduced-motion: reduce) { .pr-seg::before { transition: none; } .pr-switch:has(.pr-seg input:focus) .pr-plan { animation: none; } }
.pr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--s-5); row-gap: var(--s-4); }
.pr-team { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; margin-inline: auto; }
/* side by side, the cards share seven rows (name, price, button, fine print, headline, "everything in", list) so they line up */
.pr-plan { grid-row: span 7; display: grid; grid-template-rows: subgrid; align-content: start; }
@media (max-width: 900px) { .pr-you { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; row-gap: var(--s-5); } .pr-you .pr-plan { display: flex; } .pr-you .pr-plan > :empty { display: none; } }
@media (max-width: 680px) { .pr-team { grid-template-columns: 1fr; max-width: 520px; row-gap: var(--s-5); } .pr-team .pr-plan { display: flex; } .pr-team .pr-plan > :empty { display: none; } }
/* the hover spotlight in motion.css sets the background shorthand; keep the card's fill under it */
.site .pr-plan { background-color: var(--surface); }
.pr-plan { position: relative; flex-direction: column; gap: var(--s-4); padding: var(--s-5); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--hair); }
.pr-hi { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pen) 45%, var(--line)); }
.pr-name { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 24px; }
.pr-plan h2 { font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: 0; }
.pr-amt { font-size: 44px; line-height: 1.1; font-weight: 500; letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums; }
.pr-amt small { margin-left: 4px; font-size: 13.5px; font-weight: 450; color: var(--muted); letter-spacing: 0; }
.pr-plan .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.3; }
.pr-fine { margin: -8px 0 0; min-height: 0; font-size: 13px; color: var(--muted); text-align: center; }
.pr-fine-err { color: var(--danger); }
/* a paid plan's way down, on the Free card (src/legal.ts): Downgrade, or once cancelled, when it ends and Resume */
.pr-act { display: grid; }
.pr-down-note { display: grid; gap: var(--s-2); }
.pr-down-note p { margin: 0; }
[data-cancel-row][data-state="on"] .pr-cancelled, [data-cancel-row][data-state="on"] .pr-resume, [data-cancel-row][data-state="cancelled"] [data-cancel-open] { display: none; }
/* under Upgrade: "downgrade first" while the plan runs, "it ends on …" once it's cancelled */
.pr-switch:has([data-cancel-row][data-state="on"]) .pr-switch-off, .pr-switch:has([data-cancel-row][data-state="cancelled"]) .pr-switch-on { display: none; }
.pr-cancel-msg:empty { display: none; }
.btn-danger { background: color-mix(in srgb, var(--danger) 82%, #000); color: #fff; }
.btn-danger:not(:disabled):hover { background: var(--danger); box-shadow: none; }
/* the card's Cancel: the plain white button, slimmer than the plan buttons; the red one stays for the dialog's confirm */
.pr-dlg { width: min(440px, calc(100vw - 32px)); margin: auto; padding: var(--s-5); border: 0; border-radius: var(--r-card); background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair), var(--edge); }
.pr-dlg::backdrop { background: rgba(0, 0, 0, 0.62); }
.pr-dlg h2 { margin: 0 0 var(--s-2); font-size: 19px; font-weight: 600; letter-spacing: 0; }
.pr-dlg p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--body); }
.pr-dlg .pr-cancel-msg { margin-top: var(--s-3); font-size: 13px; }
.pr-dlg-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }
@media (max-width: 480px) { .pr-dlg-acts { flex-direction: column-reverse; } .pr-dlg-acts .btn { width: 100%; } }
.pr-for { font-size: 16px; line-height: 1.4; color: var(--body); }
.pr-adds { font-size: 14px; color: var(--muted); }
.pr-plan .ticks { margin: 0; padding: 0; list-style: none; display: grid; align-content: start; gap: var(--s-3); font-size: 14.5px; line-height: 1.5; }
.pr-plan .ticks li { display: flex; gap: 12px; align-items: baseline; }
.pr-plan .ticks li::before { content: ""; flex: none; width: 14px; height: 14px; align-self: flex-start; margin-top: 0.22em; background: var(--ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.4l3.6 3.6L15.5 6.2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.4l3.6 3.6L15.5 6.2'/%3E%3C/svg%3E") center / contain no-repeat; } /* the set's check (icons.js) */
.lg-updated { margin-top: var(--s-3); font-size: 13.5px; color: var(--muted); }
.lg { max-width: 68ch; font-size: 16px; line-height: 1.65; }
.lg h2 { margin: var(--s-7) 0 var(--s-3); font-size: 21px; letter-spacing: -0.01em; }
.lg p + p, .lg ul + p, .lg p + ul { margin-top: var(--s-3); }
.lg ul { display: grid; gap: var(--s-2); padding-left: 1.2em; list-style: disc; }
.lg a, .lg-small a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--muted); }
.lg-form { display: grid; gap: var(--s-4); max-width: 620px; }
.lg-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
@media (max-width: 560px) { .lg-row { grid-template-columns: 1fr; } }
.lg-form label { display: grid; gap: var(--s-2); font-size: 14px; font-weight: 500; color: var(--text); }
.lg-form input, .lg-form select, .lg-form textarea { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--hair); box-shadow: var(--edge-in); background: var(--surface); color: var(--text); font: 400 16px/1.5 var(--font); }
.lg-form textarea { resize: vertical; min-height: 160px; }
.lg-form input:focus-visible, .lg-form select:focus-visible, .lg-form textarea:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.lg-form .btn { justify-self: start; }
.lg-small { font-size: 13.5px; color: var(--muted); }
.lg-msg { max-width: 620px; margin-bottom: var(--s-5); padding: var(--s-4) var(--s-5); border-radius: 16px; font-size: 15px; border: 1px solid var(--hair); box-shadow: var(--edge); background: var(--surface); }
.lg-ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.lg-bad { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.tag-new { padding: 4px 9px; border-radius: var(--r-control); font-size: 11.5px; line-height: 1; font-weight: 600; color: color-mix(in srgb, var(--ok) 72%, var(--text)); background: color-mix(in srgb, var(--ok) 16%, transparent); }
