/* Fonts kept with the app so every computer shows the same letters and even-height numbers.
   Source Sans 3 is the app font; Roboto is kept as a report font choice. Both free (SIL Open Font License / Apache). */
@font-face { font-family: "Source Sans 3"; src: url(/fonts/source-sans-3.woff2) format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url(/fonts/source-sans-3-italic.woff2) format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: Roboto; src: url(/fonts/roboto.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: Roboto; src: url(/fonts/roboto-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
/* MEPS app styles. Started from the approved home-workspace prototype. */
/* Layout: a dense work screen. Home header, tabs, then entry panel (left) beside the running selections list (right). */
:root {
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --surface-2: #E6EBF1;
  --line: #D0D8E2;
  --fg: #17202B;
  --muted: #5A6676;
  --brand: #559CBE;         /* the LET logo blue, for stripes and the selected tab */
  --accent: #559CBE;        /* the LET logo blue: links, outlines, the selected row */
  --accent-fg: #0B1A24;
  --btn-gray: #DDE3EA;
  --btn-gray-line: #C3CCD7;
  --btn: #8FCDDE;           /* a lighter LET logo blue, for the main buttons */
  --sel: #DDEBF3;
  --sel-line: #8DBBD3;
  --focus: #3A87AD;
  --ok: #2A7A4B;
  --ok-weak: #DDF1E4;
  --warn-weak: #FBEFD5;
  --warn: #8A5A00;
  --danger: #B3261E;
  --font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-head: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --font-data: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151B; --surface: #19202A; --surface-2: #212A36; --line: #2E3947;
    --fg: #E5EAF1; --muted: #98A4B5; --brand: #559CBE; --accent: #559CBE; --accent-fg: #0B1526; --btn-gray: #2A3442; --btn-gray-line: #3A4656; --btn: #8FCDDE;
    --sel: #19303D; --sel-line: #3D6E88; --focus: #7DB8D6; --ok: #63C28A; --ok-weak: #18301F;
    --warn-weak: #33280F; --warn: #E8B865; --danger: #F08C82; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151B; --surface: #19202A; --surface-2: #212A36; --line: #2E3947;
  --fg: #E5EAF1; --muted: #98A4B5; --brand: #559CBE; --accent: #559CBE; --accent-fg: #0B1526; --btn-gray: #2A3442; --btn-gray-line: #3A4656; --btn: #8FCDDE;
  --sel: #19303D; --sel-line: #3D6E88; --focus: #7DB8D6; --ok: #63C28A; --ok-weak: #18301F;
  --warn-weak: #33280F; --warn: #E8B865; --danger: #F08C82; color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px;
  font-variant-numeric: lining-nums;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 14px 24px;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.mono, td.num, .num { font-family: var(--font-data); font-variant-numeric: lining-nums tabular-nums; }

.proto { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; color: var(--warn);
  background: var(--warn-weak); border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px; margin-bottom: 12px; }
.proto b { font-weight: 600; }
.keys { color: var(--muted); }
kbd { font-family: var(--font-data); font-size: 13px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 4px; background: var(--surface); color: var(--fg); }

/* Home header */
.home { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: start; }
.home h1 { font-family: var(--font-head); font-weight: 600; font-size: 24px; margin: 0; line-height: 1.15; text-wrap: balance; }
.home .sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
header.home h1 .b-edit-home { font-size: 14px; padding: 3px 12px; margin-left: 6px; vertical-align: middle; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: flex-end; }
.fact { display: grid; gap: 1px; }
.fact span { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fact strong { font-weight: 500; }
.badge { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 99px; font-weight: 500; vertical-align: 2px; margin-left: 6px; }
.badge.open { background: var(--ok-weak); color: var(--ok); }

/* Tabs */
.tabs { display: flex; gap: 2px; margin-top: 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { border: 1px solid transparent; border-bottom: 0; background: none; padding: 8px 16px; cursor: pointer; color: var(--muted);
  border-radius: 6px 6px 0 0; white-space: nowrap; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--surface); color: var(--fg); border-color: var(--line); margin-bottom: -1px; }
.tab:hover { color: var(--fg); }
.panel-tab { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; padding: 14px; }

/* Selections workspace */
.work { display: grid; grid-template-columns: minmax(300px, 340px) minmax(0, 1fr); gap: 14px; }
.entry { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: grid; gap: 9px; align-content: start; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.entry-head h2 { font-family: var(--font-head); font-size: 17px; margin: 0; font-weight: 600; }
.mode { font-size: 14px; color: var(--muted); }
.mode.dirty { color: var(--warn); font-weight: 500; }
.row { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 8px; }
.row label { color: var(--muted); font-size: 15px; }
.row2 { display: grid; grid-template-columns: 92px 70px auto 1fr; align-items: center; gap: 8px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; min-width: 0; }
textarea { resize: vertical; min-height: 44px; }
input[readonly] { background: transparent; border-style: dashed; }
.check { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.combo { position: relative; }
.combo ul { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.combo li { padding: 5px 9px; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.combo li small { color: var(--muted); font-family: var(--font-data); font-size: 13px; }
.combo li .c { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin-top: -2px; }
.combo li.hi { background: var(--sel); }
.disc { font-size: 14px; line-height: 1.45; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; min-height: 40px; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 2px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 6px; padding: 7px 10px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #0B1A24; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.gray { background: var(--btn-gray); border-color: var(--btn-gray-line); }
.btn.gray:hover { border-color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn.wide { grid-column: 1 / -1; }
.btn small { font-weight: 400; opacity: .75; font-size: 13px; margin-left: 4px; }

.list { display: grid; gap: 8px; min-width: 0; align-content: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.homes > .toolbar:first-child { padding-bottom: 12px; }
.section-head { margin-bottom: 14px; }
.find h1 { margin-bottom: 8px !important; }
.toolbar input { width: 220px; max-width: 100%; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 3px 11px; cursor: pointer; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.counts { display: flex; gap: 16px; margin-left: auto; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.counts b { color: var(--fg); font-family: var(--font-data); font-weight: 500; }
.gridwrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; background: var(--surface); }
.gridwrap:focus-visible { outline-offset: -2px; }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 15px; }
th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 14px; color: var(--muted);
  padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
td { padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.name { white-space: normal; min-width: 220px; }
td.num, th.num { text-align: right; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-2); }
tbody tr.sel td { background: var(--sel); }
tbody tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.grp td { background: var(--bg); font-family: var(--font-head); font-weight: 600; font-size: 14px; letter-spacing: .03em; color: var(--muted); cursor: default; padding: 4px 8px; }
tr.grp:hover td { background: var(--bg); }
.zero { color: var(--muted); }
.yes { color: var(--ok); font-weight: 500; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; }
.foot .total { font-family: var(--font-head); font-size: 24px; font-weight: 600; }
.foot .total span { font-family: var(--font-data); font-variant-numeric: lining-nums tabular-nums; }
.foot .cos { font-size: 14px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.empty { padding: 26px; text-align: center; color: var(--muted); }

.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 22px; max-width: 900px; }
.formgrid .row { grid-template-columns: 110px minmax(0, 1fr); }
.note { color: var(--muted); font-size: 15px; margin: 0 0 12px; max-width: 70ch; }

.toast { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 6px; font-weight: 500; z-index: 50; }

@media (max-width: 900px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .home { grid-template-columns: minmax(0, 1fr); }
  .facts { justify-content: flex-start; }
  .counts { margin-left: 0; }
  .gridwrap { max-height: none; }
}
@media (prefers-reduced-motion: no-preference) {
  tbody tr td { transition: background-color .08s; }
}

/* App bar */
.appbar { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.appbar .brand { font-family: var(--font-head); font-weight: 600; font-size: 18px; letter-spacing: .02em; color: var(--fg); text-decoration: none; }
.appbar .keys { margin-left: auto; font-size: 14px; }
.sample { font-size: 13px; padding: 1px 8px; border-radius: 99px; background: var(--warn-weak); color: var(--warn); font-weight: 500; }
.badge.closed { background: var(--surface-2); color: var(--muted); }

/* Homes list */
.homes { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; }
.homes h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; margin: 0; }
.homes:not(.lists-page) > .gridwrap table { font-size: 16px; }
#homes-wrap { justify-self: stretch; }
#homes-wrap table { width: 100%; min-width: 0; }
#homes-wrap td, #homes-wrap th { padding-right: 16px; }
#homes-wrap td.wrap { white-space: normal; min-width: 120px; }
.homes-head { display: grid; gap: 14px; padding-bottom: 6px; }
.homes-head .toolbar { padding: 0 2px; }
#homes-grid td b { font-size: 17px; }
.homes .gridwrap { max-height: none; }
.homes table { min-width: 720px; }

/* Selections additions */
tbody tr.locked td { color: var(--muted); }
.lock { font-size: 13px; color: var(--muted); margin-left: 4px; }
.mode.locked { color: var(--muted); font-weight: 500; }
.mode.saving { color: var(--focus); }
input[readonly].plain { border-color: transparent; }
.hint { font-size: 13px; color: var(--muted); }
.cos .co { display: inline-flex; gap: 6px; align-items: baseline; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--focus); cursor: pointer; font-size: 14px; text-decoration: underline; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.form-actions .btn { min-width: 120px; }
.error-page { padding: 30px; text-align: center; color: var(--muted); }
fieldset { border: 0; padding: 0; margin: 0; display: contents; }
input:disabled, textarea:disabled, select:disabled { opacity: .7; cursor: not-allowed; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Start page */
.start { display: grid; gap: 16px; }
.find { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 8px; }
.find h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; margin: 0; }
.find input { font-size: 17px; padding: 9px 11px; max-width: 640px; }
.find .combo { max-width: 640px; flex: 1; }
.find-row { display: flex; gap: 10px; align-items: center; max-width: 820px; }
.find-row .btn { text-decoration: none; white-space: nowrap; }
.find .hint a { color: var(--focus); }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.area { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; border-top: 3px solid var(--brand); }
.area h2 { font-family: var(--font-head); font-size: 21px; font-weight: 600; margin: 0; }
.area h2 + ul { margin-top: 10px; }
.area p { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.area ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.area li { display: grid; gap: 1px; }
.area .go { font-weight: 500; color: var(--fg); text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; }
.area a.go:hover { border-color: var(--accent); }
.area .go.soon { color: var(--muted); background: transparent; border-style: dashed; }
.area .go em { font-style: normal; font-size: 13px; font-weight: 400; }
.area small { color: var(--muted); font-size: 13px; padding-left: 10px; }

/* Top tabs */
.appbar { align-items: flex-end; gap: 10px 22px; border-bottom: 1px solid var(--line); padding: 0 20px; }
.appbar .brand { padding-bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-right: 44px; }
.appbar .brand img { height: 60px; width: auto; display: block; }
.appbar .brand { padding-top: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .appbar .brand img { background: #fff; border-radius: 6px; padding: 4px 6px; } }
:root[data-theme="dark"] .appbar .brand img { background: #fff; border-radius: 6px; padding: 4px 6px; }
.appbar .sample, .appbar .keys { margin-bottom: 13px; }
.maintabs { display: flex; gap: 2px; overflow-x: auto; }
.maintabs a { color: var(--fg); text-decoration: none; padding: 12px 26px; font-size: 17px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; }
.maintabs a:hover { color: var(--fg); }
.maintabs a[aria-current] { background: var(--surface); color: var(--fg); border-color: var(--line); margin-bottom: -1px; box-shadow: inset 0 3px 0 var(--brand); }
body:not([data-page="home"]) .appbar .keys { display: none; }
.section-head h1 { font-family: var(--font-head); font-weight: 600; font-size: 28px; margin: 0; }
.section-head p { color: var(--muted); margin: 2px 0 0; }
.area h2 a { color: inherit; text-decoration: none; }
.area h2 a:hover { color: var(--accent); }
.area .go.gone { color: var(--muted); background: transparent; text-decoration: line-through; border-style: dotted; }

/* Dropdown arrows on type-or-pick boxes */
.combo input[type="text"] { padding-right: 24px; }
.combo .caret { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 22px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; }
.combo .caret:hover { color: var(--fg); }
.combo .caret:disabled { visibility: hidden; }
.row3 { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.row3 label { color: var(--muted); font-size: 15px; }
textarea.disc { font: inherit; font-size: 14px; line-height: 1.45; color: var(--fg); }

/* Home Details: three columns */
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 26px; max-width: 1100px; }
.cols3 .col { display: grid; gap: 10px; align-content: start; }
.cols3 .row { grid-template-columns: 100px minmax(0, 1fr); }
.citystate { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 6px; }
@media (max-width: 900px) { .cols3 { grid-template-columns: minmax(0, 1fr); } }

/* If the entry panel is taller than the screen, the totals bar still sticks to the bottom while scrolling. */
#p-sel .foot { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -6px 12px -8px rgba(0,0,0,.25); }
#p-sel .list { align-self: start; }
/* An open home: only a little space under the list and totals bar. */
body[data-page="home"] { padding-bottom: 6px; }
#p-sel { padding-bottom: 6px; }
#entry { overflow-y: auto; }

/* Builders & Pricing */
.pricing h2, .newhome h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; margin: 0; }
.pricing-cols { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 14px; align-items: start; }
.blist { display: grid; gap: 18px; align-content: start; }
.blist ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.blist li { padding: 8px 10px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 1px; }
.blist li:last-child { border-bottom: 0; }
.blist li:hover { background: var(--surface-2); }
.blist li.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--accent); }
.blist li small { color: var(--muted); font-size: 14px; }
.blist .off-toggle { justify-self: start; color: var(--muted); font-size: 15px; }
.blist ul.off li { color: var(--muted); background: var(--surface-2); }
.blist ul.off li.sel { background: var(--sel); }
.b-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.bdetail { display: grid; gap: 12px; min-width: 0; align-content: start; }
.bdetail > .toolbar:has(> h2) { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.bdetail > .toolbar > h2 { font-size: 23px; }
.b-form, .pl-new, .pl-edit { display: grid; gap: 8px; max-width: 620px; }
.pl-new { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.covers { display: grid; gap: 4px; }
.covers-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; padding: 4px 0 0 22px; }
.covers .check { color: var(--fg); }
.pl-table, .pi-table { min-width: 640px; }
.pl-table tbody tr { cursor: pointer; }
.pi-table td { padding: 3px 6px; }
input.cell { padding: 3px 6px; width: 110px; }
input.cell.short { width: 60px; }
input.cell.money { width: 84px; text-align: right; font-family: var(--font-data); }
tr.saved td { background: var(--ok-weak); transition: background .2s; }
@media (max-width: 760px) { .pricing-cols { grid-template-columns: 1fr; } }
.newhome .cols3 { margin-top: 4px; }
@media (max-width: 760px) { .cols3 { grid-template-columns: 1fr; } }
[hidden] { display: none !important; }
.toolbar input[type="checkbox"] { width: auto; }

/* Options and pick lists */
/* Options: tabs, categories | options | details */
.o-tabs { display: flex; gap: 4px; margin-left: 18px; }
.o-tab { border: 1px solid var(--line); background: var(--surface); border-radius: 8px 8px 0 0; padding: 8px 16px; font: inherit; font-size: 16px; cursor: pointer; color: var(--fg); border-bottom: 0; }
.o-tab span { color: var(--muted); font-size: 13px; margin-left: 4px; }
.o-tab[aria-selected="true"] { background: var(--surface); box-shadow: inset 0 3px 0 var(--brand); font-weight: 600; }
.o-tab[aria-selected="false"] { background: var(--surface-2); }
.o-filters { margin: 8px 0 12px; }
.o-filters select { width: auto; }
.opt-cols3 { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(360px, 460px); gap: 14px; align-items: start; }
.opt-cols3 .gridwrap { max-height: calc(100vh - 250px); }
.opt-cols3 table { min-width: 0; }
.o-cats { max-height: calc(100vh - 250px); overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.o-cats ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.o-cat { width: 100%; display: flex; align-items: center; gap: 6px; text-align: left; border: 1px solid transparent; background: none; border-radius: 6px;
  padding: 6px 8px; font: inherit; font-size: 15px; color: var(--fg); cursor: pointer; }
.o-cat:hover { background: var(--surface); }
.o-cat.sel { background: var(--sel); box-shadow: inset 3px 0 0 var(--brand); font-weight: 600; }
.o-cat.none { color: var(--muted); }
.o-cat span { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 400; }
.o-cat small { color: var(--muted); font-size: 12px; }
.o-cats .hint { font-size: 13px; margin: 8px 4px; }
.options-page .entry { position: sticky; top: 8px; max-height: calc(100vh - 250px); overflow: auto; }
.o-dtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 2px 0 6px; }
.o-dtabs button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: 15px; color: var(--muted); cursor: pointer; }
.o-dtabs button[aria-selected="true"] { color: var(--fg); font-weight: 600; box-shadow: inset 0 -3px 0 var(--brand); }
.o-form .lbl { color: var(--muted); font-size: 15px; }
.o-prices input.money { width: 72px; text-align: right; }
.o-prices th, .o-prices td { padding: 4px 4px; }
.o-form { display: grid; gap: 8px; }
.o-form .row { grid-template-columns: 96px minmax(0, 1fr); }
.flags { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.flags .check { color: var(--fg); }
.o-sub { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; }
.o-sub h3 { margin: 0; font-size: 16px; font-weight: 600; }
.o-sub p { margin: 0; }
table.mini { min-width: 0; font-size: 14px; }
table.mini td { padding: 3px 6px; white-space: normal; }
.inline-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-add select { max-width: 240px; }
.inline-add input[type="text"] { width: 240px; max-width: 100%; }
.inline-add input.short { width: 56px; }
#bc-add #bc-name { width: 200px; }
#bc-add #bc-city { width: 150px; }
#bc-add select { max-width: 210px; }
input.cell.wide { width: 100%; min-width: 200px; }
.lists-page table { min-width: 560px; }
.lists-page .gridwrap { max-width: 900px; }
.linkbtn:disabled { opacity: .3; cursor: default; }
@media (max-width: 1100px) { .opt-cols3 { grid-template-columns: 1fr; } .options-page .entry { position: static; max-height: none; } .o-cats { max-height: 240px; } }

.back { color: var(--accent); text-decoration: none; font-size: 15px; justify-self: start; }
.back:hover { text-decoration: underline; }
.disc-box { display: grid; gap: 4px; justify-items: start; }
.disc-box .disc { width: 100%; white-space: pre-wrap; }
.disc.empty { font-style: italic; }
.dlg { border: 1px solid var(--line); border-radius: 10px; padding: 20px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); }
.dlg::backdrop { background: rgba(10, 20, 30, .35); }
.dlg form { display: grid; gap: 12px; }
.dlg h2 { font-family: var(--font-head); font-size: 21px; margin: 0; }
.dlg textarea { font: inherit; width: 100%; }
.dlg .warnline { margin: 0; padding: 8px 10px; border-radius: 6px; background: var(--warn-weak); color: var(--warn); }

/* Report designer */
.designer .hint { margin: 0 0 10px; }
.rd-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.rd-bar input[type=text] { width: 300px; }
.rd-bar input, .rd-bar select { background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; color: var(--fg); font: inherit; }
.rd-bar select { width: auto; }
.rd-bar .grow { flex: 1; }
.rd-bar .btn:disabled { opacity: .5; cursor: default; }
.rd-wrap { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 14px; height: calc(100vh - 280px); min-height: 520px; }
.rd-form { overflow-y: auto; display: grid; gap: 8px; align-content: start; padding-right: 4px; }
.rd-group { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; }
.rd-group summary { cursor: pointer; font-weight: 600; font-size: 17px; padding: 10px 0; }
.rd-group[open] { padding-bottom: 12px; }
.rd-group .hint { font-size: 14px; }
.rd-grid { display: grid; gap: 9px; }
.rd-field { display: grid; gap: 3px; }
.rd-field label { color: var(--muted); font-size: 15px; }
.rd-field input[type=text], .rd-field textarea, .rd-field select, .rd-unit input, .rd-color input[type=text] {
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; font: inherit; width: 100%; }
.rd-field textarea { resize: vertical; font-size: 15px; }
.rd-unit { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.rd-unit input { width: 90px !important; }
.rd-color { display: flex; gap: 8px; align-items: center; }
.rd-color input[type=color] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; }
.rd-color input[type=text] { width: 110px !important; font-family: var(--font-data); }
.rd-check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.rd-reset { border: 0; background: none; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0 0 0 6px; }
#rd-preview { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 8px; background: #8a929c; }
@media (max-width: 900px) { .rd-wrap { grid-template-columns: 1fr; height: auto; } #rd-preview { height: 80vh; } }
/* Keep the entry panel short enough that Save and Add new item show on a laptop screen. */
#entry { gap: 6px; }
#entry .disc-box .disc { max-height: 3.4em; min-height: 0; overflow-y: auto; padding: 4px 8px; }
#entry textarea#f-comments { min-height: 2.6em; height: 2.6em; }
#entry #panel-fields { gap: 6px; }
#entry input, #entry select { padding-top: 4px; padding-bottom: 4px; }
#entry { padding: 10px 12px; } #entry .btns { margin-top: 0; } #entry .row label, #entry .row3 label { font-size: 14.5px; } #entry .entry-head { margin-bottom: -2px; }
#entry textarea#f-comments { min-height: 2.2em; height: 2.2em; }
/* Suggested add-ons: greyed rows under the item they're for */
#grid tr.ghost td { color: var(--muted); font-style: italic; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(85,156,190,.06) 6px 12px); }
#grid tr.ghost td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
#grid tr.ghost .why { color: var(--accent); font-weight: 600; }
#grid tr.ghost .why { font-size: 13px; }
#grid tr.ghost input { width: 16px; height: 16px; cursor: pointer; }
#grid tr.ghost .linkbtn { font-size: 18px; text-decoration: none; padding: 0 4px; font-style: normal; }
/* A home's Reports tab: buttons grouped like Access */
.rep-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 20px 40px; max-width: 1400px; }
.rep-area h2 { font-family: var(--font-head); font-size: 24px; font-weight: 600; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--brand); text-align: center; }
.rep-area h2.let { margin-top: 26px; }
.rep-area h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; text-align: center; color: var(--brand); }
.rep-pkg { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 22px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.rep-pkg select { width: auto; padding: 3px 6px; font-size: 14px; }
.rep-pkg .btn { padding: 4px 10px; font-size: 14px; }
.rep-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.rep-cols > div { display: grid; gap: 8px; align-content: start; }
.btn.rep { padding: 12px 8px; font-size: 15px; text-align: center; background: var(--btn); border-color: var(--btn); color: #0B1A24; font-weight: 600; }
.btn.rep.gray { background: var(--btn-gray); border-color: var(--btn-gray-line); color: var(--fg); }
.btn.rep.gray:hover { border-color: var(--muted); }
a.btn.rep { text-decoration: none; display: flex; align-items: center; justify-content: center; }
.btn.rep.soon { display: flex; align-items: center; justify-content: center; opacity: .45; font-weight: 500; cursor: default; }
.btn.rep:disabled { background: var(--surface-2); border-color: var(--line); color: var(--muted); font-weight: 500; cursor: default; }
.rep-dlg { width: min(1100px, calc(100vw - 32px)); height: calc(100vh - 32px); max-height: none; padding: 14px 18px 18px; }
.rep-dlg[open] { display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.rep-dlg .toolbar { display: flex; align-items: center; gap: 14px; }
.rep-dlg h2 { margin-right: auto; font-size: 20px; }
.rep-dlg .x { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 4px; color: var(--muted); cursor: pointer; }
.rep-dlg .x:hover { color: var(--fg); }
.rep-dlg select { font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--fg); }
#rep-frame { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 8px; background: #8a929c; }
/* Safari's PDF viewer fits each page to the frame's width, so a page-shaped frame shows one whole page at a time. */
.rep-dlg #rep-frame { width: auto; max-width: 100%; aspect-ratio: 0.8; justify-self: center; min-height: 0; }
.rep-dlg { width: min(calc(100vw - 32px), max(760px, calc((100vh - 120px) * 0.8 + 40px))); }
/* Change order number: left, with room before the Room column */
#grid td:first-child, #gridwrap th:first-child { text-align: left; padding-left: 12px; padding-right: 22px; width: 1%; white-space: nowrap; }
/* The disclaimer is a fixed, small box; the full wording is on Edit disclaimer. */
#entry .disc-box .disc { height: auto; max-height: none; min-height: calc(2.9em + 10px); box-sizing: border-box; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#grid tr.ghost { cursor: pointer; }
#grid tr.ghost:hover td { color: var(--fg); }
.rep-dlg .toolbar .check { white-space: nowrap; color: var(--fg); }
table.b-does { width: max-content; max-width: 100%; justify-self: start; align-self: start; min-width: 0; margin: 18px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table.b-does th, table.b-does td { padding: 6px 14px; position: static; }
table.b-does tbody th { background: none; color: var(--fg); font-size: 15px; font-weight: 600; }
table.b-does td:nth-child(2) { text-align: center; }
table.b-does input[type=number] { width: 64px; text-align: right; }
.o-prices td.pl { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.counts .off b { color: var(--warn); }
.counts .bad b, .counts .bad #c-rec { color: var(--danger); }
.counts .chip { font-size: 13px; padding: 2px 9px; }
.counts .check { font-size: 14px; }
/* Brochure price list */
.br-pick { margin-bottom: 10px; }
.br-pick select { width: auto; font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--fg); }
.br-pick .lbl { color: var(--muted); }
#br-frame { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #8a929c; }
.tag { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag.ready { color: var(--brand); border-color: var(--brand); }
/* Section and Main Menu pages: grouped gray buttons, like a home's Reports tab */
.rep-menu.menu { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 24px 40px; }
.menu-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.rep-area h2 a { color: inherit; text-decoration: none; }
.rep-area h2 a:hover { color: var(--accent); }
.menu-gone { color: var(--muted); font-size: 14px; margin-top: 8px; }
.menu-gone span { text-decoration: line-through; cursor: help; }
.b-circuit { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 600; }
.b-circuit .hint { font-weight: 400; }
input, select, textarea, button { font-variant-numeric: lining-nums; }
#bc-grid tr.bc-own > td { background: var(--surface-2); white-space: normal; padding: 4px 12px 10px; }
#bc-grid tr.bc-own table.b-does { margin: 8px 0 4px; }
table.b-does.pl-pct { margin: 0; }
#bc-grid tr.bc-own select { font: inherit; padding: 3px 6px; }
#bc-grid tr.bc-row { cursor: pointer; }
#bc-grid tr.bc-row:hover > td, #bc-grid tr.bc-row.open > td { background: var(--surface-2); }
#bc-grid .caret { color: var(--muted); display: inline-block; width: 12px; }
.bc-place { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 4px; }
.bc-place label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.bc-place input { width: 180px; }
.bc-place input.short { width: 50px; }
.bc-place input.bc-name { width: 220px; }
.bc-place .b-subpanel input[type=number] { width: 70px; }
#bc-grid tr.bc-row.closed > td { color: var(--muted); }
/* Builder and community percent tables: every column after the first is centered, headings included */
table.b-does thead th:not(:first-child), table.b-does td, table.b-does td.num { text-align: center; }
table.b-does input[type=number] { text-align: center; }
table.b-does input[type=checkbox] { margin: 0; vertical-align: middle; }
.bc-table th:nth-child(4), #bc-grid > tr[data-id] > td:nth-child(4) { text-align: center; }
.pl-table th:nth-child(n+3), .pl-table td:nth-child(n+3) { text-align: center; }

.warn-note { padding: 4px 10px; border-radius: 6px; background: var(--warn-weak); color: var(--warn); font-size: 14px; }
.pl-edit { margin-bottom: 18px; }
.pi-table th, .pi-table td { padding: 6px 8px; }
.pi-table th:nth-child(n+5), .pi-table td:nth-child(n+5) { text-align: center; }
.pi-table input.cell.money { text-align: right; }

.b-subpanel { display: inline-flex; align-items: center; gap: 8px; }
.b-subpanel input[type=number] { width: 70px; text-align: center; }
.bc-own label.b-subpanel { font-weight: 600; white-space: nowrap; }
.b-form label.b-subpanel { font-weight: 600; }
.opt-cols3 td.o-cat-no { width: 110px; max-width: 110px; white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
.opt-cols3 td.o-catname { width: 150px; max-width: 150px; white-space: normal; }
.cust-dlg .row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; }
.cust-dlg select, .cust-dlg input[type=text] { width: 100%; }
#entry .btns .tag, .tag { font-size: 12px; }
#o-builder { max-width: 320px; }

/* The option box: a side panel, or wide over the page with Expand */
#o-panel .entry-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
#o-panel .o-expand { padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; }
#o-panel .o-expand svg { pointer-events: none; }
.o-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.o-nav { display: flex; gap: 6px; }
.o-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 30, .35); z-index: 40; }
#o-panel.big { position: fixed; z-index: 41; top: 40px; left: 50%; transform: translateX(-50%); width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 80px); overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); padding: 20px 24px; }
#o-panel.big .o-form { max-width: 760px; }
#o-panel.big .o-prices { width: 100%; }
#o-panel.big .o-prices td.pl { max-width: none; font-size: 15px; }
#o-panel.big .o-prices th, #o-panel.big .o-prices td { padding: 6px 8px; }
#o-panel.big .o-prices input.money { width: 96px; }
#o-panel.big form.inline-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.std-dlg { width: min(1100px, calc(100vw - 32px)); }
.std-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.std-top select { width: auto; }
.std-top #std-search { margin-left: auto; width: 240px; }
.std-wrap { max-height: calc(100vh - 290px); overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.std-table { width: 100%; border-collapse: collapse; }
.std-table th { position: sticky; top: 0; background: var(--surface); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.std-table td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.std-table input[type=number] { width: 70px; }
.std-table select { max-width: 190px; }
.std-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.std-foot .grow { flex: 1; }
.std-foot .muted { color: var(--muted); }
.btns .wide { grid-column: 1 / -1; }
.skip-list { margin: 0; padding-left: 20px; max-height: 50vh; overflow: auto; }
#close-dlg h3 { margin: 4px 0 6px; font-size: 16px; }
.home-acts { display: inline-flex; gap: 6px; margin-left: auto; align-self: center; }
.home-acts .chip { font-size: 13px; padding: 2px 10px; text-decoration: none; color: var(--fg); }
.home-acts .chip:disabled { opacity: .5; cursor: default; }
.backlink { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin: 2px 0 6px 2px; }
.backlink:hover { color: var(--fg); text-decoration: underline; }
#gridwrap th.fill, #grid td.fill { padding-left: 28px; text-align: left; } /* Catalog #, last */
/* Header facts and the change order totals sit in the middle of their bars, not at the top or baseline. */
.home { align-items: center; }
.foot { align-items: center; }
.foot .cos { align-items: center; }
/* Give the number columns room so they spread out instead of bunching at the right. */
#gridwrap th:nth-child(4) { width: 90px; }
#gridwrap th:nth-child(5), #gridwrap th:nth-child(6) { width: 140px; }
#gridwrap th:nth-child(7) { width: 160px; }

.pl-table td:nth-child(2) { white-space: normal; min-width: 200px; }
.pct-actions { display: flex; gap: 8px; margin: 0 0 8px; }
.pct-actions .btn { padding: 3px 10px; font-size: 14px; }
table.b-does input:disabled { background: none; border-color: transparent; color: var(--fg); opacity: 1; }

/* Upload Spreadsheet on the Options page */
.sheet-dlg { width: min(980px, calc(100vw - 32px)); }
.sheet-dlg .sheet-wrap { max-height: 55vh; overflow: auto; }
.sheet-table td { vertical-align: top; }
.sheet-table .bad-row td { background: var(--warn-weak); }
.sheet-dlg .bad { color: var(--danger, #B3261E); }
.sheet-lists { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; margin-top: 6px; display: grid; gap: 2px; }
.sheet-lists .sheet-builder { font-weight: 600; margin-top: 6px; }
.sheet-lists .check { padding-left: 12px; }
.pi-tabs { margin: 12px 0 0; }
.pi-tabs + .gridwrap, .pi-tabrow + .gridwrap { border-top-left-radius: 0; }

/* Builder: details on the left, what LET does and the percents beside them */
.b-top { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-start; margin-bottom: 8px; }
.b-top .b-form { flex: 1 1 280px; max-width: 460px; }
.b-top .b-pcts { flex: 0 0 auto; }
.b-top .b-pcts table.b-does { margin-top: 0; }
.b-top .b-pkg { flex: 0 0 auto; }
.b-top .b-pkg table.b-does { margin: 0; }
.b-top .b-form label.b-circuit, .b-top .b-form label.b-subpanel { white-space: nowrap; }
.b-top .b-subpanel input[type=number] { flex: 0 0 64px; }
.b-logo { display: flex; align-items: center; gap: 10px; }
.b-logo img { max-height: 40px; max-width: 140px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 2px; }
.b-logo .btn { white-space: nowrap; }
.sheet-dlg .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet-dlg .sheet-new { font-size: 14px; padding: 4px 12px; text-decoration: none; }
.o-photo { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.o-photo img { display: block; max-width: 160px; max-height: 120px; border: 1px solid var(--line, #d5dce5); border-radius: 4px; background: #fff; }
.appbar { position: relative; }
.appbar .who { position: absolute; top: 10px; right: 20px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.who a { margin-left: 8px; }
.staff .staff-table { max-width: 760px; }
.staff > p.hint { max-width: 760px; margin: 0 0 12px; }
.oc-filter { flex-wrap: wrap; gap: 10px 18px; margin-bottom: 12px; }
.oc-filter label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.oc-acts { white-space: nowrap; }
.oc-acts .btn { padding: 3px 12px; font-size: 14px; }
.btn.danger { color: #B3261E; }
.pf-comms { margin-bottom: 10px; flex-wrap: wrap; gap: 6px 14px; }
.pf-comms .lbl { color: var(--muted); }
.pf-comms .btn { padding: 3px 10px; }
.pf-comms .check { font-size: 14px; color: var(--fg); }
#pf-frame { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #8a929c; }
.profits .oc-filter select, .profits .oc-filter input[type=date] { width: auto; }
.od-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.od-kind { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.od-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.od-head b { margin-right: auto; }
.od-head .btn { padding: 3px 10px; }
.od-count { color: var(--muted); font-size: 13px; }
.od-list { max-height: 230px; overflow-y: auto; padding: 6px 10px; display: grid; gap: 2px; }
.od-list .check { font-size: 14px; color: var(--fg); }
@media (max-width: 800px) { .od-kinds { grid-template-columns: 1fr; } }
/* Suggested options by room: rooms on the left, that room's suggestions on the right */
.rs-cols { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rs-rooms ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.rs-rooms button { width: 100%; text-align: left; border: 0; background: none; padding: 5px 9px; cursor: pointer; display: flex; justify-content: space-between; }
.rs-rooms button:hover { background: var(--surface-2); }
.rs-rooms button.sel { background: var(--sel); font-weight: 600; }
.rs-main h2 { margin: 0 0 8px; font-size: 20px; }
.rs-main form { margin-top: 12px; }
.parts-page .gridwrap { max-width: none; }
.parts-page tr.off input, .parts-page tr.off select { color: var(--muted); }
@media (max-width: 700px) { .rs-cols { grid-template-columns: 1fr; } }
.parts-page .homes-head .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.parts-page .homes-head .toolbar select, .parts-page .homes-head .toolbar input[type="search"] { width: auto; }
.parts-page .homes-head .toolbar .btn { text-decoration: none; }
/* Drag to reorder: the ⠿ handle, the row being moved, and a line where it will land */
td.grip { cursor: grab; color: var(--muted); font-size: 18px; text-align: center; user-select: none; touch-action: none; width: 34px; }
td.grip:hover { color: var(--accent); }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
tr.dragging { opacity: .55; background: var(--sel); }
tr.drop-above td { box-shadow: inset 0 3px 0 var(--accent); }
tr.drop-below td { box-shadow: inset 0 -3px 0 var(--accent); }
/* Plans: a builder's plans on the left, the picked plan's standard items and optional rooms on the right */
.plans-page .toolbar select { width: auto; }
.pl-cols { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
.pl-list ul { list-style: none; margin: 0 0 10px; padding: 0; max-height: 65vh; overflow: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.pl-list ul button { width: 100%; text-align: left; border: 0; background: none; padding: 6px 10px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.pl-list ul button:hover { background: var(--surface-2); }
.pl-list ul button.sel { background: var(--sel); font-weight: 600; }
.pl-list ul button.off span:first-child { color: var(--muted); text-decoration: line-through; }
.pl-list .inline-add input[type="text"] { width: 170px; }
.pl-main h2 { font-size: 18px; margin: 18px 0 2px; }
.pl-main .hint { margin: 0 0 6px; }
.pl-head { display: flex; align-items: center; gap: 12px; }
.pl-title { font-size: 22px; font-weight: 600; max-width: 360px; }
.pl-items { width: 100%; max-width: 760px; }
.pl-additem { margin: 6px 0 4px; }
.pl-additem .pl-opt { width: 380px; max-width: 100%; }
.pl-room { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; max-width: 786px; background: var(--surface); }
.pl-room-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.pl-room-head input { font-weight: 600; max-width: 300px; }
@media (max-width: 760px) { .pl-cols { grid-template-columns: 1fr; } }
.rep-rooms { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 14px; }
.rep-rooms[hidden] { display: none; }
#rep-co-wrap[hidden] { display: none; }
/* A search box with an × at the right to clear it */
.clearable { position: relative; display: inline-block; }
.clearable input { padding-right: 28px; }
.clear-x { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 4px; }
.clear-x:hover { color: inherit; background: var(--surface-2); }
.clear-x[hidden] { display: none; }
/* Archive Old Homes */
.archive-page .ar-grid { max-height: 45vh; overflow: auto; }
.archive-page .ar-h2 { font-size: 20px; margin: 22px 0 6px; }
.archive-page .ar-h2 .counts { font-size: 14px; font-weight: 400; }
.archive-page .toolbar label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.archive-page .toolbar select { width: auto; }
.archive-page .ar-h2 .counts { display: inline; margin-left: 4px; }
.archive-page .ar-grid a { color: inherit; text-decoration: none; }
.archive-page .ar-grid a:hover { text-decoration: underline; }
/* Bids */
.bids-page .pl-list button small { font-weight: 400; }
.bd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; }
.bd-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 480px; }
.bd-left .pl-title { width: 100%; max-width: 420px; }
.bd-pctbox { flex: 0 0 auto; }
.bd-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.bd-acts a.btn { text-decoration: none; }
.bd-facts { display: flex; gap: 6px; align-items: center; margin: 4px 0 0 2px; }
.bd-facts label { display: flex; gap: 6px; align-items: center; }
.bd-top { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 12px; }
.bd-pcts { width: auto; }
.bd-notes { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 260px; max-width: 480px; }
.bd-notes textarea { width: 100%; }
.bd-view { margin: 10px 0 0; }
.bd-pctbox table.b-does { margin: 0; }
.bd-pctbox table.b-does th, .bd-pctbox table.b-does td { padding: 3px 8px; }
.bd-acts .btn { padding: 6px 10px; font-size: 14px; }
.bd-pctbox table.b-does tbody th { font-size: 14px; }
.bd-pctbox table.b-does input[type=number] { width: 56px; padding: 3px 6px; font-size: 14px; }
.bd-body { border: 1px solid var(--line); border-radius: 0 8px 8px 8px; padding: 14px; background: var(--surface); }
.bd-body > .gridwrap { margin-top: 0; }
.bd-sub { font-size: 15px; margin: 0 0 6px; }
.bd-pick { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-bottom: 10px; }
.bd-pick label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.bd-pick select { min-width: 180px; }
.bd-pick2 { margin-bottom: 10px; }
.bd-pick2 .counts { margin-left: auto; }
.bd-facts .linkbtn { font-size: 13px; }
.bd-grid { max-height: 60vh; overflow: auto; }
.bd-grid tr.grp td { font-weight: 600; color: var(--muted); background: var(--surface-2); }
.bd-head .pl-title { width: 360px; }
.cmt.incl { color: #555; font-weight: 400; font-style: normal; }
/* Options › Package tab */
.pk-h { font-size: 16px; margin: 16px 0 6px; }
.pk-finishes { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pk-chip { display: inline-flex; align-items: center; gap: 2px; }
.pk-items { width: 100%; }
.pk-room { background: #fff; border: 1px solid var(--line); border-left: 4px solid #8FCDDE; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.pk-room-name { font-weight: 600; width: 180px; }
.pk-addroom { margin-top: 4px; }
.pk .pk-rooms-h { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.pk-room-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 4px; }
.pk-room-head label, #pk-addroom label { display: inline-flex; align-items: center; gap: 2px; }
.pk-room-head .linkbtn { margin-left: auto; font-size: 18px; }
.pk-copy { margin-top: 14px; }
.pkg-rooms { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 4px; }
.pk-items select { width: 105px; }
.pk-items input[data-p="label"] { width: 100%; min-width: 90px; }
.pk-items .hint.mono { font-size: 12px; }
.pk-sub { margin: 0 0 6px; }
.pk-more { margin: 10px 0 0; }
.pk-copy { text-align: right; }
.pk .inline-add .btn.primary { padding: 4px 12px; font-size: 14px; min-height: 0; }
.pk-items th:first-child, .pk-items td:first-child { width: 1%; text-align: left; padding-left: 0; }
.pk-items th:last-child, .pk-items td:last-child { width: 1%; }
.backup .bk-h { font-size: 18px; margin: 24px 0 4px; }
.bk-table { max-width: 420px; }
.pi-raise .pi-r-by { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.pi-raise #pi-r-preview ul { margin: 4px 0 0; padding-left: 18px; }
.clearable input::-webkit-search-cancel-button { display: none; }

/* Extra sign-offs */
.so-intro { margin-top: -4px; }
.signoffs .pricing-cols { grid-template-columns: minmax(220px, 280px) minmax(0, 760px); }
.signoffs .blist { gap: 8px; }
.signoffs .blist li span { font-weight: 600; }
.so-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.so-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.so-title { flex: 1; font-weight: 600; font-size: 18px; }
.so-lbl { display: block; font-weight: 600; margin-bottom: 4px; }
.so-card textarea { width: 100%; box-sizing: border-box; font: inherit; }
.so-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0 4px; }
.so-row label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-weight: 600; }
.so-row select { font-weight: 400; }
h2.so-uses-h { font-size: 18px; margin: 20px 0 6px; padding-top: 14px; border-top: 1px solid var(--line); }
h2.so-uses-h .hint { font-size: 14px; font-weight: 400; margin-left: 6px; }
.so-uses { width: 100%; }
.so-uses td:first-child { width: 40%; }
.so-uses select { width: 100%; }
.so-uses td:last-child { width: 1%; }
.so-x { font-size: 18px; }
.so-add { margin-top: 8px; }
.so-add select { width: auto; }

/* Find homes with an option */
.wo-pick { display: flex; gap: 14px; align-items: center; max-width: 760px; margin-bottom: 14px; }
.wo-box { position: relative; flex: 1; }
.wo-pick input[type="text"] { width: 100%; box-sizing: border-box; }
.wo-pick .check { display: inline-flex; white-space: nowrap; font-size: 14px; }
.wo-matches { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0; list-style: none; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); max-height: 360px; overflow: auto; }
.wo-matches li { padding: 6px 10px; cursor: pointer; display: grid; border-bottom: 1px solid var(--line); }
.wo-matches li:last-child { border-bottom: 0; }
.wo-matches li.act, .wo-matches li[data-id]:hover { background: var(--sel); }
.wo-matches small { color: var(--muted); }
h2.wo-name { font-size: 22px; margin: 4px 0 10px; }
h2.wo-name .hint { font-size: 15px; font-weight: 400; }
.entry-head .o-homes { margin-left: auto; margin-right: 8px; white-space: nowrap; font-size: 14px; }
.with-option .toolbar select { width: auto; }
.wo-head { display: flex; align-items: baseline; gap: 14px; margin: 14px 0 6px; }
.wo-head .wo-name { margin: 0; }
.wo-head .wo-name:empty { display: none; }

/* Main Menu: Recent Homes */
.recent { display: grid; gap: 10px; }
.recent h2 { font-family: var(--font-head); font-size: 20px; font-weight: 600; margin: 0; }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.recent-home { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--fg); box-shadow: var(--shadow, none); transition: border-color .12s, box-shadow .12s; }
.recent-home:hover { border-color: var(--brand); box-shadow: 0 2px 10px rgba(16, 24, 40, .08); }
.rh-addr { font-weight: 700; font-size: 17px; }
.rh-who { font-size: 15px; }
.rh-where, .rh-when { color: var(--muted); font-size: 14px; }
.rh-when { margin-top: 4px; font-size: 13px; }

/* Categories page: list on the left in order, the picked one on the right */
.cat-cols { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); }
.cat-filters { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.cat-filters input[type="search"] { grid-column: 1 / -1; }
.cat-filters .check { font-size: 15px; color: var(--muted); }
.cat-list { max-height: calc(100vh - 230px); overflow-y: auto !important; }
.blist .cat-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.cat-list .grip { cursor: grab; color: var(--muted); font-size: 16px; user-select: none; touch-action: none; }
.cat-list .grip:hover { color: var(--accent); }
.cat-nm { display: grid; min-width: 0; }
.cat-n { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 1px 8px; }
.cat-n.zero { opacity: .55; }
.cat-list li.off .cat-nm { color: var(--muted); font-style: italic; }
.cat-list li.dragging { opacity: .55; background: var(--sel); }
.cat-list li.drop-above { box-shadow: inset 0 3px 0 var(--accent); }
.cat-list li.drop-below { box-shadow: inset 0 -3px 0 var(--accent); }
.cat-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.cat-stats div { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; }
.cat-stats b { font-size: 22px; }
.cat-stats span { color: var(--muted); font-size: 14px; }
.cat-card #c-note { width: 100%; }
.cat-help { margin: 8px 0 14px; }
.cat-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-card { max-width: 720px; }
.cat-stats div { padding: 8px 12px; }
.cat-stats b { font-size: 19px; }
#ox-dl { text-decoration: none; }
#ox-dl.disabled { opacity: .5; pointer-events: none; }
.rh-tile[hidden], .recent[hidden] { display: none; }
.rh-tile { position: relative; display: grid; }
.rh-pin { position: absolute; top: 6px; right: 8px; border: 0; background: none; padding: 2px 4px; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s; }
.rh-tile:hover .rh-pin, .rh-pin:focus-visible, .rh-tile.pinned .rh-pin { opacity: 1; }
.rh-tile.pinned .rh-pin { color: var(--brand); }
.rh-tile .rh-addr { padding-right: 22px; }
.recent-all { place-content: center; text-align: center; font-weight: 600; color: var(--fg); background: var(--surface-2); font-size: 17px; }
/* A price list opens over the Builders & Pricing page. Its name, search and buttons stay on top while you scroll. */
.pl-dlg { width: min(1400px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0 20px 20px; overflow: auto; }
.pl-dlg #pl-detail > .toolbar:first-child { position: sticky; top: 0; z-index: 2; background: var(--surface); padding: 16px 0 10px; margin: 0 0 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pi-tabrow { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.pi-tabrow .pi-tabs { margin: 0; }
.pi-tabrow #pi-search { width: 320px; margin-bottom: 6px; }
.pi-tabrow .check, .pi-tabrow .counts { margin-bottom: 12px; }
.pl-dlg .pl-close { margin-left: auto; }
.pl-table tr.pl-off td, .pl-table tr.pl-off-head td { background: var(--surface-2); }
.pl-table tr.pl-off-head { cursor: pointer; }
.pl-table tr.pl-off-head .pl-arrow { display: inline-block; width: 14px; color: var(--muted); }
.pl-new .pi-r-by { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
/* New Price List: a box over the page, one numbered step at a time. */
.pln-dlg { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px; }
.pln-dlg form { display: grid; gap: 0; }
.pln-head h2 { margin: 0 0 6px; }
.pln-step { display: grid; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.pln-step[hidden] { display: none; }
.pln-step h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; font-weight: 600; }
.pln-step h3 > span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--btn, #8FCDDE); color: #0B1526; font-size: 13px; }
.pln-step h3 small { font-weight: 400; color: var(--muted); font-size: 13px; }
.pln-step select { margin-left: 4px; }
.pln-step #pl-new-version { max-width: 320px; }
.pln-step .pi-r-by input[type=text] { width: 64px; }
.pln-pct-sum { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.pln-pct-sum b { color: var(--fg); font-weight: 600; }
.pln-err { margin: 0 0 10px; padding: 8px 10px; border-radius: 6px; background: var(--warn-weak); color: var(--danger); }
.pln-dlg .form-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.pln-dlg .pi-r-by { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.pln-step > .check:has(select) { flex-wrap: nowrap; white-space: nowrap; }
.pln-step > .check select { flex: 1; min-width: 0; }
/* A button beside a search box or input is no taller than the box. */
.toolbar:has(> input, > select, > .combo) > .btn, .inline-add .btn, .pricing .toolbar .btn { padding: 5px 12px; }
.pln-raise input, .pln-dlg .pl-pct input { width: 72px; text-align: right; }
.pln-raise { width: auto; }
.pln-step h3 .pln-edit { margin-left: 6px; padding: 2px 10px; font-size: 14px; font-weight: 500; }
.pln-note { margin: -2px 0 2px; }
.pln-dlg input[data-npct]:disabled { background: var(--surface-2); color: var(--fg); border-color: transparent; }
/* + Add Option in a price list */
.dlg form.pi-add, .pi-add { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 12px; margin: 0 0 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.dlg form.pi-add .combo { flex: 1 1 360px; min-width: 280px; }
.dlg form.pi-add .combo input { width: 100%; box-sizing: border-box; }
.pi-add-cost { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.pi-add-cost input { width: 90px; text-align: right; }
#pi-add-code { width: 190px; }
.pi-add-msg { flex-basis: 100%; margin: 0; }
.pi-add-msg.bad { color: var(--danger); }
.combo li.pi-add-create { color: var(--focus, var(--brand)); font-weight: 600; border-top: 1px solid var(--line); }
#pi-add-form #pi-add-find { width: 100%; }
#pi-add-form .clearable { display: block; width: 100%; }

/* A new option made from a price list: the Options page's option box, in its own box over the price list. */
.pi-newopt-dlg { width: min(900px, calc(100vw - 32px)); padding: 0; margin: 40px auto auto; }
.pi-newopt-dlg .o-solo .entry { position: static; max-height: calc(100vh - 80px); overflow: auto; border: 0; padding: 18px 20px; }
.pi-newopt-dlg .o-form { gap: 8px; max-width: 760px; }
.pi-newopt-dlg form.inline-add { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.pi-newopt-dlg .o-foot .mode.bad { color: var(--danger); }
.pi-newopt-dlg .o-foot #o-solo-done { margin-left: auto; }
.toast[popover] { inset: auto; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin: 0; border: 0; }


/* Back links: blue with an arrow, at the top right across from the page title, out of the way. */
.homes-head { position: relative; }
.homes-head .back { position: absolute; top: 4px; right: 2px; white-space: nowrap; }



/* A home's Selections toolbar, a pinch smaller: the search box and the change order chips. */
.list > .toolbar #search { font-size: 14.5px; padding-top: 5px; padding-bottom: 5px; }
.list > .toolbar .chip { font-size: 13px; padding: 2px 10px; }

/* Home address bar, a pinch smaller again: same layout, smaller type. */
header.home { padding: 8px 16px; }
header.home h1 { font-size: 22px; }
header.home .sub { font-size: 14px; margin-top: 1px; }
header.home .fact span { font-size: 11.5px; }
header.home .fact strong { font-size: 15px; }

/* Selections list: tighter rows so more lines fit */
#gridwrap table { font-size: 14px; }
#gridwrap th { font-size: 13px; padding: 5px 8px; }
#grid td { padding: 3px 8px; }
#grid tr.grp td { font-size: 13px; padding: 2px 8px; }
/* Selections: a pinch less space above the list, and a wider Room column. */
#app:has(> .backlink:first-child) { margin-top: -10px; }
#gridwrap th:nth-child(2) { min-width: 200px; }
#grid td.fill { white-space: normal; }
/* Edit Item panel: a little smaller boxes and buttons. */
#entry input, #entry select, #entry textarea, #entry .combo input { font-size: 14px; padding-top: 3px; padding-bottom: 3px; }
#entry .disc-box .disc { font-size: 13.5px; }
#entry .btns .btn, #entry .btns button { font-size: 14px; padding-top: 5px; padding-bottom: 5px; }

.sheet-table th.sheet-list { text-align: center; border-bottom: 0; box-shadow: none; padding-bottom: 0; }
.sheet-table thead th[rowspan] { vertical-align: bottom; }
.sheet-table thead { position: sticky; top: 0; z-index: 1; }
.sheet-table thead th { position: static; }
.sheet-downloads { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-downloads .btn { text-decoration: none; }
.sheet-downloads .btn { padding: 3px 9px; font-size: 13px; min-height: 0; }
#o-upload, #o-new-pkg, #o-new { padding: 6px 10px; font-size: 14px; min-height: 0; }
#grid tr.ghost .ghost-name { display: flex; align-items: center; gap: 12px; }
#grid tr.ghost .ghost-x { flex: none; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 20px; line-height: 1; font-style: normal; cursor: pointer; padding: 0; }
#grid tr.ghost .ghost-x:hover { color: #B42318; border-color: #B42318; }
