/* techsupport 공통 스타일 — 수작업 CSS, 외부 자원 없음 (SPEC §2.2)
   방향: 엔지니어 한 명이 케이스를 빠르게 훑는 업무 콘솔.
   - 틀: PC는 왼쪽 남색 사이드바, 휴대폰은 위쪽 띠. 내용 면은 차분한 회청색.
   - 색은 "상태"에만 쓴다 (진행 중·해결·임시 조치·에스컬레이션·미해결 종료). 조치 버튼은 파랑 하나.
   - 버튼은 4종: 주(채움) · 보조(흰 바탕+테두리) · 투명(취소·초기화) · 위험(삭제). 표 안은 작은 버튼.
   - 고정폭 글꼴은 복사해서 쓰는 식별자(케이스 번호·에러 코드·로그)에만. */

:root {
    --bg: #eef2f6;
    --surface: #ffffff;
    --surface-2: #f5f8fb;
    --text: #15202b;
    --muted: #5b6878;
    --line: #dbe2ea;
    --line-strong: #c5cfda;
    --band: #13293d;
    --band-2: #1b3550;
    --band-text: #e4ecf4;
    --band-muted: #9db1c5;
    --primary: #1c64b8;
    --primary-hover: #17559d;
    --primary-soft: #e6effa;
    --primary-text: #ffffff;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --warn: #9a5b00;
    --st-open: #1c64b8;
    --st-resolved: #1a7f4b;
    --st-workaround: #b06a00;
    --st-escalated: #c0392b;
    --st-closed: #7b8794;
    --r-sm: 8px;
    --r-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(19, 41, 61, .06);
    --shadow: 0 1px 2px rgba(19, 41, 61, .05), 0 4px 16px rgba(19, 41, 61, .06);
    --font: system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace;
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237b8794' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1319;
        --surface: #151c24;
        --surface-2: #1a222c;
        --text: #e3e9f0;
        --muted: #95a3b3;
        --line: #26303b;
        --line-strong: #33404d;
        --band: #0a1622;
        --band-2: #12263a;
        --primary: #5aa2f0;
        --primary-hover: #7bb5f3;
        --primary-soft: #16304b;
        --primary-text: #0b1a28;
        --danger: #f08b80;
        --danger-soft: #3a1c1a;
        --warn: #e0a23a;
        --st-open: #5aa2f0;
        --st-resolved: #4cc38a;
        --st-workaround: #e0a23a;
        --st-escalated: #f08b80;
        --st-closed: #8e9aa8;
        --shadow-sm: none;
        --shadow: none;
    }
}

/* ── 기본 ── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
    font-size: 15px; line-height: 1.6;
    /* 한국어는 단어 단위로 줄바꿈. 넘치는 긴 단어만 끊는다 (anywhere는 표 칸을 한 글자 폭까지 줄여 버리므로 전체에 쓰지 않는다) */
    word-break: keep-all; overflow-wrap: break-word;
}
a { color: var(--primary); text-underline-offset: 3px; }
h1 { font-size: 23px; line-height: 1.35; margin: 0 0 18px; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: 16px; line-height: 1.4; margin: 0 0 12px; letter-spacing: -0.015em; font-weight: 700; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
code, .code { font-family: var(--mono); font-size: .9em; }
.icon { width: 18px; height: 18px; flex: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── 틀: 사이드바(PC) / 위쪽 띠(휴대폰) ── */
.topbar { background: var(--band); color: var(--band-text); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; color: var(--band-text); text-decoration: none; margin: 0; }
.brand-mark { width: 26px; height: 26px; color: #7fb8f5; }
.nav { display: flex; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--band-muted); text-decoration: none; font-size: 15px; border-radius: var(--r-sm); transition: background .15s, color .15s; }
.nav a:hover { color: var(--band-text); background: var(--band-2); }
.nav a.active { color: #fff; background: var(--band-2); font-weight: 700; }
.nav a.active .icon { color: #7fb8f5; }
.logout { margin: 0; }
.logout button { background: transparent; color: var(--band-muted); border: 0; box-shadow: none; padding: 8px 12px; font-weight: 500; }
.logout button:hover { color: var(--band-text); background: var(--band-2); }
/* width:100% — 격자 칸에 margin:auto만 있으면 내용 폭으로 줄어들어 가운데로 몰린다 */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 28px 80px; min-width: 0; }

@media (min-width: 960px) {
    body.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
    .topbar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; gap: 22px; }
    .brand { padding: 0 8px; }
    .nav { flex-direction: column; flex: 1; }
    .nav a { padding: 10px 12px; }
    .logout button { width: 100%; justify-content: flex-start; }
}
@media (max-width: 959.98px) {
    .topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 16px 0; gap: 6px 12px; }
    /* 휴대폰: 메뉴 5개를 아이콘 위·글자 아래 탭으로 — 한 화면에 모두 보이게 */
    .nav { order: 3; flex-basis: 100%; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; margin: 0 -8px; padding: 0 4px 6px; }
    .nav a { flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: 12px; white-space: nowrap; }
    .nav .icon { width: 20px; height: 20px; }
    .logout button span { display: none; }
    .container { padding: 20px 16px 80px; }
}

/* ── 버튼 ── */
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 15px;
    font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap;
    color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, color .15s;
}
button:hover, .button:hover { background: var(--surface-2); border-color: var(--muted); }
button .icon, .button .icon { width: 16px; height: 16px; }
button.primary, .button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover, .button.ghost:hover { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
button.danger, .button.danger { color: var(--danger); }
button.danger:hover, .button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
button.sm, .button.sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
button:disabled { opacity: .6; cursor: default; }

/* ── 입력 ── */
.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-size: 13px; font-weight: 600; color: var(--muted); }
input, select, textarea {
    width: 100%; min-width: 0; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 15px; color: var(--text);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 0; height: 18px; padding: 0; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; color: var(--text); font-weight: 500; font-size: 14px; cursor: pointer; }
