/*
 * App-specific CSS on top of stockman.css (Tailwind bundle) + leaflet.css.
 * Keep in sync with application.css if that file is still updated manually.
 */

:root {
  --color-1: #fff4c1;
  --color-2: #ffc468;
  --color-3: #bc712b;
  --color-4: #4d2d18;
  --color-5: #110e10;
  --color-cream: var(--color-1);
  --color-gold: var(--color-2);
  --color-tawny: var(--color-3);
  --color-chocolate: var(--color-4);
  --color-black: var(--color-5);
  /* Table / section header chrome. */
  --color-table-header: #1f1f1f;
  --color-table-header-text: #dfdfdf;
  /* GPA section tables: accordion title scheme with a slightly darker header gray. */
  --color-gpa-section-table-header: color-mix(in srgb, var(--color-table-header) 10%, var(--color-table-header-text));
  --color-border: color-mix(in srgb, var(--color-tawny) 32%, var(--color-cream));
  --color-border-subtle: color-mix(in srgb, var(--color-tawny) 18%, var(--color-cream));
  --color-text-muted: color-mix(in srgb, var(--color-chocolate) 78%, var(--color-tawny));
  --color-hover-bg: color-mix(in srgb, var(--color-gold) 42%, var(--color-cream));
  /* Filter / search bars under the sub-menu (CRM, register, accounts, …) */
  --color-filter-bg: color-mix(in srgb, var(--color-gold) 58%, #fff);
  --color-filter-border: color-mix(in srgb, var(--color-tawny) 32%, var(--color-gold));
}

/* Trial: keep the cream/gold/chocolate brand; tinge cream with the area colour.
   Workspace home, Settings, and the root picker stay on :root cream. */
body.theme-land {
  --color-1: color-mix(in srgb, #fff4c1 82%, #3f7a3a);
  --folio-rail-base: #1e3d22;
  --folio-current-strong: #3f7a3a;
}

body.theme-work {
  --color-1: color-mix(in srgb, #fff4c1 82%, #b33a32);
  --folio-rail-base: #5c1614;
  --folio-current-strong: color-mix(in srgb, #b33a32 80%, #000);
}

body.theme-capital {
  --color-1: color-mix(in srgb, #fff4c1 82%, #2c5f94);
  --folio-rail-base: #12325a;
  --folio-current-strong: #2c5f94;
}

/* Shared surface for list/search filter bars. Prefer this named background everywhere filters appear. */
.stockman-filter-surface {
  border: 1px solid var(--color-filter-border);
  border-radius: 0.75rem;
  background: var(--color-filter-bg);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

/* Themed text inputs / selects / textareas (Capital / Work / Land via body.theme-*). */
.stockman-ui-field {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-chocolate);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-black) 6%, transparent);
}

.stockman-ui-field:focus {
  outline: none;
  border-color: var(--color-tawny);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gold) 45%, transparent);
}

.stockman-ui-field::placeholder {
  color: color-mix(in srgb, var(--color-chocolate) 42%, transparent);
}

.stockman-ui-field--emphasized {
  border-color: color-mix(in srgb, var(--color-tawny) 55%, var(--color-border));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gold) 28%, transparent);
}

.stockman-ui-field--emphasized:focus {
  border-color: var(--color-tawny);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gold) 55%, transparent);
}

.monitoring-definition-form__range {
  display: block;
  width: 100%;
  accent-color: var(--color-tawny);
}

.monitoring-photo {
  position: relative;
}

.monitoring-photo__exif {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  max-width: min(14rem, 48%);
  text-align: left;
}

.monitoring-photo__exif-summary {
  display: inline-flex;
  cursor: pointer;
  list-style: none;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.55);
  padding: 0.2rem 0.65rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  backdrop-filter: blur(4px);
}

.monitoring-photo__exif-summary::-webkit-details-marker {
  display: none;
}

.monitoring-photo__exif-summary::after {
  margin-left: 0.35rem;
  content: "▾";
  font-size: 0.6rem;
  opacity: 0.85;
}

.monitoring-photo__exif[open] .monitoring-photo__exif-summary::after {
  content: "▴";
}

.monitoring-photo__exif-body {
  margin-top: 0.35rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.62);
  padding: 0.5rem 0.65rem;
  color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
}

.monitoring-photo__exif-row + .monitoring-photo__exif-row {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.monitoring-photo__exif-row dt {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.monitoring-photo__exif-row dd {
  margin: 0.1rem 0 0;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
  color: #fff;
}

body {
  margin: 0;
  background-color: var(--color-cream);
  color: var(--color-chocolate);
}

/* Slip form tints (entry form card only): checks blue, deposits green, credits amber, debits rose.
   Recent-entries table keeps the shared .data-table zebra (#eff6ff), not these colours. */
.slip-panel--checks { background-color: #dbeafe; border-color: #60a5fa; }
.slip-panel--deposits { background-color: #dcfce7; border-color: #4ade80; }
.slip-panel--credits { background-color: #fce06e; border-color: #fbbf24; }
.slip-panel--debits { background-color: #ffe4e6; border-color: #fb7185; }

.slip-panel--partial .slip-entry-form__grid,
.slip-panel--full .slip-entry-form__grid,
.slip-panel--reconciled .slip-entry-form__grid {
  opacity: 0.72;
}

.slip-panel--partial .slip-entry-form__grid input:disabled,
.slip-panel--partial .slip-entry-form__grid textarea:disabled,
.slip-panel--partial .slip-entry-form__grid select:disabled,
.slip-panel--partial .slip-entry-form__grid [data-filterable-select-target="input"]:disabled,
.slip-panel--full .slip-entry-form__grid input:disabled,
.slip-panel--full .slip-entry-form__grid textarea:disabled,
.slip-panel--full .slip-entry-form__grid select:disabled,
.slip-panel--full .slip-entry-form__grid [data-filterable-select-target="input"]:disabled,
.slip-panel--reconciled .slip-entry-form__grid input:disabled,
.slip-panel--reconciled .slip-entry-form__grid textarea:disabled,
.slip-panel--reconciled .slip-entry-form__grid select:disabled,
.slip-panel--reconciled .slip-entry-form__grid [data-filterable-select-target="input"]:disabled {
  cursor: not-allowed;
  background-color: rgb(248 250 252 / 0.9);
  color: #475569;
}

.data-table tbody tr.slip-entries__row {
  cursor: pointer;
}

.data-table tbody tr.slip-entries__row:hover td {
  background-color: #f8fafc !important;
}

.data-table tbody tr.slip-entries__row:focus-visible td {
  background-color: #f1f5f9 !important;
  box-shadow: inset 0 0 0 2px #94a3b8;
}

.data-table tbody tr.slip-entries__row--selected {
  background-color: #fff7ed !important;
}

.data-table tbody tr.slip-entries__row--selected:hover,
.data-table tbody tr.slip-entries__row--selected:hover td {
  background-color: #ffedd5 !important;
}

.stockman-page-width.stockman-page-width--slip-register,
.app-has-folio-tabs .stockman-page-width.stockman-page-width--slip-register {
  --slip-register-gap: 1.25rem;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: var(--slip-register-gap);
  padding-right: var(--slip-register-gap);
  box-sizing: border-box;
}

.slip-register-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--slip-register-gap, 1.25rem);
  align-items: start;
  width: 100%;
}

.slip-register-page__table,
.slip-register-page__slip {
  min-width: 0;
}

.slip-register-page__table .slip-entries,
.slip-register-page__slip .slip-panel {
  width: 100%;
  margin: 0;
}

@media (min-width: 64rem) {
  .slip-register-page {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .slip-register-page__slip {
    position: sticky;
    top: calc(var(--navbar-height, 5.5rem) + 0.75rem);
  }
}

.slip-entries__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: min(100%, 14rem);
}

.slip-entries__count {
  margin: 0;
  text-align: right;
}

.slip-entries__filter {
  width: min(100%, 14rem);
}

.slip-entries__filter-input {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.7);
  padding: 0.45rem 0.7rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-chocolate);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-black) 6%, transparent);
}

.slip-entries__filter-input:focus {
  outline: none;
  border-color: var(--color-tawny);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gold) 45%, transparent);
}

.slip-entries__filter-input::-webkit-search-cancel-button {
  appearance: none;
  -webkit-appearance: none;
}

.slip-entries__docs {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: #0f172a;
}

.slip-entries__docs:hover {
  color: #1d4ed8;
}

.slip-entries__docs--empty {
  color: #cbd5e1;
}

.slip-entries__docs-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.slip-entries__docs-count {
  position: absolute;
  top: -0.35rem;
  right: -0.4rem;
  min-width: 0.9rem;
  padding: 0.05rem 0.22rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

.data-table--slip-entries {
  table-layout: fixed;
}

.data-table--slip-entries col.col-financial {
  width: 6.25rem;
}

.data-table--slip-entries col.col-amount {
  width: 6.25rem;
}

.data-table--slip-entries col.col-docs {
  width: 2.25rem;
}

.data-table--slip-entries col.col-reconciled {
  width: 4.25rem;
}

.data-table--slip-entries th.col-financial,
.data-table--slip-entries td.col-financial,
.data-table--slip-entries th.col-contact,
.data-table--slip-entries td.col-contact,
.data-table--slip-entries th.col-amount,
.data-table--slip-entries td.col-amount,
.data-table--slip-entries th.col-docs,
.data-table--slip-entries td.col-docs,
.data-table--slip-entries th.col-reconciled,
.data-table--slip-entries td.col-reconciled {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  vertical-align: middle;
}

.data-table--slip-entries th.col-financial,
.data-table--slip-entries td.col-financial {
  white-space: nowrap;
}

.data-table--slip-entries td.col-financial .register-list__primary {
  overflow: visible;
  text-overflow: clip;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.data-table--slip-entries th.col-docs,
.data-table--slip-entries td.col-docs,
.data-table--slip-entries th.col-reconciled,
.data-table--slip-entries td.col-reconciled {
  text-align: center;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.data-table--slip-entries td.col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Desktop Firefox / Safari: hide native <summary> markers (Chrome uses ::-webkit-details-marker). */
summary {
  list-style: none;
}

summary::-moz-list-bullet {
  display: none;
  list-style-type: none;
}

/* Firefox/Safari UA stylesheet uses margin: auto on <dialog>, which fights
   Tailwind left-1/2 + translate centering. GPX import uses margin: auto instead. */
dialog.fixed {
  margin: 0;
}

dialog.capital-register-dialog,
dialog.capital-register-dialog:modal {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 80rem);
  max-width: calc(100vw - 2rem);
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
}

dialog.capital-register-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.capital-register-dialog__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 90vh;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / 0.28);
}

.capital-register-dialog__close {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  padding: 0.25rem;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.capital-register-dialog__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.capital-register-dialog__search {
  flex-shrink: 0;
}

.capital-register-dialog__title {
  margin: 0;
  padding-right: 2rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
  flex-shrink: 0;
}

.capital-register-dialog__use-form {
  margin: 0 0 0 auto;
}

.capital-register-dialog__use {
  border: 0;
  background: transparent;
  padding: 0;
  color: #64748b;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.capital-register-dialog__use:hover {
  color: #0f172a;
}

.capital-register-dialog__search {
  display: block;
  margin-top: 1rem;
}

.capital-register-dialog__tree {
  margin-top: 1rem;
  min-height: 0;
  flex: 1 1 auto;
  height: calc(90vh - 8.5rem);
  max-height: calc(90vh - 8.5rem);
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
}

/* Time zone mismatch — native dialog centered with margin:auto (avoid fixed+translate). */
.time-zone-mismatch-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(92vw, 28rem);
  max-width: calc(100vw - 1.5rem);
}

.time-zone-mismatch-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.time-zone-mismatch-dialog__panel {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.25rem 1.5rem;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

/* Tailwind bundle includes grid-cols-3 but not bare grid-cols-2 */
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.register-import-wizard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.register-import-wizard > article {
  min-width: 0;
}

.register-import-step {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 3px 0 rgb(15 23 42 / 0.08);
}

.register-import-step--complete {
  border-color: var(--color-emerald-200, #a7f3d0);
  background: color-mix(in srgb, var(--color-cream) 70%, #ecfdf5);
}

.register-import-step--blocked {
  border-color: var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-cream) 88%, #f8fafc);
  opacity: 0.72;
}

.register-import-step__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.register-import-step__eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.register-import-step__title {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-chocolate);
}

.register-import-step__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.register-import-step__footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-subtle);
}

.register-import-step__dropzone {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-cream) 82%, #f8fafc);
  text-align: center;
}

.register-import-step__preview {
  overflow-x: auto;
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-cream) 88%, #f8fafc);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #94a3b8;
  white-space: pre-wrap;
}

.register-import-step__notice {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-gold) 55%, var(--color-cream));
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-gold) 18%, var(--color-cream));
  font-size: 0.75rem;
  color: var(--color-chocolate);
}

.register-import-step__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.register-import-step__stat {
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--color-cream) 82%, #f8fafc);
}

.register-import-step__stat dt {
  margin: 0;
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.register-import-step__stat dd {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-chocolate);
}

.register-import-step__badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

.register-import-step__badge--complete {
  background: #d1fae5;
  color: #065f46;
}

.register-import-step__badge--active,
.register-import-step__badge--ready {
  background: color-mix(in srgb, var(--color-gold) 28%, var(--color-cream));
  color: var(--color-chocolate);
}

.register-import-step__badge--required {
  background: color-mix(in srgb, var(--color-gold) 42%, var(--color-cream));
  color: var(--color-chocolate);
}

.register-import-step__badge--blocked {
  background: color-mix(in srgb, var(--color-cream) 70%, #e2e8f0);
  color: var(--color-text-muted);
}

.register-import-step .register-import-step__footer .button,
.register-import-step .register-import-step__footer input[type="submit"],
.register-import-step .register-import-step__footer button {
  width: 100%;
}

.stockman-page-width {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Flash confirmations — compact toast in the bottom-right corner. */
.flash-toast {
  position: fixed;
  right: max(1.5rem, env(safe-area-inset-right, 0px));
  bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  left: auto;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  box-sizing: border-box;
}

.flash-toast__inner {
  width: max-content;
  max-width: min(24rem, calc(100vw - 3rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: auto;
}

.flash-toast__message {
  position: relative;
  border-radius: 0.5rem;
  border-width: 1px;
  border-style: solid;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  backdrop-filter: blur(4px);
}

.flash-toast__text {
  display: block;
  text-align: left;
}

.flash-toast__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.flash-toast__close:hover,
.flash-toast__close:focus-visible {
  opacity: 1;
  outline: none;
}

.flash-toast__message--notice .flash-toast__close {
  color: #064e3b;
}

.flash-toast__message--notice .flash-toast__close:hover,
.flash-toast__message--notice .flash-toast__close:focus-visible {
  background: rgb(167 243 208 / 0.45);
}

.flash-toast__message--alert .flash-toast__close {
  color: #7f1d1d;
}

.flash-toast__message--alert .flash-toast__close:hover,
.flash-toast__message--alert .flash-toast__close:focus-visible {
  background: rgb(254 202 202 / 0.45);
}

.flash-toast__message--notice {
  border-color: #a7f3d0;
  background: rgb(236 253 245 / 0.95);
  color: #064e3b;
}

.flash-toast__message--alert {
  border-color: #fecaca;
  background: rgb(254 242 242 / 0.95);
  color: #7f1d1d;
}

/* Home hero CTA — plain CSS because stockman.css is a pre-built Tailwind bundle. */
.hero-landing {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-landing:has(.hero-landing__panel--root-picker) {
  align-items: center;
  justify-content: center;
}

.hero-landing__panel {
  position: relative;
  z-index: 10;
  width: 100%;
  color: #fff;
}

.hero-landing__panel--root-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gallery-credit {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 3;
  margin: 0;
  max-width: min(70vw, 28rem);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgb(0 0 0 / 0.8);
}

.gallery-credit[hidden] {
  display: none;
}

.root-gallery-button {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: block;
  width: 5.75rem;
  height: 3.75rem;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 0.7rem;
  background: #1c1917;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgb(0 0 0 / 0.65);
}

.root-gallery-button:hover {
  border-color: #ffe14a;
}

.root-gallery-button__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.root-gallery-dialog {
  width: min(92vw, 36rem);
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
}

.root-gallery-dialog:not([open]) {
  display: none;
}

.root-gallery-dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.root-gallery-dialog__panel {
  position: relative;
  border-radius: 0.9rem;
  background: #fff;
  padding: 1.25rem;
  color: #0f172a;
}

.root-gallery-dialog__close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.root-gallery-dialog__title {
  margin: 0;
  padding-right: 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.root-gallery-dialog__note,
.root-gallery-dialog__empty {
  margin: 0.45rem 0 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.4;
}

.root-gallery-dialog__form,
.root-gallery-dialog__credit-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.root-gallery-dialog__form {
  margin-top: 1rem;
}

.root-gallery-dialog__credit {
  flex: 1 1 8rem;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  padding: 0.4rem 0.55rem;
  color: #0f172a;
  font: inherit;
  font-size: 0.8rem;
}

.root-gallery-dialog__save {
  border: 0;
  background: transparent;
  padding: 0.2rem 0.15rem;
  color: #334155;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.root-gallery-dialog__file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.root-gallery-dialog__add {
  border: 0;
  border-radius: 0.5rem;
  background: #110e10;
  padding: 0.45rem 0.8rem;
  color: #fff4c1;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.root-gallery-dialog__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.root-gallery-dialog__item {
  position: relative;
}

.root-gallery-dialog__grid img {
  display: block;
  width: 100%;
  height: 7rem;
  object-fit: cover;
  border-radius: 0.5rem;
}

.root-gallery-dialog__remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #110e10;
  padding: 0;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.root-gallery-dialog__item:hover .root-gallery-dialog__remove,
.root-gallery-dialog__item:focus-within .root-gallery-dialog__remove {
  opacity: 1;
}

.root-picker-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem 1.25rem;
  width: min(68rem, 94vw);
  margin-top: 1.25rem;
  align-items: start;
}

.root-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.root-picker-list > li {
  width: 100%;
}

.hero-get-started {
  appearance: none;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.hero-get-started:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.hero-get-started:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.45),
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-get-started:focus:not(:focus-visible) {
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.root-picker-licence {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 1rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--color-gold) 55%, transparent);
  border-radius: 0.75rem;
  background: rgb(17 14 16 / 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-cream);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
  box-shadow:
    0 25px 50px -12px color-mix(in srgb, var(--color-black) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--color-gold) 18%, transparent);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.root-picker-licence:hover {
  background: rgb(17 14 16 / 0.72);
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.root-picker-licence:focus {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-gold) 45%, transparent),
    0 25px 50px -12px color-mix(in srgb, var(--color-black) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--color-gold) 18%, transparent);
}

.root-picker-licence:focus:not(:focus-visible) {
  box-shadow:
    0 25px 50px -12px color-mix(in srgb, var(--color-black) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--color-gold) 18%, transparent);
}

.root-picker-licence,
.root-picker-licence span {
  color: var(--color-cream);
}

.root-picker-licence__initials {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-cream) 88%, var(--color-gold));
}

.root-picker-licence__name {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-cream);
}

.root-picker-licence__type {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: color-mix(in srgb, var(--color-cream) 75%, var(--color-tawny));
}

form:has(> .root-picker-licence) {
  width: 100%;
  margin: 0;
}

.root-picker-empty {
  width: 40vw;
  min-width: 16rem;
  max-width: 42rem;
  margin-top: 1.5rem;
  padding: 1.5rem 2rem;
  border: 2px solid color-mix(in srgb, var(--color-gold) 55%, var(--color-black));
  border-radius: 1rem;
  background: var(--color-black);
  color: var(--color-cream);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
  box-shadow:
    0 25px 50px -12px color-mix(in srgb, var(--color-black) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--color-gold) 18%, transparent);
}

.hero-landing__scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(15, 23, 42, 0.45) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.navbar-sign-in {
  align-self: center;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
}

.navbar-sign-in:hover {
  text-decoration: underline;
}

.navbar-guest-links {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.85rem;
  align-self: center;
}

.navbar-legal-link {
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  text-decoration: none;
  opacity: 0.88;
}

.navbar-legal-link:hover {
  text-decoration: underline;
  opacity: 1;
}

.landing-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: calc(100dvh - 3.5rem);
  background-color: #1c1917;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.landing-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(17 14 16 / 0.25) 0%, rgb(17 14 16 / 0.72) 100%);
}

.landing-hero__copy {
  position: relative;
  z-index: 1;
  width: min(44rem, calc(100% - 2rem));
  margin: 0 auto 8vh;
  color: #fff4c1;
}

.landing-hero__eyebrow {
  margin: 0 0 0.75rem;
  color: #ffc468;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.landing-hero__lede {
  margin: 1rem 0 0;
  max-width: 38rem;
  color: #fff4c1;
  font-size: 1.125rem;
  line-height: 1.5;
}

.landing-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.landing-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.1rem;
  padding: 0.85rem 1.3rem;
  border-radius: 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.landing-button--primary {
  border: 2px solid rgb(255 244 193 / 0.45);
  background: rgb(17 14 16 / 0.88);
  color: #fff;
}

.landing-button--primary:hover {
  border-color: #ffc468;
  background: rgb(17 14 16 / 0.96);
}

.landing-overview {
  scroll-margin-top: 4.5rem;
  background: #fff4c1;
  color: #110e10;
}

.landing-overview__inner {
  width: min(68rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 4rem 0 5rem;
}

.landing-overview__kicker {
  margin: 0;
  color: #bc712b;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-overview__title {
  margin: 0.6rem 0 0;
  max-width: 40rem;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.landing-overview__lede {
  margin: 1rem 0 0;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.55;
}

.landing-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.landing-benefits li {
  border: 1px solid color-mix(in srgb, #bc712b 28%, #fff4c1);
  border-radius: 0.9rem;
  background: #fff;
  padding: 1.25rem 1.2rem 1.35rem;
}

.landing-benefits h3,
.landing-examples__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.landing-benefits p,
.landing-examples li {
  margin: 0.55rem 0 0;
  color: #4d2d18;
  font-size: 0.98rem;
  line-height: 1.5;
}

.landing-examples {
  margin-top: 2.5rem;
  max-width: 44rem;
}

.landing-examples ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
}

.landing-examples li + li {
  margin-top: 0.7rem;
}

.landing-close {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 2.5rem;
}

.landing-close p {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.landing-sign-in {
  color: #4d2d18;
  font-size: 0.95rem;
  font-weight: 650;
}

.landing-legal {
  max-width: 36rem;
  color: color-mix(in srgb, var(--color-chocolate) 72%, var(--color-tawny));
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  line-height: 1.5;
}

.landing-legal a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.interest-inquiry-dialog__choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.interest-inquiry-dialog__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: #334155;
  font-size: 0.875rem;
  line-height: 1.35;
}

.interest-inquiry-dialog__choice input {
  margin-top: 0.15rem;
}

@media (max-width: 52rem) {
  .landing-benefits {
    grid-template-columns: 1fr;
  }
}

.hero-landing__cta {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero-interest-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.9rem 1.4rem;
  appearance: none;
  border: 2px solid #110e10;
  border-radius: 0.75rem;
  background: #ffe14a;
  color: #110e10;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.55);
}

.hero-interest-link:hover {
  background: #ffd000;
  color: #110e10;
}

.hero-interest-link:focus {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(255, 225, 74, 0.55),
    0 10px 24px -12px rgba(0, 0, 0, 0.55);
}

.login-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: calc(100dvh - 3.5rem);
  padding: 2rem 1rem;
  background-color: #1c1917;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.login-screen__scrim {
  position: absolute;
  inset: 0;
  background: rgb(17 14 16 / 0.28);
}

.login-card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(100%, 28rem);
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #fff;
  padding: 1.75rem 1.5rem 1.5rem;
  color: #0f172a;
  box-shadow: 0 24px 50px -18px rgb(0 0 0 / 0.55);
}

.login-card h1 {
  margin: 0;
  color: #0f172a;
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.25;
}

.login-card p {
  color: #475569;
}

.login-card .hero-interest-link {
  box-sizing: border-box;
  width: 100%;
}

.interest-inquiry-dialog:not([open]) {
  display: none;
}

.interest-inquiry-dialog {
  width: min(92vw, 32rem);
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
}

.interest-inquiry-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.interest-inquiry-dialog__panel {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 20px 40px -16px rgb(15 23 42 / 0.45);
}

.interest-inquiry-dialog__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  padding: 0.25rem 0.45rem;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.interest-inquiry-dialog__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.interest-inquiry-dialog__title {
  margin: 0;
  padding-right: 2rem;
  color: #0f172a;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.interest-inquiry-dialog__intro {
  margin: 0.5rem 0 0;
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.45;
}

.interest-inquiry-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.interest-inquiry-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.interest-inquiry-dialog__label {
  color: #334155;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.interest-inquiry-dialog__input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.55rem 0.75rem;
  color: #0f172a;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
}

.interest-inquiry-dialog__input:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 3px rgb(148 163 184 / 0.35);
}

.interest-inquiry-dialog__legal {
  margin: 0.35rem 0 0.85rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}

.interest-inquiry-dialog__legal a {
  color: #334155;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.interest-inquiry-dialog__submit {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 1px solid #1e293b;
  border-radius: 0.375rem;
  background: #0f172a;
  padding: 0.65rem 1rem;
  color: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.interest-inquiry-dialog__submit:hover {
  background: #1e293b;
}

.interest-inquiry-dialog__error {
  margin: 0;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  background: #fef2f2;
  padding: 0.5rem 0.75rem;
  color: #7f1d1d;
  font-size: 0.875rem;
}

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

.hero-interest-link--menu {
  display: flex;
  width: calc(100% - 1.5rem);
  margin: 0.35rem 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  box-shadow: none;
}

.hero-get-started {
  position: relative;
  z-index: 10;
  width: 40vw;
  min-width: 16rem;
  max-width: 42rem;
  margin: 0;
  padding: 2.75rem 2rem;
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;
}

@media (max-width: 40rem) {
  .hero-get-started,
  .root-picker-empty {
    width: min(88vw, 42rem);
  }

  .hero-get-started {
    padding: 2rem 1.5rem;
    font-size: 1.75rem;
  }

  .root-picker-columns {
    width: min(94vw, 68rem);
    gap: 0.35rem 0.6rem;
  }

  .root-picker-licence {
    padding: 0.85rem 0.95rem;
    font-size: 1rem;
  }
}

/* Navbar asset search (icon-only field + live results). */
.asset-search__icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.asset-search__icon svg {
  display: block;
  width: 1rem;
  height: 1rem;
}

.asset-search__input {
  display: block;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.55);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-chocolate);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-black) 6%, transparent);
}

.asset-search__input:focus {
  outline: none;
  border-color: var(--color-tawny);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-gold) 45%, transparent);
}

.asset-search__input::-webkit-search-cancel-button {
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

.asset-search__input::-moz-search-cancel-button {
  display: none;
  appearance: none;
}

.asset-search__results {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 50;
  width: min(24rem, 90vw);
  max-height: 18rem;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 10px 15px -3px rgba(15, 23, 42, 0.12);
}

.asset-search__group-label {
  margin: 0;
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
}

.asset-search__group-label:not(:first-child) {
  margin-top: 0.25rem;
  border-top: 1px solid #e2e8f0;
}

/* Index tables: fixed layout, explicit column balance, text stays inside cells.
   border-collapse: separate is required for position: sticky in Safari. */
.data-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table-shell {
  --data-table-shell-offset: 8.5rem;
}

.data-table-shell__caption {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
}

.data-table-shell .data-table-shell__scroll {
  max-height: calc(100vh - var(--data-table-shell-offset));
  max-height: calc(100dvh - var(--data-table-shell-offset));
  overflow: auto;
}

/* App table headers: #1f1f1f background + #dfdfdf text.
   Exclude HFP Budget (.budget-grid) so its sticky / category headers stay as-is. */
table:not(.budget-grid) thead {
  color: var(--color-table-header-text) !important;
  background-color: var(--color-table-header) !important;
}

table:not(.budget-grid) thead th {
  color: var(--color-table-header-text) !important;
}

.data-table thead {
  color: var(--color-table-header-text) !important;
  background-color: var(--color-table-header) !important;
}

.data-table-shell .data-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--color-table-header-text) !important;
  font-weight: 700 !important;
  background: var(--color-table-header) !important;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--color-black) 40%, var(--color-table-header));
}

.data-table tbody tr:nth-child(odd) {
  background-color: #eff6ff !important;
}

.data-table tbody tr:hover {
  background-color: #e5e7eb !important;
}

