/* EduTots design system — port of the Tailwind theme in src/index.css + tailwind.config.js
   (navy + red palette of the current app).
   Plain CSS so the web host and the MAUI app need no Node/Tailwind build. */

/* ---------- Tokens ---------- */
:root {
  --background: 214 44% 97%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --primary: 222 60% 26%;
  --primary-foreground: 0 0% 100%;
  --secondary: 214 48% 92%;
  --muted: 214 34% 94%;
  --muted-foreground: 218 16% 40%;
  --accent: 353 70% 48%;
  --destructive: 0 72% 45%;
  --border: 214 26% 87%;
  --input: 214 26% 84%;
  --ring: 353 70% 50%;
  --blue: 217 70% 42%;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 28px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-color: hsl(var(--border)); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; font-variation-settings: "SOFT" 0, "WONK" 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; }
table { border-collapse: collapse; }
::selection { background-color: hsl(var(--accent) / 0.22); color: hsl(var(--foreground)); }
:focus-visible { outline: 2px solid hsl(var(--ring) / 0.6); outline-offset: 2px; }

/* ---------- Typography helpers ---------- */
.display { font-family: var(--font-display); }
.nums { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-accent { color: hsl(var(--accent)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-2xs { font-size: 11px; }
.tiny { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.center { text-align: center; }
.right { text-align: right; }
.pre-wrap { white-space: pre-wrap; }
.eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.section-label { font-size: 14px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-body); }
.page-title { margin-top: 6px; font-size: 28px; line-height: 1.05; letter-spacing: -0.01em; }
.lead { margin-top: 8px; font-size: 14px; color: hsl(var(--muted-foreground)); max-width: 42rem; }
.stat-value { font-family: var(--font-display); font-size: 24px; line-height: 1; }
.stat-big { font-family: var(--font-display); font-size: 44px; line-height: 1; letter-spacing: -0.01em; }
@media (min-width: 640px) {
  .page-title { font-size: 36px; }
  .stat-big { font-size: 56px; }
}

/* ---------- Layout ---------- */
.page { display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-start { display: flex; align-items: flex-start; gap: 12px; }
.row-between { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.row-center-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0%; min-width: 0; }
.shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }
.mt-auto { margin-top: auto; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.w-full { width: 100%; }
.max-sm { max-width: 24rem; }
.hidden { display: none !important; }

.grid { display: grid; gap: 16px; }
.grid-gap-sm { gap: 12px; }
.cols-2-xs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .page { gap: 20px; }
  .grid { gap: 20px; }
  .grid-gap-sm { gap: 12px; }
  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4-sm { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm-span-all { grid-column: 1 / -1; }
}
.md-only { display: none !important; }
@media (min-width: 640px) {
  .assign-grid { grid-template-columns: 1.2fr 1.2fr .8fr auto; align-items: end; }
}
@media (min-width: 768px) {
  .md-only { display: inline-flex !important; }
  .split-aside { grid-template-columns: 280px minmax(0, 1fr); }
  .md-hidden { display: none !important; }
  .md-block { display: block !important; }
  .md-flex { display: flex !important; }
}
@media (min-width: 1024px) {
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split-hero { grid-template-columns: 1.35fr 1fr; }
  .split { grid-template-columns: 1.15fr 1fr; }
  .split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .split-xl { grid-template-columns: 1.15fr 1fr; }
}

/* ---------- Surfaces ---------- */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-sm { background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 16px; }
.card-link { transition: border-color .15s ease; }
.card-link:hover { border-color: hsl(var(--primary) / 0.3); }
.card-hero { border-radius: var(--radius-xl); padding: 20px; }
.card-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.card-primary .muted-inv { color: hsl(var(--primary-foreground) / 0.72); }
.card-danger-soft { background: hsl(var(--destructive) / 0.05); border-radius: var(--radius-lg); padding: 16px; }
.tint { background: hsl(var(--secondary) / 0.6); border-radius: var(--radius-sm); padding: 8px 12px; }
.tint-strong { background: hsl(var(--secondary) / 0.7); }
.panel-soft { background: hsl(var(--secondary) / 0.5); border: 1px solid hsl(var(--border) / 0.8); border-radius: 22px; padding: 12px 16px; }
.empty {
  border: 1px dashed hsl(var(--border));
  background: hsl(var(--card) / 0.6);
  border-radius: var(--radius);
  padding: 40px 16px;
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 14px;
}
.empty-title { font-family: var(--font-display); font-size: 20px; color: hsl(var(--foreground)); }
.overflow-x { overflow-x: auto; }
.scroll-y { overflow-y: auto; }
.max-h-64 { max-height: 16rem; }
.max-h-72 { max-height: 18rem; }
.divider-top { border-top: 1px solid hsl(var(--border)); padding-top: 16px; }
@media (min-width: 640px) {
  .card { border-radius: var(--radius-xl); padding: 24px; }
  .card-hero { border-radius: 36px; padding: 28px 32px; }
  .card-danger-soft { border-radius: var(--radius-xl); padding: 20px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover { background: hsl(var(--primary) / 0.9); }
.btn:disabled { opacity: .55; }
.btn-outline { background: hsl(var(--card)); color: hsl(var(--foreground)); border-color: hsl(var(--input)); }
.btn-outline:hover { background: hsl(var(--secondary)); }
.btn-ghost { background: transparent; color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--secondary)); }
.btn-danger { background: hsl(var(--destructive)); color: #fff; }
.btn-danger:hover { background: hsl(var(--destructive) / 0.9); }
.btn-light { background: hsl(var(--primary-foreground)); color: hsl(var(--primary)); }
.btn-light:hover { background: hsl(var(--primary-foreground) / 0.9); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; }
.link { color: hsl(var(--primary)); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link-muted { color: hsl(var(--muted-foreground)); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.link-muted:hover { color: hsl(var(--foreground)); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; }
.hint { font-size: 12px; color: hsl(var(--muted-foreground)); }
.input, .textarea, .select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid hsl(var(--input));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font: inherit; font-size: 14px;
}
.textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566581' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: hsl(var(--ring)); box-shadow: 0 0 0 3px hsl(var(--ring) / 0.18); }
.input-sm { height: 36px; }
.input-lg { height: 48px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.input-icon > .input { padding-left: 38px; }
.error-text { font-size: 14px; color: hsl(var(--destructive)); }
.error-box { border-radius: var(--radius-sm); background: hsl(var(--destructive) / 0.08); color: hsl(var(--destructive)); padding: 10px 12px; font-size: 14px; }
.file-label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid hsl(var(--border)); border-radius: 999px; padding: 8px 16px; font-size: 14px; background: hsl(var(--card));
}
.file-label:hover { background: hsl(var(--secondary)); }
.file-label.sm { padding: 6px 12px; font-size: 12px; }
.file-label input[type=file] { display: none; }
.dashed-box { border: 1px dashed hsl(var(--border)); border-radius: var(--radius-sm); padding: 12px; }

/* ---------- Chips & badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 4px 10px;
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500;
  background: hsl(var(--secondary)); color: hsl(var(--muted-foreground));
  border: 1px solid transparent; white-space: nowrap;
}
.chip-lg { font-size: 11px; padding: 5px 10px; letter-spacing: .1em; }
.chip-accent { background: hsl(var(--accent) / 0.1); color: hsl(var(--accent)); }
.chip-primary { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); }
.chip-danger { background: hsl(var(--destructive) / 0.1); color: hsl(var(--destructive)); }
.chip-blue { background: hsl(var(--blue) / 0.1); color: hsl(var(--blue)); }
.chip-outline-accent { border-color: hsl(var(--accent) / 0.3); }
.chip-outline-danger { border-color: hsl(var(--destructive) / 0.3); }
.pill-info {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  border-radius: 999px; padding: 8px 14px; font-size: 12px; color: hsl(var(--muted-foreground));
}
.code-pill { border-radius: 999px; background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); padding: 4px 10px; font-weight: 500; font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; background: hsl(var(--border)); }
.dot-accent { background: hsl(var(--accent)); }
.dot-danger { background: hsl(var(--destructive)); }

/* ---------- Segmented toggle ---------- */
.segmented { display: inline-flex; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: 999px; padding: 4px; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 8px 16px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.segmented button.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

/* ---------- Lists & tables ---------- */
.list > li + li { border-top: 1px solid hsl(var(--border)); }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.pick-item { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 4px; text-align: left; border-radius: 8px; }
.pick-item:hover { background: hsl(var(--secondary) / 0.5); }
.table { width: 100%; font-size: 14px; }
.table th { text-align: left; font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-foreground)); padding: 8px; }
.table td { padding: 8px; border-top: 1px solid hsl(var(--border) / 0.7); vertical-align: top; }
.table .right { text-align: right; }
.table-compact td, .table-compact th { padding: 6px 4px; }
.table-head-tint thead { background: hsl(var(--secondary) / 0.6); }
.min-w-640 { min-width: 640px; }
.boxed { border: 1px solid hsl(var(--border)); border-radius: var(--radius-sm); overflow: hidden; }

/* ---------- Avatar ---------- */
.avatar { position: relative; display: inline-flex; flex-shrink: 0; }
.avatar-face {
  display: grid; place-items: center; border-radius: 999px;
  background: hsl(var(--secondary)); color: hsl(var(--primary));
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.avatar-sm .avatar-face { width: 36px; height: 36px; font-size: 11px; }
.avatar-md .avatar-face { width: 48px; height: 48px; font-size: 14px; }
.avatar-lg .avatar-face { width: 64px; height: 64px; font-size: 18px; }
.avatar-dot { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 999px; border: 2px solid hsl(var(--card)); background: hsl(var(--muted-foreground) / 0.4); }
.avatar-dot.in_school { background: hsl(var(--accent)); }
.avatar-dot.absent { background: hsl(var(--destructive)); }
.icon-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); background: hsl(var(--secondary)); color: hsl(var(--primary)); flex-shrink: 0; }
.icon-circle { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0; }
.icon-circle.entry { background: hsl(var(--accent) / 0.1); color: hsl(var(--accent)); }
.icon-circle.exit { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.icon-circle.danger { width: 40px; height: 40px; background: hsl(var(--destructive)); color: #fff; }

/* ---------- Icons ---------- */
.icon { width: 16px; height: 16px; flex-shrink: 0; }
.icon-xs { width: 12px; height: 12px; }
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 20px; height: 20px; }
.icon-lg { width: 24px; height: 24px; }
.spin { animation: et-spin 1s linear infinite; }
@keyframes et-spin { to { transform: rotate(360deg); } }

/* ---------- Skeleton ---------- */
.skeleton { background: hsl(var(--card)); border-radius: var(--radius-lg); animation: et-pulse 1.6s ease-in-out infinite; }
.skeleton.tint-bg { background: hsl(var(--secondary) / 0.6); }
@keyframes et-pulse { 50% { opacity: .5; } }

/* ---------- Progress ---------- */
.progress { height: 6px; border-radius: 999px; background: hsl(var(--secondary)); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: hsl(var(--accent)); }

/* ---------- App shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding-top: var(--safe-top);
}
.appbar-inner, .container { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.appbar-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.brand-logo { width: 36px; height: 36px; border-radius: 12px; object-fit: contain; }
.brand-name { font-family: var(--font-display); font-size: 22px; line-height: 1; letter-spacing: -0.01em; }
.appbar-nav { display: none; align-items: center; gap: 4px; margin-left: 8px; }
.nav-link { border-radius: 999px; padding: 8px 14px; font-size: 14px; color: hsl(var(--muted-foreground)); transition: color .15s ease; }
.nav-link:hover { color: hsl(var(--foreground)); }
.nav-link.active { background: hsl(var(--secondary)); color: hsl(var(--foreground)); font-weight: 500; }
.appbar-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.appbar-who { display: none; text-align: right; }
.appbar-who .name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.appbar-who .role { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.initials { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: hsl(var(--secondary)); font-size: 12px; font-weight: 600; }
.app-main { max-width: 72rem; margin: 0 auto; padding: 24px 16px calc(112px + var(--safe-bottom)); }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding-bottom: var(--safe-bottom);
}
.bottom-nav-inner { display: flex; max-width: 28rem; margin: 0 auto; padding: 0 8px; }
.bottom-link {
  flex: 1 1 0%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: hsl(var(--muted-foreground));
}
.bottom-link .icon { width: 20px; height: 20px; }
.bottom-link.active { color: hsl(var(--primary)); }
@media (min-width: 640px) {
  .appbar-inner, .container { padding: 0 24px; }
  .appbar-who { display: block; }
  .app-main { padding: 32px 24px calc(112px + var(--safe-bottom)); }
}
@media (min-width: 768px) {
  .appbar-nav { display: flex; }
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 48px; }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: hsl(222 47% 11% / 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  animation: et-fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 32rem; max-height: 92vh; overflow-y: auto;
  background: hsl(var(--card)); color: hsl(var(--foreground)); border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(20px + var(--safe-bottom));
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.45);
  animation: et-sheet .22s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-md { max-width: 28rem; }
.modal-title { font-family: var(--font-display); font-size: 24px; line-height: 1.15; display: flex; align-items: center; gap: 8px; }
.modal-desc { margin-top: 6px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.modal-body { margin-top: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { margin-top: 24px; display: flex; flex-direction: column-reverse; gap: 8px; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 16px; }
  .modal { border-radius: 24px; padding: 24px; }
  .modal-footer { flex-direction: row; justify-content: flex-end; }
}
@keyframes et-fade { from { opacity: 0; } }
@keyframes et-sheet { from { transform: translateY(24px); opacity: .6; } }

/* ---------- Toasts ---------- */
.toaster {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px);
  pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 14px;
  padding: 12px 14px; font-size: 14px;
  box-shadow: 0 18px 40px -22px rgba(3, 20, 12, 0.5);
  animation: et-rise .25s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast.success .icon { color: hsl(var(--accent)); }
.toast.error .icon { color: hsl(var(--destructive)); }
.toast.info .icon { color: hsl(var(--primary)); }
@media (min-width: 768px) { .toaster { bottom: 24px; left: auto; right: 24px; transform: none; } }

/* ---------- Gate camera ---------- */
.camera-frame { position: relative; aspect-ratio: 4 / 3; width: 100%; overflow: hidden; border-radius: var(--radius); background: hsl(var(--primary) / 0.9); }
.camera-frame video, .camera-frame img { width: 100%; height: 100%; object-fit: cover; }
.camera-frame video.mirror { transform: scaleX(-1); }
.camera-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 24px; text-align: center; font-size: 14px; color: hsl(var(--primary-foreground) / 0.8); }
.result-box { border-radius: var(--radius); border: 1px solid; padding: 16px; }
.result-box.ok { border-color: hsl(var(--accent) / 0.4); background: hsl(var(--accent) / 0.05); }
.result-box.bad { border-color: hsl(var(--destructive) / 0.4); background: hsl(var(--destructive) / 0.05); }
.quote-box { border-radius: var(--radius-sm); background: hsl(var(--card)); padding: 8px 12px; font-size: 12px; }

/* ---------- Distress presets ---------- */
.preset { border-radius: var(--radius-sm); border: 1px solid hsl(var(--border)); padding: 8px 12px; text-align: left; font-size: 12px; color: hsl(var(--muted-foreground)); }
.preset:hover { background: hsl(var(--secondary)); }
.preset.active { border-color: hsl(var(--destructive)); background: hsl(var(--destructive) / 0.05); color: hsl(var(--foreground)); }

/* ---------- Report card ---------- */
.report { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.report-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.5); padding: 16px 20px; }
.report-body { overflow-x: auto; padding: 8px; }
.report-foot { border-top: 1px solid hsl(var(--border)); padding: 16px 20px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.score-row { display: grid; grid-template-columns: minmax(0,1fr) 58px 58px 44px 32px; align-items: center; gap: 8px; }
.score-row .input { height: 36px; }
.score-row .num { text-align: right; }
@media (min-width: 640px) { .report-body { padding: 8px 16px; } }

/* ---------- Messages ---------- */
.convo-btn { width: 100%; border-radius: var(--radius-sm); padding: 10px 12px; text-align: left; transition: background-color .15s ease; }
.convo-btn:hover { background: hsl(var(--secondary) / 0.5); }
.convo-btn.active { background: hsl(var(--secondary)); }
.thread { display: flex; flex-direction: column; min-height: 420px; border-radius: var(--radius-lg); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.thread-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid hsl(var(--border)); padding: 12px 16px; }
.thread-body { flex: 1 1 0%; overflow-y: auto; max-height: 60vh; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.thread-compose { display: flex; align-items: flex-end; gap: 8px; border-top: 1px solid hsl(var(--border)); padding: 12px; }
.thread-compose .textarea { min-height: 42px; max-height: 8rem; resize: none; }
.bubble { max-width: 85%; border-radius: var(--radius); padding: 8px 14px; font-size: 14px; background: hsl(var(--secondary)); align-self: flex-start; }
.bubble.mine { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); align-self: flex-end; }
.bubble .meta { margin-top: 4px; font-size: 10px; color: hsl(var(--muted-foreground)); }
.bubble.mine .meta { color: hsl(var(--primary-foreground) / 0.6); }
.bubble .who { margin-bottom: 2px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }

/* ---------- Charts ---------- */
.chart { width: 100%; overflow: visible; }
.chart-bars { height: 64px; color: hsl(var(--primary) / 0.8); }
.chart-line { height: 96px; }
.chart-grid { stroke: hsl(var(--foreground) / 0.1); }
.chart-stroke { stroke: hsl(var(--accent)); }
.chart-fill-accent { fill: hsl(var(--accent)); }
.chart-fill-bg { fill: hsl(var(--background)); }
.chart-label { fill: hsl(var(--muted-foreground)); font-size: 9px; letter-spacing: .06em; }
.ring { position: relative; width: 64px; aspect-ratio: 1; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: hsl(var(--primary) / 0.15); }
.ring .fill { stroke: hsl(var(--primary)); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 500; }
@media (min-width: 640px) { .ring { width: 76px; } .ring span { font-size: 14px; } }
.dl-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-top: 1px solid hsl(var(--border)); padding-top: 16px; margin-top: 16px; }
.dl-3 dt { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.dl-3 dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 24px; line-height: 1; }
.feed-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; row-gap: 4px; padding: 12px 0; }
.feed-row .what { grid-column: span 2; min-width: 0; font-size: 14px; }
.feed-row .when { grid-column-start: 2; grid-row-start: 1; justify-self: end; font-size: 12px; color: hsl(var(--muted-foreground)); }
@media (min-width: 640px) {
  .feed-row { grid-template-columns: 132px 1fr auto; column-gap: 20px; }
  .feed-row .what { grid-column: auto; }
  .feed-row .when { grid-column-start: 3; grid-row-start: auto; }
}

/* ---------- Animations (src/index.css) ---------- */
@keyframes et-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes et-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes et-ring { from { stroke-dashoffset: 213.63; } }
@keyframes et-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.et-draw { stroke-dasharray: 1; animation: et-draw 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.et-grow { transform-box: fill-box; transform-origin: center bottom; animation: et-grow .9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.et-ring-fill { animation: et-ring 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.et-rise { animation: et-rise .6s cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .et-draw, .et-grow, .et-ring-fill, .et-rise, .spin, .skeleton { animation: none !important; }
}

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom)); }
.auth-card { width: 100%; max-width: 26rem; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius-xl); padding: 28px 24px; }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; margin-bottom: 24px; }
.auth-head .icon-tile { width: 48px; height: 48px; }
.auth-title { font-size: 26px; }
.auth-foot { margin-top: 24px; text-align: center; font-size: 14px; color: hsl(var(--muted-foreground)); }
.simple-header { border-bottom: 1px solid hsl(var(--border) / 0.7); }
.simple-header .inner { max-width: 48rem; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 64px; padding: calc(var(--safe-top)) 16px 0; }
.narrow { max-width: 48rem; margin: 0 auto; padding: 40px 16px 64px; }
.role-card { overflow: hidden; border-radius: var(--radius-lg); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); text-align: left; transition: border-color .15s ease; display: block; width: 100%; }
.role-card:hover { border-color: hsl(var(--primary) / 0.4); }
.role-card.active { border-color: hsl(var(--primary)); }
.role-card:disabled { opacity: .6; }
.role-card .media { aspect-ratio: 16 / 9; overflow: hidden; background: hsl(var(--secondary)); }
.role-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.role-card:hover .media img { transform: scale(1.03); }
.role-card .body { padding: 20px; }
.blocked { max-width: 32rem; margin: 0 auto; padding: 40px 0; text-align: center; }
.blocked .icon-tile { margin: 0 auto; width: 56px; height: 56px; }

