/* features/data-management/data-management.css — 데이터 관리 두 하위 방(2026-09-23 재설계).
   · 한 페이지 = 12트랙 격자 하나, span만 쓴다(시작선 지정 금지).
   · 강조색은 --ui-primary 하나. 성공·주의·위험은 의미 색이며 늘 글자·숫자와 함께 쓴다.
   · 버튼 겉모습은 index.html 「버튼 정규화 층」(.btn)이 정한다 — 여기서는 .btn의 배치만 다룬다.
   · 기기별 배치: 721~1179px은 폭이 아니라 화면비로 가른다 —
     거의 정사각(폴드 펼침 · 가로/세로 > 3/4)은 6트랙(카드 2열), 길쭉한 세로 태블릿은 데스크톱 12트랙 그대로. */

.dm-root.data-manager{
  --dm-gap:20px;
  --dm-radius:16px;
  --dm-text-2:color-mix(in srgb,var(--ui-text-secondary) 76%,var(--ui-text));
  --dm-line:var(--ui-border);
  /* 컨트롤 테두리 — --btn-line(흰 표면 3.06:1)은 캔버스(#f8fafc)·옅은 표면에서 2.8~2.9로 떨어진다(2026-09-23 실측). 글자 쪽으로 한 단 진하게. */
  --dm-line-strong:color-mix(in srgb,var(--btn-line) 82%,var(--ui-text));
  --dm-shadow:0 1px 2px rgba(15,23,42,.03),0 4px 12px rgba(15,23,42,.03);
  --dm-ok:var(--ui-success);
  --dm-warn:var(--ui-warning);
  --dm-bad:var(--ui-danger);
  max-width:1240px;
  margin:0 auto;
  padding:4px 0 84px;
  color:var(--ui-text);
  font-variant-numeric:tabular-nums;
  word-break:keep-all;
  overflow-wrap:break-word;
  min-width:0;
}
.dm-root *{box-sizing:border-box}
.dm-root :focus-visible{outline:2px solid var(--ui-focus);outline-offset:2px}
/* 방 이름 — 데스크톱 셸(≥768px, index.html 셸 규칙과 같은 경계)은 상단바(#kbgShellContext)가 「데이터 관리 · 하위 방」을 가지므로 본문에서는 읽기 전용으로 접는다(방 이름은 한 곳에만).
   셸 상단바가 없는 화면(모바일·오버레이 탈출 방)에서는 이 제목이 유일한 방 이름이라 보이게 둔다 — 어느 쪽이든 보이는 이름은 하나다. */
.dm-title{margin:0 0 12px;font-size:22px;font-weight:800;line-height:1.3;color:var(--ui-text)}
.dm-title__group{color:var(--dm-text-2);font-weight:700}
.dm-title:focus{outline:none}
/* 하위 방 전환 줄 — 상단바·사이드바가 없는 좁은 화면(<768)에서만. 넓은 화면은 사이드바 「데이터 관리」 하위 항목이 맡는다. */
.dm-subnav{display:none;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.dm-subnav .dm-tab{flex:1 1 0;justify-content:center}
@media (max-width:767px){ .dm-subnav{display:flex} }
@media (min-width:768px){ body.kbg-shell-on .dm-title{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0} }

/* ── 격자 ─────────────────────────────────────────────────────────────── */
.dm-page{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:var(--dm-gap);align-items:stretch;min-width:0}
.dm-s12{grid-column:span 12}
.dm-s8{grid-column:span 8}
.dm-s9{grid-column:span 9}
.dm-s4{grid-column:span 4}
.dm-s3{grid-column:span 3}
.dm-page>*{min-width:0}
.dm-cards{display:grid;grid-template-columns:subgrid;gap:var(--dm-gap);align-items:stretch}
.dm-fm-card{grid-column:span 4}
.dm-cards[data-layout="list"]>.dm-fm-card{grid-column:span 12}
.dm-preview:empty{display:none}
.dm-empty{margin:0;padding:18px;border:1px dashed var(--btn-line);border-radius:12px;color:var(--dm-text-2);font-size:13.5px;text-align:center}
.dm-root [hidden]{display:none !important}

/* ── 카드 공통 ─────────────────────────────────────────────────────────── */
.dm-card{display:flex;flex-direction:column;gap:12px;background:var(--ui-surface);border:1px solid var(--dm-line);border-radius:var(--dm-radius);padding:20px;box-shadow:var(--dm-shadow);min-width:0}
.dm-card__row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;min-width:0}
.dm-card__title{margin:0;font-size:15.5px;font-weight:700;line-height:1.35;color:var(--ui-text)}
.dm-card__meta{margin:0;font-size:12.5px;line-height:1.45;color:var(--dm-text-2)}
.dm-card__desc{margin:0;font-size:13px;line-height:1.6;color:var(--dm-text-2)}
.dm-note{margin:0;font-size:12.5px;line-height:1.55;color:var(--dm-text-2)}

