/* ══════════════════════════════════════════════════════════════
   SEO Factory — NICE COMPANY 테마
   NaverToolWeb(assets/style.css)과 같은 디자인 체계: 밝은 바탕 + 초록 포인트.
   전역 컴포넌트: 레이아웃 · 사이드바 · 페이지 머리 · 카드 · 버튼 · 입력 · 선택 카드 · 상태 배지
                 · 목록/상세 · 단계 타일 · 탭 · 표 · 단계 목록 · 모달 · 알림 · 파일 선택
   ══════════════════════════════════════════════════════════════ */
:root {
    --nice-green: #2eb872;
    --nice-green-dark: #27a565;
    --nice-green-soft: #e8f6ee;
    --nice-green-line: #bfe8d1;
    --nice-text: #222a33;
    --nice-strong: #1f2937;
    --nice-sub: #4b5563;
    --nice-muted: #7b8794;
    --nice-line: #e3e7ec;
    --nice-panel: #f3f5f7;
    --nice-bg: #f4f6f8;
    --nice-input: #d5dbe1;
    --nice-red: #e04848;
    --nice-red-dark: #c53030;
    --nice-red-soft: #fdeeee;
    --nice-red-line: #f3caca;
    --nice-yellow: #9a6200;
    --nice-yellow-soft: #fff5e0;
    --nice-yellow-line: #f5dfae;
    /* 통계 차트 색 — 검색엔진 순서 네이버 · 구글 · 다음 · 빙 (이 순서로 색약·대비 검사 통과), 0 = 계열 하나 */
    --viz-0: #2a78d6;
    --viz-1: #008300;
    --viz-2: #2a78d6;
    --viz-3: #eb6834;
    --viz-4: #6250d6;
    --viz-grid: #e9edf1;
    --viz-axis: #c9d1d9;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, 'Noto Sans KR', sans-serif;
    font-size: 14px;
    background: var(--nice-bg);
    color: var(--nice-text);
}

/* 맨 위 초록 줄 */
body::before { content: ""; display: block; height: 4px; background: var(--nice-green); }
body.modal-open { overflow: hidden; }

a { color: #1f8f56; }
h1, h2, h3 { color: var(--nice-strong); }
.muted, small { color: var(--nice-muted); }
.wrap { white-space: pre-wrap; word-break: break-word; }
.hidden, [hidden] { display: none !important; }
code {
    background: var(--nice-panel);
    color: #374151;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
}

/* ── 레이아웃 · 사이드바 ── */
.layout { display: flex; min-height: calc(100vh - 4px); }

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--nice-line);
    padding: 0 14px 24px;
}

.logo {
    display: block;
    padding: 18px 12px 12px;
    margin: 0 -14px 10px;
    border-bottom: 1px solid var(--nice-line);
    text-decoration: none;
}

.logo-nice {
    display: block;
    color: var(--nice-green);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: .18em;
    line-height: 1;
}

.logo-company {
    display: block;
    color: #8a97a6;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    margin-top: 3px;
}

.brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #8a97a6;
    margin: 18px 12px 8px;
}

.nav {
    display: block;
    color: var(--nice-sub);
    font-weight: 600;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.nav.active,
.nav:hover { background: var(--nice-green-soft); color: #1f7a4a; }

.nav-divider { height: 1px; background: var(--nice-line); margin: 18px 0 6px; }

.mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    color: var(--nice-sub);
    font-size: 13px;
}

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; padding: 24px 28px 48px; min-width: 0; }

