:root {
  --salva-green: #006b3f;
  --salva-green-dark: #004b2f;
  --salva-green-soft: #e5f3dc;
  --salva-yellow: #ffd400;
  --salva-yellow-soft: #fff3a6;
  --salva-red: var(--salva-green);
  --salva-red-dark: var(--salva-green-dark);
  --ink: #101820;
  --ink-soft: #4a5568;
  --paper: #f7f5e8;
  --card: #ffffff;
  --line: rgba(16, 24, 32, 0.12);
  --ok: #0c7a43;
  --warn: #7c5a00;
  --shadow: 0 26px 80px rgba(0, 75, 47, 0.18);
  --focus-ring: 0 0 0 3px rgba(0, 107, 63, 0.32);
  font-family: "Inter", "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 212, 0, 0.34), transparent 34rem),
    radial-gradient(circle at 86% 14%, rgba(0, 107, 63, 0.2), transparent 28rem),
    linear-gradient(135deg, #f8f4df 0%, #edf4e7 48%, #dfeee4 100%);
}

button,
input {
  font: inherit;
}

.lang-switcher {
  position: fixed;
  top: max(0.65rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 50;
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 107, 63, 0.16);
  box-shadow: 0 6px 16px rgba(16, 24, 32, 0.08);
  backdrop-filter: blur(12px);
}

.lang-switcher-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(16, 24, 32, 0.72);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switcher-button:hover,
.lang-switcher-button:focus-visible {
  background: rgba(0, 107, 63, 0.1);
  color: #006b3f;
  outline: none;
}

.lang-switcher-button.is-active {
  background: #006b3f;
  color: #fff;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.4rem;
  background: rgba(16, 24, 32, 0.08);
}

.start-shell,
.inspection-shell {
  width: min(980px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) 1rem max(1.5rem, env(safe-area-inset-bottom));
  display: grid;
  align-items: center;
}

.hero-card,
.inspection-intro,
.loading-card,
.completed-card,
.review-card,
.sending-card,
.error-card,
.admin-login,
.session-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card,
.inspection-intro,
.completed-card,
.review-card,
.sending-card,
.error-card,
.admin-login {
  padding: clamp(1.25rem, 5vw, 3rem);
}

.hero-card,
.inspection-intro {
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.inspection-intro::before {
  content: "";
  position: absolute;
  right: -7rem;
  top: -7rem;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 212, 0, 0.32), rgba(0, 107, 63, 0.08) 58%, transparent 70%);
  pointer-events: none;
}

.brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 8.8rem;
  height: auto;
  display: block;
  flex: 0 0 auto;
  filter: none;
}

.brand-logo-small {
  width: 8rem;
}

.brand-logo-subtle {
  opacity: 0.84;
}

.hero-card .brand-logo-subtle,
.inspection-intro .brand-logo-subtle {
  opacity: 0.82;
}

.camera-header .brand-logo-subtle {
  opacity: 0.68;
}

.brand-mark {
  width: 3.8rem;
  height: 3.8rem;
  display: grid;
  place-items: center;
  border-radius: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--salva-red), #ff7b2c);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--salva-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 9vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 1.5rem 0;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  line-height: 1.45;
}

.start-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
  max-width: 26rem;
}

.stepped-start-form {
  max-width: 44rem;
}

.start-step {
  display: grid;
  gap: 0.8rem;
  animation: stepIn 180ms ease both;
}

.start-step[hidden] {
  display: none;
}

