/* JOV Office website.
   Light and dark (prefers-color-scheme) (logical properties throughout),
   down to 360 px wide. Colours are tokens below; web/tests/contrast.test.mjs checks text contrast. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light dark;

  /* Brand: the logo's raspberry, as the desktop home page's accent (web/os/assets/brand.js). */
  --brand: #be1265;
  --brand-strong: #990e52;
  --brand-soft: #fdeef5;
  --brand-contrast: #ffffff;

  --bg: #ffffff;
  --bg-subtle: #f5f7fa;
  --surface: #ffffff;
  --border: #e1e6ee;
  --border-strong: #c9d1dd;
  --text: #111827;
  --text-muted: #4b5563;
  --focus: #be1265;

  --danger: #b42318;
  --danger-soft: #fef0ee;
  --success: #0f6b3a;
  --success-soft: #e9f7ef;
  --warning: #8a4b00;
  --warning-soft: #fff4e0;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 12px 32px rgb(16 24 40 / 7%);
  --container: 1120px;
  --gutter: 20px;
  --header-height: 64px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #ff8ac0;
    --brand-strong: #ffb0d3;
    --brand-soft: #3a1426;
    --brand-contrast: #2a0716;

    --bg: #0d1016;
    --bg-subtle: #131720;
    --surface: #161b24;
    --border: #262d3a;
    --border-strong: #364052;
    --text: #eef1f6;
    --text-muted: #a7b0c0;
    --focus: #ff8ac0;

    --danger: #ff9b8f;
    --danger-soft: #3b1714;
    --success: #74d6a0;
    --success-soft: #0f2a1c;
    --warning: #f5c46b;
    --warning-soft: #33250c;

    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 12px 32px rgb(0 0 0 / 35%);
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 750;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  font-weight: 700;
}

h3 {
  font-size: 1.15rem;
  font-weight: 650;
}

p {
  margin: 0 0 1em;
}

/* On phones: even heading lines, and no word left alone on a paragraph's last line. */
@media (max-width: 720px) {
  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  p,
  li {
    text-wrap: pretty;
  }
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-strong);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

ul,
ol {
  margin: 0 0 1em;
  padding-inline-start: 1.4em;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 760px;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.9rem;
}

.center {
  text-align: center;
}

.skip-link {
  position: absolute;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
  color: var(--brand-contrast);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-block-end: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: var(--header-height);
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  margin-inline-end: auto;
}

.brand:hover {
  color: var(--text);
}

/* The logo: the app icon's mark (assets/img/logo.svg, also the favicon). */
.logo-mark {
  display: inline-block;
  inline-size: 30px;
  block-size: 30px;
  flex: none;
  background: url("../img/logo.svg") center / contain no-repeat;
}

.logo-mark-small {
  inline-size: 22px;
  block-size: 22px;
}

.wordmark {
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.site-nav .nav-links {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 550;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-subtle);
}

/* The phone menu (site.js): wider than 720 px the panel is only a wrapper and the button is hidden. */
.header-panel {
  display: contents;
}

.menu-button,
.site-header .header-cta {
  display: none;
}

@media (max-width: 720px) {
  .header-inner {
    position: relative;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 60px;
  }

  .brand {
    min-width: 0;
    min-height: 44px;
  }

  .site-header .header-cta {
    display: inline-flex;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
    flex: none;
    inline-size: 44px;
    block-size: 44px;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  /* Three bars, a cross while the menu is open. */
  .menu-icon,
  .menu-icon::before,
  .menu-icon::after {
    display: block;
    inline-size: 18px;
    block-size: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.15s ease, background-color 0.15s ease;
  }

  .menu-icon {
    position: relative;
  }

  .menu-icon::before,
  .menu-icon::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
  }

  .menu-icon::before {
    top: -6px;
  }

  .menu-icon::after {
    top: 6px;
  }

  .menu-open .menu-icon {
    background: transparent;
  }

  .menu-open .menu-icon::before {
    transform: translateY(6px) rotate(45deg);
  }

  .menu-open .menu-icon::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .header-panel {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    max-block-size: calc(100dvh - 61px);
    overflow-y: auto;
    padding: 8px var(--gutter) 16px;
    border-block-end: 1px solid var(--border-strong);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .menu-open .header-panel {
    display: grid;
    gap: 12px;
  }

  .site-nav .nav-links {
    flex-direction: column;
    gap: 2px;
  }

  .site-nav a {
    display: flex;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--text);
    font-size: 1.05rem;
  }
}

