@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700&display=swap');

/* AI 제작 도우미 화면 (좌측 대화 70% / 우측 미리보기 30%, 드래그로 조절) */
:root {
  --as-bg: #f6f8f4;
  --as-panel: #ffffff;
  --as-sidebar-bg: #ffffff;
  --as-sidebar-w: 236px;
  --as-sidebar-rail: 60px;
  --as-line: #e3e8e1;
  --as-input: #ffffff;
  --as-text: #20352d;
  --as-muted: #748078;
  --as-green: #2a624b;
  --as-green-deep: #20352d;
  --as-green-soft: #edf3eb;
  --as-left: 70%;
}

* { box-sizing: border-box }

html, body {
  height: 100%;
  margin: 0;
  background: var(--as-bg);
  color: var(--as-text);
  font-family: 'Noto Sans KR', system-ui, sans-serif;
  font-size: 14px
}

button { font: inherit; color: inherit; cursor: pointer }

.as-shell {
  display: flex;
  height: 100vh;
  overflow: hidden
}

body.as-dragging, body.as-dragging * { cursor: col-resize !important; user-select: none !important }

/* ── 좌측 접이식 사이드바 ─────────────── */
.as-nav-backdrop { display: none }

.as-sidebar {
  flex: 0 0 var(--as-sidebar-w);
  width: var(--as-sidebar-w);
  background: var(--as-sidebar-bg);
  border-right: 1px solid var(--as-line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s ease, flex-basis .2s ease
}

.as-sidebar-head {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border-bottom: 1px solid var(--as-line)
}

.as-nav-toggle { flex: none }
.as-sidebar-brand { white-space: nowrap; overflow: hidden }

.as-sidebar-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px
}

.as-workspace-label {
  font-size: 10px;
  font-weight: 600;
  color: #939d96;
  letter-spacing: 1.4px;
  padding: 4px 12px 10px;
  white-space: nowrap;
  transition: opacity .15s ease
}

.as-nav {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.as-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #768078;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease
}

.as-nav-item:hover { background: var(--as-green-soft); color: var(--as-green) }
.as-nav-item.active { background: var(--as-green-soft); color: var(--as-green); font-weight: 700 }

.as-nav-item:focus-visible,
.as-account-card:focus-visible,
.as-nav-toggle:focus-visible,
.as-mobile-nav-btn:focus-visible {
  outline: 2px solid var(--as-green);
  outline-offset: 2px
}

.as-nav-ico {
  flex: none;
  width: 22px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
  color: inherit
}

.as-nav-item:hover .as-nav-ico { color: var(--as-green) }

.as-sidebar-foot {
  flex: none;
  padding: 12px 10px;
  border-top: 1px solid var(--as-line)
}

.as-account-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--as-text);
  text-decoration: none;
  transition: background .15s ease
}

.as-account-card:hover { background: var(--as-green-soft) }

.as-account-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9eee4;
  color: var(--as-green);
  font-size: 14px;
  font-weight: 700
}

.as-account-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px
}

.as-account-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--as-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.as-account-sub {
  font-size: 11px;
  color: var(--as-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.as-workspace {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  height: 100%;
  overflow: hidden
}

.as-chat-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0
}

.as-icon.as-mobile-nav-btn { display: none }
.as-brand.as-chat-brand { display: none }

/* ── 좌측 대화 ─────────────────────────── */
.as-chat {
  position: relative;
  flex: 0 0 var(--as-left);
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse 65% 50% at 50% 42%, #e9eee3 0%, #f1f5ed 42%, var(--as-bg) 80%)
}

.as-shell.preview-hidden .as-chat { flex: 1 1 auto }

.as-chat-head, .as-preview-head {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px
}

.as-chat-head {
  background: #ffffffa6;
  border-bottom: 1px solid var(--as-line)
}

.as-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--as-text);
  text-decoration: none;
  font-size: 15px
}

.as-brand b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--as-green);
  color: #fff;
  font-size: 14px
}