.dm-chip-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;height:40px;border-radius:12px;background:var(--ui-primary-soft);color:var(--ui-primary)}
.dm-chip-icon .ui-icon{width:20px;height:20px}
.dm-chip-icon--primary{background:var(--ui-primary-soft);color:var(--ui-primary)}
.dm-chip-icon--success{background:color-mix(in srgb,var(--dm-ok) 13%,var(--ui-surface));color:var(--dm-ok)}
.dm-chip-icon--warning{background:color-mix(in srgb,var(--dm-warn) 14%,var(--ui-surface));color:var(--dm-warn)}
.dm-chip-icon--danger{background:color-mix(in srgb,var(--dm-bad) 12%,var(--ui-surface));color:var(--dm-bad)}

.dm-dot{display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:var(--ui-text-secondary);vertical-align:middle}
.dm-dot--ok{background:var(--dm-ok)}
.dm-dot--warn{background:var(--dm-warn)}
.dm-dot--bad{background:var(--dm-bad)}
.dm-dot--muted{background:var(--ui-text-secondary)}
.dm-tag{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--dm-line-strong);border-radius:999px;font-size:11.5px;font-weight:600;color:var(--dm-text-2);white-space:nowrap}
.dm-chip{display:inline-flex;align-items:center;min-height:20px;padding:0 7px;border-radius:999px;font-size:11px;font-weight:700;line-height:1}
.dm-chip--warn{background:color-mix(in srgb,var(--dm-warn) 14%,var(--ui-surface));color:color-mix(in srgb,var(--dm-warn) 78%,var(--ui-text))}

/* ── 머리(본문 제목은 상단바가 가진다 — 여기엔 설명·상태·주 동작만) ─────────────── */
.dm-head{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:4px 0 2px;min-width:0}
.dm-head__icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:48px;border-radius:14px;background:var(--ui-primary-soft);color:var(--ui-primary)}
.dm-head__icon .ui-icon{width:24px;height:24px}
.dm-head__text{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:6px}
.dm-head__sub{min-width:0;margin:0;font-size:14px;line-height:1.55;color:var(--dm-text-2)}
.dm-head__side{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-left:auto}
.dm-head__updated{font-size:12px;line-height:1.4;color:var(--dm-text-2);text-align:right}
.dm-head__updated b{color:var(--ui-text);font-weight:600}
.dm-ops{display:flex;flex-wrap:wrap;gap:4px 14px;margin:0;font-size:12.5px;color:var(--dm-text-2)}
.dm-ops__item{display:inline-flex;align-items:center;gap:6px;min-width:0}
.dm-ops abbr{text-decoration:none;border-bottom:1px dotted var(--btn-line);color:var(--ui-text);cursor:help}

/* ── KPI(시안 3: 아이콘 칩 · 이름 · 큰 수 · 한 줄 꼬리) ───────────────────────── */
.dm-kpi{flex-direction:row;align-items:flex-start;gap:14px;padding:18px}
.dm-kpi__body{display:flex;flex-direction:column;gap:4px;min-width:0}
.dm-kpi__label{margin:0;font-size:12.5px;font-weight:600;color:var(--dm-text-2)}
.dm-kpi__value{margin:0;font-size:var(--ui-font-metric);font-weight:800;line-height:1.15;color:var(--ui-text);letter-spacing:-.01em}
.dm-kpi__value--small{font-size:17px;line-height:1.35;font-weight:700}
.dm-kpi__foot{display:flex;align-items:center;gap:6px;margin:2px 0 0;font-size:12px;line-height:1.45;color:var(--dm-text-2)}

/* ── 분류별 데이터 수(세로 막대 · 좁으면 가로 막대) ────────────────────────────── */
.dm-chart{container-type:inline-size}
.dm-bars-wrap{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;min-width:0}
.dm-axis{list-style:none;margin:0;padding:22px 0 46px;display:flex;flex-direction:column;justify-content:space-between;font-size:11.5px;color:var(--dm-text-2);text-align:right;line-height:1;height:268px}
.dm-axis li{transform:translateY(-50%)}
.dm-axis li:last-child{transform:translateY(50%)}
.dm-bars{list-style:none;margin:0;padding:0;display:flex;align-items:stretch;gap:0;min-width:0;height:268px;
  background-image:repeating-linear-gradient(to bottom,var(--ui-border) 0 1px,transparent 1px 50px);background-repeat:no-repeat;background-size:100% 201px;background-position:0 22px}
