/* Hallmark · shape: app screen · genre: modern-minimal · theme: Furrow (deal 1/3, seed krishi-sahayak-farm-advisory-581c·db158eeb·2026-11-24·r0)
 * nav: top bar, wordmark and five tabs · signature: the field record card, a notebook entry with the crop's usual range drawn against your soil · states: loading, empty, error, full
 * axes: light/grotesk-sans/warm · posture: committed · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R3 V4 · weakest: R, the survey map is drawn from the field's own coordinates so each place gets its own land */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --bar-h: 64px;
  --field-h: 52px;
  --radius-sheet: 3px;
}

/* ---------- shell ---------- */
.skip { position: absolute; left: var(--space-md); top: calc(-1 * var(--space-3xl)); z-index: var(--z-tooltip); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-pill); }
.skip:focus-visible { top: var(--space-xs); }

.bar { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: var(--color-paper); border-bottom: var(--rule-hair) solid var(--color-ink); }
.bar__inner { display: flex; align-items: center; gap: var(--space-lg); min-height: var(--bar-h); }
.wordmark { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); letter-spacing: var(--tracking-display); text-decoration: none; white-space: nowrap; }
.wordmark:focus-visible, .tabs a:focus-visible { border-radius: var(--radius-pill); }

.tabs { display: flex; gap: var(--space-2xs); margin-inline: auto; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-sm); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); text-decoration: none; white-space: nowrap; transition: background-color var(--dur-short) var(--ease-out); }
.tabs a[aria-current="page"] { background: var(--color-accent); color: var(--color-accent-ink); }
@media (hover: hover) { .tabs a:not([aria-current]):hover { background: var(--color-paper-3); } }

.account { display: flex; align-items: center; gap: var(--space-xs); min-width: 0; font-size: var(--text-sm); }
.account__name { color: var(--color-muted); max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { padding-block: var(--space-xl) var(--space-2xl); outline: none; }
.noscript { padding-block: var(--space-md); }
h1 { font-size: var(--text-3xl); }
.lead { margin-top: var(--space-xs); color: var(--color-muted); }
.small-title { font-size: var(--text-md); margin-top: var(--space-xl); }
.helper { min-height: 1lh; margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); }
.helper.is-error { color: var(--color-error); }

.foot { border-top: var(--rule-hair) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-sm); }
.foot__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-columns); padding-block: var(--space-lg); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 48px; padding: 0 var(--space-lg); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font: 500 var(--text-md)/1 var(--font-body); white-space: nowrap; text-decoration: none; cursor: pointer; box-shadow: inset 0 1px 0 var(--color-sheet), 0 1px 1px var(--color-rule); transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: color-mix(in oklab, var(--color-accent) 78%, var(--color-ink)); box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-sheet) 32%, transparent), inset 0 -1px 0 color-mix(in oklab, var(--color-ink) 10%, transparent); }
.btn--quiet { background: transparent; box-shadow: none; }
.btn--small { min-height: 36px; padding: 0 var(--space-sm); font-size: var(--text-sm); }
@media (hover: hover) {
  .btn:hover { background: var(--color-paper-3); }
  .btn--primary:hover { background: color-mix(in oklab, var(--color-accent) 90%, var(--color-ink)); }
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }

.field { position: relative; }
.field label { position: absolute; left: var(--space-md); top: var(--space-xs); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); pointer-events: none; }
.field input, .field select { width: 100%; height: var(--field-h); padding: var(--space-md) var(--space-xl) 0 var(--space-md); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); outline: 2px solid transparent; outline-offset: -3px; transition: background-color var(--dur-short) var(--ease-out); }
.field input[type="number"] { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.field input::-webkit-inner-spin-button { appearance: none; }
.field select { appearance: none; cursor: pointer; }
.field--select::after { content: ""; position: absolute; right: var(--space-md); top: 50%; width: 7px; height: 7px; border: solid var(--color-ink-2); border-width: 0 1.5px 1.5px 0; transform: translateY(-25%) rotate(45deg); pointer-events: none; }
.field input:focus-visible, .field select:focus-visible { outline-color: var(--color-focus); border-color: var(--color-ink-2); }
@media (hover: hover) { .field input:hover, .field select:hover { background: var(--color-sheet); } }
.field input[aria-invalid="true"] { border-color: var(--color-error); }
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.field__unit { position: absolute; right: var(--space-sm); bottom: var(--space-xs); font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); pointer-events: none; }
.field--grow { flex: 1 1 14rem; min-width: 0; }

