/* The Wren account page. Colours follow apps/web/src/styles/tokens.css. */
/* BEGIN GENERATED from design/tokens/colors.json by design/tokens/build.mjs. Edit the JSON, then run the script. */
:root {
  /* Surfaces: the page is warm grey paper, panes and cards are white. */
  --wren-bg: #f3f2ef;
  --wren-bg-card: #ffffff;
  --wren-bg-sunken: #efede9;
  --wren-bg-hover: #e8e6e1;

  /* Borders */
  --wren-border: #e3e0da; /* hairline, decorative */
  --wren-border-input: #8a847a; /* form fields and controls, 3:1 */

  /* Text */
  --wren-ink: #1d1a17; /* headings, the bird, the wordmark */
  --wren-text: #45413b; /* body text */
  --wren-text-muted: #6b665e; /* secondary text, timestamps, overdue days */
  --wren-on-ink: #f6f3ee; /* words on an ink fill (the primary button) */

  /* Links are ink and underlined; focus is a 2px ink ring with a 2px gap. */
  --wren-link: #1d1a17;
  --wren-focus: #1d1a17;

  /* The decision card: the one inverse object on screen, the bird as its seal. Ink on a light page, paper on a dark one. */
  --wren-decision-bg: #1d1a17;
  --wren-decision-text: #f6f3ee;
  --wren-decision-muted: #b9b2a7; /* secondary words on the card */
  --wren-decision-line: #6e675e; /* the outlined Edit draft, 3:1 */
  --wren-decision-cta: #f6f3ee; /* Send: the inverse of the card */
  --wren-decision-on-cta: #1d1a17;

  /* Status: green done and red failed are the only colours, always with a ✓ / ✕ and words. Warning and info are neutral. */
  --wren-success-text: #2b7a3b;
  --wren-success-border: #a9d2b1; /* an outlined done pill (decorative: the ✓ and the word carry it) */
  --wren-danger: #b3261e;
  --wren-danger-bg: #f9e6e3;
  --wren-danger-text: #b3261e;
  --wren-danger-border: #eab8b1; /* an outlined failed pill (decorative: the ✕ and the word carry it) */
}
@media (prefers-color-scheme: dark) {
  :root {
    /* Surfaces: the page is warm grey paper, panes and cards are white. */
    --wren-bg: #161412;
    --wren-bg-card: #201d1a;
    --wren-bg-sunken: #100e0c;
    --wren-bg-hover: #332f2a;

    /* Borders */
    --wren-border: #34302b; /* hairline, decorative */
    --wren-border-input: #7a7369; /* form fields and controls, 3:1 */

    /* Text */
    --wren-ink: #f2efea; /* headings, the bird, the wordmark */
    --wren-text: #cfc9c0; /* body text */
    --wren-text-muted: #a39d93; /* secondary text, timestamps, overdue days */
    --wren-on-ink: #161412; /* words on an ink fill (the primary button) */

    /* Links are ink and underlined; focus is a 2px ink ring with a 2px gap. */
    --wren-link: #f2efea;
    --wren-focus: #f2efea;

    /* The decision card: the one inverse object on screen, the bird as its seal. Ink on a light page, paper on a dark one. */
    --wren-decision-bg: #f2efea;
    --wren-decision-text: #1d1a17;
    --wren-decision-muted: #5f594f; /* secondary words on the card */
    --wren-decision-line: #8f887d; /* the outlined Edit draft, 3:1 */
    --wren-decision-cta: #1d1a17; /* Send: the inverse of the card */
    --wren-decision-on-cta: #f6f3ee;

    /* Status: green done and red failed are the only colours, always with a ✓ / ✕ and words. Warning and info are neutral. */
    --wren-success-text: #7fd08e;
    --wren-success-border: #355f3e; /* an outlined done pill (decorative: the ✓ and the word carry it) */
    --wren-danger: #ff8f80;
    --wren-danger-bg: #3a201b;
    --wren-danger-text: #ff8f80;
    --wren-danger-border: #6b3029; /* an outlined failed pill (decorative: the ✕ and the word carry it) */
  }
}
/* END GENERATED */
:root {
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wren-bg);
  color: var(--wren-text);
  font: 15px/1.5 var(--font);
}
[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 8px;
}
/* The bird (a static mark, ink) beside the word. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wren-ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand svg { display: block; width: 22px; height: auto; flex: none; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--wren-text-muted); font-size: 14px; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; }
.foot { max-width: 640px; margin: 0 auto; padding: 0 16px 32px; color: var(--wren-text-muted); font-size: 13px; }
.foot a { color: var(--wren-text-muted); }

h1 { color: var(--wren-ink); font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; margin: 16px 0 6px; }
/* Focused by script after each view change so screen readers announce it;
   it is not a control, so no ring. */
