:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --line: #dde3ea;
  --ink: #1d2733;
  --ink-soft: #66727f;
  --accent: #0f766e;
  --accent-soft: #e2f3f1;
  --map-bg: #e9eef3;
  --map-fill: #ffffff;
  --map-stroke: #3b4754;
  --map-hover: #dbeafe;
  --map-sel: #f97316;
  --radius: 10px;
  --sel-row: #fff1e6;              /* 목록에서 선택한 줄 */
  --glass: rgb(255 255 255 / 0.88); /* 지도 위에 뜨는 제목·안내 */
  --dim: rgb(233 238 243 / 0.6);    /* 불러오는 중 가림막 */
  --pop: #1d2733;                   /* 알림·이름 풍선 (밝기와 상관없이 어두운 바탕) */
  --fav-bg: #fffbeb; --fav-line: #fde68a;
  --on-accent: #ffffff;              /* 청록 바탕 위 글자 */
  color-scheme: light;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
}

/* 어두운 테마: 시스템 설정을 따르거나(테마=시스템) 직접 고른 경우. 지도 칸 색(채우기)은 꾸미기 값 그대로 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131a; --panel: #161d26; --line: #273241; --ink: #e5ebf2; --ink-soft: #93a1b2;
    --accent: #2dd4bf; --accent-soft: #123532; --map-bg: #0b1016;
    --sel-row: #3a2615; --glass: rgb(22 29 38 / 0.9); --dim: rgb(11 16 22 / 0.6); --pop: #000000;
    --fav-bg: #2e2610; --fav-line: #5c4a12; --on-accent: #062b27;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131a; --panel: #161d26; --line: #273241; --ink: #e5ebf2; --ink-soft: #93a1b2;
  --accent: #2dd4bf; --accent-soft: #123532; --map-bg: #0b1016;
  --sel-row: #3a2615; --glass: rgb(22 29 38 / 0.9); --dim: rgb(11 16 22 / 0.6); --pop: #000000;
  --fav-bg: #2e2610; --fav-line: #5c4a12; --on-accent: #062b27;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button { font: inherit; color: inherit; cursor: pointer; }

.app { display: grid; grid-template-columns: 320px 1fr; height: 100vh; }

/* 왼쪽 패널 */
.panel {
  display: flex; flex-direction: column; gap: 12px; min-height: 0;
  padding: 18px 16px 12px; background: var(--panel); border-right: 1px solid var(--line);
}
.brand h1 { margin: 0; font-size: 19px; letter-spacing: -0.02em; }
.brand p { margin: 4px 0 0; font-size: 12px; color: var(--ink-soft); }
.brand b { color: var(--accent); }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: var(--radius); }
.tab { padding: 8px; border: 0; border-radius: 7px; background: transparent; font-weight: 600; color: var(--ink-soft); }
.tab.on { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }

