/*
 * 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) 24%, var(--color-cream));
}

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

/* 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 — centered in the main app column at 90% body width. */
.flash-toast {
  position: fixed;
  left: var(--stockman-page-inset, 0);
  right: 0;
  bottom: 1.5rem;
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
}

.flash-toast__inner {
  width: 90%;
  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: center;
}

.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 {
  -webkit-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 */
.data-table {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

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

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

.data-table-shell .data-table-shell__scroll {
  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: sticky;
  top: 0;
  z-index: 2;
  color: #64748b !important;
  background: #fff !important;
  box-shadow: inset 0 -1px 0 #e2e8f0;
}

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

.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 .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-financial,
.data-table--register-list col.col-economic {
  width: 6.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: 5.75rem;
}

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

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

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

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

.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 #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
  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::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-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;
}

/* Upper-left: map key with edit toolbar anchored to its top-right (out of document flow). */
[data-farm-map-root] .farm-map-left-controls {
  width: fit-content;
  max-height: calc(100% - 1.5rem);
}

[data-farm-map-root] .farm-map-key-aside {
  max-height: calc(100dvh - 6rem);
  background-color: rgb(255 255 255 / 0.8);
}

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

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

.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-width: 1px;
  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-width: 1px;
  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.45 !important;
  stroke: #c2410c !important;
  stroke-width: 3px !important;
}

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

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

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

/* 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.5rem;
  padding-right: 0.5rem;
  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: underline;
}

.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: baseline;
  min-width: 0;
  max-width: 100%;
}

.breadcrumb-trail__sep {
  flex-shrink: 0;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  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: underline;
}

.breadcrumb-trail__label--link {
  text-decoration: none;
}

.breadcrumb-trail__label--link:hover {
  text-decoration: underline;
}

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

.breadcrumb-trail__action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding-left: 0.65rem;
}

.breadcrumb-trail__action-link {
  font-size: inherit;
}

/* Icon-only actions — size with surrounding text (1em), no border */
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem;
  margin: 0;
  border: none;
  background: transparent;
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.icon-action-btn__icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  display: block;
}

.icon-action-btn--neutral {
  color: var(--color-text-muted);
}

.icon-action-btn--neutral:hover {
  color: var(--color-chocolate);
}

.icon-action-btn--danger {
  color: #dc2626;
}

.icon-action-btn--danger:hover {
  color: #991b1b;
}

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

.markdown-render > * + * {
  margin-top: 0.75rem;
}

.markdown-render h1,
.markdown-render h2,
.markdown-render h3,
.markdown-render h4 {
  font-weight: 600;
  line-height: 1.35;
}

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

/* 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-contact-detail {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 11rem);
  min-height: 32rem;
  max-height: calc(100vh - 11rem);
  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: 1fr 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__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__entries {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.crm-information-entry__content {
  max-height: min(50vh, calc(100vh - 16rem));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

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

.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) auto 1.25rem;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
}

.crm-information-entry__row--no-chevron {
  grid-template-columns: 6.75rem 9.25rem minmax(0, 1fr) auto;
}

.crm-information-list__header {
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.6875rem;
  font-weight: 600;
  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__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: #64748b;
}

.crm-information-entry__age--future {
  color: #0369a1;
}

.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__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--today {
  background: #e2e8f0 !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__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-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: #0f172a;
}

.task-kanban__column-title--button {
  display: flex;
  width: 100%;
  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;
}

.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));
  gap: 1px;
}

.crm-calendar-month__week-label {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.crm-calendar-month__day {
  min-width: 0;
}

/* 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: sticky;
  left: 0;
  z-index: 5;
  min-width: 8rem;
  width: 8rem;
  padding: 0.125rem 0.25rem;
  background: #fff !important;
  box-shadow: 1px 0 0 #e2e8f0;
}

.data-table-shell .data-table--worksheet .worksheet-grid__reason-cell {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 8rem;
  width: 8rem;
  padding: 0.125rem 0.25rem;
  background: #fff !important;
  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: sticky;
  left: 0;
  z-index: 6;
  background: #fff !important;
}

.worksheet-grid__reason-display {
  display: block;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.worksheet-grid__reason-display[hidden],
.worksheet-grid__notes-input[hidden],
.worksheet-grid__amount-input[hidden],
.worksheet-grid__combined-display[hidden],
.worksheet-grid__reason-input[hidden] {
  display: none !important;
}

.worksheet-grid__drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  border-radius: 0.25rem;
}

.worksheet-grid__drag-handle--active {
  cursor: grab;
  color: #94a3b8;
}

.worksheet-grid__drag-handle--active:hover {
  color: #64748b;
  background: #f8fafc;
}

.worksheet-grid__drag-handle--active:active {
  cursor: grabbing;
}

.worksheet-grid__drag-handle-icon {
  display: block;
}

.worksheet-grid__row--dragging {
  opacity: 0.55;
}

.worksheet-grid__row--drop-target {
  box-shadow: inset 0 2px 0 0 color-mix(in srgb, var(--color-gold, #d4a017) 70%, #fff);
}

.worksheet-grid__cell-input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  box-shadow: none;
  border-radius: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  resize: vertical;
}

.worksheet-grid__notes-input {
  box-sizing: border-box;
  overflow: hidden;
  resize: none;
  min-height: 1.25rem;
  line-height: 1.25rem;
}

.data-table--worksheet .worksheet-grid__month-cell {
  padding: 0.125rem 0.25rem;
}

.worksheet-grid__cell-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-slate-900, #0f172a) 15%, transparent);
}

.worksheet-grid__amount-input {
  -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 {
  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%);
}

.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: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1rem;
}

.worksheet-grid__title {
  margin: 0;
  min-width: 0;
  justify-self: start;
}

.worksheet-grid__view-toggles {
  justify-self: end;
}

.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;
  justify-self: center;
  max-width: 100%;
}

@media (max-width: 64rem) {
  .worksheet-grid__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .worksheet-tag-palette {
    order: 3;
    flex: 1 1 100%;
    align-items: center;
  }

  .worksheet-tag-palette__tags {
    justify-content: center;
  }

  .worksheet-grid__view-toggles {
    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;
  gap: 0.375rem;
  align-items: center;
}

.worksheet-tag {
  display: inline-flex;
  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--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 {
  padding: 0.125rem;
}

