/* ── Nature suite — page & tool styles ───────────────────────────────
   Builds on css/shared.css (tokens, header, footer, Orbitron). Family
   look: dark accent icon-chip hero + card/section/faq pattern, matching
   the Space suite. The Plant & Tree Identifier reads the Pl@ntNet API
   via the same-origin /api/plantnet proxy; the Grass Seed calculator
   is pure client-side arithmetic (js/grass-seed.js). */

main { max-width: 940px; margin: 0 auto; padding: 20px; }

/* ── Tool hero: dark accent icon chip + Orbitron h1 + lede ───────── */
.tool-hero { max-width: 940px; margin: 0 auto; padding: 36px 20px 4px; }
.tool-hero .hero-head { display: flex; align-items: center; gap: 16px; }
.tool-hero .hero-icon { flex-shrink: 0; width: 56px; height: 56px; border-radius: 14px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; }
.tool-hero .hero-icon svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; }
.tool-hero .subtitle { color: var(--muted); font-size: 1.02rem; margin-top: 12px; max-width: 720px; }
.tool-hero .subtitle a { color: var(--accent); font-weight: 600; text-decoration: none; }
.tool-hero .subtitle a:hover { color: var(--accent-h); text-decoration: none; }

main .lede { color: var(--muted); font-size: 1.02rem; margin: 6px 0 20px; max-width: 640px; }

