/* ============================================================
   Nepal Land Tools
   ------------------------------------------------------------
   Layered on top of styles.css rather than replacing it, so the
   land tools are visibly part of the same site — same header,
   same cards, same type scale.

   The one place this departs from the rest of the site is the map
   screen. Everywhere else a tool is a form with a result under it;
   on the map the map IS the tool, so it takes the full viewport
   and the results dock beside it (or beneath it, on a phone).
   ============================================================ */

.lt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Dashboard ---- */
.lt-dash-intro {
  max-width: 62ch;
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.lt-card {
  display: flex;
  flex-direction: column;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 180ms var(--ease-out), box-shadow 180ms var(--ease-out),
    border-color 180ms var(--ease-out);
}

.lt-card:hover,
.lt-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent, #4338ca);
  box-shadow: 0 12px 26px rgba(67, 56, 202, 0.16);
}

.lt-card-icon {
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 0.7rem;
}

.lt-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.lt-card p {
  margin: 0.4rem 0 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-soft);
  flex: 1;
}

.lt-card-go {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--accent, #4338ca);
}

/* The four kinds of number, which is the product's central distinction. */
.lt-kinds {
  margin: 1rem 0 0;
}

.lt-kinds dt {
  margin-top: 1rem;
  font-weight: 700;
}

.lt-kinds dd {
  margin: 0.25rem 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---- The map screen ---- */
.lt-app {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  /* Fill the window below the header, so the map is the page. */
  height: clamp(520px, calc(100vh - 210px), 900px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lt-mapwrap {
  position: relative;
  min-width: 0;
}

.lt-map {
  position: absolute;
  inset: 0;
  /* Leaflet needs a real height on its container or it renders nothing. */
  height: 100%;
  width: 100%;
  background: #e8eaed;
}

.lt-searchbar {
  position: absolute;
  z-index: 500;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 0.5rem;
  max-width: 620px;
}

.lt-searchbar input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 0.9rem;
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}

.lt-suggest {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 501;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  max-height: 260px;
  overflow-y: auto;
}

.lt-suggest button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.6rem;
  text-align: left;
  font: inherit;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.lt-suggest button:hover,
.lt-suggest button:focus-visible {
  background: var(--money-tint, #d9f4ea);
}

.lt-layerswitch {
  position: absolute;
  z-index: 500;
  bottom: 22px;
  left: 12px;
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

.lt-layerswitch button {
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  background: #fff;
  border: 0;
  cursor: pointer;
}

.lt-layerswitch button.is-active {
  background: var(--ink);
  color: #fff;
}

.lt-panel {
  overflow-y: auto;
  padding: 1.1rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
}

/* ---- Controls ---- */
.lt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

/* 44px minimum, because these are pressed on a phone in a field. */
.lt-btn-sm {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  font-size: 0.88rem;
}

.btn.is-active {
  background: var(--ink);
  color: #fff;
}

.lt-danger:hover {
  border-color: var(--safety, #dc2626);
  color: var(--safety, #dc2626);
}

.lt-status {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
  line-height: 1.5;
  border-radius: 8px;
  background: #f1f3f7;
  color: var(--ink-soft);
}

.lt-status.is-ok {
  background: var(--money-tint, #d9f4ea);
  color: #065f46;
}

/* Never colour alone — the wording carries the warning too. */
.lt-status.is-warn {
  background: #fdf1dc;
  color: #7c4a03;
}

/* ---- Results ---- */
.lt-result-head {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.lt-result-label {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lt-result-big {
  margin: 0.2rem 0 0;
  font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lt-result-sub {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.lt-figures {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin: 0.9rem 0;
  font-size: 0.9rem;
}

.lt-figures dt {
  color: var(--ink-soft);
}

.lt-figures dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lt-units {
  font-size: 0.88rem;
}

.lt-u-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The sentence that must always be present. */
.lt-caveat {
  margin: 1rem 0 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--border-strong);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.lt-saverow,
.lt-exportrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
}

.lt-saverow input {
  flex: 1;
  min-width: 140px;
  height: 44px;
  padding: 0 0.7rem;
  font: inherit;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.lt-exportrow span {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---- GPS ---- */
.lt-gpsbar {
  display: flex;
  gap: 1.75rem;
  margin-bottom: 0.9rem;
}

.lt-gpsstat {
  display: flex;
  flex-direction: column;
}

.lt-gpslabel {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lt-gpsstat strong {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.lt-gpsstat strong.is-ok {
  color: #059669;
}

.lt-gpsstat strong.is-warn {
  color: #b45309;
}

/* ---- Kitta ---- */
.lt-step {
  margin-top: 0;
  font-size: 1.05rem;
}

.lt-canvaswrap {
  overflow: auto;
}

.lt-sheet {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.drop-zone.is-over {
  border-color: var(--accent, #4338ca);
  background: var(--money-tint, #d9f4ea);
}

/* ---- Saved ---- */
.lt-list {
  display: grid;
  gap: 1rem;
}

.lt-saved-meta {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.lt-saved-area {
  margin: 0.6rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---- Mobile: the panel becomes a bottom sheet ---- */
@media (max-width: 900px) {
  .lt-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 55vh) auto;
    height: auto;
  }

  .lt-mapwrap {
    min-height: 320px;
  }

  .lt-panel {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: none;
    /* A phone's own scroll is the sheet — a nested scroller here traps it. */
    overflow: visible;
  }

  .lt-searchbar {
    flex-wrap: wrap;
  }

  .lt-searchbar input {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lt-card {
    transition: none;
  }
  .lt-card:hover,
  .lt-card:focus-visible {
    transform: none;
  }
}
