:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background: #101112;
  color: #f4f4f5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(145deg, #111214, #202226);
  min-height: 100vh;
}
.shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}
aside {
  background: #0a0b0d;
  border-right: 1px solid #303238;
  padding: 25px 16px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 1.05rem;
  line-height: 1.1;
}
.brand span {
  background: #f0a54a;
  color: #141414;
  font-weight: 950;
  border-radius: 9px;
  padding: 9px;
}
.sidebar {
  display: grid;
  gap: 7px;
  margin-top: 35px;
}
.sidebar button {
  width: 100%;
  text-align: left;
}
.side-note {
  margin-top: auto;
  color: #757982;
  font-size: 0.85rem;
}
.app {
  max-width: 1040px;
  width: 100%;
  padding: 30px 28px 70px;
  margin: 0 auto;
}
.top,
.section-head,
.actions,
.quote-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: #f0a54a;
  margin: 0 0 5px;
}
h1,
h2 {
  margin: 0;
  color: #fff;
}
h1 {
  font-size: 2rem;
}
h2 {
  font-size: 1.25rem;
}
p {
  color: #aeb1b7;
}
.tabs {
  display: none;
}
.tab {
  display: none;
}
.tab.active {
  display: block;
}
.hero {
  background: radial-gradient(circle at 80% 20%, #3d3a35, #18191c 62%);
  border: 1px solid #383a40;
  border-radius: 18px;
  padding: 32px;
  margin-top: 22px;
}
.hero h2 {
  font-size: 1.75rem;
  max-width: 510px;
}
.hero p:not(.eyebrow) {
  max-width: 620px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}
.metrics article,
.card {
  background: #1a1b1e;
  border: 1px solid #35373c;
  border-radius: 14px;
}
.metrics article {
  padding: 16px;
}
.metrics span {
  color: #aeb1b7;
  font-size: 0.85rem;
  display: block;
}
.metrics strong {
  font-size: 1.7rem;
  color: #fff;
}
.card {
  padding: 20px;
  margin-top: 14px;
  box-shadow: 0 12px 32px #0003;
}
.quote-head {
  margin: 22px 0 0;
}
.pill {
  background: #354f2b;
  color: #e3f6d9;
  padding: 6px 9px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}
.muted {
  background: #34363a;
  color: #dedfe2;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
label {
  display: block;
  color: #e1e2e4;
  font-size: 0.87rem;
  font-weight: 750;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: #111214;
  border: 1px solid #474950;
  color: #f4f4f5;
  border-radius: 8px;
  padding: 11px;
  font: inherit;
}
textarea {
  resize: vertical;
}
button,
.upload {
  border: 1px solid #45474d;
  background: #282a2e;
  color: #fff;
  padding: 10px 13px;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.primary {
  background: linear-gradient(90deg, #f6ae4b, #ed7b3f);
  border: 0;
  color: #20140d;
}
.actions {
  margin-top: 14px;
  align-items: stretch;
  flex-wrap: wrap;
}
.product-catalog-picker {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #725b32;
  border-left: 4px solid #f0a54a;
  border-radius: 10px;
  background: #211c15;
}
.product-catalog-picker[hidden] {
  display: none;
}
.product-catalog-picker label {
  color: #f2c67e;
}
.product-catalog-picker select {
  background: #111214;
}
.product-catalog-actions {
  justify-content: flex-start;
}
.product-catalog-help {
  margin: 10px 0 0;
  font-size: 0.82rem;
}
.upload {
  display: inline-block;
}
.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.attachment {
  background: #272a2f;
  color: #f2c67e;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 0.85rem;
}
.line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 155px 120px auto;
  gap: 10px;
  align-items: end;
  padding: 13px 0;
  border-bottom: 1px solid #32343a;
}
.quote-price-help {
  margin: 2px 0 5px;
  color: #f2c67e;
  font-size: 0.82rem;
}
.quote-price {
  border-color: #a56b2b;
  background: #16120d;
}
.line label {
  font-size: 0.78rem;
}
.lineTotal {
  grid-column: 4;
  grid-row: 1;
  text-align: right;
  padding: 11px 0;
}
.line > .remove {
  grid-column: 5;
  grid-row: 1;
}
.line-supplier {
  grid-column: 1 / span 2;
  grid-row: 2;
}
.line-location {
  grid-column: 3 / span 3;
  grid-row: 2;
}
.report-item-detail {
  display: block;
  margin-top: 3px;
  color: #5e6672;
  font-size: 0.74rem;
}
.totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}
.totals div {
  padding: 13px;
  display: flex;
  justify-content: space-between;
  background: #121316;
  border: 1px solid #34363a;
  border-radius: 8px;
}
.totals span {
  color: #b2b4b9;
}
.totals .profit {
  border-color: #67613a;
  color: #f4d68e;
}
.nec {
  border-color: #494237;
}
.notice {
  font-size: 0.88rem;
  background: #272117;
  color: #e7d19a;
  padding: 10px;
  border-radius: 7px;
}
.check {
  margin: 12px 0;
}
.check input {
  display: inline;
  width: auto;
  margin: 0 8px 0 0;
}
.status {
  color: #a8e391;
  font-weight: 800;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}
th,
td {
  text-align: left;
  padding: 6px;
  color: #d9dade;
}
.history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.history button {
  text-align: left;
  background: #131417;
  border-color: #33353a;
}
.history button:hover {
  border-color: #f0a54a;
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  aside {
    position: sticky;
    top: 0;
    z-index: 4;
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid #303238;
  }
  .brand {
    display: none;
  }
  .sidebar {
    display: flex;
    margin: 0;
    gap: 6px;
    overflow: auto;
  }
  .sidebar button {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 8px;
  }
  .side-note {
    display: none;
  }
  .app {
    padding: 20px 12px 56px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .line {
    grid-template-columns: 1fr 1fr;
  }
  .line .product {
    grid-column: span 2;
  }
  .line-supplier,
  .line-location {
    grid-column: span 2;
    grid-row: auto;
  }
  .lineTotal {
    grid-column: auto;
    grid-row: auto;
    text-align: left;
    padding: 0;
  }
  .line > .remove {
    grid-column: auto;
    grid-row: auto;
  }
  .totals {
    grid-template-columns: 1fr;
  }
  .top {
    align-items: flex-start;
  }
  .hero {
    padding: 23px;
  }
  .section-head {
    align-items: flex-start;
  }
  .history button {
    white-space: normal;
  }
}
.invoice-preview {
  margin-top: 16px;
}
.paper {
  margin-top: 16px;
  background: #fff;
  color: #1c1d20;
  border-radius: 10px;
  padding: 26px;
  min-height: 250px;
}
.paper h3,
.paper h4 {
  color: #101217;
  margin: 0 0 9px;
}
.invoice-meta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #d6d8dc;
}
.invoice-client {
  margin: 18px 0;
}
.paper table {
  width: 100%;
  border-collapse: collapse;
}
.paper th,
.paper td {
  padding: 9px 5px;
  border-bottom: 1px solid #e2e4e8;
  color: #1d2025;
}
.paper th {
  text-align: left;
  color: #5e6672;
}
.paper .invoice-total {
  font-size: 1.25rem;
  text-align: right;
  margin-top: 20px;
  font-weight: 900;
}
.professional-report {
  max-width: 900px;
  margin-inline: auto;
  padding: 52px 64px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
}
.report-company h3 {
  margin: 0;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}
.report-company p {
  margin: 4px 0 0;
  color: #42464c;
}
.report-title {
  max-width: 720px;
  margin: 48px auto 34px;
  color: #0e1115;
  font-size: 1.75rem;
  line-height: 1.15;
  text-align: center;
}
.report-client-meta {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  margin-bottom: 16px;
}
.report-client-meta strong,
.report-client-meta span {
  display: block;
}
.report-client-meta span {
  margin-top: 3px;
}
.report-meta-line {
  margin: 0 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid #cfd3d8;
  color: #4b5159;
}
.pdf-calculation-section {
  margin: 24px 0;
  break-inside: avoid;
}
.pdf-calculation-section h2 {
  margin: 0 0 8px;
  color: #111;
  font-size: 1.25rem;
}
.pdf-code-basis {
  margin: 0 0 12px;
  color: #4d535b;
  font-size: 0.84rem;
}
.pdf-calculation-section dl {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  margin: 0;
}
.pdf-calculation-section dt,
.pdf-calculation-section dd {
  margin: 0;
  padding: 5px 8px;
  border-bottom: 1px solid #e1e3e6;
}
.pdf-calculation-section dd {
  font-weight: 700;
  text-align: right;
}
.pdf-conclusion {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #252a30;
  background: #f2f3f4;
}
.report-items {
  margin-top: 12px;
  break-inside: auto;
}
.report-items tr {
  break-inside: avoid;
}
.report-footer {
  margin-top: 34px;
  padding-top: 12px;
  border-top: 1px solid #cfd3d8;
  color: #5b6169;
  font-size: 0.72rem;
}
.permit-report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.permit-report-badge {
  padding: 7px 10px;
  border: 1px solid #22272d;
  color: #22272d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.permit-project-grid {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 10px 24px;
  margin: 18px 0 22px;
  padding: 14px 0;
  border-top: 1px solid #cfd3d8;
  border-bottom: 1px solid #cfd3d8;
}
.permit-project-grid div {
  break-inside: avoid;
}
.permit-project-grid strong,
.permit-project-grid span {
  display: block;
}
.permit-project-grid strong {
  color: #555c65;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.permit-project-grid span {
  margin-top: 3px;
}
.permit-formula-table {
  margin-top: 10px;
  break-inside: auto;
}
.permit-formula-table tr {
  break-inside: avoid;
}
.permit-formula-table th:last-child,
.permit-formula-table td:last-child {
  text-align: right;
}
.permit-result-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  break-inside: avoid;
}
.permit-ev-section {
  margin-top: 26px;
  break-inside: avoid;
}
.permit-result-box div {
  padding: 11px;
  border: 1px solid #c5c9ce;
  background: #f5f6f7;
}
.permit-result-box span,
.permit-result-box strong {
  display: block;
}
.permit-result-box span {
  color: #59606a;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.permit-result-box strong {
  margin-top: 4px;
  color: #11151a;
}
.permit-review-block {
  margin-top: 28px;
  padding: 14px;
  border: 1px solid #adb3ba;
  break-inside: avoid;
}
.permit-review-block h3 {
  margin-bottom: 8px;
}
.permit-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 38px;
}
.permit-signature-line {
  padding-top: 5px;
  border-top: 1px solid #1e2329;
  color: #4e555e;
  font-size: 0.72rem;
}
.permit-disclaimer {
  margin-top: 24px;
  padding: 10px 12px;
  border: 1px solid #b9bec4;
  background: #f3f4f5;
  color: #444a52;
  font-size: 0.74rem;
  break-inside: avoid;
}
.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid #33353a;
  background: #131417;
  border-radius: 8px;
}
.quote-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.quote-actions button {
  padding: 7px 9px;
  font-size: 0.8rem;
}
@media (max-width: 620px) {
  .quote-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .invoice-meta {
    display: block;
  }
  .invoice-meta > div + div {
    margin-top: 15px;
  }
}
@media print {
  @page {
    size: letter;
    margin: 0.55in;
  }
  body {
    background: #fff;
  }
  .shell > aside,
  .top,
  .tabs,
  .sidebar,
  .card:not(.invoice-preview),
  #invoiceHistory,
  .invoice-preview > .section-head {
    display: none !important;
  }
  .shell,
  .app {
    display: block;
    padding: 0;
    margin: 0;
    max-width: none;
  }
  .invoice-preview {
    display: block !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .paper {
    border: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    color: #111 !important;
    min-height: 0 !important;
    padding: 0 !important;
  }
  .professional-report {
    max-width: none !important;
    font-size: 10.5pt;
  }
  .report-title {
    margin-top: 0.45in;
    font-size: 19pt;
  }
  .permit-report-header,
  .permit-ev-section,
  .permit-review-block,
  .permit-result-box,
  .permit-disclaimer {
    break-inside: avoid;
  }
}
.app-hidden {
  display: none;
}
.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 0, #2a2b30, #101112 65%);
}
.auth-card {
  width: min(430px, 100%);
  background: #1a1b1e;
  border: 1px solid #383a40;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 18px 60px #0008;
}
.auth-card h1 {
  font-size: 1.55rem;
}
.auth-card label {
  margin: 22px 0 14px;
}
.auth-card button {
  width: 100%;
}
.auth-error {
  min-height: 1.2em;
  color: #ffb4a7;
  font-weight: 700;
  font-size: 0.9rem;
}
[hidden] {
  display: none !important;
}
.ai-panel {
  border-color: #5b4a2e;
}
.analysis-result {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.source-grid article {
  background: #121316;
  border: 1px solid #34363a;
  border-radius: 9px;
  padding: 14px;
}
.source-grid span {
  display: block;
  color: #aeb1b7;
  font-size: 0.82rem;
}
.source-grid strong {
  display: block;
  margin-top: 5px;
  color: #f2c67e;
}
.market-products {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.market-product {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: #121316;
  border: 1px solid #34363a;
  border-radius: 8px;
}
.market-product span {
  color: #b9bbc0;
}
.json-link {
  display: inline-block;
  color: #f0b85f;
  font-weight: 800;
  margin-top: 6px;
}
@media (max-width: 620px) {
  .source-grid {
    grid-template-columns: 1fr;
  }
  .market-product {
    grid-template-columns: 1fr;
  }
}
.lookup-home-depot {
  display: block;
  margin-top: 7px;
  padding: 6px 8px;
  font-size: 0.76rem;
}
.market-results {
  display: grid;
  gap: 9px;
  margin: 14px 0;
}
.market-result {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: #121316;
  border: 1px solid #45474d;
  border-radius: 9px;
}
.market-result strong,
.market-result span {
  display: block;
}
.market-result span {
  color: #b9bbc0;
  margin-top: 4px;
}
.market-result button {
  white-space: nowrap;
}
.json-view {
  margin-top: 12px;
}
.json-view summary {
  cursor: pointer;
  color: #f0b85f;
  font-weight: 800;
}
.json-view pre {
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
  background: #0d0e10;
  border: 1px solid #34363a;
  border-radius: 8px;
  color: #d9dadd;
  font-size: 0.78rem;
}
@media (max-width: 620px) {
  .market-result {
    grid-template-columns: 1fr;
  }
  .market-result button {
    width: 100%;
  }
}
.price-book-editor {
  border-color: #6b5531;
}
.price-book-editor .table-wrap {
  margin-top: 14px;
}
.price-book-editor tbody tr:focus-within {
  background: #242018;
}
.price-book-editor input {
  min-width: 110px;
}
.price-book-editor .name {
  min-width: 210px;
}
.price-book-editor .unit {
  min-width: 92px;
}
.price-book-editor .book-quantity {
  min-width: 105px;
}
.price-book-editor .book-total {
  display: inline-block;
  min-width: 95px;
  color: #f2c67e;
  font-size: 0.95rem;
  white-space: nowrap;
}
.price-book-formula-help {
  color: #f2c67e;
  font-weight: 750;
}
.price-book-status {
  min-height: 1.25em;
  margin: 10px 0 0;
  color: #a8e391;
  font-weight: 800;
}
@media (max-width: 620px) {
  .price-book-editor .section-head {
    display: grid;
  }
  .price-book-editor #addProduct {
    width: 100%;
  }
}
.lookup-home-depot {
  width: 100%;
  min-height: 44px;
  margin-top: 9px;
  background: linear-gradient(90deg, #f6ae4b, #ed7b3f);
  border: 0;
  color: #20140d;
  font-size: 0.86rem;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}
.lookup-home-depot:hover {
  filter: brightness(1.08);
}
.lookup-home-depot:active {
  transform: translateY(1px);
}
.lookup-home-depot:disabled {
  cursor: wait;
  opacity: 0.68;
}
.sms-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  color: #d8d9dc;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}
.sms-consent input {
  display: inline-block;
  width: auto;
  flex: 0 0 auto;
  margin: 2px 0 0;
}
.sms-consent-note {
  display: block;
  margin-top: 6px;
  color: #f2c67e;
  font-size: 0.76rem;
  font-weight: 750;
}
.sms-consent-note.authorized {
  color: #a8e391;
}
.workspace-landing {
  position: relative;
  overflow: hidden;
  min-height: 820px;
  margin-top: 22px;
  padding: 42px 42px 48px;
  border: 1px solid #4a4030;
  border-radius: 24px;
  background: radial-gradient(
    circle at 72% 8%,
    #34302a 0,
    #1a1b1e 42%,
    #111214 100%
  );
  box-shadow: 0 24px 70px #0006;
}
.workspace-landing:after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(115deg, #0000 0 52%, #f0a54a12 100%);
  pointer-events: none;
}
.landing-heading {
  position: relative;
  z-index: 2;
  min-height: 28px;
}
.landing-heading .eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
}
.folder-stage {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 66px auto 0;
  padding: 0 24px;
}
.folder-grid {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 132px));
  justify-content: center;
  align-items: end;
  gap: 22px;
}
.workspace-folder {
  position: relative;
  appearance: none;
  text-align: left;
  min-width: 0;
  min-height: 122px;
  padding: 11px 6px 6px;
  border: 1px solid #f9cb7a;
  background: linear-gradient(145deg, #f5b553, #cf7625);
  border-radius: 8px 8px 11px 11px;
  color: #20140d;
  box-shadow:
    0 15px 24px #0008,
    inset 0 1px #fff8;
  transition:
    transform 0.18s ease,
    filter 0.18s ease,
    box-shadow 0.18s ease;
  overflow: visible;
}
.workspace-folder:hover,
.workspace-folder:focus-visible {
  transform: translateY(-6px);
  filter: brightness(1.07);
  box-shadow:
    0 22px 30px #0009,
    inset 0 1px #fff8;
  outline: 2px solid #fff;
  outline-offset: 3px;
}
.workspace-folder:nth-child(2) {
  transform: rotate(0.65deg);
}
.workspace-folder:nth-child(2):hover,
.workspace-folder:nth-child(2):focus-visible {
  transform: translateY(-6px) rotate(0.2deg);
}
.workspace-folder:nth-child(3) {
  transform: rotate(-0.55deg);
}
.workspace-folder:nth-child(3):hover,
.workspace-folder:nth-child(3):focus-visible {
  transform: translateY(-6px) rotate(-0.15deg);
}
.workspace-folder:nth-child(4) {
  transform: rotate(0.4deg);
}
.workspace-folder:nth-child(4):hover,
.workspace-folder:nth-child(4):focus-visible {
  transform: translateY(-6px) rotate(0.1deg);
}
.approved-folder {
  border-color: #a7df8c;
  background: linear-gradient(145deg, #c1e89e, #629b52);
}
.approved-folder .folder-tab {
  border-color: #c8efae;
  background: linear-gradient(145deg, #d6f5b9, #76b862);
}
.approved-folder .sheet-title {
  border-bottom-color: #69a95a;
}
.folder-tab {
  position: absolute;
  left: -1px;
  top: -22px;
  display: flex;
  align-items: center;
  width: 78%;
  height: 27px;
  padding: 0 7px;
  border: 1px solid #f9cb7a;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(145deg, #ffc96c, #e08b31);
  color: #24170d;
  font-size: 0.61rem;
  font-weight: 950;
  letter-spacing: 0.01em;
  clip-path: polygon(0 0, 84% 0, 100% 100%, 0 100%);
}
.folder-sheet {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 82px;
  padding: 7px;
  border: 1px solid #d2c9b7;
  border-radius: 4px;
  background: linear-gradient(#fffef9, #ede8dc);
  color: #202329;
  box-shadow: 0 6px 12px #5b321755;
  overflow: hidden;
}
.sheet-title {
  display: block;
  padding-bottom: 4px;
  border-bottom: 2px solid #e0a94d;
  color: #15171a;
  font-size: 0.49rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mini-sheet-field {
  height: 13px;
  border: 1px solid #ccd0d4;
  border-radius: 3px;
  background: #fff;
}
.mini-sheet-line {
  display: block;
  width: 72%;
  height: 4px;
  border-radius: 99px;
  background: #cdd1d5;
}
.sheet-total {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid #1d2025;
  color: #444a52;
  font-size: 0.47rem;
  font-weight: 850;
}
.sheet-total strong {
  color: #26804a;
}
.folder-action {
  display: block;
  padding: 5px 1px 0;
  color: #2b190a;
  font-size: 0.48rem;
  font-weight: 950;
  text-align: right;
  white-space: nowrap;
}
.workspace-folder:active {
  transform: translateY(-2px);
}
.tape-shelf {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 700px;
  height: 48px;
  margin: -3px auto 0;
  border: 1px solid #f7c837;
  border-radius: 5px;
  background: repeating-linear-gradient(
      90deg,
      #2c260f 0 1px,
      transparent 1px 10px
    ),
    repeating-linear-gradient(90deg, #2c260f 0 2px, transparent 2px 50px),
    linear-gradient(180deg, #ffe45a 0, #f4bd16 58%, #c99109 100%);
  box-shadow:
    0 12px 20px #0009,
    inset 0 1px #fff8;
  transform: perspective(500px) rotateX(4deg);
}
.tape-shelf:before {
  content: "1　　　　2　　　　3　　　　4　　　　5　　　　6　　　　7　　　　8　　　　9";
  position: absolute;
  left: 15px;
  right: 10px;
  top: 5px;
  overflow: hidden;
  white-space: nowrap;
  color: #332a0e;
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.17em;
}
.tape-shelf:after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    #30270b 0 1px,
    transparent 1px 5px
  );
}
.jobs-chart {
  position: relative;
  z-index: 2;
  min-height: 385px;
  margin-top: 58px;
  padding: 28px 30px 30px;
  border: 1px solid #41444a;
  border-radius: 18px;
  background: linear-gradient(145deg, #18191c, #121316);
  box-shadow: 0 18px 38px #0005;
}
.jobs-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}
.jobs-chart-head h2 {
  font-size: 1.35rem;
}
.jobs-chart-head p:not(.eyebrow) {
  max-width: 540px;
  margin: 8px 0 0;
  color: #9fa3aa;
  font-size: 0.82rem;
}
.jobs-chart-summary {
  text-align: right;
}
.jobs-chart-summary strong,
.jobs-chart-summary span {
  display: block;
}
.jobs-chart-summary strong {
  color: #fff;
  font-size: 1.05rem;
}
.jobs-chart-summary span {
  margin-top: 4px;
  color: #aeb1b7;
  font-size: 0.78rem;
}
.job-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}
.job-kpis article {
  padding: 14px;
  border: 1px solid #35383e;
  border-radius: 10px;
  background: #101114;
}
.job-kpis span,
.job-kpis strong {
  display: block;
}
.job-kpis span {
  color: #969ba4;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.job-kpis strong {
  margin-top: 7px;
  color: #fff;
  font-size: 1.05rem;
}
.job-kpis article:last-child strong {
  color: #9de382;
}
.job-kpis article:last-child strong.negative {
  color: #ff9d88;
}
.job-status-list {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}
.job-status-row {
  display: grid;
  grid-template-columns: 145px minmax(160px, 1fr) 150px;
  align-items: center;
  gap: 16px;
}
.job-status-label strong,
.job-status-label span {
  display: block;
}
.job-status-label strong {
  color: #f2f2f4;
  font-size: 0.84rem;
}
.job-status-label span {
  margin-top: 3px;
  color: #969ba4;
  font-size: 0.7rem;
}
.job-meter {
  height: 18px;
  overflow: hidden;
  border: 1px solid #363941;
  border-radius: 999px;
  background: #0d0e10;
  box-shadow: inset 0 2px 5px #0008;
}
.job-meter i {
  display: block;
  width: 0;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f7b84e, #ed7b3f);
  box-shadow: 0 0 14px #ed7b3f55;
  transition: width 0.3s ease;
}
.job-status-row:nth-child(2) .job-meter i {
  background: linear-gradient(90deg, #91d878, #4f9d58);
}
.job-status-row:nth-child(3) .job-meter i {
  background: linear-gradient(90deg, #80b8f1, #5379cb);
}
.job-status-total {
  text-align: right;
}
.job-status-total b,
.job-status-total small {
  display: block;
}
.job-status-total b {
  color: #fff;
  font-size: 0.9rem;
}
.job-status-total small {
  margin-top: 2px;
  color: #969ba4;
  font-size: 0.66rem;
}
.jobs-chart-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid #32353a;
  color: #8f949c;
  font-size: 0.68rem;
}
.jobs-chart-foot strong {
  color: #c9ccd1;
}
@media (max-width: 760px) {
  .workspace-landing {
    min-height: 780px;
    padding: 34px 20px 40px;
  }
  .folder-stage {
    max-width: 600px;
    margin-top: 62px;
    padding-inline: 10px;
  }
  .folder-grid {
    grid-template-columns: repeat(4, minmax(0, 120px));
    gap: 12px;
  }
  .tape-shelf {
    height: 44px;
  }
  .jobs-chart {
    min-height: 430px;
    margin-top: 52px;
    padding: 24px 20px;
  }
  .job-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .job-status-row {
    grid-template-columns: 110px minmax(120px, 1fr) 110px;
    gap: 10px;
  }
}
@media (max-width: 520px) {
  .workspace-landing {
    min-height: 0;
    padding: 28px 10px 30px;
    border-radius: 18px;
  }
  .landing-heading {
    padding-left: 8px;
  }
  .landing-heading .eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }
  .folder-stage {
    margin-top: 58px;
    padding: 0 3px;
  }
  .folder-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .workspace-folder {
    min-height: 102px;
    padding: 8px 4px 4px;
  }
  .folder-tab {
    top: -19px;
    width: 82%;
    height: 23px;
    padding: 0 4px;
    font-size: 0.46rem;
  }
  .folder-sheet {
    gap: 3px;
    min-height: 68px;
    padding: 5px;
  }
  .sheet-title {
    padding-bottom: 3px;
    font-size: 0.4rem;
  }
  .mini-sheet-field {
    height: 10px;
  }
  .mini-sheet-line {
    height: 3px;
  }
  .sheet-total {
    padding-top: 3px;
    font-size: 0.38rem;
  }
  .folder-action {
    padding-top: 4px;
    font-size: 0.38rem;
  }
  .tape-shelf {
    height: 38px;
  }
  .tape-shelf:before {
    font-size: 0.45rem;
  }
  .jobs-chart {
    min-height: 0;
    margin-top: 44px;
    padding: 20px 14px 24px;
  }
  .jobs-chart-head {
    display: block;
  }
  .jobs-chart-summary {
    margin-top: 12px;
    text-align: left;
  }
  .job-kpis {
    gap: 8px;
    margin-top: 18px;
  }
  .job-kpis article {
    padding: 11px;
  }
  .job-kpis strong {
    font-size: 0.9rem;
  }
  .job-status-list {
    gap: 20px;
  }
  .job-status-row {
    grid-template-columns: 1fr auto;
    gap: 7px;
  }
  .job-status-label span {
    font-size: 0.66rem;
  }
  .job-meter {
    grid-column: 1/3;
    grid-row: 2;
    height: 16px;
  }
  .job-status-total {
    grid-column: 2;
    grid-row: 1;
  }
  .jobs-chart-foot {
    display: block;
    line-height: 1.5;
  }
}

/* AI-assisted NEC 2023 electrical service draft */
.service-quote-card {
  border-color: #56864a;
  background: linear-gradient(145deg, #18231a, #171a18 58%, #121413);
  box-shadow: 0 14px 38px #0b1f0d55;
}
.service-quote-pill {
  background: #31552a;
  color: #e3f6d9;
}
.service-quote-card > p {
  margin-bottom: 0;
}
.service-client-message,
.service-sms-consent {
  margin-top: 14px;
}
.service-sms-consent {
  line-height: 1.4;
}
.service-quote-actions {
  justify-content: flex-start;
}
.service-quote-actions button {
  min-height: 46px;
}
.service-tool-folders {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.service-tool-folder {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 23px 18px 16px;
  overflow: hidden;
  border: 1px solid #725b32;
  border-radius: 7px 13px 13px 13px;
  background: linear-gradient(145deg, #2b2419, #191b1e);
  color: #fff;
  text-align: left;
  box-shadow: 0 12px 24px #0005;
}
.service-tool-folder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48%;
  height: 12px;
  background: #f0a54a;
  border-radius: 0 0 8px 0;
}
.service-tool-folder span {
  color: #f2c67e;
  font-size: 1.1rem;
}
.service-tool-folder strong {
  font-size: 1rem;
}
.service-tool-folder small {
  color: #aeb1b7;
}
.service-tool-folder.active {
  border-color: #f0a54a;
  background: linear-gradient(145deg, #3a2b18, #1d2024);
  box-shadow: 0 0 0 2px #f0a54a33, 0 14px 28px #0006;
}
.ai-service-assistant {
  border-color: #2f6fad;
  background: linear-gradient(145deg, #17212d, #15181c 58%, #111316);
  box-shadow: 0 14px 38px #071a2d66;
}
.ai-service-assistant .service-draft-pill {
  background: #173d6e;
  color: #dcebff;
}
.ai-service-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ai-service-details {
  margin-top: 16px;
}
.ai-service-pricebook-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #3c4f63;
  border-radius: 10px;
  background: #0f141a;
}
.ai-service-pricebook-add button {
  min-height: 44px;
}
.ai-service-pricebook-items {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.ai-service-pricebook-items:empty {
  display: none;
}
.ai-service-pricebook-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 190px auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid #3c4f63;
  border-radius: 9px;
  background: #121a22;
}
.ai-service-pricebook-item strong {
  align-self: center;
  color: #fff;
}
.ai-service-pricebook-item .price-book-line-total {
  align-self: center;
  color: #f2c67e;
  font-weight: 800;
}
.ai-service-pricebook-grand-total {
  padding: 14px;
  border: 1px solid #725b32;
  border-radius: 9px;
  background: #211c15;
  color: #f2c67e;
  font-size: 1rem;
  font-weight: 900;
  text-align: right;
}
.material-clause-preview {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #725b32;
  border-left: 3px solid #f0a54a;
  border-radius: 9px;
  background: #211c15;
}
.material-clause-preview strong {
  color: #f2c67e;
}
.material-clause-preview p {
  margin: 7px 0;
  color: #e6e0d4;
  font-size: 0.82rem;
  line-height: 1.45;
}
.material-clause-preview small {
  color: #aeb1b7;
}
.invoice-scope {
  margin: 16px 0;
  padding: 12px;
  border: 1px solid #d6d8dc;
  border-radius: 6px;
  white-space: pre-line;
}
.ai-service-actions {
  justify-content: flex-start;
}
.ai-service-actions .primary {
  min-height: 48px;
}
.ai-service-result {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.ai-service-result:empty {
  display: none;
}
.ai-service-summary,
.ai-service-recommendation,
.ai-service-list {
  padding: 14px;
  border: 1px solid #3c4f63;
  border-radius: 10px;
  background: #0f141a;
}
.ai-service-summary strong,
.ai-service-recommendation strong,
.ai-service-list strong {
  color: #dcebff;
}
.ai-service-summary p,
.ai-service-list ul {
  margin: 8px 0 0;
}
.ai-service-recommendation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.ai-service-recommendation-grid span {
  padding: 9px;
  border: 1px solid #303e4d;
  border-radius: 7px;
  background: #111820;
  color: #c8d2dc;
  font-size: 0.78rem;
}
.ai-service-recommendation-grid b {
  display: block;
  margin-top: 3px;
  color: #fff;
}
.ai-service-warning {
  border-color: #725b32;
  background: #272117;
}
.ai-service-warning strong {
  color: #f2c67e;
}
.ai-service-assistant.busy {
  border-color: #f0a54a;
}
.service-calculation-panel {
  border-color: #2f6fad;
  background: linear-gradient(145deg, #17212d, #15181c 58%, #111316);
}
.service-calculation-panel[hidden] {
  display: none;
}
.service-calculation-actions {
  justify-content: flex-start;
  margin-top: 16px;
}
.calculation-report {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.calculation-report:empty {
  display: none;
}
.calculation-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.calculation-report-grid article {
  padding: 13px;
  border: 1px solid #3c4f63;
  border-radius: 9px;
  background: #0f141a;
}
.calculation-report-grid span,
.calculation-report-grid strong {
  display: block;
}
.calculation-report-grid span {
  color: #9fa9b5;
  font-size: 0.72rem;
  text-transform: uppercase;
}
.calculation-report-grid strong {
  margin-top: 5px;
  color: #fff;
  font-size: 1rem;
}
.calculation-conclusion {
  padding: 13px;
  border-left: 3px solid #79bd65;
  border-radius: 7px;
  background: #18251a;
  color: #d9f1d1;
  font-weight: 750;
}
.calculation-conclusion.over-capacity {
  border-left-color: #ef7a61;
  background: #2a1917;
  color: #ffd6cc;
}
.equipment-photo-reader {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #4a5d72;
  border-radius: 11px;
  background: #10161d;
}

.plan-takeoff {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #285e93;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(24, 45, 72, 0.72), rgba(12, 16, 22, 0.94));
}
.plan-takeoff > p { color: var(--muted); }
.plan-takeoff-results { display: grid; gap: .65rem; margin: .85rem 0; }
.plan-takeoff-result {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 110px minmax(170px, 1fr) 100px 90px;
  gap: .65rem;
  align-items: end;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #101318;
}
.plan-takeoff-result label { margin: 0; }
.plan-takeoff-result strong,
.plan-takeoff-result small { display: block; }
.plan-takeoff-result small { margin-top: .3rem; color: var(--muted); line-height: 1.35; }
.plan-takeoff-result .takeoff-confidence { align-self: center; color: #ffd27d; font-weight: 800; }
.plan-takeoff-warning { border-color: #7b5521; background: #241d13; }
@media (max-width: 900px) {
  .plan-takeoff-result { grid-template-columns: 1fr 110px; }
  .plan-takeoff-result .takeoff-location { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .plan-takeoff-result { grid-template-columns: 1fr; }
  .plan-takeoff-result .takeoff-location { grid-column: auto; }
}
.equipment-photo-reader h3 {
  margin: 2px 0 6px;
  color: #fff;
}
.equipment-photo-actions {
  justify-content: flex-start;
  margin-top: 14px;
}
.equipment-photo-upload {
  min-height: 44px;
}
.equipment-photo-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.equipment-photo-queue:empty,
.equipment-photo-results:empty {
  display: none;
}
.equipment-photo-queue span {
  padding: 7px 10px;
  border: 1px solid #3b4652;
  border-radius: 999px;
  background: #171d24;
  color: #d8dde3;
  font-size: 0.75rem;
}
.equipment-photo-results {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.equipment-photo-result {
  padding: 13px;
  border: 1px solid #3c4f63;
  border-radius: 9px;
  background: #0d1217;
}
.equipment-photo-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.equipment-photo-result-head small {
  color: #9fa9b5;
}
.equipment-photo-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.equipment-photo-result-grid label {
  margin: 0;
}
.equipment-photo-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 11px;
  color: #f2c67e;
  font-size: 0.8rem;
  font-weight: 750;
}
.equipment-photo-confirm input {
  width: auto;
  margin-top: 2px;
}
.combined-load-mode {
  border-color: #d99138;
}
@media (max-width: 960px) {
  .service-tool-folders {
    grid-template-columns: 1fr;
  }
  .ai-service-grid,
  .ai-service-recommendation-grid,
  .calculation-report-grid,
  .equipment-photo-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .ai-service-grid,
  .ai-service-recommendation-grid,
  .calculation-report-grid,
  .equipment-photo-result-grid {
    grid-template-columns: 1fr;
  }
  .ai-service-actions .primary {
    width: 100%;
  }
  .ai-service-pricebook-add {
    grid-template-columns: 1fr;
  }
  .ai-service-pricebook-item {
    grid-template-columns: 1fr;
  }
  .ai-service-pricebook-add button {
    width: 100%;
  }
  .service-quote-actions button {
    width: 100%;
  }
  .equipment-photo-actions,
  .equipment-photo-actions > * {
    width: 100%;
  }
}
.lidar-capture {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #4b4f58;
  border-radius: 14px;
  background: linear-gradient(145deg, #15171a, #101114);
  box-shadow: inset 0 1px #ffffff08;
}
.lidar-capture h3 {
  margin: 0;
  color: #fff;
  font-size: 1.08rem;
}
.lidar-capture > p:not(.eyebrow) {
  margin: 10px 0;
  color: #aeb1b7;
  font-size: 0.84rem;
}
.lidar-actions {
  justify-content: flex-start;
}
.lidar-actions .primary,
.lidar-actions .upload {
  min-height: 44px;
}
.lidar-status {
  min-height: 1.2em;
  color: #f2c67e !important;
  font-weight: 800;
}
.lidar-status.ready {
  color: #a8e391 !important;
}
.lidar-results {
  margin-top: 16px;
}
.lidar-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.lidar-metrics article {
  padding: 13px;
  border: 1px solid #383b42;
  border-radius: 9px;
  background: #0d0e10;
}
.lidar-metrics span,
.lidar-metrics strong {
  display: block;
}
.lidar-metrics span {
  color: #8f949d;
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lidar-metrics strong {
  margin-top: 6px;
  color: #fff;
  font-size: 1rem;
}
.lidar-openings {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.lidar-opening {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #34373d;
  border-radius: 8px;
  background: #121316;
  color: #c9ccd1;
  font-size: 0.78rem;
}
.lidar-opening strong {
  color: #fff;
}
.lidar-confirm {
  padding: 12px;
  margin: 14px 0 !important;
  border: 1px solid #5f5939;
  border-radius: 8px;
  background: #262117;
}
.lidar-confirm input {
  margin-top: 2px;
}
.lidar-scan-source {
  color: #9ea3ab;
  font-size: 0.7rem;
}
.lidar-capture .pill.ready {
  background: #354f2b;
  color: #e3f6d9;
}
@media (max-width: 620px) {
  .lidar-capture {
    padding: 16px 12px;
  }
  .lidar-actions {
    display: grid;
  }
  .lidar-actions .primary,
  .lidar-actions .upload {
    width: 100%;
    text-align: center;
  }
  .lidar-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lidar-opening {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}
/* Centered folder return control */
.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: 100%;
}
.top-title {
  justify-self: start;
}
.top-actions {
  justify-self: end;
  margin-top: 0;
}
.back-home {
  justify-self: center;
  white-space: nowrap;
  padding: 12px 20px;
  border: 1px solid #79b8ff;
  background: linear-gradient(135deg, #2583ff, #1455c4);
  color: #fff;
  box-shadow: 0 8px 22px #1455c455;
}
.back-home:hover {
  background: linear-gradient(135deg, #4395ff, #1c63dc);
  border-color: #a6d1ff;
}
.back-home:focus-visible {
  outline: 3px solid #a6d1ff;
  outline-offset: 3px;
}
.back-home[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .top-title {
    justify-self: center;
  }
  .back-home {
    grid-row: 1;
    margin-bottom: 12px;
  }
  .top-actions {
    justify-self: center;
  }
}

/* Electrical service formula */
.service-formula {
  border-color: #725b32;
  background: linear-gradient(145deg, #1d1c19, #17191c);
}
.service-formula .service-voltage {
  background: #173d6e;
  color: #dcebff;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.service-sizing {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid #373a40;
}
.service-formula-actions {
  justify-content: flex-start;
}
.service-formula-status {
  margin: 12px 0 0;
  color: #f2c67e;
  font-weight: 800;
}
.service-formula-preview {
  margin-top: 14px;
  overflow: auto;
  border: 1px solid #3b3e45;
  border-radius: 10px;
  background: #111316;
}
.service-formula-preview:empty {
  display: none;
}
.service-material-table {
  margin: 0;
  min-width: 620px;
}
.service-material-table th {
  background: #202329;
  color: #f2c67e;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.service-material-table th,
.service-material-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #30333a;
}
.service-material-table tbody tr:last-child td {
  border-bottom: 0;
}
.service-material-table td:nth-child(2),
.service-material-table td:nth-child(3) {
  white-space: nowrap;
}
.service-safety {
  margin: 14px 0 0;
  border-left: 3px solid #f0a54a;
}
.service-route-field[hidden] {
  display: none;
}
@media (max-width: 960px) {
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
  .service-formula-actions button {
    width: 100%;
  }
}

/* Electric Services folder */
.folder-stage {
  max-width: 900px;
}
.folder-grid {
  grid-template-columns: repeat(5, minmax(0, 132px));
  gap: 16px;
}
.tape-shelf {
  max-width: 820px;
}
.workspace-folder:nth-child(5) {
  transform: rotate(-0.35deg);
}
.workspace-folder:nth-child(5):hover,
.workspace-folder:nth-child(5):focus-visible {
  transform: translateY(-6px) rotate(-0.1deg);
}
.services-folder {
  border-color: #79b8ff;
  background: linear-gradient(145deg, #60a9ff, #2366c6);
}
.services-folder .folder-tab {
  border-color: #9ac9ff;
  background: linear-gradient(145deg, #82bdff, #3378d3);
}
.services-folder .sheet-title {
  border-bottom-color: #448bde;
}
.services-folder .folder-action {
  color: #071d3d;
}
.service-material-table th:nth-child(4),
.service-material-table td:nth-child(4) {
  min-width: 135px;
}
.service-material-table th:last-child,
.service-material-table td:last-child {
  width: 150px;
  text-align: right;
}
.price-book-value,
.price-book-source {
  display: block;
  white-space: nowrap;
}
.price-book-value {
  color: #e3f6d9;
}
.price-book-value.missing {
  color: #f2c67e;
}
.price-book-source {
  margin-top: 3px;
  color: #8f949d;
  font-size: 0.7rem;
}
.service-price-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.service-price-actions button {
  width: 100%;
  padding: 7px 9px;
  font-size: 0.74rem;
}
.service-edit-price {
  border-color: #4f78a7;
  background: #1b314b;
  color: #dcebff;
}
.service-delete {
  padding: 8px 10px;
  border-color: #8e4444;
  background: #422326;
  color: #ffdede;
}
.service-delete:hover {
  border-color: #e47b7b;
  background: #5a292d;
}
.service-empty {
  padding: 18px;
  color: #aeb1b7;
  text-align: center;
}
.service-formula-actions #restoreServiceItems {
  border-color: #4f78a7;
  color: #dcebff;
}
@media (max-width: 760px) {
  .folder-grid {
    grid-template-columns: repeat(3, minmax(0, 120px));
    column-gap: 12px;
    row-gap: 48px;
  }
  .tape-shelf {
    margin-top: 20px;
  }
}
@media (max-width: 520px) {
  .folder-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .workspace-folder {
    min-height: 96px;
    width: 100%;
  }
  .folder-tab {
    padding: 8px 10px;
  }
  .folder-sheet {
    padding: 10px;
  }
  .folder-action {
    margin-top: 6px;
    font-size: 0.74rem;
  }
  .tape-shelf {
    margin-top: 14px;
  }
}

/* iPhone full-width estimator fix */
@media (max-width: 760px) {
  html,
  body,
  .shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .tab,
  .tab.active {
    width: 100%;
    max-width: none;
  }
}


@media (max-width: 760px) {
  .sidebar {
    gap: 9px;
    padding-bottom: 4px;
  }

  .sidebar button {
    font-size: 1.05rem;
    line-height: 1.2;
    padding: 12px 14px;
    min-height: 46px;
    border-radius: 10px;
  }
}