.group { margin: var(--space-lg) 0 0; padding: 0; border: 0; min-width: 0; }
.group legend { padding: 0; margin-bottom: var(--space-xs); font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs) var(--space-sm); }
.grid .helper { margin-top: var(--space-3xs); font-size: var(--text-xs); }
form > .btn--primary { margin-top: var(--space-xl); }

.autofill { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin-top: var(--space-sm); }
.autofill .helper { margin: 0; flex: 1 1 16rem; }

/* segmented sample chooser */
.samples { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-lg); }
.samples button { min-height: 40px; padding: 0 var(--space-md); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-pill); background: var(--color-paper-2); color: var(--color-ink); font-size: var(--text-sm); font-weight: 500; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.samples button[aria-pressed="true"] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
@media (hover: hover) { .samples button:not([aria-pressed="true"]):hover { background: var(--color-paper-3); } }

/* ---------- today ---------- */
.today { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gap-columns); align-items: start; }
.place { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-lg); }
.choices { list-style: none; margin: 0 0 var(--space-md); padding: 0; border-top: var(--rule-hair) solid var(--color-ink); }
.choices button { display: flex; justify-content: space-between; gap: var(--space-md); width: 100%; min-height: 44px; padding: var(--space-xs) 0; border: 0; border-bottom: var(--rule-hair) solid var(--color-rule); background: none; color: var(--color-ink); text-align: left; cursor: pointer; }
.choices button span:last-child { color: var(--color-muted); font-size: var(--text-sm); }
@media (hover: hover) { .choices button:hover { background: var(--color-paper-3); } }

.map { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 0 0 var(--rule-hair) var(--color-rule); background: var(--color-paper-3); }
.map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.place-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-top: var(--space-md); }
.place-name h2 { font-size: var(--text-xl); }
.coords { font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: var(--space-md) 0 0; border-top: var(--rule-hair) solid var(--color-ink); }
.stats > div { padding: var(--space-sm) var(--space-sm) 0; border-left: var(--rule-hair) solid var(--color-rule); }
.stats > div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; }
.stats dd { margin: var(--space-2xs) 0 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-2xl); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats dd small { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 400; letter-spacing: 0; color: var(--color-muted); }

.forecast { width: 100%; margin-top: var(--space-lg); border-collapse: collapse; font-size: var(--text-sm); }
.forecast caption { text-align: left; font-weight: 500; padding-bottom: var(--space-xs); }
.forecast th, .forecast td { padding: var(--space-xs) var(--space-xs) var(--space-xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); text-align: left; white-space: nowrap; }
.forecast thead th { border-bottom-color: var(--color-ink); font-weight: 500; color: var(--color-muted); }
.forecast .num { font-family: var(--font-outlier); text-align: right; }

.tools-title { margin-top: var(--space-2xl); font-size: var(--text-xl); }
.ruled { list-style: none; margin: var(--space-md) 0 0; padding: 0; border-top: var(--rule-hair) solid var(--color-ink); }
.ruled > li { border-bottom: var(--rule-hair) solid var(--color-rule); }
.tools a { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr) auto; gap: var(--gap-columns); align-items: baseline; padding: var(--space-md) 0; text-decoration: none; transition: background-color var(--dur-short) var(--ease-out); }
.tools a::after { content: "Open"; font-size: var(--text-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 0.2em; }
.tools__name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); letter-spacing: var(--tracking-display); }
.tools__line { color: var(--color-muted); }
@media (hover: hover) { .tools a:hover { background: var(--color-paper-3); } }

