/*
 * AIVI shared English workspace styles.
 * Keep cross-page builder primitives and shared question-preview/card/edit shells here.
 * Page-specific Question Create, Similar Lab, and Exam Center styles live in their own CSS files.
 */
.aivi-exam-wrap {
  display: none !important;
}

.exam-builder-v1 {
  --exam-ink: #0f172a;
  --exam-muted: #64748b;
  --exam-line: #dbe3ef;
  --exam-soft: #f8fafc;
  --exam-shadow: 0 10px 30px rgba(15, 23, 42, .045);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  color: var(--exam-ink);
}

.exam-page-shell {
  width: 100%;
}

.exam-page-header {
  width: 100%;
}

.exam-content-shell {
  min-width: 0;
}

.exam-builder-v1 * {
  box-sizing: border-box;
}

.exam-builder-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.exam-builder-title {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.exam-builder-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  flex: 0 0 auto;
}

.exam-builder-title h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: 0;
}

.exam-builder-title p,
.exam-builder-muted {
  margin: .35rem 0 0;
  color: var(--exam-muted);
  font-size: .92rem;
  font-weight: 650;
  line-height: 1.65;
}

.exam-builder-card {
  background: #fff;
  border: 1px solid var(--exam-line);
  border-radius: 18px;
  box-shadow: var(--exam-shadow);
}

.exam-builder-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .25rem;
  border: 1px solid var(--exam-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--exam-shadow);
}

.exam-builder-tab,
.exam-builder-btn,
.exam-builder-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid var(--exam-line);
  background: #fff;
  color: #334155;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.exam-builder-tab {
  min-height: 42px;
  border-color: transparent;
  border-radius: 12px;
  padding: .65rem 1rem;
  font-size: .88rem;
}

.exam-builder-tab.is-active,
.exam-source-card.is-active,
.exam-preset-card.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.exam-tab-button[data-future-menu],
.exam-builder-btn[data-future-menu],
.exam-builder-steps[data-future-menu] {
  display: none !important;
}


.question-placeholder-card {
  display: grid;
  gap: 1rem;
  background: #f8fafc;
}

.question-placeholder-card .exam-builder-btn[disabled] {
  cursor: not-allowed;
  opacity: .65;
}

.question-preview-section {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.question-preview-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
}

.question-preview-empty {
  padding: .9rem 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
  color: #64748b;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.6;
}

.question-preview-list {
  display: grid;
  gap: .9rem;
}

.question-preview-card {
  display: grid;
  gap: .9rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
}

.question-preview-card.is-preview-edited {
  border-color: #bfdbfe;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .08);
}

.question-preview-card.is-preview-excluded {
  border-color: #fecaca;
  background: #fef2f2;
  opacity: .78;
}

.question-preview-card.is-preview-excluded::before {
  content: "제외";
  justify-self: start;
  padding: .3rem .6rem;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #991b1b;
  font-size: .76rem;
  font-weight: 950;
}

.question-preview-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  cursor: pointer;
  border-radius: 12px;
  outline: none;
}

.question-preview-card-head:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

.question-preview-card-head:hover .question-preview-summary-line {
  color: #1d4ed8;
}

.question-preview-card-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 950;
}

.question-preview-card-head p {
  margin: .25rem 0 0;
  color: #64748b;
  font-size: .84rem;
  font-weight: 800;
}

.question-preview-card-summary {
  display: grid;
  gap: .45rem;
  min-width: 0;
  flex: 1 1 260px;
}

.question-preview-card-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.question-preview-type-badge,
.question-preview-card-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .3rem .58rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: .74rem;
  font-weight: 900;
}

.question-preview-summary-line {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #334155;
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.question-preview-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  color: #64748b;
  font-size: .78rem;
  font-weight: 850;
}

.question-preview-card-badges {
  align-items: flex-start;
}

.csv-ai-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem;
  width: 100%;
}

.csv-ai-card-actions .exam-builder-btn {
  min-height: 30px;
  padding: .35rem .62rem;
  font-size: .78rem;
}

.question-preview-card-toggle {
  background: #fff;
  color: #2563eb;
}

.question-preview-card:not(.is-open) .question-preview-body,
.question-preview-card:not(.is-open) > .question-preview-actions,
.question-preview-card:not(.is-open) > .question-preview-edit-panel {
  display: none;
}

