/* ===================================================================
   로또 6/45 — 다크 테마 스타일
   Kiro IDE 다크 테마 계열의 딥 차콜 배경 + 라벤더 액센트.
   번호 공은 입체감 있는 그라데이션(구간별 색상 규칙 유지).
   =================================================================== */

:root {
    /* 네이티브 컨트롤(셀렉트 팝업, 스크롤바)까지 다크로 맞춘다 */
    color-scheme: dark;

    /* 배경 / 표면 */
    --bg: #17181c;            /* 페이지 배경 */
    --surface: #1e2024;       /* 카드 */
    --surface-2: #24272c;     /* 카드 안쪽 패널 */
    --surface-3: #2b2f35;     /* 입력 요소 */
    --line: #34383f;
    --line-soft: #292d33;

    /* 텍스트 */
    --ink: #e4e6ea;
    --ink-mid: #a6acb6;
    --ink-dim: #767d88;

    /* 액센트 (라벤더) */
    --accent: #7c6cf0;
    --accent-hover: #6b59ee;
    --accent-soft: rgba(124, 108, 240, 0.14);
    --accent-line: rgba(124, 108, 240, 0.35);
    --accent-text: #a99bff;

    /* 상태 색 */
    --red: #ef6b62;
    --green: #55b877;

    --radius: 10px;
    --radius-sm: 6px;
    --page: 940px;   /* 본문 최대 폭 */
    --rail: 160px;   /* 좌/우 광고 레일 폭 (애드센스 160x600 기준) */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    padding-bottom: 3rem;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.2px; }

.hidden { display: none !important; }

/* 스크린리더 전용 텍스트 */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ===================================================================
   사이트 헤더 — 유틸(로그인) / 타이틀 / 탭
   =================================================================== */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }

