/*
 * epicro 웹 — 디자인 기준 (2026-10-20 개편, 사용자 선택 "추천대로"):
 *   톤: Linear 처럼 채도 낮은 따뜻한 회색 층, 그림자 대신 배경 밝기 차이로 구분, 강조색은 "고른 것"에만
 *   아이템: Destiny Item Manager 처럼 아이콘 격자 + 등급 색 테두리 (UR 금 · SR 보라 · SSS/SS 파랑 · S 초록)
 *   숫자: DAK.GG 처럼 작고 촘촘하게, 같은 폭 숫자(tabular-nums)
 */
:root {
    --bg: #0f1012;
    --layer-1: #151619;
    --layer-2: #1b1c20;
    --layer-3: #232429;
    --line: #2a2b31;
    --line-soft: #202126;
    --text: #e9e8e6;
    --text-2: #b4b2ad;
    --muted: #8d8b87;          /* --bg 위 5:1 이상 */
    --accent: #9da5ff;         /* 고른 것·현재 탭에만 */
    --accent-bg: rgba(157, 165, 255, .14);
    --on-accent: #0f1012;
    --ok: #6cc497;
    --ok-bg: rgba(108, 196, 151, .10);
    --bad: #e8777b;
    --bad-bg: rgba(232, 119, 123, .09);
    --warn: #dcae5c;
    /* 아이템 등급 (테두리) */
    --g-ur: #e3a54a;
    --g-sr: #b48af0;
    --g-ss: #6ea2e8;
    --g-s: #6fbf86;
    --g-none: #3a3b42;
    --r: 6px;
    --font: "Pretendard", "Pretendard Variable", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f4f2;
        --layer-1: #ffffff;
        --layer-2: #f8f7f5;
        --layer-3: #efeeeb;
        --line: #e2e0dc;
        --line-soft: #ecebe8;
        --text: #1d1c1a;
        --text-2: #45433f;
        --muted: #67645f;
        --accent: #4a52d6;
        --accent-bg: rgba(74, 82, 214, .10);
        --on-accent: #ffffff;
        --ok: #1f8a57;
        --ok-bg: rgba(31, 138, 87, .08);
        --bad: #c73a40;
        --bad-bg: rgba(199, 58, 64, .07);
        --warn: #9a6a12;
        --g-ur: #c27b12;
        --g-sr: #8455c9;
        --g-ss: #2f6ec4;
        --g-s: #2f8a4b;
        --g-none: #cfccc6;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 104px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
[hidden] { display: none !important; }

/* ── 위 고정: 머리글 + 탭 ── */
.sticky-top { position: sticky; top: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line-soft); }
.top { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 16px; max-width: 1280px; margin: 0 auto; }
.brand { font-weight: 700; font-size: 15px; letter-spacing: -0.02em; }
.brand::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--accent); vertical-align: 1px; }
.who { margin-left: auto; color: var(--muted); font-size: 13px; }

