/* 호그와트 — 낡은 양피지와 참나무 책상.
   레이아웃(2:1 PC): 맨 위 시계·점수 띠 → 캐릭터 띠(가로) → [기능 패널 | 장소 채팅 | 지도] 3단. 페이지 스크롤 없음.
   가독성: 양피지 바탕 위 철담즙 잉크 — 대비 약 13:1. 요소는 작게, 배치는 가로로. */
:root {
  color-scheme: light;
  --oak: #1d1510;
  --parch: #f0e3c4;
  --parch-2: #e5d3a8;
  --parch-edge: #b8955c;
  --line: rgba(150,110,50,.32);
  --ink: #2a1c11;
  --ink-soft: #6a543c;
  --gilt: #9c7426;
  --gilt-hi: #d9b45a;
  --oxblood: #8a2c22;
  --moss: #3f6b3a;
  --house: #9c7426;
  --display: 'Song Myung', 'Gowun Batang', serif;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --sans: 'IBM Plex Sans KR', system-ui, sans-serif;
  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  --paper-stain: radial-gradient(ellipse 60% 40% at 85% 12%, rgba(150,100,40,.10), transparent 70%),
                 radial-gradient(ellipse 50% 35% at 10% 90%, rgba(140,90,30,.12), transparent 70%);
  --r: 2px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--ink); font: 14px/1.5 var(--serif); background: radial-gradient(ellipse at 50% 20%, #3a2a1c 0%, var(--oak) 70%), var(--oak); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0 0 .4em; line-height: 1.25; text-wrap: balance; }
h2 { font-size: 1.15rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .5em; }
.dim { color: var(--ink-soft); }
.small { font-size: .8rem; }
.num { font-family: var(--sans); font-variant-numeric: tabular-nums; }

/* ── 양피지 ── */
.parch {
  background: var(--paper-stain), var(--paper-grain), var(--parch);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(120,80,30,.35), inset 0 0 30px rgba(130,85,30,.26), 0 4px 14px rgba(0,0,0,.45);
}

/* ── 버튼/입력 ── */
.btn { background: var(--parch-2); border: 1px solid var(--parch-edge); border-radius: var(--r); padding: .22em .7em; font-family: var(--serif); font-size: .88rem; line-height: 1.5; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--ink-soft); background: #ead9b2; }
.btn.primary { background: var(--ink); color: var(--parch); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: #43301f; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[aria-current=page], .btn[aria-current=page]:hover:not(:disabled) { background: var(--ink); color: var(--parch); border-color: var(--ink); }
input, select, textarea { background: rgba(255,250,235,.55); border: 1px solid var(--parch-edge); border-radius: var(--r); padding: .28em .5em; width: 100%; font-size: .92rem; }
textarea { resize: vertical; min-height: 4em; line-height: 1.6; }
label { display: block; margin-bottom: .55em; }
label > span { display: block; font-size: .78rem; color: var(--ink-soft); margin-bottom: .1em; }
.row { display: flex; gap: .4em; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ── 금박 명판 버튼 (수업듣기/과제하기) ── */
.plaque {
  position: relative; width: 100%; padding: .9em 1em .8em; border: 1px solid #1a110a; border-radius: 1px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.18)),
    radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--house) 55%, #3b2a1a) 0%, color-mix(in srgb, var(--house) 30%, #1d130b) 100%);
  color: #f3dfa6; text-align: center;
  box-shadow: inset 0 0 0 3px #1d130b, inset 0 0 0 4px var(--gilt-hi), inset 0 0 0 7px #1d130b, inset 0 0 0 8px rgba(217,180,90,.55), 0 3px 10px rgba(40,20,5,.45);
  transition: filter .15s ease, transform .1s ease;
}
.plaque::before, .plaque::after { content: '◆'; position: absolute; top: 50%; transform: translateY(-50%); font-size: .55rem; color: var(--gilt-hi); }
.plaque::before { left: 14px; } .plaque::after { right: 14px; }
.plaque .ttl { display: block; font-family: var(--display); font-size: 1.45rem; letter-spacing: .12em; line-height: 1.2; text-shadow: 0 1px 0 #000, 0 0 10px rgba(217,180,90,.35); }
.plaque .sub { display: block; font-size: .78rem; color: #e2cc93; margin-top: .15em; letter-spacing: .04em; }
.plaque:hover:not(:disabled) { filter: brightness(1.12); }
.plaque:active:not(:disabled) { transform: translateY(1px); }
.plaque:disabled { cursor: default; filter: saturate(.6); }
.progress { height: 4px; background: rgba(120,80,30,.2); border-radius: 2px; overflow: hidden; margin: .35em 0 .15em; }
.progress > div { height: 100%; background: var(--house); transition: width 1s linear; }

/* ── 로그인/안내 ── */
.gate { max-width: 400px; margin: 12vh auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.gate h1 { font-size: 2.3rem; color: var(--parch); text-align: center; margin-bottom: .1em; }
.gate .crest { color: var(--gilt-hi); text-align: center; margin-bottom: 1.4em; }
.gate .panel { padding: 1.3em; }
.tabs-mini { display: flex; gap: 1.1em; margin-bottom: .9em; }
.tabs-mini button { background: none; border: 0; padding: 0 0 .2em; color: var(--ink-soft); border-bottom: 2px solid transparent; }
.tabs-mini button[aria-selected=true] { color: var(--ink); border-color: var(--gilt); }
.err { color: var(--oxblood); min-height: 1.3em; font-size: .86rem; }

/* ── 입학 인트로 ── */
.intro { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); }
.intro .scene { width: min(720px, 100%); padding: 2.2em 2.6em 1.6em; text-align: center; position: relative; }
.intro .step { font-family: var(--sans); font-size: .72rem; color: var(--ink-soft); letter-spacing: .1em; }
.intro h1 { font-size: 1.9rem; margin: .3em 0 .7em; }
.intro .prose { font-size: 1.04rem; line-height: 1.95; text-align: left; max-width: 34em; margin: 0 auto; }
.intro .prose p { margin-bottom: .9em; animation: ink 1.1s ease both; }
.intro .prose p:nth-child(2) { animation-delay: .5s; } .intro .prose p:nth-child(3) { animation-delay: 1s; } .intro .prose p:nth-child(4) { animation-delay: 1.5s; }
.intro .letter-card { margin: .4em auto 1em; max-width: 30em; text-align: left; padding: 1em 1.3em; border: 1px solid var(--parch-edge); background: rgba(255,250,235,.55); font-size: .98rem; line-height: 1.85; color: #233a26; position: relative; }
.intro .wax { position: absolute; right: -14px; top: -14px; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #b0443a, #6e1a14 70%); box-shadow: 0 2px 4px rgba(0,0,0,.4); display: grid; place-items: center; color: #e6b8a0; font-family: var(--display); font-size: 1.1rem; }
.intro .nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2em; }
.intro .nav .btn { font-size: .95rem; padding: .35em 1.2em; }
/* 입학 흐름: 이야기 + 선택 */
.intro .scene.form { width: min(980px, 100%); }
.intro .scene.wide { width: min(1500px, 100%); }
.intro .scene.form .prose { max-width: 46em; }
.enroll-body { text-align: left; margin-top: .4em; }
.enroll-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: .2em; }
.enroll-dots .d { width: 7px; height: 7px; border-radius: 50%; background: rgba(120,80,30,.25); }
.enroll-dots .d.form { border-radius: 1px; transform: rotate(45deg); }
.enroll-dots .d.done { background: var(--ink-soft); }
.enroll-dots .d.on { background: var(--house); box-shadow: 0 0 0 2px rgba(255,250,235,.8), 0 0 0 3px var(--house); }
.intro .nav .err { margin-right: .6em; min-height: 0; }
.letter-card .lt-title { font-family: var(--display); font-size: 1.15rem; margin-bottom: .5em; }
.sign-block { margin-top: 1em; padding-top: .8em; border-top: 1px dashed var(--parch-edge); }
.sign-row { display: flex; align-items: flex-end; gap: .6em; margin: .5em 0 .3em; }
.sign-row .lbl { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; padding-bottom: .35em; }
input.sign { flex: 1; background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: .1em .2em; font-family: var(--display); font-size: 1.6rem; color: #233a26; }
input.sign:focus-visible { outline: none; border-bottom-color: var(--gilt); box-shadow: 0 2px 0 var(--gilt-hi); }
.notice { border: 1px solid var(--gilt); background: rgba(217,180,90,.12); padding: .5em .8em; font-size: .88rem; margin-bottom: .8em; }
.choice.tall { padding: .7em .8em; font-size: .86rem; }
.choice.tall[aria-pressed=true] { padding: calc(.7em - 1px) calc(.8em - 1px); }
.choice .perk { margin-top: .4em; padding-top: .35em; border-top: 1px dotted var(--parch-edge); color: var(--gilt); }
.choice .perk b { color: var(--ink); font-weight: 700; }
.choice-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wand-steps.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.4em; }
.recap { margin-top: 1em; border-top: 1px solid var(--line); padding-top: .6em; }
.intro .two { display: grid; grid-template-columns: 1fr 1fr; gap: .8em; }
.intro .two textarea { min-height: 9em; }
@keyframes ink { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }

/* ── 입학 서류 (가로 2단) ── */
.create { width: min(1640px, calc(100% - 32px)); margin: 2vh auto; padding: 1.2em 1.5em; }
.create > header { display: flex; align-items: baseline; gap: 1em; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .5em; margin-bottom: .8em; }
.create > header h1 { font-size: 1.6rem; margin: 0; }
.create .grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6em; }
.create section { margin-bottom: .9em; }
.choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4em; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice { text-align: left; background: rgba(255,250,235,.4); border: 1px solid var(--parch-edge); border-radius: var(--r); padding: .45em .55em; font-size: .8rem; line-height: 1.4; }
.choice strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.02rem; }
.choice { position: relative; transition: opacity .15s ease, box-shadow .15s ease; }
.choice:hover { border-color: var(--ink-soft); }
/* 선택된 항목: 굵은 테두리 + 바깥 고리 + ✓ 표식, 나머지는 흐리게 */
.choice[aria-pressed=true] { border: 2px solid var(--c, var(--ink)); padding: calc(.45em - 1px) calc(.55em - 1px); background: #fffaf0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--ink)) 28%, transparent), 0 3px 8px rgba(60,30,10,.25); }
.choice[aria-pressed=true]::after { content: '✓'; position: absolute; top: -8px; right: -8px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--c, var(--ink)); color: #fff8e6; font: 700 11px/19px var(--sans); text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.choice-grid:has(.choice[aria-pressed=true]) .choice:not([aria-pressed=true]) { opacity: .55; }
.choice-grid:has(.choice[aria-pressed=true]) .choice:not([aria-pressed=true]):hover { opacity: 1; }
.choice-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.stack1 { grid-template-columns: minmax(0, 1fr); }
.choice-grid.bg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35em; }
.choice-grid.bg-grid .choice { text-align: center; padding: .3em .2em; }
.choice-grid.bg-grid .choice[aria-pressed=true] { padding: calc(.3em - 1px) calc(.2em - 1px); }
.choice-grid.bg-grid .choice strong { font-size: .9rem; }
.abil-table.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.abil-cell.set { background: rgba(255,250,235,.7); border-color: var(--parch-edge); }
.create .grid3 { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, .9fr) minmax(0, 1.25fr); gap: 1.4em; align-items: start; }
.wand-col { border-left: 1px solid var(--line); padding-left: 1.2em; }
.wstep { margin-bottom: .7em; }
.wstep h3 { display: flex; align-items: baseline; gap: .45em; margin-bottom: .3em; }
.wstep .wnum { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: var(--ink); color: var(--parch); font: 600 .72rem/1 var(--sans); }
.wstep .hint { font-family: var(--serif); font-size: .76rem; color: var(--ink-soft); }
.wstep.locked { opacity: .45; }
.wstep.locked .wnum { background: var(--ink-soft); }
.bg-detail { margin-top: .4em; font-size: .82rem; line-height: 1.5; border-left: 2px solid var(--parch-edge); padding-left: .6em; }
.wand-summary { margin-top: .6em; border: 1px solid var(--gilt); background: rgba(255,250,235,.7); padding: .6em .8em; box-shadow: inset 0 0 0 3px rgba(217,180,90,.18); }
.wand-summary .wand-name { font-family: var(--display); font-size: 1.1rem; margin-bottom: .3em; }
dl.traits, .wand-summary dl { display: grid; grid-template-columns: auto 1fr; gap: .15em .7em; margin: 0; font-size: .84rem; }
dl.traits dt, .wand-summary dt { color: var(--ink-soft); }
dl.traits dd, .wand-summary dd { margin: 0; }
.abil-table { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35em; }
.abil-cell { border: 1px solid var(--line); border-radius: var(--r); padding: .3em .35em; background: rgba(255,250,235,.35); text-align: center; }
.abil-cell select { padding: .1em .2em; text-align: center; }
.abil-cell .final { font-family: var(--display); font-size: 1.2rem; line-height: 1.3; }
.create .two { display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }

/* ── 메인 셸 ── */
.shell {
  height: 100vh; height: 100dvh; display: grid; gap: 8px;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 312px;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) 8px max(8px, env(safe-area-inset-left, 0px));
}
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.1em; padding: .1em .4em; color: var(--parch); }
.topbar .title { font-family: var(--display); font-size: 1.15rem; color: var(--gilt-hi); white-space: nowrap; }
.topbar .clock { font-size: .92rem; white-space: nowrap; }
.topbar .clock .now { color: var(--gilt-hi); margin-left: .5em; }
.standings { margin-left: auto; display: flex; flex-wrap: wrap; gap: .3em .9em; align-items: center; }
.standings .h { white-space: nowrap; display: flex; align-items: center; gap: .35em; font-size: .82rem; color: #e2d2ac; }
.standings .h .sw { width: 8px; height: 16px; border-radius: 1px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.standings .h b { font-family: var(--sans); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--parch); }
.standings .h.lead b { color: var(--gilt-hi); }

/* 캐릭터 띠 */
.charbar { grid-column: 1 / -1; display: flex; align-items: center; padding: .45em .5em; overflow-x: auto; }
.charbar > .seg { padding: 0 .9em; border-left: 1px solid var(--line); flex: none; }
.charbar > .seg:first-child { border-left: 0; }
.charbar .name { font-family: var(--display); font-size: 1.25rem; line-height: 1.15; }
.charbar .abil { display: flex; gap: 3px; }
.charbar .ab { text-align: center; min-width: 3.1em; border: 1px solid var(--line); border-radius: var(--r); padding: .05em .2em; background: rgba(255,250,235,.35); line-height: 1.2; }
.charbar .ab .k { display: block; font-size: .68rem; color: var(--ink-soft); }
.charbar .ab .v { font-family: var(--display); font-size: 1rem; }
.charbar .ab .m { font-family: var(--sans); font-size: .64rem; color: var(--ink-soft); margin-left: .15em; }
.charbar .facts { display: grid; grid-template-columns: auto auto auto auto; gap: .05em .6em; font-size: .8rem; }
.charbar .facts > :nth-child(odd) { color: var(--ink-soft); }
.charbar .facts > :nth-child(even) { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.charbar .act { width: 230px; font-size: .82rem; }
.charbar .today { font-size: .8rem; }
.charbar .today .slot { white-space: nowrap; }
.charbar .today .slot.cur { font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--house); text-decoration-thickness: 2px; }
.charbar .buttons { margin-left: auto; display: flex; gap: .4em; }
.crest-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--house); box-shadow: 0 0 0 1.5px rgba(255,250,235,.7), 0 0 0 2.5px var(--house); margin-right: .35em; }
.badge { background: var(--oxblood); color: #fff; border-radius: 8px; font-family: var(--sans); font-size: .68rem; padding: 0 .4em; line-height: 1.5; margin-left: .3em; }

.col { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.col-scroll { overflow-y: auto; min-height: 0; flex: 1; padding: .7em .85em; }
.col-head { padding: .45em .85em .35em; border-bottom: 1px solid var(--line); flex: none; }
.col-head h2 { margin: 0; font-size: 1.08rem; display: inline; }

/* 기숙사 인원 균형 */
.house-card .headcount { font-size: .8rem; color: var(--ink-soft); border: 1px solid var(--parch-edge); border-radius: 9px; padding: 0 .5em; }
.house-card.closed, .choice-grid:has(.choice[aria-pressed=true]) .house-card.closed { opacity: 1; cursor: not-allowed; color: var(--ink-soft); background: repeating-linear-gradient(135deg, rgba(120,80,30,.07) 0 6px, transparent 6px 12px); }
.house-card.closed > :not(.closed-note) { opacity: .5; }
.house-card.closed .closed-note { margin-top: .5em; padding-top: .4em; border-top: 1px dotted var(--oxblood); color: var(--oxblood); font-size: .8rem; }

/* 칭호 */
.title-badge.earned { color: #8a5a10; font-weight: 700; text-shadow: 0 0 6px rgba(217,180,90,.6); }
.charbar .ab.pen { border-color: var(--oxblood); background: rgba(138,44,34,.08); }
.charbar .ab.pen .v { color: var(--oxblood); }
.charbar .act.warn { color: var(--oxblood); }
.plaque.detention { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.2)), radial-gradient(ellipse at 50% 0%, #6b2a22 0%, #2a120e 100%); }
.title-badge { font-size: .7rem; color: var(--gilt); letter-spacing: .04em; line-height: 1.1; }
/* 수업 일지 */
.classlog { display: flex; flex-direction: column; min-height: 220px; }
.classlog.is-live { border-color: var(--gilt); box-shadow: inset 0 0 0 1px rgba(217,180,90,.35); }
.classlog .log-body { flex: 1; max-height: 260px; overflow-y: auto; margin-top: .4em; padding-right: .3em; }
.classlog .entry { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); gap: .5em; padding: .35em 0; border-bottom: 1px dotted var(--parch-edge); animation: ink .8s ease both; }
.classlog .entry:last-child { border-bottom: 0; }
.classlog .when { font-size: .72rem; color: var(--ink-soft); padding-top: .15em; }
.classlog .what p { margin: 0 0 .15em; font-size: .9rem; line-height: 1.55; }
.classlog .what p.dice { font-family: var(--sans); font-size: .76rem; color: var(--ink-soft); }
.classlog .tags { display: flex; gap: .3em; flex-wrap: wrap; margin-top: .15em; }
.tag.pos { color: var(--moss); border-color: rgba(63,107,58,.5); }
.tag.neg { color: var(--oxblood); border-color: rgba(138,44,34,.5); }

/* 기능 패널 탭 */
.tabs { display: flex; gap: 1px; padding: .35em .6em 0; border-bottom: 1px solid var(--parch-edge); overflow-x: auto; scrollbar-width: thin; flex: none; }
.tabs button { white-space: nowrap; flex: none; background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 3px 3px 0 0; padding: .2em .65em; color: var(--ink-soft); font-family: var(--serif); font-size: .88rem; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current=page] { color: var(--ink); background: rgba(255,250,235,.6); border-color: var(--parch-edge); margin-bottom: -1px; box-shadow: inset 0 2px 0 var(--house); }

/* 채팅 */
.chat-head .desc { font-size: .78rem; color: var(--ink-soft); margin-left: .5em; }
.chat-log { flex: 1; overflow-y: auto; min-height: 0; padding: .55em .85em; font-size: .95rem; line-height: 1.65; }
.msg { margin-bottom: .25em; overflow-wrap: anywhere; }
.msg .who { font-weight: 700; margin-right: .4em; }
.msg .t { font-family: var(--sans); font-size: .66rem; color: var(--ink-soft); margin-left: .4em; }
.msg.system { color: var(--gilt); font-size: .86rem; text-align: center; border-block: 1px dotted var(--parch-edge); padding: .1em 0; }
.msg.ooc { color: var(--ink-soft); }
.msg .ooc-mark { font-family: var(--sans); font-size: .72rem; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--parch-edge); border-radius: 2px; padding: 0 .3em; margin-right: .4em; vertical-align: 1px; }
.chat-form { display: flex; gap: .4em; padding: .4em .6em; border-top: 1px solid var(--line); align-items: stretch; flex: none; }
.chat-form textarea { min-height: 2.3em; height: 2.3em; resize: none; }
.ooc-toggle { display: flex; align-items: center; gap: .25em; margin: 0; font-size: .82rem; white-space: nowrap; cursor: pointer; color: var(--ink-soft); }
.ooc-toggle input { width: auto; margin: 0; accent-color: var(--ink); }
.ooc-toggle:has(input:checked) { color: var(--ink); font-weight: 700; }

/* 지도·사람 */
.map-wrap { padding: .2em .4em 0; flex: none; }
.map svg { width: 100%; height: auto; display: block; max-height: 46vh; }
.map .pt { cursor: pointer; }
.map .pt circle.dot { fill: var(--parch); stroke: var(--ink); stroke-width: 1.4; }
.map .pt:hover circle.dot, .map .pt:focus circle.dot { fill: var(--gilt-hi); }
.map .pt.here circle.dot { fill: var(--house); stroke: var(--ink); stroke-width: 2; }
.map .pt.locked { cursor: not-allowed; opacity: .45; }
.map .pt text { font-family: var(--serif); font-size: 12.5px; fill: var(--ink); paint-order: stroke; stroke: var(--parch); stroke-width: 3px; }
.map .pt.here text { font-weight: 700; }
.map .cnt circle { fill: var(--ink); }
.map .cnt text { font-family: var(--sans); font-size: 9.5px; fill: var(--parch); stroke: none; font-weight: 600; }
.side-lists { flex: 1; min-height: 0; overflow-y: auto; padding: .4em .85em .6em; border-top: 1px solid var(--line); font-size: .86rem; }
.people { list-style: none; margin: 0 0 .6em; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 .5em; }
.people li { padding: .08em 0; display: flex; align-items: center; gap: .35em; min-width: 0; }
.people li .hname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #b9a684; flex: none; }
.dot.on { background: var(--moss); box-shadow: 0 0 0 2px rgba(63,107,58,.2); }
.hname { cursor: pointer; background: none; border: 0; padding: 0; text-align: left; font-family: var(--serif); }
.hname:hover { text-decoration: underline; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: .2em 0; border-bottom: 1px solid var(--line); font-size: .8rem; line-height: 1.4; }
.news li:last-child { border: 0; }

/* ── 기능 화면 공통: 가로 배치 ── */
.grid { display: grid; gap: .7em; align-items: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-side { grid-template-columns: 250px minmax(0, 1fr); }
.block { border: 1px solid var(--line); border-radius: var(--r); padding: .55em .7em; background: rgba(255,250,235,.3); min-width: 0; }
.stack { display: grid; gap: .7em; align-content: start; min-width: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list > li { border-bottom: 1px solid var(--line); padding: .32em 0; }
.list > li:last-child { border-bottom: 0; }
.tag { display: inline-block; border: 1px solid var(--parch-edge); border-radius: 2px; padding: 0 .35em; font-size: .72rem; color: var(--ink-soft); font-family: var(--sans); }
.note { font-size: .78rem; color: var(--ink-soft); margin: .4em 0 0; }

.timetable { width: 100%; border-collapse: collapse; font-size: .84rem; }
.timetable th, .timetable td { border-bottom: 1px solid var(--line); padding: .22em .35em; text-align: left; }
.timetable th { color: var(--ink-soft); font-weight: 400; font-size: .78rem; }
.timetable td:first-child { white-space: nowrap; }
.timetable tr.today td { background: rgba(156,116,38,.12); }
.timetable td.cur { font-weight: 700; text-decoration: underline; text-decoration-color: var(--house); text-decoration-thickness: 2px; }

.grades { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4em; }
.grades.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grades .gr { border: 1px solid var(--line); border-radius: var(--r); padding: .3em .45em; background: rgba(255,250,235,.35); }
.grades .gr .top { display: flex; align-items: baseline; justify-content: space-between; gap: .3em; }
.grades .gr .code { font-family: var(--display); font-size: 1.25rem; color: var(--gilt); line-height: 1.1; }
.grades .gr .nm { font-size: .78rem; line-height: 1.3; }
.grades .gr .xp { font-family: var(--sans); font-size: .66rem; color: var(--ink-soft); }
.bar { height: 3px; background: rgba(120,80,30,.18); border-radius: 2px; overflow: hidden; margin-top: .2em; }
.bar > div { height: 100%; background: var(--gilt); }

.glasses { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5em; }
.glass { text-align: center; font-size: .86rem; }
.glass .tube { height: 120px; width: 36px; margin: 0 auto .25em; border: 2px solid var(--ink-soft); border-radius: 18px; position: relative; overflow: hidden; background: rgba(255,250,235,.4); }
.glass .fill { position: absolute; bottom: 0; left: 0; right: 0; background: var(--c); transition: height 1.2s ease; }
.glass .pts { font-family: var(--display); font-size: 1.2rem; line-height: 1.2; }
.delta-pos { color: var(--moss); } .delta-neg { color: var(--oxblood); }

.score { font-family: var(--display); font-size: 1.5rem; text-align: center; line-height: 1.3; }
.live { color: var(--oxblood); font-size: .74rem; font-family: var(--sans); font-weight: 600; }
.qlog { max-height: 260px; overflow-y: auto; font-size: .84rem; }
.qlog p { margin: 0 0 .2em; }

.letter { white-space: pre-wrap; line-height: 1.75; background: rgba(255,250,235,.65); border: 1px solid var(--parch-edge); padding: .7em .9em; border-radius: 1px; font-size: .92rem; }
.unread .subj { font-weight: 700; }
.mail-item { cursor: pointer; display: flex; flex-wrap: wrap; gap: 0 .8em; justify-content: space-between; font-size: .88rem; }
.mail-item .subj { min-width: 7em; }
.mail-item:hover .subj { text-decoration: underline; }

/* 토스트·대화상자 */
#toasts { position: fixed; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: .4em; z-index: 50; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--paper-grain), var(--parch); color: var(--ink); border: 1px solid var(--parch-edge); border-left: 4px solid var(--gilt); border-radius: 2px; padding: .5em .8em; white-space: pre-wrap; font-size: .86rem; box-shadow: 0 6px 18px rgba(0,0,0,.45); animation: in .25s ease; }
.toast.err { border-left-color: var(--oxblood); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } }
dialog { color: var(--ink); border: 0; padding: 1.1em 1.3em; max-width: min(520px, calc(100vw - 32px)); background: var(--paper-stain), var(--paper-grain), var(--parch); border-radius: 3px; box-shadow: inset 0 0 30px rgba(130,85,30,.26), 0 10px 40px rgba(0,0,0,.6); }
dialog::backdrop { background: rgba(20,12,6,.65); }

/* 좁은 화면: PC 최적화가 기본이고, 좁으면 쌓아서 쓸 수 있게만 */
@media (max-width: 1240px) {
  .create .grid3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wand-col { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .shell { grid-template-columns: minmax(0, 1fr) 300px; }
  .col.panel { grid-column: 1 / -1; order: 5; min-height: 70vh; }
  .grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { height: auto; grid-template-columns: minmax(0, 1fr); padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
  .col.chat-col { min-height: 70vh; }
  .charbar { flex-wrap: wrap; gap: .5em 0; }
  .g2, .g3, .g4, .g-side, .create .grid3, .choice-grid, .choice-grid.three, .choice-grid.two-col { grid-template-columns: minmax(0, 1fr); }
  .choice-grid.bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wand-col { border-left: 0; padding-left: 0; }
  .abil-table { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro .scene { padding: 1.4em 1.2em; }
  .choice-grid.four, .wand-steps.two, .intro .two { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 시즌 0 2차: 주문 · 전투 주문 · 금지된 숲 전투 · 도감 · 우편 동봉 ── */
.grades { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.grades.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.charbar .ab.buff { border-color: var(--gilt); background: rgba(217,180,90,.16); }
.charbar .ab.buff .v { color: var(--gilt); font-weight: 700; }

.cats { display: inline-flex; gap: .2em; flex-wrap: wrap; vertical-align: middle; }
.cat { display: inline-block; font-family: var(--sans); font-size: .66rem; line-height: 1.5; padding: 0 .35em; border-radius: 2px; border: 1px solid currentColor; white-space: nowrap; }
.cat-버프 { color: #8a6a12; } .cat-공격 { color: var(--oxblood); } .cat-방어 { color: #2c4f7a; }
.cat-회복 { color: var(--moss); } .cat-제어 { color: #5d3a78; } .cat-특수 { color: var(--ink-soft); }

.spell-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4em; max-height: 58vh; overflow-y: auto; padding-right: .2em; }
.spell { border: 1px solid var(--line); border-radius: var(--r); padding: .4em .55em; background: rgba(255,250,235,.4); }
.spell strong { font-family: var(--display); font-weight: 400; font-size: 1rem; }
.spell-pick { width: 100%; }
.restricted { margin-top: .6em; padding-top: .5em; border-top: 1px dashed var(--parch-edge); }

.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4em; }
.slot-card { display: flex; flex-direction: column; gap: .2em; min-height: 5.2em; border: 1px dashed var(--parch-edge); border-radius: var(--r); padding: .45em .55em; position: relative; }
.slot-card.filled { border-style: solid; border-color: var(--ink-soft); background: #fffaf0; }
.slot-card .n { position: absolute; top: .3em; right: .5em; font-family: var(--display); color: var(--gilt); font-size: 1.1rem; }
.slot-card strong { font-family: var(--display); font-weight: 400; font-size: 1rem; padding-right: 1.2em; }
.slot-card .btn { align-self: flex-start; margin-top: auto; }

.warnbox { border-color: rgba(138,44,34,.5); color: var(--oxblood); background: rgba(138,44,34,.06); }
.tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em; }
.tier { border: 1px solid var(--parch-edge); border-radius: var(--r); padding: .45em .55em; background: rgba(255,250,235,.45); display: flex; flex-direction: column; }
.tier strong { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.tier .row:last-child { margin-top: auto !important; padding-top: .3em; }
.tier.locked { opacity: .55; background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(120,80,30,.06) 6px 12px); }

.result { border-left: 3px solid var(--gilt); padding: .2em .6em; margin-bottom: .4em; }
.result.cleared { border-color: var(--moss); } .result.defeat { border-color: var(--oxblood); }
.blog { max-height: 52vh; overflow-y: auto; font-size: .82rem; line-height: 1.45; }
.blog p { margin: 0 0 .25em; padding-left: .5em; border-left: 2px solid transparent; }
.blog .k-act { color: var(--ink); } .blog .k-hit { color: var(--oxblood); border-color: rgba(138,44,34,.35); }
.blog .k-miss { color: var(--ink-soft); } .blog .k-down { color: var(--oxblood); font-weight: 700; border-color: var(--oxblood); }
.blog .k-heal { color: var(--moss); border-color: rgba(63,107,58,.35); } .blog .k-sys { color: var(--ink-soft); font-style: italic; }
.blog .k-event { color: var(--ink); border-color: var(--parch-edge); }
.blog .k-loot, .blog .k-win { color: var(--gilt); font-weight: 700; border-color: var(--gilt-hi); }

.forest .steps { display: flex; gap: .25em; align-items: center; }
.forest .stp { width: 1.6em; height: 1.6em; display: inline-grid; place-items: center; border: 1px solid var(--parch-edge); border-radius: 50%; font-family: var(--sans); font-size: .72rem; color: var(--ink-soft); }
.forest .stp.done { background: var(--ink-soft); color: var(--parch); border-color: var(--ink-soft); }
.forest .stp.on { border: 2px solid var(--gilt); color: var(--ink); font-weight: 700; }
.fighter { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--r); padding: .35em .5em; margin-bottom: .35em; background: rgba(255,250,235,.45); font: inherit; color: inherit; }
.fighter.turn { box-shadow: 0 0 0 2px var(--gilt-hi); }
.fighter.picked { border: 2px solid var(--ink); padding: calc(.35em - 1px) calc(.5em - 1px); background: #fffaf0; }
.fighter.enemy.picked { border-color: var(--oxblood); }
.fighter.dead { opacity: .4; text-decoration: line-through; cursor: default; }
.fighter strong { font-family: var(--display); font-weight: 400; font-size: 1rem; }
.hpbar { position: relative; height: 14px; border-radius: 2px; background: rgba(120,80,30,.18); overflow: hidden; margin: .2em 0; }
.hpbar > div { height: 100%; background: linear-gradient(90deg, #5b8a4f, var(--moss)); transition: width .4s ease; }
.fighter.enemy .hpbar > div { background: linear-gradient(90deg, #a8463a, var(--oxblood)); }
.hpbar.down > div { background: none; }
.hpbar span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--sans); font-size: .66rem; font-weight: 600; color: #fff; text-shadow: 0 0 2px #000, 0 0 3px rgba(0,0,0,.9), 0 1px 1px #000; }
.chips { display: flex; gap: .2em; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-size: .64rem; padding: 0 .35em; border-radius: 8px; border: 1px solid; }
.chip.good { color: var(--moss); border-color: rgba(63,107,58,.5); } .chip.bad { color: var(--oxblood); border-color: rgba(138,44,34,.5); }
.actions h3 { display: flex; justify-content: space-between; align-items: baseline; }
.timer { font-family: var(--sans); }
.act-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35em; }
.btn.act { display: flex; flex-direction: column; align-items: flex-start; white-space: normal; text-align: left; padding: .35em .55em; gap: .1em; }
.btn.act strong { font-family: var(--display); font-weight: 400; font-size: .98rem; }
.event p { font-size: .92rem; }
.btn.ev-opt { white-space: normal; text-align: left; padding: .4em .7em; }
.btn.ev-opt.spell { border-color: var(--gilt); background: rgba(217,180,90,.16); }

.codex { display: flex; flex-direction: column; gap: .45em; }
.codex-sec > summary { display: flex; align-items: baseline; gap: .5em; cursor: pointer; font-family: var(--display); font-size: 1.02rem; list-style: none; }
.codex-sec > summary::before { content: '▸'; color: var(--gilt); transition: transform .15s ease; display: inline-block; }
.codex-sec[open] > summary::before { transform: rotate(90deg); }
.codex-sec > summary::-webkit-details-marker { display: none; }
.codex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35em; margin-top: .45em; }
.cx { border: 1px solid var(--line); border-radius: var(--r); padding: .35em .5em; background: rgba(255,250,235,.5); }
.cx strong { font-family: var(--display); font-weight: 400; }
.cx.unknown { background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(120,80,30,.05) 7px 14px); border-style: dashed; }
.cx.unknown strong { color: var(--ink-soft); letter-spacing: .15em; }

.attach-box { border: 1px dashed var(--parch-edge); border-radius: var(--r); padding: .45em .55em; margin-top: .45em; }
.att-list { display: flex; flex-wrap: wrap; gap: .25em; margin: .3em 0; }
.att-list .x { background: none; border: 0; padding: 0 .1em; color: var(--oxblood); }
.parcel { display: flex; align-items: center; gap: .6em; justify-content: space-between; margin-top: .5em; padding: .45em .6em; border: 1px solid var(--gilt); background: rgba(217,180,90,.12); border-radius: var(--r); }

@media (max-width: 1240px) {
  .spell-list, .codex-grid { grid-template-columns: minmax(0, 1fr); }
  .tiers { grid-template-columns: minmax(0, 1fr); }
  .grades { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.item-hits { display: flex; flex-wrap: wrap; gap: .3em; max-height: 9.5em; overflow-y: auto; margin-top: .3em; }
.item-hits .btn.hit { padding: .15em .55em; font-size: .78rem; }
.chip .x { background: none; border: 0; padding: 0 .1em; color: var(--oxblood); cursor: pointer; }

/* ── 스크롤바: 양피지 톤 ── */
* { scrollbar-width: thin; scrollbar-color: rgba(106, 74, 40, .55) rgba(120, 85, 40, .08); }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: rgba(120, 85, 40, .07); border-left: 1px solid rgba(106, 74, 40, .12); }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #a07c4c, #7a5a34); border-radius: 6px; border: 2px solid rgba(233, 217, 180, .9); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #8a6236, #5e4224); }
*::-webkit-scrollbar-corner { background: transparent; }
/* ── 이곳에서 할 수 있는 일 ── */
.spots { display: grid; gap: .35em; margin-bottom: .5em; }
.spot { border: 1px dashed var(--line); border-radius: var(--r); padding: .3em .45em; background: rgba(255, 250, 235, .35); }
.spot .btn { padding: .1em .55em; font-size: .78rem; }
.hname.inline { display: inline; padding: 0; font: inherit; font-weight: 600; text-decoration: underline dotted; text-underline-offset: 2px; }
.tabs-mini.dur button { padding: .15em .6em; }
.mylog { max-height: 18em; overflow-y: auto; }
.errand .progress { margin: .35em 0 .2em; }
.mail-item.row { align-items: flex-start; gap: .45em; }
.mail-item input[type=checkbox] { margin-top: .25em; accent-color: #7a5a34; }
.tabs-mini.dur { margin: 0; gap: .8em; }

.mail-item.row { display: flex; flex-direction: row; align-items: flex-start; }
.mail-item.row > .grow { display: flex; flex-direction: column; min-width: 0; }
.mail-item.row { flex-wrap: nowrap; justify-content: flex-start; }

/* ── 3차: 채팅 칭호 · 사담 배경 · 제어 주문 창 · 제작 · 우편함 ── */
.msg .chat-title { font-family: var(--sans); font-size: .64rem; font-weight: 600; color: #8a6a2c; background: rgba(217,180,90,.16); border: 1px solid rgba(176,140,60,.35); border-radius: 2px; padding: 0 .3em; margin-right: .3em; vertical-align: 2px; white-space: nowrap; }
.msg.ooc { background: rgba(60,45,25,.13); border-left: 3px solid rgba(90,70,40,.35); padding: .15em .45em; margin-left: -.2em; border-radius: 2px; color: #5a4a36; }
.msg.ooc .who { opacity: .8; }
.cast-targets { display: flex; flex-wrap: wrap; gap: .35em; margin: .6em 0; }
.cast-dialog { max-width: 26em; }
.fx { color: #3f5a3a; margin-top: .15em; }
.exp-list li { gap: .3em; padding: .12em 0; }
.exp-list .btn { padding: .05em .55em; min-width: 1.9em; }
.mail-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: .8em; align-items: start; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.mailbox { padding: 0; overflow: hidden; }
.mail-folders { display: flex; align-items: center; gap: .2em; padding: .5em .6em; border-bottom: 1px solid var(--parch-edge); }
.mail-folders .fold { background: none; border: 0; border-bottom: 2px solid transparent; padding: .3em .55em; font: inherit; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }
.mail-folders .fold[aria-current=page] { color: var(--ink); font-weight: 700; border-bottom-color: var(--gilt); }
.mail-tools { display: flex; align-items: center; gap: .4em; padding: .35em .6em; background: rgba(90,70,40,.06); border-bottom: 1px solid var(--parch-edge); }
.mail-tools .btn { padding: .15em .6em; font-size: .78rem; }
.mlist { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.mrow { display: grid; grid-template-columns: 1.6em 1.6em minmax(0, 1fr); align-items: center; gap: .3em; padding: .45em .6em; border-bottom: 1px dashed rgba(120,95,60,.25); cursor: pointer; }
.mrow:hover { background: rgba(217,180,90,.1); }
.mrow.sel { background: rgba(217,180,90,.2); }
.mrow.unread .msubj { font-weight: 700; }
.mcheck { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mcheck input { margin: 0; accent-color: #7a5a34; }
.micon { text-align: center; font-size: .95rem; }
.mmain { display: flex; flex-direction: column; min-width: 0; }
.msubj { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmeta { font-family: var(--sans); font-size: .7rem; color: var(--ink-soft); }
.mailbox .note { margin: .5em .7em .7em; }
.mail-pane-head { display: flex; align-items: baseline; gap: .6em; justify-content: space-between; border-bottom: 1px solid var(--parch-edge); margin-bottom: .55em; }
.mail-pane-head h3 { margin: 0 0 .3em; }
.mail-field { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); align-items: center; gap: .4em; font-size: .85rem; }
.mail-field > span { color: var(--ink-soft); }
.mail-empty { text-align: center; padding: 2.5em 1em; }
.seg-pick { display: flex; gap: .3em; margin-bottom: .4em; }
.seg-pick .btn.on { background: #3b2a17; color: #f6ecd2; border-color: #3b2a17; }

/* ── 다이애건 앨리 주문서 탭 ── */
.shop-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--parch-edge); margin: -.1em 0 .45em; }
.shop-tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: .35em .2em; font-size: .88rem; color: var(--ink-soft); cursor: pointer; }
.shop-tabs button:hover { color: var(--ink); }
.shop-tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--gilt); }
.shop-tabs .n { font-family: var(--sans); font-size: .64rem; margin-left: .3em; color: var(--ink-soft); font-weight: 400; }
.shop-desc { display: block; font-size: .72rem; line-height: 1.35; margin-top: .05em; }
.shop-empty { padding: .8em .2em; }
.shop-cauldron { margin-top: .4em; padding-top: .45em; border-top: 1px dashed var(--line); }

/* ── 학생 프로필 창: 기숙사마다 색·문장·덕목 ── */
dialog.pf-dlg { padding: 0; width: min(560px, calc(100vw - 32px)); max-width: none; overflow: hidden; border: 1px solid var(--hb); box-shadow: 0 0 0 4px var(--hd), 0 0 0 5px var(--hb), 0 18px 50px rgba(0,0,0,.65); }
.pf-head { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: .9em; align-items: center; padding: 1.1em 1.3em 1em;
  color: #f6ecd2; background:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--hb) 12%, transparent) 14px 16px),
    radial-gradient(ellipse 70% 120% at 15% 0%, color-mix(in srgb, var(--ha) 70%, white 8%), transparent 70%),
    linear-gradient(160deg, var(--ha), var(--hd)); }
.pf-shield { width: 76px; height: 86px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); }
.pf-id { min-width: 0; }
.pf-title { display: inline-block; font-family: var(--sans); font-size: .7rem; letter-spacing: .04em; color: var(--hd); background: var(--hb); padding: .05em .55em; border-radius: 1px; margin-bottom: .25em; }
.pf-name { margin: 0; font-family: var(--display); font-size: 1.85rem; font-weight: 400; line-height: 1.15; color: #fbf3df; text-shadow: 0 2px 3px rgba(0,0,0,.4); overflow-wrap: anywhere; }
.pf-sub { font-size: .85rem; opacity: .85; margin-top: .15em; }
.pf-online { margin-left: .8em; display: inline-flex; vertical-align: 1px; align-items: center; gap: .35em; font-family: var(--sans); font-size: .7rem; color: rgba(246,236,210,.7); white-space: nowrap; }
.pf-online i { width: 8px; height: 8px; border-radius: 50%; background: rgba(246,236,210,.35); }
.pf-online.on { color: #f6ecd2; } .pf-online.on i { background: #7fd36a; box-shadow: 0 0 6px #7fd36a; }
.pf-x { position: absolute; top: .35em; right: .5em; background: none; border: 0; color: rgba(246,236,210,.75); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: .1em .3em; }
.pf-x:hover { color: #fff; }
.pf-x:focus:not(:focus-visible) { outline: none; }
.pf-ribbon { display: flex; justify-content: space-between; align-items: center; padding: .3em 1.3em; background: var(--hb); color: var(--hd); font-family: var(--display); font-size: .92rem; letter-spacing: .12em; }
.pf-ribbon .el { font-family: var(--sans); font-size: .68rem; letter-spacing: .05em; opacity: .8; }
.pf-hufflepuff .pf-ribbon, .pf-hufflepuff .pf-title { color: #f3d36b; }
.pf-hufflepuff .pf-ribbon { background: #2a2118; }
.pf-hufflepuff .pf-title { background: #2a2118; }
.pf-body { padding: .9em 1.3em .3em; flex: 1; min-height: 0; overflow-y: auto; }
.pf-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: rgba(255,250,235,.45); }
.pf-fact { padding: .45em .55em; border-left: 1px solid var(--line); text-align: center; min-width: 0; }
.pf-fact:first-child { border-left: 0; }
.pf-fact .k { display: block; font-family: var(--sans); font-size: .66rem; color: var(--ink-soft); letter-spacing: .03em; }
.pf-fact .v { display: block; font-size: .92rem; font-weight: 600; color: color-mix(in srgb, var(--ha) 75%, var(--ink)); overflow-wrap: anywhere; line-height: 1.3; }
.pf-hufflepuff .pf-fact .v { color: #7a5a08; }
.pf-sec { margin-top: .9em; }
.pf-sec h3 { display: flex; align-items: center; gap: .5em; margin: 0 0 .35em; font-family: var(--display); font-weight: 400; font-size: 1rem; color: var(--ink); }
.pf-sec h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hb), transparent); opacity: .8; }
.pf-hufflepuff .pf-sec h3::after { background: linear-gradient(90deg, #c69a1c, transparent); }
.pf-sec h3::before { content: '◆'; font-size: .55rem; color: var(--ha); }
.pf-wand { margin: 0 0 .4em; font-size: .9rem; }
.pf-traits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35em .9em; margin: 0; }
.pf-traits > div { border-left: 2px solid color-mix(in srgb, var(--ha) 55%, transparent); padding-left: .5em; }
.pf-traits dt { font-family: var(--sans); font-size: .66rem; color: var(--ink-soft); }
.pf-traits dd { margin: 0; font-size: .84rem; line-height: 1.45; }
.pf-text { margin: 0; white-space: pre-wrap; line-height: 1.75; font-size: .9rem; }
.pf-foot { display: flex; gap: .4em; align-items: center; padding: .7em 1.3em .9em; border-top: 1px solid var(--line); margin-top: .7em; }
@media (max-width: 520px) { .pf-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-fact:nth-child(3) { border-left: 0; } .pf-traits { grid-template-columns: 1fr; } .pf-head { grid-template-columns: 56px minmax(0, 1fr); } .pf-shield { width: 56px; height: 64px; } }

/* ── 프로필 사진 · 접는 칸 · 관계 ── */
.pf-avatar { width: 104px; height: 104px; border: 3px solid var(--hb); outline: 1px solid rgba(0,0,0,.35); box-shadow: 0 4px 10px rgba(0,0,0,.45); background: var(--hd); overflow: hidden; flex: none; }
.pf-avatar img, .pf-avatar svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.pf-avatar.big { width: 128px; height: 128px; }
.pf-hufflepuff .pf-avatar, .me-photo .pf-avatar { border-color: var(--hb); }
.pf-hufflepuff .pf-avatar { border-color: #2a2118; }
.pf-fold > summary { list-style: none; display: flex; align-items: center; gap: .5em; cursor: pointer; font-family: var(--display); font-size: 1rem; padding: .1em 0; }
.pf-fold > summary::-webkit-details-marker { display: none; }
.pf-fold > summary::before { content: '◆'; font-size: .55rem; color: var(--ha); }
.pf-fold > summary::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--hb), transparent); opacity: .8; order: 2; }
.pf-hufflepuff .pf-fold > summary::after { background: linear-gradient(90deg, #c69a1c, transparent); }
.pf-fold .cnt { order: 1; font-family: var(--sans); font-size: .66rem; color: var(--ink-soft); background: rgba(90,70,40,.1); border-radius: 8px; padding: 0 .45em; }
.pf-fold .chev { order: 3; font-size: .75rem; color: var(--ink-soft); transition: transform .15s; }
.pf-fold:not([open]) .chev { transform: rotate(-90deg); }
.pf-fold-body { padding: .35em 0 .1em; }
.pf-rels { list-style: none; margin: 0; padding: 0; display: grid; gap: .35em; }
.pf-rels li { background: rgba(255,250,235,.5); border: 1px solid var(--line); border-left: 3px solid var(--ha); padding: .35em .55em; }
.pf-rels .row { gap: .4em; align-items: baseline; }
.pf-rels .ico { width: 1.2em; text-align: center; }
.pf-rels .lbl { font-family: var(--sans); font-size: .72rem; color: var(--ink-soft); }
.pf-rels .det { margin: .2em 0 0 1.6em; font-size: .84rem; line-height: 1.55; white-space: pre-wrap; }
.pf-friends { display: flex; flex-wrap: wrap; gap: .25em .5em; align-items: baseline; margin-top: .5em; font-size: .85rem; }
.pf-friends .k { font-family: var(--sans); font-size: .7rem; color: var(--ink-soft); margin-right: .2em; }
.pf-incoming { border: 1px solid var(--gilt); background: rgba(217,180,90,.15); padding: .4em .6em; margin-bottom: .7em; display: grid; gap: .3em; }
.pf-foot { flex-wrap: wrap; }
/* 관계 제안 창 */
dialog.rel-dlg { width: min(520px, calc(100vw - 32px)); }
.rel-dlg h2 { margin: 0 0 .2em; font-family: var(--display); font-weight: 400; }
.rel-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3em; }
.rel-k { display: flex; flex-direction: column; align-items: center; gap: .1em; padding: .45em .2em; border: 1px solid var(--parch-edge); background: rgba(255,250,235,.55); border-radius: var(--r); cursor: pointer; font-size: .82rem; }
.rel-k .ico { font-size: 1.1rem; }
.rel-k .why { font-family: var(--sans); font-size: .6rem; color: var(--oxblood); }
.rel-k.on { background: #3b2a17; color: #f6ecd2; border-color: #3b2a17; }
.rel-k:disabled { opacity: .45; cursor: not-allowed; }
.rel-roles { display: grid; grid-template-columns: auto 1fr 1fr; gap: .4em; align-items: stretch; margin-top: .6em; }
.rel-roles > .small { align-self: center; }
.rel-role { display: flex; gap: .4em; align-items: flex-start; border: 1px solid var(--parch-edge); padding: .35em .5em; font-size: .8rem; cursor: pointer; background: rgba(255,250,235,.45); }
.rel-role.on { border-color: var(--gilt); background: rgba(217,180,90,.2); }
/* 도감 칭호 칸 */
.tcard { font-size: .82rem; }
.tkind { font-family: var(--sans); font-size: .64rem; color: var(--ink-soft); letter-spacing: .03em; margin-bottom: .15em; }
.tline { display: flex; gap: .45em; align-items: baseline; line-height: 1.45; }
.tline .tk { flex: none; font-family: var(--sans); font-size: .64rem; color: #f6ecd2; background: #6a543c; padding: 0 .35em; border-radius: 1px; }
/* 내 방 */
.me-sub { font-family: var(--sans); font-size: .72rem; font-weight: 600; color: var(--ink-soft); margin: .7em 0 .2em; letter-spacing: .03em; }
.me-sub.hot { color: var(--oxblood); }
.me-social .list .btn { padding: .05em .55em; font-size: .78rem; }
/* 관리 탭 */
.adm-tabs { display: flex; gap: .2em; border-bottom: 1px solid var(--parch-edge); margin-bottom: .7em; flex-wrap: wrap; }
.adm-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: .4em .8em; cursor: pointer; color: var(--ink-soft); font-size: .92rem; }
.adm-tabs button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--gilt); }
.adm-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5em; margin-bottom: .7em; }
.adm-sum > div { border: 1px solid var(--line); background: rgba(255,250,235,.5); padding: .4em .7em; display: flex; align-items: baseline; gap: .5em; }
.adm-sum b { font-size: 1.3rem; font-family: var(--display); font-weight: 400; }
.adm-sum span { font-size: .78rem; color: var(--ink-soft); }
.adm-students { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: .7em; align-items: start; }
@media (max-width: 1100px) { .adm-students { grid-template-columns: 1fr; } }
.adm-table-wrap { max-height: 60vh; overflow: auto; }
.adm-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.adm-table th { position: sticky; top: 0; background: var(--parch-2); text-align: left; font-family: var(--sans); font-size: .7rem; color: var(--ink-soft); padding: .3em .4em; border-bottom: 1px solid var(--parch-edge); }
.adm-table td { padding: .3em .4em; border-bottom: 1px dashed var(--line); white-space: nowrap; }
.adm-table td.num, .adm-table th:nth-child(n+5):nth-child(-n+7) { text-align: right; }
.adm-table td.warn { color: var(--oxblood); font-weight: 700; }
.adm-table tbody tr { cursor: pointer; }
.adm-table tbody tr:hover { background: rgba(217,180,90,.12); }
.adm-table tbody tr.sel { background: rgba(217,180,90,.25); }
.adm-table .chip { margin-right: .2em; }
.adm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .2em .8em; margin: .5em 0 .7em; }
.adm-facts > div { display: flex; justify-content: space-between; gap: .5em; border-bottom: 1px dotted var(--line); padding: .1em 0; }
.adm-facts > div:last-child { grid-column: 1 / -1; }
.adm-acts { display: grid; gap: .35em; }
.adm-acts .lbl { width: 4.5em; font-size: .8rem; color: var(--ink-soft); flex: none; }
.col-scroll { container-type: inline-size; }
@container (max-width: 820px) { .adm-students { grid-template-columns: 1fr; } .adm-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-students .row > .grow input { min-width: 8em; }
.rel-role input { width: auto; flex: none; margin: .25em 0 0; accent-color: #7a5a34; }
.rel-role > span { min-width: 0; }
/* 탭을 바꾸는 중: 내용은 그대로 두고 살짝 흐리게 (깜빡임 대신) */
.col-scroll.loading { opacity: .55; pointer-events: none; transition: opacity .12s .05s; }

/* 프로필 카드: 세로로 길게 — 관계 칸까지 한눈에 */
dialog.pf-dlg[open] { display: flex; flex-direction: column; height: min(900px, calc(100vh - 40px)); max-height: none; }
.pf-head, .pf-ribbon, .pf-foot { flex: none; }
/* 우편함: 안 읽은 편지 / 읽은 편지 */
.mrow.unread { background: rgba(217,180,90,.16); box-shadow: inset 3px 0 0 var(--gilt); }
.mrow.unread .msubj { font-weight: 700; color: var(--ink); }
.mrow.unread .mmeta { color: var(--ink); }
.mrow.read .msubj { font-weight: 400; color: var(--ink-soft); }
.mrow.read .micon { opacity: .6; }
.mnew { display: inline-block; font-family: var(--sans); font-size: .6rem; font-weight: 700; color: #fff; background: var(--oxblood); border-radius: 2px; padding: 0 .35em; margin-right: .4em; vertical-align: 1px; }

/* ── 스탯 투자 ── */
.seg.abil { position: relative; }
.stat-up { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: .15em .55em; margin-left: .3em; border: 1px solid var(--gilt); background: linear-gradient(#f3d98a, #d9b45a); color: #3b2a17; border-radius: var(--r); cursor: pointer; animation: statGlow 1.6s ease-in-out infinite; }
.stat-up b { font-size: 1rem; line-height: 1.1; } .stat-up span { font-family: var(--sans); font-size: .6rem; }
@keyframes statGlow { 50% { box-shadow: 0 0 0 3px rgba(217,180,90,.35); } }
dialog.stat-dlg { width: min(560px, calc(100vw - 32px)); }
.stat-dlg h2 { margin: 0 0 .2em; font-family: var(--display); font-weight: 400; }
.stat-left { font-size: .95rem; margin: .3em 0 .5em; } .stat-left b { font-size: 1.3rem; color: var(--gilt); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4em; }
.stat-cell { border: 1px solid var(--parch-edge); background: rgba(255,250,235,.5); text-align: center; padding: .4em .3em; }
.stat-cell.up { border-color: var(--gilt); background: rgba(217,180,90,.18); }
.stat-cell .k { font-family: var(--sans); font-size: .7rem; color: var(--ink-soft); }
.stat-cell .v { font-size: 1.35rem; font-family: var(--display); } .stat-cell .arrow { color: var(--moss); font-weight: 700; }
.stat-cell .btn { padding: 0 .65em; }
.stat-warn { margin-top: .7em; padding: .5em .7em; border: 1px solid var(--oxblood); background: rgba(138,44,34,.08); color: var(--oxblood); font-size: .85rem; }
/* ── 학기말 시험 ── */
.exam-grades { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .2em; margin-top: .25em; }
.exam-grades .eg { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); padding: .1em 0; background: rgba(255,250,235,.5); }
.exam-grades .eg i { font-style: normal; font-family: var(--sans); font-size: .58rem; color: var(--ink-soft); white-space: nowrap; }
.exam-grades .eg b { font-family: var(--display); font-size: 1.05rem; }
.eg.g-O b { color: #9c7426; } .eg.g-E b { color: var(--moss); } .eg.g-A b { color: #2d4f7c; } .eg.g-P b, .eg.g-D b, .eg.g-T b { color: var(--oxblood); }
.eg.g-O { background: rgba(217,180,90,.2); }
/* ── 비밀 거래소 ── */
.mk-banner { padding: .5em .8em; margin-bottom: .7em; border: 1px dashed var(--parch-edge); background: rgba(60,45,25,.07); font-size: .88rem; }
.mk-list li { padding: .45em 0; }
.mk-price { font-family: var(--display); font-size: 1.1rem; color: var(--gilt); margin-right: .3em; }
.mk-hint { border-left: 3px solid var(--gilt); padding: .3em .6em; background: rgba(217,180,90,.1); display: grid; gap: .1em; }
.mk-hint .bad { color: var(--oxblood); }
/* 쿨타임 */
.cd { font-variant-numeric: tabular-nums; font-family: var(--sans); }
.cd-line { margin-top: .2em; color: var(--oxblood); }
.cd-line .cd, .cd-mini .cd { font-weight: 600; }
.cd.ready { color: var(--moss); }
.cd-mini { font-size: .72rem; color: var(--ink-soft); }
/* 출석부 */
.att-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3em; margin-top: .5em; }
.att-d { display: flex; flex-direction: column; align-items: center; padding: .3em 0; border: 1px solid var(--line); background: rgba(255,250,235,.45); }
.att-d .n { font-family: var(--sans); font-size: .62rem; color: var(--ink-soft); }
.att-d .m { font-size: 1rem; line-height: 1.4; color: var(--ink-soft); }
.att-d.on { background: rgba(63,107,58,.14); border-color: rgba(63,107,58,.45); } .att-d.on .m { color: var(--moss); font-weight: 700; }
.att-d.gift { border-color: var(--gilt); background: rgba(217,180,90,.15); }
.att-d.today { outline: 2px dashed var(--gilt); outline-offset: -3px; }
/* 고르는 사용 창 */
dialog.choice-dlg { width: min(460px, calc(100vw - 32px)); }
.choice-dlg h2 { margin: 0 0 .2em; font-family: var(--display); font-weight: 400; }
.choice-opts { display: grid; gap: .45em; margin: .4em 0 .7em; }
.choice-opt { display: flex; flex-direction: column; align-items: flex-start; gap: .15em; text-align: left; padding: .6em .8em; border: 1px solid var(--parch-edge); background: rgba(255,250,235,.55); cursor: pointer; border-radius: var(--r); }
.choice-opt:hover { border-color: var(--gilt); background: rgba(217,180,90,.18); }
/* 프로필 사진 편집 */
.pf-avatar-link { position: relative; }
.pf-avatar-link img { position: absolute; max-width: none; object-fit: fill; }
dialog.crop-dlg { width: min(560px, calc(100vw - 32px)); }
.crop-dlg h2 { margin: 0 0 .4em; font-family: var(--display); font-weight: 400; }
.crop-src { margin: .3em 0 .6em; }
.crop-main { display: flex; gap: 1em; align-items: flex-start; flex-wrap: wrap; }
.crop-view { position: relative; overflow: hidden; flex: none; background: repeating-conic-gradient(#e9dcbc 0 25%, #f4ead2 0 50%) 0 0 / 16px 16px; border: 3px solid var(--gilt); box-shadow: 0 2px 8px rgba(0,0,0,.25); cursor: grab; touch-action: none; user-select: none; }
.crop-view.grab { cursor: grabbing; }
.crop-img { position: absolute; max-width: none; pointer-events: none; }
.crop-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1em; font-size: .82rem; color: var(--ink-soft); }
.crop-side { flex: 1; min-width: 12em; }
.crop-side input[type=range] { flex: 1; accent-color: #7a5a34; }
.mk-list li.mk-mine { background: rgba(217,180,90,.1); box-shadow: inset 3px 0 0 var(--gilt); padding-left: .5em; }
.btn.danger { color: var(--oxblood); border-color: rgba(138,44,34,.45); }
/* ── 내 방 ── */
.me-head { display: flex; align-items: center; gap: .8em; padding: .7em 1em; margin-bottom: .7em; color: #f6ecd2; background: repeating-linear-gradient(135deg, transparent 0 14px, rgba(255,255,255,.04) 14px 16px), linear-gradient(160deg, var(--ha), var(--hd)); border-bottom: 3px solid var(--hb); border-radius: var(--r); }
.me-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.4rem; }
.title-list li.on { background: rgba(217,180,90,.15); }
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3em .8em; }
.rec { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: .15em 0; font-size: .85rem; }
.rec .k { color: var(--ink-soft); }
.rec-more { margin-top: .5em; font-size: .85rem; } .rec-more summary { cursor: pointer; color: var(--ink-soft); }
.rec-exam { margin: .3em 0 .5em; }
.dm-log { height: 15em; overflow-y: auto; padding: .4em; margin-top: .5em; border: 1px solid var(--line); background: rgba(255,250,235,.5); display: flex; flex-direction: column; gap: .3em; }
.dm { display: flex; flex-direction: column; align-items: flex-start; max-width: 85%; }
.dm.mine { align-self: flex-end; align-items: flex-end; }
.dm .bubble { padding: .3em .6em; border-radius: 8px; background: #fff8e6; border: 1px solid var(--line); font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dm.mine .bubble { background: #ecdcb4; }
.dm .t { font-family: var(--sans); font-size: .62rem; color: var(--ink-soft); }
.me-dm input[type=text] { flex: 1; }
/* 성별 고르기 */
.gender-pick { display: flex; align-items: center; gap: .35em; flex-wrap: wrap; margin-bottom: .5em; }
.gender-pick .lbl { font-weight: 600; font-size: .9rem; margin-right: .3em; }
.gender-pick .btn.on { background: #3b2a17; color: #f6ecd2; border-color: #3b2a17; }
.gender-pick input { width: 10em; }
.pf-facts.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 520px) { .pf-facts.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.me-head .btn { background: rgba(255,255,255,.12); color: #f6ecd2; border-color: rgba(246,236,210,.45); }
.friend-head { display: flex; align-items: center; gap: .5em; }
.alert-toggle { display: inline-flex; align-items: center; gap: .25em; font-weight: 400; color: var(--ink); cursor: pointer; white-space: nowrap; }
.alert-toggle input { width: auto; margin: 0; accent-color: #7a5a34; }
.btn.bell { padding: .05em .45em; opacity: .55; } .btn.bell.on { opacity: 1; }
.chip.fly { margin-right: .3em; } .chip.fly1 { color: var(--oxblood); border-color: rgba(138,44,34,.4); } .chip.fly2 { color: var(--moss); } .chip.fly3 { color: #7a5a08; background: rgba(217,180,90,.25); border-color: var(--gilt); font-weight: 700; }
.sell-box { display: inline-flex; gap: .25em; align-items: center; } .sell-n { width: 3.6em; padding: .1em .3em; }
/* 내 방 하위 탭 · 룸메이트 상태 */
.me-title-row { display: flex; align-items: baseline; gap: .7em; flex-wrap: wrap; }
.mate-line { display: inline-flex; align-items: center; gap: .3em; font-size: .78rem; opacity: .85; }
.mate-line .dot { background: rgba(246,236,210,.45); }
.mate-line .dot.on { background: #8fd17f; box-shadow: 0 0 0 2px rgba(143,209,127,.25); }
.mate-line b { font-weight: 600; }
.me-tabs { display: flex; gap: .3em; margin: -.2em 0 .7em; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.me-tabs .btn { border-radius: var(--r) var(--r) 0 0; border-bottom: none; margin-bottom: -1px; }
.me-tabs .btn.on { background: var(--parch); border-color: var(--line); font-weight: 600; }
.cx.worn { border-color: var(--gilt-hi, #d9b45a); box-shadow: 0 0 0 2px rgba(217,180,90,.3); }
.dm-log.big { height: min(60vh, 32em); }
.tag.info { color: var(--ink); background: rgba(217,180,90,.18); border-color: rgba(160,120,40,.45); }
/* 퀴디치: 내기 · 리그 표 */
.hdot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; }
.bet-side { padding: .3em 0; border-bottom: 1px dotted var(--line); gap: .5em; }
.qtable { width: 100%; border-collapse: collapse; } .qtable th, .qtable td { padding: .2em .3em; text-align: left; border-bottom: 1px dotted var(--line); } .qtable th { color: var(--ink-soft); font-weight: 600; }
b.good { color: var(--moss); } b.bad { color: var(--oxblood); }
.notice-1y { background: rgba(217,180,90,.14); border-left: 3px solid var(--gilt-hi, #d9b45a); }
/* 버전 · 공지 · 초대코드 */
.topbar .title { display: flex; flex-direction: column; line-height: 1.1; }
.topbar .title .ver, .gate-ver { font-family: var(--sans); font-size: .62rem; color: #9a917f; letter-spacing: .04em; }
.gate-ver { text-align: center; margin-top: .6em; }
.red-dot { display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: #d23a2a; margin-left: .3em; vertical-align: super; box-shadow: 0 0 0 2px rgba(210,58,42,.2); }
.notice summary { display: flex; gap: .6em; align-items: baseline; cursor: pointer; }
.notice-body { white-space: pre-wrap; margin: .5em 0 .3em; line-height: 1.6; }
.inv-code { font-family: var(--mono, ui-monospace, monospace); font-size: .9rem; letter-spacing: .08em; background: rgba(0,0,0,.05); padding: 0 .3em; border-radius: 2px; user-select: all; }
.inv-table tr.dim td { opacity: .55; }