/* 로그인 영역: 항상 우측 정렬 */
.header-util { border-bottom: 1px solid var(--line-soft); background: #1a1c20; }
.header-util-inner {
    max-width: var(--page); margin: 0 auto; padding: 0.45rem 1.2rem;
    display: flex; justify-content: flex-end; align-items: center;
}
.auth-guest, .auth-user { display: inline-flex; align-items: center; gap: 0.4rem; }
.auth-nickname { color: var(--ink); font-size: 0.85rem; font-weight: 500; margin-right: 0.15rem; }

.util-btn {
    padding: 0.3rem 0.75rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface-2); color: var(--ink-mid);
    font-family: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer;
    white-space: nowrap;
}
.util-btn:hover { color: var(--ink); border-color: #454a52; }
.util-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.util-btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.link-btn {
    border: none; background: none; padding: 0;
    color: var(--accent-text); font-family: inherit; font-size: inherit; font-weight: 500;
    cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:hover { color: #c0b5ff; }

.role-tag {
    display: inline-block; padding: 0.1rem 0.45rem; border-radius: 3px;
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--accent-text); font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}

/* 타이틀 */
.header-title { max-width: var(--page); margin: 0 auto; padding: 1.5rem 1.2rem 1.1rem; }
.header-title h1 { font-size: 1.4rem; letter-spacing: -0.5px; }
.subtitle { color: var(--ink-mid); margin-top: 0.25rem; font-size: 0.88rem; }

/* ---------- 탭 ---------- */
.tab-bar {
    max-width: var(--page); margin: 0 auto; padding: 0 1.2rem;
    display: flex; gap: 0.1rem; overflow-x: auto;
}
.tab-btn {
    flex: 0 0 auto;
    padding: 0.65rem 0.9rem;
    border: none; border-bottom: 2px solid transparent;
    background: none; color: var(--ink-mid);
    font-family: inherit; font-size: 0.92rem; font-weight: 500;
    cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

/* ===================================================================
   레이아웃 — 본문 + 좌/우 광고 레일
   기본은 1단(본문만). 레일을 놓을 폭이 확보되는 화면에서만 3단으로 전환한다.
   =================================================================== */
.page { max-width: var(--page); margin: 0 auto; }
.page-main { min-width: 0; }

.container { max-width: var(--page); margin: 0 auto; padding: 1.5rem 1.2rem 0; }
.panel { display: none; }
.panel.active { display: block; }

/* 좌/우 사이드 광고 레일 (160x600 기준) */
.ad-rail {
    width: var(--rail); flex-shrink: 0;
    position: sticky; top: 1rem;
    min-height: 600px;
}
/* 상/하단 가로 광고 */
.ad-banner {
    max-width: var(--page); margin: 1.2rem auto 0; padding: 0 1.2rem;
    min-height: 90px;
}
.ad-banner#ad-top { margin-top: 1.5rem; }
.ad-banner#ad-bottom { margin-top: 1.5rem; }

/* 미설정 상태: 자리만 점선으로 표시 */
.ad-placeholder {
    display: grid; place-items: center;
    border: 1px dashed var(--line); border-radius: var(--radius-sm);
    color: var(--ink-dim); font-size: 0.78rem; letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.015);
}
.ad-rail.ad-placeholder { height: 600px; }
.ad-banner.ad-placeholder { height: 90px; margin-left: 1.2rem; margin-right: 1.2rem; padding: 0; }

/* 3단 전환: 본문 940 + 레일 160×2 + 여백 */
@media (min-width: 1300px) {
    .page {
        max-width: calc(var(--page) + (var(--rail) + 1.5rem) * 2);
        display: grid;
        grid-template-columns: var(--rail) minmax(0, 1fr) var(--rail);
        gap: 1.5rem;
        align-items: start;
    }

    /*
      각 칸을 명시적으로 지정한다. 레일이 display:none 이 되면 그리드 항목에서 빠지므로,
      자동 배치에 맡기면 본문이 첫 번째 칸(160px)으로 밀려 들어가 레이아웃이 깨진다.
    */
    #ad-left  { grid-column: 1; }
    .page-main { grid-column: 2; }
    #ad-right { grid-column: 3; }

    /* 레일을 쓰지 않는 페이지(문서 페이지, 광고 끈 상태)는 한 칸으로 되돌린다 */
    .page.no-rails {
        max-width: var(--page);
        grid-template-columns: minmax(0, 1fr);
    }
    .page.no-rails .page-main { grid-column: 1; }
}
/* 레일을 놓을 폭이 없으면 광고 레일은 숨긴다(본문 폭을 침범하지 않도록) */
@media (max-width: 1299px) {
    .ad-rail { display: none !important; }
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem;
}
.card-head {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding-bottom: 0.9rem; margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card h2 { font-size: 1.1rem; }
.hint { color: var(--ink-mid); font-size: 0.88rem; margin-bottom: 1rem; }
.hint strong { color: var(--ink); }

/* ---------- 버튼 ---------- */
.primary-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.7rem 1.5rem; border: 1px solid var(--accent); border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    font-family: inherit; font-size: 0.98rem; font-weight: 700; cursor: pointer;
}
.primary-btn:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.primary-btn.full { width: 100%; }

.secondary-btn {
    padding: 0.55rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink);
    font-family: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
}
.secondary-btn:hover:not(:disabled) { background: var(--surface-3); border-color: #454a52; }
.secondary-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.ghost-btn {
    padding: 0.7rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: transparent; color: var(--ink-mid);
    font-family: inherit; font-size: 0.92rem; font-weight: 500; cursor: pointer;
}
.ghost-btn:hover { color: var(--ink); border-color: #454a52; }

/* ---------- 입력 요소 공통 ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], input[type="number"], select {
    font-family: inherit; font-size: 0.94rem; color: var(--ink);
    background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
}
input::placeholder { color: var(--ink-dim); }
select option { background: var(--surface-2); color: var(--ink); }
input:focus, select:focus, button:focus-visible {
    outline: 2px solid var(--accent-text); outline-offset: 1px;
}

/* ---------- 추천: 모드 전환 ---------- */
.mode-switch {
    display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm);
    overflow: hidden; margin-bottom: 1.3rem;
}
.mode-btn {
    padding: 0.5rem 1.2rem; border: none; background: var(--surface-2);
    color: var(--ink-mid); font-family: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--line); }
.mode-btn.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- 추천 모델 패널 ---------- */
.model-panel {
    background: var(--surface-2); border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1.5rem;
}
.model-label { font-size: 0.82rem; font-weight: 700; color: var(--ink-mid); margin-bottom: 0.6rem; }
.model-radios { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.model-radios label { cursor: pointer; }
.model-radios input { position: absolute; opacity: 0; pointer-events: none; }
.model-radios span {
    display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-3);
    color: var(--ink-mid); font-size: 0.86rem;
}
.model-radios input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.model-radios input:focus-visible + span { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.model-desc { font-size: 0.84rem; color: var(--ink-mid); margin-top: 0.6rem; min-height: 1.2em; }

.weight-panel { margin-top: 0.9rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.weight-row { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.weight-row label {
    display: flex; flex-direction: column; gap: 0.25rem;
    font-size: 0.78rem; color: var(--ink-mid); font-weight: 500;
}
.weight-row input { width: 78px; }
.weight-hint { font-size: 0.76rem; color: var(--ink-dim); margin-top: 0.6rem; }

/* 번호별 선정 이유 */
.pick-reasons { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.2rem; text-align: left; }
.reason-row {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.5rem 0.7rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.reason-row .reason-ball {
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 0.84rem; flex-shrink: 0;
}
.reason-row .reason-text { font-size: 0.85rem; color: var(--ink-mid); flex: 1; }
.reason-row .reason-score { font-size: 0.78rem; color: var(--accent-text); font-weight: 700; white-space: nowrap; }

/* ---------- 추첨기 ---------- */
.lotto-machine { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.3rem; }
.machine-dome {
    position: relative; width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #2f343c 0%, #20232a 60%, #1b1e24 100%);
    border: 2px solid var(--line);
    overflow: hidden; display: grid; place-items: center;
}
.machine-balls { position: absolute; inset: 0; }
.machine-balls .mini-ball {
    position: absolute; top: 50%; left: 50%;
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 0.6rem; font-weight: 700;
    box-shadow: inset -1px -2px 3px rgba(0, 0, 0, 0.3);
    transform-origin: 0 0;
    animation: orbit var(--dur, 3s) linear infinite;
    animation-delay: var(--delay, 0s);
}
@keyframes orbit {
    from { transform: rotate(var(--angle)) translateX(var(--radius)) rotate(calc(-1 * var(--angle))); }
    to   { transform: rotate(calc(var(--angle) + 360deg)) translateX(var(--radius)) rotate(calc(-1 * (var(--angle) + 360deg))); }
}
.machine-balls.idle { display: none; }
/* 추첨 중 아주 약한 상하 진동(과장하지 않음) */
.machine-dome.spinning { animation: wobble 0.7s ease-in-out infinite; }
@keyframes wobble {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-2px); }
}
.machine-status {
    z-index: 2; text-align: center;
    padding: 0.3rem 0.8rem; border-radius: 999px;
    background: rgba(23, 24, 28, 0.85); border: 1px solid var(--line);
    color: var(--ink-mid); font-size: 0.85rem; font-weight: 500;
}
.machine-tube { width: 12px; height: 26px; background: var(--line); border-radius: 0 0 6px 6px; }

/* ---------- 볼 / 트레이 ---------- */
.tray { min-height: 70px; display: grid; place-items: center; margin-bottom: 1.2rem; }
.ball-stage { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; align-items: center; }
.tray-slots { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.4rem; }
.slot { width: 46px; height: 46px; border-radius: 50%; border: 1px dashed #3d424a; }

.ball {
    position: relative;
    width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800; font-size: 1.05rem;
    box-shadow: inset -4px -6px 10px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}
/* 구 표면 하이라이트(입체감) */
.ball::after {
    content: ""; position: absolute; top: 7px; left: 11px;
    width: 12px; height: 9px; background: rgba(255, 255, 255, 0.55);
    border-radius: 50%; filter: blur(1px);
}

/* 번호 구간별 색상 (1~10 노랑 / 11~20 파랑 / 21~30 빨강 / 31~40 회색 / 41~45 초록) */
.range-1 { background: linear-gradient(145deg, #fdcb6e, #f0a500); color: #4a3200; }
.range-2 { background: linear-gradient(145deg, #74b9ff, #0984e3); color: #ffffff; }
.range-3 { background: linear-gradient(145deg, #ff7675, #d63031); color: #ffffff; }
.range-4 { background: linear-gradient(145deg, #9aa1ab, #565d66); color: #ffffff; }
.range-5 { background: linear-gradient(145deg, #3bb45a, #2c9244); color: #ffffff; }

.drop-in { animation: dropIn 0.45s cubic-bezier(0.22, 1.1, 0.36, 1); }

.controls { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- 최종 결과 ---------- */
.final-result {
    margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line-soft);
    text-align: center;
}
.final-result h3 { font-size: 0.95rem; color: var(--ink-mid); margin-bottom: 0.9rem; }

/* ===================================================================
   추첨결과 탭
   =================================================================== */
.result-nav {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    padding-bottom: 1rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 1.4rem;
}
.nav-btn {
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink-mid);
    font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.nav-btn:hover:not(:disabled) { background: var(--surface-3); }
.nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.result-date { color: var(--ink-mid); font-size: 0.86rem; margin-left: auto; }

/* 당첨번호 블록 */
.result-numbers {
    background: var(--surface-2); border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.8rem;
}
.result-title { font-size: 0.95rem; color: var(--ink-mid); margin-bottom: 0.9rem; }
/*
  보너스 볼 정렬

  "보너스" 라벨이 .bonus-wrap 안에서 볼 아래에 쌓이므로 이 박스는 본번호(50px)보다
  약 16px 높다. .number-row 가 align-items: center 라서 그 큰 박스를 중앙에 맞추면
  보너스 볼만 8px 정도 위로 올라간다.

  라벨을 절대 배치로 흐름에서 빼내면 .bonus-wrap 높이가 볼 높이와 같아져
  본번호와 정확히 같은 높이에 놓인다. 라벨이 놓일 자리는 .number-row 의
  아래 여백으로 확보한다.
*/
.number-row {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    padding-bottom: 1.1rem;   /* 절대 배치된 보너스 라벨이 놓일 공간 */
}
.number-row .ball { width: 50px; height: 50px; font-size: 1.1rem; }
.plus-sign { color: var(--ink-dim); font-size: 1.25rem; margin: 0 0.15rem; }
.bonus-wrap {
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    gap: 0;                   /* 라벨이 흐름에서 빠졌으므로 간격이 필요 없다 */
}
.bonus-label {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;      /* "보너스" 가 줄바꿈되지 않게 */
    font-size: 0.7rem; color: var(--ink-dim);
}

.table-title { font-size: 0.95rem; margin-bottom: 0.6rem; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }

.prize-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
.prize-table thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 0.7rem; color: var(--ink-mid); font-size: 0.8rem; font-weight: 700;
    white-space: nowrap;
}
.prize-table tbody th, .prize-table tbody td {
    padding: 0.7rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle;
}
.prize-table tbody tr:last-child th, .prize-table tbody tr:last-child td { border-bottom: none; }
.prize-table tbody tr:first-child { background: var(--accent-soft); }
.prize-table .rank-cell { text-align: left; font-weight: 700; white-space: nowrap; }
.prize-table .num-cell { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prize-table .num-cell.strong { font-weight: 700; }
.prize-table .criteria-cell { text-align: center; color: var(--ink-mid); white-space: nowrap; }
.prize-table .remark-cell { text-align: center; color: var(--ink-mid); font-size: 0.8rem; }
.prize-table .remark-cell .remark-line { display: inline-block; margin: 0 0.25rem; white-space: nowrap; }
.prize-table .remark-cell b { color: var(--ink); }
.prize-table tbody tr:first-child .num-cell.strong { color: var(--red); }

.result-meta {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.5rem; margin-top: 1rem;
}
.meta-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem;
    padding: 0.7rem 0.9rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.meta-item dt { color: var(--ink-mid); font-size: 0.85rem; }
.meta-item dd { font-weight: 700; font-variant-numeric: tabular-nums; }

.table-note { margin-top: 1rem; font-size: 0.78rem; color: var(--ink-dim); line-height: 1.6; }

/* ---------- 히스토리 ---------- */
.history-list { display: grid; gap: 0.4rem; }
.history-item {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: 0.8rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent-line);
}
.history-item dt { color: var(--ink-mid); font-size: 0.88rem; }
.history-item dd { font-weight: 700; font-size: 1rem; font-variant-numeric: tabular-nums; }

/* ---------- 통계 / 수집 폼 ---------- */
.stats-form { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; margin-bottom: 1rem; }
.form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.form-row label { font-size: 0.8rem; font-weight: 500; color: var(--ink-mid); }
.form-row input { width: 130px; }

/* 최근 N주 칩 */
.quick-range { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.9rem; }
.range-chip {
    padding: 0.4rem 0.85rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--surface-2); color: var(--ink-mid);
    font-family: inherit; font-size: 0.85rem; cursor: pointer;
}
.range-chip:hover { background: var(--surface-3); color: var(--ink); }
.range-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 구간 지정 (회차 셀렉트) */
.range-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.3rem; }
.episode-select { min-width: 108px; cursor: pointer; }
.range-tilde { color: var(--ink-dim); }

/* 토글형 보너스 체크박스 */
.toggle { display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer; margin-left: auto; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
    width: 40px; height: 22px; border-radius: 999px; background: #3d424a;
    position: relative; transition: background 0.15s;
}
.toggle-thumb {
    position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #e4e6ea; transition: transform 0.15s;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.toggle-label { color: var(--ink-mid); font-size: 0.88rem; }

/* 많이/적게 추첨된 번호 */
.highlight-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1.6rem; }
.highlight-box {
    background: var(--surface-2); border: 1px solid var(--line-soft);
    border-radius: var(--radius); padding: 1rem;
}
.highlight-box h4 { font-size: 0.85rem; color: var(--ink-mid); margin-bottom: 0.8rem; text-align: center; }

.stats-title { font-size: 0.98rem; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.8rem;
}
.combo-head { margin-top: 2rem; }

/* 정렬 토글 */
.sort-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.sort-btn {
    padding: 0.35rem 0.8rem; border: none; background: var(--surface-2);
    color: var(--ink-mid); font-family: inherit; font-size: 0.84rem; cursor: pointer;
}
.sort-btn + .sort-btn { border-left: 1px solid var(--line); }
.sort-btn.active { background: var(--accent); color: #fff; font-weight: 700; }

/* 조합 크기 라디오 */
.combo-size { display: inline-flex; gap: 0.3rem; }
.combo-size label { display: inline-flex; align-items: center; cursor: pointer; }
.combo-size input { position: absolute; opacity: 0; pointer-events: none; }
.combo-size span {
    padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
    background: var(--surface-2); color: var(--ink-mid); font-size: 0.84rem;
}
.combo-size input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }

/* 동반 출현 리스트 */
.combo-list { display: flex; flex-direction: column; gap: 0.35rem; }
.combo-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.6rem 0.8rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.combo-row .combo-rank { color: var(--ink-dim); font-size: 0.85rem; width: 26px; }
.combo-row .combo-balls { display: flex; gap: 0.3rem; flex: 1; flex-wrap: wrap; margin: 0 0.6rem; }
.combo-row .combo-meta { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.combo-row .combo-count { font-weight: 700; font-size: 0.92rem; color: var(--accent-text); }
.combo-row .combo-recent { font-size: 0.75rem; color: var(--ink-dim); }
.mini-num {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 700; font-size: 0.8rem;
    box-shadow: inset -2px -3px 5px rgba(0, 0, 0, 0.25);
}

/* 페이저 */
.pager { display: flex; justify-content: center; align-items: center; gap: 0.25rem; margin-top: 1rem; flex-wrap: wrap; }
.pager button {
    min-width: 30px; height: 30px; padding: 0 0.4rem;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink-mid); font-family: inherit; font-size: 0.84rem; cursor: pointer;
}
.pager button:hover:not(:disabled) { background: var(--surface-3); color: var(--ink); }
.pager button.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.pager button:disabled { opacity: 0.35; cursor: not-allowed; }

/* 전체 통계 그리드 */
.stats-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 0.4rem; }
.stat-cell {
    display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
    padding: 0.6rem 0.2rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.stat-number {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    font-weight: 800; font-size: 1.05rem;
    box-shadow: inset -3px -4px 7px rgba(0, 0, 0, 0.25);
}
.stat-count { font-size: 0.78rem; color: var(--ink-mid); }

/* ---------- 백테스트 결과 표 ---------- */
.bt-table { width: 100%; border-collapse: collapse; margin-top: 0.4rem; font-size: 0.86rem; }
.bt-table th, .bt-table td { padding: 0.6rem 0.5rem; text-align: right; white-space: nowrap; }
.bt-table th:first-child, .bt-table td:first-child { text-align: left; }
.bt-table thead th {
    background: var(--surface-2); color: var(--ink-mid); font-size: 0.8rem;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.bt-table tbody tr { border-bottom: 1px solid var(--line-soft); }
.bt-table td.bt-model { font-weight: 700; }
.bt-table td.bt-avg { font-weight: 700; color: var(--accent-text); }
.bt-note {
    margin-top: 1rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    font-size: 0.84rem; color: var(--ink-mid);
}
.bt-note strong { color: var(--ink); }
.bt-meta { font-size: 0.8rem; color: var(--ink-dim); margin-bottom: 0.5rem; }
.bt-scroll { overflow-x: auto; }

/* ---------- 진행 / 결과 / 메시지 ---------- */
.progress { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.9rem; color: var(--ink-mid); font-size: 0.86rem; }
.spinner {
    width: 16px; height: 16px; border: 2px solid var(--line);
    border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite;
}
.collect-result {
    margin-top: 0.9rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm);
    background: rgba(85, 184, 119, 0.12); border: 1px solid rgba(85, 184, 119, 0.35);
    color: #a8ddbc; font-size: 0.88rem;
}
.collect-result strong { color: var(--ink); }
.error-msg {
    margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
    background: rgba(239, 107, 98, 0.12); border: 1px solid rgba(239, 107, 98, 0.35);
    color: #f4a6a0; font-size: 0.86rem;
}
.success-msg {
    margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
    background: rgba(85, 184, 119, 0.12); border: 1px solid rgba(85, 184, 119, 0.35);
    color: #a8ddbc; font-size: 0.86rem;
}

/* ===================================================================
   푸터
   =================================================================== */
.app-footer {
    max-width: var(--page); margin: 2.5rem auto 0; padding: 1.4rem 1.2rem 0;
    border-top: 1px solid var(--line);
    color: var(--ink-dim); font-size: 0.8rem;
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.9rem; }
.footer-nav a {
    color: var(--ink-mid); text-decoration: none; font-size: 0.85rem; font-weight: 500;
}
.footer-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.footer-note { line-height: 1.7; margin-bottom: 0.5rem; max-width: 70ch; }
.footer-note strong { color: var(--ink-mid); font-weight: 500; }
.footer-meta { margin-top: 0.9rem; font-size: 0.78rem; }
.footer-meta a { color: var(--ink-mid); }
.footer-sep { margin: 0 0.35rem; color: var(--line); }

/* ===================================================================
   안내 문서 페이지 (소개 / 이용안내 / 개인정보처리방침 / 문의하기)
   =================================================================== */
.doc-header { padding-bottom: 1.4rem; }
.back-home {
    display: inline-block; margin-bottom: 0.7rem;
    color: var(--ink-mid); text-decoration: none; font-size: 0.85rem;
}
.back-home:hover { color: var(--ink); }

.doc { line-height: 1.85; }
.doc > h2 {
    font-size: 1.02rem; margin: 2rem 0 0.7rem;
    padding-bottom: 0.5rem; border-bottom: 1px solid var(--line-soft);
}
.doc > h2:first-child, .doc > p:first-child { margin-top: 0; }
.doc p { margin-bottom: 0.9rem; color: var(--ink-mid); }
.doc p strong, .doc li strong, .doc dd strong { color: var(--ink); font-weight: 700; }
.doc a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.doc a:hover { color: #c0b5ff; }
.doc em { font-style: normal; color: var(--ink-dim); font-size: 0.92em; }

/* 값이 설정되지 않은 자리표시 */
.unset { color: var(--red); }

/* 목록 형태 */
.doc-list { margin-bottom: 1rem; }
.doc-list dt {
    font-weight: 700; color: var(--ink); margin-top: 0.9rem;
    padding-left: 0.7rem; border-left: 2px solid var(--accent-line);
}
.doc-list dd { color: var(--ink-mid); margin: 0.3rem 0 0 0.7rem; }

.doc-steps, .doc-bullets { margin: 0 0 1rem 1.2rem; color: var(--ink-mid); }
.doc-steps li, .doc-bullets li { margin-bottom: 0.5rem; padding-left: 0.2rem; }

.doc-tip {
    font-size: 0.86rem; color: var(--ink-dim);
    padding-left: 0.8rem; border-left: 2px solid var(--line);
}

/* 강조 박스 */
.callout {
    margin: 1.1rem 0; padding: 0.9rem 1.1rem; border-radius: var(--radius-sm);
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--ink-mid); font-size: 0.88rem; line-height: 1.75;
}
.callout-warn {
    background: rgba(239, 107, 98, 0.1); border-color: rgba(239, 107, 98, 0.3);
}
.callout strong { color: var(--ink); }

/* 문서용 표 */
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 420px; }
.doc-table thead th {
    background: var(--surface-2); border-bottom: 1px solid var(--line);
    padding: 0.6rem 0.8rem; color: var(--ink-mid); font-size: 0.8rem; text-align: left;
    white-space: nowrap;
}
.doc-table tbody th, .doc-table tbody td {
    padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line-soft);
    vertical-align: top; text-align: left; color: var(--ink-mid); line-height: 1.7;
}
.doc-table tbody th { color: var(--ink); font-weight: 700; white-space: nowrap; }
.doc-table tbody tr:last-child th, .doc-table tbody tr:last-child td { border-bottom: none; }

.doc-meta { margin-top: 1.6rem; font-size: 0.82rem; color: var(--ink-dim); }

/* ---------- 문의 양식 ---------- */
.inquiry-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 0.5rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.inquiry-form .field > span { font-size: 0.86rem; }
.inquiry-form .req { color: var(--red); font-style: normal; }
.inquiry-form input, .inquiry-form select, .inquiry-form textarea { width: 100%; }
.inquiry-form textarea {
    font-family: inherit; font-size: 0.94rem; line-height: 1.7; color: var(--ink);
    background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 0.7rem; resize: vertical; min-height: 160px;
}
.inquiry-form textarea::placeholder { color: var(--ink-dim); }
.inquiry-form textarea:focus { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.inquiry-form small { color: var(--ink-dim); font-size: 0.76rem; }
.inquiry-form .primary-btn { align-self: flex-start; }

.check-field {
    display: flex; align-items: flex-start; gap: 0.55rem;
    padding: 0.8rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
    font-size: 0.85rem; color: var(--ink-mid); line-height: 1.7; cursor: pointer;
}
.check-field input {
    width: 16px; height: 16px; margin-top: 0.25rem; flex-shrink: 0;
    accent-color: var(--accent);
}

@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; }
    .doc-table { min-width: 340px; }
}

/* ===================================================================
   모달 (로그인 / 회원가입)
   =================================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.2rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 11, 13, 0.7); }
.modal-box {
    position: relative; width: 100%; max-width: 380px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.1rem; }
.modal-head h2 { font-size: 1.1rem; }
.modal-close {
    border: none; background: none; color: var(--ink-dim);
    font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 0.2rem;
}
.modal-close:hover { color: var(--ink); }

.modal-form { display: flex; flex-direction: column; gap: 0.8rem; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field > span { font-size: 0.84rem; font-weight: 500; color: var(--ink-mid); }
.field > span em { font-style: normal; color: var(--ink-dim); font-weight: 400; }
.field small { font-size: 0.74rem; color: var(--ink-dim); }
.modal-foot { text-align: center; font-size: 0.84rem; color: var(--ink-mid); }

/* ---------- 애니메이션 ---------- */
@keyframes dropIn {
    0%   { transform: translateY(-70px) scale(0.6); opacity: 0; }
    70%  { transform: translateY(4px) scale(1.04); opacity: 1; }
    100% { transform: translateY(0) scale(1); }
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .drop-in, .machine-balls .mini-ball, .spinner, .machine-dome.spinning { animation: none !important; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 640px) {
    .highlight-row { grid-template-columns: 1fr; }
    .toggle { margin-left: 0; }
    .header-title h1 { font-size: 1.25rem; }
    .result-date { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
    .machine-dome { width: 190px; height: 190px; }
    .ball, .slot { width: 40px; height: 40px; font-size: 0.95rem; }
    .ball::after { top: 6px; left: 9px; width: 10px; height: 7px; }
    .number-row .ball { width: 44px; height: 44px; font-size: 1rem; }
    .stats-grid { grid-template-columns: repeat(5, 1fr); }

    /*
      당첨번호 6개를 한 줄에 고정한다.

      볼이 44px 고정이면 6개가 6*44 + 5*8(gap) = 304px 를 차지한다.
      360px 화면에서는 컨테이너와 카드 여백을 빼면 290px 안팎만 남아
      6번째 볼이 다음 줄로 밀려 "5개 + 1개" 로 보였다.

      뷰포트 너비로 계산하지 않고 flex 로 컨테이너 너비를 균등 분배한다.
      실제 남은 폭을 기준으로 하므로 여백이나 광고 레일 유무와 무관하게 넘치지 않는다.
      원형은 aspect-ratio 로 유지한다.
    */
    .number-row { justify-content: center; row-gap: 0.55rem; }

    #result-balls,
    #final-balls {
        flex-wrap: nowrap;
        width: 100%;
        gap: 0.4rem;
    }
    #result-balls .ball,
    #final-balls .ball {
        flex: 1 1 0;          /* .ball 의 flex-shrink: 0 을 덮어쓴다 */
        min-width: 0;
        width: auto;
        height: auto;
        max-width: 44px;      /* 넓은 화면에서 과도하게 커지지 않도록 상한 */
        aspect-ratio: 1 / 1;
        font-size: clamp(0.8rem, 3.6vw, 1rem);
    }
    /* 하이라이트는 고정 px 대신 비율로 두어 볼이 작아져도 위치가 유지된다 */
    #result-balls .ball::after,
    #final-balls .ball::after {
        top: 14%; left: 22%; width: 26%; height: 20%;
    }
}

/* ===================================================================
   오늘의 기록 (번호 추천 하단 카운터)
   =================================================================== */
.stats-card { margin-top: 1rem; }
.stats-date { font-size: 0.8rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }

.counter-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.5rem;
}
.counter-item {
    padding: 0.85rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.counter-item dt { font-size: 0.8rem; color: var(--ink-mid); margin-bottom: 0.25rem; }
.counter-item dd {
    font-size: 1.3rem; font-weight: 700; color: var(--ink);
    font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.counter-item dd .unit {
    font-size: 0.8rem; font-weight: 500; color: var(--ink-dim); margin-left: 0.15rem;
}

/* ===================================================================
   금주 회차 성적표 (추첨결과 탭 하단)
   =================================================================== */

/*
  등수 5개를 한 줄에 놓는다. 좁은 화면에서는 auto-fit 이 줄을 나눈다.
  minmax 하한을 counter-item(150px)보다 작게 둔 이유는 5칸이 들어가야 하기 때문이다.
*/
.score-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.5rem;
    margin-top: 0.9rem;
}
.score-item {
    padding: 0.85rem 0.7rem; text-align: center; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.score-item dt { font-size: 0.86rem; font-weight: 700; color: var(--ink-mid); margin-bottom: 0.3rem; }
.score-item dd {
    font-size: 1.35rem; font-weight: 800; color: var(--ink);
    font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.score-item dd .unit {
    font-size: 0.78rem; font-weight: 500; color: var(--ink-dim); margin-left: 0.1rem;
}
.score-item small {
    display: block; margin-top: 0.35rem;
    font-size: 0.7rem; color: var(--ink-dim); line-height: 1.35;
}

/* 당첨 건수가 있는 등수는 강조한다(0건이 대부분이므로 눈에 띄어야 의미가 있다) */
.score-item.hit {
    background: var(--accent-soft); border-color: var(--accent-line);
}
.score-item.hit dt, .score-item.hit dd { color: var(--accent-text); }

/* 남은 추첨 횟수 안내 */
.limit-note {
    margin-top: 1rem; padding: 0.5rem 0.9rem; border-radius: 999px;
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--accent-text); font-size: 0.82rem; font-weight: 500;
    display: inline-block;
}

/* ===================================================================
   마이페이지
   =================================================================== */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.5rem; }
.profile-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.8rem;
    padding: 0.7rem 0.9rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.profile-item dt { font-size: 0.82rem; color: var(--ink-mid); }
.profile-item dd { font-size: 0.9rem; font-weight: 700; text-align: right; }

.grade-tag {
    display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--accent-text); font-size: 0.8rem; font-weight: 700;
}

.mydraws-list { display: flex; flex-direction: column; gap: 0.5rem; }
.mydraw-row {
    padding: 0.85rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.mydraw-head {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem;
}
.mydraw-episode { font-weight: 700; font-size: 0.88rem; }
.mydraw-when { font-size: 0.76rem; color: var(--ink-dim); }
.mydraw-badge {
    margin-left: auto; padding: 0.15rem 0.55rem; border-radius: 999px;
    font-size: 0.76rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.mydraw-badge.pending {
    background: var(--surface-3); border-color: var(--line); color: var(--ink-mid);
}
.mydraw-badge.win {
    background: rgba(85, 184, 119, 0.15); border-color: rgba(85, 184, 119, 0.4); color: #8fd3a8;
}
.mydraw-badge.miss {
    background: var(--surface-3); border-color: var(--line); color: var(--ink-dim);
}

.mydraw-balls { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
/* 맞지 않은 번호는 흐리게, 맞은 번호는 테두리로 강조 */
.mydraw-balls .mini-num.dimmed { opacity: 0.35; }
.mydraw-balls .mini-num.hit { box-shadow: 0 0 0 2px var(--accent-text); }
.mydraw-plus { color: var(--ink-dim); margin: 0 0.15rem; }

.mydraw-actual {
    display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
    margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--line);
}
.mydraw-actual-label { font-size: 0.76rem; color: var(--ink-dim); white-space: nowrap; }

.empty-note {
    padding: 1.4rem; text-align: center; color: var(--ink-dim); font-size: 0.86rem;
    border: 1px dashed var(--line); border-radius: var(--radius-sm);
}

/* ===================================================================
   관리자 환경 설정
   =================================================================== */
.setting-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.setting-row {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: 0.7rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
}
.setting-name {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    font-size: 0.9rem; font-weight: 500;
}
.setting-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem; color: var(--ink-dim);
    background: var(--surface-3); border: 1px solid var(--line);
    border-radius: 3px; padding: 0.05rem 0.35rem;
}
.setting-input { display: inline-flex; align-items: center; gap: 0.4rem; }
.setting-input input { width: 90px; text-align: right; }
.setting-unit { font-size: 0.78rem; color: var(--ink-dim); white-space: nowrap; }
/* 설정 행 안의 토글은 자동 좌측 여백을 쓰지 않는다 */
.setting-row .toggle { margin-left: 0; }

/* 비밀번호 재설정 페이지 — 좁은 카드를 가운데 정렬 */
.reset-card { max-width: 460px; margin-left: auto; margin-right: auto; }

@media (max-width: 560px) {
    .setting-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .mydraw-badge { margin-left: 0; }
}

/* ===================================================================
   관리자 문의 관리
   =================================================================== */
.head-actions { display: inline-flex; align-items: center; gap: 0.7rem; }

/* 탭에 붙는 미답변 건수 배지 */
.tab-badge {
    display: inline-grid; place-items: center;
    min-width: 17px; height: 17px; padding: 0 0.25rem; margin-left: 0.3rem;
    border-radius: 999px; background: var(--red); color: #fff;
    font-size: 0.68rem; font-weight: 700; line-height: 1;
    vertical-align: 1px;
}

.inquiry-list { display: flex; flex-direction: column; gap: 0.5rem; }
.inquiry-row {
    padding: 0.9rem 1rem; background: var(--surface-2);
    border: 1px solid var(--line-soft); border-radius: var(--radius-sm);
    border-left: 2px solid var(--red);
}
/* 답변이 끝난 문의는 강조를 낮춘다 */
.inquiry-row.answered { border-left-color: var(--line); opacity: 0.72; }

.inquiry-head {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.6rem;
}
.inquiry-category {
    padding: 0.1rem 0.5rem; border-radius: 3px;
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--accent-text); font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
.inquiry-writer { font-size: 0.88rem; font-weight: 700; }
.inquiry-mail { font-size: 0.8rem; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.inquiry-mail:hover { color: #c0b5ff; }
.inquiry-when { font-size: 0.76rem; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.inquiry-status {
    margin-left: auto; padding: 0.12rem 0.5rem; border-radius: 999px;
    font-size: 0.74rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.inquiry-status.todo {
    background: rgba(239, 107, 98, 0.14); border-color: rgba(239, 107, 98, 0.4); color: #f4a6a0;
}
.inquiry-status.done {
    background: var(--surface-3); border-color: var(--line); color: var(--ink-dim);
}

.inquiry-message {
    font-size: 0.87rem; color: var(--ink-mid); line-height: 1.75;
    white-space: pre-wrap; word-break: break-word;
    padding: 0.7rem 0.9rem; background: var(--surface); border-radius: var(--radius-sm);
    border: 1px solid var(--line-soft);
}
.inquiry-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.inquiry-actions .ghost-btn, .inquiry-actions .secondary-btn {
    padding: 0.4rem 0.85rem; font-size: 0.82rem;
}

/* ===================================================================
   위험 동작 영역 (회원 탈퇴)
   =================================================================== */
.danger-card { border-color: rgba(239, 107, 98, 0.3); }
.danger-card .card-head { border-bottom-color: rgba(239, 107, 98, 0.2); }
.danger-card .card-head h2 { color: #f4a6a0; }

.danger-btn {
    padding: 0.65rem 1.3rem; border: 1px solid var(--red); border-radius: var(--radius-sm);
    background: transparent; color: #f4a6a0;
    font-family: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer;
    align-self: flex-start;
}
.danger-btn:hover:not(:disabled) { background: var(--red); color: #fff; }
.danger-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.danger-text { color: #f4a6a0; }
.danger-text:hover { color: #fff; border-color: var(--red); }

/* ---------- 내 정보 수정 ---------- */

/*
  이메일 미등록 안내.
  오류가 아니라 주의를 끌어야 하는 상태이므로 빨강이 아닌 주황 계열을 쓴다.
*/
.warn-note {
    margin-top: 0.9rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm);
    background: rgba(240, 165, 0, 0.12); border: 1px solid rgba(240, 165, 0, 0.35);
    color: #f0c070; font-size: 0.86rem; line-height: 1.5;
}

/* 수정 양식도 탈퇴와 같이 접어 둔다(평소에는 조회 화면을 방해하지 않게) */
.profile-edit-details { margin-top: 1rem; }
.profile-edit-details > summary {
    cursor: pointer; display: inline-block;
    padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink-mid); font-size: 0.86rem;
}
.profile-edit-details > summary:hover { color: var(--ink); border-color: #454a52; }
.profile-edit-details[open] > summary { margin-bottom: 1rem; }
.profile-form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 420px; }
.profile-form input { width: 100%; }
.profile-form .primary-btn { align-self: flex-start; }

/* 탈퇴 양식은 접어 두어 실수로 누르지 않게 한다 */
.withdraw-details > summary {
    cursor: pointer; display: inline-block;
    padding: 0.45rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--ink-mid); font-size: 0.86rem;
}
.withdraw-details > summary:hover { color: var(--ink); border-color: #454a52; }
.withdraw-details[open] > summary { margin-bottom: 1rem; }
.withdraw-form { display: flex; flex-direction: column; gap: 0.8rem; max-width: 420px; }
