:root {
  --brand-charcoal: #242424;
  --brand-paper: #f5f3ef;
  --brand-warm: #ebe7df;
  --brand-orange: #f47b36;
  --brand-ink: #242424;
  --brand-focus: #24529a;
}

html { color-scheme: light; }
body { background: var(--brand-paper); color: var(--brand-ink); overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, .button { border-radius: 8px; min-height: 46px; }
button:focus-visible, .button:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible { outline: 3px solid var(--brand-focus); outline-offset: 3px; }
input, select, textarea { border-radius: 6px; }

.top {
  min-height: 76px; height: auto; padding: 10px clamp(20px, 3.5vw, 64px);
  display: flex; align-items: center; gap: clamp(16px, 2.5vw, 42px);
  background: var(--brand-charcoal); color: #fff;
}
.wordmark { display: block; flex: none; line-height: 0; }
.brand-logo { display: block; width: 100%; height: auto; object-fit: contain; }
.header-logo { width: clamp(148px, 15vw, 190px); }
.gate-logo { width: min(370px, 100%); margin-bottom: clamp(28px, 4vw, 46px); }
.top-note { color: #f5eee6; font: 600 .72rem/1.4 Arial, Helvetica, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.text-button { min-height: 40px; padding: 8px; border: 0; background: transparent; color: #fff; text-decoration: underline; }

#gate.gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100svh - 76px); max-width: none; padding: 0; border: 0; box-shadow: none; background: var(--brand-paper); }
.gate-card { display: flex; align-items: center; justify-content: center; padding: clamp(32px, 6vw, 100px); min-width: 0; }
.gate-content { width: min(100%, 600px); min-width: 0; }
#gate h1 { max-width: 640px; margin: 0 0 22px; font: 750 clamp(3.2rem, 5.25vw, 5.8rem)/.99 Arial, Helvetica, sans-serif; letter-spacing: -.068em; overflow-wrap: normal; }
#gate .gate-intro { max-width: 510px; margin: 0 0 32px; font-size: clamp(1.03rem, 1.3vw, 1.22rem); line-height: 1.55; color: #44413c; }
.gate-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gate-actions button { padding: 12px 22px; border: 0; background: var(--brand-orange); color: #1b1713; font-weight: 700; }
.gate-actions button.secondary { background: #dfdcd5; color: #242424; }
.gate-actions button:hover { filter: brightness(.94); }
#gate .access-note { max-width: 500px; margin: 26px 0 0; color: #58544f; font-size: .91rem; line-height: 1.55; }
#gate #gate-message { max-width: 510px; margin: 16px 0 0; color: #6b625b; font-size: .88rem; line-height: 1.5; }
#gate #gate-message:empty { display: none; }
.support-reference { margin: 16px 0; color: #4a4540; font-size: .84rem; }
.support-reference summary { cursor: pointer; text-decoration: underline; }
.support-reference code { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.access-pending { margin-top: 24px; border-radius: 8px; }

#gate .gate-art { position: relative; display: block; min-width: 0; overflow: hidden; background: var(--brand-warm); padding: 0; }
.art-circle { position: absolute; width: 78%; aspect-ratio: 1; border: clamp(40px, 7vw, 105px) solid #d9d2c7; border-radius: 50%; top: -20%; right: -23%; }
.art-line { position: absolute; left: -20%; top: 67%; width: 150%; height: clamp(70px, 10vw, 145px); transform: rotate(-26deg); background: var(--brand-orange); }
.brand-message { position: absolute; z-index: 1; top: 22%; left: 12%; right: 10%; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; }
.brand-message-title { font: 750 clamp(3.2rem, 5.5vw, 6.2rem)/.99 Arial, Helvetica, sans-serif; letter-spacing: -.067em; text-transform: none; color: #28231e; }
.brand-message img { display: block; width: min(100%, 400px); height: auto; }

@media (max-width: 900px) {
  #gate.gate { grid-template-columns: 1fr; min-height: 0; }
  .gate-card { padding: clamp(36px, 8vw, 76px) clamp(24px, 6vw, 54px); }
  #gate h1 { font-size: clamp(3.2rem, 8vw, 5rem); }
  #gate .gate-art { min-height: 235px; }
  .brand-message { top: 20%; left: 9%; gap: 8px; }
  .brand-message-title { font-size: clamp(2.5rem, 6vw, 4rem); }
  .brand-message img { width: min(42%, 240px); }
}
@media (max-width: 560px) {
  .top { min-height: 68px; padding: 8px 18px; gap: 12px; }
  .header-logo { width: 142px; }
  .top-note { max-width: 145px; font-size: .6rem; letter-spacing: .07em; }
  .top-actions { font-size: .75rem; }
  .gate-card { padding: 38px 23px 32px; }
  .gate-logo { width: min(300px, 100%); margin-bottom: 26px; }
  #gate h1 { font-size: clamp(2.7rem, 11vw, 4rem); letter-spacing: -.06em; }
  #gate .gate-intro { font-size: 1.04rem; margin-bottom: 26px; }
  .gate-actions { align-items: stretch; }
  .gate-actions button { flex: 1 1 100%; }
  #gate .gate-art { min-height: 190px; border-bottom: 14px solid var(--brand-orange); }
  .art-circle { width: 65%; top: -43%; right: -10%; }
  .art-line { display: none; }
  .brand-message { top: 22%; left: 8%; right: 6%; gap: 6px; }
  .brand-message-title { font-size: 2rem; }
  .brand-message img { width: 165px; }
}
@media (prefers-reduced-motion: no-preference) { .gate-actions button { transition: filter .18s ease; } }

.board-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.partner-mark { display:block; max-width:min(220px,100%); max-height:84px; width:auto; height:auto; object-fit:contain; margin:10px 0 16px; }
.table-brand-mark { display:block; max-width:84px; max-height:42px; width:auto; height:auto; object-fit:contain; margin-bottom:4px; }
.draft-logo { flex:0 0 auto; max-width:110px; max-height:60px; width:auto; height:auto; object-fit:contain; }
.draft-line { display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin:12px 0; padding:14px;
  border:1px solid #d8d2c9; border-radius:8px; }
.draft-line label { flex:1 1 150px; }
.draft-line .remove-draft-line { flex:0 0 auto; }
.board-card { border:1px solid #d8d2c9; border-radius:10px; padding:16px; background:#f9f7f3; }
.board-card h3 { margin:6px 0; }
.board-card button { width:100%; }
.board-sheet { display:grid; grid-template-columns:minmax(180px,1fr) 2fr; gap:18px; align-items:start; }
.board-image { min-height:180px; display:grid; place-items:center; padding:20px; text-align:center;
  border:1px dashed #aaa39a; border-radius:8px; background:#f5f3ef; color:#615e59; }
.board-sheet dl { display:grid; grid-template-columns:max-content 1fr; gap:6px 14px; overflow-wrap:anywhere; }
.board-sheet dt { font-weight:700; }
.board-sheet dd { margin:0; }
.board-qr { display:flex; align-items:center; gap:18px; flex-wrap:wrap; margin:18px 0; }
.board-qr img { width:160px; height:160px; background:white; border:8px solid white; }
.board-timeline { display:flex; gap:0; overflow-x:auto; padding:16px 0; }
.board-stage { flex:1 0 140px; min-width:140px; border-top:5px solid #b3b5b3; padding:12px;
  background:#f5f4f1; }
.board-stage summary { cursor:pointer; display:grid; gap:5px; list-style:none; font-weight:700; }
.board-stage summary::-webkit-details-marker { display:none; }
.board-stage small { font-weight:500; text-transform:capitalize; }
.board-stage.completed { border-color:#277744; background:#e8f3e8; }
.board-stage.skipped { border-color:#687784; background:#edf1f4; }
.board-stage.current,.board-stage.in_progress { border-color:#e0732d; background:#fff0e3; }
.board-stage.blocked,.board-stage.failed { border-color:#b33232; background:#ffe9e7; }
.board-stage.rework { border-color:#8047aa; background:#f0e9f7; }
.stage-index { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#242424; color:white; }
.production-progress { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.production-progress progress { flex:1; min-width:160px; accent-color:#277744; }
.fulfilment { line-height:1.9; }
#board-lookup { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin:16px 0; }
#board-lookup label { display:grid; gap:6px; flex:1 1 240px; }
#retailer-camera { display:block; width:min(100%,420px); margin:14px 0; background:#222; }
#retailer-camera[hidden] { display:none; }
#workspace { max-width:none; min-height:calc(100svh - 76px); padding:0; display:grid;
  grid-template-columns: minmax(240px,300px) minmax(0,1fr); align-items:stretch; }
.workspace-sidebar { min-width:0; background:#292929; color:#f5f3ef; padding:30px 24px;
  display:flex; flex-direction:column; gap:18px; }
.sidebar-label { margin:0; color:#c8c3bb; font:400 .75rem/1.5 Georgia,serif; letter-spacing:.16em; }
.sidebar-identity,.sidebar-brand { display:flex; align-items:center; gap:12px; min-width:0; line-height:1.3; }
.sidebar-identity strong { overflow-wrap:anywhere; font-size:1.06rem; }
.sidebar-identity img { flex:none; width:64px; height:64px; object-fit:contain; }
.sidebar-brands { display:grid; gap:10px; padding:4px 0; }
.sidebar-brand { font-size:.88rem; }
.sidebar-brand img { flex:none; width:48px; height:40px; object-fit:contain; }
.sidebar-picker { display:grid; gap:8px; color:#e2ded8; font-size:.88rem; }
.sidebar-picker select { width:100%; min-width:0; color:#fff; background:#383838;
  border:1px solid #84817d; padding:12px; }
.workspace-main { min-width:0; padding:clamp(26px,4vw,64px); }
#workspace .heading { border-bottom:1px solid #ccc7bf; margin-bottom:28px; min-width:0; }
.workspace-title-row,.brand-panel-title { display:flex; align-items:center; gap:16px; min-width:0; }
.workspace-title-row h1 { overflow-wrap:anywhere; }
.workspace-title-row img { flex:none; width:clamp(54px,6vw,88px); height:clamp(54px,6vw,88px); object-fit:contain; }
.brand-panel-title img { flex:none; max-width:100px; max-height:56px; width:auto; height:auto; object-fit:contain; }
#sections { display:flex; flex-direction:column; gap:3px; padding:4px 0; overflow:visible; }
#sections button { text-align:left; white-space:normal; width:100%; padding:14px 18px;
  min-height:52px; background:transparent; color:#f0eeea; border:0; border-left:4px solid transparent; }
#sections button:hover,#sections button.active { background:#454545; color:#fff; border-left-color:#ff8744; }
#sections button:focus-visible { outline:3px solid #85baff; outline-offset:2px; }
#notice,#content { min-width:0; }
#menu-toggle,.mobile-menu-head { display:none; }
.menu-backdrop[hidden] { display:none; }
@media(max-width:750px){
  #workspace { display:block; }
  .workspace-sidebar { position:fixed; z-index:101; top:0; right:0; bottom:0; width:min(340px,88vw); padding:20px 18px; gap:16px; overflow-y:auto; overscroll-behavior:contain; box-shadow:-14px 0 35px #0004; transform:translateX(110%); visibility:hidden; transition:transform .22s ease,visibility .22s; }
  .workspace-sidebar.menu-open { transform:translateX(0); visibility:visible; }
  .workspace-main { padding:24px 16px 48px; }
  #menu-toggle { display:flex; align-items:center; gap:8px; min-height:44px; margin:0; padding:8px 12px; background:#454545; border:1px solid #888; border-radius:8px; color:#fff; font-weight:700; }
  #menu-toggle[hidden] { display:none; }
  .mobile-menu-head { display:flex; align-items:center; justify-content:space-between; font-size:1.15rem; }
  #menu-close { min-width:44px; min-height:44px; background:#454545; color:#fff; border:1px solid #888; border-radius:8px; font-size:1.8rem; line-height:1; }
  #sections { display:flex; padding:4px 0 0; }
  #sections button { min-height:52px; }
  .menu-backdrop:not([hidden]) { display:block; position:fixed; inset:0; z-index:100; background:#0009; border:0; border-radius:0; cursor:pointer; }
  body.mobile-menu-open { overflow:hidden; }
}
@media(max-width:400px){.menu-toggle-text{display:none}}
@media(prefers-reduced-motion:reduce){.workspace-sidebar{transition:none}}
@media(max-width:650px){.board-sheet{grid-template-columns:1fr}.board-timeline{margin-inline:-18px;padding-inline:18px}}
@media(max-width:650px){main{padding:0}.top-note,.top-actions #identity{display:none}}
@media print {
  body { background:white; color:black; }
  header, nav, .heading, #notice, button, #board-lookup { display:none!important; }
  #workspace { max-width:none; padding:0; }
  .panel { border:0; break-inside:avoid; box-shadow:none; }
  .board-timeline { overflow:visible; }
  .board-stage { flex-basis:12%; min-width:0; }
}
