/* ═══ SeatSaathi app styles ═══ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ss-bg);
  color: var(--ss-ink);
  font-family: var(--ss-font);
  font-size: var(--ss-fs-md);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:lang(hi), :lang(mr) { line-height: 1.55; }
a { color: var(--ss-primary); }
a:hover { color: var(--ss-primary-hover); }
:focus-visible { outline: 2px solid var(--ss-primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--ss-fs-xl); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--ss-fs-md); font-weight: 800; }

/* ═══ LAYOUT ═══ */
#app { min-height: 100dvh; display: flex; flex-direction: column; }
.screen {
  flex: 1 1 auto;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) var(--ss-pad) calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--ss-gap);
}
.screen--center { justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--lg { gap: var(--ss-gap); }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--ss-muted); font-size: var(--ss-fs-sm); }
.small { font-size: var(--ss-fs-xs); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ BRAND ═══ */
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  width: 38px; height: 38px; flex: none; border-radius: var(--ss-r-sm);
  background: var(--ss-primary); display: grid; place-items: center;
}
.brand__mark svg { width: 20px; height: 20px; }
.brand__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand__name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.brand__sub { font-size: var(--ss-fs-xs); color: var(--ss-muted); }
.brand--hero .brand__mark { width: 56px; height: 56px; border-radius: 16px; }
.brand--hero .brand__mark svg { width: 28px; height: 28px; }
.brand--hero .brand__name { font-size: 22px; }

/* ═══ CARDS ═══ */
.card {
  background: var(--ss-surface);
  border: 1px solid var(--ss-line);
  border-radius: var(--ss-r-md);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.card--hero {
  background: var(--ss-primary); color: var(--ss-on-primary);
  border: 0; border-radius: var(--ss-r-lg); padding: 18px;
}
.card--hero .muted { color: var(--ss-on-primary-muted); }
.card--tint { background: var(--ss-primary-tint); border-color: transparent; }
.card--warn { background: var(--ss-warn-tint); border-color: transparent; color: var(--ss-warn); }

/* ═══ FORMS ═══ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--ss-fs-sm); font-weight: 700; }
.field__hint { font-size: var(--ss-fs-xs); color: var(--ss-muted); }
.field__error { font-size: var(--ss-fs-xs); color: var(--ss-danger); font-weight: 600; min-height: 0; }
.field__error:empty { display: none; }
.input, .select {
  width: 100%;
  height: var(--ss-tap);
  border-radius: 12px;
  border: 1px solid var(--ss-line-strong);
  background: var(--ss-surface);
  color: var(--ss-ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  font-weight: 600;
  padding: 0 14px;
  transition: border-color .15s var(--ss-ease), box-shadow .15s var(--ss-ease);
}
.input:focus, .select:focus { border-color: var(--ss-primary); box-shadow: 0 0 0 3px rgb(31 90 67 / 15%); outline: none; }
.input[aria-invalid="true"] { border-color: var(--ss-danger); }
.input::placeholder { color: #9AA39E; font-weight: 500; }
.select-wrap { position: relative; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.select-wrap svg { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; width: 14px; height: 14px; }
.select--compact { height: 38px; border-radius: var(--ss-r-sm); font-size: var(--ss-fs-sm); font-weight: 700; padding: 0 30px 0 12px; }
.select-wrap--compact svg { right: 10px; }
.input-group { display: flex; align-items: stretch; }
.input-group__prefix {
  display: grid; place-items: center; padding: 0 12px;
  border: 1px solid var(--ss-line-strong); border-right: 0;
  border-radius: 12px 0 0 12px; background: var(--ss-bg);
  font-weight: 700; color: var(--ss-muted);
}
.input-group .input { border-radius: 0 12px 12px 0; }
.input-group__btn {
  border: 1px solid var(--ss-line-strong); border-left: 0; border-radius: 0 12px 12px 0;
  background: var(--ss-surface); padding: 0 14px; font: inherit; font-weight: 700;
  font-size: var(--ss-fs-sm); color: var(--ss-primary); cursor: pointer; min-width: 64px;
}
.input-group--suffix .input { border-radius: 12px 0 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--ss-fs-sm); }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--ss-primary); flex: none; }

/* ═══ BUTTONS ═══ */
.btn {
  height: var(--ss-tap);
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  font-size: var(--ss-fs-md);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  transition: background .15s var(--ss-ease), transform .1s var(--ss-ease), opacity .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--ss-primary); color: var(--ss-on-primary); }
.btn--primary:hover { background: var(--ss-primary-hover); }
.btn--ghost { background: transparent; color: var(--ss-primary); }
.btn--ghost:hover { background: var(--ss-primary-tint); }
.btn--line { background: var(--ss-surface); color: var(--ss-ink); border: 1px solid var(--ss-line-strong); }
.btn--danger { background: var(--ss-danger-tint); color: var(--ss-danger); }
.btn--block { width: 100%; }
.btn--sm { height: 40px; font-size: var(--ss-fs-sm); padding: 0 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: ss-spin .7s linear infinite;
}
@keyframes ss-spin { to { rotate: 360deg; } }
.link-btn {
  background: none; border: 0; padding: 8px 0; font: inherit; font-weight: 700;
  font-size: var(--ss-fs-sm); color: var(--ss-primary); cursor: pointer; min-height: 40px;
}

