/* =========================================================================
   Tutok — Component Library
   Every class referenced in the build contract, styled to a premium bar.
   Screens consume these classes; they do not redefine them.
   ========================================================================= */

/* =========================================================================
   App bar / header
   ========================================================================= */
.appbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--bar-h);
  padding: var(--s-2) var(--s-4);
}
.appbar__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
  flex: 1 1 auto;
  min-width: 0;
}
.appbar__actions { display: inline-flex; align-items: center; gap: var(--s-1); }

/* =========================================================================
   Icon button (44px tap target)
   ========================================================================= */
.icon-btn {
  --sz: 44px;
  width: var(--sz);
  height: var(--sz);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--ink);
  background: transparent;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  flex: 0 0 auto;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); background: var(--surface-3); }
.icon-btn--surface { background: var(--surface); box-shadow: var(--sh-1); }
.icon-btn--surface:hover { background: var(--surface); transform: translateY(-1px); box-shadow: var(--sh-2); }
.icon-btn--ghost-light { color: #fff; }
.icon-btn--ghost-light:hover { background: rgba(255,255,255,.16); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
  --pad-y: 13px;
  --pad-x: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: var(--pad-y) var(--pad-x);
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: .005em;
  line-height: 1;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--sh-inset);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(.975); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn--primary {
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--sh-brand);
}
.btn--primary:hover { filter: brightness(1.05); box-shadow: 0 14px 30px rgba(108,76,241,.42); }
.btn--primary:active { transform: scale(.97); box-shadow: var(--sh-brand); }

.btn--secondary {
  color: var(--brand-ink);
  background: var(--brand-soft);
  box-shadow: none;
}
.btn--secondary:hover { background: color-mix(in srgb, var(--brand-soft) 70%, #fff); }

.btn--ghost {
  color: var(--ink-soft);
  background: transparent;
  box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn--danger {
  color: var(--danger);
  background: var(--danger-soft);
  box-shadow: none;
}
.btn--danger:hover { background: color-mix(in srgb, var(--danger-soft) 75%, #fff); }

.btn--block { display: flex; width: 100%; }
.btn--sm { min-height: 38px; padding: 9px 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--sm svg { width: 16px; height: 16px; }
.btn--lg { min-height: 56px; padding: 17px 24px; font-size: var(--fs-lg); border-radius: var(--r-lg); }

/* =========================================================================
   Chips
   ========================================================================= */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--sh-inset);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
}
.chip__emoji { font-size: 1.05em; line-height: 1; }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip:active { transform: scale(.95); }
.chip--active {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--sh-2);
}
.chip--active:hover { background: var(--ink); color: #fff; }
.chip--brand.chip--active { background: var(--grad-brand); box-shadow: var(--sh-brand); }

/* =========================================================================
   Segmented control
   ========================================================================= */
.seg {
  display: inline-flex;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  gap: 2px;
  width: 100%;
  box-shadow: var(--sh-inset);
}
.seg__opt {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
  font-family: var(--font-display);
  color: var(--ink-soft);
  background: transparent;
  transition: color var(--dur-fast) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.seg__opt svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seg__opt:hover { color: var(--ink); }
.seg__opt:active { transform: scale(.97); }
.seg__opt.is-active {
  color: var(--brand-ink);
  background: var(--surface);
  box-shadow: var(--sh-1);
}

/* =========================================================================
   Cards
   ========================================================================= */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--pad { padding: var(--s-4); }
.card--interactive { cursor: pointer; }
.card--interactive:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.card--interactive:active { transform: translateY(0) scale(.995); }
.card--flat { box-shadow: var(--sh-inset); }
.card--brand {
  background: var(--grad-brand);
  color: #fff;
  box-shadow: var(--sh-brand);
}

/* =========================================================================
   Tutor card (rich)
   ========================================================================= */
.tutor-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
}
.tutor-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.tutor-card__top { display: flex; gap: var(--s-3); align-items: flex-start; }
.tutor-card__body { flex: 1 1 auto; min-width: 0; }
.tutor-card__name-row { display: flex; align-items: center; gap: 6px; }
.tutor-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: -.01em;
  color: var(--ink);
}
.tutor-card__verify { color: var(--brand); flex: 0 0 auto; display: inline-flex; }
.tutor-card__verify svg { width: 16px; height: 16px; }
.tutor-card__headline {
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  margin-top: 1px;
  font-weight: 600;
}
.tutor-card__school {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: .01em;
}
.tutor-card__rating { display: flex; align-items: center; gap: 6px; margin-top: var(--s-2); }
.tutor-card__rating-num { font-weight: 800; font-size: var(--fs-sm); color: var(--ink); }
.tutor-card__reviews { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.tutor-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.tutor-card__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.tutor-card__price { margin-left: auto; text-align: right; }
.tutor-card__avatar-wrap { position: relative; flex: 0 0 auto; }
.tutor-card__online {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--success);
  border: 2.5px solid var(--surface);
}

/* =========================================================================
   Mini tutor row
   ========================================================================= */
.mini-tutor {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  text-align: left;
}
.mini-tutor__body { flex: 1 1 auto; min-width: 0; }
.mini-tutor__name { font-weight: 700; font-size: var(--fs-body); color: var(--ink); }
.mini-tutor__sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }

/* =========================================================================
   Avatar
   ========================================================================= */
.avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--grad-brand);
  isolation: isolate;
}
.avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  background: var(--surface-3);
}
.avatar__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  background: var(--grad-brand);
  letter-spacing: .01em;
  z-index: 0;
  text-transform: uppercase;
}
.avatar--ring { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px var(--brand); }
.avatar--sm { width: 32px; height: 32px; }
.avatar--lg { width: 64px; height: 64px; }

