:root {
  --bg: #0c0a10;
  --card: #15121c;
  --field: #1c1825;
  --field-hover: #221d2d;
  --line: #2a2434;
  --line-strong: #3b3349;
  --text: #efecf5;
  --muted: #a59fb3;
  --faint: #8a8399;
  --accent: #8b5cf6;
  --accent-strong: #7c3aed;
  --accent-text: #c9b8ff;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.55);
  --on-accent: #fff;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --danger-line: rgba(248, 113, 113, 0.35);
  --danger-text: #fecaca;

  --plate-bg:
    radial-gradient(120% 140% at 50% 0%, rgba(139, 92, 246, 0.32), rgba(139, 92, 246, 0.08) 60%),
    #1d1530;
  --plate-line: rgba(139, 92, 246, 0.45);
  --plate-shadow: 0 18px 50px -20px rgba(124, 58, 237, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --price: #d9ccff;
  --dock-bg: #1d1530;
  --shadow: rgba(0, 0, 0, 0.8);
  --scrim: rgba(6, 4, 10, 0.6);
  --thumb-ring: var(--card);
  --switch-track: #221d2d;
  --knob-bg: #7c3aed;
  --knob-fg: #ffffff;

  --c-material: #a78bfa;
  --c-energy: #f5c451;
  --c-machine: #60a5fa;
  --c-labor: #f472b6;
  --c-extras: #94a3b8;
  --c-fees: #f87171;
  --c-profit: #34d399;

  --radius: 14px;
  --radius-sm: 10px;
  --gap: 24px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

/* Light theme: system preference unless the visitor picked dark, or picked light explicitly */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f1f7;
    --card: #ffffff;
    --field: #f6f4fa;
    --field-hover: #efecf6;
    --line: #e4e0ec;
    --line-strong: #cdc6da;
    --text: #17131f;
    --muted: #57506a;
    --faint: #6b6480;
    --accent: #7c3aed;
    --accent-strong: #6d28d9;
    --accent-text: #6d28d9;
    --accent-soft: rgba(124, 58, 237, 0.09);
    --accent-line: rgba(124, 58, 237, 0.45);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.07);
    --danger-line: rgba(220, 38, 38, 0.3);
    --danger-text: #991b1b;
    --plate-bg:
      radial-gradient(120% 140% at 50% 0%, rgba(124, 58, 237, 0.16), rgba(124, 58, 237, 0.04) 60%),
      #f7f3ff;
    --plate-line: rgba(124, 58, 237, 0.3);
    --plate-shadow: 0 14px 34px -22px rgba(76, 29, 149, 0.45);
    --price: #4c1d95;
    --dock-bg: #f7f3ff;
    --shadow: rgba(40, 24, 72, 0.22);
    --scrim: rgba(23, 19, 31, 0.35);
  --switch-track: #e6dff6;
  --knob-bg: #ffffff;
  --knob-fg: #6d28d9;
    --c-material: #8b5cf6;
    --c-energy: #e0a10f;
    --c-machine: #3b82f6;
    --c-labor: #db2777;
    --c-extras: #94a3b8;
    --c-fees: #ef4444;
    --c-profit: #047857;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f1f7;
  --card: #ffffff;
  --field: #f6f4fa;
  --field-hover: #efecf6;
  --line: #e4e0ec;
  --line-strong: #cdc6da;
  --text: #17131f;
  --muted: #57506a;
  --faint: #6b6480;
  --accent: #7c3aed;
  --accent-strong: #6d28d9;
  --accent-text: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.09);
  --accent-line: rgba(124, 58, 237, 0.45);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.07);
  --danger-line: rgba(220, 38, 38, 0.3);
  --danger-text: #991b1b;
  --plate-bg:
    radial-gradient(120% 140% at 50% 0%, rgba(124, 58, 237, 0.16), rgba(124, 58, 237, 0.04) 60%),
    #f7f3ff;
  --plate-line: rgba(124, 58, 237, 0.3);
  --plate-shadow: 0 14px 34px -22px rgba(76, 29, 149, 0.45);
  --price: #4c1d95;
  --dock-bg: #f7f3ff;
  --shadow: rgba(40, 24, 72, 0.22);
  --scrim: rgba(23, 19, 31, 0.35);
  --switch-track: #e6dff6;
  --knob-bg: #ffffff;
  --knob-fg: #6d28d9;
  --c-material: #8b5cf6;
  --c-energy: #e0a10f;
  --c-machine: #3b82f6;
  --c-labor: #db2777;
  --c-extras: #94a3b8;
  --c-fees: #ef4444;
  --c-profit: #047857;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--on-accent); }

