/* ──────────────────────────────────────────────
   네이버 블로그 자동화 — 나눔스퀘어 네오 OTF 기반
   ────────────────────────────────────────────── */

:root {
    --color-primary: #03c75a;       /* 네이버 그린 */
    --color-primary-dark: #02b050;
    --color-primary-soft: #f0f7ee;
    --color-text: #222;
    --color-text-light: #666;
    --color-text-lighter: #999;
    --color-border: #e5e7eb;
    --color-bg: #f5f6f8;
    --color-card: #ffffff;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    --color-warning: #f39c12;

    --font-base: "NanumSquareNeo", "NanumSquareNeoOTF",
                 -apple-system, BlinkMacSystemFont,
                 "맑은 고딕", "Malgun Gothic", sans-serif;
    --font-mono: ui-monospace, "SF Mono", Monaco, Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-card: 0 2px 6px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-base);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    padding: 24px 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.container { max-width: 920px; margin: 0 auto; }

/* ─── Header ─── */
header {
    background: var(--color-card);
    padding: 24px 28px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.config-info { font-size: 13px; color: var(--color-text-light); }

.config-info .chip {
    display: inline-block;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    padding: 3px 10px;
    border-radius: 12px;
    margin-right: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* ─── Tab Navigation ─── */
.tab-nav {
    display: flex;
    gap: 4px;
    background: var(--color-card);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}
.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-light);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    letter-spacing: -0.01em;
}
.tab-btn:hover { background: var(--color-bg); color: var(--color-text); }
.tab-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── 참고 모드 — 글 목록 카드 ─── */
.ref-post-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ref-post-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.ref-post-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(3,199,90,0.08);
}
.ref-post-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
}
.ref-post-card .rpc-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text);
    margin-bottom: 4px;
}
.ref-post-card .rpc-meta {
    color: var(--color-text-lighter);
    font-size: 12px;
    margin-bottom: 8px;
}
.ref-post-card .rpc-thumbs {
    display: flex;
    gap: 4px;
}
.ref-post-card .rpc-thumbs img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

