:root {
  --paper: #faf7f4;
  --paper-soft: #f5f1ed;
  --ink: #171717;
  --muted: rgba(23, 23, 23, .58);
  --muted-2: rgba(23, 23, 23, .42);
  --line: rgba(23, 23, 23, .10);
  --line-strong: rgba(23, 23, 23, .18);
  --card: rgba(255, 255, 255, .70);
  --cyan: #26d4bd;
  --blue: #4a8eff;
  --violet: #905bff;
  --green: #36a66b;
  --cfs-red: #ec3426;
  --cfs-gold: #ffc733;
  --cfs-soft: #fff1bf;
  --cfs-red-soft: #ffe2dc;
  --cfs-gold-soft: #fff3c9;
  --cfs-red-deep: #9f271f;
  --cfs-ember: #e5793d;
  --bad: #b8483a;
  --warn: #9b6a18;
  --shadow: 0 14px 44px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
}
body {
  position: relative;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(250,247,244,.90)),
    url("/static/field-bg-cfs.jpg?v=20260702m") center 44% / cover fixed no-repeat,
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 4%, rgba(236,52,38,.075), transparent 22rem),
    radial-gradient(circle at 92% 8%, rgba(255,199,51,.14), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(250,247,244,.46));
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
.hidden { display: none !important; }

.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  width: 100%;
  padding: 18px;
}

.login-panel {
  width: min(340px, calc(100vw - 48px));
  max-width: 100%;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
  padding: 20px;
}

.login-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.login-logo img { width: min(140px, 42vw); }

.login-cfs-logo {
  width: 86px;
  height: 58px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255,243,201,.90), rgba(255,226,220,.70));
  border: 1px solid rgba(236,52,38,.20);
  padding: 5px;
}

.login-panel h1 {
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
}

.login-panel label, .field-notes {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.login-panel input, .manual-location input, .field-notes textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.80);
  color: var(--ink);
  padding: 12px 13px;
}

.login-panel button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #faf7f4;
  font-weight: 850;
}

.saml-login-option { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.saml-login-option::before, .saml-login-option::after { content: ""; height: 1px; background: var(--line); }
.saml-login-btn { grid-column: 1 / -1; display: grid; place-items: center; min-height: 46px; padding: 10px 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; text-decoration: none; }
.saml-login-btn:active { border-color: var(--cfs-gold); box-shadow: 0 0 0 3px rgba(255,199,51,.16); }

.error-line {
  min-height: 18px;
  color: var(--bad);
  font-size: 13px;
}

.app-shell {
  position: relative;
  min-height: 100dvh;
  width: min(540px, calc(100vw - 16px));
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
}

.app-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 106px;
  height: auto;
}

.brand div {
  display: grid;
  line-height: 1.1;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0;
}

.brand span, .eyebrow {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfs-logo {
  width: 72px;
  height: 48px;
  object-fit: contain;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(255,243,201,.88), rgba(255,226,220,.66));
  border: 1px solid rgba(236,52,38,.20);
  padding: 4px;
}

.small-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: rgba(23,23,23,.72);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
}

.status-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
}

.status-strip span {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 760;
}

.capture-section {
  display: grid;
  gap: 10px;
}

.image-stage {
  position: relative;
  min-height: min(40dvh, 390px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(23,23,23,.08), rgba(23,23,23,.24)),
    url("/static/field-bg-cfs.jpg?v=20260702m") 42% center / cover no-repeat,
    var(--paper-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.image-stage > img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  filter: saturate(.88) contrast(.98);
}

.stage-zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 999px;
  background: rgba(23,23,23,.58);
  color: #fffaf4;
  backdrop-filter: blur(10px);
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 850;
}

.stage-prompt {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 10px;
  background: rgba(250,247,244,.86);
  backdrop-filter: blur(12px);
  padding: 12px;
  pointer-events: none;
}

.stage-prompt strong {
  font-size: 18px;
  letter-spacing: 0;
}

.stage-prompt span {
  color: var(--muted);
  font-size: 13px;
}

