/* MediMind Lite — 운영자 화면(/master). style.css 를 불러오지 않는 별도 화면입니다.
 * 운영자 화면은 초록 표시색(--accent)을 그대로 두고, 상태 색(오류 · 주의 · 정상 · 복구)만 앱과 같은 값을 씁니다 (디자인 명세 §5.24, §9.4).
 * CSP 가 style 속성을 막으므로 모든 모양은 이 파일의 class/속성 선택자로만 정합니다. */
:root {
  /* 운영자 화면 고유 색 (유지) */
  --ink: #16302b; --ink-2: #3d4b5a; --muted: #5f6f6b; --line: #d8e1de; --paper: #f7f9f8; --card: #fff;
  --accent: #176459; --accent-hover: #0f4a42; --accent-soft: #e6f0ee;
  /* 앱과 같은 상태 색 */
  --warn: #8a3b2c; --warn-soft: #fbefeb; --warn-line: #e6c9bf;
  --order: #8a5a12; --order-ink: #7a4f0f; --order-soft: #fdf6e8; --order-line: #e2c48f;
  --ok: #2d6a57; --ok-soft: #e8f3ef; --ok-line: #a8cdbd;
  --recover-soft: #eef4fa; --recover-line: #8fb0cf;
  /* 선 · 입력 · 비활성 (투명도 대신 정해진 색) */
  --line-soft: #e7ecf2; --line-input: #7d8da1; --sunken: #f1f5f3;
  --disabled-bg: #e7ecf2; --disabled-ink: #6b7886;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --e2: 0 8px 28px #182c4330;
  --dur: 140ms;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 윗줄: 로고 · master 표시 · 계정 · 로그아웃 */
.top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
/* 로고(2026-10-14): 투자자 랜딩 페이지와 같은 맥박 표시(#0b7a72)와 글자. */
.brand, .brand:hover { display: inline-flex; align-items: center; gap: 9px; font: 700 22px/1 "IBM Plex Sans Condensed", "IBM Plex Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif; letter-spacing: -.01em; color: #0f1f26; text-decoration: none; white-space: nowrap; }
.brand svg { display: block; width: 28px; height: 28px; flex: none; }
.mk-bg { fill: #0b7a72; }
.mk-ln { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px; }
.who { margin-left: auto; min-width: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 20px 28px; }
h1 { font-size: 20px; line-height: 1.4; font-weight: 700; margin: 0 0 16px; }
/* 기능 디자인 링크(2026-10-14): 운영자(개발자)만 보는 2026-10-09 소개 페이지 시안으로 갑니다. */
.dev-link { margin: -10px 0 16px; font-size: 14px; }
h2 { font-size: 16px; line-height: 1.4; font-weight: 700; margin: 24px 0 10px; }
h2 .muted { font-weight: 400; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; margin-bottom: 16px; min-width: 0; }
.card > h2:first-child { margin-top: 0; }
.card > p.muted { margin: 8px 0 0; }
.card p { overflow-wrap: anywhere; }
.card > table { margin-top: 12px; }
.boot { color: var(--muted); }

/* 표 */
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody > tr:last-child > td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: 12px; padding: 8px; vertical-align: bottom; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.muted { font-size: 13px; font-variant-numeric: tabular-nums; }
td.cell-act { text-align: right; white-space: nowrap; }
td.cell-act .cell-v { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }

/* 병원 상태: 점 + 글자(활성), 경고 알약(정지). 색만으로 구분하지 않습니다. */
.status-active .cell-v, .status-suspended .cell-v { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.status-active { color: var(--ok); }
.status-active .cell-v::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.status-suspended { color: var(--warn); }
.status-suspended .cell-v { height: 22px; padding: 0 8px; border-radius: 999px; background: var(--warn-soft); box-shadow: inset 0 0 0 1px var(--warn-line); font-size: 12.5px; font-weight: 700; }
tr:has(> td.status-suspended) > td { background: var(--paper); }
tr:has(> td.status-suspended) > td.cell-title strong { color: var(--ink-2); }

/* 입력 */
form.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--muted); }
input { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-input); border-radius: 6px; background: var(--card); min-width: 200px; }
input::placeholder { color: #697683; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #1764592e; outline: none; }
input:focus-visible { outline: none; }
input.short { min-width: 64px; width: 72px; min-height: 36px; padding: 0 8px; text-align: right; font-variant-numeric: tabular-nums; }
form.row label:first-child input { width: 280px; }
form.row input[type="email"] { width: 320px; }
/* 체크 상자 + 글(진료 사용 · 테스트 의원, 2026-10-15) */
label.check { flex-direction: row; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; color: var(--ink); }
label.check input { min-width: 0; min-height: 0; width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
form.row input[type="file"] { min-width: 220px; padding: 6px 8px; }
.row-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }

/* 버튼: 한 표면에 채운 버튼 하나. 나머지는 테두리 또는 조용한 버튼. */
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 40px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; transition: background-color var(--dur), border-color var(--dur); }
button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.quiet { background: transparent; border-color: transparent; color: var(--accent); }
button.quiet:hover { background: var(--accent-soft); }
button.danger { border-color: var(--warn); color: var(--warn); background: var(--card); }
button.danger:hover { background: var(--warn-soft); }
/* 표 안의 버튼은 작게, 채운 색 없이(재개 = 초록 테두리). */
td button { min-height: 32px; padding: 0 10px; font-size: 13px; }
td button:not(.quiet):not(.danger) { background: var(--card); color: var(--accent); }
td button:not(.quiet):not(.danger):hover { background: var(--accent-soft); }
#backup-schedule-form button { background: var(--card); color: var(--accent); }
#backup-schedule-form button:hover { background: var(--accent-soft); }
#logout { min-height: 40px; }
button:disabled, button.quiet:disabled, button.danger:disabled, td button:disabled, #backup-schedule-form button:disabled { background: var(--disabled-bg); color: var(--disabled-ink); border-color: transparent; cursor: not-allowed; }
button[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: m-spin .8s linear infinite; flex: 0 0 auto; }
@keyframes m-spin { to { transform: rotate(360deg); } }

/* 알림(토스트) */
.notice { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); max-width: min(560px, calc(100vw - 24px)); min-height: 44px; display: flex; align-items: center; background: var(--ink-2); color: #fff; padding: 12px 16px; border-radius: 6px; font-size: 13.5px; line-height: 1.5; box-shadow: var(--e2); z-index: 20; overflow-wrap: anywhere; }
.notice.error { background: var(--warn); }

.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.break { overflow-wrap: anywhere; word-break: break-all; }
.nowrap { white-space: nowrap; }
.cell-v { min-width: 0; }
.selectable { user-select: all; }

/* 로그인 전 */
.login { text-align: center; padding: 60px 0; }
.login p { word-break: keep-all; }
.google-login { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; }
.google-login:hover { background: var(--accent-hover); color: #fff; }
details summary { cursor: pointer; color: var(--accent); }

/* 초대: 같은 초대가 이미 있을 때 — 복구 모양(점선 + 문서 아이콘), 빨간색 아님 */
.note[data-kind="recovery"] { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: center; margin: 12px 0 0; padding: 10px 12px 10px 14px; border: 1px dashed var(--recover-line); border-left: 4px solid var(--accent); border-radius: 6px; background: var(--recover-soft); font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink); word-break: keep-all; }
.note[data-kind="recovery"]::before { content: ""; width: 20px; height: 20px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5M10 13h6M10 17h6'/%3E%3C/svg%3E") center / 20px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h7l5 5v13H7z'/%3E%3Cpath d='M14 3v5h5M10 13h6M10 17h6'/%3E%3C/svg%3E") center / 20px no-repeat; }
tr.is-flash > td { background: var(--accent-soft); transition: background-color .4s; }
tr.is-flash > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* 운영 패널: 최근 오류 · 의견 / 거부된 로그인 · DB 백업 (1100px 이상 2×2) */
.panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1100px) { .panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.panel { margin-bottom: 0; display: flex; flex-direction: column; max-height: 408px; padding: 0 16px 12px; overflow: hidden; }
.panel-head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: 48px; margin: 0 0 12px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head button { margin-left: auto; min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.panel > p { margin: 0 0 4px; }
.panel-body { flex: 1 1 auto; overflow: auto; max-height: 360px; min-height: 0; }
.panel-body table { font-size: 13.5px; }
.panel-body th, .panel-body td { padding: 8px 6px; border-bottom-color: var(--line-soft); }
.panel-body td { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; min-height: 36px; }
.panel-body thead th { position: sticky; top: 0; background: var(--card); z-index: 1; border-bottom-color: var(--line); }
.panel-body > p.muted { margin: 4px 0 0; font-size: 13.5px; }
.panel-error { color: var(--warn); margin: 0 0 8px; }

/* 넓은 화면의 패널 표: 열 너비를 고정해 병원 이름 · 사용자 이름이 글자 단위로 쪼개지지 않게 합니다. */
@media (min-width: 721px) {
  table:has(td.cell-act) > thead th:last-child { text-align: right; }
  .panel-body table { table-layout: fixed; }
  .panel-body td { word-break: keep-all; overflow-wrap: anywhere; }
  #panel-errors th:nth-child(1), #panel-rejections th:nth-child(1), #panel-db th:nth-child(1) { width: 96px; }
  #panel-errors th:nth-child(2) { width: 112px; }
  #panel-errors th:nth-child(4) { width: 76px; }
  #panel-errors th:nth-child(5) { width: 120px; }
  #panel-errors td:nth-child(4) .muted { display: block; font-size: 12px; }
  /* 최근 오류: 경로와 상태 코드는 한 줄로 읽혀야 합니다. 표가 칸보다 넓으면 줄을 바꾸지 않고 칸 안에서 가로로 스크롤합니다. */
  #panel-errors table { table-layout: auto; width: max-content; min-width: 100%; }
  #panel-errors td { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
  #panel-errors td:nth-child(2) { white-space: normal; word-break: keep-all; min-width: 96px; }
  #panel-errors .panel-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* 가로로 더 있다는 것을 보이게: 겹쳐 사라지는 스크롤 막대 대신 늘 보이는 얇은 막대(WebKit/Blink). */
  #panel-errors .panel-body::-webkit-scrollbar { width: 8px; height: 8px; }
  #panel-errors .panel-body::-webkit-scrollbar-track { background: var(--paper); border-radius: 4px; }
  #panel-errors .panel-body::-webkit-scrollbar-thumb { background: var(--line-input); border-radius: 4px; }
  #panel-rejections th:nth-child(3) { width: 120px; }
  #panel-db th:nth-child(2) { width: 56px; }
  #panel-db th:nth-child(4) { width: 76px; }
  #panel-db th:nth-child(5) { width: 96px; }

  /* 의견: 표 대신 한 건씩 쌓는 목록 — 위 줄에 시각 · 병원 · 사용자 · 화면, 아래 줄에 내용, 오른쪽에 읽음 표시 */
  #panel-feedback thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #panel-feedback table, #panel-feedback tbody { display: block; }
  #panel-feedback tr[data-feedback] { display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; column-gap: 6px; row-gap: 4px; align-items: baseline; padding: 10px 8px 10px 12px; border-bottom: 1px solid var(--line-soft); }
  #panel-feedback tr[data-feedback] > td { display: block; padding: 0; border: 0; font-size: 12.5px; line-height: 1.5; min-height: 0; }
  #panel-feedback tr[data-feedback] > td:nth-child(n+2):nth-child(-n+4)::before { content: "· "; color: var(--muted); font-weight: 400; }
  #panel-feedback tr[data-feedback] > td > .cell-v { display: inline; }
  #panel-feedback tr[data-feedback] > td:nth-child(5) > .cell-v { display: block; }
  #panel-feedback tr[data-feedback] > td:nth-child(4) br { display: none; }
  #panel-feedback tr[data-feedback] > td:nth-child(4) .muted.mono { margin-left: 4px; }
  #panel-feedback tr[data-feedback] > td:nth-child(5) { grid-column: 1 / 5; grid-row: 2; font-size: 14px; }
  #panel-feedback tr[data-feedback] > td:nth-child(6) { grid-column: 5; grid-row: 1 / span 2; align-self: start; text-align: right; }
  #panel-feedback tr[data-state="new"] { box-shadow: inset 3px 0 0 var(--accent); }
  #panel-feedback tr[data-state="new"] > td:first-child { box-shadow: none; }
}

/* 개수 배지 · 상태 알약 */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-variant-numeric: tabular-nums; }
.badge[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.badge[data-tone="accent"] { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-input); font-variant-numeric: tabular-nums; vertical-align: middle; }
.pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn-line); }
.pill[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok-line); }

