/* ==========================================================================
   Quintal da Dona Maria - tema "fichário de cozinha"
   Papel kraft, fichas pautadas, caneta azul e vermelha, selos de carimbo.
   ========================================================================== */

:root {
  --kraft: #d1a87c;
  --kraft-deep: #b88a58;
  --kraft-light: #e3c7a2;
  --sun: #f2d14f;
  --sun-deep: #e2b92b;
  --ink: #4a230e;
  --ink-soft: #7a4a2c;
  --ink-dark: #2f1507;
  --paper: #fffdf4;
  --paper-edge: #efe3c4;
  --rule: #c3d6ec;
  --margin: #e0605a;
  --pen-red: #c2282e;
  --pen-blue: #27379a;
  --olive: #62743a;
  --olive-soft: #e5ebcf;
  --danger: #b3261e;

  --f-display: 'Cherry Swash', 'Georgia', serif;
  --f-body: 'Alegreya Sans', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --f-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  --rail: 248px;
  --line: 30px; /* altura da pauta das fichas */
}

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

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

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  background-color: var(--kraft);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .2  0 0 0 0 .07  0 0 0 .25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  min-height: 100vh;
  min-height: 100dvh;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--pen-blue); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 700; margin: 0; line-height: 1.15; color: var(--ink); }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

.hand { font-family: var(--f-hand); font-weight: 600; font-size: 1.28em; line-height: 1; }
.blue { color: var(--pen-blue); }
.red { color: var(--pen-red); }
.muted { color: var(--ink-soft); }
.small { font-size: 15px; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Botões: cara de carimbo / adesivo ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 8px 18px;
  font-weight: 700; font-size: 18px; letter-spacing: .01em;
  color: var(--ink); background: var(--sun);
  border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
  text-decoration: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #f6da6d; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 253, 244, .55); }
.btn.ghost:active { transform: none; }
.btn.paper { background: var(--paper); }
.btn.danger { background: var(--pen-red); color: #fff; border-color: var(--ink); }
.btn.sm { min-height: 38px; padding: 4px 12px; font-size: 16px; border-radius: 10px; box-shadow: 0 2px 0 var(--ink); }
.btn.sm.ghost { box-shadow: none; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none;
  background: transparent; border: 2px solid transparent; border-radius: 10px; color: var(--ink);
}
.icon-btn:hover { background: rgba(74, 35, 14, .1); border-color: rgba(74, 35, 14, .25); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.danger { color: var(--danger); }

/* ---------- Campos ---------- */

label.field, div.field { display: block; margin: 0 0 14px; }
label.field > span, .lbl { display: block; font-weight: 700; margin: 0 0 5px; font-size: 16px; color: var(--ink); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 9px 12px;
  background: #fffef9; color: var(--ink);
  border: 2px solid #c9ad84; border-radius: 10px;
  box-shadow: inset 0 2px 0 rgba(74, 35, 14, .06);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.35; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun); }
input::placeholder, textarea::placeholder { color: #a58a66; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { display: none; }
.hint { font-size: 15px; color: var(--ink-soft); margin: 4px 0 0; }
.err { color: var(--pen-red); font-weight: 700; margin: 8px 0 0; min-height: 1.35em; }

.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--paper); }
.seg button { border: 0; background: transparent; padding: 8px 16px; min-height: 42px; font-weight: 700; color: var(--ink); }
.seg button + button { border-left: 2px solid var(--ink); }
.seg button[aria-pressed=true] { background: var(--sun); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 6px 14px; border-radius: 999px;
  background: var(--paper); border: 2px solid #c9ad84; color: var(--ink); font-weight: 600;
  text-align: left; line-height: 1.15;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed=true] { background: var(--sun); border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
.chip small { display: block; font-weight: 500; font-size: 14px; color: var(--ink-soft); }
.chip.dim { opacity: .55; }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 12px; background: var(--paper); overflow: hidden; }
.stepper button { width: 44px; height: 42px; border: 0; background: transparent; font-size: 24px; font-weight: 700; color: var(--ink); }
.stepper button:hover { background: var(--sun); }
.stepper output { min-width: 40px; text-align: center; font-weight: 700; font-size: 20px; }

/* ---------- Estrutura: trilho lateral / topo / navegação inferior ---------- */

.rail { display: none; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--ink-dark); color: var(--paper); position: sticky; top: 0; z-index: 20; border-bottom: 3px dashed rgba(242, 209, 79, .55); }
.topbar img { width: 44px; height: 44px; border-radius: 50%; }
.topbar .t { font-family: var(--f-display); font-size: 20px; line-height: 1.1; }
.topbar .who { margin-left: auto; font-size: 15px; opacity: .85; text-align: right; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--ink-dark); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 3px dashed rgba(242, 209, 79, .55);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
  color: #e9d9bd; text-decoration: none; background: none; border: 0; font-size: 13px; font-weight: 600; min-height: 52px; justify-content: center;
}
.bottomnav svg { width: 24px; height: 24px; }
.bottomnav [aria-current=page] { color: var(--sun); }
.bottomnav .plus { position: relative; top: -14px; }
.bottomnav .plus span.disc {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sun); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.bottomnav .plus svg { width: 28px; height: 28px; }
.bottomnav .plus { color: var(--sun); }