h1:focus { outline: none; }
h2 { color: var(--wren-ink); font-size: 17px; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--wren-text-muted); }
.lead { color: var(--wren-text-muted); margin-bottom: 20px; }

.card {
  background: var(--wren-bg-card);
  border: 1px solid var(--wren-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 14px;
}
.card.done { background: transparent; }
.card.locked { opacity: 0.6; }
.step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

/* Status pills: outlined, with the mark and the word. Done is green, a
   problem is red; everything else is neutral. */
.badge {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--wren-border);
  color: var(--wren-text-muted);
}
.badge.ok { color: var(--wren-success-text); border-color: var(--wren-success-border); }
.badge.ok::before { content: "\2713\00a0"; }
.badge.warn { color: var(--wren-danger-text); border-color: var(--wren-danger-border); }
.badge.warn::before { content: "\2715\00a0"; }

form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
label { color: var(--wren-ink); font-size: 14px; font-weight: 500; }
.hint { color: var(--wren-text-muted); font-size: 13px; font-weight: 400; }
a { color: var(--wren-link); text-decoration: underline; text-underline-offset: 2px; }
input {
  width: 100%;
  font: inherit;
  color: var(--wren-ink);
  background: var(--wren-bg-card);
  border: 1px solid var(--wren-border-input);
  border-radius: 8px;
  padding: 10px 12px;
}
input:focus { outline: none; box-shadow: 0 0 0 2px var(--wren-bg-card), 0 0 0 4px var(--wren-focus); }
.slug { display: flex; align-items: stretch; }
.slug input { border-radius: 8px 0 0 8px; min-width: 0; }
.slug .suffix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--wren-border-input);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--wren-bg-sunken);
  color: var(--wren-text-muted);
  white-space: nowrap;
}

button {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  cursor: pointer;
}
button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--wren-bg-card), 0 0 0 4px var(--wren-focus); }
button:disabled { opacity: 0.55; cursor: default; }
.primary { background: var(--wren-ink); color: var(--wren-on-ink); }
.primary:hover:not(:disabled) { background: var(--wren-text); }
.secondary { background: transparent; color: var(--wren-ink); border-color: var(--wren-border-input); }
.secondary:hover:not(:disabled) { background: var(--wren-bg-sunken); }
.danger { background: var(--wren-danger); color: var(--wren-on-ink); }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--wren-link);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Notices: a problem keeps its light red tint; everything else is neutral. */
.notice { border-radius: 8px; padding: 10px 12px; margin: 0 0 14px; font-size: 14px; border: 1px solid var(--wren-border); background: var(--wren-bg-sunken); color: var(--wren-ink); }
.notice.ok { background: transparent; color: var(--wren-success-text); border-color: var(--wren-success-border); }
.notice.ok::before { content: "\2713\00a0"; font-weight: 600; }
.notice.error { background: var(--wren-danger-bg); color: var(--wren-danger-text); border-color: var(--wren-danger-border); }
.notice.error::before { content: "\2715\00a0"; font-weight: 600; }

.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--wren-border);
  border-radius: 10px;
  padding: 16px;
  background: var(--wren-bg);
}
.plan .price { color: var(--wren-ink); font-size: 20px; font-weight: 600; }
.plan .trial { color: var(--wren-success-text); font-size: 13px; font-weight: 600; }
.plan .trial::before { content: "\2713\00a0"; }
.plan button { margin-top: auto; }

/* PRICING-01: who provides the AI, picked beside the plan. */
.ai-choices { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.ai-choices legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.ai-option { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--wren-border); border-radius: 10px; padding: 10px 12px; background: var(--wren-bg); cursor: pointer; }
.ai-option:has(input:checked) { border-color: var(--wren-ink); }
.ai-option input[type="radio"] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--wren-ink); }
.ai-option .ai-price { color: var(--wren-ink); font-weight: 600; }
.ai-option .ai-detail { display: block; font-size: 14px; }

.code {
  font: 600 30px/1.2 var(--mono);
  letter-spacing: 0.08em;
  color: var(--wren-ink);
  background: var(--wren-bg-sunken);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  margin: 8px 0 12px;
  user-select: all;
}
ol.steps { margin: 0 0 12px; padding-left: 20px; }
ol.steps li { margin-bottom: 4px; }
.addr { font-family: var(--mono); font-size: 14px; color: var(--wren-ink); word-break: break-all; }

details.danger-zone { margin-top: 28px; }
details.danger-zone summary { cursor: pointer; color: var(--wren-text-muted); font-size: 14px; }
details.danger-zone .card { margin-top: 12px; border-color: var(--wren-danger-border); }

