:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #eef3f7;
  --text: #15202e;
  --muted: #5e6b78;
  --line: #d9e1ea;
  --accent: #0f9f9a;
  --accent-strong: #087d7a;
  --accent-soft: #dff7f4;
  --warm: #f4a83d;
  --danger: #cf3d4f;
  --shadow: 0 18px 50px rgba(21, 32, 46, 0.11);
  --radius: 8px;
  --header-height: 72px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417;
  --surface: #1a1f24;
  --surface-strong: #232a31;
  --text: #f2f5f7;
  --muted: #a8b2bd;
  --line: #323b45;
  --accent: #35c4ba;
  --accent-strong: #72ded7;
  --accent-soft: #143f3d;
  --warm: #f6bd60;
  --danger: #ff6b7a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, var(--bg), var(--surface-strong));
  color: var(--text);
  font-family: inherit;
}

.site-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.site-loader span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  animation: loaderSlide 900ms ease-in-out infinite;
}

body.is-loading .site-loader {
  opacity: 1;
  visibility: visible;
}

@keyframes loaderSlide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(240%);
  }
}

main {
  display: flex;
  flex-direction: column;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input,
textarea {
  border-radius: var(--radius);
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 4rem);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  color: var(--text);
}

.brand span {
  white-space: nowrap;
}

.top-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.5rem);
  color: var(--muted);
  font-size: 0.96rem;
}

.top-nav a,
.site-footer nav a,
.text-link {
  position: relative;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  white-space: nowrap;
}

.top-nav a::after,
.text-link::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.28rem;
  height: 2px;
  content: "";
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.top-nav a:hover::after,
.text-link:hover::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.4rem 0.7rem;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.theme-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: inset -4px -4px 0 rgba(255, 255, 255, 0.35);
}

.hero {
  position: relative;
  order: 1;
  min-height: calc(100vh - var(--header-height));
  display: grid;
  align-items: center;
  padding: clamp(3rem, 9vw, 6.5rem) clamp(1rem, 4vw, 4rem) clamp(3rem, 7vw, 5rem);
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  position: absolute;
  inset: auto 0 0 0;
  height: 26%;
  content: "";
  background: linear-gradient(180deg, transparent, var(--bg));
  z-index: -1;
}

#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-content {
  width: min(980px, 100%);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero h1,
.section-heading h2,
.guide-copy h2,
.future-section h2,
.page-hero h1 {
  margin: 0;
  color: var(--text);
  line-height: 1.05;
}

.hero h1 {
  max-width: 760px;
  font-size: 5.6rem;
}

.hero-subtitle {
  max-width: 760px;
  margin: 1.2rem 0 2rem;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.6;
}

.hero-search {
  position: relative;
  width: min(760px, 100%);
}

.hero-search input,
.compact-search,
.unit-box input,
.unit-box select,
.context-grid input,
.converter-controls input,
.converter-controls select,
.calculator-card input,
.calculator-card select,
.newsletter-form input,
.admin-form input,
.admin-form select,
.page-form input,
.page-form textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-search input {
  min-height: 68px;
  padding: 0 1.3rem;
  font-size: 1.1rem;
  box-shadow: var(--shadow);
}

.hero-search input:focus,
.compact-search:focus,
.unit-box input:focus,
.unit-box select:focus,
.context-grid input:focus,
.converter-controls input:focus,
.converter-controls select:focus,
.calculator-card input:focus,
.calculator-card select:focus,
.newsletter-form input:focus,
.admin-form input:focus,
.admin-form select:focus,
.page-form input:focus,
.page-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  display: none;
  max-height: 310px;
  overflow: auto;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 8;
}

.search-results.active {
  display: grid;
  gap: 0.35rem;
}

.search-results button,
.search-results a,
.category-list button,
.mini-list button {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
}

.search-results button,
.search-results a {
  display: block;
  padding: 0.75rem;
}

.search-results button:hover,
.search-results a:hover,
.category-list button:hover,
.mini-list button:hover {
  background: var(--surface-strong);
  border-color: var(--line);
}

.search-result-title {
  display: block;
  font-weight: 800;
}