.upload-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 22px;
  text-align: center;
  color: #faf7f4;
  background: linear-gradient(135deg, rgba(35,22,17,.70), rgba(70,34,20,.62));
  backdrop-filter: blur(8px);
}

.upload-overlay.show { display: grid; }
.upload-overlay strong {
  font-size: 19px;
  line-height: 1.15;
}
.upload-overlay span {
  color: rgba(250,247,244,.78);
  font-size: 13px;
}

.think-ring {
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: conic-gradient(var(--cfs-red), var(--cfs-gold), #fff5d5, var(--cfs-red));
  animation: spin 1.1s linear infinite;
  mask: radial-gradient(circle, transparent 53%, #000 55%);
}

.progress {
  width: min(260px, 100%);
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(250,247,244,.18);
}

.progress i {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cfs-red), var(--cfs-gold), var(--cfs-red));
  animation: load 1s ease-in-out infinite;
}

.capture-actions, .add-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.workflow-panel, .uploads-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 12px;
}

.wizard-copy h1, .uploads-head h1 {
  margin-top: 2px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 650;
}

.wizard-copy p:last-child {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.photo-set {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.photo-tile {
  position: relative;
  min-height: 96px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.tile-toggle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-tile.excluded img {
  opacity: .38;
  filter: saturate(.55) contrast(.9);
}

.photo-tile.excluded::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(245,241,237,.36);
  pointer-events: none;
}

.tick {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.82);
  background: var(--green);
  color: #faf7f4;
  font-size: 16px;
  font-weight: 900;
}

.photo-tile.excluded .tick {
  display: none;
}

.tile-label {
  position: absolute;
  z-index: 2;
  left: 5px;
  right: 5px;
  bottom: 5px;
  display: flex;
  justify-content: center;
  border-radius: 6px;
  background: rgba(250,247,244,.84);
  color: rgba(23,23,23,.72);
  padding: 3px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.remove-photo {
  position: absolute;
  z-index: 4;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  display: none;
  place-items: center;
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 9px;
  background: rgba(255,255,255,.90);
  color: var(--bad);
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
}

.photo-tile.excluded .remove-photo { display: grid; }

.selection-summary, .technical-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.result-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.selection-summary div, .technical-summary div, .result-metrics div, .scene-panel div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  padding: 10px;
}

.result-metrics div {
  padding: 8px 7px;
}

.selection-summary span, .technical-summary span, .result-metrics span, .scene-panel span, .powered-model {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.selection-summary strong, .technical-summary strong, .result-metrics strong, .scene-panel strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.result-metrics strong.scene-ok,
.result-metrics strong.scene-bad,
.result-metrics strong.scene-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.result-metrics strong.scene-ok {
  color: var(--green);
}

.result-metrics strong.scene-ok::before {
  content: "\2713";
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
}

.result-metrics strong.scene-bad {
  color: var(--bad);
}

.result-metrics strong.scene-pending {
  color: var(--warn);
}

.area-summary-card {
  position: relative;
  padding-right: 72px !important;
}

.inline-change {
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 7px;
  background: rgba(255,255,255,.78);
  color: var(--cfs-red-deep);
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 850;
}

.area-summary-card .inline-change {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.manual-location {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(236,52,38,.18);
  border-radius: 10px;
  background: rgba(255,241,191,.26);
  padding: 10px;
}

.manual-location.flash, .result-location.flash {
  animation: locationFlash .9s ease-out 2;
  border-color: rgba(236,52,38,.62);
  box-shadow: 0 0 0 4px rgba(236,52,38,.10);
}

.manual-location label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.manual-location .area-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.manual-location p {
  color: var(--muted);
  font-size: 12px;
}

.btn {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px 13px;
  font-weight: 850;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
}

.btn:active, .photo-tile:active, .image-stage:active {
  transform: translateY(1px);
  border-color: rgba(236,52,38,.38);
  box-shadow: 0 0 0 3px rgba(255,199,51,.18);
}

.btn.dark {
  background: var(--ink);
  color: #faf7f4;
}

.next-btn {
  position: relative;
  z-index: 0;
  overflow: hidden;
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  padding: 22px 18px;
  background: transparent;
  box-shadow: 0 14px 30px rgba(23,23,23,.13);
}

.next-btn::before {
  content: "";
  position: absolute;
  inset: -80%;
  z-index: -2;
  background: conic-gradient(from 0deg, var(--cfs-red), var(--cfs-gold), #fff6d6, var(--cfs-red));
  animation: spin 3.2s linear infinite;
}

.next-btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(135deg, #1a1716, #271817 52%, #332015);
}

.next-btn[disabled]::before {
  animation: none;
  background: rgba(23,23,23,.22);
}

.next-btn[disabled]::after {
  background: rgba(23,23,23,.34);
}

.next-btn span {
  position: relative;
  z-index: 1;
}

#wizard-predict-label {
  color: #fffaf4;
  font-size: 20px;
  line-height: 1.12;
  text-align: left;
}

.step-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(250,247,244,.22);
  border-radius: 7px;
  background: rgba(250,247,244,.12);
  padding: 7px 9px;
  color: rgba(250,247,244,.78);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.post-prediction-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.btn.light, .btn.quiet {
  background: rgba(255,255,255,.76);
  color: rgba(23,23,23,.82);
  border-color: var(--line);
}

.btn.quiet {
  color: var(--bad);
}

.btn[disabled] {
  opacity: .44;
  cursor: not-allowed;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  padding: 10px;
}

.status-line .dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.status-line.warn .dot { background: var(--warn); }
.status-line.bad .dot { background: var(--bad); }
.status-line span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.prediction-modal, .add-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(250,247,244,.54);
  backdrop-filter: blur(10px);
}

.add-modal { z-index: 50; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}

.result-card, .add-card {
  position: relative;
  z-index: 2;
  width: min(460px, 100%);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 14px;
  background: rgba(250,247,244,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.18);
  padding: 16px;
  animation: modalIn .18s ease-out;
}

.result-card {
  gap: 7px;
  padding: 12px 14px 14px;
}

.close-add {
  justify-self: end;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  padding: 6px 10px;
  font-weight: 800;
}

.result-card > .close-add {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
}

.add-card p:not(.eyebrow), .result-copy, .submit-success p {
  color: var(--muted);
  font-size: 13px;
}

.result-card {
  text-align: center;
}

.result-content {
  display: grid;
  justify-items: center;
  gap: 7px;
}

.result-content h2 {
  line-height: 1.08;
  letter-spacing: 0;
  font-size: 30px;
}

.prediction-number {
  justify-self: center;
  width: min(320px, 100%);
  min-height: 88px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(236,52,38,.13);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,243,201,.62) 52%, rgba(255,226,220,.80)),
    linear-gradient(90deg, rgba(236,52,38,.34), rgba(255,199,51,.52), rgba(236,52,38,.22));
  background-origin: border-box;
  box-shadow: inset 0 -4px 0 rgba(23,23,23,.04);
  padding: 14px 16px;
}

