/*
 * 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);
  --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));
}

/* 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);
}

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

/* 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;
}

/* 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;
}

.root-picker-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 40vw;
  min-width: 16rem;
  max-width: 42rem;
  margin: 1.5rem 0 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: 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-family: inherit;
  text-align: left;
  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: color-mix(in srgb, var(--color-gold) 12%, var(--color-black));
  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;
}

.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-list,
  .root-picker-empty {
    width: min(88vw, 42rem);
  }

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

  .root-picker-licence {
    padding: 1.25rem 1.5rem;
  }
}

/* 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);
}

/* 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;
}

/* stockman.css styles all tables for markdown; reset for app data tables */
.data-table thead {
  color: #64748b !important;
  background-color: transparent !important;
}

.data-table-shell .data-table thead th {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  color: #334155 !important;
  font-weight: 700 !important;
  background: #fff !important;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

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

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

.data-table tbody tr > th,
.data-table tbody tr > td {
  background-color: inherit !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. */
.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: #f1f5f9 !important;
  background-color: #1e293b !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: #64748b;
  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: #0f172a !important;
}

.data-table-sort-link.is-active,
.data-table-sort-header.is-sorted-asc,
.data-table-sort-header.is-sorted-desc {
  color: #c2410c !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: 5.5rem;
}

.data-table--enterprises th.actions-col,
.data-table--enterprises td.actions-col {
  width: 5.5rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.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 col.col-select {
  width: 2.5rem;
}

.data-table--register-list col.col-financial,
.data-table--register-list col.col-economic {
  width: 5.25rem;
}

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

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

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

.data-table--register-list col.col-coa {
  width: 11rem;
}

.data-table--register-list col.col-number {
  width: 5rem;
}

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

.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-economic,
.data-table--register-list td.col-economic,
.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-amount,
.data-table--register-list td.col-amount,
.data-table--register-list th.col-coa,
.data-table--register-list td.col-coa,
.data-table--register-list th.col-number,
.data-table--register-list td.col-number,
.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.75rem;
  padding-bottom: 0.75rem;
}

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

.data-table--register-list th.col-financial,
.data-table--register-list td.col-financial,
.data-table--register-list th.col-economic,
.data-table--register-list td.col-economic,
.data-table--register-list th.col-type,
.data-table--register-list td.col-type,
.data-table--register-list th.col-number,
.data-table--register-list td.col-number,
.data-table--register-list th.col-reconciled,
.data-table--register-list td.col-reconciled {
  font-size: 0.8125rem;
  white-space: nowrap;
}

.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,
.data-table--register-list td.col-amount {
  white-space: nowrap;
  min-width: 9rem;
}

.data-table--register-list .register-list__description {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.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;
}

.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__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  padding: 0.4375rem 0.625rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.register-filters__summary::-webkit-details-marker {
  display: none;
}

.register-filters__summary::-moz-list-bullet {
  display: none;
}

.register-filters__summary::before {
  flex-shrink: 0;
  width: 0.75rem;
  font-size: 0.625rem;
  line-height: 1;
  color: #64748b;
  content: "▸";
}

.register-filters[open] .register-filters__summary::before {
  content: "▾";
}

.register-filters__toggle {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
}

.register-filters__hint {
  font-size: 0.75rem;
  color: #94a3b8;
}

.register-filters__chips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.register-filters__chip {
  max-width: 14rem;
  overflow: hidden;
  padding: 0.0625rem 0.4375rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.6875rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.register-filters__clear,
.register-filters__clear-action {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
}

.register-filters__clear:hover,
.register-filters__clear-action:hover {
  color: #0f172a;
  text-decoration: underline;
}

.register-filters__panel {
  padding: 0.625rem 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
}

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

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

.register-filters__description {
  grid-column: 1 / -1;
}

.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__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.625rem;
}

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

.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;
}

@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;
}

.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: #1e3a5f;
  border: 1px solid #1e3a5f;
}

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

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

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

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

.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-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;
  pointer-events: none;
}

.farm-map-scale .leaflet-control-scale {
  margin: 0;
  float: none;
  background: transparent;
  box-shadow: none;
  border: 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-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: #64748b;
  border-bottom: 1px solid #e2e8f0;
}

.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__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-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;
}

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