.search-result-meta {
  display: block;
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.popular-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.popular-actions button,
.copy-button,
.favorite-button,
.page-cta,
.activity-heading button {
  min-height: 42px;
  padding: 0.58rem 0.88rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.popular-actions button:hover,
.copy-button:hover,
.favorite-button:hover,
.page-cta:hover,
.activity-heading button:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.recent-searches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  margin-top: 1rem;
  color: var(--muted);
}

.recent-searches:empty {
  display: none;
}

.recent-searches span {
  font-size: 0.84rem;
  font-weight: 800;
}

.recent-searches a,
.recent-searches button {
  min-height: 34px;
  padding: 0.42rem 0.66rem;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.recent-searches a:hover,
.recent-searches button:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.header-ad {
  order: 0;
}

.popular-conversions {
  order: 3;
}

.category-overview {
  order: 4;
}

.trust-section {
  order: 5;
}

.why-section {
  order: 6;
}

.faq-section {
  order: 7;
}

.tool-section {
  order: 8;
}

.ad-band:not(.header-ad) {
  order: 9;
}

.tools-section {
  order: 10;
}

.guide-preview {
  order: 11;
}

.business-section {
  order: 12;
}

.newsletter-section {
  order: 13;
}

.blog-system {
  order: 14;
}

.admin-section {
  order: 15;
}

.tool-section,
.category-overview,
.guide-preview,
.future-section,
.popular-conversions,
.tools-section,
.business-section,
.trust-section,
.why-section,
.faq-section,
.newsletter-section,
.blog-system,
.admin-section,
.page-shell {
  width: min(1420px, calc(100% - 2rem));
  margin: 0 auto;
}

.tool-section {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.4rem;
  margin-bottom: 1.4rem;
}

.section-heading h2,
.guide-copy h2,
.future-section h2 {
  font-size: 2.65rem;
}

.metric-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  color: var(--muted);
}

.metric-strip span {
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(250px, 320px);
  gap: 1rem;
  align-items: start;
}

.category-panel,
.converter-panel,
.activity-panel,
.overview-grid article,
.guide-preview,
.future-grid article,
.popular-grid a,
.calculator-card,
.ad-band,
.trust-grid article,
.newsletter-section,
.blog-grid article,
.admin-section,
.page-card,
.page-form {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.category-panel,
.activity-panel {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  padding: 1rem;
}

.field-label,
.unit-box span,
.result-label,
.panel-kicker,
.context-copy,
.page-form label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.compact-search {
  min-height: 44px;
  margin: 0.45rem 0 0.9rem;
  padding: 0 0.8rem;
}

.category-list {
  display: grid;
  gap: 0.45rem;
  max-height: 640px;
  overflow: auto;
  padding-right: 0.1rem;
}

.category-list button {
  display: grid;
  gap: 0.25rem;
  padding: 0.7rem 0.75rem;
}

.category-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
}

.category-icon,
.overview-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 34px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  border-radius: var(--radius);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
}

.overview-icon {
  margin-bottom: 0.75rem;
}

.category-list button.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.category-name {
  display: block;
  font-weight: 800;
}

.category-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.converter-panel {
  padding: clamp(1rem, 3vw, 1.4rem);
}

.converter-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.converter-header h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: 2rem;
}

.converter-header p {
  margin: 0;
}

#activeCategoryDescription {
  color: var(--muted);
  line-height: 1.5;
}

.favorite-button {
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.favorite-button.is-active {
  color: #101318;
  background: var(--warm);
  border-color: var(--warm);
}

.converter-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}

.unit-box {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.9rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.unit-box input {
  min-height: 56px;
  padding: 0 0.75rem;
  font-size: 1.65rem;
  font-weight: 800;
}

.unit-box select {
  min-height: 44px;
  padding: 0 0.65rem;
}

.swap-button {
  width: 54px;
  height: 54px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: 0;
  font-size: 1.55rem;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 28%, transparent);
}

.swap-button:hover {
  transform: rotate(180deg);
  transition: transform 220ms ease;
}

.context-panel {
  margin-top: 0.9rem;
  padding: 0.9rem;
  background: color-mix(in srgb, var(--surface-strong) 70%, transparent);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.converter-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.converter-controls label,
.calculator-card label,
.admin-form label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.converter-controls input,
.converter-controls select,
.calculator-card input,
.calculator-card select,
.newsletter-form input,
.admin-form input,
.admin-form select {
  min-height: 44px;
  padding: 0 0.7rem;
}

.context-panel[data-mode="electricity"] .agriculture-context,
.context-panel[data-mode="agriculture"] .electricity-context {
  display: none;
}

.context-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  align-items: baseline;
  margin-bottom: 0.7rem;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.context-grid label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.context-grid input {
  min-height: 42px;
  padding: 0 0.65rem;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 82%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
}

.result-bar strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  overflow-wrap: anywhere;
}

