/* ============ Icons ============ */
.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.6em; height: 1.6em; }
.icon-xl { width: 2.2em; height: 2.2em; }

/* Icon tile: a small blue → green square that holds a white icon (same look as the numbered form-section icons) */
.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--on-brand);
  background: var(--grad);
  box-shadow: 0 10px 26px -10px rgb(var(--teal-rgb) / 0.8);
  flex: none;
}
.icon-tile .icon { width: 24px; height: 24px; stroke-width: 2; }
.icon-tile.sm { width: 38px; height: 38px; border-radius: 11px; }
.icon-tile.sm .icon { width: 19px; height: 19px; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--s-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
  border-radius: 12px;
}
.brand img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 6px 18px rgb(var(--teal-rgb) / 0.35));
  transition: transform var(--dur) var(--ease);
}
.brand:hover img { transform: rotate(-6deg) scale(1.04); }

.main-nav { display: none; margin-inline: auto; }
.main-nav ul { list-style: none; display: flex; gap: 4px; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color var(--dur), background var(--dur);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.main-nav a[aria-current='page'] .icon { color: var(--green); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
@media (min-width: 900px) {
  .main-nav { display: block; }
  .header-actions { margin-left: 0; }
}

.account-slot { display: flex; }
/* Language + screen colour: two small pills that always show both choices */
.pref-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  border: 1px solid rgb(var(--teal-rgb) / 0.4);
  background: var(--surface-1);
  flex: none;
}
.pref-switch button {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background var(--dur), color var(--dur);
}
.pref-switch button:hover { color: var(--text); background: var(--surface-3); }
.pref-switch button[aria-pressed='true'] { color: var(--on-brand); background: var(--grad); box-shadow: 0 4px 12px -6px rgb(var(--teal-rgb) / 0.8); }
.pref-switch button[lang='hi'] { font-family: var(--font-hi); font-size: 0.86rem; font-weight: 600; line-height: 1.5; padding-top: 1px; }
.pref-switch .icon { width: 16px; height: 16px; }
.theme-switch button { padding: 0 7px; }
@media (max-width: 520px) {
  .site-header .container { gap: var(--s-3); }
  .header-actions { gap: 6px; }
  .pref-switch button { padding: 0 7px; min-width: 30px; }
}
/* Very narrow phones: the login button keeps its icon, the pills keep their words */
@media (max-width: 380px) {
  .account-slot .btn-sm { padding: 0 10px; gap: 0; font-size: 0; }
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
}
.account-chip .dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  color: var(--on-brand);
}
.account-chip .dot .icon { width: 14px; height: 14px; stroke-width: 2.2; }

.account-menu { position: relative; }
.account-menu [role='menu'] {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
}
.account-menu [role='menuitem'] {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-decoration: none;
}
.account-menu [role='menuitem']:hover { background: var(--surface-3); color: var(--text); }

/* Mobile bottom navigation */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
}
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.bottom-nav a[aria-current='page'] .icon { color: var(--green); }
body.has-bottom-nav { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .bottom-nav { display: none; }
  body.has-bottom-nav { padding-bottom: 0; }
}

/* ============ Footer ============ */
.site-footer {
  margin-top: var(--s-8);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgb(var(--teal-rgb) / 0.04));
}
.site-footer .container {
  display: grid;
  gap: var(--s-6);
  padding-block: var(--s-7) var(--s-6);
}
.footer-top { display: grid; gap: var(--s-6); }
@media (min-width: 768px) { .footer-top { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-brand img { width: 48px; height: 48px; margin-bottom: var(--s-4); }
.footer-brand p { color: var(--muted); max-width: 34ch; font-size: var(--fs-sm); }
.footer-col h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--s-3);
  font-weight: 600;
}
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { color: var(--text-2); text-decoration: none; font-size: var(--fs-sm); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.footer-quiet { color: inherit; text-decoration: none; }
.footer-quiet:hover { color: var(--text-2); }

/* ============ Buttons ============ */
.btn {
  --btn-h: 46px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h);
  padding: 0 20px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease), background var(--dur), border-color var(--dur), box-shadow var(--dur), opacity var(--dur);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-hover); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  border: 0;
  color: var(--on-brand);
  background: var(--grad);
  background-size: 140% 100%;
  background-position: 0% 0;
  box-shadow: 0 10px 30px -10px rgb(var(--teal-rgb) / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.btn-primary:hover { background: var(--grad); background-size: 140% 100%; background-position: 100% 0; box-shadow: 0 14px 40px -10px rgb(var(--green-rgb) / 0.75), inset 0 1px 0 rgb(255 255 255 / 0.3); }
.btn-primary .icon { stroke-width: 2.1; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { background: rgb(240 98 90 / 0.12); border-color: rgb(240 98 90 / 0.4); color: var(--danger-fg); }
.btn-danger:hover { background: rgb(240 98 90 / 0.2); border-color: var(--danger); }

.btn-lg { --btn-h: 56px; padding: 0 28px; font-size: var(--fs-md); }
.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-h); padding: 0; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--text) transparent var(--text) transparent;
  animation: spin 0.8s linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--on-brand) transparent var(--on-brand) transparent; }

