/* Sticky Mat — shares the panels, picture cards, dropzone and stepper of Soil Doctor and Crop Doctor (soil.css, crop.css) */

/* ---------- Crop cards (same picture cards as Soil Doctor) ---------- */
body[data-page='sticky'] .crop-tiles { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px; }
@media (max-width: 420px) { body[data-page='sticky'] .crop-tiles { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
body[data-page='sticky'] .crop-tile { gap: 10px; min-height: 138px; padding: 20px 10px 16px; align-content: start; }
body[data-page='sticky'] .crop-tile.skeleton { min-height: 138px; }
.crop-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  margin-top: -4px;
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--muted);
}

/* ---------- Trap colour cards ---------- */
.trap-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
@media (min-width: 720px) { .trap-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.trap-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(90% 70% at 20% 30%, rgb(255 255 255 / 0.035), transparent 70%),
    var(--bg-2);
  color: var(--text-2);
  text-align: left;
  transition: border-color var(--dur), transform 260ms var(--ease), box-shadow 260ms var(--ease);
}
.trap-choice:hover { border-color: var(--line-hover); transform: translateY(-2px); }
.trap-choice[aria-checked='true'] {
  color: var(--text);
  border-color: transparent;
  background:
    radial-gradient(90% 70% at 20% 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);
}
.trap-choice[aria-checked='true'] .crop-check { opacity: 1; transform: none; }
.trap-choice-text { display: grid; gap: 4px; min-width: 0; padding-right: 26px; }
.trap-choice-text strong { font-size: var(--fs-md); color: var(--text); }
.trap-choice-text span { font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.trap-best { justify-self: start; white-space: normal; text-align: left; font-size: 0.68rem; padding: 2px 10px; }

.trap-swatch {
  position: relative;
  flex: none;
  width: 76px; height: 76px;
  border-radius: 12px;
  transform: rotate(-4deg);
  box-shadow: 0 10px 20px -10px rgb(0 0 0 / 0.7), inset 0 0 0 1px rgb(0 0 0 / 0.12);
  transition: transform 320ms var(--ease);
}
.trap-choice:hover .trap-swatch, .trap-choice[aria-checked='true'] .trap-swatch { transform: rotate(2deg) scale(1.05); }
.trap-swatch.yellow { background: linear-gradient(135deg, #f8dc55, #e9bd2c); }
.trap-swatch.blue { background: linear-gradient(135deg, #3d8bf2, #1c55c4); }
.trap-swatch i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #2e2610; }
.trap-swatch.blue i { background: #d6e6ff; }
.trap-swatch i:nth-child(1) { left: 16px; top: 14px; }
.trap-swatch i:nth-child(2) { left: 46px; top: 22px; }
.trap-swatch i:nth-child(3) { left: 28px; top: 40px; }
.trap-swatch i:nth-child(4) { left: 54px; top: 52px; }
.trap-swatch i:nth-child(5) { left: 14px; top: 58px; }
.trap-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2); }
.trap-dot.yellow { background: #f2cc3c; }
.trap-dot.blue { background: #2f78e0; }

/* ---------- Days ---------- */
/* Days: the question on the left, one small − 7 days + pill on the right (stacked on a phone). */
.days-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-3) var(--s-6); padding-block: var(--s-5); }
.days-row { display: grid; justify-items: center; gap: 6px; padding: 0; }
.days-stepper {
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-1);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 18px -10px rgb(var(--teal-rgb) / 0.35);
  overflow: hidden;
}
.day-step {
  width: 52px; min-height: 52px; padding: 0; flex: none;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--teal); font-size: 1.5rem; line-height: 1; cursor: pointer;
  transition: background 160ms var(--ease), transform 120ms var(--ease);
}
.day-step:hover { background: rgb(var(--teal-rgb) / 0.1); }
.day-step:active { background: rgb(var(--teal-rgb) / 0.18); transform: scale(0.96); }
.day-step:focus-visible { outline: 2px solid var(--teal); outline-offset: -4px; border-radius: var(--r-pill); }
.days-readout { display: flex; align-items: baseline; justify-content: center; gap: 6px; min-width: 112px; padding: 0 var(--s-3); border-inline: 1px solid var(--line); }
.days-row .days-input {
  width: 2.2ch; min-width: 44px; padding: 4px 0; text-align: center;
  font-size: 2rem; line-height: 1.1; color: var(--text);
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.days-row .days-input:focus { outline: none; }
.days-unit { color: var(--text-2); font-size: var(--fs-md, 1rem); }
.days-hint { min-height: 1.2em; color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 720px) { .days-section { grid-template-columns: 1fr; } }

.pest-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.pest-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.pest-chip i, .insect-chip i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---------- Photo step ---------- */
.trap-tips { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .trap-tips { grid-template-columns: repeat(4, 1fr); } }
.trap-tips li {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--text-2);
}
.trap-tips .icon { width: 22px; height: 22px; color: var(--green); }
.trap-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.trap-summary .chip { gap: 8px; }

/* ---------- Result: Crop Doctor's remedy screen (remedy-head, remedy-card, remedy-cols, numbered remedy-list); only the bits it does not have are here ---------- */
.lvl-none { --lvl: var(--muted); }
.lvl-low { --lvl: var(--sufficient); }
.lvl-medium { --lvl: var(--deficient); }
.lvl-high { --lvl: var(--excess); }

.remedy-photo .photo-zoom { position: relative; display: block; padding: 0; border: 0; background: none; border-radius: 18px; cursor: zoom-in; }
.remedy-photo .photo-zoom .zoom { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); background: rgb(0 0 0 / 0.62); color: #fff; font-size: var(--fs-xs); font-weight: 600; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta .chip { gap: 8px; }
.insect-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.insect-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  font-size: var(--fs-sm);
  color: var(--text-2);
}
.insect-chip b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }

/* Pests: cards side by side (one column on a phone) */
.pest-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); align-items: start; }
.pest-card { container-type: inline-size; display: grid; gap: 14px; padding: var(--s-5); border-radius: var(--r-lg); animation: fade-up 420ms var(--ease) both; }
.pest-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pest-top h3 { display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--font-ui); font-size: var(--fs-xl); font-weight: 600; }
.pest-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--bg-2); color: var(--teal); }
.pest-icon .icon { width: 18px; height: 18px; }
.pest-top .badge::before { display: none; }
.pest-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pest-metrics > div { display: grid; align-content: center; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.pest-metrics b { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 600; color: var(--text); line-height: 1.1; }
.pest-metrics span { font-size: var(--fs-xs); color: var(--muted); }
.pest-why { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
.pest-advice { color: var(--text); font-size: var(--fs-sm); line-height: 1.55; }

/* Natural and chemical steps: two small panels, side by side when the card is wide enough */
.steps-grid { display: grid; gap: 12px; }
@container (min-width: 600px) { .steps-grid:not(.is-one) { grid-template-columns: 1fr 1fr; align-items: start; } }
.steps-panel { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.steps-panel h4 { display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); font-size: var(--fs-sm); font-weight: 600; }
.steps-panel h4 .icon { width: 17px; height: 17px; color: var(--teal); }
.steps-panel ol { list-style: none; display: grid; gap: 8px; counter-reset: st; }
.steps-panel li { counter-increment: st; display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-2); }
.steps-panel li::before { content: counter(st); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgb(var(--green-rgb) / 0.14); color: var(--green); font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; }
.chem-note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); font-weight: 300; line-height: 1.55; color: var(--text-2); }
.chem-note .icon { flex: none; margin-top: 2px; color: var(--muted); }

/* While ParthAI counts, the photo behind the blur loses its yellow, so the loader does not look yellow */
.is-analysing .leaf-preview img { filter: grayscale(1); opacity: 0.55; }

/* ---------- Result v2: big photo reaching out of the risk card, level meter, insect mix, small cards for the other insects ---------- */
.sm-result { gap: var(--s-6); }

/* Hero: the same two cards as Crop Doctor's compare step. The photo card is only as wide as the photo needs at this height. */
.sm-hero { --ph: clamp(280px, 30vw, 340px); display: grid; gap: var(--s-5); align-items: stretch; }
@media (min-width: 1000px) { .sm-hero { grid-template-columns: clamp(380px, calc(var(--ar, 1.2) * var(--ph) + 34px), 560px) minmax(0, 1fr); } }

.sm-photo { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-lg); min-width: 0; }
.sm-photo .photo-zoom {
  position: relative; display: block; width: 100%; height: var(--ph); flex: none; padding: 0; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-1); cursor: zoom-in;
}
.sm-photo .sm-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sm-photo .zoom {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 20px);
  padding: 5px 11px; border-radius: var(--r-pill); background: rgb(0 0 0 / 0.62); color: #fff; font-size: var(--fs-xs); font-weight: 600;
}
@media (max-width: 999px) { .sm-hero { --ph: clamp(260px, 70vw, 380px); } }

