.jpo-portal{padding:24px 0;color:#e7edf9}.jpo-portal h1{margin:0;font-size:1.7rem}.jpo-portal header p{color:#acc4d9;margin:5px 0 16px}.jpo-tabs,.jpo-controls,.jpo-heading{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:16px 0}.jpo-heading{justify-content:space-between}.jpo-empty{padding:24px;border:1px solid #34516a;border-radius:14px;background:#0d2033;max-width:700px}.jpo-empty p{line-height:1.6}.jpo-empty input{display:block;width:100%;padding:12px;margin:8px 0 14px;background:#081727;color:white;border:1px solid #476c88;border-radius:8px}.jpo-controls label{font-size:.85rem}.jpo-controls select{width:210px}.jpo-list{display:grid;gap:12px}.jpo-order{display:grid;grid-template-columns:110px 1fr;gap:14px;background:#102033;border:1px solid #36516b;border-radius:12px;padding:16px;overflow-wrap:anywhere}.jpo-select{grid-column:1/-1;font-size:.8rem}.jpo-photo{width:100px;height:100px;border:1px dashed #637f99;border-radius:8px;background:#173349;color:#b9d6e8;padding:4px}.jpo-photo img{width:100%;height:100%;object-fit:contain}.jpo-order h3{margin:0 0 8px}.jpo-order p{margin:8px 0;font-size:.9rem}.jpo-order small{display:block;margin:5px 0}.jpo-order a{color:#81d5f4}.jpo-order details{margin-top:14px}.jpo-arrived{background:#d9efdd;color:#193b27}.jpo-delivered{background:#ffe0bf;color:#51321d}.jpo-arrived a,.jpo-delivered a{color:#114a79}.jpo-money{display:inline-block;padding:5px 10px;border-radius:20px;font-size:.85rem}.jpo-debt{background:#ffe0e0;color:#a32222}.jpo-credit{background:#d8eaff;color:#144e9a}.jpo-paid{background:#d5eedb;color:#1b6238}.jpo-annulled{text-decoration:line-through;opacity:.75}.jpo-zoom img{display:block;width:100%;max-height:70vh;object-fit:contain;margin-top:15px}.jpo-portal [hidden]{display:none!important}@media(max-width:600px){.jpo-tabs .btn{flex:1}.jpo-order{grid-template-columns:80px 1fr;padding:12px;gap:10px}.jpo-photo{width:76px;height:90px}.jpo-controls label,.jpo-controls select{width:100%}.jpo-empty{padding:16px}.jpo-order h3{font-size:1rem}}

#japanOrdersPortal:not([hidden]) + #japanBoxesPublic > .jp-heading{display:none}
/* Override global muted paragraph color on light logistics cards. */
.jpo-order.jpo-arrived p,.jpo-order.jpo-arrived small{color:#284c34}.jpo-order.jpo-delivered p,.jpo-order.jpo-delivered small{color:#654123}
/* Read-only customer ledger: one order per row, independent logistics/debt. */
.jpo-table-scroll{overflow:auto;max-width:100%;border:1px solid #36516b;border-radius:12px}.jpo-table{border-collapse:collapse;width:100%;min-width:1120px;font-size:.86rem}.jpo-table th{padding:12px 10px;text-align:left;white-space:nowrap;background:#172c44;color:#c2d7ee}.jpo-table .jpo-order{display:table-row;border:0;border-radius:0;padding:0}.jpo-table td{padding:12px 10px;border-bottom:1px solid #57718a55;vertical-align:middle}.jpo-table td:nth-child(3){min-width:190px;max-width:260px;overflow-wrap:anywhere}.jpo-table td:last-child{min-width:180px;max-width:270px}.jpo-table .jpo-photo{width:84px;height:84px}.jpo-table h3{font-size:.9rem;margin:0 0 8px}.jpo-table small{display:block;line-height:1.5;margin-top:6px;font-size:.74rem}.jpo-table .jpo-money{white-space:nowrap}.jpo-table .jpo-abono{background:#c7ecd2;color:#125731}.jpo-table .jpo-status{display:inline-block;border:1px solid currentColor;border-radius:18px;padding:4px 9px;font-size:.78rem;white-space:nowrap}.jpo-table details{min-width:155px;max-width:260px;margin-top:8px}.jpo-table .jpo-movement{border-top:1px solid #7d92a866;padding:5px 0}.jpo-table input[type=checkbox]{width:19px;height:19px;accent-color:#48cdb8}.jpo-table td:first-child{text-align:center}.jpo-table-scroll:focus-visible{outline:2px solid #58e5d1;outline-offset:3px}
.jpo-table{min-width:1270px}.jpo-table td:nth-child(4){min-width:125px}.jpo-table td:nth-child(7){min-width:145px}.jpo-table td:nth-child(8){min-width:145px}.jpo-cost{white-space:nowrap;font-weight:650}.jpo-table td small{overflow-wrap:normal}.jpo-table .jpo-movement small{overflow-wrap:anywhere}
/* Cancellation is visible and non-destructive; financial history remains readable. */
.jpo-table .jpo-order.jpo-cancelled{background:#f8cece;color:#651d27}.jpo-order.jpo-cancelled p,.jpo-order.jpo-cancelled small{color:#742b35}.jpo-order.jpo-cancelled a{color:#5d1834}.jpo-order.jpo-cancelled .jpo-status{background:#a42336;color:#fff;border-color:#8a1729}.jpo-order.jpo-cancelled td{border-bottom-color:#c58e95}
/* Customer-owned available balance stays separate from per-order debt/credit. */
.jpo-wallet{margin:18px 0;padding:18px;border:1px solid #487b9d;border-radius:12px;background:#10283f;color:#e7f4ff}.jpo-wallet-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}.jpo-wallet h2{font-size:1rem;margin:0 0 6px}.jpo-wallet-balance{display:block;font-size:1.6rem;color:#a8ddff}.jpo-wallet-heading p{max-width:450px;margin:0;color:#b9d0e4;font-size:.84rem;line-height:1.5}.jpo-wallet-history{margin-top:14px}.jpo-wallet-history summary{cursor:pointer;color:#c3e2fb;font-size:.86rem}.jpo-wallet-scroll{max-width:100%;overflow:auto;margin-top:12px}.jpo-wallet table{width:100%;min-width:460px;border-collapse:collapse;font-size:.84rem}.jpo-wallet th,.jpo-wallet td{padding:10px;text-align:left;border-bottom:1px solid #3c607b;vertical-align:top}.jpo-wallet th{color:#b7d7ef;background:#112f49}.jpo-wallet td:first-child{white-space:nowrap}.jpo-wallet td:last-child{white-space:nowrap}.jpo-wallet small{display:block;margin-top:5px;line-height:1.5;color:#b9cfe1;overflow-wrap:anywhere}.jpo-wallet-in{color:#8de5bd}.jpo-wallet-out{color:#b6d6ff}.jpo-wallet-reversed td>strong,.jpo-wallet-reversed td>span,.jpo-wallet-reversed td>strong+small{ text-decoration:line-through}.jpo-wallet-reversed{opacity:.8}.jpo-wallet .jpo-wallet-reversal{color:#f4c99e;font-weight:650;text-decoration:none}.jpo-wallet-scroll:focus-visible{outline:2px solid #58e5d1;outline-offset:2px}@media(max-width:600px){.jpo-wallet{padding:14px}.jpo-wallet-heading{align-items:flex-start;flex-direction:column;gap:10px}.jpo-wallet-balance{font-size:1.45rem}}

/* Mobile keeps the same ledger rows: explicit navigation, no hidden financial columns. */
.jpo-heading-actions,.jpo-column-nav{display:flex;flex-wrap:wrap;gap:8px}.jpo-heading-actions .btn,.jpo-column-nav .btn{min-height:44px}.jpo-table-tools{scroll-margin-top:16px;margin:12px 0 6px}.jpo-table-tools p{margin:0 0 8px;color:#bdd7ed;font-size:.85rem}.jpo-column-nav{gap:6px}.jpo-column-nav .btn{font-size:.82rem;padding:10px 12px}.jpo-jump{display:none}.jpo-portal [data-photo-status]:empty{display:none}.jpo-table summary{min-height:44px;cursor:pointer;display:list-item;padding:10px 0}.jpo-table-scroll{overscroll-behavior-x:contain}.jpo-table input[type=checkbox]{margin:12px}.jpo-portal [data-show-all]{min-height:44px}
@media(max-width:600px){.jpo-jump{display:inline-flex}.jpo-heading{margin:10px 0;gap:8px}.jpo-heading h2{font-size:1.1rem;margin:0 0 4px}.jpo-heading-actions{width:100%}.jpo-heading-actions .btn{flex:1}.jpo-wallet{margin:10px 0;padding:12px}.jpo-wallet-heading{gap:6px}.jpo-wallet-heading p{font-size:.78rem;line-height:1.4}.jpo-wallet-history{margin-top:8px}.jpo-controls{gap:8px;margin:10px 0}.jpo-controls select{min-height:44px;font-size:16px}.jpo-column-nav .btn{flex:1;padding:10px 7px}.jpo-table-tools p{font-size:.78rem}.jpo-wallet-history summary{padding:5px 0;min-height:36px}}

.jpo-shipping{display:inline-block;font-size:12px;font-weight:700;padding:4px 8px;border-radius:12px;background:#153446;color:#d9edf4;margin:3px 0 6px}.jpo-arrival-estimate{max-width:180px;white-space:normal}

/* Customer wallet actions keep the existing order table and mobile structure. */
.jpo-wallet-actions,.jpo-wallet-credit{margin:12px 0;padding:16px;border:1px solid #487b9d;border-radius:12px;background:#10283f;color:#e7f4ff;overflow-wrap:anywhere}.jpo-wallet-credit{border-color:#55b7a7;background:#102d35}.jpo-wallet-actions h2,.jpo-wallet-credit h2{font-size:1rem;margin:0 0 10px}.jpo-wallet-actions p,.jpo-wallet-credit p{font-size:.84rem;line-height:1.5;color:#bfd7e6}.jpo-wallet-actions form{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.jpo-wallet-actions label{display:flex;flex-direction:column;gap:6px;min-width:0;max-width:100%}.jpo-wallet-actions select{max-width:100%;width:320px}.jpo-wallet-actions input{width:160px;max-width:100%}.jpo-wallet-actions input,.jpo-wallet-actions select,.jpo-wallet-actions button,.jpo-wallet-credit button{min-height:44px}.jpo-wallet-credit details{margin:10px 0}.jpo-wallet-credit summary{cursor:pointer;min-height:44px;padding:10px 0}.jpo-wallet-credit ul{list-style:none;padding:0;margin:0;max-height:260px;overflow:auto}.jpo-wallet-credit li{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #39626b}.jpo-wallet-credit li strong{white-space:nowrap}.jpo-wallet-actions :focus-visible,.jpo-wallet-credit :focus-visible{outline:2px solid #58e5d1;outline-offset:2px}@media(max-width:600px){.jpo-wallet-actions,.jpo-wallet-credit{padding:12px}.jpo-wallet-actions form{display:grid;grid-template-columns:minmax(0,1fr)}.jpo-wallet-actions label,.jpo-wallet-actions select,.jpo-wallet-actions input{width:100%;box-sizing:border-box;font-size:16px}.jpo-wallet-actions button,.jpo-wallet-credit button{width:100%;margin:4px 0}}

.jpo-table .jpo-article-text{display:block;margin-top:6px;font-size:1rem;line-height:1.45;overflow-wrap:anywhere;color:inherit}

.jpo-wallet-actions .jpo-wallet-payment-summary{flex-basis:100%;margin:0;line-height:1.6}.jpo-wallet-actions [data-wallet-max]{white-space:nowrap}

.jpo-wallet-review-details{list-style:none;padding:0;margin:12px 0}.jpo-wallet-review-details li{display:flex;justify-content:space-between;gap:12px;padding:8px 0;border-bottom:1px solid #39626b}.jpo-wallet-review-details span{min-width:0;overflow-wrap:anywhere}.jpo-wallet-review-details strong{white-space:nowrap}

.jpo-coupon {font-size:.8rem;margin-top:.25rem;}
.jpo-coupon summary {cursor:pointer;color:#25664b;}

/* Abonos stay compact; their panel lives in the browser top layer, outside table overflow. */
.order-abonos-toggle{font:inherit;font-weight:700;color:#137d56;background:transparent;border:1px solid currentColor;border-radius:8px;min-height:44px;padding:6px 10px;white-space:nowrap;cursor:pointer}.order-abonos-toggle:focus-visible{outline:3px solid #398ceb;outline-offset:2px}.order-abonos-panel{position:fixed;inset:auto;margin:0;box-sizing:border-box;max-width:calc(100vw - 24px);overflow:auto;padding:16px;border:1px solid #54777c;border-radius:12px;background:#fff;color:#17363b;box-shadow:0 8px 32px #0004;font:16px/1.5 system-ui;white-space:normal}.order-abonos-panel header,.order-abonos-panel li{display:flex;justify-content:space-between;gap:12px}.order-abonos-panel header>strong,.order-abonos-panel li>span{min-width:0;overflow-wrap:anywhere}.order-abonos-panel button{min-width:44px;min-height:44px;font:inherit;cursor:pointer;flex-shrink:0}.order-abonos-panel ul{list-style:none;padding:0;margin:12px 0}.order-abonos-panel li{padding:8px 0;border-bottom:1px solid #d5e2e5}.order-abonos-panel li>strong{white-space:nowrap}.order-abonos-panel small{display:block;font-size:14px;color:#476167}.order-abonos-panel footer{margin-bottom:8px}.order-abonos-panel::backdrop{background:#0003}

/* Per-order payment stays in a compact top-layer dialog, never inside a table row. */
.jpo-wallet-order-pay{display:block;margin-top:8px;min-height:44px;white-space:nowrap}.jpo-wallet-panel{box-sizing:border-box;width:420px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);overflow:auto;border:1px solid #487b9d;border-radius:14px;padding:20px;background:#10283f;color:#e7f4ff;box-shadow:0 16px 48px #0006}.jpo-wallet-panel::backdrop{background:#0008}.jpo-wallet-panel h2{font-size:1.15rem;margin:0}.jpo-wallet-panel p{font-size:.9rem;line-height:1.5;color:#d0e4f0}.jpo-wallet-panel label{display:flex;flex-direction:column;gap:6px}.jpo-wallet-panel input{box-sizing:border-box;width:100%;min-height:44px;font-size:16px}.jpo-wallet-panel button{min-height:44px}.jpo-wallet-percentages{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.jpo-wallet-percentages button{font-size:.8rem}.jpo-wallet-panel .jpo-wallet-weight-note{font-size:.8rem;color:#f0d5a6;border-top:1px solid #487b9d;padding-top:10px}.jpo-wallet-panel [aria-invalid=true]{border-color:#f19d9d}.jpo-wallet-panel :focus-visible{outline:2px solid #58e5d1;outline-offset:2px}.jpo-wallet-panel [hidden]{display:none!important}

.order-abonos-panel [hidden]{display:none!important}.order-abonos-panel [data-abonos-history-toggle]{margin-top:10px;max-width:100%;white-space:normal}.order-abonos-panel [data-abonos-history]{overflow-wrap:anywhere}.order-abonos-panel .jpo-movement{padding:8px 0;border-bottom:1px solid #d5e2e5}.order-abonos-panel .jpo-movement p{margin:0 0 4px}.order-abonos-panel .jpo-annulled{color:#647176}
/* The history popover has a light surface, independent of the surrounding dark table. */
dialog.order-abonos-panel [data-abonos-history],dialog.order-abonos-panel [data-abonos-history] p{color:#17363b}
dialog.order-abonos-panel [data-abonos-history] .jpo-movement small{color:#476167}
dialog.order-abonos-panel [data-abonos-history] .jpo-annulled{color:#476167;opacity:1}

/* One transitional previous-weight debt, separate from article logistics. */
.jpo-table .jpo-legacy-weight{background:#203044;color:#f6e5bf}.jpo-table .jpo-legacy-weight small{color:#e1d3b6}

/* Match the admin ledger without moving financial columns or changing amounts. */
.jpo-table{--order-cost:#7dd3fc;--order-payment:#6ee7a0;--order-debt:#ff8c94;--order-credit:#86c5ff;--order-neutral:#d5dce7;--order-adjustment:#67e8f9;--order-muted:#bac6d6}
.jpo-table .jpo-arrived,.jpo-table .jpo-delivered,.jpo-table .jpo-cancelled{--order-cost:#075f80;--order-payment:#146c43;--order-debt:#b42332;--order-credit:#1558a6;--order-neutral:#425466;--order-adjustment:#09626f;--order-muted:#52606d}
.jpo-table .jpo-cost{display:block;white-space:nowrap;font-size:inherit;font-weight:800;color:var(--order-cost)}
.jpo-table .jpo-money{padding:0;border:0;border-radius:0;background:transparent;font-size:inherit;font-weight:800}
.jpo-table .jpo-money.jpo-debt{color:var(--order-debt)}
.jpo-table .jpo-money.jpo-credit{color:var(--order-credit)}
.jpo-table .jpo-money.jpo-paid{color:var(--order-neutral)}
.jpo-table .order-abonos-toggle,.jpo-table .order-abonos-zero{font-weight:800;color:var(--order-payment)}
.jpo-table .order-abonos-toggle{padding:6px 11px;border:0;border-radius:0;background:transparent;min-height:44px}
.jpo-table td .jpo-weight{font-weight:600}
.jpo-table td .jpo-weight.jpo-weight-amount{color:var(--order-adjustment)}
.jpo-table td .jpo-weight.jpo-weight-pending{color:var(--order-muted)}
.jpo-table .jpo-coupon{min-width:0;font-size:.72rem;margin-top:4px}
.jpo-table .jpo-coupon summary{color:var(--order-muted);font-weight:500}

/* Fixed, read-only selection bubble: never captures clicks or enters table scroll. */
.jpo-selection-summary{position:fixed;right:calc(20px + env(safe-area-inset-right,0px));bottom:calc(20px + env(safe-area-inset-bottom,0px));z-index:4;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;width:320px;max-width:calc(100vw - 24px);padding:12px 18px;border:1px solid #577b96;border-radius:24px;background:#10283cf5;color:#e7edf9;box-shadow:0 5px 20px #0005;overflow-wrap:anywhere;pointer-events:none}
.jpo-selection-summary span{display:block;font-size:.75rem;line-height:1.35;color:#c6d7e6}
.jpo-selection-summary strong{display:block;margin-top:3px;font-size:1.15rem;line-height:1.3;font-variant-numeric:tabular-nums}
.jpo-selection-summary .jpo-selection-debt{border-left:1px solid #577b96;padding-left:16px}
.jpo-selection-summary .jpo-selection-debt strong{color:#ffb7bd}
/* Reserve an unobstructed end position for pagination and the last order. */
.jpo-portal:has(.jpo-selection-summary:not([hidden])){padding-bottom:calc(120px + env(safe-area-inset-bottom,0px))}
html:has(.jpo-portal:not([hidden]) .jpo-selection-summary:not([hidden])){scroll-padding-bottom:calc(120px + env(safe-area-inset-bottom,0px))}
/* Payment/photo dialogs, history popovers and transient notices take precedence. */
body:has(dialog[open]) .jpo-selection-summary,body:has(.order-abonos-toggle[aria-expanded="true"]) .jpo-selection-summary,body:has(#toast:not(:empty)) .jpo-selection-summary{visibility:hidden}
@media(max-width:600px){.jpo-selection-summary{left:50%;right:auto;transform:translateX(-50%);bottom:calc(12px + env(safe-area-inset-bottom,0px));width:304px;gap:12px;padding:11px 15px}.jpo-selection-summary .jpo-selection-debt{padding-left:12px}}
