:root {
  --pt-bg: #ffffff;
  --pt-bg-2: #f5f5f6;
  --pt-card: #ffffff;
  --pt-ink: #141414;
  --pt-muted: #6b6b73;
  --pt-line: rgba(20, 20, 20, 0.12);
  --pt-red: #e10600;
  --pt-red-2: #a80500;
  --pt-red-soft: #ff3b30;
  --pt-ok: #1a7f4b;
  --pt-warn: #b7791f;
  --pt-info: #2f5ea8;
  --pt-radius: 18px;
  --pt-font: "Outfit", system-ui, sans-serif;
  --pt-display: "Cormorant Garamond", Georgia, serif;
  --pt-safe-b: env(safe-area-inset-bottom, 0px);
  --pt-safe-t: env(safe-area-inset-top, 0px);
  /* aliases usados no JS/CSS legado */
  --pt-pink: var(--pt-red);
  --pt-pink-2: var(--pt-red-2);
  --pt-blush: var(--pt-red);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--pt-bg);
  color: var(--pt-ink);
  font-family: var(--pt-font);
  -webkit-tap-highlight-color: transparent;
  color-scheme: light;
}
body.pt-app {
  background:
    radial-gradient(700px 360px at 85% -8%, rgba(225, 6, 0, 0.07), transparent 55%),
    radial-gradient(520px 300px at 0% 100%, rgba(168, 5, 0, 0.04), transparent 50%),
    var(--pt-bg);
  min-height: 100dvh;
}
body.pt-app.is-locked {
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(225, 6, 0, 0.14), transparent 55%),
    radial-gradient(700px 420px at 0% 100%, rgba(168, 5, 0, 0.08), transparent 50%),
    var(--pt-bg);
}
.pt-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.pt-gate, .pt-shell, .pt-reader, .pt-modal { position: relative; z-index: 1; }

.pt-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--pt-safe-t)) 20px calc(24px + var(--pt-safe-b));
}
.pt-gate-card {
  width: min(420px, 100%);
  padding: 28px 22px 24px;
  border-radius: 28px;
  border: 1.5px solid rgba(225, 6, 0, 0.55);
  background: linear-gradient(165deg, #ffffff, #fff8f7);
  box-shadow:
    0 0 0 1px rgba(225, 6, 0, 0.06),
    0 18px 50px rgba(225, 6, 0, 0.14),
    0 30px 80px rgba(0, 0, 0, 0.08);
  animation: ptRise 0.55s ease both;
}
@keyframes ptRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.pt-logo { display: grid; place-items: center; margin-bottom: 10px; }
.pt-logo-mark {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center;
  font-family: var(--pt-display); font-weight: 700; font-size: 2rem;
  color: #fff;
  background: linear-gradient(145deg, var(--pt-red-soft), var(--pt-red-2));
  box-shadow: 0 12px 30px rgba(225, 6, 0, 0.38);
}
.pt-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--pt-red);
  font-weight: 600;
  text-align: center;
}
.pt-brand {
  margin: 4px 0 8px;
  text-align: center;
  font-family: var(--pt-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 10vw, 3.4rem);
  letter-spacing: 0.08em;
  line-height: 1;
  background: linear-gradient(180deg, #ff4a3d, var(--pt-red-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 22px rgba(225, 6, 0, 0.22));
}
.pt-lede, .pt-fine, .pt-hint {
  color: var(--pt-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
}
.pt-fine { font-size: 0.8rem; margin-top: 14px; }
.pt-hint { text-align: left; margin: 0 0 14px; font-size: 0.82rem; }

.pt-login-form { display: grid; gap: 14px; margin-top: 22px; }
.pt-field { display: grid; gap: 6px; }
.pt-field span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pt-muted);
}
.pt-field input, .pt-tab-panel input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  padding: 14px 16px;
  font: inherit;
  font-size: 1.05rem;
}
.pt-field textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  resize: vertical;
  min-height: 84px;
}
.pt-field textarea:focus {
  outline: none;
  border-color: rgba(225, 6, 0, 0.65);
  box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.14);
}
.pt-obs { margin-top: 0; }
.pt-error { color: var(--pt-red); text-align: center; margin: 0; font-size: 0.88rem; }