.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-edit-toolbar {
  position: absolute;
  top: 0;
  left: calc(100% + 0.5rem);
  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));
  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: absolute;
  top: 0;
  left: calc(100% + 0.5rem);
  width: min(16.5rem, calc(100vw - 26rem));
  max-height: calc(100dvh - 6rem);
  overflow: auto;
  pointer-events: none;
}

.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__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;
}

[data-farm-map-root].farm-map-editing-active .farm-map-analysis-dive {
  top: 3rem;
}

.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;
}

.farm-map-layer-label-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
}

.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-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--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 (6px / 14px). */
[data-farm-map-root].farm-map-editing-active .leaflet-marker-pane .leaflet-editing-icon:not(.leaflet-edit-resize) {
  width: 6px !important;
  height: 6px !important;
  margin-left: -3px !important;
  margin-top: -3px !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: 14px !important;
  height: 14px !important;
  margin-left: -7px !important;
  margin-top: -7px !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: 3px !important;
  height: 3px !important;
  margin-left: -1.5px !important;
  margin-top: -1.5px !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: 7px !important;
  height: 7px !important;
  margin-left: -3.5px !important;
  margin-top: -3.5px !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;
}

/* 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 {
  display: inline-block;
  transition: transform 0.15s ease;
}

.monitoring-sites-accordion[open] .monitoring-sites-accordion__chevron,
.monitoring-events-accordion[open] .monitoring-events-accordion__chevron {
  transform: rotate(180deg);
}

.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: 28%;
}

.monitoring-sites-table th:nth-child(2),
.monitoring-sites-table td:nth-child(2) {
  width: 22%;
}

.monitoring-sites-table th:nth-child(3),
.monitoring-sites-table td:nth-child(3),
.monitoring-sites-table th:nth-child(4),
.monitoring-sites-table td:nth-child(4) {
  width: 25%;
}

/* Leaflet + Tailwind preflight (img max-width: 100% hides tiles) */
.leaflet-container img.leaflet-tile {
  max-width: none !important;
  max-height: none !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-width: 2.25rem;
  /* 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);
  box-sizing: border-box;
}

.app-has-folio-tabs .stockman-page-width {
  width: 90%;
  margin-left: 0;
  margin-right: auto;
}

/* 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: 35;
  pointer-events: none;
  background: var(--color-4);
}

.folio-rail__line {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid var(--color-border);
  pointer-events: none;
}

.folio-tabs {
  position: absolute;
  right: 0;
  top: var(--navbar-height);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: auto;
}

.folio-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--folio-tab-width);
  min-height: 4.5rem;
  padding: 0.65rem 0.35rem;
  border: 1px solid var(--color-gold);
  border-right: none;
  border-radius: 0.45rem 0 0 0.45rem;
  transform-origin: right center;
  background: var(--color-3);
  box-shadow:
    2px 0 6px color-mix(in srgb, var(--color-black) 8%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.2);
  text-decoration: none;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.folio-tab:hover {
  background: color-mix(in srgb, var(--color-3) 88%, var(--color-1));
  border-color: var(--color-gold);
  box-shadow:
    3px 0 10px color-mix(in srgb, var(--color-black) 12%, transparent),
    inset 0 1px 0 rgb(255 255 255 / 0.28);
  transform: translateX(-1px);
}

.folio-tab--current {
  position: relative;
  z-index: 1;
  margin-right: -1px;
  padding-right: calc(0.35rem + 1px);
  background: var(--color-cream);
  border: none;
  box-shadow: none;
  transform: none;
}

.folio-tab--current:hover,
.folio-tab--current:focus,
.folio-tab--current:focus-visible {
  background: var(--color-cream);
  border: none;
  box-shadow: none;
  transform: none;
}

.folio-tab--current:focus-visible {
  outline: 2px solid var(--color-gold);
  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);
}

.folio-tab--land .folio-tab__label,
.folio-tab--capital .folio-tab__label,
.folio-tab--work .folio-tab__label {
  color: var(--color-1);
}

.folio-tab--land.folio-tab--current .folio-tab__label {
  color: var(--color-chocolate);
}

.folio-tab--capital.folio-tab--current .folio-tab__label {
  color: var(--color-black);
}

.folio-tab--work.folio-tab--current .folio-tab__label {
  color: var(--color-chocolate);
}

@media (max-width: 40rem) {
  .app-has-folio-tabs {
    --stockman-page-inset: 2.35rem;
    --folio-tab-width: 1.9rem;
  }

  .folio-tab {
    min-width: var(--folio-tab-width);
    min-height: 3.75rem;
    padding: 0.5rem 0.25rem;
  }

  .folio-tab--current {
    padding-right: calc(0.25rem + 1px);
  }

  .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;
}

.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;
}

.context-help__markdown th {
  background: #f8fafc;
  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. */
.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);
}

