/* 답변 속 화면 부품(static/js/answer_ui.js) — 차트·표·계산기·선택 단추·단계·카드·수치·퀴즈.
   색은 공용 토큰(--surface-color·--border-color·--text-color·--text-muted·--primary-color)만 쓴다 — 없는 토큰은 다크
   모드에서만 조용히 깨진다. 계열 색 여덟은 여기 한 벌(밝은·어두운). */

:root {
  --aui-c0: #2f6bff;
  --aui-c1: #f28c28;
  --aui-c2: #18a07b;
  --aui-c3: #d64f6a;
  --aui-c4: #7b5cff;
  --aui-c5: #00a3c4;
  --aui-c6: #b48a00;
  --aui-c7: #8a8f98;
  --aui-up: #13985e;
  --aui-down: #d64545;
}

[data-theme="dark"] {
  --aui-c0: #5b8cff;
  --aui-c1: #ffa552;
  --aui-c2: #3ccf9f;
  --aui-c3: #ff7a94;
  --aui-c4: #a28bff;
  --aui-c5: #3cc8e6;
  --aui-c6: #e0b83c;
  --aui-c7: #a3a8b0;
  --aui-up: #3ccf8a;
  --aui-down: #ff6b6b;
}

.aui {
  margin: 14px 0;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

.aui__title {
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.35;
}

.aui__lead {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.aui__note {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* 부품 단추는 제 크기를 스스로 정한다 — 폰 공용 규칙(button min-height 38px)이 체크 원을 타원으로 늘리지 않게. */
.aui button {
  font: inherit;
  min-height: 0;
}

/* 쓰는 중인 블록 — 반짝이는 빈 칸 */
.aui--pending {
  min-height: 96px;
  position: relative;
}

.aui__shimmer {
  position: absolute;
  inset: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text-muted) 8%, transparent) 25%,
    color-mix(in srgb, var(--text-muted) 18%, transparent) 50%,
    color-mix(in srgb, var(--text-muted) 8%, transparent) 75%);
  background-size: 200% 100%;
  animation: aui-shimmer 1.3s linear infinite;
}

@keyframes aui-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* 계열 색 */
.aui-fill.aui-c0, .aui-chart__dot.aui-c0 { fill: var(--aui-c0); background: var(--aui-c0); }
.aui-fill.aui-c1, .aui-chart__dot.aui-c1 { fill: var(--aui-c1); background: var(--aui-c1); }
.aui-fill.aui-c2, .aui-chart__dot.aui-c2 { fill: var(--aui-c2); background: var(--aui-c2); }
.aui-fill.aui-c3, .aui-chart__dot.aui-c3 { fill: var(--aui-c3); background: var(--aui-c3); }
.aui-fill.aui-c4, .aui-chart__dot.aui-c4 { fill: var(--aui-c4); background: var(--aui-c4); }
.aui-fill.aui-c5, .aui-chart__dot.aui-c5 { fill: var(--aui-c5); background: var(--aui-c5); }
.aui-fill.aui-c6, .aui-chart__dot.aui-c6 { fill: var(--aui-c6); background: var(--aui-c6); }
.aui-fill.aui-c7, .aui-chart__dot.aui-c7 { fill: var(--aui-c7); background: var(--aui-c7); }
.aui-line.aui-c0, .aui-dot.aui-c0 { stroke: var(--aui-c0); }
.aui-line.aui-c1, .aui-dot.aui-c1 { stroke: var(--aui-c1); }
.aui-line.aui-c2, .aui-dot.aui-c2 { stroke: var(--aui-c2); }
.aui-line.aui-c3, .aui-dot.aui-c3 { stroke: var(--aui-c3); }
.aui-line.aui-c4, .aui-dot.aui-c4 { stroke: var(--aui-c4); }
.aui-line.aui-c5, .aui-dot.aui-c5 { stroke: var(--aui-c5); }
.aui-line.aui-c6, .aui-dot.aui-c6 { stroke: var(--aui-c6); }
.aui-line.aui-c7, .aui-dot.aui-c7 { stroke: var(--aui-c7); }
.aui-area.aui-c0 { fill: var(--aui-c0); }
.aui-area.aui-c1 { fill: var(--aui-c1); }
.aui-area.aui-c2 { fill: var(--aui-c2); }
.aui-area.aui-c3 { fill: var(--aui-c3); }
.aui-area.aui-c4 { fill: var(--aui-c4); }
.aui-area.aui-c5 { fill: var(--aui-c5); }
.aui-area.aui-c6 { fill: var(--aui-c6); }
.aui-area.aui-c7 { fill: var(--aui-c7); }

