/* Farm Manager – shared calculator/tool page chrome */

:root {
  --calc-green-dark: #234f2e;
  --calc-green: #2f6b2f;
  --calc-text: #1f2520;
  --calc-muted: #566052;
  --calc-page-bg: #eef1e6;
  --calc-green-soft: #e6efe2;
  --calc-surface: #ffffff;
  --calc-surface-soft: #f8f9f4;
  --calc-border: #cfd8c6;
}

/* Top brand row: logo + back link */
.tool-page-header__bar,
.calc-brand-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0 1rem;
  border-bottom: 1px solid var(--calc-border);
}

.calc-brand-link,
.tool-page-header__logo-link {
  display: block;
  line-height: 0;
  text-decoration: none;
  flex-shrink: 0;
}

.calc-brand-logo {
  height: auto;
  max-width: 220px;
  width: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}

/* Matches homepage .btn-secondary / app outline actions */
.tool-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 42px;
  padding: 0.62rem 1.05rem;
  border-radius: 12px;
  background: var(--calc-surface-soft);
  color: var(--calc-green-dark);
  border: 1px solid var(--calc-border);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 2px rgba(31, 37, 32, 0.04);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.tool-home-btn:link,
.tool-home-btn:visited,
.tool-home-btn:hover,
.tool-home-btn:active,
.tool-home-btn:focus {
  color: var(--calc-green-dark);
  text-decoration: none;
}

.tool-home-btn:hover {
  background: var(--calc-green-soft);
  border-color: var(--calc-green);
  box-shadow: 0 2px 6px rgba(31, 37, 32, 0.06);
}

.tool-home-btn:active {
  background: #dce8d8;
  box-shadow: none;
}

.tool-home-btn:focus-visible {
  outline: 3px solid rgba(47, 107, 47, 0.2);
  outline-offset: 2px;
}

.hero .seo-intro {
  margin-top: 0.65rem;
  font-size: 0.92rem;
}

/* Title row: page name + back link (mobile duplicate above title) */
.tool-page-header__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.tool-page-header__title-row h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.tool-page-header__title-row .tool-home-btn--title {
  display: none;
}

@media (max-width: 640px) {
  .tool-page-header__bar .tool-home-btn--bar {
    display: none;
  }

  .tool-page-header__title-row .tool-home-btn--title {
    display: inline-flex;
  }

  .tool-page-header__title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    margin-top: 0.15rem;
    margin-bottom: 1rem;
  }

  .tool-page-header__title-row .tool-home-btn--title {
    width: 100%;
    order: -1;
  }

  .tool-page-header__title-row h1 {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .calc-brand-logo {
    max-width: 180px;
  }
}

/* Public site footer link on calculator pages */
.calc-site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.65rem;
  margin-top: 2rem;
  padding: 1.25rem 1rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--calc-muted);
  border-top: 1px solid var(--calc-border);
}

.calc-site-footer__sep {
  color: var(--calc-muted);
  user-select: none;
}

.calc-site-footer a {
  color: var(--calc-green-dark);
  font-weight: 500;
  text-decoration: none;
}

.calc-site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 400px) {
  .tool-page-header__bar,
  .calc-brand-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
  }

  .calc-brand-link,
  .tool-page-header__logo-link {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .tool-page-header__bar .tool-home-btn--bar {
    width: 100%;
  }
}
