:root {
  --ink: #17231f;
  --muted: #66736d;
  --line: #d7ded9;
  --paper: #fbfcfa;
  --panel: #ffffff;
  --forest: #1d5b44;
  --teal: #0f7c80;
  --rose: #a94635;
  --mint: #edf5f0;
  --shadow: 0 14px 34px rgba(28, 42, 36, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(220, 235, 226, 0.5), rgba(251, 252, 250, 0) 30rem),
    var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-screen.hidden,
.locked {
  display: none !important;
}

.hidden {
  display: none !important;
}

.login-card {
  width: min(400px, 100%);
  display: grid;
  gap: 11px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-logo {
  width: 142px;
  height: auto;
  margin-bottom: 6px;
}

.login-copy {
  margin-bottom: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: var(--rose);
  font-size: 0.86rem;
  font-weight: 750;
}

.app-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.brand-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.brand-row.compact {
  grid-template-columns: 34px minmax(0, 1fr);
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.12rem, 2.2vw, 1.55rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f5;
}

.nav-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.nav-tabs button.active {
  background: var(--forest);
  color: #fff;
}

.nav-tabs button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.primary,
.secondary {
  min-height: 36px;
  border-radius: 6px;
  font-weight: 850;
  cursor: pointer;
}

.primary {
  background: var(--forest);
  color: #fff;
}

.secondary {
  background: #edf3ef;
  color: var(--forest);
}

.top-print {
  padding: 0 12px;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.top-actions .secondary,
.top-actions .primary {
  padding: 0 10px;
  white-space: nowrap;
}

.page {
  display: none;
}

.page.active {
  display: grid;
  gap: 12px;
}

.input-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.48fr) minmax(0, 1.52fr);
  gap: 12px;
  align-items: start;
}

.input-hero,
.input-card,
.summary-block,
.data-section,
.notes-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.input-hero {
  position: sticky;
  top: 68px;
  overflow: hidden;
}

.input-hero img {
  display: block;
  width: 100%;
  height: 170px;
  object-fit: cover;
}

.input-hero div {
  padding: 14px;
}

.input-hero p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.42;
}

.input-card {
  padding: 14px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

fieldset:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

legend,
summary {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

legend {
  margin-bottom: 8px;
}

label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

small {
  color: var(--muted);
  font-size: 0.7rem;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 124, 128, 0.14);
}

.field-grid {
  display: grid;
  gap: 9px;
}

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

.field-grid.three {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.preset-row button {
  min-height: 31px;
  padding: 0 9px;
  font-size: 0.74rem;
}

.mix-status {
  min-height: 17px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.mix-status.ok {
  color: var(--teal);
}

.mix-status.warn {
  color: var(--rose);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin: 9px 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7f5;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: grid;
  min-height: 30px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  cursor: pointer;
}

.segmented input:checked + span {
  background: var(--forest);
  color: #fff;
}

.advanced summary {
  margin-bottom: 10px;
  cursor: pointer;
}

.helper-text {
  margin: -2px 0 9px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.38;
}

.crop-plan-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}

.crop-plan-toolbar button {
  padding: 0 9px;
}

.capacity-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 9px;
}

.capacity-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.capacity-card.full {
  border-color: rgba(15, 124, 128, 0.4);
  background: #eef8f7;
}

.capacity-card.over {
  border-color: rgba(169, 70, 53, 0.48);
  background: #fff1ee;
}

.capacity-card header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.capacity-card strong {
  font-size: 0.8rem;
}

.capacity-badge {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 999px;
  background: #edf3ef;
  color: var(--forest);
  font-size: 0.66rem;
  font-weight: 850;
}

.capacity-card.full .capacity-badge {
  background: #d7efeb;
  color: #0f6468;
}

.capacity-card.over .capacity-badge {
  background: #f7d8d0;
  color: var(--rose);
}

.capacity-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3ef;
}

.capacity-meter span {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  border-radius: inherit;
  background: var(--forest);
}

