/* metarein components. Use only these on product pages; a new one is added here and listed in INDEX.md. */
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--paper); line-height: 1.55; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* logo: mark + lower-case wordmark */
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.35rem;
  letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.logo svg { width: 2rem; height: 2rem; flex: none; }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a:not(.btn) { text-decoration: none; font-weight: 600; color: var(--ink-2); }
@media (max-width: 640px) { .nav-links .hide-sm { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3rem;
  padding: .75rem 1.4rem; border: 2px solid var(--ink); border-radius: 999px; font: inherit; font-weight: 700;
  text-decoration: none; white-space: nowrap; cursor: pointer; background: var(--sun); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { background: var(--sun-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn-quiet { background: var(--paper); }
.btn-quiet:hover { background: var(--cream); }
.btn-sm { min-height: 2.5rem; padding: .4rem .9rem; font-size: .9rem; box-shadow: 0 3px 0 var(--ink); }

/* e-mail sign-up: a styled input + button, never a bare native control */
.signup { display: flex; flex-wrap: wrap; gap: .75rem; max-width: 30rem; margin: 0; }
.field { flex: 1 1 14rem; min-height: 3rem; padding: .75rem 1.1rem; border: 2px solid var(--ink); border-radius: 999px;
  font: inherit; color: var(--ink); background: var(--paper); }
.field::placeholder { color: var(--ink-2); }
.fine { font-size: .9rem; color: var(--ink-2); margin: .75rem 0 0; }

/* sections */
.section { padding: clamp(3rem, 8vw, 6rem) 0; }
.section-cream { background: var(--cream); }
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink a, .section-ink .fine, .section-ink .lead { color: var(--paper); }
.eyebrow { display: inline-block; font-weight: 800; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--sun); color: var(--ink); padding: .2rem .7rem; border-radius: 999px; margin: 0 0 1rem; }
.h1 { font-size: var(--t-hero); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1.25rem; font-weight: 850; }
.h2 { font-size: var(--t-h2); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 1rem; font-weight: 800; }
.h3 { font-size: 1.2rem; margin: 0 0 .4rem; font-weight: 750; }
.lead { font-size: var(--t-lead); color: var(--ink-2); margin: 0 0 1.75rem; max-width: 36rem; }
.mark { background: linear-gradient(transparent 60%, var(--sun) 60%); }

/* hero: copy + chat side by side, stacked on mobile */
.hero { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: center; padding-top: 2rem; padding-bottom: 4rem; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 3.5rem; padding-top: 4rem; padding-bottom: 6rem; } }

/* chat: the product's picture. A thread of messages with role avatars. */
.chat { margin: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden; }
.chat-head { padding: .75rem 1rem; border-bottom: 2px solid var(--ink);
  background: var(--cream); font-weight: 700; font-size: .95rem; }
.chat-head .topic { color: var(--ink-2); font-weight: 600; }
.chat-body { list-style: none; margin: 0; padding: .5rem 0; }
.msg { display: grid; grid-template-columns: 2.25rem 1fr; gap: .65rem; padding: .55rem 1rem; }
.msg-who { font-weight: 750; font-size: .92rem; }
.msg-who small { font-weight: 600; color: var(--ink-2); margin-left: .35rem; }
.msg-text { margin: .1rem 0 0; font-size: .95rem; }
.chat-table-wrap { overflow-x: auto; margin: .3rem 0 0; }
.chat-table { border-collapse: collapse; font-size: .85rem; }
.chat-table th, .chat-table td { border: 1px solid var(--ink-2); padding: .25rem .5rem; text-align: left; }
.msg-owner { background: #fffbef; }
.avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center;
  font-weight: 800; font-size: .85rem; background: var(--role-owner); }
.avatar[data-role="pm"] { background: var(--role-pm); }
.avatar[data-role="arch"] { background: var(--role-arch); }
.avatar[data-role="dev"] { background: var(--role-dev); }
.avatar[data-role="review"] { background: var(--role-review); }
.avatar[data-role="ops"] { background: var(--role-ops); }
.avatar[data-role="design"] { background: var(--role-design); }

/* badges: status tokens only */
.badge { display: inline-block; font-size: .78rem; font-weight: 750; padding: .1rem .55rem; border-radius: 999px; margin-left: .25rem;
  vertical-align: 1px; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

/* cards and grids */
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); list-style: none; margin: 2rem 0 0; padding: 0; }
.card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); padding: 1.4rem; }
.card p { margin: 0; color: var(--ink-2); }
.card .avatar { width: 3rem; height: 3rem; font-size: 1.05rem; margin-bottom: .9rem; }

/* numbered steps */
.steps { counter-reset: step; }
.step { position: relative; padding-top: 3.4rem; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 1.4rem; left: 1.4rem;
  width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink);
  display: grid; place-items: center; font-weight: 850; }
.step.card { padding-top: 4.4rem; }

/* big number for proof */
.stat { font-size: clamp(3rem, 9vw, 5.5rem); font-weight: 900; line-height: 1; letter-spacing: -.04em; color: var(--sun); margin: 0; }

