/* HK OPS -- editorial, typographic, square. Hairlines instead of cards; no pills, no glow. */
:root {
  --paper: #f3f1ec;
  --panel: #f9f8f4;
  --ink: #131313;
  --mute: #6c6860;
  --faint: #a6a196;
  --rule: #d8d4c9;
  --wash: rgba(19, 19, 19, 0.035);
  --ok: #1e6a3b;
  --warn: #96600a;
  --bad: #a5281c;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --nav: 208px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
a.u, .link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 32px; font-weight: 300; letter-spacing: -0.015em; line-height: 1.1; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
h3 { font-size: 15px; font-weight: 500; }
.micro { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.sig { display: inline-flex; align-items: baseline; gap: 8px; }
.sig::before { content: ""; width: 7px; height: 7px; background: currentColor; flex: none; transform: translateY(-1px); }

/* shell */
#nav { position: fixed; inset: 0 auto 0 0; width: var(--nav); border-right: 1px solid var(--rule); padding: 30px 26px 24px; display: flex; flex-direction: column; background: var(--paper); z-index: 5; }
.mark { font-size: 21px; font-weight: 700; letter-spacing: 0.02em; display: block; margin-bottom: 44px; }
.mark span { font-weight: 300; letter-spacing: 0.3em; margin-left: 7px; }
#links { display: flex; flex-direction: column; }
#links a { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--mute); padding: 9px 0; border-bottom: 1px solid transparent; }
#links a:hover { color: var(--ink); }
#links a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
#links .gap { height: 22px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
#status { min-height: 15px; }
#status.bad { color: var(--bad); }
#view { margin-left: var(--nav); padding: 38px 46px 140px; max-width: 1420px; }

/* page furniture */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--ink); margin-bottom: 30px; }
.head .sub { margin-top: 8px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
section.blk { margin-bottom: 44px; }
.blk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 46px; }
.note { border-left: 1px solid var(--ink); padding: 2px 0 2px 14px; color: var(--mute); font-size: 12.5px; max-width: 760px; }