/* ═══ PIN ═══ */
.pin-dots { display: flex; justify-content: center; gap: 16px; padding: 8px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ss-primary); transition: background .12s; }
.pin-dots span.is-on { background: var(--ss-primary); }
.pin-dots.is-shake { animation: ss-shake .35s; }
@keyframes ss-shake { 25% { translate: -8px 0; } 75% { translate: 8px 0; } }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; width: 100%; }
.pin-key {
  height: 60px; border-radius: 16px; border: 1px solid var(--ss-line); background: var(--ss-surface);
  font: inherit; font-size: 24px; font-weight: 700; color: var(--ss-ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pin-key:active { background: var(--ss-primary-tint); }
.pin-key--blank { visibility: hidden; }
.pin-key--icon { font-size: var(--ss-fs-sm); color: var(--ss-muted); display: grid; place-items: center; }
.pin-key--icon svg { width: 26px; height: 26px; }

/* ═══ APP SHELL (signed in) ═══ */
.shell { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 100dvh; }
.shell__top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--ss-bg) 92%, transparent);
  backdrop-filter: blur(10px);
  padding: calc(12px + env(safe-area-inset-top)) var(--ss-pad) 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.shell__top .brand { flex: 1 1 auto; }
.shell__tools { flex: 0 1 auto; min-width: 0; max-width: 55%; display: flex; gap: 8px; }
.shell__tools .select-wrap { min-width: 0; }
.shell__tools .select { max-width: 100%; text-overflow: ellipsis; }
.shell__main {
  flex: 1 1 auto; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 6px var(--ss-pad) calc(88px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: var(--ss-gap);
}
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--ss-surface); border-top: 1px solid var(--ss-line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.nav__item {
  border: 0; background: none; font: inherit; color: var(--ss-muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 52px; justify-content: center; border-radius: 12px; cursor: pointer;
  font-size: 11.5px; font-weight: 700;
}
.nav__item svg { width: 22px; height: 22px; }
.nav__item[aria-current="page"] { color: var(--ss-primary); }
.nav__item[aria-current="page"] svg { stroke: var(--ss-primary); }

.list { display: flex; flex-direction: column; background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-r-md); overflow: hidden; }
.list__item {
  display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px;
  border: 0; border-bottom: 1px solid var(--ss-line); background: none; font: inherit;
  color: inherit; text-align: left; width: 100%; cursor: pointer;
}
.list__item:last-child { border-bottom: 0; }
a.list__item { text-decoration: none; }
.list__item:hover { background: #FBFAF6; }
.list__icon { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--ss-primary-tint); display: grid; place-items: center; }
.list__icon svg { width: 18px; height: 18px; }
.chev { width: 16px; height: 16px; flex: none; }

/* ═══ BANNERS + TOAST ═══ */
.banner {
  font-size: var(--ss-fs-sm); font-weight: 700; padding: 8px var(--ss-pad);
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.banner--offline { background: var(--ss-ink); color: #fff; }
.banner--update { background: var(--ss-primary); color: #fff; border: 0; width: 100%; font: inherit; font-weight: 700; font-size: var(--ss-fs-sm); cursor: pointer; }
.banner--warn { background: var(--ss-warn-tint); color: var(--ss-warn); }
.banner--danger { background: var(--ss-danger-tint); color: var(--ss-danger); }
#toast-root {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); translate: -50% 0;
  z-index: 100; width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast {
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  background: var(--ss-ink); color: #fff; box-shadow: var(--ss-shadow);
  opacity: 0; translate: 0 16px; transition: opacity .25s var(--ss-ease), translate .25s var(--ss-ease);
}
.toast.is-visible { opacity: 1; translate: 0 0; }
.toast--success { background: var(--ss-success); }
.toast--error { background: var(--ss-danger); }

/* ═══ SKELETON ═══ */
.skeleton {
  border-radius: var(--ss-r-md);
  background: linear-gradient(90deg, #ECE9E0 0%, #F4F2EC 50%, #ECE9E0 100%);
  background-size: 200% 100%; animation: ss-shimmer 1.2s ease-in-out infinite;
}
.skeleton--hero { height: 130px; border-radius: var(--ss-r-lg); }
.skeleton--row { height: 64px; }
.skeleton--line { height: 18px; width: 60%; border-radius: 8px; }
@keyframes ss-shimmer { to { background-position: -200% 0; } }

/* ═══ EMPTY / INFO STATES ═══ */
.empty { text-align: center; align-items: center; padding: 28px 18px; }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--ss-primary-tint); display: grid; place-items: center; }
.empty__icon svg { width: 26px; height: 26px; }
.step-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: var(--ss-fs-sm); }

/* ═══ DEBUG ═══ */
#debug-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; max-height: 40vh; overflow: auto;
  background: rgb(0 0 0 / 90%); color: #7CFC9A; font: 11px/1.4 ui-monospace, Menlo, monospace; padding: 8px 10px;
}
#debug-panel b { color: #7FDBFF; }

/* ═══ DESKTOP ═══ */
@media (min-width: 1024px) {
  .shell { flex-direction: row; }
  .nav {
    position: sticky; top: 0; height: 100dvh; width: 232px; flex: none;
    grid-template-columns: 1fr; align-content: start; gap: 4px;
    border-top: 0; border-right: 1px solid var(--ss-line); padding: 84px 12px 12px;
  }
  .nav__item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; font-size: 14px; min-height: 46px; }
  .nav__item[aria-current="page"] { background: var(--ss-primary-tint); }
  .shell__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
  .shell__main { max-width: 960px; padding-bottom: 32px; }
  #toast-root { bottom: 24px; }
}
@media (max-width: 1023.98px) { .shell__body { display: contents; } }
@media (max-width: 359.98px) {
  :root { --ss-pad: 14px; --ss-fs-xl: 21px; }
  .pin-key { height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══ L1: SETUP WIZARD ═══ */
.wizard { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 100dvh; }
.wizard__top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) var(--ss-pad) 10px;
  background: color-mix(in srgb, var(--ss-bg) 94%, transparent); backdrop-filter: blur(10px);
  max-width: 560px; width: 100%; margin: 0 auto;
}
.wizard__top .link-btn { flex: none; white-space: nowrap; }
.wizard__body { flex: 1 1 auto; width: 100%; max-width: 560px; margin: 0 auto; padding: 6px var(--ss-pad) 0; }
.wizard__form { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.wizard__bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px var(--ss-pad) calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--ss-bg) 70%, color-mix(in srgb, var(--ss-bg) 0%, transparent));
}
.wizard__bar .btn { max-width: 520px; margin: 0 auto; display: flex; }
.progress { height: 6px; border-radius: 999px; background: var(--ss-line); overflow: hidden; }
.progress__fill { display: block; height: 100%; background: var(--ss-primary); border-radius: inherit; transition: width .3s var(--ss-ease); }
.progress__fill--1 { width: 14.3%; } .progress__fill--2 { width: 28.6%; } .progress__fill--3 { width: 42.9%; }
.progress__fill--4 { width: 57.1%; } .progress__fill--5 { width: 71.4%; } .progress__fill--6 { width: 85.7%; }
.progress__fill--7 { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--ss-primary-tint); }
.icon-btn svg { width: 22px; height: 22px; }
.stack--xs { gap: 2px; }
.wz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.wz-grid--single { grid-template-columns: 1fr; }
.wz-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.wz-grid > [hidden] { display: none; }
.wz-batch h2 { font-size: var(--ss-fs-sm); color: var(--ss-muted); text-transform: uppercase; letter-spacing: .04em; }
.wz-preview { font-weight: 700; color: var(--ss-primary); background: var(--ss-primary-tint); border-radius: 12px; padding: 12px 14px; font-size: var(--ss-fs-sm); }
.wz-preview.is-empty { color: var(--ss-muted); background: var(--ss-surface); border: 1px dashed var(--ss-line-strong); }
.input--code { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; max-width: 140px; }
.card--danger { background: var(--ss-danger-tint); border-color: transparent; color: var(--ss-danger); font-weight: 600; font-size: var(--ss-fs-sm); }
.review { gap: 0; padding: 4px 16px; }
.review__row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--ss-line); }
.review__row:last-child { border-bottom: 0; }
.review__value { font-weight: 700; font-size: var(--ss-fs-sm); white-space: pre-line; overflow-wrap: anywhere; }
.review__row .link-btn { flex: none; padding: 0 4px; min-height: 32px; }
.empty__icon--success { background: var(--ss-success); }
.btn--light { background: var(--ss-surface); color: var(--ss-primary); }
.btn--light:hover { background: var(--ss-primary-tint); }

