/* Land Intelligence design tokens and shared components.
   Same structure as Wells Intelligence (app/www/wells.css), with Land's navy
   as the single accent. Loaded last in the app head so these components win
   over Bootstrap and the older per-surface sheets. Prefer these classes to
   inline styles in R markup. */
:root {
  --li-ink: #0f172a; --li-ink-2: #334155; --li-muted: #64748b; --li-faint: #94a3b8;
  --li-line: #cbd5e1; --li-line-soft: #e2e8f0; --li-bg-soft: #f8fafc;
  --li-navy: var(--primary, #003B5C); --li-navy-dark: #00293d; --li-navy-soft: #e6eef3;
  --li-ok: #0e7c4a; --li-ok-soft: #e7f4ed;
  --li-warn: #b45309; --li-warn-soft: #fdf6e9;
  --li-bad: #b91c1c; --li-bad-soft: #fdeeee;
  --li-radius: 8px; --li-radius-sm: 6px;
  --li-control-h: 34px;
  --li-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .08);
  --li-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Tracked uppercase caption above a control group. */
.li-label { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--li-muted); margin: 0 0 6px; display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.li-label .li-hint { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--li-faint); }

/* Small (i) that opens a definition tooltip. */
.li-info { color: var(--li-faint); font-size: .78rem; cursor: help; display: inline-flex; align-items: center; border: 0; background: transparent; padding: 0; line-height: 1; letter-spacing: 0; }
.li-info:focus-visible { outline: 2px solid var(--li-navy); outline-offset: 2px; border-radius: 50%; }
.li-info:hover { color: var(--li-muted); }

/* Small buttons. Secondary by default, .li-primary for the one main action. */
.btn.li-btn-sm, .li-btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .76rem; font-weight: 600; line-height: 1.2; padding: 6px 11px;
  border-radius: var(--li-radius-sm); border: 1px solid var(--li-line-soft);
  background: var(--li-bg-soft); color: var(--li-navy); box-shadow: none; white-space: nowrap;
  text-decoration: none; cursor: pointer;
}
.btn.li-btn-sm:hover, .li-btn-sm:hover { background: var(--li-navy-soft); border-color: var(--li-line); color: var(--li-navy-dark); }
.btn.li-btn-sm:focus-visible, .li-btn-sm:focus-visible { outline: 2px solid var(--li-navy); outline-offset: 1px; box-shadow: none; }
.btn.li-btn-sm.li-primary, .li-btn-sm.li-primary { background: var(--li-navy) !important; border-color: var(--li-navy) !important; color: #fff !important; }
.btn.li-btn-sm.li-primary:hover, .li-btn-sm.li-primary:hover { background: var(--li-navy-dark) !important; border-color: var(--li-navy-dark) !important; }
.btn.li-btn-sm.li-ghost, .li-btn-sm.li-ghost { background: transparent; border-color: transparent; }
.btn.li-btn-sm.li-ghost:hover, .li-btn-sm.li-ghost:hover { background: var(--li-bg-soft); border-color: var(--li-line-soft); }
.btn.li-btn-sm.li-block, .li-btn-sm.li-block { width: 100%; }
.btn.li-btn-sm.li-lg, .li-btn-sm.li-lg { font-size: .84rem; padding: 8px 14px; }
.li-btn-sm .fa, .li-btn-sm svg { font-size: .9em; }

/* Segmented control: one joined bar, navy active segment. Works with plain
   <button>s carrying .active and with shinyWidgets radioGroupButtons. */
.li-segmented { display: inline-flex; gap: 0; padding: 2px; border: 1px solid var(--li-line-soft); border-radius: var(--li-radius-sm); background: var(--li-bg-soft); }
.li-segmented > button, .li-segmented .btn {
  display: inline-flex; align-items: center; margin: 0; font-size: .74rem; font-weight: 600; line-height: 1.2;
  padding: 4px 10px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--li-ink-2);
  box-shadow: none; white-space: nowrap; cursor: pointer; letter-spacing: 0; text-transform: none;
}
.li-segmented > button:hover, .li-segmented .btn:hover { color: var(--li-navy); }
.li-segmented > button.active, .li-segmented .btn.active, .li-segmented .btn-check:checked + .btn { background: var(--li-navy); color: #fff; }

/* Field with its caption inside on the left and the value on the right. */
.li-field { position: relative; flex: 1; min-width: 0; }
.li-field .form-group { margin: 0; }
.li-field .li-field-cap { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--li-muted); pointer-events: none; z-index: 1; }
.li-field .form-control {
  height: var(--li-control-h); padding: 4px 10px 4px 40px; font-size: .82rem; font-weight: 600; text-align: right;
  color: var(--li-ink); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius-sm); background: #fff; box-shadow: none;
  font-variant-numeric: tabular-nums;
}
.li-field .form-control:focus { border-color: var(--li-navy); box-shadow: 0 0 0 2px var(--li-navy-soft); }
.li-field .form-control::placeholder { color: var(--li-faint); font-weight: 500; }
.li-fields { display: flex; gap: 8px; }