.as-crumb {
  font-size: 14px;
  font-weight: 700;
  color: var(--as-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.as-head-actions { display: flex; gap: 6px; align-items: center; flex: none }

.as-ghost {
  border: 1px solid var(--as-line);
  background: #fff;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--as-text)
}

.as-ghost:hover { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }

.as-only-collapsed { display: none }
.as-shell.preview-hidden .as-only-collapsed { display: inline-block }

.as-chat-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0 24px
}

.as-welcome {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 28px;
  text-align: center
}

.as-spark {
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  background: conic-gradient(from 45deg, #4f8df7, #3fbf8c, #f2c14e, #e8615a, #4f8df7);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%)
}

.as-welcome h1 { margin: 0 0 10px; font-size: 32px; font-weight: 500 }
.as-welcome p { margin: 0; color: var(--as-muted) }

.as-chat.has-messages .as-welcome, .as-chat.has-messages .as-suggest { display: none }

.as-messages {
  list-style: none;
  margin: 0 auto;
  padding: 16px 0 24px;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px
}

.as-messages:empty { display: none }

.as-msg {
  max-width: 85%;
  padding: 11px 16px;
  border-radius: 18px;
  line-height: 1.6;
  word-break: break-word
}

.as-msg.user { align-self: flex-end; background: var(--as-green-soft); color: var(--as-text); border: 1px solid #d9e5d6; border-bottom-right-radius: 6px; white-space: pre-wrap }
.as-msg.ai { align-self: flex-start; width: 100%; max-width: 100%; background: transparent; padding: 11px 0; color: var(--as-text); white-space: normal }
.as-msg-text { white-space: pre-wrap; line-height: 1.6 }

.as-msg-widget { margin-top: 10px }
.as-msg-widget.is-done { opacity: .72 }

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

.as-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--as-line);
  border-radius: 18px;
  background: var(--as-panel);
  color: var(--as-text);
  font-size: 13px;
  font-weight: 500;
  transition: background .15s ease, border-color .15s ease, color .15s ease
}

.as-choice:hover:not(:disabled) { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }
.as-choice.selected { background: var(--as-green-soft); border-color: var(--as-green); color: var(--as-green); font-weight: 600 }
.as-choice.primary { background: var(--as-green); border-color: var(--as-green); color: #fff }
.as-choice.primary:hover:not(:disabled) { background: var(--as-green-deep); border-color: var(--as-green-deep); color: #fff }
.as-choice.subtle { background: transparent; border-color: transparent; color: var(--as-muted) }
.as-choice.subtle:hover:not(:disabled) { background: var(--as-green-soft); border-color: transparent; color: var(--as-green) }
.as-choice.danger { border-color: #e6c8c4; color: #a83b32; background: #fff }
.as-choice.danger:hover:not(:disabled) { background: #fdf1f0; border-color: #d99d96; color: #8c2820 }
.as-choice:disabled { opacity: .65; cursor: default }
.as-choice.selected:disabled { opacity: .9 }
.as-choice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }

.as-npc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px
}

.as-npc-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: var(--as-panel);
  color: var(--as-text);
  text-align: center;
  box-shadow: 0 2px 8px #20352d08;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease
}

.as-npc-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #bfd0be;
  background: #fafcf9;
  box-shadow: 0 6px 16px #20352d14
}
.as-npc-card.selected {
  background: var(--as-green-soft);
  border-color: var(--as-green);
  box-shadow: 0 0 0 2px #2a624b26
}
.as-npc-card:disabled { opacity: .7; cursor: default }
.as-npc-card.selected:disabled { opacity: .9 }

.as-npc-thumb {
  flex: none;
  width: 100%;
  height: 140px;
  border-radius: 0;
  background: linear-gradient(180deg, #f3f6f1 0%, #e6ede3 100%);
  color: var(--as-green);
  display: block;
  object-fit: contain;
  object-position: center bottom;
  padding: 10px 8px 0;
  border-bottom: 1px solid #edf1eb
}

span.as-npc-thumb {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 28px;
  font-weight: 700
}

.as-npc-info {
  min-width: 0;
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px
}

.as-npc-info strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--as-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%
}

.as-npc-info small {
  font-size: 11px;
  color: var(--as-muted);
  white-space: normal;
  line-height: 1.35
}

.as-summary-card {
  padding: 14px 16px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: var(--as-panel)
}

.as-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px
}

