/* PhoneRun's own page CSS (not the kit's): the palette, then the parts of the pages.
   Shared by every page that scripts/build-site.mjs writes. */
:root {
  --p-bg: #0f0f0f; --p-surface: #1a1a1a; --p-ink: #ffffff; --p-muted: #8f8f8f;
  --p-accent: #dafa9c; --p-accent-ink: #0f0f0f; --p-action: #dafa9c; --p-action-ink: #0f0f0f;
  --p-inv-bg: #ffffff; --p-inv-surface: #ececec; --p-inv-ink: #0f0f0f; --p-inv-muted: #5f5f5f;
  --p-inv-accent: #0f0f0f; --p-inv-accent-ink: #ffffff; --p-inv-action: #0f0f0f; --p-inv-action-ink: #ffffff;
  --font-display: "Host Grotesk", system-ui, sans-serif;
  --font-text: "Host Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.035em;
  --display-tracking-xl: -0.04em;
}
  /* phone cuts (layout-v4: cut the phone copy) and the tablet screen counts */
  @media (max-width: 639px) { .pr-desk { display: none !important; } }
  /* a ground's section keeps the system's top-aligned screen (backgrounds.css centres it) */
  #features, #questions { align-content: stretch; padding: var(--padt) 0 calc(var(--padb) + var(--bar)); }
  @media (min-width: 640px) and (max-width: 1023px) {
    #pricing { --h: 2; }
    /* the form keeps the full row under its text (booking-form: the form full width) */
    #order .grid > .card { grid-column: 1 / -1; }
    /* the questions fill their two screens: each row takes an equal share of the room left over */
    #questions > .wrap { display: flex; flex-direction: column; }
    #questions > .wrap > .grid { flex: 1 0 auto; grid-template-rows: auto 1fr; }
    #questions .faq { display: flex; flex-direction: column; }
    #questions .faq > .faq__item { flex: 1 1 auto; align-content: center; }
  }
  /* 1024 to 1279: the section grows with its plan cards, so the card row keeps its own height */
  @media (min-width: 1024px) and (max-width: 1279px) { #pricing .grid.fill { flex: 1 0 auto; } }
  /* a short laptop screen: these two grow with their content, never over the next section */
  @media (min-width: 1280px) and (max-height: 779px) {
    #pricing, #questions { height: auto; min-height: 100svh; }
    #pricing .grid.fill { flex: 1 0 auto; }
  }
  /* a phone: a section grows with its content rather than run into the next one on a short screen */
  @media (max-width: 639px) {
    main > :is(section, .section):not(.hero, .section--hero), footer.closing { height: auto; min-height: calc(var(--hm, var(--h, 1)) * 100svh); display: flex; flex-direction: column; }
    main > :is(section, .section):not(.hero, .section--hero) > .wrap, footer.closing > .wrap { flex: 1 0 auto; height: auto; min-height: 0; }
    main > :is(section, .section) > .wrap > .fill { flex: 1 0 auto; }
  }
  @media (min-width: 1024px) { #order .card { --card-pad: 48px; } }
  .pr-planned { margin: auto 0 0; padding-top: var(--s-2); }
  /* the order form: the three plans as rows to pick from, then the number of phones and what it comes to */
  .pr-plans { grid-column: 1 / -1; display: grid; gap: var(--s-2); margin: 0; padding: 0; border: 0; min-width: 0; }
  .pr-plans legend { padding: 0; margin-bottom: var(--s-2); font-size: var(--t-small); font-weight: 500; }
  .pr-plan { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3);
    min-height: var(--btn-h); padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-sm); cursor: pointer; }
  .pr-plan:has(input:checked) { border-color: var(--ink); }
  .pr-plan:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
  .pr-plan input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
  .pr-plan__name { display: grid; font-weight: 500; }
  .pr-plan__name small { font-size: var(--t-small); font-weight: 400; color: var(--muted); }
  .pr-plan__price { font-weight: 500; white-space: nowrap; }
  .pr-total { align-self: end; margin: 0; min-height: var(--btn-h); display: grid; align-content: center; font-size: var(--t-lead); letter-spacing: -0.01em; }
  .form > .pr-total { grid-column: auto; }
  @media (max-width: 639px) { .pr-plan__name small { display: none; } }

  /* PhoneRun's own UI where no .stage sets its palette: the hero pieces and the console frame */
  .pr-ui {
    --ui-font: var(--font-text); --ui-mono: var(--font-mono); --ui-radius: 12px;
    --fx-bg: #252525; --fx-surface: #1a1a1a; --fx-ink: #ffffff; --fx-muted: #9a9a9a;
    --fx-accent: #dafa9c; --fx-accent-ink: #0f0f0f;
  }

  /* the viewer window (hero) */
  .hero__art > .ly-piece { z-index: 1; }
  .pr-win { overflow: hidden; }
  .pr-win__bar { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 14px; border-bottom: 1px solid var(--u-line); background: var(--u-fill); font-size: 13px; line-height: 16px; color: var(--u-muted); white-space: nowrap; }
  .pr-win__bar b { font-weight: 500; color: var(--u-ink); }
  .pr-win__body { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 660px; padding-right: var(--ly-cut-room); }
  .pr-side { display: grid; align-content: start; gap: 20px; padding: 16px; border-right: 1px solid var(--u-line); }
  .pr-side__name { font-size: 15px; line-height: 20px; font-weight: 500; }
  .pr-side__sub { font-size: 13px; line-height: 16px; color: var(--u-muted); }
  .pr-label { margin-bottom: 8px; font-size: 13px; line-height: 16px; color: var(--u-soft); }
  .pr-keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pr-keys .ui-btn { width: 100%; justify-content: center; padding: 0 6px; }
  .pr-rows { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; margin: 0; font-size: 13px; line-height: 16px; }
  .pr-rows dt { color: var(--u-muted); }
  .pr-rows dd { margin: 0; text-align: right; font-family: var(--ui-mono); font-size: 12px; }
  .pr-view { display: flex; justify-content: center; align-items: flex-start; padding: 20px 0 0 28px; }

  /* the phone and its screen */
  .pr-phone { flex: none; width: 264px; padding: 8px; border-radius: 34px; background: #060607; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .16), 0 18px 40px -18px rgb(0 0 0 / .7); }
  .pr-screen { position: relative; display: flex; flex-direction: column; height: 551px; border-radius: 26px; overflow: hidden; color: #ffffff; background: linear-gradient(168deg, #4a5b40 0%, #212c24 52%, #0e1310 100%); font-size: 13px; line-height: 16px; }
  .pr-sbar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 30px; padding: 0 16px; font-size: 12px; font-weight: 500; }
  .pr-sbar > span:last-child { display: inline-flex; align-items: center; gap: 6px; }
  .pr-batt { position: relative; width: 20px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px currentColor; opacity: .9; }
  .pr-batt::before { content: ""; position: absolute; inset: 2px 5px 2px 2px; border-radius: 1px; background: currentColor; }
  .pr-clock { padding: 26px 18px 28px; }
  .pr-clock b { display: block; font-size: 44px; line-height: 48px; font-weight: 400; letter-spacing: -0.02em; }
  .pr-clock span { font-size: 13px; opacity: .82; }
  .pr-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 0; margin: 0; padding: 0 6px; list-style: none; }
  .pr-apps li { display: grid; justify-items: center; gap: 6px; font-size: 12px; line-height: 14px; letter-spacing: -0.015em; white-space: nowrap; }
  .pr-screen .ic-tile { --tile-bg: #ffffff; --tile-line: transparent; }
  .pr-dock { display: flex; justify-content: space-around; margin: auto 10px 10px; padding: 10px 6px; border-radius: 22px; background: rgb(255 255 255 / .12); }
  .pr-dock i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgb(255 255 255 / .16); }
  .pr-dock svg { width: 20px; height: 20px; fill: none; stroke: #ffffff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .pr-pill { flex: none; align-self: center; width: 96px; height: 4px; margin-bottom: 8px; border-radius: 2px; background: currentColor; opacity: .75; }
  /* an app open on the phone: a post being written */
  .pr-screen--app { background: #f4f3ef; color: #17191c; }
  .pr-appbar { display: flex; align-items: center; justify-content: space-between; flex: none; height: 44px; padding: 0 16px; border-bottom: 1px solid rgb(0 0 0 / .08); font-size: 15px; font-weight: 500; }
  .pr-appbar span { font-size: 13px; font-weight: 400; color: #5a5f66; }
  .pr-caption { margin: 0 16px; padding: 16px 0; min-height: 148px; border-bottom: 1px solid rgb(0 0 0 / .08); font-size: 14px; line-height: 20px; }
  .pr-caption i { display: inline-block; width: 1.5px; height: 16px; margin-left: 1px; vertical-align: -3px; background: #17191c; }
  .pr-opts { margin: 0 16px; padding: 0; list-style: none; }
  .pr-opts li { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid rgb(0 0 0 / .08); }
  .pr-opts li:first-child { border-top: 0; }
  .pr-opts span { color: #5a5f66; }

  /* the small result card (hero) */
  .hero__art > .ly-piece--note { left: var(--s-5); bottom: var(--s-5); width: 300px; z-index: 2; padding: 14px 16px 8px; }
  .pr-note__row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .pr-note__line { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--u-line); font-size: 13px; line-height: 18px; color: var(--u-text-2); }
  .pr-note__line i { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--u-fill-3); color: var(--u-ink); font-style: normal; font-size: 12px; font-weight: 700; }
  .hero__proof { font-size: var(--t-small); }
  @media (min-width: 1024px) {
    .pr-win__body { min-height: min(660px, 100svh - 276px); }
    .pr-win .pr-screen { height: min(551px, 100svh - 348px); }
  }
  @media (min-width: 1024px) and (max-width: 1279px) {
    .pr-win .pr-side { display: none; }
    .pr-win__body { grid-template-columns: minmax(0, 1fr); }
    .pr-view { padding-left: 0; }
  }
  @media (max-width: 1023px) { .hero__art > .ly-piece--note { left: var(--s-4); bottom: var(--s-4); width: 270px; } }
  @media (max-width: 639px) {
    .pr-win .pr-side { display: none; }
    .pr-win__body { grid-template-columns: minmax(0, 1fr); }
    .pr-view { padding-left: 0; }
  }

  /* the console (app-frame recipe) */
  .app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: var(--s-7); background: var(--u-bg); border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow); }
  .app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
  .app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
  .app > .app__pane > .ui-panel { width: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; }
  .pr-open__body { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 32px; padding: 24px 32px 0; }
  .pr-open__col { display: grid; align-content: start; gap: 24px; padding-top: 4px; }
  .pr-open .pr-keys { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pr-open .pr-phone { padding: 0; background: none; box-shadow: none; }
  .pr-open .pr-screen { height: 567px; border: 8px solid #060607; border-radius: 34px; }
  .pr-hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--u-muted); }
  @media (min-width: 1024px) and (max-width: 1279px) {
    .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
    .pr-open .pr-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 1023px) {
    .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .app > .app__pane--list { max-height: 252px; }
    .app > .app__pane--list::after { display: none; }
    .app .ui-win__side { display: none; }
    .app .ui-win__body { grid-template-columns: minmax(0, 1fr); }
    .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
    .pr-stream { display: none; }
  }
  @media (max-width: 639px) {
    .app.ui { grid-template-rows: minmax(0, 1fr); }
    .app > .app__pane--list { display: none; }
    .app > .app__pane + .app__pane { border-top: 0; }
    .pr-open__body { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 20px 16px 0; }
    .pr-open__col { display: none; }
  }

  /* the phone's status card (carrier line section) */
  .pr-status { width: 380px; }
  .pr-status .pr-rows { padding: 16px; gap: 12px; }
  .pr-status__foot { padding: 0 16px 16px; }
  .pr-status__foot .ui-btn { width: 100%; justify-content: center; }
  .pr-log { display: grid; gap: 10px; padding: 14px 16px 16px; border-top: 1px solid var(--u-line); font-size: 13px; line-height: 16px; }
  .pr-log div { display: flex; justify-content: space-between; gap: 12px; color: var(--u-muted); }
  .pr-log b { font-weight: 500; color: var(--u-ink); }
/* On a wide but short window the close and the footer links do not fit one screen. Let the footer grow
   past the screen, as it already does on a tablet, so the big name never sits on the link columns. */
@media (min-width: 1280px) {
  footer.closing { height: auto; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
  footer.closing > .wrap { flex: 1 0 auto; height: auto; min-height: 0; }
}

/* reading pages (calculator, status, getting started): one column under the nav */
.doc-page { padding-top: var(--nav-h, 72px); }
.doc { max-width: 680px; padding-block: var(--s-9); }
.doc h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.08; margin: 0 0 var(--s-5); }
.doc h2 { font-size: var(--t-lead); line-height: 1.3; margin: var(--s-7) 0 var(--s-3); letter-spacing: -0.01em; }
.doc p, .doc li { font-size: var(--t-body); line-height: 1.6; color: var(--muted); }
.doc p { margin: 0 0 var(--s-4); }
.doc ul { margin: 0 0 var(--s-4); padding-left: 20px; }
.doc li { margin-bottom: var(--s-2); }
.doc .btn-row { margin-top: var(--s-5); }
.doc .form { margin-top: var(--s-5); }
.pr-calc__out { margin-top: var(--s-6); padding: var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--r-md, 16px); }
.pr-calc__out p { margin: 0; }
.pr-calc__big { font-size: clamp(32px, 4vw, 44px) !important; line-height: 1.1; color: var(--ink) !important; letter-spacing: -0.02em; margin-bottom: var(--s-2) !important; }
.pr-fleet { display: grid; margin: var(--s-5) 0; border-top: 1px solid var(--line); }
.pr-fleet > div { display: flex; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.pr-fleet dt { color: var(--muted); }
.pr-fleet dd { margin: 0; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* /teams: the usage table and the API reply inside their panels */
.pr-usage table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 16px; }
.pr-usage th, .pr-usage td { padding: 10px 14px; border-top: 1px solid var(--u-line); text-align: right; white-space: nowrap; }
.pr-usage th:first-child, .pr-usage td:first-child { text-align: left; }
.pr-usage th { color: var(--u-muted); font-weight: 500; }
.pr-usage td { font-family: var(--ui-mono); font-size: 12px; }
.pr-usage td:first-child { font-family: var(--ui-font); font-size: 13px; }
.pr-code pre { margin: 0; padding: 14px 16px; font: 12px/1.6 var(--ui-mono); color: var(--u-ink); white-space: pre; overflow: hidden; }

/* Language switcher in the footer */
.pr-langs { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding-top: var(--s-5); margin-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--t-small, 14px); }
.pr-langs a { color: inherit; opacity: .7; text-decoration: none; }
.pr-langs a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.pr-langs a[aria-current] { opacity: 1; font-weight: 500; }