input, button { font: inherit; color: inherit; }
button { cursor: pointer; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

h1, h2, p { margin: 0; }

[hidden] { display: none !important; }

/* ---------- Shell ---------- */

.app {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--gap);
  row-gap: 14px;
  max-width: 1240px;
  height: 100dvh;
  margin: 0 auto;
  padding: var(--gap) var(--gap) 14px;
}

/* Credits sit under both cards, centered */
.site-foot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--faint);
}
.site-foot a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}
.site-foot a:hover { text-decoration-color: currentColor; }
.site-foot a.link-btn { text-decoration: none; }
.site-foot__brand { color: var(--muted); font-weight: 600; }
.site-foot__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.panel::-webkit-scrollbar { width: 10px; }
.panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--card); }
.panel::-webkit-scrollbar-track { background: transparent; }

/* ---------- Form ---------- */

.form {
  overflow-y: auto;
  padding: 0 32px 24px;
  overscroll-behavior: contain;
}

/* Title bar stays put while the fields scroll under it */
.form__head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -32px;
  padding: 24px 32px 16px;
  background: var(--card);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
/* Only the rule changes when stuck: resizing the bar here would shift the
   scroll position and toggle the state back and forth (visible jitter) */
.form__head.is-stuck { border-bottom-color: var(--line); }
.form__head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.form__intro {
  color: var(--muted);
  max-width: 52ch;
}

.form__head-actions { display: flex; align-items: center; gap: 10px; }

/* Always-visible, low-key invitation to donate (opens the Pix dialog) */
.support-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.support-chip svg { width: 15px; height: 15px; color: var(--accent-text); }
.support-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
@media (max-width: 480px) {
  .support-chip { width: 34px; padding: 0; justify-content: center; }
  .support-chip span { display: none; }
}
.profile-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.profile-btn:hover { border-color: var(--accent-line); color: var(--accent-text); background: var(--accent-soft); }
.profile-btn.is-set { color: var(--accent-text); border-color: var(--accent-line); }

/* Theme switch: a pill with a knob that carries the current mode's icon */
.theme-switch {
  position: relative;
  flex: none;
  width: 62px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--switch-track);
  transition: background-color 0.3s, border-color 0.3s;
}
.theme-switch:hover { border-color: var(--line-strong); }
.theme-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--knob-bg);
  color: var(--knob-fg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s var(--ease), background-color 0.3s, color 0.3s;
}
.theme-switch svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.theme-switch .i-moon { display: none; }
:root[data-theme="dark"] .theme-switch__knob { transform: translateX(28px); }
:root[data-theme="dark"] .theme-switch .i-sun { display: none; }
:root[data-theme="dark"] .theme-switch .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-switch__knob { transform: translateX(28px); }
  :root:not([data-theme="light"]) .theme-switch .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-switch .i-moon { display: block; }
}

/* Each section opens on a rule, with a violet title set well above its fields */
.group {
  scroll-margin-top: 84px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.group > h2, .group__head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--accent-text);
  margin-bottom: 20px;
}
.group__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.group__head h2 { margin-bottom: 0; }
.group__meta { color: var(--text); font-size: 14px; font-weight: 600; }

.hint { color: var(--faint); font-size: 13px; line-height: 1.45; margin-top: 10px; }
.group__head + .hint { margin-top: -10px; margin-bottom: 20px; }

