:root {
  --ink: #17201b;
  --muted: #56655f;
  --line: #cbd7d1;
  --page: #dfe8e2;
  --paper: #f8f7f2;
  --panel: #f1f4ef;
  --wash: #e6eee8;
  --green: #1d7d5a;
  --green-dark: #14583f;
  --gold: #c8912e;
  --coral: #c95543;
  --blue: #315f8f;
  --shadow: 0 24px 70px rgba(23, 32, 27, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

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

.topbar {
  align-items: center;
  background: rgba(248, 247, 242, 0.92);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  min-height: 68px;
  padding: 14px clamp(18px, 4vw, 54px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(217, 164, 65, 0.95) 0 31%, transparent 31% 100%),
    linear-gradient(90deg, transparent 0 68%, rgba(29, 125, 90, 0.95) 68% 100%),
    var(--ink);
  border-radius: 7px;
  color: white;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  letter-spacing: 0;
  position: relative;
  width: 48px;
}

.brand-mark::after {
  background: rgba(255, 255, 255, 0.72);
  content: "";
  height: 2px;
  left: 9px;
  position: absolute;
  top: 27px;
  width: 30px;
}

.brand-mark span {
  font-size: 0.72rem;
  font-weight: 950;
  position: relative;
  z-index: 1;
}

.brand-name {
  font-size: 1.03rem;
  letter-spacing: 0;
}

.nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  padding: 9px 11px;
}

.nav a:hover {
  background: var(--wash);
  color: var(--ink);
}

.hero {
  display: grid;
  gap: clamp(26px, 4vw, 54px);
  grid-template-columns: minmax(280px, 0.68fr) minmax(320px, 1.32fr);
  min-height: calc(100vh - 68px);
  padding: clamp(28px, 5vw, 74px) clamp(18px, 4vw, 54px) 42px;
}

.hero-copy {
  align-self: start;
  padding-top: clamp(8px, 4vw, 54px);
  position: sticky;
  top: 94px;
}

.eyebrow {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(2.55rem, 6vw, 5.4rem);
  line-height: 0.96;
  margin-bottom: 20px;
  max-width: 720px;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.03;
  margin-bottom: 10px;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 560px;
}

.tool-page-hero {
  padding: clamp(42px, 7vw, 92px) clamp(18px, 4vw, 54px) 28px;
}

.tool-page-hero h1 {
  max-width: 840px;
}

.tool-page-hero p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 720px;
}

.hero-actions,
.submit-row,
.form-actions,
.section-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.icon-button {
  align-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 44px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
  padding: 12px 16px;
}

.button.primary {
  background: var(--green);
  box-shadow: 0 10px 22px rgba(29, 125, 90, 0.22);
  color: white;
}

.button.primary:hover,
.button.small:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.button.ghost {
  background: var(--wash);
  color: var(--ink);
}

.button.small {
  background: var(--ink);
  color: white;
  min-height: 38px;
  padding: 8px 12px;
}

.icon-button {
  background: var(--wash);
  color: var(--ink);
  height: 42px;
  width: 42px;
}

.icon-button:hover,
.button.ghost:hover {
  background: #e9efec;
}

.bol-panel,
.preview-section,
.tools-band {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.bol-panel {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 3vw, 30px);
}

.panel-header,
.section-title {
  justify-content: space-between;
}

.panel-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  padding-bottom: 14px;
}

.panel-header h2 {
  margin: 0;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px;
}

.optional-section {
  background: #fbfaf5;
}

.field-help {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
}

.form-section {
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 0;
}

.form-section summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.95rem;
  font-weight: 950;
  justify-content: space-between;
  list-style: none;
  padding: 15px 16px;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary::after {
  color: var(--green);
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
}

.form-section[open] summary {
  border-bottom: 1px solid var(--line);
}

.form-section[open] summary::after {
  content: "-";
}

.form-section > :not(summary) {
  margin: 0 16px 16px;
}

.mini-fieldset {
  padding: 12px;
}

.mini-fieldset legend {
  font-size: 0.82rem;
}

legend {
  color: var(--ink);
  font-weight: 900;
  padding: 0 6px;
}

