/* Application layer: motion, auth pages, dashboard widgets and forms.
   Motion follows docs/11-design-system.md section 6: it explains a change and never decorates.
   No scroll reveals, no cursor effects, no opacity on buttons. */

/* Page to page: a short cross-fade so moving between pages feels continuous. */
@view-transition {
  /* Chromium can abort auto transitions when a marker action navigates while the map
     is still settling. Keep navigation deterministic; map controls already animate locally. */
  navigation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--dur-toggle);
  animation-timing-function: var(--ease-enter);
}

.sidebar {
  view-transition-name: sidebar;
}

/* Interactive cards lift slightly on hover and settle on press. */
.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur-toggle) var(--ease-enter), box-shadow var(--dur-toggle) var(--ease-enter), border-color var(--dur-toggle) linear;
}

@media (hover: hover) {
  .card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised);
    border-color: var(--border);
    text-decoration: none;
  }

  .list-row.lift:hover {
    transform: translateX(2px);
  }
}

.card-link:active {
  transform: translateY(0);
}

.list-row {
  transition: background-color var(--dur-press) linear, transform var(--dur-toggle) var(--ease-enter);
}

/* Loading skeletons pulse in place, matching the final layout. */
.skeleton {
  border-radius: var(--radius-s);
  background: var(--border-soft);
  animation: pulse 1.4s ease-in-out infinite;
}

.skeleton-line { height: 14px; }
.skeleton-title { height: 22px; width: 50%; }
.skeleton-row { height: 64px; border-radius: var(--radius-m); }
.skeleton-hero { height: 40px; width: 40%; }
.skeleton-block { height: 180px; border-radius: var(--radius-l); }
.skeleton-block-l { height: 240px; }
.notice-flat { border-radius: 0; }
.auth-center { text-align: center; justify-items: center; }

@keyframes pulse {
  0%, 100% { background-color: var(--border-soft); }
  50% { background-color: var(--bg); }
}

/* Toast slides up from the bottom edge. */
.toast {
  animation: toast-in var(--dur-sheet) var(--ease-enter);
}

@keyframes toast-in {
  from { transform: translate(-50%, var(--space-16)); }
  to { transform: translate(-50%, 0); }
}

/* Dialogs scale in from 96 percent. */
dialog.sheet[open] {
  animation: sheet-in var(--dur-sheet) var(--ease-enter);
}

@keyframes sheet-in {
  from { transform: scale(0.96) translateY(var(--space-8)); }
  to { transform: none; }
}

/* Inline progress for button work. */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
  .skeleton { animation: none; }
}

/* Sign in and sign up */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-24) var(--space-16);
  background: var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: var(--space-24);
  padding: var(--space-32) var(--space-24);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-raised);
}

.auth-head {
  display: grid;
  justify-items: center;
  gap: var(--space-12);
  text-align: center;
}

.auth-head .brand-mark {
  width: min(280px, 82vw);
  height: auto;
}

.form-error {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-m);
  background: var(--danger-tint);
  color: var(--danger);
  font-size: var(--fs-subhead);
  line-height: var(--lh-subhead);
}

.field-error {
  font-size: var(--fs-footnote);
  line-height: var(--lh-footnote);
  color: var(--danger);
}

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

/* Dashboard */
.greeting {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-tint);
  color: var(--primary);
  font-size: var(--fs-title-3);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border-soft), 0 6px 14px rgba(16, 24, 40, 0.10);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-l {
  width: 96px;
  height: 96px;
  font-size: var(--fs-title-1);
}

.dash-grid {
  display: grid;
  gap: var(--space-24);
}

@media (min-width: 1024px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: start;
  }
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-12);
}

@media (min-width: 640px) {
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-16);
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
  color: var(--text-1);
  text-decoration: none;
}

.stat-value {
  font-size: var(--fs-title-1);
  line-height: var(--lh-title-1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Today's doses: a raised disc with a progress ring, plus a timeline. */
.dose-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 6px 0 var(--border-soft), 0 16px 28px rgba(16, 24, 40, 0.12);
}

.dose-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}

.dose-ring .bar {
  stroke: var(--success);
  transition: stroke-dashoffset var(--dur-sheet) var(--ease-enter);
}

.dose-ring .track {
  stroke: var(--border-soft);
}

.doses {
  display: grid;
  gap: var(--space-8);
}

.dose {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: var(--space-12);
  align-items: center;
  padding: var(--space-12);
  border-radius: var(--radius-m);
  border: 1px solid var(--border-soft);
  background: var(--surface);
}