.capacity-card.full .capacity-meter span {
  background: var(--teal);
}

.capacity-card.over .capacity-meter span {
  background: var(--rose);
}

.capacity-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.crop-plan-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.crop-plan-table {
  min-width: 880px;
  font-size: 0.76rem;
}

.crop-plan-table th,
.crop-plan-table td {
  padding: 5px;
}

.crop-plan-table input,
.crop-plan-table select {
  min-height: 29px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.crop-plan-table input[type="text"] {
  min-width: 125px;
}

.crop-plan-table input[type="number"] {
  width: 68px;
}

.crop-plan-table input[data-format="thousand"] {
  width: 88px;
  min-width: 88px;
}

.crop-plan-table .remove-crop {
  min-height: 29px;
  width: 29px;
  border-radius: 6px;
  background: #f6e9e6;
  color: var(--rose);
  font-weight: 900;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 24, 19, 0.52);
}

.modal-card {
  width: min(640px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(15, 30, 24, 0.22);
}

.modal-head {
  display: flex;
  gap: 10px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-head h2 {
  font-size: 1.15rem;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #edf3ef;
  color: var(--forest);
  font-weight: 900;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.modal-actions .primary,
.modal-actions .secondary {
  padding: 0 16px;
}

.page-head {
  display: flex;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.page-head .secondary,
.page-head .primary {
  padding: 0 11px;
  white-space: nowrap;
}

.visual-strip {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  box-shadow: var(--shadow);
}

.visual-strip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 24, 19, 0.78), rgba(11, 24, 19, 0.08)),
    linear-gradient(0deg, rgba(11, 24, 19, 0.22), rgba(11, 24, 19, 0));
}

.visual-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-height: 180px;
  max-width: 440px;
  padding: 20px;
  color: #fff;
}

.visual-copy span {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.68rem;
  font-weight: 850;
}

.visual-copy strong {
  margin-top: 9px;
  font-size: clamp(1.6rem, 4.2vw, 3.2rem);
  line-height: 0.96;
}

.visual-copy small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 750;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.kpi {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.kpi span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
}

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.05;
}

.kpi small {
  display: block;
  margin-top: 4px;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(0, 1.32fr);
  gap: 12px;
}

.summary-block,
.data-section,
.notes-section {
  padding: 12px;
}

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

.section-heading h2 {
  flex: 1;
  text-align: right;
  font-size: 0.88rem;
}

.metrics-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.metrics-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: baseline;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.metrics-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

dd {
  margin: 0;
  font-weight: 850;
  text-align: right;
}

canvas {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f8fbfa);
}

.table-wrap {
  overflow: auto;
}

.table-wrap.tall {
  max-height: 560px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th,
td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr.warning {
  color: var(--rose);
}

.notes-section {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
}

.notes-section p {
  margin-bottom: 0;
}

.report-page #reportContent {
  display: grid;
  gap: 12px;
}

.report-controls {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.module-picker label {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 800;
}

.module-picker input {
  width: 14px;
  min-height: 14px;
}

.report-actions {
  display: flex;
  gap: 6px;
}

.report-actions button {
  padding: 0 9px;
}

.report-sheet {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.report-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-logo {
  width: 118px;
  height: auto;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.report-card {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-card span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.report-card strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.proposal-page #proposalContent {
  display: grid;
  gap: 12px;
}

.proposal-cover {
  gap: 12px;
}

.proposal-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.proposal-brand .report-logo {
  width: 140px;
}

.proposal-hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: 8px;
  background: #102019;
}

.proposal-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proposal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 28, 21, 0.88), rgba(13, 28, 21, 0.24));
}

.proposal-hero div {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  max-width: 560px;
  min-height: 260px;
  padding: 28px;
  color: #fff;
}

.proposal-hero span {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.72rem;
  font-weight: 850;
}

.proposal-hero strong {
  margin-top: 12px;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
}

.proposal-hero p,
.proposal-copy {
  margin: 10px 0 0;
  line-height: 1.45;
}