.logo-row,
.form-grid,
.field-row {
  display: grid;
  gap: 14px;
}

.logo-row {
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(150px, 0.8fr);
}

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

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

.field-row {
  grid-template-columns: 1fr 112px 112px;
}

.field-row .field:not(.short) {
  min-width: 0;
}

.field {
  display: grid;
  gap: 6px;
  position: relative;
}

label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

input,
textarea {
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29, 125, 90, 0.12);
}

.places-suggestions {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 18px 45px rgba(23, 32, 27, 0.18);
  display: none;
  left: 0;
  margin-top: 70px;
  overflow: hidden;
  position: absolute;
  right: 0;
  z-index: 30;
}

.places-suggestions.is-open {
  display: block;
}

.places-option {
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: block;
  font-weight: 750;
  line-height: 1.25;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.places-option:hover,
.places-option.is-active {
  background: var(--wash);
}

.places-option span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 3px;
}

.places-attribution {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 7px 12px;
  text-align: right;
}

.logo-drop {
  align-items: center;
  background: var(--panel);
  border: 1px dashed #aebbb4;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 9px;
  justify-items: center;
  min-height: 96px;
  padding: 12px;
  text-align: center;
}

.logo-drop input {
  display: none;
}

.logo-preview {
  align-items: center;
  background: #fffcf4;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: flex;
  font-weight: 900;
  height: 48px;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
  width: 96px;
}

.logo-preview img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.line-items {
  display: grid;
  gap: 10px;
}

.line-items-head,
.line-item {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 64px 84px 96px 84px 94px minmax(190px, 1fr) 42px;
}

.line-items-head {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0 4px;
  text-transform: uppercase;
}

.line-items-list {
  display: grid;
  gap: 8px;
}

.remove-line {
  background: #f8ecea;
  color: #8c281b;
}

.checks,
.checklist {
  display: grid;
  gap: 10px;
}

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

.checks label,
.checklist label,
.toggle-line {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 8px;
  min-height: 34px;
}

input[type="checkbox"] {
  accent-color: var(--green);
  flex: 0 0 auto;
  min-height: auto;
  width: 18px;
}

.legal-note {
  background: #fff8ea;
  border: 1px solid #efd49a;
  border-radius: 8px;
  color: #69470c;
  font-size: 0.91rem;
  padding: 12px 14px;
}

.submit-row {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  padding-top: 16px;
}

.preview-section,
.tools-band {
  margin: 0 clamp(18px, 4vw, 54px) 42px;
  padding: clamp(18px, 4vw, 36px);
}

.section-heading {
  margin-bottom: 20px;
  max-width: 760px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 10px 0 0;
}

.preview-heading {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
}

.preview-heading .section-heading {
  margin-bottom: 0;
}

.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

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

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