.dose-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dose.is-taken {
  background: var(--success-tint);
  border-color: transparent;
}

.dose.is-skipped {
  background: var(--bg);
  border-color: transparent;
  color: var(--text-2);
}

.dose.is-next {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* Date tile for appointments: a small raised calendar leaf. */
.date-tile {
  display: grid;
  justify-items: center;
  width: 56px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 3px 0 var(--border-soft), 0 6px 12px rgba(16, 24, 40, 0.08);
  text-align: center;
}

.date-tile-month {
  width: 100%;
  padding: var(--space-4) 0;
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-caption);
  line-height: var(--lh-caption);
  font-weight: 700;
  text-transform: uppercase;
}

.date-tile-day {
  padding: var(--space-4) 0 var(--space-8);
  font-size: var(--fs-title-2);
  line-height: var(--lh-title-2);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Profile completeness bar */
.meter {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-soft);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width var(--dur-sheet) var(--ease-enter);
}

/* Chip input for allergies, conditions and similar lists */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.chip-x {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 32px;
  padding: 0 var(--space-4) 0 var(--space-12);
  border-radius: var(--radius-full);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: var(--fs-subhead);
  line-height: var(--lh-subhead);
  font-weight: 600;
}

.chip-x button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

@media (hover: hover) {
  .chip-x button:hover { background: var(--surface); }
}

.inline-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-8);
}

/* Sections on long forms */
.form-section {
  display: grid;
  gap: var(--space-20);
}

.form-grid {
  display: grid;
  gap: var(--space-16);
  align-items: start;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-2 { grid-column: span 2; }
}

@media (min-width: 1280px) {
  .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.section-nav {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  padding-bottom: var(--space-4);
}

.section-nav a {
  flex-shrink: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-12);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  font-size: var(--fs-subhead);
  line-height: var(--lh-subhead);
  font-weight: 600;
  text-decoration: none;
}

@media (hover: hover) {
  .section-nav a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
}

.sticky-save {
  position: sticky;
  bottom: var(--space-16);
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-float);
}

/* Day picker for reminders */
.days {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.days button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--dur-toggle) linear, color var(--dur-toggle) linear, border-color var(--dur-toggle) linear;
}

.days button[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  align-items: center;
}

.times .input {
  width: auto;
  min-width: 120px;
}

/* Medicine card on the reminders page: a raised pill blister object. */
.med-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-16);
  align-items: start;
}

.pill-obj {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 3px 0 var(--border-soft), 0 6px 12px rgba(16, 24, 40, 0.08);
  display: grid;
  place-items: center;
  color: var(--primary);
}

.empty-art {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--primary);
  border: 1px solid var(--border-soft);
  box-shadow: 0 6px 0 var(--border-soft), 0 14px 24px rgba(16, 24, 40, 0.10);
}

.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  padding: var(--space-12);
  border-radius: var(--radius-l);
  border: 1px solid var(--border-soft);
}

.user-card .avatar {
  width: 40px;
  height: 40px;
  font-size: var(--fs-headline);
  box-shadow: none;
}

.nav-group {
  display: grid;
  gap: var(--space-4);
}

.offline {
  display: none;
}

.is-offline .offline {
  display: flex;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.file-row-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: nowrap;
}

.chip-on {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-tint);
}

.facts .span-2 {
  grid-column: 1 / -1;
}

@media (min-width: 1024px) {
  .search-side {
    position: sticky;
    top: var(--space-24);
  }
}

.hero-detail {
  display: grid;
  gap: var(--space-16);
}

.price-hero {
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.price-hero .price {
  font-size: var(--fs-large-title);
  line-height: var(--lh-large-title);
}

.platform-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-m);
  background: var(--bg);
  color: var(--text-1);
  font-weight: 700;
  font-size: var(--fs-subhead);
  border: 1px solid var(--border-soft);
}

.stack-4 {
  display: grid;
  gap: var(--space-4);
}

/* Grid items default to min-width:auto, which lets wide content stretch the page on phones. */
.shell > * {
  min-width: 0;
}

.dose-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-24);
}

.dose-list {
  flex: 1;
  min-width: 0;
}

.dose-actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

@media (max-width: 639px) {
  .dose-wrap {
    flex-direction: column;
    align-items: center;
  }

  .dose-list {
    width: 100%;
  }

  .dose {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .dose > :last-child {
    grid-column: 1 / -1;
    justify-self: end;
  }

  .greeting .avatar-l {
    width: 64px;
    height: 64px;
    font-size: var(--fs-title-3);
  }
}

/* Reviews (D-43) */
.rating-pair {
  display: grid;
  gap: var(--space-24);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border-soft);
}

