:root {
  --bg: #f5efe4;
  --bg-accent: radial-gradient(circle at top, rgba(209, 143, 72, 0.24), transparent 38%),
    linear-gradient(135deg, #f8f4ed 0%, #ebe3d2 100%);
  --surface: rgba(255, 251, 245, 0.85);
  --surface-strong: #fffdf8;
  --border: rgba(89, 61, 38, 0.14);
  --text: #22170d;
  --muted: #655646;
  --primary: #0f766e;
  --primary-dark: #0b5b55;
  --accent: #c96e2f;
  --danger: #a63b32;
  --shadow: 0 24px 60px rgba(52, 33, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background: var(--bg-accent);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

video,
canvas {
  width: 100%;
  max-width: 100%;
  border-radius: 22px;
}

img {
  max-width: 100%;
  height: auto;
}

.page-shell {
  flex: 1 0 auto;
  width: min(1200px, calc(100% - 32px));
  min-width: 0;
  margin: 0 auto;
  padding: 32px 0 48px;
}

.site-footer {
  flex: 0 0 auto;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(255, 251, 245, 0.28);
  text-align: center;
  color: var(--muted);
  font-size: 0.94rem;
  letter-spacing: 0.01em;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent);
  font-weight: 600;
}

.site-footer a:hover {
  color: var(--primary);
}

.page-grid,
.admin-grid {
  display: grid;
  gap: 24px;
}

.page-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.admin-grid {
  grid-template-columns: 1fr;
}

.super-admin-shell { max-width: 1440px; }
.client-access-shell { max-width: 1200px; display: grid; place-items: center; }
.client-login-card { width: min(100%, 520px); }
.client-app { width: 100%; display: grid; gap: 28px; }
.client-app[hidden] { display: none; }
.workspace-card { width: 100%; padding: clamp(28px, 5vw, 58px); border: 1px solid rgba(89, 61, 38, 0.14); border-radius: 30px; background: rgba(255, 251, 245, 0.82); box-shadow: 0 28px 75px rgba(52, 33, 17, 0.14), 0 2px 0 rgba(255, 255, 255, 0.55) inset; backdrop-filter: blur(18px); }
.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.workspace-heading { min-width: 0; overflow-wrap: anywhere; }
.workspace-heading__topline { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.workspace-heading .eyebrow { margin: 0; }
.workspace-heading h1 { margin: 0; max-width: 850px; font-size: clamp(2.8rem, 6vw, 5.5rem); line-height: .98; letter-spacing: -.06em; }
.workspace-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(47, 133, 90, .18); border-radius: 999px; color: #236b45; background: rgba(217, 244, 229, .7); font: 600 .76rem/1.1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: .02em; white-space: nowrap; }
.workspace-status__dot { width: 7px; height: 7px; border-radius: 50%; background: #39a36a; box-shadow: 0 0 0 4px rgba(57, 163, 106, .12); }
.organization-chip { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; margin: 22px 0 0; padding: 10px 14px; overflow-wrap: anywhere; border: 1px solid rgba(15, 118, 110, .16); border-radius: 999px; color: var(--primary-dark); background: rgba(228, 241, 233, .72); font: 600 .92rem/1.3 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.button__icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.button--logout { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 12px 16px; border-radius: 14px; font: 600 .9rem/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.button--logout:hover { color: var(--primary-dark); border-color: rgba(15, 118, 110, .35); background: rgba(228, 241, 233, .75); }
.quick-actions { margin-top: clamp(48px, 7vw, 82px); }
.quick-actions__intro h2 { margin: 0; font: 700 clamp(1.8rem, 3vw, 2.35rem)/1.05 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.04em; }
.quick-actions__intro > p:last-child { margin: 10px 0 0; color: var(--muted); font: 400 1rem/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.client-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.action-card { min-height: 245px; display: flex; flex-direction: column; align-items: flex-start; padding: 24px; border: 1px solid var(--border); border-radius: 22px; background: rgba(255, 253, 248, .84); box-shadow: 0 10px 24px rgba(52, 33, 17, .06); transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease; }
.action-card:hover { transform: translateY(-4px); border-color: rgba(15, 118, 110, .28); box-shadow: 0 18px 34px rgba(52, 33, 17, .12); }
.action-card:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid rgba(201, 110, 47, .45); outline-offset: 3px; }
.action-card__icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 28px; border-radius: 16px; color: var(--primary); background: rgba(15, 118, 110, .11); }
.action-card__icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.action-card--accent .action-card__icon { color: var(--accent); background: rgba(201, 110, 47, .12); }
.action-card--neutral .action-card__icon { color: #6d5b48; background: rgba(109, 91, 72, .11); }
.action-card__body { display: grid; gap: 10px; }
.action-card__body strong { font: 700 1.2rem/1.2 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.025em; }
.action-card__body span { max-width: 28ch; color: var(--muted); font: 400 .94rem/1.55 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.action-card__link { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 28px; color: var(--primary-dark); font: 700 .9rem/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.action-card__link span { transition: transform 200ms ease; }
.action-card:hover .action-card__link span { transform: translateX(4px); }
.small-link { display: inline-block; margin-top: 18px; color: var(--primary); font-weight: 600; }
.field-with-toggle { position: relative; }
.field-with-toggle input { padding-right: 52px; }
.password-toggle { position: absolute; right: 8px; bottom: 5px; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.super-login-card { max-width: 520px; margin: 8vh auto 0; }
.super-dashboard { display: grid; gap: 24px; }
.super-dashboard[hidden] { display: none; }
.super-topbar, .super-layout, .toolbar { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.super-layout { align-items: flex-start; }
.super-sidebar { width: 220px; min-width: 0; padding: 18px; display: grid; gap: 8px; position: sticky; top: 20px; }
.super-nav { padding: 12px 14px; border-radius: 12px; color: var(--muted); }
.super-nav:hover, .super-nav--active { color: var(--primary-dark); background: rgba(15, 118, 110, 0.1); }
.super-main { flex: 1; min-width: 0; display: grid; gap: 24px; }
.muted-copy { color: var(--muted); line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-strong); display: grid; gap: 8px; }
.stat-card span { color: var(--muted); font-size: .9rem; }
.stat-card strong { font-size: 2rem; }
.stat-card--primary strong { color: var(--primary); }.stat-card--success strong { color: #2f855a; }.stat-card--danger strong { color: var(--danger); }.stat-card--muted strong { color: var(--muted); }
.client-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.client-form button { align-self: end; justify-self: start; }
.status-badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: .78rem; text-transform: capitalize; background: #eee; }.status-badge--active { color: #17633d; background: #d9f4e5; }.status-badge--inactive { color: #665b31; background: #f4edc9; }.status-badge--suspended { color: #8c2c26; background: #f7d9d6; }
.button--small { padding: 8px 12px; font-size: .82rem; }
.client-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.client-access-shell .client-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.button--danger { color: #8c2c26; border-color: #e9b7b2; background: #fff8f7; }
.button--danger:hover { color: #fff; border-color: #8c2c26; background: #8c2c26; }

@media (max-width: 860px) { .super-layout { display: grid; }.super-sidebar { width: 100%; position: static; grid-template-columns: repeat(4, 1fr); }.stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .client-form, .stats-grid { grid-template-columns: 1fr; }.super-sidebar { grid-template-columns: repeat(2, 1fr); }.super-topbar { align-items: flex-start; } }

@media (max-width: 900px) {
  .client-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .client-access-shell { width: min(100% - 20px, 560px); padding-top: 20px; }
  .workspace-card { padding: 26px 18px; border-radius: 24px; }
  .workspace-header { flex-direction: column; gap: 24px; }
  .workspace-heading h1 { font-size: clamp(2.55rem, 13vw, 4rem); }
  .workspace-heading__topline { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 14px; }
  .button--logout { width: 100%; }
  .quick-actions { margin-top: 48px; }
  .client-access-shell .client-actions { grid-template-columns: 1fr; gap: 12px; }
  .action-card { min-height: 220px; padding: 22px; }
  .super-topbar { flex-direction: column; align-items: stretch; }
  .super-topbar .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .action-card, .action-card__link span, .button { transition: none; }
}

#dashboard-content {
  display: grid;
  gap: 24px;
}

#dashboard-content[hidden] {
  display: none;
}

.subject-picker, .identified-student { margin-top: 18px; }
.identified-student { padding: 12px 14px; border-radius: 14px; background: rgba(15,118,110,.1); color: var(--primary-dark); font-weight: 700; }
.subject-options { display: flex; flex-wrap: wrap; gap: 10px; }

.hero {
  min-height: calc(100vh - 80px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: center;
}

.hero__content {
  max-width: 760px;
}

.hero__visual {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.hero__visual::before,
.hero__visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
}

.hero__visual::before {
  width: 430px;
  height: 430px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
}

.hero__visual::after {
  width: 310px;
  height: 310px;
  background: rgba(201, 110, 47, 0.08);
}

.scan-orb {
  position: relative;
  width: 310px;
  height: 310px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 253, 248, 0.94), rgba(228, 241, 233, 0.88));
  border: 1px solid rgba(15, 118, 110, 0.18);
  box-shadow: 0 25px 70px rgba(15, 118, 110, 0.16), inset 0 0 40px rgba(255, 255, 255, 0.8);
}

.scan-orb__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(15, 118, 110, 0.28);
}

.scan-orb__ring--outer {
  inset: 18px;
  border-style: dashed;
  animation: orb-spin 24s linear infinite;
}

.scan-orb__ring--inner {
  inset: 44px;
  border-color: rgba(201, 110, 47, 0.3);
  animation: orb-spin-reverse 18s linear infinite;
}

.scan-orb__face {
  position: relative;
  width: 105px;
  height: 135px;
  border: 3px solid var(--primary);
  border-radius: 48% 48% 45% 45%;
  background: rgba(255, 253, 248, 0.52);
  box-shadow: 0 0 0 10px rgba(15, 118, 110, 0.06);
}

.scan-orb__eye,
.scan-orb__nose,
.scan-orb__mouth {
  position: absolute;
  display: block;
  background: var(--primary-dark);
}

.scan-orb__eye {
  top: 48px;
  width: 9px;
  height: 5px;
  border-radius: 50%;
}

.scan-orb__eye--left { left: 27px; }
.scan-orb__eye--right { right: 27px; }

.scan-orb__nose {
  left: 49px;
  top: 58px;
  width: 3px;
  height: 24px;
  border-radius: 4px;
  opacity: 0.65;
}

.scan-orb__mouth {
  left: 39px;
  top: 101px;
  width: 26px;
  height: 3px;
  border-radius: 4px;
  opacity: 0.7;
}

.scan-orb__corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
}

.scan-orb__corner--tl { top: 82px; left: 76px; border-top: 2px solid; border-left: 2px solid; }
.scan-orb__corner--tr { top: 82px; right: 76px; border-top: 2px solid; border-right: 2px solid; }
.scan-orb__corner--bl { bottom: 82px; left: 76px; border-bottom: 2px solid; border-left: 2px solid; }
.scan-orb__corner--br { bottom: 82px; right: 76px; border-bottom: 2px solid; border-right: 2px solid; }

.scan-orb__line {
  position: absolute;
  left: 68px;
  right: 68px;
  top: 50%;
  height: 2px;
  background: var(--accent);
  opacity: 0.65;
  box-shadow: 0 0 12px rgba(201, 110, 47, 0.8);
  animation: scan-line 3s ease-in-out infinite;
}

.hero__status-card,
.workflow-card {
  position: absolute;
  padding: 18px;
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
}

.hero__status-card {
  width: min(320px, 78%);
  right: 0;
  top: 82px;
}

.status-card__topline,
.status-card__person,
.workflow-steps {
  display: flex;
  align-items: center;
}

.status-card__topline {
  gap: 8px;
  color: var(--muted);
  font-size: 0.83rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3eaa70;
  box-shadow: 0 0 0 5px rgba(62, 170, 112, 0.12);
}

.status-card__time {
  margin-left: auto;
  font-size: 0.75rem;
}

.status-card__person {
  gap: 11px;
  margin-top: 18px;
}

.status-card__avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: white;
  background: var(--primary);
  font-weight: 700;
}

.status-card__avatar::before,
.status-card__avatar::after {
  content: "";
  position: absolute;
  background: rgba(255, 253, 248, 0.92);
}

.status-card__avatar::before {
  top: 9px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-card__avatar::after {
  bottom: 8px;
  width: 22px;
  height: 11px;
  border-radius: 14px 14px 8px 8px;
}

.status-card__person strong {
  font-size: 0.95rem;
}

.status-card__person p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-card__check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 50%;
  color: white;
  background: #3eaa70;
}

.workflow-card {
  width: min(370px, 88%);
  bottom: 58px;
  left: 0;
}

.workflow-card__label {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workflow-steps {
  justify-content: space-between;
  gap: 8px;
}

.workflow-step {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
}

.workflow-step b {
  color: var(--text);
  font-size: 0.82rem;
}

.workflow-step--active b {
  color: var(--primary);
}

.workflow-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

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

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

@keyframes scan-line {
  0%, 100% { transform: translateY(-35px); opacity: 0.15; }
  50% { transform: translateY(35px); opacity: 0.9; }
}

.hero__content h1,
.section-heading h1,
.section-heading h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-heading h1 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
}

.section-heading h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

.hero__content h1 {
  font-size: clamp(3rem, 8vw, 5.7rem);
  max-width: 10ch;
}

.hero__copy,
.muted {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__actions,
.toolbar__actions,
.stack {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stack {
  flex-direction: column;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.button,
input,
select {
  font: inherit;
}

.button {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 180ms ease, background 180ms ease;
  text-align: center;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button--primary {
  background: var(--primary);
  color: #f6fbfa;
}

.button--primary:hover {
  background: var(--primary-dark);
}

.button--accent {
  background: var(--accent);
  color: #fff8f3;
}

.button--danger {
  background: var(--danger);
  color: #fff8f8;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field input,
.toolbar input,
.toolbar select {
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: var(--surface-strong);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #241910;
  aspect-ratio: 4 / 3;
}

.camera-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.camera-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status {
  margin-top: 18px;
  min-height: 28px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

.status[data-tone="success"] {
  color: #0d5f59;
  background: rgba(15, 118, 110, 0.12);
}

.status[data-tone="warning"] {
  color: #8c5319;
  background: rgba(201, 110, 47, 0.14);
}

.status[data-tone="error"] {
  color: #89251c;
  background: rgba(166, 59, 50, 0.12);
}

.sample-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.sample-chip {
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.toolbar__actions {
  min-width: 0;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  margin-top: 18px;
}

.calendar-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

#userSearch {
  margin-bottom: 10px;
  padding: 8px;
  width: 100%;
}

.summary-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid transparent;
}

.summary-pill--present {
  color: #0d5f59;
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.18);
}

.summary-pill--absent {
  color: #89251c;
  background: rgba(166, 59, 50, 0.12);
  border-color: rgba(166, 59, 50, 0.18);
}

.attendance-calendar {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 8px;
}

.calendar-day {
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.calendar-day__date {
  font-weight: 600;
}

.calendar-day__status {
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.calendar-day--present {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.2);
}

.calendar-day--absent {
  background: rgba(166, 59, 50, 0.12);
  border-color: rgba(166, 59, 50, 0.2);
}

.calendar-day--not_submitted {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.2);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background: var(--surface-strong);
  padding: 20px;
  margin: max(16px, 10vh) auto;
  width: min(100%, 500px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .hero {
    min-height: auto;
  }

  .page-shell,
  .site-footer {
    width: min(100% - 24px, 1100px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 24px;
  }

  .hero__visual {
    min-height: 480px;
  }

  .hero__content h1 {
    max-width: none;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 22px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar__actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar__actions .button,
  .toolbar__actions input,
  .toolbar__actions select {
    min-width: 0;
  }

  .client-access-shell .client-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  table {
    min-width: 620px;
  }
}

@media (max-width: 720px) {
  .page-shell,
  .site-footer {
    width: min(100% - 20px, 100%);
  }

  .page-shell {
    padding: 20px 0 32px;
  }

  .site-footer {
    font-size: 0.92rem;
  }

  .card {
    padding: 18px;
    border-radius: 22px;
  }

  .hero {
    gap: 18px;
    padding-top: 8px;
  }

  .hero__visual {
    min-height: 420px;
    transform: scale(0.92);
    transform-origin: center;
    margin: -20px 0;
  }

  .hero__content h1 {
    font-size: clamp(2.5rem, 13vw, 4rem);
  }

  .hero__copy,
  .muted {
    font-size: 0.98rem;
  }

  .hero__actions,
  .toolbar__actions,
  .stack {
    gap: 10px;
  }

  .hero__actions .button,
  .stack .button,
  .toolbar__actions .button,
  .toolbar__actions input,
  .toolbar__actions select {
    width: 100%;
  }

  .section-heading h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .section-heading h2 {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
  }

  .button {
    padding: 13px 16px;
  }

  .field input,
  .toolbar input,
  .toolbar select {
    padding: 13px 14px;
    font-size: 16px;
  }

  .camera-frame {
    border-radius: 20px;
    aspect-ratio: 4 / 3;
  }

  .status {
    margin-top: 14px;
    min-height: 0;
  }

  .sample-strip {
    gap: 8px;
    margin-top: 14px;
  }

  .sample-chip {
    padding: 8px 12px;
    font-size: 0.92rem;
  }

  .table-wrap {
    margin-top: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .attendance-calendar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  table {
    min-width: 540px;
  }

  th,
  td {
    padding: 12px 10px;
    font-size: 0.94rem;
  }
}

@media (max-width: 480px) {
  .page-shell,
  .site-footer {
    width: calc(100% - 16px);
  }

  .page-shell {
    padding: 16px 0 26px;
  }

  .card {
    padding: 16px;
    border-radius: 18px;
  }

  .camera-frame {
    border-radius: 18px;
  }

  .hero__content h1 {
    font-size: clamp(2.2rem, 12vw, 3.2rem);
  }

  .hero__visual {
    min-height: 350px;
    transform: scale(0.78);
    margin: -55px 0;
  }

  .section-heading h1 {
    font-size: clamp(1.8rem, 11vw, 2.5rem);
  }

  .section-heading h2 {
    font-size: clamp(1.35rem, 8.5vw, 1.9rem);
  }

  .toolbar {
    gap: 12px;
  }

  .toolbar__actions {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .attendance-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status {
    padding: 10px 12px;
    font-size: 0.92rem;
  }
}