.tabs { display: flex; gap: 4px; padding: 0 12px; max-width: 1280px; margin: 0 auto; }
.tabs button {
    min-height: 40px; padding: 0 12px; border-radius: 0;
    background: none; color: var(--muted); font-weight: 600; font-size: 14px;
    border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
body.wide main { max-width: 1280px; }

/* ── 기본 요소 ── */
.card { background: var(--layer-1); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
h1, h2, h3 { margin: 0 0 8px; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 18px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
input, select {
    width: 100%; min-height: 40px; padding: 6px 10px;
    border-radius: var(--r); border: 1px solid var(--line);
    background: var(--layer-2); color: var(--text); font: inherit;
}
input::placeholder { color: var(--muted); }
input:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button {
    min-height: 40px; padding: 6px 14px; border: 1px solid transparent; border-radius: var(--r);
    background: var(--text); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer;
    transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
#loginForm button { margin-top: 12px; width: 100%; }
button.link { min-height: 32px; padding: 4px 8px; background: none; color: var(--text-2); font-weight: 500; }
button.link:hover { color: var(--text); }
button.danger { color: var(--bad); }

.row { display: flex; gap: 8px; }
.row input { flex: 1; letter-spacing: .35em; font-size: 18px; text-align: center; }
.msg { min-height: 1.5em; margin: 8px 0 0; font-size: 13px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--bad); }

/* ── 상태: 기기 ── */
.device { padding: 0; background: none; border: 0; }
.device-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 2px 10px; }
.device-head h2 { margin: 0; font-size: 14px; }
.device-state { font-size: 12px; }
.device-head .remove { margin-left: auto; font-size: 12px; color: var(--muted); }
.device-head .remove:hover { color: var(--bad); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }

.panes { display: grid; gap: 10px; }
@media (min-width: 640px) { .panes { grid-template-columns: 1fr 1fr; } }
.pane { background: var(--layer-1); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 12px 14px; }
.pane-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.pane-title { color: var(--text); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.pane-sub { font-size: 12px; white-space: nowrap; }
.pane-state { margin-left: auto; white-space: nowrap; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--layer-3); }
.pane-state.run { color: var(--ok); background: var(--ok-bg); }

/* 스작: 합계 크게 + 힘·민·지 (맵 -Check 색: 힘 주황 · 민 연두 · 지 파랑) */
.hero { display: grid; grid-template-columns: auto 1fr 1fr 1fr; align-items: baseline; gap: 4px 14px; margin: 0 0 10px; padding: 8px 10px; border-radius: var(--r); background: var(--layer-2); }
.hero > div { display: flex; flex-direction: column; min-width: 0; }
.hero dt { font-size: 11px; color: var(--muted); }
.hero dt.s { color: #f29661; }
.hero dt.a { color: #abf200; }
.hero dt.i { color: #6799ff; }
.hero dd { margin: 0; font-size: 13px; font-weight: 600; white-space: nowrap; }
.hero .hero-sum dd { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
@media (prefers-color-scheme: light) {
    .hero dt.s { color: #b8541c; }
    .hero dt.a { color: #4d7a00; }
    .hero dt.i { color: #2f5fc4; }
}

.rate { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line-soft); }
.rate .label { width: 100%; font-size: 12px; color: var(--muted); }
.value.big { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.unit { font-size: 12px; color: var(--muted); }
.zero { color: var(--muted) !important; font-weight: 500 !important; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; }
.stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-size: 14px; font-weight: 600; }
.stats dd.warn, .warn { color: var(--warn); }
.ok { color: var(--ok); }

.bosses { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.bosses summary { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.bosses summary::-webkit-details-marker { display: none; }
.bosses summary::after { content: "▾"; color: var(--muted); font-size: 11px; transition: transform .12s; }
.bosses[open] summary::after { transform: rotate(180deg); }
.boss-sum { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.boss-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px 16px; }
@media (min-width: 400px) { .boss-list { grid-template-columns: 1fr 1fr; } }
.boss-list li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; border-bottom: 1px dashed var(--line-soft); }
.boss-list .t { color: var(--muted); }

/* ── 아이템 기준 (어느 창) ── */
.source { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.source label { margin: 0; }
.source select { width: auto; flex: 1; min-width: 160px; max-width: 360px; }
.source .muted { font-size: 12px; }

/* ── 아이콘 + 등급 테두리 (DIM 처럼) ── */
.icon {
    width: 36px; height: 36px; flex: none; display: block;
    border-radius: 4px; background: var(--layer-3);
    box-shadow: 0 0 0 1px var(--g-none);
    object-fit: cover;
}
.icon.sm { width: 26px; height: 26px; }
.icon.g-ur { box-shadow: 0 0 0 2px var(--g-ur); }
.icon.g-sr { box-shadow: 0 0 0 2px var(--g-sr); }
.icon.g-ss { box-shadow: 0 0 0 2px var(--g-ss); }
.icon.g-s  { box-shadow: 0 0 0 2px var(--g-s); }

/* ── 아이템 탭: 유닛별 아이콘 격자 ── */
.owner { margin-bottom: 16px; }
.owner h3 { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.owner h3 .muted { font-size: 12px; font-weight: 500; }
.item-grid { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 8px 4px 6px; border-radius: var(--r); background: var(--layer-1);
    text-align: center; min-width: 0; position: relative;
}
.item .icon { width: 42px; height: 42px; }
.item .name { font-size: 11px; line-height: 1.25; width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: var(--text-2); }
.item .count {
    position: absolute; top: 4px; right: 4px;
    font-size: 10.5px; font-weight: 700; padding: 0 4px; border-radius: 3px;
    background: var(--layer-3); color: var(--text);
}

/* ── 조합: 거르기 ── */
.filters { display: grid; gap: 8px; margin-bottom: 10px; }
.filters input[type="search"] { max-width: 520px; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips button {
    min-height: 32px; padding: 2px 10px; border-radius: 16px;
    background: transparent; color: var(--text-2); border: 1px solid var(--line);
    font-weight: 500; font-size: 13px; white-space: nowrap;
}
.chips button:hover { border-color: var(--muted); }
.chips button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.checks { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: center; font-size: 13px; }
label.check { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 32px; color: var(--text-2); font-size: 13px; }
label.check input { width: 16px; min-height: 16px; height: 16px; accent-color: var(--accent); }
label.check.sort { margin-left: auto; color: var(--muted); }
label.check.sort select { width: auto; min-height: 32px; padding: 2px 8px; font-size: 13px; }
@media (max-width: 699px) {
    .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
    .chips::-webkit-scrollbar { display: none; }
    .chips button { flex: none; }
    label.check.sort > .sort-word { display: none; }
}

.seg { display: inline-flex; padding: 2px; border-radius: var(--r); background: var(--layer-2); border: 1px solid var(--line-soft); }
.seg button { min-height: 28px; padding: 0 10px; border-radius: 4px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--layer-3); color: var(--text); }

/* ── 조합: 구역 ── */
.rc-section { margin-bottom: 4px; }
.category { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.category::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); align-self: center; }
.section-note { font-size: 11px; font-weight: 500; color: var(--muted); }

.pill { font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: var(--layer-3); color: var(--muted); white-space: nowrap; }
.pill.tier { color: var(--text-2); }

/* ── 카드 보기 ── */
.rc-grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .rc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .rc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rc { display: flex; flex-direction: column; gap: 8px; background: var(--layer-1); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px; }
.rc.can { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.rc.picked { border-color: var(--accent); background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--layer-1); }
.rc-head { display: flex; align-items: center; gap: 10px; }
.rc-head > .icon { width: 40px; height: 40px; }
.rc-title { flex: 1; min-width: 0; }
.rc-name { font-weight: 700; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.rc-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }.make-btn { flex: none; min-height: 32px; min-width: 64px; padding: 2px 10px; background: var(--layer-3); color: var(--text-2); font-size: 13px; }
.make-btn:hover { color: var(--text); }
.make-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.vary-row { display: flex; align-items: center; gap: 8px; margin: 0; }
.vary-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vary-row select { min-height: 32px; padding: 2px 8px; font-size: 13px; }
.rc-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rc-progress .track { flex: 1; height: 3px; border-radius: 2px; background: var(--layer-3); overflow: hidden; }
.rc-progress .track i { display: block; height: 100%; background: var(--text-2); }
.rc.can .rc-progress .track i { background: var(--ok); }
.rc-count { color: var(--muted); white-space: nowrap; font-weight: 600; }
.rc.can .rc-count { color: var(--ok); }

/* 재료 타일 (색 + ✓/✗ 글자) */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 4px 5px; border-radius: var(--r); background: var(--layer-2); text-align: center; min-width: 0; }
.tile-icon .icon { width: 36px; height: 36px; }
.tile-mark { display: none; }
.tile-name { font-size: 11px; line-height: 1.25; width: 100%; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile-count { font-size: 11.5px; font-weight: 700; }
.tile.ok .tile-count { color: var(--ok); }
.tile.ok .tile-count::before { content: "✓ "; }
.tile.lack .tile-count { color: var(--bad); }
.tile.lack .tile-count::before { content: "✗ "; }
.tile.small .tile-icon .icon { width: 28px; height: 28px; }
.sub-tiles { padding-top: 6px; border-top: 1px dashed var(--line); }
.sub-label { font-size: 11px; color: var(--warn); margin-bottom: 4px; }

/* ── 줄 보기 ── */
.rr-list { display: grid; gap: 1px; grid-template-columns: 1fr; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
@media (min-width: 900px) { .rr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; background: var(--layer-1); padding: 8px 10px; }
.rr.picked { background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--layer-1); }
.rr.open { grid-column: 1 / -1; }
.rr-main { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; cursor: pointer; }
.rr-main > .icon { width: 30px; height: 30px; }
.rr-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rr-prog { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; padding-left: 4px; }
.rr.can .rr-prog { color: var(--ok); }
.rr-make { min-height: 30px; min-width: 32px; padding: 0 8px; background: var(--layer-3); color: var(--text-2); font-size: 15px; }
.rr-make[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.minis { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0 0 0 38px; display: flex; flex-wrap: wrap; gap: 6px; }
.mini { display: flex; align-items: center; gap: 3px; }
.mini .icon { width: 22px; height: 22px; }
.mini-cnt { font-size: 11px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.mini.ok .mini-cnt { color: var(--ok); }
.mini.ok .mini-cnt::before { content: "✓"; margin-right: 1px; }
.mini.lack .mini-cnt { color: var(--bad); }
.rr-detail { grid-column: 1 / -1; border: 0; padding: 4px 0 0; background: none; }

/* ── 아이콘 보기 ── */
.ri-grid { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.ri {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-height: 0; padding: 8px 4px 6px; border-radius: var(--r); border: 1px solid transparent;
    background: var(--layer-1); color: var(--text); font-weight: 500;
}
.ri:hover { background: var(--layer-2); }
.ri .icon { width: 42px; height: 42px; }
.ri.picked { border-color: var(--accent); background: linear-gradient(var(--accent-bg), var(--accent-bg)), var(--layer-1); }
.ri.open { border-color: var(--text-2); }
.ri-pick { position: absolute; top: 4px; right: 5px; font-size: 10px; font-weight: 700; color: var(--accent); }
.ri-name { width: 100%; font-size: 11px; line-height: 1.25; text-align: center; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 2.5em; }
.ri-bar { width: 42px; height: 3px; border-radius: 2px; background: var(--layer-3); overflow: hidden; }
.ri-bar i { display: block; height: 100%; background: var(--text-2); }
.ri.can .ri-bar i { background: var(--ok); }
.ri-cap { font-size: 11px; font-weight: 600; color: var(--muted); }
.ri.can .ri-cap { color: var(--ok); }
.ri-detail { grid-column: 1 / -1; }

/* ── 고른 조합의 재료: 아래 고정 바 ── */
#viewRecipes { padding-bottom: 64px; }
.sel-sheet { position: sticky; bottom: 0; z-index: 2; margin: 12px -16px -16px; background: var(--layer-1); border-top: 1px solid var(--line); }
.sel-sheet summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 16px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; }
.sel-sheet summary::-webkit-details-marker { display: none; }
.sel-sheet summary::after { content: "재료 보기 ▴"; margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-2); }
.sel-sheet[open] summary::after { content: "접기 ▾"; }
.sel-hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.sel-hint.ok { color: var(--ok); }
.sel-hint.lack { color: var(--bad); }
.sel-body { max-height: 55vh; overflow: auto; padding: 0 16px 12px; }
.sel-body .link { margin-top: 6px; }
.mat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mat-table th { position: sticky; top: 0; background: var(--layer-1); text-align: right; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.mat-table th:first-child { text-align: left; }
.mat-table td { padding: 4px 6px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.mat-table td.name { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.mat-table td.name > span { display: inline-flex; align-items: center; gap: 8px; }
.mat-table .lack { color: var(--bad); font-weight: 600; }
.mat-table .enough { color: var(--ok); }
.mat-table tr.middle td { color: var(--muted); }
.mat-table .note { color: var(--warn); }

/* ── 로그인: 구글 버튼 (구글 안내대로 흰 바탕 + G 로고) ── */
.google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; margin: 12px 0 8px;
    border-radius: var(--r); border: 1px solid #dadce0; background: #fff; color: #1f1f1f;
    font-weight: 600; font-size: 14px; text-decoration: none;
}
.google-btn:hover { background: #f8f9fa; }
.google-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.small-link { font-size: 12px; text-decoration: none; display: inline-flex; align-items: center; }
.login-open { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text); }
a.who { text-decoration: none; }
a.who:hover { color: var(--text); }

/* ── 가입 마무리 · 내 계정 · 문서 ── */
.consent { display: grid; gap: 2px; margin: 12px 0 4px; }
/* 글·링크가 한 줄로 이어지게 블록 + 체크 상자는 왼쪽에 (flex 면 링크마다 따로 줄바꿈됨) */
.consent label.check { display: block; position: relative; padding: 6px 0 6px 28px; line-height: 1.55; min-height: 0; }
.consent label.check input { position: absolute; left: 0; top: 9px; margin: 0; }
.consent a, .doc-links a { color: var(--text); }
#nicknameForm button[type="submit"] { width: 100%; margin-top: 8px; }
.account-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.account-info > div { display: contents; }
.account-info dt { color: var(--muted); font-size: 13px; }
.account-info dd { margin: 0; font-weight: 600; }
.rename input { letter-spacing: normal; font-size: 15px; text-align: left; }
.doc-links { margin-top: 12px; font-size: 12px; }
.danger-zone h2 { color: var(--bad); }
.danger-btn { background: var(--bad); color: #fff; width: 100%; margin-top: 8px; }
main.doc { max-width: 720px; line-height: 1.7; font-size: 14px; }
main.doc h1 { font-size: 20px; margin-top: 8px; }
main.doc h2 { font-size: 15px; margin-top: 22px; }
main.doc ul { padding-left: 20px; }
main.doc li { margin: 4px 0; }
main.doc .back { font-size: 13px; color: var(--text-2); text-decoration: none; }
.todo { color: var(--warn); font-weight: 600; }
.login-rules { margin-top: 14px; font-size: 12px; line-height: 1.6; }

/* ── 공통: 글 입력칸, 작은 버튼, 구역 머리 ── */
textarea {
    width: 100%; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line);
    background: var(--layer-2); color: var(--text); font: inherit; font-size: 14px; resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.small-btn { min-height: 34px; padding: 2px 14px; font-size: 13px; }
.section-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; font-size: 14px; }
.section-head .muted { font-size: 12px; }
.link-more { margin-left: auto; font-size: 12px; color: var(--text-2); text-decoration: none; }
.link-more:hover { color: var(--text); }
@media (max-width: 420px) { .tabs button { padding: 0 9px; font-size: 13.5px; } }

/* ── 상태 탭: 조합 목표 ── */
.goals { margin: 14px 0 16px; }
.goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
@media (min-width: 640px) { .goal-list { grid-template-columns: 1fr 1fr; } }
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r); background: var(--layer-1); min-width: 0; }
.goal .icon { width: 32px; height: 32px; }
.goal-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.goal-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal .track { height: 3px; border-radius: 2px; background: var(--layer-3); overflow: hidden; }
.goal .track i { display: block; height: 100%; background: var(--text-2); }
.goal.can .track i { background: var(--ok); }
.goal-state { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.goal.can .goal-state { color: var(--ok); }

/* ── 상태 탭: 내 캐릭터 (저장됨) ── */
.profiles { margin: 0 0 16px; }
.profile-list { display: grid; gap: 8px; }
@media (min-width: 640px) { .profile-list { grid-template-columns: 1fr 1fr; } }
.profile-list .char-card { background: var(--layer-1); border: 1px solid var(--line-soft); }
.profile-list .char-card .hero, .profile-list .equip .item { background: var(--layer-2); }
.profile-list .char-top .link { min-height: 28px; padding: 2px 6px; font-size: 12px; }

/* ── 기록 탭 ── */
.history-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.history-bar select { width: auto; min-width: 160px; max-width: 280px; min-height: 34px; padding: 2px 8px; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 12px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpis > div { background: var(--layer-1); padding: 10px 12px; }
.kpis dt { font-size: 12px; color: var(--muted); }
.kpis dd { margin: 2px 0 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.kpis .unit { font-size: 12px; font-weight: 500; }
.chart-grid { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 4px; }
@media (min-width: 900px) { .chart-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chart { background: var(--layer-1); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.chart-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.chart-head h3 { margin: 0; font-size: 13px; }
.chart-head .muted { margin-left: auto; font-size: 11.5px; }
.bars { display: grid; align-items: end; gap: 2px; height: 96px; }
.chart.no-data .bars { height: 6px; }   /* 기록이 없으면 빈 칸을 크게 두지 않음 */
.bar { height: 100%; display: flex; align-items: flex-end; border-radius: 2px; }
.bar:hover { background: var(--layer-2); }
.bar i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: var(--text-2); opacity: .55; }
.bar.today i { background: var(--accent); opacity: 1; }
.axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--muted); }
.stat-now { margin: 0 0 8px; }
.boss-table { margin-top: 2px; }
.boss-table .zone { font-size: 11.5px; }
.boss-table .spark-col { width: 40%; }
.spark { display: flex; align-items: flex-end; gap: 1px; height: 18px; }
.spark i { flex: 1; min-width: 2px; background: var(--text-2); opacity: .6; border-radius: 1px; }
@media (max-width: 520px) { .boss-table .spark-col { display: none; } }

/* ── 게시판 ── */
.board-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.board-bar .chips { flex: 1; min-width: 0; }
.posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.posts:empty { display: none; }
.post-row a { display: block; padding: 10px 12px; background: var(--layer-1); color: var(--text); text-decoration: none; }
.post-row a:hover { background: var(--layer-2); }
.post-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.post-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 12px; color: var(--text-2); }
.raid-boss { font-weight: 600; color: var(--text); }
.pill-open { color: var(--ok); background: var(--ok-bg); }
.pill.kind-raid, .pill.kind-dungeon { color: var(--text); }
.char-sub { font-size: 12px; color: var(--muted); margin: 10px 0 4px; }

/* ── 맞춤 프로필 (내 정보) ── */
.loadout-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.loadout-head h2 { margin: 0; }
.loadout-help { font-size: 12.5px; line-height: 1.6; }
.loadouts { display: grid; gap: 12px; margin-top: 8px; }
.loadout-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.loadout-label { font-size: 15px; }
.loadout-editor { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.loadout-editor h3 { margin: 0; font-size: 15px; }
.loadout-editor input, .loadout-editor select { width: 100%; }
.loadout-tip { font-size: 12px; margin: 0; }
.loadout-slots button.item, .loadout-cands button.item { cursor: pointer; font: inherit; color: inherit; text-align: center; }
.loadout-slots .item.changed { outline: 2px solid var(--ok); outline-offset: -2px; }
.loadout-slots .item.open, .loadout-cands .item.on { outline: 2px solid var(--text); outline-offset: -2px; }
.pill-preset { color: var(--text); }
.post-form .seg { margin: 4px 0 2px; }
.raid-fields { display: grid; gap: 0 10px; grid-template-columns: 1fr 1fr; }
.raid-fields > div:first-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .raid-fields { grid-template-columns: 2fr 1.4fr 0.8fr; } .raid-fields > div:first-child { grid-column: auto; } }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
#postView .back { display: inline-block; margin-bottom: 8px; font-size: 13px; color: var(--text-2); text-decoration: none; }
.post-head h1 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.post-head .post-meta { margin: 4px 0 10px; }
.raid-info { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 0 12px; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
@media (min-width: 640px) { .raid-info { grid-template-columns: repeat(4, 1fr); } }
.raid-info > div { background: var(--layer-1); padding: 8px 12px; }
.raid-info dt { font-size: 11.5px; color: var(--muted); }
.raid-info dd { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
.post-body, .comment-body { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.post-actions { display: flex; gap: 4px; margin-bottom: 8px; }
.comments-title { font-size: 14px; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.comments { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.comment { background: var(--layer-1); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; }
.comment.accepted { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; }
.comment-head .muted { font-size: 12px; }
.comment-tools { margin-left: auto; display: flex; gap: 2px; }
.comment-tools .link { min-height: 28px; padding: 2px 8px; font-size: 12px; }
.comment-body { margin: 8px 0 0; }
.char-card { background: var(--layer-2); border-radius: var(--r); padding: 10px; }
.char-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.char-name { font-size: 14px; }
.char-at { margin-left: auto; font-size: 11.5px; }
.char-form { font-size: 12px; }
.char-card .hero { background: var(--layer-1); }
.equip { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.equip .item { background: var(--layer-1); }
.apply-form h2 { font-size: 14px; }
.apply-form select { margin-bottom: 8px; }
.apply-preview { margin-bottom: 8px; }
.apply-form textarea { margin-bottom: 4px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { flex: 1; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
