/* 블로그 포스팅 도구 공통 스타일 (nicecompany 공용 테마) */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --line: #e6e8eb;
    --text: #1a1d21;
    --muted: #6b7280;
    --faint: #9aa1ab;
    --primary: #111827;
    --accent: #03c75a;
    --accent-soft: #e8f9ef;
    --red: #d92d20;
    --red-soft: #fee4e2;
    --amber: #b54708;
    --amber-soft: #fef0c7;
    --green: #067647;
    --green-soft: #dcfae6;
    --blue: #175cd3;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.ic { vertical-align: -3px; flex: 0 0 auto; }

.mono { font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; font-size: 13px; }

.muted { color: var(--muted); }

.faint { color: var(--faint); }

/* ── 상단 ── */

.topbar {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; }

.topbar .brand .mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 15px;
}

.topbar h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.topbar .sub { font-size: 13px; color: var(--muted); margin-left: 4px; }

.topbar .spacer { flex: 1; }

/* ── 버튼 ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: var(--shadow);
    transition: background .12s, border-color .12s;
}

.btn:hover { background: #f8f9fb; border-color: #d5d8dd; }

.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }

.btn.primary:hover { background: #262b33; }

.btn.danger { color: var(--red); }

.btn.danger:hover { background: #fff5f4; border-color: #f4b8b2; }

.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--muted); }

.btn.ghost:hover { background: #eef0f3; color: var(--text); }

.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }

.btn.icon { padding: 0; width: 34px; justify-content: center; }

.btn.icon.sm { width: 28px; }

.inline { display: inline; }

/* ── 본문 ── */

main { max-width: 1760px; margin: 0 auto; padding: 24px 28px 40px; }

.flash {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-soft);
    color: var(--green);
    border: 1px solid #b7ebc9;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* ── 카드 + 로그 박스 ── */

.top { display: flex; gap: 16px; align-items: stretch; margin-bottom: 20px; }

/* 카드는 전부 같은 높이(92px)다. 내용이 달라도 줄 높이가 흔들리지 않는다. */
.cards { display: grid; grid-template-columns: repeat(3, 156px); grid-auto-rows: 92px; gap: 12px; flex: 0 0 auto; }

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 92px;
    position: relative;
    transition: border-color .12s;
}

.card .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.card .num { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

.card .num.err { font-size: 14px; color: var(--red); }

.card.stat { cursor: pointer; }

.card.stat .num { font-size: 22px; }

.card .sub {
    /* 라벨 줄 오른쪽 끝에 시각만 작게. 숫자와 겹치지 않는다. */
    position: absolute;
    right: 14px;
    top: 14px;
    max-width: 48px;
    font-size: 11px;
    color: var(--faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.logbox {
    flex: 1 1 auto;
    min-width: 320px;
    /* 카드 두 줄 높이만큼만 차지한다. 로그가 많아도 이 안에서 스크롤된다. */
    max-height: 196px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logbox .head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.logbox .head strong { color: var(--text); font-size: 13px; font-weight: 600; }

.logbox .head .spacer { flex: 1; }

/* 실시간 표시 점. 켜져 있으면 초록으로 천천히 깜빡인다. (로그 박스, 목록 도구 줄 공용) */
.live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d1d5db; }

.live.on { background: var(--accent); animation: pulse 2s ease-in-out infinite; }

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

/* 켜고 끄는 스위치 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 12px; user-select: none; }

.switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.switch .track { width: 30px; height: 17px; border-radius: 999px; background: #d1d5db; position: relative; transition: background .15s; }

.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }

.switch input:checked + .track { background: var(--accent); }

.switch input:checked + .track::after { left: 15px; }

.logbox .body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px 14px; }

.logbox .line { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px solid #f1f2f4; font-size: 12.5px; }

.logbox .line:last-child { border-bottom: 0; }

.logbox .line .t { color: var(--faint); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.logbox .line .a { color: var(--blue); flex: 0 0 auto; min-width: 40px; }

.logbox .line .m { flex: 1 1 auto; white-space: pre-wrap; word-break: break-all; }

.logbox .line.err .m { color: var(--red); }

/* 새로 들어온 줄: 왼쪽에 얇은 초록 선을 두고 연한 배경이 몇 초에 걸쳐 사라진다. */
.logbox .line.new {
    box-shadow: inset 3px 0 0 var(--accent);
    padding-left: 8px;
    margin-left: -8px;
    animation: fadeNew 4s ease-out forwards;
}

@keyframes fadeNew {
    from { background: var(--accent-soft); }
    to   { background: transparent; }
}

.logbox .empty { color: var(--faint); padding: 24px; text-align: center; }

/* ── 도구 줄 ── */

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

.toolbar .spacer { flex: 1; }

.field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--faint);
    box-shadow: var(--shadow);
}

.field:focus-within { border-color: #9aa1ab; color: var(--muted); }

.field input {
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    color: var(--text);
    width: 260px;
}

.field input.short { width: 110px; }

.field select { border: 0; outline: 0; background: transparent; font: inherit; color: var(--text); padding-right: 4px; cursor: pointer; }

.field.select { color: var(--muted); }

.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }

/* 라디오를 붙여 놓은 선택 버튼. 실시간 / 목록 전환에 쓴다. */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); padding: 2px; }

.seg label { position: relative; margin: 0; }

.seg input { position: absolute; opacity: 0; width: 0; height: 0; }

.seg span { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }

.seg label:hover span { color: var(--text); }

.seg input:checked + span { background: var(--primary); color: #fff; }

/* ── 표 ── */

.table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table { border-collapse: collapse; width: 100%; min-width: 1040px; }

th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: middle; }

