:root {
  --primary: #15803d;
  --primary-dark: #14532d;
  --primary-deep: #0b331b;
  --primary-light: #dcfce7;
  --primary-bg: #f0fdf4;
  --accent: #d97706;
  --accent-bg: #fffbeb;
  --accent-border: #fde68a;
  --text-main: #0f172a;
  --text-muted: #475569;
  --bg-page: #f3f6f4;
  --card-bg: #ffffff;
  --border: #d5e0d8;
  --border-focus: #16a34a;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --radius-xl: 16px;
  --radius-lg: 13px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  color: var(--text-main);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: var(--primary-dark);
}

.container {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ==================== STICKY HEADER & NAV ==================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--primary-deep);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.2px;
  flex-shrink: 0;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 59px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 12px 12px;
    gap: 4px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 44px;
  }
}

/* ==================== MAIN CONTENT ==================== */
main.site-main {
  flex: 1;
  padding: 14px 0 36px;
}

/* Season Strip */
.season-strip {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-dark) 50%, var(--primary));
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-md);
}

.season-main {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
}

.season-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12.5px;
  color: #dcfce7;
  font-weight: 600;
}

.season-facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.season-fact-box {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 12px;
  line-height: 1.35;
}

.season-fact-box strong {
  display: block;
  font-size: 13px;
  color: #fde047;
}

@media (max-width: 580px) {
  .season-facts-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Safety Notice Line */
.safety-line {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-left: 4px solid var(--accent);
  color: #78350f;
  border-radius: var(--radius-md);
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 14px;
}

/* Data Context Note */
.data-note {
  background: var(--primary-bg);
  border: 1px solid #bbf7d0;
  color: var(--primary-deep);
  border-radius: var(--radius-md);
  padding: 10px 13px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* ==================== SEARCH TOOL ==================== */
.tool-section {
  margin-bottom: 18px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  background: #e2ebe4;
  padding: 5px;
  border-radius: var(--radius-lg);
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  padding: 11px 10px;
  min-height: 46px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-tab.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 560px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
}

select.control,
input.control {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
}

select.control {
  padding-right: 36px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

select.control:disabled,
input.control:disabled {
  background-color: #f1f5f2;
  color: #94a3b8;
  cursor: not-allowed;
}

select.control:focus,
input.control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

/* Sticky Search Box */
.search-sticky {
  position: sticky;
  top: 64px;
  z-index: 80;
  background: rgba(243, 246, 244, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 0 6px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  min-height: 50px;
  padding: 12px 44px 12px 14px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  box-shadow: 0 3px 10px rgba(21, 128, 61, 0.1);
}

.search-input:disabled {
  border-color: var(--border);
  background: #f8faf9;
  box-shadow: none;
}

.clear-btn {
  position: absolute;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #e2ebe4;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.reverse-row {
  display: flex;
  gap: 8px;
}

@media (max-width: 480px) {
  .reverse-row {
    flex-direction: column;
  }
}

.btn-primary {
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.count-line {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 6px 2px 4px;
  font-weight: 600;
}

.count-line b {
  color: var(--text-main);
}

/* Farmer Cards */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.farmer-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.farmer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.farmer-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.farmer-idx {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.farmer-father {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  background: var(--primary-bg);
  border: 1.5px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.code-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dark);
  text-transform: uppercase;
}

.code-val {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-deep);
  letter-spacing: 0.6px;
  word-break: break-all;
}

.copy-btn {
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 16px;
  min-height: 48px;
  min-width: 112px;
  border-radius: var(--radius-md);
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn.copied {
  background: #16a34a;
}

.card-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef2f0;
  font-size: 13px;
  color: var(--text-muted);
}

.card-meta strong {
  color: var(--text-main);
}

.load-more-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  background: #ffffff;
  color: var(--primary-dark);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  padding: 12px;
}

.load-more-btn:hover {
  background: var(--primary-bg);
}

.empty-box {
  background: #ffffff;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-box h3 {
  margin: 0 0 6px;
  color: var(--text-main);
  font-size: 16.5px;
}

/* ==================== CTA & TABLES & PROSE PAGES ==================== */
.cta-banner {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--primary-dark);
  color: #ffffff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 800;
  padding: 15px 18px;
  border-radius: var(--radius-lg);
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}

.cta-banner:hover {
  background: var(--primary);
}

.info-table-card,
.prose-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.info-table-card h2,
.prose-card h1,
.prose-card h2 {
  margin-top: 0;
  color: var(--primary-deep);
}

.prose-card h1 {
  font-size: 24px;
  margin-bottom: 10px;
}

.prose-card h2 {
  font-size: 18px;
  margin-top: 20px;
  margin-bottom: 8px;
}

.prose-card p,
.prose-card li {
  font-size: 15px;
  color: #1e293b;
}

.prose-card ul,
.prose-card ol {
  padding-left: 20px;
}

.table-wrap {
  overflow-x: auto;
}

table.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table.help-table th,
table.help-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

table.help-table th {
  color: var(--text-muted);
  font-size: 12.5px;
  text-transform: uppercase;
}

.official-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.email-highlight {
  display: inline-block;
  font-size: 18px;
  font-weight: 900;
  color: var(--primary-dark);
  background: var(--primary-bg);
  border: 1.5px dashed var(--primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  word-break: break-all;
}

.warn-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  color: #7f1d1d;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  margin: 14px 0;
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 20px 0 24px;
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0;
}

.footer-links a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-non-gov {
  font-weight: 800;
  color: var(--text-main);
  margin-top: 6px;
}