.pt-btn {
  appearance: none;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  border-radius: 999px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.pt-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pt-btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--pt-red), var(--pt-red-2));
  color: #fff;
  box-shadow: 0 10px 28px rgba(225, 6, 0, 0.28);
}
.pt-btn-send {
  border-color: transparent;
  background: linear-gradient(135deg, #3b74c9, var(--pt-info));
  color: #fff;
  box-shadow: 0 10px 28px rgba(47, 94, 168, 0.28);
}
.pt-btn-ghost {
  background: transparent;
  color: var(--pt-ink);
}
.pt-btn-reopen {
  color: var(--pt-muted) !important;
  font-weight: 500;
}
.pt-text-btn, .pt-icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--pt-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}
#ptLogout {
  color: #888890;
  font-weight: 500;
}

.pt-shell { min-height: 100dvh; padding-bottom: calc(24px + var(--pt-safe-b)); }
.pt-shell:has(#ptOrderView:not([hidden])) {
  padding-bottom: calc(96px + var(--pt-safe-b));
}
.pt-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--pt-safe-t)) 16px 10px;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--pt-line);
}
.pt-topbar-brand { display: grid; gap: 2px; min-width: 0; }
.pt-topbar-brand strong {
  font-family: var(--pt-display);
  letter-spacing: 0.12em;
  font-size: 1.35rem;
  font-weight: 700;
  background: linear-gradient(180deg, #ff4a3d, var(--pt-red-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pt-topbar-brand span {
  color: var(--pt-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

.pt-view { padding: 18px 16px 28px; animation: ptRise 0.35s ease both; }
.pt-view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pt-view-head h2 {
  margin: 0;
  font-family: var(--pt-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--pt-ink);
}
.pt-order-head {
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
}
.pt-order-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.pt-order-title-wrap h2 {
  font-size: 1.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-autosave {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pt-ok);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.pt-autosave.is-on {
  opacity: 1;
}
.pt-autosave[hidden] { display: none !important; }
.pt-status {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--pt-line);
  color: var(--pt-red);
  background: rgba(225, 6, 0, 0.06);
}
.pt-status.is-finalizado {
  color: var(--pt-info);
  border-color: rgba(47, 94, 168, 0.35);
  background: rgba(47, 94, 168, 0.08);
}
.pt-status.is-enviado {
  color: var(--pt-ok);
  border-color: rgba(26, 127, 75, 0.35);
  background: rgba(26, 127, 75, 0.08);
}
.pt-btn-save {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--pt-ink);
  border-color: var(--pt-line);
  background: #fff;
}
.pt-btn-save.is-ok {
  border-color: rgba(26, 127, 75, 0.45);
  color: var(--pt-ok);
}

.pt-list { display: grid; gap: 12px; }
.pt-list,
.pt-list .pt-card,
.pt-list .pt-card * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-tap-highlight-color: transparent;
}
.pt-card.is-pressing {
  transform: scale(0.985);
}
body.pt-holding-card,
body.pt-holding-card * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}
.pt-swipe {
  position: relative;
  border-radius: var(--pt-radius);
  overflow: hidden;
  touch-action: pan-y;
}
.pt-swipe-bg {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  background: #b42318;
  z-index: 0;
}
.pt-swipe-bg[hidden] { display: none !important; }
.pt-swipe-delete {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 22px;
  min-width: 96px;
  cursor: pointer;
}
.pt-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 16px 16px 14px;
  border-radius: var(--pt-radius);
  border: 1.5px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  will-change: transform;
}
.pt-card.is-rascunho {
  border-color: rgba(183, 121, 31, 0.5);
}
.pt-card.is-finalizado {
  border-color: rgba(47, 94, 168, 0.45);
}
.pt-card.is-enviado {
  border-color: rgba(26, 127, 75, 0.45);
}
.pt-card:active { transform: scale(0.985); }
.pt-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.pt-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.pt-card-mail {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: rgba(47, 94, 168, 0.55);
}
.pt-card-mail svg {
  display: block;
  width: 18px;
  height: 18px;
}
.pt-card-title {
  font-family: var(--pt-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--pt-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
}
.pt-badge.is-rascunho {
  color: #8a5a12;
  background: rgba(183, 121, 31, 0.12);
  border: 1px solid rgba(183, 121, 31, 0.28);
}
.pt-badge.is-finalizado {
  color: var(--pt-info);
  background: rgba(47, 94, 168, 0.1);
  border: 1px solid rgba(47, 94, 168, 0.28);
}
.pt-badge.is-enviado {
  color: var(--pt-ok);
  background: rgba(26, 127, 75, 0.1);
  border: 1px solid rgba(26, 127, 75, 0.28);
}
.pt-card .pt-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  color: var(--pt-muted);
  font-size: 0.85rem;
}
.pt-card-meta-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pt-card-valor {
  font-weight: 600;
  color: var(--pt-ink);
  white-space: nowrap;
}
.pt-card-actions {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.pt-card-act {
  appearance: none;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}
.pt-card-act.is-danger {
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.05);
}
.pt-card-act.is-dup {
  color: var(--pt-ink);
  border-color: var(--pt-line);
  background: #fff;
}
.pt-card-act.is-send {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(145deg, #3b74c9, var(--pt-info));
}
.pt-card-act.is-pdf {
  color: var(--pt-ink);
}
.pt-card-act.is-more {
  min-width: 36px;
  padding: 7px 10px;
  letter-spacing: 0.08em;
  color: var(--pt-muted);
}
.pt-empty { color: var(--pt-muted); text-align: center; padding: 48px 16px; line-height: 1.5; }

.pt-rule-hint {
  margin: 0 0 14px;
  color: var(--pt-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.pt-min-faltam {
  margin: -4px 0 12px;
  padding: 0 2px;
  color: #b42318;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.pt-min-faltam[hidden] {
  display: none !important;
}
.pt-reader-min {
  margin: 0;
  padding: 6px 14px 8px;
  background: rgba(180, 35, 24, 0.07);
  border-bottom: 1px solid rgba(180, 35, 24, 0.18);
  color: #b42318;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}
.pt-reader-min[hidden] {
  display: none !important;
}
.pt-details {
  border-radius: var(--pt-radius);
  border: 1px solid var(--pt-line);
  background: #fff;
  margin-bottom: 16px;
  overflow: hidden;
}
.pt-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pt-ink);
  user-select: none;
}
.pt-details > summary::-webkit-details-marker { display: none; }
.pt-details > summary::after {
  content: "›";
  float: right;
  color: var(--pt-muted);
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}
.pt-details[open] > summary::after {
  transform: rotate(-90deg);
}
.pt-details .pt-panel {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--pt-line);
  border-radius: 0;
  box-shadow: none;
}

.pt-toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--pt-safe-b));
  transform: translateX(-50%) translateY(8px);
  z-index: 90;
  max-width: min(92vw, 360px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pt-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pt-toast[hidden] { display: none !important; }

/* Sheet duplicar (mobile long-press) */
.pt-action-sheet .pt-share-actions,
.pt-action-sheet .pt-modal-sheet {
  gap: 10px;
}
.pt-action-sheet .pt-modal-sheet {
  display: grid;
}

@media (hover: hover) and (pointer: fine) {
  .pt-swipe {
    overflow: visible;
  }
  .pt-swipe-bg { display: none !important; }
  .pt-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
  }
  .pt-card-actions {
    display: flex;
  }
}

