/* The three approved skins share one order and pricing layout. */
body[data-skin="workshop"] {
  color-scheme: light;
  --bg: #eff2ff;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --text: #1c2643;
  --muted: #4c5876;
  --line: #d9dff2;
  --primary: #4958a9;
  --primary-2: #2f6a84;
  --accent: #805617;
  --danger: #a44051;
  --input: #f6f7fe;
  --hint-bg: #edf0ff;
  --hint-border: #c9d2ee;
  --upload-bg: #f6f7fe;
  --upload-border: #a0aed9;
  --note-bg: #f8f1e3;
  --note-border: #ebd9b3;
  --shadow: 0 6px 24px rgba(53, 69, 138, .08);
  --glow: none;
  --action-fill: #4c59b2;
  --brand-start: #5061b5;
  --brand-end: #377dab;
  --customer-fill: #f2d59c;
  --customer-ink: #39290d;
  --quote-bg: #e8eeff;
  --quote-line: #cad5f1;
  --quote-ink: #353d91;
  --intake-bg: #fbf6ed;
}
body[data-skin="ledger"] {
  color-scheme: light;
  --bg: #f4f1e8;
  --panel: #fffdf8;
  --panel-solid: #fffdf8;
  --text: #213641;
  --muted: #4e615d;
  --line: #ddd8ca;
  --primary: #256963;
  --primary-2: #36665d;
  --accent: #75531f;
  --danger: #98444a;
  --input: #faf8f1;
  --hint-bg: #edf1ea;
  --hint-border: #c8d8cb;
  --upload-bg: #f7f6ea;
  --upload-border: #a6b9aa;
  --note-bg: #f8f0df;
  --note-border: #e6d5b3;
  --shadow: 0 4px 17px rgba(73, 58, 33, .06);
  --glow: none;
  --action-fill: #276b66;
  --brand-start: #357a73;
  --brand-end: #29625d;
  --customer-fill: #e3bc79;
  --customer-ink: #332408;
  --quote-bg: #f8f1e0;
  --quote-line: #e1d0a9;
  --quote-ink: #204358;
  --intake-bg: #faf8f2;
}
body[data-skin="night"] {
  color-scheme: dark;
  --bg: #111a30;
  --panel: #1b2743;
  --panel-solid: #1b2743;
  --text: #eef2ff;
  --muted: #bac7e4;
  --line: #405171;
  --primary: #aab9ff;
  --primary-2: #81d1df;
  --accent: #edc982;
  --danger: #a53b59;
  --input: #243353;
  --hint-bg: #24365b;
  --hint-border: #4b5e86;
  --upload-bg: #1f2d4c;
  --upload-border: #687ba8;
  --note-bg: #2d3348;
  --note-border: #63566b;
  --success-bg: #203e4a;
  --success-border: #486878;
  --shadow: 0 8px 27px rgba(3, 8, 21, .24);
  --glow: none;
  --action-fill: #5161aa;
  --brand-start: #5269b8;
  --brand-end: #39718f;
  --customer-fill: #edc982;
  --customer-ink: #2c210c;
  --quote-bg: #243454;
  --quote-line: #546280;
  --quote-ink: #f4d397;
  --intake-bg: #202e4b;
}

body[data-skin] { background: var(--bg); }
body[data-skin] .app { padding: 18px clamp(12px, 2.3vw, 34px) 34px; }
body[data-skin] .layout { grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); }
body[data-skin] .left-stack,
body[data-skin] .right-stack { min-width: 0; }
body[data-skin] .topbar {
  padding: 14px 17px;
  border-radius: 17px;
  background: var(--panel-solid);
  backdrop-filter: none;
}
body[data-skin] .brand { font-size: clamp(19px, 2.1vw, 29px); letter-spacing: 0; }
.v14-brand-title { font: inherit; margin: 0; }
body[data-skin] .brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--brand-start), var(--brand-end));
}
body[data-skin] .toolbar { gap: 7px; }
body[data-skin] .toolbar .btn { padding: 8px 10px; white-space: nowrap; }
body[data-skin] .toolbar .btn.success { color: var(--text); background: var(--panel-solid); border-color: var(--line); }
body[data-skin] .btn.primary { background: var(--action-fill); color: #fff; }
body[data-skin] .btn.orange { background: var(--customer-fill); color: var(--customer-ink); }
body[data-skin] .btn:focus-visible, #skinSelect:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.v14-skin-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 7px 5px 10px;
}
.v14-skin-control label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.v14-skin-control select {
  width: auto;
  padding: 4px 3px;
  background: var(--input);
  color: var(--text);
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}
body[data-skin] .card { border-radius: 17px; }
body[data-skin] .card-title .badge { display: none; }