/* =========================================================================
   Stars
   ========================================================================= */
.stars { display: inline-flex; align-items: center; gap: 1px; line-height: 0; color: var(--star); }
.stars svg { display: block; }

/* =========================================================================
   Badges
   ========================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.3;
  background: var(--surface-2);
  color: var(--ink-soft);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge--brand { background: var(--brand-soft); color: var(--brand-ink); }
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--accent { background: color-mix(in srgb, var(--accent) 18%, #fff); color: #9A6A00; }
.badge--muted { background: var(--surface-2); color: var(--muted); }
.badge--outline { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--line); }
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* =========================================================================
   Tier pill
   ========================================================================= */
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.3;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.tier-pill__emoji { font-size: 1em; }
.tier-pill--basic { background: var(--surface-3); color: var(--ink-soft); }
.tier-pill--pro { background: var(--brand-soft); color: var(--brand-ink); }
.tier-pill--expert { background: linear-gradient(135deg, #FFEFC6, #FFE0B0); color: #8A5A00; }

/* =========================================================================
   List row
   ========================================================================= */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 60px;
  padding: var(--s-3) var(--s-4);
  text-align: left;
  background: var(--surface);
  transition: background var(--dur-fast) var(--ease);
}
.list-row:hover { background: var(--surface-2); }
.list-row:active { background: var(--surface-3); }
.list-row__icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--brand);
  font-size: 1.2rem;
}
.list-row__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-row__body { flex: 1 1 auto; min-width: 0; }
.list-row__title { font-weight: 700; font-size: var(--fs-body); color: var(--ink); }
.list-row__sub { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; margin-top: 1px; }
.list-row__end { margin-left: auto; display: inline-flex; align-items: center; gap: var(--s-2); color: var(--muted); }
.list-row__chev { color: var(--muted); flex: 0 0 auto; }
.list-row__chev svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-group {
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.list-group .list-row + .list-row { border-top: 1px solid var(--line); }

/* =========================================================================
   Stat pill
   ========================================================================= */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
}
.stat-pill__icon { display: inline-flex; color: var(--brand); font-size: 1em; }
.stat-pill__icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stat-pill strong { color: var(--ink); font-weight: 800; }

/* =========================================================================
   Review block
   ========================================================================= */
.review { padding: var(--s-4) 0; }
.review + .review { border-top: 1px solid var(--line); }
.review__head { display: flex; align-items: center; gap: var(--s-3); }
.review__who { flex: 1 1 auto; min-width: 0; }
.review__author { font-weight: 700; font-size: var(--fs-sm); color: var(--ink); }
.review__date { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.review__text { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: var(--s-2); line-height: var(--lh-body); }
.review__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }

/* =========================================================================
   Payment row
   ========================================================================= */
.pay-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-inset);
  text-align: left;
  transition: box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.pay-row:hover { background: var(--surface-2); }
