/* Shared page styles for the menu pages: How it works, Make a PCOC, Admission gate,
   Verify, Apps, Learn, Technical. Loaded after verify.css and nav.css. */

/* Two-column cards */
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); gap: 1rem; max-width: 56rem; margin: 1.25rem 0; }
.pair > div { padding: 1.1rem 1.2rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.pair h3 { margin: 0 0 0.4rem; font-size: 1.1rem; letter-spacing: 0; text-transform: none; opacity: 1; }
.pair p { margin: 0.3rem 0 0; line-height: 1.55; }
.pair dl { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.35rem 0.75rem; margin: 0.6rem 0 0; }
.pair dt { margin: 0; text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--muted); }
.pair dd { margin: 0; font-family: inherit; font-size: 0.98rem; }

/* Architecture figures: a wide drawing on desktop, a tall one on phones */
.arch { width: 100%; max-width: 56rem; margin: 1.5rem 0 2rem; }
.arch svg { width: 100%; height: auto; display: block; }
.arch .narrow { display: none; max-width: 100%; }
@media (max-width: 720px) { .arch .wide { display: none; } .arch .narrow { display: block; } }
.arch figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; max-width: 40rem; }

.principles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 0.75rem; max-width: 56rem; }
.principles li { padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: 10px; }
.principles strong { display: block; margin-bottom: 0.25rem; }
.principles span { color: var(--text-soft); font-size: 0.97rem; line-height: 1.5; }
.mech { max-width: none; padding-left: 1.2rem; }
.mech li { margin: 0 0 0.9rem; line-height: 1.6; }

/* Platform and language tabs. Apps platform tabs share one width.
   Language tabs on Make stay sized to their labels. */
.platforms { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 1.25rem; }
.platforms button { min-height: 44px; padding: 0 1.15rem; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-soft); font: 600 0.98rem/1 var(--font-sans); cursor: pointer; }
main.works > .platforms:not(.lang-tabs) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
main.works > .platforms:not(.lang-tabs) button { width: 100%; padding: 0 0.4rem; }
@media (max-width: 640px) {
  main.works > .platforms:not(.lang-tabs) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
main.works a.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0.35rem 0 0.85rem; }
.platforms button[aria-selected="true"] { border-color: var(--accent); color: var(--text-strong); background: var(--tint); }
.platforms button:hover { border-color: var(--btn-border-hover); }
main.works section.app-panel { margin: 0; }
.app-panel[hidden] { display: none; }
.lang-tabs { margin: 1rem 0 0.75rem; }

/* Apps: download buttons */
.formats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 0.9rem; }
.fmt { display: flex; flex-direction: column; justify-content: center; min-width: min(12rem, 100%); min-height: 64px; padding: 0.7rem 1.2rem; border-radius: 12px; text-decoration: none; border: 1px solid var(--border); color: var(--text); }
.fmt strong { font-size: 1.1rem; }
.fmt small { font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
a.fmt.main { background: var(--cta-bg); border-color: var(--cta-bg); color: var(--cta-text); }
a.fmt.main small { color: var(--cta-text); opacity: 0.85; }
.fmt.soon { border-style: dashed; }
.release-line { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 1rem; }
.app-details { max-width: 44rem; }
.facts { display: grid; grid-template-columns: 7rem 1fr; gap: 0.35rem 0.9rem; max-width: 44rem; margin: 0.75rem 0 1rem; font-size: 0.95rem; }
.facts dt { margin: 0; color: var(--muted); font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
.facts dd { margin: 0; font-family: inherit; overflow-wrap: anywhere; }
.facts code { font-size: 0.82rem; }
details.more { max-width: 46rem; margin: 1.5rem 0; }
details.more > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; min-height: 44px; display: flex; align-items: center; gap: 0.5rem; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "\25B8"; color: var(--accent-text); font-size: 0.9em; }
details.more[open] > summary::before { content: "\25BE"; }
.poster { display: inline-flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0 1rem; text-decoration: none; }
.poster img { width: 16rem; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--border); }

/* Learn hub */
.learn-section { margin: 2.5rem 0 0; }
.learn-section .section-time { color: var(--muted); font-weight: 500; font-size: 0.95rem; margin: -0.35rem 0 0.9rem; }
.hub-list { list-style: none; padding: 0; max-width: 44rem; }
.hub-list li { margin: 0 0 1.2rem; line-height: 1.6; }
.hub-list a { font-weight: 600; }
.hub-list .gloss { display: block; color: var(--text-soft); margin-top: 0.2rem; }
.hub-list .reading-time { color: var(--muted); }

