/* Customer portal: Apple's grouped lists, floating glass bar buttons and sheets; Persian (right
   to left) and English; light and dark. Sizes are in rem, so they follow the reader's text size
   (Dynamic Type on iPhone). */

:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --card: #ffffff;
  --card-raised: #ffffff;
  --sheet: #f2f2f7;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-strong: rgba(120, 120, 128, 0.2);
  --label: #000000;
  --secondary: rgba(60, 60, 67, 0.6);
  --tertiary: rgba(60, 60, 67, 0.3);
  --separator: rgba(60, 60, 67, 0.29);
  --tint: #007aff;
  --tint-fill: rgba(0, 122, 255, 0.12);
  --green: #248a3d;
  --green-fill: rgba(52, 199, 89, 0.16);
  --orange: #c93400;
  --orange-fill: rgba(255, 149, 0, 0.16);
  --red: #d70015;
  --red-fill: rgba(255, 59, 48, 0.13);
  --segment-on: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.08);
  --scrim: rgba(0, 0, 0, 0.3);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Vazirmatn, "Noto Sans Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-raised: #2c2c2e;
    --sheet: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.32);
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, 0.6);
    --tertiary: rgba(235, 235, 245, 0.3);
    --separator: rgba(84, 84, 88, 0.65);
    --tint: #0a84ff;
    --tint-fill: rgba(10, 132, 255, 0.2);
    --green: #30d158;
    --green-fill: rgba(48, 209, 88, 0.18);
    --orange: #ff9f0a;
    --orange-fill: rgba(255, 159, 10, 0.18);
    --red: #ff453a;
    --red-fill: rgba(255, 69, 58, 0.18);
    --segment-on: #636366;
    --glass: rgba(44, 44, 46, 0.7);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --scrim: rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 106.25%; /* 17px, Apple's body size */
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

/* On iPhone and iPad the page follows the reader's Dynamic Type size. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Persian letters need taller lines; they never take letter spacing (it breaks their joins). */
html[lang="fa"] body { line-height: 1.7; }

h1, h2, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.center { text-align: center; }
.mono { font-family: var(--mono) !important; }
.loading { color: var(--secondary); text-align: center; margin-top: 40vh; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent);
  outline-offset: 2px;
  border-radius: 10px;
}
h1:focus, h1:focus-visible { outline: none; }