.search { position: relative; }
.search input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search-results {
  position: absolute; z-index: 20; inset: calc(100% + 4px) 0 auto; max-height: 360px; overflow: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.search-results li { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.search-results li:hover, .search-results li.on { background: var(--accent-soft); }
.search-results small { display: block; color: var(--ink-soft); font-size: 11px; }
.search-results .empty { color: var(--ink-soft); cursor: default; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13px; }
.crumbs button { padding: 3px 7px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.crumbs button:last-child { background: var(--accent); color: var(--on-accent); cursor: default; }
.crumbs span { color: var(--ink-soft); }

.list-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.btn { padding: 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }

.list-title { font-size: 12px; color: var(--ink-soft); }
.list { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; font-size: 14px; }
.list li:hover { background: var(--bg); }
.list li.sel { background: var(--sel-row); }
.list label { flex: 1; display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.list label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list input { accent-color: var(--map-sel); }
.list .drill { padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.list .drill:hover { border-color: var(--accent); color: var(--accent); }

.unit-switch { display: flex; gap: 4px; }
.unit-switch:empty { display: none; }
.unit-switch button { flex: 1; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 13px; }
.unit-switch button.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.credits { font-size: 11px; line-height: 1.5; color: var(--ink-soft); }
.credits a { color: inherit; }

/* 오른쪽 지도 영역 */
.stage { display: flex; flex-direction: column; min-width: 0; }
.toolbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13px;
}
.toolbar { flex-wrap: wrap; row-gap: 8px; gap: 14px; }
.tool { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tool-name { color: var(--ink-soft); font-weight: 600; }
.tool input[type=range] { width: 90px; accent-color: var(--accent); }
.tool output { min-width: 24px; font-variant-numeric: tabular-nums; font-weight: 600; }
.tool input[type=color] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.tool select { padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--panel); }
.tool input[type=checkbox] { accent-color: var(--accent); }
.tool-sep { width: 1px; height: 20px; background: var(--line); }
.seg { display: flex; padding: 2px; border-radius: 7px; background: var(--bg); }
.seg button { padding: 3px 9px; border: 0; border-radius: 5px; background: transparent; font-size: 12px; color: var(--ink-soft); }
.seg button.on { background: var(--panel); color: var(--accent); font-weight: 700; box-shadow: 0 1px 2px rgb(0 0 0 / 0.1); }
.link-btn { padding: 0; border: 0; background: none; color: var(--ink-soft); font-size: 12px; text-decoration: underline; }
.link-btn:hover { color: var(--accent); }
.spacer { flex: 1; }
.export-hint { color: var(--ink-soft); font-size: 12px; }
.export { position: relative; display: flex; gap: 8px; }
.split { display: flex; }
.split button { border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.split-main { padding: 7px 12px; border-radius: 8px 0 0 8px; }
.split-more { padding: 7px 8px; border-left-color: rgb(255 255 255 / 0.35) !important; border-radius: 0 8px 8px 0; }
.split button:hover { background: #0b5f58; }
.export.busy button, .exp-actions.busy button { opacity: 0.5; pointer-events: none; }
.exp-btn { padding: 7px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.exp-btn:hover { filter: brightness(1.1); }
.exp-btn.ghost { background: var(--panel); color: var(--accent); }
.exp-btn.ghost:hover { background: var(--accent-soft); filter: none; }

/* 알림 (되돌리기 단추 포함) */
.toast {
  position: absolute; z-index: 25; left: 50%; bottom: 52px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 10px;
  background: var(--pop); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
}
.toast button { padding: 3px 8px; border: 1px solid rgb(255 255 255 / 0.4); border-radius: 6px; background: none; color: #fff; font-size: 12px; font-weight: 700; }
.toast button:hover { background: rgb(255 255 255 / 0.12); }
.menu .note { font-size: 11px; color: var(--ink-soft); cursor: default; white-space: normal; max-width: 220px; }
.menu .note:hover { background: none; }

/* 내보내기 창 */
.exp-dialog { width: min(900px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.2); }
.exp-dialog::backdrop { background: rgb(15 23 42 / 0.35); }
.exp-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.exp-head h3 { margin: 0; font-size: 16px; }
.exp-head .close { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ink-soft); }
.exp-body { display: grid; grid-template-columns: 300px 1fr; gap: 16px; padding: 14px 18px; }
.exp-options { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.exp-options fieldset { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.exp-options legend { padding: 0 4px; font-weight: 700; color: var(--ink-soft); font-size: 12px; }
.exp-options label { display: flex; align-items: baseline; gap: 6px; margin: 4px 0; cursor: pointer; flex-wrap: wrap; }
.exp-options label small { color: var(--ink-soft); font-size: 11px; }
.exp-options input { accent-color: var(--accent); }
.exp-options input:disabled + * , .exp-options label:has(input:disabled) { opacity: 0.45; cursor: default; }
.exp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.exp-row > span { width: 44px; color: var(--ink-soft); }
.exp-note { margin: 6px 0 0; font-size: 11px; color: var(--ink-soft); }
.exp-preview { display: flex; flex-direction: column; min-width: 0; }
.exp-preview img {
  width: 100%; height: 380px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px;
  /* 투명 배경이 보이도록 체크무늬 */
  background: conic-gradient(#eef1f5 25%, #fff 0 50%, #eef1f5 0 75%, #fff 0) 0 0 / 16px 16px;
}
.exp-preview img.white { background: #fff; }
.exp-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.menu {
  position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; min-width: 230px;
  margin: 0; padding: 4px; list-style: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
}
.menu li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.menu li:hover { background: var(--accent-soft); }
.menu small { display: block; color: var(--ink-soft); font-size: 11px; }

.map-wrap { position: relative; flex: 1; min-height: 0; background: var(--map-bg); }
.map-head { position: absolute; z-index: 5; top: 12px; left: 14px; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.map-head > * { pointer-events: auto; }
.map-head h2 { margin: 0; padding: 3px 10px; border-radius: 8px; background: var(--glass); font-size: 17px; }
.tool-name small { margin-left: 2px; font-weight: 400; font-size: 11px; }

/* 앱 안 입력창 */
.ask { width: 320px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / 0.18); }
.ask::backdrop { background: rgb(15 23 42 / 0.3); }
.ask h3 { margin: 0 0 10px; font-size: 15px; }
.ask input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; outline: none; }
.ask input:focus { border-color: var(--accent); }
.ask-btns { display: flex; flex-direction: row-reverse; gap: 6px; margin-top: 14px; }
.ask-btns .btn { min-width: 64px; }
.btn.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { color: var(--on-accent); filter: brightness(1.1); }
.chip { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 600; }
.chip.accent { border-color: var(--map-sel); background: var(--map-sel); color: #fff; }
#btnBack[disabled] { opacity: 0.4; cursor: default; }

#map { display: block; width: 100%; height: 100%; cursor: grab; user-select: none; touch-action: none; }
#map.dragging { cursor: grabbing; }
/* 색·테두리·모양은 map.applyStyle()이 #map 에 CSS 변수로 넣는다 */
.region {
  fill: var(--map-fill); stroke: var(--map-stroke); stroke-width: var(--map-stroke-w, 1);
  stroke-linejoin: var(--map-join, round); vector-effect: non-scaling-stroke;
}
.region:hover, .region.hover { filter: brightness(0.9); }
.region.sel { fill: var(--map-sel); }
.overlay path { fill: none; stroke: var(--map-stroke); stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.focus-mode .region:not(.sel) { fill: #e5e7eb !important; } /* export.js DIM_FILL 과 같은 색 */
#map.pin-mode { cursor: crosshair; }
.pin { cursor: move; }
.pin-num { text-anchor: middle; dominant-baseline: central; font-weight: 800; pointer-events: none; }
.route path { fill: none; stroke: #1d2733; stroke-dasharray: 6 5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }
.radius path { fill-opacity: 0.12; stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.pin.active path { stroke: #111827; stroke-width: 2.5; }

/* 오른쪽 클릭 메뉴 */
.menu.ctx { position: fixed; top: 0; right: auto; min-width: 200px; }
.menu .head { font-weight: 700; color: var(--ink-soft); font-size: 12px; cursor: default; }
.menu .head:hover { background: none; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.menu li.swatches { cursor: default; }
.menu li.swatches:hover { background: none; }
.swatches button { width: 20px; height: 20px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.swatches button.on { box-shadow: 0 0 0 2px var(--ink); }
.swatches input[type=color] { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }

/* 핀 편집 창 */
.pin-editor {
  position: absolute; z-index: 15; top: 12px; right: 14px; width: 220px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); font-size: 13px;
}
.pe-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pe-head .close { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--ink-soft); }
.pe-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.pe-row > span { width: 40px; color: var(--ink-soft); }
.pe-row input[type=range] { flex: 1; accent-color: var(--accent); }
.pe-row.actions { justify-content: flex-end; }
.btn.danger { color: #dc2626; }
.btn.danger:hover { border-color: #dc2626; color: #dc2626; }
.pe-tip { margin: 6px 0 0; font-size: 11px; color: var(--ink-soft); }

/* 도구줄 단추 */
.icon-btn { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 15px; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.toggle-btn { padding: 4px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 13px; }
.toggle-btn.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

/* 켜고 끄는 단추형 체크박스 (번호·범례, 동선, 색 범례) */
.toggle-chk { display: inline-flex; cursor: pointer; }
.toggle-chk input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-chk span { padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); font-size: 12px; white-space: nowrap; }
.toggle-chk input:checked + span { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.toggle-chk input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 급지 색 줄 */
.swatches .sw-label { font-size: 11px; color: var(--ink-soft); margin-right: 2px; }
.grades button { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 800; color: #fff; }

/* 지도 위 범례 */
.legend {
  position: absolute; z-index: 6; min-width: 120px; padding: 8px 12px 10px;
  background: rgb(255 255 255 / 0.96); border: 1px solid #cbd5e1; border-radius: 10px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.08); font-size: 13px; color: #1d2733; /* 범례는 파일에 들어가는 모습 그대로: 늘 흰 바탕 */
}
.lg-head { margin: -2px -4px 6px; padding: 2px 4px; font-weight: 800; cursor: move; user-select: none; }
.lg-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.lg-swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #94a3b8; flex: none; }
.lg-pin { width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; flex: none; }
.lg-text { min-width: 40px; padding: 1px 3px; border-radius: 4px; outline: none; cursor: text; }
.lg-text:hover { background: var(--bg); }
.lg-text:focus { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }

/* 검색 이동 단위 */
.search-jump { display: flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 11px; color: var(--ink-soft); }
.search-jump select { flex: 1; min-width: 0; padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--panel); }

.pe-row input[type=text], .pe-row select { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }

/* 즐겨찾기 */
.favs { display: flex; flex-wrap: wrap; gap: 4px; }
.fav { display: inline-flex; border: 1px solid var(--fav-line); border-radius: 999px; background: var(--fav-bg); font-size: 12px; overflow: hidden; }
.fav button { padding: 3px 8px; border: 0; background: none; }
.fav .rm { padding: 3px 6px 3px 0; color: var(--ink-soft); }
.list .star { padding: 0 4px; border: 0; background: none; color: #d1d5db; font-size: 15px; }
.list .star.on, .list .star:hover { color: #f59e0b; }
.labels { fill: #1d2733; stroke: #fff; paint-order: stroke; pointer-events: none; text-anchor: middle; dominant-baseline: central; font-weight: 600; }

.zoom { position: absolute; right: 14px; bottom: 44px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); font-size: 18px; }
.zoom button:hover { color: var(--accent); border-color: var(--accent); }

.tooltip {
  position: fixed; z-index: 30; padding: 4px 8px; border-radius: 6px; pointer-events: none;
  background: var(--pop); color: #fff; font-size: 12px; white-space: nowrap;
}
.loading {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--dim); font-weight: 600; color: var(--ink-soft);
}
.hint { position: absolute; left: 14px; bottom: 12px; padding: 5px 10px; border-radius: 999px; background: var(--glass); font-size: 12px; color: var(--ink-soft); }

/* 지도 + 오른쪽 꾸미기 패널 */
.stage-body { flex: 1; min-height: 0; display: flex; }
.stage-body .map-wrap { flex: 1; min-width: 0; }
.props {
  width: 260px; flex: none; overflow: auto; padding: 10px 12px 16px;
  background: var(--panel); border-left: 1px solid var(--line); font-size: 13px;
}
.props-head { display: flex; justify-content: space-between; align-items: center; margin: 2px 2px 8px; }
.props details { border-top: 1px solid var(--line); padding: 6px 2px; }
.props summary { padding: 4px 0; font-weight: 700; color: var(--ink-soft); font-size: 12px; cursor: pointer; list-style: none; }
.props summary::before { content: '▸ '; }
.props details[open] summary::before { content: '▾ '; }
.prop { display: flex; align-items: center; gap: 8px; margin: 7px 0; cursor: pointer; }
.prop-name { flex: 1; }
.prop input[type=range] { width: 110px; accent-color: var(--accent); }
.prop output { min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.prop input[type=color] { width: 32px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.prop select { padding: 3px 4px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--panel); color: var(--ink); }
.prop input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.prop .btn { flex: 1; }
.toolbar .icon-btn { font-weight: 700; }

/* 여행지 뽑기 */
.dice {
  position: absolute; z-index: 18; top: 60px; left: 50%; transform: translateX(-50%); width: min(520px, 92%);
  padding: 12px 14px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
}
.dice-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dice-head .close { border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ink-soft); }
.dice-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dice-slot { padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-align: center; min-width: 0; }
.dice-slot small { display: block; font-size: 11px; color: var(--ink-soft); }
.dice-slot b { display: block; margin-top: 4px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dice-slot.spin b { color: var(--ink-soft); }
.dice-slot.done { border-color: var(--accent); background: var(--accent-soft); }
.dice .btn { width: 100%; }
.dice .btn:disabled { opacity: 0.5; cursor: default; }
.seg.lang button { min-width: 34px; font-weight: 700; }

/* 첫 화면 안내 */
.onboard {
  position: absolute; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, 90%);
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.2); font-size: 14px; line-height: 1.6;
}
.onboard h3 { margin: 0 0 8px; }
.onboard ol { margin: 0 0 8px; padding-left: 20px; }
.onboard p { margin: 0 0 12px; color: var(--ink-soft); font-size: 13px; }

/* 도움말 */
.help-dialog { width: min(720px, 94vw); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); box-shadow: 0 16px 40px rgb(0 0 0 / 0.2); }
.help-dialog::backdrop { background: rgb(15 23 42 / 0.35); }
.help-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 14px 18px 18px; font-size: 13px; }
.help-body h4 { margin: 0 0 6px; }
.help-body dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; margin: 0; }
.help-body dt { white-space: nowrap; font-weight: 600; }
.help-body dd { margin: 0; color: var(--ink-soft); }
kbd { padding: 1px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--bg); font: 600 11px ui-monospace, monospace; }

/* 목록: 정렬, 칠한 색 점 */
.list-head { display: flex; justify-content: space-between; align-items: center; }
.list-head select { padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; background: var(--panel); color: var(--ink); }
.list .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1px solid rgb(0 0 0 / 0.15); }

/* 대화상자·입력창도 테마 색을 따른다 */
.exp-dialog, .ask { background: var(--panel); color: var(--ink); }
.search input, .ask input, .pe-row input[type=text], .pe-row select, .search-jump select { background: var(--panel); color: var(--ink); }

[hidden] { display: none !important; }
