/* Lotenex visual theme. Existing layout, data and interaction owners stay intact. */
:root {
  --ink: #25282d;
  --green: #89603d;
  --lime: #e8dccb;
  --paper: #f5f2ee;
  --line: #ded8d1;
  --muted: #68635e;
  --white: #fffdfa;
  --amber: #805a32;
  --bronze: #89603d;
  --bronze-hover: #775133;
  --bronze-soft: #eee4d7;
  --surface: #fffdfa;
  --surface-hover: #f2ece4;
  --graphite: #282a2d;
  --focus: #9b7049;
  --lift: 0 3px 10px rgb(56 43 29 / 9%);
  font-family: "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}

body { background: var(--paper); }
button, input, select, textarea, .button-link {
  border-color: var(--line);
  border-radius: 9px;
  background-color: var(--surface);
  transition: background-color 170ms ease, border-color 170ms ease,
    box-shadow 170ms ease, color 170ms ease;
}
button, select, summary, .button-link, a, input[type="checkbox"], input[type="file"] { cursor: pointer; }
button, .button-link { font-weight: 500; }
button:hover:not(:disabled), .button-link:hover {
  background-color: var(--surface-hover);
  border-color: #bca88f;
  box-shadow: var(--lift);
}
button:active:not(:disabled), .button-link:active { box-shadow: inset 0 1px 3px rgb(56 43 29 / 13%); }
button.active, button.primary, .primary {
  background-color: var(--bronze);
  color: #fffdfa;
  border-color: var(--bronze);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
}
button.active:hover:not(:disabled), button.primary:hover:not(:disabled) {
  background-color: var(--bronze-hover);
  border-color: var(--bronze-hover);
  color: #fffdfa;
  box-shadow: 0 3px 11px rgb(96 63 35 / 17%);
}
button:disabled {
  background: #f7f4f0;
  color: #a6a099;
  border-color: #e5ded7;
  cursor: not-allowed;
  box-shadow: none;
  opacity: .72;
}
:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgb(155 112 73 / 12%);
}
input, select, textarea { padding: 11px 13px; }
input::placeholder, textarea::placeholder { color: #817b74; opacity: 1; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: #bca88f;
  background-color: #fffefa;
  box-shadow: 0 2px 7px rgb(56 43 29 / 6%);
}
input:focus, select:focus, textarea:focus, .compact-note:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgb(137 96 61 / 10%);
}
input[type="checkbox"] { accent-color: var(--bronze); }
a { text-underline-offset: 3px; transition: color 170ms ease, background-color 170ms ease, box-shadow 170ms ease; }
a:hover { color: var(--bronze-hover); }
h1, h2, h3 { color: var(--ink); font-family: inherit; }
h1 { font-size: 36px; font-weight: 720; letter-spacing: -1.25px; line-height: 1.2; }
h2 { font-weight: 650; letter-spacing: -.65px; }
h3 { font-weight: 650; letter-spacing: -.2px; }