.dm-bars__item{flex:1 1 0;min-width:0;display:flex}
.dm-bar{position:relative;flex:1;min-width:0;min-height:44px;display:flex;flex-direction:column;align-items:center;gap:0;padding:0;border:0;border-radius:8px;background:transparent;color:var(--ui-text);font:inherit;cursor:pointer}
.dm-bar:hover{background:color-mix(in srgb,var(--ui-surface-hover) 60%,transparent)}
.dm-bar__value{height:22px;display:flex;align-items:flex-end;justify-content:center;font-size:11.5px;font-weight:700;color:var(--ui-text);white-space:nowrap}
.dm-bar__track{position:relative;width:min(28px,70%);height:200px;display:flex;align-items:flex-end}
.dm-bar__fill{display:block;width:100%;height:calc(var(--dm-ratio,0) * 100%);min-height:2px;border-radius:6px 6px 0 0;background:var(--ui-primary)}
.dm-bar--unknown .dm-bar__fill,.dm-bar--zero .dm-bar__fill{min-height:0;height:0}
.dm-bar--unknown .dm-bar__track{border-bottom:2px dashed var(--btn-line)}
.dm-bar__label{height:46px;display:flex;align-items:flex-start;justify-content:center;padding-top:6px;font-size:11.5px;line-height:1.25;color:var(--dm-text-2);text-align:center;word-break:keep-all;overflow-wrap:break-word}
.dm-bar__tip{position:absolute;left:50%;bottom:calc(100% - 14px);transform:translateX(-50%);z-index:3;display:none;padding:6px 9px;border-radius:8px;background:var(--ui-text);color:var(--ui-surface);font-size:12px;font-weight:600;white-space:nowrap;width:max-content;pointer-events:none;box-shadow:0 4px 12px rgba(15,23,42,.18)}
.dm-bar:hover .dm-bar__tip,.dm-bar:focus-visible .dm-bar__tip{display:block}
/* 막대 16개 × 44px 터치 폭 + 눈금이 안 들어가면 가로 막대로 바꾼다(가짜로 좁히지 않는다). */
@container (max-width:745px){
  .dm-bars-wrap{grid-template-columns:minmax(0,1fr)}
  .dm-axis{display:none}
  .dm-bars{flex-direction:column;height:auto;gap:2px;background:none}
  .dm-bar{display:grid;grid-template-columns:minmax(64px,34%) minmax(0,1fr) auto;align-items:center;gap:10px;padding:0 6px;min-height:44px}
  .dm-bar__label{grid-column:1;grid-row:1;height:auto;padding:0;justify-content:flex-start;text-align:left;font-size:12.5px;color:var(--ui-text)}
  .dm-bar__track{grid-column:2;grid-row:1;width:100%;height:10px;border-radius:999px;background:var(--ui-surface-subtle);align-items:stretch}
  .dm-bar__fill{height:100%;width:calc(var(--dm-ratio,0) * 100%);min-width:2px;min-height:0;border-radius:999px}
  .dm-bar--unknown .dm-bar__fill,.dm-bar--zero .dm-bar__fill{min-width:0;width:0}
  .dm-bar--unknown .dm-bar__track{border:1px dashed var(--btn-line);background:transparent}
  .dm-bar__value{grid-column:3;grid-row:1;height:auto;font-size:12.5px}
  .dm-bar__tip{display:none !important}
}

/* ── 동기화 현황(도넛) ─────────────────────────────────────────────────── */
.dm-donut{position:relative;width:min(176px,100%);height:auto;aspect-ratio:1;margin:4px auto 0}
.dm-donut svg{width:100%;height:100%;transform:none}
.dm-donut__track{fill:none;stroke:var(--ui-surface-subtle);stroke-width:5.2}
.dm-donut__seg{fill:none;stroke-width:5.2}
.dm-donut__seg--ok{stroke:var(--dm-ok)}
.dm-donut__seg--bad{stroke:var(--dm-bad)}
.dm-donut__seg--warn{stroke:var(--dm-warn)}
.dm-donut__seg--muted{stroke:var(--ui-text-secondary)}
.dm-donut__center{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-align:center}
.dm-donut__center b{font-size:24px;font-weight:800;line-height:1.1;color:var(--ui-text)}
.dm-donut__center span{font-size:12px;color:var(--dm-text-2)}
.dm-donut__act{align-self:center}
.dm-subtle{margin-top:2px;border-top:1px solid var(--dm-line);padding-top:8px}
.dm-subtle>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:12.5px;font-weight:600;color:var(--dm-text-2)}
.dm-subtle>.dm-note{margin:0 0 8px}
.dm-legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.dm-legend li{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--ui-text)}
.dm-legend li span:nth-child(2){flex:1;min-width:0}
.dm-legend b{font-weight:700}

