/* 키오스크 현황판 — 디자인 토큰·클래스 (mockup-01/02/04 기준, 사내망 전용: 외부 CDN 미사용) */

:root {
    --surface-0: #f4f3ef;
    --surface-1: #faf9f5;
    --surface-2: #ffffff;
    --border: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.22);
    --border-stronger: rgba(0, 0, 0, 0.35);
    --text-primary: #1a1a17;
    --text-secondary: #5f5e5a;
    --text-muted: #8a8983;
    --radius: 8px;
    --bg-accent: #E6F1FB;
    --border-accent: #378ADD;
    --text-accent: #185FA5;
    --bg-danger: #FCEBEB;
    --border-danger: #E24B4A;
    --text-danger: #A32D2D;
    --bg-success: #EAF3DE;
    --text-success: #3B6D11;
    --status-ok: #639922;
    --status-warn: #EF9F27;
    --status-danger: #E24B4A;
    --fill-primary: #1a1a17;
    --on-primary: #ffffff;
}

/* 다크 모드 — :root 토큰 재정의 (add-dark-mode). data-theme=dark는 App.razor 스크립트가 <html>에 설정.
   :root와 동일 특이도라 소스 순서상 뒤에 와서 속성 존재 시 우선. 따뜻한 다크 그레이 기반. */
[data-theme="dark"] {
    --surface-0: #1a1917;   /* 페이지 배경(가장 어두움) */
    --surface-1: #222120;   /* 트랙·미묘한 채움 */
    --surface-2: #2a2926;   /* 카드·상단바(살짝 밝음) */
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.24);
    --border-stronger: rgba(255, 255, 255, 0.40);
    --text-primary: #f0efe9;
    --text-secondary: #b0aea6;
    --text-muted: #837f76;
    --bg-accent: #14304a;
    --border-accent: #4A9BEE;
    --text-accent: #8FC2F5;
    --bg-danger: #3a1e1e;
    --border-danger: #E4655F;
    --text-danger: #F0A6A2;
    --bg-success: #23301a;
    --text-success: #A9CE86;
    --status-ok: #7DB33A;    /* 다크 배경 대비로 약간 밝게 */
    --status-warn: #F0A63A;
    --status-danger: #E4655F;
    --fill-primary: #f0efe9; /* 다크에선 밝은 채움 + 어두운 글자로 반전 */
    --on-primary: #1a1917;
}
/* 다크에서 조정 필요한 하드코딩 색 */
[data-theme="dark"] .banner-popup { background: #3a2f16; color: #f0c86a; }
[data-theme="dark"] .err-row-sel.err-row-fatal:hover { background: #4a2626; }
[data-theme="dark"] .cl-tag { color: var(--surface-0); } /* 밝아진 회색 배지 위 글자를 어둡게 */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: 'Segoe UI', 'Malgun Gothic', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--surface-2); /* 라이트=#fff 동일, 다크=카드색 (add-dark-mode) */
    font-size: 14px;
}

/* ── 레이아웃 ── */
.topbar {
    padding: 8px 24px;
    border-bottom: 0.5px solid var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-spacer { flex: 1; }
/* 다크/라이트 토글 (add-dark-mode) — 아이콘 2개 중 테마에 맞는 것만 표시 */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0.5px solid var(--border); border-radius: 6px; cursor: pointer; padding: 5px 8px; color: var(--text-secondary); margin-right: 10px; }
.theme-toggle:hover { border-color: var(--border-strong); background: var(--surface-1); }
.theme-toggle .ico-sun { display: none; }
[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px; }
.wrap-full { padding: 10px 24px; } /* 월보드 — 전폭 사용 (list-one-screen-board) */
.page-narrow { max-width: 1100px; margin: 0 auto; } /* 상세 페이지는 읽기 폭 유지 */
.page { background: var(--surface-0); border-radius: 12px; padding: 0.5rem; }

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