.pay-row__emoji {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 1.3rem;
}
.pay-row__body { flex: 1 1 auto; min-width: 0; }
.pay-row__label { font-weight: 700; font-size: var(--fs-body); color: var(--ink); }
.pay-row__detail { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.pay-row__radio {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--line);
  display: grid;
  place-items: center;
  transition: box-shadow var(--dur-fast) var(--ease);
}
.pay-row__radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); transform: scale(0); transition: transform var(--dur) var(--ease); }
.pay-row.is-selected { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.pay-row.is-selected .pay-row__radio { box-shadow: inset 0 0 0 2px var(--brand); }
.pay-row.is-selected .pay-row__radio::after { transform: scale(1); }

/* =========================================================================
   Fare table
   ========================================================================= */
.fare {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  box-shadow: var(--sh-1);
}
.fare__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 7px 0;
  font-size: var(--fs-body);
  color: var(--ink-soft);
}
.fare__row span:first-child { font-weight: 500; }
.fare__row span:last-child { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.fare__row--discount span:last-child { color: var(--success); }
.fare__row--muted { color: var(--muted); }
.fare__row--muted span:last-child { color: var(--muted); font-weight: 600; }
.fare__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-2);
  padding-top: var(--s-3);
  border-top: 1.5px dashed var(--line);
}
.fare__total-label { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); color: var(--ink); }
.fare__total-value { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h1); color: var(--brand-ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* Reusable price text */
.price { font-family: var(--font-display); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price__amount { font-size: var(--fs-lg); }
.price__unit { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; margin-left: 2px; }

/* =========================================================================
   Bottom sheet
   ========================================================================= */
.sheet { position: absolute; inset: 0; pointer-events: auto; }
.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,31,.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: sheetFade var(--dur) var(--ease);
}
.sheet__panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-pop);
  padding: var(--s-3) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom, 0px));
  max-height: 88%;
  overflow-y: auto;
  scrollbar-width: none;
  animation: sheetUp var(--dur-slow) var(--ease);
}
.sheet__panel::-webkit-scrollbar { display: none; }
.sheet__handle {
  width: 40px; height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  margin: 0 auto var(--s-3);
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.sheet__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2); }
.sheet__body { display: block; }
.sheet__footer { margin-top: var(--s-4); }

@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheetFade { from { opacity: 0; } to { opacity: 1; } }

/* =========================================================================
   Toast
   ========================================================================= */
.toast {
  pointer-events: auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--sh-pop);
  animation: toastIn var(--dur) var(--ease);
}
.toast.is-leaving { animation: toastOut var(--dur) var(--ease) forwards; }
.toast__emoji { font-size: 1.05em; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* =========================================================================
   Skeleton shimmer
   ========================================================================= */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--r-sm);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.4s infinite;
}
.skeleton--line { height: 12px; border-radius: var(--r-pill); }
.skeleton--text { height: 14px; border-radius: var(--r-pill); }
.skeleton--avatar { width: 56px; height: 56px; border-radius: 50%; }
.skeleton--card { height: 132px; border-radius: var(--r-lg); }
.skeleton--block { height: 100px; border-radius: var(--r-md); }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; } }

/* =========================================================================
   Sticky footer CTA (sits above the bottom nav)
   ========================================================================= */
.footer-cta {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-top: 1px solid var(--line);
  z-index: var(--z-footer);
}
.footer-cta__row { display: flex; align-items: center; gap: var(--s-3); }
.footer-cta__info { flex: 0 0 auto; }
.footer-cta__label { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.footer-cta__value { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-h2); color: var(--ink); line-height: 1.1; }

/* =========================================================================
   Bottom navigation
   ========================================================================= */
.bottom-nav {
  flex: 0 0 auto;
  position: relative;
  z-index: var(--z-nav);
  display: flex;
  align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-top: 1px solid var(--line);
}
.bottom-nav.is-hidden { display: none; }
.nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  position: relative;
  transition: color var(--dur-fast) var(--ease);
  padding-top: 6px;
}
.nav-item__icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur) var(--ease); }
.nav-item__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em; }
.nav-item::before {
  content: "";
  position: absolute;
  top: 0;
  width: 26px; height: 3px;
  border-radius: var(--r-pill);
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--dur) var(--ease);
}
.nav-item:hover { color: var(--ink-soft); }
.nav-item:active .nav-item__icon { transform: scale(.9); }
.nav-item.is-active { color: var(--brand); }
.nav-item.is-active::before { transform: scaleX(1); }
.nav-item.is-active .nav-item__icon { transform: translateY(-1px); }