.question-preview-card.is-open {
  border-color: #bfdbfe;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .07);
}

.question-preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .35rem .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: .78rem;
  font-weight: 900;
}

.question-preview-status.ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.question-preview-status.needs-review {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.question-preview-status.needs-image {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.question-preview-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.question-preview-status.complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.question-preview-status.is-secondary {
  min-height: 26px;
  padding: .25rem .5rem;
  font-size: .72rem;
}

.question-preview-status-stack {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .4rem;
}

.question-preview-card.is-preview-locked {
  border-color: #bbf7d0;
  background: #f8fffb;
}

.question-preview-card.is-preview-locked .question-preview-actions {
  opacity: .72;
}

.question-preview-body {
  display: grid;
  gap: .75rem;
  color: #334155;
}

.question-preview-body strong {
  display: block;
  margin-bottom: .25rem;
  color: #0f172a;
  font-size: .82rem;
  font-weight: 950;
}

.question-preview-body p {
  margin: 0;
  color: #475569;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.6;
}

.question-preview-image-needed {
  padding: .75rem .85rem;
  border: 1px dashed #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: .86rem;
  font-weight: 850;
}

.question-preview-choice-list {
  display: grid;
  gap: .45rem;
  margin: 0;
  padding-left: 1.25rem;
}

.question-preview-choice-list li {
  color: #334155;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.5;
}

.question-preview-answer {
  display: grid;
  gap: .45rem;
  padding: .75rem .85rem;
  border-radius: 14px;
  background: #f8fafc;
  color: #334155;
  font-size: .87rem;
  font-weight: 850;
}


.question-preview-id-row {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.question-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.question-preview-actions-bottom {
  padding-top: .2rem;
}

.question-preview-save-result {
  padding: .95rem 1rem;
  border: 1px solid #bbf7d0;
  border-radius: 16px;
  background: #f0fdf4;
  color: #166534;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.65;
}

.question-preview-save-result strong {
  display: block;
  margin-bottom: .2rem;
  color: #14532d;
  font-size: .96rem;
}

.question-preview-save-actions {
  margin-top: .65rem;
}

.question-preview-lookup {
  display: grid;
  gap: .85rem;
}

.question-panel-intro.compact {
  margin-bottom: 0;
}

.question-preview-lookup-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}

.question-preview-lookup-result {
  padding: .85rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.6;
}

.question-preview-lock-notice {
  margin-top: .65rem;
  padding: .7rem .8rem;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
}

.question-import-batch-list {
  display: grid;
  gap: .85rem;
}

.question-import-batch-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: .75rem;
  align-items: end;
}

.question-import-batch-cards {
  display: grid;
  gap: .75rem;
}

.question-import-batch-card {
  display: grid;
  gap: .7rem;
  padding: .9rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
}

.question-import-batch-head,
.question-import-batch-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .55rem;
}

.question-import-batch-head strong {
  display: block;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 950;
}

.question-import-batch-head span,
.question-import-batch-meta span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 800;
}

.question-import-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: .45rem;
}

.question-import-batch-grid span {
  padding: .55rem .65rem;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: .82rem;
  font-weight: 850;
}

.question-preview-commit-result {
  padding: .9rem 1rem;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  background: #fff7ed;
  color: #9a3412;
  font-size: .9rem;
  font-weight: 850;
  line-height: 1.65;
}

.question-preview-commit-result strong {
  display: block;
  margin-bottom: .25rem;
  color: #7c2d12;
  font-size: .96rem;
}

.question-preview-commit-result ul {
  display: grid;
  gap: .3rem;
  margin: .55rem 0 0;
  padding-left: 1.15rem;
}

.question-preview-final-commit {
  display: grid;
  gap: .65rem;
  margin-top: .85rem;
  padding: .85rem;
  border: 1px solid #fdba74;
  border-radius: 14px;
  background: #fffbeb;
}

.question-preview-final-commit.muted {
  border-color: #e5e7eb;
  background: #f8fafc;
  color: #64748b;
}