.icon-tile {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--muted);
  flex: none;
}

/* Fields */

.cols { display: grid; gap: 12px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols__full { grid-column: 1 / -1; margin-top: 0; }
.group > .field + .range, .group > .range + .cols { margin-top: 18px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field__label em { font-style: normal; color: var(--faint); font-weight: 400; }

.input {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 12px;
  gap: 6px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.input:hover { background: var(--field-hover); }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  caret-color: var(--accent);
}
.input input::placeholder { color: var(--faint); font-weight: 400; }
.input__unit { color: var(--faint); font-size: 13px; white-space: nowrap; }
.input.is-invalid { border-color: var(--danger); }

/* Range */

.range__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.range__value { color: var(--accent-text); font-weight: 600; font-size: 14px; }

input[type="range"] {
  --p: 0%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--accent) var(--p), var(--line) var(--p));
}
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: var(--line); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 6px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--thumb-ring);
  box-shadow: 0 0 0 1px var(--accent), 0 2px 6px var(--shadow);
  transition: transform 0.15s var(--ease);
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--thumb-ring);
  box-shadow: 0 0 0 1px var(--accent);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1px var(--accent), 0 0 0 5px var(--accent-soft); }

/* Toggle rows */

.opts { display: flex; flex-direction: column; }
.opt { border-top: 1px solid var(--line); }
.opt:last-child { border-bottom: 1px solid var(--line); }
.opts .opt:only-child { border-top: 0; border-bottom: 0; }
.group > .range + .opts { margin-top: 18px; }

.opt__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.opt__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.opt__text strong { font-size: 14px; font-weight: 600; }
.opt__text span { font-size: 12.5px; color: var(--muted); }
.opt[data-on="true"] .icon-tile { color: var(--accent-text); border-color: var(--accent-line); }
.opt .icon-tile, .opt__text { transition: opacity 0.2s; }
.opt[data-on="false"] .icon-tile, .opt[data-on="false"] .opt__text { opacity: 0.45; }

.opt__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--ease);
}
.opt[data-on="true"] .opt__body { grid-template-rows: 1fr; }
.opt__body > .opt__inner { overflow: hidden; min-height: 0; }
.opt[data-on="true"] .opt__inner { padding-bottom: 16px; }
.opt[data-on="false"] .opt__inner { visibility: hidden; transition: visibility 0s 0.32s; }

.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: var(--field);
  transition: background-color 0.2s, border-color 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--faint);
  transition: transform 0.25s var(--ease), background-color 0.2s;
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--on-accent); }

/* Fees */

.fees { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fees:empty { display: none; }

.fees__empty {
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px;
}

.fee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 120px 36px 36px;
  gap: 8px;
  align-items: center;
}
.fee__name input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  outline: 0;
  caret-color: var(--accent);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fee__name input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fee__name input::placeholder { color: var(--faint); }
.fee__name input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.fee--saved { grid-template-columns: minmax(0, 1fr) auto 120px 36px; }
.fee__delete:hover { color: var(--danger); }
.fee__delete.is-armed { color: var(--danger); background: var(--danger-soft); }
.btn--icon { width: 42px; padding: 0; flex: none; color: var(--muted); }

.fee__save[aria-pressed="true"] { color: var(--accent-text); }
.fee__save[aria-pressed="true"] svg { fill: currentColor; }
.fee__save:hover { color: var(--accent-text); }

.fees__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fees__actions .btn--ghost { flex: 1 1 160px; }

/* Saved-fee picker: native select, restyled */
.picker {
  position: relative;
  flex: 2 1 240px;
  min-width: 0;
}
.picker select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-overflow: ellipsis;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.picker select:hover { border-color: var(--line-strong); }
.picker select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.picker select option { background: var(--card); color: var(--text); }
.picker > svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.hint__icon { width: 13px; height: 13px; vertical-align: -2px; color: var(--accent-text); }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  transition: background-color 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent); }
.seg--full { display: flex; width: 100%; margin-bottom: 18px; }
.seg--full button { flex: 1; padding: 8px 10px; font-size: 14px; }
.seg--compact { margin-bottom: 0; }
.seg--compact button { padding: 6px 8px; font-size: 13px; }
.seg--sm { height: 42px; align-items: stretch; }