/* Stat grid: caption over value, optional sub line. */
.li-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.li-stat { min-width: 0; }
.li-stat-cap { font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--li-muted); display: flex; align-items: center; gap: 5px; }
.li-stat-val { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; color: var(--li-ink); line-height: 1.25; margin-top: 2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.li-stat-sub { font-size: .72rem; color: var(--li-faint); margin-top: 1px; line-height: 1.3; }
.li-stat-sub.ok { color: var(--li-ok); }
.li-stat-sub.warn { color: var(--li-warn); }
.li-stat-sub.bad { color: var(--li-bad); }

/* Status tag: sentence case, soft fill. */
.li-tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: .72rem; font-weight: 600; line-height: 1; white-space: nowrap; background: var(--li-line-soft); color: var(--li-ink-2); }
.li-tag.ok { background: var(--li-ok-soft); color: var(--li-ok); }
.li-tag.warn { background: var(--li-warn-soft); color: var(--li-warn); }
.li-tag.bad { background: var(--li-bad-soft); color: var(--li-bad); }
.li-tag.navy { background: var(--li-navy-soft); color: var(--li-navy); }
.li-tag .li-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Soft note box. Replaces the yellow, blue and red alert boxes. */
.li-note-box { padding: 9px 12px; background: var(--li-bg-soft); border-left: 3px solid var(--li-line); border-radius: var(--li-radius-sm); font-size: .78rem; color: var(--li-ink-2); line-height: 1.5; }
.li-note-box.warn { border-left-color: var(--li-warn); background: var(--li-warn-soft); }
.li-note-box.bad { border-left-color: var(--li-bad); background: var(--li-bad-soft); }
.li-note-box.ok { border-left-color: var(--li-ok); background: var(--li-ok-soft); }
.li-note-box b { color: var(--li-ink); }

/* Modal title: navy rule, eyebrow, heading. */
.li-modal-title { border-left: 4px solid var(--li-navy); padding: 4px 0 4px 12px; margin-right: 16px; }
.li-modal-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--li-navy); }
.li-modal-heading { font-size: 1.05rem; font-weight: 700; color: var(--li-ink); margin-top: 2px; line-height: 1.25; }
.li-modal-heading .li-heading-sub { font-size: .82rem; font-weight: 500; color: var(--li-muted); margin-left: 8px; }

.li-note { font-size: .74rem; color: var(--li-muted); line-height: 1.45; }
.li-spacer { flex: 1; }

/* ---------------------------------------------------------------------------
   Side panels (Search, Layers, Workspace)
   ------------------------------------------------------------------------- */
.li-panel-group { margin-top: 18px; }

/* Selectize dropdowns: slim, one control height. */
.panel-section .selectize-control .selectize-input,
.panel-section .selectize-control .selectize-input input,
.panel-section .selectize-control .selectize-input .item { font-size: .84rem; line-height: 1.3; }
.panel-section .selectize-control .selectize-input {
  min-height: var(--li-control-h); padding: 7px 28px 7px 10px;
  border: 1px solid var(--li-line-soft); border-radius: var(--li-radius-sm); box-shadow: none;
}
.panel-section .selectize-input.focus { border-color: var(--li-navy); box-shadow: 0 0 0 2px var(--li-navy-soft); }
.panel-section .selectize-dropdown .optgroup-header { font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--li-muted); }
.panel-section .selectize-dropdown { font-size: .82rem; border-color: var(--li-line-soft); border-radius: var(--li-radius-sm); box-shadow: var(--li-shadow); }

/* Switch-style checkboxes. The real checkbox stays (server code updates it);
   only its look changes. */