.proposal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-meta span,
.proposal-signoff span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.proposal-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.proposal-panel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-panel h3 {
  margin-bottom: 8px;
}

.proposal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.proposal-list li + li {
  margin-top: 6px;
}

.proposal-table table {
  min-width: 0;
}

.proposal-highlight {
  display: grid;
  align-content: center;
  gap: 8px;
  background: var(--mint);
}

.proposal-highlight strong {
  display: block;
  color: var(--forest);
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  line-height: 1;
}

.proposal-highlight p,
.proposal-signoff p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.proposal-steps {
  display: grid;
  gap: 8px;
}

.proposal-signoff {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 0.64fr);
  gap: 12px;
  margin-top: 4px;
}

.proposal-signoff > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-signoff strong,
.proposal-signoff small {
  display: block;
  margin-top: 4px;
}

.proposal-sheet {
  position: relative;
  overflow: hidden;
  gap: 14px;
  border-color: rgba(29, 91, 68, 0.16);
  background:
    linear-gradient(135deg, rgba(237, 245, 240, 0.9), rgba(255, 255, 255, 0) 34%),
    #fff;
}

.proposal-sheet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, var(--forest), var(--teal));
}

.proposal-sheet > * {
  position: relative;
  z-index: 1;
}

.proposal-cover-top,
.proposal-page-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.proposal-cover-top > div {
  display: grid;
  gap: 4px;
  text-align: right;
}

.proposal-cover-top span,
.proposal-cover-top strong,
.proposal-page-mark span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.proposal-cover-logo {
  width: 148px;
  height: auto;
}

.proposal-cover-main {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

.proposal-cover-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 420px;
  padding: 24px;
  border-radius: 8px;
  background: #102019;
  color: #fff;
}

.proposal-cover-copy .eyebrow {
  color: #a8d8c4;
}

.proposal-cover-copy h2 {
  max-width: 430px;
  color: #fff;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  line-height: 0.96;
}

