/* ===================================================================
   MASIN · 캐릭터 강화 공유 스타일
   아이템 강화 / 강화 관리 화면의 골드-브라운 테마를 캐릭터 강화로 확장
   =================================================================== */
:root {
  --bg-main: #f4f1e8;
  --bg-panel: #ffffff;
  --bg-soft: #faf6ec;
  --primary: #7a5c1f;
  --primary-dark: #4a3712;
  --accent: #c08a2c;
  --accent-soft: #e8c878;
  --border: #d8cdb2;
  --border-strong: #b4a481;
  --text: #2b261d;
  --text-soft: #574e3f;
  --text-muted: #7a7060;
  --danger: #b13a2a;
  --success: #2f7a3d;
  --info: #2b5fa3;

  --rar-ssr: #b48a00;
  --rar-ssr-bg: linear-gradient(135deg, #f5d96b, #b48a00);
  --rar-ssr-soft: #fbf5e4;
  --rar-ssr-border: #e6d49a;
  --rar-sr: #8b6d31;
  --rar-sr-bg: linear-gradient(135deg, #c2a05a, #8b6d31);
  --rar-sr-soft: #f4ede0;
  --rar-sr-border: #e0d3b1;
  --rar-r: #6a7a4a;
  --rar-r-bg: linear-gradient(135deg, #a4b577, #6a7a4a);
  --rar-r-soft: #eef0e6;
  --rar-r-border: #d6dbc4;
  --rar-n: #8a837a;
  --rar-n-bg: linear-gradient(135deg, #b6ada1, #8a837a);
  --rar-n-soft: #f0ede7;
  --rar-n-border: #d6d1c8;

  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(74, 56, 18, 0.06);
  --shadow-md: 0 6px 16px rgba(74, 56, 18, 0.08);
  --shadow-lg: 0 28px 64px rgba(30, 22, 8, 0.30);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg-main);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ===== Header ===== */
.app-header {
  background: linear-gradient(135deg, #2d2a26, #4a3f2a);
  border-bottom: 1px solid var(--border);
  height: 64px; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.header-inner {
  max-width: 1360px; margin: 0 auto; height: 100%;
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-brand h1 {
  margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em;
  color: white;
}
.header-brand .admin-tag {
  font-size: 10px; font-weight: 900; letter-spacing: 0.12em;
  padding: 3px 9px; border-radius: 5px;
}
.header-brand .admin-tag.game { background: var(--accent); color: #2d2a26; }
.header-brand .admin-tag.admin { background: var(--danger); color: white; }
.header-nav { display: flex; gap: 4px; font-size: 0.875rem; font-weight: 700; }
.header-nav a {
  padding: 8px 16px; border-radius: 8px;
  text-decoration: none; color: rgba(255,255,255,0.7);
  transition: all 0.15s;
}
.header-nav a:hover { color: white; background: rgba(255,255,255,0.08); }
.header-nav a.active { color: white; background: rgba(255,255,255,0.15); }

.breadcrumb {
  max-width: 1360px; margin: 0 auto; padding: 18px 32px 0;
  font-size: 0.85rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-dark); }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb .current { color: var(--text); font-weight: 700; }

.main { max-width: 1240px; margin: 0 auto; padding: 20px 32px 96px; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px; gap: 20px;
}
.page-title {
  font-size: 2.2rem; font-weight: 900; margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.page-sub { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; }

/* ===== Buttons ===== */
.btn {
  border: none; border-radius: 10px;
  padding: 11px 18px; font-size: 0.9rem; font-weight: 800;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all 0.15s; white-space: nowrap;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 8px 12px; font-size: 0.82rem; border-radius: 8px; }

/* ===== Section ===== */
.section {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--bg-soft);
  gap: 12px;
}
.section-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 1.12rem; font-weight: 900; color: var(--text);
  letter-spacing: -0.01em;
  margin: 0;
}
.section-title .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--primary); color: white;
  border-radius: 7px;
  font-size: 0.85rem; font-weight: 900;
  font-family: 'Courier New', monospace;
}
.section-sub { color: var(--text-muted); font-size: 0.86rem; font-weight: 600; }

/* ===== KPI ===== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.kpi .lab {
  font-size: 11px; font-weight: 800; letter-spacing: 0.14em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.kpi .lab i { color: var(--accent); }
.kpi .val {
  font-size: 1.5rem; font-weight: 900; color: var(--text);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi .val .sub { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-left: 4px; }
.kpi.accent .val { color: var(--primary-dark); }
.kpi.gold {
  background: linear-gradient(135deg, #fff7e2, #f8eccb);
  border-color: var(--accent);
}
.kpi.gold .val { color: var(--primary-dark); }

/* ===== Rarity / character chips ===== */
.rar-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9.5px; font-weight: 900;
  letter-spacing: 0.12em;
  color: white;
}
.rar-tag.SSR { background: var(--rar-ssr-bg); color: #3a2906; }
.rar-tag.SR  { background: var(--rar-sr-bg); color: white; }
.rar-tag.R   { background: var(--rar-r-bg); color: white; }
.rar-tag.N   { background: var(--rar-n-bg); color: white; }

/* Character portrait token */
.char-glyph {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 14px;
  font-size: 1.6rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.char-glyph.SSR { background: var(--rar-ssr-soft); border: 1.5px solid var(--rar-ssr-border); }
.char-glyph.SR  { background: var(--rar-sr-soft);  border: 1.5px solid var(--rar-sr-border); }
.char-glyph.R   { background: var(--rar-r-soft);   border: 1.5px solid var(--rar-r-border); }
.char-glyph.N   { background: var(--rar-n-soft);   border: 1.5px solid var(--rar-n-border); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 300;
  background: var(--text); color: white;
  padding: 12px 20px; border-radius: 10px;
  font-size: 0.9rem; font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(8px);
  transition: all 0.2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ===== Modal (shared shell) ===== */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20, 14, 4, 0.55);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s;
}
.modal-back.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  background: var(--bg-main);
  border-radius: 18px;
  width: 100%;
  max-width: 760px;
  max-height: 92vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
  display: flex; flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(.2,.7,.3,1.05);
}
/* Bootstrap 전역 `.modal`(position:fixed; top/left:0)과의 충돌 방지 —
   오버레이(.modal-back) 안의 모달은 flex 중앙정렬을 따르도록 강제 */
.modal-back > .modal {
  position: relative;
  inset: auto;
  height: auto;
  margin: 0;
}
.modal-head {
  background: linear-gradient(135deg, #2d2a26, #4a3f2a);
  color: white;
  padding: 18px 26px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-head h2 {
  margin: 0; font-size: 1.2rem; font-weight: 900;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 12px;
}
.modal-head h2 i { color: var(--accent-soft); }
.modal-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  width: 36px; height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.16); }
.modal-body { overflow-y: auto; padding: 24px 26px; flex: 1; }
.modal-foot {
  padding: 16px 26px;
  border-top: 1px solid var(--border);
  background: white;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-foot .info {
  color: var(--text-muted); font-size: 0.82rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.modal-foot .info i { color: var(--accent); }

/* ===== Form fields ===== */
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.88rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.form-label .help {
  display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  margin-top: 2px;
}
.form-input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 0.95rem;
  background: white; color: var(--text);
  outline: none; transition: all 0.15s;
  font-variant-numeric: tabular-nums;
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 138, 44, 0.12);
}
.input-with-suffix { position: relative; }
.input-with-suffix .form-input { padding-right: 44px; }
.input-with-suffix .suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-size: 0.85rem; font-weight: 800; color: var(--text-muted);
  pointer-events: none;
}

/* Slider */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] {
  flex: 1; height: 8px;
  -webkit-appearance: none; appearance: none;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  cursor: pointer; border: 2px solid white;
  box-shadow: 0 2px 5px rgba(74,56,18,0.2);
}
.slider-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  cursor: pointer; border: 2px solid white;
  box-shadow: 0 2px 5px rgba(74,56,18,0.2);
}
.rate-pill {
  background: linear-gradient(135deg, #fff7e2, #f8eccb);
  border: 1px solid var(--accent);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 900; font-size: 1rem;
  font-variant-numeric: tabular-nums;
  min-width: 64px; text-align: center;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 2.4rem;
  color: var(--border-strong);
  margin-bottom: 16px;
  display: block;
}
.empty-state h3 {
  font-size: 1.1rem; font-weight: 900;
  color: var(--text-soft);
  margin: 0 0 6px;
}
.empty-state p { font-size: 0.9rem; font-weight: 600; margin: 0; }

/* ===== Evolution arrow (source → result) ===== */
.evo-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.evo-arrow .line {
  width: 30px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent), var(--accent) 4px, transparent 4px, transparent 8px);
}