/* 의견: 새 의견은 왼쪽 초록 막대 + 굵은 줄, 읽은 의견은 흐리게 */
.feedback-trail { margin-top: 6px; font-size: 12px; }
.feedback-trail summary { cursor: pointer; color: var(--muted, #5b6472); }
.feedback-trail ol { max-height: 14em; overflow: auto; margin: 4px 0 0; padding-left: 22px; line-height: 1.5; overflow-wrap: anywhere; }
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; max-height: 9.3em; overflow: auto; font-size: 14px; line-height: 1.55; }
tr[data-state="new"] > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr[data-state="new"] > td { font-weight: 600; }
tr[data-state="new"] .feedback-text { font-weight: 400; }
tr[data-state="read"] > td { color: var(--muted); }
#panel-feedback td, #panel-rejections td { vertical-align: top; }

/* DB 백업 상태 줄 */
.db-status { margin: 0 0 4px; font-size: 15px; font-weight: 700; line-height: 1.45; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.db-status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.db-status[data-tone="ok"] { color: var(--ok); }
.db-status[data-tone="warn"] { color: var(--warn); }
.db-status[data-tone="none"] { color: var(--muted); font-weight: 600; }
#panel-db .db-status + p.muted { margin: 0 0 8px 16px; }

/* 서버 · 백업 (2026-10-14): 맨 위 두 카드 — 재고 자동 백업 일정(넓게) · 서버 용량 */
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (min-width: 1100px) { .dash { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; } }
.dash > .card { margin-bottom: 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.card-head h2 { margin: 0; }
.card-head button { margin-left: auto; min-height: 36px; padding: 0 12px; font-size: 13.5px; }
#card-backup .db-status { margin: 0 0 12px; }
#card-backup form.row { margin-bottom: 4px; }
select { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); min-height: 40px; padding: 8px 32px 8px 12px; border: 1px solid var(--line-input); border-radius: 6px; background: var(--card); min-width: 160px; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #1764592e; outline: none; }
input.days { min-width: 0; width: 120px; font-variant-numeric: tabular-nums; }
.disk-free { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 8px; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ok); }
.disk-free[data-tone="warn"] { color: var(--warn); }
.disk-free .muted { color: var(--muted); }
.disk-meter { display: block; width: 100%; height: 12px; margin: 0 0 12px; }
.note-warn { margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--warn-line); border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 600; }
#card-storage table { margin-top: 0; }
#card-storage td, #card-storage th { padding: 7px 8px; }
tr.sum-row > td { border-top: 1px solid var(--line); }

/* 손가락 입력: 누를 곳은 최소 44px */
@media (pointer: coarse) {
  button, input, .google-login { min-height: 44px; }
  td button, .panel-head button, input.short { min-height: 44px; }
}

/* 휴대폰: 표를 이름표 달린 카드로 (열을 숨기지 않고 모두 보여 줌) */
@media (max-width: 720px) {
  .top { padding: 8px 12px; gap: 8px; }
  .who { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
  .brand { gap: 8px; font-size: 19px; }
  .brand svg { width: 24px; height: 24px; }
  .tag { flex: 0 0 auto; }
  #logout { flex: 0 0 auto; white-space: nowrap; padding: 0 8px; }
  main { padding: 12px 12px 24px; }
  .card { padding: 12px; }
  input, form.row label:first-child input, form.row input[type="email"] { min-width: 0; width: 100%; font-size: 16px; min-height: 48px; }
  input.short { width: 88px; font-size: 16px; min-height: 44px; }
  form.row > label { flex: 1 1 100%; }
  select, input.days { width: 100%; font-size: 16px; min-height: 48px; }
  form.row > button { width: 100%; min-height: 48px; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tr { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; background: var(--card); }
  tbody > tr:last-child > td, td { border: 0; }
  td, .panel-body td { padding: 4px 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; align-items: baseline; min-height: 36px; text-align: left; overflow-wrap: anywhere; }
  td.num { text-align: left; }
  td::before { content: attr(data-label); font-size: 12px; font-weight: 700; color: var(--muted); }
  td.cell-title, td.cell-act, td[colspan] { display: block; }
  td.cell-title::before, td.cell-act::before, td[colspan]::before { content: none; }
  td.cell-title { font-size: 15px; font-weight: 600; }
  td.cell-act { padding-top: 8px; white-space: normal; }
  td.cell-act .cell-v { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  td.cell-act button { width: 100%; min-height: 44px; }
  .status-active .cell-v, .status-suspended .cell-v { justify-self: start; }
  tr:has(> td.status-suspended) { background: var(--paper); }
  tr:has(> td.status-suspended) > td { background: transparent; }
  tr.detail-row { padding: 0; border: 0; background: transparent; }
  tr.detail-row tr { background: var(--sunken); }
  .panel { max-height: none; padding: 0 12px 12px; }
  .panel-body { max-height: none; overflow: visible; }
  tr[data-state="new"] > td:first-child { box-shadow: none; }
  tr[data-state="new"] { box-shadow: inset 3px 0 0 var(--accent); }
  tr.is-flash { background: var(--accent-soft); }
  tr.is-flash > td { background: transparent; }
  tr.is-flash > td:first-child { box-shadow: none; }
  .notice { top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); left: 12px; right: 12px; transform: none; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* AI 모델 · API 키 (U18) */
#card-ai .db-status { flex-wrap: wrap; font-size: 14px; color: var(--ink); }
#card-ai form.row { margin-top: 10px; }
#card-ai .ai-model { width: 260px; font-family: var(--mono); font-size: 13px; }
#card-ai .ai-src { font-weight: 400; font-size: 12px; }
#card-ai input[name="key"] { font-family: var(--mono); }
/* U23: 제공자별 키 줄 · 모델 선택 체크 목록 */
#card-ai .ai-conns { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--line); }
#card-ai .ai-conn { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
#card-ai .ai-conn .muted { font-size: 12.5px; }
#card-ai .ai-conn button { margin-left: auto; }
#card-ai .ai-conn-none { font-size: 13px; }
#card-ai .ai-add { align-items: flex-end; }
#card-ai .ai-add select { min-width: 190px; }
#card-ai .ai-add-key input { width: 300px; }
#card-ai .ai-sub { margin: 22px 0 8px; font-size: 14px; font-weight: 700; }
#card-ai .ai-pick { margin: 0 0 12px; padding: 0; border: 0; }
#card-ai .ai-pick legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
#card-ai .ai-pick-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#card-ai .ai-pick-row .mono { overflow-wrap: anywhere; }
/* 체크 상자: 일반 입력 칸 크기(min-width 200px · min-height 40px)를 물려받지 않게 */
#card-ai .ai-pick-row input[type="checkbox"] { width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
#card-ai .ai-pick-row { cursor: pointer; font-weight: 400; color: var(--ink); }
#card-ai .ai-pick-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-bottom: 10px; }
#card-ai .ai-prov { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0; padding: 0; border: 0; min-height: 40px; }
#card-ai .ai-prov legend { float: left; margin-right: 4px; padding: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
#card-ai .ai-prov label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; color: var(--ink); cursor: pointer; }
#card-ai .ai-prov input { width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
#card-ai .ai-sort { display: flex; gap: 6px; }
#card-ai .ai-sort-btn { min-width: 76px; }
#card-ai .ai-sort-btn { border: 1px solid var(--line-input); background: var(--card); color: var(--ink-2); font-weight: 400; }
#card-ai .ai-add-ws input { width: 240px; font-family: var(--mono); }
#card-ai .ai-sort-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; background: var(--card); }
#card-ai .ai-search input { width: 240px; min-width: 0; }
#card-ai .ai-latest { flex-direction: row; align-items: center; gap: 6px; min-height: 40px; font-weight: 400; color: var(--ink); }
#card-ai .ai-latest input { width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
#card-ai .ai-pick-row { grid-template-columns: 18px minmax(0, 1fr) auto minmax(0, 34%); }
#card-ai .ai-pick-price { font-size: 12px; text-align: right; }
#card-ai .ai-pick-none { margin: 8px 0; font-size: 13px; }
#card-ai .ai-price-note { margin: 4px 0 10px; font-size: 12px; }
#card-ai .ai-chosen { list-style: none; margin: 0 0 6px; padding: 0; border-top: 1px solid var(--line); }
#card-ai .ai-chosen li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 40%); align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#card-ai .ai-chosen .mono { overflow-wrap: anywhere; }
#card-ai .ai-pick-list { max-height: 300px; overflow-y: auto; border-top: 1px solid var(--line); }
@media (max-width: 720px) {
  #card-ai form.row label, #card-ai .ai-model, #card-ai form.row label:first-child input { width: 100%; }
  #card-ai .ai-add select, #card-ai .ai-add-key input, #card-ai .ai-add-ws input { width: 100%; min-width: 0; }
  #card-ai .ai-pick-row, #card-ai .ai-chosen li { grid-template-columns: 18px minmax(0, 1fr); } #card-ai .ai-chosen li { grid-template-columns: minmax(0, 1fr); }
  #card-ai .ai-pick-row .ai-pick-tag, #card-ai .ai-pick-row .ai-pick-price { grid-column: 2; text-align: left; }
  #card-ai .ai-chosen .ai-pick-price { text-align: left; }
  #card-ai .ai-search, #card-ai .ai-search input { width: 100%; }
}
