/*
 * Shared public laser-quote UI.
 *
 * This is the source of truth for both Andover Laser and Next Day Laser. The
 * asset build stamps it byte-for-byte into both Pages projects; brand colour,
 * surrounding copy and the default lead tier stay in each site's HTML shell.
 * Everything is namespaced under .hfq so it can sit beside either site's
 * existing component library without changing the marketing pages.
 */
.hfq {
  --hfq-bg: var(--bg, var(--surface, #fff));
  --hfq-panel: var(--card, var(--surface, #fff));
  --hfq-soft: var(--tint, var(--surface-1, #f6f8fb));
  --hfq-line: var(--line, var(--border, #dfe5ec));
  --hfq-text: var(--fg, var(--text, #172033));
  --hfq-muted: var(--muted, var(--text-muted, #5d6b7d));
  --hfq-accent: var(--brand, #1f6feb);
  --hfq-accent-strong: var(--brand-strong, #164d9b);
  --hfq-on: var(--on, var(--brand-on, #fff));
  --hfq-danger: var(--error, #b42318);
  --hfq-warning: #9a6700;
  --hfq-success: #16794b;
  --hfq-radius: var(--radius, 12px);
  --hfq-shadow: var(--shadow, 0 12px 34px rgba(12, 18, 32, .08));
  color: var(--hfq-text);
  font-size: 16px;
}

.hfq *, .hfq *::before, .hfq *::after { box-sizing: border-box; }
.hfq [hidden] { display: none !important; }

.hfq-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(22px, 4vw, 44px);
  align-items: start;
}

.hfq-main { min-width: 0; }
.hfq-section + .hfq-section { margin-top: 28px; }
.hfq-section-head { display: flex; gap: 16px; align-items: start; justify-content: space-between; margin-bottom: 14px; }
.hfq-section-head h2, .hfq-section-head h3 { margin: 0; color: inherit; }
.hfq-section-head h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); }
.hfq-section-head p { margin: 5px 0 0; color: var(--hfq-muted); max-width: 68ch; }

.hfq-step {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  color: var(--hfq-on);
  background: var(--hfq-accent);
  font-weight: 800;
  font-size: .84rem;
}

.hfq-heading-with-step { display: flex; align-items: start; gap: 11px; }

.hfq-upload {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 164px;
  padding: 24px;
  text-align: center;
  border: 2px dashed color-mix(in srgb, var(--hfq-accent) 42%, var(--hfq-line));
  border-radius: var(--hfq-radius);
  background: var(--hfq-soft);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}
.hfq-upload:hover, .hfq-upload:focus-within, .hfq-upload.is-dragging {
  border-color: var(--hfq-accent);
  background: color-mix(in srgb, var(--hfq-accent) 9%, var(--hfq-bg));
}
.hfq-upload:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--hfq-accent) 22%, transparent); }
.hfq-upload strong { color: var(--hfq-accent-strong); }
.hfq-upload p { margin: 5px 0 0; color: var(--hfq-muted); font-size: .9rem; }
.hfq-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hfq-upload-icon { width: 34px; height: 34px; margin-bottom: 8px; color: var(--hfq-accent); }

.hfq-alert {
  border: 1px solid var(--hfq-line);
  border-left: 4px solid var(--hfq-accent);
  border-radius: 9px;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: var(--hfq-panel);
  color: var(--hfq-text);
}
.hfq-alert[data-tone="error"] { border-left-color: var(--hfq-danger); color: var(--hfq-danger); }
.hfq-alert[data-tone="warning"] { border-left-color: var(--hfq-warning); }
.hfq-alert[data-tone="success"] { border-left-color: var(--hfq-success); }

.hfq-empty {
  padding: 25px 18px;
  border: 1px solid var(--hfq-line);
  border-radius: var(--hfq-radius);
  text-align: center;
  color: var(--hfq-muted);
  background: var(--hfq-panel);
}

.hfq-parts { display: grid; gap: 18px; }
.hfq-part {
  overflow: clip;
  border: 1px solid var(--hfq-line);
  border-radius: var(--hfq-radius);
  background: var(--hfq-panel);
  box-shadow: var(--hfq-shadow);
}
.hfq-part-head {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--hfq-line);
  background: color-mix(in srgb, var(--hfq-soft) 68%, var(--hfq-panel));
}
.hfq-part-title { min-width: 0; }
.hfq-part-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hfq-part-title span { display: block; color: var(--hfq-muted); font-size: .82rem; }
.hfq-part-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.hfq-part-body { padding: 17px; }

.hfq-badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.hfq-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--hfq-soft);
  border: 1px solid var(--hfq-line);
  color: var(--hfq-muted);
  font-size: .77rem;
  font-weight: 700;
}
.hfq-badge[data-tone="review"] { background: #fff8c5; border-color: #e4c767; color: #6f5300; }
.hfq-badge[data-tone="ready"] { background: #e8f7ef; border-color: #9bd2b6; color: #17643f; }
.hfq-badge[data-tone="error"] { background: #fff0ee; border-color: #efb0a8; color: var(--hfq-danger); }

.hfq-analysis {
  display: grid;
  grid-template-columns: minmax(160px, .78fr) minmax(0, 1.22fr);
  gap: 14px;
  margin-bottom: 17px;
}
.hfq-preview {
  min-height: 145px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--hfq-line);
  border-radius: 9px;
  background: #fff;
  color: var(--hfq-muted);
  font-size: .82rem;
  text-align: center;
}
.hfq-preview svg { display: block; width: 100%; max-height: 190px; }
.hfq-geometry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.hfq-geometry div { padding: 9px 10px; border-radius: 8px; background: var(--hfq-soft); min-width: 0; }
.hfq-geometry dt { color: var(--hfq-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.hfq-geometry dd { margin: 2px 0 0; font-weight: 750; overflow-wrap: anywhere; }

.hfq-dfm { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.hfq-dfm li { position: relative; padding-left: 18px; font-size: .86rem; color: var(--hfq-muted); }
.hfq-dfm li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 7px; height: 7px; border-radius: 50%; background: var(--hfq-warning); }
.hfq-dfm li[data-severity="error"]::before { background: var(--hfq-danger); }
.hfq-dfm li[data-severity="info"]::before { background: var(--hfq-accent); }

.hfq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hfq-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.hfq-field--wide { grid-column: 1 / -1; }
.hfq-field label, .hfq-field .hfq-label { font-size: .86rem; font-weight: 750; }
.hfq-field small { color: var(--hfq-muted); }
.hfq input, .hfq select, .hfq textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1.5px solid var(--hfq-line);
  border-radius: 8px;
  background: var(--hfq-bg);
  color: var(--hfq-text);
  font: inherit;
}
.hfq textarea { min-height: 78px; resize: vertical; }
.hfq input:focus-visible, .hfq select:focus-visible, .hfq textarea:focus-visible,
.hfq button:focus-visible, .hfq [tabindex]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hfq-accent) 32%, transparent);
  outline-offset: 2px;
}
.hfq [aria-invalid="true"] { border-color: var(--hfq-danger); }

.hfq-ops { margin: 17px 0 0; padding: 0; border: 0; }
.hfq-ops > legend { padding: 0 0 9px; font-weight: 800; }
.hfq-op-list { display: grid; gap: 9px; }
.hfq-op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .42fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--hfq-line);
  border-radius: 9px;
  background: var(--hfq-soft);
}
.hfq-op.is-manual { grid-template-columns: 1fr; border-left: 4px solid var(--hfq-warning); }
.hfq-check { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.hfq-check input { width: 19px; min-height: 19px; height: 19px; flex: 0 0 19px; margin: 2px 0 0; accent-color: var(--hfq-accent); }
.hfq-check strong { display: block; }
.hfq-check small { display: block; color: var(--hfq-muted); margin-top: 2px; }
.hfq-op-control { min-width: 0; }
.hfq-op-control label { display: block; font-size: .78rem; font-weight: 750; margin-bottom: 4px; }
.hfq-manual-note { margin: 2px 0 0 28px; }
.hfq-manual-note label { display: block; font-size: .82rem; font-weight: 750; margin-bottom: 4px; }
.hfq-manual-note textarea { background: var(--hfq-bg); }

.hfq-leads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hfq-lead { position: relative; }
.hfq-lead input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.hfq-lead label {
  display: block;
  height: 100%;
  min-height: 94px;
  padding: 13px;
  border: 1.5px solid var(--hfq-line);
  border-radius: 9px;
  background: var(--hfq-panel);
  cursor: pointer;
}
.hfq-lead label strong { display: block; }
.hfq-lead label span { display: block; margin-top: 4px; color: var(--hfq-muted); font-size: .82rem; }
.hfq-lead input:checked + label { border-color: var(--hfq-accent); box-shadow: inset 0 0 0 1px var(--hfq-accent); background: color-mix(in srgb, var(--hfq-accent) 7%, var(--hfq-bg)); }
.hfq-lead input:focus-visible + label { outline: 3px solid color-mix(in srgb, var(--hfq-accent) 32%, transparent); outline-offset: 2px; }
.hfq-lead input:disabled + label { opacity: .58; cursor: not-allowed; }

.hfq-sidebar { position: sticky; top: 82px; display: grid; gap: 15px; }
.hfq-summary, .hfq-contact {
  padding: 20px;
  border: 1px solid var(--hfq-line);
  border-radius: var(--hfq-radius);
  background: var(--hfq-panel);
  box-shadow: var(--hfq-shadow);
}
.hfq-summary h2, .hfq-contact h2 { margin: 0 0 12px; font-size: 1.18rem; color: inherit; }
.hfq-summary-state { color: var(--hfq-muted); }
.hfq-summary-total { font-size: clamp(1.8rem, 5vw, 2.35rem); line-height: 1.1; font-weight: 800; margin: 7px 0 4px; }
.hfq-summary-vat { color: var(--hfq-muted); font-size: .82rem; }
.hfq-summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-top: 1px solid var(--hfq-line); font-size: .9rem; }
.hfq-review {
  padding: 14px;
  border-radius: 9px;
  background: #fff8c5;
  border: 1px solid #e4c767;
  color: #594500;
}
.hfq-review strong { display: block; margin-bottom: 4px; }
.hfq-refs { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hfq-line); }
.hfq-ref { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; }
.hfq-ref + .hfq-ref { margin-top: 5px; }
.hfq-ref code { color: inherit; font: 700 .82rem/1.4 var(--font-mono, ui-monospace, monospace); overflow-wrap: anywhere; text-align: right; }

.hfq-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hfq-contact-grid .hfq-field--wide { grid-column: 1 / -1; }
.hfq-privacy { margin: 10px 0 0; color: var(--hfq-muted); font-size: .75rem; }

.hfq-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}
.hfq-button--primary { color: var(--hfq-on); background: var(--hfq-accent); }
.hfq-button--primary:hover { background: var(--hfq-accent-strong); }
.hfq-button--secondary { color: var(--hfq-text); background: var(--hfq-panel); border-color: var(--hfq-line); }
.hfq-button--danger { color: var(--hfq-danger); background: transparent; border-color: color-mix(in srgb, var(--hfq-danger) 35%, var(--hfq-line)); }
.hfq-button--block { width: 100%; }
.hfq-button:disabled { opacity: .55; cursor: not-allowed; }
.hfq-icon-button { width: 44px; padding: 0; flex: 0 0 44px; }

.hfq-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hfq-spin .75s linear infinite;
}
@keyframes hfq-spin { to { transform: rotate(360deg); } }

.hfq-skeleton { min-height: 280px; display: grid; place-items: center; color: var(--hfq-muted); }
.hfq-noscript { padding: 18px; border: 1px solid var(--hfq-line); border-radius: var(--hfq-radius); background: var(--hfq-soft); }

@media (max-width: 980px) {
  .hfq-shell { grid-template-columns: 1fr; }
  .hfq-sidebar { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .hfq-grid, .hfq-leads, .hfq-sidebar { grid-template-columns: 1fr; }
  .hfq-analysis { grid-template-columns: 1fr; }
  .hfq-preview { min-height: 120px; }
  .hfq-op { grid-template-columns: 1fr; }
  .hfq-part-head { align-items: flex-start; }
  .hfq-part-actions { flex-direction: column; }
  .hfq-part-actions .hfq-button { min-height: 40px; }
}

@media (max-width: 430px) {
  .hfq-part-body, .hfq-summary, .hfq-contact { padding: 14px; }
  .hfq-part-head { padding: 13px 14px; }
  .hfq-contact-grid, .hfq-geometry { grid-template-columns: 1fr; }
  .hfq-section-head { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .hfq *, .hfq *::before, .hfq *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Compact multi-part workspace ------------------------------------------------ */
.hfq-shell {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
  gap: 18px;
}

.hfq-workspace {
  min-width: 0;
  /* Brand shells give page-level sections a deep vertical band.  This nested
     section is the editor panel, so it must start directly below the menu. */
  padding: 0 !important;
  border: 1px solid var(--hfq-line);
  border-radius: var(--hfq-radius);
  background: var(--hfq-panel);
  box-shadow: var(--hfq-shadow);
  overflow: clip;
}

.hfq-commandbar {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(210px, .72fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hfq-line);
  background: color-mix(in srgb, var(--hfq-soft) 74%, var(--hfq-panel));
}
.hfq-command-copy { min-width: 0; }
.hfq-command-copy h2 { margin: 0; font-size: 1rem; color: inherit; }
.hfq-command-copy p { margin: 2px 0 0; color: var(--hfq-muted); font-size: .76rem; line-height: 1.35; }
.hfq-add-button { white-space: nowrap; }
.hfq-add-button input,
.hfq-row-action input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hfq-lead-control { display: grid; gap: 3px; min-width: 0; }
.hfq-lead-control > span { font-size: .72rem; font-weight: 800; color: var(--hfq-muted); }
.hfq-lead-control small { font-size: .68rem; color: var(--hfq-muted); }
.hfq-lead-control select { min-height: 38px; padding: 6px 30px 6px 9px; font-size: .84rem; }
.hfq-calculate { min-height: 38px; white-space: nowrap; }

.hfq-deliverybar {
  display: grid;
  grid-template-columns: auto minmax(280px, .9fr) minmax(210px, .7fr);
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  margin: 0;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid var(--hfq-line);
  background: var(--hfq-panel);
}
.hfq-deliverybar > legend { padding: 0; font-size: .76rem; font-weight: 800; color: var(--hfq-text); }
.hfq-delivery-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 0; }
.hfq-delivery-choices label { position: relative; min-width: 0; cursor: pointer; }
.hfq-delivery-choices input { position: absolute; width: 1px; height: 1px; min-height: 1px; opacity: 0; pointer-events: none; }
.hfq-delivery-choices label > span { display: block; min-width: 0; min-height: 42px; padding: 6px 9px; border: 1px solid var(--hfq-line); border-radius: 8px; background: var(--hfq-panel); }
.hfq-delivery-choices strong, .hfq-delivery-choices small { display: block; }
.hfq-delivery-choices strong { font-size: .78rem; }
.hfq-delivery-choices small { margin-top: 1px; overflow: hidden; color: var(--hfq-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-delivery-choices input:checked + span { border-color: var(--hfq-accent); box-shadow: inset 0 0 0 1px var(--hfq-accent); background: color-mix(in srgb, var(--hfq-accent) 6%, var(--hfq-panel)); }
.hfq-delivery-choices input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--hfq-accent) 32%, transparent); outline-offset: 2px; }
.hfq-delivery-postcode { display: grid; gap: 2px; min-width: 0; }
.hfq-delivery-postcode > span { color: var(--hfq-muted); font-size: .68rem; font-weight: 800; }
.hfq-delivery-postcode input { min-height: 38px; padding: 6px 9px; font-size: .82rem; text-transform: uppercase; }
.hfq-delivery-postcode small { color: var(--hfq-muted); font-size: .64rem; }

.hfq-upload--compact {
  display: flex;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  margin: 10px 12px;
  padding: 9px 12px;
  border-width: 1.5px;
  border-radius: 9px;
}
.hfq-upload--compact .hfq-upload-icon { width: 22px; height: 22px; margin: 0; flex: 0 0 22px; }
.hfq-upload--compact span { display: flex; gap: 4px; align-items: baseline; font-size: .86rem; }
.hfq-upload--compact small { color: var(--hfq-muted); }

.hfq-bulkbar {
  display: grid;
  grid-template-columns: auto minmax(135px, 1fr) minmax(115px, .7fr) 90px auto auto;
  align-items: end;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid color-mix(in srgb, var(--hfq-accent) 22%, var(--hfq-line));
  border-bottom: 1px solid color-mix(in srgb, var(--hfq-accent) 22%, var(--hfq-line));
  background: color-mix(in srgb, var(--hfq-accent) 7%, var(--hfq-panel));
}
.hfq-bulkbar > strong { align-self: center; white-space: nowrap; font-size: .83rem; }
.hfq-bulkbar label { display: grid; gap: 3px; min-width: 0; }
.hfq-bulkbar label > span { font-size: .68rem; font-weight: 800; color: var(--hfq-muted); }
.hfq-bulkbar input, .hfq-bulkbar select { min-height: 36px; padding: 6px 8px; font-size: .82rem; }
.hfq-bulkbar .hfq-button { min-height: 36px; padding: 7px 11px; font-size: .8rem; }

.hfq-line-table { min-width: 0; overflow-x: auto; }
.hfq-line-head,
.hfq-line-row {
  display: grid;
  grid-template-columns: 32px minmax(195px, 1.5fr) minmax(115px, .9fr) minmax(92px, .65fr) 64px minmax(120px, .9fr) minmax(82px, .55fr) 100px;
  gap: 8px;
  align-items: center;
  min-width: 860px;
}
.hfq-line-head {
  min-height: 34px;
  padding: 6px 11px;
  border-bottom: 1px solid var(--hfq-line);
  color: var(--hfq-muted);
  background: var(--hfq-soft);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.hfq-price-heading { text-align: right; }
.hfq-parts { display: block; min-width: 860px; }
.hfq-line { border-bottom: 1px solid var(--hfq-line); background: var(--hfq-panel); }
.hfq-line:last-child { border-bottom: 0; }
.hfq-line.is-selected { background: color-mix(in srgb, var(--hfq-accent) 5%, var(--hfq-panel)); }
.hfq-line.is-active .hfq-row-thumb { border-color: color-mix(in srgb, var(--hfq-accent) 65%, var(--hfq-line)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hfq-accent) 12%, transparent); }
.hfq-line.is-expanded { box-shadow: inset 3px 0 var(--hfq-accent); }
.hfq-line-row { min-height: 78px; padding: 7px 11px; }

.hfq-select-cell { display: grid; place-items: center; min-width: 0; }
.hfq-select-cell input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  accent-color: var(--hfq-accent);
}
.hfq-part-cell {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.hfq-part-cell:disabled { cursor: default; opacity: .72; }
.hfq-row-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 62px;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  font-size: .58rem;
  font-weight: 850;
  letter-spacing: .05em;
}
.hfq-row-thumb svg, .hfq-row-thumb img { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.hfq-line-name { min-width: 0; }
.hfq-line-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.hfq-line-name small { display: flex; align-items: center; gap: 5px; margin-top: 3px; min-width: 0; color: var(--hfq-muted); font-size: .68rem; }
.hfq-line-number { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 4px; background: var(--hfq-soft); font-weight: 800; }
.hfq-status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--hfq-muted); }
.hfq-status-dot[data-tone="ready"] { background: var(--hfq-success); }
.hfq-status-dot[data-tone="review"] { background: var(--hfq-warning); }
.hfq-status-dot[data-tone="error"] { background: var(--hfq-danger); }
.hfq-status-dot[data-tone="working"] { background: var(--hfq-accent); }

.hfq-line-field { display: grid; min-width: 0; }
.hfq-line-field > span { display: none; }
.hfq-line-field input, .hfq-line-field select { min-height: 36px; padding: 6px 8px; border-width: 1px; font-size: .79rem; }
.hfq-line-ops { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hfq-op-chips { display: flex; flex: 1 1 auto; gap: 4px; min-width: 0; overflow: hidden; }
.hfq-op-chip {
  flex: 0 0 auto;
  max-width: 112px;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-radius: 999px;
  color: var(--hfq-muted);
  background: var(--hfq-soft);
  font-size: .64rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hfq-op-chip.is-review { color: #6f5300; background: #fff8c5; border-color: #e4c767; }
.hfq-text-button { padding: 3px; border: 0; color: var(--hfq-accent-strong); background: transparent; font: 750 .72rem/1 inherit; cursor: pointer; }
.hfq-holes-button { flex: 0 0 auto; padding: 5px 7px; border-radius: 999px; color: #6b2fa0; background: #f4e8ff; }
.hfq-muted-inline { color: var(--hfq-muted); font-size: .72rem; }
.hfq-line-price { min-width: 0; text-align: right; }
.hfq-line-price strong, .hfq-line-price small { display: block; }
.hfq-line-price strong { font-size: .82rem; }
.hfq-line-price small { margin-top: 2px; color: var(--hfq-muted); font-size: .64rem; }
.hfq-price-review { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #6f5300; background: #fff8c5; font-size: .68rem; font-weight: 800; }
.hfq-line-actions { display: flex; justify-content: flex-end; gap: 3px; }
.hfq-row-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--hfq-line);
  border-radius: 6px;
  color: var(--hfq-muted);
  background: var(--hfq-panel);
  font: 800 1rem/1 inherit;
  cursor: pointer;
}
.hfq-row-action--danger { color: var(--hfq-danger); }
.hfq-row-action:disabled, .hfq-row-action[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.hfq-visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.hfq-line-detail { padding: 13px 15px 16px 50px; border-top: 1px solid var(--hfq-line); background: color-mix(in srgb, var(--hfq-soft) 55%, var(--hfq-panel)); }
.hfq-line-detail .hfq-alert { margin-bottom: 0; }
.hfq-analysis--compact { display: block; margin: 0; }
.hfq-detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.hfq-detail-heading strong, .hfq-detail-heading small { display: block; }
.hfq-detail-heading small { margin-top: 2px; color: var(--hfq-muted); font-size: .72rem; }
.hfq-expanded-analysis-grid { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); align-items: stretch; gap: 14px; min-width: 0; }
.hfq-expanded-preview {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) auto;
  min-width: 0;
  min-height: 238px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-radius: 10px;
  color: var(--hfq-text);
  background: #fff;
  text-align: left;
  cursor: zoom-in;
}
.hfq-expanded-preview:hover { border-color: color-mix(in srgb, var(--hfq-accent) 55%, var(--hfq-line)); }
.hfq-expanded-preview-canvas { display: grid; place-items: center; min-width: 0; min-height: 190px; padding: 8px; overflow: hidden; color: var(--hfq-muted); background: #fbfcfd; font-size: .78rem; text-align: center; }
.hfq-expanded-preview-canvas svg, .hfq-expanded-preview-canvas img { display: block; width: 100%; height: 100%; max-height: 220px; object-fit: contain; }
.hfq-expanded-preview-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-width: 0; padding: 9px 11px; border-top: 1px solid var(--hfq-line); }
.hfq-expanded-preview-caption strong { font-size: .8rem; }
.hfq-expanded-preview-caption small { overflow: hidden; color: var(--hfq-muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-analysis-data { min-width: 0; }
.hfq-analysis--compact .hfq-geometry { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hfq-analysis--compact .hfq-dfm { margin-bottom: 13px; }

.hfq-ops { margin: 16px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--hfq-line); min-width: 0; }
.hfq-ops > legend { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; width: 100%; padding: 0 0 10px; }
.hfq-ops > legend strong, .hfq-ops > legend small { display: block; }
.hfq-ops > legend strong { font-size: .94rem; }
.hfq-ops > legend small { margin-top: 2px; color: var(--hfq-muted); font-size: .7rem; font-weight: 500; }
.hfq-ops-count { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 10%, var(--hfq-panel)); font-size: .68rem; font-weight: 800; }
.hfq-op-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 11px; align-items: start; min-width: 0; }
.hfq-op-group { min-width: 0; overflow: hidden; border: 1px solid var(--hfq-line); border-radius: 10px; background: var(--hfq-panel); }
.hfq-op-group.is-review { border-color: #e4c767; }
.hfq-op-group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--hfq-line); background: var(--hfq-soft); }
.hfq-op-group.is-review .hfq-op-group-head { border-bottom-color: #ead68d; background: #fffbed; }
.hfq-op-group-head strong, .hfq-op-group-head small { display: block; }
.hfq-op-group-head strong { font-size: .8rem; }
.hfq-op-group-head small { max-width: 46ch; margin-top: 2px; color: var(--hfq-muted); font-size: .67rem; line-height: 1.35; }
.hfq-op-group-head > span { flex: 0 0 auto; padding: 3px 6px; border: 1px solid var(--hfq-line); border-radius: 999px; color: var(--hfq-muted); background: var(--hfq-panel); font-size: .6rem; font-weight: 800; white-space: nowrap; }
.hfq-op-group.is-review .hfq-op-group-head > span { border-color: #e4c767; color: #6f5300; background: #fff8c5; }
.hfq-op-list { display: block; }
.hfq-op {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(135px, .42fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--hfq-line);
  border-radius: 0;
  background: var(--hfq-panel);
}
.hfq-op:last-child { border-bottom: 0; }
.hfq-op.is-selected { background: color-mix(in srgb, var(--hfq-accent) 5%, var(--hfq-panel)); }
.hfq-op.is-manual { grid-template-columns: minmax(0, 1fr); border-left: 0; }
.hfq-op.is-manual.is-selected { background: #fffdf4; }
.hfq-op.is-office-review.is-selected { background: #fffdf4; }
.hfq-op-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; min-width: 0; }
.hfq-op-main .hfq-check { min-width: 0; }
.hfq-op-main .hfq-check > span:last-child { min-width: 0; }
.hfq-op-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; color: var(--hfq-accent-strong); }
.hfq-op-icon:empty { display: none; }
.hfq-op-icon svg { display: block; width: 22px; height: 22px; }
.hfq-op-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; color: var(--hfq-muted); background: var(--hfq-soft); font-size: .62rem; font-weight: 800; white-space: nowrap; }
.hfq-op-status[data-tone="on"] { color: var(--hfq-success); background: #e8f7ef; }
.hfq-op-status[data-tone="review"] { color: #6f5300; background: #fff8c5; }
.hfq-op-control { min-width: 0; }
.hfq-op-control label { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px; font-size: .7rem; font-weight: 800; }
.hfq-op-control label small { color: var(--hfq-muted); font-size: .64rem; font-weight: 500; }
.hfq-op-control input, .hfq-op-control select { min-height: 38px; padding: 7px 8px; font-size: .8rem; }
.hfq-manual-note { margin: 2px 0 0 28px; }
.hfq-manual-note label { margin-bottom: 5px; }
.hfq-manual-note label small { display: block; margin-top: 2px; color: var(--hfq-muted); font-size: .67rem; font-weight: 500; }

/* One graphical chooser owns all grade guidance. Quote rows show only the
   selected grade; descriptions and available gauges live here. */
.hfq-material-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-radius: 14px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  box-shadow: 0 24px 80px rgba(7, 15, 30, .28);
}
.hfq-material-dialog::backdrop { background: rgba(7, 15, 30, .68); backdrop-filter: blur(2px); }
.hfq-material-modal { display: grid; grid-template-rows: auto auto minmax(0, 1fr); width: 100%; min-width: 0; max-height: calc(100dvh - 34px); }
.hfq-material-modal > * { min-width: 0; }
.hfq-material-modal .hfq-preview-head > div { min-width: 0; }
.hfq-material-intro { margin: 0; padding: 11px 15px; overflow-wrap: anywhere; border-bottom: 1px solid var(--hfq-line); color: var(--hfq-muted); background: var(--hfq-soft); font-size: .78rem; }
.hfq-material-options { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; min-height: 0; padding: 14px; overflow: auto; }
.hfq-material-family { flex: 0 0 auto; min-width: 0; }
.hfq-material-family {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hfq-material-accent) 36%, var(--hfq-line));
  border-left: 5px solid var(--hfq-material-accent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--hfq-material-accent) 5%, var(--hfq-panel));
}
.hfq-material-family > header { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-bottom: 1px solid color-mix(in srgb, var(--hfq-material-accent) 24%, var(--hfq-line)); }
.hfq-material-family > header > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.hfq-material-family > header strong, .hfq-material-family > header small { display: block; }
.hfq-material-family > header strong { color: color-mix(in srgb, var(--hfq-material-accent) 72%, #172033); font-size: .9rem; }
.hfq-material-family > header small { max-width: 78ch; margin-top: 2px; color: var(--hfq-muted); font-size: .68rem; line-height: 1.35; }
.hfq-material-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 9px; }
.hfq-material-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--hfq-line);
  border-left: 4px solid var(--hfq-material-accent);
  border-radius: 9px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .14s;
}
.hfq-material-card:hover { border-color: var(--hfq-material-accent); background: color-mix(in srgb, var(--hfq-material-accent) 7%, var(--hfq-panel)); transform: translateY(-1px); }
.hfq-material-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--hfq-material-accent) 32%, transparent); outline-offset: 1px; }
.hfq-material-card.is-selected { border-color: var(--hfq-material-accent); background: color-mix(in srgb, var(--hfq-material-accent) 11%, var(--hfq-panel)); box-shadow: inset 0 0 0 1px var(--hfq-material-accent); }
.hfq-material-card:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.hfq-material-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hfq-material-card-title strong { overflow: hidden; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-material-card-title em { flex: 0 0 auto; margin-left: auto; padding: 2px 6px; border-radius: 999px; color: color-mix(in srgb, var(--hfq-material-accent) 76%, #172033); background: color-mix(in srgb, var(--hfq-material-accent) 17%, #fff); font-size: .6rem; font-style: normal; font-weight: 850; text-transform: uppercase; }
.hfq-material-description { color: var(--hfq-muted); font-size: .7rem; line-height: 1.4; }
.hfq-material-advice { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px; padding: 6px 7px; border-radius: 6px; color: #276348; background: #edf8f2; font-size: .66rem; line-height: 1.35; }
.hfq-material-advice.is-caution { color: #77580a; background: #fff8e6; }
.hfq-material-advice b { font-size: .61rem; text-transform: uppercase; }
.hfq-material-gauges { display: grid; gap: 4px; padding-top: 2px; }
.hfq-material-gauges > b { color: var(--hfq-muted); font-size: .61rem; text-transform: uppercase; }
.hfq-material-gauges > span { display: flex; flex-wrap: wrap; gap: 4px; }
.hfq-material-gauges > span > span { padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--hfq-material-accent) 28%, var(--hfq-line)); border-radius: 999px; color: var(--hfq-text); background: color-mix(in srgb, var(--hfq-material-accent) 7%, var(--hfq-panel)); font-size: .62rem; font-weight: 750; }
.hfq-material-gauges > span > span.is-empty { color: var(--hfq-muted); font-weight: 600; }
.hfq-material-unavailable { color: var(--hfq-danger); font-size: .64rem; font-weight: 750; }

/* One modal owns both the flat-pattern and interactive model surfaces. */
.hfq-preview-dialog {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-radius: 14px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  box-shadow: 0 24px 80px rgba(7, 15, 30, .28);
}
.hfq-preview-dialog::backdrop { background: rgba(7, 15, 30, .68); backdrop-filter: blur(2px); }
.hfq-preview-modal { display: grid; grid-template-rows: auto auto minmax(360px, 1fr) auto; max-height: calc(100dvh - 34px); }
.hfq-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 13px 15px; border-bottom: 1px solid var(--hfq-line); }
.hfq-preview-head h2 { margin: 1px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.05rem; }
.hfq-preview-kicker { color: var(--hfq-muted); font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hfq-preview-tabs { display: flex; gap: 4px; padding: 7px 12px 0; background: var(--hfq-soft); }
.hfq-preview-tabs button { min-height: 38px; padding: 7px 12px; border: 0; border-bottom: 3px solid transparent; color: var(--hfq-muted); background: transparent; font: 750 .8rem/1.2 inherit; cursor: pointer; }
.hfq-preview-tabs button[aria-selected="true"] { border-bottom-color: var(--hfq-accent); color: var(--hfq-accent-strong); }
.hfq-preview-tabs button:disabled { opacity: .42; cursor: not-allowed; }
.hfq-preview-modal-host { position: relative; display: grid; place-items: center; min-height: 420px; height: min(62vh, 680px); overflow: hidden; color: #64748b; background: #f8fafc; }
.hfq .hfq-preview-modal-host.aq2-3dwrap { min-height: 420px; height: min(62vh, 680px); border-radius: 0; }
.hfq-preview-modal-host > svg, .hfq-preview-modal-host > img { display: block; width: 100%; height: 100%; max-height: 100%; padding: 24px; object-fit: contain; }
.hfq-preview-empty { display: grid; place-items: center; gap: 8px; max-width: 460px; padding: 30px; text-align: center; color: var(--hfq-muted); }
.hfq-preview-empty strong { color: var(--hfq-text); }
.hfq-preview-meta { max-height: 180px; padding: 11px 14px; overflow: auto; border-top: 1px solid var(--hfq-line); background: var(--hfq-panel); }
.hfq-preview-meta .hfq-geometry { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hfq-preview-meta .hfq-dfm { margin: 9px 0 0; }

@media (max-width: 1180px) {
  .hfq-shell { grid-template-columns: 1fr; }
  .hfq-sidebar { position: static; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .hfq-commandbar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .hfq-command-copy { grid-column: 2; }
  .hfq-lead-control { grid-column: 1 / 3; grid-row: 2; }
  .hfq-calculate { grid-column: 3; grid-row: 1 / 3; align-self: stretch; }
  .hfq-deliverybar { grid-template-columns: 1fr 1fr; }
  .hfq-deliverybar > legend { grid-column: 1 / -1; }
  .hfq-bulkbar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hfq-bulkbar > strong { grid-column: 1 / -1; }
  .hfq-line-table { overflow: visible; }
  .hfq-line-head { display: none; }
  .hfq-parts { min-width: 0; }
  .hfq-line-row {
    grid-template-columns: 32px minmax(0, 1fr) minmax(105px, .72fr) auto;
    grid-template-rows: auto auto auto auto;
    min-width: 0;
    gap: 8px;
    padding: 10px;
  }
  .hfq-select-cell { grid-column: 1; grid-row: 1; }
  .hfq-part-cell { grid-column: 2 / 4; grid-row: 1; }
  .hfq-line-actions { grid-column: 4; grid-row: 1; }
  .hfq-line-material { grid-column: 1 / 3; grid-row: 2; }
  .hfq-line-thickness { grid-column: 3 / 5; grid-row: 2; }
  .hfq-line-quantity { grid-column: 1 / 3; grid-row: 3; }
  .hfq-line-ops { grid-column: 3 / 5; grid-row: 3; }
  .hfq-line-price { grid-column: 1 / 5; grid-row: 4; padding-top: 7px; border-top: 1px solid var(--hfq-line); text-align: left; }
  .hfq-line-field > span { display: block; margin-bottom: 3px; color: var(--hfq-muted); font-size: .67rem; font-weight: 800; }
  .hfq-line-field input, .hfq-line-field select, .hfq-text-button { min-height: 44px; }
  .hfq-row-action { width: 44px; height: 44px; min-height: 44px; }
  .hfq-bulkbar .hfq-button { min-height: 44px; }
  .hfq-line-detail { padding: 13px; }
  .hfq-expanded-analysis-grid { grid-template-columns: 1fr; }
  .hfq-expanded-preview { grid-template-rows: clamp(190px, 34vw, 260px) auto; }
  .hfq-expanded-preview-canvas { min-height: 190px; }
  .hfq-analysis--compact .hfq-geometry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hfq-op-groups { grid-template-columns: 1fr; }
  .hfq-op { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .hfq-sidebar { grid-template-columns: 1fr; }
  .hfq-workspace,
  .hfq-commandbar,
  .hfq-deliverybar,
  .hfq-bulkbar,
  .hfq-line-row { max-width: 100%; min-width: 0; }
  .hfq-commandbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hfq-command-copy { grid-column: 1 / -1; grid-row: 1; }
  .hfq-add-button { grid-column: 1; grid-row: 2; }
  .hfq-calculate { grid-column: 2; grid-row: 2; }
  .hfq-add-button,
  .hfq-calculate { width: 100%; min-width: 0; white-space: normal; }
  .hfq-lead-control { grid-column: 1 / -1; grid-row: 3; }
  .hfq-deliverybar { grid-template-columns: 1fr; padding: 10px; }
  .hfq-deliverybar > legend { grid-column: 1; }
  .hfq-delivery-choices { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hfq-delivery-choices small { overflow: visible; text-overflow: clip; white-space: normal; }
  .hfq-delivery-postcode input { min-height: 44px; }
  .hfq-upload--compact span { display: block; }
  .hfq-bulkbar { grid-template-columns: 1fr 1fr; }
  .hfq-bulkbar label:nth-of-type(1) { grid-column: 1 / -1; }
  .hfq-bulkbar > *,
  .hfq-bulkbar .hfq-button { width: 100%; min-width: 0; }
  .hfq-bulkbar .hfq-button { padding-inline: 6px; white-space: normal; }
  .hfq-line-row { grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: repeat(7, auto); }
  .hfq-part-cell { grid-template-columns: 64px minmax(0, 1fr); }
  .hfq-row-thumb { width: 64px; height: 56px; }
  .hfq-part-cell { grid-column: 2 / -1; grid-row: 1; }
  .hfq-line-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; }
  .hfq-line-material { grid-column: 1 / -1; grid-row: 3; }
  .hfq-line-thickness { grid-column: 1 / -1; grid-row: 4; }
  .hfq-line-quantity { grid-column: 1 / -1; grid-row: 5; }
  .hfq-line-ops { grid-column: 1 / -1; grid-row: 6; min-height: 36px; }
  .hfq-line-price { grid-column: 1 / -1; grid-row: 7; }
  .hfq-detail-heading { align-items: flex-start; flex-direction: column; }
  .hfq-expanded-preview { grid-template-rows: clamp(180px, 52vw, 230px) auto; min-height: 226px; }
  .hfq-expanded-preview-caption { align-items: flex-start; flex-direction: column; gap: 2px; }
  .hfq-op-main { align-items: flex-start; }
  .hfq-op-group-head { align-items: flex-start; flex-direction: column; }
  .hfq-manual-note { margin-left: 0; }
  .hfq-preview-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 10px; }
  .hfq-preview-modal { max-height: calc(100dvh - 14px); grid-template-rows: auto auto minmax(260px, 1fr) auto; }
  .hfq-preview-modal-host { min-height: 300px; height: 54vh; }
  .hfq .hfq-preview-modal-host.aq2-3dwrap { min-height: 300px; height: 54vh; }
  .hfq-preview-meta .hfq-geometry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Public editor parity refresh ------------------------------------------------ */
.quote-workspace-section {
  padding-top: clamp(8px, 1.5vw, 18px) !important;
  padding-bottom: clamp(28px, 5vw, 58px) !important;
}

.hfq-shell { grid-template-columns: minmax(0, 1fr); }
.hfq-sidebar {
  position: static;
  grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr);
  align-items: start;
}
.hfq-commandbar {
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
  padding: 8px 11px;
}
.hfq-command-copy p { margin: 0; }

.hfq-fulfilment {
  padding: 16px;
  border-top: 1px solid var(--hfq-line);
  background: color-mix(in srgb, var(--hfq-soft) 58%, var(--hfq-panel));
}
.hfq-fulfilment-head { margin-bottom: 12px; }
.hfq-fulfilment-head h2 { margin: 0; color: inherit; font-size: 1rem; }
.hfq-fulfilment-head p { margin: 3px 0 0; color: var(--hfq-muted); font-size: .76rem; }
.hfq-fulfilment-grid {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(470px, 1.35fr) auto;
  gap: 12px;
  align-items: end;
}
.hfq-fulfilment .hfq-lead-control { grid-column: auto; grid-row: auto; align-self: stretch; }
.hfq-fulfilment .hfq-lead-control select { min-height: 42px; }
.hfq-fulfilment .hfq-calculate { grid-column: auto; grid-row: auto; min-height: 44px; padding-inline: 22px; }
.hfq-fulfilment .hfq-deliverybar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr);
  gap: 7px 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.hfq-fulfilment .hfq-deliverybar > legend {
  grid-column: 1 / -1;
  font-size: .72rem;
}
.hfq-fulfilment .hfq-deliverybar > legend small { color: var(--hfq-muted); font-weight: 500; }
.hfq-delivery-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hfq-delivery-postcode input { min-height: 42px; }

.hfq-line-head,
.hfq-line-row {
  grid-template-columns: 32px minmax(220px, 1.5fr) minmax(135px, .88fr) 82px 58px 124px 88px minmax(100px, .65fr) 76px 92px;
  min-width: 1050px;
}
.hfq-parts { min-width: 1050px; }
.hfq-line-row { min-height: 106px; }
.hfq-part-cell { grid-template-columns: 112px minmax(0, 1fr); }
.hfq-row-thumb { width: 112px; height: 88px; }
.hfq-row-thumb svg, .hfq-row-thumb img { padding: 5px; }
.hfq-row-thumb svg *,
.hfq-expanded-preview-canvas svg *,
.hfq-preview-modal-host > svg * { vector-effect: non-scaling-stroke; }

.hfq-line-field { align-self: stretch; align-content: center; }
.hfq-line-field > span { display: block; margin-bottom: 3px; color: var(--hfq-muted); font-size: .65rem; font-weight: 800; }
.hfq-material-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px 6px 7px;
  overflow: hidden;
  border: 1px solid var(--hfq-line);
  border-left: 4px solid var(--hfq-material-accent, #9aa5ad);
  border-radius: 6px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hfq-material-trigger:hover { background: color-mix(in srgb, var(--hfq-material-accent) 7%, var(--hfq-panel)); }
.hfq-material-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--hfq-material-accent) 30%, transparent); outline-offset: 1px; }
.hfq-material-trigger:disabled { opacity: .55; cursor: not-allowed; }
.hfq-material-trigger strong { overflow: hidden; font-size: .79rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-material-swatch { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: var(--hfq-material-accent, #9aa5ad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hfq-material-accent, #9aa5ad) 18%, transparent); }
.hfq-auto-note { display: block; margin-top: 3px; color: var(--hfq-success); font-size: .62rem; font-weight: 800; }

.hfq-inline-op { display: grid; align-content: center; gap: 3px; min-width: 0; }
.hfq-inline-op-label { display: flex; align-items: center; gap: 4px; color: var(--hfq-muted); font-size: .65rem; font-weight: 800; }
.hfq-inline-op .hfq-op-icon { width: 18px; height: 18px; flex-basis: 18px; }
.hfq-inline-op .hfq-op-icon svg { width: 16px; height: 16px; }
.hfq-inline-op select { min-height: 36px; padding: 6px 7px; font-size: .74rem; }
.hfq-inline-op a { color: var(--hfq-accent-strong); font-size: .61rem; font-weight: 700; }
.hfq-inline-fold {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  cursor: pointer;
}
.hfq-inline-fold.is-disabled { opacity: .55; cursor: not-allowed; }
.hfq-inline-fold input { width: 19px; height: 19px; min-height: 19px; flex: 0 0 19px; padding: 0; accent-color: var(--hfq-accent); }
.hfq-inline-fold .hfq-op-icon { width: 22px; height: 22px; flex-basis: 22px; }
.hfq-inline-fold strong, .hfq-inline-fold small { display: block; }
.hfq-inline-fold strong { font-size: .76rem; }
.hfq-inline-fold small { color: var(--hfq-muted); font-size: .62rem; }

.hfq-expanded-analysis-grid { grid-template-columns: minmax(340px, .86fr) minmax(0, 1.14fr); }
.hfq-expanded-preview { grid-template-rows: minmax(290px, 1fr) auto; min-height: 342px; }
.hfq-expanded-preview-canvas { min-height: 290px; padding: 10px; }
.hfq-expanded-preview-canvas svg, .hfq-expanded-preview-canvas img { max-height: 330px; }

.hfq-holes { margin-bottom: 12px; overflow: hidden; border: 1px solid var(--hfq-line); border-radius: 10px; background: var(--hfq-panel); }
.hfq-hole-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 11px; border-bottom: 1px solid var(--hfq-line); background: var(--hfq-soft); }
.hfq-hole-head strong, .hfq-hole-head small { display: block; }
.hfq-hole-head strong { font-size: .82rem; }
.hfq-hole-head small { margin-top: 2px; color: var(--hfq-muted); font-size: .68rem; }
.hfq-hole-head > span { flex: 0 0 auto; color: var(--hfq-accent-strong); font-size: .68rem; font-weight: 800; }
.hfq-hole-list { max-height: 520px; overflow: auto; }
.hfq-hole-row {
  display: grid;
  grid-template-columns: minmax(170px, .7fr) minmax(160px, .65fr) minmax(240px, 1.4fr);
  gap: 9px;
  align-items: start;
  padding: 10px 11px;
  border-bottom: 1px solid var(--hfq-line);
}
.hfq-hole-row:last-child { border-bottom: 0; }
.hfq-hole-row > label { display: grid; gap: 3px; min-width: 0; }
.hfq-hole-row > label > span, .hfq-hardware-picker label > span { color: var(--hfq-muted); font-size: .66rem; font-weight: 800; }
.hfq-hole-row select, .hfq-hole-row input { min-height: 38px; padding: 7px 8px; font-size: .76rem; }
.hfq-hole-identity { display: flex; align-items: center; gap: 8px; min-width: 0; padding-top: 18px; }
.hfq-hole-identity > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; color: var(--hfq-on); background: var(--hfq-accent); font-size: .66rem; font-weight: 850; }
.hfq-hole-identity strong, .hfq-hole-identity small { display: block; }
.hfq-hole-identity strong { font-size: .75rem; }
.hfq-hole-identity small { color: var(--hfq-muted); font-size: .61rem; }
.hfq-hardware-picker { display: grid; gap: 6px; min-width: 0; }
.hfq-hardware-picker > label { display: grid; gap: 3px; }
.hfq-hardware-search { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 5px; }
.hfq-hardware-search .hfq-button { min-height: 38px; padding: 7px 9px; font-size: .72rem; }
.hfq-hole-note, .hfq-hole-error { color: var(--hfq-muted); font-size: .65rem; }
.hfq-hole-error { color: var(--hfq-danger); }

@media (max-width: 980px) {
  .hfq-fulfilment-grid { grid-template-columns: minmax(210px, .65fr) minmax(0, 1.35fr); }
  .hfq-fulfilment .hfq-calculate { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 1180px) {
  .hfq-sidebar, .hfq-fulfilment-grid { grid-template-columns: minmax(0, 1fr); }
  .hfq-fulfilment .hfq-calculate { grid-column: auto; }
  .hfq-fulfilment .hfq-deliverybar { grid-template-columns: minmax(0, 1fr); }
  .hfq-fulfilment .hfq-deliverybar > legend { grid-column: 1; }
  .hfq-line-table { overflow: visible; }
  .hfq-line-head { display: none; }
  .hfq-parts { min-width: 0; }
  .hfq-line-row {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto auto;
    min-width: 0;
  }
  .hfq-select-cell { grid-column: 1 / 2; grid-row: 1; }
  .hfq-part-cell { grid-column: 2 / 10; grid-row: 1; }
  .hfq-line-actions { grid-column: 10 / 13; grid-row: 1; }
  .hfq-line-material { grid-column: 1 / 6; grid-row: 2; }
  .hfq-line-thickness { grid-column: 6 / 10; grid-row: 2; }
  .hfq-line-quantity { grid-column: 10 / 13; grid-row: 2; }
  .hfq-inline-deburr { grid-column: 1 / 9; grid-row: 3; }
  .hfq-inline-fold { grid-column: 9 / 13; grid-row: 3; }
  .hfq-line-ops { grid-column: 1 / 13; grid-row: 4; }
  .hfq-line-price { grid-column: 1 / 13; grid-row: 5; }
  .hfq-expanded-analysis-grid { grid-template-columns: minmax(0, 1fr); }
  .hfq-expanded-preview { grid-template-rows: clamp(260px, 50vw, 340px) auto; min-height: 312px; }
  .hfq-hole-row { grid-template-columns: minmax(150px, .75fr) minmax(0, 1.25fr); }
  .hfq-hole-row > :nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .quote-workspace-section { padding-top: 6px !important; }
  .hfq-commandbar { grid-template-columns: minmax(0, 1fr); }
  .hfq-command-copy { grid-column: 1; grid-row: 1; }
  .hfq-add-button { grid-column: 1; grid-row: 2; width: 100%; }
  .hfq-delivery-choices { grid-template-columns: minmax(0, 1fr); }
  .hfq-line-row { grid-template-columns: 32px minmax(0, 1fr); grid-template-rows: repeat(9, auto); }
  .hfq-part-cell { grid-template-columns: 88px minmax(0, 1fr); grid-column: 2; grid-row: 1; }
  .hfq-row-thumb { width: 88px; height: 72px; }
  .hfq-line-actions { grid-column: 1 / -1; grid-row: 2; }
  .hfq-line-material { grid-column: 1 / -1; grid-row: 3; }
  .hfq-line-thickness { grid-column: 1 / -1; grid-row: 4; }
  .hfq-line-quantity { grid-column: 1 / -1; grid-row: 5; }
  .hfq-inline-deburr { grid-column: 1 / -1; grid-row: 6; }
  .hfq-inline-fold { grid-column: 1 / -1; grid-row: 7; }
  .hfq-line-ops { grid-column: 1 / -1; grid-row: 8; }
  .hfq-line-price { grid-column: 1 / -1; grid-row: 9; }
  .hfq-inline-op select { min-height: 44px; }
  .hfq-hole-row { grid-template-columns: minmax(0, 1fr); }
  .hfq-hole-row > :nth-child(3) { grid-column: auto; }
  .hfq-hole-identity { padding-top: 0; }
  .hfq-hardware-search { grid-template-columns: minmax(0, 1fr) minmax(88px, auto); }
  .hfq-hardware-search input { grid-column: 1 / -1; }
  .hfq-expanded-preview { grid-template-rows: clamp(230px, 64vw, 300px) auto; }
}

@media (max-width: 700px) {
  .hfq-material-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 10px; }
  .hfq-material-modal { max-height: calc(100dvh - 14px); }
  .hfq-material-card-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .hfq-material-options { padding: 8px; }
  .hfq-material-advice { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Shared 3D holes + hardware workspace ------------------------------------- */
.hfq-hole-dialog {
  width: min(1500px, calc(100vw - 30px));
  height: min(920px, calc(100dvh - 30px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hfq-line) 82%, #70839b);
  border-radius: 16px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  box-shadow: 0 28px 80px rgba(7, 15, 30, .32);
}
.hfq-hole-dialog::backdrop { background: rgba(7, 15, 30, .7); backdrop-filter: blur(3px); }
.hfq-hole-modal { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.hfq-hole-modal > * { min-width: 0; }
.hfq-hole-modal-head { border-bottom: 1px solid var(--hfq-line); }
.hfq-hole-notice {
  display: flex;
  align-items: center;
  gap: 10px 18px;
  padding: 9px 16px;
  color: #0f5132;
  background: color-mix(in srgb, #d8f5e4 76%, var(--hfq-panel));
  border-bottom: 1px solid color-mix(in srgb, #68b787 36%, var(--hfq-line));
  font-size: .76rem;
}
.hfq-hole-notice strong { flex: 0 0 auto; }
.hfq-hole-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 430px); min-width: 0; min-height: 0; }
.hfq-hole-stage {
  position: relative;
  min-width: 0;
  min-height: 430px;
  overflow: hidden;
  border-right: 1px solid var(--hfq-line);
  background: radial-gradient(circle at 50% 42%, #f9fbfd 0, #eef2f6 68%, #e3e9ef 100%);
}
.hfq-hole-viewer { position: absolute; inset: 0; display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; }
.hfq .hfq-hole-viewer.aq2-3dwrap { position: absolute; inset: 0; width: auto; min-height: 0; height: auto; border-radius: 0; }
.hfq-hole-stage-help {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  color: #475569;
  font-size: .67rem;
  font-weight: 700;
}
.hfq-hole-stage-help span { padding: 6px 9px; border: 1px solid rgba(148, 163, 184, .45); border-radius: 999px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(6px); }
.hfq-hole-panel { min-width: 0; min-height: 0; overflow: auto; background: var(--hfq-panel); scrollbar-gutter: stable; }
.hfq-hole-panel-inner { display: grid; align-content: start; min-height: 100%; }
.hfq-hole-selection, .hfq-hole-config { padding: 15px; }
.hfq-hole-selection { border-bottom: 1px solid var(--hfq-line); background: color-mix(in srgb, var(--hfq-soft) 64%, var(--hfq-panel)); }
.hfq-hole-panel-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hfq-hole-panel-title h3 { margin: 1px 0 0; font-size: 1rem; }
.hfq-hole-panel-title > small { max-width: 175px; color: var(--hfq-muted); font-size: .65rem; text-align: right; }
.hfq-hole-groups { display: grid; gap: 7px; }
.hfq-hole-group {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 7px 10px;
  border: 1px solid var(--hfq-line);
  border-radius: 9px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hfq-hole-group:hover { border-color: color-mix(in srgb, var(--hfq-accent) 55%, var(--hfq-line)); background: color-mix(in srgb, var(--hfq-accent) 5%, var(--hfq-panel)); }
.hfq-hole-group.is-selected { border-color: var(--hfq-accent); background: color-mix(in srgb, var(--hfq-accent) 10%, var(--hfq-panel)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hfq-accent) 14%, transparent); }
.hfq-hole-group-size { display: grid; place-items: center; min-height: 40px; border-radius: 7px; color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 12%, var(--hfq-panel)); font-size: .86rem; font-weight: 900; }
.hfq-hole-group strong, .hfq-hole-group small { display: block; }
.hfq-hole-group strong { font-size: .78rem; }
.hfq-hole-group small { margin-top: 2px; overflow: hidden; color: var(--hfq-muted); font-size: .65rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-hole-individual { margin-top: 9px; }
.hfq-hole-individual summary { color: var(--hfq-accent-strong); font-size: .7rem; font-weight: 800; cursor: pointer; }
.hfq-hole-individual > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: 7px; }
.hfq-hole-mini { display: grid; gap: 2px; min-width: 0; min-height: 48px; padding: 5px; border: 1px solid var(--hfq-line); border-radius: 7px; color: var(--hfq-text); background: var(--hfq-panel); font: inherit; cursor: pointer; }
.hfq-hole-mini.is-selected { border-color: var(--hfq-accent); color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 9%, var(--hfq-panel)); }
.hfq-hole-mini > span { font-size: .74rem; font-weight: 900; }
.hfq-hole-mini small { overflow: hidden; font-size: .56rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-hole-choice { display: grid; gap: 12px; }
.hfq-hole-choice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hfq-hole-choice-head > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.hfq-hole-choice-head strong, .hfq-hole-choice-head small { display: block; }
.hfq-hole-choice-head strong { font-size: .78rem; }
.hfq-hole-choice-head small { color: var(--hfq-muted); font-size: .63rem; }
.hfq-hole-number { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; color: var(--hfq-on); background: var(--hfq-accent); font-size: .7rem; font-weight: 900; }
.hfq-hole-current { max-width: 42%; padding: 5px 8px; overflow: hidden; border-radius: 999px; color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 11%, var(--hfq-panel)); font-size: .64rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.hfq-hole-operation-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.hfq-hole-operation-tabs button { min-height: 44px; padding: 6px; border: 1px solid var(--hfq-line); border-radius: 8px; color: var(--hfq-text); background: var(--hfq-panel); font: inherit; font-size: .68rem; font-weight: 800; cursor: pointer; }
.hfq-hole-operation-tabs button:hover { border-color: var(--hfq-accent); }
.hfq-hole-operation-tabs button.is-active { border-color: var(--hfq-accent); color: var(--hfq-on); background: var(--hfq-accent); box-shadow: 0 4px 12px color-mix(in srgb, var(--hfq-accent) 22%, transparent); }
.hfq-hole-dependent { display: grid; gap: 9px; }
.hfq-hole-dependent > label, .hfq-hole-dependent .hfq-hardware-picker > label { display: grid; gap: 4px; }
.hfq-hole-dependent label > span { color: var(--hfq-muted); font-size: .67rem; font-weight: 800; }
.hfq-hole-dependent select, .hfq-hole-dependent input { min-width: 0; min-height: 44px; }
.hfq-hardware-loading { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px; border: 1px dashed var(--hfq-line); border-radius: 9px; color: var(--hfq-muted); font-size: .69rem; }
.hfq-hardware-groups { display: grid; gap: 10px; max-height: 360px; overflow: auto; padding: 1px; scrollbar-gutter: stable; }
.hfq-hardware-group { display: grid; gap: 5px; }
.hfq-hardware-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hfq-hardware-group > header strong { font-size: .69rem; }
.hfq-hardware-group > header span { padding: 2px 6px; border-radius: 999px; color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 10%, var(--hfq-panel)); font-size: .6rem; font-weight: 800; }
.hfq-hardware-group > div { display: grid; gap: 5px; }
.hfq-hardware-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid var(--hfq-line);
  border-radius: 8px;
  color: var(--hfq-text);
  background: var(--hfq-panel);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hfq-hardware-card:hover { border-color: var(--hfq-accent); background: color-mix(in srgb, var(--hfq-accent) 5%, var(--hfq-panel)); }
.hfq-hardware-card.is-selected { border-color: #8c45c7; background: #f8efff; box-shadow: 0 0 0 2px rgba(140, 69, 199, .12); }
.hfq-hardware-card strong, .hfq-hardware-card small, .hfq-hardware-card em { display: block; }
.hfq-hardware-card strong { font-size: .71rem; }
.hfq-hardware-card small { margin-top: 1px; overflow: hidden; color: var(--hfq-muted); font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.hfq-hardware-card em { margin-top: 3px; color: var(--hfq-success); font-size: .59rem; font-style: normal; font-weight: 800; }
.hfq-hardware-model { position: relative; display: block; width: 38px; height: 42px; border-radius: 7px; background: linear-gradient(145deg, #f3e8ff, #e8ddf3); }
.hfq-hardware-model i, .hfq-hardware-model b { position: absolute; left: 50%; display: block; transform: translateX(-50%); }
.hfq-hardware-model i { top: 7px; width: 25px; height: 8px; border-radius: 50%; background: #8f5aad; box-shadow: inset 0 -2px 0 rgba(54, 25, 74, .25); }
.hfq-hardware-model b { top: 13px; width: 12px; height: 22px; border-radius: 2px 2px 5px 5px; background: linear-gradient(90deg, #6f3c91, #b483ce 48%, #6f3c91); }
.hfq-hardware-model[data-family*="stud"] b { height: 28px; border-radius: 2px; }
.hfq-hardware-model[data-family*="rivet"] i { width: 20px; }.hfq-hardware-model[data-family*="rivet"] b { width: 10px; }
.hfq-hole-adjust-note { display: grid; gap: 3px; margin: 0; padding: 10px; border: 1px solid var(--hfq-line); border-radius: 9px; color: var(--hfq-muted); background: var(--hfq-soft); font-size: .68rem; }
.hfq-hole-adjust-note strong { color: var(--hfq-text); }
.hfq-hole-adjust-note.is-adjusted { border-color: #62b688; color: #266244; background: color-mix(in srgb, #d8f5e4 66%, var(--hfq-panel)); }
.hfq-hole-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-top: 1px solid var(--hfq-line); background: var(--hfq-soft); }
.hfq-hole-footer p { margin: 0; color: var(--hfq-muted); font-size: .67rem; }
.hfq-hole-footer p strong { color: var(--hfq-text); }
.hfq-holes-summary .hfq-hole-head { border-bottom: 0; }
.hfq-hole-summary-body { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px; border-top: 1px solid var(--hfq-line); }
.hfq-hole-summary-model { position: relative; width: 58px; height: 48px; overflow: hidden; border: 1px solid var(--hfq-line); border-radius: 8px; background: linear-gradient(145deg, #d9e1e9, #f7f9fb); }
.hfq-hole-summary-model span { position: absolute; inset: 12px 8px; border-radius: 3px; background: #8593a3; transform: skewY(-7deg); }
.hfq-hole-summary-model i, .hfq-hole-summary-model b { position: absolute; top: 19px; width: 9px; height: 9px; border: 2px solid #9b4ed8; border-radius: 50%; background: #f4e8ff; }
.hfq-hole-summary-model i { left: 18px; }.hfq-hole-summary-model b { right: 14px; }
.hfq-hole-summary-body strong { font-size: .8rem; }
.hfq-hole-summary-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.hfq-hole-summary-chips span { padding: 3px 6px; border-radius: 999px; color: var(--hfq-accent-strong); background: color-mix(in srgb, var(--hfq-accent) 10%, var(--hfq-panel)); font-size: .6rem; font-weight: 800; }
.hfq-hole-summary-chips small { color: var(--hfq-muted); font-size: .62rem; }

@media (max-width: 900px) {
  .hfq-hole-dialog { width: calc(100vw - 12px); height: calc(100dvh - 12px); border-radius: 10px; }
  .hfq-hole-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: clamp(240px, 42dvh, 330px) minmax(0, 1fr); }
  .hfq-hole-stage { min-height: 240px; border-right: 0; border-bottom: 1px solid var(--hfq-line); }
  .hfq-hole-panel { max-height: none; }
  .hfq-hole-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (max-width: 560px) {
  .hfq-hole-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .hfq-hole-notice { min-height: 44px; justify-content: center; padding-block: 8px; }
  .hfq-hole-notice > :not(strong) { display: none; }
  .hfq-hole-workspace { grid-template-rows: clamp(220px, 34dvh, 290px) minmax(0, 1fr); }
  .hfq-hole-stage { min-height: 220px; }
  .hfq-hole-stage-help { display: none; }
  .hfq-hole-selection, .hfq-hole-config { padding: 11px; }
  .hfq-hole-operation-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hfq-hole-individual > div { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hfq-hole-summary-body { grid-template-columns: 50px minmax(0, 1fr); }
  .hfq-hole-summary-model { width: 50px; }
  .hfq-hole-summary-body > .hfq-button { grid-column: 1 / -1; width: 100%; }
  .hfq-hole-footer { align-items: stretch; flex-direction: column; padding: 10px 12px; }
  .hfq-hole-footer p { display: none; }
  .hfq-hole-footer .hfq-button { width: 100%; min-height: 44px; }
  .hfq-hole-panel-title { align-items: flex-start; flex-direction: column; }
  .hfq-hole-panel-title > small { max-width: none; text-align: left; }
}

/* Short landscape tablets, foldables and phones need the viewer and the
   scrollable configuration pane at the same time.  A stacked 190px viewer
   leaves only a sliver of panel at common 844x390 / 667x375 viewports, so the
   short-landscape layout returns to two columns while portrait stays stacked. */
@media (max-width: 900px) and (max-height: 700px) {
  .hfq-hole-notice { min-height: 44px; justify-content: center; padding-block: 8px; }
  .hfq-hole-notice > :not(strong) { display: none; }
  .hfq-hole-footer { padding-block: 6px; }
  .hfq-hole-footer p { display: none; }
  .hfq-preview-modal { grid-template-rows: auto auto minmax(180px, 1fr) minmax(0, auto); }
  .hfq-preview-modal-host,
  .hfq .hfq-preview-modal-host.aq2-3dwrap { min-height: 180px; height: 38dvh; }
  .hfq-preview-meta { max-height: 128px; }
}

@media (min-width: 561px) and (max-width: 900px) and (max-height: 700px) {
  .hfq-hole-workspace {
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 42vw);
    grid-template-rows: minmax(0, 1fr);
  }
  .hfq-hole-stage {
    min-height: 0;
    border-right: 1px solid var(--hfq-line);
    border-bottom: 0;
  }
  .hfq-hole-panel { min-height: 0; }
}

@media (max-width: 360px) {
  .hfq-part-cell { grid-template-columns: 72px minmax(0, 1fr); }
  .hfq-row-thumb { width: 72px; height: 62px; }
  .hfq-material-dialog { width: 100vw; max-height: 100dvh; border: 0; border-radius: 0; }
  .hfq-material-modal { max-height: 100dvh; }
  .hfq-material-intro { padding: 9px 11px; }
  .hfq-material-family { border-left-width: 3px; }
  .hfq-material-family > header { padding-inline: 9px; }
  .hfq-material-card-grid { padding: 7px; }
  .hfq-material-card { padding: 9px; }
  .hfq-hole-group { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 7px; padding-inline: 7px; }
  .hfq-hole-group-size { font-size: .78rem; }
  .hfq-hole-current { max-width: 48%; }
  .hfq-hardware-card { grid-template-columns: 38px minmax(0, 1fr); }
  .hfq-hardware-card > :last-child:not(:nth-child(2)) { grid-column: 2; }
}

@media (hover: none), (pointer: coarse), (any-pointer: coarse) {
  .hfq-row-action { width: 44px; height: 44px; min-height: 44px; }
  .hfq-material-trigger,
  .hfq-line-field input,
  .hfq-line-field select,
  .hfq-inline-op select,
  .hfq-hole-side-control { min-height: 44px; }
  .hfq-hole-operation-tabs button,
  .hfq-hole-dependent select,
  .hfq-hole-dependent input,
  .hfq-hole-individual summary,
  .hfq-text-button { min-height: 44px; }
  .hfq-hole-individual summary { display: flex; align-items: center; }
}