/* ── 상단 툴바 — 요약 칩 + 상태등 범례 + 갱신 카운트다운 (한 줄) ── */
.toolbar { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .spacer { flex: 1; }
.tb-right { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; flex: 1; }
.tb-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter.static { cursor: default; }
/* 정렬 드롭다운 — 필터 칩과 같은 톤 */
.sort-select { font-size: 14px; font-family: inherit; padding: 6px 8px; border-radius: var(--radius); background: var(--surface-2); border: 0.5px solid var(--border); color: var(--text-secondary); cursor: pointer; outline: none; }
.sort-select:hover { border-color: var(--border-strong); }
/* 상태등 범례 — 카드와 같은 4칸 막대 + 칸별 설명 (툴바 왼쪽) */
.light-legend {width: 310px; display: inline-flex; gap: 8px; align-items: stretch; padding: 5px 9px; border: 0.5px solid var(--border); border-radius: 8px; background: var(--surface-2); height: 85px; }
/* 카드 읽는 법 범례 — 실제 카드 마크업 재사용 예시 + 번호 설명 */
/* 카드 읽는 법 — 예시 카드(박스 없이 실물 그대로)와 설명 박스(색상 가이드와 동일 스타일) 독립 배치 */
.cl-sample-wrap { display: inline-flex; align-items: center; height: 85px; margin-left: 0px; }
.cl-sample { width: 215px; height: 85px; pointer-events: none; flex: none; display: flex; position: relative; } /* 범례 박스들과 높이 통일 */
.cl-tag { position: absolute; top: -8px; left: 8px; font-size: 10px; font-weight: 600; background: var(--text-secondary); color: #fff; border-radius: 5px; padding: 1px 7px; line-height: 1.4; } /* 실제 카드 오인 방지 — 예시 표시 (좌상단) */
.cl-sample .card-body { flex: 1; }
.cl-desc { width: 215px; margin-left: 0px; }
.cl-desc .ll-rows > div { white-space: nowrap; } /* 설명 줄바꿈 방지 */
.toolbar > .light-legend, .toolbar > .cl-sample-wrap { align-self: flex-start; } /* 툴바 stretch에 안 늘어나게 */
.ll-bar { display: flex; flex-direction: column; gap: 3px; width: 9px; flex: none; }
.ll-bar span { flex: 1; border-radius: 2px; }
.ll-rows { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; font-size: 11px; }
.ll-rows > div { display: flex; align-items: center; line-height: 1.2; }
.ll-rows b { font-weight: 500; width: 68px; flex: none; }
.ll-sub { color: var(--text-secondary); }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.t-accent { color: var(--text-accent); }

.top5 { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 14px; }
.top5-title { font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.top5-sub { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.top5-row { display: flex; gap: 12px; padding: 5px 4px; font-size: 13px; cursor: pointer; border-bottom: 0.5px solid var(--border); align-items: baseline; border-radius: 4px; }
.top5-row:last-child { border-bottom: none; }
.top5-row:hover { background: var(--surface-1); }
.top5-rank { color: var(--text-muted); width: 14px; }
.top5-name { font-weight: 500; min-width: 110px; }
.top5-count { color: var(--text-danger); min-width: 40px; }
.top5-last { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 전역 최근 에러 피드 (add-error-feed) ── */
.feed-row { display: flex; gap: 12px; padding: 5px 4px; font-size: 13px; cursor: pointer; border-bottom: 0.5px solid var(--border); align-items: baseline; border-radius: 4px; }
.feed-row:last-child { border-bottom: none; }
.feed-row:hover { background: var(--surface-1); }
.feed-kiosk { font-weight: 500; min-width: 110px; white-space: nowrap; }

/* ── 검색/필터 ── */
.search-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.search-box {
    flex: 1; display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 0.5px solid var(--border);
    border-radius: var(--radius); padding: 6px 12px;
}
.search-box input {
    flex: 1; font-size: 14px; border: none; outline: none;
    background: transparent; color: var(--text-primary); padding: 2px 0;
}
.refresh-note { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.filter-row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.filter {
    font-size: 14px; padding: 7px 14px; border-radius: var(--radius); cursor: pointer;
    background: var(--surface-2); border: 0.5px solid var(--border); color: var(--text-secondary);
}
.filter.on { background: var(--fill-primary); color: var(--on-primary); border-color: var(--fill-primary); }
.filter.d.on { background: var(--text-danger); border-color: var(--text-danger); }

/* ── 멀티 뷰 (add-multi-view) ── */
.btn-primary { background: var(--fill-primary); color: var(--on-primary); border-color: var(--fill-primary); }
.btn-primary:hover { background: var(--fill-primary); opacity: 0.9; }
/* 다중 선택 모드 — 카드 전체 강조(오버레이 아이콘 없음, 썸네일 안 가림) */
/* .card / .card-err 기본 규칙을 확실히 이기도록 2-클래스 선택자로 우선순위 상향 */
.card.card-selectable:hover { border-color: var(--border-accent); }
.card.card-selected { border: 2px solid var(--border-accent); background: var(--bg-accent); }
.card-maxed { opacity: 0.5; cursor: not-allowed; }
.tb-gap { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; flex: none; }

/* 다중 선택 토글 — 텍스트 고정("다중 선택") + 체크박스 모양만 켜짐/꺼짐 */
.chk-chip { display: inline-flex; align-items: center; }
.chk { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--border-strong); border-radius: 3px; position: relative; margin-right: 7px; box-sizing: border-box; }
.chk.on { background: var(--fill-primary); border-color: var(--fill-primary); }
.chk.on::after { content: ''; position: absolute; left: 4px; top: 1px; width: 3px; height: 6px; border: solid var(--on-primary); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* 모아 보기/해제 — 다중 선택 켜지면 오른쪽으로 펼쳐지고, 끄면 왼쪽으로 접힘 */
.multi-actions { display: inline-flex; align-items: center; gap: 6px; max-width: 0; overflow: hidden; opacity: 0; transition: max-width 0.25s ease, opacity 0.25s ease; }
.multi-actions.open { max-width: 320px; opacity: 1; }
.multi-actions:not(.open) { pointer-events: none; } /* margin 스냅 제거 — 열기/닫기 대칭 */
/* 접힐 때 버튼이 폭 0으로 짓눌려 글자가 세로 줄바꿈 → 높이 폭발하는 것 방지: 원래 크기 유지하고 가로로만 클립 */
.multi-actions > .btn { flex: 0 0 auto; white-space: nowrap; }
.multi-grid { display: grid; gap: 12px; }
.panel-drag.drop-hint { outline: 2px dashed var(--border-accent); outline-offset: 2px; border-radius: 12px; } /* 드래그 재배치 드롭 대상 표시 */
.multi-cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multi-rows { grid-template-columns: 1fr; }
.panel { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 0.7rem 0.9rem; }
/* 멀티 뷰 — 8개가 1080 한 화면에 들어오되 타일은 너무 작지 않게 (상세 페이지 타일은 그대로) */
.panel .panel-head { margin-bottom: 6px; }
.panel .banner { margin-bottom: 8px; padding: 6px 10px; }
.panel .lane-window { padding: 4px; margin-top: 0 !important; }
.panel .tile-img { width: 50px; height: 90px; }
.panel .tile-name { font-size: 11px; max-width: 82px; min-height: 28px; align-items: flex-start; } /* 항상 2줄 확보 → 이름 줄바꿈 유무와 무관하게 패널 높이 통일 */
.panel .arw-lg { font-size: 22px; padding-bottom: 18px; }
.panel-clickable { cursor: pointer; transition: box-shadow 0.12s ease, border-color 0.12s ease; }
.panel-clickable:hover { border-color: var(--border-accent); box-shadow: 0 0 0 1.5px var(--border-accent), 0 3px 10px rgba(0, 0, 0, 0.1); }
.panel-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head .spacer { flex: 1; }
.panel-name { font-size: 15px; font-weight: 500; }
/* 멀티 뷰 흐름 창 — 한 줄 고정(넘치면 잘림), 현재 화면 중심. 뒤에 오는 .lane을 이기려고 2클래스 */
.lane.lane-window { flex-wrap: nowrap; overflow: hidden; }
/* 창 양끝 오버플로 표시 — 숨은 화면이 이쪽에 N칸 더 있음을 알리는 칩 */
.win-more {
    flex: none; align-self: stretch;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    min-width: 30px; padding: 0 8px;
    border: 1px dashed var(--border); border-radius: 8px;
    background: var(--surface-1); color: var(--text-secondary);
    cursor: default;
}
.win-more .win-chev { font-size: 24px; line-height: 1; font-weight: 300; }
.win-more .win-cnt { font-size: 10px; line-height: 1; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

/* ── 카드 그리드 ── */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* 월보드 밀도 — 기본 10열, 좁은 화면은 구간별로 열 수 축소 (list-one-screen-board) */
.cards-grid.board { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1599px) { .cards-grid.board { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 1199px) { .cards-grid.board { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 899px)  { .cards-grid.board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 599px)  { .cards-grid.board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.board .card { padding: 0.38rem 0.55rem; border-radius: 8px; }
.board .card-info { gap: 2px; }
.board .card-name, .board .card-screen, .board .card-stock { line-height: 1.2; }
.board .badge { font-size: 11px; padding: 1px 7px; }
.board-min { min-width: 527px;}

/* 상태등 — 카드 좌측 세로 4칸, 줄별 의미 고정: ①동작 ②카드 ③리본 ④에러 (회색=데이터 없음) */
.card-lights { display: flex; flex-direction: column; gap: 3px; width: 7px; align-self: stretch; flex-shrink: 0; }
.light { flex: 1; border-radius: 2px; background: var(--surface-1); border: 0.5px solid var(--border); }
.light.on { border-color: transparent; }
.lt-green.on { background: var(--status-ok); }
.lt-orange.on { background: var(--status-warn); }
.lt-red.on { background: var(--status-danger); }

/* 카드 v2: 좌측 이름·현재화면·상태, 우측 현재 화면 썸네일 (사용자 요청 2026-07-13) */
.card-body { display: flex; gap: 8px; justify-content: space-between; align-items: stretch; }
.card-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; } /* flex:1 — 남는 카드 폭을 텍스트가 흡수(고해상도에서 색깔바↔텍스트 간격 벌어짐 방지) */
/* font-size는 아래 기본 .card-name(15px)이 적용됨 — 여기선 말줄임만 담당 */
.card-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-screen { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-stock { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-status { margin-top: auto; }
.card-thumb img, .card-thumb-ph {
    width: 36px; height: 64px; object-fit: cover; object-position: top;
    border-radius: 4px; border: 0.5px solid var(--border); display: block;
}
.card-thumb-ph { background: var(--surface-1); }
.card {
    background: var(--surface-2); border: 0.5px solid var(--border);
    border-radius: 12px; padding: 0.9rem 1rem; cursor: pointer;
    position: relative; /* .card-check 앵커 */
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
.card-err { border-color: var(--border-danger); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.card-name { font-size: 15px; font-weight: 500; }
.card-lines { font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 3px; }

/* ── 배지 ── */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.badge.ok { background: var(--bg-success); color: var(--text-success); }
.badge.err { background: var(--bg-danger); color: var(--text-danger); }
.badge.off { background: var(--surface-1); border: 0.5px solid var(--border); color: var(--text-muted); }
.cnt { font-size: 11px; padding: 0 5px; border-radius: 99px; background: var(--bg-danger); color: var(--text-danger); }

/* ── 상세 헤더 ── */
.detail-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
/* 상세: 헤더는 전체 너비, 그 아래 2컬럼(왼쪽 통계+흐름 / 오른쪽 최근 에러 — 같은 높이) */
.detail-page { min-width: 510px; max-width: 1680px; margin: 0 auto; }
.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; }
.detail-main { min-width: 0; }
.detail-main > .sect:last-child { margin-bottom: 0; }
@media (max-width: 1000px) { .detail-body { grid-template-columns: 1fr; } }
.detail-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-name { font-size: 17px; font-weight: 500; }

.btn {
    font-size: 12px; color: var(--text-secondary); border: 0.5px solid var(--border-strong);
    border-radius: 6px; padding: 3px 10px; cursor: pointer; background: var(--surface-2);
}
.btn:hover { background: var(--surface-1); }

.seg-group { display: flex; gap: 3px; background: var(--surface-2); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 3px; }
.seg { font-size: 12px; padding: 3px 10px; border-radius: 6px; color: var(--text-secondary); cursor: pointer; }
.seg.on { background: var(--fill-primary); color: var(--on-primary); }

/* ── 스탯 카드 ── */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.stat-card { background: var(--surface-1); border-radius: var(--radius); padding: 0.75rem 1rem; }
.stat-label { font-size: 12px; color: var(--text-muted); margin: 0 0 2px; }
.stat-value { font-size: 21px; font-weight: 500; margin: 0; }
.stat-value.small { font-size: 15px; margin-top: 3px; }
.stat-sub { font-size: 12px; color: var(--text-secondary); font-weight: 400; }
.t-danger { color: var(--text-danger); }

/* ── 섹션 카드 ── */
.sect { background: var(--surface-2); border: 0.5px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 12px; }
.sect-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sect-title { font-size: 14px; font-weight: 500; }

/* ── 배너 ── */
.banner { display: flex; align-items: center; gap: 8px; border-radius: var(--radius); padding: 7px 12px; margin-bottom: 12px; font-size: 13px; }
.banner-cur { background: var(--bg-accent); color: var(--text-accent); }
.banner-idle { background: var(--surface-1); color: var(--text-secondary); }
.banner-off { background: var(--surface-1); border: 0.5px solid var(--border); color: var(--text-muted); }
.banner-warn { background: var(--bg-danger); color: var(--text-danger); }
.banner-popup { background: #FAEEDA; color: #854F0B; }
.ver-chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-1); color: var(--text-secondary); border: 0.5px solid var(--border); white-space: nowrap; }
/* 현재 사용 언어 (add-language-tracking) — 외국어 사용 중이면 파랑 강조 */
.lang-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-1); color: var(--text-secondary); border: 0.5px solid var(--border); white-space: nowrap; }
.lang-chip.lang-foreign { background: var(--bg-accent); color: var(--text-accent); border-color: var(--border-accent); }
.err-lang { flex: none; font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 5px; background: var(--bg-accent); color: var(--text-accent); white-space: nowrap; }
.banner-popup .pop-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--status-warn); margin-right: 4px; }

/* ── View 맵 레인 ── */
.lane-label { font-size: 12px; color: var(--text-muted); margin: 10px 0 5px; display: flex; align-items: center; gap: 10px; }
.lane-label.on { color: var(--text-accent); }
.lane-label .fold { cursor: pointer; color: var(--text-muted); font-size: 11px; }
.lane { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; padding: 8px; background: var(--surface-1); border-radius: var(--radius); }
.lane-dim { opacity: 0.72; }

.chip {
    font-size: 12px; padding: 4px 8px; border-radius: 6px;
    background: var(--surface-2); border: 0.5px solid var(--border);
    display: inline-flex; align-items: center; gap: 4px;
}
.chip-err { border-color: var(--border-danger); }
.chip-cur { background: var(--bg-accent); border: 2px solid var(--border-accent); color: var(--text-accent); font-weight: 500; }
.chip-start { background: var(--surface-1); color: var(--text-secondary); }
.arw { font-size: 11px; color: var(--text-muted); }
.arw-lg { font-size: 26px; color: var(--text-secondary); line-height: 1; margin: 0 1px; padding-bottom: 20px; } /* 타일 레인용 — 이미지 높이 중앙쯤에 오도록 */

/* ── 화면 썸네일 타일 (add-screen-images — 세로형 54×96, 키오스크 9:16) ── */
.screen-tile {
    display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 5px; border-radius: 6px;
    background: var(--surface-2); border: 0.5px solid var(--border);
}
.tile-err { border-color: var(--border-danger); }
/* 현재 진행 화면 — 살아있는 화면임을 한눈에: 맥동하는 파란 헤일로 (창 overflow:hidden에 안 잘리게 3px 이내) */
@keyframes tile-cur-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(55, 138, 221, 1); }
    50%      { box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.4); }
}
.tile-cur {
    background: var(--bg-accent); border-color: var(--border-accent); /* 폭은 기본 0.5px 유지 → 레이아웃 중립, 강조는 아래 헤일로가 담당 */
    animation: tile-cur-pulse 1.4s ease-in-out infinite;
}
.tile-cur .tile-name { color: var(--text-accent); font-weight: 500; }
@media (prefers-reduced-motion: reduce) {
    .tile-cur { animation: none; box-shadow: 0 0 0 3px rgba(55, 138, 221, 0.7); }
}
.tile-img {
    width: 54px; height: 96px; object-fit: cover; object-position: top;
    border-radius: 4px; display: block; border: 0.5px solid var(--border);
}
.tile-ph { display: flex; align-items: center; justify-content: center; background: var(--surface-1); color: var(--text-muted); font-size: 9px; }
.tile-name { font-size: 11px; color: var(--text-primary); display: inline-flex; gap: 3px; align-items: center; max-width: 92px; text-align: center; line-height: 1.25; }

.popuprow { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 0 0 12px 18px; }
.popuprow-label { font-size: 11px; color: var(--text-muted); }
.pop {
    font-size: 12px; padding: 3px 8px; border-radius: 6px;
    border: 1px dashed var(--border-strong); color: var(--text-muted);
    display: inline-flex; gap: 4px;
}
.pop-open { border: 2px dashed var(--border-accent); background: var(--bg-accent); color: var(--text-accent); font-weight: 500; }
.pop-err { border: 1px dashed var(--border-danger); background: var(--bg-danger); color: var(--text-danger); }

.collapsedrow { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.flowchip {
    font-size: 12px; padding: 4px 10px; border-radius: 99px;
    background: var(--surface-1); border: 0.5px solid var(--border); color: var(--text-secondary);
    cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}
.flowchip:hover { border-color: var(--border-strong); background: var(--surface-2); }

/* ── 범례 ── */
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border-top: 0.5px solid var(--border); padding-top: 10px; font-size: 11px; color: var(--text-muted); }
.legend .spacer { flex: 1; }
.legend-box { display: inline-block; width: 12px; height: 9px; border-radius: 3px; vertical-align: -1px; margin-right: 3px; }
.lb-screen { border: 0.5px solid var(--border-strong); }
.lb-popup { border: 1px dashed var(--border-strong); }
.lb-cur { background: var(--bg-accent); border: 2px solid var(--border-accent); }

/* ── 페이저 ── */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.page-btn { font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 0.5px solid var(--border); background: var(--surface-2); color: var(--text-secondary); cursor: pointer; }
.page-btn:hover { border-color: var(--border-strong); }
.page-btn.on { background: var(--fill-primary); color: var(--on-primary); border-color: var(--fill-primary); }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.pager-info { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

/* ── 최근 에러 ── */
.err-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 0.5px solid var(--border); font-size: 13px; }
.err-row:last-child { border-bottom: none; }
.err-time { color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.err-screen { color: var(--text-danger); white-space: nowrap; min-width: 90px; }
.err-msg { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }

/* 에러 처리 완료 (add-error-acknowledgment) */
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sect-head-actions { display: inline-flex; align-items: center; gap: 10px; }
.btn-resolve { flex: none; white-space: nowrap; cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500; padding: 4px 14px; border-radius: 6px; border: 0.5px solid var(--border-accent); background: var(--bg-accent); color: var(--text-accent); }
.btn-resolve:hover:enabled { background: var(--border-accent); color: #fff; }
.btn-resolve:disabled { opacity: 0.45; border-color: var(--border); background: var(--surface-1); color: var(--text-muted); cursor: default; }
.err-row-sel { cursor: pointer; align-items: center; border-radius: 4px; padding-left: 4px; padding-right: 4px; }
.err-row-sel:hover { background: var(--surface-1); }
.err-row-sel.on { background: var(--bg-accent); }
.err-row-sel .chk { margin-right: 0; }
.err-list { max-height: 292px; overflow-y: auto; } /* ~9행까지 보이고 초과 시 스크롤 */
.err-row-done { opacity: 0.6; }
.err-row-fatal { background: var(--bg-danger); border-radius: 4px; padding-left: 4px; padding-right: 4px; } /* 치명(Fatal) — 글자 배지 대신 연한 빨강 틴트 */
.err-row-sel.err-row-fatal:hover { background: #F7D9D9; }
.err-done-badge { flex: none; font-size: 11px; color: var(--text-success); background: var(--bg-success); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }

/* 리소스 사용량 패널 (add-resource-usage) — 현재값 진행 바 + 일일 최고 배지 */
.res-peaks { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.res-peak { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: var(--surface-1); color: var(--text-secondary); border: 0.5px solid var(--border); white-space: nowrap; }
.res-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.res-row:last-child { margin-bottom: 0; }
.res-label { font-size: 12px; color: var(--text-secondary); min-width: 44px; }
.res-track { flex: 1; height: 8px; border-radius: 5px; background: var(--surface-1); border: 0.5px solid var(--border); overflow: hidden; }
.res-fill { height: 100%; border-radius: 5px; transition: width 0.4s ease; }
.res-val { font-size: 12px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.res-lo { background: var(--status-ok); }
.res-mid { background: var(--status-warn); }
.res-hi { background: var(--status-danger); }

.link { font-size: 12px; color: var(--text-accent); cursor: pointer; }

/* ── Blazor 템플릿 기본 (에러 UI) ── */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "오류가 발생했습니다."; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