.prediction-number span {
  background: linear-gradient(135deg, var(--cfs-red-deep), #29201c 42%, var(--cfs-ember));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 58px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 740;
}

.image-prediction-list {
  width: 100%;
  display: grid;
  gap: 8px;
}

.prediction-active-card {
  position: relative;
  width: 100%;
  border: 1px solid rgba(23,23,23,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
  padding: 7px;
  display: grid;
  gap: 6px;
  text-align: left;
}

.prediction-active-card img {
  width: 100%;
  height: clamp(220px, 34dvh, 360px);
  object-fit: contain;
  border-radius: 9px;
  background: rgba(245,241,237,.82);
}

.prediction-active-card em {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  background: rgba(23,23,23,.56);
  color: #fffaf4;
  padding: 5px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  pointer-events: none;
}

.prediction-active-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.prediction-active-meta span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.prediction-active-meta strong {
  font-size: 18px;
  color: var(--cfs-red-deep);
}

.prediction-thumb-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 7px;
}

.prediction-thumb {
  position: relative;
  min-height: 84px;
  overflow: hidden;
  border: 1px solid rgba(23,23,23,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.70);
  padding: 0;
}

.prediction-thumb.active {
  border-color: rgba(236,52,38,.46);
  box-shadow: 0 0 0 3px rgba(255,199,51,.20);
}

.prediction-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prediction-thumb-index,
.prediction-thumb strong {
  position: absolute;
  border-radius: 7px;
  background: rgba(250,247,244,.88);
  color: rgba(23,23,23,.72);
  font-weight: 850;
}

.prediction-thumb-index {
  top: 5px;
  left: 5px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 11px;
}

.prediction-thumb strong {
  left: 5px;
  right: 5px;
  bottom: 5px;
  padding: 4px 5px;
  color: var(--cfs-red-deep);
  font-size: 12px;
}

.result-location {
  width: 100%;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(236,52,38,.20);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,243,201,.40), rgba(255,226,220,.28));
  padding: 9px;
  text-align: left;
}