.icon {
  width: 1.2em;
  height: 1.2em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon circle { fill: currentColor; stroke: none; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* MARK: The bar: glass buttons floating over the content; the title comes in once the big one
   scrolls under it, with the content softening there instead of a hard line. */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  view-transition-name: nav;
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0 0 -20px;
  background: linear-gradient(to bottom, var(--bg) 0%, color-mix(in srgb, var(--bg) 75%, transparent) 60%, transparent 100%);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.nav.edge::before { opacity: 1; }

.nav-bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  min-height: 56px;
  margin: 0 auto;
  padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
}
.nav-leading { justify-self: start; display: flex; min-width: 0; }
.nav-trailing { justify-self: end; display: flex; gap: 8px; min-width: 0; }
.nav-title {
  max-width: 46vw;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nav.scrolled .nav-title, .nav.inline .nav-title { opacity: 1; }

.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 0.5px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--glass-shadow);
  color: var(--tint);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.nav-button:active { transform: scale(0.94); }
.nav-button.back { padding-inline-start: 10px; }

/* MARK: Content */

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 4px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.large-title {
  margin: 2px 4px 4px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
html[lang="en"] .large-title { letter-spacing: -0.01em; }
.large-subtitle { margin: 0 4px 22px; color: var(--secondary); }
html[dir="rtl"] .large-subtitle[dir="ltr"] { text-align: right; }

.hero { padding: 8px 8px 26px; text-align: center; }
.hero h1 { margin: 0 0 8px; font-size: 1.75rem; font-weight: 700; line-height: 1.25; }
html[lang="en"] .hero h1 { letter-spacing: -0.005em; }
.hero .lead { max-width: 28em; margin: 0 auto; color: var(--secondary); }
.hero .eyebrow { margin: 0 0 6px; color: var(--tint); font-size: 0.8125rem; font-weight: 600; }
.app-icon {
  display: block;
  width: 76px;
  height: 76px;
  margin: 6px auto 18px;
  border-radius: 22.37%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}
.hero-symbol {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 6px auto 16px;
  border-radius: 50%;
  background: var(--tint-fill);
  color: var(--tint);
}
.hero-symbol .icon { width: 36px; height: 36px; stroke-width: 1.6; }
.hero-symbol.muted { background: var(--fill); color: var(--secondary); }

.progress { display: flex; gap: 6px; max-width: 160px; margin: -10px auto 24px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--fill-strong); }
.progress span.on { background: var(--tint); }

/* MARK: Grouped lists */

.section { margin: 0 0 28px; }
.section-header { margin: 0 16px 7px; color: var(--secondary); font-size: 0.8125rem; font-weight: 400; }
.section-footer { margin: 8px 16px 0; color: var(--secondary); font-size: 0.8125rem; line-height: 1.45; }
html[lang="fa"] .section-footer { line-height: 1.75; }
.group { overflow: hidden; border-radius: var(--radius); background: var(--card); }

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 11px 16px;
  border: 0;
  background: none;
  text-align: start;
}
.row + .row::before, .row + .field::before, .field + .field::before, .field + .row::before,
.step + .step::before {
  content: "";
  position: absolute;
  top: 0;
  inset-inline: 16px 0;
  border-top: 0.5px solid var(--separator);
}
.row.with-avatar + .row.with-avatar::before { inset-inline-start: 64px; }
button.row, .row.copyable { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color 0.15s ease; }
button.row:active, .row.copyable:active { background: var(--fill); transition: none; }
.row.stacked { flex-direction: column; align-items: stretch; gap: 2px; }

.row-main { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html[dir="rtl"] .row-title[dir="ltr"] { text-align: right; }
.row-subtitle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--secondary); font-size: 0.875rem; }
.row-note { color: var(--secondary); font-size: 0.875rem; }
.row .button.small { align-self: flex-start; margin: 2px -10px 0; }
.chevron { width: 0.9em; height: 0.9em; color: var(--tertiary); stroke-width: 2.6; }

.stack { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.stack .label { color: var(--secondary); font-size: 0.8125rem; transition: color 0.15s ease; }
.stack .value { overflow-wrap: anywhere; }
html[dir="rtl"] .stack .value[dir="ltr"], html[dir="rtl"] .row.stacked [dir="ltr"] { text-align: right; }
.row.copied .label { color: var(--green); }
.question { color: var(--secondary); font-size: 0.875rem; }
.row .done { display: inline-flex; color: var(--green); }
.row .done .icon { width: 1.35em; height: 1.35em; }
.row .not-yet { color: var(--tertiary); }

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(#a8adba, #868a96);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.avatar .icon { width: 60%; height: 60%; }
.avatar.large { width: 76px; height: 76px; margin-bottom: 10px; font-size: 1.75rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge.green { background: var(--green-fill); color: var(--green); }
.badge.blue { background: var(--tint-fill); color: var(--tint); }
.badge.orange { background: var(--orange-fill); color: var(--orange); }
.badge.red { background: var(--red-fill); color: var(--red); }

.identity { display: grid; justify-items: center; gap: 4px; padding: 4px 8px 12px; text-align: center; }
.identity h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; }
.identity .apple-id { margin-bottom: 6px; color: var(--secondary); overflow-wrap: anywhere; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 18px 16px 8px; text-align: center; }
.empty h2 { font-size: 1.25rem; font-weight: 700; }
.empty p { max-width: 24em; color: var(--secondary); }
.spacer { height: 12px; }

.footnote { margin: 10px 8px; color: var(--secondary); font-size: 0.8125rem; }

/* MARK: Fields */

.field { position: relative; display: block; padding: 10px 16px 10px; }
.field-label { display: block; margin-bottom: 2px; color: var(--secondary); font-size: 0.8125rem; transition: color 0.15s ease; }
.field:focus-within .field-label { color: var(--tint); }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--label);
  font-size: max(16px, 1.0625rem); /* under 16px, iPhone zooms the page into the field */
  line-height: 1.45;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field select {
  padding-inline-end: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 18'%3E%3Cpath d='M2.5 6.5 6 3l3.5 3.5M2.5 11.5 6 15l3.5-3.5' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right center / 12px 18px;
  cursor: pointer;
}
html[dir="rtl"] .field select { background-position: left center; }
input::placeholder, textarea::placeholder { color: var(--tertiary); opacity: 1; }
html[dir="rtl"] .field input[dir="ltr"] { text-align: right; }
html[dir="rtl"] .field input[dir="ltr"]::placeholder { text-align: right; }

.date-readout { display: flex; flex-wrap: wrap; gap: 6px; }
.date-readout:not(:empty) { margin: 8px 0 2px; }
.date-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--fill);
  font-size: 0.875rem;
}
.date-chip small { color: var(--secondary); font-size: 0.75rem; }
.date-meta { width: 100%; color: var(--secondary); font-size: 0.8125rem; }
.warning { color: var(--orange); font-size: 0.8125rem; }