.tool-card {
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.tool-card:nth-child(1) {
  border-top: 4px solid var(--green);
}

.tool-card:nth-child(2) {
  border-top: 4px solid var(--blue);
}

.tool-card:nth-child(3) {
  border-top: 4px solid var(--coral);
}

.fsc-card {
  grid-column: 1 / -1;
}

.tool-card .field-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card:nth-child(3) .field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.mini-calc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mini-calc h4 {
  font-size: 0.95rem;
  margin: 0;
}

.compact-result {
  min-height: 54px;
}

.result-box {
  align-content: center;
  background: linear-gradient(180deg, #f4f8f5 0%, #e7efe9 100%);
  border: 1px solid #bfcec6;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 72px;
  padding: 14px;
  text-align: center;
}

.result-box strong {
  font-size: 1.18rem;
  font-weight: 950;
  line-height: 1.15;
}

.result-box span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.result-box .result-eyebrow {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.accessorial-summary {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  margin-top: 4px;
  padding-top: 14px;
}

.accessorial-summary strong {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.accessorial-summary span {
  color: var(--muted);
  font-weight: 800;
}

.accessorial-summary textarea {
  min-height: 76px;
  resize: none;
}

.footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 54px);
}

.footer a {
  color: var(--green);
  font-weight: 900;
}

.bol-preview-sheet {
  background: white;
  border: 1px solid #cfd8d2;
  box-shadow: 0 18px 44px rgba(23, 32, 27, 0.16);
  color: #111;
  margin-inline: auto;
  min-height: 11in;
  padding: 0;
  width: min(100%, 8.5in);
}

.print-root {
  display: none;
}

.print-bol {
  background: white;
  color: #111;
  display: flex;
  flex-direction: column;
  font-family: "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: 10px;
  line-height: 1.15;
  min-height: 11in;
  padding: 0.28in;
  text-transform: none;
}

.print-bol h1,
.print-bol h2,
.print-bol h3,
.print-bol p {
  margin: 0;
}

.bol-title-row {
  align-items: center;
  border: 1.5px solid #111;
  display: grid;
  grid-template-columns: 1.25fr 2fr 1fr;
  min-height: 48px;
}

.bol-title-row > * {
  padding: 5px 7px;
}

.bol-logo-cell {
  align-items: center;
  display: flex;
  min-height: 50px;
}

.bol-logo-cell img {
  max-height: 46px;
  max-width: 185px;
  object-fit: contain;
}

.bol-title-row h1 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-align: center;
}

.bol-title-row div:last-child {
  text-align: right;
}

.bol-top-grid {
  border-left: 1.5px solid #111;
  border-right: 1.5px solid #111;
  display: grid;
  grid-template-columns: 1.1fr 0.95fr;
}

.bol-top-grid > div:first-child {
  border-right: 1.5px solid #111;
}

.bol-bar {
  background: #050505;
  color: white;
  font-weight: 900;
  letter-spacing: 0.7px;
  line-height: 1.1;
  padding: 4px 6px;
  text-align: center;
}

.bol-party,
.bol-special,
.bol-number-box,
.bol-carrier-box,
.bol-terms-box,
.bol-services-box {
  border-bottom: 1.5px solid #111;
}

.bol-party-lines,
.bol-special,
.bol-number-box,
.bol-carrier-box,
.bol-terms-box,
.bol-services-box {
  padding: 6px 7px;
}

.bol-party-lines {
  min-height: 76px;
}

.bol-party-lines p,
.bol-carrier-box p {
  font-size: 13px;
  margin: 0 0 5px;
}

.bill-to .bol-party-lines {
  min-height: 62px;
}

.bol-special {
  min-height: 58px;
}

.bol-number-box {
  min-height: 106px;
}

.bol-number-box > div:first-child {
  font-size: 13px;
  margin: 4px 0 24px;
}

.barcode-space {
  color: #b8b8b8;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 8px;
  text-align: center;
}

.barcode-space.smaller {
  font-size: 17px;
  margin-top: 22px;
}

.bol-carrier-box {
  min-height: 132px;
}

.bol-terms-box {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 1.1fr repeat(3, auto);
  min-height: 42px;
}

.bol-services-box {
  min-height: 42px;
}

.checkbox {
  border: 1.5px solid #111;
  display: inline-flex;
  font-size: 10px;
  height: 12px;
  justify-content: center;
  line-height: 10px;
  margin-left: 4px;
  vertical-align: -1px;
  width: 12px;
}

.bol-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.bol-table th,
.bol-table td {
  border: 1px solid #222;
  height: 19px;
  overflow: hidden;
  padding: 3px 5px;
  text-align: left;
  vertical-align: middle;
}

.bol-table th {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.bol-table th.bol-bar {
  border-left: 1.5px solid #111;
  border-right: 1.5px solid #111;
  color: white;
  text-align: center;
}

.bol-table .subhead th {
  font-size: 9px;
  height: 13px;
  padding: 1px 4px;
}

.bol-table tfoot td {
  font-size: 12px;
  font-weight: 900;
}

.customer-table th:nth-child(1),
.customer-table td:nth-child(1) {
  width: 28%;
}

.customer-table th:nth-child(2),
.customer-table td:nth-child(2) {
  width: 9%;
}

.customer-table th:nth-child(3),
.customer-table td:nth-child(3) {
  width: 10%;
}

.customer-table th:nth-child(4),
.customer-table td:nth-child(4),
.customer-table th:nth-child(5),
.customer-table td:nth-child(5) {
  width: 6%;
}

.commodity-table {
  flex: 1 1 auto;
}

.commodity-table th:nth-child(7),
.commodity-table td:nth-child(7) {
  width: 38%;
}

.center {
  text-align: center !important;
}

.bol-footer {
  border: 1.5px solid #111;
  border-top: 0;
  margin-top: auto;
}

.bol-cod-row {
  align-items: center;
  border-bottom: 1.5px solid #111;
  display: grid;
  gap: 8px;
  grid-template-columns: auto 1fr auto auto auto auto;
  min-height: 27px;
  padding: 4px 7px;
}

.bol-liability {
  border-bottom: 1.5px solid #111;
  font-family: Arial, sans-serif;
  font-size: 10px;
  padding: 5px 7px;
}

.bol-signature-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.25fr;
}

.bol-signature-grid > div {
  border-right: 1.5px solid #111;
  min-height: 78px;
  padding: 6px 7px;
}

.bol-signature-grid > div:last-child {
  border-right: 0;
}

.bol-signature-grid strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.bol-signature-grid p {
  font-family: Arial, sans-serif;
  font-size: 9px;
  margin: 0 0 4px;
}

.signature-rule {
  border-bottom: 1.5px solid #111;
  margin-top: 18px;
}

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

  .hero-copy {
    position: static;
  }

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding-top: 24px;
  }

  .logo-row,
  .form-grid.two,
  .form-grid.three,
  .field-row,
  .tool-grid,
  .tool-card .field-row,
  .tool-card:nth-child(3) .field-row,
  .checklist,
  .print-header,
  .print-grid.two,
  .print-grid.three,
  .print-signatures {
    grid-template-columns: 1fr;
  }

  .line-items-head {
    display: none;
  }

  .line-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
  }

  .line-item .field.description,
  .line-item .remove-line {
    grid-column: 1 / -1;
  }

  .checks.compact {
    grid-template-columns: 1fr;
  }

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

  .accessorial-summary {
    grid-template-columns: 1fr;
  }

  .preview-heading {
    flex-direction: column;
  }

  .submit-row {
    justify-content: stretch;
  }

  .submit-row .button {
    width: 100%;
  }
}

