/* 화면 전용 스타일 — app.css 디자인 토큰 위에 얹는 레이어 */

/* ------------------------------------------------------------ 부팅 스플래시 */
.boot-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  overflow: hidden;
  color: #eafff0;
  background:
    radial-gradient(1200px 800px at 50% 34%, #10331f 0%, transparent 62%),
    radial-gradient(900px 700px at 82% 84%, rgba(47, 201, 160, .18) 0%, transparent 58%),
    linear-gradient(168deg, #071c11 0%, #05130c 52%, #030d08 100%);
  animation: boot-fade-in .45s ease both;
}
@keyframes boot-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 은은하게 흐르는 오로라 */
.boot-aurora {
  position: absolute; inset: -25%;
  background:
    radial-gradient(closest-side, rgba(130, 243, 132, .22), transparent 70%) 22% 28%/48% 48% no-repeat,
    radial-gradient(closest-side, rgba(47, 201, 160, .18), transparent 70%) 78% 66%/52% 52% no-repeat;
  filter: blur(18px);
  animation: boot-aurora 11s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes boot-aurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}
.boot-field { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; }

.boot-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px;
  text-align: center;
}

/* 로고 + 후광 + 회전 링 */
.boot-mark {
  position: relative;
  display: grid; place-items: center;
  width: 190px; height: 190px;
  margin-bottom: 22px;
}
.boot-mark img {
  position: relative; z-index: 2;
  width: 140px; height: 140px;
  filter: drop-shadow(0 10px 34px rgba(0, 0, 0, .55))
          drop-shadow(0 0 26px rgba(130, 243, 132, .30));
  /* 떠오른 뒤(0.9s) 이어서 숨쉬기 시작한다 — 뒤에 온 애니메이션이 transform 을 잡는다 */
  animation: boot-rise .9s cubic-bezier(.22, 1, .36, 1) both,
             vo-breathe 4.6s ease-in-out .9s infinite;
  transform-origin: 50% 55%;
}
@keyframes boot-rise {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to { opacity: 1; transform: none; }
}
.boot-halo {
  position: absolute; inset: 8px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(130, 243, 132, .30), transparent 72%);
  filter: blur(6px);
  animation: boot-breathe 3.2s ease-in-out infinite;
}
@keyframes boot-breathe {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.07); }
}
.boot-ring {
  position: absolute; inset: 0;
  border-radius: 999px;
  border: 1.5px solid rgba(130, 243, 132, .16);
  border-top-color: rgba(167, 255, 169, .85);
  border-right-color: rgba(47, 201, 160, .45);
  animation: boot-spin 2.6s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }

.boot-name {
  font-size: 30px; font-weight: 800; letter-spacing: -.045em; line-height: 1.1;
  color: #ffffff;
  animation: boot-rise .9s .08s cubic-bezier(.22, 1, .36, 1) both;
}
.boot-name b { font-weight: 800; color: #82f384; }
.boot-tag {
  margin-top: 8px; font-size: 13.5px; color: #9fc6ae; letter-spacing: -.01em;
  animation: boot-rise .9s .16s cubic-bezier(.22, 1, .36, 1) both;
}
.boot-bar {
  width: 220px; height: 3px; margin-top: 26px;
  border-radius: 999px; overflow: hidden;
  background: rgba(130, 243, 132, .16);
  animation: boot-rise .9s .24s cubic-bezier(.22, 1, .36, 1) both;
}
.boot-bar span {
  display: block; height: 100%; width: 42%; border-radius: 999px;
  background: linear-gradient(90deg, transparent, #82f384 35%, #a7ffa9 55%, transparent);
  animation: boot-slide 1.25s cubic-bezier(.65, 0, .35, 1) infinite;
}
@keyframes boot-slide { 0% { transform: translateX(-115%); } 100% { transform: translateX(320%); } }

.boot-steps {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px; font-size: 11px; letter-spacing: .06em;
  color: #6f9b81; text-transform: uppercase;
  animation: boot-rise .9s .32s cubic-bezier(.22, 1, .36, 1) both;
}
.boot-steps i { width: 16px; height: 1px; background: rgba(130, 243, 132, .3); }
.boot-note { margin-top: 14px; color: #9fc6ae; font-size: .85rem; }

@media (max-width: 480px) {
  .boot-mark { width: 150px; height: 150px; }
  .boot-mark img { width: 110px; height: 110px; }
  .boot-name { font-size: 25px; }
  .boot-steps { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .boot-aurora, .boot-halo, .boot-ring, .boot-bar span { animation: none; }
  .boot-field { display: none; }
  .boot-mark img, .boot-name, .boot-tag, .boot-bar, .boot-steps { animation: none; }
}

/* ------------------------------------------------------------------ 로그인 */
.login-page { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; min-height: 100dvh; }
.login-visual {
  position: relative; overflow: hidden; display: flex; align-items: center;
  justify-content: center; padding: var(--sp-8, 32px);
  background: radial-gradient(120% 90% at 20% 10%, #0f2c1c 0%, #06110c 55%, #030806 100%);
  color: #eafff0;
}
.login-visual canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-visual-inner { position: relative; z-index: 1; max-width: 460px; }
.login-visual-title {
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; margin: var(--sp-5, 20px) 0 var(--sp-2, 8px);
  letter-spacing: -0.02em; line-height: 1.15;
}
.login-visual-sub { color: #82f384; font-weight: 600; letter-spacing: .04em; margin-bottom: var(--sp-4, 16px); }
.login-visual-desc { color: #b9d6c4; line-height: 1.7; font-size: .95rem; }
.login-stats { display: flex; gap: var(--sp-6, 24px); margin-top: var(--sp-7, 28px); flex-wrap: wrap; }
.login-stats > div { display: flex; flex-direction: column; }
.login-stats b { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.login-stats span { font-size: .78rem; color: #7fa08c; margin-top: 2px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: var(--sp-6, 24px); background: var(--bg, #fff); }
.login-card { width: 100%; max-width: 380px; }
.login-brand { font-size: 1.1rem; font-weight: 600; color: var(--text, #2e3c54); margin-bottom: var(--sp-6, 24px); }
.login-brand b { font-weight: 800; }
.login-title { font-size: 1.7rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.login-sub { color: var(--text-muted, #646f79); margin-bottom: var(--sp-6, 24px); }
.login-foot { margin-top: var(--sp-5, 20px); font-size: .78rem; color: var(--text-subtle, #97a1a9); text-align: center; }
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { min-height: 240px; padding: var(--sp-6, 24px); }
  .login-visual-title { font-size: 1.7rem; }
  .login-visual-desc, .login-stats { display: none; }
}

/* ---------------------------------------------------------------- 페이지 */
.page-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3, 12px); padding: var(--sp-12, 64px) var(--sp-4, 16px);
  color: var(--text-muted, #646f79);
}
.page-body.narrow { max-width: 100%; margin-inline: auto; }
.page-title { font-size: clamp(1.35rem, 2.4vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted, #646f79); margin-top: 4px; font-size: .9rem; }
.page-actions { display: flex; gap: var(--sp-2, 8px); flex-wrap: wrap; align-items: center; }
.topbar-heading { font-weight: 600; font-size: .95rem; }
.topbar-sub { font-size: .75rem; color: var(--text-muted, #646f79); }

/* 툴바 레이아웃은 app.css 24.3 이 담당한다 (검색은 넉넉, 나머지는 내용만큼) */
.toolbar .input-group { min-width: 200px; }

/* ------------------------------------------------------------ 브랜드/사이드바 */
.brand-link { display: flex; align-items: center; gap: var(--sp-3, 12px); text-decoration: none; color: inherit; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: -0.04em; white-space: nowrap; line-height: 1.14; }
.brand-name b { font-weight: 800; }
.brand-sub { display: none; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .sidebar-section-label { display: none; }
.sidebar-nav { display: flex; flex-direction: column; gap: var(--sp-4, 16px); }
.sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.sidebar-badge:empty { display: none; }

/* ------------------------------------------------------------------ 상단바 */
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2, 8px); margin-left: auto; }
.topbar-user { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: var(--sp-2, 8px); background: none;
  border: 1px solid transparent; border-radius: var(--radius, 12px); padding: 4px 8px;
  cursor: pointer; color: inherit; font: inherit;
}
.user-chip:hover { background: var(--surface-hover, #f4f5f6); border-color: var(--border, #e8e8e9); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent, #82f384), var(--accent-600, #16a34a));
  color: #0b2415; font-weight: 700; font-size: .8rem;
}
.user-name { font-size: .85rem; font-weight: 500; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 60;
  background: var(--surface, #fff); border: 1px solid var(--border, #e8e8e9);
  border-radius: var(--radius, 12px); box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.14));
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border, #e8e8e9); margin-bottom: 4px; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  text-decoration: none; color: inherit; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: .88rem; text-align: left; width: 100%;
}
.user-menu-item:hover { background: var(--surface-hover, #f4f5f6); }
.user-menu-item.danger { color: var(--danger, #ef4444); }

/* ------------------------------------------------------------------- 카드류 */
.stat-card { position: relative; }
.stat-icon { position: absolute; top: 12px; right: 12px; color: var(--text-subtle, #97a1a9); }
.stat-card.positive .stat-value { color: var(--success-text, #15803d); }
.stat-card.negative .stat-value { color: var(--danger-text, #b91c1c); }
.stat-card.warn .stat-value { color: var(--warning-text, #a16207); }
.big-metric { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.big-metric small { font-size: .85rem; font-weight: 500; color: var(--text-muted, #646f79); margin-left: 6px; }

.callout {
  display: flex; gap: var(--sp-3, 12px); align-items: flex-start; padding: var(--sp-4, 16px) var(--sp-5, 20px);
  border: 1px solid var(--border, #e8e8e9); border-radius: var(--radius, 12px);
  background: var(--surface-2, #fafafa); margin-top: var(--sp-5, 20px); font-size: .9rem; line-height: 1.68;
}
.callout > svg { flex: none; margin-top: 2px; color: var(--text-muted, #646f79); }
.callout-accent { background: var(--accent-soft, #eefdf0); border-color: var(--accent, #82f384); }
.callout-accent > svg { color: var(--accent-600, #16a34a); }
.callout-warn { background: var(--warning-soft, #fef9e7); border-color: var(--warning, #f59e0b); }
.callout-warn > svg { color: var(--warning-text, #a16207); }
.callout-muted { background: transparent; }

.alert { padding: var(--sp-3, 12px) var(--sp-4, 16px); border-radius: var(--radius, 12px); font-size: .88rem; }
.alert-danger { background: var(--danger-soft, #fdeeee); color: var(--danger-text, #b91c1c); border: 1px solid var(--danger, #ef4444); }
.alert-success { background: var(--success-soft, #edfaf1); color: var(--success-text, #15803d); border: 1px solid var(--success, #22c55e); }

/* --------------------------------------------------------------- 근거 칩 */
.ev-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ev-row + .ev-row { margin-top: 8px; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.ev-chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px;
  border: 1px solid var(--border, #e8e8e9); border-radius: 999px;
  background: var(--surface-2, #fafafa); font-size: .79rem; line-height: 1.4; max-width: 100%;
}
.ev-chip .ev-k { color: var(--text-muted, #646f79); white-space: nowrap; }
.ev-chip .ev-v { font-weight: 600; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.ev-chip.ok { background: var(--success-soft, #edfaf1); border-color: var(--success, #22c55e); }
.ev-chip.warn { background: var(--warning-soft, #fef9e7); border-color: var(--warning, #f59e0b); }

.rule-title {
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted, #646f79); margin-bottom: 6px;
}
.rule-block { margin-bottom: var(--sp-3, 12px); display: flex; flex-wrap: wrap; gap: 5px; }
.rule-block .rule-title { width: 100%; margin-bottom: 4px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border, #e8e8e9); font-size: .88rem; }
.kv-list li:last-child { border-bottom: 0; }
.src-list { display: flex; flex-wrap: wrap; gap: 5px; }
.bullet-list { margin: 0; padding-left: 1.2em; line-height: 1.75; font-size: .9rem; }
.bullet-list li { margin-bottom: 10px; }
.bullet-list li:last-child { margin-bottom: 0; }
.warn-list li::marker { color: var(--warning, #f59e0b); }
.numbered-list { margin: 0; padding-left: 1.4em; line-height: 1.75; font-size: .9rem; }
.numbered-list li { margin-bottom: 11px; }
.numbered-list li:last-child { margin-bottom: 0; }
.hint-icon { display: inline-flex; color: var(--text-subtle, #97a1a9); cursor: help; vertical-align: middle; position: relative; }
.hint-icon:hover::after, .hint-icon:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%); background: #12181f; color: #fff; padding: 7px 10px;
  border-radius: 8px; font-size: .74rem; line-height: 1.5; white-space: normal;
  width: max-content; max-width: 280px; z-index: 80; box-shadow: var(--shadow-md, 0 6px 18px rgba(0,0,0,.16));
}

/* --------------------------------------------------------------- 표/리스트 */
tr.clickable, td.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--surface-hover, #f4f5f6); }
.pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3, 12px); padding: var(--sp-4, 16px) 0; }
.pager-info { font-size: .82rem; color: var(--text-muted, #646f79); }
.skeleton-stack { display: flex; flex-direction: column; gap: 8px; padding: var(--sp-4, 16px); }
.lfc-bar { display: block; height: 3px; border-radius: 999px; background: var(--border, #e8e8e9); margin-top: 3px; overflow: hidden; }
.lfc-bar i { display: block; height: 100%; border-radius: 999px; }
.simbar { display: inline-block; width: 60px; height: 4px; border-radius: 999px; background: var(--border, #e8e8e9); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.simbar span { display: block; height: 100%; background: var(--accent-600, #16a34a); }
.rank-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--surface-2, #fafafa); border: 1px solid var(--border, #e8e8e9);
  font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums;
}
.rank-badge.top { background: var(--accent, #82f384); border-color: var(--accent, #82f384); color: #0b2415; }
.link { color: var(--accent-700, #12813b); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }

.pick-list {
  max-height: 340px; overflow: auto; border: 1px solid var(--border, #e8e8e9);
  border-radius: var(--radius, 12px); padding: 4px;
}
.pick-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; }
.pick-item:hover { background: var(--surface-hover, #f4f5f6); }
.pick-body { display: flex; flex-direction: column; min-width: 0; }
.pick-body b { font-size: .87rem; font-weight: 500; }
.pick-body small { font-size: .74rem; color: var(--text-muted, #646f79); }

.target-row, .rule-row {
  display: grid; grid-template-columns: 1.2fr .9fr .8fr .7fr auto; gap: 6px;
  align-items: center; margin-bottom: 6px;
}
.rule-row { grid-template-columns: 1fr auto auto; }
.input-sm, .select-sm { padding: 5px 9px; font-size: .82rem; }

.accordion > summary { cursor: pointer; font-weight: 600; font-size: .9rem; padding: 8px 0; list-style: none; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before { content: '▸'; margin-right: 8px; color: var(--text-muted, #646f79); }
.accordion[open] > summary::before { content: '▾'; }

.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.status-dot.ok { background: var(--success, #22c55e); box-shadow: 0 0 0 4px rgba(34,197,94,.16); }
.status-dot.bad { background: var(--danger, #ef4444); box-shadow: 0 0 0 4px rgba(239,68,68,.16); }

/* ------------------------------------------------------ 다크 캔버스 히어로 */
.dash-hero, .run-hero, .run-progress { position: relative; overflow: hidden; padding: clamp(20px, 3vw, 34px); }
.dash-hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--sp-6, 24px); align-items: center; }
.dash-hero-title { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 8px; color: var(--canvas-text, #eafff0); }
.dash-hero-sub { color: var(--canvas-muted, #9fc4ad); font-size: .95rem; line-height: 1.65; }
.dash-hero-actions { display: flex; gap: var(--sp-2, 8px); margin-top: var(--sp-5, 20px); flex-wrap: wrap; }
.canvas-btn { color: var(--canvas-text, #eafff0); border-color: rgba(130,243,132,.35); }
.canvas-btn:hover { background: rgba(130,243,132,.12); }
.dash-hero-flow, .run-hero-flow, .run-progress-flow { min-height: 130px; }
@media (max-width: 900px) { .dash-hero-inner { grid-template-columns: 1fr; } }

.run-progress-inner { position: relative; z-index: 2; display: flex; flex-direction: column; gap: var(--sp-5, 20px); }
.run-progress-title { font-size: clamp(1.15rem, 2.2vw, 1.6rem); font-weight: 700; color: var(--canvas-text, #eafff0); margin-top: 10px; }
.run-progress-sub { color: var(--canvas-muted, #9fc4ad); font-size: .85rem; }
.run-progress-bar { display: flex; flex-direction: column; gap: 8px; }
.run-progress-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--canvas-muted, #9fc4ad); }
.run-progress-actions { display: flex; gap: var(--sp-2, 8px); }

/* ------------------------------------------------------------------ 안전성 */
.risk-row { padding: var(--sp-3, 12px) var(--sp-4, 16px); border-bottom: 1px solid var(--border, #e8e8e9); }
.risk-row:last-child { border-bottom: 0; }
.risk-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; font-size: .9rem; }
.risk-paths { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.risk-path { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--text-muted, #646f79); }
.conn-mini { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4, 16px); padding: var(--sp-4, 16px); }
.conn-row { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; padding: 3px 0; }
@media (max-width: 720px) { .conn-mini { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- 검증 프로토콜 */
.model-row { padding: 10px 0; border-bottom: 1px solid var(--border, #e8e8e9); }
.model-row:last-child { border-bottom: 0; }
.model-row.primary { background: var(--accent-soft, #eefdf0); margin: 0 -16px; padding: 10px 16px; border-radius: 8px; border-bottom: 0; }
.dose-ladder { display: flex; gap: 6px; flex-wrap: wrap; }
.dose-step {
  display: inline-flex; flex-direction: column; align-items: center; padding: 8px 12px;
  border: 1px solid var(--border, #e8e8e9); border-radius: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums; font-size: .86rem; background: var(--surface-2, #fafafa);
}
.dose-step small { font-size: .66rem; font-weight: 500; color: var(--text-muted, #646f79); }
.dose-step.center { border-color: var(--accent, #82f384); background: var(--accent-soft, #eefdf0); }
.gate-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border, #e8e8e9); }
.gate-row:last-child { border-bottom: 0; }
.gate-row > svg { flex: none; margin-top: 2px; color: var(--text-muted, #646f79); }
.gate-row.ok > svg { color: var(--success, #22c55e); }
.gate-row.warn > svg { color: var(--warning, #f59e0b); }
.gate-row.danger > svg { color: var(--danger, #ef4444); }
.phase-row { display: flex; gap: var(--sp-3, 12px); padding: var(--sp-3, 12px) 0; border-bottom: 1px solid var(--border, #e8e8e9); }
.phase-row:last-child { border-bottom: 0; }
.phase-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent, #82f384); color: #0b2415; font-weight: 800; font-size: .85rem;
}
.ctrl-block { padding: 9px 0; border-bottom: 1px solid var(--border, #e8e8e9); }
.ctrl-block:last-child { border-bottom: 0; }

/* --------------------------------------------------------------- 마크다운 */
/* 다운로드용 HTML 리포트와 같은 조판 언어를 앱 안에서도 그대로 쓴다. */
.markdown {
  --md-accent: var(--accent-600, #16a34a);
  line-height: 1.78;
  font-size: 15px;
  color: var(--text-muted, #646f79);
  word-break: keep-all;
  overflow-wrap: break-word;
}
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }

.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5 {
  color: var(--text, #2e3c54);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.markdown h1 {
  font-size: 26px; font-weight: 800; margin: 0 0 18px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border, #e8e8e9);
}
.markdown h2 {
  position: relative;
  font-size: 20px; margin: 40px 0 14px; padding-left: 13px;
}
.markdown h2::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 4px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent, #82f384), var(--md-accent));
}
.markdown h3 { font-size: 16.5px; margin: 28px 0 10px; }
.markdown h4 {
  font-size: 13px; margin: 22px 0 8px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-subtle, #8a939c);
}
.markdown p { margin: 0 0 14px; }
.markdown strong { color: var(--text, #2e3c54); font-weight: 700; }

.markdown ul, .markdown ol { padding-left: 1.25em; margin: 0 0 16px; display: grid; gap: 8px; }
.markdown li { margin: 0; line-height: 1.75; }
.markdown li::marker { color: var(--md-accent); font-weight: 700; }
.markdown li > ul, .markdown li > ol { margin-top: 8px; }

/* 표 — 리포트와 동일한 규칙 (헤더 소문자 유지 · 숫자 tabular) */
.markdown .md-table-wrap {
  width: 100%; overflow-x: auto; margin: 0 0 20px;
  border: 1px solid var(--border, #e8e8e9); border-radius: 12px;
  background: var(--surface, #fff);
}
.markdown table {
  width: 100%; border-collapse: collapse; margin: 0;
  font-size: 13.5px; font-variant-numeric: tabular-nums;
}
.markdown thead th {
  position: sticky; top: 0;
  background: var(--surface-2, #f5f6f7);
  color: var(--text-subtle, #8a939c);
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; white-space: nowrap;
}
.markdown th, .markdown td {
  padding: 11px 14px; text-align: left;
  border-bottom: 1px solid var(--border, #e8e8e9);
}
.markdown tbody tr:last-child td { border-bottom: 0; }
.markdown tbody tr:hover { background: var(--surface-2, #f7f8f9); }
.markdown td:first-child { color: var(--text, #2e3c54); font-weight: 600; }

.markdown code {
  background: var(--surface-2, #f5f6f7);
  border: 1px solid var(--border, #e8e8e9);
  padding: 1px 6px; border-radius: 5px;
  font-size: .87em; font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text, #2e3c54);
  word-break: normal; overflow-wrap: anywhere;
}
.markdown pre {
  background: var(--surface-2, #f5f6f7);
  border: 1px solid var(--border, #e8e8e9);
  padding: 14px 16px; border-radius: 12px; overflow-x: auto; margin: 0 0 18px;
}
.markdown pre code { background: none; border: 0; padding: 0; }
.markdown blockquote {
  margin: 0 0 18px; padding: 14px 18px;
  border: 1px solid var(--accent, #82f384);
  border-left-width: 4px;
  border-radius: 0 12px 12px 0;
  background: var(--accent-soft, #eafdea);
  color: var(--text, #2e3c54);
}
.markdown blockquote > :last-child { margin-bottom: 0; }
.markdown hr { border: 0; border-top: 1px solid var(--border, #e8e8e9); margin: 32px 0; }
.markdown a { color: var(--accent-700, #12813b); text-decoration: underline; text-underline-offset: 2px; }
.markdown a:hover { color: var(--accent-800, #0d602c); }
.markdown del { color: var(--text-subtle, #8a939c); }

/* 리포트 리더 셸 — 모달/상세 공통 */
.report-reader { max-width: 860px; margin-inline: auto; }
.report-reader .report-meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 22px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border, #e8e8e9);
}
.report-reader .report-foot {
  margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--border, #e8e8e9);
}
.report-disclaimer {
  margin-top: 14px; font-size: 12.5px; line-height: 1.65;
  color: var(--text-subtle, #8a939c);
}

@media (max-width: 720px) {
  .markdown { font-size: 14.5px; }
  .markdown h1 { font-size: 22px; }
  .markdown h2 { font-size: 18px; }
}

/* --------------------------------------------------------------- 빈 상태 */
.empty-icon { color: var(--text-subtle, #97a1a9); margin-bottom: var(--sp-3, 12px); }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.empty-desc { color: var(--text-muted, #646f79); font-size: .88rem; margin-bottom: var(--sp-4, 16px); }

/* --------------------------------------------------------------- 반응형 */
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .page-header { flex-direction: column; align-items: flex-start; gap: var(--sp-3, 12px); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .input-group { width: 100%; } .toolbar .select { width: auto; flex: 1 1 100%; }
  .target-row { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------ 오버라이드 보정 */
/* hidden 속성이 display 규칙에 밀리지 않게 한다 */
[hidden] { display: none !important; }

/* 다크 캔버스 안에서도 주 버튼 글자색을 유지 */
.canvas .btn-primary,
.dash-hero .btn-primary,
.run-hero .btn-primary,
.run-progress .btn-primary {
  color: var(--accent-contrast, #0b2415);
}
.canvas .btn-primary svg, .dash-hero .btn-primary svg { color: inherit; }
.btn-primary { color: var(--accent-contrast, #0b2415); }
.login-visual-title, .login-visual .login-visual-title { color: #eafff0; }
.login-visual-desc { color: #b9d6c4; }

/* 모바일 드로어: 사이드바가 스크림보다 위에 오도록 보정 */
@media (max-width: 900px) {
  .drawer-scrim { z-index: 70; }
  .sidebar { z-index: 80; }
  .sidebar.open { box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,.28)); }
}
@media (max-width: 900px) {
  /* 드로어가 상단바 아래에서 시작하도록 여백 확보 */
  .sidebar { padding-top: calc(var(--sp-3, 12px) + env(safe-area-inset-top, 0px)); }
  .sidebar .sidebar-brand { padding-top: 6px; }
}

/* 스플래시 페이드 아웃 */
.boot-splash.boot-leaving {
  pointer-events: none;
  animation: boot-out .48s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes boot-out {
  from { opacity: 1; transform: scale(1); filter: blur(0); }
  to { opacity: 0; transform: scale(1.03); filter: blur(4px); }
}

/* 리포트 뷰어 — 다운로드본과 같은 문서를 앱 안에서 그대로 (iframe 격리) */
.report-frame-wrap { position: relative; margin: calc(var(--sp-5, 20px) * -1); }
.report-frame {
  display: block;
  width: 100%;
  height: min(78vh, 900px);
  border: 0;
  background: #fff;
}
.report-frame-fallback { padding: var(--sp-5, 20px); }
.report-frame-fallback[hidden] { display: none; }
@media (max-width: 720px) {
  .report-frame { height: 74vh; }
  .report-frame-wrap { margin: calc(var(--sp-4, 16px) * -1); }
}

/* 리포트 뷰어 모달 — 리포트 본문 폭에 맞춰 넓게 */
.modal.xwide { width: min(1280px, 100%); max-height: calc(100vh - 48px); }
@media (max-width: 1340px) { .modal.xwide { width: calc(100vw - 40px); } }

/* ------------------------------------------- 목록 테이블: 선택 열 · 행 동작 버튼 */
/* 리포트 목록에서 쓰던 패턴을 화합물 · 실험 · 스크리닝 · 데이터셋 목록에 공통 적용 */
.table th.col-chk,
.table td.col-chk {
  width: 36px;
  padding-right: 0;
  text-align: center;
  vertical-align: middle;
}
.table .col-chk input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent-600);
  vertical-align: middle;
}
.table .col-chk input[type='checkbox']:focus-visible {
  outline: 2px solid var(--accent-600);
  outline-offset: 2px;
}
/* 선택된 행은 은은하게 강조 */
.table tbody tr.row-selected > td { background: var(--accent-50, rgba(47, 201, 160, .08)); }

.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-1, 4px);
  white-space: nowrap;
}
.row-actions .btn-icon { flex: 0 0 auto; }
/* 마우스 환경에서는 호버·포커스 시에만 노출해 표를 조용하게 유지한다 */
@media (hover: hover) and (pointer: fine) {
  .row-actions { opacity: 0; transition: opacity .14s ease; }
  .table tbody tr:hover .row-actions,
  .table tbody tr:focus-within .row-actions,
  .table tbody tr.row-selected .row-actions { opacity: 1; }
}