/* ---------- Landing ---------- */
.landing-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid hsl(var(--border) / 0.7); background: hsl(var(--background) / 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.landing-header .appbar-inner { gap: 24px; }
.landing-nav { display: none; align-items: center; gap: 4px; margin-left: 8px; }
.landing-nav a { border-radius: 999px; padding: 8px 14px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.landing-nav a:hover { color: hsl(var(--foreground)); }
.sm-inline { display: none; }
@media (min-width: 640px) { .sm-inline { display: inline-flex; } }
@media (min-width: 768px) { .landing-nav { display: flex; } }
.section { max-width: 72rem; margin: 0 auto; padding: 64px 16px; }
.section-band { border-top: 1px solid hsl(var(--border)); border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--secondary) / 0.4); }
.section-title { margin-top: 12px; font-size: 30px; line-height: 1.08; letter-spacing: -0.01em; }
.section-lead { margin-top: 16px; font-size: 15px; line-height: 1.65; color: hsl(var(--muted-foreground)); }
.section-intro { max-width: 42rem; }
.feature-card { border-radius: var(--radius-lg); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 24px; transition: border-color .15s ease; }
.feature-card:hover { border-color: hsl(var(--primary) / 0.3); }
.feature-card h3 { margin-top: 16px; font-size: 20px; line-height: 1.2; }
.feature-card p { margin-top: 8px; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.landing-role { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.landing-role .media { aspect-ratio: 4 / 3; overflow: hidden; background: hsl(var(--secondary)); }
.landing-role .media img { width: 100%; height: 100%; object-fit: cover; }
.landing-role .body { display: flex; flex: 1 1 auto; flex-direction: column; padding: 20px; }
.landing-role h3 { font-size: 18px; line-height: 1.2; }
.check-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.check-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; color: hsl(var(--muted-foreground)); }
.check-list .icon { color: hsl(var(--accent)); margin-top: 2px; }
.check-list.lg li { font-size: 14px; color: hsl(var(--foreground)); gap: 10px; }
.media-frame { position: relative; overflow: hidden; border-radius: var(--radius-xl); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-4-5 { aspect-ratio: 4 / 5; }
.steps { display: flex; flex-direction: column; gap: 24px; margin-top: 32px; }
.steps li { display: flex; gap: 16px; }
.steps .n { margin-top: 2px; font-family: var(--font-display); font-size: 14px; color: hsl(var(--primary) / 0.7); }
.steps h3 { font-size: 18px; line-height: 1.2; }
.steps p { margin-top: 4px; font-size: 14px; line-height: 1.6; color: hsl(var(--muted-foreground)); }
.two-col { display: grid; gap: 40px; align-items: center; }
.quote-text { margin-top: 16px; font-family: var(--font-display); font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; }
.price { margin-top: 12px; font-family: var(--font-display); font-size: 46px; line-height: 1; letter-spacing: -0.01em; }
.price-card { border-radius: var(--radius-xl); border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 24px; }
.footer { border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.footer-inner { max-width: 72rem; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; padding: 40px 16px; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 14px; color: hsl(var(--muted-foreground)); }
.footer-nav a:hover { color: hsl(var(--foreground)); }
.footer-legal { max-width: 72rem; margin: 0 auto; border-top: 1px solid hsl(var(--border)); padding: 20px 16px; font-size: 12px; color: hsl(var(--muted-foreground)); }
@media (min-width: 640px) {
  .section { padding: 96px 24px; }
  .section-title { font-size: 42px; }
  .section-lead { font-size: 16px; }
  .feature-card { border-radius: var(--radius-xl); }
  .quote-text { font-size: 34px; }
  .price { font-size: 56px; }
  .price-card { border-radius: 36px; padding: 32px; }
  .media-frame { border-radius: 36px; }
  .footer-inner { padding: 40px 24px; }
  .footer-legal { padding: 20px 24px; }
}
@media (min-width: 768px) { .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; } }
@media (min-width: 1024px) {
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; }
  .two-col.quote { grid-template-columns: .85fr 1.15fr; gap: 56px; }
  .two-col.pricing { grid-template-columns: 1fr 1.05fr; }
}

/* Hero — ported from LandingHero.jsx */
.et-hero {
  --et-ink: hsl(var(--primary));
  --et-pale: hsl(var(--background));
  position: relative; width: 100%; isolation: isolate; overflow: hidden;
  background: hsl(var(--primary));
  border-bottom: 1px solid hsl(var(--primary) / 0.15);
}
.et-hero-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden;
  background:
    radial-gradient(22% 15% at 50% 58%, rgba(255,255,255,.62) 0%, rgba(233,241,255,.20) 55%, rgba(233,241,255,0) 100%),
    linear-gradient(180deg, hsl(214 60% 96%) 0%, hsl(214 55% 92%) 26%, hsl(216 45% 85%) 44%, hsl(220 40% 68%) 58%, hsl(223 46% 46%) 72%, hsl(224 58% 30%) 86%, hsl(var(--primary)) 100%);
}
.et-hero-rings {
  position: absolute; left: 50%; top: 58%; width: 150%; aspect-ratio: 1;
  transform: translate(-50%, -50%) perspective(680px) rotateX(61deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 56%, rgba(0,0,0,0) 100%);
          mask-image: radial-gradient(closest-side, #000 56%, rgba(0,0,0,0) 100%);
}
.et-hero-rings::before {
  content: ""; position: absolute; inset: -25%;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 0 12.5px, rgba(255,255,255,.55) 13px 14px, rgba(255,255,255,0) 14.5px 15px);
}
@media (prefers-reduced-motion: no-preference) { .et-hero-rings::before { animation: et-breathe 7s ease-in-out infinite; } }
@keyframes et-breathe { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.05); opacity: 1; } }
.et-hero-frame {
  position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  gap: clamp(36px, 6vw, 64px); width: 100%; max-width: 72rem; margin: 0 auto;
  padding: clamp(56px, 8vw, 104px) clamp(20px, 5vw, 48px) clamp(26px, 3vw, 34px);
}
.et-hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: clamp(16px, 2.2vw, 24px); width: 100%; }
.et-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
  border: 1px solid hsl(var(--primary) / 0.25); border-radius: 999px; background: hsl(0 0% 100% / 0.45);
  color: hsl(var(--primary) / 0.9); font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
}
.et-hero-title { font-family: var(--font-display); font-weight: 600; color: var(--et-ink); font-size: clamp(2.1rem, 1.1rem + 4vw, 4rem); line-height: 1.04; letter-spacing: -0.02em; max-width: 17em; text-wrap: balance; }
.et-hero-title em { font-style: italic; color: hsl(353 72% 42%); }
.et-hero-lead { max-width: 58ch; color: hsl(var(--primary) / 0.84); font-size: clamp(.9375rem, .88rem + .3vw, 1.0625rem); line-height: 1.62; }
.et-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 4px; }
.et-hero-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; min-width: 186px; padding: 12px 28px;
  border-radius: 999px; font-size: .9375rem; font-weight: 500; line-height: 1; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.et-hero-btn--solid { background: var(--et-ink); color: var(--et-pale); border: 1px solid var(--et-ink); }
