:root {
  --navy-950: #0b1120;
  --navy-900: #0f172a;
  --indigo-900: #1e1b4b;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-50: #eff6ff;
  --emerald-600: #059669;
  --emerald-50: #ecfdf5;
  --amber-600: #d97706;
  --red-600: #dc2626;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-500: #64748b;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--slate-50);
  color: var(--slate-900);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 18px 54px;
  flex: 1 0 auto;
}

/* Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
}

.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: block;
}
.brand-lockup-pic {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.brand-lockup-horiz {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}
.qstudio-gnb-meta {
  border-left: 1.5px solid var(--slate-200);
  padding-left: 11px;
  margin-left: 2px;
}
.qstudio-gnb-meta .brand-title.sr-only-desktop {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.qstudio-gnb-meta .brand-sub {
  font-size: 0.79rem;
  font-weight: 700;
  color: #0b172f;
  letter-spacing: -0.01em;
}
@media (max-width: 640px) {
  .brand-lockup-horiz {
    height: 34px;
  }
  .qstudio-gnb-meta {
    display: none;
  }
}
.auth-brand-lockup {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--slate-200);
}
.auth-brand-lockup img {
  height: 38px;
  width: auto;
  display: block;
}
.footer-brand-headline {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0b172f;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.footer-copyright {
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--slate-500);
}
body.theme-qstudio {
  --navy-950: #0b172f;
  --navy-900: #0b172f;
  --indigo-900: #112a52;
  --blue-700: #077fa3;
  --blue-600: #09a2cc;
  --blue-50: #f0f9ff;
}
body.theme-qstudio .pill-credit {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0b172f;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 1.75rem;
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--navy-900);
  letter-spacing: -0.02em;
}

.brand-sub {
  display: block;
  font-size: 0.74rem;
  color: var(--slate-500);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-700);
  white-space: nowrap;
  transition: all 0.16s ease;
}

.pill-btn:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
}

.pill-byok.active {
  background: var(--emerald-50);
  border-color: #34d399;
  color: #065f46;
}

.pill-credit {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.dot-muted { background: #94a3b8; }
.dot-active { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); }

.btn-primary-sm {
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary-sm:hover { background: var(--blue-700); }

.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--slate-100);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--slate-500);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
}

/* Hero Card */
.hero-card {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--indigo-900) 52%, var(--blue-700) 100%);
  color: #fff;
  border-radius: 20px;
  padding: 26px 28px;
  margin-bottom: 22px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.admin-link-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
  font-size: 0.76rem;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.hero-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-desc {
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 0.94rem;
}

.access-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.access-guide-item {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 13px 15px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.access-guide-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ag-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.ag-emerald { background: #10b981; color: #052e16; }
.ag-indigo { background: #93c5fd; color: #1e3a8a; }

.ag-text {
  font-size: 0.85rem;
  color: #f1f5f9;
}

/* Builder Card */
.studio-builder-card,
.result-header-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.section-header p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--slate-500);
}

.cost-preview-badge {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 800;
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid #bfdbfe;
}

.field-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--slate-700);
  margin-bottom: 8px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

@media (max-width: 1120px) {
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .preset-grid {
    grid-template-columns: 1fr;
  }
}

.grade-control-card {
  grid-column: 1 / -1;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.grade-bar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.grade-seg-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 9px;
  min-width: 240px;
  flex: 0 0 270px;
}

.grade-seg-btn {
  border: none;
  border-radius: 7px;
  padding: 6px 0;
  font-size: 0.86rem;
  font-weight: 700;
  color: #334155;
  background: transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.grade-seg-btn:hover {
  color: #0f172a;
}

.grade-seg-btn.active {
  background: var(--blue-600);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.35);
}

.grade-guide-text {
  flex: 1 1 280px;
  text-align: right;
  font-size: 0.81rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
  word-break: keep-all;
}

@media (max-width: 900px) {
  .grade-control-card {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 8px;
  }
  .grade-bar-left {
    justify-content: space-between;
  }
  .grade-seg-switch {
    width: 100%;
    min-width: 0;
    flex: none;
  }
  .grade-guide-text {
    flex: none;
    text-align: left;
    font-size: 0.77rem;
  }
}

.subj-conditions-box {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0 8px;
  background: #ffffff;
  font-size: 0.88rem;
  line-height: 1.55;
}

.subj-wordbank-box {
  border: 1px solid #94a3b8;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 10px;
  background: #F8FAFC;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
}

.subj-contrast-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.88rem;
}

.subj-contrast-table th,
.subj-contrast-table td {
  border: 1px solid #cbd5e1;
  padding: 7px 10px;
}

.subj-contrast-table th {
  background: #e8eef7;
  font-weight: 700;
  text-align: center;
}

.preset-card {
  border: 1.5px solid var(--slate-200);
  border-radius: 12px;
  padding: 13px 15px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.preset-card:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.preset-card.selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14);
}