/* G-code import */
.gcode { margin-bottom: 20px; }
.gcode__drop {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  transition: border-color 0.15s, background-color 0.15s;
}
.gcode__drop:hover, .gcode.is-over .gcode__drop { border-color: var(--accent); border-style: solid; }
.gcode__drop .icon-tile, .gcode__head .icon-tile { color: var(--accent-text); border-color: var(--accent-line); }
.gcode__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.gcode__text strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcode__text span { font-size: 12.5px; color: var(--muted); }
.gcode__result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.gcode__result .hint { margin-top: 0; }
.gcode__head { display: flex; align-items: center; gap: 12px; }
.gcode__head .icon-btn { margin-right: -6px; }
.gcode.is-over .gcode__result { border-color: var(--accent); }
.gcode__error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger-text);
  font-size: 13px;
}

/* The second choice in Lucro is subordinate to the first: label + compact control */
.sub-label { display: block; margin: 22px 0 8px; }
[data-price-panel="profit"] .seg--compact { margin-bottom: 20px; }
[data-price-panel="final"] { margin-top: 20px; }
.name-row--narrow { max-width: 340px; }

/* Plates (one per slicer plate / G-code) */
.plates { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
#gcodeZone { margin-top: 16px; }
.gcode__manual { margin: 8px 0 0 -8px; }
.plates:empty { display: none; }
.plate-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  overflow: hidden;
}
.plate-card .input { background: var(--card); }
.plate-card .input:hover { background: var(--card); }
.plate-card .picker select { background: var(--card); }
.plate-card .seg { background: var(--card); }

.plate-card__head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 14px; }
.plate-card__thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--accent-line);
  background: var(--card);
  color: var(--accent-text);
  overflow: hidden;
}
.plate-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.plate-card__title { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.plate-card__title input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  margin-left: -8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  outline: 0;
  transition: border-color 0.15s, background-color 0.15s;
}
.plate-card__title input:hover { border-color: var(--line); }
.plate-card__title input:focus { border-color: var(--accent); background: var(--card); }
.plate-card__meta { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-card__meta:empty { display: none; }

/* Each concern of a plate lives in its own titled block */
.plate-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px;
  border-top: 1px solid var(--line);
}
.plate-block__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plate-block__title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.plate-block__value { font-size: 13px; font-weight: 600; color: var(--accent-text); text-align: right; }
.plate-block__help { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.plate-block--units { flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; }
.plate-block__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plate-block > .link-btn { align-self: flex-start; margin-left: -8px; }

.stepper {
  display: flex;
  align-items: stretch;
  flex: none;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper__btn {
  display: grid;
  place-items: center;
  width: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  transition: background-color 0.15s, color 0.15s;
}
.stepper__btn:hover { background: var(--accent-soft); color: var(--accent-text); }
.stepper__btn:disabled { opacity: 0.35; cursor: default; background: none; }
.stepper__btn svg { width: 16px; height: 16px; }
.stepper input {
  width: 52px;
  height: 100%;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  outline: 0;
}
.stepper input.is-invalid { color: var(--danger); }

.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.slot {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 110px 36px;
  gap: 8px 10px;
  align-items: center;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c, transparent);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45);
}
.slot__from, .slot__warn { grid-column: 2 / -1; font-size: 12px; color: var(--muted); margin-top: -4px; }
.slot__from i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45); }
.slot__warn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2px 8px;
  padding: 6px 4px 6px 10px;
  margin-top: 0;
  border-radius: 8px;
  background: rgba(245, 196, 81, 0.12);
  color: var(--text);
}
.slot__warn .link-btn { font-size: 12.5px; }

