/* Birthday OS 98 — Warm Cream Windows 95/98 Retro Desktop + 3 Core Apps + 5-Step Cake Bakery */

:root {
  --os-wallpaper: #e7d6be;
  --os-surface: #efe5d5;
  --os-surface-alt: #f8f1e4;
  --os-highlight: #fffcf5;
  --os-shadow-mid: #b8a38c;
  --os-shadow-dark: #635042;
  --os-title-a: #c27d62;
  --os-title-b: #dd9f7e;
  --os-title-text: #fffaf2;
  --os-accent: #c46858;
  --os-accent-warm: #e6a85c;
  --os-ink: #3c2d25;
  --os-ink-soft: #6e584a;
  --os-font: "Microsoft YaHei", "PingFang SC", "SimSun", system-ui, sans-serif;
}

/* ================= 3D ROOM TOAST & CAKE BLOW CONTROLS ================= */
#room-toast {
  position: fixed;
  top: max(70px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 30;
  padding: 10px 18px;
  border-radius: 2px;
  background: #3e312b;
  border: 2px solid;
  border-color: #f3e4cd #6e584a #6e584a #f3e4cd;
  color: #fff5e6;
  font-size: 13px;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 22px rgba(18, 12, 16, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#room-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#cake-controls {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 25;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 14px 18px;
  background: rgba(46, 36, 32, 0.94);
  border: 2px solid;
  border-color: #f1dec2 #6a5446 #6a5446 #f1dec2;
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(16, 11, 18, 0.45);
  color: #fff4e6;
}
#cake-controls[hidden] { display: none; }
#cake-status { margin: 0 0 10px; font-size: 14px; line-height: 1.5; }
.cake-control-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cake-control-actions button {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 2px;
  border: 2px solid;
  border-color: #d9c5ae #2b201c #2b201c #d9c5ae;
  background: #57453e;
  color: #fff6ea;
  font-size: 13.5px;
  cursor: pointer;
}
.cake-control-actions button:active {
  border-color: #2b201c #d9c5ae #d9c5ae #2b201c;
}
.cake-control-actions button.primary {
  background: #e9bc77;
  color: #35241b;
  border-color: #fff2d6 #8a622e #8a622e #fff2d6;
  font-weight: 700;
}
.cake-control-actions button[aria-pressed="true"] {
  background: #c46858;
  color: #fffaf4;
}
.cake-control-actions button[hidden] { display: none; }

/* ================= WIN95/98 REUSABLE BEVEL PRIMITIVES ================= */
.win-bevel-out {
  background: var(--os-surface);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  box-shadow: inset 1px 1px 0 #f7efe2, inset -1px -1px 0 var(--os-shadow-mid);
}

.win-bevel-in {
  background: var(--os-surface-alt);
  border: 2px solid;
  border-color: var(--os-shadow-mid) var(--os-highlight) var(--os-highlight) var(--os-shadow-mid);
  box-shadow: inset 1px 1px 0 var(--os-shadow-dark);
}

.win-btn,
.os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  min-height: 32px;
  background: var(--os-surface);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  box-shadow: inset -1px -1px 0 var(--os-shadow-mid);
  border-radius: 0;
  font-family: var(--os-font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.win-btn:hover:not(:disabled),
.os-btn:hover:not(:disabled) {
  background: #f5ecdc;
}
.win-btn:active:not(:disabled),
.win-btn.active,
.os-btn:active:not(:disabled) {
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
  box-shadow: inset 1px 1px 0 var(--os-shadow-mid);
  background: #e5d7c3;
  transform: translate(1px, 1px);
}
.win-btn:disabled,
.os-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}
.win-btn-sm,
.os-btn-sm {
  min-height: 28px;
  padding: 4px 9px;
  font-size: 12px;
}
.win-btn-primary,
.os-btn-accent {
  background: #e9be83;
  color: #36241b;
  border-color: #fff6e0 #7e562d #7e562d #fff6e0;
  box-shadow: inset -1px -1px 0 #c69558;
}
.win-btn-primary:hover:not(:disabled),
.os-btn-accent:hover:not(:disabled) {
  background: #f1cb94;
}

.win-ctrl-btn {
  width: 21px;
  height: 19px;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--os-surface);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-family: monospace;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.win-ctrl-btn:active {
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
}
.win-ctrl-close {
  background: #e7c8bc;
}

/* Win95 Segmented Progress Bar */
.win-progress {
  position: relative;
  height: 20px;
  padding: 2px;
  background: #fffcf5;
  border: 2px solid;
  border-color: var(--os-shadow-mid) var(--os-highlight) var(--os-highlight) var(--os-shadow-mid);
  overflow: hidden;
}
.win-progress-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    var(--os-accent) 0 10px,
    transparent 10px 13px
  );
  transition: width 0.12s linear;
}
.win-progress-fill.good {
  background: repeating-linear-gradient(
    90deg,
    #789c68 0 10px,
    transparent 10px 13px
  );
}

/* ================= FULLSCREEN RETRO CRT OVERLAY ================= */
#desktop-os {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(26, 20, 18, 0.78);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  font-family: var(--os-font);
  color: var(--os-ink);
}
#desktop-os[hidden] { display: none; }
#desktop-os.open {
  opacity: 1;
  transform: scale(1);
}

.os-bezel {
  width: min(1060px, 100%);
  height: min(748px, 100%);
  min-height: 0;
  padding: 14px 14px 10px;
  border-radius: 10px;
  background: linear-gradient(160deg, #ece3d2 0%, #dcd0bb 60%, #cfc1a9 100%);
  border: 2px solid;
  border-color: #fbf5e8 #887764 #786858 #f5ecdc;
  box-shadow: 0 24px 60px rgba(10, 8, 12, 0.65);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.os-bezel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #7d6d5d;
}
.os-bezel-led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #77c27c;
  border: 1px solid #486b4a;
  box-shadow: 0 0 8px rgba(119, 194, 124, 0.9);
}

.os-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 3px solid;
  border-color: #6b5b4e #f8f0e2 #f8f0e2 #6b5b4e;
  background-color: #dce6e0;
  background-image:
    radial-gradient(ellipse 220px 72px at 18% 24%, rgba(255, 252, 245, 0.72) 0%, rgba(255, 252, 245, 0) 70%),
    radial-gradient(ellipse 260px 84px at 78% 18%, rgba(255, 250, 240, 0.68) 0%, rgba(255, 250, 240, 0) 72%),
    radial-gradient(ellipse 300px 96px at 64% 68%, rgba(255, 245, 232, 0.55) 0%, rgba(255, 245, 232, 0) 75%),
    radial-gradient(circle 1.2px at 1px 1px, rgba(124, 146, 136, 0.10) 1px, transparent 0),
    linear-gradient(180deg, #cfe0da 0%, #e4ebe2 44%, #f4ead6 80%, #efe0c8 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 16px 16px, 100% 100%;
  overflow: hidden;
  position: relative;
}

