@font-face { font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('../fonts/jost-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('../fonts/jost-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('../fonts/jost-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

html, body { margin: 0; background: #e4e1dc; font-family: 'Jost', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; color: #1c1d1f; }
three-d-stage:not(:defined) { visibility: hidden; }
header { padding: 28px 32px 8px; display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
header h1 { margin: 0; font-weight: 400; font-size: 22px; letter-spacing: .04em; }
header p { margin: 0; font-weight: 300; color: #6b6c70; font-size: 13px; }
main { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 16px; padding: 16px 32px 32px; }
article { display: grid; grid-template-rows: auto 560px 1fr; border-radius: 6px; overflow: hidden; background: #efece8; }
article.dark { background: #1d1e21; color: #ecebe8; }
three-d-stage { display: block; width: 100%; height: 100%; }

.meta { padding: 18px 20px 14px; display: grid; gap: 8px; align-content: start; }
.meta .row { display: flex; align-items: center; gap: 10px; }
.badge { font-weight: 500; font-size: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #1c1d1f; color: #efece8; }
.dark .badge { background: #c9a86a; color: #1d1e21; }
.meta h2 { margin: 0; font-size: 17px; font-weight: 400; letter-spacing: .03em; }
.meta p { margin: 0; font-size: 12.5px; font-weight: 300; line-height: 1.55; opacity: .78; text-wrap: pretty; }
.meta .dim { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }

.ctl { display: grid; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid rgba(0,0,0,.08); align-content: start; }
.ctl [hidden] { display: none !important; }
.ctl .gh { margin-top: 6px; font-size: 10px; letter-spacing: .14em; opacity: .5; }
/* 한 행에 두 개씩. 반쪽 폭이라 이름·값은 윗줄, 슬라이더는 아랫줄 전체 폭 */
.ctl .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.ctl label { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n o" "r r"; align-items: center; gap: 1px 8px; font-size: 11px; letter-spacing: .04em; color: #55565a; min-width: 0; }
.ctl label span { grid-area: n; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctl label output { grid-area: o; text-align: right; font-variant-numeric: tabular-nums; color: #1c1d1f; }
.ctl label input { grid-area: r; width: 100%; margin: 2px 0 0; accent-color: #1c1d1f; }
.ctl label.auto { opacity: .5; }
.ctl label.auto output { font-style: italic; }
.ctl .presets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ctl button { font: inherit; font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(0,0,0,.18); background: transparent; color: #1c1d1f; cursor: pointer; white-space: nowrap; }
.ctl button:hover { background: #1c1d1f; color: #efece8; }

/* 옵션 (크기 방식 · 인식 방식 · 테두리 색) */
.ctl .opt { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .06em; color: #55565a; }
.ctl .seg { display: flex; gap: 6px; flex-wrap: wrap; }
.ctl .seg button[aria-pressed="true"] { background: #1c1d1f; color: #efece8; border-color: #1c1d1f; }
.ctl .seg .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.ctl .hint { font-size: 10.5px; line-height: 1.45; opacity: .6; }
.ctl .warn { font-size: 11px; line-height: 1.45; color: #a4492a; }
.dark .ctl .warn { color: #e8a888; }

/* 다크 패널 (B) */
.dark .ctl { border-top-color: rgba(255,255,255,.1); }
.dark .ctl label, .dark .ctl .opt { color: #a9a8a4; }
.dark .ctl input { accent-color: #d7c2a5; }
.dark .ctl output { color: #ecebe8; }
.dark .ctl button { border-color: rgba(255,255,255,.22); color: #ecebe8; }
.dark .ctl button:hover { background: #ecebe8; color: #1d1e21; }
.dark .ctl .seg button[aria-pressed="true"] { background: #d7c2a5; color: #1d1e21; border-color: #d7c2a5; }

/* 시안 보기 버튼 + 모달 */
.meta .row .sian-btn { margin-left: auto; font: inherit; font-size: 11.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(0,0,0,.2); background: transparent; color: inherit; cursor: pointer; white-space: nowrap; }
.meta .row .sian-btn:hover { background: #1c1d1f; color: #efece8; }
.dark .meta .row .sian-btn { border-color: rgba(255,255,255,.3); }
.dark .meta .row .sian-btn:hover { background: #d7c2a5; border-color: #d7c2a5; color: #1d1e21; }
dialog.sian { padding: 0; border: 0; border-radius: 10px; background: #18191b; color: #ecebe8; width: min(1100px, 94vw); max-height: 92vh; overflow: hidden; }
dialog.sian::backdrop { background: rgba(10,10,12,.72); }
.sian-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sian-head h3 { margin: 0; font-weight: 400; font-size: 15px; letter-spacing: .03em; }
.sian-actions { display: flex; gap: 8px; }
.sian-actions a, .sian-actions button { font: inherit; font-size: 12px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #ecebe8; cursor: pointer; text-decoration: none; white-space: nowrap; }
.sian-actions .sian-dl { background: #d7c2a5; border-color: #d7c2a5; color: #1d1e21; }
.sian-actions [hidden] { display: none; }
.sian-body { overflow: auto; max-height: calc(92vh - 58px); display: grid; place-items: center; background: #0f1012; }
.sian-body img { display: block; max-width: 100%; max-height: calc(92vh - 58px); height: auto; cursor: zoom-in; }
.sian-body.zoom { place-items: start; }
.sian-body.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.sian-missing { padding: 48px 20px; margin: 0; font-size: 13px; opacity: .7; }

@media (max-width: 520px) {
  header { padding: 20px 16px 4px; }
  main { padding: 12px 16px 24px; }
  article { grid-template-rows: auto 440px 1fr; }
  .ctl { padding: 12px 16px 16px; }
  .ctl .grid2 { gap: 8px 14px; }
}
