/* ============================================================
   BALIKBAYAN BOX 3D PLANNER — kitchen-table aesthetic
   display: Archivo Black · stamps: Oswald · hand: Permanent Marker
   body: Karla
   ============================================================ */

@font-face { font-family: 'Archivo Black'; src: url('../vendor/fonts/archivo-black.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Oswald'; src: url('../vendor/fonts/oswald.woff2') format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'Permanent Marker'; src: url('../vendor/fonts/permanent-marker.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Karla'; src: url('../vendor/fonts/karla.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  --kraft: #c8a165;
  --kraft-light: #d9b67e;
  --kraft-dark: #a97f47;
  --paper: #f3e7cf;
  --paper-line: #c9b28c;
  --ink: #33261a;
  --ink-soft: #5c4a35;
  --stamp-red: #b3402e;
  --stamp-blue: #2e5d8c;
  --tape: rgba(233, 214, 160, 0.55);
  --lcd-bg: #2a2d22;
  --lcd-on: #ffb648;
  --ok: #4c7a3f;
  --warn: #b07514;
  --bad: #b3402e;
  --shadow: 0 10px 30px rgba(35, 20, 5, 0.35);
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Karla', 'Segoe UI', sans-serif;
  color: var(--ink);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- the kitchen table ---------- */
#table-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 800px at 18% -10%, rgba(255, 236, 190, 0.55), transparent 60%),
    radial-gradient(900px 700px at 85% 110%, rgba(60, 30, 8, 0.5), transparent 65%),
    repeating-linear-gradient(90deg,
      #8a5a33 0px, #916039 90px, #87572f 180px, #8f5e37 270px, #845430 360px),
    #8a5a33;
}
#table-bg::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.9; mix-blend-mode: multiply;
}
#table-bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(0,0,0,0.07) 34px 35px),
    linear-gradient(180deg, rgba(255,240,210,0.10), rgba(0,0,0,0.22));
}

/* ---------- masthead: the cargo flyer strip ---------- */
#masthead {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px 8px;
  background: linear-gradient(180deg, #efe0c2, #e6d3ac);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 18px rgba(30, 15, 2, 0.4);
  position: relative; z-index: 20;
}
#masthead::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 5px;
  background: repeating-linear-gradient(90deg, var(--stamp-red) 0 26px, transparent 26px 52px);
  opacity: 0.25; pointer-events: none;
}
.mast-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mast-title h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(19px, 2.3vw, 27px);
  letter-spacing: 0.5px; line-height: 1;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(179, 64, 46, 0.25);
  white-space: nowrap;
}
.mast-title .amp { color: var(--stamp-red); }
.mast-sub {
  font-family: 'Permanent Marker', cursive;
  font-size: 13px; color: var(--ink-soft); margin-top: 2px;
  transform: rotate(-1.2deg);
}
.mast-sub em { color: var(--stamp-red); font-style: normal; }

.stamp-round {
  width: 56px; height: 56px; flex: none;
  border: 2.5px solid var(--stamp-red); border-radius: 50%;
  color: var(--stamp-red);
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 10.5px;
  display: grid; place-items: center; text-align: center; line-height: 1.25;
  transform: rotate(-12deg); opacity: 0.85;
  box-shadow: inset 0 0 0 1.5px rgba(179,64,46,0.35);
  animation: stamp-in 0.5s cubic-bezier(.2,1.6,.4,1) both;
  user-select: none;
}
@keyframes stamp-in { from { transform: rotate(-12deg) scale(1.9); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 0.85; } }

#countdown-chip {
  margin-left: auto;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--lcd-bg); color: var(--lcd-on);
  border-radius: 6px; padding: 5px 14px;
  border: 2px solid #17190f;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 2px 0 rgba(255,255,255,0.25);
  font-family: 'Oswald', sans-serif;
  cursor: default; transition: transform .15s;
}
#countdown-chip:hover { transform: translateY(-1px); }
.chip-label { font-size: 9px; letter-spacing: 2.5px; opacity: 0.75; }
.chip-value { font-size: 15px; font-weight: 600; letter-spacing: 1px; }

.mast-right { display: flex; align-items: center; gap: 10px; }
.lcd {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  background: var(--lcd-bg); color: var(--lcd-on);
  border-radius: 6px; padding: 4px 12px;
  border: 2px solid #17190f;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 2px 0 rgba(255,255,255,0.25);
  font-family: 'Oswald', sans-serif; min-width: 86px;
}
.lcd-label { font-size: 9px; letter-spacing: 2.5px; opacity: 0.75; }
.lcd-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lcd.bump .lcd-val { animation: lcd-bump .35s; }
@keyframes lcd-bump { 40% { transform: scale(1.18); text-shadow: 0 0 12px var(--lcd-on); } }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: transform .12s, background .12s;
}
.icon-btn:hover { transform: rotate(-8deg) scale(1.06); background: #fff6e2; }
.icon-btn[aria-pressed="false"] .snd-wave { opacity: 0.15; }
.icon-btn[aria-pressed="false"]::after {
  content: ''; position: absolute; width: 26px; height: 2.5px; background: var(--stamp-red);
  transform: rotate(-45deg) translate(0px, 0px); border-radius: 2px;
}
.icon-btn { position: relative; }

/* ---------- app grid ---------- */
#app {
  display: grid;
  grid-template-columns: 348px minmax(0, 1fr) 326px;
  gap: 14px;
  padding: 14px;
  height: calc(100vh - 66px);
  min-height: 0;
}