/* Scripts Host Grotesk does not cover: the system's own face for the language. */
html:lang(zh-Hans) { --font-display: "Host Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; --font-text: var(--font-display); }
html:lang(ja) { --font-display: "Host Grotesk", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif; --font-text: var(--font-display); }
html:lang(ko) { --font-display: "Host Grotesk", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; --font-text: var(--font-display); }
html:lang(ar) { --font-display: system-ui, "SF Arabic", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", sans-serif; --font-text: var(--font-display); }
html:lang(zh-Hans) body, html:lang(ja) body { line-break: strict; overflow-wrap: anywhere; }
html:lang(ko) body { word-break: keep-all; overflow-wrap: anywhere; }
html:lang(zh-Hans) h1, html:lang(zh-Hans) h2, html:lang(ja) h1, html:lang(ja) h2, html:lang(ko) h1, html:lang(ko) h2,
html:lang(ar) h1, html:lang(ar) h2 { letter-spacing: 0; }
html:lang(ar) body { letter-spacing: 0; }

/* Right to left (Arabic). Grids and flex rows turn on their own; these are the places set with left or right. */
[dir="rtl"] .nav__link::before, [dir="rtl"] .nav__link[aria-current="page"]::after { left: var(--s-3); right: var(--s-3); }
[dir="rtl"] .card--plan h3 .badge { margin-left: 0; margin-right: var(--s-2); }
[dir="rtl"] .m-arrow, [dir="rtl"] .pr-arrow { transform: scaleX(-1); }
[dir="rtl"] .doc ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .pr-win, [dir="rtl"] .pr-ui, [dir="rtl"] code, [dir="rtl"] pre, [dir="rtl"] .pr-code { direction: ltr; text-align: left; }
@media (max-width: 1023px) {
  [dir="rtl"] .nav__toggle { margin-left: 0; margin-right: auto; }
  [dir="rtl"] .nav:not(.is-open) .nav__actions { margin-left: 0; margin-right: auto; }
  [dir="rtl"] .nav.is-open .nav__link[aria-current="page"]::after { left: auto; right: 0; }
}
[dir="rtl"] .link::after { content: "\2190"; }
[dir="rtl"] .link:hover::after { transform: translateX(-3px); }
/* Japanese headings break between phrases where the browser can tell them apart (Chrome 119+). */
html:lang(ja) :is(h1, h2, h3, .t-lead, .hero__lead) { word-break: auto-phrase; overflow-wrap: anywhere; }

/* Phones (2026-11-17): the closing block is as tall as what it holds. The kit makes it two exact screens
   and pins the big name to the first screen's foot, which left a 550 to 680px empty band under the button. */
@media (max-width: 639px) {
  footer.closing, footer.closing.g2m { height: auto; min-height: 0; }
  footer.closing.g2m > .wrap { grid-template-rows: auto auto; row-gap: var(--s-9); }
  footer.closing .close__word { margin-top: var(--s-7); }
  /* the questions too: in shorter languages (Arabic) two fixed screens left a 320px band under the last answer */
  #questions { height: auto; min-height: 0; }
}
/* Below desktop: a section with nothing that has to fill the screen (no .fill picture or frame) is as tall
   as its content, so a short section never leaves a band of empty ground before the next one. */
@media (max-width: 1279px) {
  main > :is(section, .section):not(.hero, .section--hero):not(:has(.fill, .app-frame, video, canvas)) { height: auto; min-height: 0; }
}