/* GPA → worksheet convert preview */
.data-table--gpa-convert {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table--gpa-convert col.gpa-convert__col-reason {
  width: 14rem;
}

.data-table--gpa-convert col.gpa-convert__col-amount {
  width: 7.5rem;
}

.data-table--gpa-convert col.gpa-convert__col-month {
  width: 5.75rem;
}

.data-table--gpa-convert col.gpa-convert__col-remaining {
  width: 6.5rem;
}

.data-table-shell .data-table--gpa-convert thead th {
  vertical-align: bottom;
  background: var(--color-table-header) !important;
}

.data-table-shell .data-table--gpa-convert thead th.gpa-convert__pinned {
  /* Violet tinge on header gray — must beat sticky thead !important */
  background: color-mix(in srgb, #a78bfa 28%, var(--color-table-header)) !important;
  background-color: color-mix(in srgb, #a78bfa 28%, var(--color-table-header)) !important;
}

.data-table--gpa-convert th,
.data-table--gpa-convert td {
  vertical-align: middle;
  padding: 0.4rem 0.45rem;
}

.data-table--gpa-convert .gpa-convert__month-name {
  display: block;
  line-height: 1.15;
}

.data-table--gpa-convert .gpa-convert__month-year {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.65rem;
  font-weight: 500;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: normal;
  color: color-mix(in srgb, var(--color-table-header-text) 72%, var(--color-table-header));
}

.data-table--gpa-convert .gpa-convert__note {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.25;
  color: color-mix(in srgb, var(--color-table-header-text) 72%, var(--color-table-header));
}

.data-table--gpa-convert .gpa-convert__reason {
  text-align: left;
}

.data-table--gpa-convert .gpa-convert__reason--group {
  padding-left: 0.75rem;
}

.data-table--gpa-convert .gpa-convert__reason--detail {
  padding-left: 1.5rem;
}

.data-table--gpa-convert .gpa-convert__reason--detail .gpa-convert__note {
  padding-left: 0; /* sits under the indented reason text */
}

.data-table--gpa-convert .gpa-convert__month-cell {
  text-align: right;
}

.data-table--gpa-convert .gpa-convert__month-input {
  box-sizing: border-box;
  display: inline-block;
  width: 100%;
  max-width: 5.25rem;
  min-height: 2rem;
  margin: 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: right;
  vertical-align: middle;
}

.data-table--gpa-convert .gpa-convert__month-input:focus {
  border-color: #64748b;
  outline: none;
  box-shadow: 0 0 0 1px #94a3b8;
}

.data-table--gpa-convert .gpa-convert__remaining {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.05rem;
  min-height: 2.5rem;
  line-height: 1.2;
}

.data-table--gpa-convert .gpa-convert__remaining-amount {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #334155;
}

.data-table--gpa-convert .gpa-convert__remaining-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: lowercase;
  color: #64748b;
}

.data-table--gpa-convert .gpa-convert__remaining--ok .gpa-convert__remaining-amount,
.data-table--gpa-convert .gpa-convert__remaining--ok .gpa-convert__remaining-label {
  color: #64748b;
}

.data-table--gpa-convert .gpa-convert__remaining--over .gpa-convert__remaining-amount,
.data-table--gpa-convert .gpa-convert__remaining--over .gpa-convert__remaining-label {
  color: #b45309;
}

.data-table tbody tr > th,
.data-table tbody tr > td {
  background-color: inherit !important;
}

/* Must follow the inherit rule above so pinned convert columns keep a violet tinge. */
.data-table-shell .data-table--gpa-convert tbody tr:nth-child(odd) > th.gpa-convert__pinned,
.data-table-shell .data-table--gpa-convert tbody tr:nth-child(odd) > td.gpa-convert__pinned {
  background: color-mix(in srgb, #a78bfa 24%, #eff6ff) !important;
  background-color: color-mix(in srgb, #a78bfa 24%, #eff6ff) !important;
}

.data-table-shell .data-table--gpa-convert tbody tr:nth-child(even) > th.gpa-convert__pinned,
.data-table-shell .data-table--gpa-convert tbody tr:nth-child(even) > td.gpa-convert__pinned {
  background: color-mix(in srgb, #a78bfa 24%, #fff) !important;
  background-color: color-mix(in srgb, #a78bfa 24%, #fff) !important;
}

.data-table-shell .data-table--gpa-convert tbody tr.gpa-convert__group-row:nth-child(odd) > th.gpa-convert__pinned,
.data-table-shell .data-table--gpa-convert tbody tr.gpa-convert__group-row:nth-child(odd) > td.gpa-convert__pinned {
  background: color-mix(in srgb, #a78bfa 30%, #eff6ff) !important;
  background-color: color-mix(in srgb, #a78bfa 30%, #eff6ff) !important;
}

.data-table-shell .data-table--gpa-convert tbody tr.gpa-convert__group-row:nth-child(even) > th.gpa-convert__pinned,
.data-table-shell .data-table--gpa-convert tbody tr.gpa-convert__group-row:nth-child(even) > td.gpa-convert__pinned {
  background: color-mix(in srgb, #a78bfa 30%, #fff) !important;
  background-color: color-mix(in srgb, #a78bfa 30%, #fff) !important;
}

.data-table-shell .data-table--gpa-convert tbody tr:hover > th.gpa-convert__pinned,
.data-table-shell .data-table--gpa-convert tbody tr:hover > td.gpa-convert__pinned {
  background: color-mix(in srgb, #a78bfa 24%, #e5e7eb) !important;
  background-color: color-mix(in srgb, #a78bfa 24%, #e5e7eb) !important;
}

.data-table-shell__caption + .data-table-shell__scroll .data-table thead th {
  top: 0;
}

/* Scene catalogue date list: stockman.css paints markdown table headers dark. */
turbo-frame#scene_catalogue_live.contents {
  display: contents;
}

.scene-catalogue-dates {
  width: 100%;
  border-collapse: collapse;
}

.scene-catalogue-dates thead th {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-table-header-text) !important;
  background-color: var(--color-table-header) !important;
}

.scene-catalogue-dates tbody td {
  padding: 0.5rem 0.75rem;
}

.data-table-sort-link,
.data-table-sort-header {
  display: inline-flex;
  width: 100%;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.data-table-sort-link.text-right,
.data-table-sort-header.text-right {
  justify-content: flex-end;
}

.data-table-sort-link:hover,
.data-table-sort-header:hover {
  color: var(--color-cream) !important;
}

.data-table-sort-link.is-active,
.data-table-sort-header.is-sorted-asc,
.data-table-sort-header.is-sorted-desc {
  color: var(--color-gold) !important;
}

.data-table-sort-indicator {
  font-size: 0.625rem;
  line-height: 1;
}

.data-table th,
.data-table td {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table col.col-actions {
  width: 10.5rem;
}

.data-table th.actions-col,
.data-table td.actions-col {
  width: 10.5rem;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}

.data-table--enterprises col.col-actions {
  width: 1%;
}

.data-table--enterprises th.actions-col,
.data-table--enterprises td.actions-col {
  width: 1%;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  white-space: nowrap;
}

.data-table--enterprises col.col-currency {
  width: 1%;
}

.data-table--enterprises th.currency-col,
.data-table--enterprises td.currency-col {
  width: 1%;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.data-table--hfp th,
.data-table--hfp td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.data-table--hfp th.currency-col,
.data-table--hfp td.currency-col,
.data-table--hfp th.actions-col,
.data-table--hfp td.actions-col {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Enterprises HFP columns — same header chrome as other data tables (not Budget). */
.data-table-shell .data-table.data-table--hfp thead th {
  color: var(--color-table-header-text) !important;
  background: var(--color-table-header) !important;
  background-color: var(--color-table-header) !important;
  border-color: color-mix(in srgb, var(--color-black) 25%, var(--color-table-header));
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--color-black) 40%, var(--color-table-header));
}

.data-table-shell .data-table--hfp thead .icon-action-btn--neutral {
  color: var(--color-table-header-text);
}

.data-table-shell .data-table--hfp thead .icon-action-btn--neutral:hover {
  color: #fff;
  background-color: color-mix(in srgb, var(--color-table-header-text) 14%, transparent);
}

.data-table--hfp col.col-enterprise-name {
  width: 18%;
}

.data-table--hfp col.col-description {
  width: 16%;
}

.data-table--hfp col.col-gpa,
.data-table--hfp col.col-worksheets {
  width: 20%;
}

.data-table .cell-clip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--register-import-preview col.col-line {
  width: 3rem;
}

.data-table--register-import-preview col.col-include-action {
  width: 8.5rem;
}

.data-table--register-import-preview col.col-date {
  width: 6.25rem;
}

.data-table--register-import-preview col.col-type {
  width: 4.5rem;
}

.data-table--register-import-preview col.col-amount {
  width: 5.75rem;
}

.data-table--register-import-preview col.col-coa {
  width: 12rem;
}

.data-table--register-import-preview col.col-notes {
  width: 12rem;
}

.data-table--register-import-preview th.col-include-action,
.data-table--register-import-preview td.col-include-action,
.data-table--register-import-preview th.col-date,
.data-table--register-import-preview td.col-date,
.data-table--register-import-preview th.col-type,
.data-table--register-import-preview td.col-type,
.data-table--register-import-preview th.col-amount,
.data-table--register-import-preview td.col-amount,
.data-table--register-import-preview th.col-coa,
.data-table--register-import-preview td.col-coa,
.data-table--register-import-preview th.col-notes,
.data-table--register-import-preview td.col-notes {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.data-table--register-import-preview th.col-include-action,
.data-table--register-import-preview td.col-include-action {
  vertical-align: middle;
}

.data-table--register-import-preview .register-import-preview__include-action {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.data-table--register-import-preview .register-import-preview__include-action--header {
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table--register-import-preview .register-import-preview__action-label {
  font-size: 0.8125rem;
  line-height: 1.25;
  min-width: 0;
}

.data-table--register-import-preview th.col-date,
.data-table--register-import-preview td.col-date,
.data-table--register-import-preview th.col-type,
.data-table--register-import-preview td.col-type {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.data-table--register-import-preview th.col-amount,
.data-table--register-import-preview td.col-amount {
  white-space: nowrap;
}

.data-table--register-import-preview .register-import-preview__description {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table--register-import-preview td.col-description:hover .register-import-preview__description {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

.data-table--register-import-preview tr.register-import-preview__row--invalid {
  background: #fef2f2;
  box-shadow: inset 3px 0 0 #ef4444;
}

.data-table--register-import-preview td.register-import-preview__cell--missing {
  background: #fee2e2;
}

.data-table--register-import-preview .register-import-preview__missing-value {
  color: #b91c1c;
  font-weight: 600;
}

.data-table--register-import-preview .register-import-preview__source-line {
  margin-top: 0.5rem;
  overflow-x: auto;
  border-radius: 0.375rem;
  border: 1px solid #fecaca;
  background: #fff;
  padding: 0.5rem 0.625rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: #7f1d1d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


.data-table--register-list {
  table-layout: fixed;
}

.data-table--register-list col.col-select {
  width: 2.25rem;
}

.data-table--register-list col.col-financial {
  width: 7.75rem;
}

.data-table--register-list col.col-type {
  width: 6.25rem;
}

.data-table--register-list col.col-contact {
  width: 16rem;
}

.data-table--register-list col.col-amount {
  width: 10.875rem;
}

.data-table--register-list col.col-reconciled {
  width: 4.25rem;
}

.data-table--register-list th.col-select,
.data-table--register-list td.col-select,
.data-table--register-list th.col-financial,
.data-table--register-list td.col-financial,
.data-table--register-list th.col-type,
.data-table--register-list td.col-type,
.data-table--register-list th.col-contact,
.data-table--register-list td.col-contact,
.data-table--register-list th.col-description,
.data-table--register-list td.col-description,
.data-table--register-list th.col-amount,
.data-table--register-list td.col-amount,
.data-table--register-list th.col-reconciled,
.data-table--register-list td.col-reconciled {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  vertical-align: middle;
}

.data-table--register-list th.col-select,
.data-table--register-list td.col-select {
  text-align: center;
}

.data-table--register-list th.col-financial,
.data-table--register-list td.col-financial,
.data-table--register-list th.col-type,
.data-table--register-list td.col-type,
.data-table--register-list th.col-reconciled,
.data-table--register-list td.col-reconciled {
  white-space: nowrap;
}

.data-table--register-list th.col-reconciled,
.data-table--register-list td.col-reconciled {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  text-align: center;
}

.data-table--register-list th.col-reconciled .data-table-sort-link {
  justify-content: center;
  gap: 0.1rem;
}

.data-table--register-list td.col-contact,
.data-table--register-list td.col-description {
  white-space: normal;
}

.register-list__th-stack {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  line-height: 1.15;
}

.register-list__th-secondary {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.78;
}

.register-list__th-stack .data-table-sort-link + .data-table-sort-link {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.78;
}

.register-list__primary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: #1e293b;
}

.register-list__secondary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.08rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.25;
  color: #64748b;
}

.register-list__secondary.register-coa--needs-classifying,
.register-coa--needs-classifying,
.filterable-select__input.register-coa--needs-classifying,
input.register-coa--needs-classifying {
  color: #991b1b;
  font-weight: 600;
}

.register-list__mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.register-list__stack {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.register-list__split-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.register-bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.register-bulk-toolbar__count:empty {
  display: none;
}

.data-table--register-list th.col-amount {
  white-space: nowrap;
  text-align: right;
}

.data-table--register-list td.col-amount {
  white-space: nowrap;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

/* Debit/check outflows: dark red with leading minus from balance_effect. */
.register-amount--outflow,
.data-table--register-list td.col-amount .register-amount--outflow,
.data-table--slip-entries td.col-amount .register-amount--outflow,
.data-table--register-import-preview td.col-amount .register-amount--outflow {
  color: #7f1d1d;
}

.data-table--register-list td.col-financial .register-list__primary {
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
}

.data-table--register-list .register-list__description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.3;
  color: #1e293b;
}

.data-table--register-list tr.register-list__row--view {
  cursor: pointer;
}

.data-table--register-list tr.register-list__row--view:hover td {
  background-color: #f8fafc !important;
}

.data-table--register-list tr.register-list__row--view:focus-visible td {
  background-color: #f1f5f9 !important;
  box-shadow: inset 0 0 0 2px #94a3b8;
}

tr.events-index__row,
tr.landbases-index__row {
  cursor: pointer;
}

tr.events-index__row:hover td,
tr.landbases-index__row:hover td {
  background-color: #f8fafc !important;
}

tr.events-index__row:focus-visible td,
tr.landbases-index__row:focus-visible td {
  background-color: #f1f5f9 !important;
  box-shadow: inset 0 0 0 2px #94a3b8;
}

.register-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.register-page-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.register-page-header__title h1 {
  margin: 0;
}

.register-page-header__exports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.register-filters {
  border: 1px solid var(--color-filter-border);
  border-radius: 0.75rem;
  background: var(--color-filter-bg);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.register-filters--balanced {
  background: #dcfce7;
  border-color: #86efac;
}

.register-filters__broom {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  flex-shrink: 0;
}

.register-filters__broom .icon-action-btn__icon {
  width: 1.25rem;
  height: 1.25rem;
}

.register-filters__panel {
  padding: 0.75rem;
}

.register-filters__row {
  display: grid;
  gap: 0.5rem 0.625rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0.5rem;
}

.register-filters__row:last-of-type {
  margin-bottom: 0;
}

@media (min-width: 48rem) {
  .register-filters__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .register-filters__span-2 {
    grid-column: span 2;
  }

  .register-filters__row--reconcile {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.register-filters__field .date-display-picker {
  margin-top: 0;
  width: 100%;
}

.register-filters__row--reconcile .register-filters__field {
  min-width: 0;
}

.register-filters__row--reconcile .register-filters__control,
.register-filters__row--reconcile .date-display-picker,
.register-filters__row--reconcile .date-display-picker__text {
  width: 100%;
  height: 2.375rem;
  box-sizing: border-box;
  margin-top: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.register-filters__row--reconcile .date-display-picker__text {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.register-filters__amount,
.register-filters__amount-display {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.register-filters__panel input.register-filters__amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.register-filters__amount-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.75);
  color: #0f172a;
}

.register-filters__label {
  display: block;
  margin-bottom: 0.125rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.register-filters__panel .register-filters__label + input,
.register-filters__panel .register-filters__label + select {
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
  font-size: 0.8125rem;
}

.register-filters__differential-inline {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-left: auto;
}

.register-filters__differential-inline .register-filters__label {
  margin-bottom: 0;
}

.register-filters__differential {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.register-filters--balanced .register-filters__amount-display {
  border-color: #4ade80;
  background: #f0fdf4;
}

.register-filters__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.register-filters__actions input[type="submit"] {
  padding-top: 0.4375rem;
  padding-bottom: 0.4375rem;
  font-size: 0.8125rem;
}

.register-reconcile-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  width: 1.75rem;
  min-width: 1.75rem;
  height: 1rem;
  padding: 0.1rem;
  border: 1px solid #f87171;
  border-radius: 9999px;
  background: #fecaca;
  line-height: 0;
  vertical-align: middle;
  appearance: none;
  cursor: pointer;
}

.register-reconcile-toggle__knob {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.2);
}

.register-reconcile-toggle--off {
  border-color: #f87171;
  background: #fecaca;
  justify-content: flex-start;
}

.register-reconcile-toggle--on {
  justify-content: flex-end;
  border-color: #4ade80;
  background: #bbf7d0;
}

span.register-reconcile-toggle {
  cursor: default;
}

.register-reconcile-semaphore {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 2.75rem;
  height: 1.15rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  background: #f8fafc;
  line-height: 0;
  vertical-align: middle;
  appearance: none;
  cursor: pointer;
}

span.register-reconcile-semaphore {
  cursor: default;
}

.register-reconcile-semaphore__lamp {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.08);
}

.register-reconcile-semaphore--unreconciled .register-reconcile-semaphore__lamp--unreconciled {
  background: #f87171;
  box-shadow: 0 0 0 1px #fecaca;
}

.register-reconcile-semaphore--partial .register-reconcile-semaphore__lamp--partial {
  background: #f59e0b;
  box-shadow: 0 0 0 1px #fde68a;
}

.register-reconcile-semaphore--full .register-reconcile-semaphore__lamp--full {
  background: #22c55e;
  box-shadow: 0 0 0 1px #bbf7d0;
}

.filterable-select__list {
  overscroll-behavior: contain;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
}

/* EOV monitoring map — explicit height (Tailwind h-72/h-80 not in prebuilt stockman.css) */
.monitoring-map {
  position: relative;
  width: 100%;
  height: 18rem;
  min-height: 18rem;
}

@media (min-width: 40rem) {
  .monitoring-map {
    height: 20rem;
    min-height: 20rem;
  }
}

.monitoring-map--compact {
  height: 12rem;
  min-height: 12rem;
}

.monitoring-map.monitoring-map--square {
  height: auto;
  min-height: 16rem;
  aspect-ratio: 1 / 1;
}

.eco-monitoring-split {
  display: grid;
  gap: 1rem;
  align-items: start;
}

@media (min-width: 56rem) {
  /* Prefer the lists/table: map ~35%, event columns get the rest. */
  .eco-monitoring-split {
    grid-template-columns: minmax(12rem, 0.7fr) minmax(22rem, 1.3fr);
    align-items: stretch;
  }

  .eco-monitoring-split__lists {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-height: 100%;
    overflow: auto;
  }
}

.eco-monitoring-split__map {
  min-width: 0;
}

.eco-site-row {
  cursor: pointer;
}

.eco-site-row:hover {
  background: #f8fafc;
}

.eco-site-row:focus-visible {
  outline: 2px solid #047857;
  outline-offset: -2px;
}

.eco-site-row--selected {
  background: #ecfdf5;
  box-shadow: inset 3px 0 0 #047857;
}

.eco-site-row--eov:focus-visible {
  outline-color: #7c3aed;
}

.paddock-ndvi-list {
  max-height: none;
}

.paddock-ndvi-row {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.75rem 1rem;
}

.paddock-ndvi-row.is-dragging {
  opacity: 0.55;
  background: #f8fafc;
}

.paddock-ndvi-row.is-map-focused {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #b45309;
}

@media (min-width: 40rem) {
  .paddock-ndvi-row {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.paddock-ndvi-row__meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.4rem;
  row-gap: 0.2rem;
  min-width: 0;
  align-items: start;
  padding-top: 0.15rem;
}

.paddock-ndvi-row__handle {
  margin: 0;
  padding: 0.15rem 0.2rem;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: -0.08em;
  cursor: grab;
}

.paddock-ndvi-row__handle:active {
  cursor: grabbing;
}

.paddock-ndvi-row__identity {
  min-width: 0;
}

.paddock-ndvi-row__name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.25;
}

.paddock-ndvi-row__area {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  color: #64748b;
}

.paddock-ndvi-row__value--ndvi {
  color: #166534;
}

.paddock-ndvi-row__value--ndmi {
  color: #1d4ed8;
}

.paddock-ndvi-row__charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  min-width: 0;
}

.paddock-ndvi-row__charts--single {
  grid-template-columns: 1fr;
}

.paddock-ndvi-row__site-chips {
  display: grid;
  grid-template-columns: 5.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  min-height: 1.1rem;
}

.paddock-ndvi-row__site-chips-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}

.paddock-ndvi-row__site-chips-track {
  position: relative;
  min-height: 0.85rem;
  min-width: 0;
}

.paddock-ndvi-site-chip {
  position: absolute;
  top: 0;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  border-radius: 0.15rem;
  border: 1px solid rgba(15, 23, 42, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  background: #94a3b8;
  text-decoration: none;
  color: #0f172a;
  overflow: hidden;
  z-index: 2;
  transition: width 0.12s ease, height 0.12s ease, margin-left 0.12s ease, z-index 0s;
}

.paddock-ndvi-site-chip__detail {
  display: none;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  padding: 0.15rem 0.35rem;
}

.paddock-ndvi-site-chip:hover,
.paddock-ndvi-site-chip:focus-visible {
  width: auto;
  height: auto;
  min-width: 0.7rem;
  min-height: 0.7rem;
  margin-left: -0.35rem;
  z-index: 5;
  outline: none;
}

.paddock-ndvi-site-chip:hover .paddock-ndvi-site-chip__detail,
.paddock-ndvi-site-chip:focus-visible .paddock-ndvi-site-chip__detail {
  display: inline-block;
}

.paddock-ndvi-row__chart {
  display: grid;
  grid-template-columns: 5.35rem minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.paddock-ndvi-row__chart-value {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.paddock-ndvi-row__chart-canvas {
  min-width: 0;
  min-height: 5rem;
}

.paddock-ndvi-product-toggle {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  overflow: hidden;
  background: #f8fafc;
}

.paddock-ndvi-product-toggle__btn {
  margin: 0;
  padding: 0.2rem 0.55rem;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}

.paddock-ndvi-product-toggle__btn + .paddock-ndvi-product-toggle__btn {
  border-left: 1px solid #e2e8f0;
}

.paddock-ndvi-product-toggle__btn.is-active {
  background: #fff;
  color: #0f172a;
}

.paddock-ndvi-scrubber {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.paddock-ndvi-scrubber__meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 5.5rem;
}

.paddock-ndvi-scrubber__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.paddock-ndvi-scrubber__date {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0f172a;
}

.paddock-ndvi-scrubber__track {
  position: relative;
  height: 1.25rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #cbd5e1);
  cursor: ew-resize;
  touch-action: none;
}

.paddock-ndvi-scrubber__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: #0f172a;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.paddock-ndvi-chart {
  position: relative;
}

.paddock-ndvi-chart--compact .paddock-ndvi-chart__canvas {
  display: block;
  height: 5rem;
  cursor: ew-resize;
}

.paddock-ndvi-chart__empty {
  margin: 0;
  font-size: 0.75rem;
  color: #94a3b8;
}

.paddock-ndvi-chart__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: 0.7rem;
  color: #64748b;
}

.paddock-ndvi-chart__legend--section {
  margin-top: 0;
}

.paddock-ndvi-chart__legend-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.paddock-ndvi-chart__legend-title {
  font-weight: 700;
  color: #334155;
}

.paddock-ndvi-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.paddock-ndvi-chart__swatch {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.15rem;
}

.paddock-ndvi-chart__legend-hint {
  flex: 1 1 12rem;
}

.paddock-ndvi-chart__tooltip {
  position: absolute;
  z-index: 2;
  max-width: 18rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  background: rgb(15 23 42 / 0.92);
  color: #f8fafc;
  font-size: 0.7rem;
  pointer-events: none;
}


.eco-site-row--eov.eco-site-row--selected {
  background: #f5f3ff;
  box-shadow: inset 3px 0 0 #7c3aed;
}

.eco-site-row--eov.eco-site-row--focused {
  background: #f5f3ff;
  box-shadow: inset 3px 0 0 #7c3aed;
}

.eov-site-ehi-cell--focused {
  outline: 2px solid #7c3aed;
  outline-offset: -2px;
  background: #faf5ff;
}

@media (min-width: 40rem) {
  .monitoring-map--compact {
    height: 14rem;
    min-height: 14rem;
  }
}

.monitoring-map-key {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 1000;
  margin: 0;
  padding: 0.5rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  font-size: 0.6875rem;
  line-height: 1.25;
  color: #334155;
}

.paddock-ndvi-section__legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  width: 100%;
}

.paddock-ndvi-section__legend-row .paddock-ndvi-chart__legend {
  flex: 1 1 auto;
  min-width: 0;
}

.paddock-ndvi-section__recalculate {
  margin-left: auto;
}

.landbase-activity + .mt-4,
.landbase-activity + .rounded-xl {
  margin-top: 1rem;
}

.landbase-activity__pulse {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: #0284c7;
  box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.45);
  animation: landbase-activity-pulse 1.6s ease-out infinite;
}

@keyframes landbase-activity-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.45);
  }
  70% {
    box-shadow: 0 0 0 0.45rem rgba(2, 132, 199, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0);
  }
}

.landbase-activity-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 70;
  width: min(96vw, 42rem);
  max-width: 100%;
  max-height: min(90vh, 40rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.landbase-activity-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.landbase-activity-dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: min(90vh, 40rem);
  overflow: auto;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 20px 40px -16px rgb(15 23 42 / 0.35);
}

.landbase-activity-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.landbase-activity-dialog__sync {
  margin: 0;
}

.landbase-activity--embedded {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.monitoring-map-key__title {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.monitoring-map-key__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.monitoring-map-key__item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 0.125rem 0;
}

.monitoring-map-key__symbol {
  flex-shrink: 0;
}

/* EOV monitoring legend symbols — em-sized (2:1 long/short, matches map radii 12/6) */
.eov-monitoring-legend__item,
.monitoring-map-key__item {
  font-size: inherit;
}

.eov-monitoring-legend__symbol,
.monitoring-map-key__symbol--long,
.monitoring-map-key__symbol--short,
.monitoring-map-key__symbol--landbase {
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  vertical-align: middle;
}

.monitoring-map-key__symbol--long,
.eov-monitoring-legend__symbol--long {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  background: #2c5f94;
  border: 1px solid #2c5f94;
}

.monitoring-map-key__symbol--short,
.eov-monitoring-legend__symbol--short {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: #eab308;
  border: 1px solid #eab308;
}

.monitoring-map-key__symbol--landbase,
.eov-monitoring-legend__symbol--landbase {
  width: 1em;
  height: 1em;
  border: 0.15em solid #0f172a;
  background: transparent;
}

.monitoring-map-key__symbol--bem,
.monitoring-map-key__symbol--eov-proposed {
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 0.75em;
  height: 0.75em;
  border-radius: 50%;
}

.monitoring-map-key__symbol--bem {
  background: #eab308;
  border: 1px solid #eab308;
}

.monitoring-map-key__symbol--eov-proposed {
  background: #14b8a6;
  border: 1px solid #14b8a6;
}

.monitoring-map-key__symbol--photo-point {
  display: inline-block;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 0.85em;
  height: 0.85em;
  border-radius: 2px;
  background: #eab308;
  border: 1px solid #0f172a;
}

.eov-monitoring-legend {
  font-size: 0.65rem;
  line-height: 1.25;
}

.eov-monitoring-legend__item {
  display: flex;
  align-items: center;
  gap: 0.35em;
}

.eov-monitoring-legend__symbol--bem {
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  background: #eab308;
  border: 1px solid #eab308;
}

.eov-monitoring-legend__symbol--eov-proposed {
  width: 0.85em;
  height: 0.85em;
  border-radius: 50%;
  background: #14b8a6;
  border: 1px solid #14b8a6;
}

.eov-monitoring-legend__symbol--photo-point {
  width: 0.85em;
  height: 0.85em;
  border-radius: 2px;
  background: #eab308;
  border: 1px solid #0f172a;
}

.farm-map-photo-point-icon {
  display: block;
  line-height: 0;
  border: 1px solid var(--pp-border, transparent);
  border-radius: 3px;
}

/* Right of map key: Boundary/Paddock/Strata toolbar, then Monitoring, then Scene. */
.farm-map-key-rail {
  position: absolute;
  top: 0;
  left: calc(100% + 0.5rem);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  box-sizing: border-box;
  max-width: min(42rem, calc(100vw - 16rem));
  max-height: calc(100dvh - 6rem);
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: none;
}

/* Monitoring (Ecology) above Scene (Analysis); sits under the edit toolbar when open. */
.farm-map-key-flyouts {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  box-sizing: border-box;
  width: min(18.5rem, calc(100vw - 26rem));
  max-width: min(18.5rem, calc(100vw - 16rem));
  flex-shrink: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: visible;
  pointer-events: none;
}

.farm-map-monitoring-panel {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  min-width: 0;
  pointer-events: none;
}

.farm-map-monitoring-panel.hidden,
.farm-map-monitoring-panel[hidden] {
  display: none;
}

.farm-map-monitoring-panel__card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  pointer-events: auto;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background-color: rgb(255 255 255 / 0.92);
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.1);
  color: #1e293b;
}

.farm-map-monitoring-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}

.farm-map-monitoring-panel__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.farm-map-monitoring-panel__title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
}

.farm-map-monitoring-panel__pager {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.farm-map-monitoring-panel__pager[hidden] {
  display: none;
}

.farm-map-monitoring-panel__pager-btn {
  border: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  cursor: pointer;
}

.farm-map-monitoring-panel__pager-btn:disabled {
  color: #94a3b8;
  cursor: default;
}

.farm-map-monitoring-panel__pager-index {
  min-width: 2.1rem;
  text-align: center;
}

.farm-map-monitoring-panel__close {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.farm-map-monitoring-panel__status,
.farm-map-monitoring-panel__bearing {
  margin: 0.4rem 0 0;
  font-size: 0.7rem;
  color: #475569;
}

.farm-map-monitoring-panel__status[hidden],
.farm-map-monitoring-panel__bearing.hidden {
  display: none;
}

.farm-map-monitoring-panel__label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.6rem;
  min-width: 0;
  font-size: 0.7rem;
  font-weight: 600;
}

.farm-map-monitoring-panel__input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 400;
}

.farm-map-monitoring-panel__input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.farm-map-monitoring-panel__input[type="number"]::-webkit-outer-spin-button,
.farm-map-monitoring-panel__input[type="number"]::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.farm-map-monitoring-panel__types {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  margin-top: 0.55rem;
  border: 0;
  padding: 0;
  font-size: 0.75rem;
}

.farm-map-monitoring-panel__types legend {
  float: none;
  width: auto;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.farm-map-monitoring-panel__types label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-right: 0.75rem;
}

.farm-map-monitoring-panel__coords {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem;
  margin-top: 0.35rem;
  min-width: 0;
  width: 100%;
}

.farm-map-monitoring-panel__coords.hidden {
  display: none;
}

.farm-map-monitoring-panel__coords .farm-map-monitoring-panel__label {
  margin-top: 0;
  min-width: 0;
}

.farm-map-monitoring-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.farm-map-monitoring-panel__btn.hidden {
  display: none;
}

.farm-map-monitoring-panel__btn {
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  background: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.farm-map-monitoring-panel__btn--save {
  background: #047857;
  border-color: #047857;
  color: #fff;
}

.farm-map-monitoring-panel__btn--form {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  text-decoration: none;
}

.farm-map-monitoring-panel__btn--danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.farm-map-monitoring-panel__btn--danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.farm-map-monitoring-panel__error {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  color: #b91c1c;
}

.monitoring-map-key__label {
  white-space: nowrap;
}

.monitoring-map-canvas {
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: #e2e8f0;
}

.monitoring-map-canvas.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: inherit;
  z-index: 0;
}

/* Farm map — full viewport below navbar (layout: body.farm-map-page-layout + flex main) */
body.farm-map-page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Navbar + page content live in .app-shell (see application.html.erb). */
body.farm-map-page-layout > .app-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  min-width: 0;
}

body.farm-map-page-layout [data-farm-map-root] {
  flex: 1 1 0%;
  min-height: 0;
}

/* Map canvas aligns with main column (app-shell padding when folio tabs visible). */

/* Farm map — Leaflet needs explicit size; min-h-0 lets flex children shrink so the shell fills main */
[data-farm-map-root] .farm-map-map-shell {
  flex: 1 1 0%;
  min-height: 0;
}

.landbase-visit-map-canvas {
  width: 100%;
  height: 18rem;
  min-height: 18rem;
  background: #e2e8f0;
}

.landbase-visit-map-canvas.leaflet-container {
  width: 100%;
  height: 18rem;
  min-height: 18rem;
  z-index: 0;
}

.farm-map-canvas.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: 16rem;
  z-index: 0;
}

.farm-map-hillshade-pane {
  mix-blend-mode: multiply;
  -webkit-mix-blend-mode: multiply;
  pointer-events: none;
}

.farm-map-hillshade-overlay {
  image-rendering: auto;
  image-rendering: smooth;
}

.farm-map-analysis-overlay,
.farm-map-analysis-overlay img {
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.farm-map-contour-popup .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0.25rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  padding: 0;
}

.farm-map-contour-popup .leaflet-popup-content {
  margin: 0.35rem 0.55rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

.farm-map-contour-popup .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.95);
}

/* Zoom +/- top-right; map key and edit tools stay upper-left */
[data-farm-map-root] .leaflet-top.leaflet-right {
  top: 0.75rem;
  right: 0.75rem;
}

[data-farm-map-root] .farm-map-right-controls {
  width: min(22rem, calc(100vw - 2rem));
}

.farm-map-selection-status {
  flex: 1 1 auto;
  z-index: 20;
  margin: 0;
  padding: 0.2rem 0.5rem;
  border-top: none;
  background: transparent;
  color: #1c1917;
  font-size: 0.6875rem;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: normal;
  word-break: break-word;
  min-width: 0;
}

.farm-map-status-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  z-index: 20;
  min-height: 1.25rem;
  padding: 0.15rem 0.5rem 0.15rem 0.35rem;
  border-top: none;
  background: #f2af20;
}

.farm-map-brand-logo {
  position: absolute;
  /* Start at the right edge of the map key (bottom-left of the map canvas). */
  left: var(--farm-map-key-width, 16rem);
  right: auto;
  /* Sit on the status fill; 1px overlap blends the yellow tip into the bar. */
  bottom: calc(100% - 1px);
  z-index: 21;
  display: flex;
  flex-shrink: 0;
  align-items: flex-end;
  height: 3.9rem;
  margin: 0;
  padding: 0 0 0 0.35rem;
  line-height: 0;
  background: transparent;
  pointer-events: auto;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.35));
}

.farm-map-brand-logo__img {
  display: block;
  height: 100%;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  vertical-align: bottom;
}

.farm-map-brand-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgb(0 0 0 / 0.72);
  pointer-events: none;
  overflow: auto;
}

.farm-map-brand-lightbox[hidden] {
  display: none;
}

.farm-map-brand-lightbox__img {
  /* Native 1:1 pixel size of goodall-maps-logo.png */
  width: 1024px;
  height: 247px;
  max-width: none;
  max-height: none;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 24px rgb(0 0 0 / 0.45));
}

.farm-map-status-trailing {
  position: relative;
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.farm-map-scale {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.15rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.farm-map-scale:hover {
  border-color: rgb(28 25 23 / 0.35);
  background: rgb(255 255 255 / 0.35);
}

.farm-map-scale:focus {
  outline: none;
}

.farm-map-scale:focus-visible {
  box-shadow: 0 0 0 2px #1c1917;
}

.farm-map-scale.is-active {
  border-color: #1c1917;
  background: rgb(255 255 255 / 0.55);
}

.farm-map-scale .leaflet-control-scale {
  margin: 0;
  float: none;
  background: transparent;
  box-shadow: none;
  border: none;
  pointer-events: none;
}

.farm-map-scale .leaflet-control-scale-line {
  border-color: #1c1917;
  border-top: none;
  background: transparent;
  color: #1c1917;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.1;
  padding: 0 0.1rem;
  text-shadow: none;
  box-shadow: none;
}

.farm-map-scale .leaflet-control-scale-line:not(:first-child) {
  display: none;
}

.farm-map-canvas--measuring {
  cursor: crosshair;
}

.farm-map-canvas--measuring .leaflet-container {
  cursor: crosshair;
}

.farm-map-measure-label {
  background: transparent;
  border: none;
}

.farm-map-measure-label__text {
  display: inline-block;
  transform: translate(-50%, -50%);
  padding: 0.1rem 0.3rem;
  border-radius: 0.2rem;
  background: rgb(254 243 199 / 0.92);
  color: #78350f;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  pointer-events: none;
}

.farm-map-measure-label--total .farm-map-measure-label__text {
  background: rgb(120 53 15 / 0.92);
  color: #fef3c7;
}

.farm-map-north-arrow {
  position: absolute;
  right: 0.5rem;
  /* Sit just above Leaflet’s bottom-right attribution. */
  bottom: 1.85rem;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.85);
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.2);
  pointer-events: none;
}

.farm-map-north-arrow__icon {
  font-size: 1.65rem;
  line-height: 1;
  color: #0f172a;
}

[data-farm-map-root] .leaflet-bottom.leaflet-right {
  margin-bottom: 0.15rem;
  margin-right: 0.35rem;
}

.farm-map-outline-mask-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}

.farm-map-outline-mask-toggle:hover {
  background: rgb(15 23 42 / 0.08);
}

.farm-map-outline-mask-toggle:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
}

.farm-map-outline-mask-toggle.is-inactive {
  color: #94a3b8;
}

.farm-map-outline-mask-toggle__icon {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}

.farm-map-layer-table-toggle {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: rgb(255 255 255 / 0.92);
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
  box-shadow: 0 4px 12px rgb(15 23 42 / 0.12);
}

.farm-map-layer-table-toggle:hover {
  background: #fff;
}

.farm-map-layer-table {
  display: flex;
  max-height: min(28rem, calc(100dvh - 10rem));
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 0.92);
  box-shadow: 0 8px 24px rgb(15 23 42 / 0.14);
}

.farm-map-layer-table[hidden] {
  display: none !important;
}

.farm-map-layer-table__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.75rem 0.85rem;
}