/* ── 페이지 머리 ── */
.page-title-wrap { margin-bottom: 20px; }

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-title-wrap h1 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.page-title-wrap p { margin: 0; color: #8a97a6; font-size: 14px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── 카드 ── */
.card {
    background: #fff;
    border: 1px solid var(--nice-line);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.card h2 { font-size: 18px; margin: 0 0 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.list-total { margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--nice-muted); }

/* ── 버튼: 기본 초록, 회색은 흰 바탕+테두리, 위험은 빨강 ── */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: var(--nice-green);
    color: #fff;
    padding: 11px 16px;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

button:hover,
.btn:hover { background: var(--nice-green-dark); color: #fff; }

.btn.gray,
button.gray { background: #fff; color: #374151; border: 1px solid var(--nice-input); }
.btn.gray:hover,
button.gray:hover { background: var(--nice-panel); color: var(--nice-strong); }

.danger,
button.danger { background: var(--nice-red); color: #fff; }
.danger:hover,
button.danger:hover { background: var(--nice-red-dark); }

.btn.small,
button.small { padding: 7px 12px; font-size: 12px; border-radius: 8px; }
.btn.large,
button.large { min-width: 160px; min-height: 46px; font-size: 15px; }

button[disabled],
.btn[disabled] { opacity: .45; cursor: not-allowed; }

form.inline { display: inline; margin: 0; }

/* ── 입력 ── */
label { display: block; color: var(--nice-sub); font-size: 13px; font-weight: 700; margin-bottom: 6px; }
label .req { color: var(--nice-red); margin-left: 3px; }
.label-hint { color: var(--nice-muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.form-hint { margin: 6px 0 0; font-size: 12px; color: var(--nice-muted); line-height: 1.5; }

input,
select,
textarea {
    width: 100%;
    margin: 0;
    padding: 11px 12px;
    background: #fff;
    color: var(--nice-text);
    border: 1px solid var(--nice-input);
    border-radius: 10px;
    font: inherit;
}

textarea { min-height: 84px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa5b1; }

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--nice-green);
    box-shadow: 0 0 0 3px rgba(46, 184, 114, .18);
}

input[type="radio"] { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--nice-green); flex-shrink: 0; }

.form-section { margin-bottom: 22px; }
.form-section > h3,
.form-section > summary { margin: 0 0 14px; font-size: 16px; font-weight: 800; color: var(--nice-strong); }

details.form-section {
    border: 1px solid var(--nice-line);
    border-radius: 14px;
    padding: 0 16px;
    background: #fff;
}

details.form-section > summary {
    margin: 0 -16px;
    padding: 14px 16px;
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

details.form-section > summary::-webkit-details-marker { display: none; }
details.form-section > summary::after { content: "▾"; margin-left: auto; color: var(--nice-muted); transition: transform .15s; }
details.form-section:not([open]) > summary::after { transform: rotate(-90deg); }
details.form-section[open] { padding-bottom: 16px; }
details.form-section[open] > summary { margin-bottom: 4px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.one { grid-template-columns: minmax(0, 1fr); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: 1 / -1; }

/* 로고 옆 영문 문구: 입력은 대문자로 보이고, 옆에 사이트 상단 미리보기 */
input.upper { text-transform: uppercase; }
input.upper::placeholder { text-transform: none; }
.brand-preview {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
    border: 1px dashed var(--nice-input); border-radius: 10px; background: #fff; overflow: hidden;
}
.brand-mark { flex-shrink: 0; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: #1f2d4d; color: #fff; font-weight: 800; font-size: 14px; }
.brand-preview b { font-size: 15px; color: var(--nice-strong); white-space: nowrap; }
.brand-preview small { font-size: 11px; letter-spacing: .16em; color: #6b7280; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-preview small.auto { letter-spacing: normal; text-transform: none; color: var(--nice-muted); font-style: italic; }

/* 입력 칸 + 옆 버튼 (플레이스에서 불러오기) */
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; min-width: 0; }
.input-with-btn button { flex-shrink: 0; }
.form-hint.ok { color: #1a7f4c; }
.form-hint.err { color: var(--nice-red-dark); }
/* 방금 플레이스에서 채운 칸 잠깐 표시 */
.filled-flash { animation: filled-flash 1.6s ease-out; }
@keyframes filled-flash { from { background: var(--nice-green-soft); border-color: var(--nice-green); } }
@media (prefers-reduced-motion: reduce) { .filled-flash { animation: none; } }
.form-group { min-width: 0; }

/* ── 선택 카드 (라디오) ── */
.choice-grid { display: grid; gap: 10px; margin-bottom: 14px; }
.choice-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.choice-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--nice-input);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}

.choice-card:hover { border-color: var(--nice-green); }
.choice-card:has(input:checked) { border-color: var(--nice-green); background: var(--nice-green-soft); }
.choice-card input { margin-top: 1px; align-self: center; }

/* ── 라디오 · 체크박스: 브라우저 기본 모양 대신 같은 초록 체계 ── */
input[type="radio"], input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    display: inline-block;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 2px solid var(--nice-input);
    background: #fff;
    vertical-align: middle;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"]:hover, input[type="checkbox"]:hover { border-color: var(--nice-green); }
input[type="radio"]:checked { border-color: var(--nice-green); background: radial-gradient(circle, var(--nice-green) 0 38%, #fff 44%); }
input[type="checkbox"]:checked {
    border-color: var(--nice-green);
    background: var(--nice-green) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M5 12.5l4.5 4.5L19 7.5'/></svg>") center / 13px no-repeat;
}
input[type="radio"]:focus-visible, input[type="checkbox"]:focus-visible { outline: 2px solid rgba(46, 184, 114, .45); outline-offset: 2px; }
input[type="radio"][disabled], input[type="checkbox"][disabled] { opacity: .45; cursor: not-allowed; }
.choice-card span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.choice-card b { color: var(--nice-strong); font-size: 14px; }
.choice-card small { font-weight: 400; font-size: 12px; line-height: 1.45; }

/* ── 상태 배지 (전역) — ready 회색 · running 연초록 · done 초록 채움 · stopped 빨강 · cooldown 노랑 ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
}

/* 모두 연한 바탕 + 진한 글자. 앞의 점(·)/표(✓)로 상태를 구분한다 — 완료는 ✓, 진행 중은 깜빡이는 점 */
.status-badge::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-ready { background: #f1f3f6; color: #5b6b7c; border-color: #e1e6ec; }
.status-running { background: #e6f7ee; color: #1a7f4c; border-color: #c6ead6; }
.status-running::before { animation: blink 1.2s ease-in-out infinite; }
.status-done { background: #e3f5ea; color: #15673d; border-color: #bfe3cc; }
.status-done::before { content: "✓"; width: auto; height: auto; background: none; border-radius: 0; font-size: 11px; font-weight: 900; line-height: 1; }
.status-stopped { background: var(--nice-red-soft); color: #b83232; border-color: var(--nice-red-line); }
.status-cooldown { background: var(--nice-yellow-soft); color: var(--nice-yellow); border-color: var(--nice-yellow-line); }
.status-skip { background: #fff; color: var(--nice-muted); border: 1px dashed var(--nice-input); }
.status-skip::before { display: none; }

/* 필수/권장 구분 태그 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.tag.req { background: var(--nice-red-soft); color: #b83232; }
.tag.rec { background: var(--nice-panel); color: var(--nice-sub); }

/* ── 알림 ── */
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    line-height: 1.55;
}

.alert.success { background: #e6f7ee; color: #1f6b42; border-color: var(--nice-green-line); }
.alert.error { background: var(--nice-red-soft); color: #9b2c2c; border-color: var(--nice-red-line); white-space: pre-wrap; }
.alert.warn { background: var(--nice-yellow-soft); color: #7a5200; border-color: var(--nice-yellow-line); }
.alert.info { background: var(--nice-panel); color: var(--nice-sub); border-color: var(--nice-line); }

/* ── 목록 + 상세 (작업목록) ── */
.work-list-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

/* 표 최소 폭이 칸을 밀어내지 않게 (표는 .table-wrap 안에서 가로 스크롤) */
.work-list-layout > * { min-width: 0; }

.work-list-card {
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    min-height: 420px;
}

.list-search { margin-bottom: 12px; }
.list-filters { display: flex; gap: 6px; margin-bottom: 8px; }
.list-filters:empty { display: none; }
.list-group { flex: 1 1 0; min-width: 0; padding: 9px 10px; font-weight: 700; color: var(--nice-strong); }

/* 작업 카드의 프리셋 표시 — 자리가 없으면 다음 줄로 내려간다 (카드 밖으로 잘리지 않게) */
.work-item-date { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; }
.work-item-date > span:first-child { white-space: nowrap; }
.preset-tag {
    display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%;
    padding: 2px 8px 2px 6px; border-radius: 999px;
    background: var(--nice-green-soft); border: 1px solid var(--nice-green-line);
    color: #1a7f4c; font-size: 11px; font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.preset-tag .icon { width: 12px; height: 12px; flex-shrink: 0; }
.preset-tags { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; max-width: 100%; margin-left: auto; justify-content: flex-end; }
.preset-tags .preset-tag { flex: 0 1 auto; }
/* 키워드(분야) 프리셋 = 파란 꼬리표 */
.preset-tag.kw { padding-left: 8px; background: #eef4ff; border-color: #c9dafc; color: #2f5bb7; }

.list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-right: -8px;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.work-item {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--nice-line);
    border-radius: 14px;
    background: #fff;
    color: var(--nice-text);
    text-decoration: none;
}

.work-item:hover { border-color: var(--nice-green-line); }
.work-item.active { border-color: var(--nice-green-line); background: var(--nice-green-soft); }

.work-item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.work-item-head strong { font-size: 15px; color: var(--nice-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item-meta { margin-top: 3px; color: var(--nice-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item-date { margin-top: 8px; color: #9aa5b1; font-size: 12px; }

.work-progress-row { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.mini-progress { flex: 1; height: 8px; background: var(--nice-line); border-radius: 999px; overflow: hidden; }
.mini-progress-fill { height: 100%; border-radius: 999px; background: var(--nice-green); }
.mini-progress-text { min-width: 38px; text-align: right; font-size: 12px; font-weight: 800; color: var(--nice-text); }

.empty-box {
    padding: 30px;
    border: 1px dashed var(--nice-input);
    border-radius: 14px;
    color: var(--nice-muted);
    text-align: center;
    line-height: 1.7;
}

.work-detail-card { min-height: 600px; }

.work-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.work-detail-head h2 { margin: 0 0 6px; font-size: 24px; }
.work-detail-head p { margin: 0; color: var(--nice-muted); word-break: break-all; }
.work-detail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── 다음 할 일 ── */
.next-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid var(--nice-line);
    background: var(--nice-panel);
}

.next-action > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.next-action b { font-size: 11px; letter-spacing: .12em; color: var(--nice-muted); }
.next-action span { font-size: 15px; font-weight: 700; color: var(--nice-strong); word-break: break-word; }
.next-action.next-success { background: var(--nice-green-soft); border-color: var(--nice-green-line); }
.next-action.next-warn { background: var(--nice-yellow-soft); border-color: var(--nice-yellow-line); }
.next-action.next-error { background: var(--nice-red-soft); border-color: var(--nice-red-line); }

/* ── 단계 타일 (원고 → 검수 → 개설 → 발행) / 숫자 타일 ── */
.target-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.target-box.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.tile,
.stage {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--nice-line);
    border-radius: 14px;
    background: #fff;
    color: var(--nice-text);
    text-align: left;
    font-weight: 400;
}

.tile span,
.stage span { display: block; margin-bottom: 6px; color: var(--nice-muted); font-size: 12px; font-weight: 700; }
.tile strong { font-size: 22px; color: var(--nice-strong); }
.stage strong { display: block; font-size: 14px; color: var(--nice-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stage { border-left-width: 4px; cursor: pointer; }
.stage:hover { background: var(--nice-panel); color: var(--nice-text); }
.stage-done { border-left-color: #1e7f4f; }
.stage-running { border-left-color: var(--nice-green); }
.stage-stopped { border-left-color: var(--nice-red); }
.stage-cooldown { border-left-color: #e0a526; }
.stage-ready { border-left-color: var(--nice-input); }
.stage-skip { border-style: dashed; border-left-width: 1px; }
.stage-skip strong { color: var(--nice-muted); font-weight: 400; }

/* ── 탭 (밑줄형 — 실서비스 관리 화면 식) ── */
.tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--nice-line);
    overflow-x: auto;
}

.tab {
    height: 44px;
    padding: 0 14px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--nice-sub);
    font-weight: 800;
    white-space: nowrap;
}

.tab:hover { background: none; color: #1f7a4a; }
.tab.active { background: none; border-bottom-color: var(--nice-green); color: #1f7a4a; }
.tab .tab-count { margin-left: 4px; }

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--nice-red);
    color: #fff;
    font-size: 11px;
    font-style: normal;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.panel-title { margin: 22px 0 12px; font-size: 16px; }
.panel-title:first-child { margin-top: 0; }

/* ── 표 ── */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--nice-line); border-radius: 12px; }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    padding: 12px;
    background: var(--nice-panel);
    color: var(--nice-sub);
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    border-bottom: 1px solid var(--nice-line);
    white-space: nowrap;
}

.data-table td {
    padding: 11px 12px;
    background: #fff;
    border-bottom: 1px solid var(--nice-line);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #f8fcf9; }
.data-table tr.row-fail td { background: #fffafa; }
.data-table .ellipsis { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .num { width: 46px; text-align: center; color: var(--nice-muted); }

.kv-table th { width: 130px; vertical-align: top; }

.table-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.table-search { width: 340px; max-width: 100%; }
.table-toolbar select { width: 130px; }
.table-info { margin-left: auto; color: var(--nice-muted); font-size: 14px; font-weight: 700; }

/* ── 단계 목록 (사이트 개설) ── */
.step-list { list-style: none; margin: 0; padding: 0; }

.step {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--nice-line);
}

.step:last-child { border-bottom: 0; }

.step-dot {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    background: var(--nice-panel);
    color: var(--nice-muted);
    border: 1px solid var(--nice-line);
}

.step-done .step-dot { background: #1e7f4f; border-color: #1e7f4f; color: #fff; }
.step-running .step-dot { background: var(--nice-green-soft); border-color: var(--nice-green); color: #1a7f4c; }
.step-wait .step-dot { background: var(--nice-yellow-soft); border-color: #e0a526; color: var(--nice-yellow); }
.step-error .step-dot { background: var(--nice-red); border-color: var(--nice-red); color: #fff; }

.step-body { min-width: 0; flex: 1; }
.step-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--nice-strong); min-height: 30px; }
.step-detail { margin-top: 2px; color: var(--nice-muted); font-size: 13px; line-height: 1.5; word-break: break-word; }

/* 네임서버 안내 */
.ns-box { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 16px; }
.ns-row { display: flex; align-items: center; gap: 10px; }
.ns-row code { font-size: 15px; padding: 6px 10px; }

.action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* 워드프레스 관리자 로그인 정보 (사이트 개설 완료 후) */
.cred-box { display: inline-flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--nice-line); border-radius: 12px; background: var(--nice-panel); }
.cred-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cred-row > span { width: 96px; font-size: 13px; font-weight: 700; color: var(--nice-sub); }
.cred-row code { min-width: 150px; padding: 5px 9px; border-radius: 7px; background: #fff; border: 1px solid var(--nice-line); font-size: 13px; letter-spacing: .02em; }
.cred-secret:not(.shown) { letter-spacing: .12em; color: var(--nice-muted); }
.cred-hint { font-size: 12px; color: var(--nice-muted); }

/* ── 모달 ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    padding: 30px;
    background: rgba(15, 23, 42, .35);
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-window {
    width: min(980px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--nice-line);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.modal-header {
    flex-shrink: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--nice-line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 { margin: 0; font-size: 20px; }

.modal-close {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background: var(--nice-red);
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.modal-close:hover { background: var(--nice-red-dark); }

.modal-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px 24px; }

.modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px;
    border-top: 1px solid var(--nice-line);
    background: #fff;
}

.modal-footer .muted { margin-right: auto; }

/* ── 예/아니오 창 (app.js ask · notice — 브라우저 확인창 대신) ── */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;   /* 다른 모달 위 */
    padding: 20px;
    background: rgba(15, 23, 42, .45);
    align-items: center;
    justify-content: center;
}
.confirm-overlay.show { display: flex; animation: dlg-fade .12s ease-out; }
.confirm-window {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--nice-line);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;
    animation: dlg-pop .14s ease-out;
}
.confirm-body { display: flex; gap: 14px; padding: 22px 22px 16px; }
.confirm-icon {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 18px; font-weight: 900;
    background: var(--nice-green-soft); color: #1a7f4c;
}
.confirm-icon::before { content: "?"; }
.confirm-overlay[data-kind="danger"] .confirm-icon { background: var(--nice-red-soft); color: var(--nice-red-dark); }
.confirm-overlay[data-kind="danger"] .confirm-icon::before { content: "!"; }
.confirm-overlay[data-kind="notice"] .confirm-icon { background: var(--nice-yellow-soft); color: var(--nice-yellow); }
.confirm-overlay[data-kind="notice"] .confirm-icon::before { content: "i"; font-family: Georgia, serif; }
.confirm-overlay[data-kind="input"] .confirm-icon::before { content: "✎"; font-size: 17px; }
.confirm-text { flex: 1; min-width: 0; }
.confirm-text h3 { margin: 2px 0 6px; font-size: 17px; color: var(--nice-strong); }
.confirm-text p { margin: 0; color: var(--nice-sub); font-size: 14px; line-height: 1.6; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.confirm-input { margin-top: 12px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 22px 20px; }
.confirm-actions button { min-width: 84px; }
.confirm-actions button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(46, 184, 114, .35); }
.confirm-actions button.danger:focus-visible { box-shadow: 0 0 0 3px rgba(224, 72, 72, .3); }
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes dlg-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
    .confirm-overlay.show, .confirm-window { animation: none; }
}
@media (max-width: 480px) {
    .confirm-actions button { flex: 1; }
}

/* ── 단계형 모달 (새 사이트 만들기) ── */
.wizard-window { width: min(900px, 96vw); height: min(780px, 92vh); }

.wizard-steps {
    flex-shrink: 0;
    list-style: none;
    margin: 0;
    padding: 12px 24px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--nice-line);
    background: #fafbfc;
    overflow-x: auto;
}

.wizard-step {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--nice-muted);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

.wizard-step b {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--nice-input);
    font-size: 13px;
}

.wizard-step span { display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wizard-step small { font-weight: 400; font-size: 11px; color: var(--nice-muted); }

.wizard-step.reachable { cursor: pointer; color: var(--nice-strong); }
.wizard-step.reachable:hover { background: var(--nice-green-soft); }
.wizard-step.done b { background: #1e7f4f; border-color: #1e7f4f; color: #fff; font-size: 0; }
.wizard-step.done b::after { content: "✓"; font-size: 13px; }
.wizard-step.current { background: var(--nice-green-soft); color: #1a7f4c; }
.wizard-step.current b { background: var(--nice-green); border-color: var(--nice-green); color: #fff; font-size: 13px; }
.wizard-step.current b::after { content: none; }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }
.wizard-head { margin-bottom: 18px; }
.wizard-head h3 { margin: 0 0 4px; font-size: 19px; }
.wizard-head p { margin: 0; color: var(--nice-muted); font-size: 13px; line-height: 1.5; }

.sub-title { margin: 22px 0 10px; font-size: 14px; font-weight: 800; color: var(--nice-strong); }
.wizard-head + .sub-title { margin-top: 0; }

/* 기본정보 프리셋 (1단계 위) */
.preset-bar { margin: -4px 0 20px; padding: 12px 14px; background: var(--nice-panel); border: 1px solid var(--nice-line); border-radius: 12px; }
.preset-row { display: flex; align-items: center; gap: 8px; }
.preset-row select { flex: 1; min-width: 0; padding: 8px 10px; }
.preset-row .small { flex-shrink: 0; }
.preset-row [data-preset-save] { min-width: 116px; }   /* 두 줄의 고르기 칸 폭을 맞춘다 */
.preset-bar .preset-row + .preset-row { margin-top: 6px; }
.preset-title { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--nice-strong); }
.preset-title .icon { color: var(--nice-green); }
.preset-bar .form-hint.ok { color: #1a7f4c; }
.preset-bar .form-hint.err { color: var(--nice-red-dark); }
@media (max-width: 640px) {
    .preset-row { flex-wrap: wrap; }
    .preset-title,
    .preset-row select { flex-basis: 100%; }
}

.review-table td:last-child { width: 70px; text-align: right; }
.review-table .empty { color: var(--nice-muted); }
.review-warn { margin-top: 14px; }
.review-warn ul { margin: 6px 0 0; padding-left: 18px; }

/* ── 아이콘 (SVG, 글자색을 따른다) ── */
.icon { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; transition: transform .15s ease; }
.small .icon { width: 14px; height: 14px; }
.large .icon { width: 18px; height: 18px; }
button:hover .icon-next, .btn:hover .icon-next,
button:hover .icon-go, .btn:hover .icon-go { transform: translateX(3px); }
button:hover .icon-prev, .btn:hover .icon-prev { transform: translateX(-3px); }
button:hover .icon-external, .btn:hover .icon-external { transform: translate(2px, -2px); }
.alert .icon-external { width: 13px; height: 13px; margin-left: 2px; color: var(--nice-muted); }

/* '바로 가기'는 알약 모양 */
.go-btn { border-radius: 999px; padding-left: 14px; padding-right: 12px; }

/* ── 사진 칸 (칸마다 한 장 · 칸 이름 = 사진 설명) ── */
.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.photo-slot {
    position: relative;
    aspect-ratio: 1 / .82;
    margin: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1.5px solid var(--nice-input);
    border-radius: 12px;
    background: var(--nice-panel);
    color: #374151;
    font: inherit;
    font-weight: 400;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .12s, background .12s;
}

.photo-slot:hover,
.photo-slot:focus-visible,
.photo-slot.dragover,
.photo-slot.photo-add:hover { border-color: var(--nice-green); background: var(--nice-green-soft); color: #374151; outline: none; }

.photo-circle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dfe5ec;
    color: #8a97a6;
    transition: background .12s, color .12s;
}

.photo-circle .icon { width: 22px; height: 22px; }
.photo-slot:hover .photo-circle,
.photo-slot.dragover .photo-circle { background: var(--nice-green-line); color: #1a7f4c; }

.photo-label { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.3; }

.photo-label-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px dashed transparent;
    border-radius: 6px;
    background: transparent;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.photo-label-input:hover { border-color: var(--nice-input); background: #fff; }
.photo-label-input:focus { border-style: solid; background: #fff; }

.photo-add { border-style: dashed; background: #fff; }
.photo-add .photo-circle { background: var(--nice-panel); }
.photo-add .photo-label small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; color: var(--nice-muted); }

/* 사진이 하나도 없을 때: '사진 추가'가 한 줄 전체를 차지하는 넓은 놓기 영역 */
.photo-grid:not(:has([data-slot])) .photo-add { grid-column: 1 / -1; aspect-ratio: auto; min-height: 170px; }

/* 사진을 고른 칸: 사진을 꽉 채우고 이름은 아래 띠에 */
.photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.photo-slot.filled { border-color: var(--nice-green); }
.photo-slot.filled .photo-preview { display: block; }
.photo-slot.filled .photo-circle { display: none; }
.photo-slot.filled .photo-label,
.photo-slot.filled .photo-label-input {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 18px 8px 8px;
    border: 0;
    border-radius: 0;
    background: linear-gradient(transparent, rgba(17, 24, 39, .72));
    color: #fff;
}

.photo-slot.filled .photo-label-input::placeholder { color: rgba(255, 255, 255, .8); }

.photo-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, .6);
    color: #fff;
}
.photo-remove .icon { width: 14px; height: 14px; }
.photo-slot .photo-remove:hover { background: var(--nice-red); color: #fff; }
.photo-slot.filled .photo-remove { display: flex; }

/* 순서 번호 (1 = 대표) · 링크 있음 표시 */
.photo-order {
    position: absolute; top: 8px; left: 8px;
    display: none; align-items: center;
    height: 24px; padding: 0 9px; border-radius: 999px;
    background: var(--nice-green); color: #fff;
    font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.photo-slot.filled .photo-order { display: inline-flex; }
.photo-link-flag {
    position: absolute; top: 8px; right: 38px;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #fff; color: #1a7f4c; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.photo-link-flag .icon { width: 14px; height: 14px; }

/* 고른 칸 · 끄는 중인 칸 */
.photo-slot.selected { border-color: var(--nice-green); box-shadow: 0 0 0 3px rgba(46, 184, 114, .35); }
.photo-slot.dragging { opacity: .45; }
.photo-slot[draggable="true"].filled { cursor: grab; }

/* 이미지 설정 (칸을 누르면 아래에 열림) */
.photo-editor {
    display: flex; gap: 16px;
    margin-top: 14px; padding: 16px;
    border: 1.5px solid var(--nice-green-line); border-radius: 14px;
    background: var(--nice-green-soft);
}
.photo-editor[hidden] { display: none; }
.photo-editor-thumb { flex-shrink: 0; width: 120px; height: 120px; object-fit: cover; border-radius: 10px; background: #fff; border: 1px solid var(--nice-line); }
.photo-editor-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.photo-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.photo-editor-head b { font-size: 15px; color: var(--nice-strong); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-editor-move { display: inline-flex; gap: 6px; }
.photo-editor .form-group { margin: 0; }
.photo-editor-link { display: flex; align-items: center; gap: 12px; }
.photo-editor-link input:not([type]) { flex: 1; min-width: 0; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; flex-shrink: 0; font-weight: 600; color: var(--nice-sub); cursor: pointer; }
.check-inline input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--nice-green); }
.check-inline:has(input:disabled) { opacity: .5; cursor: default; }
.photo-editor .form-hint.ok { color: #1a7f4c; }
.photo-editor .form-hint.err { color: var(--nice-red-dark); }
.photo-editor-actions { display: flex; gap: 8px; justify-content: flex-end; }
.photo-editor-actions [data-pe-remove] { color: var(--nice-red-dark); }

/* 사이트 로고 (한 장) */
.logo-picker { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1.5px dashed var(--nice-input); border-radius: 12px; background: #fff; }
.logo-picker.filled { border-style: solid; border-color: var(--nice-green); }
.logo-picker.dragover { border-color: var(--nice-green); background: var(--nice-green-soft); }
.logo-box {
    flex-shrink: 0; width: 132px; height: 88px; padding: 6px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--nice-line); border-radius: 10px;
    /* 투명 배경이 보이게 바둑판 */
    background: #fff repeating-conic-gradient(#f1f3f5 0 25%, #fff 0 50%) 0 0 / 14px 14px;
    color: var(--nice-muted);
}
.logo-box:hover { background-color: #fff; border-color: var(--nice-green); color: #1a7f4c; }
.logo-preview { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.logo-empty .photo-circle { width: 34px; height: 34px; }
.logo-empty .photo-circle .icon { width: 18px; height: 18px; }
.logo-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.logo-info b { font-size: 14px; color: var(--nice-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-info small { font-size: 12px; color: var(--nice-muted); line-height: 1.5; }
.logo-actions { display: flex; gap: 6px; margin-top: 4px; }

/* ── 빈 상세: 사용 방법 안내 ── */
.empty-state { padding: 10px 4px; }
.empty-state h2 { font-size: 22px; margin: 0 0 6px; }
.empty-state > p { margin: 0 0 20px; color: var(--nice-muted); }

.guide-steps { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.guide-steps li { padding: 16px; border: 1px solid var(--nice-line); border-radius: 14px; background: #fff; }
.guide-steps b { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--nice-green-soft); color: #1a7f4c; margin-bottom: 10px; }
.guide-steps strong { display: block; margin-bottom: 4px; color: var(--nice-strong); }
.guide-steps span { color: var(--nice-muted); font-size: 13px; line-height: 1.5; }

/* ── 표 칸 보조 ── */
.cell-sub { margin-top: 3px; color: var(--nice-muted); font-size: 12px; font-weight: 400; }
.data-table .num-col { width: 1%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .nowrap { white-space: nowrap; }
.scroll-box { max-height: 420px; overflow-y: auto; }
.note { margin: 10px 0 0; font-size: 13px; line-height: 1.6; }
.empty-box.small-empty { padding: 18px; font-size: 14px; }

/* ── 사이트 통계 (site_stats.html) ── */
.crumb { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 6px; color: var(--nice-muted); font-size: 13px; font-weight: 700; text-decoration: none; }
.crumb:hover { color: #1f7a4a; }
.crumb .icon { width: 14px; height: 14px; }

.period-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.period-label { font-weight: 800; color: var(--nice-sub); font-size: 14px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--nice-input); border-radius: 999px; background: #fff; }
.seg a { padding: 6px 14px; border-radius: 999px; color: var(--nice-sub); font-size: 13px; font-weight: 800; text-decoration: none; }
.seg a:hover { background: var(--nice-green-soft); color: #1f7a4a; }
.seg a.active { background: var(--nice-green); color: #fff; }

.tile small { display: block; margin-top: 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chart-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-head .panel-title { margin-bottom: 8px; }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--nice-sub); }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.viz-legend b { color: var(--nice-strong); font-variant-numeric: tabular-nums; }
.legend-dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: currentColor; vertical-align: -1px; }

/* 막대 차트 (charts.py) — 가는 막대 · 1px 회색 눈금선 · 마우스를 올린 날짜 칸만 옅게 */
.viz { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz-axis { stroke: var(--viz-axis); }
/* 글자 크기는 SVG 가 늘고 줄어도 화면에서 늘 같게 — app.js 가 --viz-scale(그려진 폭 ÷ viewBox 폭)을 넣고 그만큼 나눈다 */
.viz-tick { fill: var(--nice-muted); font-size: calc(12px / var(--viz-scale, 1)); font-variant-numeric: tabular-nums; }
.viz-val { fill: var(--nice-strong); font-size: calc(13px / var(--viz-scale, 1)); font-weight: 800; paint-order: stroke; stroke: #fff; stroke-width: calc(3px / var(--viz-scale, 1)); stroke-linejoin: round; }   /* 흰 테두리: 막대 · 눈금선 위에서도 읽힌다 */
.viz-val.in { fill: #fff; stroke: none; }   /* 위에 자리가 없어 막대 안에 넣은 값 */
.viz-band { fill: transparent; }
.viz-col:hover .viz-band, .viz-col:focus-within .viz-band { fill: var(--nice-panel); }
.viz-hit { fill: transparent; cursor: default; }
.viz-hit:focus { outline: none; }
.viz-hit:focus-visible { stroke: var(--nice-sub); stroke-width: 1; }
.viz-s0 { fill: var(--viz-0); } .viz-s1 { fill: var(--viz-1); } .viz-s2 { fill: var(--viz-2); }
.viz-s3 { fill: var(--viz-3); } .viz-s4 { fill: var(--viz-4); }
.viz-k0 { color: var(--viz-0); } .viz-k1 { color: var(--viz-1); } .viz-k2 { color: var(--viz-2); }
.viz-k3 { color: var(--viz-3); } .viz-k4 { color: var(--viz-4); }

/* 말풍선 (app.js) — 값이 굵게 앞, 계열 이름은 뒤, 색은 짧은 선으로만 */
.viz-tip {
    position: fixed; z-index: 1200; min-width: 130px; padding: 9px 11px;
    border: 1px solid var(--nice-line); border-radius: 10px; background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12); font-size: 13px; pointer-events: none;
}
.viz-tip-title { margin-bottom: 5px; color: var(--nice-muted); font-size: 12px; font-weight: 700; }
.viz-tip-row { display: flex; align-items: center; gap: 7px; line-height: 1.7; color: var(--nice-sub); }
.viz-tip-row b { color: var(--nice-strong); font-variant-numeric: tabular-nums; }
.viz-key { width: 12px; height: 3px; border-radius: 2px; background: currentColor; }
.viz-key.viz-key-none { background: transparent; }

.table-view { margin: 8px 0 4px; }
.table-view summary { cursor: pointer; color: var(--nice-muted); font-size: 13px; font-weight: 700; }
.table-view .table-wrap { margin-top: 8px; max-height: 320px; overflow-y: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 24px; }

/* 유입 경로 가로 막대 — 계열 하나라 한 색, 끝만 4px 둥글게 */
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 40px; align-items: center; gap: 10px; font-size: 13px; color: var(--nice-sub); }
.hbar-track { height: 10px; }
.hbar-fill { height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; background: var(--viz-0); }
.hbar b { text-align: right; color: var(--nice-strong); font-variant-numeric: tabular-nums; }

/* ── 스크롤바 (전역): 얇은 회색, 올리면 초록 ── */
* { scrollbar-width: thin; scrollbar-color: #cfd6dd transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cfd6dd; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--nice-green); background-clip: padding-box; }

/* ── 반응형 ── */
@media (max-width: 1200px) {
    .work-list-layout { grid-template-columns: minmax(0, 1fr); }
    .work-list-card { position: static; max-height: 420px; min-height: 0; }
    .target-box.five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .layout { display: block; }
    .sidebar { width: auto; padding-bottom: 12px; }
    .content { padding: 18px 16px; }
    .title-row, .work-detail-head, .next-action { flex-direction: column; align-items: stretch; }
    .form-grid, .form-grid.two, .choice-grid.two, .choice-grid.three, .choice-grid.four { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .target-box, .target-box.five, .guide-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .modal-overlay { padding: 10px; }
    .modal-window { width: 100%; max-height: 96vh; }
    .wizard-window { height: 96vh; }
    .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .photo-editor { flex-direction: column; padding: 12px; }
    .photo-editor-thumb { width: 100%; height: 140px; }
    .photo-editor-link { flex-wrap: wrap; }
    .photo-editor-link input:not([type]) { flex-basis: 100%; }
    .logo-picker { flex-direction: column; align-items: stretch; }
    .input-with-btn { flex-wrap: wrap; }
    .input-with-btn input { flex-basis: 100%; }
    .logo-box { width: 100%; height: 96px; }
    .wizard-steps { padding: 10px 12px; }
    .wizard-step { flex: 0 0 auto; padding: 6px; }
    .wizard-step:not(.current) span { display: none; }   /* 좁은 화면: 번호만, 현재 단계만 이름 */
    .modal-footer { flex-wrap: wrap; padding: 12px 14px; }
    .stats-grid { grid-template-columns: minmax(0, 1fr); }
    .top-actions { flex-wrap: wrap; }
    .viz-wrap { overflow-x: auto; }
    .viz-wrap .viz { min-width: 540px; }   /* 좁은 화면: 글자가 너무 작아지지 않게 차트만 옆으로 밀기 */
    .hbar { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) 36px; }
}

/* ── 서치어드바이저: 자동입력 방지 글자 입력 · 사이트별 요청 안내 · 아이디 목록 ── */
.site-notes { margin-bottom: 14px; }
.site-notes-head { margin-bottom: 4px; font-size: 12px; font-weight: 800; color: var(--nice-muted); }
.site-notes .alert { margin-bottom: 8px; }
.captcha-text { margin-top: 4px; }
.captcha-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.captcha-img { height: 60px; border: 1px solid var(--nice-line); border-radius: 8px; background: #fff; }
.captcha-form input[name="value"] { width: 170px; font-size: 18px; letter-spacing: .12em; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.acct-error { max-width: 340px; font-size: 12px; }
.acct-event { margin-top: 6px; font-size: 12px; line-height: 1.5; color: var(--nice-sub); }
.acct-event b { color: var(--nice-strong); }
.code-sample { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--nice-panel); font-size: 13px; }

/* ══════════════════════════════════════════════════════════════
   화면 틀 2: 상단 바 · 알림 드로어 · 진행 줄 · 토스트 · 스테퍼 · ⋯ 메뉴 · 요약 카드 · 입력 모달
   (상태 알림을 색깔 박스 더미 대신 — 진행 중인 것만 화면에 한 줄, 끝난 것은 토스트 + 드로어)
   ══════════════════════════════════════════════════════════════ */

/* ── 상단 바 ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    padding: 0 28px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--nice-line);
}

.topbar-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--nice-muted); }
.topbar-crumbs a { color: var(--nice-sub); font-weight: 700; text-decoration: none; }
.topbar-crumbs a:hover { color: #1f7a4a; }
.topbar-crumbs .sep { color: var(--nice-input); }
.topbar-crumbs .here { color: var(--nice-strong); font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.sidebar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--nice-line);
    border-radius: 12px;
    background: #fff;
    color: var(--nice-sub);
}

.worker-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--nice-green-line);
    background: var(--nice-green-soft);
    color: #1f7a4a;
    font-size: 12px;
    font-weight: 800;
    cursor: default;
}

.worker-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--nice-green); box-shadow: 0 0 0 3px rgba(46, 184, 114, .2); }
.worker-chip.off { border-color: var(--nice-red-line); background: var(--nice-red-soft); color: #9b2c2c; }
.worker-chip.off i { background: var(--nice-red); box-shadow: none; }
.worker-chip small { font-weight: 600; color: inherit; opacity: .75; }

.bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--nice-line);
    border-radius: 12px;
    background: #fff;
    color: var(--nice-sub);
}

.bell:hover, .bell[aria-expanded="true"] { background: var(--nice-green-soft); border-color: var(--nice-green-line); color: #1f7a4a; }
.bell .icon { width: 18px; height: 18px; margin: 0; }

.bell-count {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--nice-green);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.bell-count.wait { background: #e0a526; }

.worker-band {
    padding: 8px 28px;
    border-bottom: 1px solid var(--nice-red-line);
    background: var(--nice-red-soft);
    color: #9b2c2c;
    font-size: 13px;
    font-weight: 700;
}

/* ── 알림 드로어 ── */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, .25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 901;
    display: flex;
    flex-direction: column;
    width: 440px;
    max-width: 100%;
    background: #fff;
    box-shadow: -8px 0 30px rgba(15, 23, 42, .12);
    transform: translateX(100%);
    transition: transform .22s ease;
}

.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--nice-line); }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head .modal-close { width: 34px; height: 34px; }
.drawer-body { flex: 1; overflow: auto; padding: 6px 0 20px; }
.drawer-section { padding: 14px 18px 4px; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--nice-muted); text-transform: uppercase; }
.drawer-empty { padding: 48px 18px; text-align: center; color: var(--nice-muted); }

.req-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 3px 10px;
    align-items: start;
    padding: 10px 18px;
    border-bottom: 1px solid #f0f2f4;
}

.req-item:last-child { border-bottom: 0; }
.req-icon { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 10px; background: var(--nice-panel); color: var(--nice-sub); }
.req-icon .icon { margin: 0; }
.req-icon.running { background: var(--nice-green-soft); color: #1f7a4a; }
.req-icon.wait { background: var(--nice-yellow-soft); color: var(--nice-yellow); }
.req-icon.error { background: var(--nice-red-soft); color: var(--nice-red-dark); }
.req-icon.done { background: #e6f7ee; color: #1e7f4f; }
.req-title { font-size: 13px; font-weight: 700; color: var(--nice-strong); }
.req-title a { color: inherit; text-decoration: none; }
.req-title a:hover { text-decoration: underline; }
.req-sub { font-size: 12px; color: var(--nice-muted); }
.req-result { grid-column: 2 / -1; font-size: 12px; color: var(--nice-sub); white-space: pre-wrap; word-break: break-word; }
.req-result.error { color: #9b2c2c; }
.req-result details summary { cursor: pointer; color: var(--nice-muted); }
.req-time { font-size: 11px; color: var(--nice-muted); white-space: nowrap; text-align: right; }
.req-time .status-badge { display: inline-flex; margin-bottom: 4px; }
.req-item .small { grid-column: 2 / -1; justify-self: start; margin-top: 4px; }

/* ── 진행 줄 (화면 안: 진행 중인 요청만 한 줄씩) ── */
.activity { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.activity-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--nice-green-line);
    border-radius: 10px;
    background: var(--nice-green-soft);
    color: #1f6b42;
    font-size: 13px;
}

.activity-row.wait { border-color: var(--nice-yellow-line); background: var(--nice-yellow-soft); color: #7a5200; }
.activity-row.ready { border-color: var(--nice-line); background: var(--nice-panel); color: var(--nice-sub); }
.activity-row b { font-weight: 800; }
.activity-row .act-target { font-weight: 700; }
.activity-row .act-time { margin-left: auto; font-size: 12px; opacity: .8; white-space: nowrap; }
.activity-row .small { height: 28px; padding: 0 12px; }
.spinner { flex-shrink: 0; width: 14px; height: 14px; border: 2px solid rgba(46, 184, 114, .3); border-top-color: var(--nice-green); border-radius: 50%; animation: spin .8s linear infinite; }
.dot { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .6; }
.activity-row.wait .dot { animation: blink 1.2s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .15; } }

/* ── 토스트 (오른쪽 아래) ── */
.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 40px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--nice-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14);
    font-size: 13px;
    animation: toast-in .2s ease;
}

.toast::before { content: ""; flex-shrink: 0; align-self: stretch; width: 4px; border-radius: 2px; background: var(--nice-green); }
.toast.error::before { background: var(--nice-red); }
.toast.warn::before { background: #e0a526; }
.toast.info::before { background: #8a97a6; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 800; color: var(--nice-strong); }
.toast-text { margin-top: 2px; color: var(--nice-sub); word-break: break-word; }
.toast-close { padding: 0 2px; border: 0; background: none; color: var(--nice-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.toast-close:hover { color: var(--nice-strong); background: none; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ── 스테퍼 (작업 상세 4단계 · 마법사와 같은 원 + 이름) ── */
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.stepper li { display: flex; }   /* 단계 칸 높이를 맞춘다 */

.stepper button {
    display: flex;
    flex: 1;
    gap: 12px;
    align-items: center;          /* 원과 글을 세로 가운데에 */
    justify-content: flex-start;  /* 기본 버튼의 가운데 정렬을 끈다 */
    width: 100%;
    min-height: 84px;
    padding: 14px 16px;
    border: 1px solid var(--nice-line);
    border-radius: 14px;
    background: #fff;
    color: var(--nice-text);
    text-align: left;
    font-weight: 400;
    line-height: 1.45;
    white-space: normal;
}

.stepper button:hover { background: var(--nice-panel); color: var(--nice-text); }
.step-no { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; border: 2px solid transparent; border-radius: 50%; background: var(--nice-panel); color: var(--nice-muted); font-size: 13px; font-weight: 800; }
.stepper .done .step-no { background: #1e7f4f; color: #fff; }
.stepper .running .step-no { background: var(--nice-green-soft); border-color: var(--nice-green); color: #1f7a4a; }
.stepper .stopped .step-no { background: var(--nice-red-soft); border-color: var(--nice-red); color: var(--nice-red-dark); }
.stepper .cooldown .step-no { background: var(--nice-yellow-soft); border-color: #e0a526; color: var(--nice-yellow); }
.stepper .skip button { border-style: dashed; }
.stepper .skip .step-no { background: transparent; border-color: var(--nice-input); }
.stepper .current button { border-color: var(--nice-green); box-shadow: 0 0 0 3px rgba(46, 184, 114, .15); }
.stepper .current.stopped button { border-color: var(--nice-red); box-shadow: 0 0 0 3px rgba(224, 72, 72, .14); }
.stepper .current.cooldown button { border-color: #e0a526; box-shadow: 0 0 0 3px rgba(224, 165, 38, .16); }
.step-text { min-width: 0; }
.step-text b { display: block; font-size: 13px; color: var(--nice-strong); }
.step-text small { display: block; overflow: hidden; color: var(--nice-muted); text-overflow: ellipsis; white-space: nowrap; }
.step-text .next { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: #1f7a4a; white-space: normal; }
.stepper .stopped .next { color: var(--nice-red-dark); }
.stepper .cooldown .next { color: var(--nice-yellow); }

/* ── ⋯ 더보기 메뉴 ── */
.menu { position: relative; display: inline-block; }

.menu-btn {
    width: 34px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--nice-input);
    border-radius: 10px;
    background: #fff;
    color: var(--nice-sub);
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .05em;
    line-height: 1;
}

.menu-btn:hover, .menu.open .menu-btn { background: var(--nice-green-soft); border-color: var(--nice-green-line); color: #1f7a4a; }

.menu-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 300;
    display: none;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--nice-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
}

.menu.open .menu-list { display: block; }
.menu.up .menu-list { top: auto; bottom: calc(100% + 6px); }
.menu-list form { display: contents; }

.menu-list a, .menu-list button {
    display: flex;
    align-items: center;
    justify-content: flex-start;   /* 기본 버튼은 가운데 정렬이라 폼 버튼 항목만 가운데로 몰렸다 */
    gap: 8px;
    width: 100%;
    height: auto;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--nice-text);
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}

.menu-list a:hover, .menu-list button:hover { background: var(--nice-panel); color: var(--nice-strong); }
.menu-list .danger { color: var(--nice-red-dark); }
.menu-list .danger:hover { background: var(--nice-red-soft); color: var(--nice-red-dark); }
.menu-list button[disabled] { opacity: .45; cursor: default; }
.menu-list hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--nice-line); }
.menu-list .icon { margin: 0; color: var(--nice-muted); }
.menu-list .danger .icon { color: inherit; }
td .menu { vertical-align: middle; }

/* ── 요약 카드 (발행 결과 · 사이트 정보 …) ── */
.summary-card { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--nice-line); border-radius: 14px; background: #fff; }
.summary-card.success { border-color: var(--nice-green-line); background: #f4fbf7; }
.summary-card.error { border-color: var(--nice-red-line); background: #fff7f7; }
.summary-card.warn { border-color: var(--nice-yellow-line); background: #fffbf0; }
.summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.summary-head h3 { margin: 0; font-size: 15px; }
.summary-head .status-badge { margin-left: 6px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.summary-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-grid > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.summary-grid > div > span { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--nice-muted); }
.summary-grid > div > b, .summary-grid .val { font-weight: 600; color: var(--nice-strong); word-break: break-word; }
.summary-card details { margin-top: 12px; }
.summary-card details summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--nice-sub); }
.summary-card details ul { margin: 8px 0 0; padding-left: 18px; }
.summary-foot { margin: 10px 0 0; font-size: 12px; color: var(--nice-muted); }
.idx-list { display: flex; flex-direction: column; gap: 6px; }
.idx-list > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 400; font-size: 13px; }

/* 폼 안 구역 (발행: 대상 → 방식 → 실행) */
.form-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 12px; margin-bottom: 18px; }
.form-step > .step-no { grid-row: 1 / 3; width: 26px; height: 26px; font-size: 12px; }
.form-step > h4 { margin: 3px 0 0; font-size: 14px; }
.form-step > .form-step-body { grid-column: 2; }
.form-step label:first-child { margin-top: 0; }
/* 발행이 돌아가는 동안: 번호 자리에 회전 표시, 칸은 잠근 느낌 */
.form-step.working > .step-no { background: var(--nice-green-soft); border-color: var(--nice-green); }
.form-step.working .spinner { width: 12px; height: 12px; }
.form-step.working .choice-card { opacity: .55; pointer-events: none; }
/* 서치어드바이저 등록 현황 단계: 상태에 따라 번호 원 색 */
.form-step > .step-no.done { background: #1e7f4f; color: #fff; }
.form-step > .step-no.running { background: var(--nice-green-soft); border-color: var(--nice-green); color: #1f7a4a; }
.form-step > .step-no.wait { background: var(--nice-yellow-soft); border-color: #e0a526; color: var(--nice-yellow); }
.form-step > .step-no.stopped { background: var(--nice-red-soft); border-color: var(--nice-red); color: var(--nice-red-dark); }
.sa-step { padding-top: 14px; border-top: 1px dashed var(--nice-line); }
.sa-step .action-row { flex-wrap: wrap; gap: 10px; }
.sa-step .form-hint.err { margin-top: 6px; }

/* ── 입력 모달 (자동입력 방지 글자) ── */
.input-window { width: 460px; max-width: 100%; }
.input-lead { margin: 0 0 6px; font-size: 14px; }
.captcha-stage { display: flex; justify-content: center; padding: 14px; margin: 10px 0; border: 1px solid var(--nice-line); border-radius: 12px; background: var(--nice-panel); }
.captcha-stage .captcha-img { height: 90px; }
.captcha-input { width: 100%; font-size: 22px; letter-spacing: .18em; text-align: center; }

/* 탭 줄 오른쪽 자리 (통계 기간 · 안내) */
.tabs .tabs-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* 작업 상세 머리: 주요 동작 1개 + ⋯ */
.work-detail-actions .menu { margin-left: 2px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }

/* 표 안 작은 진행 표시 */
.cell-live { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #1f7a4a; }

/* ── 통계 대시보드: 요약 칩 · 아이콘 KPI 카드 · 2열 차트 카드 · 도넛 + 범례 표 · 가로 막대 ── */
:root { --viz-5: #e0a526; --viz-6: #e04848; --viz-7: #00a3a3; --viz-8: #8a97a6; }
.viz-s5 { fill: var(--viz-5); } .viz-s6 { fill: var(--viz-6); } .viz-s7 { fill: var(--viz-7); } .viz-s8 { fill: var(--viz-8); }
.viz-k5 { color: var(--viz-5); } .viz-k6 { color: var(--viz-6); } .viz-k7 { color: var(--viz-7); } .viz-k8 { color: var(--viz-8); }
.viz-donut circle { fill: none; }   /* .viz-sN 의 fill 이 고리를 꽉 채우지 않게 — 도넛은 선(stroke)으로만 그린다 */
.viz-donut circle.viz-s0 { stroke: var(--viz-0); } .viz-donut circle.viz-s1 { stroke: var(--viz-1); } .viz-donut circle.viz-s2 { stroke: var(--viz-2); }
.viz-donut circle.viz-s3 { stroke: var(--viz-3); } .viz-donut circle.viz-s4 { stroke: var(--viz-4); } .viz-donut circle.viz-s5 { stroke: var(--viz-5); }
.viz-donut circle.viz-s6 { stroke: var(--viz-6); } .viz-donut circle.viz-s7 { stroke: var(--viz-7); } .viz-donut circle.viz-s8 { stroke: var(--viz-8); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--nice-line); border-radius: 999px; background: #fff; font-size: 13px; color: var(--nice-muted); }
.chip b { color: var(--nice-strong); font-weight: 700; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--nice-line); border-radius: 14px; background: #fff; min-width: 0; }
.kpi-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; background: var(--nice-panel); color: var(--nice-sub); }
.kpi-icon .icon { width: 20px; height: 20px; margin: 0; }
.kpi-icon.green { background: var(--nice-green-soft); color: #1f7a4a; }
.kpi-icon.blue { background: #eef4ff; color: #2f5bb7; }
.kpi-icon.orange { background: #fff1e8; color: #c2531b; }
.kpi-body { min-width: 0; }
.kpi-body span { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--nice-muted); }
.kpi-body strong { display: block; font-size: 24px; line-height: 1.15; color: var(--nice-strong); font-variant-numeric: tabular-nums; }
.kpi-body small { display: block; margin-top: 4px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(380px, calc(50% - 8px)), 1fr)); gap: 16px; margin-bottom: 16px; }   /* 넓은 화면에서도 최대 2열 — 차트가 작아지지 않게 */
.dash-grid.wide { grid-template-columns: minmax(0, 1fr); }
.dash-card { padding: 18px 20px; border: 1px solid var(--nice-line); border-radius: 16px; background: #fff; min-width: 0; }
.dash-card.span-2 { grid-column: 1 / -1; }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-head h3 { margin: 0; font-size: 15px; }
.dash-head h3 small { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--nice-muted); }
.dash-card .panel-title { font-size: 14px; }
.dash-card .note { font-size: 12px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.viz-donut { flex-shrink: 0; width: 180px; height: 180px; }
.viz-donut-label { fill: var(--nice-muted); font-size: calc(12px / var(--viz-scale, 1)); font-weight: 700; }
.viz-donut-total { fill: var(--nice-strong); font-size: calc(26px / var(--viz-scale, 1)); font-weight: 900; }
.legend-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.legend-table td { padding: 5px 6px; border-bottom: 1px solid #f0f2f4; color: var(--nice-sub); }
.legend-table tr:last-child td { border-bottom: 0; }
.legend-table td:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.legend-table b { color: var(--nice-strong); font-variant-numeric: tabular-nums; }
.legend-table .num-col { text-align: right; white-space: nowrap; }

.hbar2-list { display: grid; gap: 14px; background: repeating-linear-gradient(to right, transparent 0 calc(10% - 1px), var(--viz-grid) calc(10% - 1px) 10%); background-position: 170px 0; background-size: calc(100% - 170px) 100%; background-repeat: no-repeat; padding-right: 60px; }
.hbar2 { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; align-items: center; }
.hbar2-name { font-size: 13px; font-weight: 700; color: var(--nice-strong); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar2-bars { display: grid; gap: 4px; }
.hbar2-row { display: flex; align-items: center; gap: 8px; }
.hbar2-fill { height: 12px; min-width: 3px; border-radius: 999px; background: currentColor; flex-shrink: 0; transition: width .3s; }
.hbar2-val { font-size: 12px; color: var(--nice-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-path { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* 긴 주소는 한 줄로 줄이고 title 로 전체 */

/* ── 작업목록 표 · 작업 상세 머리 ── */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td { background: #f8fcf9; }
.job-name { display: block; font-weight: 800; color: var(--nice-strong); text-decoration: none; }
.job-name:hover { color: #1f7a4a; }
.mini-steps { display: inline-flex; gap: 4px; align-items: center; }
.mini-steps i { display: block; width: 22px; height: 6px; border-radius: 999px; background: var(--nice-line); }
.mini-steps i.done { background: #1e7f4f; }
.mini-steps i.running { background: var(--nice-green); animation: blink 1.2s ease-in-out infinite; }
.mini-steps i.stopped { background: var(--nice-red); }
.mini-steps i.cooldown { background: #e0a526; }
.mini-steps i.skip { background: transparent; border: 1px dashed var(--nice-input); height: 4px; }
.next-text { margin-top: 4px; font-size: 12px; color: var(--nice-sub); max-width: 280px; }
.next-text.warn, .next-text.error { color: var(--nice-red-dark); font-weight: 700; }
.next-text.warn { color: var(--nice-yellow); }

.detail-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.detail-hero h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; font-size: 24px; }
.detail-hero .chip-row { margin-bottom: 0; }
.detail-hero .chip { height: 30px; padding: 0 12px; font-size: 12px; }
.detail-hero .chip a { color: inherit; font-weight: 700; }
.hero-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.posts-table td .cell-sub { margin-top: 2px; }

/* ── 반응형 2 ── */
@media (max-width: 1200px) {
    .drawer { width: 400px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .layout { display: flex; }
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 800;
        width: 240px;
        padding-bottom: 24px;
        overflow: auto;
        transform: translateX(-100%);
        transition: transform .2s ease;
        box-shadow: 8px 0 30px rgba(15, 23, 42, .12);
    }
    .sidebar.open { transform: none; }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .topbar { padding: 0 16px; }
    .worker-band { padding: 8px 16px; }
    .page { padding: 18px 16px 40px; }
    .worker-chip small { display: none; }
    .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-grid, .summary-grid.three { grid-template-columns: minmax(0, 1fr); }
    .drawer { width: 100%; }
    .toasts { right: 10px; bottom: 10px; }
    .activity-row { flex-wrap: wrap; }
    .activity-row .act-time { margin-left: 0; flex-basis: 100%; }
}