.preset-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.preset-title {
  font-weight: 800;
  font-size: 0.93rem;
  color: var(--navy-900);
}

.preset-pill {
  font-size: 0.7rem;
  font-weight: 700;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.preset-sub {
  font-size: 0.79rem;
  color: var(--slate-500);
}

/* Custom Item Chips */
.custom-items-panel {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.custom-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.quick-chip-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.item-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--slate-300);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.item-chip.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

/* Builder Row */
.builder-row {
  display: grid;
  grid-template-columns: 0.92fr 1.25fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 960px) {
  .builder-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 12px;
}

.text-input,
.textarea-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.oa-trust-badge-card {
  margin-top: 14px;
  margin-bottom: 10px;
  padding: 11px 14px;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
  cursor: default;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.oa-trust-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.42;
}

.oa-trust-desc {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.42;
}

.oa-trust-badge-card.is-disabled-rule {
  opacity: 0.56;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: var(--slate-50);
  margin-bottom: 9px;
  cursor: pointer;
}

.toggle-card input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--blue-600);
  flex-shrink: 0;
}

.toggle-title {
  font-size: 0.87rem;
  font-weight: 700;
}

.toggle-desc {
  font-size: 0.77rem;
  color: var(--slate-500);
}

.tier-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1.5px solid var(--slate-200);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tier-radio-card:hover {
  border-color: #93c5fd;
}

.tier-radio-card.selected[data-tier="standard"] {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.tier-radio-card.selected[data-tier="pro"] {
  border-color: #d97706;
  background: #fffbeb;
}

.tier-radio-card.selected[data-tier="ultra"] {
  border-color: #6366f1;
  background: #eef2ff;
}

.tier-radio-card.selected[data-tier="rule"] {
  border-color: var(--slate-500);
  background: var(--slate-100);
}

.tier-radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--blue-600);
  flex-shrink: 0;
}

.tier-card-content {
  flex: 1;
  min-width: 0;
}

.tier-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.tier-title {
  font-size: 0.87rem;
  font-weight: 800;
  color: var(--navy-900);
}

.tier-cost-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-std { background: #dbeafe; color: #1e40af; }
.pill-pro { background: #fef3c7; color: #b45309; border: 1px solid #fcd34d; }
.pill-ultra { background: #e0e7ff; color: #4338ca; border: 1px solid #a5b4fc; }
.pill-free { background: #e2e8f0; color: #334155; }

/* 공통 최적 활용 컬러 바 */
.tier-usecase-bar {
  display: block;
  width: 100%;
  margin: 6px 0 6px 0;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  box-sizing: border-box;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.tier-usecase-bar .usecase-label {
  font-weight: 700;
  margin-right: 4px;
}

/* 등급별 톤온톤 테마 (기존 우측 상단 배지 색상과 1:1 호응) */
.tier-usecase-1c {
  background-color: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #DBEAFE;
}

.tier-usecase-2c {
  background-color: #FFFBEB;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.tier-usecase-3c {
  background-color: #F5F3FF;
  color: #5B21B6;
  border: 1px solid #EDE9FE;
}

.tier-usecase-0c {
  background-color: #F8FAFC;
  color: #334155;
  border: 1px solid #E2E8F0;
}

/* 모바일 뷰포트 대응 (학부모 스마트폰 접속 시 가로 넘침 방지 및 깔끔한 줄바꿈) */
@media (max-width: 768px) {
  .tier-usecase-bar {
    font-size: 12px;
    padding: 6px 9px;
    white-space: normal;
    word-break: keep-all;
  }
}

.tier-desc {
  font-size: 0.76rem;
  color: var(--slate-500);
  line-height: 1.4;
}

.tier-subnote {
  margin-top: 4px;
  font-size: 0.72rem;
  color: #4f46e5;
  font-weight: 600;
  line-height: 1.38;
}

.ultra-warning-box {
  margin-top: 9px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1.48;
}

.ultra-warning-box.is-master-ultra {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
}

.cta-generate-btn {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
  color: #fff;
  font-size: 1.03rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.25);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.cta-generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.cta-generate-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Progress Panel */
.progress-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 9px;
}

.progress-timer {
  color: var(--blue-700);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 11px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width 0.35s ease;
}

.stage-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .stage-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.st-step {
  font-size: 0.77rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--slate-200);
  color: var(--slate-500);
  text-align: center;
}

.st-step.active {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-700);
}

.st-step.done {
  border-color: #6ee7b7;
  background: var(--emerald-50);
  color: #065f46;
}

/* Result Workspace */
.result-eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--blue-600);
  margin-bottom: 4px;
}

.result-header-card h2 {
  margin: 0;
  font-size: 1.35rem;
}

.result-title-main {
  width: 100%;
}

.result-heading-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.title-quick-dl-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.btn-title-dl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid var(--slate-300);
  background: #f8fafc;
  color: var(--slate-900);
  font-size: 0.81rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-title-dl:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-700);
}

.btn-title-dl-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff !important;
}

