/* ── 설정 · 페르소나 CRUD ── */

.persona-admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 16px;
}

.persona-admin-subtab {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
}

.persona-admin-subtab.active {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: transparent;
}

.persona-admin-panel h4 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.pa-section {
  margin-bottom: 28px;
}

.pa-section h4 {
  margin-top: 0;
}

.pa-time-help {
  max-width: 720px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.pa-table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--card, #fff);
}

.pa-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.pa-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.pa-data-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.pa-data-table tbody tr:nth-child(even) {
  background: #fafbfc;
}

.pa-data-table tbody tr:hover {
  background: #f0fdf4;
}

.pa-data-table tbody tr.pa-row-deleted {
  opacity: 0.4;
}

.pa-empty {
  text-align: center;
  padding: 20px !important;
}

.pa-th--act,
.pa-td--act {
  width: 1%;
  white-space: nowrap;
}

.pa-th--xs,
.pa-td .pa-inp--xs {
  max-width: 56px;
}

.pa-th--sm,
.pa-td .pa-inp--sm {
  max-width: 120px;
}

.pa-inp {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  background: transparent;
}

.pa-inp:focus {
  border-color: var(--accent, #2563eb);
  background: #fff;
  outline: none;
}

.pa-inp-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.pa-inp--select {
  cursor: pointer;
  padding-right: 24px;
}

.pa-inp--num {
  max-width: 88px;
  text-align: center;
  -moz-appearance: textfield;
}

.pa-inp--num::-webkit-outer-spin-button,
.pa-inp--num::-webkit-inner-spin-button {
  opacity: 1;
  height: 28px;
}

.pa-td--muted {
  color: var(--muted, #64748b);
  font-size: 12px;
  max-width: 200px;
}

.pa-table--formula .pa-data-table tbody td {
  vertical-align: top;
}

.pa-cell-text {
  display: block;
  white-space: normal;
  line-height: 1.45;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.pa-td--group {
  width: 108px;
  white-space: nowrap;
}

.pa-td--group .pa-cell-text {
  font-weight: 600;
  color: #334155;
}

.pa-td--val .pa-cell-text {
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0f766e;
}

.pa-td--wrap .pa-cell-wrap {
  white-space: normal;
  line-height: 1.5;
  color: var(--muted, #64748b);
  font-size: 12px;
  min-width: 200px;
}

.pa-table--formula .pa-th:nth-child(3),
.pa-table--formula .pa-td--wrap {
  min-width: min(420px, 45vw);
}

.pa-table-wrap .pa-add {
  margin: 8px 12px 10px;
}

.pa-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pa-modal.hidden {
  display: none;
}

.pa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.pa-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--card, #fff);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 0;
}

.pa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.pa-modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.pa-modal-x {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted, #64748b);
}

.pa-modal-fields {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pa-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.pa-modal-field > span {
  font-weight: 600;
  color: #475569;
  font-size: 12px;
}

.pa-modal-field--check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.pa-modal-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}

.pa-modal-input--json {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.pa-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.pa-table input.pa-cell,
.pa-table select {
  width: 100%;
  min-width: 72px;
  font-size: 12px;
}

.pa-wide .pa-table input.pa-cell {
  min-width: 100px;
}

.pa-matrix-nav {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.persona-map-wrap {
  margin: 12px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  width: 100%;
}

.persona-map-wrap--svg-fallback {
  align-items: center;
}

.persona-map-wrap--svg-fallback .persona-mini-map {
  max-width: 100%;
  width: 100%;
}

.persona-map-wrap--leaflet {
  max-width: min(560px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.persona-map-leaflet-host {
  width: 100%;
  height: 340px;
  min-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  background: #e2e8f0;
  z-index: 0;
}

/* Leaflet 기본 .leaflet-container { height:100% } 가 부모 높이 없을 때 0px 로 접히는 것 방지 */
.persona-map-leaflet-host.leaflet-container {
  height: 340px;
  min-height: 280px;
}

.persona-map-leaflet-host .leaflet-control-attribution {
  font-size: 10px;
}

.pm-leaflet-tip {
  font-size: 12px;
  font-weight: 600;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.persona-map-fallback-note {
  font-size: 11px;
  text-align: center;
  margin: 6px 0 0;
}

.persona-mini-map {
  width: 100%;
  max-width: 280px;
  height: auto;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
}

.pm-region.pm-click {
  cursor: pointer;
}

.pm-region.pm-click:hover {
  filter: brightness(0.95);
}

.pm-airport {
  fill: #ef4444;
  stroke: #fff;
  stroke-width: 1;
}

.pm-lodging {
  fill: #dc2626;
  stroke: #fff;
  stroke-width: 1;
}

.pm-pin-label {
  font-size: 9px;
  fill: #475569;
}

.persona-result-badges {
  font-size: 14px;
  color: var(--muted, #64748b);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* ── 여행 시작 · 페르소나 결정 ── */

body.trip-open {
  overflow: hidden;
}

body.trip-open .topbar {
  display: none;
}

.trip-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.trip-panel.active {
  display: flex;
}

.trip-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 44px;
}

.trip-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.trip-back-btn:hover {
  background: var(--green-light);
  border-color: var(--green);
}

.trip-title-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.trip-subtabs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: none;
  background: transparent;
}

.trip-subtabs::-webkit-scrollbar {
  display: none;
}

.trip-subtab {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.trip-subtab.active {
  background: var(--green);
  color: #fff;
  border-color: transparent;
}

.trip-dev-tuning-btn {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  background: #fffbeb;
  font-size: 12px;
  cursor: pointer;
}

.trip-dev-tuning-btn:hover {
  border-color: var(--green);
  background: var(--green-light);
}

@media (max-width: 520px) {
  .trip-back-text {
    display: none;
  }

  .trip-back-btn {
    padding: 6px 8px;
  }

  .trip-subtab {
    padding: 6px 10px;
    font-size: 11px;
  }
}

.tsm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  font-size: 13px;
}

.tsm-toolbar select {
  margin-left: 4px;
  padding: 4px 8px;
}

.tsm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.tsm-import-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}

.trip-settings {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.trip-settings-intro {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin: 0 0 12px;
  line-height: 1.5;
}

.trip-settings-subtabs {
  margin-bottom: 12px;
}

.trip-settings-embed {
  width: 100%;
}

body.trip-settings-open #tripMatrixPanel.trip-settings-embed,
body.trip-settings-open #tripTypesPanel.trip-settings-embed {
  max-width: none;
  width: 100%;
  padding: 0 0 16px;
}

body.trip-settings-open #tripMatrixPanel .tsm-scroll {
  max-height: calc(100vh - 280px);
}

.trip-settings-redirect {
  max-width: 520px;
  padding: 24px;
}

/* 매트릭스 — 전체 너비 테이블 (구 hash 호환) */
body.trip-matrix-open .persona-flow#tripMatrixPanel {
  max-width: none;
  width: 100%;
  padding: 12px 16px 24px;
}

#tripMatrixPanel .tsm-scroll {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--card, #fff);
}

#tripMatrixPanel .tsm-table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

#tripMatrixPanel .tsm-table thead th {
  position: sticky;
  z-index: 2;
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #cbd5e1;
  white-space: nowrap;
}

#tripMatrixPanel .tsm-table thead tr.tsm-head-labels th {
  top: 0;
  z-index: 3;
  border-bottom: none;
}

#tripMatrixPanel .tsm-table thead tr.tsm-head-filters th {
  top: 33px;
  z-index: 3;
  background: #e2e8f0;
  font-weight: 400;
  padding: 4px;
  border-bottom: 2px solid #cbd5e1;
}

#tripMatrixPanel .tsm-hfilter {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: 11px;
  padding: 4px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: #334155;
}