.farm-map-layer-table__title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
}

.farm-map-layer-table__hint {
  margin: 0.2rem 0 0;
  font-size: 0.65rem;
  color: #64748b;
}

.farm-map-layer-table__close {
  border: 0;
  background: transparent;
  padding: 0 0.2rem;
  font-size: 1.25rem;
  line-height: 1;
  color: #64748b;
}

.farm-map-layer-table__close:hover {
  color: #0f172a;
}

.farm-map-layer-table__body {
  overflow: auto;
  padding: 0.5rem 0.75rem 0.75rem;
}

.farm-map-layer-table__empty {
  margin: 0.5rem 0;
  font-size: 0.75rem;
  color: #64748b;
}

.farm-map-layer-table__section + .farm-map-layer-table__section {
  margin-top: 0.85rem;
}

.farm-map-layer-table__section-title {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #334155;
}

.farm-map-layer-table__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.farm-map-layer-table__table th {
  padding: 0.25rem 0.35rem;
  text-align: left;
  font-weight: 600;
  color: var(--color-table-header-text);
  background-color: var(--color-table-header);
  border-bottom: 1px solid color-mix(in srgb, var(--color-black) 25%, var(--color-table-header));
}

.farm-map-layer-table__row {
  cursor: pointer;
}

.farm-map-layer-table__row:hover {
  background: #fff7ed;
}

.farm-map-layer-table__row--selected {
  background: #ffedd5;
}

.farm-map-layer-table__row--selected:hover {
  background: #fed7aa;
}

.farm-map-layer-table__cell {
  padding: 0.35rem;
  vertical-align: top;
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
}

.farm-map-layer-table__cell--index {
  width: 2rem;
  font-variant-numeric: tabular-nums;
  color: #475569;
}

.farm-map-layer-table__cell--area {
  width: 4.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.farm-map-layer-table__cell--name {
  min-width: 7rem;
}

.farm-map-layer-table__cell--standing {
  min-width: 8rem;
}

.farm-map-layer-table__name-input {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  background: #fff;
  color: #0f172a;
  font: inherit;
  line-height: 1.25;
}

.farm-map-layer-table__name-input:focus {
  outline: 2px solid #0284c7;
  outline-offset: 1px;
  border-color: #0284c7;
}

.farm-map-layer-table__name-input:disabled {
  opacity: 0.65;
}

.farm-map-tabular-tooltip {
  max-width: none;
  line-height: 1.35;
}

.farm-map-tabular-tooltip .leaflet-tooltip-content {
  white-space: nowrap;
}

.farm-map-tabular-tooltip__line {
  white-space: nowrap;
}

.farm-map-tabular-tooltip__line + .farm-map-tabular-tooltip__line {
  margin-top: 0.15rem;
}

[data-farm-map-root] .leaflet-overlay-pane path.farm-map-part--selected {
  stroke: #c2410c !important;
  stroke-width: 3;
  fill: #fb923c !important;
  fill-opacity: 0.225 !important;
}

/* Left dock: map key full height, width hugs content (not a fixed sidebar). */
[data-farm-map-root] {
  --farm-map-key-width: 12.5rem; /* fallback until measured */
}

[data-farm-map-root] .farm-map-left-controls {
  box-sizing: border-box;
  width: max-content;
  max-width: 14rem;
  min-width: 0;
  height: 100%;
  max-height: none;
  overflow: visible; /* analysis dive / edit toolbar sit to the right */
}

[data-farm-map-root] .farm-map-key-aside {
  box-sizing: border-box;
  width: max-content;
  max-width: 14rem;
  min-width: 0;
  height: 100%;
  max-height: none;
  overflow-x: hidden;
  background-color: rgb(255 255 255 / 0.8);
}

.farm-map-key-panel {
  width: max-content;
  max-width: 14rem;
  min-width: 0;
}

.farm-map-key-panel__scroll,
.farm-map-key-panel > .shrink-0 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.farm-map-key-panel input,
.farm-map-key-panel button,
.farm-map-key-panel label,
.farm-map-key-panel a,
.farm-map-key-panel .farm-map-qfield-logos {
  pointer-events: auto;
}

.farm-map-qfield-logos {
  margin-top: 0.75rem;
}

.farm-map-visit-tracks-disclosure {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.farm-map-visit-tracks-disclosure:hover:not(:disabled) {
  background: rgb(15 23 42 / 0.08);
}

.farm-map-visit-tracks-disclosure:disabled {
  cursor: default;
  opacity: 0.5;
}

.farm-map-visit-tracks-disclosure:focus {
  outline: none;
}

.farm-map-visit-tracks-disclosure:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
}

.farm-map-visit-tracks-disclosure__icon {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  transition: transform 0.12s ease;
}

.farm-map-visit-tracks-disclosure.is-expanded .farm-map-visit-tracks-disclosure__icon {
  transform: rotate(90deg);
}

.farm-map-visit-tracks-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgb(15 23 42 / 0.15);
}

.farm-map-qfield-logos__form {
  margin: 0;
  pointer-events: auto;
}

.farm-map-qfield-logos__pair {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  max-width: 100%;
}

.farm-map-qfield-logos__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.2rem;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: default;
}

a.farm-map-qfield-logos__mark,
button.farm-map-qfield-logos__mark--send {
  cursor: pointer;
}

a.farm-map-qfield-logos__mark:hover,
button.farm-map-qfield-logos__mark--send:hover {
  background: rgb(15 23 42 / 0.06);
}

.farm-map-qfield-logos__img {
  display: block;
  width: auto;
  object-fit: contain;
}

.farm-map-qfield-logos__img--cloud {
  height: 2.4rem;
  max-width: 3.75rem;
}

.farm-map-qfield-logos__img--qfield {
  height: 1.85rem;
  max-width: 2.1rem;
}

.farm-map-qfield-logos__mark--muted {
  cursor: default;
}

/* QField icon tones: orange = needs syncing, green = up to date, gray = no privilege */
.farm-map-qfield-logos__mark--needs-sync .farm-map-qfield-logos__img--qfield {
  /* Recolor brand green SVG to orange (~#ea580c) */
  filter: brightness(0) saturate(100%) invert(42%) sepia(98%) saturate(1800%)
    hue-rotate(1deg) brightness(102%) contrast(101%);
}

.farm-map-qfield-logos__mark--synced .farm-map-qfield-logos__img--qfield {
  filter: none;
}

.farm-map-qfield-logos__mark--muted .farm-map-qfield-logos__img {
  filter: grayscale(1) opacity(0.45);
}

.farm-map-qfield-logos--compact {
  margin-top: 0;
}

.farm-map-qfield-logos--compact .farm-map-qfield-logos__pair {
  gap: 0.3rem;
}

.farm-map-qfield-logos--compact .farm-map-qfield-logos__img--cloud {
  height: 1.65rem;
  max-width: 2.5rem;
}

.farm-map-qfield-logos--compact .farm-map-qfield-logos__img--qfield {
  height: 1.35rem;
  max-width: 1.55rem;
}

.farm-map-qfield-logos--compact .farm-map-qfield-logos__mark {
  padding: 0.1rem;
}

.farm-map-qfield-status {
  margin: 0.15rem 0 0.2rem;
  padding: 0 0.2rem;
  color: #334155;
  font-size: 0.65rem;
  line-height: 1.3;
  text-align: left;
}

.farm-map-qfield-status--failed {
  color: #b91c1c;
}

.farm-map-qfield-sync-dialog {
  margin: auto;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  max-width: min(22rem, calc(100vw - 2rem));
  color: #0f172a;
  background: #fff;
  box-shadow: 0 10px 25px rgb(15 23 42 / 0.18);
}

.farm-map-qfield-sync-dialog::backdrop {
  background: rgb(15 23 42 / 0.35);
}

.farm-map-qfield-sync-dialog__panel {
  padding: 1rem 1.1rem 1.1rem;
}

.farm-map-qfield-sync-dialog__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.farm-map-qfield-sync-dialog__hint {
  margin: 0 0 0.75rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.farm-map-qfield-sync-dialog__steps {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.farm-map-qfield-sync-dialog__steps li {
  color: #94a3b8;
}

.farm-map-qfield-sync-dialog__steps li.is-active {
  color: #c2410c;
  font-weight: 600;
}

.farm-map-qfield-sync-dialog__steps li.is-done {
  color: #047857;
}

.farm-map-qfield-sync-dialog__steps li.is-failed {
  color: #b91c1c;
  font-weight: 600;
}

.farm-map-qfield-sync-dialog__message {
  margin: 0 0 0.75rem;
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.4;
  min-height: 2.4em;
}

.farm-map-qfield-sync-dialog__conflicts {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #fcd34d;
  border-radius: 0.375rem;
  background: #fffbeb;
  color: #78350f;
  font-size: 0.75rem;
  line-height: 1.35;
}

.farm-map-qfield-sync-dialog__conflict-title {
  margin: 0;
  font-weight: 600;
}

.farm-map-qfield-sync-dialog__conflict-list {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
}

.farm-map-qfield-sync-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.farm-map-qfield-sync-dialog__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.farm-map-qfield-sync-dialog__close:hover {
  background: #f1f5f9;
}

.farm-map-edit-toolbar {
  position: relative;
  top: auto;
  left: auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  width: max-content;
  height: max-content;
  max-width: min(42rem, calc(100vw - 26rem));
  flex-shrink: 0;
  padding: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background-color: rgb(255 255 255 / 0.8);
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
  /* Whole toolbar must capture clicks — gaps used to pass through to the map and clear selection. */
  pointer-events: auto;
}

.farm-map-analysis-dive {
  position: relative;
  top: auto;
  left: auto;
  width: 100%;
  max-height: none;
  overflow: visible;
  pointer-events: none;
  flex-shrink: 0;
}

.farm-map-analysis-dive.hidden,
.farm-map-analysis-dive[hidden] {
  display: none;
}

.farm-map-analysis-dive__panel {
  pointer-events: auto;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background-color: rgb(255 255 255 / 0.8);
  box-shadow: 0 4px 6px -1px rgb(15 23 42 / 0.1), 0 2px 4px -2px rgb(15 23 42 / 0.1);
}

.farm-map-analysis-dive__compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: inherit;
  color: #475569;
}

.farm-map-analysis-dive__dates {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 0.5rem;
  row-gap: 0.4rem;
}

.farm-map-analysis-dive__date {
  display: block;
  box-sizing: border-box;
  width: 7.1rem;
  min-width: 0;
  max-width: 100%;
  padding-left: 0.35rem;
  padding-right: 0.2rem;
  field-sizing: content;
}

.farm-map-analysis-dive__date::-webkit-datetime-edit,
.farm-map-analysis-dive__date::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  margin: 0;
}

.farm-map-analysis-dive__date::-webkit-calendar-picker-indicator {
  margin-left: 0.15rem;
  margin-right: 0;
  padding: 0;
  width: 0.85rem;
  height: 0.85rem;
  cursor: pointer;
}

/* Below map-key / analysis dive (z-1000); above the Leaflet canvas. */
.farm-map-scene-compare-stick {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 500;
  width: 1.25rem;
  height: 100%;
  margin-left: -0.625rem;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
  pointer-events: auto;
}

.farm-map-scene-compare-stick::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: #f8fafc;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.55), 0 0 8px rgb(15 23 42 / 0.25);
  pointer-events: none;
}

.farm-map-scene-compare-stick[hidden] {
  display: none !important;
}

.farm-map-scene-compare-stick__grabber {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.1rem;
  height: 1.1rem;
  margin: -0.55rem 0 0 -0.55rem;
  border-radius: 9999px;
  border: 2px solid #f8fafc;
  background: #0f172a;
  box-shadow: 0 1px 4px rgb(15 23 42 / 0.35);
  pointer-events: none;
}

.farm-map-scene-compare-stick.is-dragging,
.farm-map-scene-compare-stick.is-dragging .farm-map-scene-compare-stick__grabber {
  cursor: grabbing;
}

.farm-map-analysis-dive__panel input,
.farm-map-analysis-dive__panel select,
.farm-map-analysis-dive__panel button,
.farm-map-analysis-dive__panel label {
  pointer-events: auto;
}

.farm-map-index-key {
  width: 100%;
  font-size: 0.625rem;
  line-height: 1.25;
  color: #334155;
  background: transparent;
}

.farm-map-index-key__row {
  display: grid;
  grid-template-columns: 0.7rem 2rem minmax(0, 1fr);
  column-gap: 0.35rem;
  align-items: center;
  padding: 0.12rem 0;
  background: transparent !important;
  cursor: help;
}

.farm-map-index-key__swatch {
  display: flex;
  align-items: center;
}

.farm-map-index-key__swatch > span {
  display: block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.1rem;
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.12);
}

.farm-map-index-key__value {
  font-variant-numeric: tabular-nums;
  color: #64748b;
  white-space: nowrap;
}

.farm-map-index-key__label {
  color: #334155;
  min-width: 0;
}

/* Escape global markdown table zebra stripes (stockman.css styles all <table>). */
.farm-map-analysis-dive table.farm-map-index-key,
.farm-map-analysis-dive table.farm-map-index-key tbody,
.farm-map-analysis-dive table.farm-map-index-key tbody tr,
.farm-map-analysis-dive table.farm-map-index-key tbody tr:nth-child(odd),
.farm-map-analysis-dive table.farm-map-index-key tbody tr:nth-child(even),
.farm-map-analysis-dive table.farm-map-index-key tbody tr:hover,
.farm-map-analysis-dive table.farm-map-index-key tbody tr > th,
.farm-map-analysis-dive table.farm-map-index-key tbody tr > td {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
}

.farm-map-satellite-zoom-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.farm-map-satellite-zoom-lock:hover,
.farm-map-satellite-zoom-lock:focus-visible {
  color: #0f172a;
  background: rgb(148 163 184 / 0.2);
}

.farm-map-satellite-zoom-lock.is-locked {
  color: #c2410c;
}

.farm-map-satellite-zoom-lock__closed {
  display: none;
}

.farm-map-satellite-zoom-lock.is-locked .farm-map-satellite-zoom-lock__open {
  display: none;
}

.farm-map-satellite-zoom-lock.is-locked .farm-map-satellite-zoom-lock__closed {
  display: block;
}

.farm-map-key-divider {
  border: 0;
  border-top: 1px solid rgb(148 163 184 / 0.4);
  margin: 0.75rem 0;
}

.farm-map-key-panel fieldset {
  border: none;
  margin: 0;
  min-width: 0;
}

.farm-map-key-panel fieldset legend {
  float: none;
  width: auto;
  padding: 0;
}

/* EOV Short/Long/Proposed nest under the EOV master toggle (not Tailwind — utilities may be purged). */
.farm-map-eov-site-layers {
  margin: 0.25rem 0 0.35rem 1.15rem;
  padding-left: 0.55rem;
  border-left: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.farm-map-eov-site-layers__row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.farm-map-layer-key-label {
  display: flex;
  min-width: 0;
  flex: 1 1 0%;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
}

.farm-map-layer-key-label:has(input:disabled) {
  cursor: not-allowed;
}

.farm-map-edit-toolbar.hidden {
  display: none;
}

.farm-map-edit-tool {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 0.375rem;
  background-color: rgb(255 255 255 / 0.8);
  color: #334155;
  cursor: pointer;
}

/* Must beat `.farm-map-edit-tool { display: flex }` (and Tailwind `.hidden`). */
.farm-map-edit-tool.hidden {
  display: none !important;
}

.farm-map-hasl-editor {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.15rem;
  padding: 0 0.35rem;
  border-radius: 0.375rem;
  background-color: rgb(255 255 255 / 0.85);
  color: #334155;
  font-size: 0.7rem;
}

.farm-map-hasl-editor.hidden {
  display: none !important;
}

.farm-map-hasl-editor__label {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.farm-map-hasl-editor__input {
  width: 4.5rem;
  border: 1px solid rgb(148 163 184 / 0.7);
  border-radius: 0.25rem;
  padding: 0.15rem 0.35rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.75rem;
  line-height: 1.25;
}

.farm-map-hasl-editor__unit {
  color: #64748b;
}

.farm-map-hasl-editor__source {
  color: #64748b;
  white-space: nowrap;
}

.farm-map-capital-link-editor {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.15rem;
  padding: 0 0.35rem;
  border-radius: 0.375rem;
  background-color: rgb(255 255 255 / 0.85);
  color: #334155;
  font-size: 0.7rem;
}

.farm-map-capital-link-editor.hidden {
  display: none !important;
}

.farm-map-capital-link-editor__status {
  color: #64748b;
  white-space: nowrap;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.farm-map-capital-link-dialog {
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0;
  max-width: 24rem;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 40px rgb(15 23 42 / 0.18);
}

.farm-map-capital-link-dialog::backdrop {
  background: rgb(15 23 42 / 0.35);
}

.farm-map-capital-link-dialog__form {
  display: grid;
  gap: 0.65rem;
  padding: 1rem 1.1rem 1.1rem;
}

.farm-map-capital-link-dialog__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.farm-map-capital-link-dialog__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
}

.farm-map-capital-link-dialog__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
}

.farm-map-capital-link-dialog__select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  background: #fff;
}

.farm-map-capital-link-dialog__error {
  margin: 0;
  font-size: 0.75rem;
  color: #b91c1c;
}

.farm-map-capital-link-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.farm-map-capital-link-dialog__btn {
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}

.farm-map-capital-link-dialog__btn--primary {
  border-color: #991b1b;
  background: #b91c1c;
  color: #fff;
}

.farm-map-edit-tool:hover {
  background-color: rgb(255 255 255 / 0.95);
}

.farm-map-edit-tool--active {
  background-color: rgb(255 255 255 / 0.95);
  box-shadow: inset 0 0 0 2px rgb(148 163 184 / 0.8);
}

.farm-map-edit-tool--save {
  color: #047857;
}

.farm-map-edit-tool--save:hover {
  background-color: rgb(236 253 245 / 0.95);
}

.farm-map-edit-tool--close {
  color: #334155;
}

.farm-map-edit-tool--ampersand {
  min-width: 1.75rem;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.farm-map-edit-tool-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0.15rem;
}

.farm-map-edit-tool--labeled {
  width: auto;
  gap: 0.25rem;
  padding: 0 0.5rem;
}

.farm-map-edit-tool__label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.farm-map-edit-toolbar__divider {
  align-self: stretch;
  width: 1px;
  margin: 0.125rem 0.125rem;
  background-color: rgb(148 163 184 / 0.5);
  pointer-events: none;
}

/* Leaflet vertex handles must sit above the HTML map key / edit toolbar (z-index 1000). */
[data-farm-map-root].farm-map-editing-active .farm-map-edit-toolbar {
  z-index: 1200;
}

[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane,
[data-farm-map-root].farm-map-editing-active .leaflet-overlay-pane {
  z-index: 1100 !important;
}

/* Vertex handles while drawing/editing property outline or paddocks (12px / 28px). */
[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane .leaflet-editing-icon:not(.leaflet-edit-resize) {
  width: 12px !important;
  height: 12px !important;
  margin-left: -6px !important;
  margin-top: -6px !important;
  border: 1.5px solid #dc2626 !important;
  background: #ffffff !important;
  border-radius: 50%;
  box-sizing: border-box;
}

[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane .leaflet-editing-icon:not(.leaflet-edit-resize).leaflet-touch-icon {
  width: 28px !important;
  height: 28px !important;
  margin-left: -14px !important;
  margin-top: -14px !important;
}

/* Mid-edge segment split handles: half the vertex size. */
[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane .leaflet-editing-icon.leaflet-edit-resize {
  width: 6px !important;
  height: 6px !important;
  margin-left: -3px !important;
  margin-top: -3px !important;
  border: 1px solid #dc2626 !important;
  background: #ffffff !important;
  border-radius: 50%;
  box-sizing: border-box;
}

[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane .leaflet-editing-icon.leaflet-edit-resize.leaflet-touch-icon {
  width: 14px !important;
  height: 14px !important;
  margin-left: -7px !important;
  margin-top: -7px !important;
}

/* Selected outline / paddock polygons while the edit toolbar is open. */
[data-farm-map-root].farm-map-editing-active .leaflet-overlay-pane path.farm-map-outline--selected {
  fill: #fb923c !important;
  fill-opacity: 0.225 !important;
  stroke: #c2410c !important;
  stroke-width: 3px !important;
}

/*
 * Transparent-fill polygons (property outline with inverse outside fill, or fill toggled off)
 * must still receive interior clicks. Leaflet defaults to pointer-events: visiblePainted, which
 * ignores fill-opacity: 0.
 */
[data-farm-map-root] .leaflet-overlay-pane path.leaflet-interactive[fill-opacity="0"] {
  pointer-events: fill;
}

.farm-map-draw-point-icon {
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 9999px;
  border: 2px solid #c2410c;
  background: #fb923c;
  box-sizing: border-box;
}

/* Account classification tree (Capital accounts) — four columns, left to right. */
.account-classification-guide {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
}

.account-classification-guide__lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgb(51 65 85);
}

.account-classification-guide__chart {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.375rem;
  background: rgb(255 255 255);
  border: 1px dashed rgb(203 213 225);
}

.account-classification-guide__chart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
}

.account-classification-guide__chart-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  background: rgb(241 245 249);
  border: 1px solid rgb(226 232 240);
}

.account-classification-guide__chart-level {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}

.account-classification-guide__chart-example {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(30 41 59);
}

.account-classification-guide__chart-arrow {
  font-size: 1rem;
  font-weight: 700;
  color: rgb(148 163 184);
  line-height: 1;
}

.account-classification-guide__tips {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgb(71 85 105);
}

.account-classification-picker__selected-label {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(100 116 139);
}

.account-classification-picker__path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  min-height: 1.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: rgb(255 247 237);
  border: 1px solid rgb(254 215 170);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(154 52 18);
}

.account-classification-picker__path--empty {
  font-weight: 500;
  color: rgb(100 116 139);
  background: rgb(248 250 252);
  border-color: rgb(226 232 240);
}

.account-classification-picker__path-segment {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.account-classification-picker__path-segment:hover {
  background: rgb(255 237 213);
  border-color: rgb(253 186 116);
}

.account-classification-picker__path-segment--current {
  background: rgb(255 255 255);
  border-color: rgb(234 88 12);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.account-classification-picker__path-level {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(234 88 12);
}

.account-classification-picker__path-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.account-classification-picker__path-arrow {
  color: rgb(234 88 12);
  font-weight: 700;
}

.account-classification-picker__board {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  min-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.account-classification-picker__arrow {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: rgb(148 163 184);
  line-height: 1;
}

.account-classification-picker__column {
  display: flex;
  flex: 1 1 11rem;
  flex-direction: column;
  min-width: 11rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(255 255 255);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
  transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-classification-picker__column--inactive {
  opacity: 0.55;
  border-style: dashed;
  background: rgb(248 250 252);
}

.account-classification-picker__column--has-selection {
  border-color: rgb(253 186 116);
  box-shadow: 0 0 0 1px rgb(254 215 170);
}

.account-classification-picker__column-header {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(241 245 249);
  border-radius: 0.5rem 0.5rem 0 0;
}

.account-classification-picker__level {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(71 85 105);
}

.account-classification-picker__options {
  flex: 1 1 auto;
  min-height: 6rem;
  max-height: 11rem;
  overflow-y: auto;
  padding: 0.35rem 0.25rem;
}

.account-classification-picker__option {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.account-classification-picker__option:hover {
  background: rgb(241 245 249);
}

.account-classification-picker__option--selected {
  background: rgb(255 247 237);
}

.account-classification-picker__radio {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.account-classification-picker__option-label {
  font-size: 0.8125rem;
  line-height: 1.35;
  color: rgb(30 41 59);
}

.account-classification-picker__empty {
  margin: 0.5rem 0.4rem;
  font-size: 0.75rem;
  font-style: italic;
  color: rgb(148 163 184);
}

/* Capital accounts index — classification lane chart */
.accounts-index-toolbar {
  border: 1px solid var(--color-filter-border);
  border-radius: 0.75rem;
  background: var(--color-filter-bg);
  padding: 0.625rem 0.75rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.accounts-index-toolbar__tab {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(71 85 105);
  text-decoration: none;
}

.accounts-index-toolbar__tab:hover {
  background: rgb(241 245 249);
}

.accounts-index-toolbar__tab--active {
  background: rgb(255 247 237);
  color: rgb(154 52 18);
  box-shadow: inset 0 0 0 1px rgb(254 215 170);
}

.classification-chart__viewport {
  overflow: auto;
  border-radius: 0.75rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.classification-chart__board-wrap {
  padding: 1rem;
  min-width: min(100%, 52rem);
}

.classification-chart__board {
  position: relative;
  margin: 0 auto;
}

.classification-chart__edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.classification-chart__edge {
  fill: none;
  stroke: rgb(148 163 184);
  stroke-width: 1.5;
}

.classification-chart__edge--account {
  stroke: rgb(234 88 12);
  stroke-width: 1.25;
  opacity: 0.75;
}

.classification-chart__lanes {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

.classification-chart__lane {
  flex: 0 0 auto;
  border-right: 1px dashed rgb(203 213 225);
}

.classification-chart__lane:last-child {
  border-right: none;
}

.classification-chart__lane-header {
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(100 116 139);
  line-height: 2.25rem;
  text-align: center;
  background: rgb(241 245 249);
  border-bottom: 1px solid rgb(226 232 240);
}

.classification-chart__lane-title {
  display: block;
}

.classification-chart__lane--accounts .classification-chart__lane-header {
  color: rgb(154 52 18);
  background: rgb(255 247 237);
}

.classification-chart__lane-body {
  position: relative;
  padding: 0.5rem 0.35rem 0.75rem;
}

.classification-chart__node-row {
  position: absolute;
  left: 0.35rem;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 2.25rem;
}

.classification-chart__node {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(255 255 255);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition: opacity 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.classification-chart__node:hover {
  border-color: rgb(148 163 184);
}

.classification-chart__node--editing {
  position: relative;
  padding-right: 1.6rem;
  border-color: rgb(234 88 12);
  box-shadow: 0 0 0 2px rgb(254 215 170);
  cursor: default;
  overflow: visible;
}

.classification-chart__node--dimmed {
  opacity: 0.25;
}

.classification-chart__node-label {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgb(30 41 59);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classification-chart__node-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: rgb(30 41 59);
  outline: none;
}

.classification-chart__node-delete {
  position: absolute;
  top: 50%;
  right: 0.2rem;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: 0;
  padding: 0;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(220 38 38);
  cursor: pointer;
  transform: translateY(-50%);
}

.classification-chart__node-delete:disabled {
  color: rgb(203 213 225);
  cursor: not-allowed;
}

.classification-chart__node-delete:disabled:hover {
  background: transparent;
  color: rgb(203 213 225);
}

.classification-chart__node-delete:hover {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.classification-chart__node-add-child {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid rgb(147 197 253);
  border-radius: 0.25rem;
  background: rgb(239 246 255);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(29 78 216);
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.classification-chart__node-add-child:hover {
  background: rgb(219 234 254);
  border-color: rgb(96 165 250);
  color: rgb(30 64 175);
}

.classification-chart__node-add-sibling {
  position: absolute;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: -0.675rem;
  padding: 0;
  border: 1px dashed rgb(147 197 253);
  border-radius: 9999px;
  background: rgb(255 255 255);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(29 78 216);
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.classification-chart__node-add-sibling:hover {
  background: rgb(239 246 255);
  border-color: rgb(96 165 250);
}

.classification-chart__account-add-slot {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  min-height: 2.25rem;
  border-radius: 0.375rem;
  border: 1px dashed rgb(254 215 170);
  background: rgb(255 251 235 / 0.65);
  pointer-events: none;
}

.classification-chart__account-add {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px dashed rgb(251 146 60);
  background: rgb(255 247 237);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(234 88 12);
  text-decoration: none;
  cursor: pointer;
}

.classification-chart__account-add:hover {
  background: rgb(255 237 213);
  border-color: rgb(234 88 12);
  color: rgb(154 52 18);
}

.classification-chart__account {
  position: absolute;
  left: 0.35rem;
  right: 0.35rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid rgb(254 215 170);
  background: rgb(255 255 255);
  transition: opacity 0.15s ease;
}

.classification-chart__account--hidden {
  opacity: 0.2;
  pointer-events: none;
}

.classification-chart__account--unclassified {
  border-style: dashed;
  border-color: rgb(203 213 225);
}

.classification-chart__account-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(29 78 216);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classification-chart__account-name:hover {
  text-decoration: underline;
}

.classification-chart__account-currency {
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: rgb(71 85 105);
}

.landbase-gpx-import-dialog {
  margin: auto;
  border: none;
  padding: 0;
  max-width: calc(100vw - 2rem);
}

.landbase-gpx-import-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.landbase-gpx-import-dialog__chart {
  width: 100%;
  min-height: 18rem;
  box-sizing: border-box;
}

.landbase-gpx-import-dialog__chart .elevation-profile-chart__plot {
  min-height: 14rem;
}

.landbase-gpx-import-dialog__chart .elevation-profile-chart__ruler {
  padding-bottom: 0.25rem;
}

.account-balance-chart {
  width: 100%;
  min-height: 16rem;
  margin-top: 1.5rem;
  box-sizing: border-box;
}

.account-balance-chart__plot {
  min-height: 14rem;
}

.account-balance-chart__ruler {
  padding-top: 0.5rem;
  padding-bottom: 0.25rem;
}

.coa-surface-card__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.coa-surface-card__help {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.coa-surface-card__help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #64748b;
  cursor: help;
}

.coa-surface-card__help-icon:hover,
.coa-surface-card__help-icon:focus-visible {
  color: #0f172a;
}

.coa-surface-card__help-svg {
  width: 1rem;
  height: 1rem;
}

.coa-surface-card__help-tip {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 30;
  width: min(22rem, 70vw);
  padding: 0.55rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.14);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  white-space: normal;
  pointer-events: none;
}

.coa-surface-card__help:hover .coa-surface-card__help-tip,
.coa-surface-card__help:focus-within .coa-surface-card__help-tip {
  display: block;
}

.coa-surface-card__help--end .coa-surface-card__help-tip {
  left: auto;
  right: 0;
}

.coa-surface-chart {
  width: 100%;
  min-width: 0;
}

.coa-surface-chart__inner {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
  position: relative;
}

.coa-surface-chart__plot {
  width: 90%;
  max-width: none;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  min-height: 15rem;
}

.coa-surface-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.coa-surface-chart__leaf-label {
  font-size: 0.7rem;
  font-weight: 600;
  pointer-events: none;
}

.coa-surface-chart__leaf-amount {
  font-weight: 500;
  font-size: 0.65rem;
  fill: #334155;
}

.coa-surface-chart__subdivision-label {
  font-size: 0.7rem;
  font-weight: 700;
  pointer-events: none;
}

.coa-surface-chart__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  display: grid;
  gap: 0.15rem;
}

.coa-surface-chart__tooltip strong {
  font-size: 0.8rem;
  color: #0f172a;
}

.coa-surface-chart__tooltip span {
  font-size: 0.75rem;
  color: #475569;
}

.coa-surface-chart__legend-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.coa-surface-chart__legend-accordion {
  width: 90%;
  margin-inline: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.coa-surface-chart__legend-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.coa-surface-chart__legend-summary::-webkit-details-marker {
  display: none;
}

.coa-surface-chart__legend-summary::after {
  content: "▸";
  float: right;
  color: #94a3b8;
  transition: transform 0.15s ease;
}

.coa-surface-chart__legend-accordion[open] > .coa-surface-chart__legend-summary::after {
  transform: rotate(90deg);
}

.coa-surface-chart__legend {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 0.75rem 0.75rem;
}

.coa-surface-chart__legend-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.coa-surface-chart__legend-item {
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.coa-surface-chart__legend-item:last-child {
  border-bottom: 0;
}

.coa-surface-chart__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.15rem;
}

.coa-surface-chart__legend-label {
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coa-surface-chart__legend-value {
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.coa-surface-chart__empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  color: #64748b;
  font-size: 0.875rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.coa-surface-chart__leaf:focus {
  outline: none;
}

.coa-surface-chart__leaf:focus-visible rect {
  stroke: #0f172a;
  stroke-width: 2;
}

.coa-surface-period__range {
  padding-bottom: 0.55rem;
}

/* Project CRS picker (QGIS-style). Explicit sizes — do not rely on Tailwind h-40/max-h-40. */
.crs-picker__toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.crs-picker__filter-hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #64748b;
}

.crs-picker__filter-toggle {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #1d4ed8;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.crs-picker__list-wrap {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
}

.crs-picker__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 11rem;
  overflow-y: auto;
}

.crs-picker__option {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  text-align: left;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  color: inherit;
}

.crs-picker__option:hover,
.crs-picker__option:focus-visible {
  background: #fffbeb;
  outline: none;
}

.crs-picker__option--selected {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #d97706;
}

.crs-picker__option-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}

.crs-picker__option-name {
  font-size: 0.75rem;
  color: #334155;
}

.crs-picker__option-area {
  font-size: 0.6875rem;
  color: #64748b;
}

.crs-picker__empty {
  padding: 0.75rem 0.65rem;
  font-size: 0.75rem;
  color: #64748b;
}

.crs-picker__map-wrap {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #f8fafc;
}

.crs-picker__map {
  width: 100%;
  height: 10rem;
  min-height: 10rem;
}

.crs-picker__map.leaflet-container {
  width: 100%;
  height: 10rem;
  background: #e2e8f0;
  font: inherit;
}

.crs-picker__area {
  margin: 0;
  border-top: 1px solid #e2e8f0;
  padding: 0.4rem 0.65rem;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: #475569;
}

.crs-picker__save-hint {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #64748b;
}

/* Font-GIS icons in toolbar (https://github.com/Viglino/font-gis) */
.farm-map-edit-tool__icon {
  display: inline-block;
  width: 1.25rem;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
}

.farm-map-edit-tool__crud-icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.monitoring-sites-accordion__chevron,
.monitoring-events-accordion__chevron,
.paddock-ndvi-accordion__chevron,
.landbase-field-warnings-accordion__chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.monitoring-sites-accordion[open] .monitoring-sites-accordion__chevron,
.monitoring-events-accordion[open] .monitoring-events-accordion__chevron,
.paddock-ndvi-accordion[open] .paddock-ndvi-accordion__chevron,
.landbase-field-warnings-accordion[open] .landbase-field-warnings-accordion__chevron {
  transform: rotate(180deg);
}

.eco-eov-sites-placeholder {
  color: inherit;
  cursor: pointer;
}

.eco-eov-sites-placeholder:hover {
  background-color: #ecfdf5;
}

.eco-eov-sites-placeholder:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
}

.monitoring-events-table {
  table-layout: fixed;
  width: 100%;
}

.monitoring-events-table th:nth-child(1),
.monitoring-events-table td:nth-child(1) {
  width: 14%;
}

.monitoring-events-table th:nth-child(2),
.monitoring-events-table td:nth-child(2) {
  width: 14%;
  text-align: center;
}

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

.monitoring-events-table th:nth-child(4),
.monitoring-events-table td:nth-child(4) {
  width: 18%;
}

.monitoring-events-table th:nth-child(5),
.monitoring-events-table td:nth-child(5) {
  width: 18%;
}

.monitoring-events-table th:nth-child(6),
.monitoring-events-table td:nth-child(6) {
  width: 26%;
}

.monitoring-sites-table {
  table-layout: fixed;
  width: 100%;
}

.monitoring-sites-table th:nth-child(1),
.monitoring-sites-table td:nth-child(1) {
  width: 42%;
}

.monitoring-sites-table th:nth-child(2),
.monitoring-sites-table td:nth-child(2) {
  width: 28%;
}

.monitoring-sites-table th:nth-child(3),
.monitoring-sites-table td:nth-child(3) {
  width: 30%;
}

/* Many event columns: keep Site + Type/Source tight; scroll for events. */
.eov-sites-events-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.eov-sites-events-table th,
.eov-sites-events-table td {
  padding: 0.4rem 0.4rem;
  vertical-align: top;
}

.eov-sites-events-table__site {
  width: 9.5rem;
  max-width: 9.5rem;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
}

.eov-sites-events-table thead .eov-sites-events-table__site,
.eov-sites-events-table thead .eov-sites-events-table__meta {
  z-index: 2;
  color: var(--color-table-header-text) !important;
  background: var(--color-table-header) !important;
  background-clip: padding-box;
}

.eov-sites-events-table__meta {
  width: 3.4rem;
  max-width: 3.4rem;
  position: sticky;
  left: 9.5rem;
  z-index: 1;
  background: #fff;
  box-shadow: 1px 0 0 #e2e8f0;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  color: #334155;
}

.eov-sites-events-table__meta-stack {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  line-height: 1.15;
  font-size: 0.68rem;
  word-break: break-word;
  hyphens: auto;
}

.eov-sites-events-table thead .eov-sites-events-table__meta-stack {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
}

.eov-sites-events-table__event {
  width: 7rem;
  min-width: 7rem;
  max-width: 7rem;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.eov-sites-events-table thead .eov-sites-events-table__event {
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
}

.eco-site-row--eov:hover .eov-sites-events-table__site,
.eco-site-row--eov:hover .eov-sites-events-table__meta {
  background: #f8fafc;
}

.eov-site-ehi-cell {
  font-variant-numeric: tabular-nums;
  text-align: center;
  vertical-align: middle;
}

.eov-site-ehi-cell__stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.2rem;
  width: 100%;
}

.eov-site-ehi,
.eov-site-index {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border-radius: 0.25rem;
  color: #0f172a;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.eov-site-ehi {
  font-size: 0.875rem;
  line-height: 1.25;
  padding: 0.55rem 0.35rem;
}

.eov-site-index {
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.15rem 0.35rem;
}

/* Leaflet + Tailwind preflight (img max-width: 100% hides tiles).
   Subpixel rounding leaves a hairline of the map background between tiles.
   plus-lighter (leaflet.css) lightens that seam on imagery; overlap the
   256px tiles by 1px instead so the next tile covers the gap. */
.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !important;
  mix-blend-mode: normal;
  width: 257px !important;
  height: 257px !important;
}

/* EOV monitoring map — landbase location (black outline square, LTM-sized) */
.landbase-map-marker {
  background: transparent;
  border: none;
}

.landbase-map-marker__square {
  display: block;
  box-sizing: border-box;
  border: 2px solid #0f172a;
  background: transparent;
}

/* Folio section tabs — narrow left strip; main column starts at the rail line */
.app-has-folio-tabs {
  --stockman-page-inset: 2.75rem;
  --folio-tab-max-width: var(--stockman-page-inset);
  --folio-tab-max-height: 5.5rem;
  --folio-tab-current-scale: 0.9;
  --folio-tab-idle-scale: 0.75;
  /* Sticky navbar bottom: breadcrumb row + subnav row + borders (see _navbar.html.erb). */
  --navbar-height: calc(
    0.75rem + 0.125rem + 1.75rem + 0.75rem +
    1px +
    0.375rem + 1.5rem + 0.375rem +
    1px
  );
}

.app-has-folio-tabs .app-shell {
  padding-left: var(--stockman-page-inset);
  padding-right: var(--stockman-page-inset);
  box-sizing: border-box;
}

/* Fill the shell between matching left/right insets (folio rail on the left). */
.app-has-folio-tabs .stockman-page-width {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* Full-bleed page surfaces (e.g. CRM workspace) — match left/right inset */
.stockman-page-width.stockman-page-width--fill,
.app-has-folio-tabs .stockman-page-width.stockman-page-width--fill {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.folio-rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--stockman-page-inset);
  z-index: 50;
  pointer-events: none;
  /* 60% brighter than the section chocolate so the strip reads as not-in-focus. */
  background: color-mix(in srgb, var(--folio-rail-base, var(--color-4)) 40%, #fff);
}

.folio-rail__line {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 2px;
  background: var(--folio-current-strong, var(--color-border));
  pointer-events: none;
}

.folio-tabs {
  position: absolute;
  right: 0;
  top: var(--navbar-height);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.folio-tab--land {
  --folio-tab-strong: #3f7a3a;
}

.folio-tab--work {
  --folio-tab-strong: color-mix(in srgb, #b33a32 80%, #000);
}

.folio-tab--capital {
  --folio-tab-strong: #2c5f94;
}

.folio-tab {
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: calc(var(--folio-tab-max-width) * var(--folio-tab-idle-scale));
  min-height: calc(var(--folio-tab-max-height) * var(--folio-tab-idle-scale));
  padding: 0.65rem 0.35rem;
  border-top: 1px solid #fff;
  border-right: none;
  border-bottom: 2px solid color-mix(in srgb, var(--folio-tab-strong, var(--color-3)) 70%, transparent);
  border-left: 1px solid #fff;
  border-radius: 0.45rem 0 0 0.45rem;
  /* Unselected: 60% brighter so the strip says this is not in focus. */
  background: color-mix(in srgb, var(--folio-tab-strong, var(--color-3)) 40%, #fff);
  box-shadow: 2px 0 6px color-mix(in srgb, var(--color-black) 8%, transparent);
  text-decoration: none;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    width 0.18s ease,
    min-height 0.18s ease;
}

.folio-tab:hover,
.folio-tab:focus-visible {
  width: var(--folio-tab-max-width);
  min-height: var(--folio-tab-max-height);
  background: color-mix(in srgb, var(--folio-tab-strong, var(--color-3)) 55%, #fff);
  box-shadow: 3px 0 10px color-mix(in srgb, var(--color-black) 12%, transparent);
}

.folio-tab--current {
  position: relative;
  z-index: 1;
  width: calc(var(--folio-tab-max-width) * var(--folio-tab-current-scale));
  min-height: calc(var(--folio-tab-max-height) * var(--folio-tab-current-scale));
  background: var(--folio-tab-strong, var(--color-3));
  border-bottom-color: color-mix(in srgb, var(--folio-tab-strong, var(--color-3)) 55%, #000);
  box-shadow: 2px 3px 0 color-mix(in srgb, var(--color-black) 50%, transparent);
  clip-path: inset(0 0 -6px 0);
}

.folio-tab--current:hover,
.folio-tab--current:focus-visible {
  width: var(--folio-tab-max-width);
  min-height: var(--folio-tab-max-height);
  background: var(--folio-tab-strong, var(--color-3));
  box-shadow: 2px 3px 0 color-mix(in srgb, var(--color-black) 50%, transparent);
}

.folio-tab--current:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.folio-tab__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  color: color-mix(in srgb, var(--folio-tab-strong, var(--color-3)) 72%, #000);
}

.folio-tab--current .folio-tab__label {
  color: #fff;
}

@media (max-width: 40rem) {
  .app-has-folio-tabs {
    --stockman-page-inset: 2.35rem;
    --folio-tab-max-height: 4.6rem;
  }

  .folio-tab {
    padding: 0.5rem 0.25rem;
  }

  .folio-tab__label {
    font-size: 0.75rem;
  }
}

/* Navbar — neutral palette; section classes kept for structure only */
.navbar--default,
.navbar--land,
.navbar--work,
.navbar--capital,
.navbar--settings {
  --navbar-fg: var(--color-chocolate);
  --navbar-fg-muted: var(--color-text-muted);
  --navbar-fg-sep: color-mix(in srgb, var(--color-tawny) 55%, var(--color-chocolate));
  --navbar-hover-bg: var(--color-hover-bg);
  background-color: var(--color-cream);
  border-bottom-color: var(--color-border);
}

[class^="navbar--"] .navbar-subnav {
  border-top-color: var(--color-border-subtle);
}

[class^="navbar--"] .navbar-brand,
[class^="navbar--"] .navbar-user-menu,
[class^="navbar--"] .navbar-contacts-link {
  color: var(--navbar-fg-muted);
}

[class^="navbar--"] .navbar-brand {
  font-weight: 600;
  text-decoration: none;
}

[class^="navbar--"] .navbar-brand:hover,
[class^="navbar--"] .navbar-user-menu:hover,
[class^="navbar--"] .navbar-contacts-link:hover {
  color: var(--navbar-fg);
}

[class^="navbar--"] .navbar-user-menu:hover {
  background-color: var(--navbar-hover-bg);
}

[class^="navbar--"] .asset-search__icon {
  color: var(--navbar-fg-muted);
}

.navbar-contacts-link {
  display: inline-flex;
  align-items: center;
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.navbar-contacts-link:hover {
  background-color: var(--navbar-hover-bg, rgb(241 245 249));
}

.navbar-contacts-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-chocolate, #44403c) 35%, transparent);
  outline-offset: 2px;
}

.navbar-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.55);
  color: var(--color-text-muted);
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-black) 6%, transparent);
}

.navbar-share-btn:hover {
  background: var(--color-hover-bg);
  color: var(--color-chocolate);
}

.navbar-share-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.45);
}

.navbar-share-btn__icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.root-record-delegation {
  position: static;
  z-index: 5;
  flex-shrink: 0;
}

.root-record-delegation__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.9);
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.root-record-delegation__trigger:hover {
  background: #f8fafc;
}

.root-record-delegation__trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.45);
}

.root-record-delegation__trigger--owner_unshared {
  color: #dc2626;
  border-color: #fca5a5;
}

.root-record-delegation__trigger--owner_unshared:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.root-record-delegation__trigger--shared_full {
  color: #059669;
  border-color: #6ee7b7;
}

.root-record-delegation__trigger--shared_full:hover {
  background: #ecfdf5;
  color: #047857;
}

.root-record-delegation__icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.root-record-delegation__panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(15 23 42 / 0.4);
}

.root-record-delegation__panel[hidden] {
  display: none !important;
}

/* Avoid Chromium GPU crashes when a fixed overlay covers Leaflet/canvas maps. */
[data-sharing-dialog-cover] {
  visibility: hidden !important;
}

.root-record-delegation__sheet {
  position: relative;
  width: min(96vw, 32rem);
  max-height: min(88vh, 40rem);
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgb(15 23 42 / 0.18);
}

.root-record-share-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
}

.root-record-share-row__remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.375rem;
  padding: 0 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.root-record-share-row__remove-btn:hover {
  background: #f1f5f9;
}

.navbar-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: rgb(255 255 255 / 0.55);
  color: var(--color-text-muted);
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-black) 6%, transparent);
}

.navbar-help-btn:hover {
  background: var(--color-hover-bg);
  color: var(--color-chocolate);
}

.navbar-help-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.45);
}