.as-summary-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px solid #f0f3ee;
  font-size: 13px;
  line-height: 1.5
}

.as-summary-row:last-child { padding-bottom: 0; border-bottom: 0 }
.as-summary-row strong, .as-summary-row b { flex: 0 0 68px; font-size: 12px; font-weight: 600; color: var(--as-muted) }
.as-summary-row span { min-width: 0; color: var(--as-text); word-break: break-word }

.as-qa-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: var(--as-panel)
}

.as-qa-item { display: flex; flex-direction: column; gap: 10px }
.as-qa-item + .as-qa-item { padding-top: 14px; border-top: 1px solid #eef1ec }
.as-qa-q { font-size: 16px; font-weight: 700; color: var(--as-text); line-height: 1.5 }
.as-qa-card .as-choice { font-size: 14px; padding: 8px 15px; line-height: 1.45 }

.as-qa-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--as-line);
  border-radius: 10px;
  background: var(--as-bg);
  color: var(--as-text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s ease, background .15s ease
}

.as-qa-input:focus { border-color: var(--as-green); background: var(--as-panel) }

.as-story-list { display: flex; flex-direction: column; gap: 10px }

.as-story-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  background: var(--as-panel);
  color: var(--as-text);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease
}

.as-story-card:hover { background: var(--as-green-soft); border-color: #cfd9cc }
.as-story-card.selected { background: var(--as-green-soft); border-color: var(--as-green); box-shadow: 0 2px 10px #2a624b14 }

.as-story-badge {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9eee4;
  color: var(--as-green);
  font-size: 11px;
  font-weight: 600
}

.as-story-title { font-size: 15px; font-weight: 700; color: var(--as-text); line-height: 1.35 }
.as-story-hook { font-size: 13px; font-weight: 500; color: var(--as-green) }
.as-story-synopsis { font-size: 13px; color: var(--as-text); line-height: 1.55 }
.as-story-meta { font-size: 12px; color: var(--as-muted); line-height: 1.45 }

.as-loading-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--as-line);
  border-radius: 12px;
  background: var(--as-panel);
  color: var(--as-muted);
  font-size: 13px
}

.as-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--as-green);
  animation: asPulse 1.1s ease-in-out infinite
}

@keyframes asPulse {
  0%, 100% { opacity: .35; transform: scale(.85) }
  50% { opacity: 1; transform: scale(1.1) }
}

.as-mission-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  padding: 14px 16px
}

.as-mission-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--as-text)
}

.as-mission-head small { font-size: 12px; font-weight: 500; color: var(--as-muted) }
.as-mission-field { display: flex; flex-direction: column; gap: 6px }
.as-mission-label { font-size: 12px; font-weight: 600; color: var(--as-text) }
.as-mission-hint { font-size: 11px; color: var(--as-muted); line-height: 1.45 }

.as-mission-input,
.as-mission-textarea,
.as-mission-select {
  width: 100%;
  border: 1px solid var(--as-line);
  border-radius: 10px;
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--as-text);
  background: #fafbf9
}

.as-mission-input:focus,
.as-mission-textarea:focus,
.as-mission-select:focus {
  outline: none;
  border-color: var(--as-green);
  background: #fff
}

.as-mission-textarea { resize: vertical; min-height: 68px; line-height: 1.5 }
.as-mission-rows { display: flex; flex-direction: column; gap: 6px }
.as-mission-row { display: flex; align-items: center; gap: 6px }
.as-mission-row .as-mission-input,
.as-mission-row .as-mission-select { flex: 1 1 0; min-width: 0 }

.as-mission-row-del {
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--as-line);
  border-radius: 8px;
  background: #fff;
  color: var(--as-muted);
  display: grid;
  place-items: center;
  font-size: 14px
}