.btn-title-dl-primary:hover {
  background: var(--blue-700);
}

.btn-title-dl-zip {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff !important;
}

.btn-title-dl-zip:hover {
  background: #1e293b;
}

.res-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}

@media (min-width: 1240px) {
  .download-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .download-grid {
    grid-template-columns: 1fr;
  }
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-900);
  font-size: clamp(0.78rem, 0.84vw, 0.85rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
}

.dl-btn:hover {
  border-color: var(--blue-600);
  color: var(--blue-700);
  background: var(--blue-50);
}

.dl-primary {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff !important;
}

.dl-primary:hover {
  background: var(--blue-700);
}

/* Mini Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 780px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.chart-box {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--slate-50);
}

.chart-title {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--slate-700);
}

.bar-chart-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: end;
  height: 112px;
  padding-top: 16px;
}

.ans-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.ans-bar {
  width: 34px;
  background: var(--blue-600);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
}

.ans-val {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.ans-lbl {
  font-size: 0.78rem;
  color: var(--slate-700);
  margin-top: 5px;
  font-weight: 700;
}

.domain-row {
  margin-bottom: 8px;
}

.domain-row-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.domain-track {
  height: 8px;
  background: var(--slate-200);
  border-radius: 999px;
  overflow: hidden;
}

.domain-fill {
  height: 100%;
  background: #4f46e5;
  border-radius: 999px;
}

/* Workspace Tabs */
.workspace-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--slate-200);
  margin-bottom: 16px;
}

.ws-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--slate-500);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.ws-tab.active {
  color: var(--blue-700);
  border-bottom-color: var(--blue-700);
  background: var(--blue-50);
  border-radius: 10px 10px 0 0;
}

/* PDF Preview */
.pdf-toolbar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.seg-group {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 3px;
  flex-wrap: wrap;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate-700);
  cursor: pointer;
}

.seg-btn.active {
  background: var(--blue-600);
  color: #fff;
}

.pdf-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 700;
}

.pdf-viewport {
  background: #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  max-height: 820px;
  overflow-y: auto;
}

.pdf-spread-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

@media (max-width: 900px) {
  .pdf-spread-row {
    grid-template-columns: 1fr;
  }
}

.pdf-page-frame {
  background: #fff;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  text-align: center;
}

.pdf-page-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.pdf-page-cap {
  font-size: 0.76rem;
  color: var(--slate-500);
  padding-top: 4px;
  font-weight: 600;
}

