/* ==========================================================================
   미니홈피 (2000년대 초중반 · IE 팝업창 안의 바인더 북 + 도트 폰트)
   기준 화면: 2005~2006년 미니홈피 실제 캡처
     - 창: XP 파란 타이틀바 + 상태표시줄
     - 책: 스킨색 표지 + 흰 점선 스티치 → 검정 1px 테두리의 흰 페이지(머리글 포함) → 그 안의 둥근 안쪽 상자
     - 오른쪽에 걸린 세로 탭(영문), 책 밖 오른쪽에 검정 헤더의 정보 패널
   ========================================================================== */

@font-face { font-family: "Galmuri11"; src: url("../assets/fonts/Galmuri11.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Galmuri11"; src: url("../assets/fonts/Galmuri11-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../assets/fonts/silkscreen-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Silkscreen"; src: url("../assets/fonts/silkscreen-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nanum Pen Script"; src: url("../assets/fonts/nanumpen-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --font: "Galmuri11", "Gulim", "굴림", "Dotum", "돋움", sans-serif;
  --ui: "Trebuchet MS", "Galmuri11", "Gulim", sans-serif;
  --px: "Silkscreen", "Galmuri11", monospace;
  --hand: "Nanum Pen Script", "Segoe Script", "Comic Sans MS", cursive;
  --ink: #111;
  --dot: #8a8a8a;
  --bd: #1b2a35;           /* 페이지 테두리(검정에 가까운 남색) */
  --red: #d9382f;
  --xp: #ece9d8;           /* Windows XP 대화상자 바탕 */
  --desk: radial-gradient(130% 62% at 18% 120%, #2f8f1e 0 52%, transparent 53%),
          radial-gradient(120% 56% at 95% 126%, #4faa28 0 50%, transparent 51%),
          radial-gradient(34% 8% at 18% 24%, rgba(255,255,255,.88), transparent 72%),
          radial-gradient(30% 7% at 74% 15%, rgba(255,255,255,.82), transparent 72%),
          radial-gradient(26% 6% at 56% 42%, rgba(255,255,255,.55), transparent 72%),
          linear-gradient(#2a6bd6 0%, #5b9fee 38%, #a8d1f7 66%, #dcecfb 82%, #89c35b 100%);
}

/* ───────── 스킨 팔레트 (Setting 탭에서 바꿀 수 있음) ───────── */
[data-skin="sky"]   { --cover: #4aa9cc; --cover-dk: #2a7ea3; --tab: #2b86b3; --tab-dk: #14597f; --title: #1d4f78; --wall: url("../assets/skins/tile-clouds.png") 0 0 / 192px 128px, url("../assets/skins/tile-stars.png") 24px 36px / 112px 112px, linear-gradient(#6fc0ee, #b8e2f8 60%, #e9f7ff); }
[data-skin="pink"]  { --cover: #ff8fbd; --cover-dk: #d9568e; --tab: #e0508d; --tab-dk: #a83568; --title: #b0306a; --wall: url("../assets/skins/tile-hearts.png") 0 0 / 96px 96px, linear-gradient(90deg, rgba(255,255,255,.42) 50%, transparent 50%) 0 0 / 34px 34px, linear-gradient(rgba(255,255,255,.42) 50%, transparent 50%) 0 0 / 34px 34px, #ffb2d1; }
[data-skin="mint"]  { --cover: #4fcaa6; --cover-dk: #25977a; --tab: #249a7c; --tab-dk: #17705a; --title: #17705a; --wall: url("../assets/skins/tile-stars.png") 0 0 / 112px 112px, linear-gradient(90deg, rgba(255,255,255,.4) 50%, transparent 50%) 0 0 / 34px 34px, linear-gradient(rgba(255,255,255,.4) 50%, transparent 50%) 0 0 / 34px 34px, #8fe0c6; }
[data-skin="grape"] { --cover: #9d83e6; --cover-dk: #6c4fc2; --tab: #6c4fc2; --tab-dk: #4a3294; --title: #4a3294; --wall: url("../assets/skins/tile-stars.png") 0 0 / 112px 112px, url("../assets/skins/tile-hearts.png") 40px 40px / 96px 96px, linear-gradient(160deg, #b9a4f0, #e0c8f6 55%, #ffd3ea); }
[data-skin="lemon"] { --cover: #ffd24a; --cover-dk: #d19a00; --tab: #c98d00; --tab-dk: #946a00; --title: #7a5200; --wall: url("../assets/skins/tile-hearts.png") 0 0 / 96px 96px, radial-gradient(circle, rgba(255,255,255,.65) 0 4px, transparent 5px) 0 0 / 28px 28px, #ffe98a; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 12px/1.65 var(--font); color: var(--ink);
  background: var(--desk) fixed #5b9fee; min-height: 100vh; overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
img.px { image-rendering: crisp-edges; image-rendering: pixelated; }
.px:not(img) { font-family: var(--px); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px dotted #000; outline-offset: 1px; }

/* ───────── Windows XP 창 ───────── */
.desktop { position: relative; z-index: 1; }
.window { display: flex; flex-direction: column; min-height: 100vh; background: #0055ea; }
.titlebar {
  display: flex; align-items: center; gap: 5px; height: 30px; padding: 0 5px 0 6px; flex: none;
  color: #fff; font: 700 13px/1 var(--ui); text-shadow: 1px 1px #0f1089;
  background: linear-gradient(180deg, #0997ff, #0053ee 8%, #0050ee 40%, #06f 88%, #06f 93%, #005bff 95%, #003dd7 96%, #003dd7);
  border-top: 1px solid #0831d9;
}
.tb-ico { flex: none; width: 14px; height: 14px; }
.tb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-btns { display: flex; gap: 2px; flex: none; }
.tb-btns > * {
  position: relative; display: block; width: 21px; height: 21px; padding: 0; border: 1px solid #fff; border-radius: 3px; cursor: default;
  background: radial-gradient(circle at 90% 90%, #0054e9 0, #2263d5 55%, #4479e4 70%, #a3bbec 90%, #fff 100%);
}
.tb-btns > .close { cursor: pointer; background: radial-gradient(circle at 90% 90%, #cc4600 0, #dc6527 55%, #cd7546 70%, #ffccb2 90%, #fff 100%); }
.tb-btns .min::before { content: ""; position: absolute; left: 5px; bottom: 4px; width: 8px; height: 3px; background: #fff; }
.tb-btns .max::before { content: ""; position: absolute; left: 4px; top: 4px; width: 11px; height: 10px; border: 1px solid #fff; border-top-width: 3px; }
.tb-btns .close::before, .tb-btns .close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 2px; margin: -1px 0 0 -5.5px; background: #fff; transform: rotate(45deg); }
.tb-btns .close::after { transform: rotate(-45deg); }
.client { position: relative; flex: 1; background: var(--wall); image-rendering: pixelated; overflow: clip; }   /* clip: 창 밖으로 효과가 새지 않되, hidden 과 달리 sticky(탭·효과)는 유지 */
.fx { position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; overflow: hidden; pointer-events: none; z-index: 0; }
.fx-i { position: absolute; top: -24px; background: center / contain no-repeat; image-rendering: pixelated; opacity: .92; animation: fall linear infinite; will-change: transform; }
@keyframes fall { to { transform: translate3d(var(--dx), 112vh, 0) rotate(var(--rot)); } }
.status { display: flex; align-items: center; height: 22px; flex: none; padding: 0 2px; font: 11px/1 var(--font); color: #000; background: var(--xp); border-top: 1px solid #aca899; }
.st-msg { flex: 1; min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-zone { display: flex; align-items: center; gap: 5px; padding: 0 28px 0 8px; height: 100%; border-left: 1px solid #aca899; }
.globe { width: 13px; height: 13px; border-radius: 50%; border: 1px solid #1b4f93; background: radial-gradient(circle at 35% 30%, #d6f1ff, #3a93e8 50%, #1b5db0 100%); }

/* ───────── 무대 ───────── */
.stage { position: relative; z-index: 1; padding: 8px 4px 22px; }

/* ───────── BGM 줄 ───────── */
.bgm {
  display: flex; align-items: center; gap: 5px; height: 28px; margin: 0 6px 8px 4px; padding: 0 6px;
  background: #fff; border: 1px solid var(--bd); border-radius: 6px; font-size: 11px;
}
.bgm .cd { flex: none; width: 12px; height: 12px; }
.bgm.is-playing .cd { animation: spin 2.6s steps(12) infinite; }
.bgm-lbl { flex: none; font-weight: 700; }
.bgm-marquee { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; color: #333; }
.bgm-marquee > span { display: inline-block; padding-left: 100%; animation: marq 12s linear infinite; }
.bgm:not(.is-playing) .bgm-marquee > span { animation-play-state: paused; padding-left: 0; }
@keyframes marq { to { transform: translateX(-100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
.mbtn { position: relative; flex: none; width: 21px; height: 18px; padding: 0; background: #fff; border: 1px solid #222; border-radius: 4px; cursor: pointer; }
.mbtn::before { content: ""; position: absolute; top: 50%; left: 50%; }
.mbtn.play::before { margin: -4px 0 0 -2px; border-style: solid; border-width: 4px 0 4px 6px; border-color: transparent transparent transparent #111; }
.bgm.is-playing .mbtn.play::before { margin: -4px 0 0 -4px; width: 3px; height: 8px; border: 0; background: #111; box-shadow: 5px 0 0 #111; }
.mbtn.stop::before { margin: -3px 0 0 -3px; width: 6px; height: 6px; background: #111; }
.mbtn.list { width: auto; padding: 0 4px; font: 700 8px/16px var(--px); letter-spacing: .06em; }

/* ───────── 책: 표지 → 흰 베이스 → 두 페이지 ───────── */
.book { position: relative; padding-right: 34px; }
.cover {
  position: relative; padding: 14px 18px 14px 12px;
  background: var(--cover); border: 2px solid var(--cover-dk); border-radius: 20px;
  box-shadow: 0 2px 0 rgba(0,0,0,.2), inset 0 0 0 1px rgba(255,255,255,.4);
}
.cover::before { content: ""; position: absolute; inset: 5px; border: 1px dashed rgba(255,255,255,.95); border-radius: 15px; pointer-events: none; }
.base { position: relative; padding: 8px 8px 10px; background: #fff; border: 2px solid var(--bd); border-radius: 14px; }

/* 머리글 */
.top { position: relative; padding: 2px 4px 8px; }
.counter { display: inline-block; font-size: 8px; line-height: 1; color: #333; }
.counter b { font-weight: 400; color: var(--red); font-size: 8px; }
.counter .c-bar { margin: 0 6px; font-style: normal; color: #777; }
.top-links { position: absolute; right: 4px; top: 0; display: flex; gap: 4px; font-size: 11px; }
.title { margin: 8px 0 0; font: 400 22px/1.25 var(--font); color: var(--title); word-break: keep-all; }
.tag-edit { display: none; margin-left: 6px; padding: 3px 4px 2px; font: 700 8px/1 var(--px); font-style: normal; letter-spacing: .08em; color: #fff; background: #111; border-radius: 2px; vertical-align: 4px; }
.url { margin-top: 3px; font: 10px/1.3 Verdana, Arial, sans-serif; color: #555; }
.bul { position: relative; display: inline-block; margin-right: 6px; padding: 0 0 0 8px; color: #111; text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap; font: inherit; }
.bul::before { content: ""; position: absolute; left: 0; top: 50%; margin-top: -3px; border-left: 4px solid currentColor; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
a.bul:active, button.bul:active { color: var(--title); }

/* ───────── 페이지(= 검정 테두리의 둥근 안쪽 상자) ───────── */
.pages { position: relative; display: flex; flex-direction: column; }
.page { position: relative; background: #fff; border: 1px solid var(--bd); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #dfe4e8; }
.page-left { margin-bottom: 14px; padding: 10px 10px 22px; border-radius: 14px 14px 7px 7px; display: grid; gap: 8px; grid-template-areas: "photo" "mood" "caption" "history"; align-content: start; }
.page-right { padding: 22px 12px 18px; min-height: 360px; border-radius: 7px 7px 14px 14px; }

/* 링: 양 끝이 고리로 감긴 쇠 막대 */
.rings { height: 0; margin: -14px 0 14px; position: relative; z-index: 2; pointer-events: none; }
.rings i { position: absolute; top: 1px; width: 38px; height: 11px; margin: 0; border-radius: 6px; border: 1px solid #222; background: linear-gradient(#f2f2f2, #b3b3b3 55%, #8d8d8d); box-shadow: inset 0 0 0 1px rgba(255,255,255,.8); transform: rotate(90deg); }
.rings i::before, .rings i::after { content: ""; position: absolute; top: -1px; width: 10px; height: 11px; background: #fff; border: 1px solid #222; border-radius: 50%; }
.rings i::before { left: -6px; }
.rings i::after { right: -6px; }
.rings i:nth-child(1) { left: calc(17% - 19px); }
.rings i:nth-child(2) { left: calc(24% - 19px); }
.rings i:nth-child(3) { left: calc(76% - 19px); }
.rings i:nth-child(4) { left: calc(83% - 19px); }

/* ───────── 왼쪽 페이지 ───────── */
.photo { position: relative; grid-area: photo; justify-self: center; width: min(100%, 226px); margin: 0; padding: 4px; background: #fff; border: 1px solid #333; border-radius: 4px; box-shadow: 2px 2px 0 rgba(0,0,0,.14); }
.photo img:first-child { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 30%; background: #e9eef1; }
.sticker { position: absolute; right: -8px; top: -9px; width: 23px; height: 23px; }
.mood { grid-area: mood; display: flex; align-items: center; gap: 5px; white-space: nowrap; padding: 3px 9px 3px 8px; min-height: 22px; border: 1px solid #222; border-radius: 12px; background: #fff; }
.mood .lbl { font-size: 8px; font-weight: 700; color: #111; letter-spacing: .04em; }
.mood .ico-heart { width: 7px; height: 8px; }
.mood-txt { font-size: 12px; white-space: nowrap; }
.caption { grid-area: caption; margin: 0; text-align: center; font-size: 12px; line-height: 1.6; white-space: pre-line; }
.history { grid-area: history; margin-top: 4px; }
.hist-h { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; padding-bottom: 4px; border-bottom: 1px dotted #222; font: 700 8px/1 var(--px); letter-spacing: .06em; }
.hist-l a { margin-right: 8px; }
.hist-arrows { font-size: 10px; letter-spacing: 0; }
.hist-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.hist-who b { font-weight: 700; }
.sx { display: inline-block; width: 14px; height: 14px; border: 1px solid #222; border-radius: 4px; text-align: center; font: 700 10px/12px Arial, sans-serif; }
.hist-date { margin: 2px 0 0; white-space: nowrap; }
.hist-date b { font-weight: 700; letter-spacing: .01em; }
.plus { margin-left: 2px; color: #444; }
.hist-place { margin: 3px 0 0; font-size: 11px; color: #333; }
.jump {
  width: 100%; height: 26px; margin-top: 8px; padding: 0 24px 0 6px; font: inherit; font-size: 11px; color: #111; border-radius: 0;
  -webkit-appearance: none; appearance: none; background: #b9b9b9 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20'><rect x='1' y='2' width='17' height='15' fill='white' stroke='black' stroke-width='2'/><path d='M5 8h9l-4.500 5z' fill='black'/></svg>") right 2px center / 18px 18px no-repeat;
  border: 2px solid #111;
}
.quick { display: flex; gap: 5px; margin-top: 8px; }
.quick-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px 4px; background: linear-gradient(#fafafa, #dcdcdc); border: 1px solid #333; border-radius: 4px; cursor: pointer; }
.quick-btn:active { background: #cfcfcf; }
.quick-ico { height: 28px; display: flex; align-items: center; justify-content: center; }
.quick-ico img { width: auto; height: auto; transform: scale(1.5); }
.quick-lbl { font-size: 10px; letter-spacing: -.02em; white-space: nowrap; }

/* ───────── 오른쪽 페이지 공통 ───────── */
.panel { animation: pageIn .18s steps(3); }
@keyframes pageIn { from { opacity: 0; } }
.hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 6px; padding-bottom: 3px; border-bottom: 1px solid #bdbdbd; font-size: 12px; font-weight: 400; }
.hd b { font-weight: 700; white-space: nowrap; }
.hd small { margin-left: 6px; font: 8px var(--px); letter-spacing: .08em; text-transform: uppercase; color: #333; white-space: nowrap; }
.hd > a { font-size: 11px; margin-right: 0; }
.sub { margin: 14px 0 6px; font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.sub small { font: 8px var(--px); letter-spacing: .1em; font-weight: 400; color: #444; }
.bul-s { width: 5px; height: 5px; background: #111; }
.hint { margin: 6px 0; color: #555; font-size: 11px; }

/* Home */
.news { margin: 0; padding: 0; list-style: none; }
.news li { position: relative; padding: 2px 0 2px 9px; line-height: 1.6; }
.news li::before { content: ""; position: absolute; left: 0; top: 9px; width: 3px; height: 3px; background: #777; }
.news a { color: #111; text-decoration: none; }
.news a:active { color: var(--title); }
.news .n { display: inline-block; vertical-align: -1px; margin-left: 3px; }
.cnt { width: 100%; margin: 8px 0 0; border-collapse: collapse; }
.cnt td { padding: 4px 6px; border: 1px solid #b0b0b0; white-space: nowrap; cursor: pointer; }
.cnt td small { margin-left: 2px; font-size: 9px; color: #222; letter-spacing: -.03em; }
.cnt td img { display: inline-block; vertical-align: -1px; margin-left: 2px; width: 9px; height: 9px; }
.hd-room { flex-wrap: wrap; margin-top: 16px; }
.room-title { margin-left: auto; font-size: 12px; max-width: 100%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-frame { position: relative; aspect-ratio: 352 / 192; overflow: hidden; background: #dfeef3; border: 1px solid #777; }
.room-view { position: absolute; inset: 0; }
.room-view > img.room-bg { width: 100%; height: 100%; }
/* 미니룸 속 신랑·신부: 방 그림(352x192)과 같은 도트 크기. 위치는 tools/gen_room.py 의 GROOM_FEET / BRIDE_FEET 기준 % */
.mm { position: absolute; width: 7.670%; aspect-ratio: 27 / 55; background: 0 0 / 300% 100% no-repeat; image-rendering: crisp-edges; image-rendering: pixelated; animation: idlep 3.6s step-end infinite; }
.mm-groom { left: 53.13%; top: 54.69%; }
.mm-bride { left: 66.19%; top: 55.73%; animation-delay: -1.3s; }
@keyframes idlep { 0%, 100% { background-position-x: 0%; } 38% { background-position-x: 50%; } 72% { background-position-x: 0%; } 88% { background-position-x: 100%; } 93% { background-position-x: 0%; } }
/* 미니미(26x49, 3프레임: 기본/숨쉬기/눈깜빡임) — 목록·선택창·프로필용. 그림은 요소의 인라인 background-image 로 지정(문서 기준 경로). --s: 정수 배율, --rows/--i: 시트 행 수/행 번호 */
.mi { display: inline-block; flex: none; --s: 1; --rows: 1; --i: 0; width: calc(27px * var(--s)); height: calc(55px * var(--s));
  background: 0 calc(var(--i) * -55px * var(--s)) / calc(81px * var(--s)) calc(55px * var(--s) * var(--rows)) no-repeat; image-rendering: crisp-edges; image-rendering: pixelated;
  animation: idle 3.6s step-end infinite; animation-delay: calc(var(--i) * -.55s); }
@keyframes idle { 0%, 100% { background-position-x: 0; } 38% { background-position-x: calc(27px * var(--s) * -1); } 72% { background-position-x: 0; } 88% { background-position-x: calc(27px * var(--s) * -2); } 93% { background-position-x: 0; } }
.mm-bubble { position: absolute; left: 60%; top: 28%; transform: translateX(-50%); padding: 2px 8px; font-size: 11px; font-weight: 700; color: #222; white-space: nowrap; background: #fff; border: 1px solid #222; border-radius: 8px; transition: opacity .25s; }
.mm-bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 6px; height: 6px; margin-left: -3px; background: #fff; border-right: 1px solid #222; border-bottom: 1px solid #222; transform: rotate(45deg); }
.mm-bubble.off { opacity: 0; }
.room-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 8px; margin: 6px 0 14px; font-size: 11px; }
.room-links .bul.on { font-weight: 700; text-decoration: underline; }
.room-count { color: #333; white-space: nowrap; }
.room-life { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: linear-gradient(#fff7ee, #ffe8ec); }
.life-lbl { margin: 0; font-size: 8px; color: #4a7d92; }
.life-dday { margin: 4px 0 2px; font-size: 32px; line-height: 1; color: #ef6c8f; text-shadow: 2px 2px 0 #fff, 3px 3px 0 #f6c3d1; letter-spacing: .02em; }
.life-count { margin: 6px 0 0; font-weight: 700; }
.life-sub { margin: 2px 0 0; font-size: 11px; color: #777; }
.room-story { overflow: auto; background: #fffdf7; }
.story { margin: 0; padding: 6px 10px 6px 14px; list-style: none; position: relative; }
.story::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; border-left: 1px dashed #aab; }
.story li { position: relative; padding: 2px 0 2px 18px; line-height: 1.35; }
.story li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; background: #ef8aa4; border: 1px solid #b04f6e; }
.story b { display: block; font-size: 10.5px; color: var(--title); }
.hd-friends { flex-wrap: wrap; margin-top: 4px; }
.hd-friends > span { flex: 1 1 auto; min-width: 0; }
.hd-friends > a { flex: none; }
.hd-friends small { font: 11px var(--font); letter-spacing: 0; text-transform: none; color: #333; }
.ilchon-form { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 4px; margin: 6px 0 4px; }
.ilchon-list { margin: 0; padding: 0; list-style: none; }
.ilchon-list li { position: relative; padding: 4px 0 4px 10px; border-bottom: 1px dotted #aaa; line-height: 1.55; word-break: break-word; }
.ilchon-list li::before { content: "-"; position: absolute; left: 0; }
.ilchon-list .who { color: #335; font-size: 11px; white-space: nowrap; }
.ilchon-list .dt { margin-left: 4px; color: #888; font-size: 10px; }
.empty { padding: 14px 0; text-align: center; color: #888; }

/* Profile */
.prof { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px dotted var(--dot); }
.prof:last-child { border-bottom: 0; }
.prof-ava { height: 132px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; background: linear-gradient(#eef7fb, #fff 70%, #f6e3e8 70%); border: 1px solid #333; border-radius: 4px; }
.prof h3 { margin: 0 0 4px; font-size: 13px; }
.prof h3 small { margin-left: 4px; font-size: 11px; color: #555; font-weight: 400; }
.prof dl { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 2px 6px; margin: 0; }
.prof dt { color: #4a6a85; }
.prof dd { margin: 0; word-break: keep-all; }
.prof .btns { display: flex; gap: 4px; margin-top: 8px; }

/* Diary */
.cal-wrap { margin: 6px 0 14px; }
.calendar { border: 1px solid #333; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px; font-weight: 700; background: linear-gradient(#f4f4f4, #dedede); border-bottom: 1px solid #333; }
.cal-head .px { font-size: 8px; font-weight: 400; color: #333; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; padding: 3px 4px 6px; }
.cal-grid span { position: relative; height: 30px; display: flex; align-items: center; justify-content: center; }
.cal-grid .dow { height: 22px; font-size: 11px; color: #555; }
.cal-grid .sun { color: #d9382f; }
.cal-grid .sat { color: #2a62c4; }
.cal-grid .wd { color: #fff; font-weight: 700; }
.cal-grid .wd::before { content: ""; position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #ef6c8f; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #222; }
.cal-grid .wd b { position: relative; font-weight: 700; }
.cal-grid .wd img { position: absolute; top: -1px; right: 1px; width: 7px; height: 8px; }
.cal-foot { padding: 5px; text-align: center; border-top: 1px dotted #888; }
.diary-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; background: #ececec; border-top: 1px solid #333; border-bottom: 1px solid #333; font-size: 11px; }
.diary-title { margin: 12px 0 10px; font-size: 13px; font-weight: 700; color: var(--title); line-height: 1.45; }
.diary p { margin: 0 0 12px; white-space: pre-line; word-break: keep-all; }
.diary .sign { margin-top: 16px; padding-top: 10px; border-top: 1px dotted var(--dot); }
.diary .sign p { margin: 0 0 3px; }
.info-box { margin: 14px 0 0; padding: 9px 11px; background: #f7f7f7; border: 1px solid #333; }
.info-box dl { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 3px 8px; margin: 0; }
.info-box dt { color: #4a6a85; }
.info-box dd { margin: 0; }
.info-box .btns { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }

/* Photo */
.folder-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #f2f2f2; border: 1px solid #333; }
.folder-row .cnt-n { color: #c24a00; }
.folder-row .btn { margin-left: auto; }
.photo-grid { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 7px; }
.photo-grid li { min-width: 0; }
.photo-grid li.wide { grid-column: span 2; }
.photo-grid button { display: block; width: 100%; height: 100%; padding: 3px; background: #fff; border: 1px solid #333; cursor: pointer; box-shadow: 2px 2px 0 rgba(0,0,0,.14); }
.photo-grid img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; background: #e9eef1; }
.photo-grid li.wide img { aspect-ratio: auto; height: calc(100% - 32px); min-height: 0; }
.photo-grid .cap { margin-top: 3px; font-size: 10px; line-height: 1.3; text-align: center; word-break: keep-all; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.photo-grid .no { color: #c24a00; margin-right: 3px; }

/* Board */
.board { width: 100%; border-collapse: collapse; }
.board th { padding: 4px; font-weight: 400; text-align: center; background: linear-gradient(#f4f4f4, #dcdcdc); border-top: 1px solid #333; border-bottom: 1px solid #333; }
.board td { padding: 8px 4px; border-bottom: 1px dotted var(--dot); }
.board .c-no { width: 34px; text-align: center; color: #666; }
.board .c-dt { width: 50px; text-align: center; color: #666; font-size: 11px; }
.board .post-t { color: #111; text-decoration: none; cursor: pointer; }
.board .post-t .nt { margin-right: 4px; color: var(--red); font-weight: 700; }
.board .post-t img { display: inline-block; vertical-align: -1px; margin-left: 3px; width: 9px; height: 9px; }
.board tr.open .post-t { color: var(--title); font-weight: 700; }
.board .post-body td { padding: 12px 10px 14px; background: #fafafa; border-bottom: 1px solid #333; }
.post-body h4 { margin: 12px 0 4px; font-size: 12px; color: var(--title); }
.post-body h4:first-child { margin-top: 0; }
.post-body p { margin: 0 0 6px; word-break: keep-all; }
.post-body dl { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 3px 8px; margin: 0; }
.post-body dt { color: #4a6a85; }
.post-body dd { margin: 0; }
.post-body .btns { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.map-box { margin: 8px 0; border: 1px solid #333; background: #eef4f6; }
.map-box iframe { display: block; width: 100%; height: 190px; border: 0; }
.contact-row { display: flex; align-items: center; gap: 5px; padding: 6px 0; border-bottom: 1px dotted var(--dot); }
.contact-row:last-child { border-bottom: 0; }
.contact-row .who { flex: 1; min-width: 0; line-height: 1.35; }
.contact-row .who small { display: block; color: #4a6a85; font-size: 10px; }
.contact-row .who b { font-weight: 700; white-space: nowrap; }
.contact-row .btn { flex: none; padding: 5px 9px; }

/* Visitor */
.guest-form { padding: 8px; background: #f4f4f4; border: 1px solid #333; }
.avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding-bottom: 7px; }
.avatars button { min-width: 0; overflow: hidden; height: 66px; padding: 0; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #888; border-radius: 3px; cursor: pointer; }
.avatars button[aria-checked="true"] { border-color: #111; box-shadow: inset 0 0 0 1px #111; background: #fff6d6; }
@media (max-width: 359px) { .avatars { grid-template-columns: repeat(4, minmax(0, 1fr)); } }   /* 아주 좁은 폰: 미니미 16종을 4열로 (27px 폭이 잘리지 않게) */
.guest-fields { display: grid; gap: 5px; }
.guest-fields .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.guest-fields textarea { resize: none; }
.guest-btns { display: flex; align-items: center; justify-content: space-between; }
.guest-btns .len { font-size: 8px; color: #555; }
.guest-count { margin: 12px 0 6px; }
.guest-count b { color: #c24a00; }
.guest-list { margin: 0; padding: 0; list-style: none; }
.guest-item { margin-bottom: 10px; background: #fff; border: 1px solid #333; }
.guest-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 1px 6px; padding: 4px 8px; background: #e4e4e4; border-bottom: 1px solid #333; font-size: 11px; }
.guest-hd .no { font-family: var(--px); font-size: 8px; color: #c24a00; }
.guest-hd b { font-weight: 700; white-space: nowrap; }
.guest-hd .tag { color: #335; }
.guest-hd .dt { margin-left: auto; color: #555; font-size: 10px; white-space: nowrap; }
.guest-hd .del { padding: 0 3px; border: 0; background: none; color: #777; cursor: pointer; }
.guest-bd { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 8px; }
.guest-ava { width: 56px; height: 68px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 5px; background: linear-gradient(#fafafa 74%, #f1f1f1 74%); border: 1px solid #555; }
.guest-msg { white-space: pre-wrap; word-break: break-word; }
.guest-reply { margin: 0 8px 8px; padding: 6px 9px; background: #f1f1f1; border: 1px solid #aaa; }
.guest-reply b { color: #c24a00; }

/* Setting */
.skins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.skin-chip { padding: 4px 3px 3px; text-align: center; font-size: 10px; background: #fff; border: 1px solid #333; border-radius: 4px; cursor: pointer; }
.skin-chip i { display: block; height: 26px; margin-bottom: 3px; border: 1px solid rgba(0,0,0,.4); border-radius: 3px; background: var(--cv); }
.skin-chip[aria-checked="true"] { outline: 2px solid #111; outline-offset: 1px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 4px 10px; background: linear-gradient(#fff, #ddd); border: 1px solid #333; border-radius: 4px; cursor: pointer; }
.chip[aria-checked="true"] { background: #111; color: #fff; }
.juke { margin: 0; padding: 0; list-style: none; border-top: 1px solid #333; }
.juke li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px dotted var(--dot); cursor: pointer; }
.juke .no { width: 16px; text-align: center; color: #666; }
.juke .nm { flex: 1; min-width: 0; }
.juke .nm b { display: block; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.juke .nm small { color: #666; font-size: 10px; }
.juke li.now .nm b { font-weight: 700; color: #c24a00; }
.juke img { width: 10px; height: 13px; visibility: hidden; }
.juke li.now img { visibility: visible; }
.vol-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.vol-row label { flex: 1; display: flex; align-items: center; gap: 6px; }
.vol-row input { flex: 1; min-width: 0; accent-color: #111; }

/* ───────── 오른쪽에 걸린 세로 탭 (영어 라벨, 흰 선으로 구분) ───────── */
.tabs-rail { position: absolute; top: 0; bottom: 0; right: 0; width: 52px; pointer-events: none; z-index: 5; }
.tabs { position: sticky; top: 8px; margin-top: 66px; display: flex; flex-direction: column; pointer-events: auto; }
.tab {
  position: relative; width: 52px; height: 29px; padding: 1px 3px 0 0; cursor: pointer; white-space: nowrap; text-align: center;
  font: 11px/27px var(--font); letter-spacing: -.08em; color: #fff;
  background: var(--tab); border: 0; border-top: 2px solid #fff; border-radius: 0 10px 10px 0;
  box-shadow: inset -1px -1px 0 rgba(0,0,0,.25), 1px 1px 0 rgba(0,0,0,.3);
}
.tab:first-child { border-top-color: transparent; }
.tab:active { filter: brightness(.92); }
.tab[aria-selected="true"] { width: 54px; margin-left: -2px; padding-left: 0; color: #111; font-weight: 700; background: #fff; border: 1px solid var(--bd); border-left: 0; box-shadow: 1px 1px 0 rgba(0,0,0,.3); }

/* ───────── 책 밖 오른쪽 패널 ───────── */
.side { margin: 12px 6px 0 4px; }
.side-hd { padding: 7px 10px 6px; font-weight: 700; font-size: 9px; line-height: 1; letter-spacing: .14em; text-align: center; color: #fff; background: #111; border-radius: 8px 8px 0 0; }
.side-bd { padding: 8px 10px 6px; background: #fff; border: 1px solid #111; border-top: 0; }
.meter { margin: 0 0 4px; padding: 0; list-style: none; }
.meter li { display: grid; grid-template-columns: 38px minmax(0, 1fr) 16px 28px; align-items: center; gap: 5px; height: 20px; }
.meter .bar { height: 7px; background: #bdbdbd; }
.meter .bar i { display: block; height: 100%; background: #444; }
.meter .ic { width: 15px; height: 15px; border: 1px solid #888; border-radius: 2px; font: 700 10px/13px Arial, sans-serif; text-align: center; background: #fff; }
.meter .val { font-size: 11px; }
.side-line { margin: 0; padding: 4px 0; line-height: 1.5; }
.side-dot { border-top: 1px dotted var(--dot); border-bottom: 1px dotted var(--dot); }
.side-line a { text-decoration: none; }
.side-btns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 4px; margin-top: 5px; }
.side-btns .btn { padding: 5px 2px; font-size: 11px; }

.foot { margin-top: 8px; text-align: center; color: #fff; }
.hand { margin: 4px 0 0; font: 34px/1.1 var(--hand); color: #fff; transform: rotate(-2deg);
  text-shadow: -2px 0 var(--cover-dk), 2px 0 var(--cover-dk), 0 -2px var(--cover-dk), 0 2px var(--cover-dk), -2px -2px var(--cover-dk), 2px -2px var(--cover-dk), -2px 2px var(--cover-dk), 2px 2px var(--cover-dk), 3px 4px 0 rgba(0,0,0,.18); }
.copy { margin: 6px 0 0; font-size: 10px; white-space: pre-line; color: #fff; text-shadow: 1px 0 var(--cover-dk), -1px 0 var(--cover-dk), 0 1px var(--cover-dk), 0 -1px var(--cover-dk); }

/* ───────── 공통 위젯 ───────── */
.btn { display: inline-block; padding: 5px 11px; line-height: 1.3; text-align: center; text-decoration: none; color: #111; cursor: pointer; background: linear-gradient(#fafafa, #cdcdcd); border: 1px solid #222; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.btn:active { background: linear-gradient(#cdcdcd, #e9e9e9); }
.btn-sm { padding: 4px 9px; font-size: 11px; }
.btn-lg { padding: 8px 22px; font-size: 13px; font-weight: 700; }
.btn[disabled] { opacity: .5; cursor: default; }
input[type="text"], input[type="tel"], select, textarea {
  width: 100%; min-width: 0; padding: 4px 6px; font: inherit; color: #111; background: #fff; border-radius: 0;
  border: 1px solid #555; box-shadow: inset 1px 1px 0 #bbb;
}
select { width: auto; padding: 3px 2px; }
input[type="radio"], input[type="checkbox"] { margin: 0 3px 0 0; vertical-align: -2px; accent-color: #0a56e8; }
label { cursor: pointer; }

/* 터치 기기: 입력칸을 눌러도 화면이 확대되지 않도록 16px */
@media (pointer: coarse) {
  input[type="text"], input[type="tel"], select, textarea { font-size: 16px; }
  .jump { font-size: 14px; }
}

/* ───────── XP 대화상자 ───────── */
.win { background: #0055ea; padding: 0 3px 3px; border-radius: 8px 8px 0 0; box-shadow: inset -1px -1px #00138c, inset 1px 1px #0831d9, inset -2px -2px #001ea0, inset 2px 2px #166aee, inset -3px -3px #003bda, inset 3px 3px #0855dd, 0 12px 28px rgba(0, 20, 80, .45); }
.win > .titlebar { margin: 0 -3px; border-radius: 8px 8px 0 0; }
.win-body { padding: 12px; background: var(--xp); }
.win .btn { background: linear-gradient(180deg, #fff, #ecebe5 86%, #d8d0c4); border: 1px solid #003c74; border-radius: 3px; box-shadow: none; }
.win .btn:active { background: linear-gradient(180deg, #cdcac3, #e3e3db 8%, #e5e5de 94%, #f2f2f1); }
.win input[type="text"], .win select, .win textarea { border: 1px solid #7f9db9; box-shadow: none; }

.overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(10, 36, 80, .5); }
.dlg { width: min(350px, 100%); max-height: 94vh; overflow: auto; }
.dlg-lead { margin: 0 0 10px; padding: 8px 10px; line-height: 1.6; text-align: center; background: #fff; border: 1px solid #7f9db9; white-space: pre-line; }
.dlg-lead em { color: #d9382f; font-style: normal; font-weight: 700; }
.form-tbl { width: 100%; border-collapse: collapse; }
.form-tbl th { width: 46px; padding: 5px 4px 5px 0; text-align: left; font-weight: 400; vertical-align: middle; }
.form-tbl td { padding: 4px 0; }
.form-tbl label { margin-right: 7px; white-space: nowrap; }
.btns { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.gift-group { margin-bottom: 10px; background: #fff; border: 1px solid #7f9db9; }
.gift-group h4 { margin: 0; padding: 4px 9px; color: #fff; background: linear-gradient(#3a8cf0, #0a56e8); }
.gift-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-top: 1px dotted var(--dot); }
.gift-row:first-of-type { border-top: 0; }
.gift-row .who { flex: 1; min-width: 0; line-height: 1.45; }
.gift-row .who b { font-weight: 700; }
.gift-row .who span { display: block; color: #333; }


.viewer { position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center; padding: 10px; background: rgba(8, 22, 40, .88); }
.viewer-win { width: min(500px, 100%); max-height: 100%; display: flex; flex-direction: column; background: #0055ea; }
.viewer-body { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; background: #0e181d; touch-action: pan-y; }
.viewer-body img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; user-select: none; -webkit-user-drag: none; }
.vnav { position: absolute; top: 50%; width: 30px; height: 46px; margin-top: -23px; padding: 0; font-size: 11px; color: #111; background: rgba(236,233,216,.88); border: 1px solid #003c74; border-radius: 3px; cursor: pointer; }
.vnav.prev { left: 6px; }
.vnav.next { right: 6px; }
.viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--xp); }
.viewer-foot .px { font-size: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(34px + env(safe-area-inset-bottom)); z-index: 300; max-width: 86vw; padding: 6px 12px; text-align: center; color: #000; background: #ffffe1; border: 1px solid #000; box-shadow: 2px 2px 0 rgba(0,0,0,.3); opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .2s steps(3), transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 좁은 화면(휴대폰): 프로필은 홈에서만 크게 ───────── */
@media (max-width: 879px) {
  body:not([data-tab="home"]) .page-left { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "photo mood" "photo caption" "photo history"; column-gap: 10px; row-gap: 5px; padding: 8px 10px 20px; align-items: start; }
  body:not([data-tab="home"]) .photo { width: 64px; padding: 2px; }
  body:not([data-tab="home"]) .photo img:first-child { aspect-ratio: 1; }
  body:not([data-tab="home"]) .sticker { width: 17px; height: 17px; right: -6px; top: -6px; }
  body:not([data-tab="home"]) .caption { text-align: left; font-size: 11px; line-height: 1.4; }
  body:not([data-tab="home"]) .history { margin: 0; }
  body:not([data-tab="home"]) .hist-h, body:not([data-tab="home"]) .hist-who, body:not([data-tab="home"]) .hist-date, body:not([data-tab="home"]) .hist-place, body:not([data-tab="home"]) .jump { display: none; }
  body:not([data-tab="home"]) .quick { margin-top: 0; gap: 4px; }
  body:not([data-tab="home"]) .quick-btn { flex: 1 1 0; min-width: 0; flex-direction: row; justify-content: center; padding: 3px; gap: 2px; }
  body:not([data-tab="home"]) .quick-ico { height: 18px; width: 18px; overflow: hidden; }
  body:not([data-tab="home"]) .quick-ico img { transform: scale(.85); max-width: none; }
  body:not([data-tab="home"]) .quick-lbl { font-size: 9px; }
}
@media (max-width: 360px) {
  .stage { padding-left: 2px; padding-right: 2px; }
  .title { font-size: 20px; }
  .top-links { position: static; justify-content: flex-end; margin-top: 3px; }
  .mood { gap: 4px; padding: 3px 6px; }
  .mood .lbl { font-size: 7px; letter-spacing: .02em; }
  body:not([data-tab="home"]) .quick-lbl { display: none; }
  body:not([data-tab="home"]) .quick-btn { padding: 3px 6px; }
  body:not([data-tab="home"]) .quick-ico { width: 22px; }
}

/* ───────── 넓은 화면(PC): 920×570 팝업 미니홈피처럼 두 페이지를 펼침 ───────── */
@media (min-width: 880px) {
  .desktop { padding: 26px 16px 40px; }
  .window { max-width: 1010px; min-height: 0; margin: 0 auto; padding: 0 0 3px; border-radius: 8px 8px 0 0;
    box-shadow: inset -1px -1px #00138c, inset 1px 1px #0831d9, inset -2px -2px #001ea0, inset 2px 2px #166aee, inset -3px -3px #003bda, inset 3px 3px #0855dd, 0 16px 34px rgba(0, 20, 80, .45); }
  .window > .titlebar { border-radius: 8px 8px 0 0; }
  .client { margin: 0 3px; border: 1px solid #0831d9; }
  .status { margin: 0 3px; }
  .stage { display: grid; grid-template-columns: minmax(0, 1fr) 188px; grid-template-areas: "book bgm" "book side" "book foot"; grid-template-rows: auto auto 1fr; column-gap: 12px; align-items: start; padding: 22px 14px 22px 18px; }
  .book { grid-area: book; padding-right: 36px; }
  .bgm { grid-area: bgm; margin: 6px 0 10px; }
  .side { grid-area: side; margin: 0; }
  .foot { grid-area: foot; align-self: end; margin: 0 0 30px; text-align: left; }
  .hand { font-size: 42px; }
  .cover { padding: 18px 20px 18px 18px; }

  /* 흰 베이스 하나 → 왼쪽/오른쪽 페이지가 각각 머리글을 품은 두 장 */
  .base { display: grid; grid-template-columns: 212px 12px minmax(0, 1fr); grid-template-rows: auto 540px; padding: 0; background: none; border: 0; border-radius: 0; }
  .base::before, .base::after { content: ""; position: absolute; inset: 0; grid-row: 1 / 3; background: #fff; border: 1px solid var(--bd); box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #dfe4e8; }
  .base::before { grid-column: 1; border-radius: 18px 7px 7px 18px; }
  .base::after { grid-column: 3; border-radius: 7px 18px 18px 7px; }
  .top, .pages { display: contents; }
  .top-l, .top-r, .page, .rings { position: relative; z-index: 1; }
  .top-l { grid-column: 1; grid-row: 1; padding: 16px 10px 8px; text-align: center; }
  .top-r { grid-column: 3; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 10px 16px 8px 14px; }
  .tag-edit { display: inline-block; }
  .title { grid-column: 1; grid-row: 1; margin: 0; }
  .top-links { position: static; grid-column: 2; grid-row: 1; align-self: start; justify-content: flex-end; }
  .url { grid-column: 1 / span 2; grid-row: 2; margin: 3px 0 0; }
  .page-left { grid-column: 1; grid-row: 2; margin: 0 8px 8px; padding: 10px 10px 8px; gap: 6px; grid-template-rows: auto auto auto 1fr; border-radius: 14px 7px 7px 14px; overflow: hidden; }
  .page-right { grid-column: 3; grid-row: 2; margin: 0 8px 8px; padding: 12px 14px 16px; min-height: 0; border-radius: 7px 14px 14px 7px; overflow-y: auto; overflow-x: hidden; }
  .history { align-self: end; margin-top: 0; }
  .photo { width: 100%; padding: 3px; }
  .photo img:first-child { aspect-ratio: 1 / 1.08; }
  .caption { font-size: 12px; line-height: 1.45; }
  .quick { margin-top: 6px; }
  .quick-ico { height: 22px; }
  .quick-ico img { transform: scale(1.25); }
  .quick-btn { padding: 4px 2px 3px; }
  .quick-lbl { font-size: 9.5px; letter-spacing: -.06em; }
  .rings { grid-column: 2; grid-row: 1 / 3; height: auto; margin: 0; z-index: 3; }
  .rings i { left: 50% !important; right: auto; transform: translateX(-50%); }
  .rings i:nth-child(1) { top: 20%; }
  .rings i:nth-child(2) { top: 24.5%; }
  .rings i:nth-child(3) { top: 74%; }
  .rings i:nth-child(4) { top: 78.5%; }

  .tabs-rail { width: 56px; }
  .tabs { position: static; margin-top: 64px; }
  .tab { width: 56px; height: 29px; }
  .tab[aria-selected="true"] { width: 58px; }

  .home-top { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 12px; align-items: start; }
  .cnt { margin-top: 26px; }
  .cnt td { padding: 4px 4px; font-size: 11px; }
  .page-right::-webkit-scrollbar { width: 16px; }
  .page-right::-webkit-scrollbar-track { background: #f2f2f2; border-left: 1px solid #d0d0d0; }
  .page-right::-webkit-scrollbar-thumb { background: #e3e3e3; border: 1px solid #8e8e8e; border-radius: 2px; }
  .page-right::-webkit-scrollbar-button { display: block; height: 16px; background: #e9e9e9; border: 1px solid #9a9a9a; }
  .page-right { scrollbar-width: auto; scrollbar-color: #d6d6d6 #f2f2f2; }
}

/* ───────── 화면 보기: 모바일 ↔ PC(축소 보기) ─────────
   기본은 모바일 화면. 휴대폰에서 "PC 화면으로 보기"를 고르면 <head> 스크립트가 뷰포트를 1000px 로 넓혀
   위의 min-width:880px 규칙(두 페이지 펼침)이 그대로 적용되고 브라우저가 화면 폭에 맞게 줄여 보여 준다(html.pcview). */
.pc-bar { display: none; }
.view-sw { display: none; margin: 10px 0 0; }
.view-sw .btn { font-size: 12px; }
@media (max-width: 879px) {
  html:not(.pcview) .view-sw { display: block; }
  html:not(.pcview) .tb-btns .max { cursor: pointer; }
}
/* 돌아가기 줄은 축소 배율(--bz = 레이아웃 폭 ÷ 기기 폭)만큼 키워서, 어떤 기기에서도 화면에서는 보통 크기(14px 글자)로 보이게 한다 */
.pcview { --bz: 2.5; }
.pcview .pc-bar { display: flex; align-items: center; justify-content: space-between; gap: calc(10px * var(--bz)); padding: calc(6px * var(--bz)) calc(10px * var(--bz)); font-size: calc(14px * var(--bz)); line-height: 1.35; color: #000; background: #ffffe1; border-bottom: calc(1px * var(--bz)) solid #000; }
.pc-bar-btn { flex: none; padding: calc(5px * var(--bz)) calc(12px * var(--bz)); font: inherit; font-weight: 700; color: #000; cursor: pointer; background: linear-gradient(#fafafa, #cdcdcd); border: calc(1px * var(--bz)) solid #222; border-radius: calc(4px * var(--bz)); box-shadow: inset 0 0 0 calc(1px * var(--bz)) rgba(255,255,255,.7); }
.pc-bar-btn:active { background: linear-gradient(#cdcdcd, #e9e9e9); }
/* 축소된 화면에서는 팝업·토스트도 같이 작아지므로 js/app.js 의 fitPopups 가 정한 값(보이는 영역 + 배율)으로 원래 크기로 띄운다 */
.pcview { --pz: 2.5; --vx: 0px; --vy: 0px; --vw: 100vw; --vh: 100vh; }
.pcview .overlay, .pcview .viewer { position: absolute; inset: auto; left: var(--vx); top: var(--vy); width: var(--vw); height: var(--vh); padding: calc(12px * var(--pz)); }
.pcview .dlg, .pcview .viewer-win { zoom: var(--pz); }
.pcview .dlg { max-height: calc(var(--vh) * .94 / var(--pz)); }
.pcview .viewer-body img { max-height: calc(var(--vh) / var(--pz) - 160px); }
.pcview .toast { position: absolute; left: calc(var(--vx) + var(--vw) / 2); top: calc(var(--vy) + var(--vh) - 34px * var(--pz)); bottom: auto; max-width: calc(var(--vw) * .86); padding: calc(6px * var(--pz)) calc(12px * var(--pz)); font-size: calc(13px * var(--pz)); transform: translate(-50%, calc(-100% + 10px)); }
.pcview .toast.on { transform: translate(-50%, -100%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .bgm-marquee > span { padding-left: 0; }
  .fx { display: none; }
}