.as-mission-row-del:hover { background: #fdf1f0; border-color: #e6c8c4; color: #a83b32 }

.as-mission-more {
  border: 1px solid var(--as-line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f9fbf8
}

.as-mission-more summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--as-green)
}

.as-mission-more[open] summary { margin-bottom: 10px }
.as-mission-more .as-mission-field + .as-mission-field { margin-top: 10px }

/* 입력창 */
.as-composer {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto 12px;
  background: var(--as-input);
  border: 1px solid var(--as-line);
  border-radius: 26px;
  padding: 8px 10px 8px 20px;
  box-shadow: 0 2px 10px #20352d0a
}

.as-composer:focus-within { border-color: var(--as-green); box-shadow: 0 4px 16px #2a624b14 }

.as-composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  max-height: 200px;
  border: 0;
  outline: 0;
  padding: 6px 0 7px;
  resize: none;
  overflow-y: hidden;
  background: transparent;
  color: var(--as-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5
}

.as-composer textarea::placeholder { color: #939d96 }

.as-composer-bar { flex: none; display: flex; align-items: center; gap: 6px; margin-top: 0 }
.as-spacer { display: none }

.as-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--as-muted);
  font-size: 18px
}

.as-icon:hover { background: var(--as-green-soft); color: var(--as-green) }

.as-model {
  border: 0;
  background: transparent;
  border-radius: 16px;
  padding: 6px 10px;
  color: var(--as-muted);
  font-size: 13px
}

.as-model:hover { background: var(--as-green-soft); color: var(--as-green) }
.as-model i { font-style: normal; font-size: 10px; margin-left: 3px }

.as-send {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--as-green);
  color: #fff
}

.as-send:hover:not(:disabled) { background: var(--as-green-deep) }

.as-send:disabled { background: #e3e8e1; color: #9aa59d; cursor: default }

.as-suggest {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 24px 28px
}

.as-suggest button {
  border: 1px solid var(--as-line);
  background: #fff;
  border-radius: 18px;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--as-text)
}

.as-suggest button:hover { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }

/* ── 크기 조절 바 ─────────────────────── */
.as-splitter {
  flex: 0 0 8px;
  position: relative;
  cursor: col-resize;
  background: var(--as-bg);
  outline: none;
  touch-action: none
}

.as-splitter span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--as-line);
  transition: background .15s
}

.as-splitter::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 1px;
  width: 6px;
  height: 40px;
  margin-top: -20px;
  border-radius: 3px;
  background: #c7d1c5;
  transition: background .15s
}

.as-splitter:hover span, .as-splitter:focus-visible span, body.as-dragging .as-splitter span { background: var(--as-green) }
.as-splitter:hover::after, .as-splitter:focus-visible::after, body.as-dragging .as-splitter::after { background: var(--as-green) }

.as-shell.preview-hidden .as-splitter, .as-shell.preview-hidden .as-preview { display: none }

/* ── 우측 미리보기 ───────────────────── */
.as-preview {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--as-panel)
}

.as-preview-head { border-bottom: 1px solid var(--as-line); color: var(--as-text); font-size: 14px }
.as-preview-head-left { display: flex; align-items: center; gap: 8px; min-width: 0 }

.as-pv-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--as-green-soft);
  color: var(--as-green);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap
}

.as-pv-status:empty { display: none }

.as-preview-body {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  padding: 20px
}

.as-preview-empty {
  margin: auto;
  text-align: center;
  color: var(--as-muted);
  line-height: 1.7
}

.as-preview-frame {
  width: 150px;
  height: 260px;
  margin: 0 auto 18px;
  border: 2px solid #d7dfd4;
  border-radius: 22px;
  padding: 26px 16px;
  background: #f7f8f5;
  display: flex;
  flex-direction: column;
  gap: 10px
}

.as-preview-frame i { display: block; height: 10px; border-radius: 5px; background: #e3e8e1 }
.as-preview-frame i:first-child { height: 90px; border-radius: 10px }
.as-preview-frame i:last-child { width: 60% }

.as-pv-wrap {
  width: 100%;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.as-pv-progress { display: flex; flex-direction: column; gap: 6px }

.as-pv-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--as-muted)
}