.v14-slice-intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: var(--intake-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
}
.v14-intake-main { min-width: 0; }
.v14-intake-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  align-items: end;
  gap: 11px;
}
.v14-intake-fields .field { min-width: 0; }
.v14-intake-fields .v14-actions { grid-column: 1 / -1; }
.v14-intake-fields .btn { padding: 8px 11px; white-space: nowrap; }
.v14-slice-intake .v14-drop { margin: 9px 0 0; }
.v14-slice-art, .v14-quote-art { display: none; }
.v14-slice-art img, .v14-quote-art img { display: block; width: 100%; height: auto; }
body[data-skin="workshop"] .v14-slice-intake {
  grid-template-columns: minmax(0, 1fr) clamp(95px, 25%, 174px);
  background: linear-gradient(110deg, var(--intake-bg) 18%, #f0efff 100%);
}
body[data-skin="workshop"] .v14-slice-art { display: block; }
body[data-skin="ledger"] .v14-slice-intake { background: transparent; }

.v14-quote-lead {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  background: var(--quote-bg);
  border: 1px solid var(--quote-line);
  border-radius: 12px;
  padding: 16px 17px;
}
.v14-quote-price { min-width: 0; }
.v14-quote-price h2 { margin: 0 0 5px; font-size: 15px; }
.v14-main-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--quote-ink);
  font-size: clamp(31px, 4.2vw, 57px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.v14-main-amount .v14-formula-number { min-width: 0; text-align: left; overflow-wrap: anywhere; text-decoration-thickness: 1px; }
.v14-main-amount .v14-quote-currency { flex: 0 0 auto; }
.v14-main-amount:has(button:disabled) .v14-quote-currency { display: none; }
body[data-skin="ledger"] #quoteResults { border-color: var(--quote-line); }
body[data-skin="ledger"] .v14-quote-lead,
body[data-skin="night"] .v14-quote-lead {
  grid-template-columns: minmax(0, 1fr) clamp(76px, 30%, 153px);
}
body[data-skin="ledger"] .v14-quote-art {
  display: block;
  max-height: 85px;
  overflow: hidden;
  align-self: end;
  border-bottom: 1px solid var(--quote-line);
}
body[data-skin="ledger"] .v14-quote-art img {
  width: 125%;
  max-width: none;
  margin-left: -10%;
}
body[data-skin="night"] .v14-quote-art { display: block; }
body[data-skin] .v14-current-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .72fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}
body[data-skin="ledger"] .v14-current-total { border-bottom: 1px dashed var(--quote-line); }
body[data-skin] .v14-current-total > div { justify-content: space-between; min-width: 0; flex-wrap: wrap; }
.v14-quote-metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  padding-top: 9px;
}
.v14-quote-metrics > div { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.v14-quote-metrics strong { font-size: 15px; color: var(--text); }
body[data-skin] .mini-kpi b { font-size: 17px; }
body[data-skin] .mini-kpi { border-radius: 10px; }

body[data-skin="ledger"] [data-cost-row="material"] { --cost-color: #43a39c; }
body[data-skin="ledger"] [data-cost-row="electricity"] { --cost-color: #c0964e; }
body[data-skin="ledger"] [data-cost-row="depreciation"] { --cost-color: #87a075; }
body[data-skin="ledger"] [data-cost-row="accessoryDepreciation"] { --cost-color: #5a987a; }
body[data-skin="ledger"] [data-cost-row="wear"] { --cost-color: #7fb7bf; }
body[data-skin="ledger"] [data-cost-row="labor"] { --cost-color: #237b80; }
body[data-skin="ledger"] [data-cost-row="extra"] { --cost-color: #9ba9aa; }
body[data-skin="ledger"] [data-cost-row="failure"] { --cost-color: #d4ad6c; }
body[data-skin="night"] [data-cost-row="material"] { --cost-color: #8ca6f4; }
body[data-skin="night"] [data-cost-row="electricity"] { --cost-color: #ecc17d; }
body[data-skin="night"] [data-cost-row="failure"] { --cost-color: #fa8788; }
.v14-cost-toggle .dot { background: var(--cost-color, var(--category)); }
.v14-cost-toggle[aria-pressed="false"] .dot { border-color: var(--cost-color, var(--category)); background: transparent; }

.v14-customer-dialog { width: min(680px, calc(100vw - 24px)); }
.v14-customer-image-preview {
  max-height: min(55vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.v14-customer-image-preview:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.v14-customer-image { display: block; width: 100%; height: auto; -webkit-touch-callout: default; }
.v14-customer-formats { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.v14-customer-formats summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.v14-customer-formats .v14-customer-sheet { margin-top: 9px; }

@media (min-width: 1101px) {
  #costBreakdown .breakdown-list { flex-basis: 205px; }
  #costBreakdown .donut-wrap { flex-basis: clamp(150px, 14vw, 220px); min-height: 165px; }
  #costBreakdown .donut::after { width: 57%; height: 57%; }
  #costBreakdown .donut-center strong { font-size: clamp(21px, 2.1vw, 31px); }
}
@media (max-width: 1100px) {
  body[data-skin] .layout { grid-template-columns: minmax(0, 1fr); }
  body[data-skin] .topbar { flex-wrap: wrap; }
}
@media (max-width: 768px) {
  body[data-skin] .app { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  body[data-skin] .topbar { position: static; z-index: 22; }
  body[data-skin] .toolbar { justify-content: flex-start; }
  body[data-skin] .field :is(input, select, textarea) { font-size: 16px; }
  .v14-intake-fields .btn, .v14-customer-image-actions .btn { min-height: 44px; }
  .v14-customer-dialog { max-height: calc(100dvh - 24px); }
}
@media (max-width: 630px) {
  body[data-skin] .v14-slice-intake { grid-template-columns: minmax(0, 1fr); }
  body[data-skin] .v14-slice-art { display: none; }
  body[data-skin] .brand-icon {
    color: transparent;
    background: var(--input) url("/printpet-mascot.webp") center / contain no-repeat;
  }
  body[data-skin] .v14-quote-lead { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-skin], body[data-skin] .btn { transition: none; }
}
@media print {
  body[data-skin] { color-scheme: light; color: #172346; background: #fff !important; }
}

