:root {
  --portal-navy: #06162c;
  --portal-navy-2: #0b203b;
  --portal-orange: #ff5a13;
  --portal-orange-dark: #d94708;
  --portal-teal: #079c9b;
  --portal-teal-soft: #e8f7f6;
  --portal-ink: #10233d;
  --portal-steel: #526276;
  --portal-rule: #d7dee6;
  --portal-mist: #f4f7f9;
  --portal-white: #fff;
  --portal-danger: #b42318;
  --portal-success: #067647;
  --head: "Barlow Condensed", Impact, sans-serif;
  --body: "Inter", Arial, sans-serif;
  --portal-shell: 1440px;
}

* { box-sizing: border-box; }
html { color: var(--portal-ink); background: var(--portal-white); font-family: var(--body); scroll-behavior: smooth; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid #f6b73c; outline-offset: 3px; }

.portal-skip { position: fixed; left: 12px; top: 12px; z-index: 200; transform: translateY(-180%); padding: .75rem 1rem; color: #07182f; background: #f6b73c; font-weight: 800; }
.portal-skip:focus { transform: none; }
.portal-body { min-height: 100vh; background: var(--portal-mist); }
.portal-header { position: sticky; top: 0; z-index: 100; display: grid; grid-template-columns: 300px 1fr auto; align-items: stretch; min-height: 82px; color: white; background: var(--portal-navy); border-bottom: 1px solid rgba(255,255,255,.15); }
.portal-logo { display: flex; align-items: center; margin: 9px 20px; padding: 0 8px; overflow: hidden; background: white; border-radius: 6px; }
.portal-logo img { width: 245px; height: 62px; object-fit: cover; object-position: center 42%; filter: brightness(1.45) contrast(1.12); }
.portal-nav { display: flex; justify-content: center; align-items: stretch; }
.portal-nav a { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 0 30px; border-inline-start: 1px solid rgba(255,255,255,.14); color: #f4f7fb; font: 700 1.05rem/1 var(--body); text-decoration: none; }
.portal-nav a:hover { background: rgba(255,255,255,.055); }
.portal-nav a.active { color: #52d4cf; background: rgba(7,156,155,.1); }
.portal-nav a.active::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: var(--portal-teal); }
.cart-count { display: grid; width: 24px; height: 24px; place-items: center; color: white; background: var(--portal-orange); border-radius: 50%; font-size: .76rem; }
.portal-account { display: flex; align-items: center; gap: 11px; min-width: 190px; padding: 0 28px; border: 0; border-left: 1px solid rgba(255,255,255,.14); color: white; background: transparent; font-weight: 700; cursor: pointer; }
.portal-account:hover { background: rgba(255,255,255,.055); }
.portal-nav-signout { display: none; min-height: 52px; padding: 0 18px; border: 0; border-top: 1px solid rgba(255,255,255,.12); color: white; background: transparent; font-weight: 800; text-align: left; }
.account-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; color: #5dd2cb; font-size: .72rem; }
.portal-menu { display: none; }
.portal-progress { position: fixed; top: 82px; left: 0; right: 0; z-index: 110; height: 3px; pointer-events: none; }
.portal-progress.loading { background: linear-gradient(90deg, transparent, var(--portal-teal), transparent); background-size: 55% 100%; animation: portal-progress 1.1s linear infinite; }
@keyframes portal-progress { from { background-position: -120% 0; } to { background-position: 220% 0; } }

.portal-main { width: min(100%, var(--portal-shell)); min-height: calc(100vh - 82px); margin: 0 auto; padding: 42px 40px 80px; background: white; }
.portal-main.auth-screen { display: grid; place-items: center; background: var(--portal-navy); }
.button-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; }
.button-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.portal-loading { min-height: 60vh; display: grid; place-items: center; align-content: center; gap: 18px; color: var(--portal-steel); }
.portal-loading span { width: 44px; height: 44px; border: 4px solid var(--portal-rule); border-top-color: var(--portal-orange); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.portal-noscript { max-width: 700px; margin: 2rem auto; padding: 1rem; background: #fff3cd; }

.portal-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.portal-heading-row h1, .builder-heading h1, .auth-copy h1 { margin: 0; color: var(--portal-navy); font: 800 clamp(2.65rem, 4vw, 4rem)/.95 var(--head); letter-spacing: -.02em; text-transform: uppercase; }
.portal-heading-row h1.normal-case { text-transform: none; }
.portal-heading-row p, .builder-heading p { max-width: 700px; margin: 10px 0 0; color: var(--portal-steel); line-height: 1.6; }
.heading-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.portal-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: .85rem 1.3rem; border: 2px solid transparent; border-radius: 5px; font-weight: 800; line-height: 1; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease, border .15s ease; }
.portal-button:hover { transform: translateY(-1px); }
.portal-button.primary { color: white; background: var(--portal-orange); }
.portal-button.primary:hover { background: var(--portal-orange-dark); }
.portal-button.secondary { color: var(--portal-teal); background: white; border-color: var(--portal-teal); }
.portal-button.ghost { color: var(--portal-navy); background: white; border-color: var(--portal-navy); }
.portal-button.small { min-height: 38px; padding: .55rem .9rem; font-size: .84rem; }
.portal-button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.portal-link-button { padding: 0; border: 0; color: #057f7f; background: none; font-weight: 800; text-decoration: underline; cursor: pointer; }

.portal-section { margin-top: 38px; }
.portal-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.portal-section-title h2, .cart-panel h2, .design-summary h2 { margin: 0; color: var(--portal-navy); font: 800 1.75rem/1 var(--head); }
.portal-section-title a { color: var(--portal-teal); font-weight: 800; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.dashboard-main { min-width: 0; }
.order-table-wrap { overflow-x: auto; border: 1px solid var(--portal-rule); border-radius: 6px; }
.order-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.order-table th, .order-table td { padding: 18px 20px; text-align: left; border-bottom: 1px solid var(--portal-rule); }
.order-table tr:last-child td { border-bottom: 0; }
.order-table th { color: var(--portal-ink); background: #fbfcfd; font: 800 .78rem/1 var(--body); text-transform: uppercase; letter-spacing: .05em; }
.order-number { color: #0867c4; font-weight: 800; }
.status-text { display: inline-flex; align-items: center; gap: 8px; color: var(--portal-success); font-weight: 700; text-transform: capitalize; }
.status-text::before { content: ""; width: 9px; height: 9px; background: currentColor; border-radius: 50%; }
.status-text.pending, .status-text.open, .status-text.submitted { color: #b54708; }
.status-text.canceled, .status-text.declined { color: var(--portal-danger); }

.quote-rail { position: sticky; top: 106px; border: 1px solid var(--portal-teal); border-radius: 6px; overflow: hidden; background: white; }
.quote-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--portal-rule); }
.quote-rail-head h2 { margin: 0; font: 800 1.55rem/1 var(--head); }
.quote-rail-list { list-style: none; padding: 0 20px; margin: 0; }
.quote-rail-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--portal-rule); }
.quote-rail-list strong { display: block; margin-bottom: 4px; }
.quote-rail-list span { color: var(--portal-steel); font-size: .84rem; }
.quote-rail-empty { padding: 24px 20px; color: var(--portal-steel); line-height: 1.5; }
.quote-rail-foot { padding: 18px 20px; background: var(--portal-mist); }
.quote-rail-foot .portal-button { width: 100%; }

.design-band { padding: 24px; color: white; background: var(--portal-navy); border-radius: 6px; }
.design-band > h2 { margin: 0; font: 800 2rem/1 var(--head); }
.design-band > p { margin: 7px 0 22px; color: #cbd6e2; }
.design-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.design-choice { display: grid; grid-template-columns: 132px 1fr; gap: 18px; min-height: 210px; padding: 20px; color: var(--portal-ink); background: white; border-radius: 5px; text-decoration: none; }
.design-choice:hover { box-shadow: inset 0 0 0 2px var(--portal-teal); }
.design-choice-visual { position: relative; display: grid; place-items: center; min-height: 155px; background: var(--portal-mist); overflow: hidden; }
.design-choice h3 { margin: 12px 0 8px; font: 800 1.6rem/1 var(--head); }
.design-choice p { margin: 0 0 18px; color: var(--portal-steel); font-size: .9rem; line-height: 1.5; }
.mini-box { position: relative; width: 84px; height: 72px; background: #b9783c; transform: skewY(-5deg); box-shadow: inset -14px 0 0 rgba(72,39,16,.15); }
.mini-box::before { content: ""; position: absolute; left: 8px; top: -28px; width: 68px; height: 30px; background: #d49b61; transform: skewY(11deg); transform-origin: bottom; }
.mini-box::after { content: "YOUR BRAND"; position: absolute; inset: 25px 8px auto; color: #172231; font: 800 .62rem/1 var(--head); text-align: center; }
.mini-tape { width: 84px; height: 84px; border: 20px solid #f6f3e9; border-radius: 50%; box-shadow: 0 9px 18px rgba(6,22,44,.18), inset 0 0 0 5px #9a6b38; }
.help-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; padding: 18px 22px; border: 1px solid var(--portal-rule); border-radius: 5px; }
.help-strip strong { display: block; }
.help-strip a { color: var(--portal-teal); font-weight: 800; }

.empty-state { padding: 54px 30px; border: 1px dashed #aebbc9; text-align: center; background: #fbfcfd; }
.empty-state h2 { margin: 0 0 8px; font: 800 2rem/1 var(--head); }
.empty-state p { max-width: 560px; margin: 0 auto 24px; color: var(--portal-steel); }
.design-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.design-list article { padding: 22px; border: 1px solid var(--portal-rule); border-top: 4px solid var(--portal-teal); }
.design-list h3 { margin: 0 0 8px; font: 800 1.5rem/1 var(--head); }
.design-list p { color: var(--portal-steel); font-size: .88rem; }

.builder-shell { max-width: 1440px; }
.builder-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 18px; }
.breadcrumbs { margin-bottom: 12px; color: var(--portal-teal); font-size: .88rem; font-weight: 700; }
.breadcrumbs a { text-decoration: none; }
.stepper { display: flex; min-width: 360px; justify-content: flex-end; counter-reset: step; }
.stepper span { position: relative; min-width: 112px; padding-top: 34px; color: #7c8794; font-size: .76rem; text-align: center; }
.stepper span::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; z-index: 2; display: grid; width: 28px; height: 28px; place-items: center; transform: translateX(-50%); color: white; background: #929aa4; border-radius: 50%; font-weight: 800; }
.stepper span:not(:first-child)::after { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; border-top: 1px solid #aeb6c0; }
.stepper span.active { color: var(--portal-teal); font-weight: 800; }
.stepper span.active::before { background: var(--portal-teal); }
.builder-grid { display: grid; grid-template-columns: minmax(390px, .83fr) minmax(0, 1.45fr); gap: 16px; align-items: start; }
.builder-form { padding: 20px 20px 22px; border: 1px solid var(--portal-rule); border-radius: 5px; background: white; }
.form-section { padding: 0 0 17px; margin: 0 0 17px; border: 0; border-bottom: 1px solid var(--portal-rule); }
.form-section:last-of-type { border-bottom: 0; }
.form-section legend { width: 100%; margin-bottom: 12px; color: var(--portal-navy); font: 800 1.25rem/1 var(--head); text-transform: uppercase; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-grid.two { grid-template-columns: repeat(2, 1fr); }
.field-grid.four { grid-template-columns: repeat(4, 1fr); }
.portal-field { display: flex; flex-direction: column; gap: 7px; color: var(--portal-ink); font-size: .78rem; font-weight: 700; }
.portal-field.wide { grid-column: 1 / -1; }
.portal-field input, .portal-field select, .portal-field textarea { width: 100%; min-height: 44px; padding: .68rem .75rem; border: 1px solid #b7c1cc; border-radius: 4px; color: var(--portal-ink); background: white; }
.portal-field textarea { min-height: 84px; resize: vertical; }
.portal-field input:focus, .portal-field select:focus, .portal-field textarea:focus { border-color: var(--portal-teal); outline: 2px solid rgba(7,156,155,.18); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.option-grid.five { grid-template-columns: repeat(5, 1fr); }
.option-control { position: relative; }
.option-control input { position: absolute; opacity: 0; pointer-events: none; }
.option-control span { display: flex; min-height: 48px; align-items: center; justify-content: center; padding: 8px; border: 1px solid var(--portal-rule); border-radius: 4px; color: var(--portal-ink); background: #fff; font-size: .76rem; font-weight: 700; text-align: center; cursor: pointer; }
.option-control input:checked + span { border-color: var(--portal-teal); color: #056c6c; background: var(--portal-teal-soft); box-shadow: inset 0 0 0 1px var(--portal-teal); }
.option-control input:focus-visible + span { outline: 3px solid #f6b73c; outline-offset: 2px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--portal-teal); }
.all-sides-note { margin: 7px 0 0; color: var(--portal-steel); font-size: .76rem; font-weight: 600; line-height: 1.5; }
.upload-zone { display: grid; min-height: 98px; place-items: center; padding: 18px; border: 1px dashed #8d9aa8; border-radius: 4px; background: #fbfcfd; text-align: center; cursor: pointer; }
.upload-zone:hover { border-color: var(--portal-teal); background: var(--portal-teal-soft); }
.upload-zone strong { display: block; margin-bottom: 4px; }
.upload-zone small { color: var(--portal-steel); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.artwork-name { margin: 8px 0 0; color: var(--portal-teal); font-size: .75rem; font-weight: 700; }
.builder-actions { display: flex; gap: 12px; margin-top: 8px; }
.builder-actions .portal-button { flex: 1; }
.builder-note { margin: 12px 0 0; color: var(--portal-steel); font-size: .72rem; line-height: 1.45; }

.preview-column { min-width: 0; }
.preview-panel { border: 1px solid var(--portal-rule); border-radius: 5px; overflow: hidden; background: white; }
.box-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border-bottom: 1px solid var(--portal-rule); background: #fff; }
.box-editor-head strong { display: block; color: var(--portal-navy); font: 800 1.08rem/1 var(--head); text-transform: uppercase; }
.box-editor-head span { display: block; margin-top: 4px; color: var(--portal-steel); font-size: .7rem; }
.editor-mode-tabs { display: flex; }
.editor-mode-tabs button { min-height: 38px; padding: 0 14px; border: 1px solid var(--portal-rule); color: var(--portal-ink); background: #fff; font-size: .72rem; font-weight: 800; cursor: pointer; }
.editor-mode-tabs button + button { border-left: 0; }
.editor-mode-tabs button.active { color: white; border-color: var(--portal-teal); background: var(--portal-teal); }
.preview-stage { position: relative; display: grid; min-height: 540px; place-items: center; overflow: hidden; background: #f8fafb; }
.preview-stage[hidden] { display: none !important; }
.preview-dimension { position: absolute; color: var(--portal-steel); font: 800 .85rem/1 var(--body); }
.dimension-width { left: 50%; bottom: 82px; transform: translateX(-50%); }
.dimension-height { left: 44px; top: 50%; transform: translateY(-50%) rotate(-90deg); }
.dimension-depth { right: 54px; bottom: 120px; transform: rotate(-30deg); }
.box-preview-stage { min-height: 560px; perspective: 1200px; }
.box-model {
  --box-width: 330px;
  --box-height: 220px;
  --box-depth: 185px;
  --box-color: #b98249;
  position: relative;
  display: grid;
  width: min(82%, 620px);
  height: 380px;
  place-items: center;
  perspective: 1100px;
  transform-origin: center;
  transition: transform .2s ease;
}
.box-model[data-material="white"] { --box-color: #e9e5dc; }
.box-model[data-material="other"] { --box-color: #91a9ad; }
.box-cube {
  position: relative;
  width: var(--box-width);
  height: var(--box-height);
  transform: rotateX(-18deg) rotateY(28deg);
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.2,.75,.2,1);
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.box-cube:focus-visible { outline: 3px solid #f6b73c; outline-offset: 18px; }
.box-cube.is-dragging { cursor: grabbing; transition: none; }
.box-face {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(69,45,23,.58);
  background-color: var(--box-color);
  background-image: linear-gradient(105deg,rgba(255,255,255,.12),transparent 34%,rgba(56,31,12,.08)), repeating-linear-gradient(0deg,rgba(73,43,19,.035) 0 1px,transparent 1px 4px);
  box-shadow: inset 0 0 28px rgba(75,44,19,.08);
  backface-visibility: hidden;
  overflow: hidden;
}
.box-face-front, .box-face-back { width: var(--box-width); height: var(--box-height); }
.box-face-left, .box-face-right { width: var(--box-depth); height: var(--box-height); }
.box-face-top, .box-face-bottom { width: var(--box-width); height: var(--box-depth); }
.box-face-front { transform: translate(-50%,-50%) translateZ(calc(var(--box-depth) / 2)); }
.box-face-back { transform: translate(-50%,-50%) rotateY(180deg) translateZ(calc(var(--box-depth) / 2)); }
.box-face-right { transform: translate(-50%,-50%) rotateY(90deg) translateZ(calc(var(--box-width) / 2)); filter: brightness(.86); }
.box-face-left { transform: translate(-50%,-50%) rotateY(-90deg) translateZ(calc(var(--box-width) / 2)); filter: brightness(.9); }
.box-face-top { transform: translate(-50%,-50%) rotateX(90deg) translateZ(calc(var(--box-height) / 2)); filter: brightness(1.12); }
.box-face-bottom { transform: translate(-50%,-50%) rotateX(-90deg) translateZ(calc(var(--box-height) / 2)); filter: brightness(.76); }
.face-print-area {
  position: absolute;
  inset: 15%;
  display: grid;
  place-items: center;
  border: 2px dashed transparent;
  color: rgba(47,43,38,.55);
  font: 800 .82rem/1 var(--head);
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
}
.box-face.is-selected .face-print-area { border-color: transparent; }
.face-print-area img { display: block; width: auto; height: auto; max-width: 88%; max-height: 88%; object-fit: contain; object-position: center; mix-blend-mode: multiply; }
.face-custom-text { position: absolute; left: 10%; right: 10%; bottom: 5%; color: #17212b; font: 800 .68rem/1 var(--head); text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
.preview-panel.hide-guides .face-print-area { border-color: transparent; color: transparent; }
.box-drag-hint { position: absolute; top: 18px; left: 50%; margin: 0; transform: translateX(-50%); color: var(--portal-steel); font-size: .76rem; font-weight: 700; }
.box-view-controls { position: absolute; left: 50%; bottom: 18px; z-index: 5; display: flex; transform: translateX(-50%); box-shadow: 0 4px 14px rgba(8,24,42,.08); }
.box-view-controls button { min-height: 36px; padding: 0 12px; border: 1px solid var(--portal-rule); border-left: 0; color: var(--portal-ink); background: white; font-size: .7rem; font-weight: 800; cursor: pointer; }
.box-view-controls button:first-child { border-left: 1px solid var(--portal-rule); }
.box-view-controls button.active { color: white; background: var(--portal-teal); border-color: var(--portal-teal); }
.box-flat-stage { min-height: 560px; padding: 82px 30px 36px; background: #f5f7f9; }
.flat-layout-instructions { position: absolute; left: 22px; top: 20px; display: flex; flex-direction: column; gap: 3px; }
.flat-layout-instructions strong { color: var(--portal-navy); font: 800 1rem/1 var(--head); text-transform: uppercase; }
.flat-layout-instructions span { color: var(--portal-steel); font-size: .7rem; }
.box-dieline { --editor-zoom: 1; display: grid; width: min(98%, 780px); grid-template-columns: minmax(0,.82fr) minmax(0,1.35fr) minmax(0,.82fr) minmax(0,1.35fr) 34px; grid-template-rows: 112px 122px 112px; align-items: stretch; transform: scale(var(--editor-zoom)); transform-origin: center; transition: transform .2s ease; filter: drop-shadow(0 16px 18px rgba(8,24,42,.1)); }
.flat-box-face { position: relative; min-width: 0; padding: 0; overflow: hidden; border: 1px solid rgba(82,65,47,.48); color: #604b34; background-color: #bd8953; background-image: linear-gradient(110deg,rgba(255,255,255,.12),transparent 44%),repeating-linear-gradient(0deg,rgba(73,43,19,.035) 0 1px,transparent 1px 4px); cursor: pointer; touch-action: none; }
.box-flat-stage[data-material="white"] .flat-box-face { color: #59636d; background-color: #e9e5dc; }
.box-flat-stage[data-material="other"] .flat-box-face { color: #30464b; background-color: #91a9ad; }
.flat-box-face-left { grid-column: 1; grid-row: 2; }
.flat-box-face-front { grid-column: 2; grid-row: 2; }
.flat-box-face-right { grid-column: 3; grid-row: 2; }
.flat-box-face-back { grid-column: 4; grid-row: 2; }
.flat-box-flap-left-top { grid-column: 1; grid-row: 1; }
.flat-box-flap-right-top { grid-column: 3; grid-row: 1; }
.flat-box-flap-back-top { grid-column: 4; grid-row: 1; }
.flat-box-flap-left-bottom { grid-column: 1; grid-row: 3; }
.flat-box-flap-right-bottom { grid-column: 3; grid-row: 3; }
.flat-box-flap-back-bottom { grid-column: 4; grid-row: 3; }
.flat-box-flap { align-self: end; }
.flat-box-flap-dust { height: 68%; }
.flat-box-flap-left-top { clip-path: polygon(7% 0,78% 0,100% 24%,100% 100%,0 100%,0 12%); }
.flat-box-flap-right-top { clip-path: polygon(22% 0,93% 0,100% 12%,100% 100%,0 100%,0 24%); }
.flat-box-flap-tuck { height: 100%; overflow: visible; }
.flat-box-flap-tuck::before { content: ""; position: absolute; z-index: -1; left: 8%; top: -28px; width: 84%; height: 28px; border: 1px solid rgba(82,65,47,.48); border-bottom: 0; border-radius: 30px 30px 0 0; background-color: #bd8953; background-image: linear-gradient(110deg,rgba(255,255,255,.12),transparent 44%),repeating-linear-gradient(0deg,rgba(73,43,19,.035) 0 1px,transparent 1px 4px); }
.flat-box-flap-left-bottom, .flat-box-flap-right-bottom { align-self: start; }
.flat-box-flap-left-bottom { clip-path: polygon(0 0,100% 0,100% 12%,78% 100%,7% 100%,0 88%); }
.flat-box-flap-right-bottom { clip-path: polygon(0 0,100% 0,100% 88%,93% 100%,22% 100%,0 76%); }
.flat-box-flap-back-bottom { align-self: start; }
.flat-box-flap-back-bottom::before { top: auto; bottom: -28px; border-top: 0; border-bottom: 1px solid rgba(82,65,47,.48); border-radius: 0 0 30px 30px; }
.flat-glue-tab { position: relative; grid-column: 5; grid-row: 2; display: grid; place-items: center; border: 1px solid rgba(82,65,47,.48); border-left: 0; color: #604b34; background-color: #a97949; background-image: linear-gradient(110deg,rgba(255,255,255,.1),transparent 55%); clip-path: polygon(0 0,72% 9%,100% 22%,100% 78%,72% 91%,0 100%); }
.flat-glue-tab span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .52rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.box-flat-stage[data-material="white"] .flat-glue-tab { color: #59636d; background-color: #d9d5cc; }
.box-flat-stage[data-material="other"] .flat-glue-tab { color: #30464b; background-color: #7f999d; }
.box-flat-stage[data-material="white"] .flat-box-flap-tuck::before { background-color: #e9e5dc; }
.box-flat-stage[data-material="other"] .flat-box-flap-tuck::before { background-color: #91a9ad; }
.flat-box-face.is-active { z-index: 2; filter: brightness(1.05); }
.flat-box-face.is-active .flat-face-name { color: #056c6c; }
.flat-box-face.is-dragging { cursor: grabbing; }
.flat-face-name { position: absolute; left: 8px; top: 7px; z-index: 2; font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.flat-print-area { position: absolute; inset: 17%; display: grid; place-items: center; border: 1.5px dashed transparent; color: rgba(47,43,38,.56); font: 800 .7rem/1 var(--head); text-transform: uppercase; overflow: hidden; }
.flat-box-face.is-selected .flat-print-area { border-color: transparent; }
.flat-print-area img { display: block; max-width: 94%; max-height: 82%; object-fit: contain; mix-blend-mode: multiply; }
.flat-print-area .face-custom-text { font-size: .55rem; }
.preview-panel.hide-guides .flat-print-area { border-color: transparent; color: transparent; }
.box-editor-controls { padding: 14px 16px 16px; border-top: 1px solid var(--portal-rule); background: white; }
.editor-face-row { display: flex; align-items: center; gap: 12px; }
.editor-face-row > span { flex: 0 0 auto; color: var(--portal-steel); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.editor-face-row > div { display: grid; flex: 1; grid-template-columns: repeat(6, 1fr); }
.editor-face-row button { min-height: 50px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; padding: 5px 6px; border: 1px solid var(--portal-rule); border-left: 0; color: var(--portal-ink); background: white; font-size: .68rem; font-weight: 800; cursor: pointer; }
.editor-face-row button:first-child { border-left: 1px solid var(--portal-rule); }
.editor-face-row button.active { color: white; border-color: var(--portal-teal); background: var(--portal-teal); }
.editor-face-row button small { color: var(--portal-steel); font-size: .56rem; font-weight: 700; }
.editor-face-row button.has-image small { color: #08746f; }
.editor-face-row button.has-image small::before { content: "✓ "; font-weight: 900; }
.editor-face-row button.active small { color: rgba(255,255,255,.84); }
.side-artwork-panel { display: grid; grid-template-columns: minmax(150px,1fr) minmax(220px,1.45fr) auto auto; gap: 10px; align-items: stretch; margin-top: 12px; padding: 12px; background: #f5f8f9; }
.side-artwork-panel > div { align-self: center; }
.side-artwork-panel > div strong { display: block; color: var(--portal-navy); font: 800 1rem/1 var(--head); text-transform: uppercase; }
.side-artwork-panel > div span { display: block; margin-top: 5px; color: var(--portal-steel); font-size: .66rem; }
.side-upload-control { display: flex; min-width: 0; align-items: center; gap: 9px; padding: 8px 11px; border: 1px dashed #8998a5; color: var(--portal-ink); background: white; cursor: pointer; }
.side-upload-control:hover { border-color: var(--portal-teal); background: var(--portal-teal-soft); }
.side-upload-control .button-icon { flex: 0 0 auto; }
.side-upload-control > span { min-width: 0; }
.side-upload-control strong, .side-upload-control small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-upload-control strong { font-size: .7rem; }
.side-upload-control small { margin-top: 3px; color: var(--portal-steel); font-size: .6rem; }
.side-upload-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.side-remove-image, .side-next { min-height: 42px; align-self: center; padding: 0 11px; border: 1px solid var(--portal-rule); color: var(--portal-ink); background: white; font-size: .64rem; font-weight: 800; cursor: pointer; }
.side-remove-image { color: var(--portal-danger); }
.side-next { display: inline-flex; align-items: center; gap: 5px; color: white; border-color: var(--portal-navy); background: var(--portal-navy); }
.side-next .button-icon { width: 15px; }
.artwork-adjustments { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) minmax(130px,1.15fr) auto; gap: 14px; align-items: end; margin-top: 14px; }
.artwork-adjustments label { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; color: var(--portal-steel); font-size: .65rem; font-weight: 800; text-transform: uppercase; }
.artwork-adjustments input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--portal-teal); }
.artwork-adjustments output { color: var(--portal-ink); }
.artwork-adjustments .editor-text-field { display: flex; flex-direction: column; align-items: stretch; }
.editor-text-field input { min-height: 36px; padding: 0 9px; border: 1px solid var(--portal-rule); color: var(--portal-ink); background: white; font-size: .72rem; text-transform: none; }
.editor-reset { min-height: 36px; padding: 0 12px; border: 1px solid var(--portal-teal); color: #056c6c; background: var(--portal-teal-soft); font-size: .68rem; font-weight: 800; cursor: pointer; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border-top: 1px solid var(--portal-rule); }
.view-tabs, .zoom-controls { display: flex; }
.view-tabs button, .view-tabs > span, .zoom-controls button, .zoom-controls span { min-width: 48px; min-height: 38px; display: grid; place-items: center; padding: 0 13px; border: 1px solid var(--portal-rule); color: var(--portal-ink); background: white; font-weight: 700; }
.view-tabs button + button, .zoom-controls > * + * { border-left: 0; }
.view-tabs button.active, .view-tabs > span.active { color: white; background: var(--portal-teal); border-color: var(--portal-teal); }
.guide-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: .78rem; font-weight: 700; }
.guide-toggle input { width: 19px; height: 19px; accent-color: var(--portal-teal); }
.design-summary { margin-top: 14px; padding: 18px 20px; color: white; background: var(--portal-navy); border-radius: 5px; }
.design-summary h2 { color: white; margin-bottom: 14px; text-transform: uppercase; }
.summary-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.summary-grid > div { padding: 0 15px; border-left: 1px solid rgba(255,255,255,.24); }
.summary-grid > div:first-child { padding-left: 0; border: 0; }
.summary-grid strong { display: block; color: white; font-size: .85rem; }
.summary-grid span { display: block; margin-top: 3px; color: #bfcbd8; font-size: .68rem; }

.tape-stage { display: grid; grid-template-rows: 1fr 160px; min-height: 540px; align-items: center; }
.tape-roll { position: relative; width: 220px; height: 220px; margin: 20px auto; border: 52px solid #f2eee4; border-radius: 50%; box-shadow: 0 25px 32px rgba(13,31,48,.18), inset 0 0 0 13px #9f713e; }
.tape-roll::after { content: var(--tape-message, "YOUR LOGO"); position: absolute; left: 50%; top: -43px; width: 94px; padding: 10px 2px; transform: translateX(-50%); border: 1px dashed var(--portal-teal); color: var(--portal-teal); font: 800 1rem/1 var(--head); text-align: center; background: rgba(255,255,255,.82); }
.tape-roll.has-artwork::after { content: ""; height: 52px; background-color: rgba(255,255,255,.82); background-image: var(--artwork); background-size: contain; background-repeat: no-repeat; background-position: center; }
.tape-strip { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 44px; padding: 18px 54px; border-top: 1px solid var(--portal-rule); background: #f5f2e9; overflow: hidden; }
.tape-repeat { min-height: 88px; display: grid; place-items: center; border: 2px dashed var(--portal-teal); color: var(--portal-teal); font: 800 1.35rem/1 var(--head); text-align: center; background-size: contain; background-repeat: no-repeat; background-position: center; }
.tape-repeat.has-artwork { color: transparent; background-image: var(--artwork); }
.preview-panel.hide-guides .tape-repeat { border-color: transparent; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-items { border-top: 1px solid var(--portal-rule); }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 24px 0; border-bottom: 1px solid var(--portal-rule); }
.cart-item h3 { margin: 0 0 8px; font: 800 1.55rem/1 var(--head); }
.cart-item dl { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; color: var(--portal-steel); font-size: .8rem; }
.cart-item dt { font-weight: 800; }
.cart-item dd { margin: 0; }
.remove-item { align-self: start; border: 0; color: var(--portal-danger); background: none; font-weight: 800; cursor: pointer; }
.cart-panel { position: sticky; top: 106px; padding: 24px; color: white; background: var(--portal-navy); }
.cart-panel h2 { color: white; }
.cart-panel p { color: #c8d3df; font-size: .85rem; line-height: 1.55; }
.cart-panel textarea { width: 100%; min-height: 110px; margin: 10px 0 16px; padding: .8rem; border: 1px solid #9aabba; }
.cart-panel .portal-button { width: 100%; }

.auth-layout { width: min(1050px, calc(100% - 32px)); display: grid; grid-template-columns: .85fr 1.15fr; min-height: 610px; background: white; box-shadow: 0 28px 70px rgba(0,0,0,.25); }
.auth-copy { padding: 70px 58px; color: white; background: var(--portal-navy); }
.auth-copy h1 { color: white; }
.auth-copy p { color: #cbd6e2; line-height: 1.65; }
.auth-copy ul { padding: 0; margin: 40px 0 0; list-style: none; }
.auth-copy li { padding: 15px 0; border-top: 1px solid rgba(255,255,255,.18); font-weight: 700; }
.auth-form-wrap { display: grid; place-items: center; padding: 64px; }
.auth-form { width: 100%; max-width: 430px; }
.auth-form h2 { margin: 0 0 10px; font: 800 2.5rem/1 var(--head); text-transform: uppercase; }
.auth-form > p { margin: 0 0 28px; color: var(--portal-steel); line-height: 1.55; }
.auth-form .portal-field { margin-bottom: 16px; }
.auth-form .portal-button { width: 100%; }
.auth-status { min-height: 48px; margin-top: 18px; padding: 12px; color: var(--portal-steel); background: var(--portal-mist); font-size: .83rem; line-height: 1.45; }
.auth-status.success { color: var(--portal-success); background: #ecfdf3; }
.auth-status.error, .portal-error { color: var(--portal-danger); background: #fef3f2; }
.setup-state { max-width: 760px; margin: 90px auto; padding: 42px; border: 1px solid var(--portal-rule); border-top: 5px solid var(--portal-orange); }
.setup-state h1 { margin: 0 0 12px; font: 800 3rem/1 var(--head); }
.setup-state p { color: var(--portal-steel); line-height: 1.6; }
.demo-notice { margin: -18px 0 26px; padding: 11px 15px; color: #7a2e0e; background: #fff4ed; border-left: 4px solid var(--portal-orange); font-size: .78rem; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: grid; gap: 10px; }
.toast { max-width: 390px; padding: 14px 18px; color: white; background: var(--portal-navy); border-left: 4px solid var(--portal-teal); box-shadow: 0 12px 30px rgba(0,0,0,.22); font-size: .84rem; }
.toast.error { border-color: #f97066; }

@media (max-width: 1180px) {
  .portal-header { grid-template-columns: 245px 1fr auto; }
  .portal-logo { margin-inline: 12px; }
  .portal-logo img { width: 205px; }
  .portal-nav a { padding-inline: 18px; font-size: .92rem; }
  .portal-account { min-width: auto; padding-inline: 18px; }
  .dashboard-layout, .cart-layout { grid-template-columns: 1fr; }
  .quote-rail, .cart-panel { position: static; }
  .builder-grid { grid-template-columns: 420px minmax(0, 1fr); }
  .preview-stage, .tape-stage { min-height: 480px; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); gap: 18px 0; }
}

@media (max-width: 900px) {
  .portal-header { grid-template-columns: 1fr auto auto; min-height: 72px; }
  .portal-logo { margin-block: 10px; }
  .portal-logo img { width: 180px; height: 48px; }
  .portal-menu { display: block; align-self: center; margin-right: 14px; padding: .65rem .8rem; border: 1px solid rgba(255,255,255,.5); color: white; background: transparent; font-weight: 800; }
  .portal-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: var(--portal-navy); box-shadow: 0 14px 28px rgba(0,0,0,.2); }
  .portal-nav.open { display: flex; }
  .portal-nav-signout { display: block; }
  .portal-nav a { min-height: 52px; border-top: 1px solid rgba(255,255,255,.12); border-left: 0; }
  .portal-nav a.active::after { inset: 0 auto 0 0; width: 4px; height: auto; }
  .portal-account { padding: 0 14px; border: 0; }
  .portal-account [data-account-name] { display: none; }
  .portal-progress { top: 72px; }
  .portal-main { min-height: calc(100vh - 72px); padding: 34px 24px 60px; }
  .portal-main.auth-screen { background: var(--portal-navy); }
  .portal-heading-row, .builder-top { align-items: flex-start; flex-direction: column; }
  .stepper { width: 100%; justify-content: flex-start; }
  .builder-grid { grid-template-columns: 1fr; }
  .preview-column { order: -1; }
  .preview-stage, .tape-stage { min-height: 430px; }
  .design-list { grid-template-columns: repeat(2, 1fr); }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-copy { padding: 42px; }
  .auth-copy ul { display: none; }
}

@media (max-width: 620px) {
  .portal-header { grid-template-columns: 1fr auto; }
  .portal-logo { margin-left: 8px; padding-inline: 5px; }
  .portal-logo img { width: 164px; }
  .portal-account { display: none; }
  .portal-main { padding: 28px 16px 48px; }
  .portal-heading-row h1, .builder-heading h1 { font-size: 2.75rem; }
  .heading-actions, .builder-actions { width: 100%; flex-direction: column; }
  .heading-actions .portal-button, .builder-actions .portal-button { width: 100%; }
  .design-choice-grid, .design-list { grid-template-columns: 1fr; }
  .design-choice { grid-template-columns: 104px 1fr; }
  .help-strip { align-items: flex-start; flex-direction: column; }
  .stepper { min-width: 0; }
  .stepper span { min-width: 33.333%; }
  .field-grid, .field-grid.two, .field-grid.four { grid-template-columns: repeat(2, 1fr); }
  .option-grid, .option-grid.five { grid-template-columns: repeat(2, 1fr); }
  .preview-stage { min-height: 360px; }
  .box-editor-head { align-items: stretch; flex-direction: column; }
  .editor-mode-tabs button { flex: 1; }
  .box-preview-stage { min-height: 390px; }
  .box-model { --box-width: 220px; --box-height: 146px; --box-depth: 124px; width: 100%; height: 265px; }
  .box-view-controls { width: calc(100% - 28px); display: grid; grid-template-columns: repeat(3, 1fr); }
  .box-view-controls button { min-width: 0; padding-inline: 5px; border: 1px solid var(--portal-rule); }
  .dimension-height { left: 16px; }
  .dimension-depth { right: 20px; bottom: 112px; }
  .dimension-width { bottom: 84px; }
  .box-flat-stage { min-height: 410px; padding: 72px 12px 24px; }
  .box-dieline { width: 100%; grid-template-rows: repeat(3, 78px); }
  .editor-face-row { align-items: stretch; flex-direction: column; gap: 7px; }
  .editor-face-row > div { grid-template-columns: repeat(3, 1fr); }
  .editor-face-row button { border: 1px solid var(--portal-rule); }
  .side-artwork-panel { grid-template-columns: 1fr 1fr; }
  .side-artwork-panel > div, .side-upload-control { grid-column: 1 / -1; }
  .side-remove-image, .side-next { width: 100%; }
  .artwork-adjustments { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .artwork-adjustments .editor-text-field { grid-column: 1 / -1; }
  .editor-reset { grid-column: 1 / -1; }
  .tape-stage { min-height: 390px; grid-template-rows: 1fr 120px; }
  .tape-roll { width: 150px; height: 150px; border-width: 36px; }
  .tape-roll::after { top: -31px; width: 72px; font-size: .78rem; }
  .tape-strip { gap: 20px; padding: 14px 18px; }
  .tape-repeat { min-height: 65px; font-size: .9rem; }
  .preview-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-grid > div:nth-child(odd) { border-left: 0; padding-left: 0; }
  .cart-item { grid-template-columns: 1fr; }
  .auth-layout { width: 100%; }
  .auth-copy, .auth-form-wrap { padding: 34px 24px; }
  .order-table { min-width: 0; }
  .order-table thead { display: none; }
  .order-table tbody, .order-table tr, .order-table td { display: block; }
  .order-table tr { padding: 12px 16px; border-bottom: 1px solid var(--portal-rule); }
  .order-table tr:last-child { border-bottom: 0; }
  .order-table td { display: grid; grid-template-columns: 88px minmax(0,1fr); gap: 10px; padding: 7px 0; border: 0; overflow-wrap: anywhere; }
  .order-table td::before { color: var(--portal-steel); font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .order-table td:nth-child(1)::before { content: "Order"; }
  .order-table td:nth-child(2)::before { content: "Date"; }
  .order-table td:nth-child(3)::before { content: "Items"; }
  .order-table td:nth-child(4)::before { content: "Status"; }
  .order-table td:nth-child(5)::before { content: "Total"; }
  .order-table td:nth-child(6)::before { content: "Action"; }
  .order-table td .portal-button { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