.start-step-kicker {
  margin: 0;
  color: var(--salva-green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.start-step h2 {
  margin: 0;
  font-size: clamp(1.7rem, 5vw, 2.7rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.start-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.15rem;
}

.start-step-actions .primary-button,
.start-step-actions .ghost-button {
  min-width: 9rem;
}

.start-form label {
  font-weight: 800;
}

.flow-choice,
.vehicle-flow-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.vehicle-flow-choice {
  padding: 0.65rem;
  border: 1px solid rgba(0, 107, 63, 0.12);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.42);
}

.vehicle-flow-choice[hidden] {
  display: none;
}

.flow-option {
  position: relative;
  min-height: 5.2rem;
  padding: 0.9rem;
  border: 1px solid rgba(0, 107, 63, 0.14);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
}

.flow-option.selected {
  border-color: rgba(0, 107, 63, 0.38);
  background: linear-gradient(135deg, rgba(229, 243, 220, 0.94), rgba(255, 243, 166, 0.78));
  box-shadow: 0 12px 28px rgba(0, 107, 63, 0.12);
}

.flow-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flow-option strong,
.flow-option span {
  display: block;
}

.flow-option strong {
  font-size: 1.08rem;
}

.flow-option span {
  margin-top: 0.22rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.25;
}

.start-form input,
.admin-login input {
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #fff;
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-form input.property-reference {
  font-size: 1.12rem;
  letter-spacing: 0;
  text-transform: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.secondary-link {
  min-height: 3.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 80ms ease;
  -webkit-tap-highlight-color: transparent;
}

.primary-button {
  color: #fff;
  background: var(--salva-green);
  box-shadow: 0 6px 14px rgba(0, 107, 63, 0.18);
}

.primary-button:hover:not(:disabled) {
  background: var(--salva-green-dark);
  box-shadow: 0 8px 18px rgba(0, 107, 63, 0.24);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(0, 107, 63, 0.2);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.secondary-button,
.secondary-link {
  color: var(--ink);
  background: var(--salva-yellow);
  box-shadow: 0 4px 10px rgba(255, 212, 0, 0.28);
}

.secondary-button:hover,
.secondary-link:hover {
  background: #f5c800;
  box-shadow: 0 6px 14px rgba(255, 212, 0, 0.34);
}

.secondary-button:active,
.secondary-link:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(255, 212, 0, 0.24);
}

.ghost-button {
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.ghost-button:hover {
  background: rgba(16, 24, 32, 0.04);
  border-color: rgba(16, 24, 32, 0.2);
}

.ghost-button:active {
  transform: translateY(1px);
  background: rgba(16, 24, 32, 0.07);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.secondary-link:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.text-link {
  color: var(--salva-green-dark);
  font-weight: 850;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

.form-message {
  min-height: 1.4rem;
  color: var(--salva-red-dark);
  font-weight: 750;
}

.note-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.note-grid div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.6);
}

.note-grid strong,
.note-grid span {
  display: block;
}

.note-grid span {
  margin-top: 0.25rem;
  color: var(--ink-soft);
}

.privacy-note,
.admin-muted {
  color: var(--ink-soft);
}

.admin-notice {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  color: var(--ok);
  background: rgba(12, 122, 67, 0.1);
  font-weight: 850;
}

.inspection-intro {
  display: grid;
  gap: 1.05rem;
}

.inspection-intro .lead {
  margin: 0;
}

.intro-camera-button {
  width: min(100%, 22rem);
  min-height: 3.75rem;
  margin-top: 0.15rem;
  font-size: 1.08rem;
}

.inspection-intro .privacy-note {
  max-width: 34rem;
  margin: -0.25rem 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
}

.browser-warning {
  position: relative;
  z-index: 1;
  max-width: 43rem;
  padding: 0.9rem;
  border: 1px solid rgba(124, 90, 0, 0.22);
  border-radius: 1rem;
  background: rgba(255, 243, 166, 0.64);
}

.browser-warning strong,
.browser-warning p {
  display: block;
}

.browser-warning p {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  line-height: 1.35;
}

.browser-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.browser-actions .primary-button,
.browser-actions .secondary-button,
.browser-actions .ghost-button {
  min-height: 2.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.loading-card {
  width: min(24rem, 100%);
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.spinner {
  width: 2.4rem;
  height: 2.4rem;
  margin: 0 auto 1rem;
  border: 0.3rem solid rgba(16, 24, 32, 0.12);
  border-top-color: var(--salva-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.camera-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.camera-header h1 {
  font-size: clamp(1.6rem, 6vw, 3rem);
}

.progress-pill {
  min-width: 4rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: #fff;
  background: var(--ink);
  text-align: center;
  font-weight: 900;
}

.camera-stage {
  position: relative;
  overflow: hidden;
  min-height: min(58vh, 34rem);
  border-radius: 1.8rem;
  background:
    linear-gradient(135deg, rgba(16, 24, 32, 0.74), rgba(16, 24, 32, 0.92)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 18px);
  box-shadow: var(--shadow);
}

.camera-stage video {
  width: 100%;
  height: 100%;
  min-height: min(58vh, 34rem);
  display: block;
  object-fit: cover;
}

.camera-fallback {
  min-height: min(58vh, 34rem);
  display: grid;
  place-items: center;
  padding: 2rem;
  color: #fff;
  text-align: center;
}

.camera-fallback strong,
.camera-fallback span {
  display: block;
}

.orientation-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  color: #fff;
  background: rgba(16, 24, 32, 0.88);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity 180ms ease, transform 180ms ease;
}

.orientation-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.orientation-overlay h2 {
  margin: 1rem 0 0.4rem;
  font-size: clamp(1.8rem, 8vw, 3.4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.orientation-overlay p {
  max-width: 24rem;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.78);
}

.rotate-phone {
  position: relative;
  width: 8.5rem;
  height: 8.5rem;
  display: grid;
  place-items: center;
}

.phone-shape {
  width: 3.3rem;
  height: 5.7rem;
  border: 0.32rem solid #fff;
  border-radius: 0.9rem;
  animation: rotatePhone 1.25s ease-in-out infinite;
}

.rotate-arrow {
  position: absolute;
  inset: 0.2rem;
  border: 0.22rem solid rgba(255, 255, 255, 0.28);
  border-right-color: #fff;
  border-radius: 50%;
  animation: spin 1.25s linear infinite;
}

.step-panel {
  margin-top: 0.85rem;
  padding: 1rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px rgba(16, 24, 32, 0.1);
}

.step-instruction {
  margin-bottom: 0.65rem;
  font-size: 1.05rem;
  font-weight: 720;
}

.orientation-status {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  font-size: 0.94rem;
  font-weight: 760;
}

.orientation-status.ok {
  color: var(--ok);
  background: rgba(12, 122, 67, 0.1);
}

.orientation-status.soft {
  color: var(--warn);
  background: rgba(255, 184, 77, 0.14);
}

.orientation-status.blocking {
  color: var(--salva-red-dark);
  background: rgba(215, 25, 32, 0.12);
}

.metadata-status {
  margin: -0.35rem 0 0.85rem;
  padding: 0.58rem 0.72rem;
  border-radius: 0.85rem;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.18;
}

.metadata-status.ok {
  color: var(--ok);
  background: rgba(12, 122, 67, 0.09);
}

.metadata-status.soft {
  color: var(--ink-soft);
  background: rgba(16, 24, 32, 0.06);
}

.metadata-status.warning {
  color: var(--warn);
  background: rgba(255, 184, 77, 0.16);
}

.upload-status {
  margin: -0.35rem 0 0.85rem;
  padding: 0.52rem 0.68rem;
  border-radius: 0.85rem;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.16;
}

.upload-status[hidden] {
  display: none;
}

.upload-status.ok {
  color: var(--ok);
  background: rgba(12, 122, 67, 0.09);
}

.upload-status.soft {
  color: var(--ink-soft);
  background: rgba(16, 24, 32, 0.06);
}

.upload-status.warning {
  color: var(--salva-red-dark);
  background: rgba(215, 25, 32, 0.12);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.capture-button {
  min-height: 3.8rem;
  font-size: 1.08rem;
}

.capture-button.finish-mode {
  background: var(--salva-green, #006b3f);
  box-shadow: 0 14px 32px rgba(0, 107, 63, 0.32);
}

.step-strip {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  padding-bottom: 0.2rem;
  overflow-x: auto;
}

.step-dot {
  min-width: 5.4rem;
  padding: 0.65rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.step-dot span {
  width: 1.45rem;
  height: 1.45rem;
  display: inline-grid;
  place-items: center;
  margin-right: 0.25rem;
  border-radius: 50%;
  background: rgba(16, 24, 32, 0.1);
}

.step-dot.current {
  color: #fff;
  background: var(--ink);
}

.step-dot.done {
  border-color: rgba(12, 122, 67, 0.35);
}

.step-dot.done span {
  color: #fff;
  background: var(--ok);
}

.step-dot.queued,
.step-dot.uploading {
  border-color: rgba(255, 184, 77, 0.55);
}

.step-dot.queued span,
.step-dot.uploading span {
  color: #3c3000;
  background: var(--salva-yellow);
}

.step-dot.failed {
  border-color: rgba(215, 25, 32, 0.45);
}

.step-dot.failed span {
  color: #fff;
  background: var(--salva-red);
}

.finish-panel {
  padding: 1rem;
  border-radius: 1.2rem;
  background: rgba(16, 24, 32, 0.07);
}

.finish-panel p {
  margin: 0.7rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.completed-card,
.review-card,
.sending-card,
.error-card {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}

.review-card .brand-row,
.sending-card .brand-row {
  justify-content: center;
  text-align: left;
}

.review-warning-mark {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0.5rem auto 0.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(215, 25, 32, 0.12);
  color: var(--salva-red-dark, #b8141a);
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
}

.review-card .review-title {
  margin: 0.5rem 0 0.4rem;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 850;
}

.review-card .review-body {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.45;
}

.review-card .upload-status,
.sending-card .upload-status {
  margin: 0 0 1rem;
}

.review-finish-button {
  width: 100%;
  min-height: clamp(4.2rem, 12vh, 5.4rem);
  border-radius: 1.4rem;
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  font-weight: 800;
}

.sending-spinner {
  width: 3.5rem;
  height: 3.5rem;
  margin: 1.75rem auto 1.25rem;
  border: 4px solid rgba(0, 107, 63, 0.15);
  border-top-color: var(--salva-green, #006b3f);
  border-radius: 50%;
  animation: salva-spin 0.9s linear infinite;
}

.sending-card .sending-body {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.45;
}

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

.desktop-landing-card {
  width: min(46rem, 100%);
  margin: 0 auto;
  padding: clamp(1.25rem, 5vw, 3rem);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.desktop-landing-card h1 {
  font-size: clamp(2rem, 7vw, 4rem);
}

.desktop-link-box {
  display: grid;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
  text-align: left;
}

.desktop-link-box span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.desktop-link-box input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
}

.desktop-qr {
  width: min(19rem, 60vw);
  padding: 0.9rem;
  border: 1px solid rgba(0, 107, 63, 0.14);
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 18px 38px rgba(16, 24, 32, 0.12);
}

.desktop-qr.qr-error {
  width: auto;
  color: var(--salva-red-dark);
  font-weight: 800;
}

.qr-svg {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}

.desktop-lead {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 800;
  line-height: 1.3;
  max-width: 28rem;
}

.desktop-qr-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.desktop-start-notice {
  display: grid;
  justify-items: center;
  gap: 1.4rem;
  margin-top: 0.5rem;
  text-align: center;
}

.desktop-start-notice .privacy-note,
.desktop-start-notice .form-message {
  max-width: 28rem;
  margin: 0;
  font-size: 0.9rem;
}

.desktop-link-toggle {
  width: min(22rem, 100%);
  margin: 0;
  text-align: left;
}

.desktop-link-toggle > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.1rem;
  color: var(--salva-green);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.desktop-link-toggle > summary::-webkit-details-marker {
  display: none;
}

.desktop-link-toggle > summary::after {
  content: "▾";
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.desktop-link-toggle[open] > summary::after {
  transform: rotate(180deg);
}

body.desktop-blocked .hero-card > .lead,
body.start-page.desktop-blocked .hero-card > .lead {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  body.start-page:not(.desktop-override) .hero-card > .lead {
    display: none;
  }
}

.start-desktop-blocker {
  display: none;
}

body.desktop-blocked .start-desktop-blocker {
  display: grid;
}

body.desktop-blocked .start-form,
body.desktop-blocked .note-grid {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  body.start-page:not(.desktop-override) .start-desktop-blocker {
    display: grid;
  }

  body.start-page:not(.desktop-override) .start-form,
  body.start-page:not(.desktop-override) .note-grid {
    display: none;
  }
}

.desktop-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.success-mark {
  width: 4rem;
  height: 4rem;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: #fff;
  background: var(--ok);
  font-size: 2rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  color: #fff;
  background: rgba(16, 24, 32, 0.94);
  box-shadow: 0 20px 50px rgba(16, 24, 32, 0.28);
  opacity: 0;
  transform: translate(-50%, 1rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.inspection-page .toast {
  top: max(0.75rem, env(safe-area-inset-top));
  bottom: auto;
  transform: translate(-50%, -0.75rem);
}

.inspection-page .toast.visible {
  transform: translate(-50%, 0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.admin-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-header,
.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.admin-card-actions.left {
  justify-content: flex-start;
}

.admin-toolbar {
  margin: 0 0 1rem;
  padding: 0.85rem;
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.76);
}

.admin-filter-form,
.admin-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-admin-form {
  display: inline-flex;
}

.admin-filter-form input[type="search"] {
  min-height: 2.75rem;
  width: min(18rem, 100%);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-weight: 750;
}

.filter-tab {
  min-height: 2.35rem;
  padding: 0.52rem 0.72rem;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(16, 24, 32, 0.07);
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
}

.filter-tab.current {
  color: #fff;
  background: var(--salva-green);
}

.danger-button {
  color: #fff;
  background: #9f2f18;
}

.admin-header {
  margin-bottom: 1.2rem;
}

.admin-header h1 {
  font-size: clamp(2rem, 7vw, 4rem);
}

.admin-login {
  max-width: 34rem;
}

.admin-login form {
  display: grid;
  gap: 0.75rem;
}

.session-list {
  display: grid;
  gap: 1rem;
}

.session-card {
  padding: 1rem;
}

.session-card h2 {
  margin-bottom: 0.3rem;
  font-size: 1.8rem;
}

.session-check-panel,
.report-hero,
.report-grid {
  display: grid;
  gap: 0.75rem;
}

.session-check-panel {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 1rem;
}

.check-tile,
.report-card,
.report-hero > div {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.check-tile {
  min-height: 5.4rem;
  padding: 0.75rem;
}

.check-tile span,
.check-tile small,
.report-hero span,
.report-photo-row span,
.report-photo-row em {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.check-tile strong,
.report-hero strong {
  display: block;
  margin-top: 0.22rem;
}

.check-tile small {
  margin-top: 0.22rem;
  line-height: 1.25;
}

.check-tile-wide {
  grid-column: span 1;
}

.status-badge {
  width: fit-content;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.86rem;
}

.status-badge.ok {
  color: #fff;
  background: var(--ok);
}

.status-badge.warning {
  color: #3c3000;
  background: var(--salva-yellow);
}

.status-badge.danger {
  color: #fff;
  background: #9f2f18;
}

.status-badge.neutral {
  color: var(--ink);
  background: rgba(16, 24, 32, 0.1);
}

.report-shell {
  width: min(1040px, 100%);
}

.report-hero {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.report-hero > div,
.report-card {
  padding: 1rem;
}

.report-grid {
  grid-template-columns: 1.2fr 1fr 1fr;
  margin-bottom: 1rem;
}

.report-card h2 {
  margin-bottom: 0.7rem;
}

.report-card p {
  margin-bottom: 0.55rem;
}

.report-value {
  font-size: 1.25rem;
  font-weight: 900;
}

.warning-list {
  margin: 0;
  padding-left: 1.2rem;
}

.warning-list li {
  margin: 0.35rem 0;
}

.report-photo-list {
  display: grid;
  gap: 0.55rem;
}

.report-photo-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1.1fr 1.4fr 0.7fr 1.4fr;
  gap: 0.5rem;
  align-items: start;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.64);
}

.report-photo-row em {
  color: var(--warn);
  font-style: normal;
  font-weight: 760;
}

.photo-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-photo-slot {
  min-height: 10rem;
  padding: 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.admin-photo-slot strong,
.admin-photo-slot span,
.admin-photo-slot em {
  display: block;
}

.admin-photo-slot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  margin: 0.45rem 0;
  border-radius: 0.75rem;
  object-fit: cover;
  background: rgba(16, 24, 32, 0.08);
}

.admin-photo-slot span,
.admin-photo-slot em {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.admin-photo-slot em {
  margin-top: 0.2rem;
  color: var(--warn);
  font-style: normal;
  font-weight: 760;
}

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

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotatePhone {
  0%,
  24% {
    transform: rotate(0deg);
  }
  70%,
  100% {
    transform: rotate(90deg);
  }
}

@media (max-width: 700px) {
  .start-shell,
  .inspection-shell {
    align-items: start;
  }

  .browser-actions {
    grid-template-columns: 1fr;
  }

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

  .flow-choice,
  .vehicle-flow-choice {
    grid-template-columns: 1fr;
  }

  .start-step-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .start-step-actions .primary-button,
  .start-step-actions .ghost-button {
    width: 100%;
  }

  .camera-stage,
  .camera-stage video,
  .camera-fallback {
    min-height: 44dvh;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .ghost-button {
    min-height: 2.8rem;
  }

  .session-card-header,
  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-card-actions {
    justify-content: flex-start;
  }

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

  .session-check-panel,
  .report-hero,
  .report-grid,
  .report-photo-row {
    grid-template-columns: 1fr;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .inspection-shell {
    width: 100%;
    padding: 0.6rem;
  }

  .camera-header {
    margin-bottom: 0.45rem;
  }

  .camera-stage,
  .camera-stage video,
  .camera-fallback {
    min-height: 50dvh;
  }

  .step-panel {
    margin-top: 0.45rem;
    padding: 0.7rem;
  }

  .step-strip,
  .finish-panel {
    display: none;
  }
}

.inspection-page {
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.camera-shell {
  width: min(980px, 100%);
  height: 100dvh;
  min-height: 0;
  padding: calc(env(safe-area-inset-top) + 0.45rem) 0.55rem calc(env(safe-area-inset-bottom) + 0.55rem);
  display: block;
  overflow: hidden;
}

.camera-screen {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
}

.camera-header {
  min-height: 3.4rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(0, 75, 47, 0.1);
}

.brand-logo-compact {
  width: clamp(4.7rem, 19vw, 6rem);
}

.camera-title-block {
  min-width: 0;
  flex: 1;
}

.camera-title-block .eyebrow {
  margin-bottom: 0.05rem;
  font-size: 0.66rem;
}

.camera-title-block h1 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.05rem, 4.7vw, 1.55rem);
  line-height: 1;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-header .progress-pill {
  min-width: 3.1rem;
  min-height: 2.4rem;
  border: 0;
  color: var(--ink);
  background: var(--salva-yellow);
  cursor: pointer;
}

.fullscreen-button {
  min-height: 2.4rem;
  padding: 0.5rem 0.72rem;
  border: 1px solid rgba(0, 107, 63, 0.18);
  border-radius: 999px;
  color: #fff;
  background: var(--salva-green);
  font-size: 0.78rem;
  font-weight: 850;
  cursor: pointer;
}

.fullscreen-button[hidden] {
  display: none;
}

.camera-body {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.camera-stage {
  height: auto;
  min-height: 0;
  border-radius: 1.1rem;
  box-shadow: 0 16px 36px rgba(0, 75, 47, 0.2);
}

.camera-stage video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  transform: rotate(var(--video-rotation, 0deg));
  transform-origin: center;
  transition: transform 120ms ease;
  will-change: transform;
}

.camera-stage video.video-rotated-quarter {
  inset: auto;
  left: 50%;
  top: 50%;
  width: var(--video-stage-height, 100%);
  height: var(--video-stage-width, 100%);
  transform: translate(-50%, -50%) rotate(var(--video-rotation, 0deg));
}

.camera-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  height: 100%;
  min-height: 0;
}

.camera-stage video[hidden],
.camera-fallback[hidden] {
  display: none;
}

.shot-chip {
  position: absolute;
  left: 0.65rem;
  top: 0.65rem;
  z-index: 4;
  max-width: calc(100% - 1.3rem);
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 212, 0, 0.95);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.guide-caption {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  z-index: 4;
  max-width: 11rem;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 75, 47, 0.78);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: right;
}

.stage-shot-label {
  position: absolute;
  left: 50%;
  bottom: clamp(0.65rem, 3.2%, 1.25rem);
  z-index: 4;
  max-width: min(94%, 38rem);
  padding: 0.28rem 0.74rem 0.34rem;
  border: 1px solid rgba(255, 212, 0, 0.76);
  border-radius: 1rem;
  color: #fff;
  background: rgba(0, 75, 47, 0.68);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  font-size: clamp(1.18rem, 4.9vw, 3.2rem);
  font-weight: 950;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.48);
  transform: translateX(-50%);
  pointer-events: none;
}

.rotate-preview-button {
  position: absolute;
  right: 0.65rem;
  bottom: 0.65rem;
  z-index: 5;
  min-height: 2.45rem;
  padding: 0.52rem 0.74rem;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 24, 32, 0.72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.rotate-preview-button[hidden] {
  display: none;
}

.focus-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.focus-mask::before {
  content: "";
  position: absolute;
  inset: 9% 3.5% 10%;
  border-radius: 28% / 42%;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.22);
}

.focus-mask-front::before,
.focus-mask-rear::before,
.focus-mask-windshield::before {
  inset: 10% 10% 11%;
  border-radius: 34% / 38%;
}

.focus-mask-left::before,
.focus-mask-right::before {
  inset: 17% 4.5% 17%;
  border-radius: 36% / 46%;
}

.focus-mask-odometer::before {
  inset: 14% 16% 16%;
  border-radius: 1.2rem;
}

.car-guide {
  position: absolute;
  inset: 8% 3.5% 9%;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(255, 212, 0, 0.96);
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.car-guide svg,
.car-guide img {
  width: min(100%, 42rem);
  height: 100%;
  overflow: visible;
  object-fit: contain;
}

.car-guide svg {
  fill: rgba(0, 107, 63, 0.06);
  stroke: currentColor;
  stroke-width: 5.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.68));
}

.car-guide img {
  display: block;
  opacity: 0.96;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.68));
}

.mirror-guide {
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

.camera-shell .step-panel {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 75, 47, 0.12);
}

.camera-shell .step-instruction {
  display: -webkit-box;
  margin-bottom: 0.5rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 820;
  line-height: 1.22;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.camera-shell .orientation-status {
  margin-bottom: 0.55rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
  line-height: 1.18;
}

.camera-shell .metadata-status {
  margin: -0.25rem 0 0.55rem;
  padding: 0.48rem 0.62rem;
  font-size: 0.76rem;
  line-height: 1.16;
}

.camera-shell .upload-status {
  margin: -0.25rem 0 0.55rem;
  padding: 0.42rem 0.58rem;
  font-size: 0.72rem;
  line-height: 1.12;
}

.camera-shell .orientation-status.blocking {
  color: #3c3000;
  background: var(--salva-yellow-soft);
}

.camera-shell .action-row {
  grid-template-columns: 0.72fr 1.74fr 0.72fr;
  gap: 0.5rem;
}

.camera-shell .property-action-row {
  grid-template-columns: 1fr;
}

@media (orientation: portrait) {
  .camera-shell .step-panel:has(.property-action-row) {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .camera-shell .step-panel:has(.property-action-row) .secondary-action-row {
    order: 10;
    margin-top: 0;
    width: 100%;
  }

  .camera-shell .step-panel:has(.property-action-row) .property-action-row {
    order: 11;
    display: block;
    width: 100%;
    margin-top: 0.2rem;
  }

  .camera-shell .property-action-row .capture-button {
    display: flex;
    width: 100%;
    min-height: clamp(5.8rem, 16vh, 8.4rem);
    border-radius: 1.4rem;
    font-size: clamp(1.3rem, 5vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 32px rgba(0, 107, 63, 0.32);
  }

  .camera-shell .step-panel:has(.property-action-row) .secondary-action-row .compact-button {
    min-height: 3.1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 650;
  }
}

.camera-shell .primary-button,
.camera-shell .secondary-button,
.camera-shell .ghost-button {
  min-height: 3rem;
  padding: 0.68rem 0.8rem;
  font-size: 0.96rem;
}

.camera-shell .capture-button {
  min-height: 4.1rem;
  border-radius: 1.25rem;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
}

.secondary-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.compact-button {
  min-height: 2.55rem;
}

.steps-sheet {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  align-items: end;
  padding: 1rem;
  background: rgba(16, 24, 32, 0.42);
}

.steps-sheet[hidden] {
  display: none;
}

.steps-sheet-card {
  width: min(34rem, 100%);
  max-height: min(78dvh, 34rem);
  margin: 0 auto;
  padding: 1rem;
  overflow: auto;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: var(--shadow);
}

.steps-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.steps-sheet .step-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  overflow: visible;
}

.steps-sheet .step-dot {
  width: 100%;
  min-width: 0;
  text-align: left;
}

.steps-sheet-card p {
  margin: 0.85rem 0 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.finish-confirm-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(16, 24, 32, 0.55);
  animation: fadeIn 140ms ease;
}

.finish-confirm-sheet[hidden] {
  display: none;
}

.finish-confirm-card {
  width: min(28rem, 100%);
  padding: 1.4rem 1.4rem 1.2rem;
  border-radius: 1.4rem;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 32, 0.32);
  animation: confirmIn 180ms ease both;
}

.finish-confirm-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.finish-confirm-summary {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.finish-confirm-hint {
  margin: 0 0 1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.75rem;
  color: var(--warn);
  background: rgba(255, 184, 77, 0.18);
  font-size: 0.88rem;
}

.finish-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.finish-confirm-actions .primary-button,
.finish-confirm-actions .ghost-button {
  min-height: 3rem;
  font-size: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirmIn {
  from { opacity: 0; transform: translateY(0.6rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (orientation: landscape) and (max-height: 560px) {
  .finish-confirm-card {
    padding: 0.85rem 1rem 0.85rem;
    border-radius: 1rem;
  }

  .finish-confirm-card h2 {
    margin-bottom: 0.3rem;
    font-size: 1.15rem;
  }

  .finish-confirm-summary {
    margin-bottom: 0.2rem;
    font-size: 0.92rem;
  }

  .finish-confirm-hint {
    margin-bottom: 0.5rem;
    padding: 0.38rem 0.5rem;
    font-size: 0.75rem;
  }

  .finish-confirm-actions {
    margin-top: 0.55rem;
    gap: 0.4rem;
  }

  .finish-confirm-actions .primary-button,
  .finish-confirm-actions .ghost-button {
    min-height: 2.4rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 700px) {
  .brand-row {
    gap: 0.75rem;
  }

  .brand-logo {
    width: 7.4rem;
  }

  .start-shell,
  .inspection-shell {
    padding-inline: 0.75rem;
  }

  .hero-card,
  .inspection-intro,
  .completed-card,
  .error-card,
  .admin-login {
    border-radius: 1.35rem;
  }

  .camera-shell {
    padding: calc(env(safe-area-inset-top) + 0.4rem) 0.45rem calc(env(safe-area-inset-bottom) + 0.45rem);
  }

  .camera-stage,
  .camera-stage video,
  .camera-fallback {
    min-height: 0;
  }

  .camera-shell .action-row {
    grid-template-columns: 0.65fr 1.8fr 0.65fr;
  }
}

@media (max-height: 700px) and (orientation: portrait) {
  .brand-logo-compact {
    width: 5.1rem;
  }

  .camera-header {
    min-height: 3rem;
  }

  .camera-title-block h1 {
    font-size: 1rem;
  }

  .camera-shell .step-panel {
    padding: 0.5rem;
  }

  .camera-shell .step-instruction {
    -webkit-line-clamp: 1;
  }

  .camera-shell .orientation-status {
    margin-bottom: 0.4rem;
    padding: 0.42rem 0.55rem;
  }

  .secondary-action-row {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .camera-shell {
    width: 100%;
    padding: calc(env(safe-area-inset-top) + 0.35rem) 0.45rem calc(env(safe-area-inset-bottom) + 0.35rem);
  }

  .camera-screen {
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
  }

  .camera-header {
    display: none;
  }

  .camera-body {
    grid-template-columns: minmax(0, 1fr) clamp(14.4rem, 28vw, 17.2rem);
    grid-template-rows: minmax(0, 1fr);
    gap: 0.45rem;
  }

  .camera-stage {
    min-height: 0;
    border-radius: 0.9rem;
  }

  .camera-stage video,
  .camera-fallback {
    min-height: 0;
  }

  .camera-shell .step-panel {
    align-self: stretch;
    min-height: 0;
    height: 100%;
    padding: 0.7rem;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0.5rem, 1fr) auto auto auto;
    align-content: stretch;
    row-gap: 0.55rem;
  }

  .camera-shell .step-instruction {
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    line-height: 1.14;
    -webkit-line-clamp: 2;
  }

  .camera-shell .orientation-status {
    margin-bottom: 0.35rem;
    padding: 0.34rem 0.5rem;
    font-size: 0.72rem;
    line-height: 1.12;
  }

  .camera-shell .metadata-status {
    margin: -0.18rem 0 0.35rem;
    padding: 0.3rem 0.45rem;
    font-size: 0.68rem;
    line-height: 1.1;
  }

  .camera-shell .upload-status {
    margin: -0.18rem 0 0.35rem;
    padding: 0.28rem 0.42rem;
    font-size: 0.66rem;
    line-height: 1.08;
  }

  .camera-shell .secondary-action-row {
    grid-row: 6;
    gap: 0.6rem;
    margin-top: 0;
    align-self: start;
  }

  .camera-shell .action-row {
    display: grid;
    grid-row: 7 / span 2;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "previous next"
      "capture capture";
    gap: 0.7rem;
    align-self: stretch;
    height: 100%;
  }

  .camera-shell .property-action-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "capture"
      "capture";
  }

  .camera-shell .primary-button,
  .camera-shell .secondary-button,
  .camera-shell .ghost-button {
    min-height: 2.15rem;
    padding: 0.42rem 0.55rem;
    border-radius: 0.85rem;
    font-size: 0.8rem;
  }

  .camera-shell #previousButton {
    grid-area: previous;
    min-height: 2.85rem;
    padding: 0.6rem 0.7rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 0.85rem;
  }

  .camera-shell #nextButton {
    grid-area: next;
    min-height: 2.85rem;
    padding: 0.6rem 0.7rem;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 0.85rem;
  }

  .camera-shell .capture-button {
    grid-area: capture;
    align-self: stretch;
    min-height: clamp(6.5rem, 32vh, 11rem);
    border-radius: 1.25rem;
    font-size: clamp(1.4rem, 5.5vh, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 24px rgba(0, 107, 63, 0.32);
  }

  .camera-shell .secondary-action-row .compact-button {
    min-height: 2.85rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.85rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(255, 212, 0, 0.85);
    box-shadow: none;
  }

  .camera-shell .secondary-action-row .compact-button:hover {
    background: rgba(255, 212, 0, 0.95);
  }

  .camera-shell .compact-button {
    min-height: 2.6rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
  }

  .rotate-preview-button {
    right: 0.45rem;
    bottom: 0.45rem;
    min-height: 2.05rem;
    padding: 0.35rem 0.55rem;
    font-size: 0.74rem;
  }

  .stage-shot-label {
    bottom: 0.5rem;
    max-width: 94%;
    padding: 0.22rem 0.58rem 0.28rem;
    border-radius: 0.85rem;
    font-size: clamp(0.82rem, 2.75vw, 1.65rem);
  }

  .steps-sheet .step-strip {
    display: grid;
  }
}

.admin-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 212, 0, 0.34), transparent 32rem),
    radial-gradient(circle at 92% 8%, rgba(0, 107, 63, 0.2), transparent 30rem),
    linear-gradient(145deg, #f9f6e6 0%, #edf5ea 46%, #e7f0e9 100%);
}

.admin-page .admin-shell {
  width: min(1320px, 100%);
  padding: clamp(1rem, 2.4vw, 2rem);
}

.admin-page .admin-header {
  margin-bottom: 1rem;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 54px rgba(0, 75, 47, 0.12);
  backdrop-filter: blur(18px);
}

.admin-page .admin-header h1 {
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  letter-spacing: -0.06em;
}

.admin-page .brand-logo-small {
  width: clamp(6.2rem, 12vw, 8rem);
}

.admin-action-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--salva-green), var(--salva-green-dark));
  box-shadow: 0 12px 26px rgba(0, 107, 63, 0.2);
}

.admin-page .secondary-link,
.admin-page .secondary-button {
  min-height: 2.55rem;
  border: 1px solid rgba(0, 75, 47, 0.1);
  box-shadow: none;
}

.admin-page .danger-button {
  border-color: rgba(159, 47, 24, 0.18);
  color: #fff;
  background: #9f2f18;
}

.admin-type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 38px rgba(0, 75, 47, 0.08);
  backdrop-filter: blur(18px);
}

.admin-type-switch a {
  min-height: 3.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 0.95rem;
  color: var(--ink);
  background: transparent;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 900;
  text-decoration: none;
}

.admin-type-switch a.current {
  color: #fff;
  background: linear-gradient(135deg, var(--salva-green), var(--salva-green-dark));
  box-shadow: 0 12px 28px rgba(0, 107, 63, 0.22);
}

.admin-type-switch span {
  min-width: 1.8rem;
  min-height: 1.8rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.45rem;
  border-radius: 999px;
  color: var(--salva-green-dark);
  background: var(--salva-yellow);
  font-size: 0.82rem;
}

.admin-page .admin-login {
  margin-top: 1rem;
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.84);
}

.admin-page .admin-login h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.admin-dashboard article {
  min-height: 6.2rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 36px rgba(0, 75, 47, 0.08);
}

.admin-dashboard span,
.admin-dashboard small,
.session-meta,
.session-progress-text,
.technical-details,
.photo-meta-list span,
.photo-meta-list em {
  color: var(--ink-soft);
}

.admin-dashboard span,
.admin-dashboard small {
  display: block;
}

.admin-dashboard span {
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-dashboard strong {
  display: block;
  margin: 0.15rem 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.admin-dashboard small {
  font-size: 0.82rem;
}

.admin-page .admin-toolbar {
  grid-template-columns: minmax(16rem, 0.9fr) minmax(24rem, 1.6fr) auto;
  margin-bottom: 0.75rem;
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 38px rgba(0, 75, 47, 0.08);
  backdrop-filter: blur(18px);
}

.admin-page .admin-filter-form input[type="search"] {
  width: min(20rem, 100%);
  border-color: rgba(0, 75, 47, 0.16);
  background: #fff;
}

.filter-tab {
  gap: 0.45rem;
}

.filter-tab span {
  min-width: 1.45rem;
  min-height: 1.45rem;
  display: inline-grid;
  place-items: center;
  padding: 0 0.35rem;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.76rem;
}

.filter-tab.current span {
  color: var(--salva-green-dark);
  background: var(--salva-yellow);
}

.admin-page .admin-muted {
  font-size: 0.92rem;
}

.admin-page .session-list {
  gap: 0.85rem;
}

.admin-page .session-card {
  padding: clamp(0.85rem, 1.6vw, 1.15rem);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 54px rgba(0, 75, 47, 0.12);
}

.admin-page .session-card-header {
  align-items: flex-start;
}

.session-card-main {
  min-width: min(32rem, 100%);
  flex: 1;
}

.session-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.admin-page .session-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.session-state {
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-type-badge {
  min-height: 1.8rem;
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.62rem;
  border: 1px solid rgba(0, 107, 63, 0.16);
  border-radius: 999px;
  color: var(--salva-green-dark);
  background: rgba(229, 243, 220, 0.9);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-state.completed {
  color: #fff;
  background: var(--ok);
}

.session-state.in_progress {
  color: #3c3000;
  background: var(--salva-yellow);
}

.session-state.empty {
  color: var(--ink-soft);
  background: rgba(16, 24, 32, 0.1);
}

.session-meta {
  margin: 0.45rem 0 0.6rem;
  font-size: 0.9rem;
}

.session-progress {
  width: min(24rem, 100%);
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.09);
}

.session-progress span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--salva-green), var(--salva-yellow));
}

.session-progress-text {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  font-weight: 800;
}

.technical-details {
  margin-top: 0.35rem;
  font-size: 0.82rem;
}

.technical-details summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 800;
}

.technical-details code {
  display: inline-block;
  margin-top: 0.25rem;
}

.admin-page .session-check-panel {
  grid-template-columns: 0.9fr 1.4fr 1fr 0.9fr 1.3fr;
  gap: 0.65rem;
}

.admin-page .check-tile {
  min-height: 5.1rem;
  border-color: rgba(0, 75, 47, 0.12);
  background: rgba(255, 255, 255, 0.68);
}

.admin-page .photo-admin-grid {
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.7rem;
}

.admin-page .admin-photo-slot {
  min-height: 12rem;
  padding: 0.65rem;
  border-style: solid;
  border-color: rgba(0, 75, 47, 0.1);
  background: rgba(255, 255, 255, 0.76);
}

.admin-page .admin-photo-slot.has-photo {
  border-color: rgba(12, 122, 67, 0.24);
}

.photo-slot-heading {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.photo-slot-heading strong {
  line-height: 1.1;
}

.photo-slot-heading span {
  width: fit-content;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(16, 24, 32, 0.08);
  font-size: 0.7rem;
  font-weight: 850;
}

.admin-photo-slot.has-photo .photo-slot-heading span {
  color: #fff;
  background: var(--ok);
}

.admin-page .admin-photo-slot img {
  margin: 0.55rem 0;
  border-radius: 0.9rem;
  box-shadow: 0 12px 26px rgba(16, 24, 32, 0.12);
}

.photo-meta-list {
  display: grid;
  gap: 0.16rem;
}

.photo-meta-list span,
.photo-meta-list em {
  font-size: 0.78rem;
  line-height: 1.22;
}

.photo-meta-list em {
  color: var(--warn);
  font-style: normal;
  font-weight: 820;
}

.admin-photo-empty {
  display: block;
  margin-top: 3rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 820;
  text-align: center;
}

.admin-page .report-shell {
  width: min(1160px, 100%);
}

.admin-page .report-hero > div,
.admin-page .report-card {
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 38px rgba(0, 75, 47, 0.08);
}

.admin-page .report-card {
  border-radius: 1.15rem;
}

.admin-page .report-hero > div {
  min-height: 5.6rem;
  border-radius: 1.15rem;
}

.admin-page .report-card h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.admin-page .report-value {
  color: var(--salva-green-dark);
}

.admin-page .report-photo-row {
  border-color: rgba(0, 75, 47, 0.1);
  background: rgba(255, 255, 255, 0.74);
}

@media (max-width: 980px) {
  .admin-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard article:last-child {
    grid-column: 1 / -1;
  }

  .admin-page .admin-toolbar,
  .admin-page .session-check-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .admin-type-switch {
    grid-template-columns: 1fr;
  }

  .admin-dashboard,
  .admin-page .report-hero,
  .admin-page .report-grid {
    grid-template-columns: 1fr;
  }

  .admin-dashboard article:last-child {
    grid-column: auto;
  }

  .admin-page .admin-card-actions {
    width: 100%;
  }

  .admin-page .admin-card-actions .secondary-link,
  .admin-page .inline-admin-form,
  .admin-page .inline-admin-form button {
    width: 100%;
  }
}