.pt-panel, .pt-totals {
  border-radius: var(--pt-radius);
  border: 1px solid var(--pt-line);
  background: #fff;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
}
.pt-dates {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pt-dates label {
  display: grid;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--pt-muted);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.pt-dates input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
  padding: 8px 4px;
  appearance: none;
  -webkit-appearance: none;
  color-scheme: light;
}
.pt-dates input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  min-height: 1.2em;
}
.pt-totals {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 12px;
}
.pt-totals em {
  display: block;
  font-style: normal;
  color: var(--pt-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pt-totals strong {
  font-family: var(--pt-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--pt-ink);
}
.pt-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pt-cat-chip {
  appearance: none;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  border: 1px solid rgba(225, 6, 0, 0.22);
  color: var(--pt-red);
  background: rgba(225, 6, 0, 0.06);
  cursor: pointer;
}
.pt-cat-chip:active {
  transform: scale(0.98);
}
.pt-cat-items-sheet {
  max-height: min(62dvh, 520px);
  padding-bottom: calc(12px + var(--pt-safe-b));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pt-cat-items-sheet .pt-modal-head {
  margin-bottom: 8px;
  flex: 0 0 auto;
}
.pt-cat-items-sheet .pt-modal-head h3 {
  font-size: 1.2rem;
  margin: 0 0 2px;
}
.pt-cat-items-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: grid;
  gap: 6px;
  padding: 2px 0 4px;
}
.pt-cat-item-row {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--pt-line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: var(--pt-ink);
  cursor: pointer;
}
.pt-cat-item-row:active {
  background: rgba(225, 6, 0, 0.04);
}
.pt-cat-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.pt-cat-item-main strong {
  font-size: 0.92rem;
}
.pt-cat-item-main small,
.pt-cat-item-side small {
  color: var(--pt-muted);
  font-size: 0.75rem;
  line-height: 1.25;
}
.pt-cat-item-side {
  display: grid;
  gap: 2px;
  text-align: right;
  flex: 0 0 auto;
}
.pt-cat-item-side strong {
  font-size: 0.9rem;
  color: var(--pt-red);
}

.pt-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 999px;
  background: var(--pt-bg-2);
  border: 1px solid var(--pt-line);
}
.pt-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--pt-muted);
  border-radius: 999px;
  padding: 10px 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pt-tab.is-on {
  background: linear-gradient(135deg, var(--pt-red), var(--pt-red-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 6, 0, 0.22);
}
.pt-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  line-height: 1;
}
.pt-tab:not(.is-on) .pt-tab-badge {
  background: rgba(225, 6, 0, 0.12);
  color: var(--pt-red);
}
.pt-tab-badge[hidden] { display: none !important; }

