@font-face {
  font-family: "Zhihen Sans";
  src: url("/research/zhihen-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 650;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font: 14px/1.4 "Zhihen Sans","PingFang SC","Microsoft YaHei",sans-serif;
  color: #eff1ed;
  background: #080d0e;
  --wine: #a4c8c7;
  --paper: #151f22;
  --line: #a8c4c434;
  --gold: #e2d1b9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; height: 100dvh; display: grid; place-items: center; overscroll-behavior: none; }
h1, h2, h3, p { margin: 0; }
button {
  font: inherit; color: inherit; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--line); background: var(--paper);
  min-height: 44px; border-radius: 4px; padding: 0 12px;
}
button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button[aria-pressed="true"] { background: #26373b; color: #f1f5f1; border-color: #a4c8c797; }
.fitting-room {
  isolation: isolate; position: relative; width: min(100dvw, 177.778dvh); height: min(100dvh, 56.25dvw);
  background: #101414; box-shadow: 0 16px 95px #000b; overflow: hidden;
}
header {
  position: absolute; z-index: 3; inset: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(env(safe-area-inset-top), 9px) max(env(safe-area-inset-right), 18px) 5px max(env(safe-area-inset-left), 18px); pointer-events: none;
  background: linear-gradient(180deg,#051012d9,#05101200);
}
.header-actions { display: flex; align-items: center; pointer-events: auto; }
header button { display: grid; place-items: center; min-width: 44px; background: transparent; border: 0; }
header button[aria-expanded="true"] { background: #28404a7c; }
.wordmark { display: block; width: 76px; height: auto; filter: drop-shadow(0 1px 8px #000b); }
.icon { display: block; width: 23px; height: 23px; margin: auto; pointer-events: none; }
.stage {
  position: absolute; inset: 0; overflow: hidden;
  background: #101414 url("/research/studio-cyclorama.webp") center/cover no-repeat;
}
.stage::after {
  content: ""; position: absolute; inset: auto 0 0; height: 9%; pointer-events: none;
  background: linear-gradient(0deg,#0c151966,transparent);
}
iframe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 0; }
.fitting-room[data-loading] :is(header, .wardrobe, .view-track, .wardrobe-actions) { visibility: hidden; }
.loading-screen {
  position: absolute; z-index: 10; inset: 0; display: grid;
  background: radial-gradient(ellipse at 48% 41%, #10283b00 10%, #050d17d6 88%),
    linear-gradient(180deg,#09101972,#09151b1a 46%,#070f17d9 94%),
    #101a26 url("/research/studio-cyclorama.webp") center/cover no-repeat;
}
.loading-wordmark {
  position: absolute; left: 50%; top: 45%; width: clamp(118px, 19cqw, 192px);
  height: auto; transform: translate(-50%, -61%);
  filter: drop-shadow(0 3px 24px #02060990);
}
.fitting-room { container-type: inline-size; }
.loading-readout {
  position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%);
  width: min(356px, 54%); text-align: center; color: #ede6da;
}
.loading-caption {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; font-size: 13px; line-height: 20px; letter-spacing: .08em; margin-bottom: 9px;
}
#loading-percent { color: #e5cfab; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
#loading-progress {
  display: block; appearance: none; border: 0; width: 100%; height: 3px; border-radius: 4px;
  overflow: hidden; background: #e1e5ed29; color: #e5cfab;
}
#loading-progress::-webkit-progress-bar { background: transparent; }
#loading-progress::-webkit-progress-value {
  background: linear-gradient(90deg,#9a8060,#efd9aa 94%,#fff4d9);
  border-radius: 4px; transition: width .28s cubic-bezier(.25,.74,.37,1);
}
#loading-progress::-moz-progress-bar { background: linear-gradient(90deg,#9a8060,#efd9aa); border-radius: 4px; }
#loading-retry {
  margin-top: 14px; border-radius: 8px; color: var(--gold);
  border-color: #d8c09d66; background: #131e2a;
}
.loading-screen[data-failed] .loading-caption { justify-content: center; }
@media (prefers-reduced-motion: reduce) {
  #loading-progress::-webkit-progress-value { transition: none; }
}
.camera-tools {
  position: absolute; z-index: 5; top: 58px; right: max(16px, env(safe-area-inset-right));
  display: grid; grid-template-columns: repeat(2, 44px); gap: 3px; padding: 4px;
  border: 1px solid var(--line); border-radius: 13px; background: #0a1620ed;
  box-shadow: 0 6px 20px #030a1055;
}
.camera-tools button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid transparent; border-radius: 9px; background: transparent;
}
.camera-tools .icon { width: 25px; height: 25px; opacity: .76; }
.camera-tools button[aria-pressed="true"] { border-color: #cfbf9770; background: #384b5175; }
.camera-tools button[aria-pressed="true"] .icon { opacity: 1; }
.wardrobe {
  position: absolute; z-index: 2; right: max(env(safe-area-inset-right), 19px);
  bottom: max(env(safe-area-inset-bottom), 13px); width: min(43%, 312px);
  display: flex; flex-direction: column-reverse; pointer-events: none;
}
.wardrobe > * { pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stage-modes {
  align-self: flex-end; width: min(100%, 160px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #0a1620aa; border: 1px solid #b7cddb29; border-radius: 27px; overflow: hidden;
}
.stage-modes button {
  display: grid; place-items: center; min-height: 48px;
  background: transparent; border: 0; border-radius: 0; color: #c0d0d0;
}
.stage-modes .icon { width: 26px; height: 26px; opacity: .84; }
.stage-modes button[aria-expanded="true"] .icon { opacity: 1; }
.stage-modes button[aria-expanded="true"] {
  background: linear-gradient(180deg,#38545b60,transparent); color: #efe4d1;
  position: relative;
}
.stage-modes button[aria-expanded="true"]::after {
  content: ""; position: absolute; height: 1px; width: 38px; bottom: 5px; left: calc(50% - 19px); background: var(--gold);
}
.stage-shelf {
  padding: 8px; margin-bottom: 7px; background: #0c1b26ed; border: 1px solid var(--line);
  box-shadow: 0 8px 19px #050e12a0; border-radius: 5px;
}
#pose-shelf { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.pose-switch {
  display: grid; grid-template-columns: 44px minmax(60px,1fr) 44px;
  justify-self: center; align-items: center; text-align: center; color: #e4eae6;
}
.pose-arrow, #toggle-motion { background: transparent; border: 0; }
.pose-arrow { padding: 0; color: var(--gold); font: 25px/1 Georgia,serif; }
#toggle-motion { padding: 0 9px; font-size: 12px; color: #c0d0d0; border-left: 1px solid var(--line); border-radius: 0; }
.quick-range { display: grid; grid-template-columns: max-content minmax(0,1fr); align-items: center; gap: 10px; min-height: 29px; }
.quick-range input { width: 100%; margin: 0; accent-color: var(--wine); }
.wardrobe-title, .drawer-title, .drawer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 { font: 600 20px/1.25 "Songti SC",Georgia,serif; color: #eee3d2; }
.looks { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 8px 0; }
.look {
  display: grid; grid-template-rows: minmax(40px, min(9.3dvh, 82px)) auto;
  gap: 4px; padding: 4px; align-items: center; background: #111c20; border-radius: 3px; overflow: hidden; font-size: 12px;
}
.look img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }
.look span { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.wardrobe-actions {
  position: absolute; z-index: 1; bottom: max(env(safe-area-inset-bottom), 13px); left: max(env(safe-area-inset-left), 16px);
  display: flex; gap: 3px; align-items: center; pointer-events: none;
}
.stage-notice {
  position: absolute; bottom: 54px; left: 1px; width: max-content; max-width: min(256px, 41vw);
  padding: 6px 14px 7px 10px; border-left: 1px solid #d3b47d;
  background: linear-gradient(90deg,#101c26eb,#14233338 86%,transparent);
  display: grid; gap: 3px;
}
.stage-notice strong { font-size: 15px; font-weight: 550; line-height: 1.3; letter-spacing: .065em; color: #f0dfc0; }
.stage-notice span { font-size: 13px; line-height: 1.5; letter-spacing: .035em; color: #d6e1e5; }
.stage-notice[data-kind="guide"], .stage-notice[data-kind="repaired"] { border-color: #a1c9c4; }
.stage-notice[data-kind="guide"] strong, .stage-notice[data-kind="repaired"] strong {
  color: #d1eae3;
}
.wardrobe-actions button { pointer-events: auto; }
.wardrobe-buttons { display: flex; flex-shrink: 0; gap: 6px; }
.wardrobe-buttons button, #start-fitting { width: 44px; min-height: 44px; padding: 0; background: #0c191c8c; border: 0; border-radius: 50%; }
#start-fitting {
  color: #ead4b4; font-weight: 600;
}
#start-fitting:disabled { opacity: .55; cursor: default; }
.fitting-task { border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; margin: 5px 0 7px; background: var(--paper); }
.fitting-steps { display: flex; align-items: center; gap: 7px; padding: 0; margin: 0 0 8px; list-style: none; }
.fitting-steps li { flex: 1; text-align: center; font-size: 12px; padding: 4px 2px; color: #b1c4c6; border-bottom: 1px solid var(--line); }
.fitting-steps li[data-status="current"] { color: var(--gold); font-weight: 600; border-color: var(--gold); }
.fitting-steps li[data-status="passed"] { color: #ddf0ea; }
.fitting-steps li[data-status="passed"]::before { content: "✓ "; }
.fitting-task h3 { font: 600 19px/1.3 "Songti SC",Georgia,serif; color: #f1dfd4; }
.fitting-task p { margin-top: 4px; font-size: 13px; color: #e3cfc5; }
#pull-meter { display: block; width: 100%; height: 13px; margin-top: 6px; accent-color: var(--wine); }
.fitting-result { display: flex; gap: 8px; margin-top: 10px; }
.fitting-result button { flex: 1; }
#fitting-done { color: #142022; background: var(--wine); border-color: var(--wine); }
.pose-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; }
.pose-options button { padding: 0 4px; font-size: 12px; background: transparent; border: 1px solid transparent; }
.pose-options button[aria-pressed="true"] { background: #3a53595c; border-color: #aac7c775; }
.color-options { display: grid; gap: 4px; padding-bottom: 10px; }
.dye-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.dye { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 4px; font-size: 13px; }
.dye::before { content: ""; width: 12px; height: 12px; border: 1px solid #ffffffaa; border-radius: 50%; background: var(--swatch); }
.backdrop-option { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.backdrop-option input { height: 44px; width: 48px; border: 0; background: transparent; }
.fitting-room[data-fitting="elastic"] .looks,
.fitting-room[data-fitting="drape"] .looks,
.fitting-room[data-fitting="done"] .looks,
.fitting-room[data-fitting="done"] .wardrobe-actions,
.fitting-room[data-fitting="choose"] #repair,
.fitting-room[data-fitting="choose"] #tip,
.fitting-room[data-fitting="drape"] #tip,
.fitting-room[data-fitting="elastic"] #tip { display: none; }
#start-fitting[aria-expanded="true"] { color: #d3e2e0; }
#start-fitting[aria-expanded="true"] .icon { opacity: .62; }
.drawer {
  position: absolute; top: 62px; right: max(env(safe-area-inset-right), 18px);
  width: min(43%, 310px); z-index: 4; max-height: calc(100% - 76px);
  overflow: auto; overscroll-behavior: contain;
  background: radial-gradient(130% 80% at 100% 0%, #263845, #14232d 56%, #0d1823);
  border: 1px solid #a6b6bf48; border-radius: 16px;
  box-shadow: 0 19px 54px #020911a8, inset 0 1px 0 #e2edf51a;
  padding: 12px 16px max(14px,env(safe-area-inset-bottom)); scrollbar-width: thin;
  scrollbar-color: #8d9eaa66 transparent;
}
.drawer-title { padding-bottom: 5px; }
.drawer-title h2 { color: #f1e5d1; }
#close-tuning { width: 44px; padding: 0; border-radius: 50%; border-color: #d6dfdf42; font-size: 23px; line-height: 1; }
.tuning-open .wardrobe { display: none; }
.tuning-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 3px; gap: 3px;
  margin-bottom: 12px; background: #08131d91; border: 1px solid #b4c2c626; border-radius: 12px; }
.tuning-tabs button { padding-inline: 1px; background: transparent; border: 1px solid transparent; border-radius: 8px; color: #b3c3ca; }
.tuning-tabs button[aria-pressed="true"] { color: #faecd4; border-color: #dfc08565; background: linear-gradient(#7e6d5155,#5b635a2b); }
.range { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 1px;
  padding: 7px 10px 2px; margin: 5px 0; border: 1px solid #c3d1d918; border-radius: 10px; background: #09141c49; }
.range output { min-width: 43px; text-align: center; color: #f1dcb8; font-variant-numeric: tabular-nums;
  white-space: nowrap; background: #aa906527; border-radius: 9px; padding: 2px 4px; }
.range input { grid-column: 1/-1; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
.range input::-webkit-slider-runnable-track { height: 4px; border-radius: 10px;
  background: linear-gradient(90deg,#a88d60,#e4cc9b var(--range-fill),#4b6170 var(--range-fill),#4b6170); }
.range input::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #f1e0bf; border: 2px solid #ab9062; margin-top: -6px; box-shadow: 0 2px 7px #0008; }
.tuning-look { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: 14px; color: #f1e5d1; }
.tuning-look img { width: 44px; height: 36px; object-fit: cover; border-radius: 7px; border: 1px solid #dfc08545; }
.wear-actions { display: flex; gap: 8px; }
.wear-actions button { flex: 1; padding-inline: 3px; }
#preview-wear { color: #f8e9cc; border-color: #e0bd7a70; background: #88715132; }
.edge-settings { border-top: 1px solid #b9c7cd29; margin: 10px 0; }
.edge-settings summary { cursor: pointer; padding: 10px 3px; }
.option { min-height: 44px; display: flex; align-items: center; gap: 9px; }
.option input { width: 18px; height: 18px; accent-color: var(--wine); }
.drawer-actions { margin-top: 10px; }
#advanced-tuning { background: transparent; border-color: transparent; color: #c3cacc; }
#hide-advanced { position: absolute; z-index: 5; top: max(9px,env(safe-area-inset-top)); right: 16px; }
body.advanced .camera-tools, body.advanced header, body.advanced .wardrobe-actions { display: none; }
.view-track {
  position: absolute; top: 50%; left: max(env(safe-area-inset-left), 16px);
  transform: translateY(-50%); display: grid; gap: 1px;
}
.view-track button {
  width: 44px; padding: 0; border: 0; border-radius: 50%; background: #101c2845;
}
.view-track .icon { width: 17px; height: 17px; opacity: .82; transform: rotate(90deg); }
#view-up .icon { transform: rotate(-90deg); }
body.advanced .view-track { display: none; }
@media (max-width: 680px) {
  .wordmark { width: 67px; }
  .wardrobe { width: min(46%,302px); right: 12px; bottom: 9px; }
  .drawer { width: min(46%,290px); right: 12px; }
  #pose-shelf { gap: 5px; }
  .look { font-size: 11px; padding: 3px; }
}

/* Compact textile groups keep the quick shelf usable in short landscape views. */
.hosiery-picker { display: block; min-width: 0; }
.hosiery-groups { display: flex; gap: 3px; margin-bottom: 5px; overflow-x: auto; scrollbar-width: thin; }
.hosiery-groups button { flex: 1 0 auto; min-height: 30px; padding: 0 7px; font-size: 12px; border-radius: 3px; background: transparent; }
.hosiery-groups button[aria-pressed="true"] { color: var(--gold); background: #47616b50; border-color: #cabb9770; }
.hosiery-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px; max-height: 136px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hosiery-choices .dye { min-width: 0; min-height: 34px; line-height: 1.12; font-size: 11px; padding: 3px 4px; justify-content: flex-start; text-align: left; }
.hosiery-choices .dye::before { flex: 0 0 15px; width: 15px; height: 15px; border-radius: 3px; }
.hosiery-choices [data-dye="diamond"]::before { background: repeating-linear-gradient(45deg,transparent 0 4px,#c0b5b9 4px 5px), repeating-linear-gradient(-45deg,#3c343d 0 4px,#c0b5b9 4px 5px); }
.hosiery-choices [data-dye="fishnet"]::before { background: repeating-linear-gradient(45deg,transparent 0 4px,#25242a 4px 5px), repeating-linear-gradient(-45deg,#b59c88 0 4px,#25242a 4px 5px); }
.hosiery-choices [data-dye="dot"]::before { background: radial-gradient(#211f28 1px,transparent 1.5px) 0 0 / 5px 5px,#a38d8c; }
.hosiery-choices [data-dye="knee"]::before, .hosiery-choices [data-dye="crew"]::before { background: repeating-linear-gradient(90deg,var(--swatch) 0 2px,#c3b9b52e 2px 3px); }
.hosiery-choices [data-dye="ivoryLace"]::before { background: radial-gradient(ellipse,#e9e1cd 1px,transparent 3px) 0 0 / 7px 5px,#a49b83; }
@media(max-height:400px) {
  #stocking-shelf { padding: 5px; }
  #quick-dyes .hosiery-choices { max-height: 105px; }
  #quick-dyes .hosiery-groups { margin-bottom: 3px; }
  #quick-dyes .hosiery-groups button { min-height: 28px; }
  #quick-dyes .dye { min-height: 31px; }
  #stocking-shelf .quick-range { min-height: 25px; font-size: 11px; }
}
/* Material samples are icons; the single readout names the worn selection. */
.hosiery-groups { justify-content: space-between; gap: 2px; padding-bottom: 3px; border-bottom: 1px solid #a8c4c422; }
.hosiery-groups button { display: grid; place-items: center; flex: 1 1 0; min-width: 0; padding: 0; min-height: 30px; border: 0; border-radius: 0; }
.hosiery-groups svg { width: 22px; height: 25px; opacity: .65; }
.hosiery-groups [aria-pressed="true"] svg { opacity: 1; }
.hosiery-groups button[aria-pressed="true"] { background: transparent; box-shadow: inset 0 -1px #e2d1b9; }
.hosiery-choices { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; max-height: 106px; }
.hosiery-choices .dye { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 47px; min-height: 47px; padding: 2px; border: 0; border-radius: 3px; background: transparent; }
.hosiery-choices .dye[aria-pressed="true"] { background: #47616b55; box-shadow: inset 0 0 0 1px #d9c5a7b0; }
.hosiery-choices .dye::before { display: none; }
.hosiery-choices svg { width: 32px; height: 39px; }
.hosiery-selected { display: block; min-height: 18px; padding-top: 2px; color: #d2d8d4; font-size: 10px; letter-spacing: .03em; }
@media(max-height:400px) {
  #quick-dyes .hosiery-choices { max-height: 90px; gap: 3px; }
  #quick-dyes .hosiery-choices .dye { flex-basis: 36px; width: 36px; height: 40px; min-height: 40px; }
  #quick-dyes .hosiery-choices svg { width: 28px; height: 34px; }
  #quick-dyes .hosiery-groups svg { width: 20px; height: 23px; }
}