.os-desktop-area {
  flex: 1;
  min-height: 0;
  position: relative;
  padding: 14px;
  overflow: hidden;
}

/* Desktop Icons */
.os-desktop-icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px 14px;
  max-height: 100%;
  width: fit-content;
}

.os-icon-btn {
  width: 86px;
  padding: 7px 4px;
  border: 1px dotted transparent;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: var(--os-ink);
  font-family: var(--os-font);
}
.os-icon-btn:hover {
  background: rgba(255, 250, 240, 0.45);
  border-color: rgba(102, 80, 64, 0.45);
}
.os-icon-btn.selected,
.os-icon-btn:focus-visible {
  outline: none;
  border-color: #4a372c;
  background: rgba(196, 104, 88, 0.16);
}
.os-icon-btn.selected .os-icon-name {
  background: var(--os-title-a);
  color: #fffaf2;
}
.os-icon-pic {
  width: 44px;
  height: 44px;
  padding: 4px;
  background: rgba(255, 251, 244, 0.85);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  display: grid;
  place-items: center;
}
.os-icon-pic svg {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}
.os-icon-name {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  padding: 1px 4px;
  text-align: center;
  word-break: break-word;
  background: rgba(246, 236, 221, 0.78);
}

/* Centered Classic OS Welcome Dialog */
.os-welcome-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(410px, calc(100% - 36px));
  z-index: 6;
  box-shadow: 5px 5px 0 rgba(72, 54, 42, 0.22);
}
.os-welcome-card[hidden] { display: none; }
.os-mini-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  background: linear-gradient(90deg, var(--os-title-a), var(--os-title-b));
  color: var(--os-title-text);
  font-size: 12px;
  font-weight: 700;
}
.os-welcome-body {
  padding: 16px 16px 14px;
  font-size: 12.5px;
  line-height: 1.6;
}
.os-welcome-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 12px;
}
.os-welcome-badge {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #fff9ee;
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
}
.os-welcome-copy { flex: 1; min-width: 0; }
.os-welcome-body p { margin: 0 0 7px; }
.os-welcome-body ul { margin: 0; padding-left: 16px; }
.os-welcome-body li { margin-bottom: 4px; }
.os-welcome-divider {
  height: 0;
  border-top: 1px solid var(--os-shadow-mid);
  border-bottom: 1px solid var(--os-highlight);
  margin: 0 0 12px;
}
.os-welcome-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Retro App Window */
.os-window {
  position: absolute;
  left: 96px;
  top: 12px;
  width: calc(100% - 112px);
  height: calc(100% - 24px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 3px;
}
.os-window[hidden] { display: none; }
.os-window.maximized {
  inset: 6px;
  width: auto;
  height: auto;
}
.os-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px;
  background: linear-gradient(90deg, var(--os-title-a), var(--os-title-b));
  color: var(--os-title-text);
  user-select: none;
  cursor: move;
}
.os-window.maximized .os-window-bar { cursor: default; }
.os-window-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.os-win-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.os-win-icon svg { width: 16px; height: 16px; }
.os-window-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.os-window-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.os-window-menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 8px;
  background: var(--os-surface);
  border-bottom: 1px solid var(--os-shadow-mid);
  font-size: 11.5px;
  color: var(--os-ink-soft);
}
.os-menu-action {
  border: 0;
  background: transparent;
  color: var(--os-ink);
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
}
.os-menu-action:hover {
  background: var(--os-title-a);
  color: #fffaf2;
}

.os-window-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  background: #f9f2e6;
}
.os-app-pane { height: 100%; }
.os-app-pane[hidden] { display: none; }

/* Start Menu */
.os-start-menu {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 25;
  width: 248px;
  display: flex;
  padding: 2px;
}
.os-start-menu[hidden] { display: none; }
.os-start-sidebar {
  width: 28px;
  background: linear-gradient(180deg, #b87158, #dfaa86);
  color: #fffaf2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
}
.os-start-sidebar span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.os-start-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 3px;
  gap: 2px;
}
.os-start-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--os-ink);
  font-family: var(--os-font);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.os-start-item:hover {
  background: var(--os-title-a);
  color: #fffaf2;
}
.os-start-ico {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}
.os-start-ico svg { width: 18px; height: 18px; }
.os-start-sep {
  height: 2px;
  margin: 3px 4px;
  border-top: 1px solid var(--os-shadow-mid);
  border-bottom: 1px solid var(--os-highlight);
}

