:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #172d31;
  background: #f4f6f5;
  font-synthesis: none;
  --ink: #17383d;
  --muted: #647478;
  --line: #d7ddda;
  --paper: #ffffff;
  --soft: #edf1ef;
  --orange: #e86242;
  --orange-dark: #c54b2f;
  --green: #24795d;
  --amber: #986215;
  --red: #a93932;
  --shadow: 0 6px 22px rgba(23, 56, 61, 0.08);
}

@font-face {
  font-family: "TPD New Order";
  src: url("./assets/fonts/new-order-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TPD New Order";
  src: url("./assets/fonts/new-order-bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "TPD Uniwars";
  src: url("./assets/fonts/uniwars-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 226px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--ink); color: white;
  display: flex; flex-direction: column; padding: 22px 14px;
}
.brand { padding: 4px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.14); }
.brand strong { display: block; font-size: 18px; }
.brand span { color: #b9c9c7; font-size: 12px; }
.nav { display: grid; gap: 10px; padding-top: 18px; }
.nav-group { display: grid; gap: 5px; }
.nav-heading {
  padding: 10px 12px 6px;
  color: #9fb5b1;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  justify-content: space-between;
  border-radius: 6px;
}
.nav button.nav-heading {
  color: #9fb5b1;
}
.nav button.nav-heading:hover {
  background: rgba(255,255,255,.07);
  color: #dce7e5;
}
.nav-heading .chevron {
  color: #dce7e5;
  font-size: 14px;
  line-height: 1;
}
.nav-group-items {
  display: grid;
  gap: 5px;
}
.nav-group.collapsed .nav-group-items {
  display: none;
}
.nav button {
  border: 0; background: transparent; color: #dce7e5; padding: 11px 12px;
  text-align: left; border-radius: 6px; display: flex; align-items: center; gap: 10px;
}
.nav button:hover, .nav button.active { background: rgba(255,255,255,.12); color: white; }
.nav button.disabled {
  color: rgba(220, 231, 229, .55);
  cursor: not-allowed;
}
.nav button.disabled:hover { background: transparent; color: rgba(220, 231, 229, .55); }
.nav .icon { width: 20px; text-align: center; }
.nav .soon {
  margin-left: auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 2px 7px;
  color: #b9c9c7;
  font-size: 10px;
  text-transform: uppercase;
}
.user-panel { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.14); }
.user-panel small { color: #b9c9c7; display: block; margin: 3px 0 10px; }

.main { min-width: 0; }
.topbar {
  min-height: 64px; background: var(--paper); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 10px 24px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: 0; }
.status-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.content { padding: 22px 24px 40px; max-width: 1500px; margin: auto; }

.btn {
  min-height: 38px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--ink); padding: 8px 13px; font-weight: 600;
}
.btn:hover { border-color: #9baaa7; }
.btn:disabled { cursor: wait; opacity: .72; }
.btn.primary { background: var(--orange); color: white; border-color: var(--orange); }
.btn.primary:hover { background: var(--orange-dark); }
.btn.danger { color: var(--red); }
.btn.small { min-height: 32px; padding: 5px 10px; font-size: 13px; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(125deg, #17383d 0 44%, #edf1ef 44% 100%);
}
.login-panel {
  width: min(880px, 100%); display: grid; grid-template-columns: 1.1fr .9fr;
  background: white; box-shadow: 0 18px 60px rgba(0,0,0,.18);
}
.login-intro { background: var(--ink); color: white; padding: 54px 44px; }
.login-intro h1 { margin: 0 0 14px; font-size: 32px; line-height: 1.15; }
.login-intro p { color: #c9d8d6; line-height: 1.55; }
.login-form { padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 6px; }
.login-form > p { color: var(--muted); margin: 0 0 22px; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 700; color: #394e52; }
.field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid #bdc9c6; border-radius: 5px; background: white;
  padding: 10px 11px; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 98px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(232,98,66,.22); border-color: var(--orange);
}
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.form-actions .btn.primary { flex: 1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 0 14px; }
.time-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.time-input-row label { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--muted); }
.time-input-row input { min-width: 0; }
.message { border-left: 4px solid var(--amber); background: #fff7e8; padding: 10px 12px; margin: 12px 0; }
.message.error { border-color: var(--red); background: #fff0ef; color: #742923; }
.message.success { border-color: var(--green); background: #edf8f3; color: #195842; }

.page-header { display: flex; gap: 15px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.page-header h2 { margin: 0 0 4px; font-size: 24px; }
.page-header p { margin: 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar input, .toolbar select { border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; background: white; }
.record-search { display: grid; gap: 4px; min-width: 0; flex: 1 1 230px; font-size: 12px; color: var(--muted); }
.record-search input { width: 100%; min-width: 0; }
.split > [id$="-detail"] { scroll-margin-top: 82px; }
.analysis-bars { display: grid; gap: 12px; padding: 14px; }
.analysis-bar-row { display: grid; grid-template-columns: 92px minmax(80px, 1fr) 90px; align-items: center; gap: 10px; font-size: 13px; }
.analysis-bar-row > div { height: 14px; background: #edf1ef; overflow: hidden; }
.analysis-bar-row i { display: block; height: 100%; background: var(--orange); }
.analysis-bar-row strong { text-align: right; }
.count-button {
  min-width: 36px; min-height: 32px; border: 1px solid #b8c7c3; border-radius: 5px;
  background: white; color: var(--ink); font-weight: 700;
}
.count-button:hover { border-color: var(--orange); color: var(--orange-dark); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px,1fr)); gap: 12px; margin-bottom: 18px; }
.metric { background: var(--paper); border: 1px solid var(--line); padding: 16px; box-shadow: var(--shadow); text-align: left; color: var(--ink); font: inherit; }
button.metric { cursor: pointer; }
button.metric:hover { border-color: var(--orange); transform: translateY(-1px); }
button.metric:focus-visible { outline: 3px solid rgba(239, 91, 45, .28); outline-offset: 2px; }
.metric span { color: var(--muted); font-size: 13px; }
.metric strong { display: block; font-size: 28px; margin-top: 6px; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.metric.alert strong { color: var(--red); }
.dashboard-bucket-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 26, 29, .42);
}
.dashboard-bucket-dialog {
  width: min(680px, 100%);
  max-height: min(720px, 88vh);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(8, 26, 29, .28);
}
.online-order-dialog { width: min(760px, 100%); }
.overdue-label { color: var(--red); }
.dashboard-bucket-list { display: grid; gap: 8px; }
.dashboard-bucket-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(180px, 1fr);
  gap: 4px 14px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  background: #fbfcfc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.dashboard-bucket-row:hover { background: #f4faf7; }
.dashboard-bucket-row small {
  grid-column: 2;
  color: var(--muted);
}

.panel { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-title { padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-title h3 { margin: 0; font-size: 15px; }
.panel-body { padding: 15px; }
.dashboard-detail-panel { margin-top: 14px; }
.dashboard-action-bar { border-top: 1px solid var(--line); padding-top: 0; }
.split { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(340px, .8fr); gap: 14px; }
.split.preview-closed { grid-template-columns: minmax(0, 1fr); }
.product-list-panel { margin-top: 14px; }
.product-list-scroll {
  height: clamp(265px, 38vh, 380px);
  overflow: auto;
  overscroll-behavior: contain;
}
.product-list-scroll table { min-width: 980px; }
.product-list-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
.product-list-scroll tbody tr { height: 52px; }
.panel.is-collapsed .panel-title { border-bottom: 0; }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 10px 11px; vertical-align: top; }
th { background: var(--soft); color: #3c5357; font-size: 12px; text-transform: uppercase; font-weight: 700; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7faf8; }
tbody tr.selected { background: #eaf2ef; box-shadow: inset 4px 0 var(--orange); }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; background: var(--soft); font-size: 12px; font-weight: 700; }
.badge.green { color: var(--green); background: #e7f4ee; }
.badge.amber { color: var(--amber); background: #fff2dc; }
.badge.red { color: var(--red); background: #fdebea; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 32px; text-align: center; }
.detail-grid { display: grid; grid-template-columns: 125px 1fr; gap: 10px 12px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.deployment-ledger-panel { margin-top: 18px; }
.compact-form { margin-bottom: 14px; }
.order-items { display: grid; gap: 10px; margin: 10px 0 14px; }
.order-item { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 4px; background: #fbfcfc; }
.order-item span, .order-item small { color: var(--muted); }
.privacy-note { background: #edf3f1; border: 1px solid #d4dfdc; padding: 10px 12px; color: #496064; font-size: 13px; }
.stock-summary { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 10px; }
.stock-summary div { background: var(--soft); border-left: 3px solid var(--orange); padding: 11px 12px; }
.stock-summary span { display: block; color: var(--muted); font-size: 12px; }
.stock-summary strong { display: block; font-size: 22px; margin-top: 4px; }
.stock-positive { color: var(--green); font-weight: 700; }
.stock-negative { color: var(--red); font-weight: 700; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.inline-status-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-status-form select { min-width: 150px; }
.empty.compact { padding: 18px; }
.manual-stl-assist {
  border: 1px solid var(--line);
  margin: 2px 0 14px;
  padding: 12px;
  background: #fbfcfc;
}
.manual-stl-assist legend {
  color: #394e52;
  font-size: 13px;
  font-weight: 700;
  padding: 0 5px;
}
.manual-lines { display: grid; gap: 12px; margin-bottom: 12px; }
.manual-stl-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.manual-stl-progress progress { flex: 1; min-width: 120px; accent-color: #197785; }
.staff-stl-host { min-width: 0; width: 100%; }
.staff-stl-dialog { width: min(1440px, 100%); max-width: 100%; max-height: 100dvh; padding: 16px; border: 1px solid var(--line); color: var(--ink); background: #f8faf9; }
.staff-stl-dialog::backdrop { background: rgba(15, 25, 30, 0.65); }
.stl-workspace { width: 100%; min-width: 0; color: #19383e; background: #f8faf9; }
.stl-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stl-heading h2 { font-size: 22px; margin: 0; overflow-wrap: anywhere; }
.stl-heading > .form-actions { flex: 0 0 auto; width: auto; margin: 0; }
.stl-heading > .form-actions .stl-icon { flex: 0 0 42px; width: 42px; }
.stl-file-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; }
.stl-file-bar .btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.stl-file-bar input[type=file] { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.stl-file-bar strong { min-width: 0; overflow-wrap: anywhere; }
.stl-toolbar { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.stl-tool-group { display: flex; gap: 4px; flex-wrap: wrap; }
.stl-icon { width: 42px; height: 42px; min-width: 42px; padding: 8px; display: inline-flex; justify-content: center; align-items: center; }
.stl-workspace svg { width: 20px; height: 20px; flex-shrink: 0; }
.stl-icon[aria-pressed=true] { background: #d5ebed; color: #154f5c; border-color: #287885; }
.stl-stage { width: 100%; height: min(62vh, 660px); min-height: 340px; position: relative; background: #edf2f1; overflow: hidden; }
.stl-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stl-scene-status { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); pointer-events: none; font-size: 12px; background: #fff; padding: 5px 8px; color: #405c62; overflow-wrap: anywhere; }
.stl-axis-key { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 12px; pointer-events: none; }
.stl-axis-key b:nth-child(1) { color: #a52035; }
.stl-axis-key b:nth-child(2) { color: #24632f; }
.stl-axis-key b:nth-child(3) { color: #2544a0; }
.stl-measurements { padding: 10px 0; min-height: 38px; font-size: 13px; overflow-wrap: anywhere; }
.stl-transform-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stl-transform-controls fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); padding: 10px; }
.stl-transform-controls legend { font-size: 13px; font-weight: 700; }
.stl-axis-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stl-axis-inputs label { min-width: 0; font-size: 12px; }
.stl-axis-inputs input { width: 100%; min-width: 0; padding: 8px 4px; }
.stl-transform-controls .quote-check { margin-top: 10px; font-size: 13px; }
.stl-export-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; }
.stl-export-bar .btn { display: inline-flex; align-items: center; gap: 8px; }
.stl-export-bar progress { width: 150px; max-width: 100%; accent-color: #197785; }
.stl-export-bar [data-task-status] { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.stl-workspace:fullscreen, .stl-expanded { padding: 16px; background: #f8faf9; overflow: auto; }
.stl-expanded { position: fixed; inset: 0; width: 100vw; height: 100dvh; z-index: 3000; }
@media (max-width: 700px) {
  .stl-transform-controls { grid-template-columns: 1fr; }
  .staff-stl-dialog { width: 100%; height: 100dvh; max-height: 100dvh; padding: 10px; margin: 0; }
  .stl-heading h2 { font-size: 18px; }
  .stl-toolbar { gap: 8px; }
  .stl-icon { width: 40px; height: 40px; min-width: 40px; }
  .stl-stage { height: 50dvh; min-height: 320px; }
}
.manual-line {
  border: 1px solid var(--line);
  margin: 0;
  padding: 12px;
  background: #fbfcfc;
}
.manual-line legend {
  color: #394e52;
  font-size: 13px;
  font-weight: 700;
  padding: 0 5px;
}
.manual-line-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr));
  gap: 0 12px;
}
.manual-line-grid .wide { grid-column: span 2; }
.totals-grid {
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.field small { color: var(--muted); }
.keyword-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.keyword-chips span {
  display: inline-block; padding: 2px 6px; border: 1px solid #c8d5d2;
  background: #f4f7f6; color: #435b5f; font-size: 11px; border-radius: 4px;
}
.keyword-fieldset { border: 1px solid var(--line); margin: 2px 0 14px; padding: 12px; }
.keyword-fieldset legend { color: #394e52; font-size: 13px; font-weight: 700; padding: 0 5px; }
.keyword-options { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 7px 12px; margin-bottom: 13px; }
.keyword-options label { font-size: 13px; }
.schedule-fieldset { border: 1px solid var(--line); margin: 2px 0 14px; padding: 12px; }
.schedule-fieldset legend { color: #394e52; font-size: 13px; font-weight: 700; padding: 0 5px; }
.schedule-fieldset .muted { margin: 0; font-size: 13px; }

.mobile-menu, .mobile-menu-toggle { display: none; }
.quote-editor-header { margin-bottom: 14px; }
.manual-quote-editor { display: grid; gap: 10px; }
.quote-editor-section { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.quote-editor-section > summary { padding: 15px; color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; }
.quote-editor-section > summary::-webkit-details-marker { display: none; }
.quote-editor-section > summary::after { content: "+"; float: right; color: var(--orange-dark); font-size: 18px; line-height: 1; }
.quote-editor-section[open] > summary { border-bottom: 1px solid var(--line); }
.quote-editor-section[open] > summary::after { content: "-"; }
.quote-editor-section-body { padding: 15px; }
.quote-editor-section-body .field:last-child { margin-bottom: 0; }
.line-remove { float: right; border: 0; background: transparent; color: var(--red); font-size: 12px; font-weight: 700; padding: 0 3px; }
.customer-search-field { position: relative; }
.customer-search-actions { display: flex; gap: 8px; }
.customer-search-actions input { min-width: 0; flex: 1; }
.customer-search-selection { min-height: 24px; margin-top: 7px; font-size: 13px; }
.customer-search-results { display: grid; gap: 6px; margin-top: 7px; }
.customer-search-result { width: 100%; border: 1px solid var(--line); border-left: 3px solid var(--orange); background: #fbfcfc; color: var(--ink); padding: 9px 10px; text-align: left; }
.customer-search-result:hover { background: #f4faf7; }
.customer-search-result strong, .customer-search-result span { display: block; }
.customer-search-result span, .customer-search-empty { color: var(--muted); font-size: 12px; margin-top: 3px; }
.setup-code { font-family: Consolas, monospace; overflow-wrap: anywhere; background: var(--soft); padding: 8px; }
.qr { max-width: 200px; width: 100%; display: block; margin: 10px auto; }

.quote-portal {
  min-height: 100vh;
  background: #f4f6f5;
  color: var(--ink);
  font-family: "TPD New Order", "Segoe UI", Arial, sans-serif;
}
.tpd-site-header {
  min-height: 166px;
  background: var(--ink);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr auto;
  align-items: center;
  gap: clamp(18px, 4vw, 48px);
  padding: 30px clamp(20px, 4vw, 58px);
  z-index: 2;
}
.tpd-site-logo {
  display: inline-flex;
  align-items: center;
  width: min(305px, 100%);
}
.tpd-site-logo img {
  display: block;
  width: 100%;
  height: auto;
}
.tpd-site-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(18px, 3vw, 46px);
  flex-wrap: wrap;
}
.tpd-site-nav a,
.tpd-site-cta {
  color: #fff;
  text-decoration: none;
  font-family: "TPD New Order", "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.tpd-site-nav a:hover {
  color: #f5b19d;
}
.tpd-site-cta {
  background: #f15a24;
  border-radius: 7px;
  padding: 18px 24px;
  text-align: center;
}
.tpd-site-cta:hover {
  background: var(--orange-dark);
}
.tpd-site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  margin-top: 54px;
}
.tpd-footer-slope {
  position: relative;
  height: 154px;
  background: #f4f6f5;
  overflow: hidden;
}
.tpd-footer-slope::before,
.tpd-footer-slope::after {
  content: "";
  position: absolute;
  inset: 30px -4vw auto -4vw;
  height: 150px;
  clip-path: polygon(0 0, 82% 52%, 100% 3%, 100% 100%, 0 100%);
}
.tpd-footer-slope::before {
  background: #f15a24;
}
.tpd-footer-slope::after {
  top: 38px;
  background: var(--ink);
}
.tpd-footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 70px clamp(22px, 5vw, 70px) 78px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 280px) minmax(220px, 1fr);
  gap: clamp(34px, 7vw, 100px);
  align-items: center;
}
.tpd-footer-wordmark {
  display: block;
  width: min(330px, 100%);
  height: auto;
  margin-bottom: 28px;
}
.tpd-footer-contact p,
.tpd-footer-hours p {
  margin: 0 0 20px;
  font-family: "TPD New Order", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}
.tpd-footer-contact a {
  color: #f15a24;
}
.tpd-footer-mascot {
  display: flex;
  justify-content: center;
}
.tpd-footer-mascot img {
  display: block;
  max-width: 230px;
  width: 100%;
  height: auto;
  mix-blend-mode: screen;
}
.tpd-footer-hours h2 {
  margin: 0 0 32px;
  color: white;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}
.tpd-socials {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 250px;
}
.tpd-socials a {
  width: 47px;
  height: 47px;
  border-radius: 6px;
  background: #648c92;
  display: grid;
  place-items: center;
  color: #cfd8d6;
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
}
.tpd-socials a:hover {
  background: #f15a24;
  color: #fff;
}
.tpd-socials img {
  width: 29px;
  height: 29px;
  object-fit: contain;
  opacity: .9;
}
.quote-hero {
  position: relative;
  min-height: 260px;
  background: var(--ink);
  color: white;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 58px clamp(18px, 5vw, 72px) 126px;
  overflow: visible;
}
.quote-hero::before,
.quote-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 116px;
  clip-path: polygon(0 100%, 50% 0, 100% 100%, 100% 100%, 0 100%);
  pointer-events: none;
}
.quote-hero::before {
  bottom: 7px;
  background: #f15a24;
}
.quote-hero::after {
  bottom: -1px;
  background: #f4f6f5;
}
.quote-hero.confirmation {
  min-height: 230px;
}
.quote-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0;
  font-family: "TPD New Order", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}
.quote-hero p {
  max-width: 660px;
  margin: 0;
  color: #d8e5e3;
  line-height: 1.55;
  font-size: 17px;
}
.quote-kicker {
  margin: 0 0 10px;
  color: #f5b19d;
  font-weight: 700;
}
.quote-staff-link {
  color: var(--ink);
  background: white;
  border: 1px solid rgba(23,56,61,.15);
  border-radius: 6px;
  padding: 10px 13px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}
.quote-workspace {
  max-width: 1180px;
  margin: -82px auto 0;
  padding: 0 18px 44px;
  position: relative;
  z-index: 1;
}
.quote-workspace.confirmation {
  max-width: 860px;
}
.quote-analytics-consent { background: #fff; border: 1px solid var(--line); padding: 16px; margin-bottom: 16px; }
.quote-analytics-consent[hidden] { display: none; }
.quote-analytics-consent h2 { font-size: 18px; margin: 0 0 8px; }
.quote-analytics-consent p { margin: 8px 0; line-height: 1.5; }
.quote-analytics-consent details { margin: 10px 0; font-size: 14px; }
.quote-analytics-consent .form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.quote-analytics-preferences { color: inherit; margin-top: 12px; text-decoration: underline; }
.tpd-site-footer .quote-analytics-preferences { color: #fff; }
.customer-orders-workspace,
.customer-login-workspace {
  max-width: 980px;
}
.customer-login-panel {
  max-width: 620px;
  margin: 0 auto;
}
.customer-auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}
.customer-auth-card {
  border: 1px solid var(--line);
  background: #fbfcfc;
  padding: 14px;
}
.customer-auth-card h4 {
  margin: 0 0 7px;
}
.customer-auth-card-wide,
.customer-auth-message {
  grid-column: 1 / -1;
}
.customer-order-list {
  display: grid;
  gap: 14px;
}
.customer-order-card {
  border: 1px solid var(--line);
  background: #fbfcfc;
  padding: 15px;
}
.customer-order-card header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.customer-order-card header strong {
  display: block;
  font-size: 18px;
}
.customer-order-card header span {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.customer-order-card h4 {
  margin: 16px 0 8px;
}
.customer-order-items {
  display: grid;
  gap: 8px;
}
.customer-order-items div {
  border-left: 3px solid var(--orange);
  background: var(--soft);
  padding: 9px 11px;
}
.customer-order-items strong,
.customer-order-items span {
  display: block;
}
.customer-order-items span {
  color: var(--muted);
  margin-top: 3px;
}
.quote-banner {
  max-width: 1180px;
  margin: -34px auto 52px;
  padding: 13px 18px;
  border-left: 4px solid var(--amber);
  background: #fff7e8;
}
.quote-banner.success {
  border-color: var(--green);
  background: #edf8f3;
  color: #195842;
}
.quote-form {
  display: grid;
  gap: 14px;
}
.quote-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.quote-part-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}
.quote-file-list {
  display: grid;
  gap: 8px;
}
.quote-file-list.empty,
.quote-part-settings .empty {
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 12px;
}
.quote-file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  padding: 10px 12px;
  cursor: pointer;
}
.quote-file-row.selected {
  border-color: var(--orange);
  box-shadow: inset 3px 0 0 var(--orange);
}
.quote-file-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.quote-part-settings {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  position: sticky;
  top: 12px;
}
.quote-part-settings h3 {
  margin: 0 0 6px;
}
.form-grid.single {
  grid-template-columns: 1fr;
}
.quote-viewer {
  display: block;
  width: 100%;
  height: clamp(340px, 50vw, 620px);
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
  touch-action: none;
  image-rendering: auto;
}
.quote-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-weight: 700;
  color: #394e52;
}
.quote-check input {
  width: 18px;
  height: 18px;
}
.quote-analysis {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.quote-analysis > div {
  background: var(--soft);
  border-left: 3px solid var(--orange);
  padding: 12px;
}
.quote-analysis span,
.quote-total span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.quote-analysis strong,
.quote-total strong {
  display: block;
  margin-top: 5px;
  font-size: 22px;
}
.quote-analysis small,
.quote-total small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}
.quote-analysis .message {
  grid-column: 1 / -1;
  margin: 0;
}
.quote-total {
  background: #17383d;
  color: white;
  padding: 16px;
  margin-top: 4px;
}
.quote-total span,
.quote-total small {
    color: #cbd9d7;
  }
.quote-saving {
  color: #f6d1c6;
  font-weight: 700;
}
.quote-saving.warning {
  color: #ffd2cc;
}
.upload-status {
  border-left: 4px solid var(--amber);
  background: #fff7e8;
  padding: 12px;
  margin: 12px 0;
}
.upload-label {
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.upload-bar {
  height: 12px;
  border: 1px solid var(--line);
  background: white;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  height: 100%;
  background: var(--orange);
  transition: width .2s ease;
}
.upload-detail {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}
.quote-direct-link {
  margin: 10px 0 0;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--orange-dark);
  padding: 0;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 980px) {
  html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main, .content, .split, .panel, .table-wrap { min-width: 0; max-width: 100%; }
  .content, .split { width: 100%; }
  .mobile-menu-toggle {
    display: inline-flex; min-height: 36px; align-items: center; border: 1px solid var(--line); border-radius: 5px;
    background: var(--paper); color: var(--ink); padding: 7px 10px; font-size: 13px; font-weight: 700;
  }
  .mobile-menu.nav { display: none; position: fixed; inset: 64px 0 auto 0; z-index: 10; max-height: calc(100vh - 64px); overflow: auto; background: var(--ink); padding: 12px; box-shadow: 0 16px 30px rgba(8, 26, 29, .22); }
  .mobile-menu.nav.is-open { display: grid; gap: 10px; }
  .mobile-menu.nav button { border: 0; background: transparent; color: #dce7e5; padding: 13px 12px; text-align: left; border-radius: 6px; display: flex; align-items: center; gap: 10px; width: 100%; }
  .mobile-menu.nav button.active { background: rgba(255,255,255,.13); color: white; }
  .mobile-menu.nav .icon { width: 20px; text-align: center; }
  .split { grid-template-columns: 1fr; }
  .split > [id$="-detail"] { grid-row: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(130px,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .stock-summary { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .keyword-options { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .quote-part-layout { grid-template-columns: 1fr; }
  .quote-part-settings { position: static; }
  .manual-line-grid { grid-template-columns: 1fr 1fr; }
  .manual-line-grid .wide { grid-column: span 2; }
  .quote-hero {
    background: #17383d;
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 104px;
  }
  .quote-hero::before,
  .quote-hero::after {
    height: 82px;
  }
  .quote-analysis { grid-template-columns: 1fr; }
  .tpd-site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 0;
    padding: 24px 18px 30px;
  }
  .tpd-site-logo {
    width: min(285px, 86vw);
  }
  .tpd-site-nav {
    gap: 14px 24px;
  }
  .tpd-site-nav a,
  .tpd-site-cta {
    font-size: 17px;
  }
  .tpd-site-cta {
    padding: 14px 18px;
  }
  .tpd-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .tpd-footer-wordmark,
  .tpd-socials {
    margin-left: auto;
    margin-right: auto;
  }
  .tpd-footer-mascot img {
    max-width: 190px;
  }
  .table-wrap { overflow: visible; }
  .order-detail-panel { display: none; }
  .online-order-backdrop { padding: 10px; align-items: end; }
  .online-order-dialog { width: 100%; max-height: calc(100vh - 20px); }
  table.mobile-card-table tbody tr.overdue { border-left: 4px solid var(--red); }
  table.mobile-card-table { display: block; min-width: 0; width: 100%; max-width: 100%; table-layout: fixed; }
  table.mobile-card-table thead { display: none; }
  table.mobile-card-table tbody { display: grid; gap: 9px; }
  table.mobile-card-table tbody tr { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 2px 8px rgba(23, 56, 61, .05); }
  table.mobile-card-table tbody tr.selected { box-shadow: inset 4px 0 var(--orange), 0 2px 8px rgba(23, 56, 61, .05); }
  table.mobile-card-table tbody td { display: grid; grid-template-columns: minmax(92px, .72fr) minmax(0, 1.28fr); gap: 9px; border: 0; padding: 2px 0; overflow-wrap: anywhere; }
  table.mobile-card-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
  table.mobile-card-table tbody td:empty { display: none; }
  .product-list-scroll { height: auto; overflow: visible; }
}

@media (max-width: 650px) {
  .topbar { padding: 10px 14px; }
  .topbar h1 { font-size: 16px; }
  .content { padding: 16px 12px 28px; }
  .field input, .field select, .field textarea, .toolbar input, .toolbar select { font-size: 16px; }
  .login-wrap { padding: 0; background: var(--ink); }
  .login-panel { min-height: 100vh; grid-template-columns: 1fr; }
  .login-intro { padding: 30px 24px; }
  .login-intro h1 { font-size: 25px; }
  .login-form { padding: 30px 24px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 12px; }
  .metric strong { font-size: 22px; }
  .detail-grid { grid-template-columns: 95px 1fr; }
  .topbar .status-row { display: none; }
  .mobile-menu.nav { inset: 56px 0 auto 0; max-height: calc(100vh - 56px); }
  .quote-editor-section > summary { padding: 14px; }
  .quote-editor-section-body { padding: 12px; }
  .manual-line-grid, .manual-line-grid .wide { grid-template-columns: 1fr; grid-column: auto; }
  .manual-line { padding: 10px; }
  .customer-search-actions { align-items: stretch; }
  .customer-search-actions .btn { min-height: 42px; }
  .form-actions { width: 100%; }
  .form-actions .btn { flex: 1 1 140px; }
  .tpd-site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    width: 100%;
    justify-items: center;
  }
  .tpd-site-nav a {
    font-size: 16px;
  }
  .tpd-site-cta {
    width: min(280px, 100%);
  }
  .tpd-footer-slope {
    height: 72px;
  }
  .tpd-footer-slope::after {
    top: 18px;
  }
  .tpd-footer-inner {
    padding-bottom: 46px;
  }
}
#manual-service-adjustment[hidden] { display: none; }
#refresh-manual-quotes { width: 42px; height: 42px; padding: 9px; flex: 0 0 42px; }
#refresh-manual-quotes svg { display: block; width: 22px; height: 22px; }
