:root {
  --navy: #0B1F3A;
  --navy-2: #132A4A;
  --navy-3: #1A3A63;
  --gold: #C9A227;
  --gold-2: #E0BC4A;
  --gold-dim: #8A6E12;
  --white: #FFFFFF;
  --page: #F4F6F8;
  --card: #FFFFFF;
  --line: #D9DEE6;
  --text: #0B1F3A;
  --muted: #5C6B7A;
  --paid: #1B7A4A;
  --out: #B45309;
  --billed: #6B7280;
  --danger: #9B1C1C;
  --shadow: 0 8px 24px rgba(11, 31, 58, 0.10);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--text); }
body { font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
html, body, #app, .shell, .main, .table-wrap, table.data { cursor: default; pointer-events: auto; }
.tab, .name-btn, .primary, .ghost, .close, button, a, label.chk, input, select, textarea { cursor: pointer; pointer-events: auto; position: relative; z-index: 2; }
button { cursor: pointer; }
a { color: var(--navy); }

.banner {
  text-wrap: balance;

  background: var(--navy);
  color: var(--gold);
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  border-bottom: 2px solid var(--gold);
  font-weight: 600;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 0;
  background: var(--navy);
  color: var(--white);
  border-bottom: 2px solid var(--gold);
}
.brand { display: flex; gap: 12px; align-items: baseline; padding-bottom: 12px; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: 0.12em; font-weight: 700; color: var(--white); }
.brand h1 .w, .login-card h2 .w { color: #FFFFFF !important; }
.brand h1 .y, .login-card h2 .y { color: #C9A227 !important; }
.brand .sub { color: #C5D0DC; font-size: 12px; }
.topbar .meta { color: #C5D0DC; font-size: 12px; display: flex; gap: 16px; align-items: center; padding-bottom: 12px; }
.tabs {
  display: flex;
  gap: 6px;
  align-self: flex-end;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.tab {
  background: #132A4A;
  border: 1px solid #3A5270;
  border-bottom: 3px solid transparent;
  color: #FFFFFF;
  padding: 12px 22px 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--gold); border-color: var(--gold); }
.tab.active { color: var(--navy); background: var(--gold); border-color: var(--gold); }
.board-box {
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  background: var(--white);
  box-shadow: var(--shadow);
}
th[data-col], th.th-sortable { cursor: pointer; user-select: none; position: relative; }
th[data-col].dragging { opacity: 0.45; }
.th-label { cursor: pointer; }
.col-grip {
  display: inline-block;
  margin-right: 4px;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: -1px;
  cursor: grab;
  vertical-align: middle;
  opacity: 0.85;
}
.col-grip:active { cursor: grabbing; }
.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  z-index: 6;
}
.col-resizer:hover { background: rgba(201, 162, 39, 0.45); }
table.data th.th-sortable { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ghost {
  background: transparent;
  border: 1px solid #3A5270;
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--white);
}
.ghost:hover { border-color: var(--gold); color: var(--gold); }

.login-wrap {
  min-height: calc(100vh - 34px);
  display: grid;
  place-items: center;
  background: var(--navy);
}
.login-card {
  width: 400px;
  background: var(--white);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-card h2 { margin: 0 0 6px; font-size: 22px; color: var(--navy); letter-spacing: 0.08em; }
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-card .login-tagline {
  margin: 0 0 18px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.35;
  text-wrap: balance;
}
.login-card .rule { height: 2px; background: var(--gold); width: 56px; margin: 8px 0 16px; }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; font-weight: 600; letter-spacing: 0.03em; }
input, select, textarea {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 10px;
  outline: none;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.primary {
  margin-top: 18px;
  background: var(--gold);
  color: var(--navy);
  border: 0;
  border-radius: 4px;
  padding: 10px 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.primary:hover { background: var(--gold-2); }
.primary.block { width: 100%; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 8px; }

.shell { min-height: calc(100vh - 118px); max-width: 100%; overflow-x: hidden; }
.main { overflow-x: hidden; overflow-y: auto; padding: 18px 22px 40px; max-width: 100%; }
.empty { color: var(--muted); padding: 48px 12px; text-align: center; }

.toolbar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.toolbar .search { min-width: 240px; flex: 1; }
.toolbar .search input { background: var(--white); }
.search-wrap { position: relative; }
.search-wrap input { width: 100%; padding-right: 32px; }
.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.search-clear:hover { background: #EEF1F4; color: var(--navy); }
.search-clear[hidden] { display: none; }
.hint { color: var(--muted); font-size: 12px; margin-left: auto; }

.table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 168px);
}
table.data {
  width: max-content;
  min-width: max(100%, 960px);
  table-layout: auto;
  border-collapse: collapse;
  font-size: 11px;
}
table.data th, table.data td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}
table.data th:not(.col-num):not(.col-sticky),
table.data td:not(.col-num):not(.col-sticky) {
  min-width: 96px;
}
table.data th {
  background: var(--navy);
  color: var(--white);
  font-weight: 650;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--gold);
}
table.data td.wrap { white-space: normal; max-width: 220px; }
table.data tbody tr:hover { background: #F7F4EA; }
table.data th.col-num, table.data td.col-num {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 48px;
  min-width: 48px;
  background: var(--white);
  box-shadow: 1px 0 0 var(--line);
}
table.data th.col-num { background: var(--navy); z-index: 5; }
table.data tbody tr:hover td.col-num { background: #F7F4EA; }
table.data th.col-sticky, table.data td.col-sticky {
  position: sticky;
  left: var(--sticky-name-left, 48px);
  z-index: 3;
  background: var(--white);
  min-width: 100px;
  box-shadow: 1px 0 0 var(--line);
}
table.data th.col-sticky { background: var(--navy); z-index: 5; }
table.data tbody tr:hover td.col-sticky { background: #F7F4EA; }
table.data th.col-claim, table.data td.col-claim {
  position: sticky;
  left: var(--sticky-claim-left, 168px);
  z-index: 2;
  background: var(--white);
  min-width: 120px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 2px 0 4px rgba(11, 31, 58, 0.08);
}
table.data th.col-claim { background: var(--navy); z-index: 5; }
table.data tbody tr:hover td.col-claim { background: #F7F4EA; }
.name-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
.name-btn:hover { color: var(--gold-dim); }
.name-btn.name-paying { color: #1a5fb4; text-decoration-color: #1a5fb4; }
.name-btn.name-paying:hover { color: #0d47a1; }
.name-btn.name-dropped { color: #c01c28; text-decoration-color: #c01c28; }
.name-btn.name-dropped:hover { color: #9a1620; }
.name-btn.name-settled { color: #8a8f98; opacity: 0.6; text-decoration-color: #b5b9c0; }
.name-btn.name-settled:hover { opacity: 0.9; color: #6b7079; }

.chip {
  display: inline-block;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--page);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
}
.chip.on { color: var(--navy); border-color: var(--gold); background: #F7F1DC; font-weight: 650; }

.patient-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.patient-head h2 { margin: 0; font-size: 24px; color: var(--navy); }
.muted { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
  align-items: start;
}
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 14px;
}
.panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 700;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}

.params { display: flex; flex-direction: column; gap: 8px; }
.param {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 6px;
  align-items: start;
  cursor: pointer;
}
.param:active { cursor: grabbing; }
.param.dragging { opacity: 0.45; }
.handle { color: var(--muted); letter-spacing: -1px; padding-top: 2px; user-select: none; }
.param .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 650; }
.param .v { margin-top: 2px; font-size: 12px; }
.param .v small { color: var(--muted); display: block; margin-top: 2px; }

.map-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  align-items: start;
}
.map-box {
  height: calc(100vh - 220px);
  min-height: 420px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  background: #E8EEF4;
}
.offices { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.office {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--white);
}
.office.fav { border-color: var(--gold); background: #FBF6E6; }
.star {
  background: transparent;
  border: 0;
  font-size: 16px;
  color: var(--muted);
  padding: 0;
}
.office.fav .star { color: var(--gold); }
.office .nm { font-size: 13px; font-weight: 650; }
.office .ad { font-size: 11px; color: var(--muted); }
.hide-row { margin-top: 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.hide-row input { width: auto; }
.filters { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.filters label { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.filters input { width: auto; }
.poi-type { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-dim); font-weight: 700; }

.detail {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 58, 0.55);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 24px;
}
.detail-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 4px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.detail-card h2 { margin: 0 0 4px; color: var(--navy); }
.costs { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.costs th, .costs td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.costs th:first-child, .costs td:first-child { text-align: left; }
.costs th {
  color: var(--navy);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--gold);
}
.costs .billed { color: var(--billed); }
.costs .paid { color: var(--paid); font-weight: 650; }
.costs .out { color: var(--out); font-weight: 650; }
.note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 12px; }
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-head h2 { margin: 0 0 4px; }
.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.close {
  float: none;
  background: var(--navy);
  color: var(--white);
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  font-weight: 650;
}
.close:hover { background: var(--navy-3); }
.detail-actions .primary { padding: 6px 12px; }

.counts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.count-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 12px;
}
.count-card .n { font-size: 26px; font-weight: 750; color: var(--navy); }
.count-card .l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 650; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 14px;
  margin-bottom: 14px;
}
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.filter-actions .primary, .filter-actions .ghost-dark { margin-top: 0; }
.ghost-dark {
  background: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
  border-radius: 4px;
  padding: 10px 14px;
  font-weight: 650;
}
.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv span:last-child { font-weight: 700; color: var(--navy); }

textarea.notes {
  min-height: 90px;
  resize: vertical;
}

/* Notes line items (Deezy chart) */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.notes-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notes-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.notes-item-text {
  flex: 1 1 12rem;
  min-width: 8rem;
  font-size: 12px;
}
.notes-item-date {
  flex: 0 0 8.5rem;
  width: 8.5rem;
  min-width: 8.5rem;
  font-size: 12px;
}
.notes-item-by {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  min-width: 2.5rem;
}
.notes-item-del {
  flex: 0 0 auto;
  padding: 2px 8px !important;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  min-width: 2rem;
}
.notes-item-del:hover {
  color: #9B1C1C;
  border-color: #E5B4B4;
}
.notes-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
}
.notes-add-input {
  flex: 1 1 12rem;
  min-width: 8rem;
  font-size: 12px;
}
.notes-add-btn {
  flex: 0 0 auto;
}

.section-title {
  margin: 18px 0 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 700;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
}
.map-status { font-size: 12px; color: var(--muted); margin: 8px 0; min-height: 16px; }
.map-status-err { color: #b42318; font-weight: 600; }
.map-err { font-size: 12px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca; border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px; }
.fav-add { display: grid; gap: 6px; margin-top: 4px; }
.fav-add .primary { margin-top: 4px; }
.tiny { font-size: 11px; color: var(--muted); }

@media (max-width: 960px) {
  .map-layout, .grid-2, .breakdown { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .tabs { width: 100%; }
}

.login-card h2 span, .brand h1 .w, .login-card h2 .w { color: #FFFFFF !important; }
.brand h1 .y, .login-card h2 .y { color: #C9A227 !important; }
.cols-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 12px;
}
.cols-panel-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; margin-bottom: 8px; }
.cols-panel-head strong { color: var(--navy); letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; }
.add-col-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #F7F4EA;
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.add-col-form .primary { margin-top: 0; padding: 8px 14px; }
.add-col-main { flex: 1; min-width: 180px; }
.add-col-main input { width: 100%; }
.add-col-show { margin: 0 0 4px !important; white-space: nowrap; }
.cols-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 12px;
  margin: 4px 0 0;
}
.cols-panel .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 12px;
  margin: 8px 0;
}
.cols-panel label.chk { display: flex; gap: 6px; align-items: center; font-weight: 500; margin: 0; color: var(--text); font-size: 12px; }
.cols-panel label.chk input { width: auto; }
.cols-panel .col-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 6px;
  border-radius: 3px;
}
.cols-panel .col-row:hover { background: var(--page); }
.cols-panel label.col-row { padding: 4px 6px; border-radius: 3px; }
.cols-panel label.col-row:hover { background: var(--page); }
.cols-panel .col-row-check { margin: 0 !important; flex: 0 0 auto; white-space: nowrap; }
.cols-panel .col-row-label { flex: 1; font-weight: 650; color: var(--navy); }
.cols-panel .col-row-name {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
  padding: 4px 8px !important;
  font-weight: 650;
  color: var(--navy);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 3px;
}
.cols-panel .col-row-name:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.2);
}
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.add-row input, .add-row select { width: auto; min-width: 140px; padding: 6px 8px; font-size: 12px; }
.staff-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  align-items: start;
}
.activity-box { padding: 0; overflow: hidden; }
.activity-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  padding: 10px 12px;
  background: var(--navy);
  color: var(--white);
}
.activity-head strong { color: var(--gold); letter-spacing: 0.05em; text-transform: uppercase; font-size: 11px; }
.activity-head .muted { color: #C5D0DC; }
.activity-scroll {
  max-height: 360px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.activity-table { font-size: 11px; }

.col-num { width: 48px; text-align: center; color: var(--muted); }
.activity-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.activity-filter-row label {
  font-size: 11px;
  color: #C5D0DC;
  margin: 0;
}
.activity-filter-row select {
  min-width: 160px;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

@media (max-width: 960px) {
  .staff-layout { grid-template-columns: 1fr; }
}
.params {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px !important;
}
.detail-card { font-size: 12px; }
.detail-card input,
.detail-card select,
.detail-card textarea {
  width: 100%;
  box-sizing: border-box;
  background: #F7F9FC;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 12px;
}
.detail-card input:focus,
.detail-card select:focus,
.detail-card textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fff;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 8px;
}
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid label { margin: 0 0 4px; font-size: 11px; }
.form-grid .chk-row {
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}
.form-grid label.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.form-grid label.chk input { width: auto; }
.form-grid .chk-with-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.form-grid .chk-with-date .chk-stamp-date {
  width: auto;
  min-width: 8.5rem;
  max-width: 11rem;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  flex-shrink: 0;
  color: var(--navy);
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: #fffef8;
}
.form-grid .chk-with-date.is-stamped .chk-stamp-date,
.form-grid .chk-with-date .chk-stamp-date:not([hidden]) {
  display: inline-block !important;
  visibility: visible !important;
  min-width: 8.5rem;
}
.form-grid .chk-with-date .chk-stamp-date[hidden] { display: none !important; }
.form-grid .chk-with-date .chk-stamp-by {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.form-grid .chk-with-date .chk-stamp-by[hidden] { display: none !important; }

.treatment-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.treatment-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 180px);
  gap: 10px 16px;
  align-items: end;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.treatment-row:last-child { border-bottom: none; }
.treatment-row label.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.treatment-row label.chk input { width: auto; }
.treatment-date label { margin: 0 0 4px; font-size: 11px; display: block; }
.treatment-date input { width: 100%; }
.filter-actions { flex-wrap: wrap; }
.costs .cost-inp {
  width: 100%;
  max-width: 110px;
  text-align: right;
  padding: 4px 6px !important;
  font-size: 11px;
  margin-left: auto;
  display: block;
}
.save-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 0 4px;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0.85));
  border-top: 1px solid var(--line);
  z-index: 3;
}
.save-msg { font-size: 12px; font-weight: 650; margin-right: auto; }
.save-msg.ok { color: var(--paid, #1B7A4A); }
.save-msg.err { color: #9B1C1C; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.costs th, .costs td { padding: 4px 6px !important; font-size: 11px; }
.section-title { font-size: 11px !important; margin: 10px 0 6px !important; }
.notes { min-height: 56px !important; font-size: 12px; }
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .tabs { width: 100%; }
  .tab { min-height: 44px; }
  .meta span { display: none; }
  .main { padding: 10px; }
  .table-wrap { max-height: calc(100vh - 210px); }
}

.row-revoked td { color: var(--muted); opacity: 0.85; }
.danger-btn { color: #9B1C1C !important; border-color: #E5B4B4 !important; }
.danger-btn:hover { background: #FDF2F2 !important; }

.patient-search { position: relative; z-index: 10; }
/* Contain Leaflet's pane z-indexes (400-1000) so they can't cover the patient dropdown. */
.map-box { position: relative; z-index: 0; isolation: isolate; }
.patient-hits {
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  top: calc(100% + 2px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow: auto;
}
.patient-hits.hidden { display: none; }
.patient-hit {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.patient-hit:hover { background: #F4F6F8; }
.patient-hit strong { display: block; color: var(--navy); font-size: 12px; }
.patient-hit small { display: block; color: var(--muted); font-size: 11px; }
.patient-hit small em { font-style: italic; color: #9B1C1C; }

.chart-section { margin: 0; }
.chart-section.dragging { opacity: 0.45; }
.chart-section .section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-drag {
  display: inline-block;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
  opacity: 0.9;
  flex-shrink: 0;
  line-height: 1;
}
.section-drag:active { cursor: grabbing; }
.add-category-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: flex-end;
  padding: 8px 10px;
  margin: 8px 0 12px;
  background: #F7F4EA;
  border: 1px solid var(--gold);
  border-radius: 4px;
}
.add-category-form input { min-width: 180px; flex: 1; }
.add-category-form .primary { margin-top: 0; padding: 8px 14px; }
.add-col-section { min-width: 160px; }
.add-col-section select { width: 100%; }
.chart-section-empty { font-size: 12px; color: var(--muted); padding: 4px 0 8px; }
.field-cell { position: relative; min-width: 0; }
.field-cell.field-dragging { opacity: 0.4; }
.field-move {
  display: flex;
  align-items: center;
  margin: 0 0 2px;
}
.field-drag {
  display: inline-block;
  color: var(--gold);
  font-size: 10px;
  letter-spacing: -1px;
  cursor: grab;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}
.field-drag:active { cursor: grabbing; }
.form-grid .field-cell.chk-row {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
}
.chart-section.field-drop-target {
  outline: 2px dashed var(--gold);
  outline-offset: 3px;
  background: #F7F4EA;
}

.cols-admin-note { font-size: 12px; color: var(--muted); margin: 0 0 10px; }

.demo-sms { background: var(--page); border: 1px dashed var(--gold); padding: 8px 10px; border-radius: 4px; font-size: 13px; margin: 10px 0 0; color: var(--navy); }
.phone-cell { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.phone-cell .phone-edit { margin-top: 0; padding: 3px 8px; font-size: 11px; }

.delete-patient-row {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #E5E7EB);
  display: flex;
  justify-content: flex-start;
}

.import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 51, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 16px;
}
.import-card {
  background: var(--white, #fff);
  border-radius: 12px;
  width: min(520px, 100%);
  padding: 16px 18px 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  border: 1px solid var(--line, #E5E7EB);
}
.import-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.import-note { margin: 0 0 12px; font-size: 13px; line-height: 1.35; }
.import-drop {
  border: 2px dashed var(--line, #C9A227);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  background: #FBF8EF;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.import-drop.dragover {
  background: #F5EED6;
  border-color: var(--navy, #0B1F33);
}
.import-drop-title { font-weight: 600; color: var(--navy, #0B1F33); }
.import-err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #FDF2F2;
  color: #9B1C1C;
  border: 1px solid #E5B4B4;
  font-size: 13px;
}
.import-foot { margin-top: 12px; font-size: 12px; }

.staff-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.staff-toolbar .hint { flex: 1; min-width: 200px; }


.wipe-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 31, 58, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wipe-card {
  width: min(520px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid #9B1C1C;
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
}
.wipe-card h3 { margin: 0 0 8px; color: #9B1C1C; }
.wipe-card p { margin: 0 0 10px; color: var(--text); font-size: 13px; line-height: 1.4; }
.wipe-phrase {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #FDF2F2;
  border: 1px dashed #E5B4B4;
  border-radius: 4px;
  color: var(--navy);
  font-size: clamp(18px, 4vw, 24px);
  letter-spacing: 0.06em;
  font-weight: 800;
  text-align: center;
  white-space: pre-wrap;
  word-break: break-word;
}
.wipe-card input {
  width: 100%;
  margin-bottom: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.wipe-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.wipe-actions .danger-btn {
  background: #9B1C1C;
  color: #fff !important;
  border-color: #9B1C1C !important;
}
.wipe-actions .danger-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.report-active-filters {
  margin: 10px 0 8px;
  padding: 8px 10px;
  background: #F4F6F8;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-size: 12px;
  color: var(--navy);
}


/* Cases sheet Find (Ctrl+F) */
.sheet-find-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.sheet-find-bar > label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
  align-self: center;
}
.sheet-find-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  flex: 1;
  min-width: 0;
}
.sheet-find-wrap input#sheet-find {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 360px;
  background: var(--white);
}
.sheet-find-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 4.5em;
}
.sheet-find-nav,
.sheet-find-clear {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  line-height: 1;
  color: var(--navy);
  border-color: var(--line);
  background: var(--white);
}
.sheet-find-clear { font-size: 18px; }
.sheet-find-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}
.sheet-find-filter input { margin: 0; }
tr.sheet-find-hidden { display: none !important; }
mark.sheet-find-hit {
  background: #ffe566;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
mark.sheet-find-hit.sheet-find-current {
  background: #ffb020;
  outline: 2px solid #c47a00;
  outline-offset: 0;
}

.ask-box { flex: 1 1 280px; min-width: 220px; max-width: 520px; }
.ask-box label { display:block; font-size:11px; font-weight:700; color:var(--muted); margin-bottom:4px; text-transform:uppercase; letter-spacing:.03em; }
.ask-wrap { display:flex; gap:8px; align-items:center; }
.ask-wrap input { flex:1; min-width:0; }
.ask-card {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.ask-card.ask-error { color: #8b1a1a; border-color: #e2b4b4; background: #fff6f6; }
.ask-msg { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.ask-chips { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:8px; }
.ask-chip {
  border: 1px solid var(--line);
  background: #f7f8fb;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--navy);
}
.ask-chip small { color: var(--muted); margin-left: 4px; }
.ask-answer { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; padding:8px 0; border-top:1px solid var(--line); }
.ask-answer:first-of-type { border-top:0; padding-top:0; }
.ask-summary { font-size: 13px; line-height: 1.45; color: var(--navy); flex:1; }
.ask-open { flex-shrink:0; margin-top:0 !important; }
@media (max-width: 720px) {
  .ask-answer { flex-direction: column; }
}

.ask-engine{font-size:11px;color:var(--muted);margin-bottom:6px;font-weight:600;}

.chart-layout-tools{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin:12px 0 8px;}
.chart-section-accent,.chart-subsection{margin-left:14px;border-left:3px solid var(--gold);padding-left:10px;}
.section-title-text{cursor:default;}
.section-title-edit,
.section-title-edit .section-title-text{cursor:pointer;}
.section-rename-input{flex:1;min-width:120px;height:28px;padding:2px 8px;font-size:14px;font-weight:700;}

.cf-label{cursor:default;display:inline-block;}
.cf-label-text{font-weight:600;}
.field-label-edit{cursor:pointer;}
.field-label-text{font-weight:600;}

.img-portal-cell { min-width: 180px; }
.img-portal-link {
  display: inline-block;
  margin-bottom: 4px;
  font-weight: 650;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.img-portal-link:hover { color: var(--gold-dim); }

/* Hard costs category edit affordance (admin) */
.costs td.hc-cat-cell {
  cursor: pointer;
  user-select: none;
}
.costs td.hc-cat-cell .hc-cat-label,
.costs .field-label-edit.hc-cat-label {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  color: var(--navy, #0B1F3A);
  font-weight: 650;
}
.add-hc-category-form {
  margin: 10px 0 12px;
  padding: 10px 12px;
  background: #F7F5EF;
  border: 1px dashed var(--line, #D6D0C4);
  border-radius: 6px;
}
.costs .cost-inp {
  cursor: text;
  pointer-events: auto;
}
.hardcosts-totals { margin-top: 4px; }

/* Field drag-drop placement indicators (admin gold grips) */
.form-grid .field-cell.field-drop-before { box-shadow: inset 3px 0 0 var(--gold); }
.form-grid .field-cell.field-drop-after { box-shadow: inset -3px 0 0 var(--gold); }
.form-grid .field-cell.span2.field-drop-before { box-shadow: inset 0 3px 0 var(--gold); }
.form-grid .field-cell.span2.field-drop-after { box-shadow: inset 0 -3px 0 var(--gold); }

/* Two-column checkbox block ("click boxes"): Left / Right columns, admin-draggable. */
.form-grid .field-chk-block {
  grid-column: 1 / -1;
  container-type: inline-size;
  min-width: 0;
}
.chk-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 12px;
  align-items: start;
}
.chk-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 28px;
  padding: 4px 0;
  border-radius: 4px;
}
.form-grid .chk-col .field-cell.chk-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  padding: 2px 0;
  min-width: 0;
}
.form-grid .chk-col .field-cell.chk-row > .field-move { margin: 3px 0 0; }
.form-grid .chk-col .field-cell.chk-row > .chk-with-date,
.form-grid .chk-col .field-cell.chk-row > label.chk { flex: 1 1 auto; min-width: 0; }
.form-grid .chk-col label.chk { align-items: flex-start; overflow-wrap: anywhere; }
.form-grid .chk-col label.chk input { margin-top: 2px; flex-shrink: 0; }
/* Stamped date + who-checked sit on their own line under the label (fits half-width columns). */
.form-grid .chk-col .chk-with-date { gap: 4px 8px; }
.form-grid .chk-col .chk-with-date > label.chk { flex: 1 0 100%; }
.form-grid .chk-col .chk-with-date .chk-stamp-date { margin-left: 24px; }
.form-grid .chk-col .chk-with-date .chk-stamp-by {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}
.chk-col-empty {
  border: 1px dashed var(--gold);
  border-radius: 4px;
  background: #FBF9F2;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  padding: 10px 8px;
}
.chk-col.chk-col-drop {
  outline: 2px dashed var(--gold);
  outline-offset: 1px;
  background: #F3EEDD;
}
.form-grid .chk-col .field-cell.field-drop-before { box-shadow: inset 0 3px 0 var(--gold); }
.form-grid .chk-col .field-cell.field-drop-after { box-shadow: inset 0 -3px 0 var(--gold); }
/* Narrow: stack the two columns (Left, then Right). */
@container (max-width: 380px) {
  .chk-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 700px) {
  .chk-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* Reports tab: date range (From / To) */
.report-range {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 2px solid var(--gold);
  border-radius: 4px;
  padding: 12px 14px 10px;
  margin-bottom: 12px;
}
.report-range-inputs { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.report-range-inputs input[type="date"] { min-width: 150px; }
.report-range-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.range-preset, .range-clear {
  background: #F4F6F8;
  border: 1px solid var(--line);
  color: var(--navy);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  margin-top: 0;
}
.range-preset:hover, .range-clear:hover { border-color: var(--navy); }
.range-preset.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.range-clear { background: transparent; }
.report-range-active { margin-top: 8px; font-size: 13px; color: var(--navy); }
.report-range-active.is-set strong { color: var(--navy); }
.report-range-active.is-set { font-weight: 600; }
.report-range-active.is-bad { color: #B42318; }
.report-range-active .tiny { font-weight: 400; color: var(--muted); }
.report-range-error {
  margin: 10px 0 14px;
  padding: 10px 12px;
  background: #FEF3F2;
  border: 1px solid #FDA29B;
  border-left: 3px solid #B42318;
  border-radius: 4px;
  color: #7A271A;
  font-size: 14px;
}
.report-basis { font-size: 11px; color: var(--muted); margin-top: 2px; }
.report-basis-inline { font-size: 11px; color: var(--muted); }
.report-nodate { color: #93370D; margin-bottom: 6px; }
.panel h3 + .report-basis { margin: -4px 0 6px; }
#report-form .filter-actions { grid-column: 1 / -1; flex-wrap: wrap; }

.stamp-cell { white-space: nowrap; }
.add-col-type { min-width: 200px; }
.add-col-type select { width: 100%; }
.form-grid .chk-with-date .chk-stamp-none {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  white-space: nowrap;
}
.form-grid .chk-with-date .chk-stamp-none[hidden] { display: none !important; }

/* Referral map: custom markers + legend */
.map-div-icon, .map-marker-wrap {
  background: transparent !important;
  border: none !important;
}
.map-marker {
  filter: drop-shadow(0 1px 2px rgba(11, 31, 58, 0.35));
  line-height: 0;
}
.map-marker svg { display: block; }
.map-legend-control {
  margin: 0 0 12px 12px !important;
}
.map-legend {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(11, 31, 58, 0.12);
  min-width: 140px;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  font-weight: 600;
}
.map-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(11, 31, 58, 0.25);
  flex-shrink: 0;
}
.map-legend-swatch.patient {
  background: #0B1F3A;
  border-radius: 50%;
  position: relative;
}
.map-legend-swatch.patient::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  border-top-color: transparent;
  border-left-color: transparent;
  transform: rotate(35deg);
}
.map-legend-swatch.triton { background: #1A5FB4; border-radius: 3px 3px 50% 50%; }
.map-legend-swatch.other { background: #E35D2B; border-radius: 3px 3px 50% 50%; }
.map-legend-swatch.fav { background: #C9A227; border-radius: 3px 3px 50% 50%; }
.map-popup-dist { color: var(--muted); font-size: 12px; margin-top: 2px; }
.office-triton .poi-type { color: #1A5FB4; font-weight: 700; }

/* ---- New MVA report (Reports tab) ---- */
.mva-report { margin: 14px 0 10px; padding: 12px 14px; border: 1px solid var(--line, #d9dee7); border-radius: 10px; background: #fff; }
.mva-title { margin: 0 0 2px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.mva-total { display: inline-block; min-width: 26px; padding: 1px 8px; border-radius: 999px; background: #1a5fb4; color: #fff; font-size: 13px; text-align: center; }
.mva-breakdown { margin-top: 8px; }
.mva-row { display: grid; grid-template-columns: 210px 1fr 36px; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.mva-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mva-track { height: 10px; background: #eef1f6; border-radius: 6px; overflow: hidden; }
.mva-bar { display: block; height: 100%; border-radius: 6px; min-width: 0; }
.mva-bar.month { background: #1a5fb4; }
.mva-bar.office { background: #e35d2b; }
.mva-bar.unknown { background: #9aa3b2; }
.mva-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.mva-matrix { margin-top: 8px; }
.mva-matrix summary { cursor: pointer; font-weight: 600; font-size: 13px; padding: 4px 0; }
.mva-table td.num, .mva-table th { text-align: center; }
.mva-table td:first-child, .mva-table th:first-child { text-align: left; }
.mva-bar[style="width:0%"] { display: none; }
.name-btn .no-name { color: #9aa0a8; font-style: italic; font-weight: 400; }
#f-name::placeholder { color: #a8adb5; }

/* ---- Follow-ups ---- */
.tab-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: #f6c90e; color: #1b1b1b; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; }

.fu-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.fu-ctl.is-busy { opacity: 0.6; pointer-events: none; }
.fu-title { font-weight: 600; color: #0b1f3a; }
.fu-opt { margin: 0; }
.fu-other select { margin-left: 4px; padding: 2px 4px; }
.fu-stamp { color: #1a5fb4; font-size: 12px; }
.fu-stamp.muted { color: #9aa0a8; }
.tx-last { flex-basis: 100%; font-size: 11px; color: #8a8f98; margin-top: 2px; }
.fu-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.fu-head h2 { margin: 0; }
.fu-showdone { margin-left: auto; }
.fu-group { margin: 12px 0 18px; }
.fu-group h3 { margin: 0 0 6px; font-size: 15px; }
.fu-count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 999px; background: #eef1f6; font-size: 12px; text-align: center; }
.fu-overdue h3 { color: #c01c28; }
.fu-overdue .fu-count { background: #c01c28; color: #fff; }
.fu-today h3 { color: #9a6b00; }
.fu-today .fu-count { background: #f6c90e; color: #1b1b1b; }
.fu-row.fu-status-overdue td.fu-due { color: #c01c28; }
.fu-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef1f6; color: #3b4352; }
.fu-chip-overdue { background: #fde3e5; color: #c01c28; }
.fu-chip-today { background: #fff4c2; color: #7a5600; }
.fu-chip-upcoming { background: #e5effb; color: #1a5fb4; }
.fu-chip-done { background: #e6f4ea; color: #1e7a3a; }
.fu-attempts { white-space: nowrap; }
.fu-attempt { display: inline-flex; flex-direction: column; margin-right: 10px; font-size: 12px; vertical-align: top; }
.fu-att-stamp, .fu-done-stamp { font-size: 11px; color: #6b7079; }
.fu-empty { font-size: 13px; padding: 4px 0; }
.fu-done-chk { display: inline-flex; flex-direction: column; font-weight: 600; }
.fu-done h3 { color: #1e7a3a; } .fu-done .fu-count { background: #e6f4ea; color: #1e7a3a; } tr.fu-status-done td { opacity: 0.8; }
/* Follow-up controls in the procedures rows (override the old 2-col "last appointment" grid) */
.treatment-row { grid-template-columns: minmax(170px, 220px) 1fr; align-items: center; }
.treatment-row .fu-ctl { justify-content: flex-start; flex-wrap: wrap; }
.treatment-row .fu-ctl label.chk, .treatment-row .fu-ctl .fu-other { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-weight: 500; font-size: 13px; color: var(--text); letter-spacing: 0; white-space: nowrap; }
.treatment-row .fu-ctl .fu-other select { width: auto; margin: 0; padding: 2px 6px; }
.treatment-row .fu-stamp { white-space: nowrap; }
.treatment-row .tx-last { grid-column: 1 / -1; margin-top: -4px; }
.treatment-row .fu-ctl .fu-doctor { display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 0 0; font-weight: 500; font-size: 13px; color: var(--text); letter-spacing: 0; white-space: nowrap; }
.treatment-row .fu-ctl .fu-doctor select { width: auto; margin: 0; padding: 2px 6px; }
.treatment-row .fu-ctl .fu-office-pick { display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 0 0; font-weight: 500; font-size: 13px; color: var(--text); letter-spacing: 0; white-space: nowrap; }
.treatment-row .fu-ctl .fu-office-pick select { width: auto; margin: 0; padding: 2px 6px; }
.fu-doctor-fixed strong { color: #0b1f3a; }
.chk-with-date .chk-sub-input{display:block;width:100%;max-width:220px;margin:4px 0 2px 24px;padding:3px 6px;font-size:13px}
.chk-with-date .chk-sub-input[hidden]{display:none}
.chk-with-date .chk-sub-input::placeholder{color:#aaa}
.chk-col-cell > .chk-sub-input{display:block;width:100%;max-width:220px;margin:4px 0 2px 24px;padding:3px 6px;font-size:13px}
.chk-col-cell > .chk-sub-input[hidden]{display:none}
.chk-col-cell > .chk-sub-input::placeholder{color:#aaa}
.chk-with-sub{display:flex;flex-direction:column;align-items:flex-start;width:100%}
.chk-with-sub .chk-sub-input{display:block;width:100%;max-width:220px;margin:4px 0 2px 24px;padding:3px 6px;font-size:13px}
.chk-with-sub .chk-sub-input[hidden]{display:none}
.chk-with-sub .chk-sub-input::placeholder{color:#aaa}
.opc-boxes{display:flex;gap:14px;flex-wrap:wrap;padding:4px 0}
.opc-boxes .opc-chk{font-weight:600}
/* Cases sheet name color key — same colors as .name-btn.name-* */
.color-key{display:inline-flex;gap:12px;align-items:center;padding:3px 10px;border:1px solid var(--line,#d9dde3);border-radius:6px;background:#fff;font-size:12px;color:#444;margin-left:8px}
.color-key .ck-item{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.color-key .ck-sw{width:11px;height:11px;border-radius:2px;display:inline-block}
.color-key .ck-dropped{background:#c01c28}
.color-key .ck-paying{background:#1a5fb4}
.color-key .ck-settled{background:#8a8f98;opacity:.6}
/* Case settled: whole Cases row in light faded gray (color only, so the sticky name cell stays opaque).
   Dropped + settled keeps the red name; paying blue only when not settled (see caseNameClass). */
tr.row-settled > td, tr.row-settled > td *:not(.name-dropped):not(.name-redrec):not(.name-paying) { color: #a3a8b0 !important; }
tr.row-settled > td .name-btn.name-dropped { color: #c01c28 !important; }
.ask-below{margin-top:16px}
.ask-below .ask-box{max-width:640px;margin-bottom:10px}
.records-history{flex-basis:100%;width:100%;font-size:10.5px;color:#9aa0a8;margin:2px 0 0 24px;line-height:1.3}
.fu-ctl .fu-rec{margin-left:6px}
.fu-ctl select[data-fu-rec-weeks]{font-size:12px;padding:1px 2px}
.fu-rec-tag{display:inline-block;font-size:10px;font-weight:700;color:#5b3fa0;background:#efe9fb;border:1px solid #d9cdf5;border-radius:999px;padding:0 6px;margin-left:4px;vertical-align:middle}
.fu-ctl .fu-rec.is-disabled{opacity:.45;cursor:not-allowed}
/* Send records: small sub-checkbox inside the Records sent cell */
.send-records-sub{margin:2px 0 0 24px;font-size:12px}
.send-records-sub .field-label-text{font-size:12px;font-weight:600}
.send-records-sub .chk-stamp-date{font-size:12px;padding:1px 4px}

/* Send records + ledger: own full-width line under Records sent, labels never truncated (Oct 12 2026). */
.chk-row[data-field-key="recordsSent"]{flex-wrap:wrap;row-gap:4px}
.chk-row[data-field-key="recordsSent"] .send-records-sub{flex:1 0 100%;min-width:0;margin:0 0 0 30px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px}
.send-records-sub .chk-with-date{flex:0 1 auto;display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
.send-records-sub label.chk,.send-records-sub .field-label-text{white-space:nowrap}
.send-records-sub .ledger-opts{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12px}
.send-records-sub .ledger-opts label.chk{white-space:nowrap;flex:0 0 auto}
.chk-row[data-field-key="recordsSent"] > .chk-with-date{flex:1 1 0;min-width:0}

/* Request records under Hospital; Done stamps (Oct 12 2026). Stacked, labels never truncated. */
.chk-row[data-field-key="hospital"]{flex-wrap:wrap;row-gap:4px}
.chk-row[data-field-key="hospital"] > .chk-with-sub{flex:1 1 0;min-width:0}
.chk-row[data-field-key="hospital"] .hosp-records-sub{flex:1 0 100%;min-width:0;margin:0 0 0 30px;font-size:12px}
.hosp-records-sub .chk-with-date{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
.hosp-records-sub .field-label-text{font-size:12px;font-weight:600;white-space:nowrap}
.hosp-records-sub label.chk{white-space:nowrap}
.hosp-records-sub .chk-stamp-date{font-size:12px;padding:1px 4px}
.done-stamp-line{font-size:11px;color:#8a8f98;margin-top:2px;flex-basis:100%}
.chk-row[data-field-key="hospital"] .hosp-records-sub,.chk-row[data-field-key="recordsSent"] .send-records-sub{flex-basis:calc(100% - 30px);max-width:calc(100% - 30px)}
.done-stamp-line + .records-history{margin-left:12px;width:auto;max-width:calc(100% - 12px)}
.chk-row[data-field-key="recordsSent"] > .chk-with-date,.chk-row[data-field-key="hospital"] > .chk-with-sub{flex:1 1 0 !important;min-width:0}

/* Follow-up comments (Oct 12 2026) */
.fu-comment-cell{min-width:170px;max-width:260px}
.fu-comment-form{display:flex;gap:4px;align-items:center}
.fu-comment-form input{flex:1 1 auto;min-width:0;font-size:12px;padding:2px 6px;height:24px}
.fu-comment-save{font-size:11px;padding:2px 8px;height:24px;flex:0 0 auto;white-space:nowrap}
.fu-comments-line{font-size:11px;color:#8a8f98;line-height:1.35;margin-top:2px;overflow-wrap:anywhere;flex-basis:100%;max-width:100%}
.fu-ctl .fu-comments-line{width:100%}
/* Compact Follow-ups table so the Comment column fits without scrolling (Oct 12 2026). */
table.data.fu-table th, table.data.fu-table td{min-width:0;padding:4px 6px}
table.data.fu-table td.fu-comment-cell{white-space:normal;width:210px;min-width:170px;max-width:240px}
table.data.fu-table .fu-attempt{margin-right:4px;font-size:11px}

/* Emailed attorney attempt (Oct 12 2026): keep attempts compact so the table fits at 1280. */
table.data.fu-table td.fu-attempts{white-space:normal;max-width:300px}
table.data.fu-table .fu-attempt{text-align:center;line-height:1.15;margin:0 2px 2px 0;max-width:72px;white-space:normal}
table.data.fu-table .fu-att-stamp{display:block;font-size:10px;color:#8a8f98;white-space:normal}
table.data.fu-table td.muted{white-space:normal;max-width:120px}
table.data.fu-table td.fu-attempts{max-width:none}
table.data.fu-table .fu-attempt{max-width:64px;font-size:10.5px}
table.data.fu-table td.fu-comment-cell{width:190px;min-width:160px}
table.data.fu-table .fu-attempt{margin-right:8px;max-width:68px}
table.data.fu-table .fu-attempt{margin-right:5px}
table.data.fu-table td.fu-comment-cell{width:175px;min-width:150px}
table.data.fu-table th,table.data.fu-table td{padding:4px 5px}

/* Bulk edit (admin, Oct 13 2026) */
.bulk-bar{background:#f4f7fb;border:1px solid var(--line,#d9dee7);border-radius:8px;padding:6px 10px;margin:6px 0;font-size:12.5px;color:var(--navy,#0f2340)}
.bulk-bar .bulk-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:3px 0}
.bulk-bar label{display:inline-flex;align-items:center;gap:5px;font-size:12px;text-transform:none;letter-spacing:0;margin:0}
.bulk-bar select,.bulk-bar input[type=text]{font-size:12px;padding:3px 6px;height:auto;width:auto;min-width:0;max-width:200px}
.bulk-bar .bulk-title{font-size:13px}
.bulk-bar .bulk-btn{padding:4px 10px;font-size:12px;color:var(--navy,#0f2340);border-color:var(--line,#d9dee7);background:#fff}
.bulk-bar .primary.bulk-btn{color:#fff;background:var(--navy,#0f2340)}
.bulk-bar .bulk-btn[disabled]{opacity:.45;cursor:not-allowed}
.bulk-bar .bulk-msg{color:#2e7d32;font-weight:600}
.bulk-bar .bulk-confirm{margin-top:5px;padding:6px 8px;background:#fff8e1;border:1px solid #f0d27a;border-radius:6px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#cases-table input.bulk-chk{margin:0 4px 0 0;vertical-align:middle;width:13px;height:13px}
/* Bulk edit button + typed value (Oct 13 2026) */
#btn-bulk.bulk-on{background:var(--navy,#0f2340)!important;color:#fff!important}
.bulk-bar #bulk-value{min-width:220px;max-width:260px}
.bulk-bar .bulk-chips{display:inline-flex;gap:4px;flex-wrap:wrap}
.bulk-bar .bulk-chip{font-size:11px;padding:2px 7px;border:1px solid var(--line,#d9dee7);border-radius:10px;background:#fff;color:var(--navy,#0f2340);cursor:pointer}
.bulk-bar .bulk-msg.bulk-err{color:#c62828}
.fu-head .fu-office{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--navy,#0f2340)}
.fu-head .fu-office select{font-size:12px;padding:3px 6px;width:auto}
.name-split{display:flex;gap:6px}
.name-split input{flex:1;min-width:0}
.name-split input::placeholder{color:#9aa1ab}

/* Cases sheet: Excel-style bold grid (Dillon, Oct 16). Borders only — row colors/fade/red/blue untouched. */
#cases-table{border-collapse:separate;border-spacing:0;border-top:2px solid #1f2933;border-left:2px solid #1f2933}
#cases-table th,#cases-table td{border-right:1px solid #3a4250;border-bottom:1px solid #3a4250}
#cases-table th{font-weight:800;border-right:1px solid #0b0f14;border-bottom:3px solid #0b0f14;box-shadow:inset 0 -1px 0 var(--gold)}
#cases-table tbody tr:last-child td{border-bottom:2px solid #1f2933}
#cases-table th:last-child,#cases-table td:last-child{border-right:2px solid #1f2933}
/* Patient seen (beige) / Done treating (light blue) rows; settled fade wins (caseRowClass). Sticky cells get the
   same opaque background so the row color is continuous. Reduction received = green name. */
#cases-table tbody tr.row-seen > td{background:#f3e9d2}
#cases-table tbody tr.row-donetx > td{background:#dcebf9}
#cases-table tbody tr.row-seen:hover > td{background:#ecdfc0}
#cases-table tbody tr.row-donetx:hover > td{background:#cde0f3}
.name-btn.name-redrec{color:#1e7a34;text-decoration-color:#1e7a34}
.name-btn.name-redrec:hover{color:#145a25}
.color-key .ck-redrec{background:#1e7a34}
.color-key .ck-row{border:1px solid #9aa0a8}
.color-key .ck-seen{background:#f3e9d2}
.color-key .ck-donetx{background:#dcebf9}
/* Settled row: light grey background + faded text, but name colors (red/green/blue) stay fully visible. */
#cases-table tbody tr.row-settled > td{background:#eceef1}
#cases-table tbody tr.row-settled:hover > td{background:#e2e5ea}
tr.row-settled > td .name-btn.name-dropped{color:#c01c28 !important;text-decoration-color:#c01c28 !important}
tr.row-settled > td .name-btn.name-redrec{color:#1e7a34 !important;text-decoration-color:#1e7a34 !important}
tr.row-settled > td .name-btn.name-paying{color:#1a5fb4 !important;text-decoration-color:#1a5fb4 !important}
.color-key .ck-settled{background:#eceef1;opacity:1;border:1px solid #9aa0a8}
/* Cases sheet: cells wrap inside their column (Dillon, Oct 16) — no spill into the next cell; rows grow taller. */
#cases-table td{white-space:normal !important;overflow-wrap:anywhere;word-break:break-word;overflow:hidden;text-overflow:clip}
#cases-table td:not(.col-num):not([style*="max-width"]){max-width:240px}
#cases-table td *{white-space:normal;overflow-wrap:anywhere}
#cases-table td .name-btn{display:inline;white-space:normal}
/* Status checkboxes in four bordered groups (Dillon, Oct 16): 2x2, 4 across when wide, 1 column when narrow. */
.chk-cols.chk-groups{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.chk-groups > .chk-group{border:1.5px solid #c9ced6;border-radius:6px;padding:8px 8px;background:#fbfbfc}
.chk-groups > .chk-group.chk-col-drop{border-color:var(--gold)}
@container (min-width: 1000px){.chk-cols.chk-groups{grid-template-columns:repeat(4,minmax(0,1fr))}}
@container (max-width: 380px){.chk-cols.chk-groups{grid-template-columns:minmax(0,1fr)}}
@media (max-width: 700px){.chk-cols.chk-groups{grid-template-columns:minmax(0,1fr)}}
.chk-groups > .chk-group:empty{display:none}
/* Search match: brief highlight of the centered row */
@keyframes rowFlash{0%,40%{box-shadow:inset 0 0 0 3px #d4a017}100%{box-shadow:inset 0 0 0 3px transparent}}
#cases-table tbody tr.row-flash > td{animation:rowFlash 1.6s ease-out}

/* Multi-tenant orgs (Oct 22 2026) */
.org-pill{background:#eef2ff;color:#3730a3;border-radius:999px;padding:2px 10px;font-weight:600}
.org-switch{display:inline-flex;gap:6px;align-items:center;font-weight:600}
.org-switch select{padding:3px 6px}
.org-banner{padding:8px 14px;font-weight:700;text-align:center}
.org-banner.demo{background:#fef3c7;color:#92400e;border-bottom:2px solid #f59e0b}
.org-banner.off{background:#fee2e2;color:#991b1b;border-bottom:2px solid #ef4444}
.orgs-page{padding:16px;max-width:1100px}
.org-create{display:flex;gap:8px;align-items:center;margin-bottom:16px;flex-wrap:wrap}
.org-card{border:1px solid #cbd5e1;border-radius:8px;padding:12px;margin-bottom:12px;background:#fff}
.org-card-head{display:flex;gap:10px;align-items:center;margin-bottom:8px}
.org-card-row{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-bottom:8px}
.org-current{background:#dcfce7;color:#166534;border-radius:4px;padding:1px 8px;font-size:12px}
.org-tag{border-radius:4px;padding:1px 8px;font-size:12px;font-weight:700}
.org-tag.demo{background:#fef3c7;color:#92400e}.org-tag.live{background:#dcfce7;color:#166534}.org-tag.off{background:#fee2e2;color:#991b1b}
.baa-no{color:#92400e}.baa-ok{color:#166534}
.org-users{border-collapse:collapse;margin:6px 0;font-size:13px}.org-users td,.org-users th{border:1px solid #e2e8f0;padding:3px 8px;text-align:left}
.org-add-user{display:flex;gap:6px;flex-wrap:wrap}
.orgs-page input,.orgs-page select{width:auto !important;display:inline-block !important;margin:0 !important;padding:5px 8px}
.orgs-page label{display:inline-flex !important;gap:6px;align-items:center;margin:0 !important;font-size:13px;color:#1e293b}
.orgs-page input[type=checkbox]{width:16px !important;height:16px}
.orgs-page button{width:auto !important;display:inline-block !important}
.orgs-page button.ghost{color:#1e293b !important;background:#fff !important;border:1px solid #94a3b8 !important;padding:4px 10px;font-size:13px;min-height:0}
.org-add-user{margin-top:6px}
.org-switch{color:#e2e8f0;font-size:13px}

/* Per-org practice settings (Oct 22 2026) */
.practice-settings{margin:12px 16px;padding:12px 16px}
.practice-settings h3{margin:0 0 8px}
.practice-settings .ps-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin:6px 0}
.practice-settings label{display:inline-flex !important;flex-direction:column;gap:2px;font-size:12px;margin:0 !important}
.practice-settings input{width:auto !important;display:inline-block !important;margin:0 !important;padding:5px 8px;min-width:220px}
.practice-settings button{width:auto !important;display:inline-block !important}
.practice-settings button.ghost{color:#1e293b !important;background:#fff !important;border:1px solid #94a3b8 !important;padding:4px 10px;font-size:13px}
.ps-office{display:flex;gap:10px;align-items:center;margin:4px 0}
.office-prompt-inline{background:#fef3c7;color:#92400e;padding:8px 10px;border-radius:6px;font-weight:600;margin:4px 0}
.office-prompt a{color:#92400e;text-decoration:underline}

/* Referral-map favorite categories (Oct 22 2026) */
.fav-group{margin:6px 0 10px}
.fav-group-head{display:flex;align-items:center;gap:6px;padding:4px 0;border-bottom:1px solid #e2e8f0;margin-bottom:4px}
.fav-row-main{flex:1;min-width:0}
.fav-cat-edit{display:flex !important;align-items:center;gap:6px;margin-top:3px}
.fav-cat-edit select{width:auto !important;padding:2px 4px;font-size:12px}
.fav-filter{display:flex !important;align-items:center;gap:6px;margin-bottom:6px}
.fav-filter select{width:auto !important}
.map-legend-sub{font-weight:700;margin-top:4px;border-top:1px solid #e2e8f0;padding-top:4px}
.map-legend .map-legend-item svg{vertical-align:middle;margin-right:4px}
.map-marker-favcat svg{filter:drop-shadow(0 1px 2px rgba(0,0,0,.35))}
.fav-cat-admin{margin-top:8px;font-size:13px}
.fav-cat-add{display:flex;gap:6px;margin-top:4px}.fav-cat-add input{width:auto !important;flex:1}
.fav-cat-add button{width:auto !important}
.fav-cat-edit{flex-wrap:wrap}.fav-guess{font-size:11px;flex-basis:100%}

/* Imaging logins sheet (Oct 22 2026) */
.img-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.img-save-status{font-size:13px;color:#15803d;white-space:nowrap;min-width:140px;text-align:right}
.img-save-status.bad{color:#b91c1c}
table.img-sheet{table-layout:fixed;width:100%;border-collapse:collapse}
table.img-sheet th{text-align:left;position:sticky;top:0;z-index:1}
table.img-sheet td{padding:2px 4px;vertical-align:top;border-bottom:1px solid #e2e8f0}
table.img-sheet tbody tr:nth-child(even):not(.img-new-row){background:#f8fafc}
.img-cell{width:100% !important;border:1px solid transparent !important;background:transparent !important;padding:7px 8px !important;border-radius:6px;font-size:14px;box-shadow:none !important;resize:none;font-family:inherit;line-height:1.35}
.img-cell:hover{border-color:#cbd5e1 !important}
.img-cell:focus{border-color:#2563eb !important;background:#fff !important;outline:none}
.img-fac{font-weight:700}
.img-pw{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace !important}
.img-web{display:flex;align-items:center;gap:4px}
.img-open{white-space:nowrap;font-size:12px;font-weight:600;padding:4px 6px;border-radius:6px;background:#eff6ff;color:#1d4ed8;text-decoration:none}
.img-remove{padding:5px 10px !important;color:#b91c1c !important;border-color:#fecaca !important;background:#fff !important;width:auto !important;margin-top:3px}
.img-new-row td{background:#fffbeb;border-top:2px solid #e2e8f0}
.img-new-row .img-cell{border-color:#e2e8f0 !important;background:#fff !important}
.img-new-row button{margin-top:3px;width:auto !important}

/* map category search (Oct 22 2026) */
.map-cat-search{width:100%;margin-bottom:8px}
.fav-hit{display:flex;align-items:center;gap:8px}