.panel {
  min-height: 0;
  display: flex; flex-direction: column;
  background: linear-gradient(165deg, var(--kraft-light), var(--kraft) 55%, var(--kraft-dark));
  border: 1px solid #7c5a30;
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,240,210,0.5);
  position: relative;
}
.panel::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius); pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0 0.05 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23k)'/%3E%3C/svg%3E");
}

/* ---------- catalog (shopping list on ruled paper) ---------- */
.panel-head { padding: 12px 14px 8px; position: relative; }
.paper-head {
  margin: 10px 10px 0; padding: 12px 14px 10px;
  background:
    repeating-linear-gradient(180deg, transparent 0 21px, rgba(120, 150, 190, 0.28) 21px 22px),
    linear-gradient(180deg, #fdf7e8, #f6ecd4);
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(40, 20, 4, 0.3);
  transform: rotate(-0.6deg);
  position: relative; z-index: 1;
  border-left: 3px solid rgba(179, 64, 46, 0.35);
}
.paper-tape {
  position: absolute; top: -9px; left: 50%; width: 92px; height: 20px;
  transform: translateX(-50%) rotate(1.5deg);
  background: var(--tape);
  border-left: 1px dashed rgba(120, 90, 40, 0.4);
  border-right: 1px dashed rgba(120, 90, 40, 0.4);
  box-shadow: 0 2px 4px rgba(60, 35, 8, 0.25);
}
.paper-head h2.hand {
  font-family: 'Permanent Marker', cursive; font-size: 21px; color: #27418f;
  font-weight: 400; line-height: 1.1;
}
.hand-small { font-size: 12px; opacity: 0.7; display: inline-block; transform: rotate(-1deg); }
.paper-note {
  font-family: 'Permanent Marker', cursive; font-size: 12.5px; color: var(--ink-soft);
  margin-top: 3px; transform: rotate(-0.8deg);
}

.catalog-tools { padding: 10px 12px 6px; position: relative; z-index: 1; }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #f8efdb; border: 1.5px solid #8a6636; border-radius: 20px;
  padding: 7px 12px; color: var(--ink-soft);
  box-shadow: inset 0 2px 4px rgba(90, 60, 20, 0.18);
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within { border-color: var(--stamp-blue); box-shadow: inset 0 2px 4px rgba(90,60,20,.18), 0 0 0 3px rgba(46, 93, 140, 0.22); }
.search-wrap input { border: 0; background: transparent; outline: 0; font: inherit; font-size: 13.5px; width: 100%; color: var(--ink); }

.chip-row { display: flex; gap: 6px; margin-top: 9px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip-row-small { margin-top: 4px; }
.chip {
  flex: none; font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 11.5px;
  letter-spacing: 0.8px; text-transform: uppercase;
  padding: 4px 11px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--ink-soft); color: var(--ink);
  background: rgba(255, 244, 216, 0.55);
  transition: all .14s;
  user-select: none;
}
.chip:hover { transform: translateY(-1px); background: #fff3d8; }
.chip.is-on { background: var(--ink); color: #f6e7c6; border-color: var(--ink); box-shadow: 0 2px 6px rgba(30,15,2,.35); }
.chip .chip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.catalog-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 4px 10px 10px; position: relative; z-index: 1;
  scrollbar-width: thin; scrollbar-color: #8a6636 transparent;
}
.catalog-list::-webkit-scrollbar { width: 8px; }
.catalog-list::-webkit-scrollbar-thumb { background: #8a6636; border-radius: 4px; }

.cat-item {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center;
  background: rgba(255, 246, 224, 0.72);
  border: 1px solid rgba(122, 88, 42, 0.45);
  border-radius: 7px; padding: 8px 9px; margin-bottom: 7px;
  cursor: pointer; position: relative;
  transition: transform .13s, box-shadow .13s, background .13s;
  animation: card-in .3s both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.cat-item:hover { transform: translateX(3px); background: #fff6e0; box-shadow: 0 3px 10px rgba(50, 28, 6, 0.25); }
.cat-item:focus-visible { outline: 2px solid var(--stamp-blue); outline-offset: 1px; }
.cat-item.placing { outline: 2px solid var(--ok); background: #eef4e2; }
.cat-item.is-bawal { background: repeating-linear-gradient(-45deg, rgba(179,64,46,0.07) 0 8px, rgba(255,246,224,0.72) 8px 16px); }

.cat-swatch {
  width: 44px; height: 44px; border-radius: 6px; position: relative; overflow: hidden;
  display: grid; place-items: center;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: inset 0 -8px 12px rgba(0,0,0,0.12);
}
.cat-swatch .sw-shape { position: relative; display: block; filter: drop-shadow(0 2px 1px rgba(0,0,0,0.32)); }
.cat-swatch .sw-shape::before, .cat-swatch .sw-shape::after { content: ''; position: absolute; }

/* box / carton */
.sw-shape.sw-box { width: 30px; height: 23px; border-radius: 3px; box-shadow: inset 0 -6px 8px rgba(0,0,0,.24), inset 0 2px 3px rgba(255,255,255,.28); }
.sw-shape.sw-box::before { left: 0; right: 0; top: 0; height: 7px; background: rgba(0,0,0,.3); border-radius: 3px 3px 0 0; }
.sw-shape.sw-box::after { left: 16%; right: 16%; top: 48%; height: 7px; background: rgba(255,255,255,.82); border-radius: 1px; }

/* can / jar / roll / pot / cooker */
.sw-shape.sw-round { width: 22px; height: 26px; border-radius: 5px; box-shadow: inset 0 -5px 7px rgba(0,0,0,.26), inset 3px 0 5px rgba(255,255,255,.2); }
.sw-shape.sw-round::before { left: 0; right: 0; top: 0; height: 5px; background: rgba(255,255,255,.6); border-radius: 5px 5px 2px 2px; }
.sw-shape.sw-round::after { left: 0; right: 0; top: 42%; height: 8px; background: rgba(255,255,255,.74); }

/* bottle / tumbler / wine */
.sw-shape.sw-tall { width: 14px; height: 30px; border-radius: 4px 4px 3px 3px; box-shadow: inset -3px 0 4px rgba(0,0,0,.24), inset 2px 0 3px rgba(255,255,255,.22); }
.sw-shape.sw-tall::before { width: 8px; height: 6px; top: -5px; left: 3px; background: rgba(0,0,0,.42); border-radius: 2px; }
.sw-shape.sw-tall::after { left: 0; right: 0; top: 50%; height: 9px; background: rgba(255,255,255,.8); }

/* bag */
.sw-shape.sw-bag { width: 26px; height: 26px; border-radius: 3px; box-shadow: inset 0 -5px 7px rgba(0,0,0,.24); }
.sw-shape.sw-bag::before { left: 0; right: 0; top: 0; height: 6px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.38) 0 3px, transparent 3px 6px); }
.sw-shape.sw-bag::after { left: 20%; right: 20%; top: 48%; height: 6px; background: rgba(255,255,255,.74); border-radius: 1px; }

/* soft / folded goods */
.sw-shape.sw-soft { width: 30px; height: 19px; border-radius: 3px; box-shadow: inset 0 -4px 6px rgba(0,0,0,.22), 0 2px 0 rgba(0,0,0,.14); }
.sw-shape.sw-soft::before { left: 2px; right: 2px; top: -4px; height: 8px; background: rgba(255,255,255,.26); border-radius: 3px; }
.sw-shape.sw-soft::after { top: -3px; bottom: 0; left: 47%; width: 2px; background: rgba(0,0,0,.28); }
.cat-info { min-width: 0; }
.cat-name { font-weight: 700; font-size: 13.5px; line-height: 1.15; }
.cat-meta { font-family: 'Oswald', sans-serif; font-size: 10.5px; letter-spacing: 0.6px; color: var(--ink-soft); margin-top: 2px; text-transform: uppercase; }
.cat-note { font-size: 11px; color: var(--ink-soft); font-style: italic; margin-top: 2px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cat-price { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px; color: var(--stamp-blue); white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 0; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; background: #fdf4de; }
.stepper button {
  width: 24px; height: 24px; border: 0; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1;
  transition: background .1s;
}
.stepper button:hover { background: var(--ink); color: #f6e7c6; }
.stepper .qty { width: 26px; text-align: center; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px; }
.add-btn {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 1.2px;
  text-transform: uppercase; border: 0; border-radius: 5px; padding: 5px 12px;
  background: var(--stamp-red); color: #fdf1dc; cursor: pointer;
  box-shadow: 0 2px 0 #7c2a1d; transition: transform .1s, box-shadow .1s, background .12s;
}
.add-btn:hover { background: #c74b37; transform: translateY(-1px); box-shadow: 0 3px 0 #7c2a1d; }
.add-btn:active { transform: translateY(1px); box-shadow: 0 0 0 #7c2a1d; }
.add-btn.bawal-btn { background: #6b6157; box-shadow: 0 2px 0 #403a32; }
.catalog-count { padding: 6px 14px 10px; font-size: 11px; color: #4d3a22; font-family: 'Oswald', sans-serif; letter-spacing: 1px; text-transform: uppercase; position: relative; z-index: 1; }

/* ---------- stage ---------- */
#stage-panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: linear-gradient(180deg, #efe0c2, #e2cda2);
  border: 1px solid #7c5a30; border-radius: var(--radius);
  padding: 7px 10px; box-shadow: var(--shadow);
}
.size-tabs { display: flex; gap: 4px; }
.size-tab {
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: 0.8px;
  text-transform: uppercase; padding: 6px 10px; border-radius: 5px; cursor: pointer;
  border: 1.5px solid transparent; background: transparent; color: var(--ink-soft);
  transition: all .13s; position: relative;
}
.size-tab small { display: block; font-size: 8.5px; letter-spacing: 0.4px; opacity: 0.75; text-transform: none; }
.size-tab:hover { background: rgba(255, 244, 216, 0.7); }
.size-tab.is-on { background: var(--ink); color: #f6e7c6; box-shadow: 0 2px 6px rgba(30,15,2,.4); }
.toolbar-sep { width: 1.5px; align-self: stretch; background: rgba(90, 62, 28, 0.35); margin: 2px 2px; }
.tool-group { display: flex; gap: 5px; }
.tool-btn {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 11.5px; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--ink);
  background: rgba(255, 246, 224, 0.7); border: 1.5px solid var(--ink-soft); border-radius: 5px;
  padding: 6px 9px; cursor: pointer; transition: all .12s;
}
.tool-btn kbd {
  font-family: 'Oswald', sans-serif; font-size: 9px; background: var(--ink); color: #f0e2c2;
  border-radius: 3px; padding: 1px 4px; opacity: 0.75;
}
.tool-btn:hover:not(:disabled) { background: #fff6e0; transform: translateY(-1px); box-shadow: 0 3px 8px rgba(50,28,6,.25); }
.tool-btn:disabled { opacity: 0.4; cursor: default; }
.tool-btn[aria-pressed="true"] { background: var(--stamp-blue); color: #eef3fa; border-color: var(--stamp-blue); }
.toolbar-spacer { flex: 1; }
.seal-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Archivo Black', sans-serif; font-size: 13px; letter-spacing: 0.5px;
  background: linear-gradient(180deg, #c74b37, var(--stamp-red)); color: #fdf1dc;
  border: 2px solid #7c2a1d; border-radius: 7px; padding: 8px 16px; cursor: pointer;
  box-shadow: 0 3px 0 #7c2a1d, 0 6px 14px rgba(124, 42, 29, 0.4);
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.seal-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 5px 0 #7c2a1d, 0 10px 18px rgba(124,42,29,.45); }
.seal-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 0 #7c2a1d; }
.seal-btn:disabled { filter: grayscale(0.7) brightness(0.85); cursor: default; box-shadow: 0 2px 0 #5c4433; }
.seal-tag { font-family: 'Permanent Marker', cursive; font-size: 11px; opacity: 0.85; transform: rotate(-2deg); }

#stage {
  position: relative; flex: 1; min-height: 0; margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(140% 100% at 50% 0%, rgba(255, 240, 205, 0.35), rgba(46, 24, 6, 0.0) 55%),
    linear-gradient(180deg, rgba(30, 15, 3, 0.15), rgba(30, 15, 3, 0.42));
  box-shadow: inset 0 0 60px rgba(25, 12, 2, 0.5), var(--shadow);
  border: 1px solid rgba(60, 36, 12, 0.6);
}
#scene { display: block; width: 100%; height: 100%; outline: none; touch-action: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.placing { cursor: crosshair; }

.hud {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(24, 13, 3, 0.78); color: #f6e7c6;
  border: 1px solid rgba(246, 231, 198, 0.3);
  border-radius: 7px; padding: 7px 12px;
  font-size: 12.5px; backdrop-filter: blur(3px);
  display: flex; align-items: center; gap: 10px;
}
.hud.hidden { display: none; }
#placement-hud { top: 12px; left: 50%; transform: translateX(-50%); }
#placement-hud .hud-name { font-weight: 700; }
#placement-hud .hud-dims { font-family: 'Oswald', sans-serif; letter-spacing: 0.6px; opacity: 0.85; }
#placement-hud .hud-hint { opacity: 0.7; font-size: 11.5px; }
#placement-hud.invalid { border-color: var(--stamp-red); }
#placement-hud.invalid .hud-name { color: #ff9d8a; }

#sel-hud { bottom: 74px; left: 50%; transform: translateX(-50%); pointer-events: auto; }
.hud-mini {
  font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
  background: rgba(246, 231, 198, 0.14); color: #f6e7c6; border: 1px solid rgba(246,231,198,0.4);
  border-radius: 5px; padding: 4px 9px; cursor: pointer; transition: background .12s;
}
.hud-mini:hover { background: rgba(246, 231, 198, 0.3); }
.hud-danger:hover { background: rgba(179, 64, 46, 0.6); }

.hint-card {
  left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-1deg);
  flex-direction: column; gap: 4px; text-align: center;
  background: rgba(253, 247, 232, 0.94); color: var(--ink);
  border: 1px dashed var(--ink-soft); padding: 16px 22px;
  box-shadow: 0 8px 24px rgba(25, 12, 2, 0.4);
  max-width: 330px;
  animation: hint-float 4s ease-in-out infinite;
}
@keyframes hint-float { 50% { transform: translate(-50%, calc(-50% - 7px)) rotate(-1deg); } }
.hint-card .hand { font-family: 'Permanent Marker', cursive; font-size: 19px; color: var(--stamp-red); }
.hint-card p { font-size: 13px; line-height: 1.4; }
.hint-card.hidden { display: none; }

.stage-corner-note {
  position: absolute; right: 14px; top: 10px; z-index: 4;
  font-family: 'Permanent Marker', cursive; font-size: 13px;
  color: rgba(246, 231, 198, 0.75); transform: rotate(2deg);
  pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.stage-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; align-items: stretch; gap: 0;
  background: linear-gradient(180deg, rgba(28, 15, 4, 0.55), rgba(20, 10, 2, 0.88));
  border-top: 1px solid rgba(246, 231, 198, 0.22);
  backdrop-filter: blur(4px);
  color: #f0e2c2;
}
.foot-stat {
  flex: 1; padding: 8px 14px 9px; display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid rgba(246, 231, 198, 0.12); min-width: 0;
}
.foot-stat:last-child { border-right: 0; }
.foot-label { font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px; opacity: 0.65; }
.foot-value { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-sub { font-size: 10.5px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-value.danger { color: #ff9d8a; }
.foot-value.warnv { color: var(--lcd-on); }

.fill-bar {
  height: 8px; border-radius: 5px; background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(246, 231, 198, 0.25); overflow: hidden; margin-top: 5px;
}
.fill-bar-in {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7fae5f, #b7cc52 60%, #e8c33e);
  border-radius: 5px; transition: width .45s cubic-bezier(.2,.9,.3,1);
}
.fill-bar-in.hot { background: linear-gradient(90deg, #e8a13e, #e86a3e); }
.fill-bar-fat { height: 14px; }
.fill-bar-weight .fill-bar-in { background: linear-gradient(90deg, #6f9ec9, #b0c96f 55%, #e8a13e 80%, #d94f38); }
.fill-bar-value .fill-bar-in { background: linear-gradient(90deg, #5f8fae, #8fb86a 60%, #e8c33e 85%, #d94f38); }

.balance-meter {
  position: relative; height: 8px; border-radius: 5px; margin-top: 6px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(246,231,198,0.25);
}
.balance-meter-wide { height: 10px; }
.balance-zone { position: absolute; left: 32%; right: 32%; top: 0; bottom: 0; background: rgba(127, 174, 95, 0.35); }
.balance-needle {
  position: absolute; left: 50%; top: -3px; bottom: -3px; width: 4px; margin-left: -2px;
  background: var(--lcd-on); border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 182, 72, 0.8);
  transition: left .4s cubic-bezier(.2,.9,.3,1), background .3s;
}
.balance-needle.off { background: #ff7a5c; box-shadow: 0 0 10px rgba(255, 90, 60, 0.9); }
.balance-cross { display: flex; flex-direction: column; gap: 10px; }
.balance-axis { display: flex; align-items: center; gap: 8px; }
.axis-label { font-family: 'Oswald', sans-serif; font-size: 8.5px; letter-spacing: 1.5px; opacity: 0.6; width: 42px; text-align: center; flex: none; }
.balance-meter-wide { flex: 1; }

/* ---------- right panel ---------- */
#right-panel { overflow: hidden; }
.panel-tabs { display: flex; border-bottom: 2px solid rgba(90, 62, 28, 0.4); position: relative; z-index: 1; }
.ptab {
  flex: 1; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12.5px;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 11px 0; border: 0; background: transparent; color: var(--ink-soft);
  cursor: pointer; position: relative; transition: color .15s;
}
.ptab:hover { color: var(--ink); }
.ptab.is-on { color: var(--ink); }
.ptab.is-on::after {
  content: ''; position: absolute; left: 18%; right: 18%; bottom: -2px; height: 3px;
  background: var(--stamp-red); border-radius: 2px;
}
.ptab .tab-alert {
  position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--warn); box-shadow: 0 0 6px var(--warn); display: none;
}
.ptab.has-alert .tab-alert { display: block; }

.ptab-body { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 10px 10px 6px; scrollbar-width: thin; }
.ptab-body.is-on { display: block; animation: tab-in .25s; }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.card {
  background: rgba(255, 246, 224, 0.8);
  border: 1px solid rgba(122, 88, 42, 0.5);
  border-radius: 7px; padding: 11px 13px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(50, 28, 6, 0.18);
}
.card-title {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12px;
  letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink);
  margin-bottom: 8px; display: flex; align-items: baseline; gap: 6px;
}
.card-title::before { content: ''; width: 14px; height: 3px; background: var(--stamp-red); border-radius: 2px; align-self: center; }
.tita-sub { font-family: 'Permanent Marker', cursive; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--ink-soft); }

.big-fill { display: flex; align-items: baseline; gap: 10px; }
.big-fill-num {
  font-family: 'Archivo Black', sans-serif; font-size: 40px; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.big-fill-num.full { color: var(--ok); }
.big-fill-word { font-family: 'Permanent Marker', cursive; font-size: 16px; color: var(--stamp-red); transform: rotate(-2deg); }

.gauge-row { display: flex; align-items: baseline; gap: 10px; }
.gauge-big { font-family: 'Archivo Black', sans-serif; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-big.danger { color: var(--bad); }
.gauge-small { font-family: 'Oswald', sans-serif; font-size: 11.5px; letter-spacing: 0.8px; color: var(--ink-soft); text-transform: uppercase; }
.gauge-note { font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); margin-top: 7px; }
.gauge-note b { color: var(--ink); }

.flag-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.flag {
  font-size: 12px; line-height: 1.35; padding: 7px 9px 7px 26px; border-radius: 6px;
  position: relative; background: rgba(127, 174, 95, 0.14); border: 1px solid rgba(76, 122, 63, 0.35);
  animation: flag-in .3s both;
}
@keyframes flag-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; } }
.flag::before { position: absolute; left: 8px; top: 6px; font-size: 12px; }
.flag-ok::before { content: '\2714'; color: var(--ok); }
.flag-info { background: rgba(46, 93, 140, 0.1); border-color: rgba(46, 93, 140, 0.35); }
.flag-info::before { content: '\2139'; color: var(--stamp-blue); font-weight: 700; }
.flag-warn { background: rgba(176, 117, 20, 0.13); border-color: rgba(176, 117, 20, 0.45); }
.flag-warn::before { content: '\26A0'; color: var(--warn); }
.flag-stop { background: rgba(179, 64, 46, 0.13); border-color: rgba(179, 64, 46, 0.5); }
.flag-stop::before { content: '\2716'; color: var(--bad); }

.fda-list { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.fda-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 11.5px; padding: 5px 8px; border-radius: 5px; background: rgba(0,0,0,0.04); }
.fda-row .fda-name { font-weight: 700; }
.fda-row .fda-use { font-family: 'Oswald', sans-serif; font-size: 10.5px; letter-spacing: 0.5px; color: var(--ink-soft); }
.fda-row.over { background: rgba(176, 117, 20, 0.16); }
.fda-row.over .fda-use { color: var(--warn); font-weight: 600; }
.fda-bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(0,0,0,0.14); overflow: hidden; }
.fda-bar-in { height: 100%; background: #7fae5f; border-radius: 3px; transition: width .4s; }
.fda-row.over .fda-bar-in { background: var(--warn); }

/* shipping */
.field-label { font-family: 'Oswald', sans-serif; font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.select {
  width: 100%; font: inherit; font-size: 13px; padding: 8px 10px;
  border: 1.5px solid var(--ink-soft); border-radius: 6px; background: #fdf4de; color: var(--ink);
  cursor: pointer; margin-bottom: 10px;
}
.ship-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ship-card {
  border-radius: 7px; padding: 10px 11px; position: relative; overflow: hidden;
  border: 1.5px solid; transition: transform .15s, box-shadow .15s;
}
.ship-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(50,28,6,.25); }
.ship-sea { background: linear-gradient(165deg, #e3edf5, #c8dbe9); border-color: #5b84a8; }
.ship-air { background: linear-gradient(165deg, #f7e8dc, #eed2bb); border-color: #b07a4e; }
.ship-mode { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 10px; letter-spacing: 2px; opacity: 0.7; }
.ship-price { font-family: 'Archivo Black', sans-serif; font-size: 19px; margin: 3px 0 1px; }
.ship-meta { font-size: 10px; opacity: 0.65; }
.ship-time { font-family: 'Oswald', sans-serif; font-size: 12px; margin-top: 5px; letter-spacing: 0.5px; }
.ship-verdict { font-family: 'Permanent Marker', cursive; font-size: 11.5px; margin-top: 4px; transform: rotate(-1deg); }
.ship-good { color: #2e6b8c; }
.ship-air .ship-verdict { color: var(--stamp-red); }

.countdown { display: flex; align-items: center; gap: 12px; }
.cd-num {
  font-family: 'Archivo Black', sans-serif; font-size: 42px; line-height: 1;
  color: var(--stamp-red); font-variant-numeric: tabular-nums; min-width: 74px; text-align: center;
}
.cd-num.urgent { animation: cd-pulse 1.6s infinite; }
@keyframes cd-pulse { 50% { transform: scale(1.06); color: #d94f38; } }
.cd-unit { font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-soft); line-height: 1.5; }

.docs-row { display: flex; gap: 8px; padding: 10px; border-top: 2px solid rgba(90, 62, 28, 0.4); position: relative; z-index: 1; }
.doc-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 10px 6px; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--ink); background: rgba(255, 246, 224, 0.85); color: var(--ink);
  transition: all .13s;
}
.doc-btn:hover:not(:disabled) { background: var(--ink); color: #f6e7c6; transform: translateY(-1px); }
.doc-btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- toasts ---------- */
#toast-rack { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(24, 13, 3, 0.92); color: #f6e7c6; border: 1px solid rgba(246,231,198,0.3);
  border-radius: 8px; padding: 9px 16px; font-size: 13px; max-width: min(520px, 90vw);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5); text-align: center;
  animation: toast-in .3s cubic-bezier(.2,1.4,.4,1) both;
}
.toast.warn { border-color: var(--warn); }
.toast.warn b { color: var(--lcd-on); }
.toast.bad { border-color: var(--stamp-red); }
.toast.bad b { color: #ff9d8a; }
.toast.good b { color: #a8d18a; }
.toast.out { animation: toast-out .3s both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------- modals ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(20, 10, 2, 0.66); backdrop-filter: blur(3px);
  animation: modal-bg .2s both;
}
.modal-root.hidden { display: none; }
@keyframes modal-bg { from { opacity: 0; } }
.modal {
  background: linear-gradient(170deg, #fdf7e8, #f3e7cf);
  border: 2px solid var(--ink); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  padding: 22px 24px; max-width: min(560px, 92vw); width: 100%;
  max-height: 88vh; overflow-y: auto;
  animation: modal-in .3s cubic-bezier(.2,1.3,.4,1) both;
  position: relative;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(24px) scale(.95); } }
.modal-title { font-family: 'Archivo Black', sans-serif; font-size: 21px; margin-bottom: 10px; }
.modal-refused { border-color: var(--stamp-red); max-width: 470px; }
.refused-stamp {
  position: absolute; top: 14px; right: 16px;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 3px;
  color: var(--stamp-red); border: 3px solid var(--stamp-red); border-radius: 5px;
  padding: 3px 10px; transform: rotate(9deg); opacity: 0.85;
  animation: stamp-in .4s cubic-bezier(.2,1.6,.4,1) both;
}
.refused-item { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.refused-reason { font-size: 13.5px; line-height: 1.5; margin-bottom: 8px; }
.refused-rule { font-size: 12px; color: var(--ink-soft); font-style: italic; margin-bottom: 14px; }
.btn {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 9px 18px; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; color: var(--ink);
  transition: all .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(50,28,6,.3); }
.btn-primary { background: var(--stamp-red); border-color: #7c2a1d; color: #fdf1dc; }
.btn-primary:hover { background: #c74b37; }

.modal-docs { max-width: min(760px, 95vw); padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal-docs-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-x { font-size: 26px; border: 0; background: transparent; cursor: pointer; color: var(--ink-soft); line-height: 1; padding: 4px 8px; border-radius: 6px; }
.modal-x:hover { background: rgba(0,0,0,0.08); color: var(--ink); }
.docs-tabs { display: flex; gap: 6px; padding: 10px 20px; }
.doc-tab {
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 12px; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 7px 16px; border-radius: 6px 6px 0 0; cursor: pointer;
  border: 1.5px solid var(--ink-soft); border-bottom: 0; background: transparent; color: var(--ink-soft);
}
.doc-tab.is-on { background: #fff; color: var(--ink); border-color: var(--ink); }
.docs-scroll { flex: 1; overflow-y: auto; background: #8a7a63; padding: 18px; min-height: 300px; }
.doc-wrap.hidden { display: none; }
.doc-wrap .doc-paper { background: #fff; max-width: 640px; margin: 0 auto; padding: 26px 30px; box-shadow: 0 8px 26px rgba(0,0,0,0.45); color: #1c1c1c; font-size: 12.5px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1.5px solid rgba(0,0,0,0.15); background: #f3e7cf; }

/* document paper styles */
.doc-paper h1 { font-family: 'Oswald', sans-serif; font-size: 17px; letter-spacing: 2.5px; text-transform: uppercase; border-bottom: 2.5px solid #1c1c1c; padding-bottom: 6px; }
.doc-paper .doc-sub { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #555; margin-top: 3px; }
.doc-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.doc-table th { font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; text-align: left; border-bottom: 2px solid #1c1c1c; padding: 5px 6px; }
.doc-table td { border-bottom: 1px solid #bbb; padding: 5px 6px; vertical-align: top; }
.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.doc-total td { border-bottom: 0; border-top: 2.5px solid #1c1c1c; font-weight: 700; }
.doc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.doc-field { border: 1.5px solid #1c1c1c; padding: 8px 10px 22px; min-height: 62px; }
.doc-field span { font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: #555; }
.doc-field .val { display: block; font-size: 13px; margin-top: 3px; font-weight: 700; }
.doc-note { font-size: 10.5px; color: #555; margin-top: 12px; line-height: 1.5; }
.doc-sign { margin-top: 22px; display: flex; justify-content: space-between; gap: 20px; }
.doc-sign div { flex: 1; border-top: 1.5px solid #1c1c1c; padding-top: 4px; font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: #555; text-align: center; }

/* box label */
.label-paper { border: 3px solid #1c1c1c !important; position: relative; }
.label-grid { display: grid; grid-template-columns: 1fr 1fr; }
.label-cell { border: 1.5px solid #1c1c1c; padding: 10px 12px 18px; min-height: 96px; }
.label-cell span { font-family: 'Oswald', sans-serif; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; }
.label-cell .val { display: block; font-size: 14px; font-weight: 700; margin-top: 4px; line-height: 1.45; }
.label-cell.to-cell { background: #fffbe9; }
.label-marks { display: flex; gap: 10px; margin-top: 10px; align-items: stretch; }
.label-mark {
  border: 2.5px solid #1c1c1c; padding: 8px 14px; font-family: 'Oswald', sans-serif;
  font-weight: 600; letter-spacing: 2px; font-size: 13px; text-align: center;
}
.label-mark.arrows { font-size: 17px; letter-spacing: 4px; line-height: 1; }
.label-mark.fragile { color: var(--stamp-red); border-color: var(--stamp-red); }
.label-meta { margin-top: 10px; display: flex; gap: 16px; font-family: 'Oswald', sans-serif; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.label-msg {
  margin-top: 12px; border: 1.5px dashed #888; padding: 10px 14px; min-height: 52px;
  font-family: 'Permanent Marker', cursive; font-size: 16px; color: #27418f; transform: rotate(-0.5deg);
}
.label-msg span { font-family: 'Oswald', sans-serif; font-size: 9px; letter-spacing: 2px; color: #888; display: block; text-transform: uppercase; }
.label-barcode { margin-top: 12px; height: 40px; background: repeating-linear-gradient(90deg, #1c1c1c 0 2px, transparent 2px 5px, #1c1c1c 5px 6px, transparent 6px 10px, #1c1c1c 10px 13px, transparent 13px 15px); }
.label-stamp {
  position: absolute; top: 10px; right: 12px; transform: rotate(8deg);
  border: 2.5px solid var(--stamp-blue); color: var(--stamp-blue); border-radius: 50%;
  width: 74px; height: 74px; display: grid; place-items: center; text-align: center;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 9px; letter-spacing: 1px;
  opacity: 0.8;
}

/* editable doc inputs */
.doc-input { font: inherit; font-weight: 700; border: 0; border-bottom: 1.5px dashed #999; width: 100%; background: transparent; padding: 2px 0; color: #1c1c1c; }
.doc-input:focus { outline: 0; border-bottom-color: var(--stamp-blue); }
textarea.doc-input { resize: vertical; font-family: 'Permanent Marker', cursive; font-weight: 400; font-size: 15px; }

/* ---------- seal overlay ---------- */
#seal-overlay {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background: radial-gradient(80% 70% at 50% 45%, transparent 40%, rgba(15, 7, 1, 0.55));
}
#seal-overlay.hidden { display: none; }
.seal-caption {
  position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%) rotate(-1.5deg);
  font-family: 'Permanent Marker', cursive; font-size: clamp(20px, 3.4vw, 32px);
  color: #f6e7c6; text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  animation: cap-in .5s both;
}
@keyframes cap-in { from { opacity: 0; transform: translateX(-50%) translateY(16px) rotate(-1.5deg); } }

/* ---------- mobile ---------- */
#mobile-tabs { display: none; }

@media (max-width: 1120px) {
  #app { grid-template-columns: 300px minmax(0,1fr) 290px; gap: 10px; padding: 10px; }
}

@media (max-width: 920px) {
  body { overflow: auto; }
  #app { display: flex; flex-direction: column; height: auto; }
  #stage-panel { order: 0; height: 56vh; min-height: 420px; }
  #catalog-panel, #right-panel { order: 1; }
  #mobile-tabs {
    display: flex; order: 1; gap: 6px; margin-bottom: 2px;
  }
  .mob-tab {
    flex: 1; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px;
    letter-spacing: 1.5px; text-transform: uppercase; padding: 11px 0;
    border: 2px solid var(--ink); border-radius: 7px; background: rgba(255,246,224,.85);
    color: var(--ink); cursor: pointer;
  }
  .mob-tab.is-on { background: var(--ink); color: #f6e7c6; }
  body[data-mtab="shop"] #right-panel { display: none; }
  body[data-mtab="panel"] #catalog-panel { display: none; }
  #catalog-panel { max-height: 70vh; }
  #right-panel { max-height: 70vh; }
  .mast-mid, #countdown-chip { display: none; }
  #masthead { padding: 8px 12px; gap: 10px; }
  .mast-right .lcd { display: none; }
  .stamp-round { width: 42px; height: 42px; font-size: 8px; }
  .mast-title h1 { font-size: 20px; }
  .mast-sub { font-size: 11px; }
  #toast-rack { top: 64px; max-width: 92vw; }
  .stage-foot { flex-wrap: wrap; }
  .foot-stat { flex: 1 1 33%; border-top: 1px solid rgba(246,231,198,0.12); }
  .tool-btn span, .tool-btn kbd { display: none; }
  .seal-btn .seal-tag { display: none; }
  .stage-corner-note { display: none; }
}

/* ---------- print ---------- */
@media print {
  body { overflow: visible; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .doc-paper { box-shadow: none !important; max-width: 100% !important; }
  #table-bg { display: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