/* plain checklists */
.ticks { list-style: none; padding: 0; margin: 1rem 0 0; }
.ticks li { position: relative; padding-left: 1.9rem; margin: .6rem 0; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .35rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: var(--sun); border: 2px solid var(--ink); }

.footer { padding-top: 2rem; padding-bottom: 3rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--ink-2); font-size: .9rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); } /* six role cards as 3×2, not 4+2 */
.card-wide { grid-column: 1 / -1; border-style: dashed; background: var(--paper); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1rem 0 0; padding: 0; }
.chip { border: 2px solid var(--ink); border-radius: 999px; padding: .3rem .85rem; font-weight: 700; font-size: .92rem; background: var(--cream); }
.chip-add { background: var(--sun); }

/* ---- app (control plane) ---- */
.appbar { display: flex; align-items: center; gap: 1rem; padding-top: .75rem; padding-bottom: .75rem; border-bottom: 2px solid var(--ink); }
.appbar .team-name { font-weight: 750; color: var(--ink-2); margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app { padding-top: 1.5rem; padding-bottom: 3rem; display: grid; gap: 1.5rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.row-between { justify-content: space-between; }
.facts { display: grid; gap: .4rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); list-style: none; margin: 1rem 0; padding: 0; color: var(--ink-2); }
.facts strong { color: var(--ink); }

/* status pill: dot + word, status tokens only */
.status { display: inline-flex; align-items: center; gap: .4rem; font-weight: 750; font-size: .88rem; padding: .15rem .65rem;
  border-radius: 999px; background: var(--cream); color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.status-ok { background: var(--ok-bg); color: var(--ok); }
.status-bad { background: var(--bad-bg); color: var(--bad); }
.status-warn { background: var(--warn-bg); color: var(--warn); }

/* something needs the owner */
.notice { border: 2px solid var(--ink); border-left-width: .6rem; border-radius: var(--r); padding: 1rem 1.25rem; background: var(--warn-bg); }
.notice-bad { background: var(--bad-bg); }
.notice p { margin: .2rem 0 .75rem; }

/* one teammate */
.members { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .75rem; }
.member { display: grid; grid-template-columns: 3rem 1fr auto; gap: .25rem 1rem; align-items: center; background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--r); padding: .9rem 1rem; }
.member .avatar { width: 3rem; height: 3rem; grid-row: span 2; }
.member-name { font-weight: 800; }
.member-name small { font-weight: 600; color: var(--ink-2); margin-left: .35rem; }
.member-meta { color: var(--ink-2); font-size: .92rem; grid-column: 2; }
.member-side { grid-row: 1 / span 2; grid-column: 3; display: flex; align-items: center; gap: .5rem; }
@media (max-width: 560px) { .member { grid-template-columns: 2.5rem 1fr; } .member .avatar { width: 2.5rem; height: 2.5rem; }
  .member-side { grid-column: 1 / -1; grid-row: auto; justify-content: space-between; } }

/* per-card menu: a styled details, no native look */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 2; min-width: 15rem; list-style: none; margin: 0; padding: .35rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); box-shadow: 4px 4px 0 var(--ink); }
.menu-list a { display: block; padding: .5rem .75rem; border-radius: 8px; text-decoration: none; font-weight: 650; }
.menu-list a:hover { background: var(--cream); }
.menu-list .danger { color: var(--bad); }

/* setup progress */
.progress { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .6rem; }
.progress li { display: grid; grid-template-columns: 2rem 1fr; gap: .75rem; align-items: start; }
.progress li::before { content: ""; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper); }
.progress .done::before { background: var(--role-dev); }
.progress .now::before { background: var(--sun); }
.progress .now { font-weight: 750; }
.progress .now::before { border-top-color: var(--paper); animation: progress-spin 1s linear infinite; } /* the step working now turns */
@keyframes progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .progress .now::before { animation: none; border-top-color: var(--ink); } }
.progress.stopped .now::before { animation: none; border-top-color: var(--ink); } /* nothing moves once a step stopped */
.progress .todo { color: var(--ink-2); }

/* chat composer */
.composer { display: flex; gap: .75rem; align-items: flex-end; padding: .75rem 1rem; border-top: 2px solid var(--ink); background: var(--cream); }
.field-area { flex: 1; min-height: 3rem; padding: .7rem 1rem; border: 2px solid var(--ink); border-radius: var(--r); font: inherit; resize: vertical;
  color: var(--ink); background: var(--paper); }
.msg-agent { background: var(--paper); }

/* collapsed operator detail */
.more { border: 2px dashed var(--line); border-radius: var(--r); padding: .75rem 1rem; }
.more > summary { cursor: pointer; font-weight: 750; color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; transform: none; }
.app.hero { align-items: start; }
.avatar[data-role="agent"] { background: var(--ink); color: var(--paper); }

/* progress step that needs the owner now: its action sits under the label */
.progress .now > div > .row { margin-top: .6rem; }
.progress small { display: block; font-weight: 500; color: var(--ink-2); }

