/* =========================================================
   Budget Amendment Request — Stylesheet
   Plain CSS3, no frameworks. Mobile-first with breakpoints
   for tablet (600px) and desktop (900px).

   Palette/typography match budget-waltoncountyfl.com (Walton
   County's official brand green/gold, Arial/Helvetica body
   text, Georgia serif reserved for the page title only).
   ========================================================= */

:root {
  --color-green: #006231;
  --color-green-2: #0b7741;
  --color-green-3: #003f28;
  --color-gold: #d1be78;
  --color-gold-2: #f1dc94;

  --color-bg: #ffffff;
  --color-page-bg: #f6f8f5;
  --color-soft: #f6f8f5;
  --color-border: #d6dbdc;
  --color-line: rgba(23, 32, 51, 0.11);

  --color-ink: #172033;
  --color-muted: #607184;

  --color-red: #b91c1c;
  --color-red-bg: #fef2f2;
  --color-red-border: #fca5a5;

  --color-green-bg: rgba(0, 98, 49, 0.08);
  --color-green-border: rgba(0, 98, 49, 0.3);

  --color-amber: #92400e;
  --color-amber-bg: #fffbeb;
  --color-amber-border: #fcd34d;

  --radius: 18px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 12px 32px rgba(23, 32, 51, 0.1);
  --font-body: Arial, Helvetica, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: auto;
}

body {
  background:
    radial-gradient(circle at top left, rgba(209, 190, 120, 0.14), transparent 34rem),
    linear-gradient(180deg, #fbfcfa 0%, #f3f7f1 45%, #ffffff 100%);
  background-repeat: no-repeat;
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
}

/* ---------- Site header ---------- */

.site-header {
  background: linear-gradient(180deg, rgba(0, 62, 40, 0.96), rgba(0, 62, 40, 0.88));
  color: #ffffff;
  min-height: 88px;
  padding: 22px clamp(22px, 4vw, 64px) 14px;
}

.header-inner {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 52px;
  min-width: 284px;
  color: #ffffff;
  text-decoration: none;
}

.brand-seal {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--color-gold);
  overflow: hidden;
}

.brand-seal img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0;
}

.brand-top {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 800;
  /* Tuned (not computed) so "WALTON COUNTY" renders the same width as
     "BOARD OF COUNTY COMMISSIONERS" below it at this font-size — a
     static replacement for a runtime letter-spacing calc that used to
     cause a visible flash on load (see js/nav.js history). */
  letter-spacing: 2.73px;
  text-transform: uppercase;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap;
}

.brand-bottom {
  display: block;
  margin-top: 3px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10.588235px;
  line-height: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

/* ---------- Site navigation (rendered by js/nav.js) ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-gold);
}

.nav-menu-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
}

.nav-menu-toggle { display: none; }

.nav-menu-toggle span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.nav-menu-toggle span:first-child { transform: translate(-50%, calc(-50% - 6px)); }
.nav-menu-toggle span:last-child { transform: translate(-50%, calc(-50% + 6px)); }

.portal-page-heading { margin: 4px 0 32px; }
.portal-page-heading .page-eyebrow {
  margin-bottom: 14px;
  color: var(--color-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.portal-page-heading h1 {
  color: #24344d;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
}

.portal-page-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

@media (max-width: 860px) {
  .header-inner { display: flex; flex-wrap: wrap; justify-content: space-between; }
  .brand { min-width: 0; }
  .nav-menu-toggle { display: inline-flex; flex: 0 0 40px; }
  .site-nav {
    order: 5;
    flex: 1 0 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
  }
  .site-header.is-menu-open .site-nav { display: flex; }
  .site-nav a {
    justify-content: flex-start;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
  }
}

/* ---------- Landing page ---------- */

.hero {
  text-align: center;
  padding: 1rem 0 2rem;
}

.hero h1 {
  font-weight: 800;
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: #24344d;
  margin-bottom: 0.6rem;
}

.hero p {
  color: var(--color-muted);
  font-size: 1.05rem;
  margin: 0;
}

/* auto-fit + minmax scales to however many cards js/landing.js renders —
   two side by side today, three or four wrapping into extra columns/rows
   automatically later, with no breakpoint to hand-tune per card count. */
.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.landing-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  padding: 2rem 1.5rem;
}