/* Interactive CSAT Paper Cards */
.omr-sticky-bar {
  position: sticky;
  top: 64px;
  z-index: 25;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.omr-actions {
  display: flex;
  gap: 6px;
}

.csat-paper-card {
  background: #fffefb;
  border: 1px solid #d6d3d1;
  border-left: 5px solid #1e3a8a;
  border-radius: 13px;
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  margin-right: 6px;
  margin-bottom: 4px;
}
.badge-navy { background: #dbeafe; color: #1e40af; }
.badge-3pt { background: #fee2e2; color: #b91c1c; }
.badge-2pt { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-emerald { background: #d1fae5; color: #065f46; }

.csat-stem {
  font-family: 'Nanum Myeongjo', serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: #111827;
  margin: 8px 0 12px;
  line-height: 1.58;
}

.csat-box {
  font-family: 'Nanum Myeongjo', Georgia, serif;
  background: #ffffff;
  border: 1.25px solid #222222;
  border-radius: 2px;
  padding: 12px 15px;
  margin: 8px 0 12px;
  font-size: 0.97rem;
  line-height: 1.72;
  text-align: justify;
}

.csat-window-box {
  border: 1.3px solid #222222;
  border-radius: 5px 5px 1px 1px;
  overflow: hidden;
  background: #ffffff;
  margin: 8px 0 14px;
}

.csat-window-titlebar {
  height: 24px;
  background: linear-gradient(180deg, #a8a8a8 0%, #e6e6e6 100%);
  border-bottom: 1px solid #444444;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 7px;
  gap: 4px;
}

.csat-win-btn {
  width: 15px;
  height: 15px;
  background: #f4f4f5;
  border: 1px solid #3b3b3b;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.csat-win-btn svg {
  width: 10px;
  height: 10px;
  stroke: #1e1e1e;
  fill: none;
}

.csat-window-body {
  font-family: 'Nanum Myeongjo', Georgia, serif;
  padding: 13px 16px;
  font-size: 0.98rem;
  line-height: 1.78;
  color: #111827;
}

.csat-epistle-salutation {
  margin-bottom: 9px;
  text-align: left;
}

.csat-epistle-para {
  text-align: justify;
  margin-bottom: 7px;
}

.csat-epistle-para:last-child {
  margin-bottom: 0;
}

.csat-epistle-signoff {
  margin-top: 9px;
  text-align: left;
  line-height: 1.62;
}

.csat-notice-box {
  font-family: 'Nanum Myeongjo', Georgia, serif;
  background: #ffffff;
  border: 1.3px solid #222222;
  border-radius: 2px;
  padding: 14px 16px;
  margin: 8px 0 14px;
  font-size: 0.97rem;
  color: #111827;
}

.csat-notice-title {
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.csat-notice-intro {
  text-align: justify;
  line-height: 1.72;
  margin-bottom: 6px;
}

.csat-notice-detail {
  text-align: left;
  line-height: 1.68;
  padding-left: 12px;
  text-indent: -12px;
  margin-bottom: 3px;
}

.csat-summary-arrow {
  text-align: center;
  font-weight: 800;
  color: #222222;
  margin: 5px 0;
  line-height: 1.1;
}

.csat-passage {
  font-family: 'Nanum Myeongjo', Georgia, serif;
  font-size: 0.99rem;
  line-height: 1.8;
  color: #111827;
  text-align: justify;
  margin-bottom: 14px;
}

.csat-options-printed {
  font-family: 'Nanum Myeongjo', Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.solve-choice-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--slate-200);
}

.choice-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--slate-300);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.choice-btn.picked-correct {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.choice-btn.picked-wrong {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.solve-feedback {
  font-size: 0.86rem;
  font-weight: 800;
  margin-left: 6px;
}

.card-expanders {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-details {
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #fff;
  padding: 10px 14px;
}

.card-details summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--slate-700);
}

.expl-body {
  padding-top: 10px;
  font-size: 0.89rem;
  line-height: 1.65;
}

.expl-callout {
  background: var(--blue-50);
  border-left: 4px solid var(--blue-600);
  padding: 10px 13px;
  border-radius: 6px;
  margin: 8px 0;
  white-space: pre-line;
}

.slash-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.85rem;
}

/* E-Commerce & PG Compliance Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--slate-200);
  padding: 28px 18px 36px;
  color: var(--slate-500);
  font-size: 0.81rem;
  line-height: 1.68;
}

.footer-inner {
  max-width: 1220px;
  margin: 0 auto;
}

.footer-policy-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--slate-700);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.footer-link-btn:hover {
  color: var(--blue-600);
  text-decoration: underline;
}

.footer-link-bold {
  font-weight: 800;
  color: var(--slate-900);
}

.footer-sep {
  color: var(--slate-300);
}

.footer-biz-info {
  margin-bottom: 12px;
  color: var(--slate-500);
  max-width: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.footer-biz-line {
  display: block;
  max-width: 100%;
}

.footer-biz-line + .footer-biz-line {
  margin-top: 2px;
}

.ft-item {
  display: inline;
  white-space: nowrap;
}

.ft-hours-group {
  display: inline;
  word-break: keep-all;
}

.ft-nowrap {
  display: inline-block;
  white-space: nowrap;
  max-width: 100%;
}

@media (max-width: 640px) {
  .ft-item {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
  }
}

.footer-disclaimer {
  margin: 0;
  padding: 10px 13px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  color: var(--slate-700);
  font-size: 0.79rem;
  font-weight: 600;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.modal-sm { max-width: 440px; }
.modal-lg { max-width: 800px; }
.modal-billing-xl { max-width: 1120px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--slate-200);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.modal-close {
  border: none;
  background: var(--slate-100);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-weight: 800;
}

.modal-body {
  padding: 20px 22px;
}

.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-foot-right {
  display: flex;
  gap: 8px;
}

.info-callout {
  background: var(--emerald-50);
  border: 1px solid #a7f3d0;
  color: #064e3b;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--slate-700);
  margin: 8px 0 12px;
}

.api-help-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.81rem;
}

.api-help-links a,
.text-link {
  color: var(--blue-600);
  font-weight: 700;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-primary:hover { background: var(--blue-700); }

.btn-secondary {
  background: var(--slate-100);
  color: var(--slate-900);
  border: 1px solid var(--slate-300);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-outline-danger {
  background: #fff;
  color: var(--red-600);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--slate-300);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.mini-btn:hover { border-color: var(--blue-600); color: var(--blue-700); }

.w-full { width: 100%; }

/* Auth, Store & Legal Tabs */
.auth-tabs,
.legal-tabs {
  display: grid;
  background: var(--slate-100);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
  gap: 4px;
}
.auth-tabs { grid-template-columns: 1fr 1fr; }
.legal-tabs { grid-template-columns: repeat(3, 1fr); }

.auth-tab,
.legal-tab {
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.auth-tab.active,
.legal-tab.active {
  background: #fff;
  color: var(--blue-700);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.legal-pane {
  font-size: 0.87rem;
  color: var(--slate-700);
  line-height: 1.68;
}
.legal-pane h4 {
  margin: 14px 0 6px;
  color: var(--slate-900);
  font-size: 0.94rem;
}
.legal-pane h4:first-child {
  margin-top: 2px;
}
.legal-pane p {
  margin: 0 0 10px;
}

.balance-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.bal-label { font-size: 0.78rem; color: #cbd5e1; }
.bal-value { font-size: 1.45rem; font-weight: 800; margin: 2px 0 4px; }
.bal-split { font-size: 0.8rem; color: #bfdbfe; margin-bottom: 6px; font-weight: 600; }
.bal-policy { font-size: 0.79rem; color: #e2e8f0; }

.coupon-section {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px 16px;
}

.policy-summary-box {
  margin-top: 14px;
  padding: 12px 15px;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.79rem;
  color: var(--slate-700);
  line-height: 1.55;
}

.muted-note {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--slate-500);
}

.coupon-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coupon-input-row .text-input {
  flex: 1 1 auto;
  min-width: 0;
}

.promo-bonus-banner {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 52%, #b45309 100%);
  color: #ffffff;
  border: 1.5px solid #fcd34d;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.48;
  box-shadow: 0 6px 18px rgba(67, 56, 202, 0.18);
  word-break: keep-all;
}

.packages-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (min-width: 640px) and (max-width: 1099px) {
  .packages-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .packages-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.pkg-card {
  border: 1.5px solid var(--slate-200);
  border-radius: 13px;
  padding: 15px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  word-break: keep-all;
  overflow-wrap: break-word;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.pkg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.pkg-card.highlight {
  border-color: var(--blue-600);
  background: var(--blue-50);
}

.pkg-card.pkg-card-b2b {
  border-color: #6366f1;
  background: linear-gradient(180deg, #fafaff 0%, #fffbeb 100%);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.1);
}

.preset-pill-b2b {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
  color: #fde68a !important;
  border: 1px solid #f59e0b;
  letter-spacing: -0.01em;
}

.pkg-price {
  font-size: 1.32rem;
  font-weight: 800;
  margin: 8px 0 2px;
}

.pkg-vat {
  font-size: 0.76rem;
  color: var(--slate-500);
  font-weight: 700;
  margin-bottom: 6px;
}

.pkg-promo-capsule {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  margin: 4px 0 5px;
  padding: 6px 9px;
  border-radius: 8px;
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.38;
  word-break: keep-all;
}

.pkg-promo-tag {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  line-height: 1.35;
  word-break: keep-all;
}

.pg-validity-notice {
  margin: 10px 0 6px;
  padding: 8px 12px;
  border-radius: 9px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  line-height: 1.5;
  word-break: keep-all;
}

.status-banner {
  padding: 10px 13px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 700;
  margin: 10px 0;
}
.banner-ok { background: var(--emerald-50); color: #065f46; border: 1px solid #6ee7b7; }
.banner-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.tx-details {
  margin-top: 14px;
  font-size: 0.84rem;
}
.tx-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--slate-700);
}
.tx-list {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 8px 12px;
}
.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: 0.81rem;
}

.btn-receipt-print {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid #4f46e5;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.btn-receipt-print:hover {
  background: #4f46e5;
  color: #ffffff;
}

/* History & Admin */
.history-guide-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--blue-600);
  border-radius: 10px;
  padding: 12px 15px;
  margin-bottom: 14px;
}

.history-guide-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.history-guide-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.81rem;
  line-height: 1.65;
  color: var(--slate-700);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.history-dl-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 9px;
  border-top: 1px dashed var(--slate-200);
}

.hist-dl-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--slate-300);
  background: #f8fafc;
  color: var(--slate-800);
  font-size: 0.77rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.14s ease;
}

.hist-dl-chip:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-700);
}

.hist-dl-chip-primary {
  background: var(--blue-50);
  border-color: #93c5fd;
  color: var(--blue-700);
}

.hist-dl-chip-zip {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff !important;
}

.hist-dl-chip-zip:hover {
  background: #1e293b;
}

.history-expired-note {
  font-size: 0.78rem;
  color: #64748b;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px dashed #cbd5e1;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.admin-forms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) {
  .admin-forms-grid { grid-template-columns: 1fr; }
}

.admin-card {
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-card h4 { margin: 0 0 4px; font-size: 0.92rem; }
.row-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--navy-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.28);
}

/* 3-Method PG Checkout Panel */
.pkg-card.is-selected {
  border: 2px solid #4f46e5 !important;
  background: #eef2ff !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.16);
}

.pg-checkout-box {
  margin-top: 14px;
  border: 1.5px solid #c7d2fe;
  border-radius: 14px;
  padding: 16px;
  background: #f8fafc;
}

.pg-method-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #e2e8f0;
  padding: 5px;
  border-radius: 12px;
  margin: 10px 0 14px;
}

.pg-method-tab {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pg-method-tab.active {
  background: #4f46e5;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3);
}

.pg-pane {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 14px;
}

.pg-row-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 720px) {
  .pg-row-3col { grid-template-columns: 1fr; }
}

.pg-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-pg-main {
  flex: 1;
  min-width: 220px;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}
.btn-pg-main:hover { filter: brightness(1.06); }

.btn-pg-dark {
  background: #0f172a;
  color: #fde68a;
  border: 1px solid #334155;
  border-radius: 11px;
  padding: 13px 16px;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-pg-dark:hover { background: #1e293b; }

.easypay-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
@media (max-width: 680px) {
  .easypay-pills { grid-template-columns: 1fr; }
}
.easypay-pill {
  border: 1.5px solid var(--slate-200);
  background: #fff;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 0.83rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--slate-800);
}
.easypay-pill.active {
  border-color: #4f46e5;
  background: #eef2ff;
  color: #3730a3;
}

.bank-info-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  margin-bottom: 12px;
  font-size: 0.88rem;
}

.pg-qr-wait-box {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.pg-qr-wait-box img {
  width: 132px;
  height: 132px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  border: 1px solid #a7f3d0;
}

/* Built-In Fast Engine 3-Set Guidance Box */
.rule-guide-box {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  color: #0c4a6e;
  font-size: 0.82rem;
  line-height: 1.56;
}

.rule-guide-box.is-exhausted {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}

.rule-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 0.84rem;
}

.rule-guide-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #0284c7;
  color: #fff;
}

.rule-guide-box.is-exhausted .rule-guide-pill {
  background: #d97706;
  color: #fff;
}

.rule-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.rule-switch-btn {
  border: 1px solid #93c5fd;
  background: #fff;
  color: #1d4ed8;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
}

.rule-switch-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
}

