:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-strong: #eef4ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #ffffff;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(37, 99, 235, 0.22);
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --soft: #f8fafc;
  --soft-2: #f1f5f9;
  --active: #eff6ff;
  --success: #ecfdf3;
  --shadow-lg: 0 18px 48px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 6px 14px rgba(15, 23, 42, 0.03);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #fafbfc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  min-height: 100vh;
}

.workspace-pane,
.chat-pane {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.workspace-pane {
  min-height: 42vh;
  padding: 16px 16px 8px;
}

.chat-pane {
  min-height: 58vh;
  padding: 8px 16px 16px;
}

.workspace-inner,
.chat-inner {
  height: 100%;
  min-height: 0;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}

.workspace-inner {
  min-height: calc(42vh - 18px);
  padding: 22px;
  overflow: auto;
}

.chat-inner {
  min-height: calc(58vh - 18px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 2px 0;
}

.blueprint-mark {
  width: 92px;
  height: 68px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blueprint-svg {
  width: 76px;
  height: 56px;
}

.blueprint-svg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bp-grid path {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1;
}

.bp-structure path {
  stroke: rgba(71, 85, 105, 0.72);
  stroke-width: 1.6;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  opacity: 0;
  transition: stroke-dashoffset 560ms ease, opacity 320ms ease;
}

.blueprint-mark[data-stage="1"] .bp-foundation,
.blueprint-mark[data-stage="2"] .bp-foundation,
.blueprint-mark[data-stage="3"] .bp-foundation,
.blueprint-mark[data-stage="4"] .bp-foundation,
.blueprint-mark[data-stage="5"] .bp-foundation,
.blueprint-mark[data-stage="6"] .bp-foundation,
.blueprint-mark[data-stage="2"] .bp-pillars,
.blueprint-mark[data-stage="3"] .bp-pillars,
.blueprint-mark[data-stage="4"] .bp-pillars,
.blueprint-mark[data-stage="5"] .bp-pillars,
.blueprint-mark[data-stage="6"] .bp-pillars,
.blueprint-mark[data-stage="3"] .bp-walls,
.blueprint-mark[data-stage="4"] .bp-walls,
.blueprint-mark[data-stage="5"] .bp-walls,
.blueprint-mark[data-stage="6"] .bp-walls,
.blueprint-mark[data-stage="4"] .bp-roof,
.blueprint-mark[data-stage="5"] .bp-roof,
.blueprint-mark[data-stage="6"] .bp-roof,
.blueprint-mark[data-stage="5"] .bp-details,
.blueprint-mark[data-stage="6"] .bp-details,
.blueprint-mark[data-stage="6"] .bp-complete {
  stroke-dashoffset: 0;
  opacity: 1;
}

.blueprint-mark[data-stage="6"] {
  box-shadow: 0 0 0 1px rgba(31, 111, 235, 0.18), 0 10px 24px rgba(31, 111, 235, 0.08);
}

.bp-complete {
  stroke: rgba(31, 111, 235, 0.88) !important;
  stroke-width: 2.2 !important;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-header h1 {
  margin: 12px 0 8px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 760px;
}

.hero-status,
.chat-header-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.status-chip-primary {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
  color: var(--accent-strong);
}

.hero-strip {
  display: none;
}

.hero-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: none;
}

.hero-card-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.hero-card-value {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.workspace-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
}

.workspace-tab {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.workspace-tab.active {
  background: var(--panel-strong);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.workspace-view {
  display: none;
}

.workspace-view.active {
  display: block;
}

.user-summary {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-md);
}

.meta-overview {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
  box-shadow: var(--shadow-sm);
}

.meta-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.meta-pill {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}

.meta-pill-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-pill-value {
  font-size: 14px;
  font-weight: 600;
}

.user-summary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 12px;
}

.user-summary-row {
  border-bottom: 1px solid var(--line);
  padding: 14px 2px;
  background: transparent;
  box-shadow: none;
}

.user-summary-row:first-child {
  padding-top: 6px;
}

.user-summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.user-summary-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.user-summary-value {
  font-size: 14px;
  line-height: 1.6;
}

.user-summary-list {
  margin: 0;
  padding-left: 18px;
}

.summary-step-two-board {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.summary-progress-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-progress-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.48);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.summary-progress-rail {
  flex: 1;
  display: flex;
  align-items: center;
}

.summary-progress-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 23, 42, 0.24);
  background: #ffffff;
  flex: 0 0 auto;
}

.summary-progress-dot.active {
  border-color: #1f6feb;
  background: #1f6feb;
}

.summary-progress-connector {
  flex: 1;
  height: 1.5px;
  background: rgba(15, 23, 42, 0.12);
}

.summary-progress-step-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.summary-progress-step-label {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(15, 23, 42, 0.58);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
}

.summary-progress-step-label.active {
  color: #0f172a;
  background: rgba(31, 111, 235, 0.12);
  box-shadow: inset 0 0 0 1px rgba(31, 111, 235, 0.18);
}

.summary-capability-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.summary-capability-card {
  border: 1px solid rgba(46, 125, 50, 0.32);
  border-radius: 18px;
  background: #ffffff;
  padding: 16px;
  min-height: 126px;
}

.summary-capability-card.active {
  border-color: rgba(46, 125, 50, 0.72);
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.12);
}

.summary-capability-name {
  font-size: 18px;
  font-weight: 700;
  color: #16202c;
  margin-bottom: 14px;
}

.summary-capability-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-capability-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #175f8f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.user-summary-list li + li {
  margin-top: 4px;
}

.classification-summary {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
}

.graph-hints {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
}

