:root {
  --ink: #1d1c1a; --sub: #6b665e; --line: #e3ded5; --paper: #faf8f4;
  --accent: #2f8f8a; --danger: #a33b2b; --r: 10px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* 이전 작업실과 같은 어두운 남색 그라데이션 배경 */
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c1420; }
body { background: radial-gradient(ellipse at 48% 22%, #324056 0%, #202c40 42%, #111927 82%, #0c1420 100%) fixed; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 7px 12px; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; }
button.danger { background: transparent; color: var(--danger); border-color: transparent; padding-left: 0; }
input { font: inherit; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input:disabled { background: #efebe4; color: #9a948a; }
select { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; flex: 1; min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: rgba(250,248,244,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); z-index: 5; }
.brand { font-size: 16px; letter-spacing: -.01em; }
.spacer { flex: 1; }
.who { font-size: 14px; color: var(--sub); }
/* 로그인·로그아웃 버튼: 보기 방식 묶음과 같은 높이·모서리·배경 */
#authBtn { background: #fff; border-radius: 9px; padding: 6px 12px; line-height: 18px; white-space: nowrap; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; padding: 6px 12px; line-height: 18px; background: transparent; }
.seg button.on { background: var(--ink); color: #fff; }
.seg.small button { padding: 5px 14px; font-size: 14px; }

.field { display: grid; gap: 4px; margin-bottom: 10px; color: var(--sub); font-size: 13px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.grid3 label { display: grid; gap: 3px; font-size: 12px; color: var(--sub); }
.grid3 input { padding: 6px; }
.row { display: flex; gap: 8px; margin: 8px 0; }
.row button { flex: 1; }
.msg { min-height: 1.2em; margin: 6px 0 0; color: var(--sub); font-size: 13px; }
.msg.err { color: var(--danger); }
.hint { color: var(--sub); font-size: 12px; margin: 6px 0; }
.warn { color: #b5651d; font-size: 13px; margin: 6px 0; }

.info { position: fixed; left: 14px; bottom: 14px; z-index: 4; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 14px; font-size: 14px; max-width: 280px; }
.info b { display: block; font-size: 15px; }
.tip { position: fixed; z-index: 6; pointer-events: none; background: rgba(29,28,26,.88); color: #fff; font-size: 13px;
  padding: 5px 9px; border-radius: 6px; transform: translate(12px, 12px); white-space: nowrap; }
.help { max-width: calc(100vw - 200px); position: fixed; left: 14px; top: 62px; z-index: 3; font-size: 12px; color: #4d4942;
  background: rgba(250,248,244,.8); padding: 6px 10px; border-radius: 8px; }

dialog { border: 0; border-radius: 14px; padding: 26px; width: min(360px, 92vw); background: var(--paper); }
dialog::backdrop { background: rgba(29,28,26,.45); }
dialog h1 { margin: 0 0 16px; font-size: 22px; }
dialog form { display: grid; gap: 4px; }
dialog .seg { margin-bottom: 14px; }
dialog .seg button { flex: 1; }
dialog button.primary { margin-top: 6px; padding: 10px; }

/* 작품 설치 */
/* 오른쪽 작은 버튼 → 누르면 오른쪽에서 설치 창이 열림 */
.fab { position: fixed; right: 14px; top: 64px; z-index: 4; padding: 8px 14px; font-size: 14px; font-weight: 600;
  background: var(--accent); border-color: var(--accent); color: #fff; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fab:hover { filter: brightness(1.08); }
dialog.install { width: min(420px, 94vw); max-height: calc(100vh - 76px); overflow-y: auto; padding: 18px 20px;
  position: fixed; inset: 60px 14px auto auto; margin: 0; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
dialog.install[open] { animation: slidein .18s ease-out; }
dialog.install::backdrop { background: transparent; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } }

/* 내 작품 위에 뜨는 작은 버튼 */
.workbar { position: fixed; left: 0; top: 0; z-index: 4; display: flex; gap: 2px; padding: 3px; border-radius: 9px;
  background: rgba(29,28,26,.86); box-shadow: 0 3px 10px rgba(0,0,0,.3); will-change: transform; }
.workbar button { border: 0; background: transparent; color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 6px; }
.workbar button:hover { background: rgba(255,255,255,.14); }
.workbar button.on { background: #fff; color: var(--ink); }
.workbar button.del { color: #ffb4a6; }
.toast { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; margin: 0; padding: 7px 14px; border-radius: 8px;
  background: rgba(29,28,26,.9); color: #fff; font-size: 13px; max-width: 90vw; }
.toast.err { background: var(--danger); }
.inhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.inhead h1 { margin: 0; font-size: 20px; }
.photo { display: grid; place-items: center; min-height: 150px; border: 1px dashed #c9c2b6; border-radius: 10px; margin-bottom: 12px;
  cursor: pointer; color: var(--sub); text-align: center; overflow: hidden; background: #fff; }
.photo:hover { border-color: var(--accent); color: var(--accent); }
.photo input { display: none; }
.photo img { max-width: 100%; max-height: 260px; display: block; }
textarea { font: inherit; width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; background: #fff; }
#inMake { width: 100%; padding: 11px; margin-top: 4px; }
.busy { display: flex; gap: 12px; align-items: center; padding: 18px 4px; color: var(--sub); font-size: 14px; }
.spin { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 3px solid #d9d3c8; border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#inView { width: 100%; height: 280px; display: block; border-radius: 10px;
  background: radial-gradient(ellipse at 50% 30%, #324056 0%, #202c40 55%, #111927 100%); touch-action: none; }
.summary { font-size: 14px; margin: 10px 0 4px; }

/* 이름표와 동작 */
.tags { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.nametag { position: absolute; left: 0; top: 0; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 1px 7px; border-radius: 6px; color: #fff; background: #142033dc; font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.nametag.mine { background: #d0648ae6; }
.acts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4; background: rgba(250,248,244,.94);
  border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; font-size: 13px; max-width: calc(100vw - 40px); }
.acts summary { cursor: pointer; font-weight: 600; color: var(--sub); padding: 2px 2px; }
.acts[open] summary { margin-bottom: 6px; }
#actList { display: flex; flex-wrap: wrap; gap: 6px; }
#actList button { font-size: 13px; padding: 5px 10px; }

@media (max-width: 720px) {
  .acts { left: 8px; right: auto; transform: none; max-width: calc(100vw - 150px); }
  .help { display: none; }
  .fab { top: auto; bottom: 16px; right: 10px; }
  dialog.install { inset: auto 0 0 0; width: 100vw; max-width: 100vw; max-height: 86vh; border-radius: 14px 14px 0 0; }
  dialog.install[open] { animation-name: slideup; }
  .info { bottom: 64px; }
  .bar { gap: 8px; padding: 8px 10px; }
  .brand { display: none; }
  .seg button { white-space: nowrap; padding: 6px 8px; font-size: 14px; }
  #authBtn { white-space: nowrap; padding: 6px 9px; }
  .who { display: none; }
}


/* 지금 접속한 사람: 왼쪽 위, 창 없이 세로 행 */
.users { position: fixed; left: 14px; top: 62px; z-index: 3; margin: 0; padding: 0; list-style: none; pointer-events: none;
  font-size: 13px; line-height: 1.7; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.75), 0 0 6px rgba(0,0,0,.35); }
.users li::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #5fd39a; margin-right: 7px; vertical-align: 1px; box-shadow: 0 0 3px rgba(0,0,0,.5); }
.users li.me { font-weight: 700; }

/* 대화: 열리면 어두운 반투명 창 + 입력 칸, 보내면 투명해지고 글만 남음 */
.chat { position: fixed; left: 14px; bottom: 14px; z-index: 4; width: min(360px, calc(100vw - 28px)); border-radius: 10px;
  padding: 6px 8px; transition: background .2s; pointer-events: none; }
.chat.open { background: rgba(20,24,32,.62); pointer-events: auto; }
.chatlog { list-style: none; margin: 0; padding: 0; max-height: 132px; overflow: hidden; font-size: 13.5px; line-height: 1.5; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.8), 0 0 6px rgba(0,0,0,.4); display: flex; flex-direction: column; justify-content: flex-end; }
.chat.open .chatlog { max-height: 220px; overflow-y: auto; justify-content: flex-start; }
.chatlog li { transition: opacity .8s; overflow-wrap: anywhere; }
.chatlog li b { margin-right: 6px; color: #ffe2a8; }
.chatlog li.mine b { color: #9fe3d6; }
.chat:not(.open) .chatlog li.old { opacity: 0; }
.chat input { margin-top: 6px; background: rgba(255,255,255,.95); }
.chatbtn { display: none; }

/* 도움말은 위 가운데로 (왼쪽 위는 접속자 목록) */
.help { left: 50% !important; transform: translateX(-50%); max-width: calc(100vw - 420px) !important; text-align: center; }
/* 작품 정보는 오른쪽 아래로 (왼쪽 아래는 대화) */
.info { left: auto; right: 14px; }

@media (max-width: 720px) {
  .chat { bottom: 60px; left: 8px; }
  .chatbtn { display: block; position: fixed; left: 104px; bottom: 16px; z-index: 4; padding: 6px 12px; font-size: 13px; line-height: 18px;
    background: rgba(250,248,244,.94); border-radius: 9px; }
  .chatbtn[hidden] { display: none; }
  .users { top: 58px; left: 10px; font-size: 12.5px; }
  .info { top: 58px; bottom: auto; right: 8px; max-width: 55vw; }
}

/* ---- v0.6: 위 오른쪽(요청·관리자 장비), 위 가운데 공지, 아래 가운데 버튼 줄 ---- */
.topright { position: fixed; right: 14px; top: 64px; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.topright .fab { position: static; }
.admintools { display: flex; gap: 6px; }
.admintools button { font-size: 13px; padding: 5px 10px; line-height: 18px; background: rgba(250,248,244,.94); border-radius: 9px; }
.help { display: none !important; }
.notice { position: fixed; left: 50%; top: 62px; transform: translateX(-50%); z-index: 3; max-width: min(640px, calc(100vw - 460px));
  padding: 6px 14px; border-radius: 9px; background: rgba(29,28,26,.78); color: #fff; font-size: 13.5px; line-height: 1.45; text-align: center; }
.notice.edit { cursor: text; }
.notice.empty { background: rgba(250,248,244,.7); color: var(--sub); border: 1px dashed #b9b2a6; }
.notice input { min-width: min(520px, 60vw); padding: 4px 8px; color: var(--ink); }
.dock { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; display: flex; align-items: flex-end; gap: 8px; }
.dock .acts { position: static; transform: none; max-width: min(520px, calc(100vw - 260px)); }
.dockbtn { font-size: 13px; padding: 6px 12px; line-height: 18px; border-radius: 10px; background: rgba(250,248,244,.94); white-space: nowrap; }
.dockbtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chatbtn { display: none !important; }
dialog.side { width: min(400px, 94vw); max-height: calc(100vh - 76px); overflow-y: auto; padding: 18px 20px;
  position: fixed; inset: 60px 14px auto auto; margin: 0; box-shadow: 0 10px 34px rgba(0,0,0,.35); }
dialog.side::backdrop { background: transparent; }
button.wide { width: 100%; margin-top: 8px; padding: 10px; }
.reqlist, .vidlist { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.reqlist li { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.reqlist li small { display: block; color: var(--sub); margin-bottom: 3px; }
.reqlist li p { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.vidlist li { display: flex; gap: 6px; }
.vidlist li button.pick { flex: 1; text-align: left; }
.vidlist li button.pick.on { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.file { display: block; border: 1px dashed #c9c2b6; border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; color: var(--sub); margin-top: 8px; }
.file input { display: none; }
@media (max-width: 720px) {
  .topright { top: 108px; right: 8px; }
  .notice { top: 56px; max-width: calc(100vw - 16px); width: max-content; font-size: 12.5px; padding: 5px 10px; }
  .users { top: 108px; }
  .dock { bottom: 12px; width: calc(100vw - 16px); justify-content: center; }
  .dock .acts { max-width: calc(100vw - 190px); }
  .chat { bottom: 104px; }
  dialog.side { inset: auto 0 0 0; width: 100vw; max-width: 100vw; max-height: 86vh; border-radius: 14px 14px 0 0; }
}

/* 치수: 이동·회전 표시, 치수 재기 */
.dims { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.dimlabel { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: #fff;
  background: #e0571f; border-radius: 6px; padding: 2px 7px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.dimlabel.fixed { pointer-events: auto; display: flex; gap: 4px; align-items: center; cursor: pointer; padding: 2px 4px 2px 7px; }
.dimlabel.fixed button { pointer-events: auto; font-size: 12px; padding: 1px 7px; border: 0; border-radius: 5px; background: #fff; color: var(--danger); }
.dimlabel.preview { opacity: .85; }
.dockbtn.on { background: #e0571f; border-color: #e0571f; color: #fff; }

/* ---- 버튼 규격 통일 (v0.6): 화면 위 모든 조작 버튼 높이 32px · 글자 13.5px · 모서리 9px ---- */
:root { --bh: 32px; --bfs: 13.5px; --br: 9px; }
.seg { height: var(--bh); border-radius: var(--br); }
.seg button { height: calc(var(--bh) - 2px); line-height: calc(var(--bh) - 2px); padding: 0 12px; font-size: var(--bfs); }
#authBtn, .fab, .admintools button, .dockbtn, .acts {
  box-sizing: border-box; height: var(--bh); line-height: calc(var(--bh) - 2px); padding: 0 12px;
  font-size: var(--bfs); border-radius: var(--br); white-space: nowrap; box-shadow: none; }
#authBtn, .admintools button, .dockbtn:not(.primary):not(.on), .acts { background: rgba(250,248,244,.94); border: 1px solid var(--line); font-weight: 500; color: var(--ink); }
.fab, .dockbtn.primary { font-weight: 600; }
.fab { box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.acts { display: block; }
.acts summary { padding: 0; line-height: calc(var(--bh) - 2px); font-size: var(--bfs); font-weight: 500; color: var(--ink); }
.acts[open] { height: auto; padding-bottom: 8px; }
.acts[open] summary { margin-bottom: 4px; }
#actList button { height: 28px; line-height: 26px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
/* 작품·장비 위 작은 버튼 줄: 바깥 32px, 안쪽 버튼 28px */
.workbar { height: var(--bh); padding: 2px; border-radius: var(--br); box-sizing: border-box; }
.workbar button { height: 28px; line-height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
/* 창 안 버튼 */
dialog button { border-radius: var(--br); font-size: var(--bfs); }
.inhead button, .reqlist button, .vidlist button { height: var(--bh); line-height: calc(var(--bh) - 2px); padding: 0 12px; }
dialog button.primary, button.wide, #inMake { height: 40px; line-height: 38px; padding: 0 14px; font-weight: 600; }
.dimlabel.fixed button { height: 20px; line-height: 20px; }
@media (max-width: 720px) {
  :root { --bfs: 13px; }
  .seg button, #authBtn, .fab, .admintools button, .dockbtn, .acts { padding: 0 9px; }
}

/* 요청함·영상 고르기 창이 화면 위 버튼들보다 위에 오게 (휴대폰에서 아래 버튼 줄에 가려지던 문제) */
dialog.side { z-index: 30; }
@media (max-width: 720px) { dialog.side { max-height: 80vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); } }

/* 치수 재기: 수직 치수는 파랑 (수평은 주황) */
.dimlabel.v { background: #2f6fd6; }
.measuremode { display: inline-flex; gap: 4px; }
.measuremode[hidden] { display: none; }
#mH.on { background: #e0571f; border-color: #e0571f; color: #fff; }
#mV.on { background: #2f6fd6; border-color: #2f6fd6; color: #fff; }

/* 대화: 시간 표시(열었을 때만), 지난 대화 더 보기 */
.chatlog li time { display: none; margin-right: 6px; font-size: 11px; color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.chat.open .chatlog li time { display: inline; }
.chat.open .chatlog { max-height: 320px; }
.chatmore { display: block; width: 100%; margin-bottom: 6px; font-size: 12px; padding: 4px 8px; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 6px; }
.chatmore[hidden] { display: none; }
/* 접속 기록 (관리자) */
dialog.side.wide { width: min(860px, calc(100vw - 24px)); }
.logbar { display: flex; gap: 6px; margin-bottom: 8px; }
.logbar input { flex: 1; }
.logwrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.logtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.logtable th, .logtable td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.logtable th { position: sticky; top: 0; background: #f6f3ee; font-weight: 600; }
.logtable tr.bad td { color: var(--danger); }
.logtable td.link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.logtable td.on { color: #2f8f8a; font-weight: 600; }

/* 공지: 줄바꿈 표시·여러 줄 입력 */
.notice { white-space: pre-line; text-align: center; }
.notice textarea { display: block; min-width: min(520px, 60vw); padding: 4px 8px; color: var(--ink); font: inherit; resize: none; line-height: 1.5; }

/* 확인 창 */
dialog.ask { z-index: 40; width: min(360px, calc(100vw - 32px)); padding: 18px 18px 14px; border: 0; border-radius: 14px; background: #faf8f4; color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.35); }
dialog.ask::backdrop { background: rgba(10,14,22,.45); }
dialog.ask p { margin: 0 0 14px; white-space: pre-line; line-height: 1.55; font-size: 14.5px; }
.askbtns { display: flex; gap: 8px; justify-content: flex-end; }
.askbtns button { min-width: 84px; height: 34px; border-radius: 9px; font-size: 13.5px; }
.askbtns .danger { background: var(--danger); border: 1px solid var(--danger); color: #fff; font-weight: 600; }

/* 스피커 음량 밀대 (작품 위 버튼 줄 안) */
#gVolRange { width: 120px; margin: 0 6px; accent-color: #e9c46a; vertical-align: middle; }

/* 관리자: 대화 줄 지우기 */
.chatdel { display: none; margin-left: 6px; padding: 0 6px; height: 18px; line-height: 16px; font-size: 13px; border: 0; border-radius: 4px; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; }
.chat.open .chatdel { display: inline-block; }
.chatdel:hover { background: #c0392b; }

/* 아래 버튼 줄: 치수 재기 · 내 동작은 누르면 위로 목록이 뜸 */
.popwrap { position: relative; display: inline-flex; }
.dock .acts { position: relative; max-width: none; left: auto; bottom: auto; transform: none; }
.acts[open] { height: var(--bh); padding-bottom: 0; }
.acts[open] summary { margin-bottom: 0; }
.acts summary { list-style: none; }
.acts summary::-webkit-details-marker { display: none; }
.acts summary::after, #measureBtn::after { content: ' ▴'; font-size: 10px; opacity: .6; }
#actList, .measuremode { position: absolute; bottom: calc(100% + 8px); right: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: rgba(250,248,244,.97); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 8px 24px rgba(0,0,0,.18); min-width: max-content; z-index: 6; }
.measuremode { left: 50%; right: auto; transform: translateX(-50%); }
.measuremode[hidden] { display: none; }
#actList button, .measuremode .dockbtn { width: 100%; text-align: left; justify-content: flex-start; }

/* 공지: 기본 3줄까지 보이고 나머지는 스크롤 (고칠 때는 전부 보임) */
.notice { line-height: 1.5; padding-top: 6px; padding-bottom: 6px; box-sizing: border-box; max-height: calc(4.5em + 12px); overflow-y: auto; overscroll-behavior: contain; pointer-events: auto; scrollbar-width: thin; }
.notice:has(textarea) { max-height: none; overflow: visible; }

/* 인터랙티브 미디어 작품 목차 (왼쪽, 접을 수 있음) */
.ihint { margin: 6px 0 4px; font-size: 11.5px; line-height: 1.45; color: rgba(255,255,255,.85); background: rgba(233,196,106,.16); border-left: 3px solid #e9c46a; padding: 5px 7px; border-radius: 6px; }
.ihint b { color: #ffe2a8; }
.ilist { position: fixed; left: 12px; top: 150px; z-index: 3; width: min(280px, calc(100vw - 24px)); max-height: 42vh; overflow-y: auto;
  background: rgba(20,24,32,.62); color: #fff; border-radius: 12px; padding: 8px 10px; backdrop-filter: blur(6px); font-size: 12.5px; }
.ilist summary { cursor: pointer; font-weight: 700; color: #ffe2a8; list-style: none; }
.ilist summary::-webkit-details-marker { display: none; }
.ilist ol { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ilist li button { width: 100%; text-align: left; display: block; background: rgba(255,255,255,.08); border: 0; border-radius: 8px; padding: 6px 8px; color: #fff; cursor: pointer; line-height: 1.4; }
.ilist li button:hover { background: rgba(255,255,255,.16); }
.ilist li b { display: block; font-size: 12.5px; }
.ilist li span { display: block; color: rgba(255,255,255,.75); font-size: 11.5px; }
.ilist li em { font-style: normal; font-size: 10px; background: #e9c46a; color: #1a1a1a; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
@media (max-width: 720px) { .ilist { top: 112px; max-height: 34vh; width: min(260px, calc(100vw - 24px)); } }

#qBtn { margin-right: 6px; font-size: 12px; }
@media (max-width: 720px) { #qBtn { font-size: 11px; padding: 0 7px; } }

#itSummary { white-space: pre-line; }

/* 내 동작: 누르면 버튼 줄 위 가운데에 두 줄로(넓은 화면 6칸×2줄, 좁은 화면 3칸) */
#actList { position: fixed; left: 50%; right: auto; bottom: 62px; transform: translateX(-50%); display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: 5px; width: max-content; max-width: calc(100vw - 20px); }
#actList button { width: auto; white-space: nowrap; text-align: center; }
@media (max-width: 520px) { #actList { grid-template-rows: none; grid-auto-flow: row; grid-template-columns: repeat(4, auto); } }

.verbar { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 50; background: #1f2a3f; color: #fff; padding: 7px 10px 7px 14px; border-radius: 10px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.verbar[hidden] { display: none; }
.verbar button { margin-left: 8px; height: 26px; padding: 0 10px; border-radius: 7px; border: 0; background: #e9c46a; color: #1a1a1a; font-weight: 600; }
.users li.more { opacity: .8; font-style: italic; pointer-events: auto; cursor: default; }
.users li.more::before { background: #9aa0a8; }

/* 위쪽 화질·로그아웃 버튼: 배경에 묻히지 않게 진한 색 */
#qBtn, #authBtn { background: #1f2a3f !important; color: #fff !important; border: 1px solid #1f2a3f !important; font-weight: 600 !important; box-shadow: 0 2px 8px rgba(0,0,0,.22); border-radius: 9px; height: 32px; padding: 0 12px; }
#qBtn:hover, #authBtn:hover { background: #2c3b57 !important; }
.qwrap { position: relative; display: inline-block; margin-right: 6px; }
.qmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: 260px; background: #faf8f4; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 4px; }
.qmenu[hidden] { display: none; }
.qmenu > b { font-size: 13px; margin: 0 2px 4px; }
.qmenu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; }
.qmenu button:hover { background: rgba(0,0,0,.05); }
.qmenu button.on { border-color: #1f2a3f; background: rgba(31,42,63,.07); }
.qmenu button span { font-weight: 600; font-size: 13px; }
.qmenu button small { font-size: 11.5px; color: var(--sub); }
.qmenu p { margin: 4px 2px 0; font-size: 11.5px; color: var(--sub); }
@media (max-width: 720px) { #qBtn, #authBtn { height: 30px; padding: 0 9px; font-size: 12px; } }

/* ---- 휴대폰 화면 정리 (검수) ---- */
#qBtn, #authBtn { height: var(--bh); }                         /* 위 줄 버튼 높이를 보기 버튼과 똑같이 */
@media (max-width: 720px) { #qBtn, #authBtn { height: var(--bh); } }
@media (max-width: 520px) {
  .bar { gap: 6px; padding: 8px 8px; }
  .seg button { padding: 0 7px; font-size: 12.5px; }
  #qBtn, #authBtn { padding: 0 8px; font-size: 12px; }
  .qwrap { margin-right: 0; }
  .qmenu { right: -60px; width: min(260px, calc(100vw - 20px)); }
  .ilist { width: min(230px, calc(100vw - 150px)); }
  /* 아래 버튼 줄: 짧은 이름으로(작품·장비·대화·치수·동작) 한 줄에 */
  [data-short] { font-size: 0 !important; }
  [data-short]::before { content: attr(data-short); font-size: 12.5px; }
  .dock { gap: 5px; }
  .dockbtn, .acts summary { padding: 0 10px; }
  /* 작품 위 버튼: 넘치면 두 줄로 */
  .workbar { height: auto; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 16px); }
}
/* 아래 버튼 줄 높이·가운데 맞춤 (짧은 이름·내 동작 포함) */
.dock > .dockbtn, .dock > .popwrap > .dockbtn, .dock .acts summary { height: var(--bh); display: inline-flex; align-items: center; justify-content: center; line-height: 1; box-sizing: border-box; }
.dock .acts { height: var(--bh); padding: 0; display: inline-flex; }
.dock .acts summary { padding: 0 12px; border-radius: inherit; }
@media (max-width: 520px) { [data-short]::before { line-height: 1; } .dock .acts summary { padding: 0 10px; } }
@media (max-width: 720px) { dialog.side.wide { width: 100vw; max-width: 100vw; } }
@media (max-width: 520px) { .workbar button { padding: 0 6px; font-size: 12px; } .workbar { gap: 0; } }

/* ---- 아이폰: 입력 칸을 누를 때 화면이 저절로 확대되지 않게(글자 16px), 관리자 버튼 줄은 넘치면 두 줄로 ---- */
@media (pointer: coarse), (max-width: 720px) {
  input, textarea, select { font-size: 16px !important; }
}
.admintools { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 16px); }
@media (max-width: 520px) { .admintools { gap: 4px; } .admintools button { font-size: 12px; padding: 0 8px; } }

/* 로그인 화면: 기기에 맞춘 화질 안내 */
.qcheck { margin: 10px 0 0; font-size: 12px; color: var(--sub); text-align: center; line-height: 1.45; }
.qcheck.done { color: var(--accent); }
/* 로그인 화면: 뒤의 전시장을 완전히 가림(불러오는 동안) */
dialog#auth::backdrop { background: radial-gradient(ellipse at 48% 22%, #324056 0%, #202c40 42%, #111927 82%, #0c1420 100%); opacity: 1; }

/* 관리자 버튼 글자 가운데(짧은 이름 포함) */
.admintools button { display: inline-flex; align-items: center; justify-content: center; height: var(--bh); line-height: 1; }
@media (max-width: 720px) { .notice { left: 8px; right: 8px; transform: none; max-width: none; width: auto; } }
/* 공지: 3줄 아래 다음 줄이 살짝 보이지 않게 아래 여백 부분은 잘라 보임 */
.notice { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 6px), transparent calc(100% - 6px)); mask-image: linear-gradient(to bottom, #000 calc(100% - 6px), transparent calc(100% - 6px)); }
.notice:has(textarea) { -webkit-mask-image: none; mask-image: none; }

/* ======== 글씨·버튼 크게 (PC·휴대폰 모두) ======== */
:root { --bh: 40px; --bfs: 15.5px; --br: 11px; }
body { font-size: 15.5px; }
button { font-size: 15px; }
/* 위 메뉴줄 */
.bar { padding-top: 10px; padding-bottom: 10px; }
.seg button { font-size: var(--bfs); padding: 0 15px; }
#qBtn, #authBtn { font-size: 15px !important; padding: 0 16px !important; border-radius: 11px; }
.who { font-size: 15px; }
/* 아래 버튼 줄 */
.dockbtn, .dock .acts summary { font-size: 15.5px !important; padding: 0 16px; border-radius: 12px; }
.dock { gap: 10px; bottom: 16px; }
#actList button, .measuremode .dockbtn, #projMenu .dockbtn { font-size: 15px; height: 38px; line-height: 1; }
/* 오른쪽 위 버튼·관리자 도구 */
.fab, .topright button, .admintools button { font-size: 15px; height: var(--bh); padding: 0 14px; border-radius: 11px; }
/* 작품 위 버튼 */
.workbar { height: auto; min-height: var(--bh); padding: 3px; border-radius: 12px; }
.workbar button { font-size: 15px; height: 34px; line-height: 34px; padding: 0 12px; }
/* 공지·접속자·작품 목록·대화·치수·이름표 */
.notice { font-size: 15px; }
.users li { font-size: 15px; line-height: 1.7; }
.ilist { font-size: 14.5px; width: min(320px, calc(100vw - 24px)); }
.ilist summary { font-size: 15px; }
.ilist li b { font-size: 14.5px; }
.ilist li span, .ihint { font-size: 13.5px; }
.chatlog { font-size: 15px; }
.chat.open .chatlog li time { font-size: 12.5px; }
.chat input { font-size: 16px; height: 42px; }
.dimlabel { font-size: 14px; }
.nametag { font-size: 14px; padding: 3px 10px; }
.toast, .verbar { font-size: 15px; }
/* 창 안 글씨 */
dialog { font-size: 15.5px; }
dialog h1 { font-size: 24px; }
.inhead h1 { font-size: 22px; }
.field { font-size: 14.5px; }
.hint, .msg { font-size: 14px; }
.summary { font-size: 15.5px; }
dialog button.primary, button.wide, #inMake { height: 48px; font-size: 16px; }
.inhead button, .reqlist button, .vidlist button { height: 40px; font-size: 15px; }
.qmenu { width: 300px; } .qmenu button span { font-size: 15px; } .qmenu button small { font-size: 13px; }
.qcheck { font-size: 13.5px; }
.logtable { font-size: 14px; }

/* 휴대폰: 크게 하되 한 줄에 들어가게 */
@media (max-width: 720px) {
  :root { --bh: 38px; --bfs: 14.5px; }
  .seg button { padding: 0 10px; }
  #qBtn, #authBtn { padding: 0 12px !important; font-size: 14.5px !important; }
  .dockbtn, .dock .acts summary { padding: 0 12px; font-size: 15px !important; }
  .dock { gap: 6px; }
  .ilist { width: min(300px, calc(100vw - 24px)); }
}
@media (max-width: 520px) {
  :root { --bh: 38px; --bfs: 14px; }
  .bar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .seg button { padding: 0 8px; font-size: 14px; }
  #qBtn, #authBtn { padding: 0 10px !important; font-size: 14px !important; }
  [data-short]::before { font-size: 15px; }
  .dockbtn, .dock .acts summary { padding: 0 11px; }
  .dock { gap: 5px; }
  .admintools button { font-size: 14px; padding: 0 10px; }
  .workbar button { font-size: 14px; padding: 0 8px; height: 34px; }
  #actList button { font-size: 14.5px; height: 40px; }
  .ilist { width: min(260px, calc(100vw - 140px)); }
  .notice { font-size: 14px; }
}
@media (max-width: 520px) {
  .dock [data-short], .admintools [data-short] { font-size: 0 !important; }   /* 짧은 이름만 보이게(긴 이름 숨김) */
  .dock [data-short]::before { font-size: 15px; }
  .admintools [data-short]::before { font-size: 14px; }
  #qBtn, #authBtn { white-space: nowrap; }
  #projMenu { left: 0; right: auto; transform: none; }               /* 장비 메뉴가 화면 왼쪽 밖으로 나가지 않게 */
  #projMenu .dockbtn { font-size: 14.5px; }
  .seg button { padding: 0 7px; font-size: 13.5px; }
}
@media (max-width: 400px) { .dock { gap: 4px; } .dockbtn, .dock .acts summary { padding: 0 9px; } }
dialog.side { overflow-y: auto; }
@media (min-width: 721px) and (max-width: 1100px) { .chat { bottom: 70px; } }
@media (max-width: 520px) { .dock .acts summary[data-short] { font-size: 0 !important; } .dock .acts summary[data-short]::after { font-size: 10px; } }
@media (max-width: 520px) { .ilist { width: min(300px, calc(100vw - 24px)); } .ilist summary { white-space: nowrap; font-size: 14.5px; } }
/* 새로고침 안내: 화면 가운데 */
.verbar { top: 50% !important; left: 50%; transform: translate(-50%, -50%); padding: 14px 16px 14px 20px; font-size: 16px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); max-width: calc(100vw - 32px); text-align: center; }
.verbar button { height: 38px; padding: 0 16px; font-size: 15px; margin-left: 10px; }
/* 닫혀 있을 때도 보이는 대화 글은 눌러서 지난 대화 보기 */
.chat:not(.open) .chatlog li:not(.old) { pointer-events: auto; cursor: pointer; }
.chat:not(.open):hover .chatlog { filter: brightness(1.15); }
/* 오래된 대화도 마지막 3줄은 흐리게 남겨 눌러서 지난 대화를 볼 수 있게 */
.chat:not(.open) .chatlog li.old:nth-last-child(-n+3) { opacity: .55; pointer-events: auto; cursor: pointer; }
/* 치수 글자는 화면 위 창(공지·접속 목록·인터랙티브 목록 등)보다 뒤에 — 창을 가리지 않게 */
.dims { z-index: 2; }
/* 대화 글은 눌러도 창이 열리지 않음 — 화면 클릭을 막지 않게 */
.chat:not(.open) .chatlog li.old:nth-last-child(-n+3) { pointer-events: none; cursor: default; }
.chat:not(.open) .chatlog { pointer-events: none; }
/* 새로고침 알림: 글과 버튼을 가운데 정렬, 여백 위아래·좌우 같게 */
.verbar:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 14px; row-gap: 12px; padding: 16px 20px; }
.verbar button { margin: 0 !important; }
.verbar span { white-space: nowrap; }
.verbar:not([hidden]) { width: max-content; }
@media (max-width: 520px) { .verbar:not([hidden]) { flex-direction: column; } }

/* 머리 위 말풍선 */
.bubble { position: absolute; left: 0; top: 0; max-width: min(240px, 60vw); padding: 6px 11px; border-radius: 12px; background: #fff; color: #1d1c1a;
  font-size: 14px; line-height: 1.4; font-weight: 500; box-shadow: 0 3px 10px rgba(0,0,0,.22); overflow-wrap: anywhere; white-space: normal; width: max-content;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: opacity .4s; }
.bubble[hidden] { display: none; }
.bubble.mine { background: #e6f4f1; }
.bubble.out { opacity: 0 !important; }
/* 장비 설치 버튼: 보라색으로 눈에 띄게 */
#projBtn { background: #5b3fa0 !important; color: #fff !important; border-color: #5b3fa0 !important; font-weight: 600; box-shadow: 0 2px 8px rgba(91,63,160,.35); }
#projBtn:hover { background: #4a3288 !important; }
/* 장비 메뉴의 노트북: 두 줄(설명 포함) */
#projMenu .dockbtn.twoline { height: auto !important; min-height: 38px; padding-top: 6px; padding-bottom: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1.2; text-align: left; }
#projMenu .dockbtn.twoline small { font-size: 12px; font-weight: 400; color: #5b3fa0; white-space: normal; }
#projMenu .dockbtn.twoline small { max-width: 220px; }
/* 말풍선 디자인(고도화): 꼬리 달린 둥근 풍선, 톡 튀어나오는 등장, 부드러운 그림자 */
.bubble { display: block; -webkit-line-clamp: unset; overflow: visible; padding: 0; background: none; box-shadow: none; max-width: none; width: auto; }
.bubble > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; width: max-content; max-width: min(240px, 62vw);
  padding: 8px 13px; border-radius: 16px; background: linear-gradient(180deg, #ffffff, #f6f3ee); color: #1d1c1a; border: 1px solid rgba(0,0,0,.08);
  font-size: 14.5px; line-height: 1.42; font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; white-space: normal;
  box-shadow: 0 6px 18px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.12); }
.bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg);
  background: #f6f3ee; border-right: 1px solid rgba(0,0,0,.08); border-bottom: 1px solid rgba(0,0,0,.08); border-bottom-right-radius: 3px; box-shadow: 3px 3px 6px rgba(0,0,0,.08); }
.bubble.mine > span { background: linear-gradient(180deg, #e9f7f3, #d6efe8); border-color: rgba(30,105,102,.22); color: #123c3a; }
.bubble.mine::after { background: #d6efe8; border-color: rgba(30,105,102,.22); }
.bubble.pop > span, .bubble.pop::after { animation: bubblePop .32s cubic-bezier(.2,1.5,.4,1) both; }
.bubble > span { transform-origin: 50% 110%; }
@keyframes bubblePop { from { opacity: 0; transform: translateY(6px) scale(.7); } to { opacity: 1; transform: none; } }
.bubble.pop::after { animation-name: bubbleTail; }
@keyframes bubbleTail { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 720px) { .bubble > span { font-size: 14px; padding: 7px 11px; } }
/* 치수 글자는 이름표·말풍선보다 뒤에 */
.dims { z-index: 1 !important; }

/* 관리자 시크릿 모드 */
#secretBtn.on { background: #2b2b33 !important; color: #fff !important; border-color: #2b2b33 !important; }
.users li.me.secret { opacity: .7; font-style: italic; }
/* 새로고침 안내 글이 길어져서: 좁은 화면에선 줄바꿈(가운데 정렬) */
.verbar span { white-space: normal; text-align: center; word-break: keep-all; }
.verbar:not([hidden]) { max-width: min(460px, calc(100vw - 32px)); }
/* 시크릿 모드: 내 이름표 반투명 */
.nametag.ghost { filter: opacity(.5); font-style: italic; }

/* 이용 방법 창 */
#guideBtn { width: 34px; height: 32px; padding: 0; margin-right: 6px; border-radius: 9px; border: 1px solid #1f2a3f; background: #1f2a3f; color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
#guideBtn:hover { background: #2c3b57; }
dialog.guide { z-index: 45; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); padding: 20px 20px 14px; border: 0; border-radius: 16px; background: #faf8f4; color: var(--ink);
  box-shadow: 0 16px 48px rgba(0,0,0,.4); display: none; flex-direction: column; }
dialog.guide[open] { display: flex; }
dialog.guide::backdrop { background: rgba(10,14,22,.5); }
dialog.guide h2 { margin: 0 0 12px; font-size: 19px; text-align: center; }
.gsteps { list-style: none; counter-reset: g; margin: 0; padding: 0 4px 0 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.gsteps li { counter-increment: g; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; row-gap: 2px; align-items: start; }
.gsteps li::before { content: counter(g); grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; background: #2f8f8a; color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.gsteps b { font-size: 15.5px; line-height: 1.35; }
.gsteps span { font-size: 14px; line-height: 1.55; color: #3d3a35; word-break: keep-all; overflow-wrap: anywhere; }
.gsteps em { font-style: normal; font-weight: 600; color: #2f8f8a; }
.gfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.gfoot label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--sub); cursor: pointer; }
.gfoot input { width: 18px; height: 18px; margin: 0; }
#guideOk { height: 40px; padding: 0 22px; border: 0; border-radius: 10px; background: #2f8f8a; color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; }
#guideOk:hover { background: #26706c; }
.gnote { margin: 8px 0 0; font-size: 12.5px; color: var(--sub); text-align: center; }
@media (max-width: 520px) { dialog.guide { padding: 16px 14px 12px; } .gsteps span { font-size: 13.5px; } dialog.guide h2 { font-size: 17.5px; } #guideBtn { width: 30px; height: 30px; margin-right: 4px; } }
/* ? 버튼 크기를 옆 화질·로그아웃 버튼과 같게 */
#guideBtn { height: var(--bh, 38px) !important; width: var(--bh, 38px) !important; flex: none; }
@media (max-width: 520px) { #guideBtn { width: 32px !important; margin-right: 4px; } }
/* 이용 방법: 짧게 한 줄씩 */
dialog.guide { width: min(420px, calc(100vw - 24px)); }
.gsteps { gap: 9px; }
.gsteps li { grid-template-columns: 26px 1fr; align-items: center; }
.gsteps li::before { width: 24px; height: 24px; font-size: 13px; }
.gsteps b { font-size: 14.5px; }
.gsteps span { font-size: 13.5px; line-height: 1.45; }
/* 이용 방법: 읽기 쉽게 — 줄마다 카드, 큰 글씨, 넉넉한 간격 */
dialog.guide { width: min(440px, calc(100vw - 24px)); padding: 22px 18px 14px; }
dialog.guide h2 { font-size: 20px; margin-bottom: 16px; }
.gsteps { gap: 8px; }
.gsteps li { grid-template-columns: 34px 1fr; column-gap: 12px; row-gap: 3px; padding: 11px 14px; border-radius: 12px; background: #fff; border: 1px solid rgba(0,0,0,.06); }
.gsteps li::before { width: 30px; height: 30px; font-size: 15px; }
.gsteps b { font-size: 16px; color: #1d1c1a; }
.gsteps span { font-size: 14.5px; line-height: 1.45; color: #55514a; }
@media (max-width: 520px) { .gsteps li { padding: 10px 12px; } .gsteps b { font-size: 15.5px; } .gsteps span { font-size: 14px; } }
.verbar span { text-wrap: balance; line-height: 1.5; }
.gsteps span { text-wrap: pretty; }
/* 좁은 폰: 위 메뉴줄(보기 4개 + ? + 화질 + 로그아웃)이 한 줄에 들어가게 여백만 줄임 */
@media (max-width: 420px) {
  header .seg { flex-shrink: 0; }
  header .seg button { padding-left: 7px !important; padding-right: 7px !important; }
  #authBtn { padding-left: 8px !important; padding-right: 8px !important; }
  #qBtn { padding-left: 8px !important; padding-right: 8px !important; }
  .qwrap { margin-right: 4px !important; }
  #guideBtn { margin-left: 0; margin-right: 4px !important; }
  header { column-gap: 4px !important; }
}
@media (max-width: 380px) {
  header .seg button { font-size: 13px !important; padding-left: 5px !important; padding-right: 5px !important; }
  #authBtn, #qBtn { font-size: 13px !important; padding-left: 7px !important; padding-right: 7px !important; }
  #guideBtn { width: 30px !important; }
}

/* ---- Kate's House: 언어 고르기 ---- */
.langwrap { position: relative; display: inline-flex; }
#langBtn { height: var(--bh, 32px); min-width: 40px; padding: 0 8px; margin-right: 6px; border-radius: 9px; border: 1px solid #1f2a3f; background: #fff; color: #1f2a3f; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
#langBtn:hover { background: #eef1f6; }
.langmenu { position: absolute; top: calc(100% + 6px); right: 6px; z-index: 60; display: flex; flex-direction: column; min-width: 130px; padding: 6px; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.28); }
.langmenu[hidden] { display: none; }
.langmenu button { text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font-size: 15px; color: #1d1c1a; cursor: pointer; }
.langmenu button:hover { background: #f1efe9; }
.langmenu button.on { background: #2f8f8a; color: #fff; font-weight: 700; }
.langseg { display: flex; gap: 4px; justify-content: center; margin: -4px 0 12px; }
.langseg button { padding: 5px 12px; border: 1px solid var(--line, #ddd); border-radius: 999px; background: #fff; font-size: 13.5px; color: #3d3a35; cursor: pointer; }
.langseg button.on { background: #2f8f8a; border-color: #2f8f8a; color: #fff; font-weight: 700; }
@media (max-width: 420px) { #langBtn { min-width: 34px; padding: 0 6px; margin-right: 4px; font-size: 12px; } }
@media (max-width: 380px) { #langBtn { min-width: 30px; padding: 0 4px; font-size: 11.5px; } }

/* 휴대폰: 영어·필리핀어는 보기 방식 이름을 짧게(한국어는 원래 길이로 들어맞음) */
.bar .seg [data-mshort]::before { content: none; }
@media (max-width: 520px) {
  html:not([lang=ko]) .bar .seg [data-mshort] { font-size: 0 !important; }
  html:not([lang=ko]) .bar .seg [data-mshort]::before { content: attr(data-mshort); font-size: 13.5px; }
}
@media (max-width: 380px) { html:not([lang=ko]) .bar .seg [data-mshort]::before { font-size: 12.5px; } }
/* 언어 버튼이 들어가도 폰 위 메뉴가 한 줄에 들어가게 */
@media (max-width: 420px) {
  .bar { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .bar .seg button { padding: 0 6px !important; }
  #qBtn, #authBtn { padding: 0 7px !important; }
  #langBtn { min-width: 30px; padding: 0 4px; margin-right: 0; }
  #guideBtn { width: 28px !important; margin-right: 0 !important; }
}
@media (max-width: 380px) {
  .bar .seg button { padding: 0 5px !important; font-size: 12px !important; }
  html:not([lang=ko]) .bar .seg [data-mshort]::before { font-size: 12px; }
  #qBtn, #authBtn { padding: 0 6px !important; font-size: 12.5px !important; }
  #langBtn { min-width: 28px; font-size: 11px; }
  #guideBtn { width: 26px !important; }
}
@media (max-width: 420px) { .bar { gap: 3px; } html[lang=ko] .bar .seg button { font-size: 12.5px !important; } }
@media (max-width: 380px) { html[lang=ko] .bar .seg button { font-size: 12px !important; } }

/* ================= Kate's House: 여성스러운 파스텔 분위기 ================= */
:root { --ink: #4a2f3f; --sub: #8a6a7b; --line: #d8ece9; --paper: #fff7fa; --rose: #2f8f8a; --rose-d: #26706c; --blush: #dff1ee; --lav: #c9b6e4;
  font-family: "Nunito", "Gowun Dodum", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; }
html, body { background: #3a2846; }
body { background: radial-gradient(ellipse at 48% 18%, #8a5a80 0%, #6a4570 36%, #46304f 72%, #2f2138 100%) fixed; }
dialog#auth::backdrop, .bootcover { background: radial-gradient(ellipse at 48% 18%, #8a5a80 0%, #6a4570 36%, #46304f 72%, #2f2138 100%); }
.bootcover { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; transition: opacity .5s; }
.bootcover span { font: 800 26px "Nunito", sans-serif; color: #dff1ee; letter-spacing: .02em; opacity: .85; animation: bootPulse 1.6s ease-in-out infinite; }
.bootcover.gone { opacity: 0; pointer-events: none; }
@keyframes bootPulse { 50% { opacity: .45; } }
.bar { background: rgba(255,247,250,.94); border-bottom-color: #d3ebe7; }
.brand { font-family: "Nunito", sans-serif; font-weight: 800; color: #b24d73; }
.brand::before { content: "♡ "; color: #5fb8b2; }
.seg { border-color: #f0d0dc; }
.seg button.on { background: #2f8f8a; }
button { border-color: #d8ece9; }
#qBtn, #guideBtn, #authBtn { background: #2f3e5c !important; border-color: #2f3e5c !important; color: #fff !important; }
#langBtn { border-color: #d98aa6; color: #2f3e5c; }
dialog { border-radius: 18px !important; }
dialog, .qmenu, .langmenu { background: #fffafc; }
button.primary, .dock .dockbtn.primary { background: linear-gradient(135deg, #e07a9e, #2f8f8a) !important; border-color: #2f8f8a !important; color: #fff !important; }
.dock .dockbtn { border-radius: 999px !important; }
#projBtn { background: linear-gradient(135deg, #b39ddb, #8e6cc0) !important; border-color: #8e6cc0 !important; }
#buildBtn { background: linear-gradient(135deg, #ffb3c8, #6cc3bd) !important; border-color: #6cc3bd !important; color: #5a2340 !important; font-weight: 800; }
#buildBtn.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6cc3bd; }
.nametag { border-radius: 999px; }
.gsteps li { border-radius: 14px; }
#ilist { display: none !important; } /* 설치된 인터랙티브 미디어 작품 알림창은 쓰지 않음 */

/* 꾸미기 창 (아래쪽 카탈로그) */
.build { position: fixed; left: 50%; bottom: calc(var(--bh, 40px) + 22px); transform: translateX(-50%); z-index: 8; width: min(760px, calc(100vw - 16px));
  max-height: min(46vh, 380px); display: flex; flex-direction: column; background: rgba(255,250,252,.97); border: 1px solid #d3ebe7; border-radius: 20px;
  box-shadow: 0 14px 40px rgba(74,47,63,.35); overflow: hidden; }
.bhead { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px 12px; }
.btabs { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.btabs button { border: 0; border-radius: 999px; padding: 7px 16px; background: #fbe8ef; color: #2f3e5c; font-weight: 700; white-space: nowrap; }
.btabs button.on { background: #2f8f8a; color: #fff; }
.bclose { border: 0; background: transparent; font-size: 18px; color: #a07088; padding: 4px 10px; }
.bpane { padding: 0 12px 12px; overflow-y: auto; min-height: 0; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; }
.chip { flex: none; border: 1px solid #cde7e3; border-radius: 999px; padding: 5px 12px; background: #fff; color: #3f5f6e; font-size: 13.5px; white-space: nowrap; }
.chip.on { background: #dff1ee; border-color: #5fb8b2; color: #26706c; font-weight: 700; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.bcard { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 8px; border: 1px solid #f3dce5; border-radius: 14px; background: #fff; color: var(--ink); text-align: center; min-height: 118px; }
.bcard:hover { border-color: #5fb8b2; box-shadow: 0 4px 12px rgba(47,143,138,.15); }
.bcard img { width: 76px; height: 76px; object-fit: contain; border-radius: 10px; background: #eef7f6; }
.bcard.sw img { width: 100%; height: 64px; object-fit: cover; }
.bcard.on { border-color: #2f8f8a; box-shadow: 0 0 0 2px #2f8f8a inset; }
.bcard b { font-size: 12.5px; font-weight: 700; line-height: 1.25; word-break: keep-all; }
.bcard small { font-size: 11px; color: var(--sub); }
.bcard.add { justify-content: center; border-style: dashed; border-color: #5fb8b2; background: #fff5f8; color: #26706c; }
.bcard.add .plus { font-size: 28px; line-height: 1; }
.aitag { position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 800; color: #fff; background: #b39ddb; border-radius: 6px; padding: 1px 5px; }
.bdel { position: absolute; top: 4px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #a07088; background: #dff1ee; font-size: 15px; }
.bdel:hover { background: #f8c7d7; color: #7a2e50; }
.bhint { margin: 8px 2px 0; font-size: 13px; color: var(--sub); }
.wallbtns { display: flex; gap: 8px; }
.wallbtns button { flex: 1; height: 44px; border-radius: 14px; border: 1px solid #cde7e3; background: #fff; color: #2f3e5c; font-weight: 700; }
.wallbtns button.on { background: #2f8f8a; border-color: #2f8f8a; color: #fff; }
@media (max-width: 520px) {
  .build { bottom: calc(var(--bh, 38px) + 16px); max-height: 50vh; border-radius: 16px; }
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .bcard img { width: 62px; height: 62px; }
  .btabs button { padding: 6px 12px; }
}

/* 휴대폰: 영어·필리핀어는 아래 버튼 이름도 더 짧게 */
@media (max-width: 520px) { html:not([lang=ko]) .dock [data-mshort]::before { content: attr(data-mshort); } }
@media (max-width: 400px) { .dock { gap: 3px !important; } .dock > .dockbtn, .dock > .popwrap > .dockbtn, .dock .acts summary { padding: 0 8px !important; } }
@media (max-width: 400px) { html:not([lang=ko]) .dock [data-mshort]::before, html:not([lang=ko]) #chatBtn { font-size: 13.5px !important; } html:not([lang=ko]) .dock > .dockbtn, html:not([lang=ko]) .dock > .popwrap > .dockbtn, html:not([lang=ko]) .dock .acts summary { padding: 0 7px !important; } }

/* 유튜브 층: 3D 화면 뒤(화면 자리만 뚫려 보임) */

#css3d { position: fixed !important; inset: 0; pointer-events: none; overflow: hidden; } /* 3D 캔버스보다 앞(DOM 순서)이라 캔버스 아래에 그려짐 */
#css3d * { pointer-events: none; }
.ytwrap { width: 1280px; height: 720px; background: #000; }
.ytwrap iframe { width: 1280px; height: 720px; border: 0; display: block; }
.ytrow { display: flex; gap: 6px; margin: 4px 0 10px; }
.ytrow input { flex: 1; min-width: 0; }
.ytrow button { white-space: nowrap; }
.wallbtns { flex-wrap: wrap; }
#wallTurn { margin-top: 8px; }
@media (max-width: 520px) { #projMenu { position: fixed !important; left: 8px !important; right: 8px !important; bottom: calc(var(--bh, 38px) + 22px) !important; transform: none !important; width: auto !important; } #projMenu .dockbtn.twoline small { max-width: none !important; } }
/* 영어·필리핀어: 중간 폭(태블릿·작은 노트북)에서도 위 메뉴가 한 줄에 */
@media (max-width: 1200px) { html:not([lang=ko]) .bar .seg [data-mshort] { font-size: 0 !important; } html:not([lang=ko]) .bar .seg [data-mshort]::before { content: attr(data-mshort); font-size: 14px; } }
.brand, #qBtn, #authBtn, .who { white-space: nowrap; }

#inTvWrap { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; font-size: 14px; color: var(--ink); cursor: pointer; }
#inTvWrap input { width: 18px; height: 18px; margin: 0; accent-color: #2f8f8a; }

/* 대화 번역 줄 */
.chatlog li .chattr { display: block; margin: 1px 0 2px 0; padding-left: 10px; border-left: 2px solid rgba(255,214,229,.6); font-size: .86em; color: #ffe3ee; opacity: .92; }

/* 가구 생성 창: 화면을 막지 않음(아래 버튼은 계속 누를 수 있게) */
dialog.install { z-index: 30; }
#inTvWrap[hidden] { display: none !important; }
@media (max-width: 520px) { dialog.install { bottom: calc(var(--bh, 38px) + 18px) !important; max-height: calc(100vh - var(--bh, 38px) - 90px) !important; border-radius: 16px !important; } }

/* 말풍선 번역 줄 */
.bubble > span .btr { display: block; margin-top: 3px; padding-top: 3px; border-top: 1px dashed rgba(47,143,138,.35); font-size: .82em; font-weight: 500; color: #3f5f6e; }
.bubble > span { -webkit-line-clamp: 5 !important; }
/* 번역 줄이 붙어 대화가 길어지므로 닫힌 대화창을 조금 더 높게 */
.chat:not(.open) .chatlog { max-height: 180px; }

.bcard.reset { justify-content: center; border-style: dashed; }
.bcard.reset .rsticon { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; border-radius: 10px; background: #eef7f6; font-size: 28px; color: #26706c; }

/* ---- 로그인 화면 언어 버튼: 한 줄에 셋 ---- */
.langseg { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 14px !important; }
.langseg button { white-space: nowrap; padding: 8px 4px !important; font-size: 14px !important; border-radius: 10px !important; }
/* ---- 내 캐릭터 창 ---- */
dialog.lookdlg { width: min(400px, 94vw); }
#lookView { display: block; width: 100%; height: 260px; border-radius: 14px; background: radial-gradient(ellipse at 50% 30%, #fff6fa, #f6dde6); }
.lktabs { display: flex; gap: 4px; margin: 10px 0 6px; }
.lookpane h3 { margin: 12px 0 6px; font-size: 13.5px; color: var(--sub); font-weight: 700; }
.lkopts { display: flex; flex-wrap: wrap; gap: 6px; }
.lkcolors { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lkc { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #e6cbd6; }
.lkc.on { box-shadow: 0 0 0 2px #2f8f8a; }
.lkrange { display: flex; align-items: center; gap: 10px; }
.lkrange input { flex: 1; accent-color: #2f8f8a; padding: 0; border: 0; }
.lkrange span { min-width: 52px; text-align: right; font-weight: 700; color: #2f3e5c; }
.lkphoto span { font-size: 13.5px; }
#who { cursor: pointer; }
@media (max-width: 520px) { #lookView { height: 200px; } }

/* 벽 누르기 메뉴 */
.wallmenu { flex-direction: column; align-items: stretch; height: auto !important; }
.wallmenu .wmrow { display: flex; gap: 2px; justify-content: center; }
.wallsw { display: grid; grid-template-columns: repeat(4, 34px); gap: 4px; padding: 4px; }
.wallsw button { width: 34px !important; height: 34px !important; padding: 0 !important; border-radius: 8px; overflow: hidden; background: #fff !important; }
.wallsw img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 작품 막대는 화면보다 넓어지지 않게(넘치면 두 줄) */
#workbar { max-width: calc(100vw - 12px); flex-wrap: wrap; justify-content: center; height: auto; }
.langwrap[hidden], .langseg[hidden] { display: none !important; }

/* ================= 석군의 물리 실험실: 남색·청록 실험실 분위기 (2026-11-26, Kate's House 분홍 테마 덮어씀) ================= */
:root { --ink: #1f2a3a; --sub: #5b6878; --line: #d6e3e6; --paper: #f7fafb; --accent: #2f8f8a; }
html, body { background: #101a2a; }
body { background: radial-gradient(ellipse at 48% 18%, #3b5378 0%, #263a5a 38%, #172540 74%, #0e1626 100%) fixed; }
dialog#auth::backdrop, .bootcover { background: radial-gradient(ellipse at 48% 18%, #3b5378 0%, #263a5a 38%, #172540 74%, #0e1626 100%); }
.bootcover span { color: #cfe9e4; }
.bar { background: rgba(247,250,251,.94); border-bottom-color: #d6e3e6; }
.brand { color: #2f3e5c; }
.brand::before { content: "⚛ "; color: #2f8f8a; }
.seg { border-color: #cfdde2; }
dialog, .qmenu, .langmenu { background: #fbfdfd; }
.field, .who { color: #5b6878; }
button.primary, .dock .dockbtn.primary { background: linear-gradient(135deg, #3aa6a0, #2f3e5c) !important; border-color: #2f3e5c !important; }
#projBtn { background: linear-gradient(135deg, #7d9be0, #4a63b5) !important; border-color: #4a63b5 !important; }
#buildBtn { background: linear-gradient(135deg, #f6c85f, #6cc3bd) !important; border-color: #6cc3bd !important; color: #1f2a3a !important; }
.build { background: rgba(251,253,253,.97); box-shadow: 0 14px 40px rgba(20,32,52,.35); }
#lookView { background: radial-gradient(ellipse at 50% 30%, #f4fbfa, #d9ece9); }
.nametag.mine { background: #2f8f8ae6; }
.hpenter { display: block; text-align: center; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #3aa6a0, #2f3e5c); color: #fff; font-weight: 800; text-decoration: none; margin: 4px 0 8px; }
.hpenter:hover { filter: brightness(1.08); }
.hpor { font-size: 12.5px; color: #5b6878; margin: 0 0 10px; text-align: center; }