/* 차트 */
.aui-chart {
  position: relative;
  width: 100%;
  min-height: 200px;
}

.aui-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.aui-chart__grid line {
  stroke: color-mix(in srgb, var(--text-muted) 22%, transparent);
  stroke-width: 1;
}

.aui-chart__axis {
  fill: var(--text-muted);
  font-size: 11px;
}

.aui-chart__value {
  fill: var(--text-color);
  font-size: 11px;
  font-weight: 600;
}

.aui-chart__zero {
  stroke: color-mix(in srgb, var(--text-muted) 60%, transparent);
  stroke-width: 1;
}

.aui-line {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.aui-area {
  opacity: 0.22;
}

.aui-dot {
  fill: var(--surface-color);
  stroke-width: 2;
}

.aui-fill {
  transition: opacity 0.12s ease;
}

.aui-fill:hover {
  opacity: 0.82;
}

.aui-chart__slice-label {
  fill: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}

.aui-chart__hit {
  fill: transparent;
}

.aui-chart__hit:hover {
  fill: color-mix(in srgb, var(--text-muted) 7%, transparent);
}

.aui-chart__tip {
  position: absolute;
  z-index: 3;
  min-width: 120px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--surface-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  font-size: 12.5px;
  pointer-events: none;
}

.aui-chart__tip-head {
  margin-bottom: 4px;
  font-weight: 600;
}

.aui-chart__tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.aui-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
}

.aui-chart__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-color);
  font-size: 12.5px;
  cursor: pointer;
}

.aui-chart__key[aria-pressed="false"] {
  opacity: 0.4;
}

.aui-chart__dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* 표 */
.aui-table {
  overflow-x: auto;
  max-height: 420px;
}

/* 좁은 화면의 공용 규칙(base-layout.css 의 table { display: block })이 표를 내용 폭으로 줄인다 — 가로 굴림은
   감싼 .aui-table 이 맡으니 표는 표로 둔다. */
.aui-table table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.aui-table th,
.aui-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  vertical-align: top;
}

.aui-table td.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.aui-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-color);
}

.aui-table__sort {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
}

.aui-table th[aria-sort="ascending"] .aui-table__sort::after { content: " ▲"; font-size: 10px; }
.aui-table th[aria-sort="descending"] .aui-table__sort::after { content: " ▼"; font-size: 10px; }

/* 계산기 — 큰 결과와 설명, 나눠 보이는 막대, 입력(슬라이더·증감·수·고르기), 값 목록, 복사 */
.aui-calc__headline {
  margin: 2px 0 14px;
}

.aui-calc__big {
  display: block;
  color: var(--aui-up);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.aui-calc__big.is-error {
  color: var(--text-muted);
  font-size: 15px;
}

.aui-calc__caption {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.aui-calc__breakdown {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.aui-calc__bar {
  display: flex;
  gap: 3px;
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
}

.aui-calc__bar > span {
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
  transition: flex-grow 0.25s ease;
}

.aui-calc__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 8px;
}

.aui-calc__part {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aui-calc__part:last-child:not(:first-child) {
  align-items: flex-end;
  text-align: right;
}

.aui-calc__part-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.aui-calc__part-value {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.aui-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.aui-swatch.aui-c0 { background: var(--aui-c0); }
.aui-swatch.aui-c2 { background: var(--aui-c2); }
.aui-swatch.aui-c4 { background: var(--aui-c4); }
.aui-swatch.aui-c5 { background: var(--aui-c5); }

.aui-calc__inputs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aui-calc__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aui-calc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.aui-calc__label {
  color: var(--text-muted);
  font-size: 13px;
}

.aui-calc__field.is-stepper .aui-calc__label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aui-calc__value {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aui-calc__control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-color);
  font: inherit;
  box-sizing: border-box;
}

.aui-calc__control:focus,
.aui-calc__range:focus-visible,
.aui-calc__step:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary-color) 45%, transparent);
  outline-offset: 2px;
}

/* 슬라이더 — 채운 길(--aui-fill)과 흰 손잡이 */
.aui-calc__range,
.aui-explorer__apart {
  --aui-fill: 50%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.aui-calc__range::-webkit-slider-runnable-track,
.aui-explorer__apart::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary-color) var(--aui-fill), color-mix(in srgb, var(--text-muted) 22%, transparent) var(--aui-fill));
}

.aui-calc__range::-moz-range-track,
.aui-explorer__apart::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--primary-color) var(--aui-fill), color-mix(in srgb, var(--text-muted) 22%, transparent) var(--aui-fill));
}

.aui-calc__range::-webkit-slider-thumb,
.aui-explorer__apart::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -7px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  -webkit-appearance: none;
  appearance: none;
}