.navbar-help-btn__icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.navbar-context-help__dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

[class^="navbar--"] .navbar-help-btn {
  border-color: var(--color-border);
  color: var(--navbar-fg-muted);
}

[class^="navbar--"] .navbar-help-btn:hover {
  background: var(--navbar-hover-bg);
  color: var(--navbar-fg);
}

.context-help__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.context-help__markdown > :first-child {
  margin-top: 0;
}

.context-help__markdown > :last-child {
  margin-bottom: 0;
}

.context-help__markdown blockquote {
  margin: 0.75rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid #cbd5e1;
  color: #475569;
}

.context-help__markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.context-help__markdown th,
.context-help__markdown td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

/* GPA accordion titles: inverted table-header tokens. */
.gpa-section-summary {
  background: var(--color-table-header-text);
  color: var(--color-table-header);
}

.gpa-section-summary:hover {
  background: color-mix(in srgb, var(--color-table-header) 8%, var(--color-table-header-text));
}

.gpa-section-summary__title,
.gpa-section-summary__amount,
.gpa-section-summary__currency,
.gpa-section-summary__chevron {
  color: var(--color-table-header);
}

.gpa-section-summary__amount.is-negative {
  color: #b91c1c;
}

.gpa-section-summary__currency {
  color: color-mix(in srgb, var(--color-table-header) 72%, var(--color-table-header-text));
}

.gpa-section-summary__chevron {
  color: color-mix(in srgb, var(--color-table-header) 78%, var(--color-table-header-text));
}

/* GPA section tables: same inverted scheme, slightly darker header than accordion titles.
   Beat global table:not(.budget-grid) thead th so header text matches accordion titles. */
table.gpa-section-table thead {
  color: var(--color-table-header) !important;
  background-color: var(--color-gpa-section-table-header) !important;
}

table.gpa-section-table thead th {
  color: var(--color-table-header) !important;
  background-color: var(--color-gpa-section-table-header) !important;
  border-color: color-mix(in srgb, var(--color-table-header) 18%, var(--color-gpa-section-table-header));
}

/* Narrow Rounded (R) column: header letter and checkboxes share one centred stack. */
table.gpa-section-table col.gpa-round-col {
  width: 2.75rem;
}

table.gpa-section-table th.gpa-round-col,
table.gpa-section-table td.gpa-round-col {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  padding-left: 0 !important;
  padding-right: 0 !important;
  text-align: center !important;
  vertical-align: middle;
  white-space: nowrap;
  letter-spacing: normal;
  box-sizing: border-box;
}

table.gpa-section-table .gpa-round-col__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 1.5rem;
}

table.gpa-section-table .gpa-round-col__inner input[type="hidden"] {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

table.gpa-section-table .gpa-round-col__inner input[type="checkbox"] {
  margin: 0;
  flex: 0 0 auto;
}

/* stockman.css sets table thead to white-on-dark; keep help headers readable. */
.context-help__markdown thead,
.context-help__markdown th {
  color: #0f172a !important;
  background-color: #f8fafc !important;
  font-weight: 600;
}

.context-help__lead {
  margin: 0.5rem 0 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
}

.context-help__list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.context-help__list > div {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr);
  gap: 0.5rem 0.75rem;
  align-items: start;
}

.context-help__list dt {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.context-help__list dt span,
.context-help__list dd span {
  color: #64748b;
  font-weight: 500;
}

.context-help__list dd {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.context-help code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8125rem;
}

@media (max-width: 40rem) {
  .context-help__list > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.navbar-share-btn--inline {
  width: 1.75rem;
  height: 1.75rem;
}

[class^="navbar--"] .navbar-share-btn {
  border-color: var(--color-border);
  color: var(--navbar-fg-muted);
}

[class^="navbar--"] .navbar-share-btn:hover {
  background: var(--navbar-hover-bg);
  color: var(--navbar-fg);
}

.document-sharing-dialog::backdrop,
.access-sharing-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
}

/* Contact edit dialog — generous viewport use, two-column body, sticky actions. */
.crm-note-delete-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 36rem);
  max-width: calc(100vw - 1.5rem);
  max-height: min(94vh, 40rem);
  height: auto;
}

.crm-note-delete-dialog:focus,
.crm-note-delete-dialog:focus-visible {
  outline: none;
}

.crm-note-delete-dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.crm-note-delete-dialog__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

.crm-note-delete-dialog__sheet > turbo-frame {
  display: block;
  max-height: inherit;
  overflow: auto;
}

.document-attachment-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 40rem);
  max-width: calc(100vw - 1.5rem);
  max-height: min(94vh, 48rem);
  height: auto;
}

.document-attachment-dialog:focus,
.document-attachment-dialog:focus-visible {
  outline: none;
}

.document-attachment-dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.document-attachment-dialog__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

.document-attachment-dialog__sheet > turbo-frame {
  display: block;
  max-height: inherit;
  overflow: auto;
}

.document-attachment-dialog__sheet > turbo-frame[busy]::before {
  content: "Loading…";
  display: block;
  padding: 2rem 1.25rem;
  color: #64748b;
  font-size: 0.875rem;
}

.document-form-busy__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: document-form-busy-spin 0.65s linear infinite;
}

@keyframes document-form-busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.document-upload-flag {
  position: fixed;
  left: max(1.25rem, env(safe-area-inset-left, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(24rem, calc(100vw - 2.5rem));
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.12), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}

.document-upload-flag__mark {
  display: inline-flex;
  flex: 0 0 auto;
}

.document-upload-flag--success {
  border-color: #6ee7b7;
  background: rgb(236 253 245 / 0.96);
  color: #065f46;
}

.document-upload-flag--error {
  border-color: #fca5a5;
  background: rgb(254 242 242 / 0.96);
  color: #991b1b;
}

.contact-edit-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 80rem);
  max-width: calc(100vw - 1.5rem);
  max-height: min(94vh, 56rem);
  height: auto;
}

.contact-edit-dialog:focus,
.contact-edit-dialog:focus-visible {
  outline: none;
}

.contact-edit-dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.budget-enterprise-row {
  cursor: pointer;
}

.budget-enterprise-row:hover {
  background: #f8fafc;
}

.budget-enterprise-row:focus-visible {
  outline: 2px solid rgb(148 163 184 / 0.7);
  outline-offset: -2px;
}

.budget-enterprise-dialog__body {
  padding: 1.5rem 1.5rem 1.75rem;
}

.budget-enterprise-dialog__header {
  padding-right: 2.5rem;
}

.budget-enterprise-dialog__check {
  border-top: 1px solid #e2e8f0;
  padding-top: 1.25rem;
}

.budget-enterprise-dialog__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.budget-enterprise-dialog__table th,
.budget-enterprise-dialog__table td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.budget-enterprise-dialog__table th {
  color: var(--color-table-header-text);
  background-color: var(--color-table-header);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.budget-enterprise-dialog__current td {
  background: #f1f5f9;
  font-weight: 600;
}

.contact-edit-dialog__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

.contact-edit-dialog__sheet > turbo-frame {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

/* Nested address / phone / relationship forms: hug content instead of filling contact-editor height. */
.contact-edit-dialog__sheet:has(.contact-edit-nested) {
  height: fit-content;
  max-height: min(94vh, 56rem);
}

.contact-edit-dialog__sheet > turbo-frame:has(.contact-edit-nested) {
  flex: 0 1 auto;
  min-height: 0;
}

/* Address map — floating centered Google Maps popup. */
.address-map {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.address-map-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 80rem);
  max-width: calc(100vw - 1rem);
  max-height: min(94vh, 56rem);
  height: auto;
}

.address-map-dialog:focus,
.address-map-dialog:focus-visible {
  outline: none;
}

.address-map-dialog::backdrop {
  background: rgb(15 23 42 / 0.5);
}

.address-map-dialog__sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

.address-map-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.address-map-dialog__header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.address-map-dialog__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.address-map-dialog__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
}

.address-map-dialog__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.address-map-dialog__map {
  position: relative;
  width: 100%;
  height: min(82vh, 48rem);
  min-height: 22rem;
  background: #f1f5f9;
}

.address-map-dialog__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-vcard-qr {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.contact-vcard-qr-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 24rem);
  max-width: calc(100vw - 1rem);
  max-height: min(94vh, 36rem);
  height: auto;
}

.contact-vcard-qr-dialog:focus,
.contact-vcard-qr-dialog:focus-visible {
  outline: none;
}

.contact-vcard-qr-dialog::backdrop {
  background: rgb(15 23 42 / 0.5);
}

.contact-vcard-qr-dialog__sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  background: #fff;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.28),
    0 0 0 1px rgb(15 23 42 / 0.04);
}

.contact-vcard-qr-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.contact-vcard-qr-dialog__header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.contact-vcard-qr-dialog__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.contact-vcard-qr-dialog__subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
}

.contact-vcard-qr-dialog__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.contact-vcard-qr-dialog__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1rem 1.5rem;
  background: #f8fafc;
}

.contact-vcard-qr-dialog__code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 16rem);
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}

.contact-vcard-qr-dialog__code svg {
  display: block;
  width: 100%;
  height: auto;
}

.contact-vcard-qr-dialog__hint {
  margin: 0;
  max-width: 18rem;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
}

.contact-editor--dialog {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: min(72vh, 42rem);
  height: 100%;
}

.contact-edit-dialog .contact-editor__header {
  flex: 0 0 auto;
  padding: 1.75rem 3.5rem 1.25rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.contact-editor__header {
  flex: 0 0 auto;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.contact-editor__header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.contact-editor__header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.contact-editor__header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.15rem;
}

.contact-editor__body--merge {
  display: block;
  grid-template-columns: none;
  width: 100%;
}

@media (min-width: 900px) {
  .contact-editor__body--merge {
    grid-template-columns: none;
  }
}

.contact-editor__panel--merge {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.contact-editor__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.contact-editor__subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.35rem;
  color: #64748b;
}

.contact-editor__body {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  overflow: auto;
  background: #f8fafc;
}

@media (min-width: 900px) {
  .contact-editor__body {
    grid-template-columns: minmax(22rem, 0.95fr) minmax(24rem, 1.05fr);
  }
}

.contact-editor__panel {
  min-width: 0;
  padding: 1.5rem 2rem;
}

.contact-editor__panel--identity {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

@media (min-width: 900px) {
  .contact-editor__panel--identity {
    border-bottom: none;
    border-right: 1px solid #e2e8f0;
  }
}

.contact-editor__panel--details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-editor__panel--details .crm-contact-sidebar__section {
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
}

.contact-editor__panel--details .crm-contact-sidebar__section:first-child {
  border-top: none;
  padding-top: 0;
}

.contact-editor__panel--details .icon-action-btn {
  width: 2.25rem;
  height: 2.25rem;
}

.contact-editor__panel--placeholder {
  display: flex;
  align-items: center;
}

.contact-editor__footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 2rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

/* Nested add/edit forms inside the contact dialog (address, phone, relationship). */
.contact-edit-nested {
  padding: 1.75rem 1.75rem 1.5rem;
  padding-right: 3rem; /* room for × */
}

.contact-edit-nested__header {
  margin-bottom: 1.25rem;
}

.contact-edit-nested__card {
  padding: 1.5rem 1.5rem 1.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.contact-edit-nested__card .space-y-4 > :last-child,
.contact-edit-nested__card .space-y-5 > :last-child,
.contact-edit-nested__card .space-y-6 > :last-child {
  padding-top: 0.25rem;
  margin-top: 0.5rem;
}

/* Navbar second row — midway between text-lg breadcrumbs (1.125rem) and former subnav (0.75rem) */
.navbar-subnav__menu {
  font-size: 0.9375rem;
  line-height: 1.5rem;
}

[class^="navbar--"] .navbar-subnav__menu,
[class^="navbar--"] .navbar-subnav__link {
  color: var(--navbar-fg-muted);
}

.navbar-subnav__sep {
  padding-left: 0;
  padding-right: 0;
  user-select: none;
}

[class^="navbar--"] .navbar-subnav__sep {
  color: var(--navbar-fg-sep);
}

.navbar-subnav__link {
  text-decoration: none;
}

[class^="navbar--"] .navbar-subnav__link:hover,
[class^="navbar--"] .navbar-subnav__link--current {
  color: var(--navbar-fg);
}

.navbar-subnav__link:hover {
  text-decoration: none;
}

.navbar-subnav__link--current {
  font-weight: 600;
}

/* Breadcrumb trail — single row that truncates before navbar search */
.breadcrumb-trail-nav {
  width: 100%;
}

.breadcrumb-trail {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  width: 100%;
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.breadcrumb-trail__segment {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
}

.breadcrumb-trail__segment--brand,
.breadcrumb-trail__segment:not(.breadcrumb-trail__segment--current) {
  flex-shrink: 0;
}

.breadcrumb-trail__copy-url {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.2rem;
  padding: 0.15rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  line-height: 0;
}

.breadcrumb-trail__copy-url:hover,
.breadcrumb-trail__copy-url:focus-visible {
  color: #475569;
  background: rgb(241 245 249 / 0.9);
  outline: none;
}

.breadcrumb-trail__copy-url.is-copied {
  color: #15803d;
}

.breadcrumb-trail__copy-url-icon {
  display: block;
  width: 0.85rem;
  height: 0.85rem;
}

/* Current page (+ actions) uses remaining space and truncates */
.breadcrumb-trail__segment--current {
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.breadcrumb-trail__sep {
  flex-shrink: 0;
  padding-left: 0;
  padding-right: 0;
  font-weight: 400;
}

.breadcrumb-trail__root-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.breadcrumb-trail__segment--root-switcher {
  position: relative;
}

.breadcrumb-trail__segment--root-switcher .site-selection-chip {
  cursor: context-menu;
  -webkit-touch-callout: none;
  user-select: none;
}

.breadcrumb-trail__root-menu {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 50;
  margin-top: 0.25rem;
  min-width: 14rem;
  max-width: min(24rem, 90vw);
  max-height: min(70vh, 24rem);
  overflow: auto;
  padding: 0.25rem 0;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 10px 15px -3px rgb(15 23 42 / 0.1), 0 4px 6px -4px rgb(15 23 42 / 0.1);
}

.breadcrumb-trail__root-menu-form {
  display: block;
  width: 100%;
  margin: 0;
}

.breadcrumb-trail__root-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 0;
  background: transparent;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumb-trail__root-menu-item:hover,
.breadcrumb-trail__root-menu-item:focus-visible {
  background: #f8fafc;
  outline: none;
}

.breadcrumb-trail__root-menu-item--current {
  cursor: default;
  font-weight: 600;
  color: #0f172a;
  background: #f1f5f9;
}

.breadcrumb-trail__label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  white-space: nowrap;
}

.breadcrumb-trail__label--brand {
  text-decoration: none;
}

.breadcrumb-trail__label--brand:hover {
  text-decoration: none;
}

.breadcrumb-trail__label--link {
  text-decoration: none;
}

.breadcrumb-trail__label--link:hover {
  text-decoration: none;
}

.breadcrumb-trail__label--current {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[class^="navbar--"] .breadcrumb-trail__sep {
  color: var(--navbar-fg-sep);
}

[class^="navbar--"] .breadcrumb-trail__label--brand,
[class^="navbar--"] .breadcrumb-trail__label--current {
  color: var(--navbar-fg);
}

[class^="navbar--"] .breadcrumb-trail__label--link {
  color: var(--navbar-fg-muted);
}

[class^="navbar--"] .breadcrumb-trail__label--brand:hover,
[class^="navbar--"] .breadcrumb-trail__label--link:hover {
  color: var(--navbar-fg);
}

[class^="navbar--"] .icon-action-btn--neutral {
  color: var(--navbar-fg-muted);
}

[class^="navbar--"] .icon-action-btn--neutral:hover {
  color: var(--navbar-fg);
  background-color: transparent;
}

.breadcrumb-trail__action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding-left: 0.35rem;
  line-height: 1;
}

.breadcrumb-trail__action .icon-action-btn-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.breadcrumb-trail__action-link {
  font-size: 1.35rem;
  line-height: 1;
  padding: 0;
  vertical-align: middle;
  color: var(--navbar-fg, var(--color-chocolate));
}

.breadcrumb-trail__action-link:hover {
  color: var(--navbar-fg, var(--color-chocolate));
  filter: brightness(1.15);
}

.breadcrumb-trail__action-link .icon-action-btn__icon {
  width: 1.35rem;
  height: 1.35rem;
}

[class^="navbar--"] .breadcrumb-trail__action-link.icon-action-btn--neutral,
[class^="navbar--"] .breadcrumb-trail__action-link.icon-action-btn--neutral:hover {
  color: var(--navbar-fg);
}

/* Icon-only actions — rounded hit target ~2× the glyph, without growing rows */
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin: -0.25rem 0;
  border: none;
  background: transparent;
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.icon-action-btn__icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  display: block;
}

.icon-action-btn--neutral {
  color: var(--color-text-muted);
}

.icon-action-btn--neutral:hover {
  color: var(--color-chocolate);
  background-color: rgb(15 23 42 / 0.08);
}

.icon-action-btn.is-copied,
.icon-action-btn.is-copied:hover {
  color: #16a34a;
}

.crm-copy-conversation-btn.icon-action-btn {
  width: auto;
  min-width: 1.75rem;
  padding: 0 0.35rem;
  gap: 0.2rem;
}

.crm-copy-conversation-btn__ext {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  color: inherit;
  opacity: 0.85;
}

.crm-workspace-digestor-bcc.icon-action-btn {
  width: auto;
  min-width: 1.75rem;
  padding: 0 0.35rem;
}

.crm-workspace-digestor-bcc__label {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: inherit;
}

.icon-action-btn--danger {
  color: #dc2626;
}

.icon-action-btn--danger:hover {
  color: #991b1b;
  background-color: rgb(220 38 38 / 0.1);
}

.icon-action-btn--success {
  color: #16a34a;
}

.icon-action-btn--success:hover {
  color: #15803d;
}

.icon-action-btn--disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.65;
}

.icon-action-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #94a3b8;
}

.icon-action-btn-form {
  display: inline;
}

.slip-entry-form__submit--inactive,
.slip-entry-form__submit--inactive:hover,
.holistic-context-field__save--inactive,
.holistic-context-field__save--inactive:hover {
  background-color: #0f172a;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Ignore the leftover mouse-up after Turbo replaces the page with a new slip. */
.slip-entry-form__submit--new {
  pointer-events: none;
  animation: slip-submit-unlock 0.01s linear 0.45s forwards;
}

.slip-entry-form__submit--new.is-ready {
  pointer-events: auto;
  animation: none;
}

@keyframes slip-submit-unlock {
  to {
    pointer-events: auto;
  }
}

.coa-code-with-add {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  max-width: 100%;
}

.coa-code-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  color: #cbd5e1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.coa-code-with-add:hover .coa-code-add,
.coa-code-with-add:focus-within .coa-code-add,
.coa-code-add:focus-visible {
  opacity: 1;
}

.coa-code-add:hover,
.coa-code-add:focus-visible {
  color: #64748b;
}

.coa-amount-stats {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.15;
  white-space: nowrap;
}

.coa-amount-stats__row {
  display: inline-grid;
  grid-template-columns: 1.75rem max-content;
  column-gap: 0.35rem;
  align-items: baseline;
}

.coa-amount-stats__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #94a3b8;
  text-align: right;
}

.coa-amount-stats__value {
  font-variant-numeric: tabular-nums;
}

.coa-amount-stats__row--avg .coa-amount-stats__label {
  color: #64748b;
}

.coa-amount-stats__row--avg .coa-amount-stats__value {
  font-weight: 600;
}

.coa-workspace {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .coa-workspace {
    grid-template-columns: minmax(18rem, 1fr) minmax(22rem, 1.15fr);
    align-items: start;
  }
}

.coa-tree,
.coa-detail {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  padding: 1rem 1.1rem 1.25rem;
}

.coa-tree__heading {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.coa-tree__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.coa-tree__search,
.coa-tree__nature {
  min-width: 0;
  flex: 1 1 8rem;
  border: 1px solid #d6d3d1;
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  color: #334155;
  background: #fff;
}

.coa-tree__filter-submit {
  border: 1px solid #d6d3d1;
  border-radius: 0.4rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  background: #fff;
  color: #334155;
}

.coa-tree__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.coa-tree__item > .coa-tree__list,
.coa-tree__children > .coa-tree__list {
  padding-left: 0.9rem;
}

.coa-tree__children {
  display: none;
}

.coa-tree__item.is-open > .coa-tree__children {
  display: block;
}

.coa-tree__row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.4rem;
  padding: 0.2rem 0.3rem;
}

.coa-tree__row.is-selected {
  background: #eff6ff;
}

.coa-tree__row.is-archived {
  opacity: 0.65;
}

.coa-tree__toggle {
  flex: 0 0 1.1rem;
  width: 1.1rem;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  transform: rotate(0deg);
}

.coa-tree__item.is-open > .coa-tree__row > .coa-tree__toggle {
  transform: rotate(90deg);
}

.coa-tree__toggle--leaf {
  cursor: default;
}

.coa-tree__link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
}