.landing-card h2 {
  font-weight: 800;
  font-size: 1.25rem;
  color: #24344d;
  margin-bottom: 0.75rem;
}

.landing-card p {
  color: var(--color-muted);
  flex-grow: 1;
  margin: 0 0 1.5rem;
}

.landing-card .btn {
  align-self: center;
}

.coming-soon {
  color: var(--color-muted);
  text-align: center;
  padding: 2rem 0;
}

/* ---------- Page layout ---------- */

.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem) 3rem;
}

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  /* No overflow: hidden here — combobox dropdowns inside .card-body are
     absolutely positioned and need to render past the card's own bounds.
     .section-title gets its own top corner radius below instead. */
}

.section-title {
  background: var(--color-soft);
  border-bottom: 1px solid var(--color-line);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  color: var(--color-ink);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
}

.card-body {
  padding: 1.25rem;
}

/* ---------- Grid helpers ---------- */

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

.tables-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

/* Grid items default to min-width:auto, so a wide .transfer-table (its own
   overflow-x:auto notwithstanding) was forcing these cards past the 1fr
   track and out of alignment with the single-column cards above. */
.tables-grid > .card {
  min-width: 0;
}

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

/* Higher than the .page max-width (1140px) would suggest, because each
   card needs room for the .transfer-table's own 460px min-width plus
   card-body padding before splitting into two columns — otherwise the
   Amount column gets condensed/clipped and the table falls back to its
   own internal horizontal scroll. */
@media (min-width: 1150px) {
  .tables-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Form fields ---------- */

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 0.35rem;
}

.required {
  color: var(--color-red);
}

input[type="text"],
input[type="date"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--color-ink);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Native <select> chrome (the OS-drawn dropdown arrow/height) otherwise
   looks nothing like the plain text inputs and searchable comboboxes
   (Department, Expense Account) sitting right next to it — this makes a
   plain <select> like Activity of the Grant read as the same kind of
   field instead of a visibly different browser widget. */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23607184' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 0.85rem;
}

select:disabled {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a7b0bb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-green);
  box-shadow: 0 0 0 3px rgba(0, 98, 49, 0.15);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--color-red-border);
  background: var(--color-red-bg);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--color-soft);
  color: var(--color-muted);
  cursor: not-allowed;
}

.error-text {
  color: var(--color-red);
  font-size: 0.8rem;
  margin: 0.3rem 0 0;
  min-height: 1em;
}

.error-text:empty {
  display: none;
}

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

/* ---------- Amendment type radio group ---------- */

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.radio-option:hover {
  background: var(--color-soft);
}

.radio-option input[type="radio"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-green);
  flex-shrink: 0;
}

.radio-option:has(input:checked),
.radio-option.is-checked {
  border-color: var(--color-green-border);
  background: var(--color-green-bg);
}

.radio-option .statute {
  color: var(--color-muted);
  font-weight: 400;
}

.radio-option small {
  display: block;
  color: var(--color-muted);
  font-weight: 400;
  margin-top: 0.15rem;
}

/* ---------- Certification checkbox (mirrors .radio-option) ---------- */

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.checkbox-field:hover {
  background: var(--color-soft);
}

.checkbox-field input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-green);
  flex-shrink: 0;
}

.checkbox-field:has(input:checked) {
  border-color: var(--color-green-border);
  background: var(--color-green-bg);
}

.checkbox-field span {
  font-size: 0.9rem;
}

/* ---------- Repeatable rollforward line items (rollforward.html) ---------- */

.rollforward-line {
  background: var(--color-soft);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
}

.rollforward-line:last-of-type {
  margin-bottom: 1rem;
}

.rollforward-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.rollforward-line-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-green-3);
}

/* ---------- Searchable comboboxes (department + account) ---------- */

.combobox {
  position: relative;
}