.check input { margin: 0; }
.error { color: var(--danger); font-size: 13px; margin: 0; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

/* ── 로그인 화면 ── */
body.guest { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--band);
             background-image: radial-gradient(circle at 20% 15%, #1f4466 0, transparent 45%), radial-gradient(circle at 85% 90%, #17344f 0, transparent 40%); }
.guest-card { width: 100%; max-width: 390px; background: var(--surface); border-radius: 18px; padding: 30px 28px 26px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.guest-card .brand { color: var(--text); font-size: 20px; margin: 0; }
.guest-card .brand-mark { color: var(--primary); width: 30px; height: 30px; }
.guest-sub { color: var(--muted); font-size: 13.5px; margin: 4px 0 22px; }
.guest-card .primary { margin-top: 10px; width: 100%; min-height: 44px; font-size: 15px; }
.consent-title { font-size: 19px; margin: 0 0 8px; }
.consent-box { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.consent-box dt { color: var(--muted); font-size: 13px; }
.consent-box dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guest-card .consent-actions button { width: 100%; min-height: 44px; margin: 0; }

/* ── 페이지 머리 ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1, .page-head h2 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lead { font-size: 18px; font-weight: 600; line-height: 1.5; margin: -6px 0 18px; }
.muted { color: var(--muted); }
.flush { margin: 0; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.flash { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--st-resolved);
         border-radius: var(--r-sm); padding: 12px 16px; margin: 0 0 20px; box-shadow: var(--shadow-sm); }
.flash.warn { border-left-color: var(--warn); display: block; }
.flash p { margin: 0; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }

/* ── 카드·구역 ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); min-width: 0; }
.card > .page-head { margin-bottom: 14px; }
details.card > summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; }
details.card[open] > summary::before { transform: rotate(45deg); }
details.card[open] > summary { margin-bottom: 16px; }
.section-gap { margin-top: 20px; }

/* 내용 구역: 무엇에 관한 글인지 왼쪽 선 색으로 구분 */
.note { border-left: 4px solid var(--line); }
.note.symptom { border-left-color: var(--st-escalated); }
.note.diagnosis { border-left-color: var(--st-workaround); }
.note.resolution { border-left-color: var(--st-resolved); }
.note.workaround { border-left-color: var(--st-open); }

/* ── 폼 배치 ── */
fieldset { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px 22px; margin: 0 0 18px; min-width: 0; background: var(--surface); box-shadow: var(--shadow); }
/* 구역 제목은 테두리 위가 아니라 칸 안의 제목으로 (float로 일반 요소가 되게 — 두 줄이 돼도 선에 걸치지 않음) */
legend { float: left; width: 100%; grid-column: 1 / -1; padding: 0; margin: 0 0 2px; color: var(--text); font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; }
legend .muted { font-weight: 400; font-size: 13px; margin-left: 6px; }
fieldset > legend + * { clear: both; }
fieldset.new-entity { border-left: 4px solid var(--warn); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field .hint { margin: 0; }
textarea { min-height: 84px; resize: vertical; line-height: 1.6; padding-top: 10px; }
.form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center;
    padding: 14px 0; margin-top: 4px; background: var(--bg); border-top: 1px solid var(--line);
}
.form-actions .primary { min-width: 96px; }
.mono, pre.mono { font-family: var(--mono); font-size: 13px; }
pre.mono { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 14px 16px; line-height: 1.6; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding: 16px 20px;
               border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--muted); font-size: 14px; }

/* 필터 줄 */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.filters.flush { padding: 0; border: 0; background: transparent; margin: 0; }
.card .filters { padding: 0; border: 0; background: transparent; }
.filters .field { min-width: 150px; flex: 0 1 200px; }
.filters .field.grow, .grow { flex: 1 1 320px; }
.note-input { flex: 0 1 160px; }

/* ── 정의 목록 (상세 정보) ── */
dl.meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 20px; margin: 0; }
dl.meta dt { color: var(--muted); font-size: 13px; font-weight: 600; padding-top: 2px; white-space: nowrap; }
dl.meta dd { margin: 0; min-width: 0; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 36px; }

/* ── 배지·칩 ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
         color: var(--st-closed); background: color-mix(in srgb, currentColor 12%, transparent); white-space: nowrap; vertical-align: middle; line-height: 1.6; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.open, .badge.status-open { color: var(--st-open); }
.badge.status-resolved { color: var(--st-resolved); }
.badge.status-workaround { color: var(--st-workaround); }
.badge.status-escalated { color: var(--st-escalated); }
.badge.status-closed_unresolved { color: var(--st-closed); }

/* 목록에서 바로 바꾸는 상태 — 배지 모양의 선택 상자 */
select.status-select { width: auto; min-height: 30px; padding: 3px 28px 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
                       color: var(--st-closed); background-color: color-mix(in srgb, currentColor 12%, var(--surface));
                       border-color: color-mix(in srgb, currentColor 30%, transparent); background-position: right 8px center; background-size: 14px; }
select.status-select.status-open { color: var(--st-open); }
select.status-select.status-resolved { color: var(--st-resolved); }
select.status-select.status-workaround { color: var(--st-workaround); }
select.status-select.status-escalated { color: var(--st-escalated); }
select.status-select option { color: var(--text); background: var(--surface); font-weight: 400; }
select.status-select.htmx-request { opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 12.5px; padding: 2px 9px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow-wrap: anywhere; }
.chip.word { font-family: var(--font); font-size: 13px; }
.case-no { font-family: var(--mono); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

/* ── 대시보드 ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
    position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s;
}
a.stat:hover { border-color: var(--primary); }
.stat .icon { width: 22px; height: 22px; color: var(--muted); margin-bottom: 6px; }
.stat .num { font-size: 32px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat.focus { background: var(--band); border-color: var(--band); color: #fff; }
.stat.focus .icon { color: #7fb8f5; }
.stat.focus .label { color: var(--band-muted); }

/* 상태 분포 막대 — 이 화면에서 가장 눈에 띄는 한 가지 */
.dist { margin: 4px 0 2px; }
.dist svg { display: block; width: 100%; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.dist .seg-open { fill: var(--st-open); }
.dist .seg-resolved { fill: var(--st-resolved); }
.dist .seg-workaround { fill: var(--st-workaround); }
.dist .seg-escalated { fill: var(--st-escalated); }
.dist .seg-closed_unresolved { fill: var(--st-closed); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.legend-row li { display: inline-flex; align-items: center; gap: 6px; }
.legend-row .dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-row b { font-variant-numeric: tabular-nums; }
.dot.st-open { background: var(--st-open); } .dot.st-resolved { background: var(--st-resolved); } .dot.st-workaround { background: var(--st-workaround); }
.dot.st-escalated { background: var(--st-escalated); } .dot.st-closed_unresolved { background: var(--st-closed); }

/* ── 표 ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.card .table-wrap { border-radius: var(--r-sm); box-shadow: none; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; padding-top: 10px; padding-bottom: 10px; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data td.num { text-align: right; white-space: nowrap; }
table.data th.num { text-align: right; }
table.data td.act { text-align: right; white-space: nowrap; width: 1%; }
table.data a { text-decoration: none; }
table.data a:hover { text-decoration: underline; }
table.data .title-cell { min-width: 220px; }
@media (min-width: 641px) { table.cases-table .title-cell { width: 55%; min-width: 280px; } }   /* 케이스 목록은 제목에 자리를 몰아 준다 (휴대폰은 카드 모양) */
table.data .title-cell a { font-weight: 600; color: var(--text); }
table.data .title-cell a:hover { color: var(--primary); }
table.data .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
table.data .button { text-decoration: none; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

.pager { display: flex; gap: 8px; margin-top: 14px; }

/* KB 신뢰도 (1~5) */
.conf { color: var(--primary); font-size: 11px; letter-spacing: 2px; white-space: nowrap; }
.conf .off { color: var(--line-strong); }

/* 설정 — 동의어 목록: 한 줄에 동의어·메모·저장·삭제 */
.syn-list { list-style: none; margin: 0; padding: 0; }
.syn-list li { border-top: 1px solid var(--line); padding: 10px 0; }
.syn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.syn-row .grow { flex: 1 1 360px; }
.syn-row .note-input { flex: 0 1 180px; }

/* ── 설정: claude.ai 연결 ── */
.mcp-clients { list-style: none; margin: 0 0 14px; padding: 0; }
.mcp-clients li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }

/* ── 검토 대기열 ── */
.nav a { position: relative; }
.nav-badge { position: absolute; top: 2px; right: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.review-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.review-rows li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.review-rows a { overflow-wrap: anywhere; }
.review-rows .choice { display: flex; gap: 12px; margin-left: auto; }

/* ── 검색 ── */
.search-quick { display: flex; gap: 10px; align-items: center; }
.search-quick input { flex: 1; }
.search-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 18px; align-items: start; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.results li { min-width: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.results li:last-child { padding-bottom: 0; border-bottom: 0; }
.result-title { font-weight: 700; text-decoration: none; }
.result-meta, .matched { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.result-text { margin: 6px 0 0; font-size: 14px; }
.chip.syn { border-style: dashed; }

/* ── 휴대폰 ── */
@media (max-width: 640px) {
    h1 { font-size: 21px; }
    .card, fieldset { padding: 16px; }
    dl.meta { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    dl.meta dd { margin-bottom: 10px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 14px 16px; }
    .stat .num { font-size: 26px; }
    .filters .field { flex: 1 1 140px; min-width: 0; }
    .syn-row .grow, .syn-row .note-input { flex-basis: 100%; }

    /* 표는 행마다 카드처럼 세로로 쌓는다 — 칸이 좁아 글자가 쪼개지지 않게 */
    table.stack-mobile thead { display: none; }
    table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display: block; width: 100%; }
    table.stack-mobile tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    table.stack-mobile tbody tr:last-child { border-bottom: 0; }
    table.stack-mobile td { border: 0; padding: 2px 0; white-space: normal; text-align: left; }
    table.stack-mobile td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 64px; margin-right: 8px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
    table.stack-mobile td.title-cell { min-width: 0; font-size: 15.5px; margin: 2px 0 6px; }
    table.stack-mobile td.title-cell::before { display: none; }
    table.stack-mobile td.act { width: auto; text-align: left; margin-top: 8px; }
    table.stack-mobile tbody tr:hover td { background: transparent; }
    .table-wrap { overflow-x: visible; }
}

/* 로그 올리기·보기 (2C) */
.log-item { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.log-item:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.log-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.copy-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.log-head ~ details { margin: 8px 0 10px; }
.copy-line code { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px 10px; }
pre.log-preview { max-height: 60vh; overflow: auto; white-space: pre; overflow-wrap: normal; }
pre.log-preview .ln { display: inline-block; min-width: 5ch; margin-right: 10px; text-align: right; color: var(--muted); user-select: none; }
mark.mask { background: var(--primary-soft); color: var(--primary-text); border-radius: 3px; padding: 0 2px; }
.cand-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.cand-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cand-list select { width: auto; }
.log-queue { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.log-queue li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 14px; overflow-wrap: anywhere; }
.log-group { border-top: 1px solid var(--line); }
.log-group:first-of-type { border-top: 0; }
.log-group > summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 0; cursor: pointer; }
.log-group-title { font-weight: 600; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.log-group .table-wrap { margin-bottom: 12px; }
.log-group > summary { list-style: none; }
.log-group > summary::-webkit-details-marker { display: none; }
.log-group > summary::before { content: "▸"; color: var(--muted); }
.log-group[open] > summary::before { content: "▾"; }