/* Copy-paste setup blocks */
.setup { max-width: 46rem; margin: 1.25rem 0 2rem; }
.setup-meta { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.3rem 0.9rem; margin: 0 0 0.5rem; padding: 0.9rem 1.1rem; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; font-size: 0.95rem; }
.setup-meta dt { margin: 0; color: var(--muted); font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
.setup-meta dd { margin: 0; font-family: inherit; }
.tested-line { margin: 0 0 1.25rem; font-size: 0.88rem; color: var(--muted); }
.step { margin: 0 0 1.5rem; }
h3.step-h { margin: 0 0 0.4rem; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; text-transform: none; opacity: 1; color: var(--text-strong); }
.step > p { margin: 0 0 0.6rem; line-height: 1.6; }
.cmd { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0 0 0.5rem; }
.cmd pre { flex: 1 1 auto; min-width: 0; }
.cmd pre, pre.expect { margin: 0; padding: 0.85rem 1rem; background: var(--code-bg, var(--panel)); border: 1px solid var(--border); border-radius: 8px; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; }
.cmd code, pre.expect code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; background: none; padding: 0; border: 0; color: var(--text-strong); }
.cmd .copy-btn { flex: none; min-width: 4.6rem; align-self: stretch; max-height: 3.4rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: 600 0.85rem/1 var(--font-sans); cursor: pointer; }
.cmd .copy-btn:hover { border-color: var(--btn-border-hover); }
.cmd .copy-btn.done { border-color: var(--accent); }
.expect-label { margin: 0.4rem 0 0.3rem; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
pre.expect { border-style: dashed; background: transparent; }
pre.expect code { color: var(--text-soft); }

/* How it works: who runs each part */
.who-runs { border-collapse: collapse; max-width: 52rem; width: 100%; margin: 1rem 0; font-size: 0.96rem; }
.who-runs th, .who-runs td { white-space: normal; text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.who-runs th { color: var(--muted); font-weight: 600; font-size: 0.88rem; }

@media (max-width: 720px) {
  .setup-meta, .facts { grid-template-columns: 1fr; }
  .setup-meta dt, .facts dt { margin-top: 0.4rem; }
}

/* Short links in tables and cards keep a 24px tap height on phones. */
.who-runs a, .pair dd a, .facts dd a, main.doc p.fine a { display: inline-block; padding: 0.25rem 0; }

/* Leads keep the reading column. */
main.works > .lead, main.see > .lead { max-width: none; }
figure.diagram.roomy { max-width: 100%; }

/* Home, bots-first (21 Oct): the way-in row, the per-audience blocks, smaller pictures. */
main.home .way-in-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.45rem; margin: 1rem 0 0; max-width: 40rem; font-size: 0.92rem; color: var(--text-soft); }
main.home .way-in-row span { font-weight: 600; margin-right: 0.15rem; }
main.home .way-in-row a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.7rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 550; }
main.home .way-in-row a:hover { border-color: var(--accent); }
/* Tiles share the page column. A short last row stretches instead of leaving an empty cell. */
main.home .ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 0.85rem; max-width: none; margin: 1rem 0 0; }
main.home .way { display: flex; flex-direction: column; overflow-wrap: break-word; }
main.home .way { padding: 1rem 1.1rem 0.6rem; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; scroll-margin-top: 5.75rem; }
main.home .way:target { border-color: var(--accent); }
main.home .way h3,
main.home .way h4 { margin: 0 0 0.4rem; font-size: 1.08rem; font-weight: 700; letter-spacing: 0; text-transform: none; opacity: 1; color: var(--text-strong); }
main.home section .way p { margin: 0 0 0.5rem; line-height: 1.55; font-size: calc(var(--type-body) * 0.98); max-width: none; }
main.home section .way p.way-link { margin: auto 0 0; padding-top: 0.25rem; }
main.home .way-link a { display: inline-flex; align-items: center; min-height: 44px; padding: 0.35rem 0; font-weight: 600; }
/* Group labels sit on the cards under them, with a clearer break before the next group. */
main.home .way-group + .ways { margin-top: 0.55rem; }
main.home .ways + .way-group { margin-top: 1.85rem; }
main.home #next > .next-cards { margin-top: 2rem; }
main.home figure.diagram { max-width: 100%; }

/* Learn: a little more room (Christian, 21 Oct). */
.learn-section { margin-top: 3rem; }
.hub-list li { margin-bottom: 1.5rem; line-height: 1.65; }
.hub-list .gloss { margin-top: 0.3rem; }
main.doc .lead { line-height: 1.65; max-width: 44rem; }