.li-switch .form-group { margin-bottom: 6px; }
.li-switch .shiny-input-container { width: auto; }
.li-switch .checkbox { margin: 0; }
.li-switch .checkbox label { display: flex; align-items: center; gap: 9px; padding-left: 0; margin: 0; font-size: 13px; font-weight: 500; color: var(--li-ink-2); cursor: pointer; }
.li-switch .checkbox input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0;
  width: 30px; height: 18px; border: 0; border-radius: 999px; background: var(--li-line); cursor: pointer;
  transition: background .15s ease;
}
.li-switch .checkbox input[type="checkbox"]::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .25); transition: transform .15s ease;
}
.li-switch .checkbox input[type="checkbox"]:checked { background: var(--li-navy); }
.li-switch .checkbox input[type="checkbox"]:checked::before { transform: translateX(12px); }
.li-switch .checkbox input[type="checkbox"]:focus-visible { outline: 2px solid var(--li-navy); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .li-switch .checkbox input[type="checkbox"], .li-switch .checkbox input[type="checkbox"]::before { transition: none; }
}

/* Search */
.li-search-row { display: flex; gap: 6px; margin-bottom: 8px; }
.li-search-row .form-control { height: var(--li-control-h); font-size: .84rem; border-color: var(--li-line-soft); border-radius: var(--li-radius-sm); box-shadow: none; }
.li-search-row .form-control:focus { border-color: var(--li-navy); box-shadow: 0 0 0 2px var(--li-navy-soft); }
.li-search-row .li-btn-sm { height: var(--li-control-h); padding: 0 14px; }
.li-search-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.li-search-options .li-switch .form-group { margin: 0; }
.li-search-count, .li-survey-count { margin: 6px 0 4px; }
.li-search-empty { padding: 8px 0; }
.li-result { display: flex; align-items: center; gap: 8px; padding: 8px 4px 8px 8px; border-bottom: 1px solid var(--li-line-soft); border-radius: 4px; }
.li-result:hover { background: var(--li-bg-soft); }
.li-result__main { flex: 1; min-width: 0; cursor: pointer; }
.li-result__title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--li-ink); }
.li-result__title > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-result__county { flex: none; font-size: 11.5px; font-weight: 500; color: var(--li-muted); }
.li-result__meta { font-size: 12px; color: var(--li-muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.btn.li-btn-sm.li-result__add { width: 28px; height: 28px; padding: 0; }

/* Selected survey, project surveys, calculated area */
.li-survey-card { padding: 12px; background: var(--li-bg-soft); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); }
.li-survey-stats.li-stats, .li-area-stats.li-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.li-area-stats.li-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.li-survey-list { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }

/* Workspace */
.li-features-empty { padding: 4px 0 8px; }
.li-feature {
  padding: 9px 8px 7px 10px; border: 1px solid var(--li-line-soft); border-radius: var(--li-radius);
  margin-bottom: 6px; background: #fff; transition: border-color .12s ease;
}
.li-feature:hover { border-color: var(--li-line); }
.li-feature.is-hidden { opacity: .68; }
.li-feature__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.li-feature__swatch {
  -webkit-appearance: none; appearance: none; flex: none; width: 14px; height: 14px; padding: 0;
  border: 0; border-radius: 4px; background: transparent; cursor: pointer;
}
.li-feature__swatch::-webkit-color-swatch-wrapper { padding: 0; }
.li-feature__swatch::-webkit-color-swatch { border: 0; border-radius: 4px; }
.li-feature__swatch::-moz-color-swatch { border: 0; border-radius: 4px; }
.li-feature__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--li-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-feature__row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; padding-left: 22px; }
.li-feature__meta { flex: 1; min-width: 0; font-size: 11.5px; color: var(--li-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.li-feature__actions { display: flex; align-items: center; gap: 1px; flex: none; }
.li-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: var(--li-radius-sm); background: transparent; color: var(--li-muted);
  font-size: 12.5px; cursor: pointer; text-decoration: none;
}
.li-icon-btn:hover, .li-icon-btn[aria-expanded="true"] { background: var(--li-bg-soft); color: var(--li-navy); }
.li-icon-btn:focus-visible { outline: 2px solid var(--li-navy); outline-offset: 1px; }
.li-menu { font-size: .8rem; min-width: 190px; padding: 4px; border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); box-shadow: var(--li-shadow); }
.li-menu .dropdown-item { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--li-radius-sm); color: var(--li-ink-2); }
.li-menu .dropdown-item .fa, .li-menu .dropdown-item svg { width: 14px; color: var(--li-muted); }
.li-menu .dropdown-item:hover, .li-menu .dropdown-item:focus { background: var(--li-bg-soft); color: var(--li-ink); }
.li-menu .dropdown-divider { margin: 4px 2px; border-color: var(--li-line-soft); }
.li-menu .dropdown-item.li-menu-danger, .li-menu .dropdown-item.li-menu-danger .fa, .li-menu .dropdown-item.li-menu-danger svg { color: var(--li-bad); }
.li-menu .dropdown-item.li-menu-danger:hover { background: var(--li-bad-soft); }

