:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1c2128; --muted: #6b7280;
  --line: #e2e5ea; --accent: #a97b1f; --accent-ink: #fff;
  --good: #1f9d55; --warn: #b45309; --bad: #b3261e;
}
.srcbadge { display: inline-block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 0 6px; vertical-align: 1px; }
.tbl.breakdown tr.subline td { font-size: 13px; padding-top: 2px; padding-bottom: 2px; }
.tbl.breakdown tr.subline td:first-child { padding-left: 22px; color: var(--muted); }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eceef2; padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: #241f14; color: #fff; }
.brand { font-weight: 800; letter-spacing: 1px; color: #fff; font-size: 18px; }
.tagline { color: #a99a74; font-size: 12px; }
.mainnav { margin-left: auto; display: flex; gap: 16px; }
.mainnav a { color: #ddd0af; }
.signout { display: flex; gap: 10px; align-items: center; margin-left: 16px; }
.signout .whoami { color: #a99a74; font-size: 13px; }
.signout button { background: transparent; border: 1px solid #4a4230; color: #ddd0af;
  padding: 4px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }

.wrap { max-width: none; margin: 24px auto; padding: 0 20px; }   /* the window, not a column: owner instruction 2026-09-11 */
h1 { margin: 0 0 4px; } h2 { margin-top: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; }
.crumb { margin: 0 0 8px; color: var(--muted); }
.right { text-align: right; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin: 16px 0; }
.card.nopad { padding: 0; overflow: hidden; }
.cardhead { padding: 14px 18px 0; }
.login-card { max-width: 380px; margin: 60px auto; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid label, form label, .card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.card label + label { margin-top: 10px; }
input, select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; color: var(--ink); background: #fff; }
.grid button { grid-column: 1 / -1; justify-self: start; }

button, .btn { display: inline-block; background: var(--accent); color: var(--accent-ink);
  border: none; padding: 9px 16px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn:hover { text-decoration: none; opacity: .92; }
.btn.ghost, .btn.ghost:hover, button.ghost { background: transparent; color: var(--muted);
  border: 1px solid var(--line); }
button.sm, .btn.sm { padding: 4px 10px; font-size: 12px; }
form.inline { display: inline; }

.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; min-width: 130px; display: flex; flex-direction: column; }
.stat .num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 13px; }

.tbl { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { background: #fafbfc; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.tbl.compact th, .tbl.compact td { padding: 6px 10px; font-size: 13px; }
.tbl.flush { border: none; border-radius: 0; }
.tbl tr:last-child td { border-bottom: none; }

/* titlebar + pricebox */
.titlebar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pricebox { text-align: right; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 14px; display: flex; flex-direction: column; }
.pricebox .num { font-size: 22px; font-weight: 700; color: var(--accent); }
.pricebox .lbl { color: var(--muted); font-size: 12px; }

/* the rate cockpit */
.cockpit { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.rooms-col { position: sticky; top: 16px; }
.rates-tbl input.rate { max-width: 90px; text-align: right; }
.rates-tbl td { vertical-align: top; }
.rates-tbl .clipcell { width: 84px; padding-top: 8px; }
.rowclip { display: block; width: 72px; height: 48px; object-fit: contain;
  background: #f1ece1; border: 1px solid var(--line); border-radius: 4px; }
.rowclip:hover { border-color: var(--accent); }
.classline { font-size: 11px; margin-top: 2px; }
.design-hrs { font-variant-numeric: tabular-nums; color: var(--muted); }
.room-hrs { font-variant-numeric: tabular-nums; font-weight: 600; }

/* expandable per-room design breakdown */
.cardhint { padding: 0 18px; margin: -6px 0 8px; font-size: 12px; }
.roomstable .room-row { cursor: pointer; }
.roomstable .room-row:hover td { background: #faf7f0; }
.room-caret { display: inline-block; width: 14px; color: var(--muted);
  font-size: 10px; transition: transform .12s ease; }
.room-row.open .room-caret { transform: rotate(90deg); }
.room-detail td { padding: 0; background: #fbfaf7; }
.room-bd { padding: 4px 12px 8px 30px; display: flex; flex-direction: column; gap: 3px; }
.bd-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.bd-name { color: var(--muted); }
.bd-hrs { font-variant-numeric: tabular-nums; }
.bd-empty { font-size: 12px; padding: 2px 0; }
td.saved { font-size: 11px; color: var(--good); width: 46px; white-space: nowrap; }
td.saved.err { color: var(--bad); }
.goldtbl input { max-width: 130px; }
@media (max-width: 820px) {
  .cockpit { grid-template-columns: 1fr; }
  .rooms-col { position: static; }
}

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: #eef2ff;
  border: 1px solid #d9dffb; }
.flash-warn { background: #fff5e6; border-color: #f0d5a8; color: #92600c; }
.flash-ok { background: #eafaf0; border-color: #b6e6c9; color: #1f7a45; }
.flash-error { background: #fbecec; border-color: #f0bcbc; color: #8f1d16; }
.flash-info { background: #eef2ff; border-color: #d9dffb; color: #33417a; }

details.card.danger { border-color: #f0bcbc; }
details.card.danger summary { color: var(--bad); }
button.danger, .btn.danger { background: var(--bad); color: #fff; }
details.card summary, details summary { cursor: pointer; }
details summary { font-weight: 600; }

/* estimate sub-nav */
.estnav { display: flex; gap: 4px; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.estnav a { padding: 8px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.estnav a:hover { text-decoration: none; color: var(--ink); }
.estnav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* gold cards */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.goldcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; display: flex; flex-direction: column; }
.clipbox { height: 130px; background: #f1ece1; display: flex; align-items: center;
  justify-content: center; border-bottom: 1px solid var(--line); }
.clipbox img.clip { max-width: 100%; max-height: 130px; object-fit: contain; }
.noclip { color: var(--muted); font-size: 12px; }
.goldcard-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.linecount { display: flex; flex-direction: row; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-top: 4px; }
.linecount input { max-width: 70px; }
.gc-rows { display: flex; flex-direction: column; gap: 6px; }
.gc-row { display: flex; gap: 6px; }
.gc-row .gc-size { flex: 1; min-width: 0; }
.gc-row .gc-mult { max-width: 84px; }
span.saved { font-size: 11px; color: var(--good); min-height: 14px; }
span.saved.err { color: var(--bad); }
.goldsummary td, .goldsummary th { font-variant-numeric: tabular-nums; }

/* one design, big enough to read.
   The card element itself is moved in here, so it needs its grid styling
   undone rather than restyled: inside the sheet it is a column of controls
   beside the clip, not a tile. */
.goldcard { cursor: zoom-in; }
.goldcard:hover { border-color: var(--accent); }
.goldcard .openfocus { float: right; }
body.focused { overflow: hidden; }

.focus { position: fixed; inset: 0; z-index: 50; background: rgba(20, 17, 10, .72);
  display: flex; align-items: center; justify-content: center; padding: 24px; }
.focus[hidden] { display: none; }
.focus-sheet { background: var(--card); border-radius: 12px; width: min(1100px, 100%);
  max-height: 100%; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.focus-head { display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); }
.focus-head h2 { margin: 0; font-size: 20px; }
.focus-head p { margin: 2px 0 0; font-size: 13px; }
.focus-count { margin-left: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.focus-body { display: flex; gap: 18px; padding: 18px; overflow: auto; align-items: flex-start; }
.focus-clip { flex: 1 1 auto; min-width: 0; background: #f1ece1; border-radius: 8px;
  border: 1px solid var(--line); display: flex; align-items: center;
  justify-content: center; padding: 12px; min-height: 220px; }
.focus-clip img { max-width: 100%; max-height: 62vh; object-fit: contain; }
.focus-form { flex: 0 0 300px; }
/* the moved-in card, no longer a tile */
.focus-form .goldcard { border: 0; cursor: auto; }
.focus-form .goldcard:hover { border-color: transparent; }
.focus-form .goldcard .clipbox { display: none; }
.focus-form .goldcard .openfocus { display: none; }
/* said once, in the sheet's own header */
.focus-form .goldcard .gc-head,
.focus-form .goldcard .gc-feet { display: none; }
.focus-form .linecount { font-size: 15px; color: var(--ink); }
.focus-form .goldcard-body { padding: 0; gap: 10px; }
.focus-foot { display: flex; align-items: center; gap: 16px; padding: 12px 18px;
  border-top: 1px solid var(--line); background: #fbfaf7; }
.focus-foot .hint { margin: 0 auto; }
.focus-foot button[disabled] { opacity: .4; cursor: not-allowed; }

@media (max-width: 760px) {
  .focus { padding: 0; }
  .focus-sheet { border-radius: 0; height: 100%; width: 100%; }
  .focus-body { flex-direction: column; }
  .focus-form { flex: 1 1 auto; width: 100%; }
  .focus-clip img { max-height: 40vh; }
}

/* pricebox variants + summary breakdown */
.pricebox.big .num { font-size: 28px; }
.pricebox.good .num { color: var(--good); }
.pricebox.bad .num { color: var(--bad); }
.breakdown td { font-size: 15px; }
.breakdown td.neg::before { content: "− "; color: var(--muted); }
.breakdown td.right { font-variant-numeric: tabular-nums; }
.breakdown tr.rev td { font-weight: 600; }
.breakdown tr.total td { font-weight: 700; border-top: 2px solid var(--line); background: #faf7f0; }
.breakdown tr:last-child td { border-bottom: none; }

/* A save that did not land. Loud on purpose: the quiet version of this cost
   somebody a day's work. */
.savefail { position: sticky; top: 0; z-index: 40; padding: 12px 18px;
  background: var(--bad); color: #fff; font-weight: 600; line-height: 1.4; }
.savefail[hidden] { display: none; }