.aui-calc__range::-moz-range-thumb,
.aui-explorer__apart::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--text-muted) 30%, transparent);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.aui-calc__ticks {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* 증감 단추 — 가운데 큰 수 */
.aui-calc__stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 2px;
}

.aui-calc__step {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: transparent;
  color: var(--text-color);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.aui-calc__step:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
}

.aui-calc__step:disabled {
  opacity: 0.35;
  cursor: default;
}

.aui-calc__count {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aui-calc__count strong {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.aui-calc__count span {
  color: var(--text-muted);
  font-size: 12.5px;
}

/* 나머지 결과 — 이름 왼쪽, 값 오른쪽 */
.aui-calc__outputs {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
}

.aui-calc__output {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-color);
}

.aui-calc__output:last-child {
  border-bottom: none;
}

.aui-calc__out-label {
  color: var(--text-color);
}

.aui-calc__out-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-all;
}

.aui-calc__out-value.is-error {
  color: var(--text-muted);
  font-weight: 500;
}

/* 선택 단추 — 겉 상자 없이 단추만 */
.aui--choices {
  padding: 0;
  border: none;
  background: transparent;
}

.aui-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aui-choices__btn {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-color);
  color: var(--text-color);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.aui-choices__btn:hover {
  border-color: color-mix(in srgb, var(--primary-color) 55%, var(--border-color));
  background: color-mix(in srgb, var(--primary-color) 7%, var(--surface-color));
}

.aui-choices__btn.is-picked {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* 단계 */
.aui-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aui-steps__item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 14px;
}

.aui-steps__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 2px;
  width: 2px;
  background: var(--border-color);
}

.aui-steps__num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  text-align: center;
}

.aui-steps__body {
  min-width: 0;
  padding-top: 3px;
}

.aui-steps__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.aui-steps__title {
  font-weight: 600;
}

.aui-steps__time {
  color: var(--text-muted);
  font-size: 12px;
}

.aui-steps__detail {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 13px;
}

/* 카드 */
.aui-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.aui-cards__card {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-color);
}

.aui-cards__card.has-tag {
  border-color: color-mix(in srgb, var(--primary-color) 55%, var(--border-color));
}

.aui-cards__tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary-color) 14%, transparent);
  color: var(--primary-color);
  font-size: 11.5px;
  font-weight: 600;
}

.aui-cards__title {
  font-weight: 600;
}

.aui-cards__subtitle {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.aui-cards__points {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
}

.aui-cards__points li + li {
  margin-top: 3px;
}

/* 수치 */
.aui-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.aui-stats__tile {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-color);
}

.aui-stats__label {
  color: var(--text-muted);
  font-size: 12.5px;
}

.aui-stats__value {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.aui-stats__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  font-size: 12px;
}

.aui-stats__change {
  font-weight: 600;
}

.aui-stats__change.is-up { color: var(--aui-up); }
.aui-stats__change.is-down { color: var(--aui-down); }

.aui-stats__note {
  color: var(--text-muted);
}

/* 퀴즈 */
.aui-quiz__question {
  margin-bottom: 10px;
  font-weight: 600;
}

.aui-quiz__options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aui-quiz__option {
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-color);
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
}

.aui-quiz__option:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary-color) 55%, var(--border-color));
}

.aui-quiz__option:disabled {
  cursor: default;
}

.aui-quiz__option.is-correct {
  border-color: var(--aui-up);
  background: color-mix(in srgb, var(--aui-up) 12%, var(--bg-color));
}

.aui-quiz__option.is-wrong {
  border-color: var(--aui-down);
  background: color-mix(in srgb, var(--aui-down) 10%, var(--bg-color));
}

.aui-quiz__result {
  margin-top: 10px;
  font-size: 13px;
  color: var(--aui-down);
}

.aui-quiz__result.is-correct {
  color: var(--aui-up);
}

