/* CSS 변수 — JSON 스키마의 app.primaryColor / app.fontSize 로 재정의됨 */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-danger: #dc2626;
  --color-changed: #2563eb;
  --font-size-base: 13px;
  --sidebar-width: 480px;
  --toolbar-height: 40px;
  --border: 1px solid #d1d5db;
  --radius: 4px;
  --bg-section: #f9fafb;
  --bg-header: #f3f4f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--font-size-base);
  color: #111;
  background: #fff;
  height: 100vh;
  overflow: hidden;
}

/* ── 로그인 ──────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: #f3f4f6;
}
.login-box {
  background: #fff;
  border: var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.login-box h2 { text-align: center; color: var(--color-primary); }
.login-box input {
  width: 100%; padding: 0.5rem 0.75rem;
  border: var(--border); border-radius: var(--radius);
  font-size: var(--font-size-base);
}
.login-box button {
  width: 100%; padding: 0.6rem;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: var(--font-size-base);
}
.login-box button:hover { background: var(--color-primary-dark); }
.error-msg { color: var(--color-danger); text-align: center; font-size: 0.85em; }

/* ── 앱 레이아웃 ─────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
}

/* ── 사이드바 ────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: var(--border);
  background: #fff;
  overflow: hidden;
}
#sidebar-header {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  gap: 6px;
}
#schema-title {
  flex: 1;
  color: #fff;
  font-size: 0.95em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sidebar-header button {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
}
#sidebar-header button:hover { background: rgba(255,255,255,0.35); }
#sidebar-filters { padding: 0.4rem 0.5rem; border-bottom: var(--border); overflow-x: hidden; }
#search-input {
  width: 100%; padding: 0.3rem 0.5rem;
  border: var(--border); border-radius: var(--radius);
  font-size: var(--font-size-base);
}
#record-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
}
/* list-table: 헤더와 데이터가 같은 table 안에 있어 컬럼 너비 자동 정렬 */
.list-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.85em;
  table-layout: auto;
}
.list-table thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-header);
}
.list-table th {
  padding: 4px 8px;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.78em;
  white-space: nowrap;
  border-bottom: 2px solid #e5e7eb;
  text-align: left;
}
.list-table td {
  padding: 4px 8px;
  white-space: nowrap;
  border-bottom: 1px solid #f0f0f0;
}
.list-table th.list-seq,
.list-table td.list-seq { color: #9ca3af; min-width: 24px; text-align: right; }
.list-table tbody tr { cursor: pointer; }
.list-table tbody tr:hover { background: #eff6ff; }
.list-table tbody tr.active { background: #dbeafe; font-weight: 600; }
.list-empty { padding: 1rem; color: #9ca3af; text-align: center; font-size: 0.85em; }
#sidebar-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.5rem;
  border-top: var(--border);
  background: var(--bg-header);
}
#record-count { flex: 1; font-size: 0.8em; color: #6b7280; }
#sidebar-footer button {
  padding: 0.25rem 0.5rem;
  border: var(--border); border-radius: var(--radius);
  background: #fff; cursor: pointer; font-size: 0.8em;
}
#sidebar-footer button:hover { background: #f3f4f6; }
#btn-export { color: var(--color-primary); }

/* ── 메인 패널 ───────────────────────────────────────── */
#main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#form-toolbar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
  border-bottom: var(--border);
  background: var(--bg-header);
  gap: 0.5rem;
}
#form-status { font-size: 0.85em; color: #6b7280; flex: 1; }
#form-actions { display: flex; gap: 0.4rem; }
#form-actions button {
  padding: 0.3rem 0.75rem;
  border: var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 0.85em; background: #fff;
}
#btn-import-excel {
  padding: 0.3rem 0.75rem;
  border: var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 0.85em; background: #fff;
  color: #059669; border-color: #059669;
}
#btn-import-excel:hover { background: #f0fdf4; }
#btn-save {
  background: var(--color-primary) !important;
  color: #fff; border-color: var(--color-primary) !important;
}
#btn-save:disabled { opacity: 0.45; cursor: default; }
#btn-save:not(:disabled):hover { background: var(--color-primary-dark) !important; }
.btn-danger { color: var(--color-danger) !important; border-color: var(--color-danger) !important; }
.btn-danger:hover { background: #fef2f2 !important; }

#form-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}
#form-placeholder { color: #9ca3af; padding: 2rem; text-align: center; }

/* ── 폼 섹션 ────────────────────────────────────────── */
.form-section {
  margin-bottom: 0.5rem;
  border: var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.section-title {
  padding: 0.4rem 0.6rem;
  background: var(--bg-section);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  font-size: 0.9em;
  border-bottom: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.section-body {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 0.4rem 0.5rem;
}

/* ── 필드 행 ────────────────────────────────────────── */
.field-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 3px;
  border-radius: 3px;
}
.field-row.field-changed { background: #eff6ff; }
.ts-table td.field-changed { background: #eff6ff; }
.field-label {
  font-size: 0.8em;
  color: #4b5563;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
.field-wrap { display: flex; align-items: baseline; gap: 2px; }
.field-unit { font-size: 0.75em; color: #9ca3af; }

/* ── 필드 인풋 ───────────────────────────────────────── */
.field-input {
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: var(--font-size-base);
  font-family: inherit;
  outline: none;
  background: #fff;
  transition: border-color 0.1s;
}
.field-input:focus { border-color: var(--color-primary); }
.field-num { text-align: right; }
.field-text {
  resize: vertical;
  width: 100%;
  min-width: 180px;
  overflow: hidden;
}
.field-text.notepanel-text { overflow: auto; }
select.field-input { padding: 1px 2px; }

/* 토글 체크박스 */
.field-check {
  display: inline-block;
  min-width: 24px;
  padding: 1px 6px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  background: #fff;
  font-size: var(--font-size-base);
  color: #374151;
  user-select: none;
}
.field-check:focus { outline: 2px solid var(--color-primary); }
.field-check[data-value="Y"] { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.field-check[data-value="N"] { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }

.field-static {
  display: inline-block;
  padding: 1px 4px;
  color: #6b7280;
  font-style: italic;
  min-width: 40px;
}

.field-radio { cursor: pointer; }

/* ── rows 레이아웃 — table 기반 ──────────────────────────────── */
.form-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: auto;
}
.form-col-input { width: 90px; }
.form-col-gap { width: 16px; }
.form-table td {
  border: 1px solid transparent;
  padding: 3px 4px;
  vertical-align: middle;
}
.form-tr { border-top: none; }
.form-tr-separator { border-top: none; }
/* 같은 rowLabel 그룹의 연속 tr — 구분선 없이 이어 보임 */
.form-tr-cont { border-top: none; }
/* hidden input 수납용 td — 너비 0, 화면에 표시 안 됨 */
.form-td-hiddens { padding: 0; width: 0; overflow: hidden; }
.form-td-rowlabel {
  font-weight: 600;
  color: #374151;
  font-size: 0.82em;
  white-space: normal;
  vertical-align: middle;
  border-right: 2px solid #e5e7eb;
  padding-right: 8px;
  overflow: hidden;
}
.form-td-label {
  font-size: 0.8em;
  color: #4b5563;
  white-space: normal;
  word-break: break-word;
  padding-right: 4px;
  vertical-align: middle;
}
.form-td-input { width: 90px; vertical-align: middle; }
.form-td-input .field-input { width: 90px; min-width: 0; box-sizing: border-box; }
input.field-input, select.field-input { height: 22px; }
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
.form-td-span .field-input { width: 100%; }
.form-td-input.field-changed { background: #eff6ff; }
.form-td-gap {
  width: 16px;
  min-width: 16px;
  font-size: 0.75em;
  color: #9ca3af;
  white-space: nowrap;
  vertical-align: middle;
  text-align: left;
  padding-left: 2px;
}
.form-td-separator { padding: 2px 0; }
/* textarea는 td 전체 너비 */
.form-td-input .field-text { width: 100%; }

.field-cell.field-changed { background: #eff6ff; }

/* ── 시계열 테이블 ──────────────────────────────────── */
.ts-body { padding: 0; overflow-x: auto; }
.ts-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 0.85em;
}
.ts-table th, .ts-table td {
  border: 1px solid #e5e7eb;
  padding: 1px 4px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
.ts-table thead th {
  background: var(--bg-section);
  font-weight: 600;
  position: sticky; top: 0; z-index: 1;
  font-size: 0.85em;
  color: #4b5563;
  padding: 3px 6px;
}
.ts-table tbody th.ts-row-label {
  background: var(--bg-section);
  text-align: right;
  font-weight: 600;
  color: #4b5563;
  font-size: 0.85em;
  position: sticky; left: 0; z-index: 1;
  min-width: 90px;
  padding-right: 6px;
}
.ts-table td .field-input,
.ts-table td .field-check,
.ts-table td .field-static {
  width: 100%;
  min-width: 50px;
  text-align: right;
  padding: 1px 3px;
  border-radius: 2px;
}
.ts-table td .field-check { text-align: center; }
.ts-table td .field-unit { display: none; }
.ts-table tbody tr:hover { background: #f9fafb; }

/* vitals-dynamic: table-layout fixed로 컬럼 너비 고정 */
.vs-dynamic-table {
  table-layout: fixed;
  width: auto;      /* 컬럼 합계 너비만큼만 */
  min-width: 0;     /* ts-table의 min-width:100% 상속 차단 */
}
.vs-dynamic-table thead th:first-child,
.vs-dynamic-table tbody th.ts-row-label {
  width: 80px;     /* 행 레이블 컬럼 (T, FiO2 등) */
  min-width: 80px;
}
.vs-dynamic-table th.ts-time-header {
  width: 74px;     /* time input(68px) + padding */
  padding: 1px 2px;
}
.vs-dynamic-table td {
  width: 74px;
  padding: 1px 2px;
  overflow: hidden;
}
.vs-dynamic-table td .field-input {
  width: 74px;
  min-width: unset;
}

/* ── 모달 ──────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.4);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  width: min(720px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: var(--border);
}
.modal-header h3 { font-size: 1rem; }
.modal-close {
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: #6b7280;
  width: 28px; height: 28px;
  border-radius: 50%;
}
.modal-close:hover { background: #f3f4f6; }
.modal-toolbar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-bottom: var(--border);
  background: var(--bg-section);
  align-items: center;
  flex-wrap: wrap;
}
.modal-toolbar button {
  padding: 0.25rem 0.6rem;
  border: var(--border); border-radius: var(--radius);
  background: #fff; cursor: pointer; font-size: 0.85em;
}
.modal-toolbar button:hover { background: #f3f4f6; }
.modal-option {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.85em; cursor: pointer;
  margin-left: auto;
}
#excel-filter {
  padding: 0.25rem 0.5rem;
  border: var(--border); border-radius: var(--radius);
  font-size: 0.85em; width: 160px;
}
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 0.5rem 1rem;
  font-size: 0.85em;
}
.excel-section { margin-bottom: 0.6rem; }
.excel-section-title {
  font-weight: 600;
  background: var(--bg-section);
  padding: 4px 8px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.excel-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 2px 8px;
  padding: 0 8px;
}
.excel-fields label {
  display: flex; align-items: center; gap: 4px;
  padding: 1px 0;
  cursor: pointer;
}
.excel-fields label.hidden { display: none; }
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: var(--border);
  background: var(--bg-section);
}
#excel-count { font-size: 0.85em; color: #6b7280; }
.btn-primary {
  padding: 0.4rem 1rem;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer; font-size: 0.85em;
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

/* ── row label ───────────────────────────────────────── */
/* .rows-body-labeled: form-row-labeled children handle label+content layout */
/* .row-label-cell deprecated — 새 table 레이아웃에서 .form-td-rowlabel 사용 */
.row-label-cell { display: none; }

/* ── inline-table (Cranial reflex 등) ───────────────── */
.inline-table {
  border-collapse: collapse;
  font-size: 0.85em;
  table-layout: fixed;  /* 컬럼 너비 고정 */
  width: auto;
}
.inline-table th, .inline-table td {
  border: 1px solid #e5e7eb;
  padding: 2px 4px;
  text-align: center;
  overflow: hidden;
}
.ilt-col-hdr {
  background: var(--bg-section);
  font-weight: 600;
  color: #4b5563;
  font-size: 0.85em;
  width: 78px;   /* 데이터 컬럼 고정 너비 */
}
.ilt-row-hdr {
  background: var(--bg-section);
  font-weight: 600;
  color: #4b5563;
  text-align: right;
  width: 36px;   /* OD/OS 레이블 컬럼 */
  padding-right: 6px;
}
.ilt-cell {
  width: 78px;
}
.ilt-cell.field-changed { background: #eff6ff; }
/* 입력 너비를 td 전체에 맞춤 */
.ilt-cell .field-check {
  width: 100%;
  min-width: unset;
  text-align: center;
  display: block;
}
.ilt-cell .field-input {
  width: 100%;
  min-width: unset;
  text-align: right;
  box-sizing: border-box;
}

/* ── row separator ───────────────────────────────────── */
.row-separator-row { border-top: 1px solid #f0f0f0; padding: 2px 0; }
.row-separator-label {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--color-primary);
  background: #f0f4ff;
  padding: 1px 8px;
  border-radius: 3px;
}

/* ── notepanel ───────────────────────────────────────── */
.notepanel-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0;
}
.notepanel-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.notepanel-log {
  min-height: 24px;
  max-height: 140px;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 0.8em;
}
.log-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1px 4px;
  border-radius: 2px;
  margin: 1px 0;
  color: #374151;
  gap: 4px;
}
.log-text { flex: 1; font-size: 0.85em; }
.log-del-btn {
  flex-shrink: 0;
  padding: 0 3px;
  font-size: 0.7em;
  line-height: 1.3;
  border: none;
  border-radius: 2px;
  background: rgba(0,0,0,0.12);
  color: #374151;
  cursor: pointer;
  opacity: 0.5;
}
.log-del-btn:hover { opacity: 1; background: rgba(220,38,38,0.2); color: #b91c1c; }
.log-action { background: #d1fae5; }
.log-drug   { background: #fef3c7; }
.log-localblock { background: #dbeafe; }
.notepanel-text {
  resize: vertical;
  width: 100%;
  overflow-y: auto;
  font-family: inherit;
}

/* ── vitals setup row ────────────────────────────────── */
.vs-setup-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}
.vs-gen-btn, .vs-add-col-btn, .vs-del-last-btn, .vs-add-var-toggle {
  padding: 2px 10px;
  border: var(--border);
  border-radius: var(--radius);
  font-size: 0.82em;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.vs-gen-btn { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.vs-gen-btn:hover { background: var(--color-primary-dark); }
.vs-add-col-btn { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.vs-add-col-btn:hover { background: #dcfce7; }
.vs-del-last-btn { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.vs-del-last-btn:hover { background: #fee2e2; }
.vs-add-var-toggle { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.vs-add-var-toggle:hover { background: #6d28d9; }

/* Variable+ 입력 패널 */
.vs-add-var-panel {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  margin: 0 8px 4px;
  flex-wrap: wrap;
}
.vs-add-var-hint {
  font-size: 0.78em;
  color: #0369a1;
  font-weight: 600;
  white-space: nowrap;
}
.vs-new-var-confirm {
  padding: 2px 10px;
  background: var(--color-primary); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer; font-size: 0.82em;
}
.vs-new-var-cancel {
  padding: 2px 8px;
  background: #f3f4f6; color: #374151;
  border: var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 0.82em;
}

/* 커스텀 변수 행 */
.vs-custom-row-label {
  background: #fef9c3 !important;
  color: #713f12;
}
.vs-del-var-btn {
  margin-left: 3px;
  padding: 0 3px;
  font-size: 0.72em;
  line-height: 1.3;
  border: 1px solid #fca5a5;
  border-radius: 2px;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
  vertical-align: middle;
}
.vs-del-var-btn:hover { background: #fecaca; }

/* ── ts-time-header ──────────────────────────────────── */
.ts-time-header { padding: 1px 2px; }
.ts-time-input {
  width: 74px;
  height: 22px;
  font-size: var(--font-size-base);
  font-family: inherit;
  border: 1px solid #d1d5db;
  border-radius: 2px;
  padding: 1px 2px;
  text-align: center;
  background: #fff;
  box-sizing: border-box;
}

/* ── sidebar filters ─────────────────────────────────── */
.filter-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78em;
}
.filter-item label { color: #6b7280; white-space: nowrap; }
.filter-item select {
  border: var(--border);
  border-radius: var(--radius);
  font-size: 0.82em;
  padding: 1px 3px;
  max-width: 90px;
}

/* ── list header row ─────────────────────────────────── */
/* .list-header-row 제거됨 — list-table thead로 통합 */

/* ── event popup ─────────────────────────────────────── */
.event-popup-content {
  width: min(760px, 95vw);
  max-height: 82vh;
}
.event-popup-body {
  display: flex;
  gap: 0;
  flex: 1;
  overflow: hidden;
  min-height: 300px;
}
.event-popup-form {
  width: 200px;
  min-width: 180px;
  padding: 0.75rem;
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.popup-field-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.popup-field-row label {
  font-size: 0.8em;
  font-weight: 600;
  color: #4b5563;
}
.popup-field-row input, .popup-field-row select, .popup-field-row textarea {
  border: var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  font-size: 0.85em;
  font-family: inherit;
  width: 100%;
}
.btn-now {
  font-size: 0.75em;
  padding: 2px 6px;
  border: var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  align-self: flex-start;
}
.btn-now:hover { background: #f3f4f6; }
.event-popup-options {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  gap: 8px;
}
.option-group {
  flex: 1;
  min-width: 120px;
}
.option-group-title {
  font-size: 0.75em;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  padding: 3px 8px;
  border-radius: 3px 3px 0 0;
  margin-bottom: 2px;
}
.option-item {
  font-size: 0.8em;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 2px;
  color: #374151;
}
.option-item:hover { background: #eff6ff; color: var(--color-primary); }
.option-item.selected { background: #dbeafe; font-weight: 600; }

/* ── 반응형 ──────────────────────────────────────────── */
@media (max-width: 600px) {
  #sidebar { width: 100%; }
  #app { flex-direction: column; }
}

/* ── 동의서 모달 ──────────────────────────────────────── */
.consent-modal-inner {
  position: relative; z-index: 1001;
  display: flex; flex-direction: column;
  width: 94vw; height: 94vh;
  background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.consent-modal-toolbar {
  flex-shrink: 0;
  background: #f8f8f8; border-bottom: 1px solid #ddd;
  padding: 6px 12px;
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
}
#consent-frame { flex: 1; }

.consent-btn {
  padding: 0.3rem 0.75rem;
  border: var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: 0.85em; background: #fff;
  white-space: nowrap;
}
.consent-btn:hover { background: #f3f4f6; }
.consent-btn-primary {
  background: var(--color-primary) !important;
  color: #fff; border-color: var(--color-primary) !important;
}
.consent-btn-primary:hover { background: var(--color-primary-dark) !important; }