/* Taskbar */
.os-taskbar {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: none;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: var(--os-surface);
  border-top: 2px solid var(--os-highlight);
  box-shadow: inset 0 1px 0 #f8f0e2;
  min-height: 38px;
}
.os-start-btn {
  font-weight: 800;
  padding: 4px 10px;
  min-height: 28px;
}
.os-start-flower { color: var(--os-accent); }
.os-task-divider {
  width: 2px;
  height: 22px;
  border-left: 1px solid var(--os-shadow-mid);
  border-right: 1px solid var(--os-highlight);
}
.os-task-list {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.os-task-btn {
  min-height: 28px;
  max-width: 190px;
  padding: 3px 10px;
  justify-content: flex-start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.os-task-ico {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.os-task-ico svg { width: 15px; height: 15px; }

.os-tray {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  min-height: 28px;
  background: #e9decb;
  font-size: 12px;
}
.os-tray-btn {
  border: 0;
  background: transparent;
  padding: 0 2px;
  font-size: 14px;
  cursor: pointer;
}
.os-clock {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 12px;
}
.os-exit-btn {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}
.os-exit-btn.highlight {
  background: #f0c276;
  border-color: #fff6df #7c5429 #7c5429 #fff6df;
  color: #352117;
  animation: pulseCakeTask 1.2s ease-in-out infinite alternate;
}
@keyframes pulseCakeTask {
  from { filter: brightness(1); }
  to { filter: brightness(1.09); }
}

/* ================= BUILT-IN EASTER EGG APPS ================= */
.retro-notepad {
  height: 100%;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.retro-notepad-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--os-ink-soft);
}
#notepad-textarea {
  flex: 1;
  width: 100%;
  min-height: 310px;
  padding: 12px;
  resize: none;
  background: #fffdf7;
  color: var(--os-ink);
  font-family: "Microsoft YaHei", "SimSun", monospace;
  font-size: 13.5px;
  line-height: 1.75;
}

.comp-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto;
}
.comp-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
}
.comp-hero {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.comp-hero svg { width: 64px; height: 64px; }
.comp-card h3 { margin: 0 0 6px; font-size: 16px; }
.comp-card p { margin: 2px 0; font-size: 12.5px; color: var(--os-ink-soft); }
.comp-status {
  padding: 14px 16px;
  background: #fffdf7;
}
.comp-status h4 { margin: 0 0 10px; font-size: 14px; }
.comp-status ul { margin: 0 0 14px; padding-left: 18px; line-height: 1.8; font-size: 13px; }
.comp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= 1. PHOTO BOOTH APP (CURTAIN STUDIO) ================= */
.pb-app {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pb-booth {
  --pb-curtain-a: #6e1c2b;
  --pb-curtain-b: #96293d;
  --pb-curtain-c: #4c111d;
  --pb-curtain-accent: #f0c987;
  --pb-interior-bg: radial-gradient(circle at 50% 18%, #473632 0%, #2a2022 72%, #1d1618 100%);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #2f2324;
  border: 2px solid;
  border-color: #846c60 #1f1716 #1f1716 #846c60;
  color: #f6eadb;
  overflow: hidden;
}

.pb-booth[data-curtain="butter"] {
  --pb-curtain-a: #d2ae72;
  --pb-curtain-b: #ead09f;
  --pb-curtain-c: #a58049;
  --pb-curtain-accent: #6c4727;
  --pb-interior-bg: radial-gradient(circle at 50% 18%, #54463b 0%, #372d28 74%, #261f1c 100%);
}

.pb-booth[data-curtain="mist-blue"] {
  --pb-curtain-a: #4f6f87;
  --pb-curtain-b: #7494ab;
  --pb-curtain-c: #344d60;
  --pb-curtain-accent: #f3e5c8;
  --pb-interior-bg: radial-gradient(circle at 50% 18%, #3c4b57 0%, #252f38 74%, #1a2229 100%);
}

.pb-booth[data-curtain="emerald"] {
  --pb-curtain-a: #1f4a3f;
  --pb-curtain-b: #31695a;
  --pb-curtain-c: #133129;
  --pb-curtain-accent: #e8cb8e;
  --pb-interior-bg: radial-gradient(circle at 50% 18%, #30453e 0%, #1d2b27 74%, #151f1d 100%);
}

.pb-marquee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 7px 12px;
  background: linear-gradient(180deg, #332527 0%, #24191b 100%);
  border-bottom: 2px solid #d9b47a;
}

.pb-marquee-left,
.pb-marquee-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-title {
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 13px;
  color: #fae0b4;
}

.pb-bulb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd788;
  box-shadow: 0 0 10px #ffc864;
}

.pb-curtain-picker,
.pb-entrance-themes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pb-curtain-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  padding: 0;
  border: 2px solid rgba(255, 245, 224, 0.45);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--swatch) 72%, #fff), var(--swatch));
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pb-curtain-dot:hover {
  transform: scale(1.12);
}

.pb-curtain-dot.active {
  border-color: #fff5d6;
  box-shadow: 0 0 0 2px rgba(240, 201, 135, 0.55);
  transform: scale(1.12);
}

/* Curtain Theater */
.pb-curtain-theater {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--pb-interior-bg);
  overflow: hidden;
}

.pb-curtain-rod {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  z-index: 9;
  background: linear-gradient(180deg, #f3d79e 0%, #b78d4a 55%, #6b4d22 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
}

.pb-curtain-valance {
  position: absolute;
  top: 9px;
  left: 0;
  right: 0;
  height: 20px;
  z-index: 8;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      var(--pb-curtain-c) 0 16px,
      var(--pb-curtain-b) 16px 34px,
      var(--pb-curtain-a) 34px 52px
    );
  border-bottom: 2px solid color-mix(in srgb, var(--pb-curtain-accent) 75%, transparent);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.42);
}

.pb-curtain-panel {
  position: absolute;
  top: 10px;
  bottom: 0;
  width: 52%;
  z-index: 6;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.34) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.4) 100%),
    repeating-linear-gradient(
      90deg,
      var(--pb-curtain-c) 0px,
      var(--pb-curtain-a) 18px,
      var(--pb-curtain-b) 34px,
      var(--pb-curtain-a) 48px,
      var(--pb-curtain-c) 64px
    );
  box-shadow: inset -12px 0 24px rgba(0, 0, 0, 0.36);
  transition: transform 0.72s cubic-bezier(0.22, 1, 0.36, 1), filter 0.2s ease;
}

.pb-curtain-left {
  left: 0;
  border-right: 3px solid color-mix(in srgb, var(--pb-curtain-accent) 75%, transparent);
}

.pb-curtain-right {
  right: 0;
  border-left: 3px solid color-mix(in srgb, var(--pb-curtain-accent) 75%, transparent);
  box-shadow: inset 12px 0 24px rgba(0, 0, 0, 0.36);
}

.pb-curtain-theater.open .pb-curtain-left {
  transform: translateX(-96%);
}

.pb-curtain-theater.open .pb-curtain-right {
  transform: translateX(96%);
}

.pb-curtain-theater.flashing .pb-curtain-panel {
  filter: brightness(1.38);
}

/* Entrance Overlay */
.pb-entrance {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: 28px 18px 18px;
  background: radial-gradient(circle at 50% 45%, rgba(25, 16, 18, 0.25), rgba(16, 10, 12, 0.56));
  cursor: pointer;
  transition: opacity 0.45s ease;
}

.pb-entrance.hidden {
  opacity: 0;
  pointer-events: none;
}

.pb-entrance[hidden] {
  display: none;
}

.pb-entrance-card {
  max-width: 390px;
  padding: 20px 22px;
  text-align: center;
  background: rgba(33, 23, 25, 0.9);
  border: 2px solid #e6c286;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.pb-entrance-badge {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: #f3cf8d;
  font-weight: 700;
}

.pb-entrance-card h3 {
  margin: 0;
  font-size: 18px;
  color: #fff6e4;
}

.pb-entrance-card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: #e4d2c1;
}

.pb-enter-btn {
  margin-top: 4px;
  padding: 10px 22px;
  border: 2px solid;
  border-color: #ffe7bf #7a4b21 #7a4b21 #ffe7bf;
  background: linear-gradient(180deg, #df9c59, #c06848);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.pb-enter-btn:hover {
  filter: brightness(1.06);
}

/* Interior Content */
.pb-interior {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  padding: 26px clamp(24px, 3.8%, 40px) 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pb-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex-shrink: 0;
}

.pb-step-btn {
  padding: 6px 8px;
  border: 2px solid;
  border-color: #7d675c #221918 #221918 #7d675c;
  background: rgba(54, 42, 40, 0.86);
  color: #d9c6b7;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pb-step-btn.active {
  background: #e9be83;
  color: #342219;
  border-color: #fff4da #7c562c #7c562c #fff4da;
}

.pb-stage-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pb-stage-panel[hidden] {
  display: none;
}

/* Stage 1: Shoot Grid */
.pb-shoot-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.pb-camera-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.pb-viewfinder {
  position: relative;
  width: 100%;
  flex: 1 1 0;
  min-height: 140px;
  max-height: 100%;
  margin: 0 auto;
  overflow: hidden;
  background: #1a1518;
  border: 3px solid;
  border-color: #241b19 #8c766b #8c766b #241b19;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.pb-viewfinder[data-aspect="portrait"] {
  aspect-ratio: 4 / 5;
  width: auto;
  max-width: 100%;
}

.pb-viewfinder[data-aspect="square"] {
  aspect-ratio: 1 / 1;
  width: auto;
  max-width: 100%;
}

.pb-viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.pb-shot-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  padding: 3px 9px;
  background: rgba(24, 17, 19, 0.78);
  border: 1px solid rgba(240, 201, 135, 0.6);
  color: #fae1b7;
  font-size: 11.5px;
  font-weight: 700;
}

