.fac-stage {
  position: relative;
  border-radius: 22px;
  padding: 24px 24px 22px;
  overflow: hidden;
  color: #fffaf2;
  border: 1px solid rgba(232, 184, 86, 0.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 22px 56px rgba(10, 4, 6, 0.5), inset 0 1px 0 rgba(255, 244, 214, 0.2);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.fac-stage[data-theme="keepsake"],
.fac-stage:not([data-theme]) {
  background: linear-gradient(165deg, rgba(78, 18, 28, 0.94) 0%, rgba(46, 10, 17, 0.97) 100%);
  --fac-house-bg: rgba(54, 11, 19, 0.74);
  --fac-house-border: rgba(235, 191, 96, 0.65);
  --fac-accent: #f2cb6f;
}

.fac-stage[data-theme="pine"] {
  background: linear-gradient(165deg, rgba(20, 52, 37, 0.95) 0%, rgba(11, 31, 22, 0.98) 100%);
  --fac-house-bg: rgba(13, 37, 26, 0.74);
  --fac-house-border: rgba(235, 191, 96, 0.65);
  --fac-accent: #f2cb6f;
}

.fac-stage[data-theme="gingerbread"] {
  background: linear-gradient(165deg, rgba(84, 39, 19, 0.95) 0%, rgba(52, 23, 10, 0.98) 100%);
  --fac-house-bg: rgba(60, 27, 12, 0.74);
  --fac-house-border: rgba(244, 214, 162, 0.65);
  --fac-accent: #f4d6a2;
}

.fac-stage[data-theme="midnight"] {
  background: linear-gradient(165deg, rgba(16, 30, 60, 0.95) 0%, rgba(9, 18, 38, 0.98) 100%);
  --fac-house-bg: rgba(11, 22, 46, 0.76);
  --fac-house-border: rgba(236, 195, 97, 0.65);
  --fac-accent: #f2cf75;
}

.fac-lights {
  position: absolute; top: 0; left: 0; right: 0; height: 20px;
  display: flex; justify-content: space-around; align-items: flex-start;
  pointer-events: none; z-index: 2; border-top: 1px solid rgba(242, 203, 111, 0.24);
}
.fac-lights[hidden] { display: none; }

.fac-bulb {
  width: 5px; height: 8px; border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  margin-top: 3px; animation: fac-twinkle 3.2s ease-in-out infinite;
}
.fac-bulb:nth-child(3n+1) { background: #ffe8a3; box-shadow: 0 0 10px rgba(255, 232, 163, 0.85), 0 0 2px #fff8e1; animation-delay: 0s; }
.fac-bulb:nth-child(3n+2) { background: #f3c458; box-shadow: 0 0 10px rgba(243, 196, 88, 0.75); animation-delay: 1.05s; }
.fac-bulb:nth-child(3n+3) { background: #fff5d6; box-shadow: 0 0 9px rgba(255, 245, 214, 0.8); animation-delay: 2.1s; }

@keyframes fac-twinkle { 0%, 100% { opacity: 0.96; transform: scale(1); } 50% { opacity: 0.36; transform: scale(0.84); } }

.fac-snow {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    radial-gradient(1.8px 1.8px at 14% 20%, rgba(255,250,240,0.55) 50%, transparent 100%),
    radial-gradient(2.2px 2.2px at 38% 12%, rgba(255,250,240,0.4) 50%, transparent 100%),
    radial-gradient(1.8px 1.8px at 66% 28%, rgba(255,250,240,0.48) 50%, transparent 100%),
    radial-gradient(2.5px 2.5px at 84% 16%, rgba(255,250,240,0.38) 50%, transparent 100%),
    radial-gradient(1.8px 1.8px at 25% 65%, rgba(255,250,240,0.34) 50%, transparent 100%),
    radial-gradient(2.2px 2.2px at 78% 72%, rgba(255,250,240,0.4) 50%, transparent 100%);
  background-size: 280px 280px;
  animation: fac-snowfall 16s linear infinite;
}
.fac-snow[hidden] { display: none; }

@keyframes fac-snowfall { from { background-position: 0 0; } to { background-position: 40px 280px; } }
@keyframes fac-nudge-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 198, 94, 0.45); } 50% { box-shadow: 0 0 0 5px rgba(242, 198, 94, 0); } }
@keyframes fac-gift-wiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-5deg) scale(1.04); }
  45% { transform: rotate(5deg) scale(1.04); }
  70% { transform: rotate(-3deg) scale(1.02); }
  85% { transform: rotate(2deg) scale(1.01); }
}
@media (prefers-reduced-motion: reduce) { .fac-bulb, .fac-snow, .fac-sound-nudge, .fac-door.is-wiggling { animation: none !important; } }

