/* Recall Az-Zain: phone-first, teal shell on a light slate ground, large tap targets (>=44px),
   works at 360px. One calm look: no gradients, no decoration beyond what a working screen needs. */
:root {
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-light: #5eead4;
  --teal-100: #ccfbf1;
  --teal-050: #f0fdfa;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #526175;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f1f5f9;
  --card: #ffffff;
  --quiet: #f8fafc;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --err-line: #fecaca;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --ok-line: #a7f3d0;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --warn: #b45309;
  --radius: 14px;
  --radius-sm: 12px;
  --tap: 48px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-up: 0 -2px 12px rgba(15, 23, 42, 0.1), 0 -1px 2px rgba(15, 23, 42, 0.06);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* The installed app: no rubber-band or pull-to-reload on the shell (Muat semula / a tab tap refresh). */
@media (display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen) {
  html,
  body {
    overscroll-behavior-y: none;
  }
}

::selection {
  background: var(--teal-100);
  color: var(--ink);
}

h1 {
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
h2 {
  font-size: 1.0625rem;
  line-height: 1.3;
  margin: 0 0 var(--sp-1);
}

a {
  color: var(--teal-dark);
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
main:focus,
main:focus-visible {
  outline: none;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
p {
  margin: 0 0 var(--sp-2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--teal);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 10;
}
.skip:focus {
  left: 0;
}

/* --- Touch hygiene (pwa-native-feel §5) --- */
button,
a,
label,
summary,
[role="button"] {
  touch-action: manipulation;
}
header,
nav,
button,
.btn,
.chip,
.key,
summary {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
input,
textarea,
select,
.teks,
table {
  -webkit-user-select: text;
  user-select: text;
}

/* --- Top bar --- */
.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  min-height: 56px;
  padding: var(--sp-2) var(--sp-4);
  padding-top: calc(var(--sp-2) + env(safe-area-inset-top));
  background: var(--teal);
  color: #fff;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-icon {
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.brand strong {
  font-weight: 800;
}

/* --- Nav tabs --- */
.tabs {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-3) var(--sp-4);
  margin: 0 calc(-1 * var(--sp-4)) var(--sp-2);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs a {
  flex: 0 0 auto;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--sp-4);
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}
.tabs a.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
/* Tapped, waiting for the page: the colour moves at once; aria-current stays put until it lands. */
.tabs a.pending {
  background: var(--teal-100);
  border-color: var(--teal);
  color: var(--teal-dark);
}
.tabs a.on.pending {
  background: var(--teal-dark);
  color: #fff;
}

/* --- Layout --- */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--sp-4) calc(var(--sp-5) * 2 + env(safe-area-inset-bottom));
}
body.out .wrap {
  padding-top: var(--sp-4);
}
.list-head {
  margin: var(--sp-2) 0 var(--sp-4);
}
.list-head > .muted {
  margin: var(--sp-1) 0 0;
}
.list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* --- Cards --- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.card.notice {
  text-align: center;
  padding: var(--sp-5) var(--sp-4);
}
.card.notice h1,
.card.notice h2 {
  margin-bottom: var(--sp-2);
}
.card.notice p {
  margin-bottom: var(--sp-4);
}
.card-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.card-head h2 {
  margin: 0;
  flex: 1;
}

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.75rem;
  padding: 0 var(--sp-2);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.badge.prio {
  background: var(--teal-050);
  color: var(--teal-dark);
  border: 1px solid var(--teal-light);
}

/* --- Patient cards --- */
.names {
  font-size: 1.125rem;
  line-height: 1.25;
}
.patient .body {
  margin-top: var(--sp-3);
}
/* An open card shows everything; its disclosure toggle is hidden so it cannot fold by accident. */
.patient[data-state="open"] .body-toggle,
.patient[data-state="saving"] .body-toggle {
  display: none;
}
.body-toggle {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: calc(-1 * var(--sp-2)) 0 0;
  color: var(--teal-dark);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}
.body-toggle::-webkit-details-marker {
  display: none;
}
.body-toggle::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: var(--sp-2);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.body[open] > .body-toggle::after {
  transform: translateY(2px) rotate(-135deg);
}

/* A finished card is quieter: no shadow, a muted ground, the result on one line. */
.patient[data-state="done"],
.patient[data-state="saved"] {
  background: var(--quiet);
  box-shadow: none;
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-2);
}
.patient[data-state="done"] .names,
.patient[data-state="saved"] .names {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-2);
}
.patient[data-state="done"] .badge.prio,
.patient[data-state="saved"] .badge.prio {
  background: transparent;
  border-color: var(--line-2);
  color: var(--muted);
}
.patient[data-state="done"] .body,
.patient[data-state="saved"] .body {
  margin-top: var(--sp-2);
}