/* ─── 참고 모드 — 카테고리 리스트 ─── */
.ref-cat-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.ref-cat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    background: #fff;
    transition: background 0.12s;
}
.ref-cat-row:last-child { border-bottom: none; }
.ref-cat-row:hover { background: #f8fbf9; }
.ref-cat-row.selected { background: var(--color-primary-soft); border-left: 3px solid var(--color-primary); padding-left: 11px; }
.ref-cat-row.is-child { padding-left: 36px; color: var(--color-text-lighter); }
.ref-cat-row.is-child.selected { padding-left: 33px; }
.ref-cat-row.empty { opacity: 0.4; cursor: default; }
.ref-cat-row.empty:hover { background: #fff; }
.ref-cat-name { flex: 1; font-size: 14px; font-weight: 600; }
.ref-cat-row.is-child .ref-cat-name { font-weight: 500; }
.ref-cat-stat { font-size: 12px; color: var(--color-text-lighter); display: flex; gap: 10px; align-items: center; }
.ref-cat-stat .chip-crawled { background: #e6f6ec; color: #03c75a; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.ref-cat-stat .chip-remaining { background: #fff4d9; color: #b58105; padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.ref-cat-stat .chip-total { color: #666; font-weight: 700; }

.ref-cat-post-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.12s;
}
.ref-cat-post-row:last-child { border-bottom: none; }
.ref-cat-post-row:hover { background: #f8fbf9; }
.ref-cat-post-row.checked { background: #eaf7ef; }
.ref-cat-post-row.disabled { cursor: default; opacity: 0.65; }
.ref-cat-post-row.disabled:hover { background: #fff; }
.ref-cat-post-row .ccp-check { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: #03c75a; }
.ref-cat-post-row .ccp-title { flex: 1; line-height: 1.4; }
.ref-cat-post-row .ccp-date { color: var(--color-text-lighter); font-size: 11px; flex-shrink: 0; }
.ref-cat-post-row .ccp-flag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; flex-shrink: 0; }
.ref-cat-post-row .ccp-flag.done { background: #e6f6ec; color: #03c75a; }
.ref-cat-post-row .ccp-flag.new { background: #fff4d9; color: #b58105; }

.ref-cat-posts-toolbar {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #fff; padding: 10px 12px; border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}
.ref-cat-posts-toolbar .sel-info { color: #444; font-weight: 600; margin-right: auto; }
.ref-cat-posts-toolbar button { padding: 4px 10px; font-size: 12px; }

/* ─── 참고 모드 — 글 상세 ─── */
.ref-detail {
    background: #fafafa;
    padding: 16px;
    border-radius: var(--radius-md);
}
.ref-detail h4 {
    font-size: 15px;
    margin-bottom: 8px;
}
.ref-detail .meta {
    color: var(--color-text-lighter);
    font-size: 12px;
    margin-bottom: 12px;
}
.ref-detail .body {
    max-height: 400px;
    overflow-y: auto;
    background: #fff;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    transition: max-height 0.2s;
}
.ref-detail .body button {
    margin-top: 8px;
}

/* 블록 기반 렌더링 — 브라우저 글 그대로 */
.rd-rendered {
    background: #fff;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    max-height: 600px;
    overflow-y: auto;
    line-height: 1.75;
    color: var(--color-text);
}
.rd-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: #c2185b;          /* 핀크빛 — 원본 글의 📌 톤과 비슷 */
    border-left: 4px solid #c2185b;
    padding-left: 12px;
    margin: 22px 0 12px 0;
    line-height: 1.5;
}
.rd-subtitle:first-child { margin-top: 0; }
.rd-para {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
    word-break: break-word;
}
.rd-image {
    margin: 16px 0;
    text-align: center;
}
.rd-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}
.rd-image.common img {
    opacity: 0.35;
    max-width: 60%;
}
.rd-image.common::before {
    content: "🔁 시그니처 이미지 (모든 글 공통)";
    display: block;
    font-size: 11px;
    color: var(--color-text-lighter);
    margin-bottom: 4px;
}
.rd-img-caption {
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-text-light);
    font-style: italic;
}
.rd-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 13px;
    background: #fff;
}
.rd-table th, .rd-table td {
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    text-align: left;
    line-height: 1.5;
    vertical-align: top;
}
.rd-table th {
    background: #fff8d8;
    font-weight: 700;
    color: var(--color-text);
    border-bottom: 2px solid #f0d860;
}
.rd-table tbody tr:nth-child(even) {
    background: #fafafa;
}
.rd-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 18px 0;
}
.rd-fallback {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text);
    background: #fff;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    max-height: 500px;
    overflow-y: auto;
}
.ref-detail .images {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.ref-detail .images img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

/* ─── 이미지 프롬프트 가이드 카드 ─── */
.imgprompt-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #fff;
}
.imgprompt-card .ipc-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.imgprompt-card .ipc-slot {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 14px;
}
.imgprompt-card .ipc-pos {
    color: var(--color-text-lighter);
    font-size: 12px;
}
.imgprompt-card .ipc-desc {
    color: var(--color-text);
    font-size: 13px;
    margin-bottom: 12px;
    background: #fafafa;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}
.imgprompt-card .ipc-refs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.imgprompt-card .ipc-refs img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--color-primary);
}
.imgprompt-card .ipc-prompt-block {
    margin-top: 12px;
}
.imgprompt-card .ipc-prompt-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-light);
    margin-bottom: 4px;
}
.imgprompt-card .ipc-prompt-text {
    background: #1e1e1e;
    color: #e0e0e0;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 160px;
    overflow-y: auto;
}
.imgprompt-card .ipc-copy-btn {
    margin-top: 6px;
    font-size: 11px;
}

/* ─── Status bar ─── */
.status-bar {
    display: flex;
    align-items: center;
    background: var(--color-card);
    padding: 14px 22px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-text-lighter);
    margin-right: 12px;
    flex-shrink: 0;
}
.status-dot.idle { background: var(--color-text-lighter); }
.status-dot.running { background: var(--color-warning); animation: pulse 1.2s infinite; }
.status-dot.done { background: var(--color-primary); }
.status-dot.error { background: var(--color-danger); }
.status-dot.awaiting { background: var(--color-info); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.status-text { font-weight: 700; color: var(--color-text); }
.status-task { margin-left: 12px; color: var(--color-text-lighter); font-size: 13px; }

/* ─── Step section ─── */
.step {
    background: var(--color-card);
    padding: 26px 30px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.2s;
    border: 2px solid transparent;
}
.step:hover { box-shadow: var(--shadow-hover); }

/* 현재 활성 단계 — 부드러운 강조 */
.step.step-active {
    border-color: var(--color-primary);
    box-shadow: 0 6px 24px rgba(3,199,90,0.18);
}

/* 새로 활성화될 때 펄스 효과 (3초간) */
@keyframes step-pulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(3,199,90,0.18); }
    50% { box-shadow: 0 8px 32px rgba(3,199,90,0.35); }
}
.step.step-pulse {
    animation: step-pulse 0.9s ease-in-out 3;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 800;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
}

