/* ============================================================
   공통 컴포넌트 — 카드/그리드, 배지(pill), 필터 바, 표
   ============================================================
   여러 화면이 재사용하는 조각이다. 새 화면을 만들 때 여기 있는 클래스를
   먼저 찾아 쓰고, 없을 때만 새로 추가한다.

   pill 계열(.sev-*, .st-*)은 탐지 심각도·판정 상태와 1:1로 대응한다.
   상태를 추가하면 tokens.css에 색을 먼저 정의하고 여기서 참조한다.
   ============================================================ */
  /* ===== Cards / grid ===== */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
  }
  .stat-card {
    padding: 16px 18px;
  }
  .stat-card .label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .stat-card .value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
  }
  .stat-card .delta { font-size: 12px; margin-top: 4px; font-family: var(--font-mono); }
  .delta.up { color: var(--sev-high); }
  .delta.down { color: var(--st-falsepos); }
  .delta.flat { color: var(--text-faint); }

  .two-col {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
    align-items: stretch;
  }

  .card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14.5px;
    padding: 14px 16px 0;
  }
  .card-sub {
    font-size: 12px;
    color: var(--text-faint);
    padding: 2px 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }

  /* 신규(내 프로젝트/Site Key/정산) — 카드 안 키/값 나열. */
  .kv-list {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px 12px;
    padding: 0 16px 16px;
    margin: 0;
    font-size: 13px;
  }
  .kv-list dt { color: var(--text-faint); font-weight: 700; }
  .kv-list dd { margin: 0; }

  .trend-wrap { padding: 0 16px 16px; }
  .trend-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 110px;
  }
  .trend-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
  .trend-bar {
    width: 100%;
    border-radius: 4px 4px 0 0;
    background: var(--accent);
    opacity: 0.85;
    min-height: 2px;
  }
  .trend-bar-col .day { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }

  /* icon-badge circular KPI (레거시 BI 리포트 insight-page style) */
  .icon-badge-grid { display: flex; justify-content: space-around; text-align: center; padding: 8px 4px 16px; flex-wrap: wrap; gap: 18px; }
  .icon-badge-grid .item { width: 120px; }
  .icon-badge-grid .circle {
    width: 92px; height: 92px; border-radius: 50%;
    margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-family: var(--font-display); font-weight: 700;
    font-size: 20px; line-height: 1.15; text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
  }
  .icon-badge-grid .label { font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
  .icon-badge-grid .sub { display: block; font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 3px; }

  /* speech-bubble help tooltip (레거시 BI 리포트 "분석보고서 도움말" style) */
  .help-tip-wrap { position: relative; display: flex; justify-content: flex-end; margin-bottom: 14px; }
  .help-tip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; }
  .help-tip .icon { color: var(--accent); font-style: normal; }
  .help-tip:hover, .help-tip.active { color: var(--value); text-decoration: underline; }
  .help-tip + .help-tip-box { display: none; }
  .help-tip.active + .help-tip-box { display: block; animation: fadeInFromNone .15s forwards; }
  .help-tip-box {
    position: absolute; top: 26px; right: 0; z-index: 5;
    width: 360px; padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  }
  .help-tip-box:after { content: ''; position: absolute; bottom: 100%; right: 18px; border-width: 0 6px 6px 6px; border-style: solid; border-color: var(--surface) transparent; }
  .help-tip-box ul { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
  .help-tip-box li { position: relative; padding-left: 12px; }
  .help-tip-box li:before { content: ''; position: absolute; top: 7px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  @keyframes fadeInFromNone { 0% { opacity: 0; } 100% { opacity: 1; } }

  /* UI icons share the sidebar's monochrome outline style. */
  .ui-icon {
    width: 18px; height: 18px; flex: none;
    display: inline-block; vertical-align: middle;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
  .section-lead { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; background: var(--surface); }
  .section-lead .ic {
    width: 20px; height: 20px; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
  }
  .section-lead .ui-icon { width: 20px; height: 20px; }
  .section-lead h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: 0; margin: 0; color: var(--text); }
  .section-card { margin-top: 28px; padding: 20px; }
  .section-card > .section-lead { margin: 0 0 18px; }
  .section-card > .card { border: 0; border-radius: 0; }
  .section-card > .filter-bar, .section-card > .channel-card { padding: 0; }
  .section-card > .table-card { border-top: 1px solid var(--border); }
  .list-tips { list-style: none; margin: 0; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
  .list-tips li { position: relative; padding-left: 14px; font-size: 13.5px; color: var(--text); line-height: 1.6; }
  .list-tips li:before { content: ''; position: absolute; top: 8px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
  .list-tips em { color: var(--value); font-style: normal; font-weight: 700; }

  /* ===== badges/pills ===== */
  .pill {
    /* docs/ui/principles/text.md §7·15 — Badge는 13~14px, 12px 이하를 일반 정보 표시에 쓰지 않는다 */
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }
  .sev-CRITICAL { color: var(--sev-critical); background: var(--sev-critical-bg); }
  .sev-HIGH { color: var(--sev-high); background: var(--sev-high-bg); }
  .sev-MEDIUM { color: var(--sev-medium); background: var(--sev-medium-bg); }
  .st-SUSPECTED { color: var(--st-suspected); background: var(--st-suspected-bg); }
  .st-REVIEWING { color: var(--st-reviewing); background: var(--st-reviewing-bg); }
  .st-CONFIRMED { color: var(--st-confirmed); background: var(--st-confirmed-bg); }
  .st-FALSE_POSITIVE { color: var(--st-falsepos); background: var(--st-falsepos-bg); }
  .st-RESOLVED { color: var(--st-resolved); background: var(--st-resolved-bg); }

  /* 실시간 접속자 목록의 위험 세션 행(콘솔_화면구성_설계.md ②) — 새 색을 만들지 않고
     기존 심각도 색 변수만 쓴다. 배경을 칠하는 대신 왼쪽 띠 하나로 표시해 표가 시끄러워지지 않게 한다. */
  .risk-row td:first-child { box-shadow: inset 3px 0 0 var(--sev-high); }
  .risk-link { cursor: pointer; }

  /* ===== Filter bar ===== */
  .filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 14px;
    margin-bottom: 14px;
  }
  .chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
  .chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: 12.5px;
    color: var(--text-muted);
  }
  .chip.active { background: var(--accent); color: white; border-color: var(--accent); }

  .chip-group[data-tab-group] { display: inline-flex; gap: 0; }
  .chip-group[data-tab-group] .chip {
    position: relative;
    margin-left: -1px;
    border-radius: 0;
    border: 1px solid var(--border-strong);
    border-left-style: dashed;
    border-right-style: dashed;
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 700;
    padding: 10px 20px;
    z-index: 1;
  }
  .chip-group[data-tab-group] .chip:first-child { margin-left: 0; border-radius: 999px 0 0 999px; border-left-style: solid; }
  .chip-group[data-tab-group] .chip:last-child { border-radius: 0 999px 999px 0; border-right-style: solid; }
  .chip-group[data-tab-group] .chip.active {
    /* border-radius를 여기서 강제로 999px(완전한 알약)로 고정하면 .chip:first-child/:last-child가
       정해둔 모양(왼쪽만 둥글게/오른쪽만 둥글게)을 덮어써서, 첫 번째 탭이 활성화될 때 오른쪽
       탭과 이어지지 않고 따로 노는 알약처럼 보였다(스크린샷 확인). radius는 위치별 규칙이
       그대로 적용되게 비워 두고, 색/테두리 스타일만 바꾼다. */
    background: var(--accent); color: #fff; border-color: var(--accent);
    border-style: solid; z-index: 2;
  }

  .radio-pill-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
  .radio-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px 7px 10px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 12.5px; color: var(--text-muted); cursor: pointer;
  }
  .radio-pill .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; position: relative; }
  .radio-pill.active { border-color: var(--accent); color: var(--accent); font-weight: 700; }
  .radio-pill.active .dot { border-color: var(--accent); }
  .radio-pill.active .dot:after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent); }

  .summary-block { position: relative; padding: 2px 0 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
  .summary-block .help-tip-wrap { position: absolute; top: -2px; right: 0; margin: 0; }
  .meta-row { display: flex; align-items: center; gap: 0; flex-wrap: wrap; padding-right: 130px; }
  .meta-row .item { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); padding: 0 20px 0 0; }
  .meta-row .item .ic { font-size: 14px; }
  .meta-row .item b { color: var(--value); font-weight: 700; }
  .meta-row .item + .item { padding-left: 20px; border-left: 1px solid var(--border); }

  .report-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
  .report-box .box-tit { text-align: center; padding: 18px 20px; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--border); background: var(--accent-bg); color: var(--text); }
  .report-box .box-body { padding: 20px; }

  .compare-chart-wrap { background: linear-gradient(var(--accent-bg), var(--surface-2)); border-radius: 6px; padding: 20px 16px 4px; }
  .compare-chart-wrap svg { display: block; width: 100%; height: auto; }
  .compare-legend { display: flex; justify-content: center; gap: 24px; padding: 8px 0 4px; font-size: 12.5px; color: var(--text-muted); }
  .compare-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .compare-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

  .filter-bar select, .filter-bar input[type=date], .filter-bar input[type=text] {
    font-family: inherit;
    font-size: 12.5px;
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
  }
  .filter-bar .ip-search { display: flex; align-items: center; gap: 6px; }
  .filter-bar .ip-search input { width: 170px; }
  .filter-bar .fb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
  .filter-bar .spacer { flex: 1; }

  /* ===== 탐지내역 검색 UX (docs/ui/navigation/search.md) =====
     기본 .filter-bar는 한 줄(row) 레이아웃이라, 기간/빠른 보기/검색을 역할별로 분리된 줄로
     쌓으려면 .det-filter-bar에서 세로(column)로 바꾼다. */
  .det-filter-bar { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .det-filter-bar .filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  #detAdvancedToggle.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

  /* §7 — 상태·위험도는 서로 다른 Dimension이라 각자 라벨을 단 줄로 분리해서 보여준다. */
  .det-advanced {
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .det-advanced-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .det-advanced-label { flex: none; width: 48px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }

  /* §8 — 검색창은 Filter 아래에서 충분한 폭을 확보한다(짧은 170px 고정폭을 쓰지 않는다). */
  .det-search-row .det-search { flex: 1; }
  .det-search-row .det-search input { width: 100%; }

  /* §14 — 상세 필터로 고른, "빠른 보기"로 표현 안 되는 조건만 칩으로 보여준다. */
  .det-filter-bar .det-active-filters { gap: 6px; }
  .det-active-label { font-size: 12px; color: var(--text-secondary); }
  .det-active-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 999px;
    background: var(--accent-bg); color: var(--accent);
    font-size: 12px; cursor: pointer;
  }
  .det-active-chip b { font-weight: 700; }
  .det-active-clear { background: none; border: 0; padding: 0; font-size: 12px; color: var(--text-secondary); text-decoration: underline; cursor: pointer; }

  /* §10·§16 — CSV는 검색 조건이 아니라 결과 영역의 Action이다. */
  .det-results-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
  }
  .det-results-count { font-size: 13.5px; font-weight: 700; color: var(--text); }

  /* §13 — 결과가 없으면 Pagination 없이 원인·다음 행동만 보여준다. */
  .det-empty { padding: 48px 20px; text-align: center; }
  .det-empty-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
  .det-empty-desc { font-size: 13px; color: var(--text-secondary); margin: 0 0 16px; }

  .btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
  }
  .btn:hover { border-color: var(--accent); color: var(--accent); }
  .btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
  .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: white; }
  .btn.danger { color: var(--sev-high); }
  .btn.danger:hover { border-color: var(--sev-high); }
  .btn.small { padding: 4px 10px; font-size: 12.5px; }
  .btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }

  /* ===== Table ===== */
  .table-card { overflow: hidden; border-radius: 14px; }
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead th {
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.01em;
    color: #fff;
    text-transform: none;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--thead-bg);
    white-space: nowrap;
    font-weight: 700;
  }
  tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }
  tbody tr:last-child td { border-bottom: none; }
  tbody tr.detail-row { background: var(--surface-2); }
  tbody tr.clickable:hover { background: var(--accent-bg); cursor: pointer; }

  .page-nav { display: flex; justify-content: center; gap: 0; padding: 14px; }
  .page-nav a, .page-nav span {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    font-size: 12.5px; color: var(--text-muted);
    border: 1px solid var(--border); margin-left: -1px;
    background: var(--surface);
    text-decoration: none; cursor: pointer;
  }
  .page-nav a:first-child, .page-nav span:first-child { border-radius: 999px 0 0 999px; }
  .page-nav a:last-child, .page-nav span:last-child { border-radius: 0 999px 999px 0; }
  .page-nav .current { background: var(--accent); color: #fff; border-color: var(--accent); position: relative; z-index: 1; }
  .page-nav a:hover:not(.current) { background: var(--accent-bg); color: var(--accent); }
  .mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
  .risk-cell { display: flex; align-items: center; gap: 8px; }
  .risk-track { width: 54px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; flex: none; }
  .risk-fill { height: 100%; border-radius: 4px; }
  .risk-num { font-family: var(--font-mono); font-size: 12.5px; width: 24px; }
  .table-scroll { overflow-x: auto; }
  .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

  .detail-panel {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 22px;
  }
  .detail-panel h4 {
    font-family: var(--font-display);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    margin: 0 0 8px;
  }
  .rule-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--accent-bg);
    color: var(--accent);
    margin: 0 6px 6px 0;
  }
  .reason-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 4px; padding: 0; list-style: none; }
  .reason-row { font-size: 13px; line-height: 1.5; }
  .reason-row .reason-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .reason-row .reason-label { font-weight: 600; color: var(--text); }
  .reason-row .reason-points { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
  .reason-row .reason-points.is-minus { color: var(--text-faint); }
  .reason-row .reason-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
  .reason-row .reason-detail { color: var(--text-secondary); }
  .timeline { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
  .timeline-row { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
  .timeline-row .t { font-family: var(--font-mono); color: var(--text-faint); width: 130px; flex: none; }
  .ai-panel { grid-column: 1 / -1; }
  .ai-confidence { font-family: var(--font-mono); font-size: 13px; margin-bottom: 6px; }
  .ai-confidence strong { color: var(--accent); font-size: 15px; }
  .ai-factor { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
  .ai-disclaimer { font-size: 12px; color: var(--text-faint); margin-top: 8px; }
  .judge-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
  .judge-form select, .judge-form input {
    font-family: inherit; font-size: 12.5px;
    padding: 6px 10px; border-radius: 7px;
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text);
  }
  .judge-form input[type=text] { flex: 1; min-width: 160px; }

  .bulk-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    margin-top: 10px;
    border-radius: 10px;
    background: var(--accent-bg);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 500;
  }
  .bulk-bar .spacer { flex: 1; }

  .info-box {
    display: flex; gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--accent-bg);
    border: 1px solid transparent;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
  }
  .info-box .ic { color: var(--accent); flex: none; }

  .expiry-soon { color: var(--sev-medium); font-weight: 700; }
  .form-card { padding: 16px 18px; }
  .form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
  .form-row label { font-size: 12.5px; color: var(--text-muted); width: 88px; flex: none; }
  .form-row input, .form-row select {
    font-family: inherit; font-size: 12.5px;
    padding: 7px 10px; border-radius: 7px;
    border: 1px solid var(--border-strong); background: var(--surface);
    color: var(--text); flex: 1; min-width: 160px;
  }

  .channel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }
  .channel-card { padding: 16px 18px; }
  .channel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
  .channel-head .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
  .toggle {
    width: 38px; height: 22px; border-radius: 999px;
    background: var(--border-strong);
    position: relative;
    flex: none;
    border: none;
  }
  .toggle::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--surface);
    transition: left .15s;
  }
  .toggle.on { background: var(--accent); }
  .toggle.on::after { left: 18px; }
  .channel-body .form-row label { width: 100px; }
  .stub-note {
    font-size: 12.5px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    margin-top: 8px;
  }
  .recipients-table { margin-top: 8px; }

  .report-period { display: none; }
  .report-period.active { display: block; }
  .report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
  .report-card { padding: 14px 16px; }
  .report-card h4 {
    font-family: var(--font-display);
    font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--text-faint); margin: 0 0 10px;
    border-bottom: 1px solid var(--border); padding-bottom: 8px;
  }
  .report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; }
  .report-list li { display: flex; justify-content: space-between; }
  .report-list .n { font-family: var(--font-mono); font-weight: 700; }
  .loading-note, .empty-note {
    padding: 30px 20px; text-align: center; color: var(--text-faint); font-size: 12.5px;
  }
  .error-note {
    padding: 12px 14px; border-radius: 10px; background: var(--sev-high-bg); color: var(--sev-high);
    font-size: 12.5px; margin-bottom: 14px;
  }
  .scope-note {
    padding: 44px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
    max-width: 520px;
    margin: 0 auto;
  }
  .scope-note .ic { font-size: 30px; display: block; margin-bottom: 12px; }
  .scope-note b { color: var(--text); }

  .alimtalk-preview {
    max-width: 320px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .alimtalk-head {
    background: #f5d90a;
    color: #3a2f00;
    padding: 12px 14px;
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
  }
  .alimtalk-body { padding: 14px; font-size: 12.5px; line-height: 1.7; }
  .alimtalk-body b { font-family: var(--font-display); }
  .alimtalk-actions { border-top: 1px solid var(--border); }
  .alimtalk-actions div {
    padding: 11px 14px;
    text-align: center;
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
  }
  .alimtalk-actions div:last-child { border-bottom: none; }

  .gap-note {
    display: inline-flex; align-items: center; gap: 5px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--sev-medium);
    background: var(--sev-medium-bg);
    padding: 2px 8px;
    border-radius: 999px;
  }

  /* console-right-utility-rail.md §1·8·9 — 모든 화면이 공유하는 공통 Layout
     Component다(markup은 index.html에 한 벌만 있고 .view들 밖에 있다 — 화면마다 복제하지
     않는다). 폭·padding·gap·sticky를 여기 한 곳에서만 정한다. */
  .rightrail {
    width: 288px;
    flex: none;
    order: 2;
    background: var(--surface);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* scroll-layout.md §10·§14 — Rail 자체의 overflow-y:auto·max-height를 없앴다("별도
       Scrollbar 사용하지 않음"). .content-area(가장 가까운 스크롤 조상)를 기준으로 top:0에
       붙어서, Main과 "같은" 스크롤을 따라간다 — 더 이상 Rail만 따로 잘리거나 스크롤되지 않는다.

       align-self:flex-start — 전에는 기본값(stretch)을 써서 Rail 박스가 .content-area
       높이만큼 억지로 늘어났다. 구분선이 안 끊기는 건 맞았지만(border-left가 늘어난 박스
       끝까지 그려지니까), 그 대가로 카드 콘텐츠가 짧은 화면(탐지내역/대응 등)마다 카드들
       아래로 흰 여백이 수백 px씩 남았다 — "오른쪽 간격이 넓다"는 반복 지적의 원인이 바로
       이거였다. 구분선과 "콘텐츠 박스가 늘어나는 것"은 묶여 있을 이유가 없다 — 구분선은
       .rail-divider가 따로 맡는다(아래 참고, 늘 전체 높이·Rail 배경 위에 그려짐). Rail
       자신은 다시 자기 콘텐츠 높이만큼만 차지해서 빈 여백이 생기지 않는다. */
    align-self: flex-start;
    position: sticky;
    top: 0;
  }
  /* Main·Rail 구분선. DOM에서는 .rightrail "뒤"(index.html)에 있어 늘 Rail의 불투명
     배경(--surface) 위에 그려진다 — order로 시각적 위치만 둘 사이로 당겨온다. 내용이
     없는 1px짜리 선이라 align-self:stretch로 .content-area 높이만큼 늘어나도(= 이게
     목적이다) 카드처럼 "빈 박스"로 보이는 부작용이 없다. position:sticky는 Rail과 똑같이
     스크롤 중에도 화면에 고정해 끊기지 않게 한다. */
  .rail-divider {
    order: 1;
    flex: none;
    width: 1px;
    align-self: stretch;
    background: var(--border);
    position: sticky;
    top: 0;
  }
  .rail-card { padding: 18px 16px; }
  /* §8 Title 14~15px/600 — 이전엔 12px 대문자 eyebrow라 너무 작고 장식적으로 보였다. */
  .rail-title {
    font-family: var(--font-display); font-weight: 600; font-size: 14.5px;
    color: var(--text);
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
  }
  .rail-link { display: block; margin-top: 10px; font-size: 13px; text-align: right; cursor: pointer; }
  .rail-kv { font-size: 13px; color: var(--text-secondary); display: flex; justify-content: space-between; }
  .rail-kv b { color: var(--text); font-family: var(--font-mono); font-weight: 500; }
  .rail-progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
  .rail-progress > div { height: 100%; border-radius: 4px; background: var(--accent); }
  /* contextual-help.md §2·§3·§11 — 메뉴별 용어 설명(PageHelpCard). dt=용어, dd=1~2줄 설명. */
  .rail-help-list { margin: 0; }
  .rail-help-list dt { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 10px; }
  .rail-help-list dt:first-child { margin-top: 0; }
  .rail-help-list dd { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

  /* §8 — 문의하기는 더 이상 큰 Card로 항상 강조하지 않는다. PageHelpCard 아래에 작게. */
  .rail-support { padding: 4px 4px 0; text-align: center; }
  .rail-support p { font-size: 12.5px; color: var(--text-faint); margin: 0 0 8px; }
  .rail-support .btn { width: 100%; text-align: center; }
  .rail-support .btn.small { font-size: 12.5px; padding: 6px 10px; }

  /* §10 Responsive — 1280 이하에서는 Rail을 숨기고 Main이 그 폭을 그대로 흡수한다(§11, flex:1이라
     별도 처리가 필요 없다). Drawer 전환은 이번 1차 적용 범위 밖으로 둔다. */
  @media (max-width: 1280px) {
    .rightrail { display: none; }
    .rail-divider { display: none; }
  }

  /* ===== Site Key 설치 스니펫 (콘솔_화면구성_설계.md §5 4단계 13번) ===== */
  .snippet-block + .snippet-block { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
  .snippet-loc { font-size: 12.5px; color: var(--text-faint); margin: 4px 0 8px; }
  .snippet-block h5 { font-family: var(--font-display); font-size: 12.5px; font-weight: 700; color: var(--text); margin: 0 0 2px; }
  .code-block {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 11.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    color: var(--text);
    margin: 0 0 8px;
  }
  .code-block mark { background: var(--sev-medium-bg); color: var(--sev-medium); border-radius: 3px; padding: 0 2px; font-weight: 700; }

  details.install-details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
  details.install-details + details.install-details { margin-top: 10px; }
  details.install-details summary {
    cursor: pointer;
    padding: 12px 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13.5px;
    background: var(--surface-2);
    list-style: none;
  }
  details.install-details summary::-webkit-details-marker { display: none; }
  details.install-details summary:before { content: '▸ '; color: var(--accent); }
  details.install-details[open] summary:before { content: '▾ '; }
  details.install-details > .snippet-block-wrap { padding: 16px; }


  /* 오늘 상태를 한 문장으로 먼저 말해주는 띠 */
  .today-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    font-size: 14.5px;
    line-height: 1.55;
  }
  .today-banner .tb-ic { font-size: 19px; flex: none; }
  .today-banner .tb-text b { font-weight: 700; }
  .today-banner .tb-sub {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    color: var(--text-muted);
  }
  .today-banner.calm  { background: var(--st-falsepos-bg); color: var(--st-falsepos); }
  .today-banner.watch { background: var(--sev-medium-bg);  color: var(--sev-medium); }
  .today-banner.alert { background: var(--sev-high-bg);    color: var(--sev-high); }
  .today-banner.calm .tb-text b,
  .today-banner.watch .tb-text b,
  .today-banner.alert .tb-text b { color: inherit; }

  /* 통계 카드 라벨 옆 물음표 — 마우스를 올리면 뜻풀이가 뜬다 */
  .stat-card .label .q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: help;
    flex: none;
  }
  .stat-card .label .q:hover { background: var(--accent); color: var(--surface); }
  /* 라벨이 좌우 정렬(space-between)이라 물음표가 반대쪽으로 밀리는 것을 막는다 */
  .stat-card .label { justify-content: flex-start; gap: 0; }

  /* 표 머리글의 보조 설명 */
  th .th-sub {
    display: block;
    font-weight: 400;
    font-size: 12px;
    opacity: .85;
    margin-top: 2px;
  }

  /* 화면 설명문을 조금 더 읽기 쉽게 — 본문과 대비를 올리고 줄간격을 넓힌다 */
  .view-head p {
    font-size: 14px;
    line-height: 1.6;
    max-width: 62ch;
  }
  .info-box { font-size: 13.5px; line-height: 1.65; color: var(--text); }

  /* ============================================================
     ===== 대시보드(.dash) =====
     ------------------------------------------------------------
     .agents/tasks/ui-ux-dashboard/02-design.md §17.3이 정본이다. 색은 토큰만,
     글씨 크기는 --fs-* 만 쓴다(hex·고정 px 금지). 공통 클래스 정의는 바꾸지
     않고 .dash 범위 안에서만 덮어쓴다.
     ============================================================ */

  .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0);
    overflow: hidden;
    white-space: nowrap;
  }

  .dash :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  /* admin-dashboard-layout-third.md §1 — 900~1000px로 좁게 갇혀 있던 콘텐츠 폭을 1920px
     데스크톱에서 더 넓게 쓴다. 다른 화면(.view)의 1080px은 그대로 두고 .dash에서만 넓힌다
     (class 2개 .view.dash로 .view 한 개짜리 규칙보다 우선시켜 !important 없이 이긴다). */
  .view.dash { max-width: 1600px; }

  /* ----- 영역/레이아웃 ----- */
  /* §11 Page Title 22~24px — --fs-lg(20, 다른 핵심 숫자들과 공유하는 토큰)는 그대로 두고
     여기만 --fs-xl(24)을 쓴다. */
  .dash-head h1 { font-size: var(--fs-xl); }
  .dash .dash-meta {
    margin: 4px 0 0;
    max-width: none;
    font-size: var(--fs-xs);
    line-height: 1.6;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .dash-status {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    /* 아래 .dash-kpis/.dash-grid와 간격을 맞춘다. .view-head가 이미 쓰고 있는
       margin-bottom:20px 리듬에 맞춰 20px로 통일했다(처음엔 32px로 맞췄다가 전체적으로
       너무 벌어져 보여 기존 20px 쪽으로 다시 맞춤 — layout.css:281 .view-head 참고). */
    margin: 0 0 20px;
  }
  .dash-status-body { flex: 1; min-width: 240px; }
  .dash-status-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-sm);
    font-weight: 700;
    margin-bottom: 4px;
  }
  .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; vertical-align: middle; background: var(--text-secondary); }
  .status-dot.is-ok { background: var(--st-falsepos); }
  .status-dot.is-warn { background: var(--sev-medium); }
  .status-dot.is-danger { background: var(--sev-high); }
  .dash-status.is-danger .dash-status-label { color: var(--sev-high); }
  .dash-status.is-unknown .dash-status-label { color: var(--text-secondary); }
  .dash-status-text { font-size: var(--fs-lg); font-weight: 500; color: var(--text); line-height: 1.5; margin: 0; }
  .dash-status-text [title] { cursor: help; font-size: var(--fs-xs); font-weight: 400; color: var(--text-secondary); margin-left: 2px; }
  .dash-status-sub { font-size: var(--fs-sm); color: var(--text-secondary); margin: 4px 0 0; }
  .dash-status .mono { font-family: var(--font-mono); }
  .dash-status-actions { flex: none; }

  .dash-kpis {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin: 0 0 20px;
  }
  .dash-kpi {
    flex: 1;
    padding: 16px 20px;
    position: relative;
  }
  .dash-kpi + .dash-kpi { border-left: 1px solid var(--border); }
  .dash-kpi-label {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .dash-kpi-value {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 700;
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
    color: var(--text);
  }
  .dash-kpi-value.is-muted { color: var(--text-secondary); }
  .dash-kpi-line {
    font-size: var(--fs-sm);
    color: var(--text);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .dash-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex: none;
    background: var(--text-secondary);
  }
  .dash-dot.is-danger { background: var(--sev-high); }
  .dash-dot.is-warn { background: var(--sev-medium); }
  .dash-dot.is-info { background: var(--text-secondary); }

  /* console-dashboard-7day.md §10 — "최근 7일 탐지"(차트 포함 분석 Card) : "지금 확인할 일" =
     약 65 : 35. */
  .dash-grid {
    display: grid;
    grid-template-columns: 65% 1fr;
    /* align-items 기본값(stretch)이면 콘텐츠가 짧은 쪽(.dash-todo가 할 일 1개뿐일 때 등)이
       옆 카드(.dash-insight, 차트 포함)의 키에 맞춰 억지로 늘어나 카드 안쪽에 빈 공간이
       생겼다. 각 카드가 자기 콘텐츠 높이만큼만 차지하도록 start로 바꾼다. */
    align-items: start;
    /* 두 카드 사이 가로 간격도 다른 모든 간격(20px)과 다르게 40px이라 유독 넓어 보였다. */
    gap: 20px;
    margin-bottom: 20px;
  }
  /* §12 — 차트가 회색 Dashboard 배경 위에 바로 놓여 경계가 애매했다("영역 경계도 애매하다").
     .dash-status/.dash-kpis와 같은 흰 Card 테두리를 준다. */
  .dash-insight, .dash-todo {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px;
  }
  /* §11 Section 18~20px — --fs-md(16, 에러 문구 등과 공유)는 그대로 두고 여기만 --fs-lg(20). */
  .dash-h { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 12px; color: var(--text); }

  .dash-insight-title { font-size: var(--fs-sm); color: var(--text-secondary); margin: 0 0 10px; }
  .dash-insight-stat { font-size: var(--fs-2xl); font-weight: 700; color: var(--text); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
  .dash-insight-desc { font-size: var(--fs-sm); color: var(--text-secondary); margin: 0 0 10px; }
  .dash-insight-empty { font-size: var(--fs-sm); color: var(--text-secondary); }
  .dash-insight-action { margin-top: 4px; }

  /* 랭킹 막대(§5·§6·§15) — 식별은 라벨 텍스트가 하므로 막대 색은 하나뿐이다(크기=비중). */
  .dash-rank-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
  .dash-rank-row { display: flex; align-items: center; gap: 10px; }
  .dash-rank-label {
    flex: 0 0 96px; font-size: var(--fs-sm); color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .dash-rank-track { flex: 1; height: 10px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
  .dash-rank-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
  .dash-rank-value {
    flex: 0 0 auto; min-width: 40px; text-align: right;
    font-size: var(--fs-sm); color: var(--text); font-variant-numeric: tabular-nums;
  }

  /* Priority Task List(§7·§8) — 항목마다 색깔 왼쪽 띠 + 배경 틴트를 입히던 예전 스타일은
   *  뺐다(사용자 피드백 — "AI가 만든 것 같다"는 전형적인 패턴이라 지적받음). 우선순위는
   *  .dash-todo-tag 안의 작은 status-dot 하나로만 구분하고, 카드 자체는 이 앱의 다른 카드
   *  (.rail-card 등)와 같은 중립 스타일(흰 배경 + 옅은 테두리)로 통일한다. */
  .dash-todo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  .dash-todo li {
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 10px 12px;
  }
  .dash-todo li[title] { cursor: help; }
  .dash-todo-tag { font-size: var(--fs-xs); color: var(--text-secondary); margin-bottom: 2px; }
  .dash-todo-big { font-size: var(--fs-lg); font-weight: 700; color: var(--text); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
  .dash-todo-desc { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: 8px; }
  .dash-todo li .btn { margin-top: 2px; }
  .dash-todo .dash-empty { font-size: var(--fs-sm); color: var(--text-secondary); padding: 10px 0; }

  .dash-link {
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--accent);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
  }
  .dash-link:hover { text-decoration: underline; }

  .dash-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    font-weight: 700;
    border: 0;
    cursor: pointer;
    flex: none;
    padding: 0;
  }
  .dash-help:hover, .dash-help[aria-expanded="true"] { background: var(--accent); color: var(--surface); }
  .dash-help-text {
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 6px 0 0;
  }

  .dash .btn { font-size: var(--fs-sm); }
  .dash .btn.small { font-size: var(--fs-sm); padding: 4px 10px; }
  .dash .loading-note, .dash .empty-note { font-size: var(--fs-sm); color: var(--text-secondary); }
  .dash .error-note { font-size: var(--fs-sm); color: var(--text); background: none; padding: 0; }

  /* ----- 추이(7일 Vertical Bar Chart, console-dashboard-7day.md §2·§3·§7·§8·§9·§13) ----- */
  .dash-trend-nums { display: flex; align-items: baseline; gap: 20px; margin: 0 0 12px; flex-wrap: wrap; }
  .dash-trend-nums > div { display: flex; align-items: baseline; gap: 6px; }
  .dash-trend-nums b { font-size: var(--fs-lg); font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
  .dash-trend-k { font-size: var(--fs-xs); color: var(--text-secondary); }
  .dash-trend-badge {
    font-size: var(--fs-xs); color: var(--text-secondary); background: var(--surface-2);
    padding: 2px 10px; border-radius: 999px;
  }
  .dash-trend-title { font-size: var(--fs-md); color: var(--text); margin: 0 0 4px; }
  /* §2 — 차트 높이를 220~260px 범위로 줄인다(Desktop 권장). rect는 폭이 늘어도 원처럼
     찌그러지지 않아 aspect-ratio 없이 고정 높이로 늘여도 안전하다. */
  .dash-trend-chart { width: 100%; height: 220px; }
  .dash-trend-chart svg { width: 100%; height: 100%; display: block; }
  /* §9 막대 자체가 데이터다 — Stroke/Point 장식을 더하지 않는다. §8 오늘도 다른 날과 같은 색. */
  .dash-bar { fill: var(--accent); }
  .dash-bar.is-peak { fill: var(--accent); }
  /* §7 방법 A — 집계 전(pending) 날짜는 회색 Flat Bar. 점선·회전 아이콘 등 로딩처럼 보이는
     표현을 쓰지 않는다(Spinner를 Chart Point로 쓰지 않는다). */
  .dash-bar.is-pending { fill: var(--border-strong); }
  .dash-bar-label { font-size: 11px; font-weight: 500; fill: var(--text-secondary); font-variant-numeric: tabular-nums; }
  /* §4 "최고값은 바로 알 수 있어야 한다" — 값 라벨 중 최고값만 굵게·진하게. */
  .dash-bar-label.is-peak { font-weight: 700; fill: var(--text); }
  .dash-bar-label.is-pending { fill: var(--text-faint); }
  .dash-trend-axis { display: flex; gap: 6px; margin-top: 4px; }
  .dash-trend-axis > span { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--text-secondary); }
  /* §8 "날짜 Label만 오늘 정도로 강조하면 충분하다" — 막대 자체는 그대로 두고 축 라벨만 강조. */
  .dash-trend-axis > span.is-today { color: var(--accent); font-weight: 700; }


  @media (max-width: 1024px) {
    .dash-grid { grid-template-columns: 1fr; gap: 24px; }
    .dash-kpis { flex-direction: column; }
    .dash-kpi + .dash-kpi { border-left: 0; border-top: 1px solid var(--border); }
    .dash-kpi { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; }
    .dash-kpi-value { margin-top: 0; }
    .dash-status { flex-direction: column; align-items: stretch; }
    .dash-status-actions { align-self: flex-start; }
  }

  /* ============ 광고 연동 화면 (.kiro/specs/tenant-naver-searchad-key, 2026-10 UI 개선) ============
     이 화면 전용 규칙이라 접두사(.adc-)로 전부 묶는다 — 다른 화면이 재사용할 일이 생기면
     그때 공통 클래스로 승격한다(§4 "여기 있는 클래스를 먼저 찾아 쓰고, 없을 때만 새로 추가"
     원칙의 반대 방향: 아직 하나뿐인 전용 레이아웃을 섣불리 공통화하지 않는다). */
  #view-adcredential .adc-wrap { width: 100%; max-width: 1120px; color: #334155; font-size: 16px; line-height: 1.65; }
  #view-adcredential .adc-card + .adc-card { margin-top: 24px; }
  #view-adcredential .adc-card-pad { padding: 28px; }
  #view-adcredential .adc-card-title {
    font-family: var(--font-display); font-weight: 700; font-size: 22px; margin: 0 0 16px; color: #334155; line-height: 1.4;
  }

  /* 연결 상태 카드 */
  #view-adcredential .adc-status-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  }
  #view-adcredential .adc-status-site { font-size: 16px; font-weight: 700; color: #334155; }
  #view-adcredential .adc-status-desc { font-size: 16px; color: #475569; margin-top: 4px; }
  #view-adcredential .adc-muted-note {
    font-size: 16px; color: #475569; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  }
  #view-adcredential .adc-kv { padding: 16px 0 0; margin: 16px 0 0; border-top: 1px solid var(--border); font-size: 16px; grid-template-columns: minmax(100px, 140px) minmax(0, 1fr); }
  #view-adcredential .adc-kv dt { color: #475569; font-weight: 600; }
  #view-adcredential .adc-kv dd { overflow-wrap: anywhere; }
  #view-adcredential .adc-status-row .pill { font-size: 16px; }
  #view-adcredential .view-head p { font-size: 16px; color: #475569; line-height: 1.65; }

  /* Shared form controls replace card-sub, btn.small and fixed-width form-row variants. */
  #view-adcredential .adc-form { width: 100%; max-width: 720px; }
  #view-adcredential .adc-guide { font-size: 16px; color: #475569; margin: 0 0 20px; line-height: 1.65; }
  #view-adcredential .adc-guide p, #view-adcredential .adc-mapping-notes p { margin: 0; }
  #view-adcredential .adc-guide p + p, #view-adcredential .adc-mapping-notes p + p { margin-top: 8px; }
  #view-adcredential .adc-field { width: 100%; margin-bottom: 18px; }
  #view-adcredential .adc-field label, #view-adcredential .adc-mapping-row label {
    display: block; font-size: 17px; font-weight: 600; color: #334155; margin-bottom: 6px; width: auto; min-width: 0;
  }
  #view-adcredential .adc-required { color: var(--sev-high); margin-left: 2px; }
  #view-adcredential .adc-input {
    width: 100%; min-width: 0; height: 56px; padding: 0 14px; font-size: 18px; font-family: inherit; font-weight: 400;
    border: 1px solid var(--border-strong); border-radius: 8px; background: #ffffff; color: #334155;
  }
  #view-adcredential .adc-input::placeholder { color: #64748b; opacity: 1; }
  #view-adcredential .adc-input:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
  }
  #view-adcredential .adc-field.has-error input { border-color: var(--sev-high); }
  #view-adcredential .adc-field.has-error input:focus { outline-color: var(--sev-high); }
  #view-adcredential .adc-field-error { color: #b91c1c; font-size: 16px; margin: 6px 0 0; }
  #view-adcredential .adc-secret-wrap { position: relative; }
  #view-adcredential .adc-secret-wrap input { padding-right: 100px; }
  #view-adcredential .adc-secret-toggle {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--accent); cursor: pointer;
  }
  #view-adcredential .adc-secret-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
  #view-adcredential .adc-notes { list-style: none; margin: 0 0 24px; padding: 0; }
  #view-adcredential .adc-notes li {
    position: relative; padding-left: 14px; font-size: 16px; color: #475569; line-height: 1.65;
  }
  #view-adcredential .adc-notes li:before {
    content: ''; position: absolute; top: 11px; left: 0; width: 4px; height: 4px; border-radius: 50%; background: #475569;
  }
  #view-adcredential .adc-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
  #view-adcredential .adc-button { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 20px; border-radius: 8px; font-size: 16px; font-weight: 600; line-height: 1.25; max-width: 100%; white-space: nowrap; }
  #view-adcredential .adc-button[hidden] { display: none; }
  #view-adcredential .adc-button.danger { color: #b91c1c; border-color: #b91c1c; }
  #view-adcredential .adc-button[disabled] { opacity: 1; color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
  #view-adcredential .adc-mapping-actions #adCampaignMappingSaveBtn { margin-left: auto; }
  #view-adcredential .adc-mapping-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: start; margin: 0 0 16px; }
  #view-adcredential .adc-mapping-row label { margin: 0; }
  #view-adcredential .adc-mapping-row input { display: block; margin-top: 6px; }
  #view-adcredential .adc-mapping-field { min-width: 0; }
  #view-adcredential .adc-mapping-row > .adc-button { margin-top: 38px; }
  #view-adcredential .adc-field-help { margin-top: 8px; font-size: 16px; line-height: 1.65; color: #475569; overflow-wrap: anywhere; }
  #view-adcredential .adc-field-help p, #view-adcredential .adc-empty p, #view-adcredential .adc-mapping-help p { margin: 0; }
  #view-adcredential .adc-field-help p + p, #view-adcredential .adc-empty p + p, #view-adcredential .adc-mapping-help p + p { margin-top: 8px; }
  #view-adcredential .adc-mapping-help { margin: 0 0 20px; font-size: 16px; color: #475569; line-height: 1.65; }
  #view-adcredential .adc-mapping-help summary { color: #334155; font-weight: 600; cursor: pointer; }
  #view-adcredential .adc-mapping-help > div { margin-top: 12px; }
  #view-adcredential .adc-nav-access { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 20px; }
  #view-adcredential .adc-nav-access p { margin: 0; color: #475569; font-size: 16px; line-height: 1.65; }
  #view-adcredential .adc-external-link { color: var(--accent); font-size: 16px; font-weight: 600; text-underline-offset: 3px; }
  #view-adcredential .adc-external-link + p { margin-top: 8px; }
  #view-adcredential .adc-clear-notice { margin: 0 0 12px; color: #b91c1c; font-size: 16px; line-height: 1.65; }
  #view-adcredential .adc-empty { margin: 0 0 20px; font-size: 16px; color: #334155; }
  #view-adcredential .adc-mapping-notes { margin-top: 16px; font-size: 16px; line-height: 1.65; color: #475569; }
  #view-adcredential .adc-banner {
    font-size: 16px; line-height: 1.65; padding: 12px 16px; border-radius: 8px; margin: 0 0 18px;
  }
  #view-adcredential .adc-banner.is-success { color: var(--st-falsepos); background: var(--st-falsepos-bg); }
  #view-adcredential .adc-banner.is-error { color: var(--sev-high); background: var(--sev-high-bg); }

  @media (max-width: 640px) {
    #view-adcredential .adc-actions .adc-button { flex: 1 0 auto; }
    #view-adcredential .adc-mapping-actions #adCampaignMappingSaveBtn { margin-left: 0; }
    #view-adcredential .adc-mapping-row { grid-template-columns: minmax(0, 1fr); }
    #view-adcredential .adc-mapping-row .adc-button { justify-self: start; margin-top: 0; }
    #view-adcredential .adc-status-row { flex-direction: column; align-items: flex-start; }
  }

  /* ============ 설정·요금 그룹 공통 (사이트 관리/설치 및 연동/사용량·요금제/결제 내역) ============
     2026-10 UI 개선 — 광고 연동 화면(.adc-*, 위)과 같은 설계 기준이지만, 이 네 화면이 함께
     쓰도록 뷰 id로 가두지 않고 공통 클래스(.tc-*)로 뺐다. 다섯 화면이 전부 같은 모양이 되면
     그때 .adc-*도 이 쪽으로 합치는 게 맞지만, 지금은 .adc-* 쪽이 다른 세션에서 동시에
     변경되고 있어 건드리지 않는다(history.md 참고) — 중복이 당장은 더 안전하다. */
  .tc-page { max-width: 1120px; }
  .tc-page .view-head h1 { font-size: 30px; }
  .tc-page .view-head p { font-size: 15px; color: var(--text-secondary); max-width: 62ch; }
  .tc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
  .tc-card + .tc-card { margin-top: 24px; }
  .tc-card-pad { padding: 24px; }
  .tc-card-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin: 0 0 16px; color: var(--text); }
  .tc-card-desc { font-size: 14px; color: var(--text-secondary); margin: -8px 0 16px; }
  .tc-muted-note {
    font-size: 14px; color: var(--text-secondary); margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  }
  .tc-empty { padding: 40px 20px; text-align: center; color: var(--text-secondary); font-size: 14px; }
  .tc-empty .btn { margin-top: 14px; }

  .tc-field { max-width: 640px; margin-bottom: 18px; }
  .tc-field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
  .tc-required { color: var(--sev-high); margin-left: 2px; }
  .tc-field input[type=text], .tc-field input[type=password], .tc-field input[type=email],
  .tc-field input[type=tel], .tc-field select {
    width: 100%; height: 46px; padding: 0 14px; font-size: 15px;
    border: 1px solid var(--border-strong); border-radius: 8px; background: #ffffff; color: var(--text);
  }
  .tc-field input:focus, .tc-field select:focus {
    outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
  }
  .tc-field.has-error input { border-color: var(--sev-high); }
  .tc-field-error { color: var(--sev-high); font-size: 13px; margin: 6px 0 0; }

  .tc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
  .tc-actions .btn.primary { height: 44px; padding: 0 20px; font-size: 15px; font-weight: 700; }
  .tc-banner { font-size: 13.5px; padding: 10px 14px; border-radius: 8px; margin: 0 0 18px; max-width: 640px; }
  .tc-banner.is-success { color: var(--st-falsepos); background: var(--st-falsepos-bg); }
  .tc-banner.is-error { color: var(--sev-high); background: var(--sev-high-bg); }
  .tc-banner.is-info { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }

  /* 목록(사이트 관리) — 표 대신 쓰는 행형 레이아웃. 열 개수가 적고 상세 보기 동작이 없는
     목록에 표보다 가볍다. */
  .tc-list-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
  }
  .tc-list-row:last-child { border-bottom: 0; }
  .tc-list-main { font-size: 15px; font-weight: 700; color: var(--text); }
  .tc-list-sub { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }

  /* 표 안에서만 스크롤(§6 "표는 핵심 정보를 우선 표시하고 필요하면 표 내부에만 스크롤") —
     기존 .table-scroll과 같은 동작이지만 모바일에서 카드 자체가 가로로 밀리지 않게 폭을 고정한다. */
  .tc-table-wrap { overflow-x: auto; }
  .tc-table-wrap table { min-width: 520px; }

  /* 사용량 진행률 바 — 한도가 있는 지표에만 그린다(§4 "한도가 있는 지표에만 그래프"). */
  .tc-usage-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 10px 0 4px; }
  .tc-usage-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
  .tc-usage-bar.is-warn > span { background: var(--sev-medium); }
  .tc-usage-bar.is-over > span { background: var(--sev-high); }
  .tc-usage-meta { font-size: 13px; color: var(--text-secondary); }

  /* 설치 및 연동 — 설치 안내(번호 단계) / 수집 상태 */
  .tc-steps { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: tc-step; }
  .tc-steps > li {
    position: relative; padding: 0 0 16px 34px; margin-bottom: 4px; counter-increment: tc-step;
    font-size: 14px; color: var(--text-secondary); line-height: 1.6;
  }
  .tc-steps > li:before {
    content: counter(tc-step); position: absolute; left: 0; top: -1px;
    width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bg); color: var(--accent);
    font-size: 12.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  }
  .tc-steps > li > strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; font-weight: 700; }
  .tc-collect-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .tc-collect-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
  .tc-collect-dot.is-ok { background: var(--st-falsepos); }
  .tc-collect-dot.is-unknown { background: var(--text-faint); }

  @media (max-width: 640px) {
    .tc-card-pad { padding: 18px; }
    .tc-field, .tc-banner { max-width: none; }
    .tc-actions { flex-direction: column; align-items: stretch; }
    .tc-actions .btn { width: 100%; text-align: center; }
    .tc-list-row { flex-direction: column; align-items: flex-start; }
    .tc-page .view-head { flex-direction: column; align-items: flex-start; }
    .tc-page .view-head h1 { font-size: 24px; }
  }