.result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  margin: var(--sp-2) 0 0;
}
.result[hidden] {
  display: none;
}
.result-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 var(--sp-3);
  border-radius: 999px;
  background: var(--teal-050);
  border: 1px solid var(--teal-light);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.875rem;
}
.result-remark {
  color: var(--muted);
  font-size: 0.875rem;
  flex-basis: 100%;
}
.result-remark:empty {
  display: none;
}
.result-flash {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  font-weight: 700;
  font-size: 0.875rem;
}
.result-flash::before {
  content: "";
  width: 5px;
  height: 10px;
  margin: 0 2px -1px 3px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.patient[data-state="saved"] .result-flash {
  display: inline-flex;
}

/* --- Definition meta list --- */
.meta {
  margin: 0 0 var(--sp-3);
  display: grid;
  gap: var(--sp-1);
}
.meta > div {
  display: grid;
  grid-template-columns: 7.25rem 1fr;
  gap: var(--sp-2);
}
.meta dt {
  color: var(--muted);
  font-size: 0.875rem;
  padding-top: 1px;
}
.meta dd {
  margin: 0;
}

/* --- Buttons --- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.btn:active {
  background: var(--bg);
}
.btn.small {
  min-height: 40px;
  padding: 0 var(--sp-3);
  font-size: 0.875rem;
}
.btn.wide {
  width: 100%;
}
.btn.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn.primary:active {
  background: var(--teal-dark);
}
.btn.warn {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.btn.ghost:active {
  background: rgba(255, 255, 255, 0.12);
}
.btn.copy.ok {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: var(--ok);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: default;
}

/* Busy: the label stays readable, a small ring turns beside it. */
.btn.busy {
  pointer-events: none;
  opacity: 0.85;
}
.btn.busy::before,
.key.busy::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ico {
  flex: 0 0 auto;
}

/* --- Call / WhatsApp actions: the two biggest targets on the card --- */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.actions .btn {
  min-height: 56px;
  font-size: 1.0625rem;
}
.btn.call {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.btn.call:active {
  background: var(--teal-dark);
}
.btn.wa {
  background: #25d366;
  border-color: #1fb457;
  color: #06310f;
}
.btn.wa:active {
  background: #1fb457;
}

/* --- Forms --- */
.field {
  margin-bottom: var(--sp-3);
}
.field label,
.pin-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--sp-1);
}
.opt {
  font-weight: 400;
  color: var(--muted);
}
input,
select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--sp-3);
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  appearance: none;
}
input[type="date"] {
  display: flex;
  align-items: center;
}
input:focus,
select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
/* iOS zooms into any input under 16px: hold the floor on touch screens. */
@media (pointer: coarse) {
  input:not([type="radio"]):not([type="checkbox"]),
  select,
  textarea {
    font-size: max(16px, 1rem);
  }
}
select {
  background-image: url("/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}
.mark {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-3);
}
.cap-form {
  max-width: 14rem;
}

/* Result chips: real radio buttons (they post without JavaScript), drawn as large pills. */
.results {
  border: 0;
  margin: 0 0 var(--sp-3);
  padding: 0;
  min-width: 0;
}
.results legend {
  padding: 0;
  margin-bottom: var(--sp-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.chip {
  position: relative;
  flex: 1 1 auto;
  cursor: pointer;
}
.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  text-align: center;
  white-space: nowrap;
}
.chip input:checked + span {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.chip input:focus-visible + span {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.chip:active span {
  background: var(--teal-050);
}
.chip input:checked:active + span {
  background: var(--teal-dark);
}
.chip input:disabled + span {
  opacity: 0.6;
}

/* The booking date only matters for Booked: shown when Booked is picked (always, without :has). */
.mark:not(:has(input[value="Booked"]:checked)) .book-date {
  display: none;
}

.mark-msg {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3);
  border-radius: 10px;
  background: var(--err-bg);
  border: 1px solid var(--err-line);
  color: var(--err);
  font-weight: 600;
}
.mark-msg[hidden] {
  display: none;
}
.mark-msg .btn {
  margin-top: var(--sp-2);
  width: 100%;
  color: var(--err);
  border-color: var(--err-line);
}

/* Saving: the card holds still, controls dim, the button says what is happening. */
.patient[data-state="saving"] .chips,
.patient[data-state="saving"] .field {
  opacity: 0.6;
}

.saved {
  margin: var(--sp-2) 0 0;
  font-weight: 600;
  color: var(--ok);
}

/* --- Progress line --- */
.progress {
  margin-top: var(--sp-3);
}
.progress-line {
  margin: 0 0 6px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.progress-line strong {
  color: var(--ink);
}
progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  color: var(--teal);
  overflow: hidden;
  appearance: none;
}
progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 999px;
}
progress::-webkit-progress-value {
  background: var(--teal);
  border-radius: 999px;
}
progress::-moz-progress-bar {
  background: var(--teal);
  border-radius: 999px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
  background: var(--card);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty-state .btn {
  min-width: 12rem;
}

/* --- Alerts --- */
.alert {
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-3);
  font-weight: 600;
}
.alert[hidden] {
  display: none;
}
.alert.err {
  background: var(--err-bg);
  color: var(--err);
  border: 1px solid var(--err-line);
}
.alert.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}
.alert.info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid #bfdbfe;
}

