/* Estigator Simple: the redesigned shop screens (see docs/simple-ui-inventory.md and the plan).
   Everything is scoped under .sx, so the classic screens are untouched. body.sx-on hides the
   classic frame while a shop that has the new look is signed in; windows (payment, review,
   photo viewer and the rest) stay shared and keep working on top of either. */

.sx {
  --sx-navy: #0a1220;
  --sx-navy-2: #1a3358;
  --sx-blue: #1d4ed8;
  --sx-blue-bright: #2b6cf6;
  --sx-blue-soft: #eef3ff;
  --sx-bg: #ffffff;
  --sx-bg-2: #f4f6fa;
  --sx-bg-3: #eef2f7;
  --sx-line: #e2e8f0;
  --sx-line-2: #cbd5e1;
  --sx-text: #0f172a;
  --sx-muted: #475569;
  --sx-ok: #15803d;
  --sx-ok-soft: #e8f6ef;
  --sx-ok-line: #bfe5d0;
  --sx-warn: #8a4b06;
  --sx-warn-soft: #fff7e8;
  --sx-warn-line: #f1d9a6;
  --sx-info: #1e40af;
  --sx-info-soft: #eef5fd;
  --sx-info-line: #c8dcf3;
  --sx-violet: #5b21b6;
  --sx-violet-soft: #f1ebff;
  --sx-danger: #b42318;
  --sx-damage: #ea580c;
  --sx-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sx-font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --sx-font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sx-r-sm: 10px;
  --sx-r: 14px;
  --sx-r-lg: 18px;
  --sx-tap: 46px;

  font-family: var(--sx-font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--sx-text);
  background: var(--sx-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.sx-on { background: #ffffff; }
body.sx-on .app-shell > header,
body.sx-on .main-layout,
body.sx-on .bg-glow,
body.sx-on .bg-grid,
body.sx-on #readiness-banner,
body.sx-on #email-verify-banner,
body.sx-on #broadcast-banner { display: none !important; }

.sx *, .sx *::before, .sx *::after { box-sizing: border-box; }
.sx h1, .sx h2, .sx h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
.sx h1 { font-family: var(--sx-font-head); font-size: 30px; letter-spacing: -0.4px; }
.sx h2 { font-size: 19px; font-weight: 800; }
.sx p { margin: 0; }
.sx a { color: var(--sx-blue); }
.sx :focus-visible { outline: 3px solid var(--sx-blue-bright); outline-offset: 2px; }
.sx .sx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sx .sx-muted { color: var(--sx-muted); }
.sx .sx-num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .sx * { transition: none !important; animation: none !important; } }

/* ── Top bar ── */
.sx-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  border-bottom: 1px solid var(--sx-line); background: var(--sx-bg);
}
@media (min-width: 760px) { .sx-topbar { padding-left: 28px; padding-right: 28px; } }
.sx-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--sx-text); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.sx-brand-mark { flex: 0 0 38px; height: 38px; border-radius: 10px; background: var(--sx-navy); color: #fff; display: grid; place-items: center; overflow: hidden; }
.sx-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.sx-brand-mark svg { width: 20px; height: 20px; }
.sx-brand-name { font-family: var(--sx-font-head); font-size: 21px; font-weight: 700; white-space: nowrap; }
.sx-brand-shop { font-size: 14px; color: var(--sx-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28vw; }
@media (max-width: 520px) { .sx-brand-shop { display: none; } }
.sx-topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Buttons ── */
.sx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--sx-tap); padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.sx-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.sx-btn-primary { background: var(--sx-blue); color: #fff; }
.sx-btn-primary:hover { background: #1e40af; }
.sx-btn-secondary { background: #fff; color: var(--sx-text); border-color: var(--sx-line-2); }
.sx-btn-secondary:hover { background: var(--sx-bg-2); }
.sx-btn-ghost { background: transparent; color: var(--sx-blue); }
.sx-btn-ghost:hover { background: var(--sx-blue-soft); }
.sx-btn-danger { background: #fff; color: var(--sx-danger); border-color: #f3c2bc; }
.sx-btn-lg { min-height: 54px; padding: 0 24px; font-size: 17px; border-radius: 14px; }
.sx-btn-sm { min-height: 38px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.sx-btn-icon { width: var(--sx-tap); padding: 0; position: relative; }
.sx-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.sx-badge {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff;
}

/* ── Account menu ── */
.sx-menu-wrap { position: relative; }
.sx-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--sx-bg-3); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--sx-text); }
.sx-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 900; min-width: 240px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--sx-line); border-radius: var(--sx-r); box-shadow: 0 16px 40px rgba(10, 18, 32, 0.16);
  padding: 6px; display: flex; flex-direction: column;
}
.sx-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--sx-text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
}
.sx-menu button:hover { background: var(--sx-bg-2); }
.sx-menu button svg { width: 18px; height: 18px; color: var(--sx-muted); }
.sx-menu hr { border: 0; border-top: 1px solid var(--sx-line); margin: 6px 4px; }
.sx-menu-who { padding: 8px 12px 6px; font-size: 13px; color: var(--sx-muted); }
.sx-menu-grow { flex: 1; }
/* Screens row: which look is on, as a small two-part pill */
.sx-look-pill { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--sx-bg-3); font-size: 12px; font-weight: 700; }
.sx-look-pill span { padding: 3px 9px; border-radius: 999px; color: var(--sx-muted); }
.sx-look-pill span.on { background: var(--sx-blue); color: #fff; box-shadow: 0 1px 3px rgba(10, 18, 32, 0.2); }
.sx-tip {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 900; width: 260px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid var(--sx-info-line); border-radius: var(--sx-r); box-shadow: 0 16px 40px rgba(10, 18, 32, 0.18);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.sx-tip::before {
  content: ""; position: absolute; top: -7px; right: 22px; width: 12px; height: 12px; background: #fff;
  border-left: 1px solid var(--sx-info-line); border-top: 1px solid var(--sx-info-line); transform: rotate(45deg);
}
.sx-tip strong { font-size: 15px; color: var(--sx-text); }
.sx-tip p { margin: 0 0 4px; font-size: 14px; color: var(--sx-muted); line-height: 1.4; }

/* ── Page frame ── */
.sx-page {
  width: 100%; max-width: 960px; margin: 0 auto; flex: 1;
  padding-block: 28px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 24px;
}
.sx-page-wide { max-width: 1240px; }

/* ── Cards, tiles ── */
.sx-card { border: 1px solid var(--sx-line); border-radius: var(--sx-r-lg); padding: 20px 22px; background: #fff; display: flex; flex-direction: column; gap: 14px; }
.sx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.sx-tile {
  display: flex; align-items: center; gap: 16px; padding: 22px; min-height: 112px; border-radius: var(--sx-r-lg);
  border: 2px solid var(--sx-line); background: #fff; color: var(--sx-text); text-decoration: none; text-align: left;
  font: inherit; cursor: pointer;
}
.sx-tile:hover { border-color: var(--sx-line-2); }
.sx-tile-primary { background: var(--sx-blue); border-color: var(--sx-blue); color: #fff; }
.sx-tile-primary:hover { background: #1e40af; border-color: #1e40af; }
.sx-tile-icon { flex: 0 0 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--sx-bg-3); color: var(--sx-info); }
.sx-tile-primary .sx-tile-icon { background: var(--sx-blue-bright); color: #fff; }
.sx-tile-icon svg { width: 28px; height: 28px; }
.sx-tile-title { display: block; font-size: 20px; font-weight: 800; }
.sx-tile-sub { display: block; font-size: 15px; color: var(--sx-muted); margin-top: 4px; }
.sx-tile-primary .sx-tile-sub { color: #dbe6ff; }

/* ── Status chips ── */
.sx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--sx-bg-3); color: #374151; white-space: nowrap; }
.sx-chip-review { background: #fdf0d5; color: var(--sx-warn); }
.sx-chip-unpaid { background: #e5e9ff; color: #3730a3; }
.sx-chip-done { background: #dcf5e4; color: #166534; }
.sx-chip-info { background: var(--sx-info-soft); color: var(--sx-info); }

/* ── Segmented choice (Repair / Replace / Inspect / No work, Yes / No / Not sure) ── */
.sx-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 12px; background: var(--sx-bg-3); }
.sx-seg button { min-height: 40px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--sx-muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.sx-seg button[aria-pressed="true"] { background: #fff; color: var(--sx-text); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15); }

/* ── List rows (jobs, estimate lines) ── */
.sx-rows { display: flex; flex-direction: column; gap: 10px; }
.sx-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--sx-r); border: 1px solid var(--sx-line);
  background: #fff; color: var(--sx-text); text-decoration: none; font: inherit; text-align: left; width: 100%; cursor: pointer;
}
.sx-row:hover { border-color: var(--sx-line-2); }
.sx-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sx-row-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.sx-row-sub { font-size: 14px; color: var(--sx-muted); }
.sx-row-amount { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Notices (calm, never alarm-red) ── */
.sx-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--sx-r); border: 1px solid; font-size: 15px; }
.sx-notice-warn { background: var(--sx-warn-soft); border-color: var(--sx-warn-line); color: #5a3b0b; }
.sx-notice-info { background: var(--sx-info-soft); border-color: var(--sx-info-line); color: #17365b; }
.sx-notice-ok { background: var(--sx-ok-soft); border-color: var(--sx-ok-line); color: #1f5135; }
.sx-notice-text { flex: 1 1 240px; min-width: 0; }

/* ── Side drawer (messages) ── */
.sx-scrim { position: fixed; inset: 0; z-index: 950; background: rgba(10, 18, 32, 0.35); }
.sx-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 960; width: 440px; max-width: 100%; background: #fff;
  box-shadow: -12px 0 40px rgba(10, 18, 32, 0.18); display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Unsaved-changes bar ── */
.sx-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--sx-r); background: var(--sx-navy); color: #fff; }
.sx-bar input { flex: 1 1 220px; min-width: 0; min-height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #3a4b68; background: #142238; color: #fff; font: inherit; }
.sx-bar .sx-btn-secondary { background: transparent; color: #fff; border-color: #3a4b68; }

/* ── Form fields ── */
.sx-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: #334155; }
.sx-field input, .sx-field select, .sx-field textarea {
  min-height: 50px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--sx-line-2); background: #fff;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--sx-text);
}
.sx-field textarea { padding: 12px 14px; min-height: 88px; resize: vertical; }
.sx-field input:focus, .sx-field select:focus, .sx-field textarea:focus { border-color: var(--sx-blue); outline: none; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.2); }

/* ── Empty / placeholder states ── */
.sx-empty { border: 2px dashed var(--sx-line-2); border-radius: var(--sx-r-lg); padding: 28px 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--sx-bg-2); }

/* ── P1: home, all jobs, messages ── */
.sx-search {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 20px; border-radius: 16px;
  background: var(--sx-bg-2); border: 2px solid var(--sx-line); color: #334155; cursor: text;
}
.sx-search:focus-within { border-color: var(--sx-blue); background: #fff; box-shadow: 0 0 0 3px rgba(43, 108, 246, 0.18); }
.sx-search svg { width: 24px; height: 24px; flex: 0 0 auto; }
.sx-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 18px; color: var(--sx-text); }
.sx-search input::placeholder { color: #64748b; }
@media (max-width: 520px) { .sx-search { min-height: 56px; padding: 0 14px; } .sx-search input { font-size: 16px; } }

.sx-tile-icon-violet { background: #eef2ff; color: #4338ca; }
.sx-section { display: flex; flex-direction: column; gap: 10px; }
.sx-section h2, .sx-page-head h1 { margin: 0; }
.sx-link-btn { align-self: flex-start; padding-left: 4px; padding-right: 4px; }

.sx-setup { border-radius: var(--sx-r-lg); border: 1px solid #cfe3dd; background: #f2faf7; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.sx-setup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sx-setup-head h2 { color: #0b3d36; font-size: 18px; }
.sx-setup-chip { font-size: 14px; font-weight: 700; color: #0b3d36; background: #d3efe7; padding: 6px 12px; border-radius: 999px; }
.sx-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sx-step { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.sx-step-mark { flex: 0 0 30px; height: 30px; border-radius: 50%; border: 2px solid #8fbfb2; background: #fff; display: grid; place-items: center; color: #fff; }
.sx-step.is-done .sx-step-mark { background: var(--sx-ok); border-color: var(--sx-ok); }
.sx-step-mark svg { width: 16px; height: 16px; stroke-width: 3; }
.sx-step-text { flex: 1; min-width: 0; font-size: 16px; }
.sx-step.is-done .sx-step-text { color: var(--sx-muted); }

.sx-job { align-items: center; }
.sx-job-dot { flex: 0 0 12px; height: 12px; border-radius: 50%; background: #d97706; }
.sx-job-unpaid .sx-job-dot { background: #4f46e5; }
.sx-job-reviewed .sx-job-dot { background: var(--sx-ok); }
.sx-job-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sx-row-go { color: #64748b; display: grid; place-items: center; }
.sx-row-go svg, .sx-locked svg { width: 20px; height: 20px; }
.sx-locked { color: #4338ca; display: inline-grid; place-items: center; }
@media (max-width: 520px) { .sx-row { padding: 12px; gap: 10px; } .sx-row-title { font-size: 16px; } .sx-row-amount { font-size: 15px; } }

.sx-page-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.sx-page-head .sx-btn { margin-left: -8px; }
.sx-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.sx-filter {
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--sx-line-2); background: #fff;
  color: var(--sx-text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.sx-filter:hover { background: var(--sx-bg-2); }
.sx-filter[aria-pressed="true"] { background: var(--sx-navy); border-color: var(--sx-navy); color: #fff; }
.sx-list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

/* Messages drawer contents */
.sx-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 20px 14px; border-bottom: 1px solid var(--sx-line); }
.sx-drawer-head h1 { font-size: 24px; }
.sx-drawer-tools { display: flex; align-items: center; gap: 6px; }
.sx-drawer-body { flex: 1; overflow: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.sx-msg-group { display: flex; flex-direction: column; gap: 10px; }
.sx-eyebrow { font-size: 13px !important; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--sx-muted); }
.sx-msg { display: flex; gap: 12px; padding: 14px; border-radius: var(--sx-r); background: #fff; border: 1px solid var(--sx-line); }
.sx-msg-warn { background: var(--sx-warn-soft); border-color: var(--sx-warn-line); }
.sx-msg-info { background: var(--sx-info-soft); border-color: var(--sx-info-line); }
.sx-msg-plain.is-unread { border-left: 4px solid var(--sx-blue); }
.sx-msg-icon { flex: 0 0 36px; height: 36px; border-radius: 50%; background: var(--sx-bg-3); color: var(--sx-text); display: grid; place-items: center; }
.sx-msg-warn .sx-msg-icon { background: #fbe6bd; color: var(--sx-warn); }
.sx-msg-info .sx-msg-icon { background: #d6e7fa; color: var(--sx-info); }
.sx-msg-icon svg { width: 18px; height: 18px; }
.sx-msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sx-msg-top { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.sx-msg-title { font-size: 15px !important; font-weight: 700; }
.sx-msg-when { font-size: 12px; color: var(--sx-muted); white-space: nowrap; }
.sx-msg-body { font-size: 14px; color: #334155; line-height: 1.45; overflow-wrap: anywhere; }
.sx-msg .sx-btn { margin-top: 6px; }

/* The help assistant, moved into the new top bar: same element, light colors. */
.sx .assistant-wrap {
  margin-left: 0;
  --surface: #ffffff; --surface-2: #f4f6fa; --border: #e2e8f0; --border-2: #cbd5e1;
  --text: #0f172a; --text-dim: #475569; --text-faint: #64748b; --bg: #ffffff; --bg-2: #f4f6fa;
}
.sx .assistant-trigger-btn {
  width: var(--sx-tap); height: var(--sx-tap); padding: 0; border-radius: 12px; display: grid; place-items: center;
  background: var(--sx-blue); color: #fff;
}
.sx .assistant-trigger-btn svg { width: 20px; height: 20px; }
.sx .assistant-panel { color: var(--sx-text); box-shadow: 0 16px 40px rgba(10, 18, 32, 0.16); max-width: calc(100vw - 32px); z-index: 900; }
.sx .assistant-callout { z-index: 900; }
.sx-assistant-slot { display: contents; }
@media (max-width: 520px) { .sx-user-name { display: none; } }

/* "Back to home", shown over a classic screen opened from the new ones. */
#sx-return {
  position: fixed; left: 16px; bottom: 16px; z-index: 1200; display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: #1d4ed8; color: #fff;
  font: 700 15px/1 "Inter", system-ui, sans-serif; box-shadow: 0 10px 30px rgba(10, 18, 32, 0.35); cursor: pointer;
}
#sx-return[hidden] { display: none; }
#sx-return svg { width: 18px; height: 18px; }
#sx-return:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
@media (max-width: 760px) { #sx-return { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }
@media (max-width: 640px) {
  .sx .assistant-wrap { position: static; }
  .sx .assistant-panel { position: fixed; top: 72px; left: 16px; right: 16px; width: auto; }
}

/* ── P2: the estimate (job) page ── */
.sx-page-wide { max-width: 1240px; }
.sx-job-top { margin: -8px 0 -12px -8px; }
.sx-job-head { display: flex; flex-direction: column; gap: 6px; }
.sx-job-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sx-job-title h1 { font-size: 30px; }
.sx-job-facts { color: var(--sx-muted); font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sx-plate { font-family: var(--sx-font-mono); font-weight: 700; color: var(--sx-text); border: 1px solid var(--sx-line-2); border-radius: 6px; padding: 1px 8px; background: var(--sx-bg-2); }
.sx-stack { display: flex; flex-direction: column; gap: 8px; }
.sx-stack:empty { display: none; }
.sx-notice-icon { flex: 0 0 auto; display: grid; place-items: center; }
.sx-notice-icon svg { width: 18px; height: 18px; }
.sx-notice-quote { font-style: italic; margin-top: 4px; }
.sx-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--sx-blue); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; display: inline-flex; align-items: center; gap: 4px; }
.sx-link svg { width: 16px; height: 16px; }
.sx-small { font-size: 13px; }
.sx-mono { font-family: var(--sx-font-mono); }
.sx-warn-text { color: #8a4b06; }
.sx-ok-text { color: #166534; display: flex; align-items: center; gap: 8px; }
.sx-ok-text svg { width: 20px; height: 20px; }
.sx-hint { font-weight: 500; color: var(--sx-muted); font-size: 13px; }

.sx-job-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1080px) { .sx-job-layout { grid-template-columns: minmax(0, 1fr) 340px; } .sx-job-side { position: sticky; top: 16px; } }
.sx-job-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sx-card-head { display: flex; flex-direction: column; gap: 4px; }
.sx-card-head-row { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sx-card-head h2 { display: flex; align-items: center; gap: 8px; }
.sx-card-head h2 svg { width: 20px; height: 20px; color: var(--sx-blue); }
.sx-card-head p { font-size: 14px; }

.sx-attention { border: 1px solid var(--sx-warn-line); background: var(--sx-warn-soft); border-radius: var(--sx-r-lg); padding: 14px 18px; }
.sx-attention h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; color: #5a3b0b; margin-bottom: 6px; }
.sx-attention h2 svg { width: 18px; height: 18px; }
.sx-attention ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sx-attention li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 15px; color: #5a3b0b; min-height: 32px; align-items: center; }

.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 14px; }
.sx-span-all { grid-column: 1 / -1; }
.sx-info-group { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--sx-line); }
.sx-info-group:first-child { padding-top: 0; border-top: 0; }
.sx-info-group h3 { font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--sx-muted); }
.sx-kv { display: flex; flex-direction: column; gap: 4px; justify-content: center; min-height: 50px; }
.sx-kv-wide { grid-column: 1 / -1; }
.sx-kv-k { font-size: 14px; font-weight: 700; color: #334155; }
.sx-kv-v { font-size: 16px; overflow-wrap: anywhere; }
.sx-people { border: 0; margin: 0; padding: 0; }
.sx-people legend { font-weight: 800; font-size: 15px; margin-bottom: 8px; padding: 0; }
.sx-people + .sx-people { margin-top: 10px; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sx-field select { padding-right: 10px; }

.sx-diagram { border: 1px solid var(--sx-line); border-radius: var(--sx-r); padding: 0 14px; }
.sx-diagram > summary { cursor: pointer; font-weight: 700; min-height: 46px; display: flex; align-items: center; }
.sx-diagram[open] { padding-bottom: 12px; }

.sx-parts { display: flex; flex-direction: column; gap: 10px; }
.sx-part { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; padding: 14px; border: 1px solid var(--sx-line); border-radius: var(--sx-r); background: #fff; align-items: start; }
.sx-part.is-excluded { grid-template-columns: minmax(0, 1fr) auto; background: var(--sx-bg-2); }
.sx-part.is-editing { display: flex; flex-direction: column; gap: 14px; border: 2px solid var(--sx-blue); }
.sx-part-thumb { width: 72px; height: 56px; border-radius: 8px; object-fit: cover; display: grid; place-items: center; background: var(--sx-bg-3); color: #64748b; }
.sx-part-thumb svg { width: 22px; height: 22px; }
.sx-thumb-btn { border: 0; padding: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.sx-part-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sx-part-name { font-size: 17px !important; font-weight: 700; }
.sx-part-note { font-size: 14px; color: #334155; font-style: italic; }
.sx-part-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.sx-part-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.sx-part-total { font-size: 18px; font-weight: 800; }
.sx-part-btns { display: flex; gap: 4px; }
.sx-danger { color: var(--sx-danger) !important; }
.sx-part .sx-seg button { min-height: 38px; }
.sx-part .sx-seg button[aria-pressed="true"][data-value="replace"] { color: #b42318; }
.sx-part .sx-seg button[aria-pressed="true"][data-value="repair"] { color: #1e40af; }
.sx-part .sx-seg button[aria-pressed="true"][data-value="inspect"] { color: #8a4b06; }
.sx-hours { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sx-hours label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: #334155; }
.sx-hours input, .sx-photo-row select { min-height: 46px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--sx-line-2); font: inherit; font-size: 16px; width: 100%; }
.sx-photo-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sx-photo-row select { width: auto; }
.sx-static { font-weight: 500; font-size: 15px; color: var(--sx-text); min-height: 50px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sx-part-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sx-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sx-subtotal { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--sx-line); font-weight: 700; }
@media (max-width: 640px) {
  .sx-part { grid-template-columns: 56px minmax(0, 1fr); }
  .sx-part-thumb { width: 56px; height: 44px; }
  .sx-part-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
  .sx-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-job-title h1 { font-size: 24px; }
}

.sx-total h2 { font-size: 16px; color: var(--sx-muted); font-weight: 700; }
.sx-total-big { font-family: var(--sx-font-head); font-size: 40px; font-weight: 700; line-height: 1.1; }
.sx-breakdown { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sx-breakdown div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.sx-breakdown dt { color: #334155; }
.sx-breakdown dd { margin: 0; font-weight: 700; }
.sx-breakdown-sub { border-top: 1px solid var(--sx-line); padding-top: 6px; }
.sx-total-actions { display: flex; flex-direction: column; gap: 8px; }
.sx-total-actions .sx-btn { width: 100%; }

/* Folding cards (Submitted information, the audit): the whole header row opens and closes it. */
.sx-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-radius: var(--sx-r); }
.sx-fold > summary::-webkit-details-marker { display: none; }
.sx-fold > summary:focus-visible { outline: 3px solid var(--sx-blue); outline-offset: 4px; }
.sx-fold-side { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 32px; }
.sx-fold-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 14px; border-radius: 999px; background: var(--sx-blue-soft); color: var(--sx-blue); box-shadow: inset 0 0 0 1px #d6e2fb; }
.sx-fold-toggle .sx-fold-chev { color: var(--sx-blue); }
.sx-fold > summary:hover .sx-fold-toggle { background: #e2ebff; }
.sx-fold-hint { font-size: 14px; font-weight: 800; color: var(--sx-blue); }
.sx-fold-hint::before { content: attr(data-closed); }
.sx-fold[open] .sx-fold-hint::before { content: attr(data-open); }
.sx-fold-chev { width: 20px; height: 20px; color: #6b7280; transition: transform .18s ease; }
.sx-fold[open] .sx-fold-chev { transform: rotate(180deg); }
.sx-fold-body { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
@media (hover: hover) { .sx-fold > summary:hover .sx-card-head h2 { color: var(--sx-blue); } }
@media (max-width: 640px) { .sx-fold > summary { flex-wrap: wrap; } .sx-fold-side { margin-left: auto; } }

/* The audit card: amber accent while it has something for the estimator to look at. */
.sx-audit-card .sx-card-head h2 svg { color: #b45309; }
.sx-audit-card[data-state="found"] { border-color: var(--sx-warn-line); border-left: 5px solid #d97706; background: linear-gradient(180deg, var(--sx-warn-soft), #fff 140px); }
.sx-audit-card[data-state="clean"] .sx-card-head h2 svg { color: var(--sx-ok); }
.sx-audit-lead { font-weight: 800; font-size: 16px; color: #5a3b0b; }
.sx-audit-again { justify-content: flex-start; }
.sx-audit-group { display: flex; flex-direction: column; gap: 8px; }
.sx-audit-group h3 { font-size: 15px; font-weight: 800; }
.sx-audit-item { border: 1px solid var(--sx-line); border-radius: var(--sx-r); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.sx-check { display: flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.sx-check input { width: 20px; height: 20px; accent-color: var(--sx-blue); flex: 0 0 auto; }
.sx-audit-title { flex: 1; font-weight: 700; }
.sx-audit-amt { font-weight: 800; }

/* Classic blocks moved into the estimate page: same elements, the Simple colors and type. */
.sx .sx-classic {
  --bg: #f4f6fa; --bg-2: #eef2f7; --surface: #ffffff; --surface-2: #f4f6fa; --surface-3: #eef2f7;
  --border: #cbd5e1; --border-hi: #94a3b8; --text: #0f172a; --text-dim: #475569; --text-faint: #64748b;
  --accent: #1d4ed8; --accent-2: #1e40af; --accent-rgb: 29, 78, 216; --accent-glow: rgba(29, 78, 216, 0.2);
  --info: #1e40af; --info-2: #2b6cf6; --info-rgb: 30, 64, 175;
  --font-ui: "Inter", system-ui, sans-serif; --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-family: var(--font-ui); font-size: 15px; min-width: 0;
}
.sx .sx-classic:empty { display: none; }
.sx .sx-classic-cards { display: flex; flex-direction: column; gap: 14px; }
.sx .sx-classic .card { margin: 0; box-shadow: none; border-color: var(--sx-line); border-radius: var(--sx-r); backdrop-filter: none; }
.sx .sx-classic .card-head { background: var(--sx-bg-2); font-size: 16px; font-weight: 800; padding: 12px 16px; flex-wrap: wrap; }
.sx .sx-classic .card-head .muted-sm { flex-basis: 100%; margin-left: 0 !important; }
.sx .sx-classic .card-body { padding: 14px 16px; }
.sx .sx-classic .btn { min-height: 42px; border-radius: 10px; font-family: var(--font-ui); }
.sx .sx-classic input, .sx .sx-classic select, .sx .sx-classic textarea { font-family: var(--font-ui); }
.sx #sec-damage-parts:has(#inspection-edit-list:empty) { display: none; }
/* The audit runs inline on this page; its separate window's button isn't needed here. */
.sx #sec-tech-added [onclick="openEstimateAudit()"] { display: none; }
.sx .submitted-photos-block { margin: 0; }
.sx #pipeline-progress { margin-bottom: 12px; }
.sx #btn-mark-reviewed { width: 100%; min-height: 54px; font-size: 17px; font-weight: 800; background: var(--sx-blue); color: #fff; border: 0; border-radius: 14px; justify-content: center; }
.sx #btn-mark-reviewed:hover { background: #1e40af; }
.sx #review-status-display:empty { display: none; }
.sx #review-status-display { display: flex; justify-content: center; }
.sx .est-rates-line { margin: 0; font-size: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* The two bottom bars (unsaved changes, photos changed), restyled. */
.sx .save-changes-bar, .sx .regen-pending-bar {
  left: 0; right: 0; padding: 12px max(16px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--sx-navy); color: #fff; border-top: 0; box-shadow: 0 -10px 30px rgba(10, 18, 32, 0.3);
  flex-wrap: wrap; gap: 10px; z-index: 800; backdrop-filter: none;
}
.sx .regen-pending-bar { background: #3b2a06; }
.sx .save-changes-msg, .sx .regen-pending-msg { color: #fff; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.sx .save-note-input { flex: 1 1 220px; min-width: 0; min-height: 44px; background: #142238; border: 1px solid #3a4b68; color: #fff; border-radius: 10px; }
.sx .save-changes-bar .btn, .sx .regen-pending-bar .btn { min-height: 44px; border-radius: 10px; }
.sx .save-changes-bar .btn-ghost, .sx .regen-pending-bar .btn-ghost { color: #fff; border-color: #3a4b68; background: transparent; }
.sx .save-changes-bar .btn-success { background: #16a34a; color: #fff; border: 0; }
body.sx-on:has(.sx .save-changes-bar[style*="flex"]) .sx-page, body.sx-on:has(.sx .regen-pending-bar[style*="flex"]) .sx-page { padding-bottom: 140px; }
/* Classic's global label/heading styles must not reach the new screens. */
.sx .sx-field, .sx .sx-check, .sx .sx-hours label, .sx legend, .sx .sx-search { text-transform: none; letter-spacing: normal; }
.sx h1, .sx h2, .sx h3 { text-transform: none; text-align: left; }

.sx-job-total-mini { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; }
.sx-job-total-mini strong { font-size: 20px; }
@media (min-width: 1080px) { .sx-job-total-mini { display: none; } }
.sx .sx-check { font-size: 15px; font-weight: 500; color: var(--sx-text); }
.sx .sx-photo-row select { max-width: 100%; }

/* ── New-estimate flow (P3, simple/new.js) ── */
.sxn { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 96px; }
.sxn-title { font-size: 30px; font-weight: 800; letter-spacing: -0.3px; }
.sxn-sub { font-size: 16px; margin-top: -8px; }
.sxn-topbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.sxn-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.sxn-mode { text-align: left; }
.sxn-mode .sx-tile-text { flex: 1; min-width: 0; }
.sxn-mode .sx-tile-go { width: 22px; height: 22px; color: #94a3b8; flex-shrink: 0; }
.sxn-mode[data-mode="customer"] .sx-tile-icon { background: #f3e8ff; color: #6d28d9; }
.sx .sx-link { background: none; border: 0; padding: 4px 2px; color: var(--sx-blue); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }

/* Step tracker: three named steps, each a button back to its screen. */
.sxn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: none; }
.sxn-steps button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--sx-r); border: 1px solid var(--sx-line); background: #fff; font: inherit; font-weight: 700; color: var(--sx-muted); cursor: pointer; text-align: left; min-height: 52px; }
.sxn-step-num { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--sx-bg-3); color: #334155; font-weight: 800; }
.sxn-steps li[data-state="current"] button { border-color: var(--sx-blue); background: var(--sx-blue-soft); color: var(--sx-navy); }
.sxn-steps li[data-state="current"] .sxn-step-num { background: var(--sx-blue); color: #fff; }
.sxn-steps li[data-state="done"] .sxn-step-num { background: var(--sx-ok); color: #fff; }
@media (max-width: 640px) {
  .sxn-steps button { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; text-align: center; font-size: 13px; }
  .sxn-step-num { flex: none; width: 28px; height: 28px; }
  .sxn-title { font-size: 24px; }
}

.sxn [data-sxn-step] { gap: 16px; }
.sxn-card { gap: 16px; }

/* VIN / Enter Manually switch: drives the classic wizSetVinTab(). */
.sxn-switch { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--sx-bg-3); align-self: flex-start; }
.sxn-switch-btn { border: 0; background: transparent; font: inherit; font-weight: 700; padding: 8px 16px; border-radius: 9px; color: #334155; cursor: pointer; min-height: 40px; }
.sxn-switch-btn.active { background: #fff; color: var(--sx-navy); box-shadow: 0 1px 3px rgba(15, 23, 42, .15); }
.sxn-panel { display: none; }
.sxn-panel.active { display: block; }

/* Classic blocks inside the flow: drop their own headings and intros (the cards carry them). */
.sxn .sxn-location .wiz-location-heading,
.sxn #grp-photo > .wiz-step-intro,
.sxn #wiz-obd-note,
.sxn #pl-submitted-photos { display: none !important; }
.sxn .sx-classic .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); max-width: none; }
.sxn .sx-classic label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; color: #334155; }
.sxn .sx-classic input, .sxn .sx-classic select, .sxn .sx-classic textarea { min-height: 46px; font-size: 16px; border-radius: 10px; }
.sxn .sx-classic textarea { min-height: 110px; width: 100%; }
.sxn .wiz-question-block { margin: 0 0 16px; }
.sxn .wiz-question-block:last-child { margin-bottom: 0; }
.sxn .wiz-question-label { font-size: 16px; font-weight: 800; }
.sxn .wiz-choice-btn, .sxn .wiz-pos-btn { min-height: 48px; font-size: 15px; border-radius: 12px; }
.sxn .wiz-choice-btn.active { background: var(--sx-blue); border-color: var(--sx-blue); color: #fff; }
.sxn #grp-people.wiz-people-flat .wiz-people-panel + .wiz-people-panel { margin-top: 18px; }
.sxn #grp-people .wiz-people-panel-heading { font-size: 15px; font-weight: 800; color: var(--sx-navy); text-transform: none; letter-spacing: 0; margin-bottom: 8px; }
.sxn .drop-zone { border-radius: var(--sx-r); min-height: 140px; }
.sxn .sxn-diagram { min-height: 200px; }
.sxn-claim-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--sx-muted); margin-bottom: 12px; }
.sxn [data-sxn-slot="claim-wrap"] { display: flex; flex-direction: column; gap: 16px; }
.sxn [data-sxn-slot="claim-wrap"] > .sxn-claim-note { margin-bottom: -4px; }

/* Review rows (classic wizComputeSummaryRows). */
.sxn-review { display: flex; flex-direction: column; }
.sxn-review-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sx-line); }
.sxn-review-row:last-child { border-bottom: 0; }
.sxn-review-label { font-weight: 800; color: #334155; }
.sxn-review-value { overflow-wrap: anywhere; }
.sxn-review-value.is-empty { color: #94a3b8; }
@media (max-width: 520px) { .sxn-review-row { grid-template-columns: minmax(0, 1fr) auto; } .sxn-review-label { grid-column: 1 / -1; margin-bottom: -8px; } }

/* Bottom bar: Back · step · Next/Run. */
.sxn-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 -16px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--sx-line); }
.sxn-bar .sx-btn-primary { margin-left: auto; }
.sxn-bar .spinner { width: 16px; height: 16px; }
@media (max-width: 760px) { .sxn-bar { bottom: calc(env(safe-area-inset-bottom, 0px)); } .sxn-bar-step { display: none; } .sxn-bar .sx-btn-primary { flex: 1; justify-content: center; } }
.sxn .wiz-location-subsection { margin: 0; padding: 0; border: 0; }

/* Photos and re-analysis sit inside Submitted information and fold with it. */
.sxj-subsection { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--sx-line); }
.sxj-subsection h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
.sxj-subsection h3 svg { width: 18px; height: 18px; color: var(--sx-blue); }
.sx-fold-card > [data-sxj-slot="progress"] { margin-top: 12px; }

/* ── My shop (P4, simple/shop.js) ── */
.sxs { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.sxs-nav { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: 0; z-index: 4; padding: 8px 0; background: rgba(255, 255, 255, .96); }
.sxs-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--sx-bg-3); color: #1e293b; font-weight: 700; text-decoration: none; }
.sxs-nav a:hover { background: var(--sx-blue-soft); color: var(--sx-blue); }
.sxs-card { scroll-margin-top: 64px; gap: 12px; }
.sxs-sub { font-size: 16px; font-weight: 800; margin-top: 6px; }
.sxs-sub:first-of-type { margin-top: 0; }
.sxs .sx-classic .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); max-width: none; }
.sxs .sx-classic label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; color: #334155; }
.sxs .sx-classic input:not([type=checkbox]), .sxs .sx-classic select, .sxs .sx-classic textarea { min-height: 44px; font-size: 16px; border-radius: 10px; }
.sxs .sx-classic .wk-section-title { font-size: 16px; font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--sx-navy); }
.sxs .sx-classic .btn-group { margin-top: 10px; }
.sxs .sx-classic .hint { font-size: 14px; color: var(--sx-muted); }

/* ── Shop activity (simple/activity.js) ── */
.sxa { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.sxa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.sxa-stat.is-hero { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.sxa-stat.is-hero .sxa-label { flex-basis: 100%; }
.sxa-stat.is-hero .sxa-value { font-size: 36px; }
.sxa-stat { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--sx-line); border-radius: var(--sx-r); background: #fff; text-align: left; font: inherit; color: inherit; }
.sxa-stat.is-link { cursor: pointer; padding-right: 40px; }
.sxa-stat.is-link:hover { border-color: var(--sx-blue); background: var(--sx-blue-soft); }
.sxa-stat.is-link:focus-visible { outline: 3px solid var(--sx-blue); outline-offset: 2px; }
.sxa-label { font-size: 14px; font-weight: 700; color: var(--sx-muted); }
.sxa-value { font-size: 30px; font-weight: 800; color: var(--sx-navy); line-height: 1.1; }
.sxa-note { font-size: 13px; color: var(--sx-muted); }
.sxa-go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #94a3b8; }
.sxa-chart { gap: 10px; }
.sxa-chart-title { font-size: 17px; font-weight: 800; }
/* Thin single-hue bars on a baseline, 4px rounded tops, 2px+ gaps; hover title per bar, a table for screen readers. */
.sxa-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; height: 140px; align-items: end; border-bottom: 1px solid var(--sx-line-2); }
.sxa-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.sxa-bar { width: min(100%, 28px); background: #2563eb; border-radius: 4px 4px 0 0; }
.sxa-col:hover .sxa-bar { background: #1d4ed8; }
.sxa-bar-label { font-size: 13px; font-weight: 700; color: #334155; min-height: 16px; }
.sxa-axis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; font-size: 12px; color: var(--sx-muted); text-align: center; white-space: nowrap; }

/* ── Classic dialogs over the new screens (My Profile, Change Password, the import, payment,
   photo-tag, pairing and signature windows): same dialogs and handlers, the new look. Applies only
   while the new screens are on (body.sx-on). ── */
body.sx-on .modal-overlay {
  --bg: #f4f6fa; --bg-2: #eef2f7; --surface: #ffffff; --surface-2: #f4f6fa; --surface-3: #eef2f7;
  --border: #cbd5e1; --border-hi: #94a3b8; --text: #0f172a; --text-dim: #475569; --text-faint: #64748b;
  --accent: #1d4ed8; --accent-2: #1e40af; --accent-rgb: 29, 78, 216; --accent-glow: rgba(29, 78, 216, 0.2);
  --info: #1e40af; --info-2: #2b6cf6; --info-rgb: 30, 64, 175;
  --font-ui: "Inter", system-ui, sans-serif; --font-head: "Inter", system-ui, sans-serif;
  font-family: var(--font-ui); background: rgba(15, 23, 42, 0.45);
}
body.sx-on .modal-overlay .card { background: #fff; border: 0; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); backdrop-filter: none; }
body.sx-on .modal-overlay .card-head { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 18px 56px 14px 22px; font-size: 20px; font-weight: 800; color: #0a1220; text-transform: none; letter-spacing: 0; }
body.sx-on .modal-overlay .card-head .ic { background: #eef3ff; color: #1d4ed8; border-radius: 10px; }
body.sx-on .modal-overlay .card-body { padding: 18px 22px 22px; font-size: 15px; color: #0f172a; }
body.sx-on .modal-overlay label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; color: #334155; }
body.sx-on .modal-overlay input:not([type=checkbox]):not([type=radio]):not([type=file]),
body.sx-on .modal-overlay select, body.sx-on .modal-overlay textarea {
  min-height: 44px; font-size: 16px; border-radius: 10px; font-family: var(--font-ui); background: #f8fafc; border-color: #cbd5e1; color: #0f172a;
}
body.sx-on .modal-overlay input:focus, body.sx-on .modal-overlay select:focus, body.sx-on .modal-overlay textarea:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
body.sx-on .modal-overlay .btn { min-height: 44px; border-radius: 12px; font-family: var(--font-ui); font-weight: 700; font-size: 15px; padding: 0 18px; }
body.sx-on .modal-overlay .btn-primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; box-shadow: none; }
body.sx-on .modal-overlay .btn-primary:hover { background: #1e40af; }
body.sx-on .modal-overlay .btn-ghost { background: #eef2f7; border-color: transparent; color: #0f172a; }
body.sx-on .modal-overlay .btn-ghost:hover { background: #e2e8f0; }
body.sx-on .modal-overlay .btn-group { gap: 10px; margin-top: 16px; }
body.sx-on .modal-close-btn { width: 36px; height: 36px; top: 14px; right: 14px; border-radius: 999px; border: 0; background: #eef2f7; color: #334155; }
body.sx-on .modal-close-btn:hover { background: #e2e8f0; color: #0a1220; }
body.sx-on .modal-overlay .muted-sm, body.sx-on .modal-overlay .hint { color: #64748b; }
@media (max-width: 640px) {
  body.sx-on .modal-overlay { padding: 0; align-items: flex-end; }
  body.sx-on .modal-overlay .card { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
}

/* ── Help (simple/help.js) ── */
.sxh { width: 100%; max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.sxh .wc-help-tabs .btn { min-height: 40px; border-radius: 999px; background: var(--sx-bg-3); border: 0; color: #1e293b; font-weight: 700; padding: 0 16px; }
.sxh .wc-help-tabs .btn.active { background: var(--sx-blue); color: #fff; }
.sxh #help-faq-section details { border: 1px solid var(--sx-line) !important; border-radius: 12px !important; padding: 14px 16px !important; background: #fff; }
.sxh #help-faq-section summary { font-size: 16px; font-weight: 700 !important; }
.sxh .sxh-body { font-size: 16px; line-height: 1.55; }

/* ── Platform admin (simple/admin.js, the admin home) ── */
.sxad { width: 100%; max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; padding-bottom: 48px; }
.sxad-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 10px; }
.sx .sxad-tile { align-items: flex-start; }
.sxad-tile-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sx-blue-soft); color: var(--sx-blue); }
.sxad-tile-icon svg { width: 20px; height: 20px; }
.sxad-group { display: flex; flex-direction: column; gap: 6px; }
.sxad-group > h2 { font-size: 20px; }
.sxad-group > .sxad-tiles { margin-top: 8px; }
.sxad-groups { flex-wrap: wrap; }
.sx .sxad-badge { position: static; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.sxad-home-tiles { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.sx .sxad-issue-mark { background: var(--sx-warn-soft); color: var(--sx-warn); border-color: var(--sx-warn-line); }
.sx .sxad-issue-error .sxad-issue-mark { background: #fdecea; color: var(--sx-danger); border-color: #f5c2bc; }
.sxad-panel .settings-subview { display: block; animation: none; }
.sxad-panel .card, .sxad-growth .card { margin-top: 0 !important; }
.sxad .sx-classic .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); max-width: none; }
.sxad .sx-classic label { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 700; color: #334155; }
.sxad .sx-classic input:not([type=checkbox]):not([type=radio]):not([type=file]), .sxad .sx-classic select, .sxad .sx-classic textarea { min-height: 44px; font-size: 16px; border-radius: 10px; }
.sxad .sx-classic .section-title { font-size: 16px; font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--sx-navy); }
.sxad .sx-classic .muted-sm, .sxad .sx-classic .hint { font-size: 14px; color: var(--sx-muted); }
.sxad .sx-classic table { width: 100%; }
.sxad .sx-classic .table-wrap, .sxad .sx-classic .tbl-wrap { overflow-x: auto; }
.sx .sxad-attn { background: var(--sx-warn-soft); border-color: var(--sx-warn-line); }
.sx .sxad-attn .sx-setup-chip { background: #fff; color: var(--sx-warn); border: 1px solid var(--sx-warn-line); }
.sx .sxad-attn h2 { color: var(--sx-warn); }