main { padding: 18px 14px calc(110px + env(safe-area-inset-bottom, 0px)); max-width: 1120px; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 3px dashed rgba(74, 35, 14, .4); }
.page-head h1 { margin-right: auto; }

@media (min-width: 960px) {
  #app.shell { display: grid; grid-template-columns: var(--rail) 1fr; align-items: start; }
  .topbar, .bottomnav { display: none; }
  .rail {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh;
    background: var(--ink-dark); color: var(--paper); padding: 22px 0 18px 16px;
    border-right: 4px dashed rgba(242, 209, 79, .45); overflow-y: auto;
  }
  .rail .brand { display: block; width: 150px; margin: 0 auto 8px; padding-right: 16px; }
  .rail .brand img { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 0 0 4px var(--ink-dark), 0 0 0 6px var(--sun); }
  .rail nav { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; }
  .rail nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin-right: 0;
    color: #ecdcc0; text-decoration: none; font-weight: 700; font-size: 19px;
    border-radius: 14px 0 0 14px;
  }
  .rail nav a svg { width: 24px; height: 24px; flex: none; }
  .rail nav a:hover { background: rgba(255, 255, 255, .08); }
  .rail nav a[aria-current=page] { background: var(--kraft); color: var(--ink); }
  .rail nav a.new { margin-top: 8px; margin-right: 16px; border-radius: 14px; background: var(--sun); color: var(--ink); border: 2px solid var(--ink-dark); box-shadow: 0 3px 0 var(--sun-deep); }
  .rail nav a.new[aria-current=page] { background: #f8e07f; }
  .rail .me { margin: auto 16px 0 0; padding-top: 16px; border-top: 2px dashed rgba(242, 209, 79, .35); font-size: 16px; }
  .rail .me b { display: block; font-size: 18px; color: var(--sun); }
  .rail .me .row { margin-top: 8px; }
  .rail .me button { background: none; border: 0; color: #ecdcc0; padding: 6px 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
  main { padding: 28px 32px 60px; width: 100%; }
}

/* ---------- Login ---------- */

.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 18px 14px 28px; }
.login-box { width: min(440px, 100%); }
.login-logo {
  width: min(400px, 92%); margin: 0 auto -18px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent);
  mask-composite: intersect;
}
.login-card { position: relative; z-index: 1; padding: 22px 22px 20px; }
.login-card h1 { font-size: 24px; margin-bottom: 4px; }

/* ---------- Ficha (o cartão pautado) ---------- */