.combobox input[type="text"] {
  padding-right: 2.25rem;
}

.combobox-clear {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
}

.combobox-clear:hover {
  background: var(--color-soft);
  color: var(--color-ink);
}

/* position/top/left/width are set inline by accountSearch.js, computed
   from the input's actual on-screen position each time it opens — the
   listbox is re-parented onto <body> so no ancestor's overflow can clip
   it (see accountSearch.js's positionListbox()). */
.combobox-listbox {
  position: fixed;
  z-index: 1000;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.14);
}

.combobox-listbox[hidden] {
  display: none;
}

.combobox-group-label {
  padding: 0.4rem 0.6rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.combobox-option {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.combobox-option-label {
  font-size: 0.9rem;
  color: var(--color-ink);
}

.combobox-option-sublabel {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.combobox-option:hover,
.combobox-option.is-active {
  background: var(--color-green-bg);
}

.combobox-empty {
  padding: 0.6rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.department-field {
  margin-bottom: 0;
}

.account-cell {
  min-width: 220px;
}

.project-cell {
  min-width: 90px;
}

.project-input {
  width: 100%;
}

/* ---------- Transfer tables ---------- */

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

.transfer-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 460px;
}

.transfer-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  padding: 0 0 0.4rem;
}

.transfer-table td {
  padding: 0.3rem 0.4rem 0.3rem 0;
  vertical-align: top;
}

.transfer-table td:first-child {
  padding-left: 0;
}

.remove-row-btn {
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-muted);
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.remove-row-btn:hover:not(:disabled) {
  background: var(--color-red-bg);
  color: var(--color-red);
  border-color: var(--color-red-border);
}

.remove-row-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.add-row-btn {
  margin-top: 0.5rem;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-line);
  font-weight: 700;
}

.total-row span:last-child {
  font-size: 1.05rem;
}

/* ---------- Grant Amendment auto-filled account preview ---------- */

.account-preview {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.account-preview:last-child {
  margin-bottom: 0;
}

.account-preview-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin-bottom: 0.35rem;
}

.account-preview-number {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-ink);
}

.account-preview-desc {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
  min-height: 1.2em;
}

.account-preview-amount {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-line);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-green);
  border-color: var(--color-green);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--color-green-3);
  border-color: var(--color-green-3);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--color-line);
  color: var(--color-ink);
}

.btn-secondary:hover {
  background: var(--color-soft);
}

.btn-danger {
  background: #ffffff;
  border-color: var(--color-red-border);
  color: var(--color-red);
}

.btn-danger:hover {
  background: var(--color-red-bg);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-green);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  min-height: auto;
}

.btn-ghost:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ---------- Banners ---------- */

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #ffffff;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.banner[hidden] {
  display: none;
}

.banner-warning {
  background: var(--color-amber-bg);
  border-color: var(--color-amber-border);
  color: var(--color-amber);
}

.banner-success {
  background: var(--color-green-bg);
  border-color: var(--color-green-border);
  color: var(--color-green-3);
}

.banner-error {
  background: var(--color-red-bg);
  border-color: var(--color-red-border);
  color: var(--color-red);
}

.banner-info {
  background: var(--color-soft);
  border-color: var(--color-line);
  color: var(--color-muted);
}

.banner-actions {
  display: flex;
  gap: 0.5rem;
}

/* ---------- Submission confirmation modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(23, 32, 51, 0.55);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-dialog {
  width: 100%;
  max-width: 26rem;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(23, 32, 51, 0.35);
  padding: 1.5rem;
}

.modal-dialog h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--color-green-3);
  margin-bottom: 0.75rem;
}

.modal-dialog p {
  margin: 0 0 1.25rem;
  color: var(--color-ink);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* ---------- Print view ----------
   A separate, compact clerical entry view — see #printView in index.html
   and populatePrintView() in app.js. Deliberately not just a trimmed-down
   copy of the on-screen form: only filled-in account lines print, and
   there's no interactive chrome to work around. */

.print-only {
  display: none;
}

.print-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.print-seal {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: contain;
  margin-top: 0.15rem;
}