/* Round 2 break test: the "Where next" cards fit at 320 px with 200% text. */
main.home .next-cards { grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
main.home .next-also { max-width: none; margin: 0.9rem 0 0; }
/* --btn-border is 2.55:1 on the light page. The stronger button border clears 3:1 in both themes. */
main.home .next-cards a { border-width: 2px; border-color: var(--btn-border-hover); background: var(--btn-bg); }
main.home .next-cards a:hover, main.home .next-cards a:focus-visible { border-color: var(--accent); }
main.home .next-cards strong { color: var(--accent-text); font-size: 1.12rem; }
main.home .next-cards strong::after { content: " \2192"; }
main.home .next-also { font-size: 0.95rem; }
main.home .door-film video { display: block; width: 100%; height: auto; }
.platforms button.tab-lead { border-color: var(--accent); color: var(--text-strong); font-weight: 700; }

/* Round 3: #softwar stays a working alias for #cost-asymmetry.
   Merged homepage sections keep their old ids as aliases too. */
main.home .anchor-alias { display: block; height: 0; scroll-margin-top: 5.75rem; }
main.home .way .anchor-alias { scroll-margin-top: 6.75rem; }
main.home .way:has(.anchor-alias:target) { border-color: var(--accent); }
main.home section > h3 {
  margin: 1.35rem 0 0.35rem;
  max-width: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  opacity: 1;
  color: var(--text-strong);
}

/* Follow one PCOC, and the integrate-page flow. Text is the mechanism.
   No animation: the steps are on the page at mobile width and with motion off. */
main.home .kicker {
  margin: 0 0 0.4rem;
  max-width: none;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-text);
}
main.home h1 { max-width: none; }
main.home .gloss { max-width: none; color: var(--text-soft); }

/* Homepage briefs: one idea per section, a short paragraph under each heading.
   Generous space between briefs; no dense .points lists on Home. */
body main.home > section {
  margin-top: 3.25rem;
}
/* The nutshell film closes "How to impose a cost": title and film, in the reading column. */
body main.home > section#nutshell {
  margin-top: 2.25rem;
}
body main.home #nutshell .door-film {
  max-width: none;
  margin-bottom: 0;
}
main.home .first-screen > p,
main.home section > p {
  line-height: 1.75;
}
/* Opener: heavier than the brief under it, clearly lighter and smaller than the h1.
   An explicit hyphen in the line (sign-up) is not a break point. */
body main.home .subhead {
  margin: 0 0 1rem;
  max-width: none;
  font-size: clamp(0.96rem, 0.84rem + 0.28vw, 1.024rem);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 1;
  text-align: start;
  text-align-last: start;
  hyphens: none;
  -webkit-hyphens: none;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: wrap;
}
main.home section#limit {
  margin-top: 2.5rem;
}
main.home section#limit > p {
  color: var(--text-soft);
}
.follow-steps, .flow {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: 0.75rem;
}
.follow-steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.follow-steps > li, .flow > li {
  margin: 0;
  padding: 0.9rem 0.95rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}
.follow-steps .step-name, .flow .step-name {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
  color: var(--accent-text);
}
.follow-steps p, .flow p { margin: 0.45rem 0 0; font-size: 0.95rem; line-height: 1.5; max-width: none; }
.example-note { max-width: 40rem; font-weight: 650; }
.flow { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.sdk-table, .paths { width: 100%; max-width: 52rem; border-collapse: collapse; margin: 0.75rem 0 1rem; font-size: 0.96rem; }
.sdk-table th, .sdk-table td, .paths th, .paths td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sdk-table th, .paths th { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
.sdk-table caption, .paths caption { text-align: left; font-weight: 700; margin: 0 0 0.4rem; color: var(--text-strong); }
/* Stack comparison tables through the narrow desktop range (about 390–800px)
   so three columns stay inside the reading measure instead of scrolling sideways. */
@media (max-width: 800px) {
  body main :is(.sdk-table, .paths, .who-runs) {
    max-width: min(100%, var(--measure));
    margin-left: auto;
    margin-right: auto;
  }
  .sdk-table, .paths, .who-runs,
  .sdk-table tbody, .paths tbody, .who-runs tbody,
  .sdk-table tr, .paths tr, .who-runs tr,
  .sdk-table td, .paths td, .who-runs td,
  .sdk-table caption, .paths caption { display: block; width: auto; min-width: 0; }
  .sdk-table thead, .paths thead, .who-runs thead { display: none; }
  .sdk-table tr, .paths tr, .who-runs tr { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
  .sdk-table td, .paths td, .who-runs td {
    border: 0;
    padding: 0.12rem 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .sdk-table td::before, .paths td::before, .who-runs td::before { color: var(--muted); font-weight: 600; }
  .sdk-table td:nth-child(1)::before { content: "Language: "; }
  .sdk-table td:nth-child(2)::before { content: "SDK: "; }
  .sdk-table td:nth-child(3)::before { content: "Readme: "; }
  .paths td:nth-child(1)::before { content: "Path: "; }
  .paths td:nth-child(2)::before { content: "What you hand over: "; }
  .paths td:nth-child(3)::before { content: "What stays yours: "; }
  .who-runs td:nth-child(1) { font-weight: 700; }
  .who-runs td:nth-child(2)::before { content: "Today: "; }
  .who-runs td:nth-child(3)::before { content: "Your own: "; }
  .who-runs { font-size: 0.9rem; }
}
.side { margin: 2rem 0 0; }
.sitemap-group { margin: 1.75rem 0 0; max-width: 44rem; }
.sitemap-group ul { padding-left: 1.15rem; }
.sitemap-group li { margin: 0.35rem 0; line-height: 1.45; }
.move-note { max-width: 40rem; }