.coa-tree__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: #334155;
}

.coa-tree__row.is-header .coa-tree__name {
  font-weight: 600;
  color: #0f172a;
}

.coa-tree__badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #94a3b8;
}

.coa-tree__row .coa-code-add {
  opacity: 0;
}

.coa-tree__row:hover .coa-code-add,
.coa-tree__row:focus-within .coa-code-add {
  opacity: 1;
}

.slip-entry-form__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.slip-entry-form__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  gap: 0.75rem 1.5rem;
  align-items: start;
}

.slip-entry-form__type {
  margin-left: auto;
  text-align: right;
}

.slip-entry-form__type-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  margin-top: 0.25rem;
  margin-left: auto;
  padding: 0.35rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  text-align: right;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.slip-entry-form__type-toggle.is-static {
  cursor: default;
}

.slip-entry-form__type-toggle.is-unreconciled {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.slip-entry-form__type-toggle.is-partial {
  background-color: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}

.slip-entry-form__type-toggle.is-full,
.slip-entry-form__type-toggle.is-reconciled {
  background-color: #dcfce7;
  border-color: #86efac;
  color: #14532d;
}

.slip-entry-form__type-toggle:not(.is-static):hover {
  filter: brightness(0.97);
}

.slip-entry-form__type-cluster {
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.35rem;
}

.slip-entry-form__type-label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
}

.slip-entry-form__type-status {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.85;
}

.slip-entry-form__reconciled-info {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  color: #15803d;
}

.slip-entry-form__reconciled-info[hidden] {
  display: none;
}

.slip-entry-form__reconciled-info-icon {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}

.slip-entry-form__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: start;
}

.slip-entry-form__label--end {
  text-align: right;
}

.slip-entry-form__line1 {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  align-items: start;
  width: 100%;
}

.slip-entry-form__number,
.slip-entry-form__financial-date {
  width: 11rem;
  max-width: 100%;
  min-width: 0;
}

.slip-entry-form__financial-date .date-display-picker {
  width: 100%;
}

.slip-entry-form__financial-date .date-display-picker__text {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slip-entry-form__line2 {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 11rem);
  gap: 0.75rem 1.25rem;
  align-items: start;
  justify-content: space-between;
}

.slip-entry-form__contact {
  min-width: 0;
}

.slip-entry-form__amount {
  min-width: 0;
  width: 11rem;
  max-width: 100%;
  justify-self: end;
}

.slip-entry-form__amount-input {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.slip-entry-form__description {
  grid-column: 1 / -1;
  grid-row: 3;
}

.slip-entry-form__description-input {
  min-height: 2.375rem;
  line-height: 1.25rem;
  overflow-y: hidden;
  resize: vertical;
}

.slip-entry-form__description-input.is-multiline {
  min-height: calc(1.25rem * 3 + 1.125rem);
}

.register-allocations__heading {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.register-allocations__help {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.register-allocations__help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #64748b;
  cursor: help;
}

.register-allocations__help-icon:hover,
.register-allocations__help-icon:focus-visible {
  color: #0f172a;
}

.register-allocations__help-svg {
  width: 1rem;
  height: 1rem;
}

.register-allocations__help-tip {
  display: none;
  position: absolute;
  top: 50%;
  left: calc(100% + 0.35rem);
  z-index: 20;
  width: 18rem;
  transform: translateY(-50%);
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.14);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
}

.register-allocations__help:hover .register-allocations__help-tip,
.register-allocations__help:focus-within .register-allocations__help-tip {
  display: block;
}

.register-allocations__help--field .register-allocations__help-tip {
  top: calc(100% + 0.4rem);
  left: 0;
  transform: none;
}

.register-allocations:not(.register-allocations--split) .register-allocations__amount,
.register-allocations:not(.register-allocations--split) .register-allocations__remove,
.register-allocations:not(.register-allocations--split) .register-allocations__residual,
.register-allocations:not(.register-allocations--split) .register-allocations__description {
  display: none;
}

.register-allocations__description {
  margin-bottom: 0.75rem;
}

.register-allocations__description-input {
  min-height: 2.375rem;
  height: 2.375rem;
  line-height: 1.25rem;
  resize: vertical;
}

.register-allocations__fields {
  min-width: 0;
}

.register-allocations__grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.register-allocations__coa {
  min-width: 0;
  width: 100%;
}

.register-allocations__dims {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem 1rem;
  align-items: start;
}

.register-allocations--split .register-allocations__dims {
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) minmax(0, 1fr);
}

.register-allocations__trail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 0.85rem 1.15rem;
  align-items: end;
  padding: 0.65rem 0.15rem 0.35rem;
}

.register-allocations__documents {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding-bottom: 0.1rem;
}

.register-allocations__remove {
  margin-top: 0.5rem;
  text-align: center;
}

.register-allocations__upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  cursor: pointer;
}

.register-allocations__upload:hover:not(:disabled) {
  background: #f8fafc;
}

.register-allocations__upload:disabled {
  color: #94a3b8;
  background: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.55;
}

.register-allocations__upload-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.register-allocations__upload-count {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.1;
}

.register-allocations:not(.register-allocations--split) .register-allocations__upload-count--part {
  display: none;
}

.register-allocations--split .register-allocations__upload-count--slip {
  display: none;
}

.slip-panel--split .slip-entry-form__description,
.slip-panel--split .slip-entry-form__documents--header {
  display: none;
}

.slip-entry-form__documents {
  display: flex;
  justify-content: flex-start;
}

.slip-entry-form__documents--after-form {
  margin-top: 0;
}

.slip-entry-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 40rem) {
  .slip-entry-form__top {
    flex-direction: column;
  }

  .slip-entry-form__type {
    margin-left: 0;
    text-align: left;
    width: 100%;
  }

  .slip-entry-form__type-toggle {
    align-items: flex-start;
    margin-left: 0;
    text-align: left;
  }

  .slip-entry-form__meta {
    grid-template-columns: 1fr;
  }

  .register-allocations__dims,
  .register-allocations--split .register-allocations__dims,
  .register-allocations__trail {
    grid-template-columns: 1fr;
  }

  .register-allocations__documents {
    justify-content: flex-start;
  }

  .slip-entry-form__grid {
    grid-template-columns: 1fr;
  }

  .slip-entry-form__line1,
  .slip-entry-form__line2,
  .slip-entry-form__description {
    grid-column: 1;
    grid-row: auto;
  }

  .slip-entry-form__line1 {
    flex-direction: column;
  }

  .slip-entry-form__line2 {
    grid-template-columns: 1fr;
  }

  .slip-entry-form__number,
  .slip-entry-form__financial-date,
  .slip-entry-form__amount {
    width: 100%;
  }

  .slip-entry-form__amount {
    justify-self: stretch;
  }

  .slip-entry-form__label--end {
    text-align: left;
  }

  .slip-entry-form__financial-date .date-display-picker__text,
  .slip-entry-form__amount-input {
    text-align: left;
  }
}

.slip-entry-form__csv-line {
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.slip-entry-form__csv-line-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.slip-entry-form__csv-line-text {
  margin-top: 0.375rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #94a3b8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.markdown-render {
  line-height: 1.5;
}

.markdown-render > * + * {
  margin-top: 0.75rem;
}

/* Soft/hard line breaks (single Enter) get a half-line of extra space. */
.markdown-render br {
  display: block;
  content: "";
  margin-top: 0.5em;
}

@supports (margin-top: 0.5lh) {
  .markdown-render br {
    margin-top: 0.5lh;
  }
}

.markdown-render h1,
.markdown-render h2,
.markdown-render h3,
.markdown-render h4 {
  font-weight: 600;
  line-height: 1.5;
}

.markdown-render a {
  color: var(--color-tawny);
  text-decoration: underline;
}

.markdown-render a:hover {
  color: var(--color-chocolate);
}

.markdown-render ul,
.markdown-render ol {
  margin: 0.25rem 0;
  padding-left: 1.5rem;
}

.markdown-render ul {
  list-style-type: disc;
}

.markdown-render ol {
  list-style-type: decimal;
}

.markdown-render ul ul {
  list-style-type: circle;
}

.markdown-render ul ul ul {
  list-style-type: square;
}

.markdown-render ol ol {
  list-style-type: lower-alpha;
}

.markdown-render li {
  display: list-item;
}

.markdown-render li + li {
  margin-top: 0.25rem;
}

.markdown-render li > p {
  margin: 0;
}

.markdown-render li > p + p {
  margin-top: 0.5rem;
}

.markdown-render li > input[type="checkbox"] {
  margin-right: 0.35rem;
  vertical-align: middle;
}

.markdown-render code {
  background: #f1f5f9;
  padding: 0.05rem 0.25rem;
  border-radius: 0.25rem;
}

.markdown-render pre code {
  display: block;
  padding: 0.75rem;
  overflow-x: auto;
}

.markdown-render blockquote {
  border-left: 3px solid #cbd5e1;
  padding-left: 0.75rem;
  color: #475569;
}

.markdown-render table {
  width: 100%;
  border-collapse: collapse;
}

.markdown-render th,
.markdown-render td {
  border: 1px solid #e2e8f0;
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.markdown-render thead,
.markdown-render th {
  color: #0f172a !important;
  background-color: #f8fafc !important;
  font-weight: 600;
}

.markdown-editor {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.markdown-editor__surface {
  overflow-y: auto;
  min-height: var(--markdown-surface-min-height, 7.5rem);
  max-height: min(45dvh, 22rem);
  cursor: text;
}

.markdown-editor__surface[data-empty="true"]::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}

.markdown-editor__surface:focus {
  outline: none;
}

.markdown-editor__toolbar button:focus-visible {
  outline: 2px solid #64748b;
  outline-offset: 1px;
}

/* Weather page — chart flows with page scroll (no nested scroll regions) */
.weather-page {
  display: flex;
  flex-direction: column;
}

.weather-chart-hero {
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.weather-chart-hero__chart {
  padding-bottom: 1rem;
}

/* Drought chart legend — NDVI notice appears when hovering the key swatches */
.drought-legend {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 10px;
  line-height: 1.4;
  color: #64748b;
}

.drought-legend__detail {
  margin: 0 0 8px;
}

.drought-legend__key-wrap {
  position: relative;
}

.drought-legend__key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  cursor: default;
}

.drought-legend__ndvi-error {
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #dc2626;
  background: #fef2f2;
  padding: 12px;
  font-size: 14px;
  white-space: pre-wrap;
  color: #991b1b;
}

.drought-legend__ndvi-error-title {
  font-weight: 600;
  margin-bottom: 4px;
}

/* CRM workspace fills the shell below the sticky navbar so the notes list can scroll. */
html:has(.crm-workspace--index),
html:has(.crm-workspace--contact),
body:has(.crm-workspace--index),
body:has(.crm-workspace--contact) {
  height: 100dvh;
  overflow: hidden;
}

.app-shell:has(.crm-workspace--index),
.app-shell:has(.crm-workspace--contact) {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.app-shell:has(.crm-workspace--index) > nav,
.app-shell:has(.crm-workspace--contact) > nav {
  flex: 0 0 auto;
}

.app-shell:has(.crm-workspace--index) > .crm-page,
.app-shell:has(.crm-workspace--contact) > .crm-page {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.crm-workspace {
  box-sizing: border-box;
}

.crm-workspace--index,
.crm-workspace--contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
  flex: 1 1 0;
  box-sizing: border-box;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.crm-workspace--index {
  grid-template-rows: auto auto minmax(0, 1fr) minmax(12rem, 1fr);
  grid-template-areas:
    "notes-filter"
    "contacts-filter"
    "notes-body"
    "contacts-body";
}

.crm-workspace--contact {
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas:
    "notes-filter"
    "contacts-filter"
    "detail";
}

@media (min-width: 1024px) {
  .crm-workspace--index,
  .crm-workspace--contact {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .crm-workspace--index {
    grid-template-areas:
      "notes-filter contacts-filter"
      "notes-body contacts-body";
  }

  .crm-workspace--contact {
    grid-template-areas:
      "notes-filter contacts-filter"
      "detail detail";
  }
}

.crm-workspace__cell--notes-filter {
  grid-area: notes-filter;
  min-width: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.crm-workspace__cell--contacts-filter {
  grid-area: contacts-filter;
  min-width: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.crm-workspace__cell--detail {
  grid-area: detail;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

turbo-frame.crm-workspace__detail-frame,
.crm-workspace__detail-frame {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.crm-workspace__cell--notes-body {
  grid-area: notes-body;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.crm-workspace__cell--contacts-body {
  grid-area: contacts-body;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

turbo-frame.crm-workspace__panel,
.crm-workspace__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.crm-workspace__cell--notes-body .crm-information-panel {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
}

.crm-workspace__panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}


.crm-workspace-filter {
  flex: 0 0 auto;
  height: 100%;
  border-radius: 0.75rem;
  border: 1px solid var(--color-filter-border);
  background: var(--color-filter-bg);
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

.crm-workspace-filter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
}

.crm-workspace-filter__header .crm-workspace-filter__title {
  margin: 0;
}

.crm-workspace-filter__title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-workspace-filter__header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
}

.crm-workspace-filter__header-action,
.crm-workspace-filter__manage-buckets {
  flex-shrink: 0;
  white-space: nowrap;
}

.crm-workspace-filter__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Notes search on one line: title, search, period, due toggle (date range wraps below). */
.crm-workspace-filter__form--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.crm-workspace-filter__title--inline {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
}

.crm-workspace-filter__form--inline .crm-workspace-filter__row--search {
  flex: 1 1 14rem;
  min-width: 10rem;
}

.crm-workspace-filter__form--inline .crm-workspace-filter__row--period {
  flex: 0 0 auto;
  align-items: center;
}

.crm-workspace-filter__form--inline .crm-workspace-filter__due-toggle {
  margin: 0;
}

.crm-workspace-filter__form--inline .crm-workspace-filter__range {
  flex: 1 1 100%;
}

.crm-workspace-filter__row--period {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.crm-workspace-filter__period {
  min-width: 0;
  flex: 1 1 auto;
}

.crm-workspace-filter__period-select {
  width: 100%;
  max-width: 9.5rem;
}

.crm-workspace-filter__due-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  color: #334155;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.crm-workspace-filter__due-checkbox {
  width: 0.875rem;
  height: 0.875rem;
  margin: 0;
  accent-color: #0f766e;
  cursor: pointer;
}

.crm-workspace-filter__label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-workspace-filter__bucket-control {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.crm-workspace-filter__bucket-control select {
  min-width: 0;
  flex: 1 1 auto;
}

.crm-workspace-filter__broom .icon-action-btn__icon,
.crm-workspace-filter__broom svg {
  width: 1.05rem;
  height: 1.05rem;
}

.crm-workspace-filter__search-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.crm-workspace-filter__search-field {
  min-width: 0;
  flex: 1 1 auto;
}

.crm-workspace-filter__search-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
}

.crm-workspace-filter__range {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.crm-workspace-filter__range.is-visible {
  display: grid;
}

.crm-information-panel--workspace > .crm-workspace-filter-banner,
.crm-information-panel--workspace > .crm-information-panel__new-note,
.crm-information-panel--workspace > .crm-workspace-new-note-hint {
  flex: 0 0 auto;
}

.crm-workspace-filter-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.75rem;
  color: #475569;
}

.crm-workspace-filter-banner--summary {
  cursor: pointer;
}

.crm-workspace-filter-banner--summary:hover {
  background: #f1f5f9;
}

.crm-workspace-filter-banner__action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e293b;
}

.crm-note-share-default {
  display: inline-flex;
  align-items: center;
}

.crm-note-share-default .root-record-delegation__trigger {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
}

.crm-note-share-default .root-record-delegation__trigger--owner_unshared {
  color: #dc2626;
}

.crm-note-share-default .root-record-delegation__trigger--owner_unshared:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.crm-note-share-default .root-record-delegation__trigger--shared_full {
  color: #059669;
}

.crm-note-share-default .root-record-delegation__trigger--shared_full:hover {
  background: #ecfdf5;
  color: #047857;
}

.crm-note-share-default .root-record-delegation__icon {
  width: 1rem;
  height: 1rem;
}

.crm-workspace-filter-banner__clear {
  margin-left: auto;
  font-weight: 600;
  color: var(--color-tawny);
  text-decoration: underline;
}

.crm-workspace-outside-banner {
  justify-content: center;
  margin-top: 0.25rem;
  border-top: 1px solid #cbd5e1;
  background: #f1f5f9;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-workspace-outside-banner__label {
  font-size: 0.7rem;
}

.crm-contact-accordion__row {
  display: block;
}

.crm-contact-accordion__row.is-selected .crm-contact-accordion__summary {
  background: #eff6ff;
}

.crm-contact-accordion__actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
}

.crm-contact-accordion__show-all {
  margin-right: 0.25rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #334155;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.crm-contact-accordion__show-all:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.crm-contact-accordion__summary {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.crm-contact-accordion__chevron {
  flex-shrink: 0;
  margin-top: 0.15rem;
  transition: transform 0.15s ease;
}

.crm-contact-accordion__entry[open] > .crm-contact-accordion__summary .crm-contact-accordion__chevron {
  transform: rotate(180deg);
}

.crm-contact-channel-drag {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  cursor: grab;
  font-size: 0.75rem;
  color: #334155;
}

.crm-contact-channel-drag:active {
  cursor: grabbing;
}

.crm-contact-channel-drag.is-channel-dragging {
  opacity: 0.55;
}

.crm-contact-channel-drag__kind {
  font-weight: 600;
  color: #475569;
}

.crm-contact-channel-drag__purpose {
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}

.crm-contact-channel-drag__actions {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  margin: -0.2rem -0.2rem -0.2rem 0;
}

.crm-contact-channel-drag__value {
  grid-column: 1 / 4;
  color: #0f172a;
}

.bucket-page {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 11rem);
  min-height: 32rem;
  max-height: calc(100dvh - 11rem);
}

.bucket-page__header {
  flex: 0 0 auto;
  margin-bottom: 1.5rem;
}

.bucket-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

@media (min-width: 1024px) {
  .bucket-workspace {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.bucket-workspace__column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bucket-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.bucket-panel__header {
  flex: 0 0 auto;
  background: var(--color-filter-bg);
  border-bottom: 1px solid var(--color-filter-border);
}

.bucket-panel__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.bucket-mass-import__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.bucket-mass-import__header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.bucket-mass-import__header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.bucket-mass-import__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
}

.bucket-mass-import__lede {
  margin: 0.35rem 0 0;
  max-width: 40rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #475569;
}

.bucket-mass-import__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bucket-mass-import__close:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* Center via UA dialog margin:auto (same pattern as GPX import). Do not use
   fixed + translate here — Firefox/Safari margin:auto fights that centering. */
.bucket-mass-import-dialog {
  margin: auto;
  padding: 0;
  max-width: calc(100vw - 1rem);
  width: min(98vw, 90rem);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  color: inherit;
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / 0.25);
}

.bucket-mass-import-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.bucket-merge-dialog {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  width: min(96vw, 28rem);
  max-width: calc(100vw - 1rem);
}

.bucket-merge-dialog:focus,
.bucket-merge-dialog:focus-visible {
  outline: none;
}

.bucket-merge-dialog::backdrop {
  background: rgb(15 23 42 / 0.45);
}

.bucket-merge-dialog__sheet {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgb(15 23 42 / 0.25);
}

.bucket-merge-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

.bucket-merge-dialog__header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.bucket-merge-dialog__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #0f172a;
}

.bucket-merge-dialog__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #475569;
}

.bucket-merge-dialog__form,
.bucket-merge-dialog__empty {
  padding: 1rem 1.1rem 1.15rem;
}

.bucket-merge-dialog__empty {
  margin: 0;
  font-size: 0.875rem;
  color: #475569;
}

.bucket-merge-dialog__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bucket-merge-dialog__field + .bucket-merge-dialog__field {
  margin-top: 0.9rem;
}

.bucket-merge-dialog__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.bucket-merge-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.bucket-mass-import-dialog__body {
  max-height: min(96vh, 64rem);
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

.bucket-mass-import__loading {
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: #64748b;
}

.bucket-mass-import__form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.bucket-mass-import__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bucket-mass-import__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.bucket-mass-import__hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.bucket-mass-import__hint code {
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: #f1f5f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
}

.bucket-mass-import__textarea {
  min-height: 10rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}

.bucket-mass-import__meta {
  margin-bottom: 1rem;
}

.bucket-mass-import__sample {
  margin: 0.5rem 0 0;
  max-height: 6rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  color: #334155;
  white-space: pre-wrap;
}

.bucket-mass-import__toggle {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.bucket-mass-import__toggle-option {
  margin: 0;
  cursor: pointer;
}

.bucket-mass-import__toggle-option span {
  display: block;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background: #fff;
}

.bucket-mass-import__toggle-option:has(input:checked) span {
  background: #1e293b;
  color: #fff;
}

.bucket-mass-import__mapping-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}

.bucket-mass-import__inline-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0.5rem;
}

.bucket-mass-import__channel-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}

.bucket-mass-import__channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bucket-mass-import__channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bucket-mass-import__channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.bucket-mass-import__channel-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  color: #64748b;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.bucket-mass-import__channel-remove:hover {
  background: #f8fafc;
  color: #0f172a;
}

.bucket-mass-import__preset-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.bucket-mass-import__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.bucket-mass-import__alert {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  background: #fef2f2;
  font-size: 0.875rem;
  color: #7f1d1d;
}

.bucket-mass-import__error-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.bucket-mass-import__error-list li + li {
  margin-top: 0.25rem;
}

.bucket-mass-import__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bucket-mass-import__stat {
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.bucket-mass-import__stat-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
}

.bucket-mass-import__stat-value {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.bucket-mass-import__notice {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  background: #fffbeb;
  font-size: 0.875rem;
  color: #451a03;
}

.bucket-mass-import__table-wrap {
  max-height: min(70vh, 42rem);
  overflow: auto;
  margin: 0 0 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}

.bucket-mass-import__bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.bucket-mass-import__bulk-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.bucket-mass-import__bulk-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.bucket-mass-import__bulk-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bucket-mass-import__col-check {
  width: 2rem;
}

.bucket-mass-import__diff-row.is-hidden {
  display: none;
}

.bucket-mass-import__diff-cell {
  padding: 0 0.65rem 0.75rem 2.65rem !important;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.bucket-mass-import__diff-panel {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.65rem 0.75rem;
}

.bucket-mass-import__diff-title {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.bucket-mass-import__diff-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.bucket-mass-import__diff-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #0f172a;
  cursor: pointer;
}

.bucket-mass-import__diff-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.bucket-mass-import__diff-field {
  font-weight: 600;
}

.bucket-mass-import__diff-kind {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
}

.bucket-mass-import__diff-values {
  color: #475569;
}

.bucket-mass-import__diff-current {
  text-decoration: line-through;
  color: #94a3b8;
}

.bucket-mass-import__diff-incoming {
  font-weight: 600;
  color: #0f172a;
}

.bucket-mass-import__diff-empty {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.bucket-mass-import__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.bucket-mass-import__table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.55rem 0.65rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-table-header-text);
  background: var(--color-table-header);
  border-bottom: 1px solid color-mix(in srgb, var(--color-black) 25%, var(--color-table-header));
}

.bucket-mass-import__table td {
  padding: 0.55rem 0.65rem;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}

.bucket-mass-import__row-name {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}

.bucket-mass-import__row-meta,
.bucket-mass-import__cell-muted {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
}

.bucket-mass-import__row-notes {
  margin: 0.35rem 0 0;
  color: #92400e;
  font-size: 0.75rem;
}

.bucket-mass-import__action,
.bucket-mass-import__match {
  min-width: 9.5rem;
}

.bucket-mass-import__json {
  margin: 0 0 1rem;
  max-height: 22rem;
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  white-space: pre;
}

.bucket-mass-import__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
  .bucket-mass-import-dialog__body {
    padding: 1.25rem 1.25rem;
  }

  .bucket-mass-import__stats {
    grid-template-columns: 1fr;
  }
}

.bucket-panel__title-copy {
  min-width: 0;
}

.bucket-panel__title-heading {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bucket-panel__title-heading h2 {
  margin: 0;
}

.bucket-panel__title-add {
  flex-shrink: 0;
}

.bucket-panel__title-add--mass-import {
  min-width: 1.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.bucket-panel__title-add-label {
  display: block;
  transform: translateY(-0.05em);
}

.bucket-panel__search {
  flex: 0 0 auto;
  margin-left: auto;
}

.bucket-panel__search-input {
  width: 9rem;
  max-width: 40vw;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.8125rem;
}

.bucket-panel__filter-empty {
  margin-top: 0.75rem;
}

.bucket-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.bucket-panel__body--scroll {
  overflow-y: auto;
}

.bucket-panel__load-more {
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.bucket-panel__loading {
  margin: 0.5rem 0 0;
}

.bucket-panel__body--empty {
  color: #475569;
  font-size: 0.875rem;
}

.bucket-drop-zone {
  position: relative;
}

.bucket-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  background: transparent;
}

.bucket-drop-overlay.is-active {
  display: block;
}

.bucket-drop-overlay.is-bucket-drop-target {
  outline: 2px dashed #64748b;
  outline-offset: -4px;
  background: rgb(248 250 252 / 0.65);
}

.bucket-drop-zone.is-bucket-drop-target,
.bucket-panel__body.bucket-drop-zone.is-bucket-drop-target {
  outline: 2px dashed #64748b;
  outline-offset: -4px;
  background: #f8fafc;
}

.bucket-member-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.bucket-contact-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.15rem 0.75rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  background: #fff;
  cursor: grab;
  font-size: 0.8125rem;
  color: #334155;
}

.bucket-contact-chip:active {
  cursor: grabbing;
}

.bucket-contact-chip.is-bucket-contact-dragging {
  opacity: 0.55;
}

.bucket-contact-chip--member {
  border-style: solid;
  background: #f8fafc;
}

.bucket-contact-chip.is-bucket-contact-selected {
  border-color: #334155;
  border-style: solid;
  background: #e2e8f0;
  box-shadow: inset 0 0 0 1px #334155;
}

.bucket-contact-chip__type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.bucket-contact-chip__name {
  color: #0f172a;
  font-weight: 500;
}

.bucket-contact-chip__level {
  margin-left: auto;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-gold) 35%, #fff);
  color: var(--color-chocolate);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bucket-trash.is-bucket-trash-target {
  border-color: #ef4444;
  background: #fef2f2;
  color: #b91c1c;
}

.bucket-trash.is-bucket-trash-active {
  position: relative;
  z-index: 20;
}

.bucket-contact-source.is-bucket-restore-target {
  outline: 2px dashed #64748b;
  outline-offset: -4px;
  background: #f8fafc;
  border-radius: 0.5rem;
}

.crm-contact-relationship-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.5rem;
  align-items: baseline;
  min-width: 0;
  flex: 1 1 auto;
  padding: 0.45rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  text-decoration: none;
  font-size: 0.75rem;
  color: #334155;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.crm-contact-relationship-chip:hover,
.crm-contact-relationship-chip:focus-visible {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgb(37 99 235 / 0.2);
  outline: none;
}

.crm-contact-relationship-chip:focus-visible {
  box-shadow: 0 0 0 2px #2563eb;
}

.crm-contact-relationship-chip--ended {
  opacity: 0.7;
}

.crm-contact-relationship-chip__role {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-contact-relationship-chip__name {
  font-weight: 600;
  color: #0f172a;
}

.crm-contact-relationship-chip:hover .crm-contact-relationship-chip__name,
.crm-contact-relationship-chip:focus-visible .crm-contact-relationship-chip__name {
  color: #1d4ed8;
}

.crm-contact-relationship-chip__period {
  grid-column: 1 / -1;
  font-size: 0.625rem;
  color: #64748b;
}

.crm-contact-relationship-chip__details {
  grid-column: 1 / -1;
  font-size: 0.625rem;
  font-weight: 600;
  color: #475569;
}

.crm-contact-relationship-chip--bucket {
  border-color: color-mix(in srgb, var(--color-tawny) 35%, #e2e8f0);
  background: color-mix(in srgb, var(--color-gold) 22%, #fff);
}

.crm-contact-relationship-chip--event {
  border-color: color-mix(in srgb, #0ea5e9 35%, #e2e8f0);
  background: color-mix(in srgb, #bae6fd 35%, #fff);
}

.crm-contact-relationship-chip__bucket {
  grid-column: 1 / -1;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-chocolate);
}

.crm-information-entry.is-channel-drop-target > summary {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  background: #eff6ff;
}

.crm-note-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  color: #334155;
}

.crm-note-channel--compact {
  color: #64748b;
}

.crm-note-channel__icon {
  display: inline-flex;
  flex-shrink: 0;
}

.crm-note-channel__icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.crm-note-channel__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.1rem;
  font-size: 0.75rem;
}

.crm-note-channel__label {
  font-weight: 600;
  color: #475569;
}

.crm-note-channel__value-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 100%;
}

.crm-note-channel__value {
  color: #1e293b;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.crm-note-channel__copy {
  flex-shrink: 0;
}

.contact-channel-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.contact-channel-phone__value {
  min-width: 0;
}

.contact-channel-phone__actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.15rem;
}

.contact-channel-phone__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  color: var(--color-text-muted, #64748b);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.contact-channel-phone__action:hover {
  background-color: rgb(15 23 42 / 0.08);
}

.contact-channel-phone__action--call:hover {
  color: #0f172a;
}

.contact-channel-phone__action--text {
  color: #128c7e;
}

.contact-channel-phone__action--text:hover {
  color: #075e54;
  background-color: rgb(18 140 126 / 0.12);
}

.contact-channel-phone__icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.contact-channel-phone--compact .contact-channel-phone__action {
  width: 1.5rem;
  height: 1.5rem;
}

.contact-channel-phone--compact .contact-channel-phone__icon {
  width: 1rem;
  height: 1rem;
}
  flex-shrink: 0;
}

.crm-information-entry__channel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.crm-information-entry__channel-select {
  width: 100%;
  max-width: 11rem;
  color: #0f172a;
}

.crm-information-entry__channel-select:has(option:checked[value=""]),
.crm-information-entry__channel-select:invalid {
  color: #94a3b8;
}

.crm-information-entry__channel-select option {
  color: #0f172a;
}

.crm-information-entry__channel-select option[value=""] {
  color: #94a3b8;
}

.crm-contact-detail {
  display: grid;
  grid-template-columns: 1fr;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

@media (min-width: 1024px) {
  .crm-contact-detail {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}

.crm-contact-detail__information {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
}

@media (min-width: 1024px) {
  .crm-contact-detail__information {
    border-bottom: none;
    border-right: 1px solid #e2e8f0;
  }
}

.crm-contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
}

.crm-contact-sidebar__heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crm-contact-sidebar__heading-text {
  min-width: 0;
  flex: 1 1 auto;
}

.crm-contact-sidebar__heading-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  margin-left: auto;
}

.crm-contact-sidebar__section {
  padding: 0.75rem 0;
  border-top: 1px solid #e2e8f0;
}

.crm-contact-sidebar__section:first-child {
  border-top: none;
  padding-top: 0;
}

/* Indent body copy under section titles (Relationships, Documents, etc.) */
.section-panel__body {
  margin-top: 0.5rem;
  padding-left: 0.75rem;
}

.section-panel__body--spacious {
  margin-top: 0.75rem;
}

.crm-information-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.crm-information-panel--fill {
  height: 100%;
  max-height: 100%;
}

.crm-information-panel__list {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.crm-information-panel__entries {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.crm-information-panel__entries::-webkit-scrollbar {
  display: none;
}

.crm-information-panel__entries > .crm-information-list__header,
.crm-information-panel__entries > .crm-information-entry__row.crm-information-list__header {
  flex: 0 0 auto;
}

.crm-information-entry__content {
  overflow: visible;
}

.crm-information-entry__expanded-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: -0.25rem 0 0.75rem;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.25rem 0 0.5rem;
  background: linear-gradient(to bottom, rgb(226 232 240 / 0.98) 70%, rgb(226 232 240 / 0));
}

.crm-information-panel__new-note-actions {
  margin-top: 0;
  background: linear-gradient(to bottom, #fff 70%, rgb(255 255 255 / 0));
}

.crm-information-panel__new-note-body {
  border-bottom: 1px solid #e2e8f0;
}

.crm-information-entry--new {
  background-color: #e2e8f0;
  border-top: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
}

.crm-information-entry--new .crm-information-entry__content {
  background-color: transparent;
  border-top: none;
}

.crm-information-entry__expanded-audit {
  margin: 0;
  min-width: 0;
  flex: 1 1 12rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
}

.crm-information-entry__expanded-audit--below {
  flex: none;
  margin-top: 0.5rem;
}

.crm-information-entry__expanded-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  background: none;
  position: static;
}

.crm-information-entry__expanded-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.25;
}

.crm-information-entry__expanded-btn:disabled,
.crm-information-entry__expanded-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}


.crm-information-panel__ruler {
  position: relative;
  flex: 0 0 0.7rem;
  align-self: stretch;
  border-left: 1px solid #e2e8f0;
  background: #f1f5f9;
  cursor: ns-resize;
  user-select: none;
}

.crm-information-panel__ruler:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px #94a3b8;
}