.step h2 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.step-desc {
    color: var(--color-text-light);
    font-size: 14px;
    margin-bottom: 14px;
}

.hint {
    color: var(--color-text-lighter);
    font-size: 12px;
    margin-top: 8px;
}

/* ─── Collapse (details) ─── */
.collapse {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 12px;
    background: #fafafa;
}
.collapse[open] { background: #fff; }

.collapse summary {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    user-select: none;
    list-style: none;
    padding: 2px 0;
}
.collapse summary::-webkit-details-marker { display: none; }
.collapse summary::before {
    content: "▸";
    margin-right: 8px;
    color: var(--color-primary);
    transition: transform 0.15s;
    display: inline-block;
}
.collapse[open] summary::before { transform: rotate(90deg); }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-top: 14px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-light);
    letter-spacing: 0;
}

.form-grid label.full-row { grid-column: 1 / -1; }

.form-grid label.checkbox-row {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--color-text);
}

.form-grid input[type="text"],
.form-grid select,
.collapse textarea {
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-text);
    margin-top: 6px;
    transition: border-color 0.15s;
    letter-spacing: -0.01em;
}
.form-grid input[type="text"]:focus,
.form-grid select:focus,
.collapse textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(3,199,90,0.1);
}

.collapse textarea {
    width: 100%;
    line-height: 1.6;
    resize: vertical;
}

.form-grid input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* ─── Buttons ─── */
.btn-primary, .btn-secondary, .btn-small, .btn-link, .btn-danger {
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.15s;
    border: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    padding: 12px 26px;
    border-radius: var(--radius-md);
    font-size: 15px;
}
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn-primary:disabled { background: #ddd; color: #999; cursor: not-allowed; }

.btn-secondary {
    background: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
}
.btn-secondary:hover { background: var(--color-primary-soft); }

.btn-small {
    background: #f0f0f2;
    color: var(--color-text-light);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}
.btn-small:hover { background: #e5e5e8; }

.btn-link {
    background: transparent;
    color: var(--color-text-lighter);
    text-decoration: underline;
    padding: 6px 0;
    font-size: 13px;
    margin-left: 10px;
    font-weight: 500;
}
.btn-link:hover { color: var(--color-text-light); }

/* ─── 참고 모드 — 썸네일 설정 박스 ─── */
.thumb-settings-box {
    margin-top: 18px;
    padding: 16px 18px;
    background: #fdf2f8;
    border: 1px dashed #ec4899;
    border-radius: var(--radius-md);
}
.thumb-settings-head {
    font-weight: 700;
    font-size: 14px;
    color: #7d2962;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.thumb-settings-hint {
    font-weight: 500;
    color: #ad487f;
    font-size: 12px;
}

.btn-danger {
    background: #fff;
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.btn-danger:hover { background: #fdf0ee; }

/* ─── Text inputs ─── */
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.15s;
    letter-spacing: -0.01em;
}
textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(3,199,90,0.1);
}

input[type="text"] {
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    flex: 1;
    transition: border-color 0.15s;
}
input[type="text"]:focus {
    outline: none;
    border-color: var(--color-info);
}

/* ─── Extract result ─── */
.extract-result {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.extract-result h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--color-text-light);
    font-weight: 700;
}

.extract-stats {
    background: var(--color-primary-soft);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--color-primary);
    font-weight: 700;
}

.section-list { display: flex; flex-direction: column; gap: 10px; }

.section-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

.section-card .sc-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}
.section-card .sc-title { font-weight: 700; color: var(--color-text); }
.section-card .sc-meta { color: var(--color-text-lighter); font-weight: 500; }

