:root {
  --bg: #fbf7f2; --card: #fff; --ink: #2b211c; --muted: #7b6d64; --line: #eadfd5;
  --brand: #7a2e1d; --brand-ink: #fff6ec; --soft: #f5ece3; --good: #2f7a3e; --bad: #b3261e; --warn-bg: #fff4d6;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: .4rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: .2rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.thin { font-weight: 400; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem; background: var(--brand); color: var(--brand-ink); }
.top a { color: var(--brand-ink); text-decoration: none; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.brand img { border-radius: 7px; border: 1px solid #ffffff55; }
#nav { display: flex; gap: .25rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
#nav a { padding: .35rem .65rem; border-radius: 999px; white-space: nowrap; opacity: .85; }
#nav a.on { background: #ffffff26; opacity: 1; }
.who { margin-left: auto; display: flex; gap: .75rem; align-items: center; white-space: nowrap; }
.who .link { color: var(--brand-ink); }

main { max-width: 960px; margin: 0 auto; padding: 1rem 1rem 7rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem; margin: 0 0 1rem; text-align: center; }
.card.left { text-align: left; }
.narrow { max-width: 420px; margin: 2rem auto; }
.logo { border-radius: 12px; }
label { display: block; text-align: left; font-size: .9rem; color: var(--muted); margin: 0 0 .75rem; }
label.inline { display: flex; align-items: center; gap: .5rem; font-size: 1rem; color: var(--ink); }
input, select, textarea { display: block; width: 100%; font: inherit; color: var(--ink); padding: .6rem .7rem; margin-top: .25rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
label.inline select { width: auto; margin: 0; font-weight: 600; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
button, .button { font: inherit; border: 0; border-radius: 10px; padding: .6rem 1rem; cursor: pointer; text-decoration: none; display: inline-block; }
button:disabled { opacity: .5; cursor: default; }
.primary { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.secondary { background: var(--soft); color: var(--ink); }
.link { background: none; padding: .2rem .3rem; color: var(--brand); }
.danger { color: var(--bad); }
.card.narrow .primary { width: 100%; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.row.wrap label { flex: 1 1 200px; margin: 0; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between select { width: auto; }
.warn { background: var(--warn-bg); border-radius: 10px; padding: .6rem .8rem; }
.good-note { background: #e5f4e8; border-radius: 10px; padding: .6rem .8rem; }
.pill { background: var(--warn-bg); color: #6b4a00; border-radius: 999px; padding: .1rem .5rem; font-size: .8rem; align-self: flex-start; }
.badge { border-radius: 999px; padding: .1rem .55rem; font-size: .8rem; background: var(--soft); white-space: nowrap; }
.badge.failed { background: #fde7e5; color: var(--bad); }
.code { color: var(--muted); font-size: .8rem; }
code { background: var(--soft); padding: .1rem .3rem; border-radius: 5px; word-break: break-all; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); min-height: 92px; }
.tile:hover { border-color: var(--brand); }
.tile b { font-size: 1.1rem; }

.crumbs { margin: 0; }
.crumbs a { text-decoration: none; }
input[type=search] { margin: 0 0 .75rem; }
.items { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.items .section { background: var(--soft); font-weight: 700; padding: .45rem .9rem; font-size: .9rem; }
.item { display: flex; align-items: center; gap: .75rem; padding: .55rem .9rem; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item.has { background: #fff8ee; }
.item.has .desc span:first-child { font-weight: 600; }
.item.off { opacity: .5; }
.desc { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.qty { display: flex; align-items: center; gap: .25rem; }
.qty input { width: 4.2rem; text-align: center; margin: 0; padding: .5rem .2rem; font-weight: 600; }
.step { width: 2.4rem; height: 2.4rem; padding: 0; border-radius: 50%; background: var(--soft); font-size: 1.2rem; line-height: 1; }
.note { margin-top: 1rem; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: .6rem; align-items: center; justify-content: flex-end; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px #0000000d; }
.bar #count { margin-right: auto; font-weight: 600; }

dialog.review { border: 0; border-radius: 16px; padding: 1.2rem; width: min(560px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
dialog.review::backdrop { background: #2b211c80; }
dialog table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; }
dialog td { padding: .4rem .3rem; border-top: 1px solid var(--line); vertical-align: top; }
dialog tfoot td { font-weight: 700; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num:first-child { font-weight: 700; width: 3.5rem; }
.big { font-size: 2.5rem; font-weight: 700; width: 4rem; height: 4rem; line-height: 4rem; border-radius: 50%; margin: .5rem auto; }
.big.good { background: #e5f4e8; color: var(--good); }
.big.bad { background: var(--warn-bg); color: #8a5a00; }

.tbl { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tbl table { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: .55rem .7rem; text-align: left; border-top: 1px solid var(--line); }
.tbl th { border-top: 0; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.tbl th.num, .tbl td.num { text-align: right; }
.orders tr[data-id] { cursor: pointer; }
.orders tr.failed td:first-child { box-shadow: inset 3px 0 var(--bad); }
.orders tr.detail > td { background: var(--soft); }
.lines { width: 100%; }
.lines td { border: 0 !important; padding: .2rem .4rem !important; }
.tbl tr.off td { color: var(--muted); }
td.acts { white-space: nowrap; text-align: right; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.tabs a { padding: .35rem .75rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.logins { list-style: none; padding: 0; margin: 0 0 .75rem; }
.logins li { padding: .35rem 0; border-top: 1px solid var(--line); }
.logins li:first-child { border-top: 0; }
details { margin-top: 1rem; }

#toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 2rem); z-index: 20; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: .4rem .75rem; padding: .5rem .75rem; }
  .brand span { display: none; }
  #nav { order: 3; flex-basis: 100%; }
  main { padding: .75rem .75rem 7rem; }
  h1 { font-size: 1.3rem; }
  .grid { grid-template-columns: 1fr 1fr; }
  .item { padding: .55rem .7rem; gap: .5rem; }
  .qty input { width: 3.4rem; }
  .bar .secondary { padding: .6rem .7rem; }
}

/* Users page */
fieldset.stores { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; margin: .5rem 0 .9rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
fieldset.stores legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
table.storegrid { border-collapse: collapse; width: auto; }
table.storegrid th { font-weight: 600; font-size: .85rem; color: var(--muted); text-align: center; padding: .2rem .9rem; }
table.storegrid th:first-child, table.storegrid td:first-child { text-align: left; padding-left: 0; }
table.storegrid td { text-align: center; padding: .35rem .9rem; border-top: 1px solid var(--line); }
table.storegrid input { width: 1.15rem; height: 1.15rem; margin: 0; }
label.check { display: flex; align-items: center; gap: .45rem; margin: 0; color: var(--ink); font-size: 1rem; }
label.check input { width: 1.15rem; height: 1.15rem; margin: 0; }
details.user summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
details.user[open] summary { margin-bottom: .8rem; }
details.user { margin-top: 0; }

/* Privacy, terms and disconnected pages */
.legal { max-width: 720px; margin: 1rem auto; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin: .35rem 0; }
.foot { text-align: center; padding: 0 1rem 6rem; }
.foot a { color: var(--muted); }

/* Menu under the name at the top right */
.menu-wrap { position: relative; }
#who { color: var(--brand-ink); padding: .3rem .2rem; font-size: 1rem; }
.usermenu { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px #0000001f; padding: .35rem; z-index: 30; display: flex; flex-direction: column; }
.usermenu a, .usermenu button { display: block; text-align: left; padding: .65rem .8rem; border-radius: 8px; color: var(--ink) !important; background: none; font-size: 1rem; text-decoration: none; }
.usermenu a:hover, .usermenu button:hover { background: var(--soft); }
.usermenu button { color: var(--bad) !important; }

/* Delivery date picker */
.datebar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; margin: .4rem 0 1rem; }
.datebar .dlabel { font-weight: 700; margin-right: .2rem; }
.datebar button { background: var(--soft); padding: .5rem .9rem; border-radius: 999px; font-weight: 600; }
.datebar button.on { background: var(--brand); color: var(--brand-ink); }
.datebar input[type=date] { width: auto; margin: 0; padding: .45rem .6rem; }
.datebar .dlong { flex-basis: 100%; color: var(--brand); }
.datebar .dlong::first-letter, .deliv b::first-letter { text-transform: uppercase; }
.deliv { margin: 0 0 .4rem; }
.deliv b { display: inline-block; }

/* Special orders */
.filters label { flex: 1 1 160px; margin: 0; }
.upload-btn { margin: .4rem .4rem .4rem 0; }
.up-list { list-style: none; padding: 0; margin: .6rem 0 0; }
.up-list li { padding: .35rem 0; border-top: 1px solid var(--line); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.orders tr.review td:first-child, .orders tr.reading td:first-child { box-shadow: inset 3px 0 #d9a400; }
.orders tr.invoiced td { color: var(--muted); }
.sp-review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.sp-review.nofile { grid-template-columns: minmax(0, 1fr); }
.sp-review .scan { position: sticky; top: 4.2rem; }
.sp-review .scan img, .sp-review .scan iframe { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sp-review .scan iframe { height: 80vh; }
.sp-review label.unsure input, .sp-review label.unsure textarea, fieldset.unsure, .item.unsure { background: var(--warn-bg) !important; }
.item.unsure input { border-color: #d9a400; }
.totals tr.sec td { background: var(--soft); font-weight: 700; }
.menu-ed input { margin: 0; min-width: 6rem; }
@media (max-width: 800px) { .sp-review { grid-template-columns: minmax(0, 1fr); } .sp-review .scan { position: static; } .sp-review .scan iframe { height: 60vh; } }
/* Delivery day calendar and time buttons */
.pickbox { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; margin: .4rem 0 .9rem; }
.pickbox .dlong { color: var(--brand); font-weight: 600; margin-left: .4rem; }
.pickbox .dlong::first-letter { text-transform: uppercase; }
.cal { max-width: 360px; margin-top: .5rem; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; }
.cal-head b { text-transform: capitalize; }
.cal-head .link { font-size: 1.5rem; padding: 0 .7rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem; text-align: center; }
.cal-grid i { font-style: normal; font-size: .8rem; color: var(--muted); text-transform: uppercase; }
.cal-grid button { padding: 0; height: 2.6rem; border-radius: 10px; background: var(--soft); font-weight: 600; position: relative; }
.cal-grid button:disabled { background: none; color: #c9bdb3; }
.cal-grid button.mark:not(:disabled)::after { content: ""; position: absolute; left: 50%; bottom: .3rem; width: .3rem; height: .3rem; margin-left: -.15rem; border-radius: 50%; background: var(--brand); }
.cal-grid button.on { background: var(--brand); color: var(--brand-ink); }
.cal-grid button.on::after { background: var(--brand-ink) !important; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.chips button { background: var(--soft); padding: .65rem 1.1rem; border-radius: 999px; font-weight: 600; }
.chips button.on { background: var(--brand); color: var(--brand-ink); }
label.narrowf { flex: 0 1 110px !important; }
/* Drop area for order sheets */
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 1.2rem; text-align: center; background: var(--bg); transition: background .15s, border-color .15s; }
.dropzone.over { border-color: var(--brand); background: #fff1e6; }
.dropzone p { margin: 0 0 .6rem; }
/* "A new version of the app is ready" bar */
.updatebar { position: fixed; left: 0; right: 0; top: 0; z-index: 50; display: flex; gap: .8rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .55rem 1rem; background: #1f6f4a; color: #fff; font-weight: 600; }
.updatebar button { background: #fff; color: #1f6f4a; padding: .4rem 1rem; border-radius: 999px; font-weight: 700; }
/* Lists of orders to check / confirm: one big row per order */
.olist { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.2rem; }
.orow { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.orow:hover, .orow:focus-visible { border-color: var(--brand); box-shadow: 0 2px 10px #7a2e1d1a; }
.orow .omain { flex: 1; display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.orow .omain b { font-size: 1.05rem; }
.orow .ogo { background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; white-space: nowrap; }
.badge.warnb { background: var(--warn-bg); color: #6b4a00; }
h2 .count { display: inline-block; min-width: 1.6rem; padding: 0 .45rem; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .85rem; text-align: center; vertical-align: middle; }
@media (max-width: 640px) { .orow { flex-wrap: wrap; } .orow .ogo { margin-left: auto; } }

/* Totals filters: an even grid (3 across, 2 on tablets, 1 on phones) */
.tfilters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem 1rem; margin-bottom: 1rem; }
.tfilters label { margin: 0; }
.tfilters input, .tfilters select { width: 100%; margin-top: .3rem; height: 2.75rem; box-sizing: border-box; }
.tactions { gap: .6rem; margin: 0 0 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.trange { font-weight: 600; margin: 0 0 .6rem; }
@media (max-width: 800px) { .tfilters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tfilters { grid-template-columns: 1fr; } }
/* Cake orders: size buttons + quantity per cake */
.csec { padding: .7rem .9rem; border-top: 1px solid var(--line); list-style: none; }
.csec .cname { font-weight: 700; margin-bottom: .4rem; }
.crow { display: flex; align-items: flex-start; gap: .6rem; margin: .3rem 0; } /* the quantity always stays on the right */
.crow .sizes { flex: 1 1 0; min-width: 0; } .crow .qty { flex: none; } .crow .qty input { width: 4.5rem; }
.crow.unsure { background: var(--warn-bg); border-radius: 8px; padding: .2rem .4rem; }
#t-other { width: auto; }
/* Zoom into an uploaded photo */
.zoombar { display: flex; gap: .4rem; justify-content: flex-end; margin-bottom: .4rem; } .zoombar button { padding: .3rem .9rem; font-size: 1.1rem; }
.zoomwrap { overflow: auto; max-height: 80vh; border-radius: 10px; cursor: zoom-in; } .zoomwrap.zoomed { cursor: zoom-out; }
.zoomwrap img { display: block; width: 100%; max-width: none; }
/* Cake orders: the custom cake */
fieldset.cake:disabled { opacity: .5; } fieldset.cake:not(:disabled) .cake-off { display: none; }
fieldset.cake { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; }
.cakegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem 1rem; margin-bottom: .6rem; }
.cakegrid label { margin: 0; }
.cakedl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem 1rem; margin: 1rem 0; }
.cakedl dt { font-size: .8rem; color: var(--muted); } .cakedl dd { margin: 0; font-weight: 600; }
.pp-cake .cakedl { font-size: calc(16pt * var(--k)); color: #000; } .pp-cake .cakedl dt { color: #333; }
/* A confirmed order opened again: just what was ordered */
.summary { max-width: 760px; margin: 0 auto; }
.sum-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .7rem 1.2rem; margin: 0 0 1rem; }
.sum-head dt { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sum-head dd { margin: .1rem 0 0; font-size: 1.1rem; font-weight: 600; }
.sum-notes { background: var(--soft); border-radius: 10px; padding: .6rem .8rem; }
.sum-items .sum-it { display: flex; gap: .8rem; padding: .55rem .9rem; border-top: 1px solid var(--line); font-size: 1.05rem; }
.sum-head .unsure, .sum-items .sum-it.unsure { background: var(--warn-bg); border-radius: 8px; }
#t-other { width: auto; margin: 0; }
.sum-items .sum-it b { min-width: 2.2rem; text-align: right; }
/* Printed orders: one per page, big letters for the carts. --k shrinks the item lines and --h the header so a big order still fits one sheet (set in printOrders). */
#print { display: none; color: #000; font-family: Arial, Helvetica, sans-serif; background: #fff; }
#print.measure { display: block; position: absolute; left: -10000px; top: 0; width: 7.5in; }
.pp { --k: 1; --h: 1; }
.pp-top { display: flex; flex-direction: column; align-items: center; border-bottom: 4px solid #000; padding-bottom: 8px; text-align: center; }
.pp-store { font-size: calc(40pt * var(--h)); font-weight: 800; text-transform: uppercase; }
.pp-no { font-size: calc(130pt * var(--h)); font-weight: 900; line-height: 1; white-space: nowrap; }
.pp-cancel { font-size: calc(40pt * var(--h)); font-weight: 900; color: #c00000; border: 6px solid #c00000; padding: 0 .3em; margin-top: 6px; }
.pp-name { font-size: calc(40pt * var(--h)); font-weight: 800; margin-top: calc(14px * var(--h)); line-height: 1.1; }
.pp-when { font-size: calc(28pt * var(--h)); font-weight: 700; margin-top: calc(10px * var(--h)); }
.pp-phone { font-size: calc(24pt * var(--h)); margin-top: 6px; }
.pp-items { margin-top: calc(18px * var(--k)); font-size: calc(24pt * var(--k)); line-height: 1.2; }
.pp-items.cols { column-count: 2; column-gap: 24px; }
.pp-items .it { display: flex; gap: .45em; border-top: 2px solid #000; padding: calc(6px * var(--k)) 8px; break-inside: avoid; }
.pp-items .it b { min-width: 1.6em; text-align: right; }
.pp-items .it.main span { color: #c00000; font-weight: 700; } /* Principales (the meats): the name in red, the number stays black */
#print { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-notes { font-size: calc(20pt * var(--k)); margin-top: 14px; border: 2px solid #000; padding: 8px; }
/* Kitchen sheet: one page per delivery day */
.kp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 4px solid #000; padding-bottom: 6px; }
.kp-top span { font-size: calc(26pt * var(--h)); font-weight: 700; text-transform: uppercase; }
.kp-top b { font-size: calc(34pt * var(--h)); font-weight: 900; text-align: right; }
.kp-sub { font-size: calc(14pt * var(--h)); margin: 6px 0 10px; }
.kp-items { width: 100%; border-collapse: collapse; font-size: calc(22pt * var(--k)); }
.kp-items th { font-size: calc(12pt * var(--k)); text-align: right; padding: 2px 8px; border-bottom: 2px solid #000; }
.kp-items td { border-top: 1px solid #000; padding: calc(5px * var(--k)) 8px; }
.kp-items .ks td { font-weight: 800; font-size: .7em; text-transform: uppercase; border-top: 3px solid #000; padding-top: calc(10px * var(--k)); }
.kp-items .kq { text-align: right; white-space: nowrap; font-weight: 900; width: 1%; }
.kp-items .kq.sm { font-weight: 600; font-size: .75em; color: #333; }
@media print {
  body > *:not(#print) { display: none !important; }
  body { background: #fff; margin: 0; }
  #print { display: block; }
  @page { size: letter portrait; margin: 0.5in; }
  .pp { break-after: page; page-break-after: always; break-inside: avoid; max-height: 10in; overflow: hidden; }
  .pp:last-child { break-after: auto; page-break-after: auto; }
}
