:root {
  --green: #164f3d;
  --dark: #133b2f;
  --gold: #eac777;
  --ink: #243d34;
  --muted: #718078;
  --bg: #f4f6f1;
  --line: #dfe5da;
  --red: #b84438;
  --amber: #a87314;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 17px;
  background: white;
  color: var(--ink);
  font-weight: 600;
}
button:hover {
  filter: brightness(0.94);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
}
input,
select,
textarea {
  padding: 11px;
  border: 1px solid #cbd5c8;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  max-width: 100%;
}
label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  margin: 15px 0;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
a {
  color: var(--green);
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 34px;
  letter-spacing: -1.2px;
}
h2 {
  font-size: 24px;
}
h3 {
  font-size: 17px;
}
.muted,
small {
  color: var(--muted);
}
.eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  font-weight: 700;
  letter-spacing: 1px;
}
.brand b {
  font-size: 25px;
  letter-spacing: -0.5px;
  display: block;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
}
.landing {
  background: #fff;
}
.topbar {
  height: 93px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6vw;
}
.topbar nav {
  display: flex;
  gap: 30px;
}
.topbar nav a {
  text-decoration: none;
  font-size: 14px;
}
.hero {
  margin: 0 24px;
  border-radius: 18px;
  min-height: 660px;
  background:
    linear-gradient(90deg, rgba(8, 35, 22, 0.85), rgba(8, 35, 22, 0.13)),
    url("/static/images/harvest-hero.webp") center/cover;
  display: flex;
  align-items: center;
  padding: 70px 5vw;
  color: #fff;
  position: relative;
}
.hero-copy {
  max-width: 740px;
}
.hero h1 {
  font-size: clamp(40px, 4.8vw, 72px);
  font-weight: 550;
  line-height: 1.09;
  margin: 25px 0;
}
.hero p {
  font-size: 18px;
  line-height: 1.7;
  max-width: 570px;
  color: #e5ecdf;
}
.hero .eyebrow {
  color: var(--gold);
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}
.hero-foot {
  position: absolute;
  bottom: 24px;
  font-size: 12px;
  color: #dce6d4;
}
.section {
  padding: 70px 6vw;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: start;
  margin-bottom: 30px;
}
.section-head h2 {
  font-size: 34px;
  max-width: 550px;
}
.section-head p {
  max-width: 400px;
  line-height: 1.7;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  background: #f8f9f5;
}
.feature .num {
  font-size: 32px;
  color: #b3c2ab;
  margin-bottom: 30px;
}
.feature p {
  font-size: 14px;
  line-height: 1.8;
}
.workflow {
  background: var(--green);
  color: white;
  border-radius: 18px;
  padding: 40px;
  line-height: 2;
}
.landing footer {
  padding: 28px 6vw;
  font-size: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.shell {
  display: grid;
  grid-template-columns: 245px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--dark);
  color: white;
  padding: 30px 21px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  margin-bottom: 48px;
  font-size: 10px;
}
.sidebar .brand b {
  font-size: 21px;
}
.sidebar nav {
  display: grid;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
}
.sidebar nav button {
  text-align: left;
  background: transparent;
  color: #bdcfc5;
  border-color: transparent;
  font-weight: 400;
  padding: 14px;
}
.sidebar nav button.active {
  background: #2d5947;
  color: #fff;
}
.sidebar .bottom {
  margin-top: auto;
  display: grid;
  gap: 15px;
}
.sidebar .bottom button {
  background: transparent;
  color: white;
  border-color: #496858;
}
.workspace {
  min-width: 0;
}
.header {
  height: 80px;
  border-bottom: 1px solid var(--line);
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 35px;
}
.header .status {
  font-size: 12px;
}
.avatar {
  background: #eaf0e3;
  border-radius: 50%;
  padding: 11px;
  font-weight: 700;
  margin-right: 10px;
}
.content {
  padding: 32px 35px;
}
.page-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
}
.page-title h1 {
  margin-bottom: 8px;
}
.demo-banner {
  padding: 12px 17px;
  border: 1px solid #e5d8b5;
  background: #faf3df;
  color: #84631b;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 24px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  padding: 22px;
}
.metric strong {
  font-size: 36px;
  display: block;
  margin: 12px 0;
  color: var(--dark);
  font-weight: 550;
}
.metric small {
  font-size: 11px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 24px;
  margin-bottom: 22px;
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.panel-title h2 {
  font-size: 19px;
  margin: 0;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
.map {
  height: 420px;
  border-radius: 10px;
  background: #e7eddd;
}
.map.large {
  height: 620px;
}
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  background: #eef2e9;
  color: #496044;
}
.badge.high {
  background: #fbe9e5;
  color: var(--red);
}
.badge.watch {
  background: #fff2d5;
  color: var(--amber);
}
.badge.unknown {
  background: #eaeef0;
  color: #586773;
}
.badge.low {
  background: #e8f3e9;
  color: #397148;
}
.alert-row {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 9px;
}
.alert-row:last-child {
  border-bottom: 0;
}
.alert-row button {
  text-align: left;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.alert-row p {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
}
.filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.field-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.field-card img {
  height: 130px;
  width: 100%;
  object-fit: cover;
}
.field-card .inner {
  padding: 20px;
}
.field-card button {
  width: 100%;
  margin-top: 20px;
}
.risk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.risk-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 20px;
}
.risk-card p {
  font-size: 13px;
  line-height: 1.7;
}
.risk-card small {
  font-size: 11px;
  display: block;
  line-height: 1.6;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.weather-strip {
  display: flex;
  overflow: auto;
  gap: 12px;
}
.weather-item {
  flex: 0 0 110px;
  background: var(--bg);
  border-radius: 8px;
  padding: 13px;
  font-size: 12px;
}
.weather-item strong {
  font-size: 22px;
  display: block;
  margin: 15px 0;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}
td,
th {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 500;
}
.event {
  border-left: 2px solid #d7e4cb;
  padding: 0 0 23px 18px;
  margin-left: 6px;
  font-size: 14px;
}
.event small {
  display: block;
  margin-bottom: 8px;
}
.source {
  display: block;
  background: var(--bg);
  padding: 18px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.7;
}
.source a {
  font-weight: 650;
}
.answer {
  white-space: pre-wrap;
  line-height: 1.8;
}
.empty {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px;
  max-width: 560px;
  width: calc(100% - 32px);
  max-height: 90vh;
}
dialog::backdrop {
  background: #10261bc0;
  backdrop-filter: blur(4px);
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-title button {
  border: 0;
  font-size: 24px;
  padding: 2px 10px;
}
.error {
  color: var(--red);
  font-size: 13px;
  line-height: 1.6;
}
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark);
  color: white;
  border-radius: 9px;
  padding: 15px 22px;
  z-index: 9999;
  max-width: 440px;
  display: none;
}
.inspection-photo {
  max-width: 260px;
  max-height: 200px;
  border-radius: 8px;
}
.login-info {
  padding: 12px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.7;
  border-radius: 8px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #d3ad4c;
  outline-offset: 3px;
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 200px 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .field-grid,
  .risk-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .content {
    padding: 24px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 15px;
  }
  .metric strong {
    font-size: 28px;
  }
}
@media (max-width: 720px) {
  .shell {
    display: block;
  }
  .sidebar {
    height: auto;
    position: relative;
    padding: 15px;
  }
  .sidebar .brand {
    margin: 0 0 15px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 5px;
  }
  .sidebar nav button {
    white-space: nowrap;
    padding: 10px;
    font-size: 12px;
  }
  .sidebar .bottom {
    display: flex;
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 11px;
  }
  .sidebar .bottom .account {
    display: none;
  }
  .header {
    height: 60px;
    padding: 0 18px;
  }
  .header .status {
    max-width: 150px;
    font-size: 10px;
  }
  .content {
    padding: 20px 14px;
  }
  .page-title {
    align-items: start;
  }
  h1 {
    font-size: 27px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .field-grid,
  .risk-grid,
  .cards {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 18px;
  }
  .map,
  .map.large {
    height: 380px;
  }
  .topbar {
    height: 80px;
    padding: 15px;
  }
  .topbar nav {
    display: none;
  }
  .topbar .brand b {
    font-size: 18px;
  }
  .hero {
    margin: 0 10px;
    padding: 50px 25px;
    min-height: 640px;
  }
  .hero h1 {
    font-size: 42px;
  }
  .hero p {
    font-size: 15px;
  }
  .hero-actions {
    flex-wrap: wrap;
  }
  .hero-foot {
    max-width: 80%;
    font-size: 10px;
  }
  .section {
    padding: 45px 24px;
  }
  .section-head {
    display: block;
  }
  .section-head h2 {
    font-size: 28px;
  }
  .workflow {
    padding: 25px;
  }
  .risk-card {
    padding: 17px;
  }
  .page-title .muted {
    font-size: 12px;
  }
}
.map-status {
  font:
    10px "Segoe UI",
    sans-serif;
  background: #fffffff0;
  color: #435c4e;
  border-radius: 4px;
  padding: 5px 8px;
  max-width: 230px;
}
.landing footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.map {
  background-color: #eef2e7;
  background-image:
    linear-gradient(#dfe6d780 1px, transparent 1px),
    linear-gradient(90deg, #dfe6d780 1px, transparent 1px);
  background-size: 45px 45px;
}
.field-label {
  border: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 7px;
  font-size: 10px;
  color: #183c2e;
  white-space: normal;
  max-width: 120px;
  text-align: center;
}
.field-label:before {
  display: none;
}
.current-weather {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  font-size: 14px;
}
.sidebar .bottom {
  gap: 8px;
}

/* Phytosanitary references share the existing panel and field navigation. */
.phyto-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.phyto-filters label {
  margin: 0;
}
.phyto-filters small,
.phyto-filters fieldset,
.phyto-filters .actions,
.phyto-check {
  grid-column: 1/-1;
}
.phyto-symptoms {
  border: 1px solid #dce3de;
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 16px;
}
.phyto-symptoms label,
.phyto-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.phyto-symptoms input,
.phyto-check input {
  width: auto;
  margin: 0;
}
.phyto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.phyto-item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.phyto-item h2 {
  font-size: 22px;
  margin: 18px 0 8px;
}
.phyto-item > button {
  margin-top: 18px;
}
.phyto-evidence {
  background: #f3f5f2;
  border-left: 3px solid #9da991;
  padding: 14px;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
}
.phyto-evidence p {
  font-size: 14px;
}
.phyto-detail h2 {
  margin-top: 22px;
}
.phyto-detail h3 {
  margin-top: 28px;
}
.phyto-detail li {
  margin: 8px 0;
}
.phyto-detail .source a {
  overflow-wrap: anywhere;
}
.phyto-ask {
  display: grid;
  gap: 15px;
  border-top: 1px solid #dce3de;
  padding-top: 24px;
  margin-top: 24px;
}
.phyto-filters[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .phyto-filters,
  .phyto-grid {
    grid-template-columns: 1fr;
  }
  .phyto-symptoms {
    flex-direction: column;
  }
  .phyto-detail {
    padding: 18px;
  }
}

/* Monitoring is independent of server connectivity; keep its state readable on phones. */
.status {
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 70%;
  text-align: right;
}
.monitoring p,
.warning-summary {
  overflow-wrap: anywhere;
}
.warning-card details p {
  font-size: 0.9rem;
}
.warning-card .actions {
  flex-wrap: wrap;
}

.agro-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.agro-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: end;
}
.agro-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.agro-checks label,
.agro-ack {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.agro-checks input,
.agro-ack input {
  width: auto;
  margin-top: 4px;
}
.agro-soil-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.agro-workflow details {
  margin: 14px 0;
}
.agro-workflow .source {
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .agro-soil-row {
    grid-template-columns: 1fr;
  }
  .agro-filters {
    grid-template-columns: 1fr;
  }
}

.agro-filters label,
.agro-filters input,
.agro-filters select {
  min-width: 0;
  width: 100%;
}

/* Case-focused field hierarchy: essentials first, the existing agronomic workspace follows. */
.field-tools {
  margin: 12px 0 20px;
}
.field-tools summary,
.field-agronomy > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 10px 0;
}
.field-priority .badge {
  white-space: nowrap;
}
.field-priority small {
  display: block;
}
#field-risks,
#field-weather {
  scroll-margin-top: 20px;
}
.sidebar nav {
  overflow-x: hidden;
}
@media (max-width: 720px) {
  .field-priority .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .sidebar nav {
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .header .avatar {
    display: none;
  }
}
/* Compact, field-centered working views. */
.directory-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 1fr 1fr;
  gap: 16px;
  align-items: end;
}
.risk-traffic {
  border: 0;
  padding: 12px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.risk-traffic legend {
  font-weight: 650;
  padding-top: 14px;
}
.traffic-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.traffic-option input {
  width: auto;
  margin: 0;
  accent-color: var(--green);
}
.traffic-option.high {
  border-left: 5px solid var(--red);
}
.traffic-option.watch {
  border-left: 5px solid #ba8a25;
}
.traffic-option.low {
  border-left: 5px solid #4a8460;
}
.traffic-option.unknown {
  border-left: 5px solid #77868b;
}
.field-directory td {
  vertical-align: middle;
  padding: 13px 10px;
}
.field-directory small {
  display: block;
  margin-top: 5px;
}
.field-name {
  font-weight: 650;
  text-align: left;
  border: 0;
  padding: 0;
  background: none;
  color: var(--green);
}
.text-button {
  background: none;
  border: 0;
  padding: 5px 0;
  font-size: 12px;
  text-decoration: underline;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}
.field-tabbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.answer p {
  margin: 0 0 10px;
  line-height: 1.55;
}
.answer li {
  margin: 4px 0;
}
.answer h3 {
  margin: 16px 0 8px;
}
.answer pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.answer-source-list {
  margin-top: 14px;
}
.answer-source-list summary {
  cursor: pointer;
  font-weight: 600;
}
@media (max-width: 720px) {
  .directory-toolbar {
    grid-template-columns: 1fr;
  }
  .directory-panel {
    padding: 16px;
  }
  .field-directory th:nth-child(3),
  .field-directory td:nth-child(3),
  .field-directory th:nth-child(5),
  .field-directory td:nth-child(5) {
    display: none;
  }
  .field-directory td {
    padding: 10px 5px;
    font-size: 13px;
  }
  .traffic-option {
    font-size: 12px;
    padding: 7px;
  }
  .risk-traffic {
    gap: 6px;
  }
  .pagination {
    gap: 10px;
  }
  .field-tabbar button {
    font-size: 12px;
    padding: 9px;
  }
  .directory-toolbar label {
    margin: 0;
  }
}
.handbook-hit {
  padding: 16px 0;
  border-bottom: 1px solid var(--line, #dde3db);
}
.handbook-hit > button {
  font-weight: 700;
  text-align: left;
}
.handbook-hit small {
  display: block;
  margin-top: 8px;
}
.handbook-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.handbook-gallery figure {
  margin: 0;
}
.handbook-gallery img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.handbook-gallery figcaption {
  font-size: 13px;
  line-height: 1.5;
}

/* Professional handbook: scoped to the existing reference flow. */
.handbook-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin: 20px 0 12px;
}
.handbook-counts span {
  padding: 8px 0;
  color: var(--muted, #53615a);
}
.handbook-counts strong {
  font-size: 22px;
  color: var(--ink, #163b2e);
  margin-right: 4px;
}
.handbook-coverage-detail {
  margin: 0 0 10px;
  font-size: 14px;
}
.handbook-toolbar {
  margin-top: 22px;
}
.handbook-toolbar .handbook-photo-filter {
  display: flex;
  align-items: center;
  gap: 9px;
}
.handbook-photo-filter input {
  width: auto;
  margin: 0;
}
.handbook-card h2 {
  margin-top: 18px;
}
.handbook-card-kind {
  color: var(--muted, #53615a);
  line-height: 1.5;
}
.handbook-card-summary {
  padding: 16px 18px;
  background: #f2f6f0;
  border-left: 3px solid #78997d;
  border-radius: 0 8px 8px 0;
  line-height: 1.6;
}
.handbook-section {
  padding: 12px 0 15px;
  border-bottom: 1px solid var(--line, #dde3db);
}
.handbook-section h3 {
  margin: 8px 0 12px;
  font-size: 18px;
}
.handbook-section-sources {
  font-size: 12px;
  color: var(--muted, #53615a);
  margin-top: 12px !important;
  overflow-wrap: anywhere;
}
.handbook-section-sources a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.handbook-metadata {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #dde3db);
}
.handbook-metadata summary {
  cursor: pointer;
  font-weight: 600;
}
.handbook-metadata p {
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.handbook-reference-note {
  padding: 14px 0;
  margin: 18px 0 0;
  color: var(--muted, #53615a);
  line-height: 1.55;
}
.handbook-gallery {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  margin-top: 16px;
}
.handbook-gallery .handbook-photo-open {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 9px;
  background: #f2f4ef;
  text-align: left;
}
.handbook-gallery .handbook-photo-open img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 220px;
  max-height: 260px;
  object-fit: contain;
  border-radius: 0;
}
.handbook-photo-open span {
  display: block;
  padding: 9px 12px;
  font-size: 13px;
}
.handbook-gallery figcaption {
  margin-top: 10px;
  overflow-wrap: anywhere;
}
.handbook-gallery figcaption p {
  margin: 4px 0;
}
.handbook-photo-dialog {
  width: min(1100px, 94vw);
  max-width: 94vw;
  max-height: 92dvh;
  padding: 20px;
  border: 1px solid #d8e1d7;
  border-radius: 14px;
  background: #fff;
  color: #173b2c;
}
.handbook-photo-dialog::backdrop {
  background: rgb(9 28 20 / 75%);
}
.handbook-photo-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.handbook-photo-dialog-header h2 {
  margin: 0;
  font-size: 20px;
}
.handbook-photo-dialog > img {
  display: block;
  width: 100%;
  max-height: 62dvh;
  object-fit: contain;
  background: #f1f3ee;
}
.handbook-photo-attribution {
  margin-top: 14px;
  line-height: 1.45;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.handbook-photo-attribution p {
  margin: 5px 0;
}
.handbook-empty {
  padding: 24px 0;
}
.handbook-empty h2 {
  font-size: 20px;
}
.handbook-card,
.handbook-hit,
.handbook-panel {
  overflow-wrap: anywhere;
  min-width: 0;
}
@media (max-width: 720px) {
  .handbook-counts {
    gap: 8px 18px;
  }
  .handbook-counts span {
    padding: 3px 0;
  }
  .handbook-counts strong {
    font-size: 20px;
  }
  .handbook-card-summary {
    padding: 12px;
  }
  .handbook-photo-dialog {
    padding: 12px;
    width: 94vw;
    max-width: 94vw;
  }
  .handbook-photo-dialog-header {
    align-items: flex-start;
    gap: 8px;
  }
  .handbook-photo-dialog-header h2 {
    font-size: 17px;
  }
  .handbook-photo-dialog-header button {
    padding: 8px;
    white-space: nowrap;
  }
  .handbook-photo-dialog > img {
    max-height: 52dvh;
  }
}
.handbook-gallery figure {
  max-width: 580px;
}

/* A field task keeps its primary action visible at phone widths. */
.task-cards {
  display: grid;
  gap: 16px;
}
.task-card {
  background: #fff;
  border: 1px solid #dce4dc;
  border-radius: 12px;
  padding: 20px;
  overflow-wrap: anywhere;
}
.task-card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.task-card h3 {
  margin: 14px 0;
}
.task-card.overdue {
  border-left: 5px solid #af4c2d;
}
.task-card.focused-task {
  outline: 3px solid #b68b35;
  outline-offset: 2px;
}
.task-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.task-card button,
.attention-item button {
  min-height: 44px;
}
.attention-item {
  border-bottom: 1px solid #dce4dc;
  padding: 14px 0;
}
.finding-reviews .source {
  margin: 12px 0;
}
#inspection-conflict {
  margin: 12px 0;
}
#draft-status {
  font-size: 13px;
}
@media (max-width: 600px) {
  .task-card {
    padding: 16px;
  }
  .task-card .actions > button {
    flex: 1 1 100%;
  }
  .task-card .badge {
    white-space: normal;
  }
  .finding-reviews button {
    width: 100%;
  }
}

/* The first screen answers what is expected, when, and who will respond. */
.prevention-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.prevention-summary > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.prevention-summary strong {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 28px;
  color: var(--green);
}
.prevention-summary span {
  font-size: 14px;
  line-height: 1.45;
}
.coverage-notice {
  border-left: 5px solid var(--amber);
  background: #fffaf0;
  padding: 16px 20px;
}
.coverage-notice > p {
  margin: 0 0 8px;
}
.coverage-field,
.attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.coverage-field {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.coverage-field p {
  margin: 6px 0;
}
.coverage-summary {
  margin: 16px 0 24px;
  color: var(--muted);
}
.threat-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.threat-card {
  margin-bottom: 0;
  border-top: 4px solid var(--amber);
  min-width: 0;
}
.threat-card.high {
  border-top-color: var(--red);
}
.threat-card.unknown {
  border-top-color: #718078;
}
.threat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.threat-heading h2 {
  font-size: 21px;
  line-height: 1.35;
  margin: 8px 0 16px;
}
.threat-heading .eyebrow {
  letter-spacing: 0.06em;
  line-height: 1.5;
}
.threat-heading .badge {
  flex-shrink: 0;
  white-space: normal;
  max-width: 140px;
}
.threat-time {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 9px;
  line-height: 1.5;
}
.threat-time strong {
  font-size: 18px;
}
.threat-time small,
.threat-source {
  line-height: 1.55;
  font-size: 13px;
  color: #4f6256;
}
.threat-action {
  background: #eef4ed;
  border-radius: 9px;
  padding: 14px 16px;
  margin: 16px 0;
}
.threat-action p {
  margin: 6px 0 0;
  line-height: 1.6;
}
.threat-response {
  line-height: 1.65;
}
.threat-source {
  display: block;
  margin-top: 16px;
}
.threat-evidence {
  margin-top: 16px;
}
.demo-banner {
  margin-bottom: 0;
  background: #fff0c4;
  border-bottom: 1px solid #d8b35e;
  padding: 16px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.demo-banner div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.demo-banner span {
  font-size: 13px;
  max-width: 800px;
  line-height: 1.5;
}
.demo-tag {
  display: inline-block;
  background: #fff0c4;
  color: #614600;
  padding: 4px 8px;
  border-radius: 5px;
  font-weight: 700;
}
.warning-change-summary {
  margin-bottom: 16px;
}
@media (max-width: 1180px) {
  .threat-feed {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .prevention-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .prevention-summary > div {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 14px;
  }
  .threat-heading,
  .demo-banner,
  .coverage-field,
  .attention-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .demo-banner {
    padding: 16px;
  }
}

.storage-notice {
  position: fixed;
  z-index: 1200;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 980px;
  margin: auto;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px #133b2f30;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}
.storage-notice[hidden] {
  display: none;
}
.storage-notice p {
  margin: 0;
  line-height: 1.5;
}
.storage-link {
  color: #d9e9de;
  font-size: 13px;
  margin: 10px 0;
}
@media (max-width: 600px) {
  .storage-notice {
    flex-direction: column;
    align-items: flex-start;
  }
}

.login-password-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.login-password-row input {
  flex: 1 1 180px;
  min-width: 0;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.login-remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}
.login-remember-hint {
  font-size: 12px;
  line-height: 1.5;
}