th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: .01em; }

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: #fafbfc; }

td.num { color: var(--faint); font-variant-numeric: tabular-nums; }

td.actions { text-align: right; }

td.actions .btn { margin-left: 4px; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px 2px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status.progress { background: var(--amber-soft); color: var(--amber); }

.status.failed { background: var(--red-soft); color: var(--red); }

.status.done { background: var(--green-soft); color: var(--green); }

select.status-select {
    font: inherit;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    margin-left: 6px;
}

.secret { cursor: pointer; color: var(--faint); letter-spacing: 2px; }

.secret[data-shown="1"] { color: var(--text); letter-spacing: 0; }

.edit-row td { background: #fffbe6; }

.edit-row .field { height: 30px; }

.edit-row .field input { width: 160px; }

.empty { padding: 48px; text-align: center; color: var(--faint); }

/* ── 페이지 넘김 ── */

.pager { display: flex; gap: 4px; align-items: center; margin: 14px 0; font-size: 13px; }

.pager .spacer { flex: 1; }

.pager .range { font-variant-numeric: tabular-nums; }

.pager .btn { min-width: 28px; justify-content: center; }

.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

.pager .btn.disabled { opacity: .35; pointer-events: none; }

/* ── 로그 페이지 ── */

table.logs { min-width: 0; }

table.logs td { white-space: normal; vertical-align: top; }

table.logs td.time { white-space: nowrap; color: var(--faint); font-variant-numeric: tabular-nums; }

table.logs td.msg { word-break: break-all; }

table.logs td.msg.err { color: var(--red); }

/* ── 모달 (이웃추가 설정) ── */

body.modal-open { overflow: hidden; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(16, 24, 40, .45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* hidden 속성이 display:flex 에 밀리지 않도록 명시한다. */
.modal-backdrop[hidden] { display: none; }

.modal {
    width: min(760px, 100%);
    height: min(80vh, 720px);
    background: var(--panel);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(16, 24, 40, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn .15s ease-out;
}

@keyframes modalIn {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

.modal-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.modal-head strong { display: flex; align-items: center; gap: 7px; font-size: 15px; }

.modal-head .spacer { flex: 1; }

.modal-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.modal-hint { padding: 10px 18px; font-size: 12.5px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); }

.modal-body textarea {
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    outline: 0;
    resize: none;
    padding: 14px 18px;
    font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    background: var(--panel);
}

.modal-body textarea:disabled { color: var(--faint); }

/* 모달 아래에 고정되는 저장 패널. 내용이 길어 스크롤돼도 항상 보인다. */
.modal-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.modal-foot .spacer { flex: 1; }

.modal-foot .btn.primary { height: 36px; padding: 0 20px; }

/* ── 로그인 ── */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }

.login {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    width: 340px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, .06);
}

.login .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }

.login .brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 17px;
    flex: 0 0 auto;
}

.login h1 { font-size: 17px; margin: 0; letter-spacing: -.01em; }

.login .field { width: 100%; height: 40px; }

.login .field input { width: 100%; }

.login .btn { width: 100%; height: 40px; justify-content: center; margin-top: 12px; }

.login .error { color: var(--red); font-size: 13px; margin-top: 10px; }

@media (max-width: 960px) {
    .top { flex-direction: column; }
    .logbox { height: 196px; }
    .cards { grid-template-columns: repeat(3, 1fr); }
    main { padding: 16px; }
    .topbar { padding: 0 16px; }
}


/* ══════════════════════════════════════════════════════════════
   블로그 반영 검사기 전용 보강. 위쪽은 nicecompany 공용 테마 그대로다.
   ══════════════════════════════════════════════════════════════ */

/* ── 상단 메뉴 ── */

.topbar nav { display: flex; gap: 2px; margin-left: 8px; }

.topbar nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 11px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    transition: background .12s, color .12s;
}

.topbar nav a:hover { background: #eef0f3; color: var(--text); }

.topbar nav a.active { background: var(--primary); color: #fff; }

/* ── 페이지 제목 줄 ── */

.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 16px; }

.page-head h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.page-head .spacer { flex: 1; }

/* ── 일반 패널 (통계 카드와 달리 높이가 자유롭다) ── */

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.panel > h3 { font-size: 14px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 7px; }

.panel > h3 .spacer { flex: 1; }

.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: stretch; }

.panel-grid > .panel { margin-bottom: 0; }

/* 통계 카드 줄 (카드 개수가 달라도 한 줄에 맞춘다) */
.cards.auto { grid-template-columns: repeat(auto-fit, 156px); }

.card a { display: contents; }

.card.link:hover { border-color: #c9ced6; }

/* ── 폼 ── */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 16px; }

.form-grid .wide { grid-column: 1 / -1; }

.form-row { display: flex; flex-direction: column; gap: 5px; min-width: 0; }

.form-row > label { font-size: 12px; font-weight: 600; color: var(--muted); }

.input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    box-shadow: var(--shadow);
    outline: 0;
    transition: border-color .12s;
}