/* --- Skeleton: the in-content placeholder while the Apps Script answers --- */
/* Streamed first load: once the real content follows the skeleton inside #page, hide it. (Not
   :last-child: WebKit and Blink never match it while the parent is still being parsed.) */
.page > .sk:has(+ *) {
  display: none;
}
.sk {
  padding-top: var(--sp-2);
}
.sk-line {
  height: 14px;
  border-radius: 7px;
  background: #e5eaf0;
  margin-bottom: var(--sp-3);
  width: 82%;
}
.sk-h1 {
  height: 24px;
  width: 58%;
}
.sk-sub {
  width: 34%;
  margin-bottom: var(--sp-5);
}
.sk-name {
  height: 18px;
  width: 48%;
}
.sk-short {
  width: 40%;
}
.sk-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.sk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.sk-btn {
  height: 56px;
  border-radius: var(--radius-sm);
  background: #e5eaf0;
}
@media (prefers-reduced-motion: no-preference) {
  .sk-line,
  .sk-btn {
    animation: sk-pulse 1.2s ease-in-out infinite;
  }
}
@keyframes sk-pulse {
  50% {
    opacity: 0.55;
  }
}

/* --- Sign in --- */
.signin {
  max-width: 360px;
  margin: var(--sp-4) auto var(--sp-5);
  text-align: center;
}
.signin > .muted {
  margin: var(--sp-1) 0 var(--sp-4);
}
.signin-brand {
  margin-bottom: var(--sp-4);
}
.signin-brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}
.signin-brand .sys {
  display: block;
  margin-top: var(--sp-2);
  color: var(--muted);
  font-weight: 600;
}
.signin .field,
.signin .pin-label {
  text-align: left;
}
.signin .alert {
  text-align: left;
}
.pin-input {
  text-align: center;
  letter-spacing: 0.5rem;
  font-size: 1.375rem !important;
  min-height: 56px;
  margin-bottom: var(--sp-3);
}
.pinpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 60px;
  font: inherit;
  font-size: 1.375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.key:active {
  background: var(--teal-050);
}
.key.soft {
  background: var(--bg);
  font-size: 1rem;
}
.key.go {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  font-size: 1.0625rem;
}
.key.go:active {
  background: var(--teal-dark);
}
.key:disabled {
  opacity: 0.5;
}