/* ===================================================================
   캐릭터 강화 사용자 페이지 전용 레이아웃 스타일
   (캐릭터 강화.html 템플릿의 <style> 블록 이식)
   =================================================================== */

/* layout */
.layout { display: grid; grid-template-columns: 420px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .layout { grid-template-columns: 1fr; } }

/* code shell */
.code-shell {
  background: linear-gradient(180deg, #2d2a26, #1f1c18);
  border-radius: 12px; border: 1px solid #3a3024;
  padding: 16px; position: relative;
}
.code-shell::before {
  content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: radial-gradient(circle at 10% 0%, rgba(192,138,44,0.10), transparent 50%),
             radial-gradient(circle at 90% 100%, rgba(192,138,44,0.06), transparent 50%);
}
.code-shell-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 900; color: rgba(232, 200, 120, 0.7);
  letter-spacing: 0.22em; margin-bottom: 10px; position: relative;
}
.code-shell-label .live { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,0.4); }
.code-shell-label .live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #6a7a4a; box-shadow: 0 0 6px rgba(106, 122, 74, 0.8);
}
.code-input {
  width: 100%; background: transparent; border: none; color: #f0e8d0;
  font-family: 'Courier New', Courier, monospace; font-size: 1.05rem;
  font-weight: 700; letter-spacing: 0.04em; outline: none;
  padding: 8px 4px; resize: none; line-height: 1.5; position: relative;
}
.code-input::placeholder { color: rgba(232, 200, 120, 0.25); font-weight: 500; }
.code-actions { display: flex; gap: 8px; margin-top: 14px; position: relative; }
.btn-load {
  flex: 1; background: linear-gradient(135deg, var(--accent), #8b6d31);
  color: white; padding: 12px; border: none; border-radius: 10px;
  font-weight: 900; font-size: 0.92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: all 0.15s;
}
.btn-load:hover { filter: brightness(1.08); }
.btn-clear-code {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); padding: 12px 14px; border-radius: 10px;
  font-weight: 800; font-size: 0.85rem; cursor: pointer;
}
.btn-clear-code:hover { background: rgba(255,255,255,0.1); }

