/* Larger type, stronger focus states, and page-switching navigation. */
html { font-size: 17px; }
body { font-size: 17px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }

.tab-panel[hidden] { display: none !important; }
.tab-panel.is-active { animation: tab-enter 160ms ease-out; }
@keyframes tab-enter { from { opacity: .72; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.sidebar { width: 270px; padding: 28px 18px 18px; }
.main-area { margin-left: 270px; }
.brand-name { font-size: 26px; }
.farm-switcher { min-height: 72px; height: auto; }
.farm-avatar { width: 42px; height: 42px; font-size: 14px; }
.farm-label strong, .profile-label strong { font-size: 15px; }
.farm-label small, .profile-label small { font-size: 14px; }
.nav-caption { font-size: 13px; margin-bottom: 10px; }
.primary-nav { gap: 6px; overflow-y: auto; padding-right: 2px; }
.nav-link { min-height: 50px; height: auto; font-size: 15px; gap: 11px; padding: 8px 11px; }
.nav-icon { font-size: 20px; }
.nav-icon.nav-letter { font-size: 14px; font-weight: 800; }
.nav-count { font-size: 13px; min-width: 28px; }
.help-card { padding: 16px; }
.help-card strong { font-size: 14px; }
.help-card p, .help-card a { font-size: 14px; line-height: 1.6; }
.profile-avatar { width: 42px; height: 42px; font-size: 14px; }

.topbar { min-height: 68px; height: auto; }
.breadcrumb { font-size: 15px; }
.top-date { font-size: 14px; }
.page-content { padding: 36px 38px 28px; }
.welcome-row { gap: 22px; margin-bottom: 26px; }
.eyebrow, .panel-kicker { font-size: 13px; letter-spacing: 1.3px; }
.welcome-row h1 { font: 700 36px/1.2 Manrope, sans-serif; letter-spacing: -1.1px; }
.welcome-copy { font-size: 17px; line-height: 1.6; }
.date-filter, .filter-button { min-height: 46px; font-size: 15px; }

.metric-grid { gap: 16px; margin-bottom: 20px; }
.metric-card { min-height: 230px; padding: 20px 22px; }
.metric-label { font-size: 16px; }
.metric-value { font-size: 46px; }
.metric-value.small-value { font-size: 30px; line-height: 1.2; }
.metric-sub { font-size: 14px; }
.trend-tag { font-size: 13px; }
.metric-bottom-label { font-size: 13px; bottom: 16px; left: 22px; }
.content-grid { gap: 20px; margin-bottom: 22px; }
.overview-grid { grid-template-columns: minmax(0, 1fr); }
.panel { border-radius: 15px; }
.alerts-panel, .insight-panel { min-height: 300px; padding: 24px; }
.panel-heading { gap: 16px; }
.panel h2 { font: 700 25px/1.25 Manrope, sans-serif; letter-spacing: -.4px; }
.panel h3 { font-size: 20px; line-height: 1.35; }
.heading-count { font-size: 14px; padding: 4px 8px; }
.text-action { font-size: 15px; min-height: 44px; }
.alerts-list { margin-top: 18px; }
.alert-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 14px 0; }
.alert-symbol { width: 38px; height: 38px; font-size: 16px; }
.alert-copy strong { font-size: 16px; white-space: normal; line-height: 1.4; }
.alert-copy small { font-size: 14px; white-space: normal; line-height: 1.5; }
.alert-age { font-size: 14px; }
.alert-tag { font-size: 13px; }
.empty-state, .loading-row { font-size: 14px; }
.herd-visual { gap: 28px; padding: 22px 8px 16px; }
.donut-wrap { width: 140px; height: 140px; }
.donut-label strong { font-size: 27px; }
.donut-label span { font-size: 13px; }
.herd-legend { gap: 15px; }
.herd-legend div { grid-template-columns: 10px 1fr auto; gap: 9px; font-size: 14px; }
.herd-legend strong { font-size: 14px; }
.insight-note { padding-top: 14px; gap: 10px; }
.insight-note p { font-size: 14px; line-height: 1.6; }

.herd-panel, .whatsapp-panel, .monitoring-panel, .voice-panel, .screening-panel { padding: 26px; margin-bottom: 20px; }
.herd-tools { gap: 12px; }
.search-box { width: min(260px, 42vw); height: 46px; padding: 0 12px; }
.search-box input { font-size: 16px; }
.filter-button { height: 46px; }
table { white-space: normal; }
th { font-size: 13px; letter-spacing: .6px; padding: 13px 12px; }
td { font-size: 14px; line-height: 1.45; padding: 14px 12px; }
.cow-avatar { width: 38px; height: 38px; font-size: 17px; }
.animal-name strong { font-size: 14px; }
.animal-name small { font-size: 13px; }
.status-pill { font-size: 13px; padding: 6px 9px; }
.table-footer, .page-footer { min-height: 44px; height: auto; font-size: 14px; }
.page-footer { padding: 10px 1px; }
.toast { font-size: 14px; line-height: 1.45; padding: 14px 18px; }

input, select, textarea { font-size: 16px; }
button { min-height: 46px; font-size: 16px; }
.save-button, .secondary-button { min-height: 48px; padding: 11px 17px; font-size: 16px; }

.whatsapp-intro h2 { font-size: 25px; }
.whatsapp-intro p, .whatsapp-status, .whatsapp-panel label, .wa-footnote { font-size: 16px; line-height: 1.6; }
.whatsapp-panel input:not([type=checkbox]), .whatsapp-panel select { min-height: 48px; font-size: 16px; }
.whatsapp-panel small { font-size: 14px; }
.consent-line { align-items: flex-start; gap: 12px; }
.consent-line input { width: 20px; height: 20px; flex: 0 0 20px; }

.monitoring-intro, .screening-intro { font-size: 16px; line-height: 1.7; }
.monitoring-panel label, .screening-panel label { font-size: 16px; line-height: 1.5; }
.monitoring-panel input, .monitoring-panel select, .screening-panel input, .screening-panel select { min-height: 48px; height: auto; padding: 10px 12px; font-size: 16px; }
.monitoring-state, .screening-model-state { font-size: 14px; line-height: 1.6; }
.monitoring-configuration summary, .monitoring-explanation summary, .screening-model-info summary { font-size: 16px; }
.monitoring-configuration summary span { font-size: 14px; }
.monitoring-panel h3, .screening-panel h3 { font-size: 20px; }
.monitoring-help, .screening-fieldset > p { font-size: 14px; line-height: 1.65; }
.monitoring-fields { gap: 18px; }
.monitoring-score-card > span { font-size: 14px; }
.monitoring-score-card > div > span { font-size: 15px; }
.monitoring-score-card p { font-size: 15px; }
.monitoring-score-card small { font-size: 14px; }
.monitoring-readings span { font-size: 14px; }
.monitoring-readings strong { font-size: 20px; }
.monitoring-readings small { font-size: 14px; line-height: 1.5; }
.monitoring-trend span, .monitoring-trend svg text { font-size: 14px; }
.monitoring-trend > p, .monitoring-actions p, .monitoring-call-status, .monitoring-call-status p { font-size: 14px; line-height: 1.65; }
.monitoring-message, .monitoring-explanation { font-size: 14px; line-height: 1.7; }
.screening-fields, .screening-signs { gap: 18px; }
.screening-fieldset legend { font-size: 17px; }
.screening-signs label { font-size: 16px; }
.screening-result { padding: 22px; }
.screening-result-empty h3 { font-size: 20px; }
.screening-result-empty p, .screening-score-label, .screening-triage p, .screening-result-notice, .screening-model-info { font-size: 14px; line-height: 1.65; }
.screening-score small { font-size: 13px; }
.screening-triage strong, .screening-factors h3, .screening-history h3 { font-size: 15px; }
.screening-factors li { font-size: 14px; }
.screening-factors li small, .screening-history li small { font-size: 13px; }
.screening-history li { font-size: 14px; }
.screening-model-info > div { font-size: 14px; line-height: 1.65; }

.voice-intro { font-size: 16px; line-height: 1.7; }
.voice-language-badge { font-size: 14px; }
.voice-provider-state { font-size: 14px; line-height: 1.6; padding: 14px 16px; }
.voice-panel label { font-size: 16px; }
.voice-panel input:not([type=checkbox]), .voice-panel select { height: 48px; font-size: 16px; }
.voice-panel h3 { font-size: 20px; }
.voice-call-note, .voice-invitation p { font-size: 14px; line-height: 1.65; }
.voice-buttons a, .voice-history strong { font-size: 16px; }
.voice-history span, .voice-history p, .voice-message { font-size: 14px; line-height: 1.6; }
.voice-history small { font-size: 14px; line-height: 1.55; }
.voice-invitation { padding: 20px; }
.voice-invitation h3 { font-size: 19px; }
.voice-invitation input { font-size: 15px !important; }
.voice-pairing-result { margin-top: 16px; padding-top: 14px; border-top: 1px solid #dfe8df; }
.voice-pairing-result p { overflow-wrap: anywhere; }
.voice-receiver-placeholder h3 { font-size: 21px; }
.voice-receiver-placeholder p { font-size: 15px; line-height: 1.65; }
.voice-small-tag { font-size: 14px; }

.bc-connection { font-size: 14px; }
.bc-main h3 { font-size: 24px; }
.bc-main > p { font-size: 16px; line-height: 1.65; }
.bc-language { font-size: 14px; }
.bc-time { font-size: 15px; }
.bc-card button, .bc-card select, .bc-card input { font-size: 16px; }
.bc-card button { min-height: 48px; padding: 11px 17px; }
.bc-text-only { font-size: 14px !important; }
.bc-call-actions select { max-width: 180px; }
.bc-ack, .bc-note, .bc-error { font-size: 14px; line-height: 1.6; }
.bc-transcript { max-height: 330px; }
.bc-transcript h4 { font-size: 14px; }
.bc-transcript-empty, .bc-turn { font-size: 15px; line-height: 1.65; }
.bc-turn strong { font-size: 14px; }
.bc-text-form button { min-height: 46px; }

.farmer-call-shell { width: min(100%, 540px); }
.farmer-page-brand { font-size: 38px; }
.farmer-account-card { padding: 28px; }
.farmer-account-card h1, .farmer-portal-heading h1 { font-size: 28px; line-height: 1.25; }
.farmer-account-card h2, .farmer-updates h2 { font-size: 22px; }
.farmer-account-card p { font-size: 16px; line-height: 1.65; }
.farmer-eyebrow { font-size: 14px; }
.farmer-account-card label { font-size: 15px; }
.farmer-account-card input { min-height: 50px; font-size: 17px; }
.farmer-primary-button { min-height: 50px; font-size: 16px; }
.farmer-connection { font-size: 14px; line-height: 1.6; padding: 14px; }
.farmer-connection button { min-height: 42px; padding: 9px 12px; font-size: 14px; }
.farmer-text-button { min-height: 44px; font-size: 14px; }
.farmer-health-card { padding: 20px; }
.farmer-health-card h3 { font-size: 17px; line-height: 1.5; }
.farmer-health-card p { font-size: 15px; line-height: 1.65; }
.farmer-health-card small, .farmer-severity, .farmer-health-state { font-size: 14px; }
#farmer-login-message, #farmer-portal-message { font-size: 14px; line-height: 1.6; }
.farmer-pairing-guidance { display: grid; gap: 5px; margin: 22px 0; padding: 16px; border-radius: 12px; background: #eef5eb; color: #315c3f; font-size: 15px; line-height: 1.55; }
.farmer-pairing-guidance strong { font-size: 16px; }

.nav-link:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #91c7a0; outline-offset: 3px; }

@media (max-width: 1120px) {
  .sidebar { width: 250px; }
  .main-area { margin-left: 250px; }
  .topbar { padding: 0 28px; }
  .page-content { padding: 30px 28px 24px; }
}
@media (max-width: 820px) {
  .sidebar { width: 270px; }
  .main-area { margin-left: 0; }
  .topbar { min-height: 64px; padding: 0 18px; }
  .page-content { padding: 26px 18px 22px; }
  .welcome-row { align-items: flex-start; flex-direction: column; }
  .welcome-row h1 { font-size: 32px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 190px; }
  .content-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .alerts-panel, .insight-panel { min-height: 0; }
  .herd-visual { align-items: flex-start; }
  .herd-panel, .whatsapp-panel, .monitoring-panel, .voice-panel, .screening-panel { padding: 21px 17px; }
}
@media (max-width: 560px) {
  .breadcrumb { font-size: 14px; }
  .welcome-row h1 { font-size: 29px; }
  .welcome-copy { font-size: 16px; }
  .panel h2 { font-size: 22px; }
  .panel-heading { align-items: flex-start; }
  .herd-visual { flex-direction: column; }
  .herd-legend { width: 100%; }
  .voice-invitation { padding: 16px; }
  .voice-buttons > button { flex: 1 1 auto; }
  .farmer-account-card { padding: 22px; }
  .farmer-account-card h1, .farmer-portal-heading h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel.is-active { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