.result-location.missing {
  border-color: rgba(236,52,38,.42);
  background: linear-gradient(135deg, rgba(255,243,201,.56), rgba(255,226,220,.42));
}

.location-copy {
  display: grid;
  gap: 4px;
}

.location-copy div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.location-copy span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.location-copy strong {
  font-size: 15px;
}

.location-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  gap: 8px;
}

.location-entry input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  padding: 11px 12px;
  font-size: 14px;
}

.location-entry .btn,
.manual-location .area-row .btn {
  min-height: 42px;
  padding: 9px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.use-current-location {
  width: 100%;
  min-height: 42px;
  border-color: rgba(54,166,107,.24);
  background: rgba(235,249,241,.78);
  color: rgba(24,88,55,.94);
}

.area-input-wrap {
  position: relative;
  min-width: 0;
}

.manual-location .area-input-wrap input,
.location-entry .area-input-wrap input {
  padding-right: 52px;
}

.clear-area-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  min-height: 27px;
  border: 1px solid rgba(236,52,38,.18);
  border-radius: 7px;
  background: rgba(255,255,255,.88);
  color: var(--cfs-red-deep);
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.clear-area-btn:active {
  background: var(--cfs-red-soft);
  border-color: rgba(236,52,38,.38);
}

.result-location p {
  color: var(--muted);
  font-size: 12px;
}

.result-location.missing p {
  color: var(--cfs-red-deep);
  font-weight: 760;
}

.result-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-actions .btn.dark,
.result-actions .scene-generate-btn {
  grid-column: 1 / -1;
}

.scene-progress {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,199,51,.34);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,243,201,.44), rgba(255,255,255,.76));
  padding: 10px;
  text-align: left;
}

.scene-spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: conic-gradient(var(--cfs-red), var(--cfs-gold), var(--green), var(--cfs-red));
  animation: spin 1s linear infinite;
  mask: radial-gradient(circle, transparent 54%, #000 56%);
}

.scene-progress strong,
.scene-advice strong,
.location-advice strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

.scene-progress span,
.scene-advice span,
.location-advice span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.scene-advice,
.location-advice {
  width: 100%;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(155,106,24,.26);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,243,201,.52), rgba(255,255,255,.82));
  padding: 10px;
  text-align: left;
}

.location-advice {
  border-color: rgba(255,199,51,.38);
  background: linear-gradient(135deg, rgba(255,243,201,.64), rgba(255,255,255,.82));
}

.scene-advice.bad {
  border-color: rgba(184,72,58,.38);
  background: linear-gradient(135deg, rgba(255,226,220,.68), rgba(255,243,201,.34));
}

.scene-advice.warn {
  border-color: rgba(54,166,107,.24);
  background: linear-gradient(135deg, rgba(235,249,241,.78), rgba(255,243,201,.30));
}

.scene-advice-actions,
.location-advice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scene-advice.warn .scene-advice-actions {
  grid-template-columns: 1fr;
}

.result-metrics, .scene-panel {
  width: 100%;
}

.field-notes {
  text-align: left;
  width: 100%;
}