.pb-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  background: #272024;
  color: #ebd8c6;
  gap: 8px;
}
.pb-fallback[hidden] { display: none; }
.pb-fallback-icon { font-size: 26px; }
.pb-fallback p { margin: 0; font-size: 12px; line-height: 1.5; }
.pb-fallback-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.pb-countdown {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  font-size: 64px;
  font-weight: 800;
  color: #fff6dc;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.72);
  background: rgba(0, 0, 0, 0.28);
}
.pb-countdown[hidden] { display: none; }

.pb-flash {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #fffdf5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease-out;
}
.pb-flash.active { opacity: 0.96; transition: none; }

.pb-cam-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pb-cam-select {
  flex: 1 1 110px;
  min-width: 0;
  min-height: 26px;
  padding: 2px 6px;
  background: #fffdf7;
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-shadow-mid) var(--os-highlight) var(--os-highlight) var(--os-shadow-mid);
  font-family: var(--os-font);
  font-size: 11.5px;
}

.pb-shoot-controls,
.pb-studio-controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 0;
  height: 100%;
}

.pb-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pb-ctrl-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #f0d7b5;
}

.pb-ctrl-sub {
  font-weight: 400;
  font-size: 11px;
  color: #cbb6a5;
}

.pb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pb-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.pb-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pb-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pb-chip {
  padding: 7px 10px;
  min-height: 34px;
  border: 2px solid;
  border-color: #9e8777 #271e1b #271e1b #9e8777;
  background: #55433e;
  color: #f6e8d9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.pb-chip:hover:not(:disabled) {
  background: #644f49;
}

.pb-chip.active {
  background: #e9be83;
  color: #35231a;
  border-color: #fff4da #7c562c #7c562c #fff4da;
  font-weight: 700;
}

.pb-chip:disabled {
  opacity: 0.55;
  cursor: default;
}

.pb-layout-card {
  padding: 5px 8px;
  min-height: 32px;
  font-size: 11.5px;
  justify-content: flex-start;
  text-align: left;
  gap: 6px;
}

.pb-shoot-controls .pb-chip {
  padding: 5px 6px;
  min-height: 29px;
  font-size: 11.5px;
}

.pb-layout-icon {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
}

.pb-swatch-card {
  padding: 6px 5px;
  min-height: 54px;
  border: 2px solid;
  border-color: #8f796c #251c1a #251c1a #8f796c;
  background: #4b3b37;
  color: #f6eadb;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.pb-swatch-card:hover {
  background: #5c4944;
}

.pb-swatch-card.active {
  background: #e9be83;
  color: #35231a;
  border-color: #fff4da #7c562c #7c562c #fff4da;
  font-weight: 700;
}

.pb-swatch-tile {
  width: 30px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.pb-swatch-label {
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.pb-swatch-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  display: inline-block;
}

.pb-shot-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pb-shot-slot {
  position: relative;
  height: 52px;
  padding: 0;
  overflow: hidden;
  border: 2px dashed rgba(235, 207, 173, 0.45);
  background: rgba(27, 20, 22, 0.65);
  color: #d8c2b1;
  font-size: 11.5px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.pb-shot-slot.filled {
  border-style: solid;
  border-color: #e9be83;
}

.pb-shot-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pb-slot-num {
  position: absolute;
  top: 2px;
  left: 3px;
  padding: 0 4px;
  background: rgba(20, 14, 16, 0.72);
  color: #fae1b7;
  font-size: 10px;
  font-weight: 700;
}

.pb-slot-retake {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(26, 17, 19, 0.68);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.pb-shot-slot.filled:hover .pb-slot-retake {
  opacity: 1;
}

.pb-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 2px;
}

.pb-action-row .pb-shutter {
  flex: 1.1;
}

.pb-action-row .pb-next-btn {
  flex: 1;
}

.pb-shutter {
  padding: 7px 12px;
  min-height: 35px;
  border: 2px solid;
  border-color: #ffd7c4 #6b2420 #6b2420 #ffd7c4;
  background: #c85c54;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pb-shutter:disabled { opacity: 0.55; cursor: default; }

.pb-next-btn:disabled { opacity: 0.45; cursor: default; }

.pb-hint {
  margin: 0;
  font-size: 11px;
  color: #d8c4b5;
  line-height: 1.3;
}

/* Stage 2: Customize Studio */
.pb-studio-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 12px;
  align-items: stretch;
}

.pb-studio-preview-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 0;
  background: rgba(18, 13, 15, 0.42);
  border: 2px solid rgba(233, 190, 131, 0.28);
  padding: 10px;
}

.pb-studio-preview-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

#pb-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  touch-action: none;
  cursor: grab;
}

#pb-preview-canvas:active {
  cursor: grabbing;
}

.pb-sticker-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  color: #fae1b7;
}
.pb-sticker-tools[hidden] { display: none; }
.pb-danger-btn { color: #9c2b2b; }

.pb-preview-tip {
  margin: 0;
  font-size: 11px;
  color: #ceb9a8;
  text-align: center;
}

.pb-studio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  padding: 10px 12px;
  background: rgba(31, 22, 24, 0.58);
  border: 2px solid rgba(233, 190, 131, 0.24);
}

.pb-studio-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  flex-shrink: 0;
}

.pb-studio-tab {
  padding: 7px 4px;
  min-height: 34px;
  border: 2px solid;
  border-color: #8b7467 #241b19 #241b19 #8b7467;
  background: #463632;
  color: #e4d1c1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.pb-studio-tab:hover {
  background: #57443f;
}

.pb-studio-tab.active {
  background: #e9be83;
  color: #342219;
  border-color: #fff4da #7c562c #7c562c #fff4da;
}

.pb-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.pb-tab-pane[hidden] {
  display: none;
}

.pb-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pb-preset-card {
  padding: 9px 10px;
  min-height: 58px;
  border: 2px solid;
  border-color: #8f796c #251c1a #251c1a #8f796c;
  background: #4b3b37;
  color: #f6eadb;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.pb-preset-card:hover {
  background: #5b4843;
}