/* ============ Surfaces ============ */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-1), var(--card-end));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--s-5); }
@media (min-width: 768px) { .card-pad { padding: var(--s-6); } }

/* Gradient hairline border */
.card-glow {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, var(--surface-1), var(--glow-card-end)) padding-box,
    linear-gradient(140deg, rgb(var(--blue-rgb) / 0.55), var(--glow-edge) 40%, var(--glow-edge) 60%, rgb(var(--green-rgb) / 0.55)) border-box;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
}
.eyebrow::before {
  content: '';
  width: 18px; height: 1px;
  background: var(--grad);
}

.divider { height: 1px; background: var(--line); border: 0; margin: var(--s-5) 0; }

/* ============ Chips + badges ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.3;
}
button.chip { cursor: pointer; transition: background var(--dur), color var(--dur), border-color var(--dur); text-align: left; }
button.chip:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-hover); }
.chip .icon { width: 15px; height: 15px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-deficient { color: var(--deficient); background: rgb(242 179 61 / 0.1); border-color: rgb(242 179 61 / 0.35); }
.badge-sufficient { color: var(--sufficient); background: rgb(74 185 77 / 0.1); border-color: rgb(74 185 77 / 0.35); }
.badge-excess { color: var(--excess); background: rgb(240 98 90 / 0.1); border-color: rgb(240 98 90 / 0.35); }
.badge-neutral { color: var(--text-2); background: var(--surface-2); border-color: var(--line-strong); }
.badge-neutral::before { background: var(--teal); }

/* ============ Forms ============ */
.field { display: grid; gap: 8px; }
.field > label, .field-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label .req { color: var(--deficient); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field .error { font-size: var(--fs-xs); color: var(--excess); display: flex; align-items: center; gap: 6px; }

.input, .select, .textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text);
  font-size: var(--fs-md);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--placeholder); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-hover); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgb(var(--teal-rgb) / 0.16);
  background: var(--surface-1);
}
.input[aria-invalid='true'], .select[aria-invalid='true'] { border-color: var(--excess); }
.select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d898e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 18px;
}
.select:disabled { opacity: 0.5; }
.textarea { min-height: 96px; resize: vertical; }

.input-group { position: relative; display: flex; align-items: stretch; }
.input-group .input { flex: 1; }
.input-group .prefix, .input-group .suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
}
.input-group .prefix { border-radius: 14px 0 0 14px; border-right: 0; }
.input-group .prefix + .input { border-radius: 0 14px 14px 0; }
.input-group .input:has(+ .suffix) { border-radius: 14px 0 0 14px; }
.input-group .suffix { border-radius: 0 14px 14px 0; border-left: 0; }

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
}
.segmented button {
  border: 0;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: none;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.segmented button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Upload drop-zone */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: var(--s-3);
  min-height: 240px;
  padding: var(--s-6) var(--s-5);
  border-radius: var(--r-lg);
  border: 1.5px dashed var(--dash);
  background:
    radial-gradient(120% 90% at 50% 0%, rgb(var(--teal-rgb) / 0.08), transparent 60%),
    var(--bg-2);
  text-align: center;
  transition: border-color var(--dur), background var(--dur), transform var(--dur);
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--teal); }
.dropzone.is-drag { transform: scale(1.01); background: radial-gradient(120% 90% at 50% 0%, rgb(var(--teal-rgb) / 0.16), transparent 60%), var(--bg-2); }
.dropzone h3 { font-size: var(--fs-lg); }
.dropzone p { color: var(--muted); font-size: var(--fs-sm); }
.dropzone .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.file-preview {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
}
.file-preview .thumb {
  width: 72px; height: 72px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
  background: var(--surface-3);
  display: grid; place-items: center;
  color: var(--teal);
}
.file-preview .meta { min-width: 0; flex: 1; }
.file-preview .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-preview .size { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }

/* ============ Stepper ============ */
.stepper {
  list-style: none;
  display: flex;
  gap: 6px;
  counter-reset: step;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper li {
  flex: 1 0 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  position: relative;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
}
.stepper li::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}
.stepper .num {
  width: 26px; height: 26px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.stepper li.is-done { color: var(--text-2); }
.stepper li.is-done::after { background: rgb(var(--teal-rgb) / 0.5); }
.stepper li.is-done .num { background: rgb(var(--teal-rgb) / 0.15); border-color: rgb(var(--teal-rgb) / 0.5); color: var(--teal); }
.stepper li.is-current { color: var(--text); }
.stepper li.is-current::after { background: var(--grad); }
.stepper li.is-current .num { background: var(--grad); border: 0; color: var(--on-brand); font-weight: 700; }
@media (max-width: 640px) {
  .stepper li { padding-inline: 6px; flex: 1 1 0; justify-content: center; }
  .stepper li .label { display: none; }
  .stepper li.is-current .label { display: inline; }
  .stepper li.is-current { flex: 3 1 0; }
}

/* ============ Tabs ============ */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--on-brand); background: var(--grad); border-color: transparent; }
.tab .icon { width: 16px; height: 16px; }

/* ============ Accordion ============ */
.accordion { display: grid; gap: 10px; }
.accordion details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
  transition: border-color var(--dur), background var(--dur);
}
.accordion details[open] { border-color: var(--line-strong); background: var(--surface-2); }
.accordion summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 600;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .chev { margin-left: auto; color: var(--muted); transition: transform var(--dur) var(--ease); }
.accordion details[open] summary .chev { transform: rotate(180deg); color: var(--teal); }
.accordion .body { padding: 0 18px 18px; color: var(--text-2); display: grid; gap: 10px; }
.accordion .body ul { padding-left: 20px; display: grid; gap: 6px; }

/* ============ Alerts ============ */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.alert .icon { width: 20px; height: 20px; margin-top: 1px; }
.alert strong { color: var(--text); }
.alert-warn { border-color: rgb(242 179 61 / 0.35); background: rgb(242 179 61 / 0.07); }
.alert-warn > .icon { color: var(--deficient); }
.alert-error { border-color: rgb(240 98 90 / 0.4); background: rgb(240 98 90 / 0.07); }
.alert-error > .icon { color: var(--excess); }
.alert-ok { border-color: rgb(74 185 77 / 0.35); background: rgb(74 185 77 / 0.07); }
.alert-ok > .icon { color: var(--green); }
.alert-info > .icon { color: var(--info); }

/* ============ Modal (native <dialog>) ============ */
.modal {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  color: var(--text);
  box-shadow: var(--shadow-2), 0 0 120px -40px rgb(var(--teal-rgb) / 0.4);
  overflow: auto;
}
.modal::backdrop { background: var(--overlay); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in 260ms var(--ease); }
.modal-body { padding: var(--s-6) var(--s-5) var(--s-5); display: grid; gap: var(--s-4); }
@media (min-width: 480px) { .modal-body { padding: var(--s-6); } }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
}
.modal-head { display: grid; gap: 10px; justify-items: start; padding-right: 32px; }
.modal-head h2 { font-size: 2rem; }
.modal-head p { color: var(--text-2); font-size: var(--fs-sm); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }

/* OTP boxes */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  min-height: 0;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
  border-radius: 12px;
}

/* ============ Toasts ============ */
.toast-stack {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 24px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 900px) { .toast-stack { bottom: 28px; } }
.toast {
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-sm);
  animation: toast-in 280ms var(--ease);
}
.toast.is-leaving { animation: toast-out 200ms var(--ease) forwards; }
.toast .icon { width: 19px; height: 19px; margin-top: 1px; }
.toast-ok .icon { color: var(--green); }
.toast-error .icon { color: var(--excess); }
.toast-warn .icon { color: var(--deficient); }
.toast-info .icon { color: var(--info); }

/* ============ Loading / empty ============ */
.spinner {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--teal);
  animation: spin 0.8s linear infinite;
}
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: var(--s-6);
  text-align: center;
  color: var(--muted);
}
.empty .icon-tile { margin-bottom: 6px; }
.empty h3 { color: var(--text); }