.question-preview-final-commit.is-complete {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.question-preview-final-commit p {
  margin: 0;
  color: inherit;
  font-weight: 700;
}

.question-preview-final-confirm {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: #7c2d12;
  font-weight: 850;
}

.question-preview-final-confirm input {
  width: 1rem;
  height: 1rem;
  accent-color: #ea580c;
}

.exam-builder-btn.danger {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.exam-builder-btn.danger:hover:not(:disabled) {
  background: #b91c1c;
  border-color: #b91c1c;
}

.question-preview-edit-panel {
  display: grid;
  gap: .85rem;
  padding: .95rem;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: #f8fafc;
}

.question-preview-edit-stack {
  display: grid;
  gap: .8rem;
}

.question-preview-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.question-preview-edit-wide {
  grid-column: 1 / -1;
}

.question-preview-edit-panel textarea {
  min-height: 96px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.exam-builder-btn {
  min-height: 40px;
  border-radius: 12px;
  padding: .58rem .85rem;
  font-size: .84rem;
}

.exam-builder-btn.primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.exam-builder-btn.green {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.exam-builder-btn.red {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.exam-builder-btn.small {
  min-height: 32px;
  border-radius: 999px;
  padding: .35rem .6rem;
  font-size: .74rem;
}

.exam-builder-pill {
  border-radius: 999px;
  padding: .32rem .66rem;
  font-size: .74rem;
}

.exam-builder-pill.dark {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.exam-builder-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  padding: .25rem .58rem;
  font-size: .74rem;
  font-weight: 900;
}

.exam-builder-tag.gray { background: #f1f5f9; color: #334155; }
.exam-builder-tag.green { background: #ecfdf5; color: #166534; }
.exam-builder-tag.blue { background: #eff6ff; color: #1d4ed8; }
.exam-builder-tag.amber { background: #fffbeb; color: #92400e; }
.exam-builder-tag.red { background: #fef2f2; color: #991b1b; }
.exam-builder-tag.violet { background: #f5f3ff; color: #6d28d9; }

.exam-builder-panel {
  display: none;
}

.exam-builder-panel.is-active {
  display: block;
}

.exam-builder-steps,
.exam-source-grid,
.exam-preset-grid,
.exam-filter-grid,
.exam-simple-grid {
  display: grid;
  gap: .85rem;
}

.exam-builder-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.exam-step-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 0;
}

.exam-step-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-size: .78rem;
  font-weight: 900;
  flex: 0 0 auto;
}

.exam-step-dot.on {
  background: #0f172a;
  color: #fff;
}

.exam-step-item strong {
  display: block;
  font-size: .9rem;
  font-weight: 900;
}

.exam-step-item span {
  display: block;
  margin-top: .15rem;
  color: #94a3b8;
  font-size: .76rem;
  font-weight: 800;
}

.exam-source-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.exam-source-card {
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.exam-source-card:hover {
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.exam-source-label {
  color: #64748b;
  font-size: .84rem;
  font-weight: 900;
}

.exam-source-count {
  margin-top: .6rem;
  font-size: 2rem;
  font-weight: 900;
}

.exam-source-desc {
  margin-top: .25rem;
  color: #94a3b8;
  font-size: .76rem;
  font-weight: 800;
}

.exam-section-card {
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}

.exam-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: 1rem;
}

.exam-section-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.exam-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.exam-preset-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.exam-preset-card {
  border: 1px solid var(--exam-line);
  border-radius: 16px;
  background: #fff;
  padding: .95rem;
  text-align: left;
  cursor: pointer;
}

.exam-preset-card strong {
  display: block;
  font-size: .9rem;
  font-weight: 900;
}

.exam-preset-card span {
  display: block;
  margin-top: .45rem;
  font-size: .78rem;
  font-weight: 750;
  line-height: 1.55;
  color: #64748b;
}

.exam-filter-grid {
  grid-template-columns: 2fr repeat(5, minmax(130px, 1fr)) 110px;
}

.exam-builder-field label {
  display: block;
  margin-bottom: .28rem;
  color: #64748b;
  font-size: .73rem;
  font-weight: 900;
}

.exam-builder-field input,
.exam-builder-field select,
.exam-builder-field textarea {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--exam-line);
  border-radius: 12px;
  background: #fff;
  padding: .7rem .8rem;
  color: #0f172a;
  font-size: .88rem;
  font-weight: 750;
}

.exam-builder-field input:focus,
.exam-builder-field select:focus,
.exam-builder-field textarea:focus {
  outline: none;
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .06);
}

.exam-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 1.25rem;
  align-items: start;
}

.exam-question-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.exam-candidate-card {
  border: 1px solid var(--exam-line);
  border-radius: 16px;
  background: #fff;
  padding: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.exam-candidate-card:hover,
.exam-candidate-card.is-selected {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .08);
}

.exam-candidate-card.is-selected {
  background: #f8fafc;
}

.exam-candidate-card.is-hidden {
  display: none;
}

.exam-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.exam-card-title {
  margin: .75rem 0 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.55;
}

.exam-card-desc {
  margin: .45rem 0 0;
  color: #64748b;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.6;
}

.exam-cart-card {
  position: sticky;
  top: 84px;
  padding: 1.1rem;
}

.exam-cart-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .9rem;
}

.exam-cart-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--exam-line);
  border-radius: 12px;
  background: #fff;
  padding: .7rem;
}

.exam-cart-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .84rem;
  font-weight: 900;
}

.exam-cart-row span {
  display: block;
  margin-top: .18rem;
  color: #94a3b8;
  font-size: .72rem;
  font-weight: 800;
}

.exam-cart-empty,
.exam-empty-state {
  border: 1px dashed var(--exam-line);
  border-radius: 16px;
  background: #f8fafc;
  padding: 1.25rem;
  color: #64748b;
  text-align: center;
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.6;
}

.exam-cart-summary {
  border-radius: 16px;
  background: #f8fafc;
  padding: .9rem;
  color: #475569;
  font-size: .86rem;
  font-weight: 750;
  line-height: 1.65;
}

.exam-cart-summary strong {
  display: block;
  color: #0f172a;
  font-weight: 900;
}

.exam-bottom-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.25rem;
  padding: .9rem;
}

.exam-simple-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.exam-simple-item {
  padding: 1rem;
}

.exam-workbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.25rem;
  align-items: start;
}

.exam-workbook-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, .8fr)) 104px;
  gap: .75rem;
}

