:root { color-scheme: light; --ink: #17232c; --muted: #596b78; --line: #d5dfe5; --paper: #eef2f5; --accent: #006578; --accent-strong: #004e5d; }
body { background: var(--paper); font: 14px/1.45 "Segoe UI", Arial, sans-serif; color: var(--ink); }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; font-size: 14px; font-weight: 500; border-color: #beced7; border-radius: 4px; }
button:disabled { color: #82919a; background: #f4f6f8; cursor: not-allowed; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button svg { flex-shrink: 0; }
input, select, textarea { min-width: 0; font-size: 14px; border: 1px solid #c4d2db; border-radius: 4px; min-height: 38px; padding: 8px 10px; }
input::placeholder, textarea::placeholder { color: #73808a; opacity: 1; }
label { font-weight: 400; font-size: 12px; color: #364857; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.app-shell { max-width: 1440px; margin: 28px auto; padding: 0 24px; min-height: calc(100vh - 56px); grid-template-columns: minmax(0, 1.65fr) minmax(360px, 1fr); gap: 0 20px; align-content: start; align-items: start; background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 5px 26px #31444f08; }
.workspace-header { grid-column: 1 / -1; min-width: 0; }
.topbar { margin: 0 -24px; padding: 0 24px; min-height: 78px; gap: 22px; background: white; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.brand-logo, .login-logo { display: block; width: 194px; height: 35px; object-fit: contain; object-position: left center; }
.brand p { padding-left: 0; }
.login-logo { width: 236px; height: 42px; }
.brand h1 { font-size: 22px; line-height: 1.2; font-weight: 700; }
.brand p { font-size: 10px; color: var(--muted); margin-top: 3px; }
.tabs { align-self: stretch; flex: 1; align-items: stretch; gap: 6px; }
.tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; font-weight: 500; padding: 12px; }
.tab.active { color: var(--accent-strong); background: transparent; border-color: var(--accent); }
.tab:hover { background: #f2f7f8; }
.header-tools { display: flex; align-items: center; gap: 14px; }
.status-pill { background: transparent; border: 0; border-radius: 0; color: #217940; min-width: 0; padding: 0; font-size: 11px; white-space: nowrap; }
.status-pill::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.status-pill.offline { background: transparent; color: #8b5b10; }
#logoutBtn { padding: 6px 0; background: transparent; border: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.survey-heading { display: flex; align-items: center; gap: 20px; min-height: 114px; padding: 20px 4px; }
.property-heading { flex: 1; min-width: 0; font-size: 11px; gap: 0; color: var(--muted); }
.property-heading input { width: 100%; min-height: 43px; padding: 3px 0; font-size: 28px; line-height: 1.3; font-weight: 650; color: #14232f; background: transparent; border: 1px solid transparent; }
.property-heading input:hover { border-bottom-color: var(--line); }
.property-heading input:focus { padding-left: 8px; background: white; }
.address-field { display: flex; align-items: center; min-width: 0; gap: 6px; }
.address-field input { flex: 1; min-width: 0; }
#locateAddressBtn { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; color: var(--accent); border: 0; background: transparent; }
#locateAddressBtn:hover { background: #edf5f6; }
#locateAddressBtn[aria-busy="true"] { opacity: .5; cursor: progress; }
.location-status { font-size: 12px; color: var(--muted); margin-top: 5px; }
.address-dialog { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.address-dialog::backdrop { background: #17232c66; }
.address-dialog form { display: grid; gap: 16px; }
.address-dialog h2 { font-size: 20px; }
.address-dialog p { font-size: 13px; color: var(--muted); }
.address-dialog input { font-size: 16px; }
.address-dialog .address-attribution { font-size: 11px; }
.address-attribution a { color: var(--accent); }
.address-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.address-dialog-actions button { min-height: 44px; }
.draft-indicator { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #237340; white-space: nowrap; }
.draft-indicator svg { width: 16px; height: 16px; }
.top-actions { gap: 10px; flex-shrink: 0; }
.top-actions button { min-width: 100px; min-height: 42px; }
#saveSpecBtn { color: var(--accent-strong); border-color: #408493; }
#exportBtn { min-width: 135px; font-weight: 600; background: #006477; }
#newSpecBtn { min-width: 0; padding: 5px; font-size: 11px; border: 0; background: transparent; color: var(--muted); }
.summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-bottom: 24px; padding: 12px 0; background: #f7f9fb; border: 1px solid #dce4eb; border-radius: 5px; }
.summary-strip div { text-align: center; gap: 2px; padding: 4px 16px; background: transparent; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { text-transform: none; font-size: 12px; font-weight: 400; color: #3d5060; }
.summary-strip strong { font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; }
.entry-panel, .spec-panel { padding: 0; min-width: 0; background: white; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.workspace-section-title, .panel-heading { display: flex; align-items: center; min-height: 49px; margin: 0; padding: 12px 18px; background: #f7f9fb; border-bottom: 1px solid var(--line); }
.workspace-section-title, .panel-heading h2 { font-size: 17px; font-weight: 600; }
.panel-heading span { font-size: 11px; }
.entry-grid { margin: 0; padding: 16px 18px 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.entry-grid > label:not(.wide) { grid-column: 1; grid-row: 1; }
.entry-grid .preset-picker { grid-column: 2; grid-row: 1; gap: 6px; }
.entry-grid > label.wide { grid-column: 1 / -1; }
.preset-picker button { min-height: 38px; padding: 7px; font-size: 11px; }
.preset-picker:has(option:checked[value=""]) button { display: none; }
.query-label { gap: 0; }
.search-box { display: flex; align-items: center; }
.search-box > svg { position: absolute; left: 13px; width: 20px; height: 20px; color: #49616e; pointer-events: none; }
.search-box input { min-height: 45px; padding-left: 42px; padding-right: 44px; border-color: #4c8b9b; font-size: 16px; box-shadow: 0 1px 3px #3654690c; }
.clear-search { width: 36px; height: 36px; min-height: 36px; font-size: 24px; }
.survey-notes { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.survey-notes summary { cursor: pointer; padding: 0 0 3px; }
.survey-notes input { margin-top: 6px; }
.results { display: block; padding: 12px 18px 24px; border: 0; border-radius: 0; background: white; }
.result-caption { font-size: 12px; color: #425563; margin-bottom: 10px; }
.sor-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; border: 1px solid #d5dfe7; border-radius: 5px; overflow: hidden; }
.sor-col { width: 68px; }.rate-col { width: 76px; }.qty-col { width: 58px; }.resource-col { width: 88px; }.action-col { width: 87px; }
.sor-table th { padding: 12px 9px; text-align: left; font-size: 11px; font-weight: 500; color: #354957; background: #f2f5f8; border-bottom: 1px solid var(--line); border-right: 1px solid #e0e6eb; }
.sor-table th:last-child { border-right: 0; }
.sor-table .result { display: table-row; background: white; }
.sor-table td { padding: 15px 9px; vertical-align: middle; border: 0; border-bottom: 1px solid #e2e8ed; border-right: 1px solid #edf0f3; }
.sor-table td:last-child { border-right: 0; }
.sor-table tr:last-child td { border-bottom: 0; }
.result h3 { font-size: 14px; line-height: 1.45; font-weight: 400; margin: 0 0 5px; overflow-wrap: anywhere; }
.code { color: #006d86; font-size: 12px; font-weight: 400; margin: 0; }
.result .code { display: block; }
.result-detail { color: #5b6c7a; font-size: 11px; }.result-detail span { padding: 0 5px; color: #adb8c0; }
.money { min-width: 0; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
.money strong { font-weight: 600; }.money span { font-size: 10px; margin-top: 3px; }
.result-qty { min-height: 34px; padding: 6px 3px; text-align: center; font-size: 14px; }
.result-resource { min-height: 34px; padding: 6px 2px; font-size: 11px; }
.mobile-field-label { display: none; }
.action-cell button { width: 100%; min-height: 34px; padding: 5px 3px; color: var(--accent-strong); border-color: #6097a3; gap: 4px; font-size: 12px; }
.action-cell button.added { background: #edf8f0; border-color: transparent; color: #187b3c; }
.action-cell button.added:hover { background: #daf0e0; border-color: #8dbc9a; }
.action-cell svg { width: 15px; height: 15px; }
.hint, .empty { border: 0; border-radius: 0; color: var(--muted); background: white; font-size: 13px; padding: 24px 18px; }
.items { gap: 0; }.room-group { background: white; border-bottom: 1px solid var(--line); }
.room-group:last-child { border: 0; }
.room-group summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; font-size: 13px; cursor: pointer; list-style: none; background: #f1f5f8; }
.room-group summary::-webkit-details-marker { display: none; }
.room-group summary::before { content: ""; width: 6px; height: 6px; border-right: 1px solid #405667; border-bottom: 1px solid #405667; transform: rotate(-45deg); margin-right: 3px; }
.room-group[open] summary::before { transform: rotate(45deg); margin-top: -3px; }
.room-group summary span { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.room-group summary strong { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) 43px 60px 28px; gap: 10px; margin: 0 16px; padding: 20px 0; background: white; border: 0; border-bottom: 1px solid #e6ecf0; border-radius: 0; }
.item:last-child { border-bottom: 0; }
.item h3 { font-size: 14px; font-weight: 400; line-height: 1.5; margin-bottom: 4px; }
.item .code { flex-wrap: wrap; gap: 5px; }.item .code span { color: #697a85; font-size: 10px; font-weight: 400; }
.item p { font-size: 11px; margin-top: 5px; }
.item-quantity { font-size: 0; gap: 0; }
.item-quantity input { padding: 6px 2px; text-align: center; font-size: 14px; min-height: 32px; }
.item-price strong, .item-price span { display: block; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.item-price span { font-size: 10px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.remove-item { padding: 0; min-height: 36px; width: 28px; border: 0; background: transparent; color: #536a79; }.remove-item:hover { color: #ab3030; background: #fff1f1; }
.remove-item svg { width: 17px; height: 17px; }
.workspace-footer { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 16px; margin: 24px -24px 0; padding: 17px 24px; background: #fbfcfd; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; color: #277440; font-size: 11px; }
.sync-label { display: flex; align-items: center; gap: 8px; color: #4d6778; }
.save-status { font-weight: 400; font-size: 12px; margin: 0 0 12px; border: 0; border-radius: 4px; }
.export-choices { margin: 0 0 14px; }
.export-status { margin: 0 18px 18px; border-style: solid; }
.app-shell.panel-only { grid-template-columns: minmax(0, 1fr); }
.app-shell.panel-only .entry-panel, .app-shell.panel-only .summary-strip { display: none; }
.app-shell.panel-only .spec-panel { width: 100%; max-width: 1000px; justify-self: center; }
.spec-panel > div:not(.panel-heading):not(#itemsPanel) { padding: 18px; }
.admin-form, .measure-panel { border: 0; border-radius: 0; background: transparent; padding: 12px 0; }
@media (min-width: 921px) and (max-width: 1200px) {
  .app-shell { margin: 12px; padding: 0 16px; grid-template-columns: minmax(0, 1.7fr) minmax(310px, 1fr); gap: 0 14px; }
  .topbar { margin: 0 -16px; padding: 0 16px; gap: 14px; flex-wrap: wrap; }
  .tabs { order: 3; flex-basis: 100%; min-height: 44px; }.brand { padding-top: 12px; }.header-tools { margin-left: auto; }
  .draft-indicator { display: none; }.property-heading input { font-size: 23px; }
  .entry-grid { padding-inline: 12px; }.results { padding-inline: 12px; }
  .sor-col { width: 57px; }.rate-col { width: 63px; }.qty-col { width: 43px; }.resource-col { width: 73px; }.action-col { width: 65px; }
  .sor-table td, .sor-table th { padding-inline: 5px; }.result h3 { font-size: 12px; }
  .item { grid-template-columns: minmax(0, 1fr) 38px 54px 24px; gap: 7px; margin-inline: 12px; }
  .workspace-footer { margin-inline: -16px; }
}
@media (max-width: 920px) {
  .app-shell, .app-shell.panel-only { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; padding: 0 14px calc(94px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; min-height: 100vh; }
  .topbar { display: flex; position: relative; margin: 0 -14px; padding: 12px 14px; min-height: 67px; gap: 8px; border-radius: 0; }
  .topbar > div:first-child { min-width: 0; }.brand { gap: 7px; }.brand h1 { font-size: 19px; white-space: normal; }.brand p { font-size: 9px; }.brand-logo { width: 174px; height: 32px; }
  .header-tools { margin-left: auto; gap: 8px; }.status-pill { font-size: 10px; }
  .tabs, #logoutBtn, #newSpecBtn { display: none; }
  #mobileMenuBtn { display: inline-flex; height: 44px; width: 40px; min-height: 44px; padding: 0; border: 0; background: transparent; }
  #mobileMenuBtn span { display: none; }#mobileMenuBtn svg { width: 22px; height: 22px; }
  .mobile-menu { position: absolute; top: 66px; left: 14px; right: 14px; margin: 0; z-index: 30; padding: 8px; gap: 2px; }
  .mobile-menu button { justify-content: flex-start; min-height: 44px; border: 0; }
  .survey-heading { display: flex; flex-wrap: wrap; gap: 8px; padding: 19px 2px 16px; min-height: 0; }
  .property-heading { flex-basis: 100%; font-size: 10px; }.property-heading input { font-size: 23px; min-height: 36px; }
  .draft-indicator { font-size: 10px; }
  .top-actions { display: grid; position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; grid-template-columns: 1fr 1.3fr; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: white; border-top: 1px solid var(--line); }
  .top-actions #saveSpecBtn, .top-actions #exportBtn { grid-column: auto; grid-row: auto; width: 100%; min-width: 0; height: 46px; font-size: 16px; }
  #saveSpecBtn::after { content: none; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 18px; padding: 0; background: #fafbfd; }
  .summary-strip div { padding: 10px 6px; }.summary-strip div:first-child { grid-column: 1 / -1; border: 0; border-bottom: 1px solid var(--line); }
  .summary-strip span { font-size: 10px; }.summary-strip strong { font-size: 19px; }.summary-strip div:first-child strong { font-size: 25px; }
  .workspace-section-title, .panel-heading { min-height: 43px; padding: 10px 12px; }
  .workspace-section-title, .panel-heading h2 { font-size: 15px; }
  .entry-panel, .spec-panel, .app-shell.panel-only .spec-panel { padding: 0; max-width: 100%; border: 1px solid var(--line); scroll-margin-top: 12px; }
  .spec-panel { margin-top: 20px; }.app-shell.panel-only .spec-panel { margin-top: 0; }
  .entry-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 8px; padding: 12px 12px 0; }
  .entry-grid > label:not(.wide) { grid-column: 1; grid-row: 1; }.entry-grid .preset-picker { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: stretch; }
  .entry-grid > label.wide { grid-column: 1 / -1; }
  .entry-grid label { font-size: 11px; }input, select, textarea { font-size: 16px; min-height: 44px; }
  .preset-picker button { min-height: 38px; font-size: 12px; }
  .survey-notes { font-size: 11px; }
  .results { padding: 12px 0 0; }.result-caption { margin: 0 12px 8px; font-size: 11px; }
  .sor-table, .sor-table tbody { display: block; width: 100%; border: 0; border-radius: 0; }
  .sor-table thead, .sor-table colgroup { display: none; }
  .sor-table .result { display: grid; grid-template-columns: 58px minmax(0, 1fr) 92px; grid-template-areas: 'code code rate' 'description description description' 'qty resource action'; gap: 6px 8px; padding: 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
  .sor-table td { display: block; border: 0; padding: 0; min-width: 0; }
  .result-code { grid-area: code; }.result-description { grid-area: description; }.money { grid-area: rate; text-align: right; }.quantity-cell { grid-area: qty; }.resource-cell { grid-area: resource; }.action-cell { grid-area: action; align-self: end; }
  .result h3 { font-size: 13px; margin-bottom: 3px; }.result-detail { font-size: 10px; }.money span { display: none; }.money strong { font-size: 13px; }
  .mobile-field-label { display: inline; font-size: 10px; color: var(--muted); }.quantity-cell label, .resource-cell label { gap: 3px; }
  .result-qty, .result-resource { font-size: 16px; min-height: 44px; padding: 6px; }.action-cell button { min-height: 44px; font-size: 13px; }
  .item { grid-template-columns: minmax(0, 1fr) 42px 52px 28px; gap: 7px; padding: 16px 0; margin-inline: 12px; }.item h3 { font-size: 13px; }.item-quantity input { font-size: 16px; min-height: 44px; }.remove-item { min-height: 44px; }
  .room-group summary { padding: 12px; font-size: 13px; }
  .workspace-footer { margin: 20px 0 0; padding: 12px 0; font-size: 10px; border-radius: 0; flex-wrap: wrap; gap: 6px; background: white; }
  .save-status, .export-choices { position: fixed; left: 14px; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 27; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 4px 20px #24384219; }
  .export-choices { background: white; }.export-choices button { flex: 1; min-height: 44px; }.save-status { font-size: 12px; }
  .spec-panel > div:not(.panel-heading):not(#itemsPanel) { padding: 12px; }
  .measure-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