.pt-totals {
  margin-top: 8px;
}

.pt-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 4px 0 12px;
}
.pt-cat-card {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
  color: var(--pt-ink);
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 10px;
  width: 100%;
}
.pt-cat-cover {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.65), transparent 42%),
    #f0f0f2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 10px 24px rgba(0, 0, 0, 0.1);
}
.pt-cat-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: transparent;
  aspect-ratio: auto;
}
.pt-cat-card span {
  display: block;
  padding: 0 2px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--pt-display);
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--pt-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-search-results, .pt-cart-list { display: grid; gap: 8px; }
.pt-prod-row, .pt-cart-row {
  display: grid;
  gap: 4px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.pt-prod-row { grid-template-columns: 1fr; }
.pt-cart-row { grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.pt-prod-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.pt-prod-row .ref {
  color: #4a4a52;
  font-weight: 650;
}
.pt-prod-row .preco {
  font-family: var(--pt-display);
  font-weight: 650;
  font-size: 1.08rem;
  color: var(--pt-red);
  white-space: nowrap;
}
.pt-prod-row .desc,
.pt-cart-row small {
  display: block;
  color: var(--pt-muted);
  margin-top: 2px;
}
.pt-cart-row strong { color: var(--pt-ink); }

.pt-order-foot {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: grid;
  gap: 8px;
  padding: 10px 16px calc(10px + var(--pt-safe-b));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--pt-line);
  backdrop-filter: blur(12px);
}
.pt-order-foot .pt-btn {
  width: 100%;
  padding: 12px 16px;
}
.pt-order-foot .pt-foot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pt-order-foot .pt-foot-row.is-single {
  grid-template-columns: 1fr;
}
.pt-order-foot .pt-foot-row .pt-btn {
  width: 100%;
}
#ptBtnShare[hidden],
#ptBtnEnviar[hidden],
#ptBtnReabrir[hidden],
#ptBtnFinalizar[hidden],
#ptFootSecondary[hidden] {
  display: none !important;
}
#ptOrderView {
  padding-bottom: calc(160px + var(--pt-safe-b));
}
#ptTabSearch,
#ptTabCart,
#ptTabCats {
  padding-bottom: 8px;
}