@media (max-width: 340px) {
  .site-header .header-cta {
    padding: 0 10px;
    font-size: 0.9rem;
  }

  .header-inner .wordmark {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.notice-banner {
  background: var(--warning-soft);
  color: var(--warning);
  border-block-end: 1px solid var(--border);
  font-size: 0.9rem;
  padding-block: 8px;
  text-align: center;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button-primary {
  background: var(--brand);
  color: var(--brand-contrast);
}

.button-primary:hover {
  background: var(--brand-strong);
  color: var(--brand-contrast);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.button-google {
  gap: 10px;
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.button-google:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.button-google img {
  flex: none;
}

.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

.button-large {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1.05rem;
}

.button-block {
  display: flex;
  width: 100%;
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.button[aria-busy="true"] {
  cursor: progress;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.center .actions,
.actions.center {
  justify-content: center;
}

/* ---------- Sections ---------- */
.section {
  padding-block: 64px;
}

.section-tight {
  padding-block: 40px;
}

.section-alt {
  background: var(--bg-subtle);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.page-head {
  padding-block: 56px 24px;
}

.page-head .lead {
  max-width: 680px;
}

.eyebrow {
  display: inline-block;
  margin-block-end: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 650;
}

.lead {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  color: var(--text-muted);
}

/* ---------- Home ---------- */
.hero {
  padding-block: 80px 56px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    var(--bg);
}

.hero h1 {
  max-width: 820px;
  margin-inline: auto;
}

.hero .lead {
  max-width: 700px;
  margin: 0 auto 28px;
}

.hero .actions {
  justify-content: center;
}

.hero-note {
  margin-block-start: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card h3 {
  margin-block-start: 0;
}

.card p:last-child {
  margin-block-end: 0;
}

.format-chip {
  display: inline-block;
  margin-block-end: 14px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  direction: ltr;
}

/* Screenshot placeholders: plain boxes until real screenshots are added. */
.shot {
  margin: 0;
}

.shot-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(var(--bg-subtle), var(--bg-subtle)) padding-box,
    var(--surface);
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 16px;
}

.shot figcaption {
  margin-block-start: 10px;
  font-weight: 650;
  text-align: center;
}

.steps {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 24px;
  padding-block-start: 64px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  top: 20px;
  inset-inline-start: 24px;
  display: grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 700;
}

.steps p:last-child {
  margin-block-end: 0;
}

.faq {
  max-width: 760px;
  margin-inline: auto;
}

.faq details {
  border-block-end: 1px solid var(--border);
  padding-block: 4px;
}

.faq summary {
  padding-block: 14px;
  font-weight: 650;
  cursor: pointer;
  list-style-position: outside;
}

.faq details p {
  color: var(--text-muted);
}

.cta {
  text-align: center;
}

/* ---------- Download ---------- */
.download-box {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.download-box p {
  margin: 0;
}

.install-steps {
  margin: 0;
  padding-inline-start: 1.6em;
}

.install-steps > li {
  margin-block-end: 12px;
  padding-inline-start: 4px;
}

.os-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  margin-block: 20px;
}

.os-card ol {
  margin-block-end: 0;
}

.os-card li + li {
  margin-block-start: 8px;
}

.callout {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--text);
  border-inline-start: 4px solid var(--brand);
}

.callout p:last-child {
  margin-block-end: 0;
}

.checklist {
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-inline-start: 28px;
  margin-block-end: 10px;
}

.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.45em;
  inline-size: 14px;
  block-size: 8px;
  border-inline-start: 2.5px solid var(--success);
  border-block-end: 2.5px solid var(--success);
  transform: rotate(-45deg);
}

html[dir="rtl"] .checklist li::before {
  transform: rotate(45deg) scaleX(-1);
}

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  max-width: 820px;
  margin-inline: auto;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.price-card.is-featured {
  border: 2px solid var(--brand);
  box-shadow: var(--shadow);
}

.price-card h2 {
  font-size: 1.3rem;
  margin-block-end: 8px;
}

.price {
  margin: 4px 0 4px;
  font-size: 2rem;
  font-weight: 750;
  line-height: 1.2;
}

.price-card .checklist {
  margin-block: 20px 24px;
  flex: 1 0 auto;
}

.badge {
  position: absolute;
  top: -13px;
  inset-inline-end: 20px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 0.8rem;
  font-weight: 700;
}

.pricing-notes {
  max-width: 820px;
  margin: 28px auto 0;
  text-align: center;
}

/* ---------- Forms ---------- */
.auth-wrap {
  padding-block: 56px 72px;
}

.auth-card {
  max-width: 440px;
  margin-inline: auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
}

.auth-card h1:focus,
.auth-card h2:focus {
  outline: none;
}

.form {
  display: grid;
  gap: 18px;
  margin-block-start: 24px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.field input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 45%, transparent);
  outline-offset: 0;
  border-color: var(--focus);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field input[dir="ltr"] {
  text-align: start;
}

html[dir="rtl"] .field input[dir="ltr"] {
  text-align: right;
}

.hint {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

.check input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.form-links {
  margin-block-start: 22px;
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form-links p {
  margin: 0;
}

.fine-print {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.message {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.message.is-error {
  background: var(--danger-soft);
  color: var(--danger);
}

.message.is-success {
  background: var(--success-soft);
  color: var(--success);
}

.message.is-info {
  background: var(--brand-soft);
  color: var(--text);
}

.message.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.panel-icon {
  display: grid;
  place-items: center;
  inline-size: 48px;
  block-size: 48px;
  margin-block-end: 16px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 1.5rem;
  font-weight: 700;
}

.panel-icon.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

/* ---------- Account ---------- */
.account-grid {
  display: grid;
  gap: 20px;
  max-width: 760px;
  margin-inline: auto;
}

.account-row {
  display: grid;
  gap: 2px;
}

.account-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.account-value {
  font-size: 1.1rem;
  font-weight: 650;
  overflow-wrap: anywhere;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

html[dir="rtl"] .account-value {
  text-align: right;
}

.status-card {
  border-inline-start: 4px solid var(--border-strong);
}

.status-card[data-tone="positive"] {
  border-inline-start-color: var(--success);
}

.status-card[data-tone="warning"] {
  border-inline-start-color: var(--warning);
}

.status-card h2 {
  font-size: 1.35rem;
  margin-block-end: 10px;
}

.status-details p {
  margin-block-end: 6px;
}

.status-card .actions {
  margin-block-start: 18px;
}

/* ---------- Legal pages ---------- */
.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.3rem;
  margin-block-start: 2em;
}

.prose li {
  margin-block-end: 8px;
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.placeholder-note {
  font-family: var(--font-mono);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-block-start: auto;
  padding-block: 32px;
  border-block-start: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: grid;
  gap: 12px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-fine {
  margin: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }

  .section {
    padding-block: 48px;
  }

  .hero {
    padding-block: 56px 40px;
  }

  .auth-wrap {
    padding-block: 28px 48px;
  }

  .auth-card,
  .download-box,
  .price-card {
    padding: 22px 18px;
  }

  .hero .actions .button,
  .cta .actions .button,
  .download-box .button,
  .status-card .actions .button {
    width: 100%;
  }

  .hero {
    padding-block: 40px 36px;
  }

  .page-head {
    padding-block: 36px 16px;
  }

  h1 {
    font-size: clamp(1.85rem, 1.3rem + 2.6vw, 2.2rem);
  }

  .section-head {
    margin-block-end: 24px;
  }

  .card {
    padding: 20px;
  }

  /* Two columns of footer links, each one a comfortable tap. */
  .footer-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  /* Comfortable taps: the footer links and the "Show password" box. */
  .footer-links {
    gap: 0 20px;
  }

  .footer-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .check {
    gap: 10px;
    min-height: 44px;
    cursor: pointer;
  }

  .check input {
    inline-size: 20px;
    block-size: 20px;
  }

  /* The screenshot boxes: two to a row instead of a tall column of empty frames. */
  .shots-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .shots-grid .shot-frame {
    aspect-ratio: 4 / 3;
    font-size: 0.85rem;
    padding: 10px;
  }

  .shots-grid .shot figcaption {
    margin-block-start: 6px;
    font-size: 0.95rem;
  }

  .faq summary {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Small additions ---------- */
.center .lead,
.page-lead {
  max-width: 680px;
  margin-inline: auto;
}

.inline-message {
  display: inline-block;
}

/* An empty message keeps its live region in the page without leaving a gap in the form. */
.form .form-status:has(> .message[hidden]) {
  margin-block-start: -18px;
}

.page-head + .section-tight {
  padding-block-start: 8px;
}

.install-steps .allow-heading {
  margin-block: 18px 0;
  font-size: 1.05rem;
}

.os-card h4 {
  margin-block: 0 10px;
  font-size: 1rem;
}

/* download.html: the install pictures open larger in the site's viewer (os/assets/js/core/viewer.js). */
.install-steps .shot-zoom {
  margin-block: 10px 4px;
}

.install-steps .shot-zoom > .shot {
  margin: 0;
}

.os-card ol + p {
  margin-block: 14px 0;
}

/* The install pictures (drawn illustrations, 880 × 560): as wide as their column, never wider. */
.shot {
  display: block;
  max-width: 100%;
  margin-block: 10px 4px;
}

.shot-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #f3f4f8;
}

/* ---------- Admin (admin.html) ---------- */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

/* Wide tables scroll inside their box instead of widening the page. */
.admin-grid > *,
.chart-row > *,
.table-grid > * {
  min-inline-size: 0;
}

.admin-panel {
  max-width: 640px;
  margin-inline: auto;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.admin-email {
  margin-inline-start: auto;
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.segment {
  padding: 8px 14px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.segment + .segment {
  border-inline-start: 1px solid var(--border-strong);
}

.segment[aria-pressed="true"] {
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 650;
}

.segment:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin: 12px 0 20px;
}

.stat {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.stat dt {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.stat dd {
  margin: 4px 0 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chart-row,
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 20px;
}

.chart {
  margin: 0;
}

.chart figcaption {
  display: grid;
  gap: 2px;
  margin-block-end: 8px;
}

.chart-box {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
}

.chart-svg {
  display: block;
  inline-size: 100%;
  block-size: 140px;
}

.chart-bar,
.chart-dot {
  fill: var(--brand);
}

.chart-line {
  stroke: var(--brand);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-axis {
  stroke: var(--border-strong);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  border-block-end: 1px solid var(--border);
  text-align: start;
  white-space: nowrap;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
}

.data-table .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.ltr-value {
  unicode-bidi: isolate;
}

/* Emails, versions and paths are written left to right but still line up with their column. */
html[dir="rtl"] .data-table td[dir="ltr"] {
  text-align: right;
}

.admin-badge {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.8rem;
}

.admin-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-block: 12px;
}

.admin-search input {
  flex: 1 1 220px;
  min-inline-size: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* A label in each cell of the account list, shown only where the list becomes cards. */
.cell-label {
  display: none;
}

@media (max-width: 640px) {
  .segmented {
    display: flex;
    inline-size: 100%;
  }

  .segment {
    flex: 1;
    min-height: 44px;
  }

  /* 16px or more, so iOS doesn't zoom into the field. */
  .admin-search input {
    min-height: 44px;
    font-size: 1rem;
  }

  .admin-email {
    margin-inline-start: 0;
    flex-basis: 100%;
  }

  html[dir="rtl"] .admin-email {
    text-align: right;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat {
    padding: 10px 12px;
  }

  .stat dd {
    font-size: 1.3rem;
  }

  /* The account list as one card per account: every column stays readable, nothing scrolls. */
  .user-list .data-table,
  .user-list .data-table tbody,
  .user-list .data-table tr,
  .user-list .data-table td {
    display: block;
  }

  .user-list .data-table thead {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .user-list .data-table tr {
    padding: 12px 0;
    border-block-end: 1px solid var(--border);
  }

  .user-list .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    border: 0;
    white-space: normal;
    text-align: end;
  }

  .user-list .data-table td:first-child {
    display: block;
    padding-block-end: 6px;
    font-weight: 650;
    text-align: start;
    overflow-wrap: anywhere;
  }

  html[dir="rtl"] .user-list .data-table td[dir="ltr"] {
    text-align: left;
  }

  .user-list .admin-badge {
    margin-inline-start: 6px;
    font-weight: 500;
  }

  .user-list .cell-label {
    display: inline;
    color: var(--text-muted);
    text-align: start;
  }

  .admin-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .admin-pager .button {
    padding: 0 12px;
  }
}

.admin-pager {
  align-items: center;
  margin-block-start: 14px;
}

/* Admin: the latest crash reports, each with its report text shown on demand. */
.crash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.crash-item {
  padding-block: 12px;
  border-block-end: 1px solid var(--border);
}

.crash-item p {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}

.crash-report {
  margin-block-start: 10px;
  max-block-size: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: pre;
  unicode-bidi: isolate;
}

/* The admin overview's last row: all JOV apps together. */
.data-table .total-row th,
.data-table .total-row td {
  border-top: 2px solid var(--border-strong);
  font-weight: 700;
}