.et-hero-btn--solid:hover { background: transparent; color: var(--et-ink); }
.et-hero-btn--ghost { background: transparent; color: var(--et-ink); border: 1px solid hsl(var(--primary) / 0.55); }
.et-hero-btn--ghost:hover { background: var(--et-ink); color: var(--et-pale); border-color: var(--et-ink); }
.et-hero-shot { position: relative; z-index: 2; width: 100%; max-width: 52rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 24px; border: 1px solid rgba(255,255,255,.55); box-shadow: 0 40px 80px -40px rgba(8,18,38,.65); }
.et-hero-shot img { height: 100%; width: 100%; object-fit: cover; }
.et-hero-alert { position: absolute; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 16px; background: rgba(255,255,255,.94); box-shadow: 0 14px 32px -18px rgba(0,0,0,.55); }
.et-hero-alert-dot { width: 8px; height: 8px; border-radius: 999px; background: hsl(var(--accent)); box-shadow: 0 0 0 4px hsl(var(--accent) / 0.18); }
.et-hero-alert-title { font-size: .8125rem; font-weight: 600; color: hsl(var(--primary)); }
.et-hero-alert-time { font-size: .6875rem; color: hsl(var(--primary) / 0.65); }
.et-hero-logos { position: relative; z-index: 2; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: clamp(18px, 3vw, 48px); color: #fff; }
.et-hero-logo { display: flex; flex-direction: column; gap: 3px; }
.et-hero-logo-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.et-hero-logo-place { font-size: .5rem; letter-spacing: .28em; text-transform: uppercase; color: rgba(255,255,255,.78); }
@media (min-width: 640px) {
  .et-hero-shot { border-radius: 32px; }
  .et-hero-alert { left: 22px; bottom: 22px; padding: 11px 16px; }
  .et-hero-alert-title { font-size: .875rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .et-hero-eyebrow { animation: et-rise .6s 0s cubic-bezier(.2,.7,.2,1) both; }
  .et-hero-title { animation: et-rise .7s .06s cubic-bezier(.2,.7,.2,1) both; }
  .et-hero-lead { animation: et-rise .7s .14s cubic-bezier(.2,.7,.2,1) both; }
  .et-hero-actions { animation: et-rise .7s .22s cubic-bezier(.2,.7,.2,1) both; }
  .et-hero-shot { animation: et-rise .8s .28s cubic-bezier(.2,.7,.2,1) both; }
  .et-hero-logos { animation: et-rise .7s .4s cubic-bezier(.2,.7,.2,1) both; }
}
@media (max-width: 599px) {
  .et-hero-frame { gap: 48px; padding-top: 64px; }
  .et-hero-logos { display: grid; grid-template-columns: repeat(6, 1fr); justify-items: center; row-gap: 26px; column-gap: 8px; text-align: center; }
  .et-hero-logo { grid-column: span 2; align-items: center; }
  .et-hero-logo:nth-child(4) { grid-column: 2 / span 2; }
  .et-hero-logo-name { font-size: .95rem; }
  .et-hero-logo-place { font-size: .42rem; letter-spacing: .2em; }
  .et-hero-btn { min-width: 0; flex: 1 1 100%; }
}
@media (min-width: 600px) and (max-width: 767px) {
  .et-hero-logos { flex-wrap: nowrap; gap: 10px; }
  .et-hero-logo-name { font-size: .9rem; }
  .et-hero-logo-place { font-size: .4rem; letter-spacing: .16em; }
}

/* ---------- Boot / error UI ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; color: hsl(var(--muted-foreground)); font-size: 14px; }
#blazor-error-ui {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: #fff7e0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
  padding: 12px 20px calc(12px + var(--safe-bottom)); font-size: 14px;
}
#blazor-error-ui .reload { text-decoration: underline; margin-left: 8px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