/* Reader — uma página por vez (folhear horizontal) + vitrine escura */
html.pt-reader-open,
html.pt-reader-open body {
  overscroll-behavior: none;
}
body.pt-reader-open {
  overflow: hidden !important;
  touch-action: none;
}
body.pt-reader-open .pt-shell {
  pointer-events: none;
  visibility: hidden;
}
.pt-reader {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #0c0c0e;
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  pointer-events: auto;
}
.pt-reader.is-kb {
  /* pinned by JS to visualViewport while keyboard is open */
  box-shadow: 0 0 0 100vmax #0c0c0e;
}
.pt-reader[hidden] { display: none !important; }
.pt-reader-search {
  display: grid;
  gap: 8px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 14, 0.96);
  touch-action: manipulation;
  position: relative;
  z-index: 8;
}
.pt-reader-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pt-reader-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fafafa;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  padding: 10px 12px;
  outline: none;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}
.pt-reader-search-input::placeholder {
  color: rgba(244, 244, 245, 0.42);
  letter-spacing: 0;
}
.pt-reader-search-input:focus {
  border-color: rgba(225, 6, 0, 0.7);
  box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.22);
}
.pt-reader-search-hint {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(244, 244, 245, 0.62);
}
.pt-reader-search-hint.is-other {
  color: #fbbf24;
}
.pt-reader-search-hint.is-miss {
  color: rgba(244, 244, 245, 0.45);
}
.pt-reader-search-hint.is-hit {
  color: rgba(244, 244, 245, 0.78);
}
.pt-reader-info {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px 0 2px;
  overscroll-behavior-x: contain;
  flex: 1;
  min-width: 0;
  touch-action: pan-x;
}
.pt-reader-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  touch-action: manipulation;
}
/* Mantém a altura mesmo sem refs — evita as setas subirem/descerem */
.pt-reader-info-row[hidden] {
  display: flex !important;
  visibility: hidden;
  pointer-events: none;
  min-height: 56px;
  height: 56px;
  overflow: hidden;
  margin: 0;
}
.pt-reader-info[hidden] { display: none !important; }
.pt-reader-info::-webkit-scrollbar { display: none; }
.pt-info-chip {
  appearance: none;
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  min-width: min(72vw, 220px);
  max-width: min(86vw, 300px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.96);
  color: var(--pt-ink);
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pt-info-chip:active { transform: scale(0.98); }
.pt-info-chip-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.pt-info-chip .ref {
  font-size: 0.8rem;
  font-weight: 650;
  color: #4a4a52;
  letter-spacing: 0.03em;
}
.pt-info-chip .preco {
  font-family: var(--pt-display);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--pt-red);
  white-space: nowrap;
}
.pt-info-chip .desc {
  display: block;
  font-size: 0.74rem;
  line-height: 1.25;
  color: var(--pt-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-info-chip.is-pulse {
  animation: ptChipPulse 0.7s ease;
}
.pt-info-chip.is-in-order {
  border-color: rgba(225, 6, 0, 0.45);
  background: #fff8f7;
  box-shadow: 0 0 0 1px rgba(225, 6, 0, 0.12), 0 8px 22px rgba(0, 0, 0, 0.22);
}
.pt-in-order {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--pt-red);
  letter-spacing: 0.01em;
}
.pt-page-sheet-row.is-in-order .ref {
  color: var(--pt-red);
}
.pt-page-sheet-row .pt-in-order {
  margin-top: 6px;
}
.pt-reader-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--pt-safe-t)) 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 14, 0.92);
  color: #f4f4f5;
  backdrop-filter: blur(14px);
}
.pt-reader-bar-mid {
  display: grid;
  gap: 1px;
  text-align: center;
  min-width: 0;
}
.pt-reader-bar strong {
  color: #fafafa;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-reader-page-label {
  font-size: 0.72rem;
  color: rgba(244, 244, 245, 0.55);
  letter-spacing: 0.04em;
}
.pt-reader-bar .pt-text-btn,
.pt-reader-bar .pt-icon-btn {
  color: rgba(244, 244, 245, 0.88);
}
.pt-reader-bar #ptReaderCart {
  color: rgba(244, 244, 245, 0.55);
  font-weight: 500;
}
.pt-reader-stage {
  position: relative;
  min-height: 0;
  display: grid;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(225, 6, 0, 0.14), transparent 55%),
    radial-gradient(80% 50% at 50% 100%, rgba(225, 6, 0, 0.08), transparent 50%),
    #0c0c0e;
}
.pt-reader-stage::before,
.pt-reader-stage::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: calc(96px + var(--pt-safe-b));
  width: min(72px, 12vw);
  z-index: 3;
  pointer-events: none;
}
.pt-reader-stage::before {
  left: 0;
  background: linear-gradient(90deg, rgba(12, 12, 14, 0.88), transparent);
}
.pt-reader-stage::after {
  right: 0;
  background: linear-gradient(270deg, rgba(12, 12, 14, 0.88), transparent);
}
.pt-reader-scroll {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  touch-action: pan-x;
  scrollbar-width: none;
  height: 100%;
  padding-bottom: calc(156px + var(--pt-safe-b));
  box-sizing: border-box;
}
.pt-reader-scroll::-webkit-scrollbar { display: none; }
.pt-reader-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: 10px 18px 0;
  box-sizing: border-box;
  overflow: hidden;
}
.pt-reader-zoom {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-x;
}
.pt-reader-zoom.is-zoomed {
  touch-action: none;
}
.pt-reader-page {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(225, 6, 0, 0.08);
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
  will-change: transform;
}
.pt-reader-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 22, 0.78);
  color: #fafafa;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  padding: 0 0 2px;
  /* não herdar transform de estados disabled */
  touch-action: manipulation;
}
.pt-reader-prev { left: 8px; }
.pt-reader-next { right: 8px; }
.pt-reader-nav:disabled {
  opacity: 0.28;
  cursor: default;
}
@media (max-width: 720px) {
  .pt-reader-nav {
    width: 38px;
    height: 38px;
    font-size: 1.35rem;
    top: 50%;
  }
  .pt-reader-prev { left: 4px; }
  .pt-reader-next { right: 4px; }
  .pt-reader-slide { padding: 8px 12px 0; }
}