.li-unsaved-card { padding: 12px; margin-bottom: 10px; background: #fff; border: 1px solid var(--li-line-soft); border-left: 3px solid var(--li-navy); border-radius: var(--li-radius); }
.li-unsaved-card__title.li-label { margin-bottom: 4px; color: var(--li-navy); }
.li-unsaved-card__copy { font-size: 12.5px; color: var(--li-ink-2); line-height: 1.45; margin: 0 0 10px; }
.li-unsaved-card__actions { display: flex; gap: 6px; }

.btn.li-btn-sm.li-danger, .li-btn-sm.li-danger { color: var(--li-bad); }
.btn.li-btn-sm.li-danger:hover, .li-btn-sm.li-danger:hover { background: var(--li-bad-soft); border-color: var(--li-bad-soft); color: var(--li-bad); }
.btn.li-btn-sm:disabled, .btn.li-btn-sm.disabled { opacity: .5; cursor: not-allowed; }

.li-project-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; background: var(--li-bg-soft); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); margin-bottom: 4px; }
.li-project-bar__copy { min-width: 0; }
.li-project-bar__copy .li-label { margin-bottom: 2px; }
.li-project-bar__name { font-size: 14px; font-weight: 700; color: var(--li-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-import-locked { display: grid; gap: 10px; justify-items: start; }
.li-import-hint { margin-bottom: 8px; }
.li-export-note { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.li-export-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.li-export-row .li-btn-sm { flex: 1 1 auto; }
/* Selectize sizes its search input for the old font; keep the placeholder whole. */
.panel-section .selectize-control.single .selectize-input > input { min-width: 16ch !important; }

/* ---------------------------------------------------------------------------
   Modals: one frame for every dialog
   ------------------------------------------------------------------------- */
.modal-content { border: 0; border-radius: 12px; box-shadow: 0 24px 48px rgba(15, 23, 42, .2); }
.modal-backdrop.show { opacity: .4; }
.modal-header { padding: 18px 22px 6px; border-bottom: 0; align-items: flex-start; }
.modal-header .modal-title { font-size: 1.05rem; font-weight: 700; color: var(--li-ink); line-height: 1.3; width: 100%; }
.modal-header .modal-title .li-modal-title { margin-right: 0; }
.modal-body { padding: 10px 22px 18px; font-size: .88rem; color: var(--li-ink-2); line-height: 1.55; }
.modal-body .li-modal-copy { margin: 0 0 10px; }
.modal-body .control-label, .modal-body label.control-label { font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--li-muted); margin-bottom: 6px; }
.modal-body .form-control, .modal-body .selectize-input { font-size: .86rem; border-color: var(--li-line-soft); border-radius: var(--li-radius-sm); box-shadow: none; }
.modal-body .form-control:focus, .modal-body .selectize-input.focus { border-color: var(--li-navy); box-shadow: 0 0 0 2px var(--li-navy-soft); }
.modal-footer { padding: 12px 22px; gap: 6px; border-top: 1px solid var(--li-line-soft); background: var(--li-bg-soft); border-radius: 0 0 12px 12px; }
.modal-footer > * { margin: 0; }
.modal-footer .btn { font-size: .8rem; font-weight: 600; padding: 7px 14px; border-radius: var(--li-radius-sm); box-shadow: none; line-height: 1.2; }
.modal-footer .btn-default, .modal-footer .btn-secondary, .modal-footer .btn-outline-secondary, .modal-footer .btn-outline-primary {
  background: #fff; border: 1px solid var(--li-line); color: var(--li-ink-2);
}
.modal-footer .btn-default:hover, .modal-footer .btn-secondary:hover, .modal-footer .btn-outline-secondary:hover, .modal-footer .btn-outline-primary:hover {
  border-color: var(--li-faint); color: var(--li-ink); background: #fff;
}
.btn.li-btn-sm.li-danger-solid, .li-btn-sm.li-danger-solid { background: var(--li-bad); border-color: var(--li-bad); color: #fff; }
.btn.li-btn-sm.li-danger-solid:hover, .li-btn-sm.li-danger-solid:hover { background: #991b1b; border-color: #991b1b; color: #fff; }

/* Download-ready body */
.li-dl-stats.li-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 12px; }
.li-dl-note { margin-bottom: 14px; }
.li-dl-btn { margin-top: 2px; }

/* Export one feature: three choice rows */
.li-export-choices { display: grid; gap: 8px; }
.btn.li-choice {
  display: grid; grid-template-columns: 18px 1fr; column-gap: 12px; align-items: center; text-align: left;
  padding: 11px 14px; border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); background: #fff; color: var(--li-ink);
  box-shadow: none; line-height: 1.25;
}
.btn.li-choice:hover { border-color: var(--li-navy); background: var(--li-bg-soft); }
.btn.li-choice > .fa, .btn.li-choice > svg { grid-row: span 2; color: var(--li-navy); }
.li-choice__title { font-size: .86rem; font-weight: 600; }
.li-choice__sub { grid-column: 2; font-size: .76rem; color: var(--li-muted); }

/* Project manager */
.li-pm-stats.li-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; background: var(--li-bg-soft); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); margin-bottom: 14px; }
.li-pm-row { padding: 10px 0; border-top: 1px solid var(--li-line-soft); }
.li-pm-row__controls { display: flex; gap: 8px; align-items: flex-start; }
.li-pm-row__controls .form-group { flex: 1; min-width: 0; margin: 0; }
.li-pm-row__controls .li-btn-sm { height: var(--li-control-h); flex: none; }
.li-pm-row__controls .selectize-input, .li-pm-row__controls .form-control { min-height: var(--li-control-h); height: auto; padding-top: 7px; padding-bottom: 7px; }