.as-pv-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--as-line);
  overflow: hidden
}

.as-pv-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--as-green);
  transition: width .2s ease
}

.as-pv-cover {
  position: relative;
  min-height: 132px;
  border: 1px solid var(--as-line);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a624b 0%, #20352d 100%);
  display: flex;
  align-items: flex-end
}

.as-pv-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover
}

.as-pv-cover-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, #20352d1a 0%, #20352dcc 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px
}

.as-pv-badges { display: flex; flex-wrap: wrap; gap: 6px }

.as-pv-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: #ffffff29;
  color: #fff;
  font-size: 11px;
  font-weight: 500
}

.as-pv-cover-title { font-size: 15px; font-weight: 700; line-height: 1.35; color: #fff }
.as-pv-cover-place { font-size: 12px; color: #e9eee4 }

.as-pv-section { display: flex; flex-direction: column; gap: 8px }
.as-pv-section-head { font-size: 12px; font-weight: 600; color: var(--as-muted); letter-spacing: .2px }

.as-pv-npc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--as-line);
  border-radius: 12px;
  background: var(--as-bg)
}

.as-pv-npc-img {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e9eee4;
  color: var(--as-green);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700
}

.as-pv-npc-info { min-width: 0; display: flex; flex-direction: column; gap: 2px }
.as-pv-npc-info strong { font-size: 13px; font-weight: 600; color: var(--as-text) }
.as-pv-npc-info small { font-size: 11px; color: var(--as-muted) }

.as-pv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px
}

.as-pv-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--as-line);
  border-radius: 10px;
  background: var(--as-bg);
  text-align: left;
  transition: background .15s ease, border-color .15s ease
}

.as-pv-item:hover { background: var(--as-green-soft); border-color: #cfd9cc }
.as-pv-label { font-size: 11px; font-weight: 600; color: var(--as-muted) }
.as-pv-val { font-size: 12px; font-weight: 500; color: var(--as-text); line-height: 1.4; word-break: break-word }
.as-pv-val.is-empty { color: #939d96; font-weight: 400 }

.as-pv-story {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--as-line);
  border-radius: 12px;
  background: var(--as-bg);
  font-size: 13px;
  color: var(--as-text);
  line-height: 1.55
}

.as-pv-page {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--as-line);
  border-radius: 8px;
  background: var(--as-panel);
  font-size: 12px;
  line-height: 1.5
}

.as-pv-page-tag {
  align-self: flex-start;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--as-green-soft);
  color: var(--as-green);
  font-size: 10px;
  font-weight: 600
}

.as-pv-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap
}

.as-pv-section-btns { display: flex; align-items: center; gap: 6px }

.as-pv-mini-btn {
  border: 1px solid var(--as-line);
  background: #fff;
  color: var(--as-text);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  transition: .15s
}

.as-pv-mini-btn:hover { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }
.as-pv-mini-btn.primary { background: var(--as-green); border-color: var(--as-green); color: #fff }
.as-pv-mini-btn.primary:hover { background: var(--as-green-deep); border-color: var(--as-green-deep); color: #fff }

.as-pv-empty-note {
  padding: 12px;
  border: 1px dashed var(--as-line);
  border-radius: 12px;
  background: #fafbf9;
  font-size: 12px;
  color: var(--as-muted);
  text-align: center;
  line-height: 1.5
}

.as-pv-mission-list { display: flex; flex-direction: column; gap: 8px }

.as-pv-mission {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid var(--as-line);
  border-radius: 12px;
  background: #fff
}

.as-pv-mission-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }

.as-pv-mission-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--as-green);
  background: var(--as-green-soft);
  padding: 2px 7px;
  border-radius: 8px
}

.as-pv-mission-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--as-muted);
  background: #f3f5f1;
  padding: 2px 7px;
  border-radius: 8px
}