.pt-reader-fab {
  position: static;
  right: auto;
  bottom: auto;
  z-index: 6;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, var(--pt-red-soft), var(--pt-red-2));
  color: #fff;
  box-shadow: 0 8px 18px rgba(225, 6, 0, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  align-self: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.pt-reader-fab[hidden] { display: none !important; }
.pt-reader-fab-icon {
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1;
  margin-top: -2px;
}
.pt-reader-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff;
  color: var(--pt-red);
  font-size: 0.68rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.pt-reader-fab-badge[hidden] { display: none !important; }

@keyframes ptChipPulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }
  40% { box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.28), 0 10px 26px rgba(225, 6, 0, 0.22); }
}

.pt-page-sheet-list {
  display: grid;
  gap: 0;
}
.pt-page-sheet-row {
  display: block;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--pt-line);
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.pt-page-sheet-row:last-child { border-bottom: 0; }
.pt-page-sheet-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.pt-page-sheet-row .ref {
  color: #4a4a52;
  font-size: 0.95rem;
  font-weight: 650;
}
.pt-page-sheet-row .desc {
  display: block;
  color: var(--pt-muted);
  margin-top: 4px;
  font-size: 0.82rem;
}
.pt-page-sheet-row .preco {
  font-family: var(--pt-display);
  font-weight: 650;
  font-size: 1.15rem;
  color: var(--pt-red);
  white-space: nowrap;
}
.pt-page-sheet-row:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modal / grade */
.pt-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
}
.pt-modal[hidden],
.pt-reader[hidden],
.pt-shell[hidden],
.pt-gate[hidden],
.pt-view[hidden],
.pt-tab-panel[hidden],
.pt-reader-info-row[hidden],
.pt-reader-info[hidden],
.pt-reader-fab[hidden],
.pt-reader-fab-badge[hidden],
.pt-error[hidden] {
  display: none !important;
}
.pt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 10, 0.45);
}
.pt-modal-sheet {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  margin: 0 auto;
  max-height: min(92dvh, 900px);
  overflow: auto;
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(225, 6, 0, 0.28);
  border-bottom: 0;
  background: #fff;
  color: var(--pt-ink);
  padding: 16px 16px calc(16px + var(--pt-safe-b));
  box-shadow: 0 -20px 50px rgba(225, 6, 0, 0.12);
}
.pt-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.pt-modal-head h3 {
  margin: 2px 0 4px;
  font-family: var(--pt-display);
  font-size: 1.45rem;
  color: var(--pt-ink);
}
.pt-modal-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  margin-top: 14px;
}
.pt-share-actions { display: grid; gap: 8px; }

