@font-face { font-family: 'A2Z'; src: url('../fonts/A2Z-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'A2Z'; src: url('../fonts/A2Z-Medium.woff2') format('woff2'); font-weight: 500 600; font-display: swap; }
@font-face { font-family: 'A2Z'; src: url('../fonts/A2Z-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --green: #104b3a;
  --green-deep: #0b392c;
  --green-soft: #e2efe9;
  --orange: #ff6334;
  --ink: #1d2a26;
  --muted: #66706c;
  --paper: #f3f5f6;
  --card: #ffffff;
  --rule: #e2e6e7;
  --amber: #b7791f;
  --danger: #a63d32;
  --danger-soft: #f6e3df;
  --map-dark: #13212b;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(30, 40, 30, .14);
  font-family: 'A2Z', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 공통 컨트롤 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--rule);
  background: var(--card); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
@media (hover: hover) { .btn:hover { background: #f3f5f4; } }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
@media (hover: hover) { .btn-primary:hover { background: var(--green-deep); } }
.btn-ghost { border-color: transparent; background: transparent; }
@media (hover: hover) { .btn-ghost:hover { background: #eef1f0; } }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
@media (hover: hover) { .btn-danger:hover { background: #f0d3cd; } }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; height: 46px; font-size: 15px; }

.field { display: grid; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(49, 89, 67, .15); }
.error-text { color: var(--danger); font-size: 13px; min-height: 18px; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 9999;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow); animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 다이얼로그 ---------- */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 900; background: rgba(28, 32, 26, .42);
  display: grid; place-items: center; padding: 16px; animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
}
.dialog-wide { width: min(880px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 8px; }
.dialog-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.dialog-body { padding: 8px 20px 20px; display: grid; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }
.setting-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.setting-row:first-child { border-top: 0; }
.setting-row > .label { align-self: start; padding-top: 10px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }

/* ---------- 플랫폼 레이아웃(관리자, 활동지) ---------- */
.topbar { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1040px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 20px; padding: 0 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; text-decoration: none; }
.brand img { height: 30px; display: block; }
.topbar { background: #fff !important; }
.topnav a { font-size: 14px; font-weight: 600; text-decoration: none; padding: 19px 2px; border-bottom: 2px solid var(--green); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: var(--muted); }
.page { max-width: 1040px; margin: 0 auto; padding: 28px 16px 80px; }
.page-narrow { max-width: 760px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none; margin-bottom: 10px; }
.meta-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.meta-line strong { color: var(--green); font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.toolbar .spacer { flex: 1; }
.search { position: relative; width: min(300px, 100%); }
.search .input { padding-left: 34px; height: 40px; }
.search svg { position: absolute; left: 11px; top: 11px; color: var(--muted); }
.segmented { display: inline-flex; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 7px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--green-soft); color: var(--green-deep); }
.segmented .count { margin-left: 4px; font-weight: 500; }
.stage-tabs { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--rule); margin: 18px 0 8px; }
.stage-tabs a { padding: 10px 2px; text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.stage-tabs a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.stage-tabs .sep { color: var(--rule); }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 4px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 700; }

.table-wrap { border: 1px solid var(--rule); border-radius: 12px; overflow: auto; background: var(--card); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); background: #f1f4f3; padding: 12px 14px; }
table.data td { padding: 14px; border-top: 1px solid #ebecdf; font-size: 14px; vertical-align: middle; }
table.data tbody tr { cursor: pointer; }
@media (hover: hover) { table.data tbody tr:hover td { background: #f7f9f8; } }
.cell-title { font-weight: 600; }
.cell-sub { display: flex; gap: 10px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.cell-sub a { color: var(--green); font-weight: 600; }
.dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #9a9c8c; }
.dot.ok::before { background: #2e8b57; }
.dot.mid::before { background: var(--amber); }
.sub-note { color: var(--muted); font-size: 12px; margin-left: 6px; }
.status-active { color: var(--green); font-weight: 600; }
.status-archived { color: var(--muted); font-weight: 600; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 800; background: rgba(28, 32, 26, .32); animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); z-index: 801; background: var(--card);
  box-shadow: var(--shadow); overflow: auto; animation: slide .2s ease;
}
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { position: sticky; top: 0; background: var(--card); display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-body { padding: 16px 20px 40px; display: grid; gap: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #f1f2e7; border-radius: 10px; padding: 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 700; }
.answer-list { display: grid; gap: 8px; }
.answer-item { border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.answer-item .q { font-weight: 600; margin-bottom: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-ok { background: #dcefe3; color: #23613f; }
.tag-bad { background: var(--danger-soft); color: var(--danger); }
.tag-wait { background: #ececdf; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-card { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: #f0f0e6; }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
.photo-card .cap { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.86); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- 학생 입장(탑승권) ---------- */
.ticket-page { min-height: 100dvh; display: flex; flex-direction: column; }
.ticket-wrap { flex: 1; display: grid; place-items: center; padding: 24px 16px 48px; }
.ticket { display: grid; grid-template-columns: 1fr 180px; width: min(760px, 100%); filter: drop-shadow(0 18px 30px rgba(40, 50, 35, .12)); }
.ticket-main { background: var(--card); border-radius: 16px 0 0 16px; overflow: hidden; border-right: 2px dashed var(--rule); }
.ticket-band { background: var(--green); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; font-size: 13px; font-weight: 600; }
.ticket-body { padding: 22px; display: grid; gap: 16px; }
.ticket-body h1 { margin: 0; font-size: 24px; font-weight: 700; }
.ticket-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pin-wrap { position: relative; }
.pin-wrap button { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); }
.ticket-stub { background: #e9eddf; border-radius: 0 16px 16px 0; display: grid; place-items: center; text-align: center; padding: 18px; color: var(--green); }
.ticket-stub strong { display: block; font-size: 30px; font-weight: 700; margin-top: 8px; }
.ticket-stub span { font-size: 13px; color: var(--muted); }
.ticket-class { font-size: 13px; color: var(--muted); }
.staff-link { text-align: center; margin-top: 18px; font-size: 13px; }
.staff-link a { color: var(--muted); }
.demo-note { max-width: 760px; margin: 0 auto 18px; padding: 10px 14px; border-radius: 10px; background: #fbf3dc; color: #7a5a12; font-size: 13px; }

@media (max-width: 640px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-main { border-radius: 16px 16px 0 0; border-right: 0; border-bottom: 2px dashed var(--rule); }
  .ticket-stub { border-radius: 0 0 16px 16px; grid-template-columns: auto 1fr; gap: 12px; text-align: left; }
  .ticket-fields { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; }
  .setting-row > .label { padding-top: 0; }
}

/* ---------- 지도 게임 ---------- */
.safari-root { position: fixed; inset: 0; overflow: hidden; background: #2e4a32 url('../safari-assets/generated/safari/map-ground-background-v1.webp') center / cover; touch-action: none; user-select: none; -webkit-user-select: none; }
.map-viewport { position: absolute; inset: 0; cursor: grab; }
.map-viewport.dragging { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; width: 1500px; height: 850px; transform-origin: 0 0; will-change: transform; }
.map-world > img.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bld-lock { fill: var(--map-dark); fill-opacity: .93; stroke: rgba(255,255,255,.08); stroke-width: 1; cursor: pointer; transition: fill-opacity .2s; }
@media (hover: hover) { .bld-lock:hover { fill-opacity: .86; } }
.bld-open { fill: rgba(255, 244, 196, 0); stroke: rgba(255, 233, 150, 0); stroke-width: 3; cursor: pointer; transition: fill .2s, stroke .2s; }
@media (hover: hover) { .bld-open:hover, .bld-open.next { fill: rgba(255, 244, 196, .16); stroke: rgba(255, 233, 150, .95); } }
.bld-open.done { stroke: rgba(160, 230, 180, .0); }
@media (hover: hover) { .bld-open.done:hover { stroke: rgba(160, 230, 180, .95); fill: rgba(200, 255, 220, .12); } }
.lock-icon { pointer-events: none; fill: rgba(255,255,255,.75); }
.map-marker { position: absolute; transform: translate(-50%, -100%); pointer-events: none; }
.next-arrow { width: 40px; height: 52px; animation: bob 1.1s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
@keyframes bob { 50% { transform: translateY(-10px); } }
.clear-badge { background: #fff; color: #23613f; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0,0,0,.25); letter-spacing: .04em; }
.bld-label { background: rgba(255,255,255,.92); color: var(--ink); font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.2); margin-bottom: 4px; }
.landmark-pin { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: rgba(49, 89, 67, .88); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(0,0,0,.3); padding: 0; }
@media (hover: hover) { .landmark-pin:hover { background: var(--green-deep); } }
.landmark-pin span { position: absolute; top: 32px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.95); color: var(--ink); font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; }
@media (hover: hover) { .landmark-pin:hover span, .landmark-pin:focus-visible span { opacity: 1; } }
.bus { position: absolute; width: 56px; height: 56px; transform: translate(-50%, -78%); background-repeat: no-repeat; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); z-index: 3; }
.car { position: absolute; width: 20px; height: 20px; transform: translate(-50%, -70%); background-repeat: no-repeat; pointer-events: none; opacity: .95; }

.hud { position: absolute; z-index: 20; }
.hud-score { top: 12px; left: 12px; display: flex; align-items: center; gap: 8px; background: rgba(16, 75, 58, .9); color: #fff; padding: 6px 12px 6px 8px; border-radius: 12px; backdrop-filter: blur(6px); }
.hud-score img { width: 30px; height: 30px; border-radius: 50%; background: #fff; }
.hud-score .k { font-size: 11px; opacity: .8; }
.hud-score .v { font-size: 20px; font-weight: 700; line-height: 1; transition: transform .2s; }
.hud-score .v.bump { transform: scale(1.25); color: #ffb59c; }
.hud-score .u { font-size: 12px; margin-left: 2px; opacity: .8; }
.hud-top-right { top: 12px; right: 12px; display: flex; gap: 8px; }
.hud-back { text-decoration: none; color: var(--green); }
.hud-btn { height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255,255,255,.92); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.hud-stage { top: 60px; left: 12px; background: rgba(255,255,255,.92); border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--green-deep); box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.hud-zoom { right: 12px; bottom: 112px; display: grid; gap: 6px; }
.hud-zoom button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: rgba(255,255,255,.92); font-size: 20px; font-weight: 600; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.codex-book { right: 12px; bottom: 12px; width: 92px; height: 96px; border: 0; border-radius: 18px; background: linear-gradient(160deg, #1b6a52, #104b3a); color: #fff; display: grid; place-items: center; align-content: center; gap: 4px; box-shadow: 0 6px 16px rgba(0,0,0,.35); padding: 6px; }
.codex-book svg { width: 38px; height: 38px; }
.codex-book .t { font-size: 12px; font-weight: 600; }
.codex-book.locked { background: linear-gradient(160deg, #3d4a4f, #1d2a30); }
.codex-book.locked::after { content: ''; position: absolute; inset: 8px; border-radius: 10px; background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(200,200,200,.35) 12px 15px); pointer-events: none; }
.codex-book.unlocking { animation: shake .6s ease 2; }
@keyframes shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.hud-toast { top: 60px; left: 50%; transform: translateX(-50%); background: rgba(19,33,43,.9); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.score-pop { position: absolute; z-index: 30; color: #ffe27a; font-weight: 700; font-size: 26px; text-shadow: 0 2px 6px rgba(0,0,0,.5); pointer-events: none; animation: pop 1.1s ease forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateY(10px) scale(.8); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-50px) scale(1); } }
.confetti { position: fixed; z-index: 1200; width: 8px; height: 12px; pointer-events: none; animation: fall 1.2s ease-out forwards; }
@keyframes fall { to { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; } }

/* 단과대 소개 시트 */
.sheet-backdrop { position: fixed; inset: 0; z-index: 600; background: rgba(10, 18, 22, .5); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.sheet { width: min(720px, 100%); max-height: calc(100dvh - 32px); background: var(--card); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.sheet-head h2 { margin: 0; font-size: 18px; font-weight: 700; flex: 1; }
.sheet-scroll { overflow: auto; padding: 0 0 24px; }
.sheet-hero { position: relative; background: #eef1e6; }
.sheet-hero img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.sheet-hero .personality { position: absolute; left: 14px; bottom: 12px; background: rgba(255,255,255,.92); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.sheet-sec { padding: 18px 20px 0; }
.sheet-sec h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; color: var(--green-deep); }
.sheet-sec p { margin: 0 0 10px; }
.tagline { font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.blurb p { margin: 0 0 10px; }
.blurb strong { background: linear-gradient(transparent 60%, #f6e7a8 60%); font-weight: 600; }
.figure { margin: 0 0 12px; border-radius: 12px; overflow: hidden; background: #eef0e4; }
.figure img { display: block; width: 100%; height: auto; }
.figure figcaption { font-size: 12px; color: var(--muted); padding: 8px 10px; display: flex; justify-content: space-between; gap: 10px; }
.figure figcaption a { color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: #eef0e4; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.person { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: #f3f4ea; margin-bottom: 8px; }
.person img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: #ddd; }
.person .n { font-weight: 700; }
.person .r { font-size: 13px; color: var(--muted); }
.person ul { margin: 6px 0 0; padding-left: 16px; font-size: 13px; }
.hint-box { display: flex; gap: 10px; align-items: flex-start; background: #fbf3dc; border-radius: 12px; padding: 12px; font-size: 14px; }
.hint-box img { width: 40px; height: 40px; flex: none; }

.quiz-box { margin: 18px 20px 0; border-radius: 14px; background: #f1f4ea; padding: 16px; }
.quiz-box.locked { opacity: .55; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.quiz-q { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; border: 1.5px solid var(--rule); background: #fff; border-radius: 10px; padding: 12px 14px; font-size: 15px; display: flex; gap: 10px; align-items: flex-start; transition: border-color .15s, background .15s; }
@media (hover: hover) { .choice:hover:not(:disabled) { border-color: var(--green); } }
.choice .no { width: 22px; height: 22px; border-radius: 50%; background: #eef0e4; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 1px; }
.choice.right { border-color: #2e8b57; background: #e5f3ea; }
.choice.wrong { border-color: var(--danger); background: var(--danger-soft); }
.choice:disabled { cursor: default; }
.feedback { display: flex; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 12px; background: #fff; font-size: 14px; align-items: flex-start; }
.feedback img { width: 48px; height: 48px; flex: none; }
.feedback .h { font-weight: 700; margin-bottom: 2px; }
.quiz-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.read-gate { text-align: center; font-size: 13px; color: var(--muted); padding: 10px; }

/* 학과 도감 */
.codex { position: fixed; inset: 0; z-index: 650; background: var(--paper); display: flex; flex-direction: column; animation: fade .15s; }
.codex-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.codex-head h2 { margin: 0; font-size: 18px; flex: 1; }
.codex-progress { font-size: 13px; color: var(--muted); }
.codex-progress b { color: var(--green); }
.codex-filters { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.codex-filters button { flex: none; border: 1px solid var(--rule); background: #fff; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.codex-filters button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.codex-body { flex: 1; overflow: auto; padding: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-width: 1100px; margin: 0 auto; }
.dept-card { position: relative; border: 0; padding: 0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 3px 10px rgba(30,40,30,.1); text-align: left; transition: transform .15s; }
@media (hover: hover) { .dept-card:hover { transform: translateY(-2px); } }
.dept-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.dept-card .info { padding: 8px 10px 10px; }
.dept-card .n { font-weight: 700; font-size: 14px; }
.dept-card .c { font-size: 12px; color: var(--muted); }
.dept-card .bar { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.dept-card.todo img { filter: grayscale(.85) brightness(.95); }
.dept-card .stamp { position: absolute; top: 10px; right: 10px; background: #fff; color: #23613f; border: 2px solid #23613f; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; transform: rotate(8deg); }
.dept-card .stamp.bad { color: var(--danger); border-color: var(--danger); }
.codex-locked { max-width: 420px; margin: 60px auto; text-align: center; }
.codex-locked img { width: 140px; }
.dept-detail { max-width: 760px; margin: 0 auto; }
.dept-detail .hero { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.dept-detail .hero img { width: 120px; height: 120px; border-radius: 16px; object-fit: cover; }
.dept-detail h3 { font-size: 15px; color: var(--green-deep); margin: 18px 0 8px; }
.dept-detail ul { margin: 0; padding-left: 18px; }
.dept-detail li { margin-bottom: 6px; }
.dept-detail .quiz-box { margin: 18px 0 0; }

/* 관심사 체크 */
.interest-group { margin-bottom: 14px; }
.interest-group h3 { margin: 0 0 6px; font-size: 14px; }
.interest-item { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--rule); margin-bottom: 6px; font-size: 14px; cursor: pointer; }
.interest-item input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; }
.reco { display: grid; gap: 8px; }
.reco-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: #f1f4ea; }
.reco-item .bar { flex: 1; height: 8px; background: #dfe3d4; border-radius: 99px; overflow: hidden; }
.reco-item .bar i { display: block; height: 100%; background: var(--green); }

/* 코치마크 */
.coach { position: absolute; z-index: 40; width: min(340px, calc(100% - 24px)); left: 12px; bottom: 12px; background: #fff; border-radius: 16px; padding: 16px; box-shadow: var(--shadow); }
.coach .h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 17px; }
.coach .h span { font-size: 12px; color: var(--muted); font-weight: 600; }
.coach p { margin: 8px 0 14px; font-size: 14px; }
.coach .acts { display: flex; justify-content: space-between; }

/* 전체 화면 안내(로딩, 오류, 단계 안내) */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px; text-align: center; }
.center-screen .box { max-width: 420px; display: grid; gap: 12px; justify-items: center; }
.center-screen img { width: 120px; }
.center-screen h1 { margin: 0; font-size: 22px; }

@media (max-width: 640px) {
  .hud-zoom { display: none; }
  .codex-book { width: 72px; height: 76px; }
  .sheet-backdrop { padding: 0; align-items: end; }
  .sheet { border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- 탐사, 에필로그 ---------- */
.tool-tabs { display: flex; gap: 6px; margin: 12px 0 6px; flex-wrap: wrap; }
.tool-tabs a { text-decoration: none; padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.tool-tabs a[aria-current="page"] { background: var(--green); color: #fff; }
.sub-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: 14px 0 18px; }
.sub-tabs button { border: 0; background: transparent; padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 12px; padding: 16px; }
.quiz-list { display: grid; gap: 10px; }
.quiz-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.quiz-row .t { font-weight: 700; }
.q-editor { display: grid; gap: 12px; }
.q-item { border: 1px solid var(--rule); border-radius: 12px; padding: 14px; background: #fff; display: grid; gap: 10px; }
.q-item-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }
.choice-edit { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.choice-edit input[type=radio] { width: 18px; height: 18px; accent-color: #2e8b57; }
.host { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.host-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.phase-pill { background: var(--green-soft); color: var(--green-deep); font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.timer { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer.urgent { color: var(--danger); }
.host-q { font-size: 22px; font-weight: 700; margin: 6px 0 14px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 26px 1fr 44px; gap: 8px; align-items: center; font-size: 14px; }
.bar-row .no { width: 24px; height: 24px; border-radius: 50%; background: #eef0e4; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.bar-row.correct .no { background: #2e8b57; color: #fff; }
.bar-track { position: relative; background: #f0f1e6; border-radius: 8px; overflow: hidden; min-height: 38px; display: flex; align-items: center; }
.bar-track i { position: absolute; inset: 0 auto 0 0; background: #dfe7d6; }
.bar-row.correct .bar-track i { background: #cde9d6; }
.bar-track span { position: relative; padding: 6px 10px; }
.host-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.rank-list { display: grid; gap: 6px; }
.rank-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; background: #f3f4ea; font-size: 14px; }
.rank-item .r { font-weight: 700; color: var(--green); }
.rank-item.me { background: #fbf3dc; }
.live-wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; }
.live-card { background: var(--card); border-radius: 16px; box-shadow: 0 8px 24px rgba(30,40,30,.08); padding: 20px; display: grid; gap: 14px; text-align: center; }
.live-card .choices { text-align: left; }
.live-card h2 { margin: 0; font-size: 20px; }
.live-card .big { font-size: 34px; font-weight: 700; color: var(--green); }
.live-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.result-banner { border-radius: 12px; padding: 14px; font-weight: 700; font-size: 18px; }
.result-banner.ok { background: #e5f3ea; color: #23613f; }
.result-banner.bad { background: var(--danger-soft); color: var(--danger); }
.result-banner.none { background: #ececdf; color: var(--muted); }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); display: inline-block; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .4; } }
.stagebar { position: absolute; z-index: 20; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; background: rgba(255,255,255,.92); padding: 4px; border-radius: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.stagebar a, .stagebar span { padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.stagebar [aria-current="page"] { background: var(--green); color: #fff; }
.stagebar .off { color: #a6a897; }
.review-q { display: grid; gap: 6px; }
.review-q label { font-weight: 700; }
.save-state { font-size: 13px; color: var(--muted); }
.mentor-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
@media (max-width: 860px) { .host { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .stagebar { top: 58px; } .hud-stage { top: 104px; } }

/* 관리자 모바일: 상단 메뉴 한 줄, 필터 칩은 가로 스크롤 */
.topnav a, .topbar .who { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar-inner { gap: 12px; padding: 0 14px; height: 56px; }
  .topbar .brand img { height: 26px; }
  .topbar .who { display: none; }
  .segmented { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { white-space: nowrap; flex: none; }
  .page { padding-left: 16px; padding-right: 16px; }
}
/* 관리자: 멘토 사진 */
.mentor-admin { display: flex; flex-wrap: wrap; gap: 14px; }
.mentor-admin figure { margin: 0; display: grid; justify-items: center; gap: 6px; width: 120px; }
.mentor-admin img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; }
.mentor-admin figcaption { font-size: 13px; font-weight: 600; text-align: center; }
/* 관리자: 버스 퀴즈 진행 */
.bus-host { align-items: start; }
.live-answers { margin-top: 14px; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.bank-card { margin-top: 16px; }
.bank-list { display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.bank-row { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #f7f9f8; }
.bank-row.now { background: #fff1ea; box-shadow: inset 0 0 0 2px #FF6334; }
.bank-row .no { font-weight: 700; color: var(--muted); text-align: center; }
.bank-row b { display: block; font-size: 14px; }
.bank-row .muted { font-size: 12.5px; }
/* 관리자: 실천 시간표 인증 */
.practice-admin { display: grid; gap: 10px; margin: 10px 0 24px; }
.pa-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; }
.pa-row img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.pa-info { display: grid; gap: 4px; justify-items: start; }
.pa-acts { display: flex; gap: 6px; }
.pa-row.approved { opacity: .75; }
.bus-host { grid-template-columns: minmax(0, 1fr) 300px; }
.bus-host .rank-item span:first-child { white-space: nowrap; }
@media (max-width: 900px) { .bus-host { grid-template-columns: 1fr; } }
/* 관리자: 멘토 한마디 */
.notes-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.na-row { display: grid; gap: 8px; }
.na-who { display: grid; gap: 2px; }
.na-who .muted { font-size: 13px; }
.na-row .textarea { min-height: 70px; }
.na-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* 모바일 운영 화면: 탭은 한 줄로 두고 옆으로 밀어서 봐요(글자가 두 줄로 깨지거나 잘리지 않게), 작은 글자 링크도 손가락으로 누르기 쉽게 */
@media (max-width: 640px) {
  .stage-tabs, .sub-tabs, .tool-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .stage-tabs::-webkit-scrollbar, .sub-tabs::-webkit-scrollbar, .tool-tabs::-webkit-scrollbar, .segmented::-webkit-scrollbar { display: none; }
  .stage-tabs a, .sub-tabs button, .tool-tabs a, .segmented button { flex: none; white-space: nowrap; }
  .stage-tabs .spacer { flex: 0 0 4px; }
  .stage-tabs a, .sub-tabs button { min-height: 44px; display: inline-flex; align-items: center; }
  .back-link { display: inline-flex; align-items: center; min-height: 40px; }
  .topbar .btn-sm { min-height: 40px; }
}
@media (pointer: coarse) {
  .pp-staff a, .pa-links a, .staff-link a, .lp-foot a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
}
/* 포스트로그 운영: 메아 피드백 입력 */
.mea-list { display: grid; gap: 12px; }
.mea-row { display: grid; gap: 10px; }
.mea-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mea-top b { font-size: 17px; margin-right: 4px; }
.mea-skills { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.mea-skills label { display: grid; gap: 4px; font-size: 13px; color: var(--muted, #6b7a74); }
.mea-skills .input { text-align: center; }
@media (max-width: 720px) { .mea-skills { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mea-row .textarea { min-height: 70px; }
.bp-admin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bp-admin figure { margin: 0; display: grid; gap: 6px; }
.bp-admin figcaption { font-size: 13px; font-weight: 600; }
.bp-admin img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
@media (max-width: 640px) { .bp-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