.csat-footnote-line {
  margin-top: 6px;
  text-align: right;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #1e293b;
}

/* Korean Syllable Orphan Wrap Prevention & Grade/Engine Guardrail States */
.hero-card h1,
.hero-desc,
.ag-text,
.section-header h2,
.section-header p,
.preset-title,
.preset-sub,
.grade-guide-text,
.tier-title,
.tier-desc,
.toggle-title,
.toggle-desc,
.rule-guide-box,
.rule-guide-head,
.rule-guardrail-note,
.ultra-warning-box,
.cta-generate-btn,
.section-heading,
.tx-details summary,
.tx-details p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

.tier-radio-card.is-disabled {
  opacity: 0.58;
  background: #f8fafc;
  border-color: #cbd5e1;
  cursor: not-allowed;
}

.tier-radio-card.is-disabled:hover {
  border-color: #cbd5e1;
}

.rule-guardrail-note {
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.42;
}

.toggle-card.is-disabled-rule {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pre-Generation Statutory Refund & Trial Notice Bar (UI Patch 1) */
.pre-gen-refund-notice {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 12.75px;
  line-height: 1.56;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.pre-gen-refund-notice.is-free-sample {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #334155;
}

/* Mandatory No-Refund Policy Consent Checkbox in Billing Modal (UI Patch 2) */
.pg-no-refund-consent-box {
  margin: 12px 0 10px;
  padding: 11px 13px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.pg-no-refund-consent-box.is-checked {
  background: #f0fdf4;
  border-color: #86efac;
}

.pg-no-refund-consent-box.is-alert {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.pg-no-refund-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: 12.75px;
  line-height: 1.52;
  color: #1e293b;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.pg-no-refund-consent-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #1d4ed8;
  cursor: pointer;
}

.btn-pg-main:disabled,
.btn-pg-dark:disabled,
#btnSubmitBankTransfer:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* 포털 브릿지 딥링크 진입 시 1.5초 미세 포커스 하이라이트 효과 */
@keyframes meDeeplinkFocusPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.72), 0 8px 24px rgba(37, 99, 235, 0.28);
  }
  55% {
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.26), 0 12px 28px rgba(37, 99, 235, 0.38);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), 0 6px 18px rgba(37, 99, 235, 0.18);
  }
}