/* MARK: Buttons */

.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin: 16px 0 0;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--tint);
  color: #ffffff;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease-out, opacity 0.2s ease, background-color 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.button:active:not([disabled]) { transform: scale(0.97); }
.button[disabled] { opacity: 0.35; cursor: default; }
.button.tinted { background: var(--tint-fill); color: var(--tint); }
.button.plain { width: auto; min-height: 44px; margin: 8px auto 0; padding: 0 14px; background: none; color: var(--tint); font-weight: 500; }
.button.plain[disabled] { color: var(--secondary); opacity: 1; }
.button.small { width: auto; min-height: 36px; margin: 0; padding: 0 16px; font-size: 0.9375rem; }
.button.danger { color: var(--red); }
.button .icon { width: 1.15em; height: 1.15em; stroke-width: 2.1; }
.center .button.plain { display: inline-flex; }

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 6px;
  border: 0;
  background: none;
  color: var(--tint);
  cursor: pointer;
}

.spinner {
  flex: none;
  width: 1.05em;
  height: 1.05em;
  border: 2.4px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error { display: flex; align-items: flex-start; gap: 8px; margin: 14px 8px 0; color: var(--red); font-size: 0.9375rem; }
.error .icon { margin-top: 0.15em; }
.error-text { color: var(--red); }
.success { color: var(--green); }
.support { margin-top: 8px; }

/* MARK: The verification code, a box for each digit */

.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.otp-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  font-size: 16px;
}
.otp-input::selection { background: transparent; }
.otp-box {
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 6;
  border-radius: 12px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--separator);
  font-size: 1.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 0.15s ease;
}
.otp-box.active { box-shadow: inset 0 0 0 2px var(--tint); }
.otp-box.active:not(.filled)::after {
  content: "";
  width: 2px;
  height: 1.1em;
  border-radius: 1px;
  background: var(--tint);
  animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* The passcode "no": a quick, damped shake. */
.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  15% { transform: translateX(-10px); }
  30% { transform: translateX(9px); }
  45% { transform: translateX(-7px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
  90% { transform: translateX(1px); }
}

/* MARK: Camera */

.camera-wrap { padding: 12px; }
.camera {
  position: relative;
  overflow: hidden;
  max-height: 62vh;
  margin: 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  background: #0c0c0d;
}
.camera video { display: block; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera video.playback { transform: none; }
.camera-idle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: end;
  padding: 24px;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
}
.camera-idle p { position: relative; max-width: 22em; font-size: 0.9375rem; }
.face-guide {
  position: absolute;
  top: 44%;
  left: 50%;
  width: 60%;
  aspect-ratio: 3 / 4;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}
.camera-idle .face-guide { border: 2px dashed rgba(255, 255, 255, 0.45); box-shadow: none; }
.read {
  position: absolute;
  inset-inline: 12px;
  bottom: 12px;
  padding: 12px 16px;
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.6);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}
.read.static { position: relative; inset: auto; }
.count { position: absolute; top: 12px; inset-inline-end: 12px; display: grid; place-items: center; width: 52px; height: 52px; color: #ffffff; font-weight: 700; }
.count svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.count circle { fill: none; stroke-width: 4; }
.count .track { stroke: rgba(255, 255, 255, 0.25); }
.count .arc { stroke: #ff453a; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; }
.count span { position: relative; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* MARK: Password checklist, as on Apple's own form */

.checker-slot:not(:empty) { margin-top: 10px; }
.checker { padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 0.9375rem; }
.checker .head { margin-bottom: 4px; color: var(--secondary); font-size: 0.8125rem; }
.checker .req { display: flex; align-items: center; gap: 8px; padding: 2px 0; color: var(--secondary); }
.checker .req.met { color: var(--label); }
.checker .dot { display: grid; flex: none; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--tertiary); border-radius: 50%; }
.checker .req.met .dot { border-color: var(--green); background: var(--green); color: #ffffff; }
.checker .dot .icon { width: 12px; height: 12px; stroke-width: 3; }
.checker .strength { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--secondary); font-size: 0.8125rem; }
.checker .bars { display: flex; gap: 3px; direction: ltr; }
.checker .bars i { width: 26px; height: 5px; border-radius: 3px; background: var(--fill-strong); }
.checker .verdict { margin-top: 6px; font-size: 0.8125rem; }

/* Colour dots */
.colours { display: flex; flex-wrap: wrap; gap: 2px; margin: 4px -6px 0; }
.colours button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.colours button i { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px var(--separator); transition: transform 0.15s ease; }
.colours button[aria-checked="true"] i { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--tint); transform: scale(0.9); }

/* MARK: Home Screen banner and footer */

.banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 24px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
}
.banner-icon { flex: none; width: 52px; height: 52px; border-radius: 22.37%; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
.banner-text { flex: 1; padding-inline-end: 24px; }
.banner-text h2 { margin-bottom: 2px; font-size: 1.0625rem; font-weight: 600; }
.banner-text p { margin-bottom: 10px; color: var(--secondary); font-size: 0.9375rem; }
.banner-close, .sheet-close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--secondary);
  cursor: pointer;
}
.banner-close::after, .sheet-close::after { content: ""; position: absolute; inset: -7px; }
.banner-close { top: 10px; inset-inline-end: 10px; }
.banner-close .icon, .sheet-close .icon { width: 14px; height: 14px; stroke-width: 2.6; }