.pt-grade-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: var(--pt-ink);
}
.pt-grade-table th, .pt-grade-table td {
  border-bottom: 1px solid var(--pt-line);
  padding: 6px 4px;
  text-align: center;
}
.pt-tam-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1.15;
}
.pt-tam-letra {
  font-weight: 700;
}
.pt-tam-faixa {
  font-size: 0.62em;
  font-weight: 500;
  color: #8a8f8c;
  white-space: nowrap;
}
.pt-grade-table th.pt-tam-faixa-col {
  min-width: 3.6rem;
  vertical-align: bottom;
}
.pt-grade-table th:first-child, .pt-grade-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  min-width: 96px;
  max-width: 132px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
}
.pt-qty-sheet {
  max-width: 420px;
}
.pt-qty-display-wrap {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.pt-qty-display-label {
  font-size: 0.78rem;
  color: var(--pt-muted);
}
.pt-qty-display {
  min-height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--pt-line);
  background: #f7f7f8;
  font-family: var(--pt-display);
  font-size: 2rem;
  font-weight: 650;
  color: var(--pt-ink);
  letter-spacing: 0.04em;
}
.pt-qty-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.pt-qty-key {
  appearance: none;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 650;
  cursor: pointer;
}
.pt-qty-key:active {
  transform: scale(0.97);
  background: rgba(225, 6, 0, 0.08);
}
.pt-qty-key-action {
  color: var(--pt-muted);
  font-size: 1.05rem;
}
#ptQtyModal {
  z-index: 60;
}
.pt-qty-sheet #ptQtyCor {
  color: var(--pt-red);
  font-weight: 600;
  font-size: 0.95rem;
}
.pt-grade-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.pt-grade-qty {
  min-width: 52px;
  border-radius: 10px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  padding: 8px 4px;
  font: inherit;
  text-align: center;
}
.pt-grade-cell {
  appearance: none;
  min-width: 52px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--pt-line);
  background: #fff;
  color: var(--pt-ink);
  font: inherit;
  font-weight: 600;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.pt-grade-cell.has-qty {
  background: rgba(225, 6, 0, 0.12);
  border-color: rgba(225, 6, 0, 0.55);
  color: var(--pt-ink);
}

.pt-pdf-modal {
  z-index: 70;
  align-items: stretch;
}
.pt-pdf-modal[hidden] { display: none !important; }
.pt-pdf-viewer {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background: #0c0c0e;
}
.pt-pdf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--pt-safe-t)) 14px 10px;
  background: rgba(12, 12, 14, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fafafa;
}
.pt-pdf-bar .pt-text-btn {
  color: rgba(244, 244, 245, 0.9);
}
.pt-pdf-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #525252;
}
.pt-pdf-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 100%;
  padding: 10px 10px calc(16px + var(--pt-safe-b));
  box-sizing: border-box;
  background: #3a3a3c;
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: start;
}
.pt-pdf-loading {
  margin: 48px 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
  text-align: center;
}
.pt-pdf-page {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.pt-readonly #ptDatesPanel input,
body.pt-readonly #ptObservacoes,
body.pt-readonly #ptGradeSave,
body.pt-readonly #ptGradeClear { pointer-events: none; opacity: 0.45; }

@media (min-width: 860px) {
  /* Capas 1200×800 → 3/2; contain evita corte */
  .pt-cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    max-width: 920px;
  }
  .pt-cat-cover {
    aspect-ratio: 3 / 2;
  }
  .pt-cat-cover img {
    object-fit: contain;
    object-position: center;
  }
  .pt-shell { max-width: 980px; margin: 0 auto; }
  .pt-reader-stage::before,
  .pt-reader-stage::after {
    width: min(40px, 4vw);
    bottom: calc(40px + var(--pt-safe-b));
  }
  .pt-reader-slide {
    padding: 12px 48px 8px;
    overflow: visible;
  }
  .pt-reader-zoom {
    max-width: min(960px, 100%);
    max-height: 100%;
    margin: 0 auto;
    overflow: visible;
  }
  .pt-reader-page {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
  }
  .pt-reader-scroll {
    padding-bottom: calc(72px + var(--pt-safe-b));
  }
}