/* Support and settings */
.li-support-plan { padding: 12px; background: var(--li-bg-soft); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); margin-bottom: 14px; }
.li-support-stats.li-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 10px; }
.li-support-plan__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.li-contact { display: grid; gap: 6px; }
.li-contact__row { display: flex; align-items: center; gap: 9px; }
.li-contact__row .fa, .li-contact__row svg { width: 14px; color: var(--li-muted); }
.li-settings .li-label { margin-top: 2px; }
.li-settings__soon { margin-top: 16px; }
.li-settings__share { margin: 2px 0 4px; }
.li-settings__terms { font-size: .78rem; margin-bottom: 14px; }
.li-settings__terms a, .li-terms a { color: var(--li-navy); }

/* First sign-in: Terms + shared geometry consent */
.li-terms { display: grid; gap: 10px; }
.li-terms .shiny-input-container { margin-bottom: 0; }
.li-terms__lead { margin: 0; color: var(--li-ink-2); line-height: 1.5; }
.li-terms__note { margin: -6px 0 6px; font-size: .78rem; color: var(--li-muted); line-height: 1.45; }
.li-terms__agree { padding-top: 10px; border-top: 1px solid var(--li-line); }
.li-terms__agree .checkbox label { font-weight: 500; }
/* Shiny gives every input a 300px width, which broke the agreement line short
   of the modal's edge; wrapped text lines up after the box, not under it. */
.li-terms__agree .shiny-input-container { width: 100%; }
.li-terms__agree .checkbox label { display: flex; align-items: baseline; gap: 8px; padding-left: 0; }
.li-terms__agree .checkbox input[type="checkbox"] { flex: none; position: static; margin: 0; transform: translateY(2px); }
.li-start-month__list { margin: 0; padding-left: 18px; color: var(--li-ink-2); font-size: .86rem; line-height: 1.6; }
.li-soon-list { margin: 0; padding-left: 18px; color: var(--li-muted); font-size: .84rem; display: grid; gap: 4px; }