.pb-preset-card.active {
  background: #e9be83;
  color: #35231a;
  border-color: #fff4da #7c562c #7c562c #fff4da;
}

.pb-preset-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pb-preset-swatches {
  display: flex;
  gap: 4px;
}

.pb-preset-swatches i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

.pb-preset-name {
  font-size: 12.5px;
  font-weight: 700;
}

.pb-preset-tag {
  font-size: 10.5px;
  opacity: 0.85;
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 2px;
}

.pb-link-btn {
  border: 0;
  background: transparent;
  color: #f3c887;
  font-size: 11.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.pb-free-sticker-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.pb-free-btn {
  padding: 6px 6px;
  min-height: 36px;
  border: 2px solid;
  border-color: #8e786b #261c1a #261c1a #8e786b;
  background: #51403b;
  color: #f7eadc;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.pb-free-btn:hover {
  background: #634f49;
}

.pb-free-btn small {
  font-size: 11.5px;
}

.pb-caption-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-caption-input {
  flex: 1;
  min-width: 130px;
  padding: 8px 10px;
  background: #fffdf7;
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-shadow-mid) var(--os-highlight) var(--os-highlight) var(--os-shadow-mid);
  font-size: 13px;
}

.pb-date-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(255, 244, 224, 0.08);
  border: 1px solid rgba(233, 190, 131, 0.3);
  font-size: 12px;
  color: #f3dfc8;
  white-space: nowrap;
  cursor: pointer;
}

.pb-studio-footer-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(233, 190, 131, 0.22);
  flex-shrink: 0;
}

.pb-print-btn {
  flex: 1;
}

/* Stage 3: Darkroom Dispense */
.pb-dispense-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}

.pb-slot-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #f1dcc5;
}

.pb-dev-lamp { width: 10px; height: 10px; border-radius: 50%; background: #779f78; }
.pb-dev-lamp.developing {
  background: #ff624d;
  box-shadow: 0 0 12px #ff624d;
  animation: blinkLamp 0.36s infinite alternate;
}
@keyframes blinkLamp { to { opacity: 0.28; } }

.pb-slot-mouth {
  width: min(290px, 88%);
  height: 14px;
  background: #140f11;
  border: 2px solid #967d6f;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.85);
}

.pb-dispense-tray {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2px 0;
}

.pb-dropped-photo {
  transform: translateY(-108%);
  opacity: 0;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}
.pb-dropped-photo.dropped { transform: translateY(0); opacity: 1; }

.pb-photo-frame {
  padding: 8px;
  background: #fffdf8;
  border: 1px solid #cbb9a4;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
  color: #4c3b34;
}

.pb-strip-frame {
  padding: 0;
  background: transparent;
  border: 0;
}

.pb-photo-frame img {
  width: auto;
  max-width: min(260px, 74vw);
  max-height: 290px;
  object-fit: contain;
  display: block;
  filter: brightness(0.25) saturate(0.2) blur(2px);
  transition: filter 1.2s ease;
}

.pb-dropped-photo.developed .pb-photo-frame img {
  filter: brightness(1) saturate(1) blur(0);
}

.pb-photo-meta { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; font-size: 11px; color: #7c675d; }

.pb-dispense-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.pb-dispense-actions[hidden] { display: none; }

/* Burst Fan Overlay */
.pb-burst-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(28, 21, 24, 0.95);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.24s ease;
}
.pb-burst-overlay[hidden] { display: none; }
.pb-burst-overlay.open { opacity: 1; }
.pb-burst-header { display: flex; justify-content: space-between; align-items: center; color: #fae5c3; font-weight: 700; }
.pb-burst-fan { flex: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; overflow: auto; padding: 10px 4px; }
.pb-burst-card {
  width: 168px;
  padding: 8px 8px 12px;
  background: #fffdf8;
  color: #4a3830;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
  transform: scale(0.35) translateY(60px) rotate(0deg);
  opacity: 0;
  animation: burstPop 0.52s cubic-bezier(0.22, 1.25, 0.36, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
.pb-burst-card.is-strip {
  width: auto;
  max-width: 185px;
}
@keyframes burstPop { to { transform: scale(1) translateY(0) rotate(var(--rot, 0deg)); opacity: 1; } }
.pb-burst-card img {
  width: auto;
  max-width: 100%;
  max-height: 230px;
  margin: 0 auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 560px) {
  .pb-interior {
    padding: 26px 18px 10px;
    overflow-y: auto;
  }
  .pb-curtain-theater.open .pb-curtain-left {
    transform: translateX(-97%);
  }
  .pb-curtain-theater.open .pb-curtain-right {
    transform: translateX(97%);
  }
  .pb-shoot-grid,
  .pb-studio-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pb-viewfinder {
    flex: 0 0 auto;
    height: clamp(140px, 24vh, 190px);
    min-height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pb-curtain-panel,
  .pb-dropped-photo,
  .pb-photo-frame img,
  .pb-burst-card {
    transition: none !important;
    animation: none !important;
  }
  .pb-burst-card {
    transform: none;
    opacity: 1;
  }
}

.os-window.immersive-darkroom .os-window-menubar { display: none; }
.os-window.immersive-darkroom .os-window-body {
  padding: 0;
  overflow: hidden;
  background: #140303;
}

/* ================= 2. DARKROOM 3D FILM ROLLS & POLAROID ALBUM ================= */
.dk-app {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 440px;
  background: #140303;
  color: #f3e4cf;
  overflow: hidden;
  user-select: none;
}
.dk-app.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100dvh;
}
.dk-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 48%, #5e1310 0%, #2b0706 62%, #110202 100%);
}
.dk-stage[hidden] { display: none; }
.dk-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.dk-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 44%, rgba(12, 2, 2, 0.52) 82%, rgba(8, 1, 1, 0.88) 100%);
}
.dk-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(rgba(255, 224, 188, 0.45) 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

/* Editorial Top HUD */
.dk-hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  padding: 18px 24px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 12px;
  pointer-events: none;
}
.dk-meta-left {
  font-family: "Courier New", Consolas, ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 217, 186, 0.72);
  padding-top: 4px;
}
.dk-hero-title {
  text-align: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.dk-hero-title.hidden {
  opacity: 0;
  transform: translateY(-12px);
}
.dk-hero-title h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #f6ead6;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.65);
}
.dk-hero-title h2 em {
  font-style: italic;
  color: #f4cda4;
}
.dk-hero-title p {
  margin: 4px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-style: italic;
  font-size: 12.5px;
  color: rgba(242, 216, 184, 0.72);
  letter-spacing: 0.04em;
}
.dk-hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.dk-meta-count {
  font-family: "Courier New", Consolas, ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(244, 217, 186, 0.7);
  padding-top: 4px;
}
.dk-ghost-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}
.dk-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 212, 174, 0.24);
  background: rgba(26, 7, 6, 0.56);
  backdrop-filter: blur(8px);
  color: rgba(248, 232, 210, 0.88);
  font-size: 11.5px;
  font-family: inherit;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.dk-ghost-btn:hover {
  background: rgba(98, 26, 18, 0.78);
  border-color: rgba(246, 206, 154, 0.55);
  color: #fff6e8;
  transform: translateY(-1px);
}
.dk-ghost-icon {
  padding: 5px 8px;
  font-size: 13px;
}