/* ── 품질 체크리스트 · 빠른 작업 ────────────────────────────────────────── */
.dm-check__list,.dm-quick__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.dm-check__list li+li{border-top:1px solid var(--dm-line)}
.dm-check__row{display:grid;grid-template-columns:32px minmax(0,1fr) auto 18px;align-items:center;gap:12px;width:100%;min-height:52px;padding:6px 4px;border:0;border-radius:10px;background:transparent;color:var(--ui-text);font:inherit;text-align:left;cursor:pointer}
.dm-check__row:hover{background:var(--ui-surface-hover)}
.dm-check__row .dm-chip-icon{flex-basis:32px;width:32px;height:32px;border-radius:9px}
.dm-check__row .dm-chip-icon .ui-icon{width:16px;height:16px}
.dm-check__label{font-size:13.5px;font-weight:600;line-height:1.4}
.dm-check__value{font-size:13px;color:var(--dm-text-2);white-space:nowrap}
.dm-check__chev{display:inline-flex;color:var(--ui-text-secondary);transform:rotate(-90deg)}
.dm-check__chev .ui-icon{width:16px;height:16px}
.dm-quick__list{gap:8px}
.dm-quick__row{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 12px;border:1px solid var(--dm-line);border-radius:12px;background:var(--ui-surface-subtle);color:var(--ui-text);font:inherit;text-align:left;cursor:pointer}
.dm-quick__row:hover{border-color:var(--btn-line);background:var(--ui-surface-hover)}
.dm-quick__row .dm-chip-icon{flex-basis:34px;width:34px;height:34px;border-radius:10px}
.dm-quick__row .dm-chip-icon .ui-icon{width:17px;height:17px}
.dm-quick__text{display:flex;flex-direction:column;gap:2px;min-width:0}
.dm-quick__text b{font-size:13.5px;font-weight:700}
.dm-quick__text small{font-size:12px;color:var(--dm-text-2)}