/* --- Tables (Ringkasan) --- */
.branch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.branch-head h2 {
  margin: 0;
}
.branch-head p {
  margin: 0;
}
.table-scroll {
  overflow-x: auto;
}
table.stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 480px;
  font-variant-numeric: tabular-nums;
}
table.stats th,
table.stats td {
  padding: 10px 8px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.stats tbody tr:last-child th,
table.stats tbody tr:last-child td {
  border-bottom: 0;
}
table.stats thead th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
table.stats th[scope="row"],
table.stats thead th:first-child {
  text-align: left;
}
table.stats tbody th {
  font-weight: 700;
}

/* --- Weekly bar chart --- */
.legend {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}
.dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
  margin: 0 0.3rem 0 0.8rem;
  vertical-align: middle;
}
.dot.tm {
  background: var(--teal);
}
.dot.kb {
  background: var(--teal-light);
}
.chart-scroll {
  overflow-x: auto;
}
svg.chart {
  display: block;
  height: 160px;
  min-width: 320px;
  width: 100%;
}
svg.chart .axis {
  stroke: var(--line-2);
  stroke-width: 1;
}
svg.chart .bar.tm {
  fill: var(--teal);
}
svg.chart .bar.kb {
  fill: var(--teal-light);
}
svg.chart .xlab {
  fill: var(--muted);
  font-size: 10px;
}

/* --- Skrip --- */
.skrip-card .card-head {
  margin-bottom: var(--sp-2);
}
.teks {
  margin: var(--sp-2) 0 0;
  padding: var(--sp-3);
  background: var(--teal-050);
  border: 1px solid var(--teal-100);
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* --- Home tiles --- */
.tiles {
  display: grid;
  gap: var(--sp-3);
}
.tile {
  display: block;
  padding: var(--sp-4);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
}
.tile:active {
  background: var(--quiet);
}
.tile-title {
  display: block;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--teal-dark);
}
.tile-sub {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 2px;
}

@media (min-width: 560px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Install invite: an inline card in the page flow, never over a control --- */
.install {
  max-width: 720px;
  margin: var(--sp-3) auto 0;
  padding: var(--sp-3);
  background: var(--card);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.in .install {
  margin: var(--sp-3) var(--sp-4) 0;
}
body.out .install {
  margin: 0 var(--sp-4) var(--sp-5);
}
@media (min-width: 752px) {
  body.in .install,
  body.out .install {
    margin-left: auto;
    margin-right: auto;
  }
}
body.out .install {
  max-width: 360px;
}
.install[hidden] {
  display: none;
}
/* Drawn from the first streamed bytes (public/early.js decides), so it does not push the page down later. */
html.js:not(.no-install) .install[hidden] {
  display: block;
}
.install-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.install-icon {
  flex: 0 0 auto;
  border-radius: 10px;
}
.install-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.3;
}
.install-text strong {
  display: block;
  font-size: 0.9375rem;
}
.install-text span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}
.install-row .btn {
  flex: 0 0 auto;
}
.install-row .btn[hidden] {
  display: none;
}
.install-x {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 -6px 0 -4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.install-x:active {
  background: var(--bg);
}
.install-steps {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}
.install-steps[hidden],
.install-steps [hidden] {
  display: none;
}
.install-steps ol {
  margin: 0;
  padding-left: 1.3rem;
}
.install-steps li {
  margin-bottom: var(--sp-2);
}
.install-steps li:last-child {
  margin-bottom: 0;
}
.install-steps p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