/* Editorial Bottom HUD */
.dk-hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 6;
  padding: 0 24px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  pointer-events: none;
}
.dk-back-btn {
  grid-column: 1;
  justify-self: start;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(246, 212, 168, 0.42);
  background: rgba(34, 9, 7, 0.78);
  backdrop-filter: blur(8px);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: #fff2dc;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.dk-back-btn:hover {
  background: rgba(112, 30, 20, 0.88);
  border-color: rgba(255, 224, 178, 0.72);
  color: #ffffff;
  transform: translateX(-2px);
}
.dk-back-btn[hidden] { display: none; }

.dk-prompt-wrap {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.dk-hover-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(20, 5, 4, 0.74);
  border: 1px solid rgba(244, 200, 146, 0.34);
  color: #f8e2c2;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
.dk-hover-pill[hidden] { display: none; }
.dk-script-prompt {
  margin: 0;
  font-family: "Segoe Script", "Bradley Hand", "Brush Script MT", Georgia, "Songti SC", serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(245, 202, 166, 0.88);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.dk-pull-micro {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  gap: 6px;
  pointer-events: auto;
}
.dk-pull-micro[hidden] { display: none; }

/* Darkroom Developing Ritual Overlay */
.dk-develop-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 42%, rgba(62, 14, 12, 0.86), rgba(10, 2, 2, 0.94));
  backdrop-filter: blur(10px);
}
.dk-develop-overlay[hidden] { display: none; }
.dk-develop-card {
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(38, 11, 10, 0.94), rgba(20, 5, 5, 0.97));
  border: 1px solid rgba(244, 202, 152, 0.24);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 224, 186, 0.12);
}
.dk-develop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dk-dev-badge {
  font-family: "Courier New", Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(244, 212, 174, 0.8);
  text-transform: uppercase;
}
.dk-dev-status {
  font-size: 11.5px;
  color: #f3b078;
  letter-spacing: 0.08em;
}
.dk-dev-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(244, 212, 174, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #f6e7d2;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.dk-dev-close:hover { background: rgba(180, 54, 38, 0.65); }

.dk-develop-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.dk-nav-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(244, 212, 174, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: #f5e2c8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.dk-nav-arrow:hover {
  background: rgba(154, 48, 32, 0.55);
  border-color: rgba(246, 206, 154, 0.6);
}

.dk-print-frame {
  flex: 1;
  max-width: 480px;
  padding: 12px 12px 14px;
  background: #faf4e8;
  border-radius: 2px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  color: #3a271f;
}
.dk-print-photo-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #3d1208;
  overflow: hidden;
}
.dk-print-photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Start as darkroom orange-red negative before developing */
  filter: sepia(1) hue-rotate(-30deg) saturate(2.1) contrast(0.95) brightness(0.42) blur(2px);
  transition: filter 1.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.dk-print-frame.developed .dk-print-photo-box img {
  filter: var(--print-filter, none);
}
.dk-safelight-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, rgba(210, 62, 24, 0.72) 0%, rgba(120, 22, 10, 0.55) 60%, rgba(255, 168, 92, 0.32) 100%);
  opacity: 0.92;
  transition: opacity 1.5s ease-out;
}
.dk-print-frame.developed .dk-safelight-veil {
  opacity: 0;
}
.dk-print-caption-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
}
.dk-print-caption {
  font-family: Georgia, "Songti SC", serif;
  font-size: 14px;
  font-weight: 600;
  color: #3a261e;
}
.dk-print-date {
  font-family: "Courier New", Consolas, monospace;
  font-size: 11px;
  color: #8c7262;
  white-space: nowrap;
}