/* ── 영역별 상세 표 ─────────────────────────────────────────────────── */
.dm-table-card{outline:none}
.dm-table-scroll{min-width:0;overflow-x:auto}
.dm-table{width:100%;border-collapse:collapse;font-size:13px}
.dm-table th,.dm-table td{padding:9px 12px;text-align:left;vertical-align:middle;border-bottom:1px solid var(--dm-line)}
.dm-table thead th{font-size:12px;font-weight:700;color:var(--dm-text-2);white-space:nowrap}
.dm-table tbody th{font-weight:600;color:var(--ui-text);white-space:nowrap}
.dm-table td{color:var(--ui-text)}
.dm-table .dm-num{text-align:right;white-space:nowrap}
.dm-table__group th{padding-top:14px;font-size:12px;font-weight:700;letter-spacing:.02em;color:var(--dm-text-2);background:var(--ui-surface-subtle)}
.dm-table__row{transition:background-color .6s ease}
.dm-table__row.is-flash{background:var(--ui-primary-soft)}
.dm-state{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.dm-cloud-operation{display:grid;gap:6px;padding:12px;border:1px solid var(--dm-line);border-radius:10px;background:var(--ui-surface-subtle);font-size:13px}
.dm-cloud-operation small{color:var(--dm-text-2)}
.dm-cloud-progress{display:block;width:100%;height:12px;accent-color:var(--ui-primary)}
.dm-verdict{min-width:0;max-width:100%}
.dm-verdict__badge{display:inline-flex;align-items:center;min-height:30px;padding:3px 12px;border:1px solid currentColor;border-radius:999px;cursor:pointer;font-weight:700;list-style:none}
.dm-verdict__badge::-webkit-details-marker{display:none}
.dm-verdict__badge--ok{color:var(--dm-ok)}
.dm-verdict__badge--bad{color:var(--dm-bad)}
.dm-verdict__badge--warn{color:var(--dm-warn)}
.dm-verdict__badge--muted{color:var(--dm-text-2)}
.dm-verdict__detail{margin-top:8px;max-width:45ch;color:var(--dm-text-2);font-size:12.5px;line-height:1.5;overflow-wrap:break-word;word-break:keep-all}
/* 저장된 판정 배지 + 「확인하기」(형제 · 좁으면 줄바꿈) */
.dm-verdict-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.dm-verdict__act{min-height:44px;border-color:var(--dm-line-strong)}
.dm-verdict-row__meta{margin:6px 0 0;display:flex;flex-direction:column;gap:2px;font-size:12.5px;font-weight:500;line-height:1.5;color:var(--dm-text-2);overflow-wrap:break-word;word-break:keep-all}
.dm-verdict-row__names{color:var(--ui-text);font-weight:600}
.dm-verdict-row__result--ok{color:var(--dm-ok)}
.dm-verdict-row__result--warn{color:var(--dm-warn)}
.dm-table__go{white-space:nowrap}
@media (prefers-reduced-motion:reduce){.dm-table__row{transition:none}}

/* ── 백업/삭제(시안 1: 검색 + 분류 탭 + 카드 격자 + 최근 목록) ──────────────────── */
.dm-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.dm-search{position:relative;flex:1 1 320px;display:flex;align-items:center;gap:10px;min-height:46px;padding:0 14px;border:1px solid var(--dm-line-strong);border-radius:10px;background:var(--ui-surface-subtle);min-width:0}
.dm-search:focus-within{border-color:var(--ui-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--ui-primary) 12%,transparent)}
.dm-search>.ui-icon{width:18px;height:18px;flex:0 0 18px;color:var(--ui-text-secondary)}
.dm-search input{flex:1;min-width:0;height:44px;border:0;outline:0;background:transparent;color:var(--ui-text);font:400 14px 'Noto Sans KR',sans-serif}
.dm-search input::placeholder{color:var(--dm-text-2)}
.dm-toolbar__primary{flex:0 0 auto}
.dm-filterbar{display:flex;align-items:center;justify-content:space-between;gap:10px 16px;flex-wrap:wrap}
.dm-tabs,.dm-views{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.dm-tab{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0 14px;border:1px solid var(--dm-line-strong);border-radius:999px;background:var(--ui-surface);color:var(--dm-text-2);font:600 13px/1 'Noto Sans KR',sans-serif;white-space:nowrap;cursor:pointer}
.dm-tab .ui-icon{width:16px;height:16px}
.dm-tab:hover{background:var(--ui-surface-hover);color:var(--ui-text)}
.dm-tab[aria-pressed="true"]{border-color:var(--ui-primary);background:var(--ui-primary-soft);color:var(--ui-primary);font-weight:700}
.dm-tab__count{font-size:11.5px;font-weight:700;opacity:1}
.dm-views .dm-tab{border-radius:10px}

.dm-fm-card{gap:12px}
.dm-card__head{display:flex;align-items:center;gap:12px;min-width:0}
.dm-fm-card--action-top>.dm-card__head{min-height:64px}
.dm-card__titles{display:flex;flex-direction:column;gap:2px;min-width:0}
.dm-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto;min-width:0}
.dm-root .dm-action{max-width:100%;white-space:normal;text-align:left}
.dm-fm-card .dm-card-actions{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,160px),1fr));grid-auto-rows:minmax(52px,auto);align-content:start;gap:8px;margin-top:0;width:100%}
.dm-fm-card .dm-card-actions>.dm-action,.dm-fm-card .dm-card-actions>.dm-drive{width:100%;min-width:0}
.dm-fm-card .dm-card-actions .dm-action{width:100%;height:52px;min-height:52px;justify-content:flex-start}
.dm-btn-count{font-weight:700}
.dm-drive{display:inline-flex;flex-direction:column;gap:4px;max-width:100%}
.dm-reason{font-size:12px;line-height:1.45;color:var(--dm-text-2);max-width:280px}
.dm-form{display:flex;flex-direction:column;gap:10px;min-width:0}
.dm-pair{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;min-width:0}
.dm-pair>.dm-field{flex:1 1 200px}
.dm-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.dm-field__label{font-size:12px;font-weight:600;color:var(--dm-text-2)}
.dm-root .dm-select{width:100%;min-height:44px;margin:0;padding:0 10px;border:1px solid var(--dm-line-strong);border-radius:10px;background:var(--ui-surface);color:var(--ui-text);font:400 13.5px 'Noto Sans KR',sans-serif}
.dm-export-count{min-height:18px;font-size:12.5px;color:var(--dm-text-2)}
.dm-root .data-frequent-tools{display:flex;flex-wrap:wrap;gap:8px;max-width:none;flex:none}
.dm-root .data-tools-drawer{border:1px solid var(--dm-line);border-radius:12px;background:var(--ui-surface)}
.dm-root .data-tools-drawer>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:0 12px;cursor:pointer;color:var(--ui-text);font-size:13px;font-weight:600;list-style:none}
.dm-root .data-tools-drawer>summary::-webkit-details-marker{display:none}
.dm-root .data-tools-drawer>summary>span:first-child{display:inline-flex;align-items:center;gap:8px}
.dm-root .data-tools-drawer>summary .ui-icon{width:16px;height:16px;color:var(--ui-text-secondary)}
.dm-drawer__hint{font-size:12px;font-weight:500;color:var(--dm-text-2)}
.dm-root .data-tools-drawer>.dm-actions{padding:0 12px 12px}