.as-pv-mission-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--as-text);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.as-pv-mission-q { font-size: 12px; color: var(--as-text); line-height: 1.5; word-break: break-word }
.as-pv-mission-meta { font-size: 11px; color: var(--as-muted); line-height: 1.4; word-break: break-word }
.as-pv-mission-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-top: 2px }

.as-pv-tool {
  border: 1px solid var(--as-line);
  background: #fafbf9;
  color: var(--as-text);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600
}

.as-pv-tool:hover:not(:disabled) { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }
.as-pv-tool:disabled { opacity: .45; cursor: default }
.as-pv-tool.danger { color: #a83b32 }
.as-pv-tool.danger:hover:not(:disabled) { background: #fdf1f0; border-color: #e6c8c4; color: #8c2820 }

.as-pv-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px }

.as-pv-btn {
  flex: 1 1 auto;
  padding: 9px 12px;
  border: 1px solid var(--as-line);
  border-radius: 10px;
  background: var(--as-panel);
  color: var(--as-text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease
}

.as-pv-btn:hover { background: var(--as-green-soft); border-color: #cfd9cc; color: var(--as-green) }
.as-pv-btn.primary { background: var(--as-green); border-color: var(--as-green); color: #fff }
.as-pv-btn.primary:hover { background: var(--as-green-deep); border-color: var(--as-green-deep); color: #fff }

.as-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 20px;
  background: var(--as-text);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .2s
}

.as-toast.show { opacity: 1; transform: translate(-50%, 0) }

/* 데스크톱 접힘 상태 (모바일 드로어와 분리) */
@media (min-width: 768px) {
  .as-shell.nav-collapsed .as-sidebar {
    flex-basis: var(--as-sidebar-rail);
    width: var(--as-sidebar-rail)
  }
  .as-shell.nav-collapsed .as-sidebar-head { justify-content: center; padding: 0 }
  .as-shell.nav-collapsed .as-brand.as-sidebar-brand { display: none }
  .as-shell.nav-collapsed .as-brand.as-chat-brand { display: flex }
  .as-shell.nav-collapsed .as-sidebar-scroll { padding: 10px 0 }
  .as-shell.nav-collapsed .as-workspace-label {
    height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden
  }
  .as-shell.nav-collapsed .as-nav { align-items: center; gap: 6px }
  .as-shell.nav-collapsed .as-nav-item {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center
  }
  .as-shell.nav-collapsed .as-nav-txt { display: none }
  .as-shell.nav-collapsed .as-sidebar-foot {
    padding: 12px 0;
    display: flex;
    justify-content: center
  }
  .as-shell.nav-collapsed .as-account-card { padding: 4px; justify-content: center }
  .as-shell.nav-collapsed .as-account-meta { display: none }
}

/* 좁은 화면(모바일)에서는 위아래로 쌓고 드래그 조절은 숨김 */
@media (max-width: 767px) {
  .as-shell { flex-direction: column; height: auto; min-height: 100vh; overflow: visible }
  .as-workspace { flex-direction: column; height: auto; min-height: 100vh; overflow: visible }
  .as-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    max-width: 82vw;
    height: 100vh;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 12px 0 32px #20352d24
  }
  .as-shell.nav-mobile-open .as-sidebar { transform: translateX(0) }
  .as-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: #20352d4d;
    opacity: 0;
    transition: opacity .2s ease
  }
  .as-shell.nav-mobile-open .as-nav-backdrop { display: block; opacity: 1 }
  .as-icon.as-mobile-nav-btn { display: grid }
  .as-brand.as-chat-brand { display: flex }
  .as-crumb { display: none }
  .as-chat-head { padding: 0 12px; gap: 8px }
  .as-chat { flex: none; min-height: 100vh }
  .as-splitter { display: none }
  .as-preview { flex: none; min-height: 60vh }
  .as-welcome h1 { font-size: 24px }
  .as-npc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .as-npc-thumb { height: 120px }
}

@media (prefers-reduced-motion: reduce) {
  .as-sidebar, .as-nav-backdrop, .as-workspace-label, .as-pv-progress-fill, .as-npc-card { transition: none }
  .as-loading-dot { animation: none }
}