.field-notes span {
  color: rgba(23,23,23,.72);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.field-notes textarea {
  resize: vertical;
  min-height: 64px;
}

.scene-panel {
  display: grid;
  gap: 7px;
  text-align: left;
}

.submit-success {
  display: grid;
  justify-items: center;
  gap: 11px;
  text-align: center;
  padding: 8px 0;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(23,23,23,.62);
  backdrop-filter: blur(12px);
}

.image-viewer-card {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  max-height: calc(100dvh - 28px);
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 14px;
  background: rgba(250,247,244,.96);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
  padding: 12px;
}

.image-viewer-card img {
  width: 100%;
  max-height: calc(100dvh - 128px);
  object-fit: contain;
  border-radius: 10px;
  background: rgba(23,23,23,.06);
}

.image-viewer-card p {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.success-ring {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(54,166,107,.16);
  border: 3px solid rgba(54,166,107,.42);
  animation: pulseOk .7s ease-out;
}

.success-ring span {
  display: block;
  width: 36px;
  height: 20px;
  border-left: 6px solid var(--green);
  border-bottom: 6px solid var(--green);
  transform: rotate(-45deg);
}

.uploads-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.uploads-list {
  display: grid;
  gap: 8px;
}

.upload-item {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  padding: 8px;
}

.upload-item img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
}

.upload-item-title {
  font-weight: 850;
}

.upload-item-meta {
  margin-top: 3px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.bottom-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.bottom-nav button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.70);
  color: var(--muted);
  font-weight: 850;
}

.bottom-nav button.active {
  background: var(--ink);
  color: #faf7f4;
}

.powered-model {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 3px 0 0;
  color: rgba(23,23,23,.34);
  letter-spacing: 0;
}

.meta-mark {
  border: 1px solid rgba(23,23,23,.14);
  border-radius: 999px;
  padding: 2px 6px;
  color: rgba(23,23,23,.48);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.975); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulseOk {
  0% { transform: scale(.82); opacity: .2; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes tickIn {
  from { opacity: 0; transform: rotate(-45deg) scale(.5); }
  to { opacity: 1; transform: rotate(-45deg) scale(1); }
}
@keyframes locationFlash {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 520px) {
  body {
    background:
      linear-gradient(180deg, rgba(255,255,255,.82), rgba(250,247,244,.94)),
      url("/static/field-bg-cfs.jpg?v=20260702m") 52% top / auto 100dvh no-repeat,
      var(--paper);
  }
  .login-view {
    place-items: start center;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  .login-panel {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
  }
  .login-panel h1 {
    font-size: 26px;
    line-height: 1.08;
  }
  .login-cfs-logo {
    width: 76px;
    height: 52px;
  }
  .app-shell {
    width: 100%;
    padding-inline: 10px;
    gap: 9px;
  }
  .app-top {
    align-items: flex-start;
  }
  .brand {
    gap: 8px;
  }
  .brand img { width: 84px; }
  .brand strong { font-size: 16px; }
  .brand span, .eyebrow {
    font-size: 9px;
    letter-spacing: 0;
  }
  .cfs-logo {
    width: 66px;
    height: 46px;
  }
  .small-btn {
    min-height: 34px;
    padding: 6px 8px;
    font-size: 12px;
  }
  .image-stage {
    min-height: 250px;
  }
  .wizard-copy h1, .uploads-head h1 {
    font-size: 26px;
    line-height: 1.08;
  }
  .photo-set { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-tile { min-height: 92px; }
  .result-card, .add-card {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }
  .result-card {
    padding: 12px;
    gap: 6px;
  }
  .result-content {
    gap: 6px;
  }
  .result-content h2 {
    font-size: 28px;
  }
  .prediction-number {
    width: 100%;
    min-height: 78px;
  }
  .prediction-number span { font-size: 50px; }
  .prediction-active-card img {
    height: clamp(210px, 32dvh, 320px);
  }
  .prediction-thumb {
    min-height: 78px;
  }
  .selection-summary, .technical-summary, .capture-actions, .add-actions, .manual-location .area-row {
    grid-template-columns: 1fr;
  }
  .result-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .result-metrics strong {
    font-size: 12px;
  }
  .location-entry {
    grid-template-columns: minmax(0, 1fr) 94px;
  }
  .location-entry .btn {
    padding-inline: 7px;
  }
}