/* 리스트 보기 — 한 줄에 머리 · 설명 · 버튼 */
.dm-cards[data-layout="list"]>.dm-fm-card{display:grid;grid-template-columns:minmax(200px,26%) minmax(0,1fr);align-items:start;gap:8px 20px}
.dm-cards[data-layout="list"]>.dm-fm-card>.dm-card__head{grid-row:span 3}
.dm-cards[data-layout="list"]>.dm-fm-card>*:not(.dm-card__head){grid-column:2}

/* 위험 구역 — 되돌릴 수 없는 삭제만. 일반 작업과 색·묶음을 섞지 않는다. */
.dm-danger-zone{display:grid;grid-template-columns:subgrid;gap:16px var(--dm-gap);padding:20px;border:1px solid color-mix(in srgb,var(--dm-bad) 50%,var(--ui-border));border-radius:var(--dm-radius);background:color-mix(in srgb,var(--dm-bad) 4%,var(--ui-surface))}
.dm-danger-zone__head{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.dm-danger-zone__head>div{flex:1 1 240px;min-width:0}
.dm-danger-zone .dm-card__title{color:var(--dm-bad)}
.dm-fm-card--danger{border-color:color-mix(in srgb,var(--dm-bad) 32%,var(--ui-border))}

/* 최근 작업 */
.dm-recent-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.dm-recent-row{display:grid;grid-template-columns:9px minmax(0,1fr) auto auto;align-items:center;gap:12px;min-height:48px;padding:6px 2px;border-bottom:1px solid var(--dm-line)}
.dm-recent-row__label{font-size:13.5px;font-weight:600;min-width:0}
.dm-recent-row__time{font-size:12.5px;color:var(--dm-text-2);white-space:nowrap}
.dm-facts{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:0}
.dm-facts>div{min-width:0;padding:12px;border-radius:12px;background:var(--ui-surface-subtle)}
.dm-facts dt{font-size:12px;font-weight:600;color:var(--dm-text-2)}
.dm-facts dd{margin:4px 0 0;font-size:13.5px;font-weight:600;color:var(--ui-text)}

/* Google Drive 백업 진행 창 — ZIP 준비와 업로드, 되읽기 상태를 분리한다. */
.dm-backup-dialog{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:16px;background:rgba(0,0,0,.55)}
.dm-backup-dialog[hidden]{display:none}
.dm-backup-dialog__panel{width:min(100%,480px);max-height:calc(100dvh - 32px);overflow:auto;padding:22px;border:1px solid var(--ui-border);border-radius:16px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 18px 50px rgba(0,0,0,.25)}
.dm-backup-dialog__head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dm-backup-dialog__head h2{margin:0;font-size:18px;line-height:1.4}
.dm-backup-dialog__close{width:44px;height:44px;border:0;border-radius:10px;background:transparent;color:var(--ui-text);font-size:var(--ui-font-metric);cursor:pointer}
.dm-backup-dialog__close:hover{background:var(--ui-surface-hover)}
.dm-backup-dialog__status{min-height:2.8em;margin:16px 0 10px;font-size:14px;line-height:1.5}
.dm-backup-dialog__meter{display:flex;align-items:center;gap:12px}
.dm-backup-dialog__meter[hidden]{display:none}
.dm-backup-dialog__meter progress{flex:1;min-width:0;height:12px;accent-color:var(--ui-primary)}
.dm-backup-dialog__meter strong{min-width:42px;text-align:right;font-size:14px}
.dm-backup-dialog__details{margin-top:14px;border-top:1px solid var(--ui-border);font-size:12px}
.dm-backup-dialog__details summary{padding:10px 0;cursor:pointer;font-weight:700}
.dm-backup-dialog__details ol{max-height:160px;overflow:auto;margin:0 0 8px;padding-left:22px;line-height:1.6;color:var(--ui-text-secondary)}
.dm-backup-dialog__details li{overflow-wrap:anywhere}
.dm-backup-dialog__facts{display:grid;gap:8px;margin:16px 0}
.dm-backup-dialog__facts>div{min-width:0;padding:10px 12px;border-radius:10px;background:var(--ui-surface-subtle)}
.dm-backup-dialog__facts dt{font-size:12px;color:var(--ui-text-secondary)}
.dm-backup-dialog__facts dd{overflow-wrap:anywhere;margin:4px 0 0;font-size:13px;font-weight:600}
.dm-backup-dialog__missing{max-height:180px;overflow:auto;border-top:1px solid var(--ui-border);font-size:12px}
.dm-backup-dialog__missing[hidden]{display:none}
.dm-backup-dialog__missing summary{padding:9px 0;cursor:pointer;font-weight:600}
.dm-backup-dialog__missing ul{margin:0 0 8px;padding-left:20px;overflow-wrap:anywhere;line-height:1.5}
.dm-backup-dialog__note{min-height:2.5em;margin:10px 0;font-size:12px;line-height:1.5;color:var(--ui-text-secondary)}
.dm-backup-dialog__actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}
.dm-backup-dialog__actions [hidden]{display:none}