.aui-choices__btn:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ── v2 공용 — 머리말·머리 줄·단추·칩·태그 ── */
.aui__kicker {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aui__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.aui__head .aui__title {
  margin-bottom: 0;
}

.aui__count {
  flex: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.aui-btn {
  margin-top: 14px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.aui-btn:hover {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
}

.aui-tags,
.aui-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aui-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-color);
  font-size: 12px;
  font-weight: 500;
}

.aui-chip {
  padding: 5px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-color);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.aui-chip:hover {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
}

.aui-chip.is-on {
  border-color: transparent;
  background: var(--text-color);
  color: var(--surface-color);
}

/* ── 체크리스트(단계 check) ── */
.aui--steps.is-check .aui-steps__item {
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}

.aui--steps.is-check .aui-steps__item::before {
  display: none;
}

.aui-steps__check {
  flex: none;
  width: 22px;
  height: 22px;
  aspect-ratio: 1;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 70%, transparent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.aui-steps__item.is-done .aui-steps__check {
  border-color: var(--text-color);
  background: var(--text-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

[data-theme="dark"] .aui-steps__item.is-done .aui-steps__check {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.6' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.aui-steps__item.is-done .aui-steps__title,
.aui-steps__item.is-done .aui-steps__detail,
.aui-steps__item.is-done .aui-steps__when {
  color: var(--text-muted);
  text-decoration: line-through;
}

.aui-steps__when {
  margin-bottom: 1px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ── 요약 카드 ── */
.aui-summary__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.aui-summary__text {
  margin-top: 6px;
  color: var(--text-muted);
}

.aui-summary__items {
  margin: 12px 0 0;
  padding-left: 18px;
}

.aui-summary__items li + li {
  margin-top: 6px;
}

.aui--summary .aui-tags {
  margin-top: 14px;
}

/* ── 목록(사진 썸네일) ── */
.aui-list {
  display: flex;
  flex-direction: column;
}

.aui-list__item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
}

.aui-list__item:first-child {
  border-top: none;
  padding-top: 4px;
}

.aui-list__thumb {
  position: relative;
  flex: none;
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
}

.aui-list__thumb.is-missing {
  display: none;
}

.aui-list__thumb img,
.aui-images__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: aui-fade-in 0.35s ease;
}

.aui-list__body {
  min-width: 0;
}

.aui-list__kicker {
  color: var(--text-muted);
  font-size: 12px;
}

.aui-list__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.aui-list__text {
  margin-top: 4px;
}

.aui-list__meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ── 사진(mosaic·grid) ── */
.aui--images {
  padding: 0;
  border: none;
  background: transparent;
}

.aui--images.is-empty {
  display: none;
}

.aui--images > .aui__title {
  margin-bottom: 10px;
}

/* 줄·칸은 minmax(0, …) — 세로로 긴 사진이 제 높이로 줄을 밀어 틀(300px)을 벗어나지 않게. */
.aui-images.is-mosaic {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  height: 300px;
  overflow: hidden;
  border-radius: 16px;
}

.aui-images.is-mosaic .aui-images__cell:first-child {
  grid-row: 1 / span 2;
}

.aui-images.is-mosaic.n1 {
  grid-template-columns: minmax(0, 1fr);
}

.aui-images.is-mosaic.n2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.aui-images.is-mosaic.n2 .aui-images__cell {
  grid-row: 1 / span 2;
}

.aui-images.is-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
}

.aui-images__cell {
  margin: 0;
  min-width: 0;
  min-height: 0;
}

.aui-images__cell.is-missing {
  display: none;
}

.aui-images__photo {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
}

.aui-images.is-grid .aui-images__photo {
  aspect-ratio: 3 / 4;
  height: auto;
  border-radius: 14px;
}

.aui-images__photo.is-loading {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--text-muted) 8%, transparent) 25%,
    color-mix(in srgb, var(--text-muted) 18%, transparent) 50%,
    color-mix(in srgb, var(--text-muted) 8%, transparent) 75%);
  background-size: 200% 100%;
  animation: aui-shimmer 1.3s linear infinite;
}

.aui-images figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  font-size: 13px;
}

.aui-images figcaption span {
  color: var(--text-muted);
}

.aui-images__credit {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
}

.aui-images__credit a {
  color: inherit;
}

@keyframes aui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 도해(explorer) ── */
.aui-explorer__stage {
  overflow: hidden;
  padding: 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--text-muted) 12%, var(--surface-color));
  color: color-mix(in srgb, var(--text-color) 82%, transparent);
}

/* 세로로 긴 그림(서 있는 몸)도 읽히게 — 폭에 맞추되 화면 높이의 70% 안. */
.aui-explorer__stage svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(560px, 70vh);
  overflow: visible;
}

.aui-explorer__part {
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.2s ease, color 0.2s ease;
}

.aui-explorer__part.is-dim {
  opacity: 0.18;
}

.aui-explorer__part.is-picked {
  color: var(--aui-c0);
}

.aui-explorer__apart {
  margin-top: 12px;
}

.aui--explorer .aui-chips {
  margin-top: 12px;
}

.aui-explorer__desc {
  margin-top: 14px;
}

.aui-explorer__name {
  font-weight: 700;
}

.aui-explorer__text {
  margin-top: 4px;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .aui-images.is-mosaic {
    height: 220px;
  }

  .aui-list__thumb {
    width: 76px;
    height: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aui-explorer__part,
  .aui-calc__bar > span {
    transition: none;
  }
}