.fac-stage-inner {
  position: relative; z-index: 3; display: grid;
  grid-template-columns: minmax(0, 1.54fr) minmax(308px, 0.92fr);
  gap: 24px; align-items: start;
}
.fac-house-col { display: flex; flex-direction: column; gap: 12px; width: 100%; min-width: 0; }
.fac-house-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.fac-house-title { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 23px; font-weight: 700; margin: 0; color: #fffaf2; line-height: 1.15; letter-spacing: -0.01em; }
.fac-house-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.fac-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 250, 242, 0.11); border: 1px solid rgba(242, 203, 111, 0.28);
  font-size: 12px; font-weight: 600; color: #fff5df;
}
.fac-pill[hidden] { display: none; }
.fac-pill-action {
  appearance: none; cursor: pointer; font-family: inherit;
  background: rgba(242, 203, 111, 0.18); border-color: rgba(242, 203, 111, 0.55); color: #fff8e6;
  transition: background 0.15s ease, transform 0.12s ease;
}
.fac-pill-action:hover { background: rgba(242, 203, 111, 0.3); transform: translateY(-1px); }
.fac-pill-switcher {
  appearance: none; cursor: pointer; font-family: inherit;
  background: rgba(242, 203, 111, 0.22); border-color: rgba(242, 203, 111, 0.7); color: #fff8e6;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.fac-pill-switcher:hover { background: rgba(242, 203, 111, 0.34); border-color: #ffe08a; transform: translateY(-1px); }
.fac-pill-switcher .fac-svg { width: 13px; height: 13px; }

.fac-empty-hint { margin: -4px 0 0; font-size: 12.5px; line-height: 1.4; color: rgba(255, 243, 212, 0.85); }
.fac-empty-hint[hidden] { display: none; }

.fac-house {
  background: var(--fac-house-bg); border: 1.5px solid var(--fac-house-border);
  border-radius: 18px; padding: 18px 16px 16px;
  box-shadow: inset 0 0 0 4px rgba(255, 244, 214, 0.06), 0 12px 32px rgba(0, 0, 0, 0.28);
}
.fac-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 11px; perspective: 900px; }

.fac-ambient-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding-top: 2px; }
.fac-ambient-bar[hidden] { display: none; }