/* Full-panel analysing screen shared by Soil + Crop Doctor */
.analysing {
  display: grid;
  justify-items: center;
  gap: var(--s-5);
  padding: var(--s-7) var(--s-5);
  text-align: center;
}
.analysing h2 { font-size: var(--fs-2xl); }
.analysing .steps { list-style: none; display: grid; gap: 10px; min-width: min(340px, 100%); text-align: left; }
.analysing .steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: var(--fs-sm);
  transition: color var(--dur), background var(--dur), border-color var(--dur);
}
.analysing .steps li .state { width: 20px; height: 20px; flex: none; display: grid; place-items: center; }
.analysing .steps li.is-active { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.analysing .steps li.is-active .state { border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--teal); animation: spin 0.8s linear infinite; }
.analysing .steps li.is-done { color: var(--text-2); }
.analysing .steps li.is-done .state { color: var(--green); }
.analysing .note { font-size: var(--fs-xs); color: var(--muted); }

/* Lightbox */
.lightbox {
  width: min(920px, calc(100vw - 24px));
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: #000;
  overflow: hidden;
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.85); }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; }
.lightbox .cap { padding: 12px 16px; font-size: var(--fs-sm); color: var(--text-2); background: var(--surface-1); display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ============ Section scaffolding ============ */
.page-hero { padding-block: var(--s-7) var(--s-6); display: grid; gap: var(--s-4); }
.page-hero h1 { font-size: var(--fs-3xl); max-width: 16ch; }
.page-hero p.lead { color: var(--text-2); font-size: var(--fs-lg); max-width: 60ch; }
.section { padding-block: var(--s-8); }
.section-head { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); max-width: 720px; }
.section-head p { color: var(--text-2); font-size: var(--fs-lg); }

.row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: grid; gap: var(--s-4); }
.stack-lg { display: grid; gap: var(--s-6); }
.grid-2 { display: grid; gap: var(--s-4); }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ AI orb (logo mark with living rings) ============ */
.ai-orb {
  --size: 140px;
  position: relative;
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  flex: none;
}
.ai-orb img {
  width: 46%;
  height: 46%;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 26px rgb(var(--teal-rgb) / 0.55));
  animation: float 4s ease-in-out infinite;
}
.ai-orb::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--teal-rgb) / 0.35), transparent 68%);
  filter: blur(8px);
  animation: pulse-glow 2.6s ease-in-out infinite;
}
.ai-orb .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 55%, rgb(var(--blue-rgb) / 0.9) 70%, rgb(var(--green-rgb)) 85%, transparent 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation: spin 2.4s linear infinite;
}
.ai-orb .ring.r2 {
  inset: 13%;
  animation-duration: 3.6s;
  animation-direction: reverse;
  opacity: 0.7;
}
.ai-orb .dot {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
  top: 50%; left: 50%;
  margin: -3px;
  animation: orbit 3s linear infinite;
}
.ai-orb .dot:nth-of-type(2) { background: var(--blue); box-shadow: 0 0 12px var(--blue); animation-duration: 4.2s; animation-delay: -1.3s; }
.ai-orb.sm { --size: 72px; }
.ai-orb.lg { --size: 200px; }

/* Thinking dots */
.thinking { display: inline-flex; gap: 5px; align-items: center; }
.thinking i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--grad);
  animation: bounce 1.2s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: 0.15s; }
.thinking i:nth-child(3) { animation-delay: 0.3s; }

/* ============ Login ============ */
.login-mark { width: 64px; height: 64px; filter: drop-shadow(0 10px 30px rgb(var(--teal-rgb) / 0.5)); }
.login-privacy { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); color: var(--muted); }
.login-privacy .icon { margin-top: 2px; }
.link-btn {
  border: 0; padding: 0; background: none;
  color: var(--teal);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login-success {
  display: grid;
  justify-items: center;
  gap: var(--s-4);
  padding: var(--s-6) 0;
  text-align: center;
}
.success-ring {
  width: 84px; height: 84px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad);
  color: var(--on-brand);
  box-shadow: 0 0 0 10px rgb(var(--green-rgb) / 0.12), 0 20px 60px -10px rgb(var(--green-rgb) / 0.7);
  animation: pop 420ms var(--ease) both;
}
.success-ring .icon { width: 40px; height: 40px; stroke-width: 2.6; }

.demo-flag {
  position: fixed;
  z-index: 60;
  left: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: rgb(var(--teal-rgb) / 0.14);
  border: 1px solid rgb(var(--teal-rgb) / 0.4);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0.85;
}
@media (min-width: 900px) { .demo-flag { bottom: 14px; } }

/* ============ Keyframes ============ */
@keyframes orbit { from { transform: rotate(0deg) translateX(calc(var(--size) / 2)) rotate(0deg); } to { transform: rotate(360deg) translateX(calc(var(--size) / 2)) rotate(-360deg); } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pulse-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.fade-up { animation: fade-up 420ms var(--ease) both; }