/* buttons */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { background: transparent; border: 1px solid var(--ink); padding: 10px 16px; font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase; white-space: nowrap; border-radius: 0; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.solid { background: var(--ink); color: var(--paper); }
.btn.solid:hover { background: transparent; color: var(--ink); }
.btn[disabled] { opacity: 0.35; pointer-events: none; }
.link { background: none; border: 0; padding: 0; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.link:hover { color: var(--ink); }
.link.bad:hover { color: var(--bad); }
.x { background: none; border: 0; padding: 2px 6px; color: var(--faint); font-size: 15px; line-height: 1; }
.x:hover { color: var(--bad); }

/* inputs */
input, select, textarea { font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 6px 0; width: 100%; outline: none; min-width: 0; }
input:hover, select:hover, textarea:hover { border-bottom-color: var(--faint); }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
textarea { resize: vertical; min-height: 62px; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 16px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%236c6860'/%3E%3C/svg%3E") no-repeat right 2px center; cursor: pointer; }
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border: 1px solid var(--ink); padding: 0; margin: 0; flex: none; cursor: pointer; vertical-align: -2px; }
input[type=checkbox]:checked { background: var(--ink); box-shadow: inset 0 0 0 2px var(--paper); }
input[type=date] { font-variant-numeric: tabular-nums; }
.chk { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field > .micro { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field .hint { font-size: 11.5px; color: var(--faint); }
.grid { display: grid; gap: 20px 30px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; } .span4 { grid-column: 1 / -1; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { font-size: 10.5px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); text-align: left; padding: 0 20px 9px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; vertical-align: bottom; }
td { padding: 10px 20px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th:last-child, td:last-child { padding-right: 0; }
tr.go { cursor: pointer; }
tr.go:hover td { background: var(--wash); }
td input, td select { border-bottom-color: transparent; padding: 3px 0; }
td input:hover, td select:hover { border-bottom-color: var(--rule); }
td input:focus, td select:focus { border-bottom-color: var(--ink); }
td.tight { width: 1%; white-space: nowrap; }
tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 600; }
tr.grp td { padding-top: 22px; border-bottom-color: var(--ink); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.empty { padding: 26px 0; color: var(--faint); border-bottom: 1px solid var(--rule); }
.t2 { display: block; color: var(--mute); font-size: 12.5px; margin-top: 1px; }

/* metrics: a ruled grid, not cards */
.metrics { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.metric { padding: 16px 20px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-width: 0; }
.metric.first { padding-left: 0; }
.metric.last { border-right: 0; padding-right: 0; }
.metric .v { font-size: 28px; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 8px; line-height: 1.1; overflow-wrap: anywhere; }
.metric .d { font-size: 12px; color: var(--mute); margin-top: 5px; }

/* tabs */
.tabs { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 26px; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 1px solid transparent; padding: 0 0 6px; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--mute); }
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tabs sup { font-size: 9.5px; margin-left: 4px; letter-spacing: 0; font-weight: 400; color: var(--mute); }

/* funnel */
.funnel { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.funnel a { padding: 14px 12px 16px 0; border-bottom: 1px solid var(--rule); display: block; min-width: 0; }
.funnel .c { font-size: 24px; font-weight: 300; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.funnel .bar { height: 2px; background: var(--ink); margin-top: 10px; min-width: 1px; }
.funnel a:hover { background: var(--wash); }
.funnel .zero { color: var(--faint); }

/* alerts */
.alerts { border-top: 1px solid var(--ink); margin-bottom: 40px; }
.alerts a { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.alerts a:hover { background: var(--wash); }
.alerts .go { color: var(--faint); }
.info { color: var(--mute); }

/* estimator */
.est { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 0 46px; align-items: start; }
.est-side { position: sticky; top: 24px; border-left: 1px solid var(--rule); padding-left: 34px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.room { border-top: 1px solid var(--ink); padding: 16px 0 26px; }
.room-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; }
.room-head input.name { font-size: 18px; font-weight: 400; border-bottom-color: transparent; flex: 1; }
.room-head .presets { display: flex; gap: 14px; white-space: nowrap; }
.room-sum { font-size: 12.5px; color: var(--mute); margin: 12px 0 14px; font-variant-numeric: tabular-nums; }
.room-sum b { color: var(--ink); font-weight: 500; }
.tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 34px; }
.task { display: grid; grid-template-columns: 1fr 62px 22px 34px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.task.off .q, .task.off .u, .task.off .c { opacity: 0.3; }
.task input.num { padding: 2px 0; border-bottom-color: transparent; }
.task .u { font-size: 11px; color: var(--mute); }
.room-opts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 14px; }
.add-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; padding: 14px 0; border-top: 1px solid var(--ink); }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--rule); margin: 16px 0 22px; }
.tier { background: none; border: 0; border-top: 2px solid transparent; border-right: 1px solid var(--rule); padding: 12px 10px 14px 0; margin-right: 10px; text-align: left; min-width: 0; }
.tier:last-child { border-right: 0; margin-right: 0; }
.tier.on { border-top-color: var(--ink); }
.tier .p { font-size: 23px; font-weight: 300; font-variant-numeric: tabular-nums; margin-top: 6px; letter-spacing: -0.02em; }
.tier:not(.on) .p, .tier:not(.on) .micro { color: var(--faint); }
.tier:hover .p { color: var(--ink); }
.price-row { display: flex; align-items: baseline; gap: 12px; }
.price-row .cur { font-size: 30px; font-weight: 300; }
.price-row input { font-size: 44px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; padding: 0; border-bottom-color: var(--rule); }
.band { position: relative; height: 64px; margin: 20px 0 8px; }
.band .track { position: absolute; left: 0; right: 0; top: 30px; height: 1px; background: var(--rule); }
.band .range { position: absolute; top: 29px; height: 3px; background: var(--ink); }
.band .tick { position: absolute; top: 22px; width: 1px; height: 17px; background: var(--ink); }
.band .tick.me { top: 16px; height: 29px; width: 2px; margin-left: -1px; }
.band .lab { position: absolute; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute); white-space: nowrap; transform: translateX(-50%); }
.band .lab.top { top: 0; } .band .lab.bot { top: 46px; }
.band .lab.me { color: var(--ink); font-weight: 600; }
.band .lab.l { transform: none; } .band .lab.r { transform: translateX(-100%); }
.kv { width: 100%; }
.kv td { padding: 6px 0; font-size: 13px; }
.kv td.n { padding-left: 12px; }
.kv tr.sum td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 600; padding-top: 9px; }
.side-h { margin: 28px 0 8px; display: flex; justify-content: space-between; align-items: baseline; }
.flags { display: flex; flex-direction: column; gap: 7px; margin: 16px 0 4px; font-size: 13px; }
.warns { margin-top: 14px; font-size: 12.5px; color: var(--warn); display: flex; flex-direction: column; gap: 5px; }
.bom td { font-size: 12.5px; padding: 7px 10px 7px 0; }
.bom .t2 { font-size: 11.5px; }

/* sheet (modal): a ruled panel, no shadow, no rounding */
#sheet { position: fixed; inset: 0; background: rgba(243, 241, 236, 0.9); display: flex; align-items: flex-start; justify-content: center; padding-top: 16vh; z-index: 20; }
#sheet .box { background: var(--panel); border: 1px solid var(--ink); width: min(520px, calc(100vw - 40px)); padding: 28px 30px 26px; }
#sheet .box h3 { font-size: 20px; font-weight: 300; margin-bottom: 8px; }
#sheet .box p { color: var(--mute); margin-bottom: 18px; }
#sheet .box .actions { margin-top: 24px; justify-content: flex-end; }

/* deal screener */
.verdict { font-size: 44px; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.timeline { border-top: 1px solid var(--ink); }
.timeline div { display: grid; grid-template-columns: 118px 1fr; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.vat { height: 1px; background: var(--rule); position: relative; margin-top: 12px; }
.vat i { position: absolute; left: 0; top: -1px; height: 3px; background: var(--ink); }

@media (max-width: 1180px) {
  .est { grid-template-columns: minmax(0, 1fr); }
  .est-side { position: static; border-left: 0; padding-left: 0; max-height: none; border-top: 1px solid var(--ink); padding-top: 22px; margin-top: 30px; }
  .funnel { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  #nav { position: static; width: auto; flex-direction: row; align-items: center; gap: 22px; padding: 14px 18px; border-right: 0; border-bottom: 1px solid var(--rule); overflow-x: auto; }
  .mark { margin: 0; white-space: nowrap; }
  #links { flex-direction: row; gap: 18px; white-space: nowrap; }
  #links .gap { display: none; }
  .nav-foot { margin: 0 0 0 auto; flex-direction: row; white-space: nowrap; }
  #view { margin-left: 0; padding: 26px 18px 100px; }
  .cols, .tasks { grid-template-columns: minmax(0, 1fr); }
  .grid, .grid.g3, .grid.g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3 { grid-column: 1 / -1; }
  .room-head { flex-wrap: wrap; gap: 10px 18px; }
  .room-head input.name { flex-basis: 100%; }
  .funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blk > table, .blk > .add-row { max-width: 100%; }
  section.blk { overflow-x: auto; }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .metrics { --cols: 2 !important; }
  .metric, .metric.first, .metric.last { padding: 14px 12px 16px 0; border-right: 0; }
  .head { flex-direction: column; align-items: flex-start; }
  h1 { font-size: 26px; }
  .tablewrap { overflow-x: auto; }
}
@media print { #nav, .actions { display: none; } #view { margin: 0; padding: 0; } }

.grid + .metrics { margin-top: 26px; }

.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-bottom: 14px; }
td .nw { white-space: nowrap; }

.preset-row { display: grid; grid-template-columns: 170px 1fr; gap: 10px 20px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.preset-list { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.preset-list .link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.preset-list .link:hover { color: var(--mute); }
@media (max-width: 860px) { .preset-row { grid-template-columns: minmax(0, 1fr); } }

/* Field library and room diagnosis */
.library-legend { display: flex; flex-wrap: wrap; gap: 12px 26px; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.library-poster { display: block; border: 1px solid var(--rule); background: #fff; overflow: hidden; }
.library-poster img { display: block; width: 100%; height: auto; }
.library-flow, .library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.library-flow > div, .library-card { border-top: 1px solid var(--ink); padding-top: 12px; }
.library-flow h3 { margin: 8px 0 5px; }
.library-toolbar { margin: 16px 0; }
.library-frame { width: 100%; height: 590px; border: 1px solid var(--rule); background: white; }
.library-card { display: flex; flex-direction: column; gap: 9px; min-height: 170px; }
.library-card .actions { margin-top: auto; }
.diagnostic { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-top: 22px; padding: 11px 0; }
.diagnostic > summary, .diag-gate > summary { cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; }
.diagnostic > summary::-webkit-details-marker, .diag-gate > summary::-webkit-details-marker { display: none; }
.diagnostic > summary::before, .diag-gate > summary::before { content: '+ '; color: var(--mute); }
.diagnostic[open] > summary::before, .diag-gate[open] > summary::before { content: '− '; }
.diagnostic-intro { margin: 12px 0; }
.diag-gate { border-top: 1px solid var(--rule); padding: 8px 0; }
.diag-gate .micro { display: block; margin: 5px 0 10px; }
.diag-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 20px; margin-bottom: 12px; }
.diag-multi { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.diag-status { margin: 12px 0; border-left: 2px solid var(--rule); padding-left: 12px; }
.diag-status.stop { border-color: var(--bad); } .diag-status.test { border-color: var(--warn); } .diag-status.go { border-color: var(--ok); }
.diag-status p { margin: 4px 0; }
.diag-status ul { margin: 8px 0; padding-left: 17px; }
.board-allowance { grid-column: 1 / -1; padding: 2px 0 5px 22px; }
.board-allowance input { max-width: 230px; }
.diag-photo { display: grid; gap: 6px; border-top: 1px solid var(--rule); padding: 14px 0; }
.diag-photo input[type=file] { max-width: 360px; }
.survey-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.survey-gallery a { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid var(--rule); padding-top: 8px; }
.survey-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: white; }
@media (max-width: 860px) { .library-flow, .library-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.library-frame { height: 480px; } }
@media (max-width: 550px) { .library-flow, .library-grid, .diag-fields { grid-template-columns: 1fr; } }
.website-dashboard-alert { display: flex; justify-content: space-between; align-items: center; gap: 15px;
  padding: 18px 22px; margin-bottom: 25px; border-left: 4px solid #d55343; background: #fff5ee;
  color: #2b302b; text-decoration: none; }
.website-dashboard-alert:hover { background: #ffe9dd; }
.website-request-facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 9px 16px; margin: 0; font-size: 14px; }
.website-request-facts dt { color: #626861; font-weight: 650; }
.website-request-facts dd { margin: 0; overflow-wrap: anywhere; }
.website-quote-list { display: grid; gap: 12px; }
.website-quote-list > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 11px 0; border-bottom: 1px solid #ddd; }
.website-estimator-brief { display: grid; gap: 7px; margin: 0 0 22px; padding: 17px 22px; border-left: 4px solid #d55343; background: #fff8f1; font-size: 13px; line-height: 1.5; }
.website-estimator-brief strong { font-size: 15px; }
.website-estimator-brief p { margin: 0; white-space: pre-wrap; }
.website-estimator-brief a { font-weight: 700; text-decoration: underline; }