/* panel: a sheet over the dashboard (right side on desktop, full width on mobile) */
.panel { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-lg); box-shadow: 8px 8px 0 var(--ink);
  max-width: 34rem; width: 100%; justify-self: end; display: grid; gap: 1.1rem; padding: 1.4rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-head .h3 { margin: 0; }
.panel-foot { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; border-top: 2px solid var(--line); padding-top: 1rem; }
.scrim { background: rgba(29, 35, 64, .35); }

/* choice cards: a hidden radio + a styled label, no native look */
.options { border: 0; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.options > legend { font-weight: 800; margin-bottom: .5rem; padding: 0; }
.option { display: block; border: 2px solid var(--ink); border-radius: var(--r); padding: .7rem .9rem; cursor: pointer; background: var(--paper); }
.option small { display: block; color: var(--ink-2); font-weight: 500; }
.option:has(input:checked) { background: var(--cream); box-shadow: inset 0 0 0 2px var(--ink), 0 3px 0 var(--ink); }
.option:has(input:checked) strong::after { content: " ✓"; }
.option:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.label { display: block; font-weight: 800; margin-bottom: .4rem; }
.field-box { width: 100%; border-radius: var(--r); }

/* the AI tool's own sign-in terminal, collapsed by default */
.term { background: var(--ink); color: var(--paper); font: .85rem/1.5 var(--mono); border-radius: var(--r); padding: .9rem 1rem; margin: .75rem 0 0; overflow-x: auto; white-space: pre-wrap; }
@media (max-width: 560px) { .panel { box-shadow: 4px 4px 0 var(--ink); padding: 1.1rem; } }
.term-tall { min-height: 22rem; margin: 0; }
.option-off { border-style: dashed; color: var(--ink-2); cursor: default; }
.options > legend small { display: block; margin: 0; font-weight: 500; }
.app-narrow { max-width: 32rem; } /* sign-in: one short column */
.stack { display: grid; gap: 1rem; }

/* choices inside a chat message (DB10): explicit checkbox cards and the button that sends them */
.msg-choices { margin-top: .7rem; }
.msg-choices.options { grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.repo-list { grid-template-columns: minmax(0, 1fr); min-width: 0; max-height: 12rem; overflow-y: auto; margin: .5rem 0; }
.repo-list .option { min-width: 0; overflow-wrap: anywhere; }
.repo-list [hidden] { display: none; }
.repo-search { display: block; width: 100%; margin-top: .5rem; }
.option-check { position: relative; padding-left: 2.6rem; }
.option-check::before { content: ""; position: absolute; left: .8rem; top: .8rem; width: 1.1rem; height: 1.1rem; border: 2px solid var(--ink); border-radius: 5px; background: var(--paper); }
.option-check:has(input:checked)::before { content: "✓"; background: var(--ink); color: var(--paper); font: 800 .8rem/1.1rem var(--font); text-align: center; }
.option-check:has(input:checked) strong::after { content: none; }
.option:has(input:disabled) { cursor: default; }

/* labelled on/off switch (DB12, DB13): a button role="switch", the track drawn before its label; on = --ok */
.switch { display: inline-flex; align-items: center; gap: .65rem; padding: 0; border: 0; background: none; font: inherit; font-weight: 750; color: var(--ink); cursor: pointer; text-align: left; }
.switch::before { content: ""; flex: none; width: 2.9rem; height: 1.6rem; border: 2px solid var(--ink); border-radius: 999px;
  background: radial-gradient(circle at .78rem 50%, var(--ink) .45rem, transparent .5rem) var(--paper); }
.switch[aria-checked="true"]::before { background: radial-gradient(circle at calc(100% - .78rem) 50%, var(--paper) .45rem, transparent .5rem) var(--ok); }
.switch:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 999px; }
.term-code { white-space: pre; } /* exact JSON (DB12): scroll sideways, never break a value */
.app > .card { min-width: 0; } /* a grid item: lets a wide term-code scroll instead of widening the page */
/* plan card controls (DB14): the model line is a menu picker that may wrap; a lone ✕ keeps the top-right corner on mobile */
.member > div { min-width: 0; }
.member-meta .menu { display: inline-block; vertical-align: middle; }
.member-meta .menu-list { left: 0; right: auto; }
.member-meta .menu > summary { white-space: normal; text-align: left; min-height: 2.5rem; border-radius: var(--r); }
@media (max-width: 560px) { .member:has(.member-side > :only-child) { grid-template-columns: 2.5rem minmax(0, 1fr) auto; }
  .member-side:has(> :only-child) { grid-column: 3; grid-row: 1 / span 2; } }
/* team chat in the app (DB15, DB16): a folded panel at the end of a card, numbered steps inside */
.card > .more { margin-top: 1rem; }
.app-steps { margin: .75rem 0 0; padding-left: 1.4rem; }
.app-steps > li + li { margin-top: .9rem; }
.app-steps .row, .app-steps [role="status"] { margin-top: .5rem; }
.app-steps strong { overflow-wrap: break-word; } /* the server address breaks after a dot (<wbr>), never mid-word */