/* =========================================================================
   Section title
   ========================================================================= */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin: var(--s-5) 0 var(--s-3);
}
.section-title:first-child { margin-top: 0; }
.section-title__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: -.01em;
  color: var(--ink);
}
.section-title__action {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.section-title__action svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.section-title__action:hover { color: var(--brand-2); }

/* =========================================================================
   Field / input
   ========================================================================= */
.field { display: block; }
.field__label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: var(--s-2);
}
.input {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: var(--fs-body);
  color: var(--ink);
  transition: box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.input::placeholder { color: var(--muted); }
.input:focus, .input:focus-within { box-shadow: inset 0 0 0 2px var(--brand); outline: none; }
.input--icon { padding-left: 14px; }
.input__icon { color: var(--muted); display: inline-flex; flex: 0 0 auto; }
.input__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.input__el { border: none; background: none; outline: none; flex: 1 1 auto; min-width: 0; font: inherit; color: inherit; }

/* Search bar (pill) */
.searchbar {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-1);
  color: var(--ink-soft);
}
.searchbar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.searchbar input { border: none; background: none; outline: none; flex: 1 1 auto; min-width: 0; font: inherit; color: var(--ink); }
.searchbar input::placeholder { color: var(--muted); }

/* =========================================================================
   Empty state
   ========================================================================= */
.empty { text-align: center; padding: var(--s-7) var(--s-5); display: grid; place-items: center; gap: var(--s-3); }
.empty__emoji {
  width: 80px; height: 80px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  font-size: 2.4rem;
  margin-bottom: var(--s-1);
}
.empty__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2); color: var(--ink); }
.empty__text { font-size: var(--fs-body); color: var(--muted); max-width: 30ch; line-height: var(--lh-body); }

/* =========================================================================
   Divider
   ========================================================================= */
.divider { height: 1px; background: var(--line); border: none; margin: var(--s-4) 0; }
.divider--labeled {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: var(--s-4) 0;
}
.divider--labeled::before, .divider--labeled::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }

/* =========================================================================
   Big ETA / number display
   ========================================================================= */
.eta-big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-display);
  letter-spacing: -.03em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.eta-big__unit { font-size: 0.42em; color: var(--muted); font-weight: 700; letter-spacing: 0; }

/* =========================================================================
   Glow accent (decorative)
   ========================================================================= */
.glow { position: relative; }
.glow::after {
  content: "";
  position: absolute;
  inset: -30% -10%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(124,58,237,.32), transparent 70%);
  z-index: -1;
  pointer-events: none;
  filter: blur(8px);
}

/* =========================================================================
   Progress ring
   ========================================================================= */
.progress-ring { display: inline-grid; place-items: center; position: relative; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring__track { fill: none; stroke: var(--surface-3); }
.progress-ring__bar { fill: none; stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset var(--dur-slow) var(--ease); }
.progress-ring__label {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Subject tile (home scroller)
   ========================================================================= */
.subject-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  width: 124px;
  height: 124px;
  padding: var(--s-3);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
  text-align: left;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.subject-tile:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.subject-tile:active { transform: translateY(0) scale(.98); }
.subject-tile__emoji {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  font-size: 1.5rem;
  background: var(--subject-tint, var(--brand-soft));
}
.subject-tile__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-sm); color: var(--ink); line-height: 1.2; }

/* =========================================================================
   Level row (selectable)
   ========================================================================= */
.level-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-inset);
  text-align: left;
  transition: box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.level-row:hover { background: var(--surface-2); }
.level-row__body { flex: 1 1 auto; min-width: 0; }
.level-row__name { font-weight: 700; font-size: var(--fs-body); color: var(--ink); }
.level-row__desc { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; margin-top: 1px; }
.level-row__check { flex: 0 0 auto; color: var(--brand); opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.level-row__check svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.level-row.is-selected { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.level-row.is-selected .level-row__check { opacity: 1; }

/* =========================================================================
   Reduced-motion guard for component-level animations
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .sheet__panel, .sheet__backdrop, .toast { animation: none; }
}
