.order-portal {
  --op-ink: #f5f8fa;
  --op-sub: #c6d0d5;
  --op-line: #59656e;
  --op-acid: #d9ff91;
  color-scheme: dark;
  width: min(600px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(88dvh, 860px);
  padding: 0;
  color: var(--op-ink);
  background: radial-gradient(ellipse at 95% 0%, #38454e, transparent 46%), #141b20;
  border: 1px solid #81909a;
  border-radius: 20px;
  box-shadow: inset 0 1px #c8d9e140, 0 26px 90px #050709ad;
  font: inherit;
  text-align: start;
  overscroll-behavior: contain;
}
.order-portal[open] { display: flex; flex-direction: column; overflow: hidden; }
.order-portal::backdrop { background: #0b1118bb; backdrop-filter: blur(5px); }
body:has(.order-portal[open]) { overflow: hidden; }
.op-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--op-line);
  padding: 16px clamp(16px, 4vw, 30px);
  box-shadow: inset 0 -1px #0d101699;
}
.op-head h2 {
  min-width: 0;
  color: var(--op-ink);
  margin: 0;
  font-size: clamp(1.3rem, 3.4vw, 1.85rem);
  font-weight: 800;
  line-height: 1.55;
}
.op-head h2:focus { outline: 0; }
.op-content {
  display: grid;
  gap: 18px;
  min-height: 0;
  align-content: start;
  padding: 22px clamp(16px, 4vw, 30px) max(24px, env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
}
.order-portal [hidden] { display: none !important; }
.order-portal form, .op-content p { margin: 0; }
.op-message {
  background: #352626;
  border-inline-start: 3px solid #ffc78b;
  padding: 9px 13px;
  margin: 10px clamp(16px, 4vw, 30px) 0;
  max-height: 28dvh;
  overflow-y: auto;
  color: #fff2e5;
  font-size: .95rem;
}
.op-message p { margin: 0; }
.op-message .op-link { color: #e9ffa7; }
.op-content .op-note {
  color: var(--op-sub);
  font-size: .98rem;
  line-height: 1.7;
}
.op-button, .op-link {
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}
.op-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  min-height: 44px;
  padding: .45rem 1rem;
  max-width: 100%;
  line-height: 1.5;
  border: 1px solid #65737b;
  border-radius: 12px;
  font-weight: 700;
  color: #edf3f6;
  background: linear-gradient(145deg,#3c4a55,#29323a);
  box-shadow: inset 0 1px #d6e7f228, 0 2px #0d1217;
}
.op-button:active { translate: 0 1px; }
.op-button:disabled { opacity: .65; cursor: progress; }
.op-primary {
  color: #1d280d;
  border-color: #d9f8a8;
  background: linear-gradient(160deg,#e6ffac,#b8e76b);
  box-shadow: 0 2px #728e45, inset 0 1px #f8ffdf;
}
.op-quiet {
  width: fit-content;
  padding-inline: .15rem;
  color: var(--op-acid);
  background: none;
  border-color: transparent;
  box-shadow: none;
}
.op-close {
  flex: 0 0 44px;
  border-radius: 50%;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font: 400 1.6rem/1 var(--latin);
}
.order-portal :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--op-acid);
  outline-offset: 3px;
}
.op-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  width: fit-content;
  color: var(--op-acid);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.op-nav, .op-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  min-width: 0;
}
.op-nav {
  border-bottom: 1px solid #52616b;
  padding-bottom: 9px;
}
.op-nav .op-button { color: #cad5da; font-size: .9rem; }
.op-nav .op-button[aria-current] {
  color: var(--op-acid);
  box-shadow: inset 0 -2px var(--op-acid);
  border-radius: 0;
}
.op-tools { justify-content: space-between; align-items: end; }
.op-tools .op-field { flex: 1 1 10rem; }
.op-tools .op-button { align-self: end; }
.op-field, .op-stack, .op-list, .op-place, .op-geo {
  display: grid;
  min-width: 0;
}
.op-field { gap: 4px; }
.op-stack { gap: 15px; }
.op-list { gap: 10px; }
.op-field > span, .op-geo legend { font-size: .95rem; font-weight: 700; }
.order-portal :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 47px;
  padding: 8px 11px;
  margin: 0;
  border: 1px solid #798891;
  border-radius: 9px;
  color: #f6f8fc;
  background: #12191e;
  font: inherit;
  font-size: max(16px, 1rem);
  line-height: 1.5;
}
.order-portal textarea { resize: vertical; }
.order-portal select { padding-inline-end: 12px; }
.order-portal input::placeholder { color: #9aaab4; }
/* Keep the contact choice compact beside its single active identity field. */
.op-identity {
  display: grid; gap: .5rem; min-inline-size: 0; margin: 0; border: 0; padding: 0;
}
.op-identity legend { padding: 0; font-size: .95rem; font-weight: 700; }
.op-identity-options { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.op-identity-options label { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; cursor: pointer; }
.op-identity-options input { margin: 0; inline-size: 1.1rem; block-size: 1.1rem; accent-color: var(--op-acid); }
.op-profile bdi,.op-team-member bdi,.op-contact { min-width: 0; overflow-wrap: anywhere; }
.op-geo {
  padding: 12px;
  margin: 0;
  border: 1px solid #67757e;
  border-radius: 12px;
  gap: 12px;
}
.op-geo legend { padding-inline: 7px; }
.op-geo > .op-button { justify-self: start; }
.op-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.op-pin, .op-check, .op-status-form, .op-push, .op-order-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 12px;
}
.op-pin:empty { display: none; }
.op-check { flex-wrap: nowrap; align-items: start; font-size: .95rem; }
.op-check input { width: 1.2rem; height: 1.2rem; flex: 0 0 1.2rem; margin: .3rem 0 0; accent-color: #c4f183; }
.op-block, .op-summary, .op-order {
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid #596771;
  border-radius: 12px;
  background: linear-gradient(145deg, #2a353d, #1b242c);
  box-shadow: inset 0 1px #d0e4ed23, 0 2px #0d1318;
}
.op-place { gap: 1px; }
.op-place p { margin: 0; color: var(--op-sub); }
.op-items {
  margin: 0;
  padding: 0;
  list-style: none;
}
.op-items li, .op-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 14px;
  align-items: baseline;
  padding-block: 7px;
}
.op-items li + li, .op-total { border-top: 1px solid #586671; }
.op-items b, .op-items small { display: block; }
.op-items small { color: var(--op-sub); font-size: .86rem; }
.op-total strong { color: var(--op-acid); }
.op-order { padding: 0; }
.op-order > summary { display: flex; min-height: 58px; padding: 12px; gap: 12px; }
.op-order > summary::after { flex: 0 0 12px; height: 12px; }
.op-order-heading { justify-content: start; }
.op-order-heading time { font-size: .86rem; color: var(--op-sub); }
.op-order-id { overflow-wrap: anywhere; font: 600 .9rem/1.4 var(--latin); }
.op-badge { border: 1px solid #75816b; color: #dcf5ae; border-radius: 9px; padding: .1rem .5rem; font-size: .84rem; }
.op-detail { display: grid; min-width: 0; gap: 11px; padding: 0 13px 14px; }
.op-detail .op-summary { box-shadow: none; background: #192127; border-color: #495660; }
.op-detail p { padding: 0; }
.op-status-form .op-button { align-self: end; }
.op-push:has(button[hidden]):has(p:empty) { display:none; }
.op-push .op-note { flex: 1 1 12rem; }
@media (max-width: 560px) {
  .order-portal {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-height: 92dvh;
    border-radius: 17px 17px 0 0;
  }
  .op-content { gap: 14px; }
  .op-nav { gap: 3px 9px; }
}
@media (max-height: 440px) {
  .order-portal[open] { display: block; overflow-y: auto; }
  .op-content { overflow: visible; }
}
.op-geo .op-province-match { color: var(--op-ink); }
.op-geo .op-boundary-credit { min-height: 28px; color: var(--op-sub); font-size: .86rem; }

/* Carton ordering: editable quantities, price-per-carton and the amount for each line. */
#cart-dialog {
  --cart-ink: #f4f8fa;
  --cart-soft: #c1cbd1;
  --cart-edge: #53616b;
  --cart-acid: #d2fc82;
  background: radial-gradient(ellipse at 80% 0%, #344149, transparent 45%), #151c21;
  color: var(--cart-ink);
  border-color: #73838c;
  width: min(490px,100vw);
  box-shadow: 0 14px 70px #0a111bb8;
}
#cart-dialog .cart-head {
  background: linear-gradient(135deg,#354249,#263138);
  border-top-color: var(--cart-acid);
  border-bottom: 1px solid var(--cart-edge);
  padding-inline: clamp(15px, 3vw, 24px);
}
#cart-dialog .cart-head h2 { color: var(--cart-ink); }
#cart-dialog :is(.cart-head p,#cart-empty,#cart-note,.cart-unit) { color: var(--cart-soft); }
#cart-dialog .cart-close {
  background: #243038;
  border-color: #6d7981;
  box-shadow: inset 0 1px #b1c0c937, 0 3px #11171c;
}
#cart-dialog .cart-body {
  background: transparent;
  padding: 15px clamp(12px,2.5vw,22px) 18px;
}
#cart-dialog #cart-empty { text-align: center; margin-block: 34px 8px; }
#cart-dialog .cart-browse {
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  min-height: 44px;
  margin-inline: auto;
  color: var(--cart-acid);
  text-decoration: underline;
  text-underline-offset: 4px;
}
#cart-dialog .cart-list { display: grid; gap: 10px; }
#cart-dialog .cart-row {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  grid-template-areas: "art info clear" "quantity quantity sum" "error error error";
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  padding: 12px 13px 5px;
  border: 1px solid #596770;
  border-radius: 13px;
  background: linear-gradient(140deg,#2f3a42,#20292f 72%);
  box-shadow: inset 0 1px #c8d6e01d,0 3px 10px #080d122e;
}
#cart-dialog .cart-art {
  grid-area: art;
  width: 52px;
  height: 67px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background:
    radial-gradient(ellipse at 50% 65%, color-mix(in srgb,var(--cart-color,#ccd1d5) 36%,transparent),transparent 70%),
    linear-gradient(155deg,#45515a,#222c32 70%);
  border: 1px solid #9aa4a640;
  overflow: hidden;
}
#cart-dialog .cart-poster {
  width: 39px;
  height: 60px;
  object-fit: contain;
  transform: rotate(-7deg);
  filter: drop-shadow(2px 3px 3px #060a0f80);
}
#cart-dialog .cart-product-info { grid-area: info; min-width: 0; }
#cart-dialog .cart-name {
  color: var(--cart-ink);
  font-size: 1.14rem;
  line-height: 1.23;
  overflow-wrap: anywhere;
}
#cart-dialog .cart-unit { margin: 4px 0 0; line-height: 1.45; font-size: .88rem; }
#cart-dialog .cart-remove {
  grid-area: clear;
  justify-self: end;
  align-self: start;
  min-height: 40px;
  border: 0;
  background: none;
  color: #c6d1d7;
  padding: 1px 2px;
  font: inherit;
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#cart-dialog .cart-remove:hover { color: #fff; }
#cart-dialog .cart-quantity {
  grid-area: quantity;
  justify-self: start;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  border: 1px solid #72818a;
  background: #151e25;
  box-shadow: 0 2px #111820;
}
#cart-dialog .cart-step {
  flex: none;
  width: 39px;
  height: 42px;
  border: 0;
  border-radius: 9px;
  background: #36434b;
  box-shadow: none;
  color: #f2f8ff;
  font-size: 1.2rem;
}
#cart-dialog .cart-step:hover { background: #46545d; }
#cart-dialog .cart-step:disabled { color: #88949d; cursor: default; }
#cart-dialog .cart-qty-value {
  width: 4.2ch;
  min-width: 46px;
  padding: 0 3px;
  text-align: center;
  margin: 0;
  color: var(--cart-ink);
  background: transparent;
  border: 0;
  font: 700 max(16px,1rem)/1.4 var(--latin);
  font-variant-numeric: tabular-nums;
  border-radius: 3px;
}
#cart-dialog .cart-qty-value[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #ffba8f; }
#cart-dialog .cart-line {
  grid-area: sum;
  text-align: end;
  display: grid;
  justify-items: end;
  gap: 2px;
  line-height: 1.45;
}
#cart-dialog .cart-line-label { color: var(--cart-soft); font-size: .82rem; }
#cart-dialog .cart-line-amount { color: #f7f9ed; font-size: 1rem; font-variant-numeric: tabular-nums; }
#cart-dialog .cart-quote-line .cart-line-amount { color: #f4d9a3; font-size: .91rem; }
#cart-dialog .cart-qty-error { grid-area: error; color: #ffd4b2; font-size: .94rem; padding-bottom: 8px; }
#cart-dialog .cart-footer {
  padding: 13px clamp(12px,2.5vw,22px) max(12px,env(safe-area-inset-bottom));
  border-top: 1px solid #65737c;
  background: linear-gradient(160deg,#2d3a42,#1c262e);
}
#cart-dialog .cart-total { color: var(--cart-ink); }
#cart-dialog .cart-total strong { color: var(--cart-acid); }
#cart-dialog #cart-quote {
  margin: 7px 0;
  padding-inline-start: 8px;
  border-inline-start: 2px solid #d5a75f;
  color: #f4d9a3;
}
#cart-dialog [data-nitro-order] {
  width: 100%;
  min-height: 49px;
  margin-top: 11px;
  color: #1e2b0e;
  background: linear-gradient(160deg,#e5ffa9,#b9e974);
  border: 1px solid #d6eea8;
  border-radius: 12px;
  box-shadow: inset 0 1px #f8ffd2,0 2px #59723a;
}
#cart-dialog [data-nitro-order]:is(:focus-visible,:hover):not(:disabled) { background: #e7ffb2; }
#cart-dialog [data-nitro-order]:disabled { opacity: .58; cursor: default; }
#cart-dialog #cart-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 4px 0 0;
  padding: 4px 10px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #e2ebf0;
  background: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}