.me-deeplink-focus-highlight {
  animation: meDeeplinkFocusPulse 1.5s ease-out 1;
  outline: 2px solid #38BDF8;
  outline-offset: 2px;
}

/* Footer Control & Custom Academy Branding UI */
.footer-gen-box,
.footer-hist-box,
.footer-config-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.footer-config-panel {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border: 1.5px solid #cbd5e1;
  padding: 13px 16px;
}

.footer-config-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.footer-config-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
}

.footer-config-pill {
  font-size: 0.74rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 3px 9px;
  border-radius: 999px;
}

.footer-mode-radios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

@media (max-width: 860px) {
  .footer-mode-radios {
    grid-template-columns: 1fr;
  }
}

.footer-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.footer-mode-card:hover {
  border-color: #93c5fd;
}

.footer-mode-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.footer-mode-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.footer-mode-card input[type="radio"] {
  margin-top: 3px;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.footer-mode-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.35;
}

.footer-mode-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.69rem;
  font-weight: 700;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.footer-mode-card.is-active .footer-mode-tag {
  background: #dbeafe;
  color: #1e40af;
}

.footer-mode-desc {
  margin-top: 3px;
  font-size: 0.76rem;
  color: #475569;
  line-height: 1.42;
  word-break: keep-all;
}

.footer-seg-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-seg-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.footer-seg-opt input[type="radio"] {
  accent-color: #2563eb;
}

