/* ==========================================================================
   GeroPaper — 디자인 시스템 (K-Genome 계열)
   남색(#2e5fa3) · 청록(#0e8fa0) · 옥(#12a594) · 금(#c9962c) 4색 팔레트
   부드러운 배경 · 라운드 코너 14px · 그라디언트 포인트 · 은은한 그림자
   ========================================================================== */

/* ---------- Pretendard (로컬 내장) ---------- */
@font-face {
  font-family: 'Pretendard';
  src: url('/static/fonts/PretendardVariable.woff2') format('woff2-variations');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face { font-family:'PretendardFallback'; font-weight:300; font-display:swap;
  src:url('/static/fonts/Pretendard-Light.ttf') format('truetype'); }
@font-face { font-family:'PretendardFallback'; font-weight:400; font-display:swap;
  src:url('/static/fonts/Pretendard-Regular.ttf') format('truetype'); }
@font-face { font-family:'PretendardFallback'; font-weight:500; font-display:swap;
  src:url('/static/fonts/Pretendard-Medium.ttf') format('truetype'); }
@font-face { font-family:'PretendardFallback'; font-weight:600; font-display:swap;
  src:url('/static/fonts/Pretendard-SemiBold.ttf') format('truetype'); }
@font-face { font-family:'PretendardFallback'; font-weight:700; font-display:swap;
  src:url('/static/fonts/Pretendard-Bold.ttf') format('truetype'); }

/* ==========================================================================
   테마 토큰
   ========================================================================== */
:root {
  --bg: #f3f6fb;
  --bg2: #eaf0f8;
  --panel: #ffffff;
  --panel2: #f6f9fd;
  --card: #ffffff;

  --border: #e4eaf3;
  --border2: #d3dcea;

  --text: #16233f;
  --muted: #5b6884;
  --faint: #94a1ba;

  --primary: #2e5fa3;
  --primary2: #0e8fa0;
  --jade: #12a594;
  --gold: #c9962c;
  --earth: #b5793a;
  --violet: #6d5bd0;

  --success: #0f8a5f;
  --warn: #c9962c;
  --danger: #dc2f45;

  --radius: 14px;
  --radius-sm: 11px;
  --radius-xs: 9px;
  --sidebar-w: 262px;
  --sidebar-cw: 72px;
  --header-h: 66px;

  --grad: linear-gradient(120deg, #2e5fa3, #0e8fa0 52%, #12a594);
  --grad2: linear-gradient(120deg, #c9962c, #b5793a);
  --grad3: linear-gradient(120deg, #2e5fa3, #12a594 55%, #c9962c);
  --shadow: 0 12px 34px -18px rgba(25, 45, 95, .30);
  --shadow-sm: 0 1px 2px rgba(20, 40, 80, .05);
  --shadow-lg: 0 40px 90px -24px rgba(20, 40, 90, .5);

  /* ---- 기존 클래스 호환 별칭 ---- */
  --bg-alt: var(--panel2);
  --bg-hover: var(--bg2);
  --bg-sunken: var(--panel2);
  --text-muted: var(--muted);
  --text-faint: var(--faint);
  --border-strong: var(--border2);
  --accent: var(--primary);
  --accent-hover: #26518f;
  --accent-active: #1f4478;
  --accent-light: rgba(46, 95, 163, .09);
  --accent-border: rgba(46, 95, 163, .32);
  --danger-light: rgba(220, 47, 69, .10);
  --warn-light: rgba(201, 150, 44, .14);
  --warn-text: #8a6512;
  --success-light: rgba(15, 138, 95, .12);
  --purple: var(--violet);
  --teal: var(--primary2);

  --font: 'Pretendard', 'PretendardFallback', system-ui, -apple-system,
          'Malgun Gothic', 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'D2Coding', monospace;

  --t-fast: .15s cubic-bezier(.4, 0, .2, 1);
  --t: .22s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
h1 { font-size: 25px; font-weight: 800; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
p { margin: 0 0 12px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: 13px; }
button { font-family: inherit; cursor: pointer; }
code, pre { font-family: var(--mono); font-size: 13px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
img, svg, video, canvas { max-width: 100%; }
::selection { background: rgba(46, 95, 163, .18); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #c9d4e4; border-radius: 8px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #adbcd2; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==========================================================================
   키프레임
   ========================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes gradShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes barMove { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.94) translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes checkPop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes ring { 0% { transform: scale(.6); opacity: .6; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 95, 163, .28); } 50% { box-shadow: 0 0 20px 3px rgba(18, 165, 148, .22); } }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 0 rgba(46, 95, 163, .45); } 50% { box-shadow: 0 0 0 5px rgba(46, 95, 163, 0); } }
@keyframes logoSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ==========================================================================
   로그인 — 좌: 비주얼 / 우: 폼
   ========================================================================== */
@keyframes authIn { 0% { opacity: 0; transform: translateY(18px); } 100% { opacity: 1; transform: none; } }
@keyframes authFade { 0% { opacity: 0; } 100% { opacity: 1; } }

.auth {
  position: fixed; inset: 0; display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #fff; overflow: hidden; overscroll-behavior: contain; max-width: 100vw;
}
.auth-visual {
  position: relative; overflow: hidden; min-width: 0; min-height: 100%;
  display: flex; align-items: center;
  background: linear-gradient(155deg, #0f1f3a 0%, #17406e 38%, #0e7f8e 72%, #12a594 100%);
}
.auth-visual::before {
  content: ''; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.5) 22px 23px),
    repeating-linear-gradient(65deg, transparent 0 22px, rgba(255,255,255,.32) 22px 23px);
}
.auth-visual::after {
  content: ''; position: absolute; right: -90px; top: -90px; width: 380px; height: 380px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(201,150,44,.40), transparent 62%);
}
.auth-visual-body {
  position: relative; z-index: 1; min-width: 0; max-width: 100%; color: #fff;
  padding: clamp(40px, 7vh, 80px) clamp(28px, 5vw, 64px);
  animation: authFade .9s ease both;
}
.auth-eyebrow {
  font-size: 13px; font-weight: 800; letter-spacing: .16em;
  color: #3fd8c8; margin-bottom: 16px;
}
.auth-headline {
  overflow-wrap: break-word; font-size: clamp(26px, 3.4vw, 42px); font-weight: 800;
  line-height: 1.24; letter-spacing: -.02em; margin: 0 0 16px;
  text-shadow: 0 2px 22px rgba(0, 0, 0, .45);
}
.auth-headline strong { font-weight: 800; color: #ffe6ac; }
.auth-tagline {
  overflow-wrap: break-word; font-size: clamp(13.5px, 1.15vw, 16px); line-height: 1.8;
  color: #cfe3ee; margin: 0; text-shadow: 0 1px 12px rgba(0, 0, 0, .4);
}
.auth-features { display: flex; flex-direction: column; gap: 11px; margin-top: 28px; }
.auth-feature {
  display: flex; align-items: flex-start; gap: 11px;
  font-size: 14px; color: #e2f0f7; line-height: 1.6;
}
.auth-feature svg { flex-shrink: 0; margin-top: 3px; color: #3fd8c8; }
.auth-brand-line {
  display: flex; align-items: center; gap: 12px; margin-bottom: 26px;
  font-size: 21px; font-weight: 800; letter-spacing: -.02em;
}

.auth-panel {
  display: flex; align-items: center; justify-content: center; background: #fff;
  min-width: 0; padding: clamp(24px, 4vw, 48px);
  padding-top: max(clamp(24px, 4vw, 48px), env(safe-area-inset-top));
  padding-bottom: max(clamp(24px, 4vw, 48px), env(safe-area-inset-bottom));
}
.auth-card {
  width: min(430px, 100%); min-width: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 18px; padding: 32px 32px 28px;
  box-shadow: 0 10px 40px -22px rgba(20, 45, 100, .28);
  animation: authIn .6s cubic-bezier(.2, .9, .2, 1) both;
}
.auth-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand {
  display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0;
  font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text);
}
.auth-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.auth-desc { font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.auth-foot {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--faint); line-height: 1.65; text-align: center;
}

/* 플로팅 라벨 입력 */
.fld { position: relative; margin-bottom: 14px; }
.fin {
  width: 100%; padding: 21px 15px 8px; border-radius: var(--radius-sm); font-size: 16px;
  background: #fff; border: 1px solid var(--border2); color: var(--text);
  outline: none; transition: var(--t-fast); line-height: 1.4; font-family: inherit;
}
.fin:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(18, 165, 148, .14); }
.fld label {
  position: absolute; left: 15px; top: 16px; font-size: 15px; color: var(--faint);
  pointer-events: none; transition: .16s ease; background: transparent;
}
.fin:focus + label,
.fin:not(:placeholder-shown) + label { top: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.fin:focus + label { color: var(--jade); }

@media (max-width: 900px) {
  .auth {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto;
    overflow-y: auto; overflow-x: hidden; align-content: start;
  }
  .auth-visual { min-height: clamp(200px, 30vh, 290px); padding-top: env(safe-area-inset-top); }
  .auth-visual-body { padding: 26px 22px; }
  .auth-headline { font-size: clamp(21px, 5.6vw, 30px); }
  .auth-tagline { font-size: 13px; }
  .auth-features { display: none; }
  .auth-panel { padding: 24px 18px max(28px, env(safe-area-inset-bottom)); }
  .auth-card { border: none; box-shadow: none; padding: 4px 0 0; }
}

/* ==========================================================================
   앱 셸
   ========================================================================== */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* ---------- 사이드바 ---------- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff, #f5f9fd);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width var(--t); overflow: hidden;
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-cw); }

.side-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  height: 88px; flex-shrink: 0; cursor: pointer; color: var(--text);
}
.side-head:hover { text-decoration: none; }
.side-head svg { width: 46px; height: 46px; flex-shrink: 0; }
.side-head svg.spin { animation: logoSpin .75s cubic-bezier(.34, 1.2, .4, 1); }
.side-brand-wrap { min-width: 0; }
.side-brand {
  font-weight: 800; font-size: 22px; white-space: nowrap; letter-spacing: -.03em;
  background: var(--grad3); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite; line-height: 1.2;
}
.side-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
body.sidebar-collapsed .side-head { justify-content: center; padding: 14px 8px; }
body.sidebar-collapsed .side-brand-wrap { display: none; }

.nav {
  flex: 1; padding: 6px 10px 14px; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-section {
  font-size: 11.5px; font-weight: 800; color: var(--faint); letter-spacing: .08em;
  padding: 13px 13px 5px; text-transform: uppercase; white-space: nowrap;
}
body.sidebar-collapsed .nav-section { display: none; }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border-radius: var(--radius-sm); color: #1a2540; border: 1px solid transparent;
  transition: var(--t-fast); white-space: nowrap; font-size: 15px; font-weight: 600;
  cursor: pointer; position: relative; text-decoration: none;
}
.nav-item .icon, .nav-item svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.nav-item:hover { background: rgba(46, 95, 163, .09); color: #000; text-decoration: none; }
.nav-item.active {
  background: rgba(46, 95, 163, .13); color: var(--primary);
  border-color: rgba(46, 95, 163, .28); font-weight: 700;
}
.nav-item.active .icon, .nav-item.active svg { color: var(--primary); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  background: var(--grad); color: #fff; font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 20px; min-width: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
body.sidebar-collapsed .nav-item { justify-content: center; padding: 11px; }
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge { display: none; }

/* 접힘 상태 툴팁 */
body.sidebar-collapsed .nav-item::after {
  content: attr(data-tip);
  position: absolute; left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--text); color: #fff; padding: 7px 11px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 500;
  transition: opacity var(--t-fast), transform var(--t-fast); box-shadow: var(--shadow);
}
body.sidebar-collapsed .nav-item:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }

.sidebar-foot {
  padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
body.sidebar-collapsed .sidebar-foot { flex-direction: column; justify-content: center; gap: 8px; padding: 10px 6px; }
.sidebar-foot .uname {
  flex: 1; min-width: 0; font-size: 14px; color: var(--text); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-foot .uname small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 500; }
body.sidebar-collapsed .sidebar-foot .uname,
body.sidebar-collapsed .sidebar-foot .version { display: none; }
.sidebar-foot .version { font-size: 11.5px; color: var(--faint); white-space: nowrap; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0; font-size: 13px; border: 0;
}
body.sidebar-collapsed .sidebar-foot .avatar { width: 30px; height: 30px; font-size: 12px; }

/* ---------- 본문 ---------- */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.topbar {
  height: var(--header-h); flex-shrink: 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(8px); z-index: 20;
}
.topbar h1 {
  font-size: 18.5px; font-weight: 800; margin: 0; flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em;
}
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.content {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.page {
  padding: 24px 28px calc(80px + env(safe-area-inset-bottom));
  padding-left: max(28px, env(safe-area-inset-left));
  padding-right: max(28px, env(safe-area-inset-right));
  max-width: 1480px; width: 100%; animation: fadeUp .35s ease;
}
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-title-wrap { min-width: 0; }
.page-head h1 { letter-spacing: -.03em; }
.page-sub { color: var(--muted); font-size: 14.5px; margin-top: 4px; line-height: 1.7; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 드로어 오버레이 (모바일) */
.drawer-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10, 18, 38, .5);
  backdrop-filter: blur(2px); z-index: 110; opacity: 0; transition: opacity var(--t);
}
.drawer-overlay.show { display: block; opacity: 1; }

/* ==========================================================================
   컴포넌트
   ========================================================================== */

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 19px; height: 42px; font-family: inherit; font-size: 15px;
  font-weight: 600; border: none; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1;
  color: #fff; background: var(--grad); background-size: 200% auto;
  box-shadow: 0 10px 22px -12px rgba(46, 95, 163, .6);
  transition: background-position .3s ease, transform .18s ease, box-shadow .18s ease,
              border-color var(--t-fast), color var(--t-fast), background-color var(--t-fast);
}
.btn:hover { background-position: right center; transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn .icon, .btn > svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-secondary { background: linear-gradient(120deg, #64748f, #4d5b7c); box-shadow: 0 10px 22px -12px rgba(77, 91, 124, .6); }
.btn-ghost { background: #fff; border: 1px solid var(--border2); color: var(--primary); box-shadow: none; }
.btn-ghost:hover { border-color: var(--primary); background: rgba(46, 95, 163, .06); color: var(--primary); }
.btn-quiet { background: #fff; border: 1px solid var(--border2); color: var(--text); box-shadow: none; }
.btn-quiet:hover { border-color: var(--primary); background: rgba(46, 95, 163, .06); color: var(--text); }
.btn-gold { background: var(--grad2); box-shadow: 0 10px 22px -12px rgba(201, 150, 44, .6); }
.btn-danger { background: linear-gradient(120deg, #e8697c, #dc2f45); box-shadow: 0 10px 22px -12px rgba(220, 47, 69, .5); }
.btn-danger:hover { color: #fff; }

.btn-sm { height: 34px; padding: 0 13px; font-size: 13.5px; border-radius: var(--radius-xs); }
.btn-sm .icon, .btn-sm > svg { width: 15px; height: 15px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; border-radius: 8px; box-shadow: none; }
.btn-xs .icon, .btn-xs > svg { width: 13px; height: 13px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 36px; height: 36px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--muted); cursor: pointer; transition: var(--t-fast); flex-shrink: 0;
}
.icon-btn:hover { color: var(--primary); background: rgba(46, 95, 163, .08); border-color: var(--primary); }
.icon-btn.danger:hover { color: var(--danger); background: rgba(220, 47, 69, .08); border-color: var(--danger); }
.icon-btn .icon, .icon-btn > svg { width: 17px; height: 17px; }
.icon-btn.plain { background: transparent; border-color: transparent; }
.icon-btn.plain:hover { background: rgba(46, 95, 163, .08); border-color: transparent; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* 세그먼트 컨트롤 */
.seg {
  display: inline-flex; background: var(--panel2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px; flex-wrap: wrap;
}
.seg button {
  padding: 8px 16px; border: none; background: transparent; color: var(--muted);
  border-radius: 8px; font-weight: 600; font-size: 14px; transition: var(--t-fast);
  font-family: inherit;
}
.seg button.on { background: var(--grad); color: #fff; }
.seg.seg-sm { padding: 3px; }
.seg.seg-sm button { padding: 5px 12px; font-size: 13px; }

/* ---------- 설치·발급 안내 블록 ---------- */
.guide {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  padding: 16px 18px;
}
.guide-head { display: flex; align-items: flex-start; gap: 10px; }
.guide-head .icon { flex-shrink: 0; width: 19px; height: 19px; margin-top: 2px; color: var(--primary); }
.guide-steps {
  list-style: none; counter-reset: gstep; margin: 14px 0 0; padding: 0;
}
.guide-steps > li {
  counter-increment: gstep; position: relative; padding: 0 0 14px 32px;
  font-size: 14px; line-height: 1.65; color: var(--text);
}
.guide-steps > li::before {
  content: counter(gstep); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%; background: var(--grad);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.guide-steps > li:last-child { padding-bottom: 0; }

.cmd-box {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 2px;
  background: #16233f; color: #e8eefb; border-radius: var(--radius-sm);
  padding: 9px 10px 9px 13px; overflow-x: auto;
}
.cmd-box code {
  font-family: var(--mono); font-size: 12.5px; white-space: pre;
  flex: 1; color: inherit; background: none; padding: 0;
}
.cmd-box .icon-btn { color: #a8bdd9; flex-shrink: 0; }
.cmd-box .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .12); }

.field-hint .ok { color: var(--success); font-weight: 600; }
.field-hint .warn { color: var(--gold); font-weight: 600; }

/* ---------- 카드 · 패널 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0; max-width: 100%;
}
.card-pad { padding: 20px 22px; }
.card-head {
  padding: 15px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; background: var(--panel2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-head h3 { font-size: 16.5px; }
.card-body { padding: 20px 22px; }
.card-foot {
  padding: 13px 22px; border-top: 1px solid var(--border); background: var(--panel2);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  border-radius: 0 0 var(--radius) var(--radius);
}

.grid { display: grid; gap: 16px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }

/* ---------- 히어로 ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 36px 34px;
  color: #fff; margin-bottom: 18px;
  background: linear-gradient(125deg, #12233f, #1f4a86 34%, #0e7f92 66%, #12a594);
  box-shadow: 0 18px 44px -22px rgba(20, 50, 110, .6);
}
.hero::before {
  content: ''; position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background-image:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.5) 22px 23px),
    repeating-linear-gradient(65deg, transparent 0 22px, rgba(255,255,255,.35) 22px 23px);
}
.hero::after {
  content: ''; position: absolute; right: -70px; top: -70px; width: 320px; height: 320px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(201,150,44,.42), transparent 62%);
}
.hero > * { position: relative; z-index: 1; }
.hero h2 {
  margin: 0 0 10px; font-size: 31px; font-weight: 800; letter-spacing: -.03em;
  color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}
.hero p {
  margin: 0; opacity: .96; font-size: 16px; line-height: 1.8; max-width: 780px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .3);
}
.hero .hbadge {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 13px;
  padding: 5px 13px; border-radius: 20px; background: rgba(255, 255, 255, .16);
  font-size: 13px; font-weight: 700; letter-spacing: .03em;
}
.hero .hbadge .icon { width: 15px; height: 15px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-actions .btn { background: #fff; color: var(--primary); box-shadow: 0 10px 26px -12px rgba(0,0,0,.5); }
.hero-actions .btn:hover { color: var(--primary); background: #f3f8ff; }
.hero-actions .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.hero-actions .btn.ghost:hover { background: rgba(255,255,255,.24); color: #fff; }

/* ---------- 통계 타일 ---------- */
.stat {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 19px 20px; box-shadow: var(--shadow); position: relative;
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -18px rgba(30, 60, 140, .4); }
.stat::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--grad); }
.stat.purple::before { background: linear-gradient(120deg, #6d5bd0, #9b7ee8); }
.stat.teal::before { background: linear-gradient(120deg, #0e8fa0, #12a594); }
.stat.warn::before { background: var(--grad2); }
.stat-label {
  font-size: 13.5px; color: var(--muted); margin-bottom: 7px;
  display: flex; align-items: center; gap: 7px; font-weight: 600;
}
.stat-label .icon { width: 16px; height: 16px; color: var(--primary); }
.stat-value {
  font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.stat-meta { font-size: 12.5px; color: var(--faint); margin-top: 6px; }
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--primary2); }

/* ---------- 폼 ---------- */
.field { margin-bottom: 18px; }
.field-label {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 7px;
}
.field-label .req { color: var(--danger); font-weight: 800; }
.field-label .spacer { flex: 1; }
.field-hint { font-size: 13px; color: var(--faint); margin-top: 6px; line-height: 1.6; }
.field-error { font-size: 13px; color: var(--danger); margin-top: 6px; font-weight: 600; }

.input, .textarea, .select {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 11px 14px; transition: var(--t-fast); outline: none;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(46, 95, 163, .14);
}
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--panel2); color: var(--faint); cursor: not-allowed;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.textarea.tall { min-height: 210px; }
.textarea.mono { font-family: var(--mono); font-size: 13.5px; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6884' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 38px; cursor: pointer;
}

.input-group { display: flex; gap: 8px; }
.input-group .input, .input-group .select { flex: 1; min-width: 0; }
.input-group .btn { flex-shrink: 0; }

.checkbox, .radio {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 7px 0; font-size: 14.5px; user-select: none;
}
.checkbox input, .radio input {
  width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary);
  cursor: pointer; flex-shrink: 0;
}
.checkbox-card {
  display: flex; align-items: flex-start; gap: 11px; padding: 14px 16px;
  border: 1px solid var(--border2); border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--t-fast); background: #fff; position: relative; overflow: hidden;
}
.checkbox-card:hover {
  border-color: var(--primary2); transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(46, 95, 163, .6);
}
.checkbox-card.checked {
  border-color: var(--primary); background: rgba(46, 95, 163, .06);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.checkbox-card.checked::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--grad);
}
.checkbox-card input { margin-top: 2px; accent-color: var(--primary); flex-shrink: 0; }
.checkbox-card .cc-title { font-weight: 700; font-size: 14.5px; }
.checkbox-card .cc-desc { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.55; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle-track {
  width: 44px; height: 24px; background: var(--border2); border-radius: 20px;
  position: relative; transition: background var(--t-fast); flex-shrink: 0;
}
.toggle-track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform var(--t-fast);
  box-shadow: 0 1px 3px rgba(20, 40, 80, .3);
}
.toggle input:checked + .toggle-track { background: var(--jade); }
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* 예제 채우기 버튼 */
.ex-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 20px; border: 1px dashed var(--border2); background: #fff;
  color: var(--primary2); font-size: 12px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--t-fast); line-height: 1.5; white-space: nowrap;
}
.ex-btn:hover { border-color: var(--jade); background: rgba(18, 165, 148, .10); color: var(--jade); border-style: solid; }
.ex-btn:active { transform: scale(.96); }
.ex-btn svg, .ex-btn .icon { width: 13px; height: 13px; }
.ex-flash {
  animation: exFlash .9s cubic-bezier(.22, 1, .36, 1);
}
@keyframes exFlash {
  0% { box-shadow: 0 0 0 0 rgba(18, 165, 148, .55); border-color: var(--jade); }
  100% { box-shadow: 0 0 0 12px rgba(18, 165, 148, 0); }
}

/* ---------- 테이블 ---------- */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); container-type: inline-size;
}
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; padding: 12px 16px; background: var(--panel2); font-weight: 700;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--primary); background: var(--bg2); }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(46, 95, 163, .035); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { white-space: nowrap; text-align: right; }

/* ---------- 태그 · 배지 · 칩 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  font-size: 12.5px; font-weight: 700; background: var(--panel2);
  color: var(--muted); border-radius: 7px; white-space: nowrap;
}
.tag.accent { background: rgba(46, 95, 163, .10); color: var(--primary); }
.tag.success { background: rgba(15, 138, 95, .12); color: var(--success); }
.tag.warn { background: rgba(201, 150, 44, .16); color: #8a6512; }
.tag.danger { background: rgba(220, 47, 69, .10); color: var(--danger); }
.tag.purple { background: rgba(109, 91, 208, .12); color: var(--violet); }
.tag.teal { background: rgba(14, 143, 160, .12); color: #0a6b78; }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  white-space: nowrap; max-width: 100%; overflow: hidden;
}
.badge .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 8px rgba(15, 138, 95, .55); flex: 0 0 auto;
}
.badge.off .dot { background: var(--faint); box-shadow: none; }
.badge > span:not(.dot) { overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px;
  border: 1px solid var(--border2); border-radius: 20px; font-size: 13px;
  background: #fff; font-weight: 600;
}
.chip button {
  background: none; border: 0; cursor: pointer; color: var(--faint);
  padding: 0; display: inline-flex; line-height: 1;
}
.chip button:hover { color: var(--danger); }

.pill {
  display: inline-block; padding: 3px 11px; border-radius: 20px;
  background: rgba(46, 95, 163, .10); color: var(--primary);
  font-size: 13px; margin: 3px 4px 0 0; font-weight: 700;
}

/* ---------- 알림 배너 ---------- */
.notice {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary); background: rgba(46, 95, 163, .07);
  font-size: 14px; line-height: 1.7; color: var(--text);
}
.notice .icon { flex-shrink: 0; width: 19px; height: 19px; margin-top: 2px; color: var(--primary); }
.notice.warn { border-left-color: var(--gold); background: #fdf6e8; color: #7a5a12; }
.notice.warn .icon { color: var(--gold); }
.notice.danger { border-left-color: var(--danger); background: rgba(220, 47, 69, .07); }
.notice.danger .icon { color: var(--danger); }
.notice.success { border-left-color: var(--success); background: rgba(15, 138, 95, .08); }
.notice.success .icon { color: var(--success); }
.notice-title { font-weight: 700; margin-bottom: 3px; }

/* ---------- 프로그레스 ---------- */
.progress {
  height: 10px; border-radius: 20px; background: #e5ebf4; overflow: hidden;
  position: relative; border: 1px solid var(--border);
}
.progress-bar {
  height: 100%; border-radius: 20px; position: relative;
  background: var(--grad3); background-size: 220% auto;
  animation: gradShift 3.5s linear infinite;
  transition: width .5s cubic-bezier(.3, .9, .4, 1);
  box-shadow: 0 0 12px rgba(46, 95, 163, .4);
}
.progress-bar::after {
  content: ''; position: absolute; inset: 0; border-radius: 20px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  background-size: 200px 100%; animation: shimmer 1.4s linear infinite;
}
.progress.indeterminate .progress-bar {
  width: 36% !important; position: absolute; top: 0; bottom: 0;
  animation: barMove 1.2s cubic-bezier(.45, 0, .55, 1) infinite,
             gradShift 3.5s linear infinite;
}
.progress-bar.striped::after { animation: shimmer 1.1s linear infinite; }
.progress.done .progress-bar { background: linear-gradient(120deg, #0f8a5f, #12a594); animation: none; }
.progress.done .progress-bar::after,
.progress.failed .progress-bar::after { animation: none; opacity: 0; }
.progress.failed .progress-bar { background: linear-gradient(120deg, #e8697c, #dc2f45); animation: none; }

.spinner {
  width: 17px; height: 17px; border: 2.5px solid rgba(46, 95, 163, .22);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0;
}
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
.spinner.on-accent { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }

/* 작업 진행 패널 */
.run-panel {
  margin-top: 16px; padding: 18px 18px 16px; border-radius: 16px;
  position: relative; overflow: hidden; border: 1px solid rgba(46, 95, 163, .26);
  background: linear-gradient(125deg, rgba(46,95,163,.07), rgba(18,165,148,.07) 55%, rgba(201,150,44,.06));
  animation: fadeUp .35s cubic-bezier(.22, 1, .36, 1) both;
}
.run-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 100% at 0% 0%, rgba(255, 255, 255, .75), transparent 55%);
}
.run-panel > * { position: relative; }
.run-panel-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; flex-wrap: wrap; }
.run-panel-title { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0; }
.run-panel-pct {
  font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--grad3); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.run-panel-label { margin-top: 10px; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.run-panel-label b { color: var(--text); font-weight: 700; }

/* ---------- 스켈레톤 ---------- */
.skeleton {
  background: linear-gradient(100deg, var(--panel2) 30%, #fff 50%, var(--panel2) 70%);
  background-size: 400px 100%; animation: shimmer 1.4s linear infinite;
  border-radius: 8px;
}
.skeleton-line { height: 13px; margin-bottom: 11px; }
.skeleton-line.short { width: 55%; }
.skeleton-block { height: 110px; }

/* ---------- 빈 상태 ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty > .icon { width: 46px; height: 46px; color: var(--border2); margin-bottom: 14px; opacity: .8; }
.empty .btn .icon { width: 17px; height: 17px; margin-bottom: 0; color: currentColor; opacity: 1; }
.empty h3 { font-size: 17px; color: var(--text); margin-bottom: 7px; }
.empty p { font-size: 14.5px; max-width: 440px; margin: 0 auto 18px; line-height: 1.7; }

/* ---------- 탭 ---------- */
.tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; padding-bottom: 1px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 17px; font-size: 14.5px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-bottom: 2.5px solid transparent;
  cursor: pointer; white-space: nowrap; transition: var(--t-fast);
  display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
  border-radius: 10px 10px 0 0;
}
.tab:hover { color: var(--text); background: rgba(46, 95, 163, .06); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab .icon { width: 16px; height: 16px; }
.tab .count {
  background: var(--panel2); padding: 1px 8px; border-radius: 20px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.tab.active .count { background: rgba(46, 95, 163, .13); color: var(--primary); }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(18, 32, 64, .42);
  backdrop-filter: blur(5px); z-index: 900; display: flex;
  align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s;
}
.modal {
  background: #fff; width: 100%; max-width: 580px; max-height: 90vh;
  display: flex; flex-direction: column; border: 1px solid var(--border2);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: popIn .32s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { max-width: 900px; }
.modal.xwide { max-width: 1160px; }
.modal-head {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-head h3 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.modal-head .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 14px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

/* ---------- 토스트 ---------- */
.toast-wrap {
  position: fixed; top: calc(var(--header-h) + 12px); right: 18px;
  z-index: 1000; display: flex; flex-direction: column; gap: 9px;
  max-width: min(410px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  background: #fff; color: var(--text); padding: 13px 16px; border-radius: 12px;
  display: flex; align-items: flex-start; gap: 11px; box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.2, .9, .2, 1); pointer-events: auto;
  border: 1px solid var(--border2); border-left: 3px solid var(--primary);
  font-size: 14.5px; line-height: 1.55;
}
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { transform: translateX(30px); opacity: 0; } }
.toast.success { border-left-color: var(--success); }
.toast.success .icon { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .icon { color: var(--danger); }
.toast.warn { border-left-color: var(--gold); }
.toast.warn .icon { color: var(--gold); }
.toast .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--primary); }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { color: var(--muted); font-size: 13.5px; word-break: break-word; }
.toast button {
  background: none; border: 0; color: var(--faint); cursor: pointer; padding: 0;
  display: inline-flex; flex-shrink: 0;
}
.toast button:hover { color: var(--text); }

/* ---------- 진행 상태 알약 (하단 고정) ---------- */
.job-dock {
  position: fixed; left: 50%; bottom: max(22px, calc(env(safe-area-inset-bottom) + 14px));
  transform: translateX(-50%); z-index: 700;
  display: flex; flex-direction: column-reverse; gap: 9px;
  align-items: center; max-width: min(580px, calc(100vw - 24px)); pointer-events: none;
}
.job-pill {
  display: flex; align-items: center; gap: 11px; padding: 11px 18px;
  border-radius: 30px; cursor: pointer; pointer-events: auto;
  min-width: 300px; max-width: 100%; color: #fff; font-weight: 600; font-size: 14.5px;
  background: var(--grad3); background-size: 200% auto;
  box-shadow: 0 12px 30px -8px rgba(46, 95, 163, .6);
  animation: gradShift 3.5s linear infinite, popIn .3s cubic-bezier(.2, .9, .2, 1);
  border: 0; font-family: inherit; text-align: left; position: relative; overflow: hidden;
}
.job-pill.done { background: linear-gradient(120deg, #0f8a5f, #12a594); animation: none; }
.job-pill.failed { background: linear-gradient(120deg, #e8697c, #dc2f45); animation: none; }
.job-pill .pill-body { flex: 1; min-width: 0; }
.job-pill .pill-label { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-pill .pill-step { font-size: 12px; color: rgba(255, 255, 255, .82); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.job-pill .pill-pct {
  font-size: 13px; font-variant-numeric: tabular-nums; flex-shrink: 0;
  background: rgba(255, 255, 255, .22); padding: 2px 10px; border-radius: 20px;
}
.job-pill .pill-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .22); }
.job-pill .pill-progress > div { height: 100%; background: rgba(255, 255, 255, .9); transition: width .3s ease; }
.job-pill .pill-close {
  background: none; border: 0; color: rgba(255, 255, 255, .7); cursor: pointer;
  padding: 2px; display: inline-flex; flex-shrink: 0;
}
.job-pill .pill-close:hover { color: #fff; }
.job-pill .spinner { border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }

/* ==========================================================================
   기능별 스타일
   ========================================================================== */

/* ---------- 위자드 ---------- */
.wizard-steps {
  display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }
.wstep {
  display: flex; align-items: center; gap: 9px; padding: 12px 17px;
  border: 0; border-bottom: 2.5px solid transparent; cursor: pointer; white-space: nowrap;
  color: var(--muted); font-size: 14px; font-weight: 600; background: none;
  font-family: inherit; transition: var(--t-fast); border-radius: 10px 10px 0 0;
}
.wstep:hover { background: rgba(46, 95, 163, .06); color: var(--text); }
.wstep.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.wstep.done { color: var(--success); }
.wstep-num {
  width: 24px; height: 24px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; background: var(--panel2);
  font-size: 12px; font-weight: 800; flex-shrink: 0; color: var(--muted);
  transition: var(--t-fast);
}
.wstep.active .wstep-num { background: var(--grad); color: #fff; }
.wstep.done .wstep-num { background: var(--success); color: #fff; animation: checkPop .35s; }

.wizard-panel { max-width: 920px; }
.wizard-nav {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border);
}

/* ---------- 저널 카드 ---------- */
.journal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 11px; max-height: 500px; overflow-y: auto; padding: 3px;
}
.journal-card {
  border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 14px 15px;
  cursor: pointer; transition: var(--t-fast); background: #fff; text-align: left;
  font-family: inherit; display: flex; flex-direction: column; gap: 5px;
  position: relative; overflow: hidden;
}
.journal-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad); opacity: 0; transition: var(--t-fast);
}
.journal-card:hover {
  border-color: var(--primary2); transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(46, 95, 163, .6);
}
.journal-card.selected {
  border-color: var(--primary); background: rgba(46, 95, 163, .06);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.journal-card.selected::before { opacity: 1; }
.journal-card .jc-name { font-weight: 700; font-size: 14.5px; line-height: 1.35; }
.journal-card .jc-pub { font-size: 12.5px; color: var(--muted); }
.journal-card .jc-meta { font-size: 12px; color: var(--faint); }

/* IF · APC 메트릭 */
.jmetrics { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 3px; }
.jmetric {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 9px;
  border-radius: 7px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--panel2); color: var(--muted); border: 1px solid var(--border);
}
.jmetric .k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; color: var(--faint); }
.jmetric .v { font-variant-numeric: tabular-nums; }
.jmetric.if { background: rgba(46, 95, 163, .09); border-color: rgba(46, 95, 163, .22); color: var(--primary); }
.jmetric.if .k { color: rgba(46, 95, 163, .7); }
.jmetric.apc { background: rgba(201, 150, 44, .13); border-color: rgba(201, 150, 44, .28); color: #8a6512; }
.jmetric.apc .k { color: rgba(138, 101, 18, .7); }
.jmetric.apc.free { background: rgba(15, 138, 95, .12); border-color: rgba(15, 138, 95, .28); color: var(--success); }
.jmetric.apc.free .k { color: rgba(15, 138, 95, .7); }
.jmetric.na { opacity: .72; }

/* ---------- 파이프라인 보드 ---------- */
.pipeline-phases { display: flex; flex-direction: column; gap: 14px; }
.phase-block {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  overflow: hidden; box-shadow: var(--shadow); animation: fadeUp .45s ease;
}
.phase-head {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px;
  background: var(--panel2); border-bottom: 1px solid var(--border);
}
.phase-no {
  width: 28px; height: 28px; border-radius: var(--radius-xs); background: var(--grad);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.phase-block.complete .phase-no { background: linear-gradient(120deg, #0f8a5f, #12a594); }
.phase-block.active .phase-no { background: var(--grad3); background-size: 200% auto; animation: gradShift 3s linear infinite; }
.phase-title { font-weight: 700; font-size: 15.5px; }
.phase-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.phase-stages { padding: 4px 0; }

.stage-row {
  display: flex; align-items: center; gap: 13px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); transition: background var(--t-fast);
}
.stage-row:last-child { border-bottom: 0; }
.stage-row:hover { background: rgba(46, 95, 163, .035); }
.stage-status {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--border2); color: var(--faint); position: relative; transition: .2s;
}
.stage-status.done { background: var(--success); border-color: var(--success); color: #fff; animation: checkPop .4s; }
.stage-status.running { border-color: var(--primary); color: var(--primary); }
.stage-status.running::after {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid var(--primary); animation: ring 1.4s ease-out infinite;
}
.stage-status.failed { background: var(--danger); border-color: var(--danger); color: #fff; }
.stage-status.queued { background: var(--gold); border-color: var(--gold); color: #fff; }
.stage-status .icon { width: 14px; height: 14px; }
.stage-info { flex: 1; min-width: 0; }
.stage-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }
.stage-actions { display: flex; gap: 5px; flex-shrink: 0; }
.skill-tag {
  font-family: var(--mono); font-size: 11px; background: rgba(109, 91, 208, .12);
  color: var(--violet); padding: 2px 8px; border-radius: 6px; white-space: nowrap; font-weight: 600;
}
.agent-tag {
  font-family: var(--mono); font-size: 11px; background: rgba(14, 143, 160, .12);
  color: #0a6b78; padding: 2px 8px; border-radius: 6px; white-space: nowrap; font-weight: 600;
}

/* ---------- 논문 에디터 ---------- */
.editor-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 22px; }
.editor-toc { position: sticky; top: 8px; align-self: start; }
.toc-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 13px; font-size: 14px; cursor: pointer; border: 0;
  border-radius: var(--radius-xs); color: var(--muted); transition: var(--t-fast);
  background: none; width: 100%; font-family: inherit; text-align: left; font-weight: 600;
}
.toc-item:hover { background: rgba(46, 95, 163, .07); color: var(--text); }
.toc-item.active { background: rgba(46, 95, 163, .13); color: var(--primary); font-weight: 700; }
.toc-item .wc { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }

.section-editor {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px;
  background: #fff; overflow: hidden; box-shadow: var(--shadow);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  background: var(--panel2); flex-wrap: wrap;
}
.section-head h3 { font-size: 15.5px; }
.section-tools { display: flex; gap: 5px; flex-wrap: wrap; }
.section-body {
  padding: 20px 22px; min-height: 150px; font-size: 15.5px; line-height: 1.9;
  outline: none; white-space: pre-wrap; word-break: break-word; color: #25314e;
}
.section-body:focus { background: #fbfdff; box-shadow: inset 0 0 0 2px rgba(46, 95, 163, .35); }
.section-body[data-empty]:empty::before { content: attr(data-empty); color: var(--faint); font-style: italic; }
.section-body strong { font-weight: 700; }
.section-body em { font-style: italic; }
.section-foot {
  padding: 8px 18px; border-top: 1px solid var(--border); font-size: 12px;
  color: var(--faint); display: flex; justify-content: space-between; gap: 10px;
  background: var(--panel2); flex-wrap: wrap;
}

/* 공동작업 접속자 */
.presence-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: linear-gradient(120deg, rgba(46,95,163,.07), rgba(18,165,148,.07));
  margin-bottom: 16px; flex-wrap: wrap;
}
.presence-avatars { display: flex; }
.presence-avatar {
  width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px;
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff; margin-left: -8px; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(20, 40, 80, .18);
}
.presence-avatar:first-child { margin-left: 0; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 8px rgba(15, 138, 95, .6); animation: pulseDot 2s infinite; flex-shrink: 0;
}

/* ---------- Figure ---------- */
.figure-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  overflow: hidden; box-shadow: var(--shadow); transition: var(--t-fast);
}
.figure-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -18px rgba(30, 60, 140, .45); }
.figure-img {
  width: 100%; aspect-ratio: 3/2; object-fit: contain; background: var(--panel2);
  display: block; cursor: zoom-in;
}
.figure-placeholder {
  width: 100%; aspect-ratio: 3/2; background: var(--panel2); display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--faint); font-size: 13px; text-align: center; padding: 16px;
}
.figure-meta { padding: 13px 15px; }
.figure-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.figure-caption { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- 리비전 포인트 ---------- */
.rev-point {
  border: 1px solid var(--border); border-left: 4px solid var(--faint);
  border-radius: var(--radius-sm); margin-bottom: 12px; background: #fff;
  overflow: hidden; transition: var(--t-fast);
}
.rev-point:hover { box-shadow: 0 10px 24px -18px rgba(20, 45, 95, .5); }
.rev-point.major { border-left-color: var(--danger); }
.rev-point.minor { border-left-color: var(--gold); }
.rev-point.optional { border-left-color: var(--faint); }
.rev-point.resolved { opacity: .62; }
.rev-head {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 17px;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--panel2);
}
.rev-no {
  width: 26px; height: 26px; border-radius: 8px; background: #fff; border: 1px solid var(--border2);
  font-size: 12px; font-weight: 800; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; color: var(--muted);
}
.rev-body { padding: 16px 17px; display: flex; flex-direction: column; gap: 14px; }
.rev-field-label {
  font-size: 11.5px; font-weight: 800; color: var(--faint);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.rev-quote {
  background: var(--panel2); padding: 11px 14px; border-radius: 10px; font-size: 14px;
  border-left: 3px solid var(--border2); line-height: 1.7; white-space: pre-wrap;
}

/* ---------- 마크다운 뷰어 ---------- */
.md-view { font-size: 15px; line-height: 1.85; color: #25314e; }
.md-view h1, .md-view h2, .md-view h3, .md-view h4 { margin: 24px 0 10px; color: var(--text); }
.md-view h1 { font-size: 22px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.md-view h2 { font-size: 18.5px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.md-view h3 { font-size: 16px; }
.md-view h4 { font-size: 14.5px; color: var(--muted); }
.md-view p { margin: 0 0 12px; }
.md-view ul, .md-view ol { margin: 0 0 12px; padding-left: 24px; }
.md-view li { margin-bottom: 5px; }
.md-view code { background: var(--panel2); padding: 2px 6px; border-radius: 5px; font-size: 13px; color: var(--violet); }
.md-view pre {
  background: var(--panel2); padding: 14px 16px; border-radius: 10px; overflow-x: auto;
  margin: 0 0 14px; border-left: 3px solid var(--border2);
}
.md-view pre code { background: none; padding: 0; color: var(--text); }
.md-view blockquote {
  margin: 0 0 14px; padding: 11px 16px; border-radius: 10px;
  border-left: 3px solid var(--primary); background: rgba(46, 95, 163, .07); color: var(--muted);
}
.md-view table { width: 100%; border-collapse: collapse; margin: 0 0 16px; font-size: 14px; }
.md-view th, .md-view td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.md-view th { background: var(--panel2); font-weight: 700; }
.md-view a { text-decoration: underline; }
.md-view img { max-width: 100%; height: auto; border-radius: 10px; }

/* ---------- 페이지네이션 ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.pagination button {
  min-width: 36px; height: 36px; padding: 0 11px; border: 1px solid var(--border2);
  border-radius: var(--radius-xs); background: #fff; cursor: pointer;
  font-family: inherit; font-size: 14px; color: var(--text); transition: var(--t-fast); font-weight: 600;
}
.pagination button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--grad); color: #fff; border-color: transparent; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination .info { font-size: 13.5px; color: var(--muted); margin: 0 10px; }

/* ---------- 툴바 (검색/필터) ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.toolbar .search { flex: 1; min-width: 220px; position: relative; }
.toolbar .search .input { padding-left: 40px; }
.toolbar .search .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--faint); pointer-events: none;
}
.toolbar .select { width: auto; min-width: 140px; }

/* ---------- 리스트 아이템 ---------- */
.list-item {
  display: flex; align-items: center; gap: 13px; padding: 14px 17px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff;
  margin-bottom: 10px; transition: var(--t-fast);
}
.list-item:hover { border-color: var(--primary2); box-shadow: 0 8px 20px -16px rgba(46, 95, 163, .5); }
.list-item.selected { border-color: var(--primary); background: rgba(46, 95, 163, .05); }
.list-ic {
  width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--grad);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.list-ic.gold { background: var(--grad2); }
.list-ic .icon, .list-ic > svg { width: 20px; height: 20px; }
.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 700; font-size: 15.5px; }
.list-meta { font-size: 13px; color: var(--faint); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 유틸 ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.flex-1 { flex: 1; min-width: 0; }
.flex-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xsmall { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.scroll-y { overflow-y: auto; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.clickable { cursor: pointer; }
.grad-text {
  background: var(--grad3); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 8s ease infinite;
}

/* ---------- 차트 (순수 CSS 막대) ---------- */
.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-label { width: 140px; flex-shrink: 0; text-align: right; color: var(--muted); font-weight: 600; }
.bar-track { flex: 1; height: 20px; background: #e9eef6; border-radius: 20px; overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 20px; background: var(--grad3); background-size: 200% auto;
  transition: width .6s cubic-bezier(.22, 1, .36, 1); min-width: 3px;
}
.bar-value { width: 60px; flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 700; }

.spark { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.spark-bar {
  flex: 1; background: rgba(46, 95, 163, .28); min-height: 3px; position: relative;
  border-radius: 4px 4px 0 0; transition: background var(--t-fast);
}
.spark-bar:hover { background: var(--primary); }
.spark-bar .spark-tip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t-fast);
  margin-bottom: 5px; z-index: 5;
}
.spark-bar:hover .spark-tip { opacity: 1; }

/* ==========================================================================
   반응형 — 모바일 최적화
   ========================================================================== */
.hamburger { display: none; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-toc { position: static; }
  .editor-toc .card { display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .editor-toc .toc-item { white-space: nowrap; width: auto; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 278px !important; z-index: 120;
    transform: translateX(-100%); transition: transform var(--t);
    box-shadow: 6px 0 30px -8px rgba(15, 25, 55, .4);
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  body.sidebar-collapsed .sidebar .side-brand-wrap { display: block !important; }
  body.sidebar-collapsed .sidebar .nav-section { display: block !important; }
  body.sidebar-collapsed .sidebar .nav-label,
  body.sidebar-collapsed .sidebar .nav-badge { display: block !important; }
  body.sidebar-collapsed .sidebar .nav-item { justify-content: flex-start !important; padding: 11px 13px !important; }
  body.sidebar-collapsed .sidebar .nav-item::after { content: none; }
  body.sidebar-collapsed .sidebar-foot { flex-direction: row !important; padding: 12px !important; }
  body.sidebar-collapsed .sidebar-foot .uname,
  body.sidebar-collapsed .sidebar-foot .version { display: block !important; }
  body.sidebar-collapsed .side-head { justify-content: flex-start !important; padding: 12px 16px !important; }
  .main { width: 100%; }
  .hamburger { display: inline-flex; }
  #collapseBtn { display: none; }
  .page { padding: 18px 16px calc(100px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar h1 { font-size: 16.5px; }
  .hero { padding: 26px 20px; border-radius: 16px; }
  .hero h2 { font-size: 25px; }
  .hero p { font-size: 15px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .page { padding: 14px 12px calc(100px + env(safe-area-inset-bottom)); }
  .card-pad, .card-body { padding: 16px 15px; }
  .card-head, .card-foot { padding: 13px 15px; }
  h1 { font-size: 21px; }
  .journal-grid { grid-template-columns: 1fr; max-height: 420px; }
  .stat-value { font-size: 26px; }
  .modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: none; }
  .modal-backdrop { padding: 0; }
  .modal-head { padding-top: max(18px, env(safe-area-inset-top)); }
  .modal-foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .select { width: 100%; }
  .job-dock { left: 12px; right: 12px; transform: none; max-width: none; }
  .job-pill { min-width: 0; width: 100%; }
  .toast-wrap { left: 12px; right: 12px; max-width: none; }
  .bar-label { width: 90px; font-size: 12.5px; }
  table.data { font-size: 13.5px; }
  table.data th, table.data td { padding: 10px 12px; }
  .stage-row { flex-wrap: wrap; }
  .stage-actions { width: 100%; justify-content: flex-end; }
  .wstep { padding: 10px 12px; font-size: 13px; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 0; min-width: 0; padding: 9px 6px; font-size: 13px; }
  .section-head, .section-foot { padding-left: 15px; padding-right: 15px; }
  .section-body { padding: 16px 15px; }
}

/* 모바일: 표를 카드형으로 쌓기 (컨테이너 폭 기준) */
@container (max-width: 660px) {
  table.data.stackable { min-width: 0; width: 100%; display: block; }
  table.data.stackable thead { display: none; }
  table.data.stackable tbody { display: block; }
  table.data.stackable tr {
    display: block; margin-bottom: 10px; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 12px; background: #fff;
  }
  table.data.stackable tr:hover td { background: transparent; }
  table.data.stackable td {
    display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: flex-start;
    padding: 7px 0; border: none; border-bottom: 1px dashed var(--border);
    text-align: left; white-space: normal;
  }
  table.data.stackable td:last-child { border-bottom: none; }
  table.data.stackable td::before {
    content: attr(data-label); flex: 0 0 34%; max-width: 34%;
    font-size: 11.5px; font-weight: 800; color: var(--faint);
    padding-top: 2px; word-break: keep-all;
  }
  table.data.stackable td:not([data-label])::before { display: none; }
  table.data.stackable td > * { min-width: 0; }
}

/* 터치 타깃 최소 크기 */
@media (pointer: coarse) {
  .icon-btn { width: 42px; height: 42px; }
  .btn, .btn-sm { min-height: 42px; }
  .btn-xs { min-height: 32px; }
  .nav-item { padding: 13px; }
  .checkbox input, .radio input { width: 20px; height: 20px; }
  .ex-btn { min-height: 30px; }
}

/* iOS 입력 확대 방지 */
input, select, textarea { font-size: 16px; }

/* PWA standalone */
@media (display-mode: standalone) {
  .sidebar { padding-top: env(safe-area-inset-top); }
  .topbar { height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
}

/* 인쇄 */
@media print {
  .sidebar, .topbar, .job-dock, .toast-wrap, .page-actions,
  .section-tools, .tabs, .wizard-nav, .drawer-overlay { display: none !important; }
  .app-shell, .main, .content { display: block; height: auto; overflow: visible; }
  .page { padding: 0; max-width: none; }
  .card, .section-editor, .phase-block { border: 0; box-shadow: none; }
  body { font-size: 11pt; background: #fff; }
}

/* 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
