/* Tool page hero (Soil + Crop Doctor) */
.tool-hero {
  display: grid;
  gap: var(--s-5);
  padding-block: var(--s-6) var(--s-5);
  align-items: end;
}
@media (min-width: 900px) { .tool-hero { grid-template-columns: 1.3fr 1fr; padding-block: var(--s-7) var(--s-6); } }
.tool-hero-copy { display: grid; gap: var(--s-3); }
.tool-hero h1 { font-size: var(--fs-3xl); }
.tool-hero h1 em { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.05em; }
.tool-hero .lead { color: var(--text-2); font-size: var(--fs-lg); max-width: 54ch; }
.tool-hero-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool-hero-steps li {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-1);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.tool-hero-steps .icon { width: 24px; height: 24px; color: var(--teal); }
@media (max-width: 640px) {
  .tool-hero { padding-block: var(--s-5) var(--s-3); gap: var(--s-3); }
  .tool-hero-steps { display: none; }
  .tool-hero .lead { font-size: var(--fs-md); }
}

.stepper { margin-bottom: var(--s-4); }
.stepper li.is-link { cursor: pointer; }
.stepper li.is-link:hover { color: var(--text); }

.wizard { outline: none; min-height: 420px; }

/* Panels */
.panel { padding: var(--s-5); display: grid; gap: var(--s-5); border-radius: var(--r-xl); }
@media (min-width: 768px) { .panel { padding: var(--s-6) var(--s-7); } }
.panel-head { display: flex; align-items: flex-start; gap: var(--s-4); }
.panel-head h2 { font-size: var(--fs-2xl); }
.panel-head p { color: var(--text-2); margin-top: 6px; }
.panel-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: var(--s-2); border-top: 1px solid var(--line); margin-top: var(--s-2); padding-top: var(--s-5); }

/* Farm form */
.farm-form { display: grid; gap: var(--s-6); }
.form-grid { display: grid; gap: var(--s-5); }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; column-gap: var(--s-6); } }
.field > label .icon, .field-label .icon { color: var(--teal); width: 17px; height: 17px; }
.land-row { display: flex; gap: 14px; align-items: stretch; }
.land-row .input { flex: 1; min-width: 0; }
.land-row .segmented { flex: none; align-self: center; }
.place-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 600; }

/* Form sections */
.form-section {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.015), transparent);
}
@media (max-width: 560px) { .form-section { padding: var(--s-5) var(--s-4); } }
.form-section-head { display: flex; align-items: center; gap: var(--s-4); padding-bottom: var(--s-2); }
.form-section-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; letter-spacing: -0.01em; }
.form-section-head p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 6px; }
.fs-num {
  position: relative;
  width: 46px; height: 46px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--grad);
  color: var(--on-brand);
  box-shadow: 0 10px 26px -10px rgb(var(--teal-rgb) / 0.8);
}
.fs-num .icon { width: 22px; height: 22px; stroke-width: 2; }
.fs-num i {
  position: absolute;
  right: -6px; top: -6px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
}

/* Crop picture cards */
.crop-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
@media (max-width: 420px) { .crop-tiles { grid-template-columns: repeat(3, 1fr); gap: 8px; } }
.crop-tile {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 14px 8px 12px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(90% 70% at 50% 30%, rgb(255 255 255 / 0.035), transparent 70%),
    var(--bg-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  animation: fade-up 420ms var(--ease) both;
  transition: border-color var(--dur), background var(--dur), color var(--dur), transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.crop-plate {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface-1) 70%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06), 0 8px 18px -10px rgb(0 0 0 / 0.9);
  transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.crop-plate svg { width: 46px; height: 46px; filter: drop-shadow(0 4px 6px rgb(0 0 0 / 0.45)); }
.crop-name { line-height: 1.2; }
.crop-check {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--grad);
  color: var(--on-brand);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity var(--dur), transform 260ms var(--ease);
}
.crop-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.crop-tile:hover { border-color: var(--line-hover); color: var(--text); transform: translateY(-2px); }
.crop-tile:hover .crop-plate { transform: scale(1.06) rotate(-4deg); }
.crop-tile[aria-checked='true'] {
  color: var(--text);
  border-color: transparent;
  background:
    radial-gradient(90% 70% at 50% 30%, rgb(var(--green-rgb) / 0.14), transparent 70%) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    var(--grad) border-box;
  box-shadow: 0 14px 34px -16px rgb(var(--teal-rgb) / 0.8);
}
.crop-tile[aria-checked='true'] .crop-plate { transform: scale(1.08); box-shadow: 0 0 0 2px rgb(var(--green-rgb) / 0.35), 0 0 26px -4px rgb(var(--green-rgb) / 0.6); }
.crop-tile[aria-checked='true'] .crop-check { opacity: 1; transform: none; }
.crop-tile.skeleton { border: 0; min-height: 118px; }