.fac-chip-btn {
  position: relative; appearance: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(255, 250, 242, 0.2); background: rgba(255, 250, 242, 0.07);
  color: rgba(255, 250, 242, 0.85); font-family: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 11px; border-radius: 999px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.fac-chip-btn[aria-pressed="true"] { background: rgba(242, 203, 111, 0.2); border-color: rgba(242, 203, 111, 0.65); color: #fffaf2; }
.fac-chip-btn:hover { background: rgba(255, 250, 242, 0.16); color: #fffaf2; }
.fac-sound-nudge { border-color: rgba(242, 203, 111, 0.68); animation: fac-nudge-ring 2.4s ease-in-out 3; }
.fac-svg { width: 15px; height: 15px; flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* Wrapped Festive Gift Boxes */
.fac-door {
  position: relative; aspect-ratio: 0.92 / 1; border: 0; padding: 0; margin-top: 6px;
  background: transparent; cursor: pointer; font-family: inherit; perspective: 720px; border-radius: 10px;
}
.fac-door.is-wiggling { animation: fac-gift-wiggle 0.48s ease-in-out; }

.fac-gift-bow {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 30px; height: 12px; z-index: 4; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;
}
.fac-gift-bow::before, .fac-gift-bow::after {
  content: ''; position: absolute; top: 1px; width: 13px; height: 10px; border-radius: 50% 50% 2px 50%;
  background: linear-gradient(145deg, #ffe9a8 0%, #e4ae42 100%);
  border: 1px solid rgba(124, 72, 12, 0.45); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.26);
}
.fac-gift-bow::before { left: 2px; transform: rotate(-18deg); }
.fac-gift-bow::after { right: 2px; border-radius: 50% 50% 50% 2px; transform: rotate(18deg); }
.fac-bow-knot {
  position: absolute; left: 50%; top: 4px; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d1, #cf9127); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); z-index: 2;
}
.fac-door[data-state="opened"] .fac-gift-bow, .fac-door.is-swinging .fac-gift-bow { opacity: 0; transform: translateX(-50%) scale(0.7); }
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"] .fac-gift-bow { opacity: 0.38; }

.fac-door-pocket {
  position: absolute; inset: 0; border-radius: 10px;
  background: radial-gradient(circle at 50% 42%, #fff9e3 0%, #f5cb72 72%, #c98a32 100%);
  border: 1.5px solid #f7dc92; box-shadow: inset 0 4px 12px rgba(120, 62, 10, 0.32), 0 0 16px rgba(255, 218, 128, 0.42);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 5px 4px; color: #3a1f0a; overflow: hidden;
}
.fac-pocket-day { position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 800; color: rgba(58, 31, 10, 0.65); line-height: 1; }
.fac-pocket-icon {
  width: 34px; height: 34px; border-radius: 50%; background: #fffaf2; border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(90, 42, 8, 0.22); display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
}
.fac-pocket-from { font-size: 10.5px; font-weight: 700; max-width: 96%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fac-door-leaf {
  position: absolute; inset: 0; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 6px 4px; transform-origin: left center;
  transform: rotateY(0deg); transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  backface-visibility: hidden; text-align: center; overflow: hidden;
}
.fac-ribbon-v, .fac-ribbon-h { position: absolute; pointer-events: none; z-index: 1; }
.fac-ribbon-v { top: 0; bottom: 0; left: 50%; width: 9px; transform: translateX(-50%); background: linear-gradient(90deg, #d79c35 0%, #fce196 48%, #d1952e 100%); box-shadow: 0 0 3px rgba(0, 0, 0, 0.22); }
.fac-ribbon-h { left: 0; right: 0; top: 50%; height: 9px; transform: translateY(-50%); background: linear-gradient(180deg, #d79c35 0%, #fce196 48%, #d1952e 100%); box-shadow: 0 0 3px rgba(0, 0, 0, 0.22); }

.fac-gift-tag {
  position: relative; z-index: 2; min-width: 34px; height: 28px; padding: 0 7px; border-radius: 6px;
  background: #fffaf0; color: #2d1b12; border: 1px solid rgba(180, 134, 62, 0.45);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.26); display: inline-flex; align-items: center; justify-content: center;
}
.fac-door-num { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 16px; font-weight: 700; line-height: 1; }

.fac-door[data-state="empty"] .fac-door-pocket { display: none; }
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"] .fac-door-leaf {
  background: linear-gradient(160deg, rgba(255, 246, 228, 0.14) 0%, rgba(16, 7, 10, 0.34) 100%);
  border: 1.5px dashed rgba(242, 203, 111, 0.48); box-shadow: inset 0 0 0 2px rgba(255, 244, 214, 0.04);
}
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"] .fac-ribbon-v,
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"] .fac-ribbon-h { background: rgba(242, 203, 111, 0.16); box-shadow: none; }
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"] .fac-gift-tag { background: rgba(255, 250, 240, 0.92); color: #4a3324; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"]:hover .fac-door-leaf {
  background: linear-gradient(160deg, rgba(242, 203, 111, 0.24) 0%, rgba(255, 248, 232, 0.1) 100%);
  border-style: solid; border-color: #f6d57d; transform: translateY(-2px);
}
.fac-door-plus { position: absolute; bottom: 4px; right: 6px; z-index: 2; font-size: 12px; font-weight: 800; color: rgba(255, 232, 163, 0.78); line-height: 1; }

.fac-stage[data-showcase="1"] .fac-door .fac-door-leaf,
.fac-door[data-state="sealed"] .fac-door-leaf,
.fac-door[data-state="opened"] .fac-door-leaf {
  border: 1.5px solid rgba(245, 209, 122, 0.85);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.08), inset 0 -6px 12px rgba(0, 0, 0, 0.22), 0 5px 14px rgba(0, 0, 0, 0.34);
}
.fac-stage[data-showcase="1"] .fac-door[data-style="0"] .fac-door-leaf,
.fac-door[data-state="sealed"][data-style="0"] .fac-door-leaf,
.fac-door[data-state="opened"][data-style="0"] .fac-door-leaf {
  background: radial-gradient(circle at 22% 24%, rgba(255, 240, 210, 0.24) 2px, transparent 2.5px), radial-gradient(circle at 76% 74%, rgba(255, 240, 210, 0.24) 2px, transparent 2.5px), linear-gradient(155deg, #cf4234 0%, #8f1d18 100%);
  background-size: 22px 22px, 22px 22px, 100% 100%;
}
.fac-stage[data-showcase="1"] .fac-door[data-style="1"] .fac-door-leaf,
.fac-door[data-state="sealed"][data-style="1"] .fac-door-leaf,
.fac-door[data-state="opened"][data-style="1"] .fac-door-leaf {
  background: repeating-linear-gradient(-45deg, #2b7a4d, #2b7a4d 7px, #1f5f3b 7px, #1f5f3b 14px);
}
.fac-stage[data-showcase="1"] .fac-door[data-style="2"] .fac-door-leaf,
.fac-door[data-state="sealed"][data-style="2"] .fac-door-leaf,
.fac-door[data-state="opened"][data-style="2"] .fac-door-leaf {
  background: radial-gradient(circle at 30% 30%, rgba(255, 245, 215, 0.26) 2px, transparent 2.5px), linear-gradient(155deg, #c2722e 0%, #874515 100%);
  background-size: 18px 18px, 100% 100%;
}
.fac-stage[data-showcase="1"] .fac-door[data-style="3"] .fac-door-leaf,
.fac-door[data-state="sealed"][data-style="3"] .fac-door-leaf,
.fac-door[data-state="opened"][data-style="3"] .fac-door-leaf {
  background: radial-gradient(circle at 25% 25%, rgba(220, 240, 255, 0.26) 1.8px, transparent 2.2px), radial-gradient(circle at 75% 75%, rgba(220, 240, 255, 0.22) 1.8px, transparent 2.2px), linear-gradient(155deg, #2a6585 0%, #173d57 100%);
  background-size: 20px 20px, 20px 20px, 100% 100%;
}
.fac-stage[data-showcase="1"] .fac-door[data-style="4"] .fac-door-leaf,
.fac-door[data-state="sealed"][data-style="4"] .fac-door-leaf,
.fac-door[data-state="opened"][data-style="4"] .fac-door-leaf {
  background: repeating-linear-gradient(45deg, #9d2e4c, #9d2e4c 7px, #791d36 7px, #791d36 14px);
}
.fac-stage[data-showcase="1"] .fac-door:hover .fac-door-leaf { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42); }
.fac-stage[data-showcase="1"] .fac-door-plus { display: none; }
.fac-door[data-state="sealed"]:hover .fac-door-leaf { transform: rotateY(-18deg); box-shadow: 6px 8px 18px rgba(0, 0, 0, 0.45); }
.fac-door[data-state="opened"] .fac-door-leaf, .fac-door.is-swinging .fac-door-leaf { transform: rotateY(-112deg); box-shadow: none; }

.fac-door[data-today="1"] { filter: drop-shadow(0 0 10px rgba(255, 224, 138, 0.68)); }
.fac-door[data-today="1"] .fac-door-leaf { border-color: #ffe8a3; }

.fac-door-badge {
  position: absolute; top: 4px; right: 5px; z-index: 3; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(34, 14, 16, 0.56); color: #ffe8a3; display: inline-flex; align-items: center; justify-content: center;
}
.fac-door-badge .fac-svg { width: 11px; height: 11px; }

.fac-mine-tag, .fac-today-tag {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px; background: #ffe08a; color: #3a1a0a;
  z-index: 4; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.fac-sound-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fdf4e3; border: 1px solid #e6c98a; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #4a3519;
}
.fac-sound-prompt .fac-btn { width: auto; min-height: 36px; padding: 0 12px; font-size: 12px; flex-shrink: 0; }

/* Action Card */
.fac-panel {
  width: 100%; background: rgba(255, 250, 242, 0.98); color: #2b2118;
  border: 1px solid rgba(235, 206, 152, 0.85); border-radius: 16px; padding: 20px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34); display: flex; flex-direction: column; gap: 12px;
}
.fac-panel-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #c2562f; margin: 0; }
.fac-panel-title { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.fac-panel-sub { margin: 0; font-size: 13.5px; color: #6b5b4b; line-height: 1.45; }
.fac-panel-trust { margin: 0; text-align: center; font-size: 12px; color: #7c6b59; }
.fac-field { display: flex; flex-direction: column; gap: 5px; }
.fac-label { font-size: 12.5px; font-weight: 600; color: #5c4b3b; }

.fac-input, .fac-textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid #d8c8b4; background: #ffffff; color: #2b2118; font-family: inherit; font-size: 15px; box-sizing: border-box;
}
.fac-textarea { min-height: 92px; resize: vertical; line-height: 1.5; }

.fac-theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.fac-theme-btn {
  appearance: none; border: 1.5px solid #e5d9c8; background: #ffffff; border-radius: 10px;
  padding: 8px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; color: #2b2118; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fac-theme-btn[aria-pressed="true"] { border-color: #c2562f; background: #fdf2ee; box-shadow: 0 0 0 2px rgba(194, 86, 47, 0.16); }
.fac-swatch { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; border: 1.5px solid #d9a441; }

.fac-more-opts { border-top: 1px solid #eadcc9; padding-top: 9px; }
.fac-more-opts summary {
  font-size: 12.5px; font-weight: 600; color: #6b5b4b; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; user-select: none;
}
.fac-more-opts summary::-webkit-details-marker { display: none; }
.fac-more-opts summary::after { content: '▾'; font-size: 13px; color: #c2562f; }
.fac-more-opts[open] summary::after { content: '▴'; }
.fac-more-opts-body { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.fac-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #f3eadc; padding: 4px; border-radius: 10px; }
.fac-seg-btn {
  appearance: none; border: 0; background: transparent; color: #6b5b4b;
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px; border-radius: 8px; cursor: pointer;
}
.fac-seg-btn[aria-pressed="true"] { background: #ffffff; color: #2b2118; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.fac-toggle-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #2b2118; cursor: pointer; }
.fac-toggle-row input { width: 16px; height: 16px; accent-color: #c2562f; }

.fac-link-preview-box {
  background: #f7efe3; border: 1px solid #e6d6bf; border-radius: 10px; padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px; color: #3f2d1e; word-break: break-all; line-height: 1.35;
}
.fac-copy-box {
  background: #f7efe3; border: 1px solid #e6d6bf; border-radius: 11px; padding: 10px 12px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.fac-copy-text { margin: 0; font-size: 13px; line-height: 1.45; color: #2b2118; }
.fac-icon-btn {
  appearance: none; border: 1px solid #d8c8b4; background: #ffffff; color: #c2562f;
  width: 32px; height: 32px; border-radius: 999px; font-size: 15px; cursor: pointer;
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
}
.fac-icon-btn:hover { background: #fdf2ee; }

.fac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; font-family: inherit;
  font-size: 14.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  text-decoration: none; width: 100%;
}
.fac-btn:active { transform: translateY(1px); }
.fac-btn-primary { background: linear-gradient(180deg, #d15336 0%, #b53c22 100%); color: #ffffff; box-shadow: 0 4px 12px rgba(181, 60, 34, 0.28); }
.fac-btn-primary:hover { background: linear-gradient(180deg, #c7492c 0%, #9f331b 100%); }
.fac-btn-secondary { background: #ffffff; color: #2b2118; border-color: #d8c8b4; font-weight: 600; }
.fac-btn-secondary:hover { background: #f7f1e8; border-color: #bfa98f; }
.fac-btn-gold { background: linear-gradient(180deg, #f5cf6e 0%, #e6b447 100%); color: #2b1a0c; border-color: rgba(160, 110, 20, 0.25); box-shadow: 0 2px 8px rgba(180, 125, 25, 0.22); }
.fac-btn-gold:hover { background: linear-gradient(180deg, #f7d782 0%, #e2ab38 100%); }
.fac-btn-ghost { background: transparent; color: #6b5b4b; min-height: 36px; font-size: 13px; font-weight: 600; }
.fac-btn-ghost:hover { background: #f3eadc; color: #2b2118; }
.fac-btn-sm { min-height: 36px; font-size: 13px; }
.fac-btn-danger { background: #fff2f0; color: #b42318; border: 1px solid #f0b5ae; }
.fac-btn-danger:hover { background: #fee4e2; }

.fac-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fac-social-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fac-social-btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid #e5d9c8; background: #ffffff; color: #2b2118; border-radius: 10px;
  min-height: 38px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.fac-social-btn:hover { background: #f7f1e8; }

.fac-details { border-top: 1px solid #e5d9c8; padding-top: 10px; }
.fac-details summary { font-size: 12.5px; font-weight: 600; color: #6b5b4b; cursor: pointer; user-select: none; }
.fac-details-body { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.fac-key-bar { background: #fcf4e6; border: 1px dashed #d4a66a; border-radius: 10px; padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; }
.fac-key-bar-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.fac-key-bar-head { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.fac-key-bar-label { font-size: 12px; font-weight: 700; color: #7c3a14; display: inline-flex; align-items: center; gap: 5px; }
.fac-key-badge { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 1px 6px; border-radius: 999px; background: #fbe4dc; color: #9a3019; border: 1px solid #ebb9a8; white-space: nowrap; }
.fac-key-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; background: #ffffff; border: 1px solid #e3cfaf; border-radius: 8px; padding: 4px 6px 4px 9px; }
.fac-key-val { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 700; color: #2b2118; overflow-wrap: anywhere; }
.fac-key-bar-actions { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }

.fac-cal-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #f3eadc; padding: 4px; border-radius: 10px; }
.fac-cal-tab {
  appearance: none; border: 0; background: transparent; color: #6b5b4b;
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 7px 6px;
  border-radius: 8px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; white-space: nowrap;
}
.fac-cal-tab[aria-selected="true"] { background: #ffffff; color: #2b2118; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.fac-cal-list { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 2px; }
.fac-cal-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f7efe3; border: 1.5px solid #e8d9c3; border-radius: 12px; padding: 10px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fac-cal-item[data-current="1"] { background: #fff6e8; border-color: #d9a441; }
.fac-cal-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.fac-cal-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.fac-cal-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 1.5px solid #d9a441; }
.fac-cal-name { font-size: 14px; font-weight: 700; color: #2b2118; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fac-role-badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; flex-shrink: 0; letter-spacing: 0.02em; }
.fac-role-badge[data-role="mine"] { background: #fbe7df; color: #9c3416; border: 1px solid #ecc0ae; }
.fac-role-badge[data-role="friend"] { background: #e2f2e8; color: #1c5f38; border: 1px solid #b3dbc2; }
.fac-role-badge[data-role="current"] { background: #fff0c7; color: #7a4d09; border: 1px solid #e6c26b; }
.fac-cal-meta { font-size: 12px; color: #6b5b4b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fac-cal-actions { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; }
.fac-open-btn {
  appearance: none; border: 1px solid #d4b996; background: #ffffff; color: #2b2118; font-family: inherit;
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; flex-shrink: 0;
}
.fac-open-btn:hover { background: #f3eadc; border-color: #bfa07a; }
.fac-current-lbl { font-size: 11.5px; font-weight: 700; color: #8c5c12; padding: 0 4px; }
.fac-remove-btn {
  appearance: none; border: 1px solid transparent; background: transparent; color: #8c7b6a;
  width: 26px; height: 26px; border-radius: 999px; font-size: 16px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fac-remove-btn:hover { background: #fee4e2; color: #b42318; border-color: #f0b5ae; }
.fac-cal-empty {
  background: #f7efe3; border: 1px dashed #dac8ae; border-radius: 12px; padding: 20px 14px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.fac-cal-empty p { margin: 0; font-size: 13px; color: #6b5b4b; line-height: 1.45; }
.fac-cal-empty .fac-btn { width: auto; min-height: 36px; font-size: 13px; padding: 0 14px; }
.fac-visit-btn {
  appearance: none; border: 0; background: #2b7a4d; color: #ffffff; font-family: inherit;
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px; cursor: pointer; flex-shrink: 0;
}
.fac-visit-btn:hover { background: #21613d; }

/* Floating viewport toast: 0px layout impact on stage or backdrop */
.fac-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); margin: 0;
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: #eef6f0; border: 1.5px solid #96c7a7; color: #164428;
  box-shadow: 0 12px 32px rgba(10, 4, 6, 0.36); z-index: 1000; text-align: center;
}
.fac-toast[data-tone="warn"] { background: #fdf2ee; border-color: #e7b9a8; color: #7c2d12; }
.fac-toast[hidden] { display: none; }

@media (min-width: 961px) {
  .fac-stage { min-height: 620px; }
  .fac-panel { max-height: 572px; overflow-y: auto; scrollbar-width: thin; }
}

.fac-modal-backdrop { position: fixed; inset: 0; background: rgba(20, 12, 8, 0.72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 999; }
.fac-modal-backdrop[hidden] { display: none; }
.fac-modal {
  background: #fffaf2; color: #2b2118; border: 1px solid #e5d9c8; border-radius: 16px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.34);
}
.fac-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.fac-modal-title { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 22px; font-weight: 700; margin: 0; }
.fac-close { appearance: none; border: 1px solid #d8c8b4; background: #f7f1e8; color: #2b2118; width: 36px; height: 36px; border-radius: 8px; font-size: 18px; cursor: pointer; }
.fac-form-stack { display: flex; flex-direction: column; gap: 12px; }
.fac-stickers { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.fac-sticker-btn { appearance: none; border: 1.5px solid #e5d9c8; background: #ffffff; border-radius: 8px; height: 44px; font-size: 20px; cursor: pointer; }
.fac-sticker-btn[aria-pressed="true"] { border-color: #c2562f; background: #fdf2ee; box-shadow: 0 0 0 2px rgba(194, 86, 47, 0.2); }
.fac-char-count { font-size: 12px; color: #6b5b4b; text-align: right; }

.fac-reveal-card { background: #f7efe3; border: 1.5px solid #e5d1b3; border-radius: 14px; padding: 22px 18px; text-align: center; }
.fac-reveal-sticker { font-size: 46px; line-height: 1; margin-bottom: 12px; }
.fac-reveal-note { font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 20px; line-height: 1.5; margin: 0 0 14px; white-space: pre-wrap; word-break: break-word; color: #2b2118; }
.fac-reveal-from { font-size: 14px; font-weight: 600; color: #6b5b4b; margin: 0; }
.fac-reveal-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 10px 16px; background: #ffffff; border: 1px solid #d8c8b4; border-radius: 10px; color: #c2562f; font-weight: 600; font-size: 14px; text-decoration: none; }
.fac-share-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; word-break: break-all; background: #ffffff; border: 1px solid #d8c8b4; border-radius: 8px; padding: 10px; max-height: 78px; overflow-y: auto; }
.fac-story-preview { width: 100%; max-width: 260px; aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid #d8c8b4; margin: 0 auto; display: block; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.fac-stage :focus-visible { outline: 2px solid #ffe08a; outline-offset: 2px; }
.fac-panel :focus-visible, .fac-modal :focus-visible { outline: 2px solid #c2562f; outline-offset: 2px; }

.fac-door[data-mine="1"] .fac-door-leaf { box-shadow: 0 0 0 2px #ffe08a, 0 6px 16px rgba(0, 0, 0, 0.36); }
.fac-code-card { background: #f7efe3; border: 1px solid #e6d6bf; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.fac-pass-sub { margin: 0; font-size: 12px; line-height: 1.4; color: #6b5b4b; }
.fac-code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #ffffff; border: 1px solid #d8c8b4; border-radius: 8px; padding: 5px 7px 5px 10px; }
.fac-code-val { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; font-weight: 700; color: #2b2118; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.fac-mini-btn { appearance: none; border: 1px solid #d8c8b4; background: #f7f1e8; color: #2b2118; border-radius: 7px; padding: 5px 9px; font-family: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; flex-shrink: 0; }
.fac-mini-btn:hover { background: #efe3d0; }

.fac-owner-claim-row, .fac-setup-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 2px; }
.fac-link-btn { appearance: none; border: 0; background: transparent; color: #8c4120; font-family: inherit; font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 4px 6px; }
.fac-link-btn:hover { color: #c2562f; }
.fac-err-note { margin: 0; font-size: 13px; font-weight: 600; color: #b42318; }
.fac-err-note[hidden] { display: none; }

.fac-conflict-box { background: #fff5e6; border: 1.5px solid #e6a84c; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fac-conflict-box[hidden] { display: none; }
.fac-conflict-title { margin: 0; font-size: 13.5px; font-weight: 600; color: #7c3a14; line-height: 1.4; }
.fac-day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fac-day-chip { appearance: none; border: 1px solid #d8c8b4; background: #ffffff; color: #2b2118; border-radius: 999px; padding: 6px 11px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fac-day-chip[aria-pressed="true"] { background: #c2562f; border-color: #c2562f; color: #ffffff; }

/* V1 Viral & Retention Additions */
.fac-hot-tag {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe9a8 0%, #f0bf52 100%); color: #4a2308;
  z-index: 4; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.fac-stage[data-showcase="0"] .fac-door[data-state="empty"][data-hot] .fac-door-leaf {
  border-color: rgba(255, 224, 138, 0.85);
  box-shadow: inset 0 0 0 2px rgba(255, 224, 138, 0.14), 0 0 10px rgba(242, 203, 111, 0.24);
}
.fac-door[data-state="empty"][data-hot] .fac-door-plus { display: none; }

.fac-progress-box {
  background: #f7efe3; border: 1px solid #e6d6bf; border-radius: 11px;
  padding: 9px 11px; display: flex; flex-direction: column; gap: 6px;
}
.fac-progress-box[data-urgent="1"] { background: #fff3ec; border-color: #eab39c; }
.fac-progress-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: #3f2d1e; flex-wrap: wrap;
}
.fac-progress-urgent { color: #b53c22; }
.fac-progress-bar { width: 100%; height: 7px; border-radius: 999px; background: #e8dac6; overflow: hidden; }
.fac-progress-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #c2562f 0%, #e6b447 100%);
  transition: width 0.35s ease;
}
.fac-progress-box[data-full="1"] .fac-progress-fill { background: linear-gradient(90deg, #2b7a4d 0%, #48a16b 100%); }
.fac-hot-callout { margin: 0; font-size: 12px; font-weight: 600; color: #7c3a14; line-height: 1.35; }
.fac-instant-banner {
  background: #eaf6ee; border: 1px solid #b5dcbf; color: #1a5431;
  border-radius: 10px; padding: 8px 11px; font-size: 12.5px; font-weight: 600; line-height: 1.4;
}

.fac-b2a-box {
  background: linear-gradient(165deg, #fff9ea 0%, #fdf0d5 100%);
  border: 1.5px solid #e4b856; border-radius: 14px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 6px 18px rgba(180, 125, 25, 0.14);
}
.fac-b2a-kicker { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #b53c22; }
.fac-b2a-title { margin: 0; font-family: var(--font-display, 'Fraunces', Georgia, serif); font-size: 18px; font-weight: 700; color: #2b2118; line-height: 1.25; }
.fac-b2a-swatches { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fac-b2a-swatch-lbl { font-size: 12px; font-weight: 600; color: #6b5b4b; margin-right: 2px; }
.fac-b2a-dot {
  appearance: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid #ffffff; box-shadow: 0 0 0 1.5px #d4b996; padding: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fac-b2a-dot[aria-pressed="true"] { box-shadow: 0 0 0 2.5px #c2562f; transform: scale(1.1); }

.fac-recip-bar {
  background: #eaf6ee; border: 1.5px solid #9fd0ae; border-radius: 11px;
  padding: 10px 11px; display: flex; flex-direction: column; gap: 8px;
}
.fac-recip-text { margin: 0; font-size: 12.5px; font-weight: 600; color: #17492b; line-height: 1.4; }
.fac-recip-actions { display: flex; align-items: center; gap: 6px; }

.fac-remind-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #f7efe3; border: 1px solid #e6d6bf; border-radius: 10px;
  padding: 8px 10px; font-size: 12.5px; color: #4a3519;
}
.fac-remind-bar[data-on="1"] { background: #eaf6ee; border-color: #a9d5b6; color: #17492b; }
.fac-remind-info { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; line-height: 1.3; }
.fac-remind-btn {
  appearance: none; border: 1px solid #d4b996; background: #ffffff; color: #2b2118;
  border-radius: 8px; padding: 6px 10px; font-family: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.fac-remind-btn:hover { background: #fdf2ee; border-color: #c2562f; color: #b53c22; }
.fac-remind-bar[data-on="1"] .fac-remind-btn { border-color: #8cc49e; color: #17492b; }
.fac-ios-box {
  background: #fcf4e6; border: 1px dashed #d4a66a; border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: #4a3519; line-height: 1.45;
}
.fac-ios-box p { margin: 0; }
.fac-webview-hint { margin: 0; text-align: center; font-size: 12px; color: #7c6b59; line-height: 1.4; }

@media (max-width: 960px) {
  .fac-stage-inner { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .fac-panel { width: 100%; box-sizing: border-box; padding: 16px; gap: 11px; }
  .fac-stage[data-view-mode="active"] .fac-panel { order: -1; }
}

@media (max-width: 640px) {
  .fac-stage { padding: 14px 10px 12px; border-radius: 18px; }
  .fac-stage[data-view-mode="setup"] .fac-house-head { gap: 6px; }
  .fac-stage[data-view-mode="setup"] .fac-house-title { font-size: 16px; }
  .fac-stage[data-view-mode="setup"] .fac-pill { font-size: 11px; padding: 3px 8px; }
  .fac-stage[data-view-mode="setup"] .fac-house { padding: 11px 8px 8px; border-radius: 14px; }
  .fac-stage[data-view-mode="setup"] .fac-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 6px; }
  .fac-stage[data-view-mode="setup"] .fac-door { aspect-ratio: 0.94 / 1; margin-top: 4px; border-radius: 7px; }
  .fac-stage[data-view-mode="setup"] .fac-door-leaf { border-radius: 7px; padding: 3px 2px; }
  .fac-stage[data-view-mode="setup"] .fac-gift-bow { width: 22px; height: 9px; top: -6px; }
  .fac-stage[data-view-mode="setup"] .fac-gift-bow::before,
  .fac-stage[data-view-mode="setup"] .fac-gift-bow::after { width: 9px; height: 7px; }
  .fac-stage[data-view-mode="setup"] .fac-bow-knot { width: 5px; height: 5px; top: 3px; }
  .fac-stage[data-view-mode="setup"] .fac-ribbon-v { width: 6px; }
  .fac-stage[data-view-mode="setup"] .fac-ribbon-h { height: 6px; }
  .fac-stage[data-view-mode="setup"] .fac-gift-tag { min-width: 24px; height: 20px; padding: 0 4px; border-radius: 4px; }
  .fac-stage[data-view-mode="setup"] .fac-door-num { font-size: 12px; }
  .fac-stage[data-view-mode="setup"] .fac-panel { padding: 14px; border-radius: 14px; gap: 10px; }
  .fac-stage[data-view-mode="setup"] .fac-panel-kicker { display: none; }
  .fac-stage[data-view-mode="setup"] .fac-panel-title { font-size: 18px; }
  .fac-stage[data-view-mode="setup"] .fac-input { min-height: 42px; padding: 8px 11px; font-size: 14.5px; }
  .fac-stage[data-view-mode="setup"] .fac-theme-btn { padding: 7px 8px; font-size: 12.5px; gap: 6px; }
  .fac-stage[data-view-mode="setup"] .fac-swatch { width: 16px; height: 16px; }

  .fac-stage[data-view-mode="active"] .fac-house { background: transparent; border: 0; padding: 6px 0 0; box-shadow: none; border-radius: 0; }
  .fac-stage[data-view-mode="active"] .fac-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; }
  .fac-stage[data-view-mode="active"] .fac-house-head { flex-direction: row; align-items: center; justify-content: space-between; gap: 6px; }
  .fac-stage[data-view-mode="active"] .fac-house-title { font-size: 17px; }
  .fac-stage[data-view-mode="active"] .fac-pill { padding: 3px 8px; font-size: 11px; }
  .fac-stage[data-view-mode="active"] .fac-door-num { font-size: 15px; }
  .fac-stage[data-view-mode="active"] .fac-pocket-icon { width: 28px; height: 28px; font-size: 16px; }
  .fac-stage[data-view-mode="active"] .fac-pocket-from { font-size: 10px; }
  .fac-ambient-bar { gap: 6px; padding-top: 4px; }
  .fac-chip-btn { padding: 6px 9px; font-size: 12px; }
}