/* ── Hub grid (landing cards) ────────────────────────────────────── */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(264px, 1fr)); gap: 18px; margin-top: 8px; }
.hub-card { display: block; text-decoration: none; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); transition: transform .18s, border-color .18s, box-shadow .18s; }
.hub-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow-lg); text-decoration: none; }
.hub-card .hub-icon { width: 48px; height: 48px; border-radius: 12px; background: #0f0e1d; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.hub-card .hub-icon svg { width: 25px; height: 25px; stroke: var(--accent); fill: none; }
.hub-card h2 { font-size: 1.15rem; color: var(--text); margin-bottom: 6px; }
.hub-card p { font-size: .9rem; color: var(--muted); line-height: 1.6; margin-bottom: 14px; }
.hub-card .hub-open { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 700; color: var(--accent); }
.hub-card .hub-tag { position: absolute; top: 18px; right: 18px; font-size: .72rem; font-weight: 700; color: var(--accent-fg); background: var(--accent-bg); padding: 2px 9px; border-radius: 999px; }
/* Distinct "Featured" pill — solid accent fill, top-left, so it never collides with the top-right "Free" tag. */
.hub-card .hub-tag-featured { position: absolute; top: 18px; left: 18px; right: auto; color: #fff; background: var(--accent); }
/* Per-card accents so each tool keeps its colour on the hub. */
.hub-card.t-identifier { --accent:#15803d; --accent-bg:#dcfce7; --accent-fg:#166534; }
.hub-card.t-grass      { --accent:#4d7c0f; --accent-bg:#ecfccb; --accent-fg:#3f6212; }
.hub-card.t-height     { --accent:#0284c7; --accent-bg:#e0f2fe; --accent-fg:#075985; }
.hub-card.t-care       { --accent:#db2777; --accent-bg:#fce7f3; --accent-fg:#9d174c; }
.hub-card.t-area       { --accent:#0d9488; --accent-bg:#ccfbf1; --accent-fg:#115e59; }

/* ── Content sections (how-it-works / faq) ──────────────────────── */
.section { max-width: 940px; margin: 16px auto; padding: 24px 20px; }
.section > h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.section > .section-sub { color: var(--muted); margin-bottom: 20px; }
.steps { display: grid; gap: 14px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); }
.step-num { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.step-body h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.step-body p { font-size: .92rem; color: var(--muted); line-height: 1.6; }
.step-body a { color: var(--accent); }

.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; font-size: .98rem; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: '\2013'; }
.faq .faq-body { padding: 0 18px 16px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.faq .faq-body a { color: var(--accent); }

/* ── Plant & Tree Identifier: upload dropzone ───────────────────── */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 220px; padding: 24px; text-align: center;
  background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone:focus-within, .dropzone.dragging { border-color: var(--accent); background: var(--surface2); }
.dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone p { color: var(--muted); font-size: .95rem; margin: 0; pointer-events: none; }
.dropzone img { max-width: 100%; max-height: 320px; border-radius: var(--radius); object-fit: contain; pointer-events: none; }

/* ── Plant & Tree Identifier: "what did you photograph" fieldset ── */
.organs { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 16px 18px; margin-top: 18px; }
.organs legend { font-weight: 700; font-size: .92rem; padding: 0 6px; }
.organs label { display: inline-flex; align-items: center; gap: 6px; font-size: .92rem; font-weight: 600; color: var(--text); margin: 8px 14px 4px 0; cursor: pointer; }
.organs input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.organs small { display: block; margin-top: 8px; color: var(--muted); font-size: .84rem; }

#submit { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 22px; margin-top: 18px; font-family: inherit; font-size: .95rem; font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; background: var(--accent); color: #fff; transition: background .15s, opacity .15s; }
#submit:hover:not(:disabled) { background: var(--accent-h); }
#submit:disabled { opacity: .5; cursor: not-allowed; }

#status { min-height: 20px; margin-top: 14px; font-size: .9rem; font-weight: 600; color: var(--muted); }

/* ── Plant & Tree Identifier: results list ──────────────────────── */
.results { list-style: none; display: grid; gap: 12px; margin-top: 18px; }
.result { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow); }
.result img { flex-shrink: 0; width: 72px; height: 72px; border-radius: var(--radius); object-fit: cover; background: var(--surface2); }
.result strong { font-size: 1rem; color: var(--text); }
.result em { font-size: .88rem; color: var(--muted); margin-left: 6px; }
.result .family { display: block; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 2px; }
.result .bar { width: 100%; max-width: 260px; height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.result .bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.result .conf { font-size: .82rem; font-weight: 600; color: var(--accent-fg); margin-top: 4px; }
.result .links { display: flex; gap: 12px; margin-top: 8px; }
.result .links a { font-size: .84rem; font-weight: 600; }

.disclaimer { margin-top: 20px; font-size: .84rem; color: var(--muted); }

/* ── Grass Seed / Height Estimator: calculator + tool forms ─────── */
#seed-form { display: grid; gap: 14px; max-width: 420px; margin-top: 8px; }
#seed-form label, #setup label, #manual-panel label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#seed-form input, #seed-form select, #setup input, #setup select, #manual-panel input {
  font-family: inherit; font-size: .95rem; font-weight: 600; text-transform: none; letter-spacing: normal;
  color: var(--text); padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
#seed-form input:focus, #seed-form select:focus, #setup input:focus, #setup select:focus, #manual-panel input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
#seed-form button, #enable, #compute, #cap-top, #cap-base { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 22px; font-family: inherit; font-size: .95rem; font-weight: 700; border: none; border-radius: var(--radius); cursor: pointer; background: var(--accent); color: #fff; transition: background .15s; }
#seed-form button:hover, #enable:hover, #compute:hover, #cap-top:hover, #cap-base:hover { background: var(--accent-h); }

.out { margin-top: 22px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-height: 24px; }
.out:empty { display: none; }
.out p { font-size: .95rem; color: var(--text); margin: 4px 0; }
.out p:first-child strong { font-size: 1.3rem; color: var(--accent-fg); }

/* ── Per-tool accents ────────────────────────────────────────────── */
body[data-tool="plant-identifier"]      { --accent:#16a34a; --accent-h:#15803d; --accent-bg:#dcfce7; --accent-fg:#166534; --ring:22,163,74; }
body[data-tool="grass-seed-calculator"] { --accent:#65a30d; --accent-h:#4d7c0f; --accent-bg:#ecfccb; --accent-fg:#3f6212; --ring:101,163,13; }
body[data-tool="plant-care"]            { --accent:#db2777; --accent-h:#be185d; --accent-bg:#fce7f3; --accent-fg:#9d174c; --ring:219,39,119; }

/* ── Plant Care Guide: search + filters, plant cards ─────────────── */
.care-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 8px; }
#care-search {
  flex: 1 1 260px; font-family: inherit; font-size: .95rem; font-weight: 600;
  color: var(--text); padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
#care-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring),.14); }
.care-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 8px 16px;
  font-family: inherit; font-size: .85rem; font-weight: 700; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.care-count { color: var(--muted); font-size: .85rem; margin: 12px 0 6px; }

.care-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 8px; }
.care-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); transition: box-shadow .18s; }
.care-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.care-head h3 { font-size: 1.05rem; color: var(--text); margin: 0; }
.care-sci { font-style: italic; color: var(--muted); font-size: .85rem; margin: 2px 0 12px; }

.care-facts { display: grid; gap: 6px; margin: 0 0 12px; }
.care-facts > div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; }
.care-facts dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0; }
.care-facts dd { font-size: .87rem; color: var(--text); margin: 0; }

.care-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill-safe { background: #dcfce7; color: #166534; }
.pill-tox { background: #fef3c7; color: #92400e; }

.badge { flex-shrink: 0; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.badge-easy { background: #dcfce7; color: #166534; }
.badge-medium { background: #fef3c7; color: #92400e; }
.badge-hard { background: #fee2e2; color: #991b1b; }

.care-tips { margin: 0; padding-left: 18px; color: var(--muted); font-size: .87rem; line-height: 1.6; }
.care-tips li + li { margin-top: 4px; }

.care-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 32px 0; }

.care-card.care-focus { box-shadow: 0 0 0 3px rgba(var(--ring),.35), var(--shadow-lg); }

@media (max-width: 620px) {
  .tool-hero .hero-icon { width: 48px; height: 48px; }
  .tool-hero .hero-icon svg { width: 26px; height: 26px; }
  .result { flex-direction: column; }
  .result img { width: 100%; height: 160px; }
}

/* ── Height Estimator v2: mode toggle, camera stage, photo canvas ── */
.mode-toggle { display: flex; gap: 8px; margin: 4px 0 18px; }
.mode-btn { flex: 1; min-height: 44px; padding: 10px 14px; font-family: inherit; font-size: .95rem; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: background .15s, border-color .15s; }
.mode-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cam-stage { position: relative; margin: 18px 0; border-radius: var(--radius-lg); overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 60vh; }
.cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-stage .crosshair { position: absolute; inset: 0; pointer-events: none; }
.cam-stage .crosshair::before, .cam-stage .crosshair::after { content: ''; position: absolute; background: rgba(255,255,255,.85); box-shadow: 0 0 4px rgba(0,0,0,.6); }
.cam-stage .crosshair::before { left: 0; right: 0; top: 50%; height: 2px; }
.cam-stage .crosshair::after { top: 0; bottom: 0; left: 50%; width: 2px; }
.cam-stage .cam-angle { position: absolute; left: 12px; bottom: 12px; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .95rem; font-weight: 600; }
.cam-stage .cam-angle strong { font-size: 1.15rem; }
#sensor-controls, #photo-controls, #area-controls { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
#sensor-controls #captures { flex-basis: 100%; margin: 0; color: var(--muted); font-weight: 600; }
/* Capture top/base = secondary outline buttons (distinct from filled primaries). */
#cap-top, #cap-base, #area-undo, #area-clear { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 20px; font-family: inherit; font-size: .95rem; font-weight: 700; border-radius: var(--radius); cursor: pointer; background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; transition: background .15s, color .15s; }
#cap-top:hover, #cap-base:hover, #area-undo:hover, #area-clear:hover { background: var(--accent-bg); color: var(--accent-fg); }
#cap-top:active, #cap-base:active, #area-undo:active, #area-clear:active { transform: translateY(1px); }
.photo-steps { margin: 6px 0 16px 0; padding-left: 22px; color: var(--muted); font-size: .92rem; line-height: 1.7; }
#photo-file { margin-bottom: 12px; }
.canvas-wrap { margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface2); }
.canvas-wrap canvas { display: block; max-width: 100%; cursor: crosshair; touch-action: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg-btn { min-height: 40px; padding: 9px 14px; font-family: inherit; font-size: .88rem; font-weight: 700; background: var(--surface); color: var(--text); border: none; cursor: pointer; transition: background .15s, color .15s; }
.seg-btn.on { background: var(--accent); color: #fff; }

/* Primary action buttons (camera + photo modes) — solid accent, subtle lift. */
#enable, #compute, #photo-compute, #area-compute {
  min-height: 46px; padding: 12px 26px; font-family: inherit; font-size: .98rem; font-weight: 700;
  border: none; border-radius: var(--radius); cursor: pointer; color: #fff; background: var(--accent);
  box-shadow: 0 2px 10px rgba(2,132,199,.28); transition: transform .12s, box-shadow .15s, background .15s;
}
#enable:hover, #compute:hover, #photo-compute:hover, #area-compute:hover { background: var(--accent-h); box-shadow: 0 4px 16px rgba(2,132,199,.36); transform: translateY(-1px); }
#enable:active, #compute:active, #photo-compute:active, #area-compute:active { transform: translateY(0); box-shadow: 0 1px 6px rgba(2,132,199,.3); }

/* Photo upload dropzone — matches the Identifier / image-tools pattern. */
.photo-drop { gap: 8px; min-height: 180px; }
.photo-drop .drop-icon { width: 40px; height: 40px; stroke: var(--accent); fill: none; pointer-events: none; }
.photo-drop .drop-title { font-size: 1rem; font-weight: 700; color: var(--text); pointer-events: none; }
.photo-drop .drop-hint { font-size: .85rem; color: var(--muted); pointer-events: none; }
.cam-hint { flex-basis: 100%; margin: 0 0 2px; }
.lib-btn { display: block; margin: 12px auto 0; background: none; border: none; color: var(--accent); font-family: inherit; font-size: .92rem; font-weight: 700; text-decoration: underline; cursor: pointer; }
.lib-btn:hover { color: var(--accent-h); }

/* Inputs/labels in photo controls match the rest of the suite. */
#photo-controls label, #area-controls label { display: inline-flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#photo-controls input, #photo-controls select, #area-controls input, #area-controls select { min-height: 44px; padding: 10px 12px; font-size: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
#photo-controls input:focus, #photo-controls select:focus, #area-controls input:focus, #area-controls select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--ring), .14); }
