﻿.char-builder-page {
  padding-bottom: 1.2rem;
}

.cb-intro {
  margin: 0.2rem 0 0.3rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.cb-hint {
  margin-top: 0;
  margin-bottom: 1rem;
}

.cb-style-presets {
  margin-bottom: 0.9rem;
}

.cb-style-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.cb-style-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.cb-style-buttons button {
  width: auto;
  padding: 0.38rem 0.68rem;
  font-size: 0.82rem;
}

.cb-style-buttons button.active {
  background: linear-gradient(135deg, var(--accent), #f08c00);
  color: #121212;
  border-color: #f3a402;
}

.cb-style-desc {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
}

.cb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  gap: 1rem;
  align-items: start;
}

.cb-left,
.cb-right {
  min-width: 0;
}

.cb-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(19, 26, 34, 0.82);
  margin-bottom: 0.7rem;
  overflow: hidden;
}

.cb-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.72rem 0.78rem;
  font-weight: 700;
  border-bottom: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.cb-group > summary::after {
  content: "+";
  font-size: 1rem;
  color: var(--muted);
}

.cb-group > summary::-webkit-details-marker {
  display: none;
}

.cb-group[open] > summary {
  border-bottom-color: var(--line);
}

.cb-group[open] > summary::after {
  content: "-";
}

.cb-group-body {
  padding: 0.68rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.cb-group-advanced .cb-advanced-hint {
  margin: 0.55rem 0.68rem 0;
}

.mc-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 18, 27, 0.7);
  overflow: hidden;
}

.mc-field.open {
  border-color: #4b6480;
}

.mc-field-modal .mc-toggle::after {
  content: "Open";
  font-size: 0.7rem;
  border: 1px solid #39506a;
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  color: #c5d9ee;
}

html[lang="ko"] .mc-field-modal .mc-toggle::after {
  content: "선택";
}

.mc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border: 0;
  border-radius: 0;
  padding: 0.56rem 0.62rem;
  text-align: left;
  background: transparent;
  color: var(--text);
}

.mc-toggle::after {
  content: "▼";
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: 0.45rem;
}

.mc-field.open .mc-toggle::after {
  content: "▲";
}

.mc-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.mc-preview {
  color: var(--muted);
  font-size: 0.83rem;
  text-align: right;
}

.mc-panel {
  border-top: 1px solid var(--line);
  padding: 0.56rem;
}

.mc-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.48rem;
}

.mc-tools input {
  flex: 1;
}

.mc-tools .mc-clear {
  width: auto;
  white-space: nowrap;
  padding-inline: 0.6rem;
}

.mc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.65rem;
  margin-bottom: 0.5rem;
}

.mc-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 1px solid #415771;
  border-radius: 999px;
  padding: 0.14rem 0.54rem;
  font-size: 0.78rem;
  background: #1f2c3a;
}

.mc-chip button {
  width: auto;
  border: 0;
  background: transparent;
  color: #cfe5ff;
  padding: 0;
  line-height: 1;
  font-size: 0.95rem;
}

.mc-list {
  max-height: 188px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.38rem;
  background: rgba(8, 14, 22, 0.75);
}

.mc-list::-webkit-scrollbar {
  width: 8px;
}

.mc-list::-webkit-scrollbar-thumb {
  background: #33475d;
  border-radius: 999px;
}

.mc-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  margin-bottom: 0.28rem;
}

.mc-item-text {
  flex: 1;
  min-width: 0;
}

.mc-item-count {
  margin-left: auto;
  min-width: 2.1rem;
  text-align: center;
  font-size: 0.74rem;
  color: #bcd1e7;
  border: 1px solid #3f5872;
  border-radius: 999px;
  padding: 0.06rem 0.35rem;
  background: #1a2837;
}

.mc-item[hidden] {
  display: none !important;
}

.mc-item input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.cb-output-sticky {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(19, 26, 34, 0.9);
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  position: static;
}

.cb-target-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.cb-target-toggle {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.cb-target-toggle button {
  flex: 1;
  font-size: 0.83rem;
  padding: 0.48rem 0.55rem;
}

.cb-target-toggle button.active {
  background: linear-gradient(135deg, var(--accent), #f08c00);
  color: #121212;
  border-color: #f3a402;
}

.cb-checkbox-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.6rem 0;
  font-size: 0.88rem;
}

.cb-checkbox-line input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.cb-checkbox-line.is-disabled {
  opacity: 0.58;
}

.cb-wide-scene-line {
  margin-top: 0.45rem;
  margin-bottom: 0.25rem;
}

.cb-wide-scene-hint {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
}

.cb-inline-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.cb-preset-box {
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem;
  background: rgba(11, 18, 27, 0.75);
}

.cb-preset-box label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.cb-preset-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.cb-preset-row:last-child {
  margin-bottom: 0;
}

.cb-preset-row input,
.cb-preset-row select {
  flex: 1;
}

.cb-preset-row button {
  width: auto;
}

.cb-generate-btn {
  width: 100%;
  margin-top: 0.7rem;
}

.cb-output-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(19, 26, 34, 0.88);
  padding: 0.7rem;
  margin-bottom: 0.75rem;
}

.cb-output-panel h3 {
  margin: 0.15rem 0 0.45rem;
  font-size: 1rem;
}

.cb-output-panel textarea {
  min-height: 170px;
}

.mc-modal-open {
  overflow: hidden;
}

.mc-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 0.9rem;
  background: rgba(6, 10, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-modal[hidden] {
  display: none;
}

.mc-modal-dialog {
  width: min(760px, 100%);
  max-height: 86vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101b28;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.mc-modal-title {
  margin: 0;
  font-size: 1rem;
}

.mc-modal-close {
  width: auto;
}

.mc-modal-body {
  padding: 0.72rem 0.8rem;
  overflow: auto;
}

.mc-modal-list {
  height: 44vh;
  max-height: 44vh;
  min-height: 260px;
}

.mc-modal-footer {
  border-top: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  display: flex;
  justify-content: flex-end;
}

.mc-modal-footer button {
  width: auto;
  min-width: 92px;
}

@media (max-width: 1024px) {
  .cb-group-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .cb-layout {
    grid-template-columns: 1fr;
  }

  .cb-output-sticky {
    position: static;
    top: auto;
  }
}

@media (max-width: 560px) {
  .cb-target-toggle {
    flex-direction: column;
  }

  .cb-preset-row {
    flex-wrap: wrap;
  }

  .mc-modal-dialog {
    max-height: 92vh;
  }

  .mc-modal-list {
    height: 52vh;
    max-height: 52vh;
    min-height: 220px;
  }
}