.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;
}

.contact-editor--dialog {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: min(72vh, 42rem);
  height: 100%;
}

.contact-editor__header {
  flex: 0 0 auto;
  padding: 1.25rem 3.25rem 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.contact-editor__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: #0f172a;
}

.contact-editor__subtitle {
  margin: 0.35rem 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.25rem 1.5rem;
}

.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: 0.9rem 1.5rem;
  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;
}

/* 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__label {
  min-width: 0;
  font-weight: 600;
  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;
}

.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 {
  background-color: #0f172a;
  cursor: not-allowed;
  opacity: 0.5;
}

.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-editor__surface {
  overflow-y: auto;
  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 {
  min-height: calc(100vh - 11rem);
}

.crm-workspace--index,
.crm-workspace--contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1.25rem;
  height: calc(100vh - 11rem);
  min-height: 32rem;
  max-height: calc(100vh - 11rem);
}

.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;
}

.crm-workspace__detail-frame {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.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;
}

.crm-workspace__panel {
  display: flex;
  flex-direction: column;
  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);
}

.crm-workspace__cell--notes-body .crm-information-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.crm-workspace__panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  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__title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0f172a;
}

.crm-workspace-filter__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.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__range {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.crm-workspace-filter__range.is-visible {
  display: grid;
}

.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-workspace-filter-banner__clear {
  margin-left: auto;
  font-weight: 600;
  color: var(--color-tawny);
  text-decoration: underline;
}

.crm-contact-accordion__row {
  display: flex;
  align-items: flex-start;
}

.crm-contact-accordion__row.is-selected .crm-contact-accordion__summary,
.crm-contact-accordion__row.is-selected .crm-contact-accordion__actions {
  background: #eff6ff;
}

.crm-contact-accordion__actions {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 1rem 0.75rem 0;
}

.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-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: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.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__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__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__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;
}

.crm-information-entry__channel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.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 auto;
  min-height: 0;
  overflow: hidden;
}

.crm-information-panel__list {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.crm-information-panel__entries {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  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 {
  max-height: min(50vh, calc(100vh - 16rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

.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(248 250 252 / 0.98) 70%, rgb(248 250 252 / 0));
}

.crm-information-panel__new-note-actions {
  margin-top: 0;
  background: linear-gradient(to bottom, #fff 70%, rgb(255 255 255 / 0));
}

.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-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-entry__content::-webkit-scrollbar {
  width: 0.5rem;
}

.crm-information-entry__content::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 999px;
}

.crm-information-entry__content::-webkit-scrollbar-track {
  background: #e2e8f0;
}

.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 auto;
  min-height: 0;
  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 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.crm-information-panel__entries.is-isolated > .crm-information-entry[open] .crm-information-entry__content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
}

.crm-information-entry__note {
  min-height: 0;
}

.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__body {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 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: 0;
  height: auto;
}

.asset-split-show .event-links-panel--in-split {
  flex: 0 0 auto;
  margin: 0 1.5rem 1.5rem;
}

.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;
}

.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;
}

.crm-information-entry__row--workspace {
  grid-template-columns:
    minmax(9rem, 12rem)
    minmax(8rem, 12rem)
    minmax(0, 1fr)
    1.75rem
    auto
    1.25rem;
  align-items: start;
}

.crm-information-entry__row--workspace.crm-information-list__header {
  align-items: center;
}

.crm-information-entry__row--workspace.crm-information-entry__summary {
  align-items: center;
}

.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;
}

.crm-information-panel__entries > .crm-information-entry[open] > summary {
  background-color: rgb(241 245 249);
}

.crm-information-list__header-sep {
  display: none;
}

.crm-information-entry__when,
.crm-information-entry__contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.crm-information-entry__when-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.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-crm-information-accordion-edit-subject] {
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-underline-offset: 0.15em;
}

.crm-information-entry[open] [data-crm-information-accordion-edit-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: rgb(241 245 249);
}

.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) {
  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;
  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;
  width: 1.75rem;
  height: 1.75rem;
  color: #475569;
}

.crm-information-entry__attachments-icon {
  display: block;
  width: 1rem;
  height: 1rem;
}

.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--priority-very_high {
  background: color-mix(in srgb, #4cc96a 50%, white);
}

.crm-calendar__task-entry--priority-high {
  background: color-mix(in srgb, #c6e266 50%, white);
}

.crm-calendar__task-entry--priority-medium {
  background: color-mix(in srgb, #ffdd33 50%, white);
}

.crm-calendar__task-entry--priority-low {
  background: color-mix(in srgb, #ffcc99 50%, white);
}

.crm-calendar__task-entry--priority-very_low {
  background: color-mix(in srgb, #ff7f6a 50%, white);
}

.crm-calendar__task-entry--priority-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-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--priority-very_high {
  background: color-mix(in srgb, #4cc96a 50%, white);
  border-color: color-mix(in srgb, #3aab58 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-high {
  background: color-mix(in srgb, #c6e266 50%, white);
  border-color: color-mix(in srgb, #a8c44f 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-medium {
  background: color-mix(in srgb, #ffdd33 50%, white);
  border-color: color-mix(in srgb, #e6c400 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-low {
  background: color-mix(in srgb, #ffcc99 50%, white);
  border-color: color-mix(in srgb, #f0b070 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-very_low {
  background: color-mix(in srgb, #ff7f6a 50%, white);
  border-color: color-mix(in srgb, #e86650 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-not_sure {
  background: color-mix(in srgb, #7d868f 50%, white);
  border-color: color-mix(in srgb, #636b74 50%, white);
  color: #0f172a;
}

.task-kanban__card--priority-not_sure .task-kanban__card-title,
.task-kanban__card--priority-not_sure .task-kanban__card-title:hover {
  color: #0f172a;
}

.task-kanban__card--priority-not_sure .task-kanban__card-due,
.task-kanban__card--priority-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--priority-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(3, 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));
}

@media (min-width: 40rem) and (max-width: 63.99rem) {
  .account-dashboard__stat--slips {
    grid-column: 1 / -1;
  }
}

.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;
  background: #fff !important;
  background-clip: padding-box;
  box-shadow: 1px 0 0 #e2e8f0;
}

.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: #fff !important;
  background-clip: padding-box;
}

.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 {
  -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: 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;
}

.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-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;
}

.worksheet-index__years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}

.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. */
.root-awareness-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: auto;
  background: transparent;
}