.input:focus { border-color: #9aa1ab; }

.input:disabled { background: #f8f9fb; color: var(--faint); }

select.input { cursor: pointer; padding-right: 28px; }

textarea.input {
    height: auto;
    min-height: 120px;
    padding: 9px 10px;
    line-height: 1.6;
    resize: vertical;
}

textarea.input.mono { font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; font-size: 13px; }

.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }

.form-actions .spacer { flex: 1; }

/* 도움말 */
.hint {
    font-size: 12.5px;
    color: var(--muted);
    background: #fafbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
    margin-top: 10px;
    line-height: 1.6;
}

.hint b { color: var(--text); font-weight: 600; }

.hint code, .kbd {
    font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace;
    font-size: 12px;
    background: #eef0f3;
    border-radius: 4px;
    padding: 1px 5px;
}

.note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.note.err { color: var(--red); }

/* 알림 (실패) */
.flash.err { background: var(--red-soft); color: var(--red); border-color: #f4b8b2; }

/* ── 상태 (작업) ── */

.status.wait { background: #eef0f3; color: var(--muted); }

.status.checking { background: #dbeafe; color: var(--blue); }

/* ── 표 보강 ── */

table.fit { min-width: 0; }

td.wrap { white-space: normal; word-break: break-all; }

td.clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

td a.link { color: var(--blue); }

td a.link:hover { text-decoration: underline; }

.table-wrap + .table-wrap { margin-top: 16px; }

/* 왼쪽 목록 (제목 프리셋) */
.side-list a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); }

.side-list a:hover { background: #f4f5f7; }

.side-list a.active { background: var(--primary); color: #fff; }

.side-list a.active .muted, .side-list a.active .faint { color: rgba(255, 255, 255, .7); }

.side-list a .spacer { flex: 1; }

.side-list .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* 진행 로그 상자 (작업 상세) */
.log-list { max-height: 420px; overflow-y: auto; }

.log-list .line { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid #f1f2f4; font-size: 12.5px; }

.log-list .line:last-child { border-bottom: 0; }

.log-list .line .t { color: var(--faint); flex: 0 0 auto; font-variant-numeric: tabular-nums; font-family: "JetBrains Mono", "SF Mono", Consolas, Menlo, monospace; }

.log-list .line .m { flex: 1 1 auto; white-space: pre-wrap; word-break: break-all; }

.log-list .line.err .m { color: var(--red); }

/* 원고 본문 */
.manuscript {
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 13.5px;
    max-height: 520px;
    overflow-y: auto;
    padding: 4px 2px;
}

/* 정의 목록 (작업 상세 요약) */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }

.kv dt { color: var(--muted); font-weight: 500; }

.kv dd { margin: 0; min-width: 0; word-break: break-all; }

@media (max-width: 960px) {
    .kv { grid-template-columns: 100px 1fr; }
    .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; }
    .topbar nav { flex-wrap: wrap; margin-left: 0; width: 100%; }
}

/* ── 상단바: 브랜드 폭을 고정해 메뉴가 페이지마다 움직이지 않게 한다 ── */

.topbar .brand { flex: 0 0 210px; width: 210px; overflow: hidden; white-space: nowrap; }

.topbar nav { margin-left: 0; }

.topbar .sub { margin-left: 0; margin-right: 14px; }

/* ── 폼 모달 (테마의 .modal 은 텍스트 편집용이라 높이가 고정이다. 폼은 내용만큼만 쓴다) ── */

.modal.form { height: auto; max-height: min(88vh, 900px); width: min(860px, 100%); }

.modal.form.wide { width: min(1040px, 100%); }

.modal.form > form { display: flex; flex-direction: column; min-height: 0; max-height: min(88vh, 900px); }

.modal-body.pad { padding: 18px; overflow-y: auto; }

.modal-body.pad .hint { margin-top: 12px; }

.modal-foot .btn.ghost { color: var(--muted); }

.page-head .btn { height: 32px; }

/* 모달 안의 폼 textarea 는 테마의 편집기용 규칙(.modal-body textarea, 테두리 없음)보다 우선해 입력란처럼 보이게 한다 */
.modal-body.pad textarea.input {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 10px;
    resize: vertical;
    flex: none;
    min-height: 120px;
    line-height: 1.6;
    box-shadow: var(--shadow);
}

.modal-body.pad textarea.input:focus { border-color: #9aa1ab; }

/* 상단 메뉴 항목: 고정 폭 · 가운데 정렬 (글자 길이에 따라 위치가 바뀌지 않는다) */
.topbar nav a { width: 122px; padding: 0; justify-content: center; }

@media (max-width: 960px) {
    .topbar nav a { width: auto; padding: 0 11px; }
}

/* 페이지 제목 줄은 없앴다. 남은 것은 오른쪽 버튼 줄뿐이다. */
.page-head { margin: 0 0 14px; }

/* ── 상단 메뉴 드롭다운 (작업 목록 → 반영검사 / 자동포스팅) ── */

.topbar nav .nav-item { position: relative; }

.topbar nav .nav-item > a .caret { margin-left: 2px; opacity: .6; }

.topbar nav .submenu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 160px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
    padding: 6px;
    display: none;
    z-index: 30;
}

/* 메뉴와 드롭다운 사이 6px 틈에서 마우스가 빠져도 닫히지 않게 한다 */
.topbar nav .submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }

.topbar nav .nav-item:hover .submenu, .topbar nav .nav-item:focus-within .submenu { display: block; }

.topbar nav .submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    height: 32px;
    padding: 0 10px;
    justify-content: flex-start;
    border-radius: 7px;
    color: var(--text);
}

.topbar nav .submenu a:hover { background: #f4f5f7; }

.topbar nav .submenu a.active { background: var(--accent-soft); color: var(--green); }

.topbar nav .submenu a .count { margin-left: auto; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

/* 드롭다운이 열려 있는 동안(마우스가 하위 메뉴 위에 있을 때도) 부모 메뉴 버튼을 호버 상태로 유지한다 */
.topbar nav .nav-item:hover > a, .topbar nav .nav-item:focus-within > a { background: #eef0f3; color: var(--text); }

.topbar nav .nav-item:hover > a.active, .topbar nav .nav-item:focus-within > a.active { background: #262b33; color: #fff; }

.topbar nav .nav-item:hover > a .caret { opacity: 1; transform: rotate(90deg); }

.topbar nav .nav-item > a .caret { display: inline-flex; transition: transform .12s; }

/* ── 표의 "추가 +N" · "지역 +N" 태그 (추가문구 · 지역). 키워드 옆 같은 줄에 작게 붙는다 ── */

.tags { display: inline-flex; gap: 4px; vertical-align: 1px; margin-left: 4px; }

.more {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 18px;
    padding: 0 6px;
    border: 0;
    border-radius: 5px;
    background: #eef0f3;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.more b { font-weight: 600; color: var(--text); }

.more:hover { background: #dbeafe; color: var(--blue); }

.more:hover b { color: var(--blue); }

/* 누른 자리에 뜨는 오버레이 */
.popover {
    position: fixed;
    z-index: 60;
    max-width: 360px;
    min-width: 180px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .14), 0 1px 2px rgba(16, 24, 40, .06);
    padding: 10px 12px 12px;
    animation: modalIn .12s ease-out;
}

.popover-head { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

.popover-list { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    background: #eef0f3;
    color: var(--text);
    font-size: 12.5px;
    line-height: 1.4;
    white-space: normal;
    word-break: break-all;
}

/* 표 안의 오류 글자: 배지 없이 빨간 글자만. 누르면 전문을 오버레이로 본다 */
.err-text {
    padding: 0;
    border: 0;
    background: none;
    color: var(--red);
    font: inherit;
    cursor: pointer;
}

.err-text:hover { text-decoration: underline; }

/* 계정 대량 등록: 자동포스팅 옵션 묶음 */
.autopost-opts { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }

.autopost-opts[hidden] { display: none; }

/* ── 계정 선택 목록 (표 형태) ── */

.picker { position: relative; }

.picker-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.picker-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; }

.picker-btn .picker-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picker.open .picker-btn { border-color: #9aa1ab; }

.picker-pop {
    position: absolute;
    z-index: 30;
    left: 0;
    top: calc(100% + 4px);
    min-width: 100%;
    max-width: min(640px, 90vw);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .14), 0 1px 2px rgba(16, 24, 40, .06);
    padding: 8px;
}

.picker-pop[hidden] { display: none; }

.picker-search { width: 100%; margin-bottom: 6px; }

.picker-list {
    display: grid;
    grid-template-columns: max-content max-content max-content;
    column-gap: 14px;
    max-height: 320px;
    overflow: auto;
    align-content: start;
}

.picker-row { display: contents; cursor: pointer; }

.picker-row > span { padding: 5px 6px; border-radius: 6px; white-space: nowrap; line-height: 1.4; }

.picker-row[hidden] > span { display: none; }

.picker-row:hover > span { background: #f4f5f7; }

.picker-row.active > span { background: var(--primary); color: #fff; }

.picker-row.active > .muted { color: rgba(255, 255, 255, .75); }

.picker-memo { color: var(--text); }

.picker-memo:empty::before { content: "-"; color: var(--faint); }

.picker-empty { grid-column: 1 / -1; padding: 10px 6px; color: var(--faint); font-size: 12.5px; }

.picker-empty[hidden] { display: none; }

/* ── 사진 묶음 격자 ── */

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }

.media-item img { display: block; width: 100%; height: 120px; object-fit: cover; background: #f0f1f3; }

.media-meta { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11.5px; }

.media-meta .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.media-meta .inline { margin-left: auto; }

.seg a { display: inline-flex; border-radius: 6px; }

.seg a.active span { background: var(--primary); color: #fff; }

.topbar .sub .ic { vertical-align: -2px; margin-right: 4px; }

.media-video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 120px; background: #1f2937; color: #fff; font-size: 11px; font-weight: 600; }

/* ── SE 설정 편집 (도구형 폼 + 미리보기) ── */

.se-style-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }

@media (max-width: 1100px) { .se-style-layout { grid-template-columns: 1fr; } }

.se-style-form .panel { margin-bottom: 14px; }

.se-style-form .form-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.color-row { display: flex; gap: 6px; align-items: center; }

.color-row input[type=color] { width: 38px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); cursor: pointer; }

.color-row .input { flex: 1 1 auto; }

.check-row { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 0; cursor: pointer; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2px 12px; }

.se-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; background: #f0f0f0; }

.se-preview-wide { max-width: 900px; }

.panel h3 .spacer { flex: 1; }

.se-preview .pv-row { min-height: 44px; display: flex; align-items: center; padding: 12px; margin: 6px 3px 3px; line-height: 1.3; }

.se-preview .pv-table { width: calc(100% - 6px); table-layout: fixed; border-collapse: collapse; margin: 12px 3px 3px; font-size: 13px; background: #fff; }

.se-preview .pv-table td { border: 1px solid #a0a0a0; padding: 2px 6px; text-align: center; vertical-align: middle; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.se-preview .pv-table td.left { text-align: left; }

.se-preview .pv-table td.bar { font-family: "맑은 고딕", "Malgun Gothic", sans-serif; letter-spacing: -1px; }

.se-preview .pv-border { margin: 15px 3px 3px; font-family: Consolas, "JetBrains Mono", monospace; font-size: 12px; color: #111; white-space: pre-wrap; word-break: break-all; }

.se-json { margin: 12px 0 0; padding: 12px; background: #1f2937; color: #e5e7eb; border-radius: 8px; font-size: 12px; max-height: 300px; overflow: auto; }

.se-json[hidden] { display: none; }

.toolbar .field input { min-width: 220px; }

/* ── 사진마다 링크 설정 (마우스 오버 오버레이) ── */

.media-thumb { position: relative; }

.media-link-btn {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px;
    border: 0;
    background: rgba(17, 24, 39, .78);
    color: #fff;
    font: inherit; font-size: 12px; font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s;
}

.media-thumb:hover .media-link-btn, .media-link-btn:focus { opacity: 1; }

.media-link-btn:hover { background: rgba(3, 199, 90, .9); }

.media-link-badge {
    position: absolute; top: 6px; right: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.media-item.has-link { border-color: #9fdbb8; }

.link-target { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }

.link-target img { width: 84px; height: 60px; object-fit: cover; border-radius: 6px; background: #eef0f3; }

.link-target span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); margin-right: 4px; vertical-align: middle; }

/* ── 폼 영역 구분 (작업 추가) ── */

.fs { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 14px; margin: 0 0 14px; min-width: 0; }

.fs legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

.fs .form-grid { gap: 10px 16px; }

.fs .form-grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.fs .note { margin-top: 8px; }

.fs .check-row { min-height: 34px; }

/* 체크박스가 제목 자리에 오는 칸: 제목 줄 높이를 다른 칸의 라벨과 같게 하고, 꺼져 있어도 입력칸 자리를 남겨 옆 칸과 높이를 맞춘다 */
.form-row > label.check-row { min-height: 0; padding: 0; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 18px; }

.form-row > label.check-row input { margin: 0; }

.form-row > label:not(.check-row) + label.check-row { min-height: 34px; font-size: 13px; font-weight: 500; color: var(--text); }

.range-row { display: flex; gap: 8px; align-items: center; min-height: 34px; }

.range-row[hidden] { display: flex; visibility: hidden; }

/* ── 작업 목록: 선택 행 · 우클릭 메뉴 · 선택 막대 ── */

th.sel, td.sel { width: 34px; text-align: center; padding-left: 10px; padding-right: 4px; }

tr.job-row { cursor: default; user-select: none; }

tr.job-row.selected td { background: #e8f1ff; }

tr.job-row.selected:hover td { background: #dde9fb; }

.ctx {
    position: fixed; z-index: 70; min-width: 240px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .16), 0 1px 2px rgba(16, 24, 40, .06);
    padding: 6px; animation: modalIn .1s ease-out;
}

.ctx[hidden] { display: none; }

.ctx-head { padding: 6px 10px 8px; font-size: 11.5px; font-weight: 600; color: var(--faint); }

.ctx button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer; }

.ctx button:hover { background: #f1f3f6; }

.ctx button.danger { color: var(--red); }

.ctx button kbd { margin-left: auto; font-family: inherit; font-size: 11px; color: var(--faint); }

.ctx-sep { height: 1px; background: var(--line); margin: 5px 4px; }

.selbar {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60;
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .16); animation: modalIn .12s ease-out;
}

.selbar[hidden] { display: none; }

.selbar strong { margin-right: 4px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }

.selbar .btn { white-space: nowrap; flex: 0 0 auto; }

.selbar kbd { font-family: inherit; font-size: 11px; color: var(--faint); margin-left: 4px; }

/* ── 커스텀 확인 · 알림 창 ── */

.dialog-backdrop { z-index: 90; }

.modal.dialog { width: min(440px, calc(100vw - 32px)); height: auto; max-height: min(80vh, 600px); }

.dialog-body { display: flex; gap: 14px; padding: 22px 22px 18px; }

.dialog-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; }

.dialog-icon.ask { background: #dbeafe; color: var(--blue); }

.dialog-icon.danger { background: var(--red-soft); color: var(--red); }

.dialog-icon.info { background: var(--green-soft); color: var(--green); }

.dialog-text { flex: 1 1 auto; min-width: 0; }

.dialog-text strong { display: block; font-size: 15px; margin-bottom: 6px; }

.dialog-text div { font-size: 13.5px; line-height: 1.6; color: var(--muted); white-space: pre-line; word-break: keep-all; }

.btn.danger.solid { background: var(--red); border-color: var(--red); color: #fff; }

.btn.danger.solid:hover { background: #b42318; }

.modal.dialog .modal-foot { padding: 12px 18px 16px; border-top: 0; }

tr.job-row td.sel input, th.sel input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); }

tr.job-row:hover td { background: #f4f6fa; }

/* ── 작업 순서 드래그 손잡이 · 놓을 자리 표시 ── */

th.grip, td.grip { width: 22px; padding-left: 8px; padding-right: 0; }

.grip-handle { display: inline-block; color: var(--faint); font-size: 13px; letter-spacing: -3px; cursor: grab; user-select: none; padding: 2px 4px; border-radius: 4px; }

.grip-handle:hover { color: var(--text); background: #eef0f3; }

.grip-handle:active { cursor: grabbing; }

tr.job-row.dragging td { opacity: .45; }

tr.job-row.drop-before td { box-shadow: inset 0 3px 0 0 var(--accent); }

tr.job-row.drop-after td { box-shadow: inset 0 -3px 0 0 var(--accent); }

/* ── 드래그 범위 박스 (작업 목록 선택) ── */

.drag-band { position: fixed; z-index: 50; pointer-events: none; border: 1px solid var(--blue); background: rgba(23, 92, 211, .12); border-radius: 3px; }

.drag-band[hidden] { display: none; }

/* ── 진행 로그 상자 (데스크톱 오른쪽 아래 로그창) ── */

.log-panel > h3 .check-row { font-size: 12px; color: var(--muted); }

.log-box {
    height: 260px; overflow: auto; padding: 10px 12px;
    background: #f6f7f9; color: #5b6472; border: 1px solid var(--line); border-radius: 10px; /* 페이지 톤에 맞는 밝은 로그창 · 본문은 중간 회색 */
    font-family: "JetBrains Mono", Consolas, Menlo, monospace; font-size: 12.5px; line-height: 1.6;
}

.log-box .line { white-space: pre-wrap; word-break: break-all; }

.log-box .line.err { color: var(--red); }

.log-box .m { color: #5b6472; }

.log-box .line.err .m { color: var(--red); }

.log-box .t { color: var(--faint); }

.log-box .j { color: var(--blue); font-weight: 600; }

.log-box .j:hover { text-decoration: underline; }

.log-empty { color: var(--muted); padding: 8px 0; }

.worker-state { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }

.page-head .inline { display: inline-flex; }

/* ── 작업 목록 상단: 카드 4개 + 진행 로그 (같은 높이) ── */

.dash { display: flex; gap: 12px; align-items: stretch; margin-bottom: 20px; height: 244px; } /* 카드 2줄(116px×2 + 간격 12px) 높이에 로그를 맞춘다 */

.dash-cards { display: grid; grid-template-columns: repeat(2, 156px); grid-auto-rows: 116px; gap: 12px; flex: 0 0 auto; } /* 전체·대기 / 발행중·완료 2열 */

.dash-cards .card { height: 116px; }

.dash-log { flex: 1 1 auto; min-width: 0; height: 244px; display: flex; flex-direction: column; padding: 12px 14px; justify-content: flex-start; }

.dash-log .label { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

.dash-log .log-box { flex: 1 1 auto; height: 0; min-height: 0; margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; }

@media (max-width: 1100px) { .dash { flex-wrap: wrap; height: auto; } .dash-log { flex-basis: 100%; height: 244px; } }

.worker-btn { min-width: 150px; justify-content: center; font-weight: 700; }

@media (max-width: 1100px) { .dash { flex-wrap: wrap; } .dash-log { flex-basis: 100%; min-height: 244px; } }

/* ── 상단바: 폭이 좁아도 줄이 어긋나지 않게 ── */

.topbar > * { white-space: nowrap; flex-shrink: 0; }

.topbar nav { flex: 0 0 auto; overflow: visible; }

/* 좁은 폭에서는 메뉴 글자를 숨기고 아이콘만 남긴다 (드롭다운은 그대로 펼쳐진다) */
@media (max-width: 1000px) { .topbar nav > a, .topbar nav .nav-item > a { padding: 0 9px; font-size: 0; gap: 0; } .topbar nav > a .ic, .topbar nav .nav-item > a .ic { width: 16px; height: 16px; } .topbar nav .nav-item > a .caret { display: none; } .topbar nav .submenu a { font-size: 13px; gap: 6px; } }

.topbar nav a { white-space: nowrap; flex-shrink: 0; }

.topbar .sub { white-space: nowrap; }

@media (max-width: 1280px) { .topbar #clock { display: none; } }

@media (max-width: 1100px) { .topbar .brand { flex-basis: auto; width: auto; } .topbar .brand h1 { display: none; } .topbar .sub:not([title]) { display: none; } }

@media (max-width: 900px) { .topbar { padding: 0 14px; gap: 8px; } .topbar .sub { display: none; } }

/* ── 작업 목록: 긴 칸은 말줄임하지 않고 줄을 바꿔 내용이 다 보이게 한다. 표는 화면 폭에 맞추고 넘치면 가로 스크롤 ── */

#live-table table { min-width: 0; table-layout: auto; }

#live-table td.cut { max-width: 360px; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }

#live-table td.cut.kw { max-width: 340px; }

#live-table td.cut .muted, #live-table td.cut .faint { white-space: normal; }

@media (max-width: 1280px) { #live-table th, #live-table td { padding-left: 8px; padding-right: 8px; } #live-table td.cut { max-width: 180px; } }

/* ── 설정 페이지 탭 ── */

.setting-tab .panel { margin-bottom: 14px; }

.setting-tab .form-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.setting-tab[hidden] { display: none; }

.setting-user-actions[hidden] { display: none; }

/* 설정 › 원고 생성 AI: Claude / OpenAI 두 칸으로 나란히 */
.ai-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-items: start; }

.ai-split .panel { margin-bottom: 0; border-top: 3px solid var(--line); }

.ai-split .panel:first-child { border-top-color: #d97757; }

.ai-split .panel:last-child { border-top-color: #10a37f; }

.ai-split .form-grid { grid-template-columns: 1fr 1fr; }

/* 가져오기 모달 (이전 도구 · 조각 업로드 진행) */
.import-steps { display: grid; gap: 12px; }
.import-step { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.import-step b { display: block; margin-bottom: 4px; }
.import-step .muted { font-size: 12.5px; margin-bottom: 8px; line-height: 1.5; }
.import-progress { margin-top: 12px; }
.import-bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.import-bar-fill { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.import-log { margin-top: 8px; max-height: 160px; overflow-y: auto; font-family: Consolas, monospace; font-size: 11.5px; background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.import-log .err { color: var(--red); }
/* 프리셋 추가 버튼: 선택된 프리셋(파란색)과 구분되게 초록 계열 */
.btn.accent { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.btn.accent:hover { background: #17864a; border-color: #17864a; }

/* 계정 바꾸기 모달: 계정 선택 목록(팝업)이 펼쳐질 자리를 미리 확보한다. 본문이 짧아 팝업이 잘리던 문제 */
#accountModal .modal-body.pad { min-height: 470px; overflow: visible; }
#accountModal .picker-pop { max-width: 100%; }

/* 프리셋 사이드 목록: 검색 · 페이지 이동 */
.side-search { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.side-search .field { flex: 1 1 auto; min-width: 0; }
.side-search .field input { width: 100%; min-width: 0; }
.side-pager { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 2px 0; font-size: 13px; color: var(--text); }
.side-pager .btn { height: 30px; padding: 0 10px; font-size: 12.5px; font-weight: 600; gap: 4px; }
.side-pager-info { font-size: 13px; color: var(--text); white-space: nowrap; }
.side-pager-info b { font-size: 14px; }
.side-search .field { height: 34px; }
.side-search .field input { font-size: 13px; }
.side-pager .btn.disabled { opacity: .35; pointer-events: none; }

/* 사진 프리셋 종류(카테고리) 선택 */
.kind-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 10px; }
.kind-tabs a { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text); background: var(--panel); }
.kind-tabs a:hover { background: #f4f5f7; }
.kind-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.kind-tabs a .n { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: #eef0f3; color: var(--muted); }
.kind-tabs a.active .n { background: rgba(255,255,255,.22); color: #fff; }

/* 선택한 프리셋 수정 (오른쪽 상단 한 줄) */
.preset-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.preset-edit-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.preset-edit-kind { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.preset-edit-field { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; min-width: 160px; margin: 0; }
.preset-edit-field > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.preset-edit-field .input { flex: 1 1 auto; min-width: 0; height: 32px; }
.preset-edit .btn { height: 32px; }

.media-meta .media-rename-btn { width: 24px; height: 24px; padding: 0; flex: 0 0 auto; color: var(--muted); }
.media-meta .media-rename-btn:hover { color: var(--text); }

/* 진행 로그 강조색 */
.log-box .m .ok { color: #067647; font-weight: 700; }
.log-box .m .bad { color: var(--red); font-weight: 700; }
.log-box .m .wait { color: #b54708; font-weight: 700; }
.log-box .m .go { color: var(--blue); font-weight: 700; }
.log-box .m .val { color: #1a1d21; font-weight: 700; font-size: inherit; }
.log-box .m .tag { display: inline-block; font-size: 11.5px; padding: 0 6px; border-radius: 6px; background: #e9e4ff; color: #5b3fd6; font-weight: 600; font-size: 11.5px; line-height: 1.6; }
.log-box .m .lk { color: var(--blue); text-decoration: underline; }
.log-box .line.err .m .val, .log-box .line.err .m .ok, .log-box .line.err .m .wait { color: var(--red); }

.side-pager.top { padding: 0 2px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.panel > h3 .btn.sm { height: 26px; padding: 0 9px; font-size: 12px; }

/* 임베드 모달 (iframe 로 다른 페이지를 embed=1 로 연다) */
body.embed { background: var(--panel); }
main.embed { max-width: none; padding: 14px 16px 20px; }
.modal.form.wide.embed-modal { width: min(1320px, 100%); height: min(92vh, 980px); max-height: min(92vh, 980px); }
.embed-modal .embed-modal-body { flex: 1 1 auto; min-height: 0; padding: 0; }
.embed-modal iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--panel); }

/* SE 설정 편집: 이름 · 탭(테이블·색상 스타일 / 미리보기) · 저장 줄을 위에 고정해 스크롤해도 보이게 */
#seForm > .toolbar { position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 10px 0; margin: -10px 0 12px; border-bottom: 1px solid var(--line); }
body.embed #seForm > .toolbar { top: 0; background: var(--panel); margin-top: -14px; padding-top: 14px; }

tr.se-row { cursor: pointer; }
tr.se-row:hover td { background: #f7f8fa; }

tr.row-edit { cursor: pointer; }
tr.row-edit:hover td { background: #f7f8fa; }

/* 원고 저장소: 카운트 카드 + 탭 줄 고정 */
/* 원고 저장소: 상단 버튼 줄(page-head)도 고정하고, 카드+탭 줄은 그 아래에 붙인다 */
main:has(.pregen-top) > .page-head { position: sticky; top: 60px; z-index: 16; background: var(--bg); margin: 0; padding: 6px 0 10px; }
body.embed main:has(.pregen-top) > .page-head { top: 0; background: var(--panel); }
.pregen-top { position: sticky; top: 108px; z-index: 15; background: var(--bg); padding-top: 2px; margin-bottom: 12px; }
body.embed .pregen-top { top: 48px; background: var(--panel); }
.pregen-top .toolbar { margin-bottom: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
/* 로그 줄 간격 · 색 정리 */
.log-box .line { padding: 3px 0; border-bottom: 1px dashed #e6e8ec; }
.log-box .line:last-child { border-bottom: 0; }
.log-box .m .val { color: #2b3138; font-weight: 600; }
.log-box .m .ok { font-weight: 600; }
.log-box .m .bad, .log-box .m .wait, .log-box .m .go { font-weight: 600; }

/* 사진 프리셋 도구줄: 한 줄 유지, 설명은 말줄임 */
.media-toolbar { flex-wrap: nowrap; }
.media-toolbar > strong { white-space: nowrap; }
.media-toolbar > .muted { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-toolbar .btn, .media-toolbar form { flex: 0 0 auto; }
/* 표 헤더 · 셀 정렬 · 여백 통일 */
th { white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .inline { display: inline-flex; vertical-align: middle; }
td.actions .btn.sm.icon { vertical-align: middle; }
.table-wrap .empty { padding: 28px 16px; text-align: center; color: var(--muted); }
/* 설정 패널: 힌트를 아래에 붙여 높이가 같을 때 정렬 */
.panel-grid > .panel { display: flex; flex-direction: column; }
.panel-grid > .panel > .hint:last-child { margin-top: auto; }

/* 템플릿 목록: 구성 요약 칩 */
.tpl-summary { white-space: normal; line-height: 1.9; }
.tpl-tag { display: inline-block; padding: 0 7px; border-radius: 6px; background: #eef0f3; font-family: Consolas, monospace; font-size: 12px; color: var(--text); margin-right: 2px; }
.tpl-tag b { margin-left: 3px; color: var(--blue); font-weight: 600; }
.tpl-tag.muted { background: transparent; border: 1px dashed var(--line); }

/* 우측 상단 프로필 · 계정 전환 */
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.user-btn:hover, .user-menu.open .user-btn { background: #f4f5f7; border-color: var(--line); color: var(--text); }
.user-btn .caret { display: inline-flex; opacity: .6; }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .16), 0 1px 2px rgba(16, 24, 40, .06); padding: 6px; z-index: 60; }
.user-pop[hidden] { display: none; }
.user-pop-head { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px 10px 4px; }
.user-row { display: flex; align-items: center; gap: 4px; }
.user-row .user-switch { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.user-row .user-switch:hover { background: #f4f5f7; }
.user-row.current .user-switch { cursor: default; background: #f7f8fa; }
.user-row .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: 0 0 auto; }
.user-row .who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-row .who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .who small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .status { margin-left: auto; }
.user-row .user-forget { flex: 0 0 auto; width: 26px; height: 26px; padding: 0; color: var(--faint); }
.user-row .user-forget:hover { color: var(--red); }
.user-pop-foot { display: flex; gap: 6px; justify-content: space-between; padding: 8px 6px 4px; border-top: 1px solid var(--line); margin-top: 6px; }

/* 버튼: 아이콘은 왼쪽 끝에, 글자는 남은 자리 가운데. 아이콘 없는 버튼은 글자 가운데, 아이콘이 뒤에 오는 버튼(다음 ›)은 반대 */
.btn:not(.icon):has(> svg:first-child) { display: inline-grid; grid-auto-flow: column; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: center; column-gap: 6px; }
.btn:not(.icon):has(> svg:first-child) > svg { justify-self: start; }
.btn:not(.icon):has(> svg:last-child:not(:first-child)) { grid-template-columns: minmax(0, 1fr) auto; }
.btn:not(.icon):has(> svg:last-child:not(:first-child)) > svg:last-child { justify-self: end; }
.btn:not(.icon):not(:has(> svg)) { justify-content: center; }
.worker-btn { min-width: 0; padding: 0 20px; }

/* 상단 메뉴 · 드롭다운 항목도 아이콘 왼쪽 · 글자 가운데 */
.topbar nav a:has(> svg:first-child) { display: inline-grid; grid-auto-flow: column; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; justify-items: center; column-gap: 6px; padding: 0 12px; }
.topbar nav a:has(> svg:first-child) > svg:first-child { justify-self: start; }
.topbar nav a:has(> svg:first-child) > .caret { justify-self: end; }
.topbar nav a:has(> svg:first-child):not(:has(> .caret)) { grid-template-columns: auto minmax(0, 1fr); }
.topbar nav .submenu a:has(> svg:first-child) { display: grid; width: 100%; min-width: 150px; grid-template-columns: auto minmax(max-content, 1fr); }
/* 드롭다운은 가장 긴 항목 폭에 맞추고 글자는 줄바꿈하지 않는다 (아이콘 위로 겹치지 않게) */
.topbar nav .submenu { width: max-content; }
.topbar nav .submenu a { white-space: nowrap; }
.user-btn { display: inline-grid; grid-auto-flow: column; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; justify-items: center; column-gap: 6px; }
.user-btn > svg:first-child { justify-self: start; }

/* 대시보드 카드: 라벨은 줄바꿈하지 않고, 실패·멈춤 건수는 라벨 아래 작은 줄에 */
.dash-cards .card .label { white-space: nowrap; }
/* 완료 카드 우측 상단의 실패·멈춤 건수 (라벨과 같은 줄, 숫자와 겹치지 않는다) */
.card .card-note { position: absolute; right: 14px; top: 14px; max-width: 70px; font-size: 11px; line-height: 16px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .card-note .bad { color: var(--red); }

/* 반영감지 작업: 감지중 상태 · 목록의 반영감지 칸 */
.status.watch { background: #ede9fe; color: #6d28d9; }
td.detect-cell { min-width: 190px; line-height: 1.45; }
td.detect-cell .dk { font-weight: 600; }
td.detect-cell .ds { font-size: 11.5px; color: var(--muted); }
td.detect-cell .ds .status { font-size: 11px; padding: 1px 6px; }

/* 작업 목록 시간 칸의 반복 발행 표시 */
.repeat-note { margin-top: 2px; font-size: 11.5px; color: #6d28d9; white-space: nowrap; }
.repeat-note .ic { vertical-align: -1px; }

/* 작업 폼 프리셋 줄 */
.preset-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.preset-bar > strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.preset-bar select.input { width: auto; min-width: 220px; max-width: 360px; height: 32px; }
.preset-bar .spacer { flex: 1 1 auto; }
.preset-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin: -4px 0 12px; border: 1px dashed #b7c0cc; border-radius: 10px; background: #fff; }
/* display:flex 가 hidden 속성을 덮어쓰지 않게 (버튼을 눌렀을 때만 보인다) */
.preset-save[hidden] { display: none; }
.preset-save .input { width: 220px; height: 32px; }
.preset-save .check-row { min-height: 0; padding: 0; font-size: 13px; }
.preset-save .sec-label { font-size: 12px; color: var(--muted); }
