/* KISEWAY demo visual system */
:root {
  --bg: #f5f7fb;
  --surface: #fff;
  --surface2: #f7f9fd;
  --text: #18263d;
  --muted: #6b7c94;
  --line: #e3e9f2;
  --blue: #435fe4;
  --blue-soft: #edf1ff;
  --shadow: 0 8px 28px rgba(34, 51, 91, .035), 0 1px 3px rgba(34, 51, 91, .04);
}
body { color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #94a6ff; outline-offset: 3px; }

/* Frame and navigation */
.shell { grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { width: 244px; padding: 18px 14px 12px; border-color: #e7ecf4; box-shadow: 8px 0 28px rgba(35, 50, 90, .025); }
.brand { display: block; height: auto; padding: 5px 10px 19px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.brand img { width: 140px; height: 35px; }
.brand:after { content: 'AI 안전 관리 공간'; display: block; margin-top: 7px; color: #a0aec1; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.sidebar nav { padding: 0 3px 10px; scrollbar-width: thin; scrollbar-color: #d3dbeb transparent; }
.nav-heading { margin: 22px 10px 8px; color: #99a7b9; font-size: 10px; letter-spacing: .025em; }
.nav-item { position: relative; min-height: 39px; gap: 12px; padding: 9px 11px; margin: 2px 0; border-radius: 9px; color: #63738a; font-size: 12px; font-weight: 600; transition: background .18s ease, color .18s ease; }
.nav-item .icon { display: grid; place-items: center; width: 19px; height: 19px; flex: none; color: #8798b0; }
.nav-item .icon svg { width: 18px; height: 18px; }
.nav-item:hover { background: #f2f5ff; color: #3858d9; }
.nav-item:hover .icon, .nav-item.active .icon { color: #435fe4; }
.nav-item.active { background: #eef2ff; color: #3858d9; box-shadow: inset 0 0 0 1px #e2e9ff; }
.nav-item.active:before { content: ''; position: absolute; left: -3px; top: 10px; bottom: 10px; width: 3px; border-radius: 4px; background: #506ae9; }
.nav-item.nav-cue { color: #3858d9; background: #eef2ff; box-shadow: 0 0 0 2px #8298ee; }
.nav-item.nav-cue:after { content: '선택'; margin-left: auto; padding: 3px 7px; border-radius: 99px; background: #dbe4ff; color: #3858d9; font-size: 10px; font-weight: 800; }
.sidebar-footer { display: flex; justify-content: flex-start; gap: 10px; align-items: center; padding: 14px 9px 4px; }
.sidebar-footer .footer-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: #edf1ff; color: #526be4; font-size: 15px; }
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: var(--text); font-size: 10px; letter-spacing: .045em; }
.sidebar-footer small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.topbar { height: 68px; padding: 0 38px; border-color: #e8edf5; background: rgba(255, 255, 255, .84); color: #4c607f; backdrop-filter: blur(12px); }
.topbar #eyebrow:before { content: 'KISEWAY  /  '; color: #a0aec1; font-size: 10px; letter-spacing: .08em; }
.demo-indicator { padding: 7px 10px; border: 1px solid #e8edf5; border-radius: 99px; background: #fff; color: #6e7e94; }
.demo-indicator i { box-shadow: 0 0 0 3px #e4f7ef; }
.top-button, .theme-button, .btn { min-height: 36px; border-color: #dfe6f1; border-radius: 9px; padding: 9px 13px; box-shadow: 0 2px 5px rgba(28, 46, 80, .035); transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.theme-button { min-width: 36px; padding: 4px 9px; }
.top-button:hover, .theme-button:hover, .btn:hover { border-color: #b6c4ed; box-shadow: 0 4px 12px rgba(48, 76, 149, .09); }
.btn.primary { border-color: #435fe4; background: #435fe4; box-shadow: 0 5px 12px rgba(67, 95, 228, .2); }

/* Content, cards and type */
.content { max-width: 1500px; padding: 34px 38px 280px; }
.page-head { align-items: center; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin-bottom: 7px; font-size: 27px; letter-spacing: -.045em; line-height: 1.3; }
.page-head h1[tabindex="-1"]:focus { outline: none; }
.page-head p { font-size: 13px; color: var(--muted); }
.page-actions { align-items: center; flex-wrap: wrap; }
.badge { padding: 6px 10px; font-size: 10px; letter-spacing: -.01em; }
.panel { padding: 24px; margin-bottom: 18px; border-radius: 14px; }
.panel h2 { font-size: 16px; letter-spacing: -.025em; }
.panel h3 { letter-spacing: -.02em; }
.panel-title { margin-bottom: 20px; }
.sub, .panel .sub { color: var(--muted); line-height: 1.65; }
.section-eyebrow { margin-bottom: 7px; color: #8090a7; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.notice { padding: 13px 16px; margin: 16px 0 20px; border-color: #dbe4ff; border-left: 3px solid #8da3f5; border-radius: 10px; background: #f1f5ff; color: #4d65ab; }
.notice.warn { border-left-color: #e3ba61; }
.notice.fail { border-left-color: #df7d7d; }
.metric { border-radius: 14px; box-shadow: var(--shadow); }
.table th { background: #f7f9fc; color: #8492a6; font-size: 10px; letter-spacing: .02em; }
.table td { border-color: #edf1f6; }
.table tbody tr:hover { background: #f4f7ff; }
.quick { border-radius: 11px; }
.quick:hover { box-shadow: 0 6px 18px rgba(67, 95, 228, .08); }
.control, .privacy-text, .privacy-output-demo, .privacy-empty { border-radius: 10px; }
.topology, .flow, .table-wrap, .file-tabs { scrollbar-width: thin; scrollbar-color: #c1cde2 transparent; }
.topology::-webkit-scrollbar, .flow::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .file-tabs::-webkit-scrollbar { height: 6px; }
.topology::-webkit-scrollbar-thumb, .flow::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .file-tabs::-webkit-scrollbar-thumb { border-radius: 8px; background: #c1cde2; }
.topology::-webkit-scrollbar-track, .flow::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track, .file-tabs::-webkit-scrollbar-track { background: transparent; }

/* Request details */
.detail-panel { padding: 26px; }
.detail-panel .panel-title > div { min-width: 0; }
.stage-count { flex: none; color: #8795aa; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.steps { display: grid; gap: 8px; overflow: visible; border: 0; border-radius: 0; }
.step { position: relative; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 8px; min-width: 0; min-height: 86px; padding: 13px 12px; border: 1px solid #e5eaf3; border-radius: 11px; background: #fafbfe; color: #718098; box-shadow: none; text-align: left; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.step:last-child { border: 1px solid #e5eaf3; }
.step:hover { border-color: #bac8f8; background: #f5f7ff; }
.step i { width: 24px; height: 24px; margin: 0; border-color: #e1e7f0; background: #fff; color: #8090a8; font-size: 10px; }
.step .step-name { flex: 1; min-width: 0; font-size: 11px; font-weight: 800; line-height: 1.45; word-break: keep-all; }
.step small { flex-basis: 100%; padding-left: 32px; color: #91a0b5; font-size: 10px; font-weight: 600; }
.step.active, .step.active:last-child { border-color: #8196f2; background: #eef2ff; color: #3858d9; box-shadow: inset 0 0 0 1px #8196f2, 0 4px 12px rgba(67, 95, 228, .08); }
.step.active i { border-color: #435fe4; background: #435fe4; color: #fff; }
.step.active small { color: #5a72d5; }
.detail-panel .step-detail { margin-top: 18px; padding: 22px; border: 1px solid #e8edf7; border-radius: 12px; background: #f8faff; }
.detail-panel .step-detail .panel-title { align-items: flex-start; margin-bottom: 15px; }
.detail-panel .step-detail h2 { margin-bottom: 0; }
.detail-copy { margin: 0; padding: 17px 18px; border: 1px solid #e5ebf5; border-radius: 10px; background: #fff; color: #263854; font: 13px/1.8 'Noto Sans KR', system-ui, sans-serif; }
.detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.detail-summary > div, .mock-summary > div, .file-stage-meta > div { padding: 15px 16px; border-color: #e9eef5; border-radius: 10px; background: #f8fafd; }
.detail-summary span, .detail-summary strong { display: block; }
.detail-summary span { margin-bottom: 7px; color: #8b9aae; font-size: 10px; font-weight: 700; }
.detail-summary strong { font-size: 12px; font-weight: 700; }
.file-tabs { gap: 14px; }
.file-tab { padding: 10px 5px; }
.code { border-radius: 10px; }

/* Scenario selector and guide */
.overlay { background: rgba(16, 28, 55, .62); backdrop-filter: blur(5px); }
.welcome { border: 1px solid rgba(255, 255, 255, .75); border-radius: 20px; box-shadow: 0 32px 100px rgba(14, 26, 61, .3); }
.welcome-side { background: linear-gradient(145deg, #f8faff 0%, #edf2ff 65%, #e6eaff 100%); }
.welcome-side:after { border-color: #bac7ff; }
.welcome-kicker, .welcome-heading > div > span { color: #7184d6; letter-spacing: .14em; }
.welcome-side h1 { color: #182744; }
.welcome-side h1 em { color: #435fe4; }
.welcome-heading h2 { color: #1b2a43; }
.scenario { border-color: #e5eaf3; border-radius: 12px; padding: 16px; }
.scenario:hover { border-color: #93a5f5; box-shadow: 0 8px 24px rgba(67, 95, 228, .09); }
.scenario-icon { border-radius: 11px; background: #edf1ff; }
.scenario h3 { color: #24334d; }
.browse { color: #4d62ae; }
.tour { border-radius: 14px; border-color: #5269bd; box-shadow: 0 18px 55px rgba(18, 32, 71, .28); }
.tour-foot .primary { border-radius: 8px; }

/* Scenario illustrations and the KISEWAY symbol */
.scenario { grid-template-columns: 46px minmax(0, 1fr) 20px; gap: 14px; align-items: start; }
.scenario-icon { width: 46px; height: 46px; border: 1px solid #e0e7ff; border-radius: 14px; background: linear-gradient(145deg, #f5f7ff, #e8eeff); color: #4d66dc; }
.scenario-icon svg { display: block; width: 25px; height: 25px; }
.scenario:hover .scenario-icon { color: #3855d2; border-color: #ced9ff; }
.kiseway-mark { display: block; width: 28px; height: 31px; }
.welcome-foot .shield-art { width: 52px; height: 52px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 16px; background: rgba(255, 255, 255, .78); box-shadow: 0 8px 22px rgba(81, 103, 185, .13); }
.sidebar-footer .footer-mark { background: #f0f4ff; }
.sidebar-footer .kiseway-mark { width: 19px; height: 21px; }

#landing, #scenario-brief { z-index: 50; }
#landing-title:focus, #brief-title:focus { outline: none; }
.brief-card { width: min(720px, 100%); flex: none; margin: auto; padding: 30px 32px 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 32px 100px #0e1a3d4d; }
.brief-heading { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.brief-heading .scenario-icon { flex: none; width: 52px; height: 52px; }
.brief-heading h2 { margin: 7px 0; font-size: 23px; line-height: 1.35; letter-spacing: -.035em; word-break: keep-all; }
.brief-heading p, .brief-notice { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.brief-video { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: center; margin: 0 0 22px; padding: 12px; border: 1px solid #dce5f8; border-radius: 14px; background: #f7f9ff; }
.brief-video-frame { overflow: hidden; position: relative; aspect-ratio: 48 / 31; border-radius: 10px; background: linear-gradient(135deg, #263c73, #17284e); }
.brief-video-placeholder { display: flex; width: 100%; height: 100%; flex-direction: column; justify-content: center; align-items: center; gap: 8px; color: #e1e9ff; font-size: 11px; font-weight: 700; }
.brief-video-play { display: grid; place-items: center; width: 40px; height: 40px; padding-left: 2px; border: 1px solid #ffffff66; border-radius: 50%; background: #ffffff26; }
.brief-video-play svg { width: 20px; height: 20px; }
.brief-video-player { display: block; width: 100%; height: 100%; background: #101b32; object-fit: contain; }
.brief-video-copy > span { color: #536de0; font-size: 11px; font-weight: 800; }
.brief-video-copy h3 { margin: 5px 0 6px; color: var(--text); font-size: 15px; }
.brief-video-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; word-break: keep-all; }
.brief-label, .brief-section dt { color: var(--blue); font-size: 11px; font-weight: 800; }
.brief-sections { margin: 0; padding: 2px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); }
.brief-section { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; gap: 14px; padding: 14px 0; }
.brief-section + .brief-section { border-top: 1px solid var(--line); }
.brief-section dt { padding-top: 2px; }
.brief-section dd { margin: 0; font-size: 13px; line-height: 1.7; word-break: keep-all; }
.brief-journey { margin: 20px 0 16px; color: var(--muted); font-size: 11px; font-weight: 800; }
#brief-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 9px 0 0; padding: 0; list-style: none; }
#brief-flow li { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); color: var(--text); }
.brief-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.brief-actions .btn { min-height: 42px; }

/* Dark mode */
.dark { --bg: #111a2a; --surface: #1a2637; --surface2: #202e41; --text: #edf3fd; --muted: #9aacc3; --line: #334257; --blue: #a6b6ff; --blue-soft: #283b64; --shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.dark .sidebar, .dark .topbar { border-color: var(--line); }
.dark .sidebar .brand { background: transparent; border-radius: 0; }
.dark .sidebar .brand img { filter: brightness(0) invert(1); }
.dark .nav-heading { color: #a7b8ce; }
.dark .nav-item { color: #c1cde0; }
.dark .nav-item .icon { color: #a7bad3; }
.dark .topbar { background: rgba(26, 38, 55, .92); color: #c4d0e3; }
.dark .top-button, .dark .theme-button, .dark .btn { border-color: #62748d; }
.dark .nav-item:hover { background: #273958; color: #d3dcff; }
.dark .nav-item.active { background: #344c91; color: #fff; box-shadow: inset 0 0 0 1px #7389d9; }
.dark .nav-item.active .icon { color: #fff; }
.dark .nav-item.nav-cue { background: #344c91; color: #fff; box-shadow: 0 0 0 2px #a6b6ff; }
.dark .demo-indicator { background: #202e41; border-color: var(--line); color: #c1cde0; }
.dark .notice { background: #26395f; border-color: #47649c; color: #c6d3ff; }
.dark .notice.warn { background: #42341f; border-color: #bb9853; color: #ffe0a0; }
.dark .notice.fail { background: #462c35; border-color: #c47880; color: #ffd4d8; }
.dark .table td { border-color: var(--line); }
.dark .badge.gray { background: #334257; color: #dae4f1; }
.dark .welcome { background: #1a2637; border-color: #465a76; color: #edf3fd; }
.dark .welcome-side { background: linear-gradient(145deg, #263650, #1c2a40); }
.dark .welcome-side img { filter: brightness(0) invert(1); }
.dark .welcome-side h1, .dark .welcome-heading h2, .dark .scenario h3 { color: #edf3fd; }
.dark .welcome-side h1 em, .dark .welcome-kicker, .dark .welcome-heading > div > span { color: #b8c8ff; }
.dark .browse, .dark .scenario-label, .dark .welcome-foot { color: #bdcaff; }
.dark .welcome-side p, .dark .welcome-heading p, .dark .scenario p { color: #bac8da; }
.dark .scenario { background: #202e41; border-color: #41516a; }
.dark .scenario-icon { background: #304576; border-color: #536aa4; color: #d0dbff; }
.dark .welcome-notice { border-color: #40516b; color: #b6c5d8; }
.dark .brief-video { border-color: #40516b; background: #202e41; }
.dark .brief-video-copy > span { color: #b8c8ff; }
.dark .table th, .dark .table tbody tr:hover, .dark .detail-summary > div, .dark .mock-summary > div, .dark .file-stage-meta > div { background: #202e41; }
.dark .step, .dark .step:last-child { border-color: #3a4b62; background: #202e41; color: #b6c5d8; }
.dark .step i { background: #293950; border-color: #45566f; }
.dark .step.active, .dark .step.active:last-child { background: #31477a; border-color: #8da4ff; color: #fff; }
.dark .step.active i { background: #6682f5; border-color: #8da4ff; color: #fff; }
.dark .step.active small { color: #cad5ff; }
.dark .detail-panel .step-detail { background: #202e41; border-color: #3a4b62; }
.dark .detail-copy { background: #182536; border-color: #3a4b62; color: #edf3fd; }
.dark .topology, .dark .flow, .dark .table-wrap, .dark .file-tabs { scrollbar-color: #526884 transparent; }
.dark .topology::-webkit-scrollbar-thumb, .dark .flow::-webkit-scrollbar-thumb, .dark .table-wrap::-webkit-scrollbar-thumb, .dark .file-tabs::-webkit-scrollbar-thumb { background: #526884; }

@media (max-width: 1000px) {
  .content { padding-bottom: 280px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 700px) {
  .shell { display: block; }
  .sidebar { width: 244px; }
  .topbar { height: 60px; padding: 0 15px; }
  .topbar #eyebrow:before { content: ''; }
  .content { padding: 25px 15px 280px; }
  .page-head { display: block; }
  .page-head h1 { font-size: 24px; }
  .page-actions { margin-top: 14px; }
  .panel, .detail-panel { padding: 18px; border-radius: 12px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .step { min-height: 78px; }
  .detail-panel .step-detail { padding: 17px; }
  .detail-summary { grid-template-columns: 1fr; gap: 8px; }
  .detail-summary > div { padding: 12px 14px; }
  .welcome-side { min-height: 0; }
  .brief-card { padding: 22px 18px; }
  .brief-heading { gap: 12px; }
  .brief-heading h2 { font-size: 20px; }
  .brief-heading .scenario-icon { width: 42px; height: 42px; }
  .brief-video { grid-template-columns: 1fr; gap: 12px; }
  .brief-video-frame { width: 100%; }
  .brief-section { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.workspace { position: relative; min-width: 0; }
.workspace .content { min-width: 0; padding-bottom: 64px; }
.workspace .tour {
  position: static; z-index: auto; width: min(100%, 370px); max-width: 100%; max-height: none;
  margin: 12px 0 0; overflow: visible; box-shadow: 0 10px 28px #14234235;
}
.workspace .content > .tour:first-child { margin: 0 0 16px; }
.policy-send-row + .tour, .setup-actions + .tour { margin-left: auto; }
.workspace .tour.is-collapsed { padding: 12px 14px; }
.tour-top { align-items: center; }
.tour-top > span { min-width: 0; }
.tour-controls { display: flex; align-items: center; flex: none; gap: 6px; }
.tour-top .guide-toggle { padding: 5px 8px; border: 1px solid #6578a2; border-radius: 7px; color: #e8efff; font-size: 10px; font-weight: 700; line-height: 1.3; }
.tour-top .guide-toggle:hover { background: #304568; }
.tour-top .guide-close { padding: 0 2px; font-size: 20px; line-height: 1; }
.guide-compact-title { margin-top: 8px; color: #e2e9f7; font-size: 11px; font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour.is-collapsed .guide-progress { margin-top: 8px; }
.guide-body[hidden] { display: none; }
.tour-foot { flex-wrap: wrap; gap: 8px; }
.privacy-summary, .demo-result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.privacy-action-layout { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.privacy-action-layout > :is(.privacy-actions-demo, .privacy-summary) { flex: 1 1 220px; min-width: 0; flex-wrap: wrap; }
.privacy-action-layout > .tour { flex: 1 1 272px; margin: 0 0 0 auto; }
#privacy-result .privacy-action-layout { margin-top: 18px; }
#privacy-result .privacy-action-layout .privacy-summary { margin-top: 0; }
.privacy-summary [data-record], .privacy-summary [data-action="go-logs"] { margin-left: auto; }
.privacy-text, .privacy-output-demo, .privacy-empty { min-height: clamp(220px, 33vh, 280px); }
.policy-comparison { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 125px), 1fr)); gap: 8px; margin: 12px 0; }
.policy-comparison > div { display: grid; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); }
.policy-comparison span { color: var(--muted); font-size: 11px; }
.demo-answer-protection { padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface2); }
.demo-answer-protection p { margin: 7px 0 0; color: var(--text); font-size: 12px; line-height: 1.65; }
.mock-answer-header { flex-wrap: wrap; }
.mock-answer-header [data-record], .mock-answer-header [data-action="go-logs"] { margin-left: auto; }
.mock-answer > .tour { max-width: calc(100% - 24px); margin: 12px 12px 0 auto; }
.result-log .detail-summary { margin: 0; }
.result-log dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.result-log dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; }
.log-note { margin-top: 18px; }
.log-note .privacy-output-demo { min-height: 0; }
.setup-actions > .badge { align-self: center; }
.setup-nav-hint { margin: 0; color: var(--blue); font-size: 14px; font-weight: 700; line-height: 1.6; }
.log-nav-hint { margin: 0; color: var(--blue); font-size: 14px; font-weight: 700; line-height: 1.6; }
.setup-config-panel { max-width: 820px; }
.setup-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-top: 14px; }
.setup-fields select:disabled { background: var(--surface2); color: var(--muted); }
.setup-model-list { display: grid; gap: 8px; margin: 16px 0; }
.setup-model-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface2); }
.setup-model-row strong, .setup-model-row small { display: block; }
.setup-model-row small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.setup-complete { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
.setup-complete-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.setup-complete-heading span:not(.badge) { color: var(--blue); font-size: 12px; font-weight: 800; }
.setup-complete-heading h3 { margin: 5px 0 0; font-size: 17px; }
.setup-complete p { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.setup-route { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.setup-route li { position: relative; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.setup-route li + li:before { content: '→'; position: absolute; top: 15px; left: -12px; z-index: 1; color: var(--blue); font-weight: 800; }
.setup-route b, .setup-route small { display: block; }
.setup-route small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.setup-complete-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 16px 0 0; }
.setup-complete-grid > div { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.setup-complete-grid dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.setup-complete-grid dd { margin: 5px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.setup-complete .setup-complete-next { margin-top: 16px; color: var(--text); }
@media (max-width: 700px) {
  .sidebar.open { z-index: 45; }
}

/* Explain the protection before asking visitors to configure it. */
:root { --muted: #536681; }
.dark { --muted: #b6c5d8; }

/* 처리 로그를 찾아보고 요청의 흐름을 이해하는 화면 */
.log-list-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.log-list-heading h2 { margin: 0 0 6px; }
.log-list-heading p, .log-guide-intro p, .log-story-heading p, .log-story-steps p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.log-list-heading > span { flex: none; padding: 7px 11px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-size: 12px; font-weight: 700; }
.log-guide-intro { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; margin-bottom: 14px; border: 1px solid #bdcaff; border-radius: 10px; background: var(--blue-soft); }
.log-guide-intro > span { color: var(--blue); font-size: 22px; line-height: 1; }
.log-guide-intro strong { display: block; margin-bottom: 3px; font-size: 14px; }
.table tbody tr.log-row-current, .table tbody tr.log-row-current:hover { background: var(--blue-soft); }
.log-current-label { display: inline-block; margin-top: 5px; color: var(--blue); font-size: 11px; font-weight: 800; }
.log-story-heading > span { color: var(--blue); font-size: 12px; font-weight: 800; }
.log-story-heading h2 { margin: 6px 0 7px; font-size: 18px; }
.log-record-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: 12px; margin-top: 18px; }
.log-record-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.log-record-label { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.log-record-request { max-height: 220px; overflow: auto; margin: 10px 0 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 14px; line-height: 1.75; }
.log-record-result { display: block; margin-top: 10px; color: var(--blue); font-size: 16px; }
.log-record-card p { margin: 10px 0 0; color: var(--text); font-size: 14px; line-height: 1.7; }
.log-record-card .log-record-files, .log-record-card .log-record-foot { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.log-record-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.log-record-meta span { color: var(--muted); }
.dark .table tbody tr.log-row-current, .dark .table tbody tr.log-row-current:hover { background: var(--blue-soft); }
.dark .log-guide-intro { border-color: #5c72b4; }
@media (max-width: 700px) {
  .log-list-heading { flex-direction: column; gap: 10px; }
  .log-record-grid, .setup-complete-grid { grid-template-columns: 1fr; }
  .setup-route { gap: 5px; }
  .setup-route li { padding: 10px 8px; }
  .setup-route small { font-size: 11px; }
  .log-table, .log-table tbody, .log-table tr { display: block; min-width: 0; }
  .log-table thead { display: none; }
  .log-table tbody tr { padding: 14px 12px; border-bottom: 1px solid var(--line); }
  .log-table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .log-table td[data-label]:before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
  .log-table td[data-label="체험"] { flex-wrap: wrap; }
  .log-table td[data-label="체험"] strong { margin-left: auto; }
  .log-table td:last-child { display: block; padding-top: 12px; }
  .log-table td:last-child .btn { width: 100%; }
}
.welcome { width: min(1180px, 100%); grid-template-columns: .95fr 1.05fr; }
.welcome-side { gap: 24px; padding: 30px; justify-content: flex-start; }
.welcome-foot { margin-top: auto; }
.welcome-side > div { position: relative; z-index: 1; }
.welcome-side h1 { font-size: clamp(26px, 2.4vw, 33px); }
.welcome-side p, .welcome-heading p, .scenario p { font-size: 14px; line-height: 1.75; color: var(--muted); }
.welcome-body { padding: 20px 28px; }
.welcome-heading h2 { margin: 6px 0 4px; }
.welcome-heading p { margin-bottom: 16px; }
.welcome-notice, .brief-heading p, .brief-notice, .brief-section dd { font-size: 14px; color: var(--muted); }
.scenario { padding: 10px 14px; margin-bottom: 8px; gap: 12px; }
.scenario h3 { margin: 3px 0; font-size: 16px; line-height: 1.5; }
.scenario p { line-height: 1.6; }
.scenario-label, .brief-label, .brief-section dt { font-size: 12px; }
.scenario-group-title { margin: 12px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.scenario-group-title:first-child { margin-top: 0; }
.scenario:first-of-type { border-color: #8298ee; background: var(--blue-soft); }
.product-flow { display: grid; gap: 9px; padding: 0; margin: 22px 0 12px; list-style: none; }
.product-flow li { position: relative; display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 12px 14px; }
.product-flow li + li:before { content: '↓'; position: absolute; left: 20px; top: -14px; color: var(--muted); font-size: 13px; }
.product-flow b { font-size: 14px; }
.product-flow span { color: var(--muted); font-size: 13px; line-height: 1.6; }
.product-flow .product-flow-protection { border: 2px solid #728bed; background: var(--blue-soft); }
.welcome-side .product-flow-note { font-size: 12px; line-height: 1.7; }
.home-flow { margin: 0 0 16px; }
.demo-context { margin: 0 0 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.demo-context-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.demo-context-head > div > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.demo-context-head h2 { margin: 5px 0 0; font-size: 16px; }
.demo-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0 10px; }
.demo-context-grid > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); }
.demo-context-grid dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.demo-context-grid dd { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.demo-context p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; word-break: keep-all; }
.demo-context .btn { margin-top: 12px; }
.selected-law small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.5; }
.inspection-scope { margin: 0 0 14px; padding: 12px 14px; border-left: 3px solid var(--blue); background: var(--surface2); color: var(--muted); font-size: 14px; line-height: 1.7; }
.inspection-scope strong { color: var(--text); }
.result-scope { margin-bottom: 14px; }
.privacy-transfer { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.privacy-transfer-text { margin: 14px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.medical-transfer-scope { margin: 4px 0 16px; padding: 14px; border-left: 3px solid var(--blue); border-radius: 4px; background: var(--surface); }
.demo-answer-protection .medical-transfer-scope h3 { margin: 0; }
.approval-context { margin-bottom: 16px; }
.product-roles { margin: 20px 0 0; font-size: 14px; line-height: 1.8; }
.product-roles dt { font-weight: 700; color: var(--text); }
.product-roles dd { margin: 3px 0 16px; color: var(--muted); }
.demo-answer-protection summary { cursor: pointer; color: var(--blue); padding: 10px 0; font-weight: 700; font-size: 14px; }
.demo-answer-protection h3 { margin-top: 14px; }
.page-head p, .sub, .panel .sub, .notice, .field, .tour p, .table td, .demo-answer-protection p { font-size: 14px; }
.nav-item, .top-button, .btn, .tour-foot button { font-size: 13px; }
.table th, .badge, .tour-top span, .setup-key-card small, .setup-summary div, .demo-file small, .brief-journey { font-size: 12px; }
.welcome-notice { color: var(--muted); }
.tour.is-paused { border-style: dashed; }
.dark .scenario:first-of-type { background: var(--blue-soft); }
.dark .product-flow-protection { border-color: #a6b6ff; }

/* 실제 제품의 메뉴, 목록, 설정 창과 채팅 화면을 시연 데이터로 재구성합니다. */
@media (min-width: 701px) {
  .shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { width: 220px; }
}
.sidebar { padding: 14px; box-shadow: none; }
.brand { height: 52px; padding: 2px 8px 12px; margin-bottom: 2px; border-bottom: 0; }
.brand img { width: 145px; height: 34px; }
.brand:after { content: none; }
.sidebar nav { padding: 0 3px 10px; }
.nav-heading { margin: 18px 8px 6px; font-size: 10px; }
.nav-item { min-height: 32px; padding: 7px 9px; margin: 1px 0; gap: 9px; border-radius: 6px; font-size: 13px; }
.nav-item.active { color: white; background: #3b5bdb; box-shadow: none; }
.nav-item.active:before { content: none; }
.nav-item.active .icon { color: white; }
.nav-item:disabled { cursor: default; opacity: .68; }
.nav-item.nav-cue { color: #2747c4; background: #eef2ff; box-shadow: 0 0 0 2px #8298ee; }
.topbar { height: 58px; padding: 0 28px; background: var(--bg); backdrop-filter: none; }
.topbar #eyebrow { color: var(--blue); }
.topbar #eyebrow:before { content: none; }
.content { max-width: none; padding: 30px 28px 90px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; letter-spacing: -.035em; }
.panel { border-radius: 7px; padding: 20px; box-shadow: 0 1px 2px #0f172a0a; }
.setup-config-panel { max-width: none; }
.setup-client-fields { grid-template-columns: 1fr; }
.setup-client-method { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.setup-client-method p { margin-top: 8px; line-height: 1.6; }
.replica-list-panel { padding: 0; overflow: hidden; }
.replica-demo-context { margin-bottom: 14px; color: var(--muted); }
.replica-demo-context > summary { cursor: pointer; color: var(--blue); font-weight: 700; padding: 8px 0; }
.replica-demo-context .demo-context { margin-top: 8px; }
.replica-list-panel > .panel-title, .replica-list-panel > .setup-actions { margin: 18px 20px; }
.replica-list-panel .table { min-width: 620px; }
.replica-log-filters { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)); gap: 12px; margin-bottom: 16px; }
.replica-log-filters label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.replica-log-filters .control { width: 100%; }
.replica-log-filters p { grid-column: 1/-1; margin: 0; font-size: 12px !important; }
.replica-log-input { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.replica-model-table td, .replica-list-panel .table td { padding: 14px 18px; }
.replica-drawer-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(16,24,40,.45); display: flex; justify-content: flex-end; }
.replica-drawer { width: min(650px, 100%); height: 100%; padding: 26px; background: var(--surface); overflow-y: auto; box-shadow: -8px 0 30px #10182824; }
.replica-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.replica-drawer-head h2 { margin: 0; font-size: 19px; }
.replica-drawer .field { margin: 20px 0; }
.replica-setting-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.replica-setting-item small { color: var(--muted); font-size: 12px; }
.replica-tabs { display: flex; gap: 4px; width: fit-content; padding: 4px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.replica-tabs span { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.replica-tabs .active { border-radius: 5px; color: var(--blue); background: var(--blue-soft); font-weight: 700; }
.replica-pack-group { margin-top: 20px; }
.replica-pack-group h3 { margin: 0 0 10px; font-size: 14px; }
.replica-pack-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 370px); gap: 0 24px; align-items: start; }
.replica-pack-primary { min-width: 0; }
.replica-pack-other { grid-column: 1 / -1; }
.workspace .replica-pack-layout > .tour { width: 100%; margin: 20px 0 0; }
.replica-pack-actions { align-items: center; justify-content: space-between; }
.replica-pack-hint { flex: 1 1 220px; color: var(--muted); font-size: 13px; line-height: 1.5; }
@media (max-width: 900px) { .replica-pack-layout { grid-template-columns: minmax(0, 1fr); } .replica-pack-other { grid-column: auto; } .workspace .replica-pack-layout > .tour { margin-top: 16px; } }
.replica-unavailable { margin-top: 8px; }
.replica-unavailable small { color: var(--muted); }
.replica-drawer-actions { margin-top: 28px; }
.replica-drawer .tour { position: static; width: min(100%,370px); margin: 15px 0 0 auto; }
.workspace .tour p { color: #d0dbeb; }
/* Place the setup guide beneath the action on the right, ahead of the list. */
.replica-list-panel > .panel-title + .tour {
  width: min(370px, calc(100% - 40px));
  max-width: calc(100% - 40px);
  margin: 0 20px 18px auto;
}
.replica-log-security { padding: 18px; }
.replica-log-security label { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.replica-log-security .control { margin-top: 7px; }
.replica-log-filters { grid-template-columns: repeat(4,minmax(145px,1fr)); gap: 12px 16px; }
.replica-log-filters label:nth-child(5) { grid-column: span 1; }
.replica-log-filters .replica-live-filter { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 42px; color: var(--muted); font-weight: 700; }
.replica-log-list { padding: 0; overflow: hidden; }
.replica-log-table { min-width: 1070px; }
.replica-log-table th, .replica-log-table td { white-space: nowrap; vertical-align: middle; }
.replica-log-table th:last-child, .replica-log-table tr:not(.replica-log-detail-row) td:last-child { position: sticky; right: 0; z-index: 1; background: var(--surface); }
.replica-log-table tr.log-row-current td:last-child { background: var(--blue-soft); }
.replica-log-table th:last-child { background: var(--surface2); }
.replica-log-table td:nth-child(4) { max-width: 260px; white-space: normal; }
.replica-log-table .replica-log-detail-row > td { padding: 0; white-space: normal; }
.replica-log-expand { display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted); font-size: 22px; min-width: 36px; min-height: 36px; }
.replica-log-expand:hover { color: var(--blue); background: var(--blue-soft); border-radius: 6px; }
.replica-log-path { display: inline-block; border: 1px solid #dce4ff; border-radius: 6px; padding: 5px 8px; color: var(--blue); background: var(--blue-soft); font-size: 12px; }
.replica-log-detail { position: sticky; z-index: 2; left: 0; width: min(100%, calc(100vw - 304px)); padding: 18px; background: var(--surface); border-left: 3px solid #b2c0f6; }
.replica-log-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.replica-log-detail-head strong, .replica-log-detail-head small { display: block; }
.replica-log-detail-head small { color: var(--muted); margin-top: 5px; }
.replica-log-section { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface2); }
.replica-log-section h2, .replica-log-summary h2 { margin: 0 0 9px; font-size: 14px; }
.replica-log-section p { margin: 6px 0; }
.replica-log-section pre { margin: 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.7; }
.replica-log-answer { border-left: 3px solid #91a4fa; background: var(--blue-soft); }
.replica-log-summary { padding: 15px 0; }
.replica-log-summary dl { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 14px; margin: 0; }
.replica-log-summary dt { color: var(--muted); font-size: 12px; }
.replica-log-summary dd { margin: 4px 0 0; font-weight: 700; }
.replica-log-detail-row .tour { margin: 12px 18px 18px auto; }
.replica-log-detail-head + .tour, .log-guide-intro + .tour { margin-left: auto; margin-bottom: 14px; }
/* 로그 안내는 목록과 상세 내용을 아래로 밀지 않도록 화면 위에 둡니다. */
.workspace .replica-log-detail-row .tour, .workspace .log-guide-intro + .tour {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  width: min(370px, calc(100vw - 40px));
  max-height: min(70vh, 500px);
  overflow-y: auto;
  margin: 0;
}
.workspace .log-guide-intro + .tour { top: 80px; bottom: auto; right: 22px; }
@media (max-width: 700px) {
  .workspace .replica-log-detail-row .tour, .workspace .log-guide-intro + .tour { right: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); max-height: 45vh; }
  .workspace .log-guide-intro + .tour { top: 72px; bottom: auto; right: 12px; }
}
.replica-log-json { text-decoration: none; white-space: nowrap; }
.replica-log-internal { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.replica-log-internal summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.replica-log-metrics { display: flex; flex-wrap: wrap; gap: 18px; align-items: end; padding: 16px 0; border-bottom: 1px solid var(--line); }
.replica-log-metrics > div { display: grid; gap: 5px; min-width: 78px; }
.replica-log-metrics span, .replica-log-metrics small { color: var(--muted); font-size: 12px; }
.replica-log-metrics strong { font-size: 14px; }
.replica-log-route { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.replica-log-route > div:first-child { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.replica-log-route h2, .replica-log-usage h2 { margin: 0; font-size: 14px; }
.replica-log-route > div:first-child span, .replica-log-route p { color: var(--muted); font-size: 12px; }
.replica-route-row { display: grid; grid-template-columns: 110px minmax(0,1fr); align-items: center; gap: 12px; margin: 8px 0; font-size: 12px; }
.replica-route-row i { display: block; height: 8px; border-radius: 2px; width: calc(100% / var(--steps)); margin-left: calc(100% / var(--steps) * var(--step)); background: #8198ed; }
.replica-route-row:last-of-type i { background: #526cdb; }
.replica-log-route p { margin: 14px 0 0; }
.replica-log-usage { margin: 10px 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.replica-log-usage h2 { margin-bottom: 10px; }
.replica-log-usage > div { display: inline-flex; gap: 12px; min-width: 100px; color: var(--muted); }
.replica-log-usage strong { color: var(--text); }
.case-file-card { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface2); }
.case-file-card > div:first-child { flex: 1 1 240px; }
.case-file-card p { margin: 5px 0 0; }
.case-file-table { width: 100%; margin: 12px 0 0; border-collapse: collapse; font-size: 13px; }
.case-file-table th, .case-file-table td { padding: 8px; text-align: left; border-bottom: 1px solid var(--line); }
.case-file-table th { color: var(--muted); }
.case-download { display: inline-flex; margin-top: 10px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media(max-width: 1000px) { .replica-log-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width: 700px) { .replica-log-filters { grid-template-columns: 1fr 1fr; } .replica-log-detail { width: min(100%, calc(100vw - 52px)); } }
.replica-playground { display: grid; grid-template-columns: minmax(250px, .38fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.replica-settings-box { background: var(--surface2); border: 1px solid var(--line); border-radius: 7px; padding: 12px; }
.replica-settings-box .field { margin: 0 0 14px; }
.replica-conversation { min-width: 0; }
.replica-messages { display: flex; flex-direction: column; gap: 12px; min-height: 330px; max-height: 470px; overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface2); }
.replica-empty { display: grid; place-items: center; flex: 1; min-height: 260px; color: var(--muted); }
.replica-user-message, .replica-assistant-message { max-width: 90%; padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); line-height: 1.65; }
.replica-user-message { align-self: flex-end; background: var(--blue-soft); }
.replica-assistant-message { align-self: flex-start; }
.replica-user-message b, .replica-assistant-message b, .replica-assistant-message small { display: block; }
.replica-assistant-message small { margin-top: 4px; color: var(--muted); }
.replica-user-message p, .replica-assistant-message pre { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.replica-conversation .field textarea { min-height: 130px; }
.case-next-actions, .case-log-actions { margin-top: 16px; display: flex; justify-content: flex-end; }
.case-medical-note { margin-top: 12px; }
.replica-policy-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, .37fr); align-items: start; }
.replica-policy-chat { min-height: 510px; }
.replica-policy-conversation { display: flex; flex-direction: column; min-height: 220px; }
.replica-policy-empty { margin: auto; text-align: center; color: var(--muted); }
.replica-policy-empty > span { display: grid; place-items: center; margin: 0 auto 14px; width: 44px; height: 44px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 22px; }
.replica-policy-empty h2 { color: var(--text); }
.replica-policy-empty p { margin: 4px 0; }
.replica-policy-compose { max-width: 760px; margin: 0 auto; }
.replica-policy-compose .field { margin: 12px 0; }
.replica-policy-compose textarea { min-height: 110px; }
.replica-policy-result { width: min(100%,760px); margin: 0 auto; }
.policy-example-answer { max-width: 100%; margin: 14px 0 18px; }
.policy-chat-answer { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 12px; width: min(100%,760px); margin: 18px auto; align-self: flex-start; }
.assistant-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 19px; }
.assistant-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 9px; margin: 2px 0 8px; }
.assistant-heading strong { color: var(--text); font-size: 14px; }
.assistant-heading span { color: var(--muted); font-size: 11px; }
.assistant-content { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid #617ef4; border-radius: 8px; background: var(--surface); line-height: 1.7; }
.assistant-content p { margin: 0 0 8px; }
.assistant-content p:last-child { margin-bottom: 0; }
.assistant-content pre { margin: 0; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.replica-policy-actions { width: min(100%,760px); margin: 0 auto; }
.case-policy-result { width: min(100%,760px); margin: 16px auto; }
.replica-law-heading { align-items: center; margin-bottom: 12px; }
.replica-law-heading h2 { margin: 0; }
.replica-law-heading > span { white-space: nowrap; font-size: 12px; }
.replica-law-notice { margin: 0 0 12px; line-height: 1.55; font-size: 12px !important; }
.replica-policy-list { max-height: none; overflow: visible; padding: 8px; border-top: 1px solid var(--line); }
.replica-policy-list .law-row { min-height: 47px; padding: 13px 8px; border-top: 0; border-bottom: 1px solid var(--line); }
.replica-policy-list .law-row.guide-focus { outline-offset: -3px !important; box-shadow: inset 0 0 0 2px #a8b8ff !important; border-radius: 8px; }
.replica-policy-list .law-row label { display: inline; font-size: 13px; }
.replica-policy-list .law-row > small { float: right; margin: 2px 0 0 8px; font-size: 10px; }
.replica-policy-list .law-facts { margin-bottom: 8px; }
.replica-policy-list .law-facts label { display: block; }
.replica-law-unavailable input { opacity: .55; }
.policy-cards > .approval-context { margin: 14px 0 0; font-size: 12px !important; line-height: 1.6; }
.dark .nav-item.active { background: #3b5bdb; color: #fff; }
.dark .nav-item.active .icon { color: #fff; }
.dark .replica-drawer-backdrop { background: rgba(0,0,0,.65); }
@media(max-width: 1000px) {
  .replica-playground, .replica-policy-layout { grid-template-columns: 1fr; }
  .replica-log-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .replica-settings { margin-bottom: 0; }
}
@media(max-width: 700px) {
  .sidebar { width: 220px; }
  .topbar { height: 60px; padding: 0 15px; }
  .content { padding: 24px 15px 70px; }
  .replica-drawer { padding: 20px; }
  .replica-user-message, .replica-assistant-message { max-width: 100%; }
  .replica-messages { min-height: 240px; }
  .replica-empty { min-height: 180px; }
}
@media (max-width: 850px) {
  .welcome { grid-template-columns: 1fr; }
  .welcome-side { gap: 20px; }
  .welcome-side:after, .welcome-foot { display: none; }
}
@media (max-width: 500px) {
  .welcome-side, .welcome-body { padding: 22px; }
  .demo-context-grid { grid-template-columns: 1fr; }
  .product-flow li { grid-template-columns: 1fr; gap: 4px; }
  .scenario { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .scenario-icon { width: 38px; height: 38px; }
  .scenario-arrow { display: none; }
  .welcome-side h1 { font-size: 26px; }
}

/* Keep the selector within the viewport without hiding its controls. */
@media (min-width: 851px) {
  #landing { align-items: center; padding: 16px; overflow: hidden; }
  #landing .welcome { max-height: calc(100dvh - 32px); min-height: 0; grid-template-rows: minmax(0, 1fr); }
  #landing .welcome-side, #landing .welcome-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #landing .welcome-side { background-image: radial-gradient(circle at 100% 110%, transparent 0 164px, #bac7ff 165px, transparent 166px), linear-gradient(145deg, #f8faff 0%, #edf2ff 65%, #e6eaff 100%); }
  #landing .welcome-side:after { display: none; }
}
@media (min-width: 851px) and (max-height: 850px) {
  #landing .welcome-side { gap: 12px; padding: 18px 24px; }
  #landing .welcome-side > img { width: 130px; }
  #landing .welcome-side h1 { margin: 10px 0; font-size: clamp(23px, 2vw, 29px); }
  #landing .welcome-side p { font-size: 12px; line-height: 1.5; }
  #landing .product-flow { gap: 6px; margin: 12px 0 9px; }
  #landing .product-flow li { padding: 8px 12px; }
  #landing .product-flow b, #landing .product-flow span { font-size: 12px; line-height: 1.4; }
  #landing .welcome-foot .shield-art { width: 40px; height: 40px; }
  #landing .welcome-body { padding: 14px 22px; }
  #landing .welcome-heading h2 { font-size: 20px; }
  #landing .welcome-heading p { margin-bottom: 8px; font-size: 12px; }
  #landing .scenario-group-title { margin: 7px 0 5px; font-size: 12px; }
  #landing .scenario { grid-template-columns: 38px minmax(0, 1fr) 18px; gap: 10px; padding: 7px 12px; margin-bottom: 5px; }
  #landing .scenario-icon { width: 38px; height: 38px; border-radius: 11px; }
  #landing .scenario-icon svg { width: 21px; height: 21px; }
  #landing .scenario-label { font-size: 10px; }
  #landing .scenario h3 { font-size: 14px; line-height: 1.3; }
  #landing .scenario p { font-size: 12px; line-height: 1.35; }
  #landing .browse { padding: 8px 0; }
  #landing .welcome-notice { padding-top: 9px; font-size: 12px; }
}

/* Guide outlines stay inside the scrolling sidebar instead of being clipped. */
.sidebar .nav-item.guide-focus, .sidebar .nav-item:focus-visible { outline-offset: -3px !important; box-shadow: inset 0 0 0 2px #879afc !important; }
.replica-demo-context > .privacy-output-demo { min-height: 0; max-height: 220px; overflow: auto; }

/* Keep chat actions together so guidance never separates or overlaps them. */
.replica-conversation .replica-chat-explanation { margin-top: 14px; }
.replica-conversation .replica-chat-actions { flex-wrap: wrap; justify-content: flex-start; gap: 12px 18px; }
.replica-chat-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.replica-chat-actions > .sub { flex: 1 1 220px; min-width: 0; }
@media (min-width: 1201px) and (min-height: 650px) {
  .workspace .replica-conversation > .tour {
    position: fixed; left: 260px; right: auto; bottom: 22px; z-index: 90;
    width: min(330px, calc(27.5vw - 92px)); max-height: min(55vh, 380px);
    overflow-y: auto; margin: 0;
  }
}