.footer-seg-opt:has(input[type="radio"]:checked) {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1e40af;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12);
}

#genFooterConfigBox:has(input[name="genFooterMode"][value="hidden"]:checked) #genFooterHiddenSub,
#resFooterConfigPanel:has(input[name="resFooterMode"][value="hidden"]:checked) #resFooterHiddenSub,
#histFooterConfigBox:has(input[name="histFooterMode"][value="hidden"]:checked) #histFooterHiddenSub {
  display: block !important;
}

#genFooterConfigBox:has(input[name="genFooterMode"][value="custom"]:checked) #genFooterCustomSub,
#resFooterConfigPanel:has(input[name="resFooterMode"][value="custom"]:checked) #resFooterCustomSub,
#histFooterConfigBox:has(input[name="histFooterMode"][value="custom"]:checked) #histFooterCustomSub {
  display: block !important;
}

.footer-suboption-row {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
}

.footer-custom-box-wrap {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
}

.footer-custom-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.footer-custom-label small {
  font-weight: 600;
  color: #475569;
}

.footer-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-custom-row .text-input {
  flex: 1 1 180px;
  min-width: 0;
  font-size: 0.85rem;
  padding: 9px 11px;
  background: #ffffff;
  border-color: #60a5fa;
}

.footer-char-cnt {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.footer-error-note {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.79rem;
  font-weight: 700;
}

.footer-meta-compliance-note {
  margin: 7px 0 2px;
  font-size: 0.77rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.45;
}

/* Custom Topic & Pinset Worksheet Builder (Mode A & Mode B) */
.preset-card[data-mode="PINSET_CUSTOM"] {
  border-color: #c7d2fe;
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
}

.preset-card[data-mode="PINSET_CUSTOM"] .preset-pill {
  background: #e0e7ff;
  color: #3730a3;
}

.preset-card[data-mode="PINSET_CUSTOM"].selected {
  border-color: #4f46e5;
  background: linear-gradient(180deg, #eef2ff 0%, #f5f3ff 100%);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.16);
}

.custom-topic-builder {
  margin-top: 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.custom-topic-builder.is-expanded {
  border-color: #818cf8;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
}

.custom-topic-builder.is-disabled {
  opacity: 0.56;
  background: #f8fafc;
}

.ct-accordion-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 13px;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.custom-topic-builder.is-expanded .ct-accordion-head {
  background: #eef2ff;
  border-bottom: 1px solid #c7d2fe;
}

.ct-head-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #1e293b;
  word-break: keep-all;
  line-height: 1.38;
}

.ct-head-title small {
  font-weight: 600;
  color: #475569;
  font-size: 0.76rem;
  white-space: nowrap;
}

.ct-head-right {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.ct-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
}

.ct-status-badge.is-active {
  background: #4f46e5;
  color: #ffffff;
}

.ct-chevron {
  font-size: 0.85rem;
  color: #475569;
  transition: transform 0.18s ease;
}

.custom-topic-builder.is-expanded .ct-chevron {
  transform: rotate(180deg);
}

.ct-accordion-body {
  padding: 12px 13px 13px;
  background: #ffffff;
}

.ct-mode-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 10px;
  line-height: 1.45;
}

.ct-rows-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-slot-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
}

.ct-slot-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ct-slot-select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  font-size: 0.81rem;
  font-weight: 700;
  color: #0f172a;
  font-family: inherit;
}

.ct-row-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.ct-row-del-btn:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

.ct-row-del-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ct-slot-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ct-topic-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  font-size: 0.82rem;
  color: #0f172a;
  font-family: inherit;
}

.ct-topic-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.14);
}

.ct-topic-input.is-invalid {
  border-color: #ef4444;
  background: #fef2f2;
}

.ct-char-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  flex-shrink: 0;
}

.ct-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.ct-add-row-btn {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px dashed #6366f1;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.79rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}

.ct-add-row-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ct-limit-note {
  font-size: 0.74rem;
  color: #64748b;
  font-weight: 600;
}

.ct-guardrail-alert {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.45;
}

.ct-sample-chips-box {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #e2e8f0;
}

.ct-sample-lbl {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

.ct-sample-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ct-sample-chip {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.ct-sample-chip:hover {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
}

.ct-numbering-bar {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}

.ct-numbering-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: #4c1d95;
  margin-bottom: 6px;
}

.ct-numbering-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.ct-num-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

/* =========================================================================
   5-Feature Advanced Engine Upgrade Styles:
   1) Unified Topic Combobox (3-Category Floating Popover)
   2) Mode B Multi-Type Chaining Selector Badges (1~8 items, max 4 types/row)
   3) #29 Inline Grammar Point Selector (`[어법 포인트: 자동 순환 ▾]`)
   4) Vault / Workspace Single-Item Pinset Swap Popover (`0C 풀 교체` & `새 소재 재출제`)
   ========================================================================= */
.ct-slot-top {
  flex-wrap: wrap;
  gap: 6px;
}

.ct-grammar-select {
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.76rem;
  font-weight: 800;
  font-family: inherit;
  max-width: 245px;
  cursor: pointer;
}

.ct-multi-type-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.ct-multi-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.ct-multi-trigger:hover {
  border-color: #6366f1;
}

.ct-multi-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.ct-chain-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.ct-multi-hint {
  font-size: 0.73rem;
  font-weight: 700;
  color: #4f46e5;
  white-space: nowrap;
  flex-shrink: 0;
}

.ct-multi-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 65;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
  padding: 9px 10px;
  max-height: 270px;
  overflow-y: auto;
}

.ct-multi-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px solid #f1f5f9;
}