/* Feature form */
.li-provenance { padding: 10px 12px; background: var(--li-bg-soft); border: 1px solid var(--li-line-soft); border-radius: var(--li-radius); margin-bottom: 14px; display: grid; gap: 3px; }
.li-provenance__row { display: flex; gap: 10px; font-size: .8rem; }
.li-provenance__row span { min-width: 120px; color: var(--li-muted); }
.li-provenance__row b { font-weight: 600; color: var(--li-ink); overflow-wrap: anywhere; }
.li-color-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.li-color-row .control-label { margin: 0; }
.li-color-input { width: 40px; height: 28px; padding: 0; border: 1px solid var(--li-line); border-radius: var(--li-radius-sm); background: #fff; cursor: pointer; }

/* Plans modal: sentence-case ribbon, header uses li-modal-title */
.plans-modal .plans-modal__sub { margin-top: 0; }
.modal-header .plans-modal__close { position: absolute; top: 14px; right: 16px; border: 0; background: transparent; color: var(--li-faint); font-size: 1.05rem; padding: 4px 6px; cursor: pointer; line-height: 1; }
.modal-header .plans-modal__close:hover { color: var(--li-navy); }
.modal-header:has(.plans-modal__close) { position: relative; }
.plan-card__ribbon { text-transform: none; letter-spacing: 0; font-size: .7rem; font-weight: 600; }
.btn.li-choice .action-label { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.li-stat--wide { grid-column: 1 / -1; }
.li-stat-val--sm { font-size: .84rem; font-weight: 600; }
.modal-body .selectize-input input, .modal-body .selectize-input .item { font-size: .86rem; }

/* Toasts: Shiny 1.14 styles notifications through #shiny-notification-panel
   with 32px padding and 24px margins, which outranked clearfork.css and made
   every toast oversized. Same specificity here, loaded last. */
/* bslib's Bootstrap build positions the panel with a doubled id selector
   (bottom-right, 450px wide); match it to own position and width. */
/* Below the header, not on it: the dark pill disappeared against the navy
   bar (Kyle's 10/20 walkthrough), so it sits over the map, larger. */
#shiny-notification-panel#shiny-notification-panel {
  top: calc(var(--header-height, 56px) + 10px); bottom: auto; left: 50%; right: auto; transform: translateX(-50%);
  padding: 0; gap: 8px; width: max-content; max-width: min(640px, calc(100vw - 32px));
}
#shiny-notification-panel .shiny-notification {
  margin: 0; padding: 12px 36px 12px 46px; min-height: 0; width: fit-content; max-width: 100%;
  font-size: 14px; line-height: 1.45; border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}
/* One toast at a time, so a stack never grows down over the calls panel.
   Warnings and errors win: while any is active, informational toasts stay
   hidden (a "Saved" can follow a failed write), and among several problems
   the newest shows. With no problem active, the newest toast shows. Each
   toast still times out on its own schedule. */
#shiny-notification-panel#shiny-notification-panel:not(:has(.shiny-notification-warning, .shiny-notification-error)) .shiny-notification:not(:last-child),
#shiny-notification-panel#shiny-notification-panel:has(.shiny-notification-warning, .shiny-notification-error) .shiny-notification:not(.shiny-notification-warning):not(.shiny-notification-error),
#shiny-notification-panel#shiny-notification-panel .shiny-notification-warning:has(~ .shiny-notification-warning, ~ .shiny-notification-error),
#shiny-notification-panel#shiny-notification-panel .shiny-notification-error:has(~ .shiny-notification-warning, ~ .shiny-notification-error) {
  display: none;
}
#shiny-notification-panel .shiny-notification::before { left: 15px; top: 13px; width: 19px; height: 19px; }
/* Links inside a toast (Undo, Retry the unconfirmed change, Reopen workspace)
   took the theme's navy link colour on the navy toast and vanished. */
#shiny-notification-panel .shiny-notification .shiny-notification-content a {
  color: #7dd3fc; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
#shiny-notification-panel .shiny-notification .shiny-notification-content a:hover { color: #bae6fd; }
/* A reading in progress (deed-wait.js): spinner, what is happening, how long
   it usually takes, time so far. Always shown, whatever else is toasting. */
