:root {
  --ink: #172033;
  --muted: #647087;
  --line: #dce2eb;
  --surface: #ffffff;
  --page: #f1f4f8;
  --orange: #f36f21;
  --orange-dark: #d95508;
  --navy: #111c32;
  --green: #13844a;
  --green-soft: #e1f5e9;
  --red: #b42318;
  --red-soft: #fee7e5;
  --amber: #966500;
  --amber-soft: #fff1c6;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); }
body.auth-mode {
  background:
    linear-gradient(rgba(10, 20, 36, .48), rgba(10, 20, 36, .58)),
    url("shopfront-login.jpg") center 58% / cover fixed no-repeat;
}
body.auth-mode .auth-card {
  background: rgba(255, 255, 255, .94);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 22px 55px rgba(5, 13, 27, .4);
  backdrop-filter: blur(7px);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 104px;
  padding: 20px clamp(24px, 4vw, 64px);
  color: white;
  background: linear-gradient(115deg, #0d182b 0%, #17223a 65%, #342118 100%);
  border-bottom: 5px solid var(--orange);
}
.site-header h1 { margin: 0 0 5px; font-size: clamp(25px, 3vw, 34px); }
.site-header p { margin: 0; color: #ccd4e2; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 54px;
  border: 3px solid var(--orange);
  color: var(--orange);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: .04em;
  transform: skew(-8deg);
}
.header-user { margin-left: auto; text-align: right; font-size: 14px; }
.header-user strong { display: block; font-size: 16px; }
.header-user span { display: block; margin-top: 3px; color: #d7deea; }

main { width: min(1780px, calc(100% - 28px)); margin: 24px auto 60px; }
.hidden { display: none !important; }
body[data-role="customer"] .admin-only,
body[data-role="customer"] #admin-panel,
body[data-role="customer"] .admin-tab,
body[data-role="customer"] #accounts-panel,
body[data-role="customer"] #data-panel { display: none !important; }
body[data-role="admin"] .customer-tab { display: none !important; }

.auth-card, .card, .metric {
  background: var(--surface);
  border: 1px solid rgba(20, 40, 70, .08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(31, 47, 70, .07);
}
.auth-card { width: min(480px, 100%); margin: 8vh auto; padding: 34px; }
.auth-card h2, .card h2 { margin: 5px 0 14px; }
.auth-card p { color: var(--muted); line-height: 1.5; }
.card { padding: 24px; margin-bottom: 20px; }
.eyebrow { color: var(--orange-dark); font-size: 12px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.stack-form { display: grid; gap: 16px; margin-top: 22px; }
.stack-form.compact { gap: 12px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: #344058; }
input, textarea, select {
  width: 100%;
  border: 1px solid #bdc7d6;
  border-radius: 9px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(243,111,33,.17); border-color: var(--orange); }

.primary, .secondary, .danger, .text-button {
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  font-weight: 800;
}
.primary { background: var(--navy); color: #fff; }
.primary:hover { background: #213050; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.secondary { color: var(--ink); background: #fff; border: 1px solid #b8c3d3; }
.danger { color: var(--red); background: var(--red-soft); }
.text-button { padding: 6px 9px; color: #225da8; background: #eaf2fd; }

.tabs {
  display: flex;
  gap: 6px;
  padding: 7px;
  margin-bottom: 18px;
  overflow-x: auto;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 4px 16px rgba(31, 47, 70, .06);
}
.tabs button { white-space: nowrap; border: 0; border-radius: 8px; padding: 11px 16px; background: transparent; color: #4e5a70; font-weight: 750; }
.tabs button.active { background: var(--navy); color: #fff; }
.tabs .logout { margin-left: auto; }
.count { display: inline-block; min-width: 18px; margin-left: 5px; border-radius: 10px; padding: 1px 5px; background: rgba(120,130,150,.18); font-size: 11px; }

.notice { margin-bottom: 18px; border-radius: 10px; padding: 13px 16px; background: var(--green-soft); color: var(--green); font-weight: 650; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.warning { background: var(--amber-soft); color: var(--amber); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.status-pill { border-radius: 20px; padding: 8px 12px; font-size: 12px; font-weight: 800; }
.status-pill.neutral { color: #4e5a70; background: #edf0f5; }
.status-pill.good { color: var(--green); background: var(--green-soft); }
.status-pill.bad { color: var(--red); background: var(--red-soft); }

.search-card { padding: 16px 18px; }
.search-card .section-heading { margin-bottom: 10px; }
.search-card h2 { font-size: 22px; }
#parts-input { min-height: 68px; max-height: 96px; resize: vertical; }
.search-card .form-actions { margin-top: 10px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px; color: #69758b; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; background: #f7f8fa; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.part { font-family: Consolas, monospace; font-weight: 800; }
.money { text-align: right; white-space: nowrap; font-weight: 800; }
.muted { color: var(--muted); }
.availability { display: inline-block; border-radius: 16px; padding: 5px 9px; font-size: 12px; font-weight: 800; color: var(--amber); background: var(--amber-soft); }
.availability.available { color: var(--green); background: var(--green-soft); }
.availability.unavailable, .availability.not-found { color: var(--red); background: var(--red-soft); }
.empty-state { padding: 26px 10px; color: var(--muted); text-align: center; border: 1px dashed #c9d1dd; border-radius: 10px; }
.qty-input { width: 70px; padding: 8px; }
.order-form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.5fr) auto; align-items: end; gap: 14px; margin-top: 20px; }
.order-actions { display: flex; gap: 10px; align-items: end; }
.ducati-order-toolbar { display: grid; grid-template-columns: minmax(160px, 220px) minmax(220px, 360px); gap: 14px; margin-bottom: 14px; }
#ducati-order-input { min-height: 280px; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.c9-convert-card { padding: 24px; }
.c9-convert-toolbar { display: grid; grid-template-columns: minmax(240px, 420px); gap: 14px; margin-bottom: 14px; }
#c9-convert-text { min-height: 160px; font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.c9-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.c9-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}
.c9-summary strong { display: block; color: var(--navy); font-size: 18px; }
.c9-summary span { color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; }
.cam-ai-card { padding: 24px; }
.cam-ai-settings {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(180px, 280px);
  gap: 12px;
  margin-bottom: 14px;
}
.cam-ai-settings label { font-size: 11px; font-weight: 800; color: #586276; text-transform: uppercase; }
.cam-ai-settings input { margin-top: 6px; }
.cam-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}
.cam-ai-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(209, 67, 67, .12);
}
.cam-ai-status.online { background: var(--green-soft); color: var(--green); }
.cam-ai-status.online .cam-ai-light { background: var(--green); box-shadow: 0 0 0 3px rgba(28, 129, 80, .14); }
.cam-ai-status.checking { background: var(--amber-soft); color: var(--amber); }
.cam-ai-status.checking .cam-ai-light { background: var(--amber); box-shadow: 0 0 0 3px rgba(181, 114, 14, .14); }
.cam-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
}
.cam-ai-message {
  max-width: 82%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  line-height: 1.45;
}
.cam-ai-message.user {
  align-self: flex-end;
  border-color: #cbd7ea;
  background: #eef4ff;
}
.cam-ai-message.assistant { align-self: flex-start; }
.cam-ai-message { overflow-wrap: anywhere; }
.cam-ai-message strong { display: block; margin-bottom: 5px; color: var(--navy); font-size: 12px; text-transform: uppercase; }
.cam-ai-form { margin-top: 14px; }
#cam-ai-input { font-family: inherit; resize: vertical; }
.finder-card { padding: 0; overflow: hidden; }
.finder-card.filmstrip-left {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(460px, calc(100vh - 390px));
}
.finder-card.filmstrip-left .finder-toolbar,
.finder-card.filmstrip-left .finder-groups {
  grid-column: 1 / -1;
}
.finder-card.filmstrip-left .finder-layout {
  grid-column: 2;
  grid-row: 3;
}
.finder-card.filmstrip-left .finder-filmstrip-shell {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  border-top: 0;
  border-right: 1px solid var(--line);
}
.finder-toolbar { display: grid; grid-template-columns: 120px 120px minmax(260px, 1fr) minmax(250px, .75fr) minmax(220px, .8fr); gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); background: #fff; }
.finder-toolbar label { font-size: 11px; font-weight: 800; color: #586276; text-transform: uppercase; }
.finder-toolbar select, .finder-toolbar input { margin-top: 6px; }
.finder-vin-field span { display: flex; gap: 6px; }
.finder-vin-field input { min-width: 0; }
.finder-vin-field button { align-self: end; min-width: 58px; height: 38px; margin-top: 6px; padding: 0 12px; border: 0; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 900; }
.finder-vin-field.is-hidden { display: none; }
.finder-groups { display: flex; justify-content: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafafa; }
.finder-groups button { min-width: 150px; border: 1px solid #8b8f96; border-radius: 20px; background: #fff; color: #344052; font-weight: 900; text-transform: uppercase; }
.finder-groups button.active { border-color: #111; background: #111; color: #fff; }
.finder-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(620px, .95fr); gap: 8px; align-items: stretch; height: calc(100vh - 390px); min-height: 460px; min-width: 0; overflow: hidden; }
.finder-diagram-pane, .finder-parts-pane { min-width: 0; min-height: 0; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.finder-diagram-pane { display: flex; flex-direction: column; height: 100%; }
.finder-parts-pane { position: relative; display: flex; flex-direction: column; overflow: auto; }
.finder-diagram-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.finder-diagram-bar select { min-width: 0; flex: 1 1 auto; }
.finder-zoom-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; }
.finder-zoom-controls button { min-width: 34px; height: 30px; padding: 0 9px; border: 1px solid #b8c4d5; border-radius: 6px; background: #fff; color: var(--navy); font-weight: 900; line-height: 1; }
.finder-zoom-controls button:disabled { opacity: .45; cursor: not-allowed; }
#finder-zoom-reset { min-width: 56px; }
.finder-diagram-stage { position: relative; display: grid; flex: 1 1 auto; min-height: 0; place-items: center; overflow: auto; padding: 0; background: #fff; }
.finder-diagram-stage.ktm-native { display: block; overflow: auto; }
.finder-diagram-canvas { position: relative; display: grid; width: 100%; height: 100%; min-height: 0; place-items: center; }
.finder-diagram-canvas.ktm-native { display: block; width: max-content; height: max-content; min-width: 0; min-height: 0; }
.finder-diagram-canvas img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.finder-diagram-canvas img.ktm-native { width: auto; height: auto; max-width: none; max-height: none; object-fit: fill; }
.finder-hotspots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.finder-hotspots.ktm-native { inset: auto; top: 0; left: 0; }
.finder-hotspot { position: absolute; display: grid; place-items: center; transform: translate(-50%, -50%); border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; pointer-events: auto; }
.finder-hotspot-marker { display: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #d90000; color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; box-shadow: 0 2px 7px rgb(0 0 0 / 22%); }
.finder-hotspot:hover .finder-hotspot-marker,
.finder-hotspot:focus-visible .finder-hotspot-marker,
.finder-hotspot.hover-match .finder-hotspot-marker { display: block; }
.finder-hotspot:focus-visible { outline: none; }
.finder-click-marker { position: absolute; z-index: 3; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid #fff; border-radius: 999px; background: #d90000; color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; box-shadow: 0 2px 7px rgb(0 0 0 / 22%); transform: translate(-50%, -50%); pointer-events: none; }
.finder-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; }
.finder-table th { background: #0b0b0b; color: #fff; letter-spacing: 0; }
.finder-table tr.finder-row-hover td, .finder-table tr.finder-row-active td { background: #ff8a92; color: #111; }
.finder-result-link { display: inline; padding: 0; border: 0; background: transparent; color: #075fba; font: inherit; font-weight: 900; text-align: left; text-decoration: underline; cursor: pointer; }
.finder-result-link:hover, .finder-result-link:focus-visible { color: #c90000; }
.finder-table td:nth-child(1) { width: 46px; font-weight: 900; }
.finder-table td:nth-child(2) { width: 150px; }
.finder-table td:nth-child(4) { width: 84px; }
.finder-table td:nth-child(5) { width: 120px; }
.finder-table td:nth-child(6) { width: 78px; text-align: right; }
.finder-filmstrip-shell { border-top: 1px solid var(--line); background: #f6f7f9; }
.finder-filmstrip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 30px; padding: 0 14px; color: #344052; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.finder-filmstrip-head span { color: var(--muted); font-size: 11px; font-weight: 800; }
.finder-layout-toggle { display: inline-flex; align-items: center; margin-left: auto; }
.finder-filmstrip-head button { flex: 0 0 auto; border: 1px solid #c9d1dd; border-radius: 999px; padding: 4px 9px; background: #fff; color: #344052; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.finder-filmstrip { display: flex; min-width: 0; height: 168px; gap: 12px; overflow-x: auto; overflow-y: hidden; padding: 0 14px 14px; overscroll-behavior: contain; scroll-snap-type: x proximity; }
.finder-filmstrip-empty { display: grid; flex: 1 0 100%; height: 128px; place-items: center; border: 1px dashed #c9d1dd; border-radius: 6px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 800; }
.finder-thumb { display: grid; flex: 0 0 172px; grid-template-rows: 108px 36px; gap: 6px; padding: 5px; border: 2px solid transparent; border-radius: 6px; background: #fff; color: #111; box-shadow: 0 2px 8px rgb(0 0 0 / 12%); font-size: 10px; font-weight: 900; text-align: left; text-transform: uppercase; cursor: pointer; scroll-snap-align: start; }
.finder-thumb.active { border-color: #d90000; }
.finder-thumb img, .finder-thumb-placeholder { width: 100%; height: 108px; object-fit: contain; background: #fff; }
.finder-thumb span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.2; }
.finder-card.filmstrip-left .finder-filmstrip-head {
  align-items: center;
  height: auto;
  min-height: 44px;
  padding: 10px 10px 7px;
  flex-wrap: nowrap;
}
.finder-card.filmstrip-left .finder-filmstrip-head span { flex: 1 1 auto; text-align: right; }
.finder-card.filmstrip-left .finder-layout-toggle { flex: 0 0 auto; margin-left: 0; }
.finder-card.filmstrip-left .finder-filmstrip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  height: calc(100% - 44px);
  gap: 9px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 10px 12px;
  scroll-snap-type: none;
}
.finder-card.filmstrip-left .finder-filmstrip-empty {
  grid-column: 1 / -1;
  height: auto;
  min-height: 220px;
}
.finder-card.filmstrip-left .finder-thumb {
  grid-template-rows: 78px 34px;
  width: 100%;
  min-width: 0;
  min-height: 124px;
}
.finder-card.filmstrip-left .finder-thumb img,
.finder-card.filmstrip-left .finder-thumb-placeholder { height: 78px; }

.tech-card { padding: 24px; }
.tech-toolbar {
  display: grid;
  grid-template-columns: 140px 120px minmax(320px, 1fr) minmax(220px, .7fr);
  gap: 12px;
  margin-top: 18px;
}
.tech-toolbar label { font-size: 11px; font-weight: 800; color: #586276; text-transform: uppercase; }
.tech-toolbar select, .tech-toolbar input { margin-top: 6px; }
.tech-document-row {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.tech-document-row label { font-size: 11px; font-weight: 800; color: #586276; text-transform: uppercase; }
.tech-document-row select { margin-top: 6px; }
#tech-results { margin-top: 18px; }
.table-toggle { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.table-toggle input { width: 17px; height: 17px; }

.powerparts-card { padding: 24px; }
.powerparts-toolbar {
  display: grid;
  grid-template-columns: 180px 120px minmax(320px, 1fr) minmax(260px, .75fr);
  gap: 12px;
  margin: 18px 0 16px;
}
.powerparts-toolbar label { font-size: 11px; font-weight: 800; color: #586276; text-transform: uppercase; }
.powerparts-toolbar select, .powerparts-toolbar input { margin-top: 6px; }
.powerparts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 12px;
}
.powerparts-category {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding: 9px 12px;
  border-radius: 6px;
  background: #111c32;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.powerpart-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.powerpart-image {
  display: grid;
  place-items: center;
  min-height: 150px;
  border: 1px solid #edf0f5;
  border-radius: 6px;
  background: #fafbfc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.powerpart-image img { max-width: 100%; max-height: 148px; object-fit: contain; }
.powerpart-body { min-width: 0; }
.powerpart-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--navy); font-size: 13px; }
.powerpart-topline span { white-space: nowrap; font-weight: 900; }
.powerpart-card h3 { margin: 8px 0 6px; font-size: 18px; line-height: 1.25; }
.powerpart-card p { margin: 10px 0 0; color: #344052; font-size: 13px; line-height: 1.45; }
.powerpart-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.powerpart-actions .text-button { text-decoration: none; }

.order-card { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0; overflow: hidden; }
.order-customer { display: block; margin-bottom: 5px; color: var(--navy); }
.order-head { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; background: #f7f8fa; }
.order-head strong { display: block; }
.order-lines { padding: 8px 16px 14px; }
.order-meta { color: var(--muted); font-size: 12px; }
.order-status { border-radius: 14px; padding: 5px 9px; background: #e8eef8; color: #284b7d; font-size: 12px; font-weight: 800; }

.admin-status-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.metric { padding: 18px; }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { display: block; margin-top: 7px; font-size: 25px; }
.metric small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.auto-import-status { margin: 14px 0; padding: 12px 14px; border: 1px solid #b9dfc8; border-radius: 10px; background: #edf9f1; color: #176b39; font-size: 13px; line-height: 1.45; }
.auto-import-status.error { border-color: #efb8b8; background: #fff0f0; color: var(--red); }
.auto-import-status .folder-path { display: block; margin-top: 4px; color: inherit; font-family: Consolas, monospace; overflow-wrap: anywhere; }
.auto-price-folder { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-bottom: 12px; }
.auto-price-folder label { margin: 0; }
.auto-price-folder button { min-height: 42px; white-space: nowrap; }
.auto-price-actions { margin-bottom: 12px; }
.auto-price-actions button { width: 100%; }
.app-dialog { width: min(480px, calc(100% - 32px)); border: 0; border-radius: 16px; padding: 28px; color: var(--ink); box-shadow: 0 24px 70px rgba(8, 18, 35, .35); }
.app-dialog::backdrop { background: rgba(8, 18, 35, .62); backdrop-filter: blur(3px); }
.app-dialog .stack-form { margin-top: 0; }
.app-dialog h2 { margin: 5px 0 4px; }
.dialog-error { padding: 10px 12px; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700; }
.tech-types-dialog { width: min(720px, calc(100% - 32px)); }
.tech-types-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; }
.tech-type-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px; border-radius: 8px; font-size: 13px; line-height: 1.35; }
.tech-type-row:hover { background: #f4f7fb; }
.tech-type-row input { width: 16px; height: 16px; margin-top: 1px; flex: 0 0 auto; }
.tech-type-summary { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.admin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.admin-grid .card { min-height: 390px; }
.admin-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 8px; color: var(--muted); font-size: 12px; }
.admin-list-head strong { color: var(--ink); font-size: 14px; }
.admin-backorders-list .empty-state.compact { margin-top: 16px; padding: 14px 10px; }
.backorder-admin-table { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.backorder-admin-table table { min-width: 760px; }
.backorder-admin-table th { position: sticky; top: 0; z-index: 1; }
.backorder-admin-table td { font-size: 13px; }
.import-preview { margin-top: 14px; font-size: 13px; line-height: 1.5; }
.preview-good { color: var(--green); font-weight: 750; }
.preview-errors { max-height: 110px; overflow: auto; margin-top: 8px; padding: 9px; background: var(--red-soft); color: var(--red); border-radius: 8px; }
.mono { font-family: Consolas, monospace; word-break: break-all; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.account-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto; gap: 12px; align-items: end; }
.toggle-row { display: flex; grid-template-columns: none; align-items: center; gap: 10px; margin-top: 18px; }
.toggle-row input { width: 20px; height: 20px; }
.availability.offline-available, .availability.offline-zero, .availability.offline-not-listed { color: var(--amber); background: var(--amber-soft); }

@media (max-width: 1080px) {
  .admin-grid { grid-template-columns: 1fr 1fr; }
  .admin-status-grid { grid-template-columns: 1fr 1fr; }
  .account-form { grid-template-columns: 1fr 1fr; }
  .tech-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body.auth-mode { background-position: 55% center; }
  main { width: min(100% - 20px, 1420px); }
  .site-header { padding: 18px; }
  .brand-mark { display: none; }
  .site-header p { display: none; }
  .header-user { max-width: 45%; }
  .admin-grid, .admin-status-grid { grid-template-columns: 1fr; }
  .auto-price-folder { grid-template-columns: 1fr; }
  .order-form { grid-template-columns: 1fr; }
  .order-actions { flex-direction: column; align-items: stretch; }
  .ducati-order-toolbar { grid-template-columns: 1fr; }
  .c9-convert-toolbar, .c9-summary, .cam-ai-settings { grid-template-columns: 1fr; }
  .cam-ai-message { max-width: 100%; }
  .finder-toolbar { grid-template-columns: 1fr; }
  .finder-groups { justify-content: flex-start; overflow-x: auto; }
  .finder-card.filmstrip-left { display: block; }
  .finder-card.filmstrip-left .finder-filmstrip-shell { border-right: 0; border-top: 1px solid var(--line); }
  .finder-card.filmstrip-left .finder-filmstrip-head { height: 30px; min-height: 30px; padding: 0 14px; align-items: center; }
  .finder-card.filmstrip-left .finder-filmstrip-head span { flex: 0 1 auto; }
  .finder-layout { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .finder-diagram-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .finder-diagram-stage { height: 430px; min-height: 430px; }
  .finder-filmstrip { height: 128px; }
  .finder-card.filmstrip-left .finder-filmstrip { flex-direction: row; height: 128px; overflow-x: auto; overflow-y: hidden; padding: 0 14px 14px; }
  .finder-thumb { flex-basis: 128px; grid-template-rows: 76px 32px; }
  .finder-card.filmstrip-left .finder-thumb { flex-basis: 128px; width: auto; min-height: auto; grid-template-rows: 76px 32px; }
  .finder-thumb img, .finder-thumb-placeholder { height: 76px; }
  .finder-card.filmstrip-left .finder-thumb img,
  .finder-card.filmstrip-left .finder-thumb-placeholder { height: 76px; }
  .tech-toolbar, .tech-document-row { grid-template-columns: 1fr; }
  .account-form { grid-template-columns: 1fr; }
  .section-heading, .form-actions { align-items: stretch; flex-direction: column; }
}
