/* 이내풍 홍보 도우미 — 화면 모양
   생각: 매일 원고를 쓰는 책상. 흰 종이(원고) 위에 쪽빛 글씨, 고칠 곳은 빨간 펜.
   색: 책상 #EEF1F4 / 종이 #FFFFFF / 먹 #1B2430 / 쪽빛 #234E9C / 빨간 펜 #C2452D */
:root {
  --desk: #eef1f4;
  --paper: #ffffff;
  --ink: #1b2430;
  --ink-2: #51606f;
  --line: #d5dbe2;
  --line-soft: #e6eaef;
  --indigo: #234e9c;
  --indigo-deep: #16356e;
  --indigo-wash: #e9effa;
  --pen: #c2452d;
  --pen-wash: #fbede9;
  --amber: #8a5800;
  --amber-wash: #fff4dc;
  --ok: #1f7a4d;
  --ok-wash: #e6f4ec;
  --radius: 6px;
  --font: "Pretendard Variable", Pretendard, "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--desk); line-height: 1.6; -webkit-text-size-adjust: 100%; }
:where(h1, h2, h3, p, ul, ol, dl, form) { margin: 0; }
a { color: var(--indigo); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #7aa2e8; outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 50; }

/* 틀 */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--paper); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 2px 8px 12px; }
.brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--pen); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 17px; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
/* 왼쪽 메뉴: 큰 메뉴(굵은 쪽빛 글씨 + 네모 표시) 아래에 작은 메뉴(들여쓰기 + 세로줄) */
.nav-sec + .nav-sec { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.nav-group { display: flex; align-items: center; gap: 8px; padding: 4px 8px 6px; font-size: 15px; font-weight: 800; color: var(--indigo-deep); letter-spacing: -0.01em; }
.nav-group::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--indigo); flex: none; }
.nav-sub { list-style: none; margin: 0 0 0 11px; padding: 0 0 0 9px; border-left: 2px solid var(--line-soft); }
.nav-item { position: relative; display: block; padding: 6px 10px; border-radius: var(--radius); color: #3a4653; text-decoration: none; font-size: 14.5px; }
.nav-item:hover { background: var(--desk); color: var(--ink); }
.nav-item.is-active { background: var(--indigo-wash); color: var(--indigo-deep); font-weight: 700; }
.nav-item.is-active::before { content: ""; position: absolute; left: -11px; top: 4px; bottom: 4px; width: 2px; background: var(--indigo); }
.side-foot { margin-top: auto; padding: 10px 10px 0; font-size: 12px; color: var(--ink-2); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; justify-content: flex-end; padding: 10px 28px; background: var(--paper); border-bottom: 1px solid var(--line); font-size: 14px; position: sticky; top: 0; z-index: 10; }
.menu-btn { display: none; margin-right: auto; }
.meter { margin-right: auto; background: var(--indigo-wash); color: var(--indigo-deep); padding: 4px 12px; border-radius: 999px; font-weight: 600; }
.meter.is-low { background: var(--pen-wash); color: var(--pen); }
.top-user b { font-weight: 700; }
.top-link { color: var(--ink-2); text-decoration: none; }
.top-link:hover { color: var(--indigo); text-decoration: underline; }
.as-link { background: none; border: 0; padding: 0; cursor: pointer; }
.inline-form { display: inline; margin: 0; }
.main { padding: 28px; max-width: 1080px; width: 100%; }
.main.is-wide { max-width: 1400px; }

/* 글자 */
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.page-lead { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
h2.sec { font-size: 19px; font-weight: 700; margin-bottom: 0; }
.table-wrap, .cols { margin-bottom: 0; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }

/* 종이(면) */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-grid .btn { width: 100%; }
.block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.block-head h2.sec { margin: 0; }

/* 세로 간격은 한 가지 규칙으로: 위아래로 쌓이는 것들 사이에만 같은 간격을 준다.
   (숨은 입력칸은 세지 않는다. :where 로 써서 아래의 "나란히 놓인 것" 규칙이 항상 이긴다) */
:where(.card, .stack, .block, form, .login-card) > :where(:not([type=hidden])) ~ * { margin-top: 14px; }
:where(.cols > div) > :where(:not([type=hidden])) ~ * { margin-top: 16px; }
:where(.main) > * + * { margin-top: 20px; }
.stack { margin-top: 16px; }
.main > .stack { margin-top: 20px; }
.card > .stack, form > .stack { margin-top: 14px; }
/* 나란히 놓인 것들은 위쪽 간격 없이 줄을 맞춘다 */
.row > *, .grid-2 > *, .grid-4 > *, .cols > *, .btn-grid > *, .form-line > *, .tabs > *, .checks > *, dl.facts > *, .page-head > *, .block-head > *, .manual-row > * { margin-top: 0; }

/* 입력 */
.field { display: block; }
.field > .label, .label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.field .hint { display: block; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.req { color: var(--pen); font-weight: 700; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1px solid #b9c2cd; border-radius: var(--radius); padding: 8px 11px; background: #fff; min-height: 40px;
}
textarea { resize: vertical; line-height: 1.7; }
input:hover, select:hover, textarea:hover { border-color: #8d99a8; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row-end { justify-content: flex-end; }
form.card.row { align-items: flex-end; }
/* 한 줄 입력: 칸들과 단추의 아랫선을 맞춘다 */
.form-line { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-line > .field { flex: 0 1 240px; min-width: 180px; }
.form-line > .grow { flex: 1 1 280px; }
.form-line > .full { flex: 1 0 100%; margin-bottom: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--indigo); }

/* 단추 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent; background: var(--indigo); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; font-size: 15px; white-space: nowrap; }
.btn:hover { background: var(--indigo-deep); }
.btn[disabled] { background: #aab4c0; cursor: not-allowed; }
.btn-line { background: #fff; color: var(--indigo-deep); border-color: var(--indigo); }
.btn-line:hover { background: var(--indigo-wash); }
.btn-quiet { background: #fff; color: var(--ink); border-color: #b9c2cd; min-height: 34px; padding: 0 12px; font-size: 14px; font-weight: 600; }
.btn-quiet:hover { background: var(--desk); }
/* 한 줄에 놓인 단추는 높이를 같게 */
.row > .btn-quiet, .page-head .btn-quiet, .form-line > .btn-quiet, form.card.row > .btn-quiet, .manual-row > .btn-quiet { min-height: 40px; padding: 0 14px; }
.btn-pen { background: #fff; color: var(--pen); border-color: var(--pen); }
.btn-pen:hover { background: var(--pen); color: #fff; }
.btn.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }

/* 알림 */
.flash { padding: 11px 14px; border-radius: var(--radius); font-weight: 600; border: 1px solid; }
.flash-ok { background: var(--ok-wash); color: var(--ok); border-color: #b6dcc6; }
.flash-bad { background: var(--pen-wash); color: var(--pen); border-color: #efc4b9; }
.note { background: var(--amber-wash); color: #5c3b00; border: 1px solid #f0d9a4; border-radius: var(--radius); padding: 11px 14px; font-size: 14.5px; }
.note-plain { background: var(--desk); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); padding: 11px 14px; font-size: 14.5px; }

/* 채널 고르기 */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { padding: 9px 16px; border: 1px solid #b9c2cd; border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.tab:hover { border-color: var(--indigo); }
.tab.is-active { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* 원고지: 프롬프트 · 초안이 놓이는 칸. 왼쪽의 붉은 세로줄이 원고지의 여백선이다 */
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 8px 26px; border-bottom: 1px solid var(--line-soft); background: #fbfcfd; }
.sheet-label { font-weight: 700; font-size: 14.5px; }
.sheet-text { border: 0; border-radius: 0; padding: 12px 14px 12px 26px; min-height: 240px; font-size: 15px; line-height: 28px;
  background-image: linear-gradient(to right, transparent 16px, #e9b3a7 16px, #e9b3a7 17px, transparent 17px), repeating-linear-gradient(to bottom, transparent 0, transparent 27px, #edf0f4 27px, #edf0f4 28px);
  background-attachment: local; background-position: 0 0, 0 12px; }
.sheet-text:focus-visible { outline-offset: -3px; }
.code { font-family: Consolas, "D2Coding", monospace; font-size: 13.5px; line-height: 1.6; background: #f6f8fa; }

/* 점검 결과: 빨간 펜으로 표시한 교정지 */
.score { display: flex; align-items: baseline; gap: 10px; }
.score-num { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.score-num.is-bad { color: var(--pen); }
.score-num.is-mid { color: var(--amber); }
.score-num.is-good { color: var(--ok); }
.marks { list-style: none; margin: 14px 0 0; padding: 0; }
.mark { padding: 10px 12px 10px 14px; border-left: 4px solid var(--line); background: #fff; border-bottom: 1px solid var(--line-soft); }
.mark-bad { border-left-color: var(--pen); background: var(--pen-wash); }
.mark-warn { border-left-color: #d49a1f; background: var(--amber-wash); }
.mark-good { border-left-color: var(--ok); }
.mark-label { font-weight: 700; margin-right: 8px; }
.mark-bad .mark-label { color: var(--pen); }
.mark-warn .mark-label { color: var(--amber); }
.mark-good .mark-label { color: var(--ok); }
.mark-where { display: block; margin-top: 4px; font-size: 14px; color: var(--ink-2); text-decoration: underline wavy var(--pen); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.mark-good .mark-where, .mark-warn .mark-where { text-decoration-color: #d49a1f; }
.stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); margin-top: 8px; }

/* 표 */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 700; background: #f3f5f8; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fafbfc; }
.table a.title-link { font-weight: 600; text-decoration: none; }
.table a.title-link:hover { text-decoration: underline; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }

/* 꼬리표 */
.tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.tag-indigo { background: var(--indigo-wash); color: var(--indigo-deep); border-color: #c6d5f2; }
.tag-ok { background: var(--ok-wash); color: var(--ok); border-color: #b6dcc6; }
.tag-warn { background: var(--amber-wash); color: var(--amber); border-color: #f0d9a4; }
.tag-pen { background: var(--pen-wash); color: var(--pen); border-color: #efc4b9; }

/* 노출 순위 */
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 14.5px; color: var(--ink-2); }
.rank { font-weight: 800; font-size: 15.5px; }
.rank-top { color: var(--indigo); }
.rank-out { color: var(--ink-2); font-size: 13.5px; }
.chg { display: inline-block; margin-left: 4px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chg-up { color: var(--ok); }
.chg-down { color: var(--pen); }
.table-rank th, .table-rank td { padding: 9px 10px; }
.table th[scope=row] { background: #fff; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.table tr:last-child th[scope=row] { border-bottom: 0; }
.table .th-group { text-align: center; border-left: 1px solid var(--line); }
.table .th-manual, .table .td-manual { border-left: 1px solid var(--line); }
.table thead tr + tr th { font-size: 13.5px; }
.hits { margin: 0; padding: 0; list-style: none; }
.hits li + li { margin-top: 3px; }
.hit-pos { display: inline-block; min-width: 38px; font-weight: 700; color: var(--ink-2); font-size: 13.5px; }
.err { color: var(--pen); margin-top: 4px; }
.manual-list { border: 1px solid var(--line-soft); border-radius: var(--radius); }
.manual-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 200px; gap: 14px; align-items: center; padding: 12px 14px; }
.manual-row + .manual-row { border-top: 1px solid var(--line-soft); }
.manual-row .hint { display: block; font-size: 13px; color: var(--ink-2); }
.manual-input { display: block; }
.manual-input > span { display: block; margin-bottom: 3px; }

/* 홈 */
.start { display: block; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; border-top: 4px solid var(--indigo); }
.start:hover { border-color: var(--indigo); background: var(--indigo-wash); }
.start b { display: block; font-size: 17px; }
.start span { color: var(--ink-2); font-size: 14px; }
.notice { border-left: 4px solid var(--pen); background: #fff; padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; white-space: pre-wrap; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; font-weight: 600; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* 로그인 · 막힘 */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.bare-main { width: 100%; max-width: 400px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; border-top: 5px solid var(--pen); }
.login-title { font-size: 22px; font-weight: 800; }

/* 좁은 화면 */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 250px; transform: translateX(-100%); box-shadow: 0 0 0 9999px rgba(27, 36, 48, 0); }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 9999px rgba(27, 36, 48, 0.4); }
  .menu-btn { display: inline-flex; }
  .meter { margin-right: 0; }
  .top { padding: 10px 14px; flex-wrap: wrap; justify-content: flex-start; }
  .main { padding: 18px 14px; }
  .cols, .grid-2, .manual-row { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: no-preference) {
  .side { transition: transform 0.18s ease; }
}
@media print { .side, .top { display: none; } .shell { display: block; } }