.dk-develop-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dk-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.dk-filter-pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(244, 212, 174, 0.24);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 222, 194, 0.78);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dk-filter-pill:hover {
  border-color: rgba(246, 204, 150, 0.52);
  color: #fff5e6;
}
.dk-filter-pill.active {
  background: rgba(196, 86, 44, 0.72);
  border-color: rgba(255, 212, 160, 0.78);
  color: #fffaf2;
}
.dk-dev-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.dk-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(244, 212, 174, 0.28);
  background: rgba(46, 14, 12, 0.76);
  color: #f6e7d2;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.dk-action-btn:hover {
  background: rgba(94, 28, 20, 0.88);
  border-color: rgba(246, 208, 158, 0.56);
}
.dk-action-btn.primary {
  background: linear-gradient(180deg, #b84a2a, #8d3119);
  border-color: rgba(255, 214, 168, 0.5);
  color: #fff9f0;
  font-weight: 600;
}
.dk-action-btn.primary:hover {
  background: linear-gradient(180deg, #cb5735, #9f391f);
}

/* Preserved Polaroid Shell */
.dk-polaroid-shell {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 14px 16px;
  background: #f9f2e6;
  color: var(--os-ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dk-polaroid-shell[hidden] { display: none; }
.dk-polaroid-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 2px solid var(--os-shadow-mid);
  padding-bottom: 8px;
}
.dk-pol-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dk-pol-bar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--os-ink);
}
.album-count { font-size: 12px; color: var(--os-ink-soft); font-weight: 600; }

@media (max-width: 720px) {
  .dk-hud-top {
    padding: 12px 12px 0;
    grid-template-columns: 1fr auto;
  }
  .dk-hero-title {
    grid-column: 1 / -1;
    order: 3;
    margin-top: 2px;
  }
  .dk-hud-bottom {
    padding: 0 12px 12px;
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .dk-back-btn,
  .dk-pull-micro {
    justify-self: center;
  }
  .dk-develop-card {
    padding: 12px;
  }
}

.album-polaroid-view {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.album-polaroid-view[hidden] { display: none; }
.polaroid-flash-screen { position: fixed; inset: 0; background: #fffdf5; opacity: 0; pointer-events: none; z-index: 60; transition: opacity 0.28s ease-out; }
.polaroid-flash-screen.flash { opacity: 0.92; transition: none; }
.polaroid-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 274px 1fr;
  gap: 18px;
  align-items: stretch;
}
.polaroid-camera {
  position: relative; padding: 14px; border-radius: 12px;
  background: linear-gradient(180deg, #faf3e8 0%, #e9decb 100%);
  border: 2px solid #b5a18a; box-shadow: 0 8px 20px rgba(56, 42, 34, 0.18);
  display: flex; flex-direction: column; align-items: center;
}
.pol-top-row { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pol-viewfinder { width: 34px; height: 26px; border-radius: 4px; background: #2e292b; border: 2px solid #8a7c70; }
.pol-flash-lamp { width: 58px; height: 28px; border-radius: 4px; background: repeating-linear-gradient(90deg, #e8e1d5 0 5px, #d0c5b4 5px 8px); border: 2px solid #8f8275; }
.pol-flash-lamp.firing { background: #fffef4; box-shadow: 0 0 28px 10px rgba(255, 245, 200, 0.95); }
.pol-shutter-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 3px solid #f7d6ce;
  background: radial-gradient(circle at 35% 35%, #ef736b, #c23d3b);
  color: #fff; font-size: 11px; font-weight: 700; cursor: pointer;
}
.pol-lens-ring { width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, #2a2629 46%, #595257 68%, #d7ccba 100%); display: grid; place-items: center; border: 3px solid #8e8175; }
.pol-lens-glass { width: 52px; height: 52px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6d89a8 0%, #232a3a 55%, #11131a 100%); border: 2px solid #49444a; }
.pol-rainbow { width: 100%; height: 10px; margin: 10px 0 8px; background: linear-gradient(90deg, #e05a5a 0 20%, #ec9a49 20% 40%, #f0cf65 40% 60%, #7cb77d 60% 80%, #5b93c4 80% 100%); }
.pol-eject-slot { width: 88%; height: 10px; background: #1b1718; }
.pol-eject-area { width: 100%; min-height: 196px; display: flex; justify-content: center; overflow: hidden; padding-top: 6px; }
.pol-ejected-card {
  width: 184px; padding: 9px 9px 14px; background: #fffdf8; border: 1px solid #d5c3ad;
  box-shadow: 0 10px 24px rgba(45, 32, 26, 0.25); transform: translateY(-115%);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); cursor: pointer;
}
.pol-ejected-card.ejected { transform: translateY(0); }
.pol-photo-wrap { width: 100%; aspect-ratio: 4 / 3; background: #233036; overflow: hidden; }
.pol-photo-wrap img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.18) saturate(0.1) blur(3px); transition: filter 1.5s ease; }
.pol-ejected-card.developed .pol-photo-wrap img { filter: brightness(1) saturate(1) blur(0); }
.pol-handwriting { margin-top: 8px; font-size: 12px; font-weight: 600; color: #4d3b32; text-align: center; }
.pol-date { font-size: 10.5px; color: #8c786c; text-align: center; margin-top: 2px; }
.polaroid-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  background: var(--os-surface);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
}
.pol-guide { margin: 0; font-size: 13px; line-height: 1.6; color: var(--os-ink-soft); }
.pol-shelf-title { font-size: 12.5px; font-weight: 700; color: var(--os-ink); }
.pol-shelf {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  align-content: start;
  gap: 10px;
}
.pol-mini-card {
  padding: 6px 6px 8px; border: 2px solid; border-color: var(--os-highlight) var(--os-shadow-mid) var(--os-shadow-mid) var(--os-highlight);
  background: #fffdf8; display: flex; flex-direction: column; gap: 5px; cursor: pointer;
}
.pol-mini-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.pol-mini-card span { font-size: 11px; color: #5f4a3f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.album-lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(20, 15, 18, 0.82); padding: 20px; }
.album-lightbox[hidden] { display: none; }
.album-lightbox-card {
  max-width: min(460px, 100%); padding: 14px 14px 16px; background: #fffdf8;
  border: 2px solid; border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  color: #4a372f; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.album-lightbox-card img { width: auto; max-width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.lb-meta { width: 100%; display: flex; justify-content: space-between; font-size: 13px; }

/* ================= 3. 5-STEP CAKE BAKERY APP ================= */
.bakery-app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

#bakery-view-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Stepper Bar */
.bakery-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  flex-shrink: 0;
}
.bakery-step-pill {
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: #e5d8c4;
  color: var(--os-ink-soft);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-mid) var(--os-shadow-mid) var(--os-highlight);
  cursor: pointer;
}
.bakery-step-pill.active {
  background: var(--os-title-a);
  color: #fffaf2;
  border-color: #efbda7 #6f3c2d #6f3c2d #efbda7;
}
.bakery-step-pill.done {
  background: #dce5cf;
  color: #3a5233;
}
.bakery-step-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bakery-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 1.3fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.bakery-stage-box {
  padding: 12px;
  background: #fbf3e4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.bakery-view-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.bakery-view-tabs {
  display: inline-flex;
  gap: 4px;
}

.bakery-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #e9dcc7;
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.bakery-view-tab.active {
  background: var(--os-title-a);
  color: #fffaf2;
  border-color: #efbda7 #6f3c2d #6f3c2d #efbda7;
}
.bakery-view-tab .tab-pct {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  opacity: 0.9;
}

.bakery-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bakery-canvas {
  width: 100%;
  max-height: 100%;
  height: auto;
  aspect-ratio: 520 / 380;
  object-fit: contain;
  display: block;
  background: #f6ead8;
  border: 2px solid;
  border-color: var(--os-shadow-mid) var(--os-highlight) var(--os-highlight) var(--os-shadow-mid);
  touch-action: none;
  user-select: none;
  box-shadow: inset 0 2px 8px rgba(72, 52, 42, 0.08);
}
.bakery-canvas.interactive { cursor: crosshair; }
.bakery-canvas.custom-tool { cursor: none; }
.bakery-canvas.dragging { cursor: grabbing; }

.bakery-stage-tip {
  margin: 0;
  font-size: 12px;
  color: var(--os-ink-soft);
  text-align: center;
  line-height: 1.45;
  flex-shrink: 0;
}

.bakery-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  min-height: 0;
}

.bakery-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  flex-shrink: 0;
}

.bakery-panel-tab {
  padding: 7px 4px;
  min-height: 36px;
  background: #e5d8c4;
  color: var(--os-ink-soft);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.bakery-panel-tab:hover {
  background: #f3e8d6;
  color: var(--os-ink);
}
.bakery-panel-tab.active {
  background: var(--os-title-a);
  color: #fffaf2;
  border-color: #efbda7 #6f3c2d #6f3c2d #efbda7;
}

.bakery-tab-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bakery-tab-pane[hidden] {
  display: none;
}

.bakery-group-title {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--os-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bakery-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bakery-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.bakery-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.bakery-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.bakery-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  min-height: 54px;
  background: var(--os-surface-alt);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.bakery-choice-card:hover:not(:disabled) {
  background: #fff9ee;
}
.bakery-choice-card.active {
  background: #f4d8b1;
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
  font-weight: 700;
}
.bakery-choice-card.done {
  background: #dce5cf;
  color: #36522d;
}
.bakery-choice-card .choice-ico {
  font-size: 20px;
  line-height: 1.1;
}
.bakery-choice-card .choice-label {
  font-size: 12px;
  line-height: 1.2;
}

.bakery-choice-card.compact {
  min-height: 44px;
  flex-direction: row;
  padding: 7px 10px;
  gap: 7px;
}

.bakery-swatch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  min-height: 56px;
  background: var(--os-surface-alt);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.bakery-swatch-card:hover {
  background: #fff9ee;
}
.bakery-swatch-card.active {
  background: #f4d8b1;
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
  font-weight: 700;
}
.bakery-swatch-card .swatch-box {
  width: 28px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(60, 45, 37, 0.42);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45);
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--os-ink-soft);
}
.bakery-swatch-card .swatch-name {
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.bakery-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.bakery-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 4px;
  min-height: 66px;
  background: var(--os-surface-alt);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.bakery-tool-btn:hover { background: #fff9ee; }
.bakery-tool-btn .tool-ico { font-size: 18px; line-height: 1.1; }
.bakery-tool-btn .tool-sub { font-size: 10.5px; font-weight: 500; color: var(--os-ink-soft); }
.bakery-tool-btn.active {
  background: #f5dbb5;
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
}

.bakery-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  min-height: 28px;
  background: var(--os-surface);
  color: var(--os-ink);
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-dark) var(--os-shadow-dark) var(--os-highlight);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.bakery-chip.active {
  background: #f4d8b1;
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
  font-weight: 700;
}
.bakery-chip.done {
  background: #dce5cf;
  color: #36522d;
}
.bakery-swatch {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(60, 45, 37, 0.45);
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}
.bakery-sub-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--os-ink-soft);
  line-height: 1.35;
}

/* Oven Heat Meter */
.oven-meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.oven-meter-bar {
  position: relative;
  height: 22px;
  border: 2px solid;
  border-color: var(--os-shadow-dark) var(--os-highlight) var(--os-highlight) var(--os-shadow-dark);
  background: linear-gradient(
    90deg,
    #f6ebd9 0% 35%,
    #f3d58e 35% 60%,
    #e5a44d 60% 85%,
    #784834 85% 100%
  );
}
.oven-meter-sweet {
  position: absolute;
  left: 60%;
  width: 25%;
  top: 0;
  bottom: 0;
  border-left: 2px dashed #fffaf2;
  border-right: 2px dashed #fffaf2;
  pointer-events: none;
}
.oven-meter-needle {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 4px;
  background: #2b1d17;
  border: 1px solid #fffaf2;
  transform: translateX(-50%);
}
.oven-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--os-ink-soft);
}
.bakery-feedback {
  padding: 8px 10px;
  background: #fff7e6;
  border: 1px solid #d5b483;
  font-size: 12.5px;
  line-height: 1.5;
  color: #553924;
}
.bakery-feedback.warn {
  background: #fbeae2;
  border-color: #d48977;
  color: #6f2f24;
}

/* Frosting Turntable Slider */
.turntable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.turntable-row input[type="range"] {
  flex: 1;
  accent-color: var(--os-accent);
}

/* Decor Message Input */
.bakery-input {
  width: 100%;
  padding: 7px 9px;
  background: #fffdf7;
  color: var(--os-ink);
  font-family: var(--os-font);
  font-size: 13px;
}

.bakery-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(110, 88, 74, 0.22);
  flex-shrink: 0;
}
.bakery-footer-actions .win-btn-primary {
  flex: 1;
}

/* Step 5 Finish Card */
.bakery-finish-wrap {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 20px;
  align-items: center;
  padding: 8px 16px;
}
.bakery-polaroid-preview {
  padding: 10px 10px 14px;
  background: #fffdf8;
  border: 2px solid;
  border-color: var(--os-highlight) var(--os-shadow-mid) var(--os-shadow-mid) var(--os-highlight);
  box-shadow: 0 8px 20px rgba(58, 42, 32, 0.18);
  text-align: center;
}
.bakery-polaroid-preview img {
  width: 100%;
  display: block;
}
.bakery-finish-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bakery-finish-info h3 { margin: 0; font-size: 17px; color: var(--os-ink); }
.bakery-finish-info p { margin: 0; font-size: 13px; line-height: 1.65; color: var(--os-ink-soft); }

/* ================= RESPONSIVE MOBILE LAYOUT ================= */
@media (pointer: coarse), (max-width: 780px) {
  #room-toast { top: calc(env(safe-area-inset-top) + 66px); width: max-content; }
  #desktop-os { padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
  .os-bezel { padding: 6px 6px 5px; border-radius: 6px; }
  .os-desktop-area { padding: 8px; overflow-y: auto; }
  .os-desktop-icons {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    max-height: none;
    gap: 8px 10px;
  }
  .os-icon-btn { width: 76px; }
  .os-welcome-card {
    width: min(360px, calc(100% - 20px));
    max-height: calc(100% - 12px);
    display: flex;
    flex-direction: column;
  }
  .os-mini-bar { flex: none; }
  .os-welcome-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .os-welcome-actions button, .os-exit-btn { min-height: 44px; }
  .os-mini-bar .win-ctrl-btn { width: 44px; height: 44px; }
  .os-window,
  .os-window.maximized {
    inset: 4px;
    width: auto;
    height: auto;
  }
  .os-window-body { padding: 8px; }
  .os-window-controls .win-ctrl-btn { width: 44px; height: 44px; }
  .os-menu-action, .os-start-btn { min-height: 44px; }
  .dk-app { min-height: 0; }
  .dk-app.is-fullscreen .dk-hud-top {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .dk-app.is-fullscreen .dk-hud-bottom {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .os-taskbar { flex-shrink: 0; gap: 4px; padding: 3px 4px; }
  .os-exit-btn { padding: 4px 7px; font-size: 11.5px; }
  .os-clock { display: none; }
  .pb-stage,
  .polaroid-stage,
  .bakery-finish-wrap {
    grid-template-columns: 1fr;
  }
  .bakery-app,
  #bakery-view-root {
    height: auto;
  }
  .bakery-body {
    grid-template-columns: minmax(290px, 1.3fr) minmax(215px, 0.92fr);
    gap: 8px;
  }
  .bakery-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .bakery-step-pill {
    font-size: 10.5px;
    padding: 4px 2px;
  }
  .polaroid-camera { margin: 0 auto; width: 100%; max-width: 270px; }
}
@media (max-width: 620px) {
  .bakery-body {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 460px) and (orientation: landscape) {
  .os-bezel-footer { display: none; }
  .os-welcome-body { padding: 8px 12px; }
  .os-welcome-row { margin-bottom: 6px; }
  .os-welcome-divider { margin-bottom: 6px; }
}