/* Filament library */
.fil { grid-template-columns: 36px minmax(0, 1fr) 92px 108px 100px 78px 36px; }
.fil__save { height: 42px; padding: 0 12px; }
.fil__save:disabled { background: var(--field); color: var(--faint); border-color: var(--line); opacity: 1; }
.fil.is-dirty .fil__name .input { border-color: var(--accent-line); }

/* Stock (read-only list of the library) */
.stock { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.stock li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.stock .swatch { width: 18px; height: 18px; flex: none; }
.stock__text { display: flex; flex-direction: column; min-width: 0; }
.stock__name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock__meta { font-size: 12px; color: var(--muted); }

.modal.modal--wide { width: min(860px, calc(100% - 32px)); }
.fil-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 92px 108px 100px 78px 36px;
  gap: 8px;
  padding: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
}
.fil-head span:first-child { grid-column: 2; }
.modal .btn--ghost { margin-top: 10px; flex: none; }
.fil__color { display: grid; place-items: center; }
.fil input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.fil input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.fil input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.5); }
.fil input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.fil.is-flash .input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Packaging items */
.pack { grid-template-columns: minmax(0, 1fr) 140px 36px; }
.packs:not(:empty) { margin-bottom: 10px; }
.btn--block { width: 100%; }
.seg--sm button { padding: 0 11px; min-width: 38px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--faint);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--field); color: var(--text); }
.fee__remove:hover { color: var(--danger); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn--ghost { border: 1px dashed var(--line-strong); color: var(--accent-text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn--outline { border-color: var(--line); background: transparent; color: var(--text); }
.btn--outline:hover:not(:disabled) { border-color: var(--line-strong); background: var(--field); }
.btn--quiet { background: transparent; color: var(--muted); padding: 0 10px; margin-left: -10px; }
.btn--quiet:hover { color: var(--text); background: var(--field); }
.btn--quiet.is-armed { color: var(--danger); }
.btn--primary { background: var(--accent-strong); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent); }
.btn--sm { height: 42px; padding: 0 14px; }

.form__foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.form__saved { color: var(--faint); font-size: 13px; max-width: 60ch; }
.form__saved strong { color: var(--muted); font-weight: 600; }
.foot-block { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.foot-block + .foot-block { padding-top: 16px; border-top: 1px solid var(--line); }
.foot-block h3 { margin: 0; font-size: 14px; font-weight: 600; }
.form__foot-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form__foot-actions .btn--quiet { margin-left: 0; }
.form__status { font-size: 13px; font-weight: 500; color: var(--accent-text); }
.form__status.is-error { color: var(--danger); }

/* Saved profiles (printer, filament) */
.cols--spaced { margin-top: 16px; }
.profile__bar { display: flex; gap: 8px; margin-bottom: 14px; }
.profile__bar .picker { flex: 1 1 auto; }
.name-row { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; align-items: end; }
.btn-save:hover { color: var(--accent-text); }
.btn-save[aria-pressed="true"] { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.btn-save[aria-pressed="true"] svg { fill: currentColor; }

.prof { grid-template-columns: minmax(0, 1fr) auto 36px; }
.prof__sum { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s;
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { background: var(--accent-soft); }

/* ---------- "Compensa?" verdict in the receipt ---------- */

/* Pinned between the scrolling values and the actions: always in view */
.worth {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: none;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--field);
}
.worth__head { display: flex; align-items: center; gap: 10px; }
.worth__title { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent-text); }
.worth__edit { width: 30px; height: 30px; margin: -4px -6px -4px auto; }
.worth__edit svg { width: 16px; height: 16px; }
.worth[data-verdict="unset"] .worth__badge, .worth[data-verdict="notime"] .worth__badge { color: var(--muted); background: var(--card); }
.worth__badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--muted);
  background: var(--card);
}
.worth__badge:empty { display: none; }
.worth[data-verdict="yes"] { border-color: color-mix(in srgb, var(--c-profit) 45%, transparent); }
.worth[data-verdict="yes"] .worth__badge { color: var(--c-profit); background: color-mix(in srgb, var(--c-profit) 14%, transparent); }
.worth[data-verdict="partial"] { border-color: color-mix(in srgb, var(--c-energy) 45%, transparent); }
.worth[data-verdict="partial"] .worth__badge { color: var(--c-energy); background: color-mix(in srgb, var(--c-energy) 14%, transparent); }
.worth[data-verdict="no"] { border-color: var(--danger-line); }
.worth[data-verdict="no"] .worth__badge { color: var(--danger); background: var(--danger-soft); }
.worth__text { font-size: 13px; line-height: 1.5; color: var(--text); }
.worth__text strong { font-weight: 600; }

.worth__meter { height: 6px; border-radius: 6px; background: var(--card); overflow: hidden; }
.worth__meter span { display: block; height: 100%; width: var(--w, 0%); border-radius: 6px; background: var(--accent); transition: width 0.5s var(--ease); }
.worth[data-verdict="yes"] .worth__meter span { background: var(--c-profit); }
.worth[data-verdict="partial"] .worth__meter span { background: var(--c-energy); }

.worth__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.worth__stats div { min-width: 0; }
.worth__stats dt { font-size: 11.5px; color: var(--faint); }
.worth__stats dd { margin: 1px 0 0; font-size: 14px; font-weight: 600; white-space: nowrap; }

/* Profile dialog */
#goalForm { display: flex; flex-direction: column; min-height: 0; }
.goal-block { display: flex; flex-direction: column; gap: 10px; }
.goal-block + .goal-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.goal-block > .field__label { color: var(--text); font-weight: 600; font-size: 14px; }
.goal-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.goal-row .seg { height: 42px; align-items: stretch; }
.goal-block .hint { margin-top: 0; }
.modal__foot { gap: 8px; }

/* ---------- Saved-fees dialog ---------- */

.modal {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 30px 80px -24px var(--shadow);
}
.modal::backdrop { background: rgba(10, 8, 16, 0.55); backdrop-filter: blur(3px); }
.modal[open] { display: flex; flex-direction: column; animation: donate-in 0.35s var(--ease); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal__head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent-text); }
.modal__head .icon-btn { margin-right: -8px; }
.modal__hint { margin: 6px 0 18px; }
.modal .fees { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 4px; }
.modal__foot { display: flex; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal__foot .btn { min-width: 120px; }

/* ---------- Donation dialog ---------- */

.donate {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 32px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 30px 80px -24px var(--shadow);
  overflow-y: auto;
}
.donate::backdrop { background: rgba(10, 8, 16, 0.55); backdrop-filter: blur(3px); }
.donate[open] { animation: donate-in 0.4s var(--ease); }
@keyframes donate-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
}