#tripMatrixPanel .tsm-hfilter:focus {
  outline: 2px solid #93c5fd;
  border-color: #93c5fd;
}

#tripMatrixPanel .tsm-hfilter-text {
  min-width: 0;
}

#tripMatrixPanel .tsm-filter-reset:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 페르소나 유형 (층2) */
body.trip-types-open .persona-flow#tripTypesPanel,
body.trip-settings-open #tripTypesPanel.trip-settings-embed {
  max-width: none;
  width: 100%;
  padding: 12px 16px 24px;
}

.persona-type-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #93c5fd;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 16px;
}

.persona-type-badge,
.pt-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 8px;
}

.persona-type-meta,
.pt-meta-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pt-meta-tag {
  display: inline-block;
  font-size: 11px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
}

.persona-id-label {
  font-size: 11px;
  margin: 8px 0 4px;
}

.pt-simulator {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.pt-flow-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 10px 0 6px;
  font-size: 12px;
}

.pt-flow-step {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.pt-flow-step.pt-flow-type {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.pt-flow-step.pt-flow-out {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
  font-weight: 600;
}

.pt-flow-id {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.85;
}

.pt-flow-arrow {
  color: #94a3b8;
  font-size: 11px;
}

.pt-flow-note {
  font-size: 11px;
  margin: 0 0 4px;
  line-height: 1.45;
}

.pt-sim-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: end;
  margin-top: 12px;
}

.pt-sim-q {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
}

.pt-sim-q select {
  min-width: 132px;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.pt-sim-qid {
  display: inline-block;
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  margin-right: 2px;
}

.pt-sim-q.pt-sim-adj .pt-sim-qid {
  background: #f1f5f9;
  color: #94a3b8;
}

.pt-sim-sub {
  margin-top: 6px;
  font-size: 11px;
}

.pt-sim-adj-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pt-adj-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
}

.pt-sim-grid .hidden {
  display: none;
}

.pt-sim-result {
  margin-top: 12px;
}

.pt-sim-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px;
}