/* 저장된 운영 복원 드릴 — 네이티브 대화상자의 초점·Escape 계약을 사용한다. */
.dm-drill{margin:auto;width:min(720px,calc(100% - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:0;border:1px solid var(--ui-border);border-radius:18px;background:var(--ui-surface);color:var(--ui-text);box-shadow:0 20px 70px rgba(0,0,0,.28);overflow:hidden;font-variant-numeric:tabular-nums;word-break:keep-all;overflow-wrap:anywhere}
.dm-drill::backdrop{background:rgba(15,23,42,.5)}
.dm-drill[open]{display:flex;flex-direction:column}
.dm-drill *{box-sizing:border-box}
.dm-drill__head,.dm-drill__footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 22px;flex-shrink:0}
.dm-drill__head{border-bottom:1px solid var(--ui-border)}
.dm-drill__head small,.dm-drill__footer span{color:var(--ui-text-secondary);font-size:12px}
.dm-drill__head h2{margin:4px 0 0;font-size:19px;line-height:1.4}
.dm-drill__head .btn{flex-shrink:0}
.dm-drill__body{padding:20px 22px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--ui-border) transparent;min-height:0}
.dm-drill__body::-webkit-scrollbar{width:6px}
.dm-drill__body::-webkit-scrollbar-thumb{background:var(--ui-border);border-radius:8px}
.dm-drill__footer{border-top:1px solid var(--ui-border)}
.dm-drill__summary p{margin:10px 0 6px;font-size:14px;line-height:1.5}
.dm-drill__summary small{color:var(--ui-text-secondary);font-size:12px;line-height:1.5}
.dm-drill__badge{display:inline-flex;align-items:center;padding:5px 10px;border-radius:8px;font-size:12px;font-weight:700;line-height:1.4;background:var(--ui-surface-subtle);color:var(--ui-text-secondary);flex-shrink:0}
.dm-drill__badge--ok{color:var(--ui-success);background:color-mix(in srgb,var(--ui-success) 9%,var(--ui-surface))}
.dm-drill__badge--todo{color:var(--ui-warning);background:color-mix(in srgb,var(--ui-warning) 9%,var(--ui-surface))}
.dm-drill__metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}
.dm-drill__metrics>div{padding:14px 16px;border:1px solid var(--ui-border);border-radius:12px;background:var(--ui-surface-subtle)}
.dm-drill__metrics dt{font-size:12px;color:var(--ui-text-secondary)}
.dm-drill__metrics dd{margin:5px 0 0;font-size:var(--ui-font-metric);font-weight:800;line-height:1.35}
.dm-drill__metrics dd small{display:block;font-size:12px;font-weight:500;color:var(--ui-text-secondary);margin-top:2px}
.dm-drill__checks{margin:0;padding:0;list-style:none}
.dm-drill__checks li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--ui-border)}
.dm-drill__checks b{font-size:13px}
.dm-drill__checks small{display:block;margin-top:3px;color:var(--ui-text-secondary);font-size:12px;line-height:1.45}
.dm-drill__details{margin:16px 0 0;font-size:12.5px;line-height:1.5}
.dm-drill__details summary{padding:6px 0;font-weight:700;cursor:pointer}
.dm-drill__details ul{margin:6px 0 0;padding-left:20px;color:var(--ui-text-secondary)}
.dm-drill__details li+li{margin-top:6px}
.dm-drill__note{font-size:12px;line-height:1.5;color:var(--ui-text-secondary);margin:14px 0 0}
.dm-drill__facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0 0;padding-top:14px;border-top:1px solid var(--ui-border)}
.dm-drill__facts dt{font-size:12px;color:var(--ui-text-secondary)}
.dm-drill__facts dd{margin:4px 0 0;font-size:12px;line-height:1.5}
.dm-drill__empty{padding:24px 0;font-size:14px;line-height:1.5}
@media(max-width:479px){.dm-drill{width:calc(100% - 16px);max-height:calc(100dvh - 16px);border-radius:14px}.dm-drill__head,.dm-drill__footer{padding:12px 16px}.dm-drill__body{padding:16px}.dm-drill__head h2{font-size:17px}.dm-drill__facts{grid-template-columns:minmax(0,1fr)}.dm-drill__checks li{align-items:flex-start}.dm-drill__checks .dm-drill__badge{font-size:11px;padding:4px 7px}.dm-drill__metrics>div{padding:12px}.dm-drill__metrics dd{font-size:23px}}