.footer { display: grid; justify-items: center; gap: 8px; margin: 40px 0 4px; color: var(--secondary); }
.segmented { display: inline-grid; grid-auto-columns: 1fr; grid-auto-flow: column; padding: 2px; border-radius: 10px; background: var(--fill); }
.segmented button {
  min-width: 96px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.segmented button[aria-checked="true"] { background: var(--segment-on); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04); font-weight: 600; }
.brand { direction: ltr; font-size: 0.75rem; letter-spacing: 0.02em; }

/* MARK: Sheet */

.sheet-host { position: fixed; inset: 0; z-index: 100; }
.scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; }
.sheet {
  --card: var(--card-raised);
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  max-width: 640px;
  max-height: calc(100% - max(24px, env(safe-area-inset-top)));
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  outline: none;
  background: var(--sheet);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  transform: translate3d(0, 100%, 0);
  will-change: transform;
}
.sheet-header { position: relative; flex: none; padding: 8px 60px 8px; text-align: center; touch-action: none; cursor: grab; }
.sheet-header:active { cursor: grabbing; }
.grabber { width: 36px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: var(--tertiary); }
.sheet-header h2 { font-size: 1.0625rem; font-weight: 600; }
.sheet-close { top: 16px; inset-inline-end: 16px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-body > .button + .button { margin-top: 10px; }
@media (min-width: 700px) {
  .sheet { bottom: 24px; border-radius: 24px; }
}
html.sheet-open, html.sheet-open body { overflow: hidden; }

.home-preview {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 128px;
  margin: 4px auto 16px;
  padding: 20px 0 12px;
  border-radius: 28px;
  background: linear-gradient(155deg, #5b8def, #8d6be8 55%, #e985a8);
}
.home-preview img { width: 64px; height: 64px; border-radius: 22.37%; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
.home-preview span { color: #ffffff; font-size: 0.75rem; font-weight: 500; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.sheet-lead { max-width: 26em; margin: 0 auto 18px; color: var(--secondary); text-align: center; }
.steps { margin: 0 0 8px; padding: 0; overflow: hidden; border-radius: var(--radius); background: var(--card); list-style: none; }
.step { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.step + .step::before { inset-inline-start: 58px; }
.step-number {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tint);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 700;
}
.step-text { flex: 1; min-width: 0; }
.step-detail { margin-top: 2px; color: var(--secondary); font-size: 0.875rem; }
.step-symbol { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--fill); color: var(--tint); }
.step-symbol .icon { width: 22px; height: 22px; }

/* MARK: Toast */

.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border: 0.5px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--glass-shadow);
  font-size: 0.9375rem;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 12px) scale(0.94);
  transition: opacity 0.25s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast .icon { color: var(--green); }
.toast.alert .icon { color: var(--red); }

/* MARK: Moving between screens: in from the trailing edge and back, mirrored right to left. */

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: 0.4s;
    animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
  }
  html[data-nav="push"]::view-transition-new(root) { animation-name: in-from-end; }
  html[data-nav="push"]::view-transition-old(root) { animation-name: out-to-start; }
  html[data-nav="pop"]::view-transition-new(root) { animation-name: in-from-start; }
  html[data-nav="pop"]::view-transition-old(root) { z-index: 1; animation-name: out-to-end; }
  html[dir="rtl"][data-nav="push"]::view-transition-new(root) { animation-name: in-from-end-rtl; }
  html[dir="rtl"][data-nav="push"]::view-transition-old(root) { animation-name: out-to-start-rtl; }
  html[dir="rtl"][data-nav="pop"]::view-transition-new(root) { animation-name: in-from-start-rtl; }
  html[dir="rtl"][data-nav="pop"]::view-transition-old(root) { animation-name: out-to-end-rtl; }
}
@keyframes in-from-end { from { transform: translateX(100%); } }
@keyframes out-to-start { to { opacity: 0.6; transform: translateX(-28%); } }
@keyframes in-from-start { from { opacity: 0.6; transform: translateX(-28%); } }
@keyframes out-to-end { to { transform: translateX(100%); } }
@keyframes in-from-end-rtl { from { transform: translateX(-100%); } }
@keyframes out-to-start-rtl { to { opacity: 0.6; transform: translateX(28%); } }
@keyframes in-from-start-rtl { from { opacity: 0.6; transform: translateX(28%); } }
@keyframes out-to-end-rtl { to { transform: translateX(-100%); } }

/* MARK: Readers' settings */

@media (prefers-reduced-motion: reduce) {
  .button:active:not([disabled]), .nav-button:active { transform: none; }
  .toast { transform: translate(-50%, 0); transition: opacity 0.2s ease; }
  .toast.show { transform: translate(-50%, 0); }
  .sheet-host { opacity: 0; transition: opacity 0.2s ease; }
  .sheet-host.shown { opacity: 1; }
  .sheet-host .scrim { opacity: 1 !important; }
  .otp-box.active:not(.filled)::after { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav-button, .toast, .read {
    background: var(--card-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .nav::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask-image: none; mask-image: none; }
}

@media (prefers-contrast: more) {
  :root { --separator: rgba(60, 60, 67, 0.6); --secondary: rgba(60, 60, 67, 0.85); --tertiary: rgba(60, 60, 67, 0.55); }
  .group, .banner, .steps, .otp-box, .nav-button { box-shadow: 0 0 0 1px var(--separator); }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root { --separator: rgba(235, 235, 245, 0.45); --secondary: rgba(235, 235, 245, 0.85); --tertiary: rgba(235, 235, 245, 0.55); }
}