.section-card .sc-memo {
    color: var(--color-text-light);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 100px;
    overflow-y: auto;
    background: #fafafa;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.section-card .sc-images { display: flex; gap: 6px; flex-wrap: wrap; }

.section-card .sc-images img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

/* ─── Preview ─── */
.preview-result {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--color-primary-soft);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
}
.preview-result h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--color-primary);
    font-weight: 700;
}

/* ─── Log section ─── */
.log-section {
    background: var(--color-card);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}
.log-header h3 {
    font-size: 15px;
    color: var(--color-text-light);
    font-weight: 700;
}
.log-actions { display: flex; gap: 8px; }

.input-prompt {
    background: #e8f4fd;
    border-left: 4px solid var(--color-info);
    padding: 14px 22px;
}

.manual-input {
    background: #fafafa;
    border-top: 1px solid var(--color-border);
    padding: 10px 22px;
}
.manual-input details summary {
    cursor: pointer;
    user-select: none;
    list-style: none;
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 600;
    padding: 4px 0;
}
.manual-input details summary::-webkit-details-marker { display: none; }
.manual-input details summary::before {
    content: "▸";
    margin-right: 6px;
    color: var(--color-text-lighter);
}
.manual-input details[open] summary::before { content: "▾"; }
.manual-input .prompt-actions { margin-top: 8px; }
.manual-input code {
    background: #fff;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 12px;
}
.prompt-text {
    font-size: 14px;
    color: #2c5b8a;
    margin-bottom: 10px;
    font-weight: 500;
}
.prompt-text .prompt-icon { margin-right: 6px; font-size: 16px; }
.prompt-text strong { font-weight: 700; }
.prompt-actions { display: flex; gap: 8px; align-items: center; }

.log-output {
    background: #1e1e1e;
    color: #e0e0e0;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    padding: 14px 18px;
}