.proposal-cover-copy p {
  max-width: 420px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.proposal-cover-photo {
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
}

.proposal-cover-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.proposal-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.proposal-kpi-strip .proposal-card {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.proposal-kpi-strip .proposal-card span,
.proposal-kpi-strip .proposal-card small {
  color: rgba(255, 255, 255, 0.72);
}

.proposal-kpi-strip .proposal-card strong {
  color: #fff;
}

.proposal-thesis {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 124, 128, 0.22);
  border-radius: 8px;
  background: #eef8f7;
}

.proposal-thesis span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.proposal-thesis p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.proposal-page-head {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.proposal-page-head h2 {
  max-width: 560px;
}

.proposal-page-mark {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.proposal-page-mark .report-logo {
  width: 98px;
}

.proposal-page-mark span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: #fff;
}

.proposal-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.proposal-stat-grid.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.proposal-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-card span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.proposal-card strong {
  display: block;
  margin-top: 6px;
  color: var(--forest);
  font-size: 1.08rem;
  line-height: 1.05;
}

.proposal-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.proposal-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.proposal-chart-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-chart-card h3 {
  margin-bottom: 8px;
  color: var(--ink);
}

.proposal-chart {
  display: block;
  width: 100%;
  height: auto;
}

.proposal-chart-title {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.proposal-chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.proposal-chart-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.proposal-callout {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
}

.proposal-callout strong {
  font-size: 1.45rem;
  line-height: 1;
}

.proposal-callout p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.proposal-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.proposal-timeline div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.proposal-timeline span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--forest);
  font-weight: 900;
}

.proposal-timeline strong {
  display: block;
  margin-bottom: 6px;
}

.proposal-timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

  .top-print,
  .top-actions {
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .input-layout,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .input-hero {
    position: static;
  }

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

  .report-controls {
    grid-template-columns: 1fr;
  }

  .proposal-cover-main,
  .proposal-chart-grid,
  .proposal-two-col,
  .proposal-signoff {
    grid-template-columns: 1fr;
  }

  .proposal-stat-grid,
  .proposal-stat-grid.compact,
  .proposal-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .app-shell {
    padding: 8px;
  }

  .topbar,
  .page-head {
    padding: 9px;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-items: center;
  }

  .topbar .brand-row {
    grid-area: brand;
  }

  .topbar .nav-tabs {
    grid-area: nav;
  }

  .topbar .top-actions {
    grid-area: actions;
    display: flex;
    width: auto;
  }

  .topbar .top-actions .secondary,
  .topbar .top-actions .primary {
    min-height: 31px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .field-grid.two,
  .field-grid.three,
  .action-row,
  .capacity-status,
  .kpi-grid,
  .report-grid,
  .top-actions {
    grid-template-columns: 1fr;
  }

  .input-card,
  .summary-block,
  .data-section,
  .notes-section,
  .report-sheet {
    padding: 10px;
  }

  input,
  select {
    font-size: 16px;
  }

  .input-hero img {
    height: 130px;
  }

  .visual-strip,
  .visual-copy {
    min-height: 150px;
  }

  .visual-copy {
    padding: 14px;
  }

  .page-head,
  .section-heading,
  .report-logo-row,
  .proposal-brand {
    display: grid;
    align-items: start;
  }

  .proposal-hero,
  .proposal-hero div {
    min-height: 210px;
  }

  .proposal-hero div {
    padding: 16px;
  }

  .proposal-kpi-strip,
  .proposal-stat-grid,
  .proposal-stat-grid.compact,
  .proposal-timeline,
  .proposal-callout {
    grid-template-columns: 1fr;
  }

  .section-heading h2 {
    text-align: left;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  body {
    background: #fff;
    font-size: 10pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .no-print,
  .topbar,
  .page-head.no-print,
  button {
    display: none !important;
  }

  .app-shell {
    width: 100%;
    padding: 0;
  }

  .page {
    display: none !important;
  }

  .page.active {
    display: grid !important;
    gap: 12px;
  }

  .page-head,
  .input-card,
  .input-hero,
  .summary-block,
  .data-section,
  .notes-section,
  .kpi,
  .report-sheet {
    box-shadow: none;
    break-inside: avoid;
  }

  .visual-strip {
    min-height: 180px;
    break-inside: avoid;
  }

  .visual-copy {
    min-height: 180px;
  }

  .table-wrap,
  .table-wrap.tall {
    max-height: none;
    overflow: visible;
  }

  table {
    min-width: 0;
    font-size: 8.5pt;
  }

  th,
  td {
    padding: 5px 4px;
  }

  canvas {
    max-height: 220px;
  }

  .report-sheet {
    page-break-after: always;
  }

  .report-sheet:last-child {
    page-break-after: auto;
  }

  .proposal-page.active {
    display: block !important;
  }

  .proposal-page #proposalContent {
    display: block;
    gap: 0;
  }

  .proposal-page .proposal-sheet {
    width: 100%;
    min-height: 277mm;
    margin: 0;
    padding: 8mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 8px;
    page-break-after: always;
    break-after: page;
  }

  .proposal-page .proposal-sheet:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .proposal-cover-copy,
  .proposal-cover-photo {
    min-height: 0;
    height: 90mm;
  }

  .proposal-cover-copy h2 {
    font-size: 30pt;
  }

  .proposal-cover-logo {
    width: 34mm;
  }

  .proposal-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .proposal-stat-grid.compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .proposal-chart-grid,
  .proposal-two-col,
  .proposal-signoff {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proposal-timeline {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .proposal-card,
  .proposal-panel,
  .proposal-chart-card,
  .proposal-timeline div,
  .proposal-signoff > div {
    break-inside: avoid;
  }

  .proposal-chart-card {
    padding: 5mm;
  }

  .proposal-chart-title {
    font-size: 14px;
  }

  .proposal-chart-label,
  .proposal-chart-value {
    font-size: 11px;
  }
}