.ficha {
  position: relative;
  background-color: var(--paper);
  background-image:
    linear-gradient(to bottom, transparent 0 calc(var(--line) * 2 - 2px), var(--margin) calc(var(--line) * 2 - 2px) calc(var(--line) * 2), transparent calc(var(--line) * 2)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% calc(100% - var(--line) * 2);
  background-position: 0 0, 0 calc(var(--line) * 2);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 2px 0 var(--paper-edge), 0 3px 0 rgba(74, 35, 14, .3), 0 14px 22px -10px rgba(47, 21, 7, .55);
  padding: 0 18px 12px;
  color: var(--pen-blue);
  font-family: var(--f-hand);
  font-size: 24px;
  line-height: var(--line);
}
.ficha .ln { min-height: var(--line); line-height: var(--line); display: flex; align-items: baseline; gap: 8px; }
.ficha .ln.top { height: calc(var(--line) * 2); align-items: center; }
.ficha .red-ink { color: var(--pen-red); }
.ficha .sans { font-family: var(--f-body); font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.ficha .num { font-family: var(--f-hand); font-weight: 700; color: var(--pen-red); white-space: nowrap; }
.ficha .sep { flex: 1; }

.ficha-head { display: flex; align-items: center; gap: 10px; height: calc(var(--line) * 2); }
.ficha-head img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.ficha-head .nm { font-family: var(--f-display); font-size: 17px; color: var(--ink); line-height: 1.05; }
.ficha-head .nm small { display: block; font-family: var(--f-body); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.ficha-head .stamp { margin-left: auto; }

.ficha .who { color: var(--pen-red); font-weight: 700; }
.ficha .grp-h { margin-top: 0; }
.ficha .item { display: flex; align-items: flex-start; gap: 8px; min-height: var(--line); }
.ficha .item .bul { flex: none; width: 22px; text-align: center; }
.ficha .item .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ficha .item .txt small { font-family: var(--f-body); font-size: 14px; font-weight: 700; color: var(--ink-soft); margin-right: 4px; }
.ficha .item .txt em { color: var(--pen-red); font-style: normal; }
.ficha .item .qty { color: var(--pen-red); font-weight: 700; white-space: nowrap; }
.ficha .item .val { color: var(--pen-red); font-weight: 700; white-space: nowrap; min-width: 64px; text-align: right; }
.ficha .item.done .txt { text-decoration: line-through; text-decoration-color: rgba(39, 55, 154, .45); text-decoration-thickness: 2px; }

.chk {
  flex: none; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: var(--pen-blue);
  display: inline-grid; place-items: center; position: relative; top: 0;
}
.chk::before { content: ''; width: 18px; height: 18px; border: 2px solid var(--pen-blue); border-radius: 4px; background: rgba(255, 255, 255, .7); }
.chk svg { position: absolute; width: 30px; height: 30px; left: 0; top: -3px; opacity: 0; transform: scale(.6) rotate(-10deg); transition: opacity .12s, transform .16s; }
.chk[aria-pressed=true] svg { opacity: 1; transform: none; }
.chk[disabled] { cursor: default; }
.chk:not([disabled]):hover::before { background: #fff; box-shadow: 0 0 0 3px var(--sun); }

.ficha .total { font-size: 30px; }
.ficha .total b { color: var(--pen-red); }

/* carimbo de pagamento */
.stamp {
  display: inline-block; padding: 0 10px; line-height: 26px; font-family: var(--f-display); font-weight: 700; font-size: 16px;
  border: 3px double currentColor; border-radius: 6px; transform: rotate(-6deg);
  opacity: .92; mix-blend-mode: multiply; letter-spacing: .04em; white-space: nowrap;
}
.stamp.paid { color: #2f7a3d; }
.stamp.open { color: var(--pen-red); }
.stamp.slam { animation: slam .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes slam { from { transform: rotate(-6deg) scale(2.2); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: .92; } }

/* cartão da lista de pedidos */
.cards { display: grid; gap: 26px 22px; grid-template-columns: 1fr; padding-top: 4px; }
@media (min-width: 1100px) { .cards { grid-template-columns: 1fr 1fr; } }
.ocard { text-decoration: none; display: block; padding-bottom: 14px; transition: transform .15s ease; }
.ocard:hover { transform: translateY(-3px) rotate(-.25deg); }
.ocard .ln.top .cli { font-family: var(--f-hand); font-size: 29px; font-weight: 700; color: var(--pen-red); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocard .ln.top .stamp { margin-left: auto; }
.ocard .meta { font-family: var(--f-body); font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.ocard .more { color: var(--ink-soft); font-size: 20px; }
.ocard .foot { display: flex; align-items: baseline; gap: 10px; min-height: var(--line); }
.ocard .foot .tot { margin-left: auto; font-size: 30px; }
.prog { font-family: var(--f-body); font-size: 15px; font-weight: 700; color: var(--olive); }
.prog.zero { color: var(--ink-soft); }

.summary { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 14px; margin: 0 0 18px; background: var(--ink-dark); color: var(--paper); border-radius: 10px; }
.summary span { font-size: 16px; }
.summary b { font-family: var(--f-hand); font-size: 27px; font-weight: 700; color: var(--sun); margin-right: 4px; vertical-align: -2px; }

/* ---------- Blocos de formulário (papel liso) ---------- */

.sheet-card { background: var(--paper); border-radius: 12px; padding: 16px; margin-bottom: 16px; border: 2px solid var(--ink); box-shadow: 0 4px 0 rgba(74, 35, 14, .5); }
.sheet-card > h2 { margin-bottom: 12px; font-size: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.sugg { position: relative; }
.sugg ul { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 5; left: 0; right: 0; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 8px 0 rgba(74, 35, 14, .25); max-height: 260px; overflow-y: auto; }
.sugg li button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.sugg li button:hover, .sugg li button:focus-visible { background: var(--sun); }
.sugg li small { display: block; font-weight: 500; color: var(--ink-soft); }
.picked { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--olive-soft); border: 2px solid var(--olive); border-radius: 12px; }
.picked b { font-size: 19px; }

.lines { display: grid; gap: 10px; margin-bottom: 14px; }
.line-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; background: #fff; border: 2px solid #d4bd96; border-radius: 12px; }
.line-card .tx { font-weight: 600; overflow-wrap: anywhere; }
.line-card .tx small { color: var(--ink-soft); font-weight: 700; margin-right: 4px; }
.line-card .tx em { font-style: normal; color: var(--pen-red); font-weight: 700; }
.line-card .for { display: inline-block; background: var(--olive-soft); color: var(--olive); border-radius: 6px; padding: 0 8px; font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.line-card .pv { text-align: right; font-weight: 800; white-space: nowrap; }
.line-card .acts { grid-column: 1 / -1; display: flex; gap: 6px; justify-content: flex-end; border-top: 2px dotted #e0cfae; padding-top: 6px; }
.empty { text-align: center; padding: 26px 14px; border: 3px dashed rgba(74, 35, 14, .35); border-radius: 14px; color: var(--ink); background: rgba(255, 253, 244, .45); }
.empty h2 { margin-bottom: 6px; }
.empty p { margin: 0 0 14px; }

.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--ink-dark); color: var(--paper); border-top: 3px dashed rgba(242, 209, 79, .55);
}
.savebar .tt { font-size: 15px; line-height: 1.1; }
.savebar .tt b { display: block; font-family: var(--f-hand); font-size: 32px; color: var(--sun); line-height: 1; }
.savebar .btn { margin-left: auto; }
@media (min-width: 960px) { .savebar { left: var(--rail); } }

/* ---------- Diálogos ---------- */

dialog.sheet {
  border: 0; padding: 0; background: var(--paper); color: var(--ink);
  width: min(680px, 100%); max-width: 100%; max-height: 94vh; max-height: 94dvh;
  margin: auto auto 0; border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 0 var(--sun), 0 -10px 40px rgba(47, 21, 7, .5);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: rise .2s ease-out; }
dialog.sheet::backdrop { background: rgba(47, 21, 7, .62); }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 3px dashed rgba(74, 35, 14, .3); }
.sheet-head h2 { margin-right: auto; font-size: 21px; }
.sheet-body { padding: 14px 16px 6px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 3px dashed rgba(74, 35, 14, .3); background: var(--paper); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost { flex: 0 0 auto; }
@media (min-width: 720px) {
  dialog.sheet { margin: auto; border-radius: 18px; box-shadow: 0 0 0 3px var(--ink), 0 14px 0 rgba(47, 21, 7, .35); }
}

.group-t { margin: 16px 0 8px; font-size: 17px; }
.group-t:first-child { margin-top: 0; }
.build-list { display: grid; gap: 8px; margin: 6px 0 4px; padding: 10px; background: #fff; border: 2px solid #d4bd96; border-radius: 12px; }
.build-row { display: flex; align-items: center; gap: 8px; }
.build-row .nm { flex: 1; font-weight: 700; min-width: 0; }
.build-row input { width: 88px; text-align: right; font-weight: 700; }
.build-row .u { color: var(--ink-soft); font-weight: 700; }
.wsum { font-weight: 700; margin-top: 4px; }
.pricebox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pricebox input { width: 130px; font-weight: 800; font-size: 20px; }
.linkbtn { background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; color: var(--pen-blue); }

/* ---------- Tabelas simples (produção, cardápio) ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tabs .chip { min-height: 42px; }

.plist { list-style: none; margin: 0; padding: 0; display: grid; }
.plist li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 2px dotted #d4bd96; }
.plist li .n { font-weight: 700; flex: 1; min-width: 0; }
.plist li .q { font-family: var(--f-hand); font-size: 28px; font-weight: 700; color: var(--pen-red); min-width: 52px; text-align: right; line-height: 1; }
.plist li .g { color: var(--ink-soft); font-weight: 600; min-width: 74px; text-align: right; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

.clist { display: grid; gap: 10px; }
.crow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border: 2px solid #d4bd96; border-radius: 12px; }
.crow .nm { font-weight: 800; font-size: 19px; }
.crow .grow { cursor: pointer; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 14px; font-weight: 800; background: var(--olive-soft); color: var(--olive); border: 2px solid var(--olive); }
.badge.off { background: #eee; color: #777; border-color: #999; }
.badge.adm { background: var(--sun); color: var(--ink); border-color: var(--ink); }

details.cat { background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; margin-bottom: 14px; box-shadow: 0 4px 0 rgba(74, 35, 14, .5); }
details.cat > summary { cursor: pointer; padding: 14px 16px; font-family: var(--f-display); font-size: 20px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.cat > summary::-webkit-details-marker { display: none; }
details.cat > summary::before { content: '▸'; font-family: var(--f-body); transition: transform .15s; }
details.cat[open] > summary::before { transform: rotate(90deg); }
details.cat .cb { padding: 0 16px 16px; }
.mrow { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; padding: 10px 0; border-bottom: 2px dotted #d4bd96; }
.mrow .nums { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mrow .nums label { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
.mrow .nums input { width: 86px; min-height: 40px; padding: 4px 8px; text-align: right; }
.mrow input[type=checkbox], .ck { width: 24px; height: 24px; accent-color: var(--olive); }
.sizes { display: grid; gap: 8px; margin-bottom: 8px; }
.sizes .row input { width: 110px; }
.mbar { position: sticky; bottom: 0; z-index: 5; }

/* ---------- Avisos ---------- */

.toasts { position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 14px; }
@media (min-width: 960px) { .toasts { left: var(--rail); bottom: 28px; } }
.toast { background: var(--ink-dark); color: var(--paper); padding: 11px 18px; border-radius: 12px; font-weight: 700; border: 2px solid var(--sun); box-shadow: 0 6px 0 rgba(0, 0, 0, .25); animation: rise .2s ease-out; max-width: 520px; }
.toast.bad { border-color: #ff8a80; background: #5a1410; }

.loading { padding: 40px 0; text-align: center; font-family: var(--f-hand); font-size: 30px; color: var(--ink); }

/* ---------- Impressão: ficha em A5, sem menus ---------- */

#printBatch { display: none; }

@page { size: A5; margin: 8mm; }

@media print {
  html, body { background: #fff !important; }
  #app.shell { display: block; }
  .rail, .topbar, .bottomnav, .noprint, .savebar, .toasts, dialog, .page-head .btn, .summary { display: none !important; }
  main { padding: 0; max-width: none; }
  .ficha { box-shadow: none; border: 1px solid #b9c9dc; break-inside: avoid; margin: 0; }
  .chk { pointer-events: none; }
  .ficha .chk::before { background: #fff; }
  body.printing-batch #app { display: none !important; }
  body.printing-batch #printBatch { display: block; }
  body.printing-batch #printBatch .ficha { break-after: page; margin-bottom: 0; }
  body.printing-batch #printBatch .ficha:last-child { break-after: auto; }
  .stamp { mix-blend-mode: normal; }
  .print-card { box-shadow: none !important; border: 1px solid #999 !important; background: #fff !important; }
}

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

/* colunas do detalhe do pedido */
.detail-cols { display: grid; gap: 18px; }
@media (min-width: 900px) { .detail-cols { grid-template-columns: minmax(0, 580px) minmax(0, 1fr); align-items: start; } }
.chip-date { border-radius: 999px !important; width: auto !important; }
.back { display: inline-grid; }

.ficha .ln .bul { width: 22px; text-align: center; flex: none; }
#app.has-save .bottomnav { display: none; }