.log-line {
    margin: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.log-line .ts { color: #888; margin-right: 8px; }
.log-line.error { color: #ff8a8a; }
.log-line.success { color: #8fd97f; }
.log-line.command { color: #ffcc66; font-weight: 600; }
.log-line.user-input { color: #66c2ff; font-weight: 600; }

.log-output:empty::after {
    content: "로그가 여기에 표시됩니다...";
    color: #555;
    font-style: italic;
}

/* ─── Footer ─── */
footer {
    text-align: center;
    color: var(--color-text-lighter);
    font-size: 12px;
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    max-width: 920px;
    margin: 0 auto;
}
footer a {
    color: var(--color-text-lighter);
    text-decoration: none;
}
footer a:hover { color: var(--color-text-light); }

/* ─── Mobile ─── */
@media (max-width: 640px) {
    body { padding: 12px 10px; }
    header { padding: 18px 20px; }
    .step { padding: 20px 18px; }
    .form-grid { grid-template-columns: 1fr; }
    footer { flex-direction: column; gap: 6px; }
    .prompt-actions { flex-direction: column; align-items: stretch; }
}

/* ─── Model picker + cost preview ─── */
.cost-preview { margin-top: 14px; }
.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 10px;
}
.cost-table th, .cost-table td {
    padding: 6px 8px;
    text-align: right;
    border-bottom: 1px solid #eee;
}
.cost-table th:first-child, .cost-table td:first-child { text-align: left; }
.cost-table tr.recommended {
    background: #e8f5e9;
    font-weight: 600;
}
.cost-table tr.recommended td:first-child::before {
    content: "★ ";
    color: #03C75A;
}

/* ─── Color picker ─── */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.color-swatch {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}
.color-swatch input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.color-swatch .swatch {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    border: 3px solid transparent;
    transition: border-color 0.15s;
    user-select: none;
}
.color-swatch .swatch-default {
    background: #fff;
    color: #333;
    border-color: #ddd;
}
.color-swatch input[type="radio"]:checked + .swatch {
    border-color: #222;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}
.color-swatch.color-custom input[type="color"] {
    width: 44px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}
.color-swatch.color-custom input[type="radio"]:checked ~ input[type="color"] {
    border-color: #222;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* ─── 일반탭 — 사진 목록 ─── */
.gen-image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.gen-image-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    padding: 6px;
    position: relative;
    transition: border-color .15s;
}
.gen-image-card:hover { border-color: #03C75A; }
.gen-image-card .img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 6px;
    background: #f3f4f6;
}
.gen-image-card .img-wrap img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.gen-image-card .img-id {
    position: absolute; top: 10px; left: 10px;
    background: rgba(0,0,0,.65); color: #fff;
    width: 22px; height: 22px; border-radius: 50%;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.gen-image-card .img-source {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,.92); color: #444;
    padding: 2px 6px; border-radius: 4px;
    font-size: 10px; font-weight: 600;
}
.gen-image-card .img-source.extract { color: #03C75A; }
.gen-image-card .img-source.upload  { color: #2D6CDF; }
.gen-image-card input.caption-input {
    width: 100%; box-sizing: border-box;
    padding: 4px 6px; font-size: 12px;
    border: 1px solid #ddd; border-radius: 4px;
}
.gen-image-card .img-del {
    width: 100%; margin-top: 4px;
    background: transparent; border: 1px solid #fcd5d5; color: #b8404a;
    padding: 3px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
.gen-image-card .img-del:hover { background: #fef2f2; }

/* GIF 표시 배지 */
.gen-image-card .img-gif-badge {
    position: absolute;
    bottom: 60px;
    left: 10px;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    pointer-events: none;
}

/* ─── 자동 분석 박스 (Claude 개선 포인트 추출) ─── */
.auto-research-box {
    background: linear-gradient(135deg, #faf5ff 0%, #f0f9ff 100%);
    border: 1px solid #d8b4fe;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.auto-research-head {
    font-size: 14px;
    font-weight: 700;
    color: #6b21a8;
    margin-bottom: 10px;
}
.auto-research-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.auto-research-status {
    font-size: 13px;
    color: #4b5563;
}
.auto-research-status.running { color: #2563eb; font-weight: 600; }
.auto-research-status.success { color: #16a34a; font-weight: 600; }
.auto-research-status.error   { color: #dc2626; font-weight: 600; }

/* ─── 이미지 자동 생성 박스 ─── */
.auto-gen-images-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 16px 18px;
}
.auto-gen-head {
    font-size: 14px;
    font-weight: 700;
    color: #065f46;
    margin-bottom: 8px;
}
.auto-gen-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.auto-gen-status { font-size: 13px; color: #4b5563; }
.auto-gen-status.running { color: #2563eb; font-weight: 600; }
.auto-gen-status.success { color: #16a34a; font-weight: 600; }
.auto-gen-status.error   { color: #dc2626; font-weight: 600; }

.auto-gen-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.auto-gen-slot {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
}
.auto-gen-slot-head {
    font-weight: 700;
    color: #374151;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.auto-gen-slot .label { color: #6b7280; font-size: 11px; line-height: 1.4; }
.auto-gen-slot.queued    { border-color: #d1d5db; }
.auto-gen-slot.submitting,
.auto-gen-slot.generating { border-color: #93c5fd; background: #eff6ff; }
.auto-gen-slot.done      { border-color: #6ee7b7; background: #ecfdf5; }
.auto-gen-slot.failed    { border-color: #fca5a5; background: #fef2f2; }
.auto-gen-slot .badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #e5e7eb; color: #374151;
}
.auto-gen-slot.submitting .badge,
.auto-gen-slot.generating .badge { background: #dbeafe; color: #1d4ed8; }
.auto-gen-slot.done .badge      { background: #d1fae5; color: #065f46; }
.auto-gen-slot.failed .badge    { background: #fee2e2; color: #991b1b; }
.auto-gen-slot img {
    width: 100%;
    border-radius: 4px;
    margin-top: 6px;
}
.auto-gen-slot .retry-btn {
    margin-top: 6px;
    background: transparent;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}
.auto-gen-slot .retry-btn:hover { background: #fef2f2; }

.cost-estimate {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
}
.cost-estimate strong { color: #065f46; }

/* ─── Toast 시스템 (Q2) ─────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: #1f2937;
    color: #f9fafb;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #047857; }
.toast.info { background: #1e40af; }
.toast.warning { background: #b45309; }
.toast.error { background: #b91c1c; }

/* ─── Sticky CTA bar (Q1) ──────────────────────── */
.sticky-cta {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255,255,255,0.96);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 -18px 14px;
}
.sticky-cta .sticky-action {
    background: linear-gradient(135deg,#7c3aed 0%,#2563eb 100%);
    color: #fff;
    border: 0;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(124,58,237,.25);
}
.sticky-cta .sticky-action:hover { transform: translateY(-1px); }
.sticky-cta .sticky-action:disabled { background: #d1d5db; color: #6b7280; cursor: not-allowed; box-shadow: none; }
.sticky-cta .sticky-stop {
    background: #dc2626;
    color: #fff;
    border: 0;
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}
.sticky-cta .sticky-status {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
    flex: 1;
    min-width: 0;
}
.sticky-cta .sticky-status .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    margin-right: 6px;
    vertical-align: middle;
}
.sticky-cta .sticky-status.running .dot { background: #f59e0b; animation: pulse 1.4s infinite; }
.sticky-cta .sticky-status.done .dot { background: #10b981; }
.sticky-cta .sticky-status.error .dot { background: #dc2626; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.sticky-cta .sticky-cost {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ─── 인라인 style 대체 클래스들 (Q3 부분) ──────── */
.collapse-callout-warm summary,
.collapse-callout-warm > summary {
    background: linear-gradient(135deg,#fef3c7 0%,#fde68a 100%);
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}
.btn-cta-gradient {
    background: linear-gradient(135deg,#7c3aed 0%,#2563eb 100%);
}
.btn-cta-orange {
    background: linear-gradient(135deg,#f59e0b 0%,#dc2626 100%);
}
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hidden { display: none !important; }

/* ─── Progress stepper (M2) ──────────────────────── */
.progress-stepper {
    display: flex;
    align-items: center;
    margin: 14px 0 20px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    gap: 0;
    font-size: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.progress-stepper .ps-step {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .2s, background .2s;
}
.progress-stepper .ps-step .ps-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}
.progress-stepper .ps-step.active {
    color: #4338ca;
    background: #eef2ff;
}
.progress-stepper .ps-step.active .ps-circle {
    background: #4f46e5;
    color: #fff;
    animation: psPulse 1.6s infinite;
}
.progress-stepper .ps-step.done {
    color: #047857;
}
.progress-stepper .ps-step.done .ps-circle {
    background: #10b981;
    color: #fff;
}
.progress-stepper .ps-step.done .ps-circle::before {
    content: "✓";
}
.progress-stepper .ps-step.done .ps-circle .num { display: none; }
.progress-stepper .ps-arrow {
    color: #cbd5e1;
    margin: 0 4px;
    font-size: 12px;
    flex: 0 0 auto;
}
@keyframes psPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79,70,229,.4); } 50% { box-shadow: 0 0 0 6px rgba(79,70,229,0); } }
@media (max-width: 640px) {
    .progress-stepper .ps-step { padding: 4px 6px; font-size: 11px; }
    .progress-stepper .ps-arrow { margin: 0 2px; }
}

/* ─── Time estimate (M4) ─────────────────────────── */
.sticky-eta {
    font-size: 12px;
    color: #6b7280;
    background: #fef3c7;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
    margin-left: 4px;
}
.sticky-eta.hidden { display: none; }

/* ─── 통일 톤 (M5) — 그라데이션 한두 개로 ─────── */
:root {
    --color-accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --color-accent-grad-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --color-soft-bg: #f8fafc;
}

/* ─── M5: 콜아웃·재작성 패널 톤 통일 ──────────── */
.collapse-callout-warm > summary,
.collapse-callout-warm summary {
    background: #fef3c7;  /* 그라데이션 → 단색 */
    border-left: 3px solid #f59e0b;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: #92400e;
}
.btn-cta-gradient {
    /* 보라+파랑 그라데이션 약화 */
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}
.btn-cta-warm {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

/* 썸네일 설정 박스 — 분홍 점선 톤 약화 */
.thumb-settings-box {
    background: #fdf4ff;
    border: 1px solid #f0abfc;
    border-left: 3px solid #c026d3;
    padding: 14px 16px;
    border-radius: 8px;
    margin-top: 14px;
}
.thumb-settings-head {
    color: #86198f;
    font-weight: 700;
    margin-bottom: 10px;
}

/* 자동 분석 박스 — 보라/연보라 통일 */
.auto-research-box {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-left: 3px solid #7c3aed;
    padding: 14px 16px;
    border-radius: 8px;
}
.auto-research-head {
    color: #5b21b6;
    font-weight: 700;
    margin-bottom: 10px;
}

/* 글 작성 / 이미지 자동 생성 박스 톤 정리 */
.auto-gen-images-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 3px solid #059669;
    padding: 14px 16px;
    border-radius: 8px;
}

/* ─── Q3: 자주 쓰이는 인라인 style → 유틸리티 ───── */
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-10 { margin-top: 10px; }
.gap-10 { gap: 10px; }
.row-center { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ml-10 { margin-left: 10px; }

/* 재작성 패널 summary — M5 */
.rewrite-summary {
    background: #fef3c7;
    border-left: 3px solid #f59e0b;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: #92400e;
}

/* 헤더 우측 — 블로그 바로가기 버튼 */
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn-blog-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #03c75a;
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    transition: background .15s, transform .1s;
}
.btn-blog-link:hover { background: #02b150; transform: translateY(-1px); }

/* Sticky bar 미리보기 버튼 */
.sticky-cta .sticky-preview {
    background: #fff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}
.sticky-cta .sticky-preview:hover:not(:disabled) { background: #f1f5f9; }
.sticky-cta .sticky-preview:disabled { color: #94a3b8; cursor: not-allowed; background: #f8fafc; }

/* ─── 참고 탭 이미지 갤러리 ───────────────────── */
.ref-gallery-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ref-gallery-head b { color: #0f172a; }
.ref-gallery-bulk {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.ref-gallery-status {
    font-size: 12px;
    color: #64748b;
    margin-left: auto;
}
.ref-gallery-status.saving { color: #2563eb; }
.ref-gallery-status.saved  { color: #059669; }
.ref-gallery-status.error  { color: #dc2626; }

.ref-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.ref-img-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s, box-shadow .15s;
}
.ref-img-card.body_use    { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.ref-img-card.gen_reference { border-color: #7c3aed; box-shadow: 0 0 0 1px #7c3aed inset; }
.ref-img-card.excluded    { opacity: .55; background: #f8fafc; }
.ref-img-card.excluded .ref-img-thumb img { filter: grayscale(1); }
.ref-img-card.is_common { border-style: dashed; }

.ref-img-thumb {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ref-img-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.ref-img-card .ref-img-meta {
    padding: 8px 10px 4px;
    font-size: 11px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.ref-img-meta .idx {
    background: #e2e8f0;
    color: #334155;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 600;
}
.ref-img-meta .is-common {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
}
.ref-img-card .ref-img-ctx {
    padding: 0 10px 8px;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ref-img-card .ref-img-choices {
    padding: 6px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}
.ref-img-choices label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 2px 0;
}
.ref-img-choices .gen-config {
    display: flex;
    gap: 4px;
    padding-left: 20px;
    padding-top: 4px;
}
.ref-img-choices .gen-config select,
.ref-img-choices .gen-config input {
    flex: 1;
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    min-width: 0;
}

/* 갤러리 - 업로드 배지 + 삭제 */
.ref-img-source-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 10px;
}
.ref-img-source-badge.upload {
    background: #dcfce7;
    color: #166534;
}
.ref-img-card .ref-img-del-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(220,38,38,0.9);
    color: #fff;
    border: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transition: opacity .15s;
}
.ref-img-card:hover .ref-img-del-btn { opacity: 1; }
.ref-img-card .ref-img-thumb-wrap { position: relative; }

/* 일반탭 이미지 카드 — 3-way 선택 + hint */
.gen-image-card { transition: border-color .15s, box-shadow .15s; }
.gen-image-card.choice-body_use { border-color: #10b981 !important; box-shadow: 0 0 0 1px #10b981 inset; }
.gen-image-card.choice-gen_reference { border-color: #7c3aed !important; box-shadow: 0 0 0 1px #7c3aed inset; }
.gen-image-card.choice-excluded { opacity: .55; }
.gen-img-choices {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px 4px;
    font-size: 11px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.gen-img-choices label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 1px 0;
}
.gen-img-choices select,
.gen-img-choices .hint-input {
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    margin-top: 3px;
    width: 100%;
}

/* 갤러리 카드의 hint-row */
.ref-img-choices .hint-row {
    padding: 4px 0 0;
    padding-left: 20px;
}
.ref-img-choices .hint-row input {
    width: 100%;
    font-size: 11px;
    padding: 3px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}