/* Variety chips */
.variety-field { animation: fade-up 360ms var(--ease) both; }
.variety-chips { display: flex; flex-wrap: wrap; gap: 12px; }
.variety-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px 10px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  animation: fade-up 320ms var(--ease) both;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.variety-chip.skeleton { width: 130px; border: 0; }
.vc-dot {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: transparent;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.vc-dot .icon { width: 13px; height: 13px; stroke-width: 3; }
.variety-chip:hover { color: var(--text); border-color: var(--line-hover); }
.variety-chip[aria-checked='true'] { color: var(--text); border-color: var(--teal); background: rgb(var(--teal-rgb) / 0.1); }
.variety-chip[aria-checked='true'] .vc-dot { background: var(--grad); border-color: transparent; color: var(--on-brand); }

/* Scan step */
.scan-slot { display: grid; }
.card-kinds { display: flex; align-items: center; gap: 12px; }
.card-kinds .kind {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 78px;
  padding: 12px 8px 10px;
  border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    var(--grad) border-box;
  color: var(--tile-fg);
  box-shadow: 0 12px 30px -14px rgb(var(--teal-rgb) / 0.7);
}
.card-kinds .kind .icon { width: 26px; height: 26px; }
.card-kinds .kind b { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; }
.card-kinds .kind-or { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.dropzone .formats { font-size: 0.7rem; color: var(--placeholder); letter-spacing: 0.02em; }

.card-preview { margin: 0; width: min(100%, 460px); justify-self: center; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-1); }
.cp-frame {
  position: relative;
  min-height: 180px;
  max-height: 340px;
  display: grid;
  place-items: center;
  gap: 10px;
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.015) 0 10px, transparent 10px 20px),
    var(--bg-2);
  color: var(--muted);
  font-size: var(--fs-sm);
  overflow: hidden;
}
.cp-frame img { width: 100%; max-height: 340px; object-fit: contain; }
.cp-frame .pdf-sheet { padding: 40px; display: grid; justify-items: center; gap: 8px; color: var(--teal); font-family: var(--font-mono); }
.card-preview.is-opening .cp-frame { grid-auto-flow: column; }
.cp-badge {
  position: absolute;
  left: 10px; top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgb(0 0 0 / 0.7);
  color: #fff;
  font-size: 0.7rem;
  backdrop-filter: blur(6px);
}
.cp-meta { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line); }
.cp-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--grad); color: var(--on-brand); }
.cp-text { display: grid; min-width: 0; flex: 1; }
.cp-text .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-text .size { font-size: var(--fs-xs); color: var(--muted); }
.hint.center { text-align: center; color: var(--text-2); font-size: var(--fs-sm); }
.chosen { display: grid; gap: var(--s-4); justify-items: stretch; }
.chosen .btn-lg { justify-self: center; min-width: min(320px, 100%); }
.photo-tips { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.photo-tips li {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 10px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-2);
  text-align: center;
}
.photo-tips .icon { color: var(--teal); width: 22px; height: 22px; }
.or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.12em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Card being read */
.card-scan {
  position: relative;
  width: min(300px, 80vw);
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line-bold);
  background: var(--surface-2);
  box-shadow: 0 24px 50px -24px rgb(var(--teal-rgb) / 0.55);
}
.card-scan img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.95) brightness(0.96); }
.card-scan .pdf-sheet { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--teal); font-family: var(--font-mono); }
.card-scan .beam {
  position: absolute;
  left: 0; right: 0;
  height: 36%;
  top: -36%;
  background: linear-gradient(180deg, transparent, rgb(var(--green-rgb) / 0.35) 85%, #b6ffb0);
  box-shadow: 0 6px 20px rgb(var(--green-rgb) / 0.5);
  animation: beam-down 2.2s var(--ease) infinite;
  mix-blend-mode: screen;
}
.card-scan .grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgb(var(--teal-rgb) / 0.16) 1px, transparent 1px), linear-gradient(90deg, rgb(var(--teal-rgb) / 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
  mix-blend-mode: screen;
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.card-scan .spark {
  position: absolute;
  top: 60%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #c9ffc4;
  box-shadow: 0 0 10px #7dff75;
  animation: spark 2.4s ease-in-out infinite;
}

/* Values */
.value-group { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; }
.value-group legend { display: flex; align-items: center; gap: 14px; font-weight: 700; font-size: var(--fs-xl); color: var(--text); padding: 0; margin-bottom: 4px; }
.value-group legend .icon { box-sizing: content-box; width: 20px; height: 20px; padding: 9px; border-radius: 12px; color: var(--on-brand); background: var(--grad); }
.value-group > .hint { margin-top: 0; color: var(--text-2); font-size: var(--fs-sm); }
.value-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 8px; }
.value-field {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line-bold);
  background: var(--surface-1);
  box-shadow: 0 10px 24px -16px rgb(var(--teal-rgb) / 0.45);
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}
.value-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgb(var(--teal-rgb) / 0.18); }
.value-field label { display: flex; align-items: center; gap: 12px; font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.value-field .nc-sym { width: 36px; height: 36px; font-size: 0.78rem; font-weight: 700; background: rgb(var(--teal-rgb) / 0.16); border-color: rgb(var(--teal-rgb) / 0.55); color: var(--teal); }
.value-field .vf-name { flex: 1; }
.value-field .req { color: var(--deficient); font-weight: 700; }
.value-field .ai-tag { display: none; color: var(--green); }
.value-field.is-ai { border-color: var(--green); background: linear-gradient(180deg, rgb(var(--green-rgb) / 0.14), var(--surface-1) 70%); }
.value-field.is-ai .ai-tag { display: inline-flex; }
.value-field.is-writing { box-shadow: 0 0 0 4px rgb(var(--green-rgb) / 0.25), 0 0 30px -6px rgb(var(--green-rgb) / 0.6); border-color: var(--green); }
.value-field .input {
  min-height: 52px;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgb(var(--teal-rgb) / 0.1);
  border: 1.5px solid var(--line-bold);
}
.value-field .input:focus { background: var(--surface-1); border-color: var(--teal); }
.value-field .input-group .suffix { background: rgb(var(--teal-rgb) / 0.2); border: 1.5px solid var(--line-bold); border-left: 0; color: var(--teal); font-weight: 700; }
.value-field .hint { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; }

/* Soil analysing visual: warm earth layers under a grassy top, with nutrient chips floating up */
.soil-visual { position: relative; width: min(320px, 100%); height: 240px; display: grid; justify-items: center; }
.soil-visual .ai-orb { --size: 136px; }
.soil-strata {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgb(122 80 40 / 0.35);
  box-shadow: 0 20px 36px -20px rgb(110 70 30 / 0.7), inset 0 1px 0 rgb(255 255 255 / 0.35);
}
.soil-strata span { position: absolute; left: 0; right: 0; }
.soil-strata span:nth-child(1) { top: 0; height: 26%; background: linear-gradient(180deg, #7dc35a, #55a63f); }
.soil-strata span:nth-child(2) { top: 26%; height: 27%; background: linear-gradient(180deg, #c58f57, #b47b45); }
.soil-strata span:nth-child(3) { top: 53%; height: 47%; background: linear-gradient(180deg, #a26b3c, #8a5830); }
.soil-strata i {
  position: absolute;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  color: var(--teal);
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: 0 6px 14px -6px rgb(13 60 52 / 0.5);
  animation: rise 2.6s ease-in infinite;
}

/* Plan analysing visual */
.plan-visual { position: relative; width: 220px; height: 200px; display: grid; place-items: center; }
.plan-visual .ai-orb { --size: 150px; }
.orbit-icon {
  position: absolute;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--green);
  animation: float 3s ease-in-out infinite;
}
.orbit-icon .icon { width: 20px; height: 20px; }
.orbit-icon.o1 { top: 6px; left: 8px; }
.orbit-icon.o2 { top: 30px; right: 0; animation-delay: -1s; color: var(--blue); }
.orbit-icon.o3 { bottom: 6px; left: 30px; animation-delay: -2s; color: var(--teal); }

/* Next-step card */
.next-card {
  display: grid;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-5);
  border-radius: var(--r-xl);
}
@media (min-width: 820px) { .next-card { grid-template-columns: auto 1fr auto; padding: var(--s-5) var(--s-6); } }
.next-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.next-card p { color: var(--text-2); margin-top: 6px; }

.report-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.tips { display: grid; gap: 10px; }
.tips h3 { display: flex; align-items: center; gap: 10px; }
.tips h3 .icon { color: var(--teal); }
.tips ul { padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }

@keyframes beam-down { 0% { top: -36%; } 100% { top: 100%; } }
@keyframes spark { 0%, 100% { opacity: 0; transform: translateY(0) scale(0.6); } 40% { opacity: 1; } 70% { opacity: 0.8; transform: translateY(-40px) scale(1); } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-150px); opacity: 0; } }