.exam-workbook-list {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.exam-workbook-rank-card {
  display: grid;
  grid-template-columns: 54px 64px minmax(0, 1fr) minmax(330px, .62fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--exam-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--exam-shadow);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.exam-workbook-rank-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .07);
  transform: translateY(-1px);
}

.exam-workbook-rank-card.is-active {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12), var(--exam-shadow);
}

.exam-workbook-rank-card.is-hidden {
  display: none;
}

.exam-workbook-rank-no {
  display: grid;
  place-items: center;
  min-height: 58px;
  border-right: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 1.55rem;
  font-weight: 900;
}

.exam-workbook-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.65rem;
}

.exam-workbook-main {
  min-width: 0;
}

.exam-workbook-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
}

.exam-workbook-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.4;
}

.exam-workbook-desc {
  margin: .35rem 0 0;
  color: #64748b;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.6;
}

.exam-workbook-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}

.exam-workbook-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: .9rem;
  align-items: center;
}

.exam-workbook-action-stack {
  position: relative;
  display: grid;
  gap: .45rem;
}

.exam-workbook-action-row {
  display: grid;
  gap: .45rem;
}

.exam-workbook-action-row.two {
  grid-template-columns: 1fr 1fr;
}

.exam-workbook-action-row.three {
  grid-template-columns: 1fr 1fr 42px;
}

.exam-workbook-more-menu {
  display: none;
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 10;
  min-width: 132px;
  border: 1px solid var(--exam-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(15, 23, 42, .12);
  overflow: hidden;
}

.exam-workbook-more-menu.is-open {
  display: block;
}

.exam-workbook-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: #fff;
  padding: .65rem .8rem;
  color: #334155;
  text-align: left;
  font-size: .8rem;
  font-weight: 900;
}

.exam-workbook-menu-item:hover {
  background: #f8fafc;
}

.exam-workbook-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.exam-workbook-stat {
  padding: 0 .65rem;
  text-align: center;
  border-right: 1px solid #e2e8f0;
}

.exam-workbook-stat:last-child {
  border-right: 0;
}

.exam-workbook-stat-label {
  color: #94a3b8;
  font-size: .7rem;
  font-weight: 900;
}

.exam-workbook-stat-value {
  margin-top: .25rem;
  color: #0f172a;
  font-size: .95rem;
  font-weight: 900;
}

.exam-workbook-side {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.exam-workbook-side-card {
  padding: 1rem;
}

.exam-workbook-mini-row {
  display: flex;
  align-items: center;
  gap: .7rem;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  background: #f8fafc;
  padding: .75rem;
}

.exam-workbook-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: .85rem;
}