/* status pill */
.code-status {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  font-size: 0.86rem; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border);
}
.code-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; }
.code-status.ok { background: rgba(47,122,61,0.08); border-color: rgba(47,122,61,0.25); color: var(--success); }
.code-status.ok .dot { background: var(--success); box-shadow: 0 0 8px rgba(47,122,61,0.4); }
.code-status.err { background: rgba(177,58,42,0.08); border-color: rgba(177,58,42,0.25); color: var(--danger); }
.code-status.err .dot { background: var(--danger); }
.code-status.warn { background: rgba(192,138,44,0.10); border-color: rgba(192,138,44,0.30); color: var(--primary-dark); }
.code-status.warn .dot { background: var(--accent); }

/* player meta */
.player-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.meta-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px; }
.meta-card .lab {
  font-size: 10px; font-weight: 900; color: var(--text-muted);
  letter-spacing: 0.14em; margin-bottom: 4px; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.meta-card .lab i { color: var(--accent); }
.meta-card .val { font-size: 1.15rem; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.meta-card .val .sub { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); margin-left: 2px; }
.meta-card.point .val { color: var(--primary-dark); }

/* right panel */
#enh-section { min-height: 520px; }

/* not-enhanceable card */
.state-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 28px;
  display: flex; align-items: center; gap: 24px; background: white;
}
.state-card.blocked { background: linear-gradient(135deg, #faf3f1, white 60%); border-color: rgba(177,58,42,0.25); }
.state-card .sc-glyph { width: 104px; height: 104px; font-size: 3.1rem; border-radius: 20px; }
.state-card .sc-body { flex: 1; }
.state-card .sc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.state-card .sc-status {
  font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 5px;
}
.state-card .sc-status.no { background: rgba(177,58,42,0.1); color: var(--danger); border: 1px solid rgba(177,58,42,0.25); }
.state-card h3 { margin: 0; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.01em; }
.state-card .sc-desc { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); margin-top: 6px; }
.state-card .sc-note {
  margin-top: 14px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 14px; font-size: 0.84rem; font-weight: 700; color: var(--text-soft);
  display: flex; align-items: center; gap: 8px;
}
.state-card .sc-note i { color: var(--accent); }

/* evolution focus */
.evo-focus {
  background: linear-gradient(135deg, #fffdf6, white 70%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 30px; display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
}
.evo-focus .ef-node { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; max-width: 220px; }
.evo-focus .ef-glyph { width: 110px; height: 110px; font-size: 3.2rem; border-radius: 22px; }
.evo-focus .ef-name { font-size: 1.3rem; font-weight: 900; color: var(--text); text-align: center; }
.evo-focus .ef-sub { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.evo-focus .ef-tag { font-size: 9.5px; font-weight: 900; letter-spacing: 0.16em; color: var(--text-muted); text-transform: uppercase; }
.evo-focus .ef-mid {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 8px;
  color: var(--accent);
}
.evo-focus .ef-mid i { font-size: 1.8rem; }
.evo-focus .ef-mid .ml { font-size: 9px; font-weight: 900; letter-spacing: 0.14em; }

/* cost + rate */
.enh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.enh-card { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.enh-card .ec-lab {
  font-size: 10px; font-weight: 900; color: var(--text-muted); letter-spacing: 0.14em;
  text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.enh-card .ec-lab i { color: var(--accent); }
.enh-card .ec-cost { display: flex; align-items: baseline; gap: 8px; }
.enh-card .ec-cost .num { font-size: 1.8rem; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.enh-card .ec-cost .u { font-size: 0.85rem; font-weight: 800; color: var(--text-muted); }
.enh-card .ec-cost .owned { margin-left: auto; font-size: 0.78rem; font-weight: 700; color: var(--text-muted); align-self: flex-end; }
.enh-card .ec-cost .owned.short { color: var(--danger); }
.rate-meter { display: flex; align-items: center; gap: 14px; }
.rate-meter .rval { font-size: 1.8rem; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.rate-meter .rval.low { color: var(--danger); }
.rate-meter .bar-wrap { flex: 1; height: 10px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.rate-meter .bar { height: 100%; background: linear-gradient(90deg, var(--success), #58a96b); transition: width 0.4s; }
.rate-meter .bar.low { background: linear-gradient(90deg, #d8a02c, #b13a2a); }

/* CTA */
.enhance-cta { margin-top: 16px; }
.btn-do-enhance {
  width: 100%; background: linear-gradient(135deg, #f5d96b, #b48a00);
  color: #2d2a26; border: 1px solid #b48a00; padding: 17px;
  border-radius: 13px; font-size: 1.05rem; font-weight: 900; letter-spacing: -0.01em;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.15s; box-shadow: 0 6px 16px rgba(180, 138, 0, 0.30); position: relative;
}
.btn-do-enhance:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.04); }
.btn-do-enhance:hover:not(:disabled) i { transform: rotate(-12deg) scale(1.1); }
.btn-do-enhance i { transition: transform 0.3s; }
.btn-do-enhance:disabled {
  background: var(--bg-soft); color: var(--text-muted); box-shadow: none;
  cursor: not-allowed; border: 1px solid var(--border);
}

/* result savecode panel */
.result-panel {
  margin-top: 16px; background: linear-gradient(180deg, #2d2a26, #1f1c18);
  border: 1px solid #3a3024; border-radius: 14px; padding: 20px 22px; position: relative; overflow: hidden;
  display: none;
}
.result-panel.show { display: block; animation: slideUp 0.3s; }
.result-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 15% 0%, rgba(245,217,107,0.12), transparent 55%);
}
.result-panel .rp-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; position: relative;
}
.result-panel .rp-badge {
  font-size: 10px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  color: #f5d96b; background: rgba(245,217,107,0.12); border: 1px solid rgba(245,217,107,0.25);
  padding: 4px 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 7px;
}
.result-panel .rp-char { font-size: 0.82rem; color: rgba(255,255,255,0.55); font-weight: 700; }
.result-panel .rp-char strong { color: #f0e8d0; }
.result-panel .rp-code {
  font-family: 'Courier New', monospace; font-size: 1.5rem; font-weight: 800;
  color: #f5d96b; letter-spacing: 0.05em; text-align: center; padding: 12px 8px;
  user-select: all; position: relative; word-break: break-all;
}
.result-panel .rp-actions { display: flex; gap: 8px; margin-top: 8px; position: relative; }
.result-panel .rp-actions .btn-copy {
  flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9); padding: 11px; border-radius: 9px; font-weight: 800; font-size: 0.85rem;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.15s;
}
.result-panel .rp-actions .btn-copy:hover { background: rgba(255,255,255,0.12); }
.result-panel .rp-actions .btn-apply {
  background: linear-gradient(135deg, var(--accent), #8b6d31); border: none; color: white;
  padding: 11px 16px; border-radius: 9px; font-weight: 800; font-size: 0.85rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.result-panel .rp-actions .btn-apply:hover { filter: brightness(1.08); }

/* attempt log */
.attempt-log {
  margin-top: 16px; background: white; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; max-height: 168px; overflow-y: auto;
}
.attempt-log .log-head {
  font-size: 10px; font-weight: 900; color: var(--text-muted); letter-spacing: 0.16em;
  text-transform: uppercase; margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.log-line {
  font-size: 0.84rem; padding: 6px 0; border-bottom: 1px dashed var(--bg-soft);
  display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text-soft);
}
.log-line:last-child { border-bottom: none; }
.log-line .ic { width: 20px; text-align: center; }
.log-line.success { color: var(--success); }
.log-line.fail { color: var(--danger); }
.log-line .cost { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text-muted); }
.log-empty { text-align: center; padding: 14px; color: var(--text-muted); font-size: 0.82rem; font-weight: 600; }

/* fx overlay */
.fx-overlay { position: absolute; inset: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; z-index: 10; opacity: 0; }
.fx-overlay.on { opacity: 1; transition: opacity 0.2s; }
.fx-burst {
  position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,217,107,0.7), rgba(245,217,107,0) 70%); opacity: 0;
}
.fx-burst.go { animation: burst 0.6s ease-out forwards; }
@keyframes burst { 0% { transform: scale(0.3); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
.fx-result {
  background: rgba(45,42,38,0.92); color: white; padding: 12px 28px; border-radius: 12px;
  font-weight: 900; font-size: 1.3rem; letter-spacing: 0.06em;
  border: 1px solid rgba(232,200,120,0.3); opacity: 0;
}
.fx-result.go { animation: resultPop 1.2s ease-out forwards; }
.fx-result.success { background: linear-gradient(135deg, #f5d96b, #b48a00); color: #2d2a26; }
.fx-result.fail { background: var(--danger); color: white; }
@keyframes resultPop {
  0% { transform: scale(0.6); opacity: 0; }
  20% { transform: scale(1.15); opacity: 1; }
  55% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ===================================================================
   캐릭터 강화/관리 템플릿 추가 스타일 (카드 그리드 · 걸리버 기운 · 모달 · 관리자 피커)
   =================================================================== */

/* ===== summary chips (user) ===== */
.sum-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sum-chip {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px;
}
.sum-chip .si {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1rem;
  background: var(--bg-soft); color: var(--accent); border: 1px solid var(--border);
}
.sum-chip .st-lab { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }
.sum-chip .st-val { font-size: 1.3rem; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.sum-chip .st-val .u { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); margin-left: 2px; }

/* ===== character grid (user) ===== */
.char-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 860px) { .char-grid { grid-template-columns: 1fr; } }

.echar-card {
  background: var(--bg-panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 20px; cursor: pointer; transition: all 0.16s; position: relative;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 14px;
}
.echar-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.echar-card.completed { background: linear-gradient(135deg, #f4faf2, white 60%); border-color: rgba(47,122,61,0.35); }

.ecc-top { display: flex; align-items: center; gap: 14px; }
.ecc-flow { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.ecc-node { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ecc-node .char-glyph { width: 52px; height: 52px; font-size: 1.5rem; }
.ecc-node.res .char-glyph { width: 40px; height: 40px; font-size: 1.15rem; }
.ecc-info { min-width: 0; }
.ecc-tag { font-size: 8.5px; font-weight: 900; letter-spacing: 0.14em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px; }
.ecc-name { font-weight: 900; font-size: 1.02rem; color: var(--text); line-height: 1.18; display: flex; align-items: center; gap: 6px; }
.ecc-name.res-name { font-size: 0.84rem; color: var(--text-soft); }
.ecc-meta { font-size: 0.74rem; font-weight: 700; color: var(--text-muted); margin-top: 2px; }
.ecc-arrow { color: var(--accent); font-size: 1rem; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ecc-arrow .glabel { font-size: 8px; font-weight: 900; letter-spacing: 0.08em; }

.status-badge {
  position: absolute; top: 14px; right: 16px;
  font-size: 10px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 5px;
}
.status-badge.none { background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border); }
.status-badge.prog { background: rgba(192,138,44,0.12); color: var(--primary-dark); border: 1px solid rgba(192,138,44,0.3); }
.status-badge.done { background: rgba(47,122,61,0.1); color: var(--success); border: 1px solid rgba(47,122,61,0.28); }

/* card footer area */
.ecc-foot { border-top: 1px dashed var(--border); padding-top: 12px; }
.ecc-unreg {
  display: flex; align-items: center; gap: 8px; color: var(--text-muted);
  font-size: 0.84rem; font-weight: 700;
}
.ecc-unreg i { color: var(--accent); }
.ecc-foot .reg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.ecc-foot .pts { font-size: 0.84rem; font-weight: 800; color: var(--text-soft); white-space: nowrap; }
.ecc-foot .pts .u { color: var(--text-muted); font-weight: 700; font-size: 0.76rem; }
.ecc-foot .cnt { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }

/* spirit gauge (걸리버 기운) */
.spirit {
  --h: 10px;
}
.spirit .sp-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.74rem; font-weight: 800; color: var(--text-muted); margin-bottom: 6px;
}
.spirit .sp-head .lab { display: inline-flex; align-items: center; gap: 5px; letter-spacing: 0.04em; }
.spirit .sp-head .lab i { color: #d8842c; }
.spirit .sp-head .pct { font-variant-numeric: tabular-nums; color: var(--text-soft); font-weight: 900; }
.spirit .sp-bar {
  height: var(--h); background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden; position: relative;
}
.spirit .sp-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #e6a13a, #f5d96b);
  transition: width 0.5s cubic-bezier(.2,.8,.3,1);
}
.spirit.full .sp-fill {
  background: linear-gradient(90deg, #f5d96b, #ffae3a, #f5d96b);
  background-size: 200% 100%; animation: spiritGlow 1.6s linear infinite;
  box-shadow: 0 0 12px rgba(245,180,58,0.7);
}
@keyframes spiritGlow { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
.spirit.full .sp-head .pct { color: #b4660e; }

/* ===== Enhance modal (강화창) ===== */
.modal-enh { max-width: 720px; }
.modal-enh .modal-body { padding: 0; }
.enh-stage { padding: 22px 26px 6px; }

/* enhance modal evolution focus overrides */
.modal-enh .evo-focus { padding: 24px 26px; }
.modal-enh .evo-focus .ef-node { gap: 9px; max-width: 200px; }
.modal-enh .evo-focus .ef-glyph { width: 96px; height: 96px; font-size: 2.8rem; border-radius: 20px; }
.modal-enh .evo-focus .ef-name { font-size: 1.18rem; display: flex; align-items: center; gap: 7px; }
.modal-enh .evo-focus .ef-sub { font-size: 0.78rem; }
.modal-enh .evo-focus .ef-tag { font-size: 9px; }
.modal-enh .evo-focus .ef-mid { gap: 6px; padding: 0 6px; }
.modal-enh .evo-focus .ef-mid i { font-size: 1.6rem; }
.modal-enh .evo-focus .ef-mid .ml { font-size: 8.5px; }

/* big spirit panel (강화창 내부) */
.spirit-panel {
  margin-top: 16px; background: linear-gradient(180deg, #2d2a26, #221f1a);
  border: 1px solid #3a3024; border-radius: 14px; padding: 18px 20px; position: relative; overflow: hidden;
}
.spirit-panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 15% 0%, rgba(245,180,58,0.12), transparent 55%);
}
.spirit-panel .sph-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; position: relative; }
.spirit-panel .sph-title { display: flex; align-items: center; gap: 9px; color: #f0e8d0; font-weight: 900; font-size: 0.96rem; }
.spirit-panel .sph-title i { color: #f5b43a; }
.spirit-panel .sph-val { font-size: 1.5rem; font-weight: 900; color: #f5d96b; font-variant-numeric: tabular-nums; }
.spirit-panel .sp-bar { height: 16px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; position: relative; }
.spirit-panel .sp-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #e6a13a, #f5d96b);
  transition: width 0.5s cubic-bezier(.2,.8,.3,1);
}
.spirit-panel.full .sp-fill {
  background: linear-gradient(90deg, #f5d96b, #ffae3a, #f5d96b);
  background-size: 200% 100%; animation: spiritGlow 1.4s linear infinite;
  box-shadow: 0 0 14px rgba(245,180,58,0.8);
}
.spirit-panel .sph-note {
  margin-top: 10px; font-size: 0.78rem; font-weight: 700; color: rgba(255,255,255,0.55);
  display: flex; align-items: center; gap: 7px; position: relative;
}
.spirit-panel .sph-note i { color: #f5b43a; }
.spirit-panel.full .sph-note { color: #f5d96b; }

/* enhance modal card / rate / cta variants */
.enh-card.guaranteed { background: linear-gradient(135deg, #fff7e2, #f8eccb); border-color: var(--accent); }
.rate-meter .rval.guar { color: var(--primary-dark); font-size: 1.2rem; }
.rate-meter .bar.guar { background: linear-gradient(90deg, #f5d96b, #b48a00); }
.btn-do-enhance.done-btn { background: rgba(47,122,61,0.12); color: var(--success); border-color: rgba(47,122,61,0.3); cursor: default; }

/* attempt log scroll + guaranteed badge (modal) */
.modal-enh .attempt-log { margin: 16px 26px 4px; max-height: none; }
.log-scroll { max-height: 150px; overflow-y: auto; }
.log-line .badge-guar { font-size: 9px; font-weight: 900; letter-spacing: 0.08em; color: #b4660e; background: #fbf1d8; border: 1px solid var(--accent-soft); padding: 1px 6px; border-radius: 5px; }

/* modal foot for enhance */
.modal-enh .modal-foot { gap: 8px; }
.modal-enh .modal-foot .left { display: flex; gap: 8px; }

/* ===== savecode modal (user) ===== */
.modal-code { max-width: 520px; }
.code-hint { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-hint .ch-lab { font-size: 0.76rem; font-weight: 800; color: var(--text-muted); }
.code-chip { background: var(--bg-soft); border: 1px solid var(--border); padding: 7px 11px; border-radius: 8px; font-family: 'Courier New', monospace; font-size: 0.8rem; font-weight: 700; color: var(--text-soft); cursor: pointer; transition: all 0.12s; }
.code-chip:hover { border-color: var(--accent); color: var(--primary-dark); }
.code-target { display: flex; align-items: center; gap: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.code-target .char-glyph { width: 46px; height: 46px; font-size: 1.3rem; }
.code-target .ct-info .ct-tag { font-size: 9px; font-weight: 900; letter-spacing: 0.14em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.code-target .ct-info .ct-name { font-weight: 900; font-size: 1.05rem; color: var(--text); display: flex; align-items: center; gap: 7px; }
.code-msg { margin-top: 14px; font-size: 0.84rem; font-weight: 800; display: none; align-items: center; gap: 8px; }
.code-msg.err { display: flex; color: var(--danger); }
.code-msg.ok { display: flex; color: var(--success); }

/* ===================================================================
   캐릭터 강화 관리(어드민) 전용 스타일
   =================================================================== */

/* ===== toolbar ===== */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar .lead { display: flex; gap: 10px; align-items: baseline; }
.toolbar .lead strong { font-size: 0.98rem; }

/* ===== Enhance entry card ===== */
.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 18px; align-items: center;
  transition: all 0.15s;
}
.entry-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.entry-index {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem; font-weight: 900;
  color: var(--text-muted);
  text-align: center;
}
/* source → result flow */
.evo-flow { display: flex; align-items: center; gap: 16px; min-width: 0; }
.evo-node { display: flex; align-items: center; gap: 12px; min-width: 0; }
.evo-node .char-glyph { width: 52px; height: 52px; font-size: 1.5rem; }
.evo-node .nd-info { min-width: 0; }
.evo-node .nd-name {
  font-weight: 900; font-size: 1rem; color: var(--text);
  line-height: 1.2; display: flex; align-items: center; gap: 7px;
}
.evo-node .nd-meta {
  font-size: 0.76rem; font-weight: 700; color: var(--text-muted);
  margin-top: 3px;
}
.evo-node .nd-tag {
  font-size: 9px; font-weight: 900; letter-spacing: 0.14em;
  color: var(--text-muted); text-transform: uppercase;
  margin-bottom: 4px;
}
.evo-flow .evo-arrow { flex-direction: column; gap: 3px; }
.evo-flow .evo-arrow i { font-size: 1.1rem; }
.evo-flow .evo-arrow .glabel {
  font-size: 8.5px; font-weight: 900; letter-spacing: 0.1em;
  color: var(--accent);
}
/* stats block */
.entry-stats { display: flex; gap: 26px; align-items: center; }
.entry-stats .st { text-align: right; }
.entry-stats .st .l {
  font-size: 10px; font-weight: 900; letter-spacing: 0.1em;
  color: var(--text-muted); text-transform: uppercase; margin-bottom: 3px;
  display: flex; align-items: center; gap: 5px; justify-content: flex-end;
}
.entry-stats .st .l i { color: var(--accent); }
.entry-stats .st .v {
  font-size: 1.15rem; font-weight: 900; color: var(--primary-dark);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.entry-stats .st .v .u { font-size: 0.74rem; color: var(--text-muted); margin-left: 2px; }
.entry-stats .st .v.rate-high { color: var(--success); }
.entry-stats .st .v.rate-low { color: var(--danger); }
.entry-actions { display: flex; gap: 6px; }
.entry-actions .btn-sm {
  background: white; color: var(--text-soft); border: 1px solid var(--border);
  width: 36px; height: 36px; padding: 0; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.12s;
}
.entry-actions .btn-sm.edit:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--bg-soft); }
.entry-actions .btn-sm.del:hover { border-color: var(--danger); color: var(--danger); background: rgba(177,58,42,0.05); }

/* ===== Modal: character pickers ===== */
.modal-wide { max-width: 820px; }
.preview-bar {
  background: linear-gradient(135deg, #2d2a26, #4a3f2a);
  border-radius: 12px;
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: center; gap: 22px;
  margin-bottom: 22px;
  position: relative; overflow: hidden;
}
.preview-bar::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(192,138,44,0.14), transparent 55%),
              radial-gradient(circle at 80% 100%, rgba(192,138,44,0.10), transparent 55%);
  pointer-events: none;
}
.preview-node { display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.preview-node .char-glyph { width: 64px; height: 64px; font-size: 1.9rem; }
.preview-node .pv-name { font-weight: 900; font-size: 0.95rem; color: white; }
.preview-node .pv-empty { color: rgba(255,255,255,0.35); }
.preview-node .pv-tag {
  font-size: 9px; font-weight: 900; letter-spacing: 0.16em;
  color: var(--accent-soft); text-transform: uppercase;
}
.preview-arrow { color: var(--accent-soft); font-size: 1.4rem; position: relative; }

.picker-block { margin-bottom: 0; }
.picker-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.9rem; font-weight: 900; color: var(--text);
  margin-bottom: 10px;
}
.picker-head .dot {
  width: 18px; height: 18px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.68rem; color: white; font-weight: 900;
}
.picker-head .dot.s { background: var(--text-soft); }
.picker-head .dot.r { background: var(--accent); }

/* generic glyph swatch (reused in trigger + option rows) */
.pc-glyph {
  width: 34px; height: 34px; border-radius: 8px; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pc-glyph.SSR { background: var(--rar-ssr-soft); border: 1px solid var(--rar-ssr-border); }
.pc-glyph.SR  { background: var(--rar-sr-soft);  border: 1px solid var(--rar-sr-border); }
.pc-glyph.R   { background: var(--rar-r-soft);   border: 1px solid var(--rar-r-border); }
.pc-glyph.N   { background: var(--rar-n-soft);   border: 1px solid var(--rar-n-border); }
.pc-info { min-width: 0; }
.pc-name { font-weight: 900; font-size: 0.86rem; color: var(--text); line-height: 1.15; }
.pc-rar { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Searchable character select ===== */
.select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 720px) { .select-grid { grid-template-columns: 1fr; } }
.char-select { position: relative; }
.cs-trigger {
  width: 100%; min-height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: white; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 9px 14px; cursor: pointer; transition: all 0.12s; text-align: left;
}
.cs-trigger:hover { border-color: var(--accent); }
.cs-trigger.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(192,138,44,0.12); }
.cs-trigger > .chev { color: var(--text-muted); transition: transform 0.18s; flex-shrink: 0; font-size: 0.85rem; }
.cs-trigger.active > .chev { transform: rotate(180deg); }
.cs-placeholder { color: var(--text-muted); font-weight: 700; font-size: 0.85rem; }
.cs-cur { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-cur-name { font-weight: 900; font-size: 0.92rem; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; }
.cs-cur-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cs-dropdown {
  position: fixed; z-index: 9999;
  background: white; border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 10px; display: none;
}
.cs-dropdown.open { display: block; animation: fadeIn 0.12s; }
.cs-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 8px;
}
.cs-search i { color: var(--text-muted); font-size: 0.85rem; }
.cs-search input { border: none; background: transparent; outline: none; flex: 1; font-size: 0.88rem; font-weight: 700; color: var(--text); }
.cs-filters { display: flex; gap: 5px; margin-bottom: 8px; }
.cs-filter {
  flex: 1; padding: 5px 0; border: 1px solid var(--border); background: white;
  border-radius: 6px; font-size: 0.72rem; font-weight: 800; color: var(--text-soft);
  cursor: pointer; transition: all 0.12s;
}
.cs-filter:hover { border-color: var(--accent); }
.cs-filter.active { background: var(--text); color: white; border-color: var(--text); }
.cs-list { max-height: 244px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.cs-opt {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 8px; background: white;
  cursor: pointer; text-align: left; transition: all 0.1s; width: 100%;
}
.cs-opt:hover { background: var(--bg-soft); }
.cs-opt.selected { background: linear-gradient(135deg, #fff7e2, #f8eccb); border-color: var(--accent); }
.cs-opt.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.cs-opt .pc-name { line-height: 1.2; }
.cs-opt .cs-chk { margin-left: auto; color: var(--accent); flex-shrink: 0; }
.cs-opt .cs-dis-tag { margin-left: auto; font-size: 0.66rem; font-weight: 800; color: var(--text-muted); flex-shrink: 0; }
.cs-empty { text-align: center; padding: 26px 12px; color: var(--text-muted); font-size: 0.84rem; font-weight: 700; }
.cs-count { text-align: right; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); padding: 6px 4px 2px; }

/* ===== config grid ===== */
.config-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 6px; }
@media (max-width: 720px) { .config-grid { grid-template-columns: 1fr; } }
.config-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}
.config-card .cc-lab {
  font-size: 0.82rem; font-weight: 900; color: var(--text);
  display: flex; align-items: center; gap: 7px; margin-bottom: 4px;
}
.config-card .cc-lab i { color: var(--accent); }
.config-card .cc-help { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); margin-bottom: 12px; }

.warn-row {
  background: rgba(177,58,42,0.06); border: 1px solid rgba(177,58,42,0.25);
  color: var(--danger); border-radius: 9px; padding: 9px 13px;
  font-size: 0.8rem; font-weight: 800; margin-top: 14px;
  display: none; align-items: center; gap: 8px;
}
.warn-row.show { display: flex; }

/* editable value pill (slider + direct input) */
.rate-pill.editable {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 4px 10px 4px 8px; min-width: 0;
}
.rate-pill.editable .pill-input {
  width: 42px; border: none; outline: none; background: transparent;
  color: var(--primary-dark); font-weight: 900; font-size: 1rem;
  font-variant-numeric: tabular-nums; text-align: right;
  -moz-appearance: textfield; padding: 0;
}
.rate-pill.editable .pill-input::-webkit-outer-spin-button,
.rate-pill.editable .pill-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rate-pill.editable .pill-suffix { font-weight: 900; font-size: 1rem; color: var(--primary-dark); }
.rate-pill.editable:focus-within { box-shadow: 0 0 0 3px rgba(192,138,44,0.18); }