.donate__close { position: absolute; top: 12px; right: 12px; }
.donate__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent-text);
}
.donate__icon svg { width: 26px; height: 26px; }
.donate__head { display: flex; align-items: center; gap: 14px; padding-right: 32px; }
.donate__head .donate__icon { width: 44px; height: 44px; flex: none; }
.donate__head .donate__icon svg { width: 22px; height: 22px; }
.donate h2 {
  margin-top: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.donate__text { margin-top: 10px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.donate__text p + p { margin-top: 10px; }

.donate__pix {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 20px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
}
.donate__pix-label { font-size: 12px; font-weight: 600; color: var(--accent-text); }
.donate__pix code {
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}

.donate__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.donate__actions .btn { width: 100%; height: 46px; white-space: normal; }

/* ---------- Receipt ---------- */

.receipt {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px;
  overflow: hidden;
}
.receipt > * { flex-shrink: 0; }
.receipt__grip, .receipt__close { display: none; }

.receipt__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.receipt__head h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.receipt__channel { color: var(--muted); margin-top: 4px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 16px;
  padding: 18px 16px 16px;
  border-radius: var(--radius);
  background: var(--plate-bg);
  border: 1px solid var(--plate-line);
  box-shadow: var(--plate-shadow);
}
.plate__price {
  font-size: clamp(38px, 4.2vw, 52px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--price);
  white-space: nowrap;
}
.plate__sub { color: var(--accent-text); font-size: 13px; font-weight: 500; opacity: 0.85; }
.plate.is-invalid .plate__price { color: var(--faint); }

.receipt__error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger-text);
  font-size: 13px;
}