/* ---------- tool pages ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--space-2xl); align-items: start; }
.tool__result { position: sticky; top: calc(var(--bar-h) + var(--space-lg)); }

/* empty / error panels: a tinted well, no border */
.well { padding: var(--space-xl); border-radius: var(--radius-card); background: var(--color-paper-3); }
.well h2 { font-size: var(--text-lg); }
.well p { margin-top: var(--space-xs); color: var(--color-muted); }
.well .btn { margin-top: var(--space-md); }
.well--error h2 { color: var(--color-error); }

/* skeleton in the shape of the card */
.skeleton { display: grid; gap: var(--space-sm); padding: var(--space-lg); border-radius: var(--radius-entry); background: var(--color-paper-2); box-shadow: 0 0 0 var(--rule-hair) var(--color-rule); }
.skeleton span { display: block; height: var(--space-md); border-radius: var(--radius-pill); background: var(--color-paper-3); animation: pulse 1.4s var(--ease-in-out) infinite alternate; }
.skeleton span:first-child { height: var(--space-2xl); }
.skeleton span:nth-child(3) { width: 60%; }
@keyframes pulse { to { opacity: 0.45; } }

/* the field record: signature notebook card */
.entry { border-radius: var(--radius-entry); background: var(--color-paper-2); box-shadow: 0 0 0 var(--rule-hair) var(--color-ink), var(--shadow-lift); overflow: hidden; }
.entry__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); padding: var(--space-md) var(--space-lg); background: var(--color-ink); color: var(--color-paper); }
.entry__kind { font-size: var(--text-sm); font-weight: 500; }
.entry__conf { font-family: var(--font-outlier); font-size: var(--text-sm); }
.entry__title { padding: var(--space-lg) var(--space-lg) var(--space-md); }
.entry__title h2 { max-width: none; font-size: var(--text-3xl); }
.entry__title p { margin-top: var(--space-2xs); color: var(--color-muted); }
.notebook { background: linear-gradient(var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, var(--color-grid) 1px, transparent 1px) 0 0 / 8px 8px, var(--color-paper-2); }
.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: var(--rule-hair) solid var(--color-ink); }
.cells > div { padding: var(--space-sm) var(--space-lg); border-bottom: var(--rule-hair) solid var(--color-ink); }
.cells > div:nth-child(odd) { border-right: var(--rule-hair) solid var(--color-ink); }
.cells dt { font-size: var(--text-xs); color: var(--color-muted); }
.cells dd { margin: var(--space-3xs) 0 0; font-weight: 500; }
.cells + .entry__section { border-top: 0; }
.entry__section { padding: var(--space-md) var(--space-lg); border-top: var(--rule-hair) solid var(--color-ink); }
.entry__section h3 { font-size: var(--text-md); margin-bottom: var(--space-xs); }
.entry__section > p { color: var(--color-ink-2); }
.entry__section > p + p { margin-top: var(--space-xs); }
.entry__note { padding: var(--space-sm) var(--space-lg); border-top: var(--rule-hair) solid var(--color-ink); font-size: var(--text-sm); color: var(--color-muted); }

.runners { list-style: none; margin: 0; padding: 0; }
.runners li { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-2xs) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.runners li:last-child { border-bottom: 0; }
.runners .num { font-family: var(--font-outlier); font-size: var(--text-sm); color: var(--color-muted); }

.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 500; }
.chip--in { background: var(--color-green-soft); color: var(--color-green); }
.chip--out { background: var(--color-accent-soft); color: var(--color-ink); }