@media (min-width: 640px) {
  .rating-pair { grid-template-columns: 1fr 1fr; }
}

.stars {
  display: inline-flex;
  gap: var(--space-4);
  color: var(--border);
}

.stars .on {
  color: var(--warning);
}

.star-picker {
  display: flex;
  gap: var(--space-4);
}

.star-picker button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-m);
  background: transparent;
  color: var(--border);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-enter), color var(--dur-press) linear;
}

.star-picker button.on {
  color: var(--warning);
}

.star-picker button:active {
  transform: scale(0.9);
}

.review-form {
  padding: var(--space-16);
  border-radius: var(--radius-l);
  background: var(--surface-sunken);
  border: 1px solid var(--border-soft);
}

.review {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--border-soft);
}

.review:last-child {
  border-bottom: 0;
}

.avatar-s {
  width: 32px;
  height: 32px;
  font-size: var(--fs-footnote);
  box-shadow: none;
}

.danger-zone {
  border-color: var(--danger-tint);
}

/* Doctor profile (D-55): photo from the hospital's website beside the key facts. */
.doctor-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-24);
  align-items: center;
}

.doctor-hero-photo {
  display: grid;
  justify-items: center;
  gap: var(--space-8);
}

.avatar-xl {
  width: 128px;
  height: 128px;
  border-radius: var(--radius-xl);
  font-size: var(--fs-large-title);
}

.avatar-m {
  width: 44px;
  height: 44px;
  font-size: var(--fs-subhead);
}

.fee {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .sticky-side {
    position: sticky;
    top: var(--space-24);
  }
}

@media (max-width: 640px) {
  .doctor-hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
  }
}

.explore-grid {
  display: grid;
  gap: var(--space-24);
}

@media (min-width: 1024px) {
  .explore-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.emergency-row {
  gap: var(--space-12);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-soft);
}

.emergency-row a.stack-4 {
  color: var(--text-1);
  text-decoration: none;
  min-width: 0;
}

/* Location bar (location.js, 2026-11-04): where distances are measured from, and the controls. */
.loc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-8) var(--space-12);
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border-soft);
}

.loc-icon { display: grid; place-items: center; color: var(--primary); }
.loc-main { display: flex; flex: 1; flex-wrap: wrap; align-items: center; gap: var(--space-8); min-width: 12rem; }
.loc-text { font-weight: 600; }

.loc-live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  padding: 2px var(--space-8);
  border-radius: var(--radius-full);
  background: var(--success-tint);
  color: var(--success);
  font-size: var(--fs-footnote);
  font-weight: 700;
}

.loc-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.loc-live[hidden] { display: none; }
.loc-area { width: auto; min-width: 11rem; }

/* Real map (real-map.js): OpenStreetMap tiles with numbered pins. */
.rmap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-l);
  background: var(--surface-sunken);
  box-shadow: 0 0 0 1px var(--border-soft);
}

.rmap-view {
  position: relative;
  height: var(--rmap-h, 300px);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.rmap-view.is-dragging { cursor: grabbing; }
.rmap-tiles, .rmap-marks { position: absolute; inset: 0; }
.rmap-tile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; user-select: none; -webkit-user-drag: none; }

.rmap-pin {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: -14px 0 0 -14px;
  color: var(--text-1);
  text-decoration: none;
}

.rmap-pin-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--fs-footnote);
  font-weight: 700;
  box-shadow: var(--shadow-float);
}

.rmap-pin-diagnostic .rmap-pin-dot { background: var(--success); }
.rmap-pin-pharmacy .rmap-pin-dot { background: var(--warning); }
.rmap-pin.is-first { z-index: 2; }
.rmap-pin.is-first .rmap-pin-dot { width: 34px; height: 34px; margin: -3px; }

.rmap-pin-label {
  position: absolute;
  top: 50%;
  left: 100%;
  margin-left: var(--space-4);
  transform: translateY(-50%);
  max-width: 12rem;
  padding: 2px var(--space-8);
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  font-size: var(--fs-footnote);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rmap-pin.is-left .rmap-pin-label { right: 100%; left: auto; margin-right: var(--space-4); margin-left: 0; }

.rmap-you { position: absolute; top: 0; left: 0; z-index: 3; margin: -11px 0 0 -11px; }

.rmap-you-dot {
  display: block;
  width: 22px;
  height: 22px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--primary-tint), var(--shadow-float);
}