.copy-button {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
  white-space: nowrap;
}

.copy-button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.definition-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.definition-panel article {
  padding: 0.85rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.definition-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.definition-panel p {
  margin: 0.35rem 0 0;
  color: var(--text);
  line-height: 1.55;
}

.conversion-note {
  min-height: 1.5rem;
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.activity-panel {
  display: grid;
  gap: 1.2rem;
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
}

.activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}

.activity-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.activity-heading button {
  min-height: 32px;
  padding: 0.3rem 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.mini-list,
.history-list {
  display: grid;
  gap: 0.45rem;
}

.mini-list button,
.history-item {
  padding: 0.65rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.history-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.history-item span {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.category-overview,
.future-section,
.popular-conversions,
.tools-section,
.business-section,
.why-section,
.faq-section,
.blog-system,
.admin-section {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.trust-section {
  width: min(1420px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 1rem;
  align-items: start;
  padding: clamp(2rem, 5vw, 4rem) 0;
}

.trust-section h2 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.08;
}

.trust-section p {
  color: var(--muted);
  line-height: 1.65;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.trust-grid article {
  padding: 1rem;
}

.trust-grid h3 {
  margin: 0 0 0.45rem;
}

.trust-grid a {
  display: inline-flex;
  margin-top: 0.45rem;
  color: var(--accent-strong);
  font-weight: 800;
}

.overview-grid,
.future-grid,
.popular-grid,
.calculator-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.popular-grid a {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
}

.popular-grid span,
.blog-grid article span {
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.popular-grid strong {
  color: var(--text);
  line-height: 1.4;
}

.popular-grid small,
.blog-grid p,
.calculator-card p,
.newsletter-section p,
.admin-item span {
  color: var(--muted);
  line-height: 1.55;
}

.ad-band,
.converter-ad-slot,
.in-content-ad {
  width: min(1420px, calc(100% - 2rem));
  min-height: 112px;
  margin: 1rem auto;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 82%, transparent), color-mix(in srgb, var(--surface) 95%, transparent));
  box-shadow: none;
}

.converter-ad-slot,
.in-content-ad {
  width: 100%;
  min-height: 96px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.converter-ad-slot {
  margin: 1rem 0;
}

.in-content-ad {
  margin: 1rem 0 1.2rem;
}

.adsense-placeholder {
  overflow: hidden;
}

.adsense-placeholder[data-ad-status="placeholder"] {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 78%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
}

.ad-band span,
.converter-ad-slot span,
.in-content-ad span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ad-band strong,
.converter-ad-slot strong,
.in-content-ad strong {
  margin-top: 0.2rem;
}

.ad-band p,
.converter-ad-slot p,
.in-content-ad p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.sidebar-ad {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 0.25rem;
  min-height: 250px;
  padding: 1rem;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.sidebar-ad span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.adsbygoogle {
  min-height: 90px;
}

.calculator-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calculator-card {
  display: grid;
  align-content: start;
  gap: 0.85rem;
  padding: 1rem;
}

.calculator-card h3,
.blog-grid h3 {
  margin: 0;
}

.calculator-card p {
  margin: 0;
}

.calculator-card button,
.newsletter-form button,
.admin-form button,
.agri-tabs button {
  min-height: 42px;
  padding: 0.58rem 0.88rem;
  color: #ffffff;
  background: var(--accent-strong);
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius);
  font-weight: 800;
}

.calculator-card strong {
  display: block;
  padding: 0.75rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 0.55rem;
}

.calc-row span {
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.calc-row.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.calc-api {
  margin-top: 0.1rem;
}

.agriculture-suite {
  grid-column: span 2;
}

.agri-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.agri-tabs button {
  min-height: 36px;
  color: var(--text);
  background: var(--surface-strong);
  border-color: var(--line);
}

.agri-tabs button.active {
  color: #ffffff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.agri-tool {
  display: none;
  gap: 0.8rem;
}

.agri-tool.active {
  display: grid;
}

.newsletter-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 1rem;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.newsletter-section h2 {
  margin: 0;
  font-size: 2rem;
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
}

.newsletter-form span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.88rem;
}

.blog-grid article {
  padding: 1rem;
}

.blog-grid article a {
  display: inline-flex;
  margin-top: 0.5rem;
  color: var(--accent-strong);
  font-weight: 800;
}

.admin-section {
  box-shadow: none;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.admin-item {
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-item strong,
.admin-item span {
  display: block;
}

.overview-grid article,
.future-grid article {
  padding: 1rem;
}

.overview-grid h3,
.future-grid h3,
.page-card h2,
.page-card h3 {
  margin: 0 0 0.45rem;
}

.overview-grid p,
.future-grid p,
.page-card p,
.page-card li,
.guide-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.unit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.unit-chips span {
  padding: 0.28rem 0.48rem;
  color: var(--muted);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.78rem;
}

.guide-preview {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: 1.2rem;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.6rem);
}

.guide-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.guide-links a {
  padding: 0.75rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 700;
}

.guide-links a:hover {
  border-color: var(--accent);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem clamp(1rem, 4vw, 4rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-brand {
  margin-bottom: 0.6rem;
}

.site-footer p {
  max-width: 560px;
  margin: 0;
  line-height: 1.6;
}

.page-shell {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.page-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.2rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 82%, transparent), color-mix(in srgb, var(--surface) 96%, transparent));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page-hero h1 {
  font-size: 4rem;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.page-card,
.page-form {
  padding: 1.1rem;
}

.page-card ul,
.page-card ol {
  margin: 0.6rem 0 0;
  padding-left: 1.25rem;
}

.page-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.8rem;
  color: #ffffff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  font-weight: 800;
}

.page-form {
  display: grid;
  gap: 0.85rem;
}

.page-form label {
  display: grid;
  gap: 0.35rem;
}

.page-form input,
.page-form textarea {
  min-height: 44px;
  padding: 0.7rem;
}

.page-form textarea {
  min-height: 140px;
  resize: vertical;
}

@media (max-width: 1160px) {
  .tool-layout {
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  }

  .activity-panel {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-grid,
  .future-grid,
  .popular-grid,
  .calculator-grid,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    flex-wrap: wrap;
  }

  .top-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.2rem 0 0.35rem;
    scrollbar-width: thin;
  }

  .top-nav a {
    min-height: 38px;
    padding: 0.45rem 0.62rem;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: 3.6rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-heading h2,
  .guide-copy h2,
  .future-section h2 {
    font-size: 2.1rem;
  }

  .converter-header h2 {
    font-size: 1.65rem;
  }

  .unit-box input {
    font-size: 1.4rem;
  }

  .result-bar strong {
    font-size: 1.18rem;
  }

  .page-hero h1 {
    font-size: 2.7rem;
  }

  .section-heading,
  .converter-header,
  .result-bar,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-strip {
    justify-content: flex-start;
  }

  .tool-layout,
  .guide-preview,
  .newsletter-section,
  .trust-section,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .category-panel {
    position: static;
  }

  .activity-panel {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .converter-grid {
    grid-template-columns: 1fr;
  }

  .swap-button {
    justify-self: center;
  }

  .context-grid,
  .definition-panel,
  .converter-controls,
  .activity-panel,
  .overview-grid,
  .future-grid,
  .popular-grid,
  .calculator-grid,
  .trust-grid,
  .blog-grid,
  .admin-form,
  .admin-list,
  .guide-links {
    grid-template-columns: 1fr;
  }

  .copy-button,
  .favorite-button {
    width: 100%;
    justify-content: center;
  }

  .result-actions,
  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .sidebar-ad {
    position: static;
    min-height: 96px;
  }

  .ad-band,
  .converter-ad-slot,
  .in-content-ad {
    min-height: 88px;
    padding: 0.8rem;
  }

  .agriculture-suite {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .brand span {
    max-width: 190px;
    white-space: normal;
    line-height: 1.1;
  }

  .theme-toggle {
    min-height: 38px;
  }

  .hero-search input {
    min-height: 58px;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .section-heading h2,
  .guide-copy h2,
  .future-section h2 {
    font-size: 1.8rem;
  }

  .page-hero h1 {
    font-size: 2.3rem;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .unit-box {
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