.sm-risk { align-content: space-between; gap: var(--s-4); padding: var(--s-5); }
.sm-risk .option-head { flex-wrap: wrap; }
.sm-risk .hero-meta { gap: 6px; }
.sm-risk .hero-meta .chip { padding: 4px 10px; font-size: var(--fs-xs); }
.sm-levelrow { display: grid; grid-template-columns: minmax(190px, 250px) minmax(0, 1fr); align-items: center; gap: var(--s-6); }
.sm-levelrow .rk-gauge { margin: 0; }
.sm-leveltext { display: grid; gap: 8px; }
.sm-levelrow .option-name { color: var(--lvl); }
@media (max-width: 640px) { .sm-levelrow { grid-template-columns: 1fr; gap: var(--s-3); } .sm-levelrow .rk-gauge { margin-inline: auto; } .sm-leveltext { text-align: center; justify-items: center; } }
.sm-advice { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; max-width: 64ch; }
.sm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sm-stat { display: grid; gap: 1px; padding: 10px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.sm-stat b { font-family: var(--font-mono); font-size: var(--fs-xl); font-weight: 600; line-height: 1.1; color: var(--text); }
.sm-stat span { font-size: var(--fs-xs); color: var(--muted); }

/* Risk gauge: half circle with a needle, drawn like Soil Doctor's nutrient gauge */
.rk-gauge { width: 100%; max-width: 250px; margin-inline: auto; }
.rk-svg { display: block; width: 100%; height: auto; overflow: visible; }
.rk-arc { opacity: 0.4; transition: opacity var(--dur, 200ms); }
.rk-arc.low { stroke: var(--sufficient); }
.rk-arc.medium { stroke: var(--deficient); }
.rk-arc.high { stroke: var(--excess); }
.rk-arc.is-on { opacity: 1; }
.rk-needle { transform-box: view-box; transform-origin: 100px 94px; transform: rotate(var(--rot, 90deg)); animation: rk-swing 1.1s cubic-bezier(0.34, 1.3, 0.64, 1) both; }
.rk-needle line { stroke: #12302b; stroke-width: 2.5; stroke-linecap: round; }
.rk-needle circle { fill: #12302b; }
@keyframes rk-swing { from { transform: rotate(0deg); } }
.rk-lbl { font-family: var(--font-ui); font-size: 8.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--muted); }
.rk-lbl.is-on { font-weight: 700; }
.rk-lbl.low.is-on { fill: var(--sufficient); }
.rk-lbl.medium.is-on { fill: var(--deficient); }
.rk-lbl.high.is-on { fill: var(--excess); }
html[lang='hi'] .rk-lbl { text-transform: none; letter-spacing: 0; font-size: 9.5px; }
html[data-theme='dark'] .rk-needle line { stroke: #e8f3f0; }
html[data-theme='dark'] .rk-needle circle { fill: #e8f3f0; }
.rk-gauge.is-small { max-width: 120px; }

/* Insects found: one plain chip per insect */
.insect-mix { display: grid; gap: 10px; }
.insect-mix .eyebrow { color: var(--teal); }
.mix-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.mix-list li { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-strong); font-size: var(--fs-sm); }
.mix-name { color: var(--text-2); }
.mix-list b { font-family: var(--font-mono); font-weight: 600; color: var(--text); }

/* Main pest cards: a coloured edge for the level, the meter beside the numbers */
.pest-metrics { grid-template-columns: 1fr 1fr 1.5fr; }
.pest-metrics .pest-meter { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 10px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.pest-metrics .pest-meter span { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 520px) { .pest-metrics { grid-template-columns: 1fr 1fr; } .pest-metrics .pest-meter { grid-column: 1 / -1; } }

/* Other insects: small cards, the steps open on tap */
.minor-section { display: grid; gap: var(--s-4); }
.minor-head h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.7rem; line-height: 1.1; }
.minor-head p { margin-top: 4px; color: var(--text-2); font-size: var(--fs-sm); }
.minor-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); align-items: start; }
.pest-mini { display: grid; gap: 10px; padding: var(--s-4); border-radius: var(--r-lg); animation: fade-up 420ms var(--ease) both; }
.pest-mini h4 { display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--font-ui); font-size: var(--fs-lg); font-weight: 600; }
.pest-mini .pest-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pest-mini .badge::before { display: none; }
.mini-count { color: var(--text-2); font-size: var(--fs-sm); }
.mini-count b { font-family: var(--font-mono); color: var(--text); font-size: var(--fs-lg); }
.pest-mini .pest-why { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini-more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 600; color: var(--teal); }
.mini-more summary::-webkit-details-marker { display: none; }
.mini-more summary::after { content: '+'; font-weight: 700; }
.mini-more[open] summary::after { content: '–'; }
.mini-more-body { display: grid; gap: 12px; margin-top: 12px; }

/* Website view: the steps after the first are three empty blurred lines that open the app window (nothing real is behind them) */
.steps-blur { cursor: pointer; border-radius: 10px; padding: 2px 0; }
.steps-blur:hover .know-blur i { opacity: 0.5; }
.steps-blur:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