.pt-scroll {
  overflow: auto;
  max-height: calc(100vh - 320px);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.pt-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 12px;
}

.pt-table th,
.pt-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.pt-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
}

.pt-table tbody tr.pt-row-highlight {
  background: #eff6ff;
}

.pt-code {
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.pt-notes {
  font-size: 11px;
  color: #64748b;
  max-width: 160px;
}

.pt-sim-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pt-sim-card-compact {
  flex: 1 1 140px;
  padding: 10px 12px;
}

.pt-match-count {
  font-size: 11px;
  margin-left: 6px;
}

.pt-table tbody tr.pt-row-dim {
  opacity: 0.35;
}

/* 페르소나 유형 편집기 */
.pt-edit-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 12px;
}

.pt-edit-list-wrap {
  overflow-x: auto;
  padding-bottom: 24px;
}

.pt-edit-list-header,
.pt-edit-row {
  display: grid;
  grid-template-columns: 52px minmax(96px, 1.1fr) minmax(112px, 1fr) minmax(112px, 1fr) 44px 48px 88px;
  gap: 8px;
  align-items: center;
  min-width: 720px;
}

.pt-edit-list-header {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: -0.02em;
}

.pt-edit-list-header span:last-child {
  text-align: right;
}

.pt-edit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.pt-edit-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 6px 10px;
}

.pt-edit-card.pt-deleted {
  opacity: 0.45;
  background: #fef2f2;
}

.pt-edit-card.pt-row-highlight {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px #dbeafe;
}

.pt-edit-card.pt-row-dim {
  opacity: 0.4;
}

.pt-edit-row .pt-inp {
  width: 100%;
  min-width: 0;
}

.pt-edit-row .pt-code {
  text-align: center;
  font-weight: 600;
  padding-inline: 4px;
}

.pt-edit-row .pt-sort {
  text-align: center;
  padding-inline: 4px;
}

.pt-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.pt-btn-compact {
  padding: 4px 8px !important;
  font-size: 11px !important;
  min-height: 0 !important;
  line-height: 1.2;
}

.pt-edit-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.pt-section {
  margin-bottom: 16px;
}

.pt-section h5 {
  margin: 0 0 8px;
  font-size: 13px;
}

.pt-inp {
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
}

.pt-inp:focus {
  outline: 2px solid #93c5fd;
  border-color: #93c5fd;
}