/* why: your value against the crop's usual range */
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.why li { display: grid; grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) auto; gap: var(--space-sm); align-items: center; font-size: var(--text-sm); }
.why .num { font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); }
.range { width: 100%; height: 20px; overflow: visible; }
.range .track { fill: var(--color-grid-strong); }
.range .band { fill: var(--color-green-soft); stroke: var(--color-green); stroke-width: 1; }
.range .mid { stroke: var(--color-green); stroke-width: 1.5; }
.range .you { fill: var(--color-ink); }
.range .you-out { fill: var(--color-accent); stroke: var(--color-ink); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-md); margin-top: var(--space-sm); font-size: var(--text-xs); color: var(--color-muted); }
.legend span { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.legend i { display: inline-block; width: 12px; height: 8px; border-radius: 2px; background: var(--color-green-soft); box-shadow: 0 0 0 1px var(--color-green); }
.legend i.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-ink); box-shadow: none; }

/* ---------- leaf check ---------- */
.drop { display: grid; place-items: center; gap: var(--space-2xs); margin-top: var(--space-lg); padding: var(--space-2xl) var(--space-lg); border: var(--rule-hair) dashed var(--color-muted); border-radius: var(--radius-card); background: var(--color-paper-2); text-align: center; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
.drop:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.drop.is-over { background: var(--color-accent-soft); }
@media (hover: hover) { .drop:hover { background: var(--color-sheet); } }
.drop__title { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); letter-spacing: var(--tracking-display); }
.drop__line { color: var(--color-muted); font-size: var(--text-sm); }

.gallery { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
.gallery button { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius-pill); overflow: hidden; background: var(--color-paper-3); cursor: pointer; aspect-ratio: 1; transition: transform var(--dur-micro) var(--ease-out); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery button:active { transform: translateY(1px); }
@media (hover: hover) { .gallery button:hover img { opacity: 0.85; } }
.gallery__empty { grid-column: 1 / -1; color: var(--color-muted); font-size: var(--text-sm); }

.supported { margin-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); padding-top: var(--space-sm); }
.supported summary { cursor: pointer; font-weight: 500; min-height: 32px; }
.supported p { margin-top: var(--space-xs); color: var(--color-muted); }

.leaf-photo { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: var(--rule-hair) solid var(--color-ink); }

/* ---------- history ---------- */
.table-wrap { overflow-x: auto; margin-top: var(--space-lg); }
.history { width: 100%; border-collapse: collapse; }
.history th, .history td { padding: var(--space-sm) var(--space-md) var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); text-align: left; vertical-align: top; }
.history thead th { border-bottom: var(--rule-hair) solid var(--color-ink); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); white-space: nowrap; }
.history .num { font-family: var(--font-outlier); font-size: var(--text-sm); white-space: nowrap; }
.history td:last-child { text-align: right; padding-right: 0; }
.history .input { color: var(--color-muted); font-size: var(--text-sm); }

.toast { position: fixed; left: 50%; bottom: var(--space-lg); z-index: var(--z-toast); display: flex; align-items: center; gap: var(--space-md); padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-md); border-radius: var(--radius-card); background: var(--color-ink); color: var(--color-paper); box-shadow: var(--shadow-lift); transform: translateX(-50%); }
.toast .btn { min-height: 36px; background: var(--color-ink-2); color: var(--color-paper); border-color: var(--color-muted); box-shadow: none; }

/* ---------- narrow windows ---------- */
@media (max-width: 60rem) {
  .bar__inner { flex-wrap: wrap; gap: var(--space-xs) var(--space-md); padding-block: var(--space-xs); }
  .tabs { order: 3; width: 100%; margin: 0; }
  .account { margin-left: auto; }
  .today, .tool { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .tool__result { position: static; }
  .tools a { grid-template-columns: minmax(0, 1fr) auto; }
  .tools__line { grid-column: 1; grid-row: 2; }
  .tools a::after { grid-row: 1 / 3; grid-column: 2; align-self: center; }
  .foot__inner { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .grid, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .why li { grid-template-columns: minmax(0, 1fr) auto; }
  .why .range { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton span { animation: none; }
  .btn[aria-busy="true"]::before { animation-duration: 1.4s; }
}
.view h1:focus { outline: none; }