#shiny-notification-panel#shiny-notification-panel .shiny-notification.li-wait {
  display: flex !important; align-items: center; gap: 18px; padding: 13px 18px 13px 50px; font-size: 14.5px;
}
#shiny-notification-panel .shiny-notification.li-wait::before {
  -webkit-mask: none; mask: none; background: none; top: 50%; left: 16px; width: 20px; height: 20px;
  margin-top: -10px; box-sizing: border-box; border-radius: 50%;
  border: 2.5px solid rgba(125, 211, 252, 0.25); border-top-color: #7dd3fc;
  animation: li-wait-spin 0.8s linear infinite;
}
@keyframes li-wait-spin { to { transform: rotate(360deg); } }
.li-wait__title { font-weight: 600; }
.li-wait__sub { font-size: 12.5px; color: #cbd5e1; margin-top: 2px; }
.li-wait__time { font-variant-numeric: tabular-nums; color: #94a3b8; font-size: 13px; margin-left: auto; }
body.deed-parsing [data-li-wait] { opacity: .65; cursor: progress; pointer-events: none; }
#shiny-notification-panel .shiny-notification-close {
  position: absolute; top: 5px; right: 8px; width: auto; height: auto; padding: 0; margin: 0;
  font-size: 14px; line-height: 1;
}

/* Team plan while it is not for sale (li_team_offered) */
.plan-card--soon { opacity: .78; }
.plan-card__soon-tag { margin-left: 8px; vertical-align: middle; }
.plan-card__soon { padding: 6px 14px; border-radius: 8px; border: 1px dashed var(--li-line); color: var(--li-muted); font-size: .78rem; font-weight: 600; text-align: center; }
.plans-grid.plans-grid--two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .plans-grid.plans-grid--two { grid-template-columns: 1fr; } }
.plan-card__offer { margin: -2px 0 8px; font-size: .78rem; font-weight: 600; color: var(--li-navy); text-align: center; }

/* Resizable left panel (www/panel-resize.js): one width the panel, the
   top-left map controls and the calls drawer all follow. app.R sets 340px. */
:root { --li-panel-w: 340px; }
.activity-panel { width: var(--li-panel-w); }
body.activity-panel-is-open .mapboxgl-ctrl-top-left,
body.activity-panel-is-open .maplibregl-ctrl-top-left { left: calc(58px + var(--li-panel-w)); }
body.activity-panel-is-open .deed-review-overlay { left: calc(60px + var(--li-panel-w)); }
body.activity-panel-is-open .deed-review-overlay[data-stage="cogo"] { left: auto; }
.li-panel-resizer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 7px; z-index: 6;
  cursor: col-resize; touch-action: none; background: transparent; transition: background .15s ease;
}
.li-panel-resizer::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 2px; background: transparent;
}
.li-panel-resizer:hover::after, body.li-panel-resizing .li-panel-resizer::after { background: #94a3b8; }
body.li-panel-resizing { cursor: col-resize; user-select: none; }
body.li-panel-resizing .activity-panel,
body.li-panel-resizing .deed-review-overlay,
body.li-panel-resizing .mapboxgl-ctrl-top-left { transition: none; }
@media (max-width: 768px) {
  .activity-panel { width: calc(100vw - 44px); }
  .li-panel-resizer { display: none; }
}
/* Toasts center over the map, not the window, while the panel is open. */
body.activity-panel-is-open #shiny-notification-panel#shiny-notification-panel {
  left: calc(50% + (48px + var(--li-panel-w)) / 2);
  max-width: min(640px, calc(100vw - var(--li-panel-w) - 96px));
}
@media (max-width: 768px) {
  body.activity-panel-is-open #shiny-notification-panel#shiny-notification-panel { left: 50%; max-width: calc(100vw - 32px); }
}

/* PLSS popup: what to add (section / quarter / quarter-quarter). The chosen
   one is outlined in cyan on the map. */
.li-size-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.li-size-chip { font-size: 11px; line-height: 1.2; padding: 3px 9px; border-radius: 999px; border: 1px solid #cbd5e1;
  background: #fff; color: #334155; cursor: pointer; }
.li-size-chip:hover { border-color: #0e7490; }
.li-size-chip.is-on { background: #0e7490; border-color: #0e7490; color: #fff; }

/* Readable coordinate provenance and an editable name before saving a deed. */
.li-deed-feature-name { max-width: 420px; margin: 12px 0; }
.li-deed-feature-name .shiny-input-container { width: 100%; margin-bottom: 0; }
.li-provenance__row > b { min-width: 0; overflow-wrap: anywhere; }
.li-crs-definition { margin-top: 8px; }
.li-crs-definition summary { cursor: pointer; color: #003b5c; }
.li-crs-definition label { display: block; margin-top: 8px; }
.li-crs-definition textarea { width: 100%; font: 12px/1.5 monospace; margin: 6px 0; }
