/* 값은 여기 한 곳에 둔다. 폭 5단계는 조직 RESPONSIVE 그대로다. */
:root {
  color-scheme: light dark;
  --wrap: 100%;
  --gutter: 16px;
  --bg: #f8f6fd;
  --surface: #ffffff;
  --ink: #241a4d;
  --muted: #5f5a7d;
  --line: #e4def2;
  --accent: #5b3df5;
  --accent-ink: #ffffff;
  --radius: 16px;
  --display: Jua, Pretendard, "Apple SD Gothic Neo", sans-serif;
  --font: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14122a;
    --surface: #1f1c3a;
    --ink: #ecebf8;
    --muted: #aca8c8;
    --line: #38335c;
    --accent: #b3a2ff;
    --accent-ink: #14122a;
  }
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --wrap: 1160px; --gutter: 32px; } }
@media (min-width: 1440px) { :root { --wrap: 1400px; } }
@media (min-width: 1920px) { :root { --wrap: 1760px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  word-break: keep-all;
  overflow-wrap: break-word;
}
p, li, td { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
main { flex: 1; width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); font-size: 14px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--surface); padding: 8px 12px; z-index: 1; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 56px; gap: 0 16px; }
.logo { color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav-link { color: var(--muted); font-size: 14px; text-decoration: none; margin-right: auto; white-space: nowrap; }
.top-nav { display: flex; align-items: center; gap: 12px; font-size: 14px; white-space: nowrap; }
.top-nav a { color: var(--muted); text-decoration: none; padding: 8px 0; }
.bp { border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 11px; line-height: 1; padding: 3px 5px; }
.bp::after { content: "S"; }
@media (min-width: 640px) { .bp::after { content: "M"; } }
@media (min-width: 1024px) { .bp::after { content: "L"; } }
@media (min-width: 1440px) { .bp::after { content: "XL"; } }
@media (min-width: 1920px) { .bp::after { content: "2XL"; } }

.hero { padding: 64px 0 40px; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); letter-spacing: -0.01em; }
.hero p { margin: 16px 0 0; color: var(--muted); font-size: 18px; }
.hero .muted { font-size: 14px; }
.hero .badge { display: inline-block; margin-top: 24px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn-small { padding: 7px 14px; font-size: 14px; }
.top-nav a.btn { color: var(--accent-ink); padding: 7px 14px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; min-height: 44px; padding: 0; }
.btn-submit { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; color: var(--ink); }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.btn-quiet { background: transparent; color: var(--ink); border: 1px solid var(--line); }

section > h2 { font-size: 20px; }
.cards { list-style: none; margin: 16px 0 64px; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { font-size: 17px; }
.card p { margin: 8px 0 0; color: var(--muted); }

.foot { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 13px; }
.foot p { margin: 2px 0; }
.foot a { color: inherit; white-space: nowrap; }

.modal { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 20px; max-width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 0, 0, .4); }
.modal p { margin: 0 0 16px; }
.modal .actions { justify-content: flex-end; }
.name-modal { width: min(420px, calc(100vw - 32px)); }
.name-modal h2 { margin: 0 0 8px; font-size: 18px; }
.sr { position: absolute; left: -9999px; }
.page { padding: 32px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 26px; }
.page .card h2 { font-size: 17px; }
.page .card a { color: var(--ink); text-decoration: none; }
.page .card a:hover { color: var(--accent); }
.empty { margin-top: 24px; padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.is-busy { opacity: .6; cursor: progress; }
.private-cover { margin: 24px 0 12px; color: var(--muted); }
.danger { color: #b3261e; }

.settings { min-width: 0; }
.settings h1 { font-size: 22px; }
.settings label { display: block; margin-top: 14px; font-weight: 700; }
.settings input, .settings textarea, .composer textarea, .run-settings input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.settings textarea { resize: vertical; min-height: 200px; }
.settings .muted { margin: 8px 0 0; }
.preview { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; min-height: 560px; max-height: calc(100vh - 120px); }
.preview-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 84%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-break: normal; overflow-wrap: break-word; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.msg-assistant { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.msg-note { align-self: flex-start; color: var(--muted); font-size: 14px; }
.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.composer textarea { margin: 0; flex: 1; min-width: 0; resize: none; }

.nav-link + .nav-link { margin-right: auto; }
.nav-link:has(+ .nav-link) { margin-right: 0; }
.page-title { font-size: 26px; }
.notice { margin: 16px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice-bad { border-color: #b3261e; }
.panels { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.panel { min-width: 0; }
.panel-trial { flex: 1 1 340px; }
.panel-keys { flex: 999 1 460px; }
.panel-wide { flex: 1 1 100%; grid-column: 1 / -1; }  /* 설정 화면은 3칸 격자다 — 넓은 칸은 한 줄을 다 쓴다 */
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin-bottom: 4px; }
.panel-head form { margin-top: 4px; }
.key-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px 20px; margin: 16px 0 0; }
.key-facts dt { font-size: 13px; color: var(--muted); }
.key-facts dd { margin: 2px 0 0; font-weight: 600; }
.key-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 8px 32px; }
.key-columns h3:first-child { margin-top: 16px; }
@media (min-width: 1000px) { .key-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.key-columns h3 { margin-top: 20px; }
.key-columns td, .key-columns th { padding: 10px 12px; }
.field-label { display: block; margin-top: 16px; font-size: 14px; font-weight: 700; }
.panel .copy-row { margin-top: 6px; }
.panel .copy-row input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.secret .copy-row input { margin-top: 0; }
.page .panel a { color: var(--accent); }
.panel .big { font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--ink); }
.panel hr { margin: 16px 0; border: 0; border-top: 1px solid var(--line); }
.panel h3 { font-size: 16px; }
.panel form { margin-top: 10px; }
.secret { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: var(--bg); }
.secret label { display: block; font-size: 14px; }
.secret input, .key-form input[type=password] { width: 100%; min-height: 44px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.key-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.key-form { flex: 1 1 100%; }
.key-form summary { cursor: pointer; color: var(--accent); min-height: 32px; }
.key-form label { display: block; font-weight: 700; }
.key-form .btn { margin-top: 8px; }

.settings textarea.short { min-height: 0; }
.share-box { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.share-box h2 { font-size: 18px; }
.share-box .actions { margin-top: 12px; }
.share-box form { margin: 0; }
.copy-row { display: flex; gap: 8px; align-items: flex-end; }
.copy-row input { flex: 1; min-width: 0; }
.shared { max-width: 860px; margin: 0 auto; }
.shared .preview { margin-top: 16px; min-height: 480px; }
.shared-enter { margin-top: 16px; }
.shared-enter ul { margin: 8px 0 16px; padding-left: 20px; color: var(--muted); }
.page .shared-enter a.btn { color: var(--accent-ink); }
.page .shared-enter a.btn:hover { color: var(--accent-ink); }
.report { margin-top: 16px; color: var(--muted); font-size: 14px; }
.report summary { cursor: pointer; min-height: 32px; }
.report label { display: block; margin-top: 12px; font-weight: 700; color: var(--ink); }
.report select, .report textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.report .btn { margin-top: 12px; }
.admin-stat { flex: 1 1 240px; }
.admin-head { margin-top: 32px; font-size: 18px; }
.table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-top: 1px solid var(--line); }
thead th { border-top: 0; color: var(--muted); font-weight: 600; white-space: nowrap; }
/* 좁은 화면에서는 표의 줄을 카드로 세운다(#217). 칸 이름은 td에 붙인 data-label로 보인다. 옆으로 밀려 숨는 칸이 없다 */
@media (max-width: 639px) {
  .table-cards thead { display: none; }
  .table-cards tr { display: block; padding: 8px 14px; border-top: 1px solid var(--line); }
  .table-cards tbody tr:first-child { border-top: 0; }
  .table-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table-cards td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 13px; text-align: left; }
  .table-cards td:not([data-label]) { justify-content: flex-end; }
}
.admin-agent { margin-top: 16px; }
.admin-agent dl { margin: 0; }
.admin-agent dt { margin-top: 12px; font-size: 14px; color: var(--muted); }
.admin-agent dt:first-child { margin-top: 0; }
.admin-agent dd { margin: 2px 0 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.report-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.admin-actions { margin-top: 20px; }

.store-search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 420px; }
.store-search input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; text-decoration: none; white-space: nowrap; }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.shared .preview-static { min-height: 0; max-height: none; }
.card > p:first-child { margin-top: 0; }
.page a.btn { color: var(--accent-ink); }
.page a.btn-quiet, .hero a.btn-quiet { color: var(--ink); }
.settings select { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.share-box .actions .btn { margin: 0; }
.empty .btn { margin-top: 12px; }

.limit-form { margin-top: 12px; width: 100%; box-sizing: border-box; }
.limit-form label { display: block; margin-top: 10px; font-weight: 700; }
.limit-form input { width: 100%; box-sizing: border-box; padding: 8px 10px; }
.limit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.limit-inline { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.limit-inline input { flex: 1 1 200px; min-width: 0; padding: 8px 10px; }
.limit-delete { margin-top: 24px; }

/* 하루 풍경 — 앞 능선은 언제나 어두워 글자를 얹는다. 캔버스가 그려지기 전에도 같은 색조가 보인다. */
.logo, .page-title, .page-head h1, .day h1, section > h2 { font-family: var(--display); font-weight: 400; }
.logo { font-size: 19px; }
.day { position: relative; isolation: isolate; overflow: hidden; min-height: 620px; display: flex; align-items: flex-end; color: #fff; background: linear-gradient(180deg, #4f8fe0 0%, #ffd9c0 46%, #1f3060 62%); }
.day canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.day-crew { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.day-body { display: grid; gap: 12px; padding-top: 300px; padding-bottom: 22px; }
.day h1 { font-size: clamp(32px, 5vw, 54px); line-height: 1.18; max-width: 16em; }
.day-body p { margin: 0; max-width: 40em; }
.day .btn-glass, .band-sky .btn-glass { background: #ffffff26; color: #fff; border: 1px solid #ffffff80; }
.day-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; font-size: 14px; }
.day-pause { padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.day-pilot { position: absolute; left: 0; top: 0; width: 92px; transition: left 1.6s cubic-bezier(.45, 0, .2, 1), top 1.6s cubic-bezier(.45, 0, .2, 1); }
.featured { padding-top: 32px; }
.band-sky { padding: 32px 0 26px; background: linear-gradient(150deg, #ffd9ec 0%, #e3dcff 46%, #c9ecff 100%); color: #241a4d; }
.band-sky p { margin: 8px 0 0; color: #4e4670; }
.band-sky .page-head h1 { font-size: 32px; }
.band-sky input { background: #fff; color: #241a4d; }
.card { border-radius: 20px; transition: box-shadow .15s, transform .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #5b3df51f; }
.card-head { display: flex; gap: 12px; align-items: center; }
.card-head p { margin: 0; }
.icon { flex: none; display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--tint) 18%, var(--surface)); }
.icon svg { width: 40px; height: 40px; overflow: visible; }
.icon[data-c="learning"], .icon[data-c="marketing"] { --tint: #f4589b; }
.icon[data-c="education"], .icon[data-c="support"] { --tint: #27b98a; }
.icon[data-c="writing"], .icon[data-c="startup"] { --tint: #fba92e; }
.icon[data-c="work"] { --tint: #7a52f0; }
.icon[data-c="development"], .icon[data-c="career"] { --tint: #4f8ff7; }
.icon[data-c="life"] { --tint: #f56a4c; }
.agent-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.bot { display: block; width: 100%; height: auto; overflow: visible; }
.bot .craft { animation: bot-bob 3.2s ease-in-out infinite; transform-origin: 70px 60px; }
@keyframes bot-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.bot .beam { opacity: 0; transition: opacity .2s; }
.is-beaming .bot .beam { opacity: 1; }
.carrier { position: fixed; left: 0; top: 0; width: 110px; z-index: 20; pointer-events: none; transition: left .6s cubic-bezier(.45, 0, .2, 1), top .6s cubic-bezier(.45, 0, .2, 1); }
.flying-icon { position: fixed; z-index: 19; pointer-events: none; margin: 0; }
.is-carried { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .bot .craft { animation: none; } .card { transition: none; } .day-pilot { transition: none; }
}
.card h2 { font-size: 17px; font-family: var(--font); font-weight: 700; }
.card a { color: var(--ink); text-decoration: none; }
.card a:hover { color: var(--accent); }
.day h1, .day-body > p { text-shadow: 0 1px 12px #0b103880; }

/* 상단 메뉴 — 오른쪽 끝에서부터 프로필, 언어, 해상도 표시 순서다 */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.menu summary::-webkit-details-marker { display: none; }
.lang-now { min-height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; }
.avatar { justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #ff9ccb, #8fc6ff); color: #241a4d; font-weight: 700; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(288px, calc(100vw - 2 * var(--gutter))); display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 16px 36px #241a4d2e; white-space: normal; }
.menu-small { width: 150px; padding: 6px; }
.menu-panel p { margin: 0; }
.menu-panel hr { width: 100%; margin: 8px 0; border: 0; border-top: 1px solid var(--line); }
.menu-panel a { color: var(--ink); padding: 7px 8px; border-radius: 8px; }
.menu-panel a:hover { background: var(--bg); }
.menu-panel a[aria-current] { color: var(--accent); font-weight: 700; }
.menu-panel .link { width: 100%; min-height: 36px; padding: 0 8px; text-align: left; color: var(--ink); }
.menu-name { font-weight: 700; overflow-wrap: anywhere; }
.menu-panel .muted { overflow-wrap: anywhere; }
.menu-label { margin-top: 6px !important; color: var(--muted); font-size: 13px; }
.meter { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 3px 0; }
.meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); }

/* 단계 화면은 가운데에 둔다 */
.hero { max-width: 640px; margin: 0 auto; text-align: center; }
.hero h1 { font-family: var(--display); font-weight: 400; }
.hero .actions, .hero form .actions { justify-content: center; }
.hero form { display: grid; justify-items: center; }
.hero .check { text-align: left; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: stretch; }

/* 소개 페이지 도착 — 내려놓기 전까지 흑백으로 기다린다 */
.agent-title .icon { transition: filter .28s; }
.arriving .agent-title .icon { filter: grayscale(1); opacity: .55; }
.nav-link { margin-right: 0; }
.top-nav { margin-left: auto; }
/* 위 메뉴 묶음(#211) — 넓으면 로고 옆 한 줄, 좁으면 로고 · 프로필 아래 한 줄(넘치면 옆으로 민다) */
.main-nav { display: flex; gap: 16px; align-items: center; }
/* 설정(#211) — AI 사용 카드는 두 칸(현황 · 선택 / 내 키), 체험 키는 두 칸 너비 */
.ai-columns { display: grid; gap: 8px 32px; }
@media (min-width: 900px) { .ai-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .panel-span2 { grid-column: span 2; } }
@media (max-width: 1439px) { .panel-span2 .key-columns { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) { .panel-span2 { grid-column: 1 / -1; } }
@media (max-width: 639px) {
  .app-version, .bp, .profile-name { display: none; }
  .top-nav { order: 2; }
  .main-nav { order: 3; flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-link { padding: 10px 0 9px; }
}

/* 안내 페이지(#199) — 다른 페이지와 같은 .wrap 폭. 넓으면 카드를 여러 칸으로 펼치고, 긴 문단만 읽기 좋은 길이로 둔다 */
.guide { display: grid; gap: 14px; }
.guide > p, .guide > ul { max-width: 900px; }
.guide h2 { margin-top: 18px; font-size: 22px; }
.guide-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.guide-steps li { counter-increment: step; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.guide-steps li::before { content: counter(step); grid-row: span 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.guide-steps span { color: var(--muted); }
.guide-faq { display: grid; gap: 8px; align-items: start; }
@media (min-width: 1024px) { .guide-faq { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.client-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.client-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.client-card h4 { margin: 0; font-size: 16px; }
.client-card ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.client-card li + li { margin-top: 4px; }
.guide-faq details { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.guide-faq summary { cursor: pointer; font-weight: 700; }
.guide-faq p { margin: 8px 0 0; color: var(--muted); }
.guide-go { justify-content: center; margin-top: 12px; }

/* 상단 왼쪽은 로고 · 이름 · 버전, 오른쪽 끝은 프로필 이름이다 */
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { display: block; border-radius: 8px; }
/* 이름 아래 「powered by 젠아이랩스」(#201). mcpstore와 같은 모양 */
.logo-name { display: inline-flex; flex-direction: column; line-height: 1.15; }
.logo-name small { color: var(--muted); font: 500 11px var(--font); letter-spacing: .02em; }
/* 로고에 올리면(#205) UFO가 떠서 흔들리고 이름 글자에 그라데이션이 흐른다. 움직임 줄이기면 색만 바꾼다 */
.logo img { transition: transform .25s ease, filter .25s ease; }
.logo-text { background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 100%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; }
.logo:hover img, .logo:focus-visible img { animation: ufo-hover 1.2s ease-in-out infinite alternate; filter: drop-shadow(0 4px 8px rgba(255, 95, 162, .55)); }
.logo:hover .logo-text, .logo:focus-visible .logo-text { background-image: linear-gradient(90deg, #5b3df5, #ff5fa2, #3aa0ff, #5b3df5); color: transparent; animation: logo-flow 2.4s linear infinite; }
@keyframes ufo-hover { from { transform: translateY(0) rotate(-7deg); } to { transform: translateY(-4px) rotate(7deg); } }
@keyframes logo-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .logo:hover img, .logo:focus-visible img, .logo:hover .logo-text, .logo:focus-visible .logo-text { animation: none; }
}
.app-version { align-self: center; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; margin-right: 8px; }
.profile-now { gap: 8px; padding: 3px 12px 3px 3px; border: 1px solid var(--line); border-radius: 999px; }
.profile-now .avatar { display: inline-flex; align-items: center; width: 32px; height: 32px; }
.profile-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }

/* 카드는 눌러도 이동하지 않는다. 이동은 이용하기 단추만 한다 */
.card { display: flex; flex-direction: column; gap: 8px; }
.card > p { margin: 0; }
.card-desc { flex: 1; }
.card-actions { display: flex; gap: 8px; margin-top: 4px; }
.card-actions .btn { flex: 1; text-align: center; }
.page .card a.btn, .card a.btn { color: var(--accent-ink); }
.card a.btn:hover { color: var(--accent-ink); }
.about h2 { font-size: 19px; }
.about .actions a.btn { color: var(--accent-ink); }
.about ul { margin: 0 0 16px; padding-left: 20px; }
.maker-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.card-actions .btn { padding: 9px 12px; font-size: 14px; font-weight: 600; line-height: 1.4; }

/* 카드 — 호버 그림자, 선택 표시. 버튼은 같은 보라 계열로 맞춘다 */
.card { position: relative; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent), 0 12px 28px color-mix(in srgb, var(--accent) 14%, transparent); }
.card-maker { display: flex; align-items: baseline; gap: 8px; }
.card-subs { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; } /* 구독 수는 제작자 줄 오른쪽에 — 줄을 따로 쓰지 않는다 */
.maker { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.maker-label { color: var(--muted); font-size: 12px; }
.maker-sep { color: var(--muted); font-size: 12px; }
.maker-name { font-family: var(--display); font-size: 13px; color: var(--ink); }
.maker-org { color: var(--muted); font-size: 12px; }
.maker-org::before { content: "· "; }
.btn-action { flex: 1; display: inline-block; min-height: 40px; padding: 9px 12px; border: 0; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 600; line-height: 22px; text-align: center; text-decoration: none; cursor: pointer; background-size: 240% 100%; background-position: 0 50%; transition: background-position .5s ease, transform .15s, box-shadow .2s; }
.btn-about { color: var(--accent); background-image: linear-gradient(105deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, #4f8ff7 20%, var(--surface)), color-mix(in srgb, #ff9ccb 20%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface))); }
.btn-use, .page .card a.btn-use, .card a.btn-use, .about a.btn-use { color: #fff; background-image: linear-gradient(105deg, #7a63f2, #6c8df0, #a678ee, #7a63f2); }
.card a.btn-use:hover, .about a.btn-use:hover { color: #fff; }
.btn-action:hover { background-position: 100% 50%; transform: translateY(-1px); box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-action:active { transform: translateY(0); }
.about { width: min(680px, calc(100vw - 2 * var(--gutter))); max-width: none; max-height: calc(100dvh - 48px); padding: 26px; border-radius: 22px; }
.about[open] { display: flex; flex-direction: column; gap: 14px; }
.about-body { overflow-y: auto; display: grid; gap: 8px; min-height: 0; }
.about-body p { margin: 0; }
.about-body h3 { margin-top: 8px; font-size: 14px; color: var(--muted); }
.about-body ul { margin: 0; padding-left: 20px; }
.about-talk { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--bg); }
.about-q { justify-self: end; max-width: 85%; padding: 7px 11px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); font-size: 14px; }
.about-a { white-space: pre-line; font-size: 14px; }
.about .actions { justify-content: flex-end; }
.about .actions .btn-action { flex: 0 0 120px; }
@media (prefers-reduced-motion: reduce) { .btn-action, .card { transition: none; } .card:hover { transform: none; } }

.role-form { display: flex; gap: 8px; align-items: center; }
.card-actions form { flex: 1; display: flex; }
.limit-form select, .limit-inline select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.limit-inline select { flex: 1 1 200px; min-width: 0; }
.limit-form select { width: 100%; }
/* 답변 마크다운 */
.md-toggle { padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: 600 12px/1.5 var(--font); cursor: pointer; }
.md-toggle[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
/* 실행 결과(#217)는 대화창 답과 같은 마크다운. 그리기 전에도 줄바꿈을 지킨다 */
.run-body { white-space: pre-wrap; overflow-wrap: break-word; }
.is-md { white-space: normal; }
.is-md > :first-child { margin-top: 0; }
.is-md > :last-child { margin-bottom: 0; }
.is-md p, .is-md ul, .is-md ol, .is-md blockquote, .is-md pre { margin: 0 0 8px; }
.is-md ul, .is-md ol { padding-left: 20px; }
.is-md h3, .is-md h4, .is-md h5, .is-md h6 { margin: 10px 0 6px; font-size: 16px; }
.is-md code { padding: 1px 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: .92em; }
.is-md pre { padding: 10px; border-radius: 8px; overflow-x: auto; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.is-md pre code { padding: 0; background: none; }
.is-md blockquote { padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.is-md hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.md-table { overflow-x: auto; margin: 0 0 8px; }
.md-table table { border-collapse: collapse; font-size: 14px; }
.md-table th, .md-table td { padding: 5px 8px; border: 1px solid var(--line); text-align: left; }
/* 안내는 대화와 섞이지 않게 머리 오른쪽에 작게 둔다 */
.preview-head { align-items: center; }
.chat-meta { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 10px; margin-left: auto; font-size: 12px; }
.chat-meta .muted { font-size: 12px; }
.demo-left { padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-weight: 600; white-space: nowrap; }

.limit-form label.check { display: flex; grid-template-columns: none; font-weight: 400; margin-top: 12px; }
.limit-form label.check input { width: 18px; }
.limit-form .btn { margin-top: 12px; }

/* 운영 콘솔 — 밝은 화면에 주황으로 주의를 알린다 */
.is-console { --bg: #fff6ec; --surface: #ffffff; --ink: #2f2118; --muted: #7a6455; --line: #f3dcc4; --accent: #d9650f; --accent-ink: #ffffff; color-scheme: light; background: var(--bg); }
.is-console .top { background: #ffffff; }
.is-console main.wrap { max-width: none; padding: 0; }
.console-banner { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 10px; padding: 9px var(--gutter); background: linear-gradient(90deg, #f58a2e, #ee6a1f); color: #fff; font-size: 14px; font-weight: 600; text-align: center; }
.console { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - 95px); }
.console-nav { display: flex; flex-direction: column; gap: 2px; padding: 20px 12px; border-right: 1px solid var(--line); background: #fff1e2; }
.console-title { margin: 0 8px 10px; font-family: var(--display); font-size: 17px; color: #b4500a; }
.console-nav a { padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 14px; }
.console-nav a:hover { background: #ffe2c4; }
.console-nav a.is-active { background: #ffd2a8; font-weight: 700; }
.console-main { min-width: 0; padding: 0 var(--gutter); }
.console-main .page { max-width: 1400px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stat h2 { margin: 0; font: 400 13px/1.4 var(--font); color: var(--muted); }
.stat p { margin: 6px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat p.ok { color: #18794e; }
.stat p.bad { color: #c62f1c; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; margin-top: 12px; padding: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.bar { flex: 1 0 34px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bar span { width: 100%; max-width: 30px; min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #f9a65a, #ee6a1f); }
.bar small { color: var(--muted); font-size: 11px; }
.acting { position: sticky; top: 0; z-index: 40; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 14px; padding: 8px 16px; background: #b3261e; color: #fff; font-size: 14px; }
.acting button { padding: 3px 12px; border: 1px solid #fff; border-radius: 999px; background: transparent; color: #fff; font: inherit; cursor: pointer; }
@media (max-width: 820px) {
  .console { grid-template-columns: 1fr; }
  .console-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .console-title { width: 100%; }
}

/* 예시 질문 — 입력창 아래 작은 글자. 누르면 입력창에 채운다 */
.preview .examples { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 16px 12px; border: 0; }
.preview .examples button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.preview .examples button:hover { color: var(--accent); text-decoration-color: currentColor; }

/* 답의 출처 */
.msg-sources { align-self: flex-start; margin: -4px 0 0; color: var(--muted); font-size: 12px; }

/* 지금 메뉴 강조와 스토어 첫 화면의 안내 링크 */
.nav-link.is-active { color: var(--accent); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.nav-link { padding: 17px 0 15px; }
.store-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }
.store-links a { color: #4e3fc7; font-weight: 600; }

/* 내 에이전트 — 쓰는 방법과 카드 */
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 16px 0 8px; padding: 0; list-style: none; }
.how-steps li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.how-steps strong { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 14px; }
.how-steps span { flex: 1 1 140px; word-break: keep-all; }
.mine-card .card-actions form { flex: 1; display: flex; }
.mine-card .card-actions form .btn-action { width: 100%; }
.tag-on { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, #27b98a 16%, var(--surface)); color: #13795b; font-size: 12px; font-weight: 700; white-space: nowrap; }
.where-use ul { margin: 6px 0 0; padding-left: 18px; }
.where-use li { margin: 2px 0; word-break: keep-all; }
.where-use a, .how-steps a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* 실행형 에이전트 */
.run-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.run-settings label { display: block; margin-top: 10px; font-weight: 600; }
.run-settings input { width: 100%; }
.run-when { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.run-when select { flex: 1 1 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.run-when select:disabled { color: var(--muted); background: var(--bg); }
.run-alerts { list-style: none; margin: 0; padding: 0; }
.run-alerts .notice { margin-top: 8px; }
.run-how ol { margin: 6px 0; padding-left: 20px; }
.run-how li { margin: 4px 0; word-break: keep-all; }
.run-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
.run-succeeded { color: #13795b; border-color: #9ad8c0; }
.run-failed, .run-missed { color: #c62f1c; border-color: #f0b3a8; }
.run-queued, .run-running { color: var(--accent); }
.run-steps { margin: 8px 0; padding-left: 22px; }
.run-steps li { margin: 8px 0; }
.run-steps li.bad strong { color: #c62f1c; }
.run-steps details { margin-top: 4px; }
.run-result { display: grid; gap: 12px; padding: 0; list-style: none; }
.run-result h3 { margin: 0 0 6px; }
.run-result ul { margin: 6px 0 0; padding-left: 18px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-top-color: var(--accent); border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.tag-run { display: inline-block; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, #fba92e 18%, var(--surface)); color: #9a5a00; font-size: 12px; font-weight: 700; white-space: nowrap; }
.run-result a { color: var(--accent); }
.packs { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.pack { display: flex; flex-direction: column; gap: 6px; }
.pack .btn { margin-top: auto; text-align: center; }
.inline-form { display: inline; }
.orders { list-style: none; margin: 8px 0 0; padding: 0; }
.orders li { padding: 10px 0; border-top: 1px solid var(--line); }
.orders p { margin: 2px 0; }
.order-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* 위젯 대화창(#92) — 다른 사이트의 iframe 안. 창 전체를 대화창으로 쓴다 */
.widget-body { margin: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); }
.widget-body .preview { flex: 1; min-height: 0; max-height: none; border: 0; border-radius: 0; }
.widget-body .preview-head { padding-right: 48px; }
.widget-foot { margin: 0; padding: 6px 12px 10px; text-align: center; font-size: 12px; }
.widget-foot a { color: var(--muted); }
#widget textarea { width: 100%; min-height: 0; height: auto; resize: vertical; }
/* 팀원 선택(#94) */
.team-choices { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.team-choices .tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

/* 근거 문서(#139) — 대화창 위 목록 · 보기 화면 */
/* 도구 연결(#218) — 외부 도구 안내 한 줄, 만들기 화면의 도구 서버 목록 */
.chat-tools { margin: 0; padding: 6px 16px; font-size: 12px; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.tool-servers { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 12px; }
.tool-servers > li { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.tool-server-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tool-server-head code { overflow-wrap: anywhere; }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; }
.tool-list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.tool-list > li:first-child { border-top: 0; padding-top: 0; }
.tool-list .tag, .tool-server-head .tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tool-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.tool-list .tag-write { color: #b3261e; border-color: currentColor; }
.doc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.doc-bar-title { font-size: 13px; color: var(--muted); }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 100%; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; text-decoration: none; }
.doc-chip span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-chip .muted { flex: none; font-size: 12px; }
.doc-chip:hover, .doc-chip.is-active { border-color: var(--accent); color: var(--accent); }
button.doc-chip { font: inherit; font-size: 14px; cursor: pointer; }
.doc-chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.msg-sources a { color: var(--accent); }
.docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 12px; }
@media (min-width: 900px) { .docs { grid-template-columns: 240px minmax(0, 1fr); } }
.docs-list { display: flex; flex-direction: column; gap: 8px; }
.docs-list .doc-chip { border-radius: var(--radius); }
.doc-view { padding: 20px; min-width: 0; }
.doc-head h1 { font-size: 20px; margin: 0 0 12px; overflow-wrap: break-word; }
.doc-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doc-page input { width: 72px; min-height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.page .doc-nav a.btn-quiet { color: var(--ink); }  /* .page a.btn(흰 글자)보다 앞서야 이전 · 다음이 보인다 */
.doc-body { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); white-space: pre-wrap; line-height: 1.75; word-break: keep-all; overflow-wrap: break-word; }
.doc-body mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; border-radius: 3px; }
.doc-note { margin-top: 16px; font-size: 13px; }
.sources-form { margin: 12px 0; }

/* 문서 저장 공간 · 내 문서(#144) */
.storage { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; font-size: 14px; color: var(--muted); }
.storage-bar { flex: 1 1 160px; max-width: 280px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.storage-bar span { display: block; height: 100%; background: var(--accent); }
.storage.is-full { color: #b3261e; }
.storage.is-full .storage-bar span { background: #b3261e; }
.my-docs { margin-top: 20px; }
/* 대화 기록 삭제 · 내 데이터 모두 삭제(#147) */
.chat-clear .link { min-height: 0; font-size: 12px; }
.chat-clear .link:hover { color: #b3261e; }
.btn-danger { background: #b3261e; color: #fff; }
.erase-form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.erase-form .check { margin-top: 0; }

/* 기억하는 챗봇(#156) — 세션 목록 · LLM 에 보낸 것 · 새로 기억한 것 */
.session-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.session-row.is-current .session-name a { font-weight: 700; color: var(--accent); }
.session-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.session-name a { overflow-wrap: break-word; word-break: keep-all; }
.session-name .muted { font-size: 13px; }
.session-tools summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.session-tools[open] { flex-basis: 100%; }
.session-tools form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.session-tools input[name="title"] { flex: 1 1 160px; min-width: 0; }
.msg-context { align-self: flex-start; max-width: 100%; margin: -4px 0 0; color: var(--muted); font-size: 12px; }
.msg-context summary { cursor: pointer; }
.msg-context ul { margin: 4px 0 0; padding-left: 18px; }
.msg-context p { margin: 2px 0 0; white-space: pre-wrap; }
.msg-memory { align-self: flex-start; margin: -4px 0 0; color: var(--accent); font-size: 12px; }

/* 선택 묶음(가입 방식 등) — 라디오를 한 줄에 늘어놓고 좁으면 접는다 */
.choice { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; border: 0; }
.choice legend { width: 100%; margin-bottom: 4px; padding: 0; font-weight: 600; }
.choice-stack { flex-direction: column; gap: 8px; }
.vis-orgs, .vis-public { margin-top: 8px; }
.vis-orgs .check { display: flex; margin: 4px 0; }
/* 고른 범위에 맞는 칸만 — 스크립트 없이 CSS 로(처음 그릴 때부터, 깜빡이지 않게) */
.vis-form:not(:has(input[name="scope"][value="org"]:checked)) .vis-orgs { display: none; }
.vis-form:not(:has(input[name="scope"][value="public"]:checked)) .vis-public { display: none; }
/* 쿠폰 발행 — 고른 혜택의 칸만(CSS :has, 깜빡이지 않게) */
.coupon-form:not(:has(input[name="kind"][value="credits"]:checked)) .coupon-credits { display: none; }
.coupon-form:not(:has(input[name="kind"][value="plan"]:checked)) .coupon-plan { display: none; }
/* 설정형 화면(.settings)의 칸 규칙(입력 칸 너비 100% · 굵은 줄 제목)이 체크 상자 · 라디오까지 늘리지 않게.
   만들기 화면의 공개 범위 · 근거 문서 허용 · 팀원 선택이 390 폭에서 상자만 따로 가운데 놓였다 */
.settings .check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.settings .check input { flex: none; width: 18px; height: 18px; margin-top: 5px; padding: 0; }

/* 만들기 화면(#187) — 넓으면 설정 · 미리보기 반반(미리보기는 스크롤해도 붙어 있다), 좁으면 위의 전환 단추로 하나씩 */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; padding: 20px 0 48px; align-items: start; }
.builder-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.builder-back { font-size: 14px; color: var(--muted); text-decoration: none; }
.builder-back::before { content: "‹ "; }
.builder-back:hover { color: var(--accent); }
.builder-title .muted { margin: 8px 0 0; font-size: 14px; }
.builder-title h1 { margin: 2px 0 0; font-size: 24px; overflow-wrap: anywhere; }
.builder > .preview { position: sticky; top: 16px; height: calc(100vh - 32px); min-height: 480px; max-height: none; }
.view-switch { display: none; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; text-decoration: none; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--accent); border-bottom-color: var(--accent); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.steps li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; word-break: keep-all; }
.step-no { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.draft-box { margin-top: 16px; padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.draft-box h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 17px; color: var(--accent); }
.draft-box textarea { margin-top: 10px; }
.draft-box .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 10px 0 0; }
.draft-box .actions .muted { margin: 0; }
.settings .field-help { margin: 4px 0 0; }
.tpl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.settings .tpl-row .muted { margin: 0 4px 0 0; font-size: 13px; }
.tpl-row .chip { min-height: 32px; padding: 4px 12px; font-size: 13px; cursor: pointer; }
.tpl-row .chip:hover { border-color: var(--accent); color: var(--accent); }
.save-row { position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; padding: 12px 0; border-top: 1px solid var(--line); background: var(--bg); }
.save-row .muted { margin: 0; }
.unsaved { color: var(--accent); font-size: 14px; font-weight: 600; }
.chat-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 360px; margin: auto; padding: 24px 8px; color: var(--muted); text-align: center; word-break: keep-all; }
.chat-empty svg { color: var(--accent); }
.chat-empty strong { color: var(--ink); font-size: 16px; }
.chat-empty p { margin: 0; font-size: 14px; line-height: 1.6; }
@media (max-width: 899px) {
  .builder { grid-template-columns: minmax(0, 1fr); }
  .view-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .view-switch button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
  .view-switch button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); }
  .builder[data-view=settings] > .preview, .builder[data-view=preview] > .settings { display: none; }
  .builder > .preview { position: static; height: calc(100vh - 200px); min-height: 420px; }
  .steps li { align-items: flex-start; padding: 8px 10px; font-size: 13px; }
}
.tab-panel > .share-box:first-child { margin-top: 8px; border-top: 0; }
.key-use { margin: 12px 0 8px; }
.key-use fieldset { margin: 0; padding: 0; border: 0; }
.key-use .check { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; font-weight: 400; }
.key-use .check input { flex: none; width: 18px; height: 18px; margin-top: 3px; }
.key-use .btn { margin-top: 10px; }
.store-section { margin: 28px 0 0; font-size: 18px; }
.store-section + .cards { margin-top: 12px; }
.store-org-join { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
/* AI 연결(#197) — 연결 방법 카드와 예시 코드 */
.connect-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.connect-way { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; word-break: keep-all; }
.connect-way:hover { border-color: var(--accent); }
.connect-way strong { color: var(--accent); font-size: 17px; }
.connect-way span { color: var(--muted); font-size: 14px; }
.guide .connect-part { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 24px; }
.guide h3 { margin: 14px 0 0; font-size: 18px; }
.code-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.code-wrap pre { margin: 0; padding: 14px 16px; font-size: 13px; line-height: 1.6; }

/* 켜고 끄는 단추(#213) — 켜고 끄는 설정은 모두 이 모양. 옆에 켜짐 / 꺼짐을 글로도 보인다 */
.toggle-form { margin: 10px 0 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.switch-track, input.switch-input { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #c9c6d8; transition: background .18s; }
.switch-thumb, input.switch-input::after { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
input.switch-input { appearance: none; -webkit-appearance: none; margin: 0; cursor: pointer; }
input.switch-input::after { content: ""; }
.switch[aria-checked=true] .switch-track, input.switch-input:checked { background: var(--accent); }
.switch[aria-checked=true] .switch-thumb, input.switch-input:checked::after { transform: translateX(18px); }
.switch-label { font-weight: 700; }
.switch-state { color: var(--muted); font-size: 13px; }
.switch[aria-checked=true] .switch-state { color: var(--accent); font-weight: 700; }
.switch:focus-visible { outline: none; }
.switch:focus-visible .switch-track, input.switch-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:disabled { cursor: progress; }
.switch-state .spinner { width: 12px; height: 12px; vertical-align: -2px; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-thumb, input.switch-input, input.switch-input::after { transition: none; } }

/* 양식형(#216) — 만들기 화면의 칸 편집과 대화창 자리의 입력 양식 */
.form-row { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.form-row-grid { display: grid; gap: 8px 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.form-row-grid label { margin-top: 0; font-size: 13px; color: var(--muted); }
.form-row .check { margin-top: 8px; }
.composer-form { flex-direction: column; align-items: stretch; gap: 10px; }
.composer-form .form-input { display: grid; gap: 4px; }
.composer-form label { font-size: 13px; font-weight: 700; }
.composer-form input, .composer-form select, .composer-form textarea { width: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); font: inherit; }
.composer-form textarea { flex: none; resize: vertical; min-height: 84px; }
.composer-form { max-height: 60vh; overflow-y: auto; }
.composer-form .btn { align-self: flex-end; }