.switch { margin-top: 16px; font-size: 14px; color: var(--wren-text-muted); }

.passkey-sign-in { display: grid; gap: 10px; margin-top: 14px; }
.passkey-sign-in .or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--wren-text-muted);
  font-size: 13px;
}
.passkey-sign-in .or::before, .passkey-sign-in .or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--wren-border);
}
ul.passkeys { list-style: none; margin: 4px 0 14px; padding: 0; }
ul.passkeys li { border-top: 1px solid var(--wren-border); padding: 12px 0; }
ul.passkeys li:first-child { border-top: 0; padding-top: 4px; }
.passkey { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.passkey > div { min-width: 0; }
.passkey-name { color: var(--wren-ink); font-weight: 500; overflow-wrap: anywhere; }
.passkey-remove { margin-top: 12px; }
details.add-passkey summary { cursor: pointer; color: var(--wren-link); font-weight: 500; margin-bottom: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The one step that needs the owner is the one inverse card on the page
   (account.js marks at most one). Ink on a light page, paper on a dark one. */
.card.needs-action {
  background: var(--wren-decision-bg);
  color: var(--wren-decision-text);
  border-color: var(--wren-decision-bg);
  border-radius: 14px;
  padding: 28px;
}
.card.needs-action h2,
.card.needs-action label { color: var(--wren-decision-text); }
.card.needs-action .muted,
.card.needs-action .hint { color: var(--wren-decision-muted); }
.card.needs-action .badge { color: var(--wren-decision-muted); border-color: var(--wren-decision-line); }
.card.needs-action .badge.warn { color: var(--wren-decision-text); }
.card.needs-action a,
.card.needs-action .link,
.card.needs-action .addr { color: var(--wren-decision-text); }
.card.needs-action input {
  background: transparent;
  color: var(--wren-decision-text);
  border-color: var(--wren-decision-line);
}
.card.needs-action input:focus,
.card.needs-action button:focus-visible,
.card.needs-action a:focus-visible {
  box-shadow: 0 0 0 2px var(--wren-decision-bg), 0 0 0 4px var(--wren-decision-text);
}
.card.needs-action .slug .suffix {
  background: transparent;
  color: var(--wren-decision-muted);
  border-color: var(--wren-decision-line);
}
.card.needs-action .primary { background: var(--wren-decision-cta); color: var(--wren-decision-on-cta); }
.card.needs-action .primary:hover:not(:disabled) { background: var(--wren-decision-text); }
.card.needs-action .secondary { background: transparent; color: var(--wren-decision-text); border-color: var(--wren-decision-line); }
.card.needs-action .secondary:hover:not(:disabled) { background: transparent; border-color: var(--wren-decision-muted); }
.card.needs-action .code { background: transparent; color: var(--wren-decision-text); border: 1px solid var(--wren-decision-line); }
.card.needs-action .notice { background: transparent; color: var(--wren-decision-text); border-color: var(--wren-decision-line); }
.card.needs-action .plan { background: transparent; border-color: var(--wren-decision-line); }
.card.needs-action .plan .price { color: var(--wren-decision-text); }
.card.needs-action .plan .trial { color: var(--wren-decision-muted); }
.card.needs-action .ai-choices legend,
.card.needs-action .ai-option .ai-price { color: var(--wren-decision-text); }
.card.needs-action .ai-option { background: transparent; border-color: var(--wren-decision-line); }
.card.needs-action .ai-option:has(input:checked) { border-color: var(--wren-decision-text); }
.card.needs-action .ai-option input[type="radio"] { accent-color: var(--wren-decision-cta); }

@media (max-width: 480px) {
  h1 { font-size: 22px; }
  .card { padding: 16px; }
  .card.needs-action { padding: 20px; }
  .code { font-size: 24px; }
}

/* The agreement box at sign-up: one line, the box first, links in the text. */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.45; cursor: pointer; }
.consent input[type="checkbox"] { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--wren-ink); }
.consent span { color: var(--wren-text); }

/* INSTALL-01 S2: the Wren Setup download and the linked computers. */
a.button { display: inline-block; font-weight: 600; border-radius: 8px; padding: 10px 16px; border: 1px solid transparent; text-decoration: none; }
ul.installs { list-style: none; margin: 14px 0; padding: 0; }
ul.installs li { border-top: 1px solid var(--wren-border); padding: 12px 0; }
ul.installs li:first-child { border-top: 0; padding-top: 4px; }
.install { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.install-name { color: var(--wren-ink); font-weight: 600; }
.card.needs-action a.button.primary { color: var(--wren-decision-on-cta); }