/* ── 반응형: 트랙 수만 줄인다(좁은 규칙을 뒤에) ───────────────────────────── */
@media (max-width:959px){ .dm-root.data-manager{--dm-gap:16px} }
/* 폴드 펼침·가로 태블릿(721~1179 · 거의 정사각 이상) — 6트랙 · 카드 2열 */
@media (max-width:1179px){
  .dm-page{grid-template-columns:repeat(6,minmax(0,1fr))}
  .dm-s12,.dm-s9,.dm-s8,.dm-s4{grid-column:span 6}
  .dm-s3,.dm-fm-card{grid-column:span 3}
  .dm-wide{grid-column:span 6}
  .dm-cards[data-layout="list"]>.dm-fm-card{grid-column:span 6}
  .dm-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:719px){
  .dm-page{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dm-s12,.dm-s9,.dm-s8,.dm-s4,.dm-fm-card,.dm-cards[data-layout="list"]>.dm-fm-card{grid-column:span 2}
  .dm-s3{grid-column:span 1}
  .dm-wide{grid-column:span 2}
  .dm-cards[data-layout="list"]>.dm-fm-card{display:flex}
  .dm-head__side{margin-left:0;width:100%}
  .dm-head__updated{text-align:left;flex:1 1 auto}
  .dm-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  /* 표 → 행 카드(여러 칸 표는 좁은 화면에서 이름이 글자 단위로 끊긴다) */
  .dm-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .dm-table,.dm-table tbody,.dm-table tr{display:block;width:100%}
  .dm-table__group th{display:block;border-bottom:0;border-radius:8px}
  .dm-table__row{display:grid !important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 12px;padding:10px 4px;border-bottom:1px solid var(--dm-line)}
  .dm-table__row th{grid-column:span 2;align-self:center;padding:0;border:0;white-space:normal}
  .dm-table__row td{display:flex;flex-direction:column;gap:2px;padding:0;border:0;text-align:left !important;white-space:normal}
  .dm-table__row td::before{content:attr(data-label);color:var(--dm-text-2);font-size:11.5px;font-weight:600}
  .dm-table__row td[data-label="작업"]{order:-1;grid-column:span 1;align-items:flex-end}
  .dm-table__row th{order:-2}
  .dm-table__row td[data-label="작업"]::before{content:none}
  .dm-table__row td[data-label="클라우드 대조"],.dm-table__row td.dm-note-cell{grid-column:span 3;flex-direction:row;justify-content:space-between;align-items:center}
  .dm-table__row td.dm-note-cell.is-empty,.dm-table__row td:empty{display:none}
  .dm-state{white-space:normal}
}
@media (max-width:479px){
  .dm-root.data-manager{--dm-gap:12px}
  .dm-page{grid-template-columns:minmax(0,1fr)}
  .dm-s12,.dm-s9,.dm-s8,.dm-s4,.dm-s3,.dm-fm-card,.dm-cards[data-layout="list"]>.dm-fm-card{grid-column:span 1}
  .dm-card,.dm-danger-zone{padding:16px}
  .dm-kpi{padding:14px}
  .dm-kpi__value{font-size:24px}
  .dm-head__icon{display:none}
  .dm-facts{grid-template-columns:minmax(0,1fr)}
  .dm-verdict__act{flex:1 1 100%}
  .dm-recent-row{grid-template-columns:9px minmax(0,1fr) auto;grid-auto-rows:auto}
  .dm-recent-row__time{grid-column:2/-1}
  .dm-toolbar__primary{flex:1 1 100%}
}