/* Same sidebar navigation and page structure, with the reference's wordmark and rhythm. */
.app-shell { grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  background: var(--graphite);
  color: #f8f6f2;
  padding: 32px 16px 26px;
  gap: 29px;
  border-right: 1px solid #37383a;
  scrollbar-color: #5b5751 transparent;
}
.brand { display: block; font-family: inherit; padding: 4px 12px 2px; line-height: 1; }
.brand-wordmark { font-size: 46px; font-weight: 650; letter-spacing: -2.8px; color: #faf9f6; }
.sidebar > div:nth-child(2) { padding: 0 12px; }
.sidebar .eyebrow { font-size: 12px; line-height: 1.5; letter-spacing: 1.5px; color: #f2f0ec; }
.sidebar small { color: #c7c3bd; display: block; margin-top: 8px; line-height: 1.5; font-size: 13px; }
.sidebar nav { gap: 9px; }
.sidebar nav button {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 51px;
  padding: 12px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #eeece8;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 450;
}
.sidebar .nav-icon { width: 21px; height: 21px; flex: 0 0 21px; stroke-width: 1.7; }
.sidebar .nav-label { min-width: 0; }
.sidebar nav button:hover:not(.active) {
  background: #353639;
  border-color: #575149;
  color: #fff;
  box-shadow: 0 3px 9px rgb(0 0 0 / 12%);
}
.sidebar nav button.active {
  background: #987048;
  border-color: #a47d54;
  color: #fffdf9;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 10%);
}
.sidebar nav button.active:hover { background: #a17a52; border-color: #b38c63; box-shadow: 0 3px 11px rgb(0 0 0 / 15%); }
.sidebar :where(button, a):focus-visible { outline-color: #e1bd91; box-shadow: 0 0 0 4px rgb(225 189 145 / 15%); }
.sidebar .badge { margin-left: auto; float: none; color: #f5f2ec; background: #4d4b48; font-size: 12px; padding: 3px 6px; }
.sidebar button.active .badge { background: rgb(64 41 22 / 17%); color: #fff; }
.sidebar .foot { padding: 0 11px; font-size: 12px; }
.sidebar .foot b { color: #f1efeb; font-size: 13px; line-height: 1.6; }
.sidebar .foot b::after { content: ""; display: block; width: 44px; height: 2px; background: #b58c5c; margin: 16px 0; }
.sidebar .foot p { color: #bbb6ae; }
.sidebar .foot button { color: #e6dfd5; border-color: #686158; border-radius: 7px; }
.sidebar .foot button:hover { background: #3a3733; border-color: #b29877; box-shadow: 0 2px 8px rgb(0 0 0 / 12%); }

.workspace { padding: 31px 32px 48px; }
.page-top { gap: 20px; margin-bottom: 28px; }
.page-top > div:first-child { flex: 1; min-width: 280px; }
.breadcrumb { color: #5f5c59; font-size: 12px; letter-spacing: .2px; margin-bottom: 14px; }
.page-top p { color: #605d59; font-size: 14px; line-height: 1.65; }
.add-record-button { padding: 12px 17px; font-size: 15px; border-radius: 9px; }
.date-pill { border-left: 1px solid #d2c9be; padding-left: 22px; font-size: 11px; color: #595651; }
.date-pill b { color: var(--ink); margin: 6px 0; font-size: 13px; }
.badge { background: #eee9e1; color: #5f5548; font-weight: 550; }
.badge.green { background: #e9dfcd; color: #655038; }
.badge.amber { background: #f1e5d4; color: #77542d; }
.metrics { background: var(--surface); border-color: var(--line); border-radius: 11px; box-shadow: 0 1px 2px rgb(45 35 25 / 2%); }
.metrics strong { color: var(--ink); font-weight: 600; }
.metrics span { color: var(--muted); }

/* Selected tabs stay bronze; hovering an unselected tab stays pale. */
.channels { gap: 5px; padding-bottom: 12px; border-bottom-color: #d6cec5; }
.channels button { color: var(--ink); border: 1px solid transparent; border-radius: 8px; padding: 10px 11px; font-size: 13px; font-weight: 500; }
.channels button:not(.active):hover { background: #eae3da; border-color: #d5c7b7; box-shadow: 0 2px 6px rgb(56 43 29 / 6%); }
.channels button.active { color: #fff; background: var(--bronze); border-color: var(--bronze); }
.channels button small { opacity: .88; font-weight: 400; }
.filter-panel { background: #fcfaf7; padding: 17px; border-color: var(--line); border-radius: 12px; margin: 19px 0 24px; }
.search-row { gap: 13px; }
.search-row input, .search-row select, .search-row > button { min-height: 44px; font-size: 14px; }
/* Long source location descriptions must not widen the district menu. */
@supports (appearance: base-select) {
  #district, #district::picker(select) { appearance: base-select; }
  #district {
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #district::picker-icon { flex-shrink: 0; color: var(--bronze); }
  #district::picker(select) {
    inset: auto;
    top: anchor(bottom);
    left: anchor(left);
    width: anchor-size(width);
    min-width: 0;
    max-width: calc(100vw - 32px);
    max-height: min(320px, 50dvh);
    margin: 6px 0;
    padding: 5px;
    overflow-y: auto;
    overscroll-behavior: contain;
    position-try-fallbacks: flip-block;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 24px rgb(56 43 29 / 14%);
    font: 14px/1.45 "Segoe UI", Arial, sans-serif;
  }
  #district option {
    padding: 9px 10px;
    border-radius: 5px;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
  }
  #district option:checked { background: var(--bronze-soft); color: #69472c; font-weight: 600; }
  #district option:hover { background: var(--surface-hover); }
  #district option:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  #district option::checkmark { color: var(--bronze); flex-shrink: 0; }
}
.search-label input { padding-left: 43px; }
.search-label::before {
  content: "";
  width: 20px; height: 20px; left: 14px; top: 12px;
  background: #454546;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='7.2'/%3E%3Cpath d='m16 16 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.advanced { padding-top: 20px; margin-top: 20px; gap: 15px; }
.checkrow label { padding: 4px 5px; border-radius: 5px; cursor: pointer; transition: background-color 170ms, box-shadow 170ms; }
.checkrow label:hover { background: #eee5d9; box-shadow: 0 1px 5px rgb(56 43 29 / 5%); }
.checkrow label:has(input:checked) { color: #714e30; }
.resultbar { font-size: 14px; margin: 22px 0 15px; gap: 16px; }
.resultbar strong { font-size: 17px; font-weight: 650; }
.resultbar .tools { gap: 10px; }
.resultbar select { width: 190px; }
.view-switch { border-radius: 8px; }
.view-switch button { padding: 9px 11px; }
.view-switch button + button { margin-left: -1px; }
.view-switch button.active { position: relative; z-index: 1; }
.view-switch button:focus-visible { z-index: 2; }
.context-note { color: #716961; font-size: 12px; line-height: 1.65; }
.filter-counter { background: #ebe4da; color: #665747; }
.pagination { gap: 23px; margin: 28px 0; color: #504b46; }
.pagination button { padding: 10px 15px; }

/* Existing card, table, profile and workspace surfaces share one material palette. */
.property-card, .table-wrap, .section-panel, .map-panel, .task-group, .task-card,
.detail-header, .detail-columns > div, .detail-section, .detail-data > div,
.empty, .button-link { background: var(--surface); border-color: var(--line); }
.property-card { transition: border-color 170ms, box-shadow 170ms; }
.property-card:hover { transform: none; border-color: #c4b299; box-shadow: 0 5px 17px rgb(59 44 29 / 8%); }
.card-title { color: var(--ink); font-weight: 650; }
.card-title:hover, td button:hover, .record-link:hover { color: var(--bronze-hover); }
.card-title:hover { box-shadow: none; text-decoration: underline; text-decoration-color: #c7af90; text-underline-offset: 4px; }
.card-numbers { border-color: #e9e2d9; }
.card-reason { border-left-color: #b79770; color: #62574b; }
.table-wrap { border-radius: 12px; }
table { font-size: 13px; line-height: 1.55; }
th, td { padding: 16px 16px; border-bottom-color: #e7e0d7; }
th { background: #eae5df; color: #292b2f; font-weight: 650; }
tbody tr { transition: background-color 170ms; }
tbody tr:hover { background: #f4eee6; }
tbody tr:last-child td { border-bottom: 0; }
td button { border-radius: 4px; line-height: 1.5; transition: color 170ms, box-shadow 170ms; }
td button:hover { box-shadow: 0 2px 6px rgb(56 43 29 / 9%); }
td button[data-save] { color: var(--bronze); }
td small { color: #716a62; font-size: 11px; }
#results td:nth-child(4), #results td:nth-child(5) { font-weight: 600; }
#results td small { font-weight: 400; }
.map-canvas, .detail-map { background: #eae6dd; }
.map-toolbar { border-bottom: 1px solid #eee8e0; }
.leaflet-container { font-family: inherit; background: #eae6dd; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--ink); }
.leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--bronze-soft); }
.dot { background: #966b45; }
.dot.blue { background: #677e87; }
.dot.orange { background: #ab7a3e; }
.dot.purple { background: #83738b; }
.empty { border-style: dashed; border-color: #cfbfaa; }
.roadmap > div, .coverage-gap-grid article { background: #f7f3ed; border-color: #e0d7cb; }
.dialog { border: 1px solid #d8cfc2; box-shadow: 0 24px 95px rgb(35 32 28 / 27%); }
.dialog::backdrop, .new-record-dialog::backdrop { background: rgb(33 34 36 / 57%); backdrop-filter: blur(3px); }
.detail-header h2 { font-weight: 650; letter-spacing: -.65px; }
.detail-tabs { gap: 6px; background: var(--paper); padding-top: 14px; }
.detail-tabs button { color: #625c54; }
.detail-tabs button.active { color: #714b2b; background: #eadecd; box-shadow: inset 0 -3px var(--bronze); }
.detail-tabs button:not(.active):hover { color: var(--ink); background: #eee7dc; box-shadow: inset 0 -2px #cdb797; }
.detail-tabs button.active:hover { color: #714b2b; background: #e2d3bc; box-shadow: inset 0 -3px var(--bronze); }
.detail-tabs button:focus-visible { outline-offset: -3px; }
.thesis-box { background: #343331; color: #f5f0e8; }
.thesis-box h3 { color: #fffdfa; font-family: inherit; font-size: 24px; font-weight: 600; letter-spacing: -.5px; }
.thesis-box .eyebrow { color: #d7b58c; }
.notice { background: #f2e7d7; color: #705332; border: 1px solid #e7d7bf; }
.coordbox, .scenario-results div { background: #ebe2d5; }
.benefit-panel { background: #f1e9dc; border-color: #d5c3a9; color: #4b3b2a; }
.benefit-panel h3 { color: #483526; }
.benefit-mini { border-top-color: #e1d6c7; }
.benefit-mini > b { color: #6f4e2d; }
.benefit-mini small { color: #796348; }
.next-check { border-left-color: #a67a48; background: #fffdfa; }
.sale-method { background: #eee6da; border-color: #d8c9b5; }
.rank-card { background: #f1ebe2; }
.rank-caution { color: #7b5c37; }
summary { border-radius: 6px; transition: background-color 170ms, box-shadow 170ms; }
summary:hover { background: rgb(137 96 61 / 7%); box-shadow: 0 2px 7px rgb(56 43 29 / 5%); }
.saved-note { background: #f3eee6; border-left-color: #b69265; }
.followup-section input[type="file"] { background: #f7f3ed; border-color: #cbb99f; }
.followup-section input[type="file"]::file-selector-button { background: var(--surface); border-color: #d3c3ae; color: var(--ink); transition: background-color 170ms, box-shadow 170ms; }
.followup-section input[type="file"]::file-selector-button:hover { background: var(--bronze-soft); box-shadow: var(--lift); }
.task-group[data-task-group="today"] > summary { background: #eee5d7; color: #6e4e30; }
.task-group[data-task-group="overdue"] > summary { background: #f5e8e3; }
.task-group > summary:hover { box-shadow: inset 0 0 0 1px #bda98c; }
.checklist label:has(input:checked) { color: #765632; }
.record-link { color: var(--bronze); }
.toast, .compare-dock { background: #303133; box-shadow: 0 6px 24px rgb(35 32 28 / 20%); }
.compare-dock button { background: #f3eee6; color: #4e3a27; border-color: #d1b894; }
.compare-dock button:hover { background: #e9dac5; }
.raw-evidence { background: #f7f3ed; color: #574e44; border-radius: 6px; padding: 12px; }
.source-directory article { border-color: var(--line); }

@media (min-width: 1600px) {
  .app-shell { grid-template-columns: 260px minmax(0, 1fr); }
  .sidebar { padding: 38px 15px 23px; gap: 28px; }
  .brand-wordmark { font-size: 51px; }
  .sidebar nav { margin-top: 8px; }
  .sidebar nav button { font-size: 20px; padding: 13px 17px; gap: 17px; }
  .sidebar small { font-size: 15px; }
  .sidebar .eyebrow { font-size: 13px; }
  .sidebar .foot b::after { margin: 12px 0; }
  .sidebar .foot p { margin-bottom: 10px; }
  .sidebar .foot button { padding-block: 8px; }
  .workspace { padding: 44px 36px 48px; }
  h1 { font-size: 44px; }
  .page-top { margin-bottom: 34px; padding-inline: 8px; }
  .page-top p { font-size: 16px; }
  .breadcrumb { font-size: 14px; margin-bottom: 16px; }
  .add-record-button { font-size: 18px; padding: 13px 18px; }
  .date-pill { font-size: 12px; padding-left: 27px; }
  .date-pill b { font-size: 15px; }
  .channels button { font-size: 16px; padding: 11px 12px; }
  .filter-panel { padding: 20px 18px; margin-bottom: 30px; }
  .search-row input, .search-row select, .search-row > button { font-size: 18px; min-height: 52px; }
  .search-label::before { top: 16px; }
  .resultbar { font-size: 16px; }
  .resultbar > div:first-child { font-size: 20px; font-weight: 600; }
  .resultbar strong { font-size: 22px; }
  .resultbar select { width: 225px; font-size: 15px; }
  .view-switch button, .resultbar .tools > button { font-size: 15px; }
  .context-note { font-size: 15px; margin-bottom: 24px; }
  table { font-size: 17px; }
  td small { font-size: 14px; }
  .pagination { font-size: 16px; margin-top: 32px; }
}
@media (max-width: 1150px) and (min-width: 851px) {
  .app-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding: 25px 11px; gap: 24px; }
  .brand { padding-left: 8px; }
  .brand-wordmark { font-size: 39px; }
  .sidebar nav button { font-size: 13px; gap: 10px; padding: 11px 9px; }
  .workspace { padding: 25px 20px 45px; }
  h1 { font-size: 30px; }
  .page-top > div:first-child { min-width: 230px; }
}
@media (max-width: 850px) {
  .app-shell { display: block; }
  .sidebar { height: auto; position: static; padding: 18px 18px 14px; gap: 16px; }
  .brand { padding: 0; }
  .brand-wordmark { font-size: 35px; letter-spacing: -1.9px; }
  .sidebar > div:nth-child(2) { padding: 0; }
  .sidebar .eyebrow { font-size: 10px; }
  .sidebar small { font-size: 12px; margin-top: 4px; }
  .sidebar nav { gap: 5px; }
  .sidebar nav button { min-height: 39px; padding: 8px 10px; gap: 7px; font-size: 12px; flex-shrink: 0; }
  .sidebar .nav-icon { width: 17px; height: 17px; flex-basis: 17px; }
  .sidebar nav .badge { margin-left: 3px; font-size: 10px; }
  .workspace { padding: 23px 18px 70px; }
  .page-top { gap: 14px; margin-bottom: 23px; }
  .page-top h1 { font-size: 29px; letter-spacing: -.9px; }
  .page-top > div:first-child { min-width: 0; }
  .breadcrumb { font-size: 10px; margin-bottom: 11px; }
  .page-top p { font-size: 13px; }
  .add-record-button { font-size: 13px; padding: 10px 13px; }
  .filter-panel { padding: 13px; }
}
@media (max-width: 560px) {
  .workspace { padding-inline: 14px; }
  .page-top > div:first-child { flex: 0 0 100%; width: 100%; }
  .page-top h1 { font-size: 27px; }
  .channels { gap: 4px; }
  .channels button { font-size: 12px; padding: 9px 10px; }
  .search-row { gap: 10px; }
  .search-row input, .search-row select, .search-row > button { font-size: 13px; }
  .resultbar .tools { gap: 6px; }
  .resultbar select { width: 145px; font-size: 11px; }
  .view-switch button { padding: 8px 7px; font-size: 11px; }
  .resultbar .tools > button { padding: 8px 9px; font-size: 11px; }
  .pagination { gap: 12px; font-size: 12px; }
  .pagination button { padding: 9px 11px; }
  th, td { padding: 14px 12px; }
  .coverage-metrics strong { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
}