.print-header h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--color-green-3);
  margin-bottom: 0.5rem;
}

.print-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.print-field-label {
  font-weight: 700;
  color: var(--color-green-3);
}

.print-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.print-tables h2 {
  font-size: 0.95rem;
  color: var(--color-green-3);
  margin: 0 0 0.4rem;
}

.print-table {
  width: 100%;
  /* Fixed layout + matching <colgroup> widths on both tables (see
     index.html) so Transfer From/To render with identical column
     proportions instead of each auto-sizing to its own content — that's
     what was making the two tables wrap and end up different heights. */
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.print-table th {
  background: var(--color-soft);
}

.print-table th,
.print-table td {
  border: 1px solid #999999;
  padding: 0.3rem 0.4rem;
  text-align: left;
  vertical-align: top;
  word-wrap: break-word;
}

.print-table th:last-child,
.print-table td:last-child {
  text-align: right;
  /* Amount must never wrap mid-number (e.g. "$100,000" / ".00" splitting
     across lines) — only the Description column should wrap. */
  white-space: nowrap;
}

.print-total {
  margin-top: 0.35rem;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: right;
  color: var(--color-green-3);
}

/* Rollforward's print view — one bordered block per line (see
   rollforward.html's #printLines) instead of Transfer's side-by-side
   tables, since Justification needs full-width room to read. Mirrors
   Code.gs's buildRollforwardPdf() .rf-line block. */
.print-rf-line {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  margin-top: 0.6rem;
}

.print-rf-line h2 {
  font-size: 0.9rem;
  color: var(--color-green-3);
  margin: 0 0 0.3rem;
}

.print-justification {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
}

/* Grant Resolution — a dynamic version of the county's standard
   resolution letterhead (see grant.html's #resolutionPrintView and
   js/grant.js's populateResolutionView()). The source template is set
   entirely in a serif face (not the app's Arial UI font), so the whole
   view is scoped to var(--font-serif) rather than just the headings. */

#resolutionPrintView {
  font-family: var(--font-serif);
  color: #000000;
  font-size: 11pt;
}

.resolution-letterhead-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.resolution-letterhead-title h1 {
  font-size: 14pt;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.resolution-letterhead-title h2 {
  font-size: 12pt;
  font-weight: 700;
}

.resolution-letterhead-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  font-size: 9.5pt;
  line-height: 1.35;
}

.resolution-commissioners {
  text-align: left;
}

.resolution-seal {
  width: 64px;
  height: 64px;
  object-fit: contain;
  justify-self: center;
}

.resolution-address {
  text-align: right;
}

.resolution-rule {
  margin: 0.6rem 0 0.9rem;
  border: none;
  border-top: 1px solid #000000;
}

.resolution-number {
  text-align: center;
  font-weight: 700;
  font-size: 11pt;
  margin-bottom: 0.9rem;
}

.resolution-title {
  text-align: justify;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 11pt;
  line-height: 1.5;
  margin: 0 auto 1.1rem;
  max-width: 32rem;
}

.resolution-body {
  font-size: 11pt;
  line-height: 1.6;
  text-align: justify;
  text-indent: 2.5em;
  margin-bottom: 0.9rem;
}

.resolution-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
  font-size: 11pt;
}

.resolution-sig-label {
  font-weight: 700;
  margin-bottom: 2.25rem;
}

.resolution-sig-line {
  border-top: 1px solid #000000;
  margin-bottom: 0.25rem;
}

.resolution-sig-name {
  font-size: 10.5pt;
}

@media print {
  body {
    background: #ffffff;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .site-header,
  .portal-page-heading,
  #budgetForm,
  #rollforwardForm,
  #grantForm {
    display: none !important;
  }

  /* Combobox listboxes are re-parented onto <body> when opened (see
     accountSearch.js), so they can end up outside #budgetForm — force
     them closed for print regardless of where they currently live. */
  .combobox-listbox {
    display: none !important;
  }

  .page {
    max-width: 100%;
    padding: 0.5rem 0 0;
  }
}