/* ============================================================
   결제 상태 배너 / 이용 한도 막대
   ============================================================
   .kiro/specs/postpaid-credit-limit, prepaid-auto-charge — 모든 화면 위에 뜨는 결제 상태 배너와
   결제 내역의 이용 한도 사용률 막대. 색은 today-banner와 같은 심각도 토큰을 쓴다. */
  .billing-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13px;
  }
  .billing-banner[hidden] { display: none; }
  .billing-banner.watch { background: var(--sev-medium-bg); color: var(--sev-medium); }
  .billing-banner.alert { background: var(--sev-high-bg); color: var(--sev-high); }
  .billing-banner .bb-text b { display: block; }
  .billing-banner .bb-text span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-muted); }
  .billing-banner .btn { flex: none; }
  .credit-usage { display: flex; align-items: center; gap: 8px; }
  .credit-bar { width: 200px; max-width: 60%; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
  .credit-bar span { display: block; height: 100%; background: var(--accent); }
  .credit-bar.is-warn span { background: var(--sev-medium); }
  .credit-bar.is-over span { background: var(--sev-high); }
  @media (max-width: 640px) {
    .billing-banner { flex-direction: column; align-items: stretch; }
  }

/* ============================================================
   요금제에 포함되지 않은 기능 / 보관기간 안내 (정산.md 2.1, 2.5)
   ============================================================ */
  .retention-note {
    padding: 8px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 12.5px;
    background: var(--surface-2); color: var(--text-muted);
  }
  .retention-note[hidden] { display: none; }
  .plan-lock-note { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); }
  .channel-card.is-locked .channel-head .name { color: var(--text-faint); }
  .toggle[disabled] { opacity: .45; cursor: not-allowed; }