.hint-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.hint-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

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

.hint-name {
  font-size: 15px;
  font-weight: 700;
}

.hint-segment {
  font-size: 12px;
  color: var(--muted);
}

.hint-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hint-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text);
}

.hint-block {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.stage-status {
  margin-bottom: 18px;
}

.stage-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255,255,255,0.98);
}

.stage-card-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stage-card-value {
  font-size: 18px;
  font-weight: 700;
}

.stage-card-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.progress-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.progress-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--soft);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
}

.summary-empty {
  color: var(--muted);
  line-height: 1.6;
}

.summary-empty-compact {
  margin-top: 12px;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.summary-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.summary-reason {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.category-card,
.slot-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-sm);
}

.category-card.active,
.slot-card.active {
  border-color: rgba(79, 70, 229, 0.18);
  background: var(--active);
}

.slot-card.done {
  border-color: rgba(34, 197, 94, 0.16);
  background: var(--success);
}

.slot-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.slot-value {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

.category-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.category-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chat-helper {
  padding: 14px 18px 8px;
}

.chat-helper-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.chat-helper-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-helper-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted-strong);
  font-size: 12px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.98);
}

.chat-title {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.chat-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 420px;
}

.chat-subtitle:empty {
  display: none;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.system {
  justify-content: flex-start;
}

.bubble {
  max-width: 86%;
  border-radius: 14px;
  padding: 13px 15px;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.message.user .bubble {
  background: var(--accent);
  color: #fff;
}

.message.system .bubble {
  background: rgba(255,255,255,0.92);
  color: var(--text);
  border: 1px solid var(--line);
}

.choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.choice-chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.choice-chip:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.chat-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 0 18px 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.chat-input-row:focus-within {
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06);
}

.chat-input-row textarea {
  width: 100%;
  height: 54px;
  min-height: 54px;
  max-height: 120px;
  resize: none;
  border: 0 !important;
  border-radius: 12px;
  padding: 16px 4px 14px;
  font: inherit;
  line-height: 1.45;
  color: var(--text);
  background: transparent;
  outline: none !important;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  overflow-y: auto;
}

.chat-input-row textarea:focus {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.chat-input-row textarea::placeholder {
  color: var(--muted);
}

.chat-input-row button {
  align-self: auto;
  height: 42px;
  min-height: 42px;
  min-width: 74px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.chat-input-row .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}

.chat-input-row .icon-button svg {
  width: 18px;
  height: 18px;
}

.chat-input-row .icon-button-secondary {
  background: #ffffff;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.chat-input-row .icon-button-secondary:hover {
  background: #f9fafb;
  color: #4b5563;
}

.chat-input-row .icon-button-primary {
  background: var(--accent);
  color: #fff;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
}

@media (min-width: 960px) {
  .app-shell {
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
    min-height: 100vh;
  }

  .workspace-pane,
  .chat-pane {
    min-height: 100vh;
    padding: 16px;
  }

  .workspace-pane {
    flex: 1 1 auto;
    padding-right: 10px;
  }

  .chat-pane {
    max-width: 100%;
    padding-left: 10px;
  }

  .workspace-inner,
  .chat-inner {
    min-height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-status,
  .chat-header-chips {
    display: none;
  }

  .panel-header h1 {
    font-size: 28px;
  }

  .workspace-tabs {
    margin-top: 6px;
  }

  .chat-header {
    padding-bottom: 10px;
  }
}

@media (max-width: 959px) {
  .panel-hero,
  .chat-header {
    flex-direction: column;
  }

  .hero-status,
  .chat-header-chips {
    justify-content: flex-start;
  }

  .hero-strip {
    display: none;
  }

  .workspace-pane {
    padding-bottom: 6px;
  }

  .workspace-inner,
  .chat-inner {
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  }

  .panel-header h1 {
    font-size: 28px;
  }

  .workspace-tabs {
    margin-top: 4px;
    margin-bottom: 14px;
  }

  .chat-header {
    padding: 16px 16px 10px;
    border-bottom: 0;
  }

  .chat-title {
    font-size: 20px;
    margin-top: 10px;
  }

  .chat-subtitle {
    max-width: none;
  }

  .chat-header-chips {
    display: none;
  }

  .chat-helper {
    padding: 8px 16px 6px;
  }

  .chat-helper-label {
    display: none;
  }

  .chat-helper-chip:nth-child(n+2) {
    display: none;
  }

  .chat-messages {
    padding: 14px 16px;
  }

  .chat-input-row {
    margin: 0 16px 16px;
  }
}

/* Help drawer — appended */
.help-button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border, #d4d4d8);
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  margin-left: 8px;
}
.help-button:hover { background: rgba(11, 95, 255, 0.08); border-color: #0b5fff; color: #0b5fff; }
.help-button:focus-visible { outline: 2px solid #0b5fff; outline-offset: 2px; }

.help-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: #ffffff;
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.24s ease;
}
.help-drawer[data-open="true"] { transform: translateX(0); }
.help-drawer[hidden] { display: none; }

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  gap: 8px;
}
.help-drawer-title { font-size: 13px; font-weight: 600; flex: 1; text-align: center; }
.help-drawer-link, .help-drawer-close {
  background: transparent; border: 0; cursor: pointer; font-size: 13px; color: #0b5fff; padding: 4px 8px;
}
.help-drawer-close { font-size: 20px; line-height: 1; color: #6b7280; }
.help-drawer-close:hover { color: #111; }

#help-frame {
  flex: 1;
  width: 100%;
  border: 0;
}

@media (max-width: 640px) {
  .help-drawer { width: 100vw; }
}