.crm-information-panel__ruler-thumb {
  position: absolute;
  top: 0;
  left: 1px;
  right: 1px;
  min-height: 1.25rem;
  border-radius: 999px;
  background: #94a3b8;
}

.crm-information-panel__ruler:hover .crm-information-panel__ruler-thumb,
.crm-information-panel__ruler:focus-visible .crm-information-panel__ruler-thumb {
  background: #64748b;
}

/*
 * Only isolate the previous/next rows when a note is too long for the panel.
 * Short notes stay in the scrolling list at their natural height.
 */
.crm-information-panel__entries.is-isolated {
  overflow: hidden;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry {
  display: none;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open],
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] + .crm-information-entry,
.crm-information-panel__entries.is-isolated > .crm-information-entry:has(+ .crm-information-entry[open]) {
  display: block;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry:not([open]) {
  flex: 0 0 auto;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open]:has(.crm-information-entry__audit-info:hover),
.crm-information-panel__entries.is-isolated > .crm-information-entry[open]:has(.crm-information-entry__audit-info:focus-within) {
  overflow: visible;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] > summary {
  flex: 0 0 auto;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open]::details-content {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  height: auto;
  overflow: hidden;
  content-visibility: visible;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__content {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__edit-form {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  gap: 0.5rem;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__edit-form > * {
  margin-top: 0;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__body-scroll,
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .markdown-editor,
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__note {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-note-edit-schedule,
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .markdown-editor__toolbar,
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__expanded-audit {
  flex: 0 0 auto;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .markdown-editor__surface,
.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__note-body {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.crm-information-entry__note {
  min-height: 0;
}

.crm-information-entry__note--editable {
  cursor: text;
}

.crm-information-entry__note--editable:focus-visible {
  outline: 2px solid rgb(100 116 139 / 0.45);
  outline-offset: 2px;
  border-radius: 0.375rem;
}

.crm-information-entry__note--editable:hover .crm-information-entry__note-body,
.crm-information-entry__note--editable:hover .crm-information-entry__note-empty {
  border-color: #94a3b8;
}

.crm-information-entry__note-empty {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.crm-information-entry__note-empty-hint {
  font-size: 0.8125rem;
  color: #94a3b8;
}

.event-profile-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 1.5rem;
}

.event-profile-panel__header {
  flex-shrink: 0;
}

.event-profile-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.event-profile-panel__title-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
}

.event-profile-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.event-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-paragraph {
  min-width: 0;
}

.event-paragraph__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-paragraph__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.event-paragraph__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.event-paragraph__meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
}

.event-paragraph__footer-actions {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.event-paragraphs__add {
  display: flex;
  justify-content: flex-start;
}

/* Event show: lock to viewport so long descriptions scroll inside the panel */
.asset-split-show {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--navbar-height, 11rem));
  height: calc(100dvh - var(--navbar-height, 11rem));
  min-height: 28rem;
  max-height: calc(100vh - var(--navbar-height, 11rem));
  max-height: calc(100dvh - var(--navbar-height, 11rem));
  box-sizing: border-box;
}

.asset-split-show .crm-contact-detail {
  flex: 1 1 auto;
  min-height: 18rem;
  height: auto;
}

.asset-split-show .event-links-panel--in-split {
  flex: 0 0 auto;
  margin: 0 1.5rem 1.5rem;
}

.asset-split-show .event-expense-slips {
  flex: 0 1 auto;
  min-height: 0;
  margin-top: 1rem;
}

.asset-split-show .event-expense-slips[open] .event-expense-slips__body {
  max-height: min(20rem, 34vh);
  min-height: 0;
  overflow: auto;
}

.event-expense-slips__description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.landbase-overview__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.landbase-overview-panel {
  flex-shrink: 0;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.obdi-sparkline {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 1.75rem;
  margin: 0;
  min-width: 8rem;
  max-width: 14rem;
}

.data-table td.obdi-sparkline-cell {
  overflow: visible;
}

.obdi-sparkline__slot {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
}

.obdi-sparkline__plot {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-end;
}

.obdi-sparkline__bar {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
  border-style: solid;
  border-width: 1px;
  box-sizing: border-box;
}

.obdi-sparkline__tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  z-index: 2;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
}

.obdi-sparkline__slot:first-child .obdi-sparkline__tip {
  left: 0;
  transform: none;
}

.obdi-sparkline__slot:last-child .obdi-sparkline__tip {
  left: auto;
  right: 0;
  transform: none;
}

.obdi-sparkline__slot:hover .obdi-sparkline__tip {
  display: block;
}

.landbase-overview-map {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.crm-contact-detail__information .landbase-overview-map__frame.monitoring-map {
  flex: 1 1 auto;
  min-height: 18rem;
  height: min(50vh, calc(100vh - 20rem));
}

.crm-contact-detail__information .landbase-overview-map__frame .monitoring-map-canvas,
.crm-contact-detail__information .landbase-overview-map__frame .monitoring-map-canvas.leaflet-container {
  min-height: inherit;
}

.landbase-overview-map__empty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.landbase-visits-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  max-height: min(40vh, 22rem);
  overflow: hidden;
}

.landbase-visits-panel__header {
  flex-shrink: 0;
}

.landbase-visits-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.landbase-visit-edit__grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .landbase-visit-edit__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .landbase-visit-edit__errors {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .landbase-visit-edit__left {
    grid-column: 1;
    grid-row: 1;
  }

  .landbase-visit-edit__right {
    grid-column: 2;
    grid-row: 1;
  }

  .landbase-visit-edit__grid:has(.landbase-visit-edit__errors) .landbase-visit-edit__left,
  .landbase-visit-edit__grid:has(.landbase-visit-edit__errors) .landbase-visit-edit__right {
    grid-row: 2;
  }
}

.monitoring-map-key__symbol--outline {
  display: inline-block;
  width: 1.25rem;
  height: 0.75rem;
  border: 2px solid #334155;
  background: rgba(148, 163, 184, 0.35);
  border-radius: 1px;
}

.monitoring-map-key__symbol--paddock {
  display: inline-block;
  width: 1.25rem;
  height: 0.75rem;
  border: 1.5px solid #ca8a04;
  background: rgba(254, 249, 195, 0.7);
  border-radius: 1px;
}

.monitoring-map-key__symbol--paddock-active {
  display: inline-block;
  width: 1.25rem;
  height: 0.75rem;
  border: 2.5px solid #b45309;
  background: rgba(251, 191, 36, 0.65);
  border-radius: 1px;
}

.monitoring-map-key__symbol--contour {
  display: inline-block;
  width: 1.25rem;
  height: 0;
  border-top: 1.5px solid #000;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.55);
  opacity: 0.85;
  border-radius: 0;
  vertical-align: middle;
}

.monitoring-map-contour-popup .leaflet-popup-content-wrapper {
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
}

.monitoring-map-contour-popup .leaflet-popup-content {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
}

.monitoring-map-contour-popup .leaflet-popup-tip {
  box-shadow: none;
}

.crm-information-entry__row {
  display: grid;
  grid-template-columns: 6.75rem 9.25rem minmax(0, 1fr) 1.75rem auto 1.25rem;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
}

/* Accounting register slips mixed into the CRM information accordion */
.crm-information-entry--register-slip {
  border-left: 3px solid #059669;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), transparent 42%);
}

.crm-information-entry--register-slip > summary.crm-information-entry__summary {
  min-height: 2.75rem;
}

.crm-information-entry__age--register-slip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  line-height: 1.2;
}

.crm-register-slip-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0.25rem;
  border: 1px solid rgba(4, 120, 87, 0.35);
  background: #ecfdf5;
  padding: 0.1rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #065f46;
}

.crm-register-slip-type {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #334155;
}

.crm-information-entry__amount--header {
  justify-self: end;
  text-align: right;
  min-width: 7.5rem;
}

/* Amount must stay visible when collapsed — note rows hide .__actions until open. */
.crm-information-entry--register-slip .crm-information-entry__amount,
.crm-information-entry__actions.crm-information-entry__amount {
  display: inline-flex;
  flex-shrink: 0;
  align-items: baseline;
  justify-content: flex-end;
  justify-self: end;
  gap: 0.35rem;
  min-width: 7.5rem;
  text-align: right;
}

.crm-register-slip-amount {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.crm-register-slip-unit {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}

.crm-information-entry__content--register-slip {
  border-left: 3px solid #059669;
  margin-left: -3px;
}

.crm-information-entry__row--workspace {
  grid-template-columns:
    minmax(9rem, 12rem)
    minmax(8rem, 12rem)
    minmax(0, 1fr)
    1.75rem
    minmax(7.5rem, max-content)
    1.25rem;
  align-items: start;
}

.crm-information-entry__row--workspace.crm-information-entry__row--no-contact {
  grid-template-columns:
    minmax(9rem, 12rem)
    minmax(0, 1fr)
    1.75rem
    minmax(7.5rem, max-content)
    1.25rem;
}

.crm-information-panel__entries--with-register-slips
  .crm-information-entry__row:not(.crm-information-entry__row--workspace) {
  grid-template-columns: 6.75rem 9.25rem minmax(0, 1fr) 1.75rem minmax(7.5rem, max-content) 1.25rem;
}

.crm-information-entry__row--workspace.crm-information-list__header {
  align-items: center;
}

.crm-information-entry__row--workspace.crm-information-entry__summary {
  align-items: center;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.crm-information-entry__row--workspace.crm-information-entry__summary--editing {
  grid-template-columns:
    minmax(12.5rem, 14.5rem)
    minmax(6rem, 9rem)
    minmax(0, 1fr)
    minmax(7.5rem, 11rem)
    auto
    1.25rem;
  align-items: center;
}

.crm-information-entry__row--workspace.crm-information-entry__row--no-contact.crm-information-entry__summary--editing {
  grid-template-columns:
    minmax(12.5rem, 14.5rem)
    minmax(0, 1fr)
    minmax(7.5rem, 11rem)
    auto
    1.25rem;
}

.crm-information-entry__row:not(.crm-information-entry__row--workspace).crm-information-entry__summary--editing {
  grid-template-columns:
    6.75rem
    9.25rem
    minmax(0, 1fr)
    minmax(7.5rem, 11rem)
    auto
    1.25rem;
}

.crm-information-entry__row--no-chevron {
  grid-template-columns: 6.75rem 9.25rem minmax(0, 1fr) auto;
}

.crm-information-list__header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334155;
}

.crm-information-list__header .data-table-sort-link {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
}

.crm-information-list__header .data-table-sort-link:hover {
  color: #0f172a;
  text-decoration: underline;
}

.crm-information-list__header .data-table-sort-link.is-active {
  color: #0f172a;
}

.crm-information-panel__entries > .crm-information-entry:nth-of-type(odd) {
  background-color: #eff6ff;
}

.crm-information-panel__entries > .crm-information-entry:nth-of-type(even) {
  background-color: #fff;
}

.crm-information-panel__entries > .crm-information-entry:hover > summary {
  background-color: #e5e7eb;
}

/* Expanded note package: one shade from title through Documents, lines above title and below docs. */
.crm-information-entry[open] {
  background-color: #e2e8f0;
  border-top: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
}

.crm-information-panel__entries > .crm-information-entry[open],
.crm-information-panel__entries > .crm-information-entry[open]:nth-of-type(odd),
.crm-information-panel__entries > .crm-information-entry[open]:nth-of-type(even) {
  background-color: #e2e8f0;
}

.crm-information-entry[open] > summary,
.crm-information-panel__entries > .crm-information-entry[open] > summary,
.crm-information-panel__entries > .crm-information-entry[open]:hover > summary {
  background-color: transparent;
}

.crm-information-entry[open] .crm-information-entry__content {
  background-color: transparent;
  border-top: none;
}

.crm-information-entry[open] .crm-information-entry__documents {
  border-top-color: rgb(100 116 139 / 0.35);
  margin-bottom: 0;
  padding-bottom: 0.25rem;
}

/* Inline edit: Date spans Date+Age; subject/share sit in summary columns. */
.crm-information-entry__row:not(.crm-information-entry__row--workspace)
  .crm-information-entry__when--edit-span {
  grid-column: 1 / 3;
}

.crm-information-entry__summary--editing {
  align-items: center;
}

.crm-information-entry__summary-field {
  min-width: 0;
  width: 100%;
}

.crm-information-entry__summary-field--date {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.crm-information-entry__when.crm-information-entry__summary-field--date {
  flex-direction: row;
  align-items: center;
}

.crm-information-entry__summary-field--date .crm-information-entry__summary-input {
  flex: 0 1 auto;
  width: 10.25rem;
  max-width: calc(100% - 2rem);
  min-width: 0;
}

.crm-information-entry__summary-field--date .date-display-picker--summary {
  flex: 0 1 auto;
  width: 12.75rem;
  max-width: calc(100% - 2rem);
  min-width: 0;
}

.crm-information-entry__summary-field--date .date-display-picker--summary .crm-information-entry__summary-input {
  width: 100%;
  max-width: none;
}

.crm-information-entry__summary-tz {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  color: #94a3b8;
  pointer-events: none;
  user-select: none;
}

.crm-information-entry__summary-input {
  display: block;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.35rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.25;
  color: #0f172a;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.crm-information-entry__summary-input:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgb(100 116 139 / 0.25);
}

.crm-information-entry__summary-hint {
  margin: 0.2rem 0 0;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.crm-information-entry__actions .root-record-delegation {
  display: inline-flex;
  align-items: center;
}

.crm-information-entry__actions .root-record-delegation__trigger {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
}

.crm-information-entry__actions .root-record-delegation__trigger--owner_unshared {
  color: #dc2626;
}

.crm-information-entry__actions .root-record-delegation__trigger--owner_unshared:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.crm-information-entry__actions .root-record-delegation__trigger--shared_full {
  color: #059669;
}

.crm-information-entry__actions .root-record-delegation__trigger--shared_full:hover {
  background: #ecfdf5;
  color: #047857;
}

.crm-information-entry__actions .root-record-delegation__icon {
  width: 1rem;
  height: 1rem;
}

.crm-note-edit-schedule {
  display: grid;
  grid-template-columns:
    minmax(4.5rem, 5.75rem)
    minmax(9rem, 12.5rem)
    minmax(7.5rem, 1fr)
    auto;
  gap: 0.5rem 0.75rem;
  align-items: end;
}

.crm-note-edit-schedule .urgency-slider__header .block {
  font-size: 0.75rem;
}

.crm-note-edit-schedule__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
  padding-bottom: 0.05rem;
}

.crm-note-edit-schedule__actions .crm-information-entry__expanded-actions {
  justify-content: flex-end;
}

@media (max-width: 560px) {
  .crm-note-edit-schedule {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .crm-note-edit-schedule__actions {
    justify-content: flex-start;
  }
}

.crm-information-list__header-sep {
  display: none;
}

.crm-information-entry__when,
.crm-information-entry__note-contact {
  display: block;
  overflow: hidden;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  color: #9a3412;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-information-entry__contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.crm-information-entry__when-date {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  min-width: 0;
}

.crm-information-entry__when-primary {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.crm-information-entry__when-bubble {
  display: none;
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 0;
  z-index: 50;
  width: max-content;
  max-width: min(18rem, 70vw);
  padding: 0.45rem 0.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.14);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
}

.crm-information-entry__when-date:hover .crm-information-entry__when-bubble,
.crm-information-entry__when-date:focus-within .crm-information-entry__when-bubble {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.crm-information-entry__when-bubble-line {
  display: block;
}

.crm-information-entry__when-bubble-line--audit {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  font-size: 0.6875rem;
  color: #475569;
}

.crm-information-entry__when-bubble-line--audit strong {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-information-entry__note-markers {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.crm-information-entry__due-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.15rem;
  border-radius: 0.2rem;
  background: #fee2e2;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: #dc2626;
}

.crm-information-entry__audit-info {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.crm-information-entry__audit-trigger {
  font-size: 0.875rem;
}

.crm-information-entry__audit-popup {
  display: none;
  position: absolute;
  top: 50%;
  left: calc(100% + 0.35rem);
  transform: translateY(-50%);
  z-index: 50;
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.14);
  color: #334155;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-transform: none;
  white-space: normal;
  pointer-events: none;
}

.crm-information-entry__audit-info:hover .crm-information-entry__audit-popup,
.crm-information-entry__audit-info:focus-within .crm-information-entry__audit-popup {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.crm-information-entry__audit-popup-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.crm-information-entry__audit-popup-row strong {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.crm-information-entry summary {
  user-select: none;
}

.crm-information-entry__summary {
  align-items: center;
}

.crm-information-entry__date {
  font-size: 0.75rem;
  line-height: 1.25;
  white-space: nowrap;
}

.crm-information-entry__subject {
  min-width: 0;
}

.crm-information-entry[open] [data-edit-focus="subject"],
.crm-information-entry[open] [data-edit-focus="date"] {
  cursor: pointer;
}

.crm-information-entry[open] [data-edit-focus="subject"] {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.15em;
}

.crm-information-entry[open] [data-edit-focus="subject"]:hover {
  color: #0f172a;
}

.crm-information-entry__age {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-information-entry__age--header {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.crm-information-entry__age--past {
  color: #b91c1c;
}

.crm-information-entry__age--future {
  color: #047857;
}

.crm-information-entry__age--now {
  color: #047857;
}

.crm-information-entry[open] summary {
  background-color: transparent;
}

.crm-information-entry__actions {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}

.crm-information-entry__row--no-chevron .crm-information-entry__actions {
  display: inline-flex;
}

.crm-information-entry[open] .crm-information-entry__actions {
  display: inline-flex;
}

.crm-information-entry__actions:has(.crm-information-entry__shared),
.crm-information-entry__actions:has(.crm-information-entry__attachments:not(.crm-information-entry__attachments--empty)),
.crm-information-entry__actions:has(.crm-information-entry__note-markers),
.crm-information-entry__actions:has(.root-record-delegation) {
  display: inline-flex;
}

.crm-information-entry__action-buttons {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.crm-information-entry[open] .crm-information-entry__action-buttons,
.crm-information-entry__row--no-chevron .crm-information-entry__action-buttons {
  display: inline-flex;
}

.crm-information-entry__shared {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-information-entry__shared--active {
  color: #059669;
}

.crm-information-entry__shared-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.crm-information-entry__shared-btn:hover {
  background: rgb(236 253 245);
}

.crm-information-entry__shared-btn:focus-visible {
  outline: 2px solid rgb(16 185 129);
  outline-offset: 2px;
}

.crm-information-entry__shared-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.note-share-info-dialog {
  outline: none;
}

.note-share-info-dialog::backdrop {
  background: rgb(15 23 42 / 0.4);
}

.note-share-info-dialog__sheet {
  overflow: hidden;
  border: 1px solid #d1fae5;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 20px 40px rgb(15 23 42 / 0.18);
}

.note-share-info-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.875rem;
  border-bottom: 1px solid #ecfdf5;
  background: linear-gradient(180deg, #ecfdf5 0%, #fff 100%);
}

.note-share-info-dialog__heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.note-share-info-dialog__badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid #6ee7b7;
  background: #fff;
  color: #059669;
}

.note-share-info-dialog__badge-icon {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
}

.note-share-info-dialog__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: #064e3b;
}

.note-share-info-dialog__subject {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #64748b;
}

.note-share-info-dialog__close {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin: -0.15rem -0.15rem 0 0;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #64748b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.note-share-info-dialog__close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.note-share-info-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem;
}

.note-share-info-dialog__section {
  min-width: 0;
}

.note-share-info-dialog__label {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.note-share-info-dialog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.note-share-info-dialog__chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border: 1px solid #a7f3d0;
  border-radius: 0.375rem;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.note-share-info-dialog__chip--owner {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.note-share-info-dialog__empty {
  margin: 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.crm-information-entry__attachments {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.35rem;
  border-radius: 0.375rem;
  color: #475569;
  text-decoration: none;
}

.crm-information-entry__attachments:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.crm-information-entry__attachments--empty {
  display: none;
}

.crm-information-entry[open] .crm-information-entry__attachments--empty,
.crm-information-entry__row--no-chevron .crm-information-entry__attachments--empty {
  display: inline-flex;
}

.crm-information-entry__attachments-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.crm-information-entry__attachments-count {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.crm-information-entry__chevron {
  display: inline-block;
  transition: transform 0.15s ease;
}

.crm-information-entry[open] .crm-information-entry__chevron {
  transform: rotate(180deg);
}

.crm-calendar--full .grid.grid-cols-7 + .grid {
  min-height: 36rem;
}

.crm-calendar__day--past {
  background: #f8fafc !important;
}

.crm-calendar__day--today {
  background: color-mix(in srgb, #fecaca 28%, #fff) !important;
}

.crm-calendar__day--drop-target {
  outline: 2px solid var(--color-gold);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--color-gold) 12%, white);
}

.crm-calendar__entry--dragging {
  opacity: 0.55;
}

.crm-calendar__task-entry {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 0.25rem;
  padding: 0.0625rem 0.25rem;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  color: #0f172a;
  text-decoration: none;
}

.crm-calendar__task-entry:hover {
  filter: brightness(0.96);
}

.crm-calendar__task-entry--urgency-very_high {
  background: color-mix(in srgb, #4cc96a 50%, white);
}

.crm-calendar__task-entry--urgency-high {
  background: color-mix(in srgb, #c6e266 50%, white);
}

.crm-calendar__task-entry--urgency-medium {
  background: color-mix(in srgb, #ffdd33 50%, white);
}

.crm-calendar__task-entry--urgency-low {
  background: color-mix(in srgb, #ffcc99 50%, white);
}

.crm-calendar__task-entry--urgency-very_low {
  background: color-mix(in srgb, #ff7f6a 50%, white);
}

.crm-calendar__task-entry--urgency-not_sure {
  background: color-mix(in srgb, #7d868f 50%, white);
}

.crm-calendar__entry[draggable="true"] {
  cursor: grab;
}

.crm-calendar__entry[draggable="true"]:active {
  cursor: grabbing;
}

.task-kanban {
  margin-top: 1.5rem;
}

.task-kanban__toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.75rem;
}

.task-kanban__columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.task-kanban__column {
  display: flex;
  flex-direction: column;
  min-height: 24rem;
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.task-kanban__column-header {
  flex-shrink: 0;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0.75rem 0.75rem 0 0;
}

.task-kanban__column-header--menu {
  position: relative;
}

.task-kanban__column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.task-kanban__column-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: #0f172a;
}

.task-kanban__column-title--renamable {
  flex: 1;
  min-width: 0;
  cursor: text;
  border-radius: 0.25rem;
}

.task-kanban__column-title--renamable:hover,
.task-kanban__column-title--renamable:focus-visible {
  background: #f8fafc;
  outline: none;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.task-kanban__column-title-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 1px solid #94a3b8;
  border-radius: 0.25rem;
  background: #fff;
  padding: 0.125rem 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: #0f172a;
}

.task-kanban__column-title-input:focus {
  outline: none;
  border-color: #64748b;
  box-shadow: 0 0 0 2px rgb(148 163 184 / 0.35);
}

.task-kanban__column-add {
  flex-shrink: 0;
}

.task-kanban__column-title--button {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-kanban__column-title--button:hover {
  color: #334155;
}

.task-kanban__column-caret {
  font-size: 0.75rem;
  color: #64748b;
}

.task-kanban__column-cards {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0.875rem;
  list-style: none;
}

.task-kanban__card {
  padding: 1rem 1.125rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.task-kanban__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.task-kanban__card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.task-kanban__card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.task-kanban__card-icon {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}

.task-kanban__card-priority,
.task-kanban__card-due {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
}

.task-kanban__done-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  z-index: 10;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.task-kanban__done-menu-item {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  border: 0;
  background: transparent;
  font-size: 0.875rem;
  text-align: left;
  color: #334155;
  cursor: pointer;
}

.task-kanban__done-menu-item:hover {
  background: #f8fafc;
}

.task-kanban__done-menu-item--active {
  font-weight: 600;
  color: #0f172a;
}

@media (max-width: 1023px) {
  .task-kanban__columns {
    display: flex;
    gap: 0.875rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .task-kanban__column {
    flex: 0 0 min(85vw, 17.5rem);
    scroll-snap-align: start;
  }
}

.task-kanban__column--drop-target {
  outline: 2px solid var(--color-gold);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--color-gold) 8%, #f8fafc);
}

.task-kanban__card--dragging {
  opacity: 0.55;
}

.task-kanban__card[draggable="true"] {
  cursor: grab;
}

.task-kanban__card[draggable="true"]:active {
  cursor: grabbing;
}

/* Bucket contact cards: background set inline from last-note freshness ramp. */
.task-kanban__card--contact-recency {
  border-width: 1px;
  border-style: solid;
}

.task-kanban__card--urgency-very_high {
  background: color-mix(in srgb, #4cc96a 50%, white);
  border-color: color-mix(in srgb, #3aab58 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-high {
  background: color-mix(in srgb, #c6e266 50%, white);
  border-color: color-mix(in srgb, #a8c44f 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-medium {
  background: color-mix(in srgb, #ffdd33 50%, white);
  border-color: color-mix(in srgb, #e6c400 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-low {
  background: color-mix(in srgb, #ffcc99 50%, white);
  border-color: color-mix(in srgb, #f0b070 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-very_low {
  background: color-mix(in srgb, #ff7f6a 50%, white);
  border-color: color-mix(in srgb, #e86650 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-not_sure {
  background: color-mix(in srgb, #7d868f 50%, white);
  border-color: color-mix(in srgb, #636b74 50%, white);
  color: #0f172a;
}

.task-kanban__card--urgency-not_sure .task-kanban__card-title,
.task-kanban__card--urgency-not_sure .task-kanban__card-title:hover {
  color: #0f172a;
}

.task-kanban__card--urgency-not_sure .task-kanban__card-due,
.task-kanban__card--urgency-not_sure .task-kanban__card-priority {
  color: rgba(15, 23, 42, 0.7);
}

.task-kanban__card-title {
  min-width: 0;
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
}

.task-kanban__card-title:hover {
  text-decoration: underline;
}

.task-kanban__card-due {
  color: rgba(15, 23, 42, 0.7);
}

.task-kanban__card-audit {
  margin: 0;
  font-size: 0.625rem;
  line-height: 1.3;
  color: rgba(15, 23, 42, 0.55);
}

.task-kanban__card--urgency-not_sure .task-kanban__card-audit {
  color: rgba(15, 23, 42, 0.6);
}

.event-profile-panel__audit {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.crm-calendar__view-tab {
  border-radius: 0.375rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

.crm-calendar__view-tab:hover {
  background: #f8fafc;
}

.crm-calendar__view-tab--active {
  background: #fff7ed;
  color: #9a3412;
}

.crm-calendar-year__month {
  min-height: 0;
}

.crm-calendar--year-view .crm-calendar__title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.crm-calendar-year {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 2.5rem;
}

.crm-calendar-year__month-title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-calendar-year__month-grid {
  display: grid;
  grid-template-columns: 1.35rem repeat(7, minmax(0, 1fr));
  gap: 0.15rem;
  text-align: center;
}

.crm-calendar-year__week-header {
  display: block;
}

.crm-calendar-year__day-header {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.crm-calendar-year__week-number {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-style: italic;
  color: #64748b;
}

.crm-calendar-year__week-link {
  color: inherit;
  font-style: italic;
  text-decoration: none;
}

.crm-calendar-year__week-link:hover {
  color: #9a3412;
  text-decoration: underline;
}

.crm-calendar-year__day {
  display: inline-flex;
  height: 1.5rem;
  width: 1.5rem;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
}

.crm-calendar-year__day:hover {
  background: #f1f5f9;
}

.crm-calendar-year__day--today {
  border: 1px solid #f97316;
  font-weight: 700;
  color: #0f172a;
}

.crm-calendar-year__day--outside {
  visibility: hidden;
}

@media (max-width: 48rem) {
  .crm-calendar-year {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 30rem) {
  .crm-calendar-year {
    grid-template-columns: 1fr;
  }
}

.crm-calendar-month__grid {
  display: grid;
  grid-template-columns: 2.75rem repeat(7, minmax(0, 1fr));
  /* Prefer borders over 1px gap: fractional zoom (e.g. 75%) often collapses
     row-gap hairlines while column gaps still paint. */
  gap: 0;
}

.crm-calendar-month__grid > * {
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.crm-calendar-month__week-label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.crm-calendar-month__day {
  position: relative;
  min-width: 0;
}

.crm-calendar__day--navigate {
  cursor: pointer;
}

.crm-calendar-time__column--navigate {
  cursor: pointer;
}

.crm-calendar-time__events-column.crm-calendar-time__column--navigate {
  pointer-events: auto;
}

.crm-calendar-entry__contact-name {
  font-weight: 600;
  color: #475569;
  opacity: 0.9;
}

.crm-calendar-entries__toggle {
  margin: 0;
  list-style: none;
}

.crm-calendar-entries__more,
.crm-calendar-entries__less {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.25rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.crm-calendar-entries__more:hover,
.crm-calendar-entries__less:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.crm-calendar-month__day:has(.crm-calendar-entries--expanded) {
  z-index: 2;
  min-height: auto;
  box-shadow: 0 0 0 1px #cbd5e1;
}

.crm-calendar-month__day:has(.crm-calendar-birthday-overflow) {
  padding-bottom: 1.15rem;
}

.crm-calendar-month__day:has(.crm-calendar-birthday-overflow) .crm-calendar-entries__toggle {
  padding-right: 1.15rem;
}

.crm-calendar-birthday-overflow {
  position: absolute;
  right: 0.15rem;
  bottom: 0.15rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.1rem;
  border: 0;
  border-radius: 0.25rem;
  background: transparent;
  color: #059669;
  cursor: default;
}

.crm-calendar-birthday-overflow__icon {
  width: 0.95rem;
  height: 0.95rem;
  color: inherit;
}

.crm-calendar-birthday-overflow__list {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.15rem);
  z-index: 4;
  min-width: 7.5rem;
  max-width: 12rem;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid #a7f3d0;
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 4px 12px rgb(15 23 42 / 12%);
  text-align: left;
  white-space: nowrap;
}

.crm-calendar-birthday-overflow:hover .crm-calendar-birthday-overflow__list,
.crm-calendar-birthday-overflow:focus-visible .crm-calendar-birthday-overflow__list,
.crm-calendar-birthday-overflow:focus-within .crm-calendar-birthday-overflow__list {
  display: flex;
}

.crm-calendar-birthday-overflow__name {
  display: block;
  color: #064e3b;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.3;
}

.crm-calendar-month__day:has(.crm-calendar-birthday-overflow:is(:hover, :focus-within)) {
  z-index: 5;
}

.crm-calendar-month:has(.crm-calendar-birthday-overflow:is(:hover, :focus-within)) {
  overflow: visible;
}

.crm-calendar-month__day:has(.crm-calendar-entries--expanded) .crm-calendar-birthday-overflow {
  display: none;
}

.crm-calendar-month-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-top: 0.5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: color-mix(in srgb, var(--color-cream, #f5f0e6) 70%, #fff);
}

.crm-calendar-month-jump__year {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.3rem;
  min-width: 0;
}

.crm-calendar-month-jump__year-label {
  margin: 0;
  margin-right: 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
  text-decoration: none;
  width: fit-content;
}

.crm-calendar-month-jump__year-label:hover {
  color: #9a3412;
  text-decoration: underline;
}

.crm-calendar-month-jump__months {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.crm-calendar-month-jump__month {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.1rem 0.3rem;
  border: 1px solid #93c5fd;
  border-radius: 0.2rem;
  background: #fff;
  color: #1d4ed8;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.15;
  text-decoration: none;
}

.crm-calendar-month-jump__month:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}

.crm-calendar-month-jump__month--selected {
  border-color: color-mix(in srgb, var(--color-gold, #e4b84a) 70%, #ca8a04);
  background: color-mix(in srgb, var(--color-gold, #f5d76e) 85%, #fff);
  color: #0f172a;
  font-weight: 700;
}

.crm-calendar-time {
  --crm-calendar-hour-height-min: 3rem;
  --crm-calendar-hour-height: var(--crm-calendar-hour-height-min);
  --crm-calendar-time-gutter: 3.5rem;
  margin-top: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.crm-calendar-time--full .crm-calendar-time__scroll {
  max-height: none;
  min-height: 32rem;
}

.crm-calendar-time__scroll {
  max-height: 32rem;
  overflow: auto;
  scrollbar-gutter: stable;
}

.crm-calendar-time__all-day {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.crm-calendar-time__all-day-sheet {
  display: grid;
  grid-template-columns: var(--crm-calendar-time-gutter) repeat(var(--day-count, 1), minmax(0, 1fr));
  min-width: 0;
}

.crm-calendar-time__all-day-label {
  grid-column: 1;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.45rem 0.4rem 0.45rem 0;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
  color: #64748b;
  text-align: right;
}

.crm-calendar-time__all-day-day {
  min-height: 2.25rem;
  padding: 0.35rem 0.3rem;
  border-left: 1px solid #e2e8f0;
}

.crm-calendar-time__all-day-day--today,
.crm-calendar-time__column--today {
  background-color: color-mix(in srgb, #fecaca 28%, #fff);
}

.crm-calendar-time__all-day-day--past,
.crm-calendar-time__column--past {
  background-color: #f8fafc;
}

.crm-calendar-time__now-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  height: 0;
  border-top: 2px dashed #dc2626;
  pointer-events: none;
}

.crm-calendar-time__day-heading {
  margin: 0 0 0.2rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #334155;
  text-transform: none;
  letter-spacing: normal;
}

.crm-calendar-time__empty {
  margin: 0;
  font-size: 0.65rem;
  color: #94a3b8;
}

.crm-calendar-time__body {
  min-width: 0;
}

.crm-calendar-time__sheet {
  display: grid;
  grid-template-columns: var(--crm-calendar-time-gutter) repeat(var(--day-count, 1), minmax(0, 1fr));
  grid-template-rows: repeat(24, var(--crm-calendar-hour-height));
  min-width: 0;
}

.crm-calendar-time--week .crm-calendar-time__scroll {
  overflow-x: auto;
}

.crm-calendar-time--week .crm-calendar-time__all-day-sheet,
.crm-calendar-time--week .crm-calendar-time__sheet {
  min-width: calc(var(--crm-calendar-time-gutter) + var(--day-count) * 5.5rem);
}

.crm-calendar-time__hour {
  grid-column: 1;
  box-sizing: border-box;
  border-top: 1px solid #f1f5f9;
}

.crm-calendar-time__hour:first-child {
  border-top: none;
}

.crm-calendar-time__hour-label {
  display: block;
  margin-top: -0.45rem;
  padding-right: 0.4rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: #94a3b8;
  text-align: right;
}

.crm-calendar-time__hour:first-child .crm-calendar-time__hour-label {
  margin-top: 0.15rem;
}

.crm-calendar-time__slot {
  box-sizing: border-box;
  border-top: 1px solid #f1f5f9;
  border-left: 1px solid #e2e8f0;
}

.crm-calendar-time__slot--first-row {
  border-top: none;
}

.crm-calendar-time__events-column {
  position: relative;
  grid-row: 1 / span 24;
  z-index: 1;
  pointer-events: none;
  min-width: 0;
  border-left: 1px solid #e2e8f0;
}

.crm-calendar-time__events-column .crm-calendar-time__event-wrap {
  pointer-events: auto;
}

.crm-calendar-time__event-wrap {
  position: absolute;
  z-index: 1;
  min-height: 1.15rem;
  padding: 0 0.1rem;
  box-sizing: border-box;
}

.crm-calendar-time__event {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  height: 100%;
  overflow: hidden;
  padding: 0.15rem 0.3rem;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  box-sizing: border-box;
}

.crm-calendar-time__event-time {
  font-size: 0.6rem;
  font-weight: 500;
  opacity: 0.85;
}

.crm-calendar-time__event-title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.crm-calendar-time__event--note {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  white-space: nowrap;
}

.crm-calendar-time__event--note .crm-calendar-time__event-time {
  flex-shrink: 0;
}

.crm-calendar-time__event--note .crm-calendar-time__event-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  -webkit-box-orient: initial;
  -webkit-line-clamp: unset;
}

.crm-calendar-entry__follow-up {
  color: #dc2626;
}

.crm-calendar-entry__subject {
  color: #0f172a;
}

.crm-calendar-time__event--event {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #78350f;
}

.crm-calendar-time__event--visit {
  background: #e0e7ff;
  border-color: #a5b4fc;
  color: #312e81;
}

.crm-calendar-time__event--visit-planned {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.crm-calendar-time__event--birthday {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #064e3b;
}

.crm-calendar-time__event--task {
  background: #ffee99;
  border-color: #eab308;
  color: #422006;
}

.crm-calendar-time__event:hover {
  filter: brightness(0.97);
}

/* Account dashboard summary cards */
.account-dashboard__stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .account-dashboard__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .account-dashboard__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.account-dashboard__stat {
  display: flex;
  flex-direction: column;
  min-height: 9.5rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.875rem;
  background: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-chocolate) 8%, transparent);
}

.account-dashboard__stat--balance {
  border-color: color-mix(in srgb, var(--color-gold) 45%, var(--color-border-subtle));
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--color-gold) 22%, #fff) 0%,
    #fff 58%
  );
}

.account-dashboard__stat--currency {
  border-color: color-mix(in srgb, var(--color-tawny) 28%, var(--color-border-subtle));
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--color-cream) 55%, #fff) 0%,
    #fff 62%
  );
}

.account-dashboard__stat--slips {
  border-color: color-mix(in srgb, var(--color-tawny) 22%, var(--color-border-subtle));
}

.account-dashboard__stat--reconcile {
  border-color: color-mix(in srgb, #22c55e 28%, var(--color-border-subtle));
}

.account-dashboard__stat--clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-dashboard__stat--clickable:hover {
  border-color: color-mix(in srgb, var(--color-tawny) 40%, var(--color-border-subtle));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-chocolate) 12%, transparent);
}

.account-dashboard__stat--clickable:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-tawny) 70%, #fff);
  outline-offset: 2px;
}

.account-dashboard__stat--reconcile.account-dashboard__stat--clickable:hover {
  border-color: color-mix(in srgb, #22c55e 48%, var(--color-border-subtle));
}

@media (min-width: 40rem) and (max-width: 63.99rem) {
  .account-dashboard__stat--slips,
  .account-dashboard__stat--reconcile {
    grid-column: 1 / -1;
  }
}

.account-dashboard__dial {
  position: relative;
  width: 100%;
  max-width: 11rem;
  margin: 0 auto;
}

.account-dashboard__dial-svg {
  display: block;
  width: 100%;
  height: auto;
}

.account-dashboard__dial-track {
  stroke: #e2e8f0;
}

.account-dashboard__dial-hub {
  position: absolute;
  left: 50%;
  bottom: 0.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
  line-height: 1.1;
  text-align: center;
}

.account-dashboard__dial-hub-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #14532d;
}

.account-dashboard__dial-hub-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.account-dashboard__dial-legend {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}

.account-dashboard__dial-legend li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.75rem;
  color: #475569;
}

.account-dashboard__dial-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
}

.account-dashboard__dial-swatch--unreconciled { background: #f87171; }
.account-dashboard__dial-swatch--partial { background: #f59e0b; }
.account-dashboard__dial-swatch--full { background: #22c55e; }

.account-dashboard__stat-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.account-dashboard__stat-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  color: var(--color-chocolate);
  background: color-mix(in srgb, var(--color-cream) 70%, #fff);
}

.account-dashboard__stat--balance .account-dashboard__stat-icon {
  color: color-mix(in srgb, var(--color-tawny) 88%, var(--color-chocolate));
  background: color-mix(in srgb, var(--color-gold) 34%, #fff);
}

.account-dashboard__stat-icon svg {
  width: 1rem;
  height: 1rem;
}

.account-dashboard__stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.account-dashboard__stat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  margin-top: 0.85rem;
}

.account-dashboard__stat-value {
  margin: 0;
  line-height: 1.1;
}

.account-dashboard__stat-amount {
  font-size: clamp(1.75rem, 2.4vw, 2.125rem);
  font-weight: 700;
  color: var(--color-chocolate);
}

.account-dashboard__stat-unit {
  margin-left: 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.account-dashboard__stat-value--empty {
  font-size: 2rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--color-text-muted) 70%, #fff);
}

.account-dashboard__currency-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-tawny) 30%, var(--color-border-subtle));
  border-radius: 0.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-chocolate);
  background: color-mix(in srgb, var(--color-cream) 45%, #fff);
}

.account-dashboard__stat-note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.account-dashboard__stat-note--warning {
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  color: color-mix(in srgb, #92400e 88%, var(--color-chocolate));
  background: color-mix(in srgb, #fef3c7 72%, #fff);
}

.account-dashboard__stat-note-label {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-dashboard__stat-path {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  align-items: center;
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}

.account-dashboard__stat-path-sep {
  color: color-mix(in srgb, var(--color-tawny) 55%, var(--color-text-muted));
  font-weight: 600;
}

.account-dashboard__stat-path-segment {
  max-width: 100%;
}

.account-dashboard__stat-empty {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

.account-dashboard__slip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-dashboard__slip-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-tawny) 24%, var(--color-border-subtle));
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-chocolate);
  background: color-mix(in srgb, var(--color-cream) 55%, #fff);
}

.account-dashboard__slip-chip--link {
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.account-dashboard__slip-chip--link:hover {
  border-color: color-mix(in srgb, var(--color-gold) 55%, var(--color-tawny));
  background: color-mix(in srgb, var(--color-gold) 28%, #fff);
}

/* HFP worksheet grid */
.data-table--worksheet {
  table-layout: fixed;
}

.data-table--worksheet th,
.data-table--worksheet td {
  padding: 0.125rem 0.25rem;
}

.data-table--worksheet col.col-reason {
  width: 8rem;
}

.data-table--worksheet col.col-drag {
  width: 0;
}

.data-table--worksheet.worksheet-grid--row-reorderable col.col-drag {
  width: 1.75rem;
}

.data-table--worksheet col.col-month {
  width: 5rem;
}

.data-table--worksheet col.col-total {
  width: 4.5rem;
}

.data-table--worksheet col.col-actions {
  width: 6.5rem;
}

.data-table--worksheet th.actions-col,
.data-table--worksheet td.actions-col {
  width: 6.5rem;
  padding-left: 0.125rem;
  padding-right: 0.125rem;
}

.data-table-shell .data-table--worksheet .worksheet-grid__reason-header {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 8rem;
  width: 8rem;
  padding: 0.125rem 0.25rem;
  color: var(--color-table-header-text) !important;
  background: var(--color-table-header) !important;
  background-clip: padding-box;
  box-shadow: 1px 0 0 color-mix(in srgb, var(--color-black) 35%, var(--color-table-header));
}

.data-table-shell .data-table--worksheet .worksheet-grid__reason-cell {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 8rem;
  width: 8rem;
  padding: 0.125rem 0.25rem;
  background: #fff !important;
  background-clip: padding-box;
  box-shadow: 1px 0 0 #e2e8f0;
}

.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__reason-header,
.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__reason-cell {
  left: 1.75rem;
}

.data-table--worksheet .worksheet-grid__drag-header,
.data-table--worksheet .worksheet-grid__drag-cell {
  width: 0;
  max-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__drag-header,
.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__drag-cell {
  width: 1.75rem;
  max-width: 1.75rem;
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 6;
  background-clip: padding-box;
}

.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__drag-header {
  color: var(--color-table-header-text) !important;
  background: var(--color-table-header) !important;
}

.data-table--worksheet.worksheet-grid--row-reorderable .worksheet-grid__drag-cell {
  background: #fff !important;
}

.worksheet-grid__reason-display {
  display: block;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.worksheet-grid__reason-display[hidden],
.worksheet-grid__notes-input[hidden],
.worksheet-grid__amount-input[hidden],
.worksheet-grid__combined-display[hidden],
.worksheet-grid__reason-input[hidden] {
  display: none !important;
}

.worksheet-grid__drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 0.25rem;
}

.worksheet-grid__drag-handle--active {
  cursor: grab;
  color: #94a3b8;
}

.worksheet-grid__drag-handle--active:hover {
  color: #64748b;
  background: #f8fafc;
}

.worksheet-grid__drag-handle--active:active {
  cursor: grabbing;
}

.worksheet-grid__drag-handle-icon {
  display: block;
}

.worksheet-grid__row--dragging {
  opacity: 0.55;
}

.worksheet-grid__row--drop-target {
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--color-gold, #d4a017) 70%, #fff);
}

.worksheet-grid__cell-input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  resize: vertical;
}

.worksheet-grid__notes-input {
  box-sizing: border-box;
  overflow: hidden;
  resize: none;
  min-height: 1.25rem;
  line-height: 1.25rem;
}

.data-table--worksheet .worksheet-grid__month-cell {
  padding: 0.125rem 0.25rem;
}

.worksheet-grid__cell-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-slate-900, #0f172a) 15%, transparent);
}

.worksheet-grid__amount-input,
.gpa-row-field[inputmode="decimal"],
.gpa-row-field[inputmode="numeric"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.worksheet-grid__amount-input::-webkit-outer-spin-button,
.worksheet-grid__amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.worksheet-grid__reason-input {
  font-weight: 500;
}

.worksheet-grid__combined-display {
  min-height: 1.25rem;
  padding: 0;
  margin: 0;
}

.data-table--worksheet:not(.worksheet-grid--combined-view) .worksheet-grid__month-cell {
  vertical-align: top;
}

.data-table--worksheet.worksheet-grid--amount-view .worksheet-grid__month-cell,
.data-table--worksheet.worksheet-grid--amount-view .worksheet-grid__month-cell--group,
.data-table--worksheet.worksheet-grid--amount-view .worksheet-grid__total-cell {
  vertical-align: middle;
}

.data-table--worksheet.worksheet-grid--notes-view .worksheet-grid__month-cell,
.data-table--worksheet.worksheet-grid--amount-view .worksheet-grid__month-cell {
  position: relative;
}

.data-table--worksheet.worksheet-grid--notes-view .worksheet-grid__month-cell--has-nick::after,
.data-table--worksheet.worksheet-grid--amount-view .worksheet-grid__month-cell--has-nick::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-width: 0 0.5rem 0.5rem 0;
  border-style: solid;
  border-color: transparent #16a34a transparent transparent;
  pointer-events: none;
  z-index: 1;
}

.worksheet-grid__hint-popup,
.budget-grid__hint-popup {
  position: fixed;
  z-index: 60;
  max-width: 18rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: pre-wrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgb(15 23 42 / 25%);
}

.budget-grid__hint-popup {
  max-width: 22rem;
}

.budget-grid__hint-popup[hidden] {
  display: none;
}

.data-table--worksheet.worksheet-grid--combined-view .worksheet-grid__month-cell,
.data-table--worksheet.worksheet-grid--combined-view .worksheet-grid__total-cell {
  vertical-align: bottom;
}

.data-table--worksheet.worksheet-grid--combined-view .worksheet-grid__reason-header,
.data-table--worksheet.worksheet-grid--combined-view .worksheet-grid__reason-cell {
  vertical-align: middle;
}

.worksheet-grid__combined-notes {
  font-style: italic;
  white-space: pre-wrap;
}

.worksheet-grid__combined-amount {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.worksheet-grid__amount--negative,
.worksheet-grid__amount-input.worksheet-grid__amount--negative {
  color: #b91c1c;
}

.worksheet-grid__reason-select {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 0.25rem;
}

.worksheet-grid__reason-select:hover {
  background: color-mix(in srgb, var(--color-slate-900, #0f172a) 6%, transparent);
}

.worksheet-grid__reason-select--detail {
  padding-left: 1rem;
}

.worksheet-grid__row--selected {
  box-shadow: inset 3px 0 0 0 color-mix(in srgb, var(--color-gold, #d4a017) 75%, #fff);
}

.worksheet-grid__actions-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.worksheet-grid__row-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  flex-wrap: wrap;
}

.worksheet-grid__row--tag-drop-target {
  outline: 2px solid #16a34a;
  outline-offset: -2px;
  background: color-mix(in srgb, #16a34a 8%, #fff);
}

.worksheet-grid__toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.worksheet-grid__toolbar-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.worksheet-grid__toolbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 0.75rem;
  margin-left: auto;
}

.worksheet-stale-banner {
  position: fixed;
  left: var(--stockman-page-inset, 0);
  right: var(--stockman-page-inset, 0);
  bottom: 1.5rem;
  z-index: 55;
  display: flex;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
}

.worksheet-stale-banner__bar {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 90%;
  max-width: 40rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fcd34d;
  border-radius: 0.75rem;
  background: rgb(255 251 235 / 0.96);
  color: #92400e;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  backdrop-filter: blur(4px);
  box-sizing: border-box;
}

.worksheet-stale-banner__message {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.worksheet-stale-banner__refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b45309;
  border-radius: 0.375rem;
  background: #fff;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
  cursor: pointer;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
}

.worksheet-stale-banner__refresh:hover {
  background: #fff7ed;
}

.worksheet-grid__title {
  margin: 0;
  min-width: 0;
  justify-self: start;
}

.hfp-title-switch {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  color: #0f172a;
}

.hfp-title-switch__title {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 0.375rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hfp-title-switch__title:hover,
.hfp-title-switch__title:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
  outline: none;
}

.hfp-title-switch__select {
  margin: 0;
  max-width: min(24rem, 100%);
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  padding: 0.15rem 0.45rem;
}

.worksheet-grid__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.worksheet-grid__version {
  min-width: 0;
}

.worksheet-grid__version-select {
  max-width: 16rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.35rem 0.6rem;
}

.worksheet-year-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
}

.worksheet-year-btn--current {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.worksheet-year-btn--exists {
  color: #0f172a;
}

.worksheet-year-btn--exists:hover {
  background: #f8fafc;
}

.worksheet-year-btn--pending {
  border-style: dashed;
  color: #94a3b8;
  background: #f8fafc;
}

.worksheet-year-btn__label {
  color: #94a3b8;
}

.worksheet-year-btn__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.15rem;
}

.worksheet-year-btn__actions .icon-action-btn {
  color: #64748b;
}

.worksheet-year-btn__actions .icon-action-btn:hover {
  color: #0f172a;
}

.worksheet-grid__heading {
  min-width: 0;
  justify-self: start;
}

.worksheet-grid__currency {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  flex: 0 0 auto;
}

.worksheet-grid__meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  width: 100%;
  min-width: 0;
}

.worksheet-grid__cents-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.worksheet-grid__cents-toggle input {
  margin: 0;
}

.enterprise-hfp-col-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.enterprise-hfp-col-title .hfp-json-transfer {
  margin: -0.25rem 0;
}

.hfp-json-transfer--compact .icon-action-btn,
.hfp-json-transfer--compact label.icon-action-btn {
  cursor: pointer;
}

.worksheet-index__name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.worksheet-index__name .cell-clip {
  flex: 1 1 auto;
  min-width: 0;
}

.worksheet-index__years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}

/* Same planning year sits in the same column across rows (empty slots fill gaps).
   Used on Worksheets / GPA index pages — not on the HFP enterprises table. */
.worksheet-index__years--aligned {
  flex-wrap: nowrap;
  align-items: flex-start;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 0.1rem;
}

.worksheet-index__year-slot {
  box-sizing: border-box;
  flex: 0 0 8rem;
  width: 8rem;
  min-height: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.worksheet-index__year-slot--empty {
  pointer-events: none;
}

.worksheet-index__year-slot--action {
  flex: 0 0 auto;
  width: auto;
}

/* HFP enterprises table: one horizontal line per planning year. */
.worksheet-index__years--stacked {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.35rem;
}

.worksheet-index__year-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-height: 1.75rem;
}

.worksheet-index__year-line-label {
  flex: 0 0 auto;
  min-width: 3.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.hfp-named-worksheet-groups {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.hfp-named-worksheet-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
  width: 100%;
}

.hfp-named-worksheet-group__name {
  flex: 0 1 auto;
  max-width: 40%;
  font-weight: 600;
  color: #0f172a;
}

.hfp-named-worksheet-group .worksheet-index__years {
  flex: 1 1 12rem;
  min-width: 0;
}

.data-table--hfp .site-selection-chip {
  padding: 0.15rem 0.4rem;
  gap: 0.3rem;
}

.site-selection-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.site-selection-chip:hover,
.site-selection-chip:focus-within {
  background: var(--color-hover-bg);
}

/* Root awareness: after ≥20 seconds away, initials shrink toward the breadcrumb chip
   or (Preferences) a holistic-context modal dismissed by any click. */
.root-awareness-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: auto;
  background: transparent;
}

.root-awareness-overlay--modal {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgb(15 23 42 / 0.42);
}

.root-awareness-overlay__initials {
  position: fixed;
  z-index: 81;
  margin: 0;
  padding: 0;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--color-chocolate, #3b2314);
  text-shadow: 0 1px 0 rgb(255 255 255 / 0.55);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.root-awareness-modal {
  width: min(92vw, 36rem);
  max-height: min(88vh, 32rem);
  overflow: auto;
  margin: 0;
  padding: 1.75rem 1.75rem 1.25rem;
  border: 1px solid color-mix(in srgb, var(--color-tawny, #c4783a) 28%, #fff);
  border-radius: 1rem;
  background: #fffef8;
  box-shadow:
    0 25px 50px -12px rgb(15 23 42 / 0.35),
    0 0 0 1px rgb(15 23 42 / 0.04);
  color: var(--color-chocolate, #3b2314);
  pointer-events: none;
  user-select: none;
}

.root-awareness-modal__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-chocolate, #3b2314);
}

.root-awareness-modal__subtitle {
  margin: 0.55rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-tawny, #c4783a) 72%, var(--color-chocolate, #3b2314));
}

.root-awareness-modal__quote {
  margin: 1.25rem 0 0;
  padding: 0 0 0 1rem;
  border-left: 3px solid color-mix(in srgb, var(--color-gold, #e8c547) 70%, var(--color-tawny, #c4783a));
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 450;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-chocolate, #3b2314) 88%, #64748b);
}

.root-awareness-modal__hint {
  margin: 1.35rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #94a3b8;
  text-align: center;
}

.root-awareness-chip--pulse {
  animation: root-awareness-chip-pulse 0.9s ease-out;
}

@keyframes root-awareness-chip-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-tawny, #c4783a) 55%, transparent);
    background: color-mix(in srgb, var(--color-gold, #e8c547) 55%, transparent);
  }
  100% {
    box-shadow: 0 0 0 10px transparent;
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .root-awareness-chip--pulse {
    animation: none;
    background: color-mix(in srgb, var(--color-gold, #e8c547) 45%, transparent);
  }
}

.worksheet-index__year-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  white-space: nowrap;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.worksheet-index__year-link:hover,
.worksheet-index__year-link:focus-visible {
  text-decoration: none;
}

.worksheet-index__version-count {
  font-size: 0.8125rem;
  color: #9a3412;
  font-weight: 600;
}

.worksheet-version-dialog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.worksheet-version-dialog__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem 0.65rem;
}

.worksheet-version-dialog__link {
  color: #c2410c;
  font-weight: 600;
  text-decoration: none;
}

.worksheet-version-dialog__link:hover,
.worksheet-version-dialog__link:focus-visible {
  color: #9a3412;
  text-decoration: none;
}

.worksheet-grid__view-toggles {
  justify-self: unset;
}

.worksheet-tag-palette {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0.375rem;
  border-radius: 0.5rem;
  border: 1px dashed transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  flex: 1 1 12rem;
  max-width: 100%;
  min-width: 0;
  margin-left: auto;
}

.worksheet-tag-palette--drop-target {
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 8%, #fff);
}

.worksheet-tag-palette__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.375rem;
  align-items: center;
}

.worksheet-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  border: 0;
  border-radius: 0;
  font-weight: 700;
  line-height: 1;
  cursor: default;
  white-space: nowrap;
  /* Sharp left/right points */
  clip-path: polygon(
    0 50%,
    0.5rem 0,
    calc(100% - 0.5rem) 0,
    100% 50%,
    calc(100% - 0.5rem) 100%,
    0.5rem 100%
  );
  padding: 0.28rem 0.85rem;
}

.worksheet-tag__initials,
.worksheet-tag__label {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

.worksheet-tag--palette {
  font-size: 0.6875rem;
  cursor: grab;
  user-select: none;
}

.worksheet-tag--palette:active,
.worksheet-tag--dragging {
  cursor: grabbing;
  opacity: 0.75;
}

.worksheet-tag--applied {
  padding: 0.18rem 0.55rem 0.18rem 0.65rem;
  font-size: 0.625rem;
  letter-spacing: 0.03em;
  cursor: grab;
}

.worksheet-tag--logjam {
  background: #7f1d1d;
  color: #fff;
}

.worksheet-tag--adverse {
  background: #fecaca;
  color: #111827;
}

.worksheet-tag--wealth {
  background: #14532d;
  color: #fff;
}

.worksheet-tag--inescapable {
  background: #9a3412;
  color: #fff;
}

.worksheet-tag--weak {
  background: #bbf7d0;
  color: #111827;
}

.worksheet-grid__grand-total-toggle[data-included-in-grand-total="true"],
.worksheet-grid__actions-cell .worksheet-grid__grand-total-toggle.icon-action-btn--success {
  color: #16a34a;
}

.worksheet-grid__grand-total-toggle[data-included-in-grand-total="true"]:hover,
.worksheet-grid__actions-cell .worksheet-grid__grand-total-toggle.icon-action-btn--success:hover {
  color: #15803d;
}

.worksheet-grid__grand-total-toggle[data-included-in-grand-total="false"],
.worksheet-grid__actions-cell .worksheet-grid__grand-total-toggle.icon-action-btn--neutral {
  color: #94a3b8;
}

.worksheet-grid__grand-total-toggle[data-included-in-grand-total="false"]:hover,
.worksheet-grid__actions-cell .worksheet-grid__grand-total-toggle.icon-action-btn--neutral:hover {
  color: #64748b;
}

.worksheet-grid__row--group .worksheet-grid__reason-select,
.worksheet-grid__row--group .worksheet-grid__reason-display {
  font-weight: 700;
}

.worksheet-grid__reason-select--detail,
.worksheet-grid__reason-display--detail {
  padding-left: 1rem;
}

.worksheet-grid__reason-input--detail,
.worksheet-grid__reason-display--detail {
  padding-left: 1rem;
}

.worksheet-grid__month-cell--group,
.worksheet-grid__group-total,
.worksheet-grid__group-amount {
  font-weight: 600;
}

.worksheet-grid__grand-total-flag {
  user-select: none;
}

.worksheet-grid__grand-total-row td {
  vertical-align: middle;
}

.worksheet-grid__month-header-label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.0625rem;
  line-height: 1.1;
}

.worksheet-grid__month-name {
  font-size: inherit;
  font-weight: inherit;
}

.worksheet-grid__month-year {
  font-size: 0.6875rem;
  font-weight: 400;
  color: color-mix(in srgb, var(--color-table-header-text) 72%, var(--color-table-header));
  letter-spacing: 0.01em;
}

.worksheet-grid__month-header--draggable {
  cursor: grab;
  user-select: none;
}

.worksheet-grid__month-header--dragging {
  cursor: grabbing;
  opacity: 0.65;
}

.worksheet-grid__month-header--drop-target {
  background: color-mix(in srgb, var(--color-gold, #d4a017) 22%, #fff);
}

.worksheet-grid__actions-cell .icon-action-btn {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0.125rem;
  margin: 0;
}


/* Worksheet analysis charts */
.worksheet-analysis__header {
  margin-bottom: 1rem;
}

.worksheet-analysis__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
}

.worksheet-analysis__lead {
  margin: 0.35rem 0 0;
  max-width: 52rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
}

.worksheet-analysis-chart {
  width: 100%;
  min-width: 0;
}

.worksheet-analysis-chart__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(18rem, 1.05fr) minmax(20rem, 1.2fr);
  gap: 1.25rem;
  align-items: start;
}

.worksheet-analysis-chart__rings-panel,
.worksheet-analysis-chart__bars-panel {
  position: relative;
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}

.worksheet-analysis-chart__tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 0.15rem;
  min-width: 8rem;
  max-width: 16rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.75rem;
  line-height: 1.3;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.25);
  pointer-events: none;
}

.worksheet-analysis-chart__tooltip strong {
  font-weight: 600;
}

.worksheet-analysis-chart__tooltip span {
  font-variant-numeric: tabular-nums;
  color: #cbd5e1;
}

.worksheet-analysis-chart__segment:hover {
  filter: brightness(1.08);
}

.worksheet-analysis-chart__panel-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.worksheet-analysis-chart__panel-hint {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
}

.worksheet-analysis-chart__rings {
  width: 100%;
  min-height: 18rem;
}

.worksheet-analysis-chart__bars {
  width: 100%;
  min-height: 20rem;
}

.worksheet-analysis-chart__legend {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.worksheet-analysis-chart__legend-title {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
}

.worksheet-analysis-chart__legend-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.worksheet-analysis-chart__legend-item {
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8125rem;
  color: #334155;
}

.worksheet-analysis-chart__swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
}

.worksheet-analysis-chart__legend-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worksheet-analysis-chart__legend-value {
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

.worksheet-analysis-chart__legend-empty,
.worksheet-analysis-chart__empty {
  margin: 0;
  font-size: 0.875rem;
  color: #94a3b8;
}

.worksheet-analysis-chart__center-label {
  font-size: 0.7rem;
  fill: #64748b;
}

.worksheet-analysis-chart__center-value {
  font-size: 0.8rem;
  font-weight: 600;
  fill: #0f172a;
}

.worksheet-analysis-chart__axis text {
  font-size: 0.7rem;
  fill: #64748b;
}

.worksheet-analysis-chart__axis path,
.worksheet-analysis-chart__axis line {
  stroke: #cbd5e1;
}

.worksheet-analysis-chart__grid line {
  stroke: #e2e8f0;
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.worksheet-analysis-chart__zero {
  stroke: #94a3b8;
  stroke-width: 1.25;
}

.worksheet-analysis-chart__flow-line {
  pointer-events: none;
}

.worksheet-analysis-chart__axis--y-flow text {
  fill: #0f172a;
}

@media (max-width: 64rem) {
  .worksheet-analysis-chart__inner {
    grid-template-columns: 1fr;
  }
}

.work-timeline__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-filter-border);
  border-radius: 0.75rem;
  background: var(--color-filter-bg);
  padding: 0.625rem 0.75rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.work-timeline__toolbar-end {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.work-timeline__range {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-chocolate);
}

.work-timeline__range-form {
  margin: 0;
}

.work-timeline__range-select {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--color-chocolate);
}

.work-timeline__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.work-view-maximize,
.hfp-json-transfer__btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: #fff;
  color: var(--color-chocolate);
  cursor: pointer;
}

.work-view-maximize:hover,
.hfp-json-transfer__btn:hover {
  background: var(--color-hover-bg);
  border-color: color-mix(in srgb, var(--color-tawny) 45%, var(--color-cream));
}

.work-view-maximize:focus-visible,
.hfp-json-transfer__btn:focus-visible {
  outline: 2px solid var(--color-tawny);
  outline-offset: 2px;
}

.work-view-maximize__icon {
  display: block;
}

.work-view-maximize__icon[hidden] {
  display: none;
}

.hfp-json-transfer {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
}

.hfp-json-transfer__form {
  display: inline-flex;
  margin: 0;
}

.hfp-json-transfer__icon {
  display: block;
  width: 16px;
  height: 16px;
}

.work-view--maximized {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--color-cream);
  border-radius: 0;
  overflow: hidden;
}

.work-view-body--locked {
  overflow: hidden;
}

.work-view--maximized.work-timeline .work-timeline__toolbar,
.work-view--maximized.task-kanban .task-kanban__toolbar,
.work-view--maximized.work-calendar .crm-calendar__chrome,
.work-view--maximized.worksheet-workspace .worksheet-grid__toolbar {
  flex-shrink: 0;
}

.work-view--maximized.worksheet-workspace {
  overflow: auto;
}

.work-view--maximized.worksheet-workspace .worksheet-grid__toolbar {
  margin-bottom: 0.75rem;
}

.work-view--maximized.gpa-workspace {
  overflow: auto;
}

.work-view--maximized.budget-workspace {
  overflow: hidden;
}

.work-view--maximized.budget-workspace > :not(.budget-grid-section):not(.budget-opening-questions-wrap) {
  flex-shrink: 0;
}

.work-view--maximized.budget-workspace .budget-opening-questions-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.work-view--maximized.budget-workspace .budget-opening-questions-wrap:has(.budget-opening-questions[open]) {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 50%;
}

.work-view--maximized.budget-workspace .budget-opening-questions {
  margin-top: 0.5rem;
  flex-shrink: 0;
}

.work-view--maximized.budget-workspace .budget-opening-questions[open] {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-view--maximized.budget-workspace .budget-opening-questions > summary {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

.work-view--maximized.budget-workspace .budget-grid-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.work-view--maximized.budget-workspace .budget-grid-section__header {
  flex-shrink: 0;
}

.work-view--maximized.budget-workspace .budget-grid-shell {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

/* Example / hint copy at half the previous slate weight so it does not look like entered data. */
.gpa-row-field::placeholder {
  color: rgb(148 163 184 / 0.5);
  opacity: 1;
}

.gpa-kind-hint {
  color: rgb(71 85 105 / 0.5);
}

.gpa-display-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #f8fafc;
}

.gpa-display-mode__option {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  text-decoration: none;
}

.gpa-display-mode__option:hover {
  color: #0f172a;
  background: #fff;
}

.gpa-display-mode__option--selected {
  color: #0f172a;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.gpa-amount--selected {
  color: #0f172a;
}

.gpa-amount--selected.gpa-amount--negative {
  color: #b91c1c;
}

.gpa-amount--unselected {
  color: color-mix(in srgb, #0f172a 25%, white);
}

.gpa-amount--unselected.gpa-amount--negative {
  color: color-mix(in srgb, #b91c1c 25%, white);
}

.work-view--maximized.work-timeline .work-timeline__toolbar {
  margin-bottom: 0.75rem;
}

.work-view--maximized.work-timeline .work-timeline__viewport {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

.work-view--maximized.task-kanban .task-kanban__columns {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  align-items: stretch;
}

.work-view--maximized.task-kanban .task-kanban__column {
  min-height: 0;
  height: auto;
}

.work-view--maximized.task-kanban .task-kanban__column-cards {
  overflow-y: auto;
  min-height: 0;
}

.work-view--maximized.work-calendar > turbo-frame {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.work-view--maximized.work-calendar > turbo-frame > .rounded-xl {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0.75rem;
}

.work-view--maximized.work-calendar .crm-calendar-time {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.work-view--maximized.work-calendar .crm-calendar-time__scroll {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}

.work-view--maximized.work-calendar .crm-calendar-month {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.work-view--maximized.work-calendar .crm-calendar-month__grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: 2.25rem;
  grid-auto-rows: minmax(7rem, 1fr);
}

.work-view--maximized.work-calendar .crm-calendar-month__day {
  min-height: 7rem;
}

.work-view--maximized.work-calendar .crm-calendar-year {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* Work Calendar surfaces — fill the viewport below the sticky navbar. */
.work-calendar-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  /* Was 11rem and clipped the month grid; use navbar height so the calendar grows. */
  --work-calendar-chrome: var(--navbar-height, 5.5rem);
  min-height: calc(100dvh - var(--work-calendar-chrome));
  height: calc(100dvh - var(--work-calendar-chrome));
  max-height: calc(100dvh - var(--work-calendar-chrome));
  overflow: hidden;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.work-calendar-page > .work-board-toolbar {
  flex-shrink: 0;
  margin-bottom: 0.75rem;
}

.work-calendar--page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.work-calendar--page > turbo-frame {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.work-calendar--page > turbo-frame > .rounded-xl {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.work-calendar--page .crm-calendar__chrome {
  flex-shrink: 0;
}

.work-calendar--page .crm-calendar-month-jump {
  flex-shrink: 0;
}

.work-calendar--page .crm-calendar-time {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0.75rem;
}

.work-calendar--page .crm-calendar-time__scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.work-calendar--page .crm-calendar-month {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  margin-top: 0.5rem;
}

.work-calendar--page .crm-calendar-month__grid {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  grid-template-rows: 2.25rem;
  grid-auto-rows: minmax(9.5rem, 1fr);
}

.work-calendar--page .crm-calendar-month__day {
  min-height: 9.5rem;
}

.work-calendar--page .crm-calendar-year {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 0.5rem;
}

.work-timeline__viewport {
  position: relative;
  min-height: 28rem;
  height: min(70vh, 44rem);
  overflow: hidden;
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--color-cream) 70%, #fff);
}

.work-timeline__items {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.work-timeline__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.work-timeline__parking-fill {
  fill: color-mix(in srgb, var(--color-gold) 14%, #fff);
}

.work-timeline__today-line {
  stroke: var(--color-tawny);
  stroke-width: 1.5;
}

.work-timeline__week-line {
  stroke: color-mix(in srgb, var(--color-tawny) 32%, var(--color-cream));
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.work-timeline__grid {
  stroke: color-mix(in srgb, var(--color-tawny) 16%, #fff);
  stroke-dasharray: 3 5;
}

.work-timeline__axis-title,
.work-timeline__y-label,
.work-timeline__x-label {
  fill: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
}

.work-timeline__spline {
  fill: none;
  stroke: color-mix(in srgb, var(--color-chocolate) 55%, var(--color-tawny));
  stroke-width: 2;
  cursor: pointer;
}

.work-timeline__spline:hover {
  stroke: var(--color-tawny);
  stroke-width: 2.75;
}

.work-timeline__spline--stub {
  stroke-dasharray: 5 4;
  stroke-opacity: 0.85;
}

.work-timeline__spline--preview {
  stroke-dasharray: 6 5;
  pointer-events: none;
}

.work-timeline__tooltip {
  position: absolute;
  z-index: 5;
  max-width: 18rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--color-chocolate) 18%, #fff);
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.12);
  color: var(--color-chocolate);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  white-space: normal;
}

.work-timeline__tooltip--chip {
  max-width: 22rem;
  padding: 0.55rem 0.65rem;
  font-weight: 500;
}

.work-timeline__tooltip-title {
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-chocolate);
}

.work-timeline__tooltip-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
  color: var(--color-text-muted);
  font-size: 0.625rem;
  font-weight: 600;
}

.work-timeline__tooltip-meta strong {
  color: var(--color-chocolate);
  font-weight: 700;
}

.work-timeline__tooltip-preview {
  margin-top: 0.45rem;
  max-height: 10.5rem;
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--color-chocolate) 12%, #fff);
  padding-top: 0.4rem;
  color: var(--color-chocolate);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.35;
}

.work-timeline__tooltip-preview--empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.work-timeline__tooltip-preview.markdown-render > * + * {
  margin-top: 0.25rem;
}

.work-timeline__tooltip-preview.markdown-render p,
.work-timeline__tooltip-preview.markdown-render ul,
.work-timeline__tooltip-preview.markdown-render ol {
  margin: 0;
}

.work-timeline__tooltip[hidden] {
  display: none;
}

.work-timeline__drag-preview {
  position: absolute;
  z-index: 6;
  min-width: 7.5rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--color-tawny) 40%, #fff);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-cream) 55%, #fff);
  box-shadow: 0 4px 14px rgb(15 23 42 / 0.14);
  color: var(--color-chocolate);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
}

.work-timeline__drag-preview[hidden] {
  display: none;
}

.work-timeline__drag-preview-urgency,
.work-timeline__drag-preview-due {
  display: block;
}

.work-timeline__drag-preview-due {
  color: var(--color-text-muted);
  font-weight: 600;
}

.work-timeline__card {
  position: absolute;
  display: flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--color-tawny) 35%, #fff);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-gold) 28%, #fff);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
  user-select: none;
  cursor: grab;
  z-index: 1;
  pointer-events: auto;
}

/* Waterfall stacks: slightly deeper shadow so mounted chips read as layered cards. */
.work-timeline__card--stacked {
  box-shadow:
    0 1px 2px rgb(15 23 42 / 0.1),
    0 3px 6px rgb(15 23 42 / 0.08);
}

.work-timeline__card--note {
  background: color-mix(in srgb, var(--color-cream) 35%, #fff);
  border-color: color-mix(in srgb, var(--color-chocolate) 22%, #fff);
}

.work-timeline__card.is-dragging {
  cursor: grabbing;
  opacity: 0.85;
  z-index: 100;
}

.work-timeline__card.is-readonly {
  cursor: default;
  opacity: 0.78;
}

.work-timeline__card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 0.375rem;
  overflow: hidden;
  color: var(--color-chocolate);
}

.work-timeline__subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
}

.work-timeline__initials {
  flex-shrink: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-chocolate) 10%, #fff);
  padding: 0.1rem 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.work-timeline__node {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 0.7rem;
  height: 0.7rem;
  padding: 0;
  border: 1px solid var(--color-tawny);
  border-radius: 999px;
  background: #fff;
  cursor: crosshair;
}

.work-timeline__node--left {
  left: 0;
  transform: translate(-50%, -50%);
}

.work-timeline__node--right {
  right: 0;
  transform: translate(50%, -50%);
}

.work-timeline__node:hover {
  background: var(--color-gold);
}


/* AI settings area headings (System AI / My AI) */
.ai-settings-area__title {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.7rem;
  border-radius: 0.4rem;
  background: #0f172a;
  color: #f8fafc;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  line-height: 1.4;
}

/* Sliding on/off switch (settings toggles) */
.ui-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

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

.ui-switch__track {
  position: relative;
  display: block;
  width: 2.5rem;
  height: 1.375rem;
  flex-shrink: 0;
  border-radius: 9999px;
  background: #dc2626;
  transition: background-color 150ms ease;
}

.ui-switch__thumb {
  position: absolute;
  top: 0.125rem;
  left: 0.125rem;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.2);
  transition: transform 150ms ease;
}

.ui-switch__input:checked + .ui-switch__track {
  background: #16a34a;
}

.ui-switch__input:checked + .ui-switch__track .ui-switch__thumb {
  transform: translateX(1.125rem);
}

.ui-switch__input:focus-visible + .ui-switch__track {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}

.ui-switch__input:disabled + .ui-switch__track {
  opacity: 0.5;
}

.ui-switch__label {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #1e293b;
}

/* Twice the normal switch (e.g. the MCP emergency switch). */
.ui-switch--large .ui-switch__track {
  width: 5rem;
  height: 2.75rem;
}

.ui-switch--large .ui-switch__thumb {
  top: 0.25rem;
  left: 0.25rem;
  width: 2.25rem;
  height: 2.25rem;
}

.ui-switch--large .ui-switch__input:checked + .ui-switch__track .ui-switch__thumb {
  transform: translateX(2.25rem);
}

/* Urgency slider: High (10) left → Low (1) right */
.urgency-slider {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.urgency-slider__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.urgency-slider__track-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.urgency-slider__end-label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  user-select: none;
  transition: font-weight 0.12s ease, color 0.12s ease;
}

.urgency-slider__end-label.is-active {
  font-weight: 700;
  color: var(--color-chocolate);
}

.urgency-slider__track-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.urgency-slider__input {
  /* Flip so max (High / 10) sits on the left, min (Low / 1) on the right */
  direction: rtl;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 1.5rem;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  accent-color: var(--color-tawny);
  -webkit-appearance: none;
  appearance: none;
}

.urgency-slider__input:focus {
  outline: none;
}

.urgency-slider__input:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-tawny) 55%, #fff);
  outline-offset: 3px;
  border-radius: 999px;
}

.urgency-slider__input::-webkit-slider-runnable-track {
  height: 0.375rem;
  border-radius: 999px;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--color-tawny) 18%, var(--color-cream)),
    color-mix(in srgb, var(--color-gold) 55%, #fff),
    color-mix(in srgb, var(--color-tawny) 72%, var(--color-chocolate))
  );
  border: 1px solid color-mix(in srgb, var(--color-tawny) 28%, #fff);
}

.urgency-slider__input::-moz-range-track {
  height: 0.375rem;
  border-radius: 999px;
  background: linear-gradient(
    to left,
    color-mix(in srgb, var(--color-tawny) 18%, var(--color-cream)),
    color-mix(in srgb, var(--color-gold) 55%, #fff),
    color-mix(in srgb, var(--color-tawny) 72%, var(--color-chocolate))
  );
  border: 1px solid color-mix(in srgb, var(--color-tawny) 28%, #fff);
}

/* Invisible native thumb — hit target only; number is drawn in .urgency-slider__thumb */
.urgency-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: -0.55rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.urgency-slider__input::-moz-range-thumb {
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.urgency-slider__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--color-tawny);
  box-shadow: 0 1px 3px rgb(17 14 16 / 0.28);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  user-select: none;
}

.urgency-slider__track-wrap:hover .urgency-slider__thumb {
  background: var(--color-chocolate);
}

.date-display-picker {
  position: relative;
  display: block;
}

.date-display-picker__text {
  padding-right: 2.5rem;
}

.date-display-picker__calendar {
  position: absolute;
  top: 50%;
  right: 0.7rem;
  z-index: 1;
  display: flex;
  color: rgb(71 85 105);
  pointer-events: auto;
  cursor: pointer;
  transform: translateY(-50%);
}

.date-display-picker__icon {
  width: 1.15rem;
  height: 1.15rem;
}

.date-display-picker__native {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 2.75rem;
  margin: 0;
  padding: 0;
  color: transparent;
  background: transparent;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.date-display-picker__native::-moz-datetime-edit {
  color: transparent;
  opacity: 0;
}

.date-display-picker__native::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-display-picker__native::-moz-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.date-display-picker--disabled .date-display-picker__calendar {
  opacity: 0.45;
}

.date-display-picker--disabled .date-display-picker__native {
  cursor: not-allowed;
}

.budget-grid-section__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.budget-grid-shell {
  overflow: auto;
  max-height: min(70vh, 52rem);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.budget-grid {
  width: 100%;
  min-width: 40rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.budget-grid__corner,
.budget-grid__col-head,
.budget-grid__month,
.budget-grid__entry,
.budget-grid__amount {
  border-bottom: 1px solid rgb(226 232 240);
  border-right: 1px solid rgb(226 232 240);
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.budget-grid thead .budget-grid__corner,
.budget-grid thead .budget-grid__col-head {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid rgb(203 213 225);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(71 85 105);
}

.budget-grid thead .budget-grid__corner {
  left: 0;
  z-index: 6;
}

.budget-grid thead .budget-grid__entry-head {
  left: 7.5rem;
  z-index: 6;
}

.budget-grid__month {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 2;
  width: 7.5rem;
  min-width: 7.5rem;
  font-weight: 600;
  color: rgb(15 23 42);
  vertical-align: top;
}

.budget-grid__entry {
  position: -webkit-sticky;
  position: sticky;
  left: 7.5rem;
  z-index: 2;
  width: 13rem;
  min-width: 13rem;
  font-weight: 500;
  color: rgb(71 85 105);
  white-space: nowrap;
}

.budget-grid__col-head {
  min-width: 8.5rem;
  text-align: right;
}

.budget-grid__amount {
  text-align: right;
  white-space: nowrap;
  color: rgb(15 23 42);
}

.budget-grid__amount.worksheet-grid__amount--negative {
  color: #b91c1c;
}

/* Actual from the register (HFP classifications): provisional = month not yet reconciled;
   conflict = reconciled register figure differs from a typed actual (see hint). */
.budget-grid__amount--provisional {
  font-style: italic;
  color: #64748b;
}

.budget-grid__amount--conflict {
  box-shadow: inset 0 0 0 2px #f59e0b;
  background-color: #fffbeb;
}

.budget-grid__amount .budget-origin-link {
  color: inherit;
  font-weight: inherit;
}

.budget-grid__amount .budget-origin-link:hover {
  color: inherit;
  text-decoration: underline;
}

.budget-grid__amount:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgb(148 163 184 / 0.7);
}

.budget-grid__amount .budget-origin-link:focus-visible {
  outline: none;
  border-radius: 0.25rem;
  box-shadow: 0 0 0 2px rgb(148 163 184 / 0.45);
}

.budget-grid tfoot th,
.budget-grid tfoot td {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 4;
  border-top: 1px solid rgb(203 213 225);
  border-bottom: 0;
  font-weight: 600;
}

.budget-grid tfoot .budget-grid__month,
.budget-grid tfoot .budget-grid__entry {
  z-index: 5;
}

.budget-grid__row--month-start th,
.budget-grid__row--month-start td {
  border-top: 1px solid rgb(203 213 225);
}

.budget-grid tbody tr:nth-child(8n + 1) th,
.budget-grid tbody tr:nth-child(8n + 1) td,
.budget-grid tbody tr:nth-child(8n + 2) th,
.budget-grid tbody tr:nth-child(8n + 2) td,
.budget-grid tbody tr:nth-child(8n + 3) th,
.budget-grid tbody tr:nth-child(8n + 3) td,
.budget-grid tbody tr:nth-child(8n + 4) th,
.budget-grid tbody tr:nth-child(8n + 4) td {
  background: rgb(248 250 252);
}

.budget-grid thead .budget-grid__col-head--income {
  background: #ecfdf5;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--income .budget-origin-link {
  color: inherit;
}

.budget-grid thead .budget-grid__col-head--income .budget-origin-link:hover {
  color: inherit;
  text-decoration: underline;
}

.budget-grid thead .budget-grid__col-head--income .budget-grid__col-origins {
  color: rgb(22 101 52);
}

.budget-grid thead .budget-grid__col-head--income-total {
  background: #a7f3d0;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--income-total .budget-origin-link {
  color: inherit;
}

.budget-grid thead .budget-grid__col-head--income-total .budget-grid__col-origins {
  color: rgb(6 95 70);
}

.budget-grid thead .budget-grid__col-head--allocation {
  background: #e0f2fe;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--allocation .budget-grid__col-origins {
  color: rgb(3 105 161);
}

.budget-grid thead .budget-grid__col-head--allocation-total {
  background: #7dd3fc;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--allocation-total .budget-grid__col-origins {
  color: rgb(7 89 133);
}

.budget-grid thead .budget-grid__col-head--tagged-expense {
  background: #fce7f3;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--tagged-expense .budget-origin-link {
  color: inherit;
}

.budget-grid thead .budget-grid__col-head--tagged-expense .budget-origin-link:hover {
  color: inherit;
  text-decoration: underline;
}

.budget-grid thead .budget-grid__col-head--tagged-expense .budget-grid__col-origins {
  color: rgb(157 23 77);
}

.budget-grid thead .budget-grid__col-head--maintenance {
  background: #ede9fe;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--maintenance .budget-origin-link {
  color: inherit;
}

.budget-grid thead .budget-grid__col-head--maintenance .budget-origin-link:hover {
  color: inherit;
  text-decoration: underline;
}

.budget-grid thead .budget-grid__col-head--maintenance .budget-grid__col-origins {
  color: rgb(91 33 182);
}

.budget-grid thead .budget-grid__col-head--expense-total {
  background: #c4b5fd;
  color: rgb(15 23 42);
}

.budget-grid thead .budget-grid__col-head--expense-total .budget-grid__col-origins {
  color: rgb(76 29 149);
}

.budget-grid__sticky-end {
  position: -webkit-sticky;
  position: sticky;
  z-index: 2;
  background: #fff;
}

.budget-grid__sticky-end--cash-flow {
  right: 0;
  min-width: 8.5rem;
  width: 8.5rem;
}

.budget-grid__sticky-end--outcome {
  right: 8.5rem;
  min-width: 8.5rem;
  width: 8.5rem;
  box-shadow: -6px 0 10px -6px rgb(15 23 42 / 0.18);
}

.budget-grid thead .budget-grid__sticky-end {
  z-index: 5;
  background: #c4b5fd;
}

.budget-grid tbody tr:nth-child(8n + 1) .budget-grid__sticky-end,
.budget-grid tbody tr:nth-child(8n + 2) .budget-grid__sticky-end,
.budget-grid tbody tr:nth-child(8n + 3) .budget-grid__sticky-end,
.budget-grid tbody tr:nth-child(8n + 4) .budget-grid__sticky-end {
  background: rgb(248 250 252);
}

.budget-grid tfoot .budget-grid__sticky-end {
  z-index: 5;
  background: #fff;
}

.budget-grid:not(.budget-grid--expand-inescapable) [data-column-detail="inescapable"],
.budget-grid:not(.budget-grid--expand-maintenance) [data-column-detail="maintenance"] {
  display: none;
}

.budget-grid.budget-grid--expand-maintenance [data-column-summary="maintenance"] {
  display: none;
}

.budget-grid__expand {
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid rgb(190 24 93 / 0.35);
  border-radius: 0.25rem;
  background: rgb(255 255 255 / 0.65);
  color: rgb(157 23 77);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.budget-grid__expand:hover {
  background: #fff;
  text-decoration: underline;
}

.budget-grid__col-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.8125rem;
  letter-spacing: 0;
  text-transform: none;
}

.budget-grid tbody td.budget-grid__col--mismatch,
.budget-grid tfoot td.budget-grid__col--mismatch {
  background: rgb(255 237 213);
}

.budget-grid__plan-input {
  display: block;
  width: 100%;
  min-width: 5.5rem;
  margin: 0;
  padding: 0.15rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: transparent;
  text-align: right;
  font-size: inherit;
}

.budget-grid__plan-input:hover,
.budget-grid__plan-input:focus {
  border-color: rgb(203 213 225);
  background: #fff;
  outline: none;
}

.budget-grid__plan-input:focus {
  border-color: rgb(148 163 184);
  box-shadow: 0 0 0 2px rgb(148 163 184 / 0.25);
}

.budget-grid__spread {
  padding: 0;
  border: 0;
  background: none;
  color: #c2410c;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.budget-grid__spread:hover {
  color: #7c2d12;
  text-decoration: underline;
}

.budget-grid__total-of {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgb(100 116 139);
}

.budget-origin-link {
  color: #c2410c;
  font-weight: 500;
}

.budget-origin-link:hover {
  color: #7c2d12;
  text-decoration: underline;
}

.budget-grid__col-origins {
  margin-top: 0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: rgb(100 116 139);
}

.worksheet-grid__month-header--focus {
  box-shadow: inset 0 -3px 0 #c2410c;
}

.scene-catalogue-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* About StockMan — compact credit / attribution page */
.about-page {
  width: 100%;
  max-width: none;
}

.about-page__card {
  padding: 1.5rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 1px 3px rgb(17 14 16 / 0.06);
}

@media (min-width: 640px) {
  .about-page__card {
    padding: 2rem 2.25rem;
  }
}

.about-page__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 640px) {
  .about-page__intro {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 2rem;
  }
}

.about-page__portrait {
  margin: 0;
  flex-shrink: 0;
}

.about-page__portrait img {
  display: block;
  width: 9.5rem;
  height: 9.5rem;
  margin-inline: auto;
  border-radius: 9999px;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 4px 14px rgb(17 14 16 / 0.12);
  outline: 3px solid color-mix(in srgb, var(--color-gold) 55%, #fff);
  outline-offset: 3px;
}

@media (min-width: 640px) {
  .about-page__portrait img {
    width: 10.5rem;
    height: 10.5rem;
    margin-inline: 0;
  }
}

.about-page__credit {
  margin: 0.65rem 0 0;
  max-width: 11rem;
  margin-inline: auto;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .about-page__credit {
    margin-inline: 0;
    text-align: left;
  }
}

.about-page__credit a {
  color: var(--color-chocolate);
  font-weight: 600;
  text-decoration: none;
}

.about-page__credit a:hover {
  color: var(--color-tawny);
  text-decoration: underline;
}

.about-page__copy {
  min-width: 0;
  flex: 1;
}

.about-page__eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-tawny);
}

.about-page__title {
  margin: 0.35rem 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-chocolate);
  line-height: 1.2;
}

.about-page__lede {
  margin: 0.85rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: color-mix(in srgb, var(--color-chocolate) 88%, var(--color-tawny));
}

.about-page__lede + .about-page__lede {
  margin-top: 0.65rem;
}

.about-page__cta {
  display: inline-flex;
  margin-top: 1.1rem;
  padding: 0.45rem 0.95rem;
  border-radius: 9999px;
  background: var(--color-tawny);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}

.about-page__cta:hover {
  background: var(--color-chocolate);
  color: #fff;
}

.about-page__section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border-subtle);
}

.about-page__section-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-chocolate);
}

.about-page__section-note {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

.about-page__connect {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .about-page__connect {
    justify-content: flex-start;
  }
}

.about-page__connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-cream) 70%, #fff);
  color: var(--color-chocolate);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.about-page__connect-link:hover {
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-gold) 35%, #fff);
  color: var(--color-chocolate);
}

.about-page__connect-link:focus-visible {
  outline: 2px solid var(--color-tawny);
  outline-offset: 2px;
}

.about-page__connect-link--logo {
  padding: 0.3rem 0.7rem;
}

.about-page__connect-link img {
  display: block;
  height: 1.5rem;
  width: auto;
  max-width: 8.5rem;
  object-fit: contain;
}

.about-page__tool-groups {
  display: grid;
  gap: 1.15rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .about-page__tool-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 1.5rem;
  }
}

@media (min-width: 64rem) {
  .about-page__tool-groups {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.about-page__tool-group-label {
  margin: 0 0 0.45rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.about-page__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-page__chip {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--color-cream) 55%, #fff);
  border: 1px solid transparent;
  color: var(--color-chocolate);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.about-page__chip:hover {
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-gold) 40%, #fff);
  color: var(--color-chocolate);
}

.about-page__chip--quiet {
  background: transparent;
  border-color: var(--color-border-subtle);
  color: color-mix(in srgb, var(--color-chocolate) 82%, var(--color-tawny));
  font-weight: 500;
}

.about-page__chip--quiet:hover {
  background: color-mix(in srgb, var(--color-cream) 60%, #fff);
}

.about-page__chips--spaced {
  margin-top: 0.85rem;
}

.legal-page__header {
  margin-bottom: 0.25rem;
}

.legal-page__updated {
  margin: 0.4rem 0 0;
  color: color-mix(in srgb, var(--color-chocolate) 55%, var(--color-tawny));
  font-size: 0.85rem;
}

.legal-page__body {
  color: var(--color-chocolate);
  font-size: 0.95rem;
  line-height: 1.65;
}

.legal-page__body p {
  margin: 0;
}

.legal-page__body p + p,
.legal-page__body p + ul,
.legal-page__body ul + p {
  margin-top: 0.75rem;
}

.legal-page__body ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.legal-page__body li + li {
  margin-top: 0.4rem;
}

.legal-page__body a {
  color: color-mix(in srgb, var(--color-chocolate) 72%, var(--color-tawny));
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.login-legal {
  margin: 1rem 0 0;
  text-align: center;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.5;
}

.login-legal a {
  color: #334155;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* Contact attribute visibility: released reads as light green, private as light red. */
select.attribute-visibility-select.attribute-visibility-select--released {
  background-color: #dcfce7;
}

select.attribute-visibility-select.attribute-visibility-select--private {
  background-color: #fee2e2;
}

select.attribute-visibility-select option[value="released"] {
  background-color: #dcfce7;
}

select.attribute-visibility-select option[value="private"] {
  background-color: #fee2e2;
}

/* CRM contact timeline: notes/messages, events and register entries on one time axis. */
.crm-contact-timeline {
  grid-column: 1 / -1;
  border-top: 1px solid #e2e8f0;
  padding: 0.6rem 1rem 0.75rem;
  background: #f8fafc;
}

.crm-contact-timeline__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.crm-contact-timeline__title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-contact-timeline__span,
.crm-contact-timeline__empty {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.crm-contact-timeline__body {
  margin-top: 0.4rem;
}

.crm-contact-timeline__lane,
.crm-contact-timeline__axis {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.crm-contact-timeline__lane-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #64748b;
  white-space: nowrap;
}

.crm-contact-timeline__track {
  position: relative;
  height: 1.25rem;
  border-bottom: 1px dashed #e2e8f0;
}

.crm-contact-timeline__track--axis {
  height: 1rem;
  border-bottom: none;
}

.crm-contact-timeline__gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #e2e8f0;
}

.crm-contact-timeline__today {
  position: absolute;
  top: -0.1rem;
  bottom: -0.1rem;
  width: 2px;
  background: #f59e0b;
}

.crm-contact-timeline__tick {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.625rem;
  color: #94a3b8;
  white-space: nowrap;
}

.crm-contact-timeline__marker {
  position: absolute;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  margin-left: -0.35rem;
  margin-top: -0.35rem;
  border: 2px solid #fff;
  border-radius: 9999px;
  box-shadow: 0 0 0 1px rgb(15 23 42 / 0.15);
  transition: transform 120ms ease;
}

.crm-contact-timeline__marker:hover,
.crm-contact-timeline__marker:focus-visible {
  transform: scale(1.4);
  z-index: 1;
}

.crm-contact-timeline__marker--message {
  background: #0f766e;
}

.crm-contact-timeline__marker--event {
  background: #7c3aed;
}

.crm-contact-timeline__marker--register {
  background: #2563eb;
}

/* Timeline inside the Search in notes box (upper left of the CRM). */
.crm-contact-timeline--compact {
  grid-column: auto;
  margin-top: 0.6rem;
  border-top: 1px solid var(--color-filter-border);
  padding: 0.5rem 0 0;
  background: transparent;
}

.crm-contact-timeline--compact .crm-contact-timeline__lane,
.crm-contact-timeline--compact .crm-contact-timeline__axis {
  grid-template-columns: 8.25rem minmax(0, 1fr);
}

.crm-contact-timeline--compact .crm-contact-timeline__track {
  height: 1.05rem;
}

/* Landing page for signed-in users without a licence or workspace. */
.landing-hero__notice {
  margin: 1rem 0 0;
  max-width: 36rem;
  border-radius: 0.5rem;
  background: rgb(15 23 42 / 0.55);
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #fff;
}

/* Usage page: segmented control for date range and breakdown toggles */
.usage-segmented {
  display: inline-flex;
  align-items: stretch;
  padding: 0.1875rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.625rem;
  background: #f8fafc;
  box-shadow: inset 0 1px 1px rgb(15 23 42 / 0.04);
}

.usage-segmented__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.usage-segmented__btn:hover {
  color: #0f172a;
  background: rgb(255 255 255 / 0.7);
}

.usage-segmented__btn:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 1px;
}

.usage-segmented__btn--active {
  border-color: #cbd5e1;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

.usage-segmented__btn--active:hover {
  background: #fff;
  color: #0f172a;
}

.usage-segmented--compact .usage-segmented__btn {
  min-width: 2.25rem;
  padding: 0.3125rem 0.625rem;
  font-size: 0.75rem;
}

.usage-stat-card {
  display: block;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
  text-decoration: none;
  color: inherit;
}

.usage-stat-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.usage-stat-card--active {
  border-color: #047857;
  box-shadow: 0 0 0 1px #047857;
}

.usage-stat-card:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 2px;
}

.usage-chart {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.usage-chart__bar {
  cursor: default;
}

.usage-chart__canvas--horizontal {
  min-height: 12rem;
  height: auto;
}

.usage-chart__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  max-width: 16rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.35rem;
  background: rgb(15 23 42 / 0.92);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
}

.usage-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
}

.usage-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 500;
}

.usage-chart__legend-swatch {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.15rem;
}

.usage-chart.work-view--maximized {
  background: #fff;
}

.usage-chart.work-view--maximized .usage-chart__canvas {
  flex: 1 1 auto;
  height: auto;
  min-height: 16rem;
}

/* Health page — identical status squares, padded rows, spaced cards. */
.health-page {
  --health-tile: 4.5rem;
  --health-gap: 1rem;
  --health-section-gap: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--health-section-gap);
}

.health-page > section {
  margin: 0;
}

.health-metric-list {
  display: flex;
  flex-direction: column;
  margin: var(--health-gap) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e2e8f0;
}

.health-metric-row {
  display: grid;
  grid-template-columns: var(--health-tile) minmax(0, 1fr) minmax(11rem, 35%);
  align-items: start;
  column-gap: 1rem;
  padding-block: var(--health-gap);
  border-top: 0;
}

.health-metric-list > .health-metric-row + .health-metric-row {
  border-top: 1px solid #e2e8f0;
}

.health-page .health-status-tile {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 var(--health-tile);
  align-items: center;
  justify-content: center;
  justify-self: start;
  align-self: start;
  width: var(--health-tile);
  height: var(--health-tile);
  min-width: var(--health-tile);
  min-height: var(--health-tile);
  max-width: var(--health-tile);
  max-height: var(--health-tile);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0.35rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
  writing-mode: horizontal-tb;
}

.health-status-tile--ok {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.health-status-tile--warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.health-status-tile--critical {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.health-status-tile--missing {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.health-metric-row__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.health-metric-row__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
}

.health-metric-row__meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #64748b;
  word-break: break-all;
}

.health-metric-row__meta--mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.6875rem;
}

.health-metric-row__detail {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #475569;
}

.health-volume-chart {
  width: 100%;
  min-width: 0;
  min-height: var(--health-tile);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 55%);
  --used-pct: 0;
  --warn-pct: 85;
  --chart-fill: #10b981;
  --chart-fill-strong: #059669;
  --chart-number: #047857;
}

.health-volume-chart--alert {
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 55%);
  border-color: #fecaca;
  --chart-fill: #ef4444;
  --chart-fill-strong: #dc2626;
  --chart-number: #b91c1c;
}

.health-volume-chart--muted {
  background: #f8fafc;
  --chart-fill: #cbd5e1;
  --chart-fill-strong: #94a3b8;
  --chart-number: #64748b;
}

.health-volume-chart__numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
}

.health-volume-chart__percent {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--chart-number);
  font-variant-numeric: tabular-nums;
}

.health-volume-chart__bytes {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  font-variant-numeric: tabular-nums;
}

.health-volume-chart__bytes--end,
.health-volume-chart__percent--end {
  margin-left: auto;
  text-align: right;
}

.health-volume-chart__percent--text {
  font-size: 1.2rem;
}

.health-volume-chart__of {
  font-weight: 500;
  color: #64748b;
}

.health-volume-chart__numbers--empty .health-volume-chart__percent {
  color: #94a3b8;
}

.health-volume-chart__track {
  position: relative;
  height: 0.75rem;
  overflow: hidden;
  border-radius: 9999px;
  background: #e2e8f0;
}

.health-volume-chart__track--empty {
  background: #e2e8f0;
}

.health-volume-chart__fill {
  height: 100%;
  width: calc(var(--used-pct) * 1%);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--chart-fill), var(--chart-fill-strong));
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.06);
}

.health-volume-chart__threshold {
  position: absolute;
  top: -0.15rem;
  bottom: -0.15rem;
  left: calc(var(--warn-pct) * 1%);
  width: 2px;
  margin-left: -1px;
  background: #0f172a;
  opacity: 0.55;
  border-radius: 1px;
  pointer-events: none;
}

.health-volume-chart__threshold-label {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #64748b;
}

.health-qfc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 14rem);
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.health-qfc-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.health-qfc-row__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
}

.health-qfc-row__meta {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: #64748b;
}

.health-qfc-row__error {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: #b45309;
}

.health-qfc-row__meter {
  --used-pct: 0;
  display: grid;
  gap: 0.35rem;
}

.health-qfc-row__track {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.health-qfc-row__fill {
  height: 100%;
  width: calc(var(--used-pct) * 1%);
  border-radius: inherit;
  background: #047857;
}

.health-qfc-row__bytes {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #334155;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .health-qfc-row {
    grid-template-columns: 1fr;
  }

  .health-qfc-row__bytes {
    text-align: left;
  }
}

.health-failures {
  margin-top: calc(var(--health-gap) * 2);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #ffffff;
}

.health-failures__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.health-failures__heading {
  min-width: 0;
  flex: 1 1 12rem;
}

.health-failures__copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.health-failures__copy:hover {
  background: #f1f5f9;
}

.health-failures__copy.is-copied {
  border-color: #86efac;
  background: #ecfdf5;
  color: #065f46;
}

.health-failures__copy-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.health-failures__table-wrap {
  overflow-x: auto;
}

@media (max-width: 40rem) {
  .health-metric-row {
    grid-template-columns: var(--health-tile) minmax(0, 1fr);
  }

  .health-metric-row .health-volume-chart {
    grid-column: 1 / -1;
  }
}