.pt-kv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 8px;
}

.pt-kv-table th,
.pt-kv-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.pt-kv-table .pt-inp {
  width: 100%;
}

.pt-btn-text {
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
}

.pt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.pt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  cursor: pointer;
  background: #f8fafc;
}

.pt-chip.on {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.pt-chip input {
  margin: 0;
}

.pt-rule-label {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.pt-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  font-size: 12px;
}

.pt-notes-block {
  display: block;
  font-size: 12px;
}

.pt-notes {
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
}

.pt-active-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
  margin: 0;
}

#ptStatus.error {
  color: #b91c1c;
}

#tripMatrixPanel .tsm-table tbody td {
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

#tripMatrixPanel .tsm-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#tripMatrixPanel .tsm-table tbody tr:hover {
  background: #eff6ff;
}

#tripMatrixPanel .tsm-table tbody tr.tsm-row-deleted {
  opacity: 0.4;
  background: #fef2f2;
}

#tripMatrixPanel .tsm-cell {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  padding: 7px 6px;
  font-size: 12px;
  line-height: 1.3;
}

#tripMatrixPanel .tsm-cell:focus {
  outline: 2px solid #93c5fd;
  background: #fff;
}

#tripMatrixPanel .tsm-readonly {
  display: block;
  padding: 7px 6px;
  color: #64748b;
}

#tripMatrixPanel .col-id { width: 44px; }
#tripMatrixPanel .col-nights { width: 52px; }
#tripMatrixPanel .col-first { width: 64px; }
#tripMatrixPanel .col-transport { width: 72px; }
#tripMatrixPanel .col-companion { width: 96px; }
#tripMatrixPanel .col-age { width: 64px; }
#tripMatrixPanel .col-kid { width: 52px; }
#tripMatrixPanel .col-num { width: 44px; }
#tripMatrixPanel .col-opt { width: 120px; }
#tripMatrixPanel .col-rules { width: 180px; }
#tripMatrixPanel .col-act { width: 52px; text-align: center; }

#tripMatrixPanel .tsm-del {
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 11px;
  cursor: pointer;
  padding: 4px;
}

#tsmStatus.error {
  color: #b91c1c;
}

.trip-entry-btn {
  color: #2563eb;
}

.trip-entry-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.persona-flow {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.persona-flow.persona-flow--wide {
  max-width: min(1560px, calc(100vw - 20px));
}

.persona-step {
  animation: personaFade .25s ease;
}

@keyframes personaFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.persona-echo {
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--green-light);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: #166534;
}

.persona-echo strong {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

.persona-step-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.persona-q {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
}

.persona-sub {
  margin: -8px 0 16px;
  font-size: 13px;
  color: var(--muted);
}

/* Q6 여행 스피드 — 시작·종료·밀도 */
.pj-pace-section {
  margin: 18px 0;
}

.pj-pace-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text, #0f172a);
}

.pj-pace-apply-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.persona-step--pace .persona-opt--pace .persona-opt-title {
  font-size: 13px;
}

.persona-pace-day-tabs {
  margin: 12px 0 4px;
}

/* (legacy) 출발 × 밀도 매트릭스 */
.pj-matrix {
  display: grid;
  grid-template-columns: auto 1fr 1fr 1fr;
  gap: 8px;
  margin: 8px 0 20px;
  max-width: 100%;
}

.pj-matrix-col-label {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  padding: 4px 2px;
}

.pj-matrix-row-label {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  padding-right: 6px;
  min-width: 52px;
}