.tear {
  position: relative;
  flex: none;
  height: 22px;
  margin: 12px -28px 2px;
}
.tear::before {
  content: "";
  position: absolute;
  left: 22px; right: 22px; top: 50%;
  border-top: 1.5px dashed var(--line-strong);
}

/* Side notches punched through the card at the tear line; --ty is set from JS */
.receipt {
  --ty: -40px;
  -webkit-mask:
    radial-gradient(circle at 0 var(--ty), transparent 11px, #000 11.5px),
    radial-gradient(circle at 100% var(--ty), transparent 11px, #000 11.5px);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle at 0 var(--ty), transparent 11px, #000 11.5px),
    radial-gradient(circle at 100% var(--ty), transparent 11px, #000 11.5px);
  mask-composite: intersect;
}

/* On short screens only the breakdown scrolls; price and action stay in view */
.receipt__body {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -8px 12px;
  padding: 0 8px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.receipt > .receipt__body { flex-shrink: 1; }
.receipt__body > * { flex-shrink: 0; }

.bar {
  display: flex;
  height: 10px;
  gap: 2px;
  margin: 10px 0 4px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--field);
}
.bar span {
  height: 100%;
  min-width: 0;
  background: var(--c);
  transition: flex-grow 0.5s var(--ease);
}

.lines { margin: 8px 0 0; }
.line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 14px;
}
.line dt { display: flex; align-items: center; gap: 8px; color: var(--muted); min-width: 0; }
.line dt span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line dd { margin: 0; font-weight: 500; white-space: nowrap; }
.line i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.line--sub { padding: 2px 0 2px 16px; font-size: 13px; }
.line--sub dt, .line--sub dd { color: var(--faint); font-weight: 400; }
.line--total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.line--total dt { color: var(--text); font-weight: 600; }
.line--total dd { font-weight: 600; }
.line--total + .line:not(.line--total) { margin-top: 6px; }
.line--profit dt { color: var(--text); }
.line--profit dd { color: var(--c-profit); font-weight: 600; }
.line--loss dd, .stat.is-loss dd, .dock__more > span.is-loss { color: var(--danger) !important; }
.receipt__floor.is-loss { color: var(--danger-text); }
.receipt__floor.is-loss strong { color: inherit; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stat { min-width: 0; padding: 0 12px; }
.stat:first-child { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat dt { font-size: 12px; color: var(--faint); }
.stat dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat:last-child dd { color: var(--c-profit); }

.receipt__floor { margin-top: 10px; font-size: 13px; color: var(--faint); }
.receipt__floor strong { color: var(--muted); font-weight: 600; }

.receipt__actions { display: flex; flex-direction: column; gap: 8px; margin-top: auto; flex: none; }
.receipt__cta { width: 100%; height: 48px; }
.receipt__export { width: 100%; }

.dock, .scrim { display: none; }

/* ---------- Mobile: inputs are the page, receipt is a sheet ---------- */

@media (max-width: 880px) {
  .app {
    display: block;
    height: auto;
    padding: 0;
  }

  .form {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: var(--bg);
    padding: 0 16px 8px;
  }
  .form__head {
    margin: 0 -16px;
    padding: 18px 16px 12px;
    background: var(--bg);
  }
  .form__head h1 { font-size: 24px; }
  .site-foot {
    padding: 16px 16px calc(112px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    margin: 0 16px;
    padding-left: 0;
    padding-right: 0;
  }
  .group { margin-top: 28px; padding-top: 24px; }
  .cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-4 > .field:first-child { grid-column: 1 / -1; }

  .dock {
    display: flex;
    position: fixed;
    z-index: 20;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    text-align: left;
    border-radius: var(--radius);
    border: 1px solid var(--plate-line);
    background: var(--dock-bg);
    box-shadow: 0 12px 32px -6px var(--shadow);
  }
  .dock__price { display: flex; flex-direction: column; min-width: 0; }
  .dock__label { font-size: 12px; color: var(--accent-text); }
  .dock__price strong { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; color: var(--price); white-space: nowrap; }
  .dock__more { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; }
  .dock__more > span:first-child { color: var(--c-profit); font-weight: 600; white-space: nowrap; }
  .dock__open { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
  .dock__open svg { width: 16px; height: 16px; }

  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--scrim);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }

  .receipt {
    position: fixed;
    z-index: 40;
    left: 0; right: 0; bottom: 0;
    max-height: 90dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    padding: 8px 20px calc(16px + env(safe-area-inset-bottom));
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 0.4s var(--ease), visibility 0s 0.4s;
    box-shadow: 0 -20px 60px -20px var(--shadow);
  }
  .receipt__grip { display: block; width: 40px; height: 4px; margin: 0 auto 12px; border-radius: 4px; background: var(--line-strong); flex: none; }
  .receipt__close { display: grid; margin-right: -8px; }
  .receipt__head .seg { margin-left: auto; }
  .tear { margin-left: -20px; margin-right: -20px; }
  .tear::before { left: 18px; right: 18px; }
  .plate { margin-top: 14px; padding: 18px 12px 16px; }
  .plate__price { font-size: 40px; }
  .receipt__body { margin-bottom: 12px; }

  body.sheet-open { overflow: hidden; }
  body.sheet-open .scrim { opacity: 1; pointer-events: auto; }
  body.sheet-open .receipt { transform: none; visibility: visible; transition: transform 0.4s var(--ease); }
}

@media (max-width: 420px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 > .field:first-child { grid-column: 1 / -1; }
  .cols-time { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-time > .field:first-child { grid-column: auto; }
  .fee {
    grid-template-columns: auto minmax(0, 1fr) 36px 36px;
    grid-template-areas: "name name save remove" "seg value value value";
  }
  .fee__name { grid-area: name; }
  .fee .seg { grid-area: seg; }
  .fee__value { grid-area: value; }
  .fee__save { grid-area: save; }
  .fee__remove { grid-area: remove; }
  .fee + .fee { padding-top: 10px; border-top: 1px solid var(--line); }
  .fee--saved {
    grid-template-columns: auto minmax(0, 1fr) 36px;
    grid-template-areas: "name name delete" "seg value value";
  }
  .fee__delete { grid-area: delete; }
  .prof {
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-areas: "name delete" "sum sum";
  }
  .prof__sum { grid-area: sum; }
  .pack {
    grid-template-columns: minmax(0, 1fr) 110px 36px;
    grid-template-areas: none;
  }
  .pack > * { grid-area: auto; }
  .plate-block, .plate-card__head { padding-left: 12px; padding-right: 12px; }
  .plate-block--units { flex-direction: column; align-items: stretch; }
  .stepper { align-self: flex-start; }
  .slot { grid-template-columns: 14px minmax(0, 1fr) 96px 32px; gap: 8px; }
  .fil {
    grid-template-columns: 40px repeat(3, minmax(0, 1fr)) 36px;
    grid-template-areas: "color name name name del" "type type price weight weight" "save save save save save";
  }
  .fil__save { grid-area: save; }
  .fil:not(.is-dirty) .fil__save { display: none; }
  .fil-head { display: none; }
  .fil__color { grid-area: color; }
  .fil__name { grid-area: name; }
  .fil__type { grid-area: type; }
  .fil__price { grid-area: price; }
  .fil__weight { grid-area: weight; }
  .fil .fee__delete { grid-area: del; }
  .pack + .pack { padding-top: 0; border-top: 0; }
  .modal { padding: 20px 16px; }
  .goal-row { grid-template-columns: 1fr; }
  .goal-row .seg button { flex: 1; }
  .donate { padding: 28px 20px 20px; }
  .donate__pix code { font-size: 12px; letter-spacing: -0.02em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