.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-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: #94a3b8;
  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-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 — keep the previous minimum height, fill taller viewports. */
.work-calendar-page {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: calc(100dvh - 11rem);
  height: calc(100dvh - 11rem);
  max-height: calc(100dvh - 11rem);
  overflow: hidden;
}

.work-calendar-page > .work-board-toolbar {
  flex-shrink: 0;
  margin-bottom: 1rem;
}

.work-calendar--page {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 32rem;
  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: hidden;
  margin-top: 0.5rem;
}

.work-calendar--page .crm-calendar-month__grid {
  flex: 1 1 auto;
  min-height: 0;
  grid-template-rows: 2.25rem;
  grid-auto-rows: minmax(8rem, 1fr);
}

.work-calendar--page .crm-calendar-month__day {
  min-height: 8rem;
}

.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);
}


/* 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__value {
  flex-shrink: 0;
  min-width: 2.5rem;
  text-align: right;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-chocolate);
  font-variant-numeric: tabular-nums;
}

.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: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  user-select: none;
}

.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);
}

.urgency-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: -0.375rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--color-tawny);
  box-shadow: 0 1px 3px rgb(17 14 16 / 0.28);
}

.urgency-slider__input::-moz-range-thumb {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--color-tawny);
  box-shadow: 0 1px 3px rgb(17 14 16 / 0.28);
}

.urgency-slider__input:hover::-webkit-slider-thumb {
  background: var(--color-chocolate);
}

.urgency-slider__input:hover::-moz-range-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;
  display: flex;
  color: rgb(71 85 105);
  pointer-events: none;
  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;
}

.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 {
  max-width: 48rem;
  margin-inline: auto;
}

.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;
  }
}

.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;
}

