/* ============================================================================
   Farm Tools suite — shared styles for the /tools/ landing page and every
   individual tool page. Uses only the site theme tokens (--primary, --surface,
   --ink, --ok …) so it follows light/dark and every palette automatically.
   ========================================================================== */

.ft-wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }

/* ---- breadcrumb ---------------------------------------------------------- */
.ft-crumb { max-width: 1100px; margin: 18px auto 0; padding: 0 18px; font-size: 13px; color: var(--muted); }
.ft-crumb a { color: var(--muted); text-decoration: none; }
.ft-crumb a:hover { color: var(--primary-strong); text-decoration: underline; }
.ft-crumb span { color: var(--ink); }

/* ---- landing hero -------------------------------------------------------- */
.ft-hero { text-align: center; padding: 46px 20px 30px; }
.ft-hero-badge { display: inline-block; background: var(--primary-soft); color: var(--primary-strong); font-weight: 700;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 6px 14px; border-radius: 999px; margin-bottom: 16px; }
.ft-hero h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 900; color: var(--ink); line-height: 1.1; margin: 0 0 14px; }
.ft-hero p { font-size: clamp(15px, 2.4vw, 18px); color: var(--muted); max-width: 640px; margin: 0 auto; line-height: 1.6; }
.ft-hero-stats { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.ft-hero-stat { text-align: center; }
.ft-hero-stat b { display: block; font-size: 26px; font-weight: 900; color: var(--primary-strong); }
.ft-hero-stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- category section + tool grid --------------------------------------- */
.ft-section { padding: 26px 0 8px; }
.ft-section-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.ft-section-hd .ic { font-size: 26px; }
.ft-section-hd h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; }
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

.ft-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }
.ft-card:hover { transform: translateY(-5px); box-shadow: 0 14px 30px rgba(0,0,0,.12); border-color: var(--primary); }
.ft-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ft-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; }
.ft-card h3 { font-size: 18px; font-weight: 800; color: var(--ink); margin: 0 0 2px; line-height: 1.2; }
.ft-card .ft-tag { font-size: 12.5px; color: var(--primary-strong); font-weight: 600; }
.ft-card p { font-size: 13.5px; color: var(--muted); line-height: 1.55; margin: 0 0 16px; flex: 1; }
.ft-card-foot { display: flex; align-items: center; justify-content: space-between; }
.ft-open { font-weight: 700; color: var(--primary-strong); font-size: 14px; }
.ft-badge-live { font-size: 11px; font-weight: 700; color: var(--ok-strong); background: var(--ok-soft); padding: 3px 9px; border-radius: 999px; }

/* ---- generic tool page layout ------------------------------------------- */
.ft-tool-hd { text-align: center; padding: 34px 20px 8px; }
.ft-tool-hd .ft-icon { margin: 0 auto 14px; width: 64px; height: 64px; flex-basis: 64px; font-size: 34px; }
.ft-tool-hd h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 900; color: var(--ink); margin: 0 0 10px; }
.ft-tool-hd p { font-size: 15px; color: var(--muted); max-width: 620px; margin: 0 auto; line-height: 1.6; }

.ft-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 22px; align-items: start; margin: 26px auto 0; }
@media (max-width: 820px) { .ft-layout { grid-template-columns: 1fr; } }

.ft-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.ft-panel h2 { font-size: 17px; font-weight: 800; color: var(--ink); margin: 0 0 18px; display: flex; align-items: center; gap: 8px; }

/* ---- form controls ------------------------------------------------------- */
.ft-field { margin-bottom: 16px; }
.ft-field > label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.ft-field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.ft-input, .ft-select { width: 100%; padding: 12px 14px; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.ft-input:focus, .ft-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14); }
.ft-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ft-unit-toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.ft-unit-toggle button { border: none; background: var(--bg); color: var(--muted); padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; }
.ft-unit-toggle button.on { background: var(--primary); color: var(--primary-ink); }

.ft-btn { width: 100%; padding: 14px; font-size: 15.5px; font-weight: 800; color: var(--primary-ink);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); border: none; border-radius: 12px;
  cursor: pointer; transition: transform .15s, box-shadow .15s; margin-top: 4px; }
.ft-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(var(--primary-rgb), .35); }
.ft-btn.secondary { background: var(--bg); color: var(--primary-strong); border: 1.5px solid var(--line); }

/* ---- results ------------------------------------------------------------- */
.ft-result { min-height: 100%; }
.ft-empty { color: var(--muted); text-align: center; padding: 40px 10px; font-size: 14.5px; line-height: 1.6; }
.ft-empty .big { font-size: 42px; display: block; margin-bottom: 12px; opacity: .7; }

.ft-hero-metric { text-align: center; background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--primary-ink); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.ft-hero-metric .lbl { font-size: 13px; opacity: .9; font-weight: 600; }
.ft-hero-metric .val { font-size: 34px; font-weight: 900; margin-top: 4px; }
.ft-hero-metric .sub { font-size: 12.5px; opacity: .85; margin-top: 4px; }

.ft-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ft-kpi { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.ft-kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 600; }
.ft-kpi .val { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 4px; }

.ft-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ft-table th, .ft-table td { padding: 11px 10px; text-align: right; border-bottom: 1px solid var(--line); color: var(--ink); }
.ft-table th:first-child, .ft-table td:first-child { text-align: left; color: var(--muted); font-weight: 600; }
.ft-table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.ft-table tr.total td { font-weight: 800; border-top: 2px solid var(--line); }
.ft-table-wrap { overflow-x: auto; }

.ft-note { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: var(--warn-strong);
  border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.5; margin-top: 16px; }
.ft-note.info { background: var(--primary-soft); color: var(--primary-strong); }
.ft-note b { font-weight: 800; }

/* ---- "more tools" strip -------------------------------------------------- */
.ft-more { padding: 34px 0 46px; }
.ft-more h2 { font-size: 20px; font-weight: 800; color: var(--ink); margin: 0 0 18px; text-align: center; }
.ft-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ft-mini { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 15px; text-decoration: none; transition: border-color .15s, transform .15s; }
.ft-mini:hover { border-color: var(--primary); transform: translateY(-3px); }
.ft-mini .ft-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 22px; border-radius: 10px; }
.ft-mini b { display: block; font-size: 14px; color: var(--ink); font-weight: 700; }
.ft-mini span { font-size: 11.5px; color: var(--muted); }

/* landing CTA back to blog / marketplace */
.ft-cta { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 34px 22px; margin: 30px auto 46px; }
.ft-cta h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0 0 8px; }
.ft-cta p { color: var(--muted); margin: 0 0 18px; }
.ft-cta a { display: inline-block; padding: 12px 26px; border-radius: 10px; font-weight: 700; text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: var(--primary-ink); margin: 0 6px 8px; }
.ft-cta a.ghost { background: var(--bg); color: var(--primary-strong); border: 1.5px solid var(--line); }