@media print {
  @page {
    margin: 0.25in;
    size: letter;
  }

  html,
  body {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body > *:not(.print-root) {
    display: none !important;
  }

  .print-root {
    display: block !important;
  }

  .print-root .print-bol {
    box-sizing: border-box;
    font-size: 8.7px;
    height: 10.5in;
    line-height: 1.05;
    margin: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    width: 8in;
  }

  .print-root .bol-title-row {
    min-height: 34px;
  }

  .print-root .bol-logo-cell {
    min-height: 34px;
  }

  .print-root .bol-logo-cell img {
    max-height: 32px;
    max-width: 150px;
  }

  .print-root .bol-party-lines {
    min-height: 60px;
  }

  .print-root .bill-to .bol-party-lines {
    min-height: 46px;
  }

  .print-root .bol-special {
    min-height: 42px;
  }

  .print-root .bol-number-box {
    min-height: 86px;
  }

  .print-root .bol-carrier-box {
    min-height: 106px;
  }

  .print-root .bol-table th,
  .print-root .bol-table td {
    height: 14px;
    padding: 1.5px 3px;
  }

  .print-root .bol-table th {
    font-size: 8.2px;
  }

  .print-root .bol-table .subhead th {
    font-size: 7.4px;
    height: 9px;
  }

  .print-root .bol-table tfoot td {
    font-size: 9px;
  }

  .print-root .bol-signature-grid > div {
    min-height: 58px;
  }

  .print-root .bol-liability {
    font-size: 8px;
  }

  .print-root .bol-cod-row {
    min-height: 20px;
    padding: 2px 4px;
  }

  .print-root .bol-signature-grid strong {
    font-size: 9px;
  }

  .print-root .bol-signature-grid p {
    font-size: 7.2px;
  }
}