/* ═══ L1: HOME + SETTINGS ═══ */
.list__icon--success { background: var(--ss-success); }
.group-title { font-size: var(--ss-fs-xs); font-weight: 800; color: var(--ss-muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 4px; }
.page-head { display: flex; align-items: center; gap: 6px; margin-left: -10px; }
.page-head h1 { font-size: var(--ss-fs-lg); }
.page-head h1:focus { outline: none; }
#wz-title:focus { outline: none; }
.list__value { font-weight: 800; font-size: var(--ss-fs-sm); flex: none; }
.list__item--add { color: var(--ss-primary); font-weight: 700; min-height: 50px; }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; vertical-align: 1px;
  font-size: 11px; font-weight: 800; background: var(--ss-line); color: var(--ss-muted);
}
.tag--tint { background: var(--ss-primary-tint); color: var(--ss-primary); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; background: var(--ss-bg); min-width: 0; }
.stat__n { font-size: var(--ss-fs-xl); font-weight: 800; }
#seat-ranges { overflow-wrap: anywhere; font-weight: 700; }
.todo {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--ss-warn-tint); border: 0; border-radius: var(--ss-r-md); padding: 14px; font: inherit; color: var(--ss-ink);
}
.todo__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ss-warn); flex: none; }
.todo__title { font-weight: 800; }
@media (min-width: 1024px) {
  .wizard__bar { left: 0; }
}
@media (max-width: 359.98px) {
  .wz-grid--3 { grid-template-columns: 1fr 1fr; }
  .wz-grid--3 > :first-child { grid-column: 1 / -1; }
}