.exam-workbook-detail-item {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #f8fafc;
  padding: .65rem;
}

.exam-workbook-detail-label {
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 900;
}

.exam-workbook-detail-value {
  margin-top: .22rem;
  color: #0f172a;
  font-size: .84rem;
  font-weight: 900;
  line-height: 1.45;
}

.exam-workbook-empty {
  display: none;
  margin-top: 1rem;
  border: 1px dashed var(--exam-line);
  border-radius: 18px;
  background: #fff;
  padding: 2rem;
  text-align: center;
}

.exam-workbook-empty.is-open {
  display: block;
}

.exam-upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1rem;
}

.exam-upload-drop {
  display: grid;
  gap: .75rem;
  border: 1px dashed var(--exam-line);
  border-radius: 18px;
  background: #f8fafc;
  padding: 1rem;
}

.exam-upload-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}

.exam-upload-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--exam-line);
  border-radius: 14px;
}

.exam-upload-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

.exam-upload-table th,
.exam-upload-table td {
  border-bottom: 1px solid #eef2f7;
  padding: .72rem .8rem;
  text-align: left;
  vertical-align: top;
  font-size: .82rem;
}

.exam-upload-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 900;
}

.exam-upload-table tr:last-child td {
  border-bottom: 0;
}

.exam-upload-status {
  display: none;
  margin-top: .85rem;
  border-radius: 14px;
  border: 1px solid var(--exam-line);
  background: #fff;
  padding: .8rem .9rem;
  color: var(--exam-muted);
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.55;
}

.exam-upload-status.is-open {
  display: block;
}

.exam-toast {
  display: none;
  margin-top: .75rem;
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  background: #ecfdf5;
  color: #166534;
  padding: .8rem .9rem;
  font-size: .84rem;
  font-weight: 850;
  line-height: 1.55;
}

.exam-toast.is-open {
  display: block;
}

@media (max-width: 1280px) {
  .exam-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .exam-workbook-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .exam-builder-grid {
    grid-template-columns: 1fr;
  }

  .exam-workbook-layout {
    grid-template-columns: 1fr;
  }

  .exam-upload-layout {
    grid-template-columns: 1fr;
  }

  .exam-workbook-side {
    position: static;
  }

  .exam-workbook-rank-card {
    grid-template-columns: 46px 58px minmax(0, 1fr);
  }

  .exam-workbook-actions {
    grid-column: 1 / -1;
  }

  .exam-cart-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .exam-builder-v1 {
    padding-left: .35rem;
    padding-right: .35rem;
  }

  .exam-source-grid,
  .exam-builder-steps,
  .exam-preset-grid,
  .exam-filter-grid,
  .exam-workbook-toolbar,
  .exam-upload-summary,
  .exam-simple-grid {
    grid-template-columns: 1fr;
  }

  .exam-workbook-rank-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .exam-workbook-icon {
    display: none;
  }

  .exam-workbook-main,
  .exam-workbook-actions {
    grid-column: 2 / -1;
  }

  .exam-workbook-actions {
    grid-template-columns: 1fr;
  }

  .exam-workbook-stats {
    border: 0;
  }

  .exam-builder-tab {
    flex: 1 1 100%;
  }

  .question-create-tabs {
    width: 100%;
    border-radius: 18px;
  }

  .question-create-tab {
    flex: 1 1 100%;
  }

  .question-create-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .question-create-page .question-import-card-wide .exam-upload-layout {
    padding-left: .85rem;
    padding-right: .85rem;
  }

  .manual-field-grid,
  .manual-field-grid-answer,
  .manual-check-grid,
  .manual-question-layout,
  .question-workbook-placeholder-grid,
  .workbook-field-grid,
  .workbook-source-grid,
  .question-coming-soon-list,
  .workbook-recent-item,
  .workbook-sample-item,
  .workbook-detail-item,
  .workbook-detail-edit-grid,
  .question-gemini-mock-options,
  .question-gemini-status-grid,
  .question-gemini-log-summary,
  .csv-ai-process-guide,
  .csv-ai-preview-summary,
  .csv-ai-usage,
  .question-preview-summary,
  .text-ai-cart-summary-grid,
  .question-preview-lookup-row,
  .question-preview-edit-grid,
  .text-ai-edit-inline-grid {
    grid-template-columns: 1fr;
  }

  .text-ai-candidate-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .text-ai-candidate-action-bar-bottom {
    align-items: stretch;
  }

  .text-ai-candidate-action-buttons,
  .text-ai-cart-dialog-actions {
    justify-content: stretch;
  }

  .text-ai-candidate-action-buttons .exam-builder-btn,
  .text-ai-cart-dialog-actions .exam-builder-btn {
    flex: 1 1 auto;
  }

  .text-ai-choice-edit-row {
    grid-template-columns: 1fr;
    gap: .3rem;
  }

  .text-ai-choice-edit-row > span {
    min-height: auto;
  }

  .workbook-sample-actions {
    justify-content: stretch;
  }

  .workbook-sample-actions .exam-builder-btn {
    flex: 1 1 auto;
  }

  .manual-option-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .manual-action-card {
    align-items: stretch;
  }

  .manual-action-row,
  .manual-action-row .exam-builder-btn {
    width: 100%;
  }
}
/* /AIVI Exam Workbook Builder V1 */