#cart-dialog #cart-checkout[aria-disabled="true"] { opacity: .55; text-decoration: none; }
#cart-dialog #cart-note { margin-top: 0; line-height: 1.45; }
@media (max-width: 600px) {
  #cart-dialog { width: 100%; height: min(750px,92dvh); }
}
@media (max-width: 365px) {
  #cart-dialog .cart-row { grid-template-columns: 43px minmax(0,1fr) auto; column-gap: 7px; padding-inline: 9px; }
  #cart-dialog .cart-art { width: 43px; }
  #cart-dialog .cart-name { font-size: 1rem; }
  #cart-dialog .cart-step { width: 36px; }
}
@media (max-height: 470px) {
  #cart-dialog[open] { display: block; overflow-y: auto; }
  #cart-dialog .cart-body { overflow: visible; }
}

.order-portal[data-audience="staff"] {
  --op-acid: #b8efe7;
  background: radial-gradient(ellipse at 95% 0%,#25484b,transparent 49%),#142024;
}
.order-portal[data-audience="staff"] .op-primary {
  color: #092c27; border-color: #92d9c9;
  background: linear-gradient(150deg,#cdfff0,#8dd3c3);
  box-shadow: inset 0 1px #e9fff4,0 2px #467d70;
}
.op-doors {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  padding: 4px; border: 1px solid #5a7876; border-radius: .95rem; background: #10191b;
}
.op-door { min-width: 0; border: 0; color: #bdcecb; background: transparent; box-shadow: none; }
.op-door[aria-pressed="true"] { background: #e1f2d2; color: #1c2b20; box-shadow: inset 0 1px #fff; }
.order-portal[data-audience="staff"] .op-door[aria-pressed="true"] { background: #bfebdf; color: #162e2c; }
.op-profile { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .65rem .9rem; }
.op-profile h3 { margin: 0; font-size: 1.35rem; }
.op-profile > :is(.op-note,.op-field) { grid-column: 1/-1; }
.op-account-id { font: 500 .86rem/1.5 var(--latin) !important; }
.op-role,.op-unread { display: inline-flex; align-items: center; padding: .15rem .55rem; width: fit-content; border-radius: .45rem; font-size: .84rem; }
.op-role { color: #d0ebe3; background: #304642; }
.op-unread { background: #d5f695; color: #20320f; font-weight: 750; }
.op-team-actions,.op-thread-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.op-thread-bar { justify-content: space-between; }
.op-team-member { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .38rem .65rem; padding: .85rem; border-block-start: 1px solid #526b67; }
.op-team-member h3 { margin: 0; overflow-wrap: anywhere; }
.op-team-member > .op-button { grid-column: 1/-1; justify-self: start; }
.op-team-member bdi,.op-team-member .op-note { color: var(--op-sub); }
.op-provinces { display: grid; grid-template-columns: repeat(auto-fit,minmax(8rem,1fr)); gap: .28rem .65rem; margin: 0; padding: .6rem; border: 1px solid #607572; border-radius: .75rem; }
.op-provinces legend { padding-inline: .35rem; }
.op-provinces label { display: flex; align-items: center; min-height: 40px; padding-inline: .25rem; }
.op-provinces input { margin: 0; }
.op-alerts { border-block-start: 1px solid #4c615e; padding-block-start: .25rem; }
.op-alerts summary { padding: .5rem 0; min-height: 44px; cursor: pointer; }
.op-alerts .op-push { padding-block: .55rem; }
.op-order-heading { row-gap: .4rem; }
.op-order .op-order-heading { justify-content: start; }
.op-order .op-detail > .op-button { justify-self: start; }
.op-order .op-status-form { border-block: 1px solid #41555b; padding-block: .8rem; }
.op-order .op-status-form .op-field { flex: 1 1 12rem; }
.op-badge[data-status="delivered"] { color: #cdf3b9; border-color: #759177; }
.op-badge[data-status="cancelled"] { color: #ffcbc3; border-color: #ba8580; }
.op-badge[data-status="dispatched"] { color: #bbdffd; border-color: #739ab4; }
.op-conversation, .op-compose { display: grid; gap: .55rem; min-width: 0; }
.op-conversation { padding: .75rem; border: 1px solid #415958; border-radius: .9rem; background: #10191c; }
.op-conversation > button,.op-compose button { justify-self: start; }
.op-thread-status { color: #b7d9bd; font-size: .88rem; }
.op-thread-status:empty { display: none; }
.op-messages { display: flex; flex-direction: column; gap: .65rem; margin: 0; padding: .2rem; min-width: 0; max-height: min(38dvh,22rem); overflow-y: auto; overscroll-behavior: contain; list-style: none; }
.op-messages:empty { display: none; }
.op-bubble { align-self: flex-start; max-width: 91%; min-width: 0; padding: .56rem .75rem .62rem; border-radius: .73rem; color: #edf6f3; background: #293c40; }
.op-bubble.op-mine { align-self: flex-end; background: #344b38; }
.op-bubble p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.op-message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem; margin-block-end: .24rem; color: #c1d4ca; font-size: .76rem; }
.op-message-meta bdi { color: #f0f8ed; font-weight: 750; }
@media (max-width:365px) {
  .op-content { padding-inline: .7rem; }
  .op-team-member { grid-template-columns: 1fr; }
  .op-profile { grid-template-columns: 1fr; }
  .op-conversation { padding: .45rem; }
}

.op-order-row { display: grid; min-width: 0; gap: .26rem; }
.op-queue-region { color: #bfcec8; font-size: .87rem; line-height: 1.6; }

.op-copy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.op-copy-actions .op-note { margin: 0; }
.op-private-value { font-family: ui-monospace, monospace; }
.op-recovery,.op-qr { min-width: 0; }
.op-recovery summary,.op-qr summary { min-height: 44px; padding-block: .5rem; cursor: pointer; }
.op-qr canvas { display: block; width: min(100%, 16rem); height: auto; margin: .5rem auto; image-rendering: pixelated; }
.op-saved { display: flex; align-items: center; gap: .6rem; min-height: 44px; }
.op-saved input { flex: none; accent-color: var(--op-acid); }