.ct-multi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
}

@media (max-width: 560px) {
  .ct-multi-grid {
    grid-template-columns: 1fr;
  }
}

.ct-multi-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.ct-multi-opt:hover {
  background: #f8fafc;
}

.ct-multi-opt.is-checked {
  background: #eef2ff;
  color: #312e81;
}

/* Unified Floating Topic Combobox */
.ct-combobox-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.ct-combobox-wrap .ct-topic-input {
  width: 100%;
}

.ct-linked-seed-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.ct-combo-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 70;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.ct-combo-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 7px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}

.ct-combo-tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.ct-combo-tab.active {
  background: #ffffff;
  border-color: #818cf8;
  color: #3730a3;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ct-combo-list {
  max-height: 228px;
  overflow-y: auto;
  padding: 4px;
}

.ct-combo-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  color: #0f172a;
}

.ct-combo-item:hover,
.ct-combo-item.is-active {
  background: #eef2ff;
}

.ct-combo-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.ct-combo-badge.cat-ebs {
  background: #eff6ff;
  color: #1d4ed8;
}

.ct-combo-badge.cat-kice {
  background: #f5f3ff;
  color: #5b21b6;
}

.ct-combo-badge.cat-freq {
  background: #fff7ed;
  color: #c2410c;
}

.ct-combo-title-ko {
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-combo-title-en {
  color: #64748b;
  font-size: 0.73rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ct-combo-empty {
  padding: 10px 12px;
  font-size: 0.76rem;
  color: #64748b;
}

/* Vault / Workspace Item Card Top Bar & Single-Item Swap Popover */
.csat-card-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.csat-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.csat-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-open-item-swap {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid #818cf8;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.77rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
}

.btn-open-item-swap:hover {
  background: #e0e7ff;
  border-color: #4f46e5;
}

.item-swap-popover {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #c7d2fe;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.item-swap-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
  font-size: 0.83rem;
  font-weight: 800;
  color: #1e1b4b;
}

.item-swap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  .item-swap-grid {
    grid-template-columns: 1fr;
  }
}

.item-swap-opt-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.item-swap-opt-title {
  font-size: 0.81rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.item-swap-opt-desc {
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.45;
}

/* Q-STUDIO Cross-Device PWA Install Button & Modal */
.pill-pwa-install {
  background: linear-gradient(135deg, #0b172f 0%, #112a52 100%);
  border: 1px solid #09a2cc;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(9, 162, 204, 0.18);
}
.pill-pwa-install:hover {
  background: linear-gradient(135deg, #09a2cc 0%, #077fa3 100%);
  border-color: #077fa3;
  color: #ffffff;
  transform: translateY(-1px);
}
.pill-pwa-install.is-ready {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(9, 162, 204, 0.2);
}

.modal-pwa-box {
  max-width: 600px;
}
.pwa-hero-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b172f 0%, #162c56 100%);
  color: #f8fafc;
  margin-bottom: 12px;
}
.pwa-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #ffffff;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.pwa-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pwa-hero-copy strong {
  font-size: 0.94rem;
  font-weight: 800;
  color: #ffffff;
}
.pwa-hero-copy span {
  font-size: 0.79rem;
  line-height: 1.48;
  color: #cbd5e1;
  word-break: keep-all;
}
.pwa-direct-box {
  padding: 13px 15px;
  border-radius: 12px;
  background: #f0f9ff;
  border: 1.5px solid #38bdf8;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-direct-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: #0c4a6e;
}
.pwa-direct-text strong {
  font-size: 0.88rem;
  color: #0b172f;
}
.pwa-inapp-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1.5px solid #fdba74;
  margin-bottom: 12px;
}
.pwa-device-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.pwa-dev-tab {
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.14s ease;
}
.pwa-dev-tab.active {
  background: #0b172f;
  border-color: #09a2cc;
  color: #ffffff;
}
.pwa-guide-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pwa-step-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.pwa-step-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #0b172f;
  margin-bottom: 6px;
}
.pwa-step-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.81rem;
  line-height: 1.62;
  color: #334155;
  word-break: keep-all;
}
.pwa-step-list li + li {
  margin-top: 4px;
}
.pwa-footer-bar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .pwa-device-tabs {
    grid-template-columns: 1fr;
  }
  .pill-pwa-install {
    padding: 7px 11px;
    font-size: 0.79rem;
  }
}