/* AIVI Exam Choice Font Fix V1 */

/* 보기 번호: 검은색 계열 */
.aivi-option strong {
  color: #000000 !important;
  font-weight: 800 !important;
}

/* 보기 문장: 크기 살짝 축소 + 검은색 계열 */
.aivi-option span span {
  color: #111111 !important;
  font-size: 0.98rem !important;
  font-weight: 600 !important;
  line-height: 1.6 !important;
}

/* 선택된 상태에서도 파란색으로 변하지 않도록 고정 */
.aivi-option.is-selected strong,
.aivi-option.is-selected span span {
  color: #000000 !important;
}

/* 선택된 보기 배경은 기존처럼 차분한 회색 계열 유지 */
.aivi-option.is-selected {
  border-color: #111827 !important;
  background: #f8fafc !important;
}

/* /AIVI Exam Choice Font Fix V1 */

/* AIVI Exam Original Style Multi10 V2 */

  .aivi-exam-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
  }

  .aivi-exam-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .aivi-exam-card {
    border: 1px solid #dbe3ef;
    border-radius: 1.25rem;
    background: #ffffff;
  }

  .aivi-exam-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
  }

  .aivi-exam-question-box {
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #ffffff;
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .aivi-exam-question-title {
    font-weight: 800;
    color: #0f172a;
    line-height: 1.65;
    font-size: 1.05rem;
  }

  .aivi-exam-korean {
    margin-top: .85rem;
    border: 1px solid #dbe3ef;
    border-radius: .9rem;
    background: #f8fafc;
    padding: .85rem 1rem;
    color: #334155;
    font-weight: 600;
  }

  .aivi-option {
    border: 1px solid #dbe3ef;
    background: #ffffff;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
  }

  .aivi-option:hover {
    border-color: #9ca3af;
    background: #f9fafb;
  }

  .aivi-option.is-selected {
    border-color: #111827 !important;
    background: #f8fafc !important;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, .08);
  }

  .aivi-option strong {
    color: #111827 !important;
    font-weight: 800;
  }

  .aivi-option span span {
    color: #334155;
    font-weight: 500;

    font-size: 1.0625rem;
}

  .aivi-exam-feedback {
    margin-top: .85rem;
    line-height: 1.7;
    font-size: .92rem;
  }

  .aivi-exam-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
  }

  .aivi-exam-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid #dbe3ef;
    border-radius: .8rem;
    padding: .55rem .8rem;
    background: #ffffff;
    color: #111827;
    font-weight: 800;
    text-decoration: none;
  }



  .aivi-exam-ai-card {
    margin-top: .85rem;
    border: 1px solid #dbe3ef;
    border-radius: 1rem;
    background: #f8fafc;
    padding: .95rem 1rem;
    color: #334155;
  }

  .aivi-exam-ai-title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 900;
    color: #111827;
    margin-bottom: .45rem;
  }

  .aivi-exam-ai-body {
    line-height: 1.75;
    font-size: .95rem;
  }

  .aivi-exam-ai-mini {
    margin-top: .5rem;
    color: #64748b;
    font-size: .88rem;
  }

  .aivi-exam-ai-btn:hover {
    background: #f8fafc;
    border-color: #111827;
  }

  @media (max-width: 768px) {
    .aivi-exam-wrap {
      max-width: 100%;
      padding-left: .5rem;
      padding-right: .5rem;
    }
  }