/* ═══ L2: STUDENTS, PROFILE, SEAT MAP ═══ */
.row--tight { gap: 6px; min-width: 0; }
.list__title { font-weight: 800; }
.list__item--static { cursor: default; }
.list__item--static:hover { background: none; }
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }
.textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.icon-btn--tool { width: 40px; height: 40px; border: 1px solid var(--ss-line-strong); background: var(--ss-surface); }
.icon-btn--tool svg { width: 18px; height: 18px; }

.avatar {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--ss-primary-tint); color: var(--ss-primary);
  font-weight: 800; font-size: 14px; letter-spacing: .02em;
}
.avatar--lg { width: 52px; height: 52px; font-size: 17px; }
.avatar--muted { background: var(--ss-line); color: var(--ss-muted); }
.seat-badge {
  flex: none; min-width: 44px; padding: 4px 8px; border-radius: 10px; text-align: center;
  background: var(--ss-bg); border: 1px solid var(--ss-line-strong); font-weight: 800; font-size: var(--ss-fs-sm);
}
.seat-tile {
  flex: none; min-width: 44px; height: 40px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ss-primary-tint); color: var(--ss-primary); font-weight: 800; font-size: var(--ss-fs-sm);
}
.seat-tile--big { min-width: 56px; height: 56px; border-radius: 14px; font-size: var(--ss-fs-lg); background: var(--ss-primary); color: #fff; }
.tag--frozen { background: #E5EEF8; color: #1D4F86; }
.tag--left { background: var(--ss-line); color: var(--ss-muted); }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; pointer-events: none; }
.input--search { padding-left: 42px; }
.input--search::-webkit-search-cancel-button { cursor: pointer; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters > :only-child { grid-column: 1 / -1; }
.filters .select { width: 100%; }

.fab {
  position: fixed; z-index: 15; right: var(--ss-pad); bottom: calc(80px + env(safe-area-inset-bottom));
  height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ss-primary); color: #fff; font: inherit; font-weight: 800; font-size: var(--ss-fs-md);
  box-shadow: 0 6px 20px rgb(31 90 67 / 35%); -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.fab:active { transform: scale(0.97); }
.fab svg { width: 20px; height: 20px; }

.page-form { padding-bottom: 8px; }
.page-bar {
  position: sticky; z-index: 5; bottom: calc(64px + env(safe-area-inset-bottom));
  margin: 0 calc(-1 * var(--ss-pad)); padding: 12px var(--ss-pad);
  background: linear-gradient(to top, var(--ss-bg) 75%, color-mix(in srgb, var(--ss-bg) 0%, transparent));
}

.free-list { display: flex; flex-direction: column; border-radius: 12px; background: var(--ss-bg); padding: 4px 12px; }
.free-list__row { display: flex; align-items: center; gap: 10px; min-height: 38px; font-size: var(--ss-fs-sm); font-weight: 600; }
.free-list__row + .free-list__row { border-top: 1px solid var(--ss-line); }
.free-list__n { flex: none; font-weight: 800; color: var(--ss-primary); }
.free-list__n--full { color: var(--ss-warn); }

.seatmap { display: flex; flex-direction: column; gap: 16px; }
.seatmap__row { display: flex; flex-direction: column; gap: 8px; }
.seatmap__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.seat {
  min-height: 56px; border-radius: 12px; padding: 6px 4px; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.seat__label { font-weight: 800; font-size: var(--ss-fs-md); }
.seat__name { font-size: 11px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat--free { background: var(--ss-surface); border: 1.5px dashed var(--ss-line-strong); color: var(--ss-ink); }
.seat--free .seat__name { color: var(--ss-success); }
.seat--free[aria-disabled="true"] { opacity: .6; }
.seat--taken { background: var(--ss-primary-tint); border: 1.5px solid transparent; color: var(--ss-primary); }
.seat--taken .seat__name { color: var(--ss-primary); }
.seat:active { transform: scale(0.97); }

.toast--action { pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; }
.toast__text { flex: 1 1 auto; }
.toast__action {
  flex: none; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgb(255 255 255 / 18%); color: #fff; font: inherit; font-weight: 800; font-size: 14px;
}

@media (min-width: 1024px) {
  .fab { bottom: 28px; right: 32px; }
  .page-bar { bottom: 0; margin: 0; padding: 12px 0; }
  .seatmap__grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
}
@media (max-width: 359.98px) {
  .seatmap__grid { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .fab { padding: 0 16px 0 12px; }
}
a.btn { text-decoration: none; }

/* ═══ L2.1 · photo + ID proof ═══ */
.avatar--photo { overflow: hidden; background: var(--ss-line); }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-row { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-row--link {
  width: 100%; text-align: left; background: none; border: 0; padding: 10px 0 0; margin: 0;
  border-top: 1px solid var(--ss-line); font: inherit; color: inherit; cursor: pointer; min-height: 56px;
}
.doc-row__actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex: none; }
.doc-thumb {
  width: 56px; height: 56px; flex: none; border-radius: 12px; object-fit: cover; display: block;
  background: var(--ss-bg); border: 1px solid var(--ss-line-strong);
}
.doc-thumb--empty { display: grid; place-items: center; }
.doc-view {
  border-radius: 14px; overflow: hidden; border: 1px solid var(--ss-line-strong); background: #FFFFFF;
}
.doc-view img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.textarea--short { min-height: 64px; }
@media (max-width: 340px) {
  .doc-row { flex-wrap: wrap; }
  .doc-row__actions { flex-direction: row; width: 100%; }
  .doc-row__actions .btn { flex: 1; }
}

/* ═══ L3: FEES ═══ */
.tag--danger { background: var(--ss-danger-tint); color: var(--ss-danger); margin: 0; }
.tag--warn { background: var(--ss-warn-tint); color: var(--ss-warn); margin: 0; }
.tag--ok { background: var(--ss-primary-tint); color: var(--ss-success); margin: 0; }
.row .tag--frozen, .fee-row .tag, .list__item .tag--left { margin: 0; }
.money--neg { color: var(--ss-danger); }
.money-head { font-size: var(--ss-fs-lg); font-weight: 800; }
.money-head--danger { color: var(--ss-danger); }
.money-head--ok { color: var(--ss-success); }
.money-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--ss-bg); min-width: 0; }
.money-line .btn { flex: none; }
.money-line__frozen { color: #1D4F86; font-weight: 700; }
.money-end { align-items: flex-end; flex: none; }
.money-end .link-btn { min-height: 32px; padding: 0 2px; font-size: var(--ss-fs-xs); }

.fee-row { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 0; border-bottom: 1px solid var(--ss-line); min-width: 0; }
.fee-row:last-child { border-bottom: 0; }
.fee-row__main {
  display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; min-height: 60px; padding: 8px 0 8px 14px;
  background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.fee-row__main:focus-visible { outline: 3px solid var(--ss-primary); outline-offset: -3px; border-radius: 10px; }
.fee-row__sub { min-width: 0; flex-wrap: nowrap; }
.fee-row__sub .tag { flex: none; }
.fee-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.fee-row__end .btn--sm { height: 36px; padding: 0 12px; }

.receipt { position: relative; }
.receipt__rule { border-top: 1px dashed var(--ss-line-strong); }
.receipt__amount { font-size: var(--ss-fs-hero); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.receipt--void .receipt__amount { text-decoration: line-through; color: var(--ss-muted); }
.receipt .review { padding: 0; }
.stamp {
  flex: none; padding: 4px 10px; border: 2px solid var(--ss-danger); border-radius: 8px; color: var(--ss-danger);
  font-weight: 800; font-size: var(--ss-fs-sm); letter-spacing: 0.06em; text-transform: uppercase; rotate: -6deg;
}
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset .check { align-items: center; min-height: 40px; }

.dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto;
  border: 0; border-radius: var(--ss-r-lg); padding: 20px; background: var(--ss-surface); color: var(--ss-ink);
  box-shadow: var(--ss-shadow);
}
.dialog::backdrop { background: rgb(22 32 27 / 45%); }
@media (max-width: 359px) {
  .fee-row__end .btn--sm { padding: 0 10px; }
  .receipt__amount { font-size: 28px; }
}
.fee-sum__row { display: flex; align-items: center; gap: 10px; min-height: 38px; font-size: var(--ss-fs-sm); font-weight: 600; }
.fee-sum__row + .fee-sum__row { border-top: 1px solid var(--ss-line); }

/* ═══ L4 WhatsApp: reminder queue (one card at a time), profile reminders, public receipt page ═══ */
.rq-bar { height: 6px; border-radius: 999px; background: var(--ss-line); overflow: hidden; }
.rq-bar__fill { display: block; height: 100%; background: var(--ss-primary); border-radius: inherit;
  transition: width 0.35s var(--ss-ease); }
.rq-card { gap: 12px; }
.rq-card .tag { flex: none; }
.rq-msg { margin: 0; padding: 12px 14px; border-radius: var(--ss-r-md); background: var(--ss-bg); font-size: var(--ss-fs-sm);
  line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; color: var(--ss-ink); }
.rq-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rq-actions .btn { flex: 0 1 auto; min-width: 96px; }
.rq-actions .link-btn { text-align: right; }
#pro-rem-card .select-wrap { flex: 0 1 auto; max-width: 62%; }
@media (prefers-reduced-motion: reduce) { .rq-bar__fill { transition: none; } }

.pub { max-width: 520px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px 32px; display: flex;
  flex-direction: column; gap: var(--ss-gap); min-height: 100vh; min-height: 100dvh; }
.pub__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pub__foot { margin-top: auto; text-align: center; }
.pub__foot a { color: var(--ss-primary); }

/* ═══ L5 · payment page (/p/<code>) + payments to verify ═══ */
.qr-box { align-items: center; text-align: center; }
.qr { display: block; width: min(100%, 248px); height: auto; aspect-ratio: 1; border-radius: var(--ss-r-sm); border: 1px solid var(--ss-line); }
.pay-more { border-top: 1px solid var(--ss-line); padding-top: 4px; }
.pay-more > summary { display: flex; align-items: center; gap: 8px; min-height: var(--ss-tap); cursor: pointer; font-weight: 700;
  font-size: var(--ss-fs-sm); color: var(--ss-primary); list-style: none; }
.pay-more > summary::-webkit-details-marker { display: none; }
.pay-more[open] > summary { margin-bottom: 8px; }
.pay-upi-row { align-items: center; padding: 8px 0 0; border-top: 1px solid var(--ss-line); border-bottom: 0; }
.pay-upi-row .btn { flex: none; }
.claim-card { gap: 12px; }
.claim-card__utr { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; font-weight: 800; overflow-wrap: anywhere; }
.claim-card__who { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; padding: 0; background: none; border: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; min-height: var(--ss-tap); }
.claim-card__who:focus-visible { outline: 3px solid var(--ss-primary); outline-offset: 2px; border-radius: 10px; }
.claim-card__more { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.claim-card__more .btn { flex: 0 1 auto; }
.claim-card__more .link-btn { text-align: right; }
.verify-cta { display: flex; align-items: center; gap: 10px; }

/* ═══ L6 · import from Excel ═══ */
.imp-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 359px) { .imp-stats { grid-template-columns: repeat(2, 1fr); } }
.stat--danger { background: var(--ss-danger-tint); color: var(--ss-danger); }
.stat--danger .muted { color: var(--ss-danger); }
.imp-row { align-items: flex-start; }
.imp-row > svg { align-self: center; }
.imp-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--ss-line-strong); }
.imp-dot--ready { background: var(--ss-success); }
.imp-dot--check { background: var(--ss-warn); }
.imp-dot--fix { background: var(--ss-danger); }
.imp-dot--unchecked { background: var(--ss-primary); }
.imp-err { color: var(--ss-danger); font-weight: 600; overflow-wrap: anywhere; }
.imp-warn { color: var(--ss-warn); overflow-wrap: anywhere; }
.imp-row .small { white-space: normal; }
.shell--admin .shell__body { max-width: 760px; margin: 0 auto; width: 100%; }

/* ═══ L7: team, cash handover, activity ═══ */
.ck-row { padding: 10px 14px; min-height: 48px; align-items: center; border-bottom: 1px solid var(--ss-line); cursor: pointer; }
.ck-row:last-child { border-bottom: 0; }
.ho-item { flex-direction: column; align-items: stretch; gap: 10px; }
.ho-item .wz-grid .btn { width: 100%; }
.act-item { align-items: flex-start; }
.act-item > .list__icon { margin-top: 2px; }
.act-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }

/* ═══ L8: HOME DASHBOARD ═══ */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ss-gap); align-items: start; }
.dash__status { margin-top: -6px; }
.dash-hero { gap: 8px; }
.dash-hero__label { font-size: var(--ss-fs-md); font-weight: 700; color: var(--ss-on-primary-muted); }
.dash-hero__n { font-size: var(--ss-fs-hero); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; min-height: var(--ss-tap);
  padding: 12px 14px; text-align: left; cursor: pointer; font: inherit; color: var(--ss-ink);
  background: var(--ss-surface); border: 1px solid var(--ss-line); border-radius: var(--ss-r-md);
  transition: border-color .15s var(--ss-ease), translate .15s var(--ss-ease);
}
.dash-tile:hover { border-color: var(--ss-line-strong); }
.dash-tile:active { translate: 0 1px; }
.dash-tile:focus-visible { outline: 3px solid var(--ss-primary); outline-offset: 2px; }
.dash-tile > span { max-width: 100%; }
.dash-tile__label { font-size: var(--ss-fs-sm); font-weight: 700; color: var(--ss-muted); }
.dash-tile__n { font-size: 26px; font-weight: 800; line-height: 1.15; }
.dash-tile__sub { font-size: var(--ss-fs-sm); font-weight: 600; color: var(--ss-muted); }
.dash-tile--danger { background: var(--ss-danger-tint); border-color: transparent; }
.dash-tile--danger .dash-tile__n, .dash-tile--danger .dash-tile__sub { color: var(--ss-danger); }
.dash-tile--warn { background: var(--ss-warn-tint); border-color: transparent; }
.dash-tile--warn .dash-tile__n, .dash-tile--warn .dash-tile__sub { color: var(--ss-warn); }
.todo--danger { background: var(--ss-danger-tint); }
.todo--danger .todo__dot { background: var(--ss-danger); }
.dash-clear { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ss-primary); }
.dash-clear svg { flex: none; }
.dash-trend { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.dash-trend svg { flex: none; }
.dash-trend--up { color: var(--ss-success); }
.dash-trend--down { color: var(--ss-danger); }
.dash-trend--same { color: var(--ss-muted); }
.dash-bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; padding-top: 4px; }
.dash-bars__col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.dash-bars__bar { display: block; width: 100%; border-radius: 3px 3px 1px 1px; background: var(--ss-primary-tint); }
.dash-bars__bar--today { background: var(--ss-primary); }
.dash-bars__axis { font-size: var(--ss-fs-xs); font-weight: 600; color: var(--ss-muted); }
.dash-meter { display: block; height: 10px; border-radius: 6px; background: var(--ss-bg); overflow: hidden; }
.dash-meter__fill { display: block; height: 100%; border-radius: 6px; background: var(--ss-primary); transition: width .4s var(--ss-ease); }
@media (min-width: 720px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash__status, .dash__kpis, .dash--coord .dash-hero { grid-column: 1 / -1; }
  .dash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 359.98px) {
  .dash-hero__n { font-size: 30px; }
  .dash-tile { padding: 10px 12px; }
  .dash-tile__n { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { .dash-meter__fill, .dash-tile { transition: none; } }
.dash-hero__wait { height: 38px; width: 45%; opacity: .35; }

/* ═══ L9 Optional modules: attendance, lockers, expenses · photo at enrolment · receipt print / PDF ═══ */
.card.att-sum { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; padding: 14px 16px; font-size: var(--ss-fs-sm); color: var(--ss-muted); }
.att-sum strong { color: var(--ss-ink); font-size: var(--ss-fs-lg); }
.att-row { gap: 10px; }
.att-row .link-btn { text-align: left; min-width: 0; padding: 0; min-height: 40px; font-weight: 600; color: var(--ss-ink); }
.att-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 96px; min-height: 40px;
  padding: 0 10px; border-radius: var(--ss-r-sm); border: 1.5px solid var(--ss-line-strong); background: var(--ss-surface);
  color: var(--ss-muted); font: inherit; font-size: var(--ss-fs-sm); font-weight: 700; cursor: pointer;
}
.att-btn--present { background: var(--ss-primary); border-color: var(--ss-primary); color: #fff; }
.att-btn--absent { background: var(--ss-danger-tint); border-color: #F4C7C2; color: var(--ss-danger); }
.att-btn:disabled { opacity: .6; cursor: default; }
.seat-tile--taken { background: var(--ss-primary); color: #fff; }
.ex-cat { display: grid; gap: 4px; }
.ex-bar { height: 6px; border-radius: 3px; background: var(--ss-line); overflow: hidden; }
.ex-bar span { display: block; height: 100%; background: var(--ss-primary); border-radius: 3px; }
.text-danger { color: var(--ss-danger); }
.strike { text-decoration: line-through; color: var(--ss-muted); }
.list__item.is-void .list__title { color: var(--ss-muted); }
.list__value { font-weight: 700; white-space: nowrap; flex: none; }
.photo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-btns .btn { flex: 1 1 auto; min-height: 40px; }
.doc-row__actions .photo-btns { flex-direction: column; flex-wrap: nowrap; }
.dialog--cam { width: min(560px, calc(100vw - 24px)); }
.cam__frame { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #0E1512; border-radius: var(--ss-r-md); overflow: hidden; }
.cam__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam__video[hidden] { display: none; }
@media (max-width: 360px) {
  .att-btn { min-width: 84px; padding: 0 6px; }
}

/* Receipt sheet: hidden on screen, the only thing on the page when printing (A5). */
.print-host { display: none; }
@media print {
  @page { size: A5 portrait; margin: 10mm; }
  html.is-printing body > *:not(.print-host) { display: none !important; }
  html.is-printing .print-host { display: block; }
  html.is-printing, html.is-printing body { background: #fff; }
}
.rp { position: relative; font-family: var(--ss-font); color: #16201B; font-size: 10.5pt; line-height: 1.4; }
.rp p { margin: 0; }
.rp__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 3mm;
  border-top: 2mm solid #1F5A43; border-bottom: 0.6mm solid #1F5A43; padding-bottom: 3mm; }
.rp__library { font-size: 15pt; font-weight: 800; }
.rp__title { font-size: 12pt; font-weight: 800; color: #1F5A43; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.rp__muted, .rp__label { color: #5B6660; }
.rp__meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4mm 0 2mm; }
.rp__party { margin-bottom: 3mm !important; }
.rp__table { width: 100%; border-collapse: collapse; margin: 2mm 0 3mm; }
.rp__table th, .rp__table td { text-align: left; padding: 2mm; border-bottom: 0.3mm solid #C9D1CC; vertical-align: top; }
.rp__table thead th { background: #EEF3F0; }
.rp__table tfoot th { font-size: 12pt; border-bottom: 0.6mm solid #16201B; }
.rp__num { text-align: right !important; white-space: nowrap; }
.rp__words { margin: 1mm 0 !important; }
.rp__sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 14mm; color: #5B6660; }
.rp__signline { border-top: 0.4mm solid #16201B; padding-top: 1mm; min-width: 45mm; text-align: right; }
.rp__foot { margin-top: 8mm; border-top: 0.3mm dashed #C9D1CC; padding-top: 2mm; text-align: center; font-size: 8.5pt; color: #5B6660; }
.rp__stamp { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-size: 34pt; font-weight: 800;
  color: rgb(180 35 24 / 55%); border: 1mm solid rgb(180 35 24 / 55%); padding: 2mm 6mm; }

/* ═══ L11: help & FAQ, what's new, plan, feedback, maintenance banner ═══ */
.faq { padding: 0; }
.faq__q { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after { content: '+'; color: var(--ss-muted); font-weight: 400; flex: none; }
.faq[open] .faq__q::after { content: '−'; }
.faq__a { margin: 0; padding: 0 16px 14px; color: var(--ss-ink); line-height: 1.5; }
.wn-items { margin: 0; padding-left: 20px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.card--current { border-color: var(--ss-primary); box-shadow: inset 0 0 0 1px var(--ss-primary); }
.banner--maint { background: #FFE8A3; color: #16201B; }

/* ═══ L12: profit card + page ═══ */
.pf-card .select-wrap--compact { max-width: 60%; }
.pf-total { border-top: 1px solid var(--ss-line); padding-top: 8px; }
.pf-potential { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--ss-r-md); background: var(--ss-primary-tint); }
.pf-month { display: grid; gap: 4px; padding: 4px 0; }
.pf-month--loss .ex-bar span { background: var(--ss-danger); }