.pj-matrix-cell {
  background: var(--card, #fff);
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
  min-height: 72px;
}

.pj-matrix-cell:hover {
  border-color: var(--accent, #2563eb);
}

.pj-matrix-cell.selected {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
}

.pj-matrix-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.pj-matrix-text {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text, #0f172a);
}

.pj-matrix-hint {
  font-size: 10px;
  color: var(--muted, #64748b);
  line-height: 1.25;
}

@media (max-width: 400px) {
  .pj-matrix {
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 5px;
  }
  .pj-matrix-cell {
    padding: 8px 4px;
    min-height: 64px;
  }
  .pj-matrix-hint {
    display: none;
  }
}

.persona-field {
  margin-bottom: 14px;
}

.persona-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.persona-field input[type="date"],
.persona-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 15px;
  background: var(--card);
}

.persona-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.persona-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.persona-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.persona-opt:hover {
  border-color: var(--green);
}

.persona-opt.selected {
  border-color: var(--green);
  background: var(--green-light);
}

.persona-opt input {
  margin-top: 3px;
  accent-color: var(--green);
}

.persona-opt-body {
  flex: 1;
}

.persona-opt-title {
  font-size: 15px;
  font-weight: 600;
}

.persona-opt-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.persona-opt-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
}

.persona-card {
  padding: 16px;
  border: 2px solid var(--green);
  border-radius: 14px;
  background: var(--card);
  margin-bottom: 12px;
}

.persona-card-layout {
  display: grid;
  grid-template-columns: 1fr min(140px, 38%);
  gap: 12px;
  align-items: start;
}

.persona-card-cover {
  width: 100%;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg);
}

.persona-card-lead {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 12px;
}

.persona-card-days {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.persona-card-day {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.persona-card-day strong {
  color: var(--green-dark);
}

.persona-region-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.persona-region-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  cursor: pointer;
}

.persona-region-chip.selected {
  border-color: var(--green);
  background: var(--green-light);
}

.persona-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.persona-btn {
  padding: 14px 16px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.persona-btn-primary {
  background: var(--green);
  color: #fff;
}

.persona-btn-primary:hover {
  background: var(--green-dark);
}

.persona-btn-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.persona-btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border-dark);
}

.persona-btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px;
}

.persona-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
}

.persona-progress-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}

.persona-progress-dot.done {
  background: var(--green);
}

.persona-progress-dot.current {
  background: var(--green-dark);
}

.persona-result-id {
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 14px;
  padding: 12px;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  word-break: break-all;
  margin: 12px 0;
}

.persona-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}

.persona-result-table th,
.persona-result-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.persona-result-table th {
  width: 38%;
  color: var(--muted);
  font-weight: 500;
}

.persona-warn {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  line-height: 1.45;
}

.persona-warn-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.persona-start-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .persona-start-grid {
    grid-template-columns: 1fr;
  }
}

.persona-start-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface, #fff);
  text-align: left;
  cursor: pointer;
}

.persona-start-card:hover,
.persona-start-card.selected {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 0 0 1px var(--accent, #2563eb);
}

.persona-feedback-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.persona-feedback-stars {
  display: flex;
  gap: 4px;
  margin: 8px 0 12px;
}

.persona-star {
  font-size: 22px;
  line-height: 1;
  border: none;
  background: none;
  cursor: pointer;
  color: #d1d5db;
}

.persona-star.active {
  color: #f59e0b;
}

.persona-feedback-comment {
  width: 100%;
  margin: 8px 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  resize: vertical;
}

.persona-quick {
  max-width: 520px;
  margin: 0 auto;
}

.persona-flow:has(.persona-step--q3),
.persona-flow:has(.persona-step--lodging),
.persona-flow:has(.persona-step--q8) {
  max-width: 640px;
}

.persona-q3-layout {
  display: grid;
  grid-template-columns: 1fr minmax(148px, 200px);
  gap: 16px 20px;
  align-items: start;
  margin-bottom: 8px;
}

.persona-q3-section-label {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.persona-q3-main .persona-q3-section-label:first-child {
  margin-top: 0;
}

.persona-q3-side {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.persona-q3-side label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.persona-q3-side-hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.persona-q3-side select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  font-size: 15px;
  background: var(--card);
}

@media (max-width: 560px) {
  .persona-q3-layout {
    grid-template-columns: 1fr;
  }
  .persona-q3-side {
    order: -1;
  }
}

.persona-lodging-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--border-dark);
  background: rgba(255, 255, 255, 0.6);
}

.persona-q8-bridge {
  margin-top: -4px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f9ff;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
}

.persona-field-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
