:root {
  color-scheme: light;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --serif: Baskerville, "Times New Roman", serif;
}
body { background: #393129; }
#hero {
  --paper: #fbedd8; --ink: #27221f; --seal: #ac3e24; --thread: #4c3428;
  --grade: saturate(.76) brightness(.98) contrast(.985);
  --dusk: 0; --night: 0; --lamplight: .14; --lamp-filter: saturate(.73) brightness(1.02);
  --air: #eee6dc; --chime-paper: #e6ceac; --chime-edge: #926f52;
  --arrival-light: #fff2cb; --ring: #fff3dfd9; --panel-fade: .99;
  --open: clamp(0, calc((var(--progress, 0) - .12) * 1.38), 1);
  --door: var(--door-open, var(--open));
  --travel: calc(var(--progress,0) * var(--progress,0) * (3 - 2 * var(--progress,0)));
  color: var(--paper); background: #514336;
  -webkit-tap-highlight-color: transparent;
}
#hero[data-mode="dusk"] {
  --ink: #39261e; --paper: #ffecd2; --seal: #d15a34; --thread: #392922;
  --grade: sepia(.24) saturate(.86) brightness(.75) contrast(1.055);
  --dusk: .68; --night: 0; --lamplight: .56; --lamp-filter: saturate(1.1) brightness(1.06);
  --air: #e2c4b2; --chime-paper: #d8b48e; --chime-edge: #76513b;
  --arrival-light: #ffc37b; --ring: #fff0d6e3;
}
#hero[data-mode="night"] {
  --ink: #f2e8de; --paper: #e7e2da; --seal: #bc6248; --thread: #302c31;
  --grade: saturate(.37) brightness(.41) contrast(1.09);
  --dusk: 0; --night: .89; --lamplight: .93; --lamp-filter: saturate(1.18) brightness(1.15);
  --air: #b6c3d1; --chime-paper: #b7a791; --chime-edge: #62594c;
  --arrival-light: #ffb657; --ring: #f9e0b5df;
}
.court-art { position: absolute; left: var(--art-x, 0); top: var(--art-y, 0); width: var(--art-w, 100%); height: var(--art-h, 100%); }
#background, .photo-cut, .door-leaf img { filter: var(--grade); transition: filter 1s ease; }
.grade-dusk, .grade-night, .practical, .court-weather, .floor-shine { position: absolute; inset: 0; pointer-events: none; }
.grade-dusk {
  opacity: var(--dusk);
  background: radial-gradient(ellipse 67% 56% at 88% 26%, #eeb49675, transparent 70%), linear-gradient(153deg,#562b4a39,transparent 65%,#49302a30);
  mix-blend-mode: color; transition: opacity 1s;
}
.grade-night {
  opacity: var(--night);
  background: linear-gradient(152deg, #19304775, #38547b8c 49%, #2436506b 79%, #20324678);
  mix-blend-mode: color; transition: opacity 1.1s;
}
.practical {
  background: url(/__harness/front/bg_clean.webp?v=e0c572d301) center / 100% 100% no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 8.8% 12.1% at 85.7% 54.2%, #000 62%, transparent), radial-gradient(ellipse 8.4% 14% at 85.8% 81%, #0008, transparent), radial-gradient(ellipse 14% 6% at 38% 75%, #0008, transparent);
  mask-image: radial-gradient(ellipse 8.8% 12.1% at 85.7% 54.2%, #000 62%, transparent), radial-gradient(ellipse 8.4% 14% at 85.8% 81%, #0008, transparent), radial-gradient(ellipse 14% 6% at 38% 75%, #0008, transparent);
  opacity: var(--lamplight); filter: var(--lamp-filter); transition: opacity 1s, filter 1s;
}
.door-light {
  position: absolute; left: 75.5%; top: 38.5%; width: 20.5%; height: 30%;
  color: var(--arrival-light); background: radial-gradient(ellipse at center, currentColor, transparent 67%);
  mix-blend-mode: screen; opacity: calc(.04 + var(--lamplight) * .13 + var(--door) * .54);
  transition: color 2.85s ease;
}
.door-rays {
  position: absolute; left: 40%; top: 38%; width: 58%; height: 56%; pointer-events: none;
  background: radial-gradient(ellipse 72% 82% at 86% 18%, rgba(255, 226, 174, .46), rgba(255, 206, 134, .18) 46%, transparent 76%);
  mix-blend-mode: screen; filter: blur(18px);
  opacity: calc(var(--door) * .72); transform-origin: 86% 18%;
  transform: rotate(-18deg) scale(calc(.82 + var(--door) * .22));
}
.door-opening {
  position: absolute; left: 79.55%; top: 45.66%; width: 12.40%; height: 16.32%;
  overflow: hidden; opacity: clamp(0, calc(var(--door) * 6), 1);
  background: radial-gradient(ellipse at 50% 58%, #fffbe8, var(--arrival-light) 43%, #704623 93%);
}
.door-opening::before {
  position: absolute; content: ""; inset: 0; opacity: .39;
  background: linear-gradient(177deg, #71461b77, transparent 27% 82%, #744723a1 83%, #ffdb96 85%, #ac8051 94%);
}
.inner-room {
  position: absolute; inset: 0; overflow: hidden;
  background: linear-gradient(95deg,#35271c5e,transparent 26% 76%,#33261a52), url(/__harness/front/bg_clean.webp?v=e0c572d301) 34.8% 56.6% / 765% 565% no-repeat;
  box-shadow: inset 4px 1px 5px #54402767; filter: saturate(.79) brightness(1.04);
}
.inner-room::before {
  content: ""; position: absolute; right: 4%; top: 2%; width: 29%; height: 83%;
  background: url(/__harness/front/bg_clean.webp?v=e0c572d301) 87.2% 54.8% / 2500% 685% no-repeat;
  opacity: .75; filter: contrast(.87) brightness(.95); transform: skewY(-3deg);
  box-shadow: -1px 0 2px #6f472b8c;
}
.inner-room::after {
  content: ""; position: absolute; inset: 83% 0 0;
  background: linear-gradient(180deg,#744f29a3,transparent 31%,#92632d34),url(/__harness/front/bg_clean.webp?v=e0c572d301) 83% 73% / 740% 2300% no-repeat;
  box-shadow: 0 -1px 2px #67452a8c; transform: skewY(-1.4deg) scale(1.05);
}
.door-leaf { position: absolute; inset: 0 auto 0 0; width: 50%; overflow: hidden; transform: translateX(calc(var(--door) * -76%)); }
.door-leaf + .door-leaf { left: 50%; transform: translateX(calc(var(--door) * 76%)); }
.door-leaf img {
  position: absolute; width: var(--art-w); height: var(--art-h); max-width: none;
  left: calc(var(--art-w) * -.7955); top: calc(var(--art-h) * -.4566);
}
.door-leaf + .door-leaf img { left: calc(var(--art-w) * -.8575); }
.floor-shine {
  background: repeating-linear-gradient(176deg, transparent 0 8px, #ffe0a838 9px, transparent 11px 19px);
  -webkit-mask-image: radial-gradient(ellipse 8% 18% at 85.5% 85%, #000 5%, transparent 88%);
  mask-image: radial-gradient(ellipse 8% 18% at 85.5% 85%, #000 5%, transparent 88%);
  opacity: calc(.14 + var(--door) * .56); mix-blend-mode: screen;
  animation: courtyard-water 9s ease-in-out infinite alternate;
}
.threshold-bloom {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  background: radial-gradient(circle at calc(var(--door-x, 85.7%) + (50% - var(--door-x, 85.7%)) * var(--travel)) calc(var(--door-y, 54.1%) + (50% - var(--door-y, 54.1%)) * var(--travel)),
    rgba(255, 241, 206, .92) 0%, rgba(255, 224, 166, .48) 34%, transparent 72%);
  opacity: clamp(0, calc((var(--progress, 0) - .56) * 1.9), .88);
}
@keyframes courtyard-water { to { transform: translateY(3px) scaleY(1.007); } }
.court-weather { z-index: 1; width: 100%; height: 100%; opacity: .93; }
.court-frame {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(0deg,#221a14a1,transparent 13%), linear-gradient(120deg,#130e0926,transparent 32%);
}
.portrait-eave, .portrait-paper { display: none; }
#hero button { -webkit-appearance: none; appearance: none; }

/* Top Header */
.court-header {
  position: absolute; z-index: 8; left: 3.65%; right: 3.65%; top: clamp(22px, 5.2vh, 52px);
  display: grid; grid-template-columns: auto 1fr auto auto; gap: clamp(18px, 2.4vw, 42px); align-items: center;
  pointer-events: none; color: var(--paper); transition: color 1s, opacity .35s;
}
.court-header button, .court-header nav, .court-header .role-wrap { pointer-events: auto; }
.signature { display: flex; align-items: center; gap: 13px; white-space: nowrap; line-height: .85; color: var(--paper); }
.signature strong { font-family: var(--serif); font-size: clamp(30px, 2.6vw, 48px); font-weight: 400; letter-spacing: .105em; text-shadow: 0 1px 8px #24170769; }
.seal { width: .92em; height: .92em; display: inline-block; background: var(--seal); box-shadow: inset 0 0 0 1px #87372050; transition: background-color 1s; }

/* Inline simple navigation (guest 2 / friends 3) */
.court-links {
  display: flex; align-items: center; gap: clamp(18px, 2.6vw, 44px); padding-left: clamp(18px, 2.2vw, 38px);
  position: relative; justify-self: start;
}
.court-links[hidden] { display: none; }
.court-links::before { content: ""; position: absolute; left: 0; top: 24%; height: 52%; width: 1px; background: #f4e8cd8c; }
.court-links button {
  position: relative; padding: 10px 2px; border: 0; background: transparent;
  font-size: clamp(13px, 1vw, 15px); font-weight: 500; letter-spacing: .08em;
  color: var(--paper); text-shadow: 0 1px 8px #1e160f; white-space: nowrap;
  transition: transform .25s ease, opacity .25s ease;
}
.court-links button::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.court-links button:is(:hover,:focus-visible)::after,
.court-links button.is-departing::after { transform: scaleX(1); }
.court-links button.is-departing { color: var(--arrival-light); transform: translateY(-1px); }

.ink-times { display: flex; gap: 1px; align-items: center; justify-self: end; color: var(--ink); transition: color 1s; }
.ink-times button, .court-sound, .door-label, .arrival {
  font-family: var(--serif); font-weight: 400; letter-spacing: .16em;
}
.ink-times button {
  min-width: 34px; position: relative; display: grid; justify-items: center; gap: 6px; align-content: center;
  padding: 4px 5px; min-height: 40px; border: 0; background: transparent; font-size: clamp(9px, .68vw, 12px);
}
.ink-times button::before { content: ""; width: 7px; height: 7px; border-radius: 44% 51% 48% 45%; background: currentColor; opacity: .3; transition: transform .35s, opacity .35s; }
.ink-times button + button::after { content: "·"; position: absolute; left: -2px; bottom: 5px; opacity: .66; }
#hero[data-mode="day"] [data-time="day"]::before, #hero[data-mode="dusk"] [data-time="dusk"]::before, #hero[data-mode="night"] [data-time="night"]::before,
.ink-times button:hover::before { opacity: 1; transform: scale(1.16); }

/* Role Switcher Pill + Menu */
.role-wrap { position: relative; justify-self: end; }
.role-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 7px 15px;
  border: 1px solid currentColor; border-radius: 999px;
  color: var(--ink); background: #f2e9dd38; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: .02em;
  transition: color 1s, background-color .25s, border-color .25s;
}
.role-pill:hover { background: #f7ebd785; }
#hero[data-mode="night"] .role-pill { color: var(--paper); background: #22293275; }
#hero[data-mode="night"] .role-pill:hover { background: #36414ea8; }
.role-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--seal); flex: none; }
.role-caret { font-size: 10px; opacity: .75; }
.role-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 204px; padding: 6px;
  border-radius: 12px; border: 1px solid #d7cab455;
  background: rgba(31, 25, 21, 0.94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: #f4ece0; box-shadow: 0 18px 44px rgba(10, 8, 6, 0.45);
  display: grid; gap: 3px; z-index: 20;
}
.role-menu[hidden] { display: none; }
.role-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; border-radius: 8px; padding: 9px 11px; background: transparent;
  color: inherit; text-align: left; font-size: 13.5px; transition: background .2s;
}
.role-opt:hover { background: rgba(255, 240, 218, .12); }
.role-opt[aria-checked="true"] { background: rgba(172, 62, 36, .34); color: #fff6e8; font-weight: 600; }
.role-cnt { font-size: 11.5px; opacity: .72; font-variant-numeric: tabular-nums; }

/* Architectural Frosted Hanji Dock for HaEun (7) / Master (9) */
.court-dock-outer {
  position: absolute; z-index: 8; left: 50%; top: clamp(76px, 11.4vh, 108px);
  transform: translateX(-50%); max-width: calc(100vw - 40px);
  opacity: clamp(0, calc(1 - var(--progress) * 3.1), 1); transition: opacity .25s ease;
}
.court-dock-outer[hidden] { display: none; }
.court-dock {
  display: flex; align-items: center; gap: 4px; padding: 5px 10px;
  border-radius: 999px; border: 1px solid rgba(251, 237, 216, .24);
  background: rgba(27, 21, 17, .60); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(15, 11, 8, .28);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.court-dock::-webkit-scrollbar { display: none; }
.dock-sep { width: 1px; height: 14px; background: rgba(251, 237, 216, .24); flex: none; margin: 0 4px; }
.dock-btn {
  position: relative; flex: none; border: 0; border-radius: 999px;
  padding: 6px 12px; background: transparent; color: #f6ead6;
  font-size: 13px; font-weight: 500; letter-spacing: .02em; white-space: nowrap;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.dock-btn:hover, .dock-btn:focus-visible { background: rgba(251, 237, 216, .16); color: #fff9ef; }
.dock-btn.is-departing { background: var(--seal); color: #fff8ee; transform: scale(.97); }
.dock-tag {
  display: inline-block; width: 4px; height: 4px; border-radius: 50%; margin-right: 6px; vertical-align: middle; opacity: .7;
}
.dock-btn[data-motion="aperture"] .dock-tag { background: #e8b375; }
.dock-btn[data-motion="unfold"] .dock-tag { background: #9bd2b3; }
.dock-btn[data-motion="curtain"] .dock-tag { background: #e28466; }

/* Existing Chime, Stipple, Portal, Foot */
.chime {
  position: absolute; z-index: 4; left: var(--chime-x, 18.4%); top: var(--chime-y, 17.5%);
  width: clamp(39px,3.72vw,66px); display: grid; justify-items: center; transform-origin: 50% 0;
  transform: translateX(-50%) rotate(var(--chime-wind, 0deg)); pointer-events: auto; cursor: help;
  opacity: clamp(0,calc(1 - var(--progress) * 2.6),1); transition: opacity .25s;
}
.chime-string {
  width: 2px; height: clamp(48px, 11.8vh, 117px); background: var(--thread);
  box-shadow: 1px 0 #d9af8057; transition: background-color 1s; position: relative;
}
.chime-string::after {
  content: ""; position: absolute; bottom: -1px; left: -2px; width: 6px; height: 12px;
  border: 1px solid #805b39; border-radius: 50%;
}
.tag {
  position: relative; width: 100%; height: clamp(120px, 18.5vh, 176px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: clamp(11px,1.7vh,19px);
  background-color: var(--chime-paper); color: #372d24; border: 1px solid var(--chime-edge);
  background-image: linear-gradient(109deg,#fff5dd27,transparent 42%,#74583417), repeating-linear-gradient(33deg,transparent 0 13px,#816d5510 13.5px,transparent 14.8px 24px),repeating-linear-gradient(128deg,transparent 0 18px,#c5a88a38 18.6px, transparent 20.2px 31px);
  box-shadow: inset 0 0 0 2px #e0c4a451, 2px 4px 7px #30231825;
  transform: skewY(3.8deg); transform-origin: top center; transition: background-color 1s, border-color 1s;
  font-variant-numeric: tabular-nums; font-family: var(--serif);
}
.tag::before { content: ""; position: absolute; left: calc(50% - 3px); top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #71604c; border: 1px solid #a98964; box-shadow: 0 1px 1px #f1dab7; }
.tag time, .tag output { font-size: clamp(13px,1.12vw,21px); letter-spacing: -.045em; line-height: 1; }
.tag-rule { width: 56%; height: 1px; background: #7d67435c; }
.tag output small { font-size: .64em; vertical-align: top; }
.tag .approx { vertical-align: .12em; font-size: .56em; margin-right: 1px; opacity: .72; }
#stipple {
  position: absolute; z-index: 4; left: var(--mark-x,40%); top: var(--mark-y,55%); width: var(--mark-w,23vw); height: var(--mark-h,13vw);
  transform: translate(-50%,-50%); opacity: clamp(0, calc(var(--panel-fade) - var(--progress) * 2.15), 1);
  filter: drop-shadow(.15px .45px .65px #7c501f94) drop-shadow(0 0 2px #ffd09072);
  transition: opacity .22s; cursor: pointer;
}
.morph-switch {
  display: grid; place-items: center; position: absolute; z-index: 5; top: var(--swap-y,65%); left: var(--swap-x,48%);
  width: 36px; height: 35px; transform: translate(-50%,-50%); padding: 0; border: 0; border-radius: 50%;
  color: #fff6dc; background: transparent; opacity: clamp(0, calc(.86 - var(--progress) * 2.7), 1);
  transition: opacity .25s,color .3s;
}
.morph-switch svg { width: 27px; height: 22px; opacity: .89; filter: drop-shadow(0 1px 2px #604723c4); }
.morph-switch:is(:hover,:focus-visible) svg { opacity: 1; }
#hero[data-form="dogs"] .morph-switch .swap-indicator { transform: translateX(8px); }
.swap-indicator { transition: transform .5s; }
.door-portal {
  position: absolute; z-index: 5; left: calc(var(--door-x,85.7%) + (50% - var(--door-x,85.7%)) * var(--travel));
  top: calc(var(--door-y,54.1%) + (50% - var(--door-y,54.1%)) * var(--travel));
  width: var(--ring-size,13.3vw); height: var(--ring-size,13.3vw); transform: translate(-50%,-50%) scale(calc(1 + var(--travel) * .51));
  border: 1px solid var(--ring); border-radius: 50%; color: var(--ring); background: transparent;
  box-shadow: 0 0 0 1px #5d473222; cursor: zoom-in; transition: color 1s, border-color 1s, box-shadow .35s, opacity .28s;
}
.door-portal::before {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px;
  background: conic-gradient(from -90deg, #fff0ce calc(var(--progress) * 1turn), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.door-portal:hover { box-shadow: 0 0 0 6px #f4dbc116, 0 0 0 1px #f0d4a046; }
.door-label {
  position: absolute; top: calc(100% + 13px); left: 50%; transform: translateX(-50%);
  font-size: clamp(9px,.72vw,12px); white-space: nowrap; color: #fff5df; text-shadow: 0 1px 5px #322316,0 0 11px #312417b3;
}
.door-meter {
  position: absolute; left: 50%; bottom: 13%; transform: translateX(-50%); padding: 3px 5px;
  color: #fff6de; background: #44301d55; font: 10px/1.2 ui-monospace, monospace;
  opacity: 0; transition: opacity .26s; font-variant-numeric: tabular-nums;
}
#hero:is([data-state="armed"],[data-state="travelling"]) .door-meter { opacity: 1; }
#hero[data-state="arrived"] .door-portal { visibility: hidden; pointer-events: none; }
#hero:is([data-state="travelling"],[data-state="arrived"]) :is(.morph-switch,#stipple) { pointer-events: none; }
#hero:is([data-state="travelling"],[data-state="arrived"]) :is(.ink-times,.role-pill) { color: #fff1df; text-shadow: 0 1px 5px #362515; }

/* Threshold Doorway Picker (when zoomed via SCROLL TO ENTER) */
.arrival-picker {
  position: absolute; z-index: 7; left: 50%; top: 53%; transform: translate(-50%,-50%);
  width: min(360px, calc(100vw - 36px)); padding: 18px 20px 16px;
  border: 1px solid #d5b48c66; border-radius: 12px;
  color: #f8ecd8; background: rgba(37, 27, 21, 0.90); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 22px 54px rgba(10, 7, 5, .52); text-align: center;
  visibility: hidden; pointer-events: none; opacity: 0; transition: opacity .3s ease, visibility .3s;
}
#hero[data-state="arrived"] .arrival-picker { visibility: visible; pointer-events: auto; opacity: 1; }
.arrival-picker h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: #fff4df; }
.arrival-picker p { margin: 0 0 14px; font-size: 12.5px; color: #ccbda6; }
.arrival-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.arrival-list button {
  border: 1px solid #d6b6925c; border-radius: 999px; padding: 6px 13px;
  background: rgba(255, 244, 224, .08); color: #fbf0dd; font-size: 13px;
  transition: background .2s, border-color .2s;
}
.arrival-list button:hover { background: var(--seal); border-color: var(--seal); color: #fff; }
.arrival-back { margin-top: 12px; border: 0; background: transparent; color: #bfa98e; font-size: 12px; text-decoration: underline; }

.court-foot { position: absolute; z-index: 7; left: 3.65%; right: 3.65%; bottom: clamp(22px,6.5vh,72px); min-height: 38px; display: flex; align-items: center; pointer-events: none; }
.court-foot button, .court-foot nav { pointer-events: auto; }
.chapters {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); display: flex; align-items: center; gap: clamp(14px,1.55vw,30px);
  color: var(--paper); text-shadow: 0 1px 4px #33291c; transition: color 1s; font-family: var(--serif);
}
.chapters::before, .chapters::after { content: ""; width: clamp(27px,4.15vw,78px); height: 1px; background: currentColor; opacity: .52; }
.chapters button { position: relative; border: 0; background: transparent; padding: 8px 1px; min-width: 28px; font-size: clamp(17px,1.35vw,24px); font-variant-numeric: tabular-nums; letter-spacing: .07em; opacity: .66; transition: opacity .25s; }
.chapters button::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 3px; height: 3px; transform: translateX(-50%) scale(0); border-radius: 45%; background: #f0d1af; transition: transform .25s; }
#hero[data-chapter="1"] [data-index="1"],#hero[data-chapter="2"] [data-index="2"],#hero[data-chapter="3"] [data-index="3"],#hero[data-chapter="4"] [data-index="4"],.chapters button:hover { opacity: 1; }
#hero[data-chapter="1"] [data-index="1"]::after,#hero[data-chapter="2"] [data-index="2"]::after,#hero[data-chapter="3"] [data-index="3"]::after,#hero[data-chapter="4"] [data-index="4"]::after { transform: translateX(-50%) scale(1); }
.court-sound { display: flex; align-items: center; gap: 9px; border: 0; padding: 10px 0; color: var(--paper); background: transparent; font-size: 9px; letter-spacing: .15em; text-shadow: 0 1px 6px #20170e; transition: color 1s; }
.reeds { width: 17px; height: 11px; display: flex; justify-content: space-between; align-items: center; }
.reeds i { width: 1px; height: 4px; background: currentColor; }
.reeds i:nth-child(2) { height: 9px; }.reeds i:nth-child(3) { height: 5px; }.reeds i:nth-child(4) { height: 11px; }
[data-sound][aria-pressed="true"] .reeds i { animation: reed .95s ease-in-out infinite alternate; }.reeds i:nth-child(even) { animation-delay: -.5s !important; }
@keyframes reed { 0% { transform: scaleY(.35); } 100% { transform: scaleY(1); } }
#hero[data-portrait="true"] .portrait-eave, #hero[data-portrait="true"] .portrait-paper { display: block; position: absolute; pointer-events: none; }
.portrait-eave { left: var(--eave-x); top: 0; width: var(--eave-w); height: var(--eave-h); z-index: 2; }
.portrait-paper { left: var(--slice-x); top: var(--slice-y); width: var(--slice-w); height: var(--slice-h); z-index: 3; filter: drop-shadow(1px 3px 2px #382b1b32); }
.photo-cut { position: absolute; inset: 0; background-image: url(/__harness/front/bg_clean.webp?v=e0c572d301); background-repeat: no-repeat; }
.portrait-eave .photo-cut {
  background-size: 225.95% 324.48%; background-position: 23.07% 0%;
  clip-path: polygon(0 0,98% 0,95% 11%,92% 18%,87% 18%,86% 16%,82.4% 29.5%,78% 32.5%,74% 31.5%,70% 43%,67% 42%,64.7% 46%,61% 52%,56.7% 48%,51% 65.5%,46.4% 69%,41% 64.8%,36% 72%,31% 68%,27% 78.5%,23% 73%,20.7% 78%,17% 83%,14% 80%,10% 86%,7% 81%,5% 88%,0 94%);
}
.portrait-paper .photo-cut {
  background-size: 309.63% 186.34%; background-position: 33.56% 61.52%;
  clip-path: polygon(.7% 87%,5% 85.9%,5% 6.9%,3.1% 6.4%,3.1% 4.1%,4.8% 4%,5.3% 2.1%,8.8% 1.5%,10.6% 3.2%,88.8% 23.4%,90.1% 23.2%,90.1% 24.4%,93.4% 25.7%,93.4% 26.8%,92.6% 27%,92.6% 78.7%,97.4% 78.4%,99.5% 80.5%,99.6% 85.4%,92.6% 86.2%,39.1% 89.3%,36.7% 100%,1% 98.6%);
}

/* Phase 2: "가는 길" Travel Transition Veil */
#hero[data-traveling="true"] :is(.court-header, .court-dock-outer, .court-foot, .door-portal) {
  opacity: 0 !important; pointer-events: none !important; transition: opacity .42s ease !important;
}
#travel-veil {
  position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden;
  opacity: 0; visibility: hidden; transition: opacity .52s ease, visibility .52s;
}
#travel-veil.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.veil-panel { position: absolute; inset: 0; transition: transform .88s cubic-bezier(.19,1,.22,1), opacity .64s ease; }

/* Style 1: Aperture (원격: 맥, 윈도우, 칼리리눅스) */
#travel-veil[data-travel-style="aperture"] .veil-a,
#travel-veil[data-travel-style="aperture"] .veil-b {
  width: 50.5%; top: 0; bottom: 0; background: #141210;
  background-image: repeating-linear-gradient(90deg, rgba(251,237,216,.04) 0 1px, transparent 1px 44px);
}
#travel-veil[data-travel-style="aperture"] .veil-a { left: 0; transform: translateX(-101%); border-right: 1px solid #e6b87c66; }
#travel-veil[data-travel-style="aperture"] .veil-b { left: auto; right: 0; transform: translateX(101%); border-left: 1px solid #e6b87c66; }
#travel-veil.is-sweeping[data-travel-style="aperture"] .veil-a,
#travel-veil.is-sweeping[data-travel-style="aperture"] .veil-b { transform: translateX(0); }

/* Style 2: Unfold (공간: 게임, 하네스, 사진첩) */
#travel-veil[data-travel-style="unfold"] .veil-a {
  background: radial-gradient(circle at 75% 50%, #f5ebd9, #e4d5be 62%, #d5c1a4);
  transform: scale(.92); opacity: 0;
}
#travel-veil[data-travel-style="unfold"] .veil-b { display: none; }
#travel-veil.is-sweeping[data-travel-style="unfold"] .veil-a { transform: scale(1); opacity: 1; }

/* Style 3: Curtain (자료: 디자인 레퍼런스, 캐릭터 레퍼런스, 경제) */
#travel-veil[data-travel-style="curtain"] .veil-a {
  background: #1b1815;
  background-image: repeating-linear-gradient(180deg, rgba(251,237,216,.05) 0 1px, transparent 1px 8px);
  transform: translateY(-102%);
}
#travel-veil[data-travel-style="curtain"] .veil-b { display: none; }
#travel-veil.is-sweeping[data-travel-style="curtain"] .veil-a { transform: translateY(0); }

.veil-cue {
  position: relative; z-index: 2; height: 100%; display: grid; place-content: center; text-align: center; padding: 24px;
  opacity: 0; transform: translateY(10px); transition: opacity .42s ease .16s, transform .48s cubic-bezier(.16,1,.3,1) .16s;
}
#travel-veil.is-sweeping .veil-cue { opacity: 1; transform: translateY(0); }
#travel-veil[data-travel-style="unfold"] .veil-cue { color: #241e18; }
#travel-veil[data-travel-style="aperture"] .veil-cue,
#travel-veil[data-travel-style="curtain"] .veil-cue { color: #f6ead6; }
.veil-path { font-size: 13px; letter-spacing: .14em; opacity: .78; margin-bottom: 10px; }
.veil-title { font-size: clamp(28px, 4vw, 44px); font-weight: 700; letter-spacing: .04em; margin: 0 0 8px; transition: letter-spacing .65s cubic-bezier(.16,1,.3,1); }
#travel-veil.is-sweeping .veil-title { letter-spacing: -.02em; }
.veil-sub { font-size: 14px; opacity: .8; margin: 0; }

/* Phase 3: Destination Shell (#dest-stage) */
#dest-stage {
  position: fixed; inset: 0; z-index: 25; overflow-y: auto; overflow-x: hidden;
  background: #f3eee4; color: #1d1a16;
  opacity: 0; transform: translateY(14px); visibility: hidden;
  transition: opacity .46s ease, transform .46s cubic-bezier(.16,1,.3,1), visibility .46s;
}
#dest-stage.is-open { opacity: 1; transform: translateY(0); visibility: visible; }
.dest-bar {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; background: rgba(243, 238, 228, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #ddd3c2; flex-wrap: wrap;
}
.dest-back {
  border: 1px solid #2b251e; border-radius: 999px; padding: 7px 15px; background: #1f1b17; color: #f7f1e6;
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .2s;
}
.dest-back:hover { background: #ac3e24; border-color: #ac3e24; }
.dest-crumb { font-size: 13px; color: #5c5347; margin-right: auto; }
.dest-quick { display: flex; gap: 6px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.dest-quick::-webkit-scrollbar { display: none; }
.dest-quick button {
  flex: none; border: 1px solid #d5cab6; border-radius: 999px; padding: 6px 12px;
  background: #fbf9f4; color: #2b251e; font-size: 12.5px; white-space: nowrap;
}
.dest-quick button[aria-current="page"] { background: #1f1b17; border-color: #1f1b17; color: #f7f1e6; font-weight: 600; }

.dest-body { max-width: 1220px; margin: 0 auto; padding: 36px 28px 92px; }
.dest-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8ded0; color: #5b4d3c; margin-bottom: 12px; }
.dest-body h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 10px; letter-spacing: -.02em; line-height: 1.15; }
.dest-lead { font-size: 15.5px; color: #554c40; margin: 0 0 24px; max-width: 680px; }
.dest-card[hidden], #dest-rich[hidden], .dest-head-generic[hidden] { display: none; }
.dest-card {
  max-width: 920px;
  background: #fbf9f4; border: 1px solid #ddd3c2; border-radius: 16px; padding: 24px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
  box-shadow: 0 10px 30px rgba(29, 26, 22, .06);
}
.dest-bar-replay {
  border: 1px solid #c9bea9; border-radius: 999px; padding: 6px 12px; background: #fbf9f4; color: #2b251e;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s;
}
.dest-bar-replay:hover { background: #1f1b17; border-color: #1f1b17; color: #f7f1e6; }

/* The courtyard archive: one paper rail alongside the image shelves. */
#dest-rich a { color: inherit; text-decoration: none; }
#dest-rich :is(a, button):focus-visible { outline: 3px solid #984528; outline-offset: 2px; }
.collection-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #bdb19d; }
.collection-head h2 { font-family: Baskerville, "AppleMyungjo", serif; }
.collection-head span, .ref-body small, .cluster-foot small { color: #716250; font-size: 12px; }
.collection-layout { display: grid; grid-template-columns: minmax(146px, 185px) minmax(0, 1fr); gap: clamp(18px, 3vw, 48px); align-items: start; }
.shelf-rail { display: flex; flex-direction: column; gap: 3px; position: sticky; top: 64px; padding-right: 12px; border-right: 1px solid #d5cab6; }
.shelf-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; font-size: 14px; border-radius: 5px; }
.shelf-link small { font-variant-numeric: tabular-nums; opacity: .8; }
#dest-rich .shelf-link[aria-current] { background: #302a23; color: #fcf4e6; }
.shelf-link:hover, .hub-tools a:hover { background: #eae2d4; }
.shelf-panel { min-width: 0; }
.idea-frame { display: block; width: 100%; height: 720px; border: 0; border-radius: 8px; background: #f4f0e5; }
.shelf-panel > :is(.ref-grid, .screen-grid, .cluster-grid) { margin-bottom: 30px; }
.collection-back { display: inline-block; margin-bottom: 16px; padding: 5px 0; font-size: 13px; }
.screen-grid, .hub-tools { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.screen-grid.v1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.screen-grid.v2 .ref-title { font-size: 18px; }
.hub-tools a { padding: 14px 0; border-block: 1px solid #cfc2ae; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hub-tools b { color: #79513e; font-size: 12px; }
.tech-group { margin: 20px 0; }
.tech-group ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 0 20px; list-style: none; padding: 0; }
.tech-group li { padding: 9px 0; border-top: 1px solid #ded4c6; font-size: 13px; }
.tech-group small { display: inline-block; min-width: 46px; color: #846a50; }
.demo-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.demo-heading a { font-size: 13px; }
.demo-screen { display: block; width: 100%; height: min(74vh, 820px); min-height: 350px; border: 1px solid #cbbda8; border-radius: 8px; background: #28231c; }
.art-grid .ref-shot { aspect-ratio: 1; }
.sec-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; color: #1d1a16; display: flex; align-items: baseline; gap: 10px; }
.sec-title span { font-size: 13px; font-weight: 500; color: #6c6356; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
/* Design Reference Cards & Cluster Albums */
.ref-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ref-card {
  padding: 0; border: 1px solid #dcd1bf; border-radius: 12px; background: #fbf9f4; overflow: hidden; text-align: left;
  box-shadow: 0 4px 14px -8px rgba(29,26,22,.12); transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column; min-width: 0;
}
.ref-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -14px rgba(29,26,22,.22); }
.ref-grid.pending-grid { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
.pending-grid .ref-card > a { flex: 1; }
.pending-reason { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pending-grid .ref-card { position: relative; }
.pending-grid .ref-title { min-height: 2.8em; }
.pending-grid .decision-actions { display: grid; grid-template-columns: 1fr 1.5fr 1fr; }
.pending-grid .decision-actions button { width: 100%; padding: 8px 4px; white-space: nowrap; }
#dest-rich .origin-chip { position: absolute; top: 8px; right: 8px; z-index: 1; padding: 5px 10px; border-radius: 999px; background: #1d1a16; color: #fbf6ec; opacity: 1; font-size: 12px; font-weight: 600; line-height: 1.2; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
#dest-rich .origin-chip:hover { background: #000; }
.no-image { display: grid; place-items: center; height: 100%; background: #eae3d7; color: #645744; font-size: 13px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.decision-actions button { border: 1px solid #cbbda8; background: #f5eee1; color: #3f352a; border-radius: 5px; font: inherit; font-size: 13px; padding: 8px 10px; min-height: 40px; }
.shelf-sep { margin: 14px 0 4px; padding-top: 12px; border-top: 1px solid #d5cab6; font-size: 11px; letter-spacing: .08em; color: #8a7c68; }
.decision-actions .origin-link { display: inline-flex; align-items: center; margin-left: auto; padding: 8px 4px; font-size: 13px; color: #6b5c47; text-decoration: underline; text-underline-offset: 3px; }
.filtered-box { margin-top: 28px; border-top: 1px solid #d5cab6; padding-top: 14px; }
.filtered-box > summary { cursor: pointer; font-size: 14px; padding: 6px 0 14px; color: #5b4f40; }
.filtered-box > summary small { display: block; margin-top: 2px; color: #8a7c68; font-size: 12px; }
.filtered-box .ref-card { opacity: .82; }
.brief-who { color: #6b5c47; font-size: 13px; }
.brief-block { margin-top: 14px; }
.brief-block h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: .06em; color: #8a7c68; font-weight: 600; }
.brief-block p, .brief-block li { margin: 0; line-height: 1.6; }
.brief-block ol, .brief-block ul { margin: 0; padding-left: 18px; }
.brief-block pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: #efe6d6; padding: 10px; border-radius: 5px; max-height: 240px; overflow: auto; }
.brief-parent { display: flex; gap: 10px; align-items: center; }
.brief-parent img { width: 88px; height: 60px; object-fit: cover; border-radius: 4px; }
.brief-parent span { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; }
.brief-parent a, .brief-block a { color: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: .85; }
.brief-note { margin-top: 12px; font-size: 12px; color: #8a7c68; }
.decision-actions button:first-child { background: #393127; color: #fff9ed; }
.decision-actions button:disabled { opacity: .5; }
.lb .decision-actions { padding: 10px 0; }
.decision-status:empty { display: none; }
.pick-bar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; padding: 10px 12px; background: #f5eee1; border: 1px solid #dcd1bf; border-radius: 8px; }
.pick-bar button { border: 1px solid #cbbda8; background: #fbf9f4; color: #3f352a; border-radius: 5px; font: inherit; font-size: 13px; padding: 7px 10px; min-height: 36px; }
.pick-bar button:disabled { opacity: .45; }
.pick-count { font-size: 13px; color: #5b4f40; margin-right: auto; }
.pick-actions { display: flex; gap: 6px; }
.pick-actions button:first-child, .pick-bar.queued button[data-queue="undo"] { background: #393127; color: #fff9ed; }
.pick-bar.queued span { margin-right: auto; font-size: 13px; color: #6b5c47; }
.post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 14px; color: #3f352a; }
.post-head span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #8a7c68; font-size: 13px; }
.post-head button { border: 1px solid #cbbda8; background: #f5eee1; color: #3f352a; border-radius: 5px; font: inherit; font-size: 13px; padding: 6px 10px; }
.pick { position: absolute; top: 6px; left: 6px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: rgba(251,249,244,.92); box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: pointer; }
.pick input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.ref-card.picked { outline: 3px solid #393127; outline-offset: -3px; }
.picking .ref-card .decision-actions { visibility: hidden; }
.ref-id { font-weight: 700; color: #3f352a; }
.lb-id { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 14px; }
.lb-id button { border: 1px solid #cbbda8; background: #f5eee1; color: #3f352a; border-radius: 5px; font: inherit; font-size: 12px; padding: 3px 9px; }
.lb-id span { color: #8a7c68; font-size: 13px; }
.trash-note { margin: -4px 0 14px; font-size: 13px; color: #8a7c68; }
/* 탈락 이유: the words cover the picture, so the card keeps its size */
.why-box { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 10px 12px; color: #fff; }
.ref-card > .why-box { position: absolute; top: 0; left: 0; right: 0; z-index: 3; background: linear-gradient(#1d1a1600 0%, #1d1a16e0 40%); }
.decision-actions .why-box { flex-basis: 100%; padding: 12px 0 0; }
.why-box p { margin: 0; font-size: 12px; color: #e9dcc6; }
.why-box p small { color: #b9ab94; margin-left: 4px; }
.why-words { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.why-words button { background: none; border: 0; border-bottom: 1px solid #ffffff59; border-radius: 0; padding: 3px 0; min-height: 0; color: inherit; font: inherit; font-size: 14px; cursor: pointer; }
.why-words button:hover { border-color: currentColor; }
.why-text { width: 100%; font: inherit; font-size: 13px; padding: 7px 8px; border: 1px solid #cbbda8; border-radius: 4px; background: #fbf9f4; color: #1d1a16; }
.why-bar { color: #1d1a16; }
.why-bar > span { color: #8a7c68; font-size: 13px; }
.why-bar .why-words button { border-bottom-color: #cbbda8; font-size: 13px; }
.why-bar .why-text { flex-basis: 100%; }
.pick-bar .why-cancel { margin-left: auto; }
.decision-actions [data-decision="reject"].asking { background: #ac3e24; border-color: #ac3e24; color: #fff; }
.reject-stamp { position: absolute; top: 10px; right: 10px; z-index: 1; padding: 4px 8px 3px; border: 2px solid #ac3e24; border-radius: 3px; color: #ac3e24; background: #fbf9f4e6; font-family: "Noto Serif KR", "AppleMyungjo", serif; font-size: 13px; font-weight: 700; transform: rotate(-4deg); }
/* 취향: questions from rejection reasons, then the rules as a ledger */
.taste-sub { margin: 24px 0 10px; font-size: 15px; color: #1d1a16; }
.taste-sub small { margin-left: 6px; font-size: 12px; font-weight: 400; color: #8a7c68; }
.taste-empty { font-size: 13px; color: #8a7c68; }
.taste-ask { padding: 6px 0 22px; border-bottom: 1px solid #dcd1bf; margin-bottom: 18px; }
.taste-ask h3 { margin: 0 0 2px; font-family: "Noto Serif KR", "AppleMyungjo", serif; font-size: 22px; color: #1d1a16; }
.taste-from { margin: 0 0 12px; font-size: 12px; color: #8a7c68; }
.taste-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 160px); gap: 10px; overflow-x: auto; margin-bottom: 14px; }
.taste-strip figure { margin: 0; }
.taste-strip img, .taste-strip .no-image { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #28231c; }
.taste-strip figcaption { margin-top: 5px; font-size: 12px; line-height: 1.35; color: #6c6356; }
.taste-strip figcaption b { margin-right: 4px; font-weight: 500; color: #8a7c68; }
.taste-rule { margin: 0 0 12px; padding: 10px 12px; background: #fbf9f4; border-left: 3px solid #ac3e24; font-size: 14px; line-height: 1.5; color: #1d1a16; }
.taste-rule small { display: block; font-size: 11px; color: #8a7c68; }
.taste-rule-text[contenteditable="true"] { display: block; outline: 1px solid #cbbda8; outline-offset: 3px; }
.taste-row { display: flex; align-items: center; gap: 16px; }
.taste-yes { background: #393127; color: #fff9ed; border: 0; border-radius: 5px; padding: 9px 18px; min-height: 40px; font: inherit; font-size: 14px; cursor: pointer; }
.taste-link { background: none; border: 0; padding: 4px 0; color: #6c6356; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.taste-rules { list-style: none; margin: 0; padding: 0; counter-reset: rule; }
.taste-rules li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid #dcd1bf; counter-increment: rule; font-size: 14px; line-height: 1.5; color: #1d1a16; }
.taste-rules li::before { content: counter(rule); font-family: "Noto Serif KR", "AppleMyungjo", serif; font-size: 19px; color: #8a7c68; }
.taste-rules li small { display: block; margin-top: 2px; font-size: 12px; color: #8a7c68; }
.taste-rules li.off span { color: #8a7c68; text-decoration: line-through; }
.series-shot { position: relative; display: flex; gap: 2px; width: 100%; height: 100%; background: #0d0f14; }
.series-shot img { flex: 1; min-width: 0; height: 100%; object-fit: cover; object-position: top; }
.series-shot b { position: absolute; right: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; background: #1d1a16; color: #fbf6ec; font-size: 12px; }
.lb-series { display: flex; gap: 4px; justify-content: center; height: 70vh; max-width: 100%; overflow-x: auto; }
.lb-series[hidden], .lb-stage img[hidden] { display: none; }
.lb-series img { height: 100%; width: auto; min-width: 0; border-radius: 3px; object-fit: contain; }
.pending-grid .trash-actions { grid-template-columns: 1fr 1fr; }
.trash-actions button:first-child { background: #393127; color: #fff9ed; }
.trash-actions [data-decision="purge"] { color: #9b2f22; border-color: #d9a79f; background: #fbf1ee; }
.trash-actions [data-armed] { background: #9b2f22; color: #fff; }
.ref-shot { position: relative; aspect-ratio: 16 / 10; width: 100%; background: #1e1b18; overflow: hidden; }
.ref-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-shot img.cut { object-fit: contain; padding: 6px; }
.ref-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.ref-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ref-cat { font-size: 11px; font-weight: 700; color: #5b4d3c; background: #efe8dc; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ref-swatches { display: inline-flex; gap: 3px; align-items: center; }
.ref-swatches i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.ref-title {
  margin: 0; font-size: 13.5px; font-weight: 600; color: #1d1a16; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ref-grp { font-size: 11.5px; color: #7a6f61; margin-top: auto; }

.cluster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cluster-card {
  padding: 0; border: 1px solid #dcd1bf; border-radius: 14px; background: #fbf9f4; overflow: hidden; text-align: left;
  box-shadow: 0 6px 20px -10px rgba(29,26,22,.16); transition: transform .25s ease, box-shadow .25s ease;
}
.cluster-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -14px rgba(29,26,22,.24); }
.cluster-mosaic {
  display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
  aspect-ratio: 16 / 9; background: #26221d;
}
.cluster-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cluster-mosaic img:first-child { grid-row: 1 / 3; }
.cluster-mosaic.c1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cluster-mosaic.c1 img:first-child { grid-row: auto; }
.cluster-mosaic.c2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
.cluster-mosaic.c2 img:first-child { grid-row: auto; }
.cluster-foot { padding: 12px 15px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cluster-name { font-size: 15.5px; font-weight: 700; color: #1d1a16; }
.cluster-cnt { font-size: 12.5px; font-weight: 700; color: #ac3e24; font-variant-numeric: tabular-nums; }

.lb {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; overflow-x: hidden;
  background: #121110; color: #edeae4;
}
.lb[hidden] { display: none; }
.lb-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; background: rgba(18,17,16,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #34312d;
}
.lb-bar button {
  border: 1px solid #3c3833; border-radius: 999px; padding: 6px 14px; background: transparent;
  color: #edeae4; font-size: 13px; white-space: nowrap; transition: background .2s, color .2s;
}
.lb-bar button:hover { background: #edeae4; color: #121110; }
.lb-cnt { margin-left: auto; font-size: 13px; color: #b3ada3; font-variant-numeric: tabular-nums; }
.lb-stage { background: #070606; display: grid; place-items: center; padding: 14px 20px; }
.lb-stage img { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; border-radius: 6px; }
.lb-thumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.lb-thumb {
  padding: 0; width: 76px; height: 50px; border-radius: 6px; overflow: hidden;
  border: 2px solid transparent; opacity: .62; background: #1f1d1a; transition: opacity .2s, border-color .2s;
}
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb[aria-current="true"] { border-color: #d16a46; opacity: 1; }
.lb-info { max-width: 920px; margin: 0 auto; padding: 22px 24px 56px; display: grid; gap: 12px; }
.lb-badges { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.lb-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid #38342f; color: #cfc9be; }
.lb-info h3 { margin: 0; font-size: clamp(20px, 2.6vw, 28px); line-height: 1.3; color: #f7f3eb; }
.lb-info p { margin: 0; font-size: 15px; line-height: 1.65; color: #c7c0b4; }
.lb-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 10px 3px 6px; border-radius: 999px; border: 1px solid #34312d; color: #d5cfc4; }
.lb-swatch i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255,255,255,.25); }
.dest-kv dt { font-size: 12px; color: #74695a; font-weight: 700; margin-bottom: 4px; }
.dest-kv dd { margin: 0; font-size: 14.5px; color: #1d1a16; word-break: keep-all; }
.dest-slot {
  grid-column: 1 / -1; margin-top: 6px; padding: 20px; border-radius: 12px;
  border: 1px dashed #bfb29e; background: #f4efe6; color: #4d4438; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.dest-replay {
  border: 1px solid #1d1a16; border-radius: 999px; padding: 8px 16px; background: #fff; color: #1d1a16;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.dest-replay:hover { background: #1d1a16; color: #f7f1e6; }

@media (max-width: 760px) {
  .court-header { top: max(18px,env(safe-area-inset-top)); left: 5%; right: 5%; grid-template-columns: 1fr auto; gap: 10px; }
  .signature strong { font-size: clamp(27px,6.2vw,36px); letter-spacing: .045em; }
  .seal { width: 9px; height: 9px; }
  .court-links { padding: 0; grid-column: 1 / -1; justify-self: start; gap: 16px; }
  .court-links::before { display: none; }
  .court-links button { font-size: 13px; padding: 6px 0; }
  .ink-times { position: absolute; right: 0; top: 44px; }
  .ink-times button { min-width: 28px; font-size: 9px; padding-inline: 3px; }
  .court-dock-outer { top: 96px; max-width: calc(100vw - 24px); }
  .court-foot { left: 5%; right: 5%; bottom: max(18px,env(safe-area-inset-bottom)); }
  .chapters { left: auto; right: 0; transform: translate(0,-50%); gap: clamp(4px,1.5vw,13px); }
  .chapters::before { width: 22px; }.chapters::after { display: none; }
  .chapters button { font-size: 17px; min-width: 28px; }
  .court-sound { font-size: 8px; gap: 6px; }.reeds { width: 13px; }
  .dest-card { grid-template-columns: minmax(0, 1fr); }
  .dest-body { padding: 22px 16px 72px; }
  .collection-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .collection-head { margin-bottom: 12px; }
  .shelf-rail { position: relative; top: auto; flex-direction: row; max-width: 100%; overflow-x: auto; padding: 3px 1px 8px; border: 0; border-bottom: 1px solid #d5cab6; }
  .shelf-link { flex: none; white-space: nowrap; padding: 9px 11px; }
  .shelf-sep { flex: none; display: flex; align-items: center; margin: 0 2px 0 6px; padding: 0 0 0 10px; border-top: 0; border-left: 1px solid #d5cab6; white-space: nowrap; }
  .cluster-grid, .screen-grid.v1 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .screen-grid.v2, .hub-tools { grid-template-columns: minmax(0, 1fr); }
  .demo-screen { height: 65vh; }
  .photo-grid, .ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
#hero[data-portrait="true"] .chime { width: clamp(32px,7.4vw,44px); }
#hero[data-portrait="true"] .chime-string { height: clamp(24px,3.5vh,48px); }
#hero[data-portrait="true"] .tag { height: clamp(79px,12.5vh,122px); gap: 12px; }
#hero[data-portrait="true"] .tag time,#hero[data-portrait="true"] .tag output { font-size: 12px; }
#hero[data-portrait="true"] .court-frame { background: linear-gradient(0deg,#171412aa,transparent 17%),linear-gradient(180deg,#211e1b35,transparent 18%); }
@media (max-width:760px) and (max-aspect-ratio:1/1) {
  .ink-times { background: transparent; border-radius: 2px; padding: 0 4px; text-shadow: 0 1px 3px #fff3df70; color: #2c241e; }
  #hero[data-mode="night"] .ink-times { color: #f1ebe0; text-shadow: 0 1px 3px #25303d; }
  .door-label { font-size: 8px; letter-spacing: .105em; top: calc(100% + 9px); }
}
@media (max-height:470px) and (orientation:landscape) {
  .court-header { top: 10px; }.court-foot { bottom: 7px; }.chime-string { height: 31px; }.tag { height: 72px; gap: 7px; }
  .ink-times { position: static; }.court-header { grid-template-columns:auto 1fr auto auto; }
}
#hero[data-state="arrived"] :is(.morph-switch,#stipple,.chime) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .floor-shine, .reeds i { animation: none !important; }
  #background,.photo-cut,.practical,.grade-dusk,.grade-night,.door-light,.veil-panel,.veil-cue { transition-duration: .05s !important; }
}