.rmap-controls {
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  display: grid;
  gap: var(--space-4);
}

.rmap-btn { background: var(--surface); box-shadow: var(--shadow-float); }

.rmap-credit {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 2px var(--space-8);
  border-top-left-radius: var(--radius-s);
  background: var(--surface);
  font-size: 11px;
  line-height: 16px;
}

/* Dashboard: Near you. */
.near-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-16); align-items: stretch; }
/* The map is as tall as the cards beside it, so the row has no empty corner. */
.near-map, .near-map .rmap { display: grid; height: 100%; }
.near-map .rmap-view { height: 100%; min-height: 260px; }
.near-more .num { white-space: nowrap; }
.near-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-12); }
.near-card { display: grid; gap: var(--space-8); align-content: start; }
.near-main { display: grid; gap: var(--space-4); color: var(--text-1); text-decoration: none; }
.near-more { display: grid; gap: var(--space-4); list-style: none; font-size: var(--fs-subhead); }
@media (max-width: 899px) { .near-layout { grid-template-columns: minmax(0, 1fr); } }

/* 3D icons (2026-11-04). The same isometric objects as the page heads, at icon size, each with one
   moving part. A page head's object moves gently all the time; an icon on a card moves once when
   the page opens, then again while the card is hovered, focused or pressed, so a page full of
   cards stays calm. No motion at all when the patient asks for reduced motion. */
.art-dark-top { fill: #48484A; }
.art-dark-left { fill: var(--text-1); }
.art-dark-right { fill: #000; }

.art3d { overflow: visible; }
.i3d { display: block; flex-shrink: 0; }

.a3 { transform-box: fill-box; transform-origin: 50% 50%; }
.a3-grow { transform-origin: 50% 100%; }
.a3-bob { animation: a3-bob 1.6s var(--ease-enter) 1 both; }
.a3-pulse { animation: a3-pulse 1.4s var(--ease-enter) 1 both; }
.a3-grow { animation: a3-grow 1.2s var(--ease-enter) 1 both; }
.a3-press { animation: a3-press 1.4s var(--ease-enter) 1 both; }
.a3-blink { animation: a3-blink 0.9s ease-in-out 2 both; }
.a3-drive { animation: a3-drive 0.6s ease-in-out 2 both; }
.a3-pop { animation: a3-pop 1.4s var(--ease-enter) 1 both; }
.a3-hop { animation: a3-hop 1.4s var(--ease-enter) 1 both; }
.a3-scan { animation: a3-scan 1.8s ease-in-out 1 both; }
.a3-dot { animation: a3-dot 1.2s ease-in-out 1 both; }
.a3-late { animation-delay: 0.15s; }
.a3-later { animation-delay: 0.3s; }

/* Page heads: one object per page, moving slowly. */
.hero-art .a3 { animation-iteration-count: infinite; animation-duration: 3.2s; }
.hero-art .a3-blink { animation-duration: 1.2s; }
.hero-art .a3-drive { animation-duration: 1.6s; }

/* Cards: move again while the patient points at, focuses or presses them. */
:is(a, button, .card, .near-card, .stat):is(:hover, :focus-visible, :focus-within, :active) .i3d .a3,
:is(a, .card):is(:hover, :focus-visible, :active) .tile-art .a3 {
  animation-iteration-count: infinite;
}

@keyframes a3-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes a3-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes a3-grow { 0% { transform: scaleY(0.55); } 60% { transform: scaleY(1.06); } 100% { transform: scaleY(1); } }
@keyframes a3-press { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
@keyframes a3-blink { 0%, 100% { fill-opacity: 1; } 50% { fill-opacity: 0.25; } }
@keyframes a3-drive { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, -2px); } }
@keyframes a3-pop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 70% { transform: translateY(-4px); } }
@keyframes a3-hop { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(-8deg); } }
@keyframes a3-scan { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-26px, 15px); } }
@keyframes a3-dot { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } 60% { transform: translateY(0); } }

/* A 3D icon in the round icon slot of a list row, empty state or card head. */
.empty-art > .i3d { width: 56px; height: 56px; }
.card-icon3d {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

@media (prefers-reduced-motion: reduce) {
  .a3 { animation: none !important; }
}

.reduce-motion .a3 {
  animation: none !important;
}

.i3d-tile {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: var(--tile);
  height: var(--tile);
  border-radius: var(--radius-l);
  background: var(--primary-tint);
}
