:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #69736e;
  --faint: #919a95;
  --line: #e2e7e3;
  --soft-line: #edf0ee;
  --canvas: #f6f8f6;
  --paper: #ffffff;
  --sidebar: #f1f4f1;
  --accent: #155c46;
  --accent-strong: #0f4938;
  --accent-soft: #e5f0eb;
  --accent-pale: #f0f7f3;
  --warning: #9a6717;
  --danger: #a13f3f;
  --shadow: 0 14px 40px rgba(21, 45, 36, .10);
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.workspace-app { overflow: hidden; background: var(--paper); }
.app-frame { display: grid; grid-template-columns: 236px minmax(0, 1fr) 288px; min-height: 100vh; }
.sidebar, .inspector { background: var(--sidebar); }
.sidebar { display: flex; flex-direction: column; padding: 24px 16px 18px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 4px; color: var(--ink); text-decoration: none; font-family: inherit; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark, .welcome-mark { display: inline-grid; place-items: center; color: white; background: var(--accent); font-family: inherit; font-weight: 700; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; }
.new-analysis { display: flex; align-items: center; gap: 8px; width: 100%; margin: 30px 0 22px; padding: 13px 14px; border: 0; border-radius: 9px; color: white; background: var(--accent); box-shadow: 0 5px 12px rgba(21, 92, 70, .16); font-weight: 700; cursor: pointer; }
.new-analysis:hover { background: var(--accent-strong); }
.sidebar a.new-analysis { text-decoration: none; }
.nav-section { min-height: 0; }
.nav-label, .eyebrow { margin: 0; color: var(--faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.nav-label { padding: 0 7px 8px; }
.history-list { display: grid; gap: 3px; }
.history-item, .side-link { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 7px; color: #3e4944; background: transparent; text-align: left; text-decoration: none; cursor: pointer; }
.history-item { width: 100%; padding: 10px 9px; font-size: 13px; }
.history-item span { color: #8d9691; font-size: 10px; letter-spacing: .08em; }
.history-item:hover, .history-item.active, .side-link:hover, .side-link.active { color: var(--accent-strong); background: #dfe9e4; }
.history-item.active { font-weight: 700; }
.privacy-note { margin: 18px 8px 0; color: #8b938f; font-size: 10px; line-height: 1.55; }
.sidebar-footer { display: grid; gap: 4px; margin-top: auto; padding-top: 24px; border-top: 1px solid var(--line); }
.side-link { padding: 10px 9px; font-size: 13px; }
.side-link span { width: 18px; text-align: center; color: #75817b; }

.chat-workspace { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; min-width: 0; background: var(--paper); }
.workspace-header { z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 84px; padding: 14px 30px; border-bottom: 1px solid var(--soft-line); background: rgba(255,255,255,.96); }
.workspace-header h1, .page-header h1 { margin: 5px 0 0; font-family: inherit; font-weight: 500; letter-spacing: -.025em; }
.workspace-header h1 { font-size: 22px; }
.model-picker { position: relative; width: 194px; }
.model-picker summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; min-height: 54px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: white; cursor: pointer; list-style: none; }
.model-picker summary::-webkit-details-marker { display: none; }
.model-picker summary:hover { border-color: #bac9c1; }
.model-picker summary strong, .model-picker summary small { display: block; }
.model-picker summary strong { font-size: 12px; }
.model-picker summary small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 999px; background: #3ab886; box-shadow: 0 0 0 4px rgba(58,184,134,.10); }
.status-dot.muted { background: #9da6a1; box-shadow: none; }
.chevron { color: var(--muted); }
.model-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: 390px; max-height: min(570px, calc(100vh - 110px)); overflow: auto; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.model-group + .model-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--soft-line); }
.model-group > p { margin: 5px 7px; color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.model-option { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; width: 100%; padding: 10px; border: 1px solid transparent; border-radius: 8px; background: white; text-align: left; cursor: pointer; }
.model-option:hover, .model-option.selected { border-color: #cfe0d7; background: var(--accent-pale); }
.model-option strong, .model-option small { display: block; }
.model-option strong { font-size: 12px; }
.model-option small, .model-metrics { margin-top: 3px; color: var(--muted); font-size: 10px; }
.model-metrics { align-self: center; white-space: nowrap; }
.model-settings-link { display: block; margin-top: 8px; padding: 10px; border-top: 1px solid var(--soft-line); color: var(--accent); text-align: right; text-decoration: none; font-size: 11px; font-weight: 700; }

.conversation { overflow-y: auto; min-height: 0; padding: 38px clamp(24px, 5vw, 74px) 26px; scroll-behavior: smooth; }
.welcome { max-width: 720px; margin: 7vh auto 0; text-align: center; }
.welcome-mark { width: 42px; height: 42px; margin-bottom: 15px; border-radius: 12px; font-size: 22px; }
.welcome h2 { margin: 11px 0 10px; font-family: inherit; font-size: clamp(25px, 3vw, 34px); font-weight: 500; letter-spacing: -.035em; }
.welcome > p:not(.eyebrow) { margin: 0 auto; max-width: 560px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.prompt-examples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 32px; text-align: left; }
.prompt-examples button { min-height: 102px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.prompt-examples button:hover { border-color: #adc8bb; background: var(--accent-pale); transform: translateY(-1px); }
.prompt-examples span, .prompt-examples strong { display: block; }
.prompt-examples span { margin-bottom: 14px; color: var(--accent); font-size: 10px; font-weight: 700; }
.prompt-examples strong { font-size: 12px; line-height: 1.55; }

.message { max-width: 760px; margin: 0 auto 24px; }
.user-message { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 12px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #eef1ef; color: #53605a; font-size: 11px; font-weight: 700; }
.avatar.ai { color: white; background: var(--accent); font-family: inherit; }
.message-meta { margin-bottom: 8px; color: var(--faint); font-size: 10px; }
.user-copy { margin: 0; color: #303a35; font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-message { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 12px; margin-top: 30px; }
.ai-body { min-width: 0; }
.preview-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 7px; padding: 3px 7px; border-radius: 999px; color: #855d21; background: #fff5df; font-size: 9px; font-weight: 700; }
.answer-stack { display: grid; gap: 11px; }
.answer-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.answer-title { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; font-family: inherit; font-size: 16px; }
.answer-title span { color: #829087; font-family: inherit; font-size: 10px; }
.answer-card p { margin: 0; color: #4c5751; font-size: 12px; line-height: 1.85; }
.issue-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.issue { padding: 13px; border-left: 2px solid var(--accent); background: #f6f8f6; }
.issue small, .issue strong { display: block; }
.issue small { margin-bottom: 8px; color: var(--accent); font-size: 9px; }
.issue strong { font-size: 12px; }
.case-list { display: grid; gap: 8px; }
.case-card { padding: 13px; border: 1px solid var(--soft-line); border-radius: 7px; background: #fbfcfb; }
.case-card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.case-card-head strong { font-family: inherit; font-size: 13px; }
.similarity { color: var(--accent); font-size: 10px; font-weight: 700; }
.case-card small { color: var(--muted); font-size: 10px; }
.analysis-sections { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 0; }
.analysis-sections dt, .analysis-sections dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--soft-line); font-size: 12px; line-height: 1.7; }
.analysis-sections dt { color: var(--accent); font-weight: 700; }
.analysis-sections dd { color: #4c5751; }
.loading-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.loading-row { height: 10px; margin: 10px 0; border-radius: 999px; background: linear-gradient(90deg,#edf0ee 25%,#f8faf9 45%,#edf0ee 65%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.loading-row:nth-child(2) { width: 78%; }.loading-row:nth-child(3) { width: 56%; }
@keyframes shimmer { to { background-position: -100% 0; } }

.composer-wrap { z-index: 4; padding: 8px clamp(24px, 5vw, 74px) 14px; background: linear-gradient(transparent, white 14%); }
.demo-disclosure { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 0 auto 8px; color: #7e8581; font-size: 10px; }
.composer { max-width: 760px; margin: 0 auto; padding: 13px 13px 10px; border: 1px solid #cad4ce; border-radius: 14px; background: white; box-shadow: 0 8px 30px rgba(24,50,40,.09); }
.composer:focus-within { border-color: #719b88; box-shadow: 0 8px 32px rgba(21,92,70,.12); }
.composer textarea { display: block; width: 100%; min-height: 76px; max-height: 240px; resize: vertical; padding: 4px 5px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; line-height: 1.65; }
.composer textarea::placeholder { color: #9ca49f; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 6px; }
.file-chip { max-width: 220px; padding: 6px 9px; border-radius: 6px; color: #4f5c55; background: #edf3f0; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-toolbar, .tool-buttons { display: flex; align-items: center; gap: 8px; }
.composer-toolbar { justify-content: space-between; margin-top: 9px; }
.tool-button, .analysis-modes button { padding: 7px 9px; border: 0; border-radius: 7px; color: #5c6862; background: transparent; font-size: 10px; cursor: pointer; }
.tool-button:hover, .analysis-modes button:hover { background: #f0f3f1; }
.analysis-modes { display: flex; padding-left: 7px; border-left: 1px solid var(--line); }
.analysis-modes button.active { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.submit-analysis { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 0; border-radius: 8px; color: white; background: var(--accent); font-size: 11px; font-weight: 700; cursor: pointer; }
.submit-analysis:hover { background: var(--accent-strong); }
.submit-analysis:disabled { opacity: .55; cursor: wait; }
.submit-analysis span { font-size: 16px; line-height: .7; }
.legal-disclaimer { max-width: 760px; margin: 7px auto 0; color: #9aa19d; text-align: center; font-size: 9px; }

.inspector { height: 100vh; overflow-y: auto; padding: 25px 20px; border-left: 1px solid var(--line); }
.inspector-header { display: flex; align-items: flex-start; justify-content: space-between; }
.inspector h2 { margin: 7px 0 0; font-family: inherit; font-size: 22px; font-weight: 500; }
.pipeline-card { margin: 27px 0 20px; padding: 15px; border: 1px solid #d7e6de; border-radius: 8px; background: #e9f4ee; }
.pipeline-title { display: flex; align-items: center; gap: 8px; color: var(--accent); font-size: 12px; }
.pipeline-card p { margin: 10px 0 12px; color: #64716a; font-size: 10px; line-height: 1.55; }
.pipeline-line { height: 2px; overflow: hidden; background: #c5dcd1; }
.pipeline-line span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .5s ease; }
.pipeline-card.active .pipeline-line span { width: 100%; }
.analysis-stats { margin: 0; border-top: 1px solid var(--line); }
.analysis-stats div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.analysis-stats dt { margin-bottom: 6px; color: #8b9590; font-size: 10px; }
.analysis-stats dd { margin: 0; font-size: 11px; font-weight: 700; overflow-wrap: anywhere; }
.not-connected { display: inline-block; margin-left: 4px; padding: 2px 5px; border-radius: 4px; color: #87672e; background: #f6eddc; font-size: 8px; font-weight: 700; }
.scope-block { margin-top: 22px; }
.scope-block > div { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); color: #5e6963; font-size: 10px; }
.scope-block strong { color: var(--accent); font-size: 9px; }
.info-note { display: flex; gap: 8px; margin-top: 22px; padding: 12px; color: #737d78; background: #ecefec; font-size: 9px; line-height: 1.55; }
.info-note p { margin: 0; }
.text-link { display: inline-block; margin-top: 15px; color: var(--accent); font-size: 10px; font-weight: 700; text-decoration: none; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; }
.mobile-only { display: none; }
.backdrop { display: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Settings and admin routes */
.page-app { min-height: 100vh; background: var(--canvas); }
.page-shell { display: grid; grid-template-columns: 236px minmax(0,1fr); min-height: 100vh; }
.page-main { min-width: 0; padding: 38px clamp(24px, 6vw, 80px) 80px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; max-width: 1040px; margin: 0 auto 28px; }
.page-header h1 { font-size: 30px; }
.page-description { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.page-grid { display: grid; gap: 16px; max-width: 1040px; margin: 0 auto; }
.settings-card, .admin-card { border: 1px solid var(--line); border-radius: 12px; background: white; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px 15px; border-bottom: 1px solid var(--soft-line); }
.card-heading h2 { margin: 0; font-family: inherit; font-size: 19px; font-weight: 500; }
.card-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.card-body { padding: 18px 22px 22px; }
.form-row { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 25px; padding: 14px 0; border-bottom: 1px solid var(--soft-line); }
.form-row:last-child { border-bottom: 0; }
.provider-divider { margin-top: 18px; }
.field-label strong, .field-label small { display: block; }
.field-label strong { font-size: 12px; }
.field-label small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.field-control input[type="text"], .field-control input[type="password"], .field-control input[type="number"], .field-control select { width: min(100%, 440px); min-height: 40px; padding: 9px 11px; border: 1px solid #cfd7d2; border-radius: 7px; color: var(--ink); background: white; outline: 0; }
.field-control input:focus, .field-control select:focus { border-color: #6f9b87; box-shadow: 0 0 0 3px rgba(21,92,70,.08); }
.field-control input:disabled { color: #929a96; background: #f0f2f1; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; color: #58645e; background: white; font-size: 11px; }
.segmented input:checked + span { border-color: #9bb9aa; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.range-wrap { display: flex; align-items: center; gap: 14px; width: min(100%, 440px); }
.range-wrap input { flex: 1; accent-color: var(--accent); }
.range-value { min-width: 34px; padding: 4px 6px; border-radius: 5px; background: #eef2f0; text-align: center; font-size: 11px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; font-size: 11px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; width: 38px; height: 21px; border-radius: 999px; background: #cbd2ce; transition: .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: white; transition: .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 9px 14px; border-radius: 7px; text-decoration: none; font-size: 11px; font-weight: 700; cursor: pointer; }
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { border: 1px solid #cbd4cf; color: #49564f; background: white; }
.secondary-button:hover { background: #f4f6f5; }
.danger-button { border: 1px solid #e1baba; color: var(--danger); background: #fffafa; }
button:disabled, .disabled { opacity: .5; cursor: not-allowed; }
.form-status { min-height: 18px; margin: 12px 0 0; color: var(--muted); font-size: 10px; }
.form-status.success { color: var(--accent); }.form-status.error { color: var(--danger); }
.pill { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 9px; font-weight: 700; white-space: nowrap; }
.pill.neutral { color: #6e7772; background: #eef0ef; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card { min-height: 122px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: 10px; }
.metric-card strong { margin: 18px 0 7px; font-family: inherit; font-size: 25px; font-weight: 500; }
.metric-card small { color: #8d9691; font-size: 9px; }
.category-bars { display: grid; gap: 13px; }
.category-row { display: grid; grid-template-columns: 70px minmax(0,1fr) 60px; align-items: center; gap: 12px; font-size: 11px; }
.category-row strong { text-align: right; }
.bar { height: 7px; overflow: hidden; border-radius: 999px; background: #edf0ee; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-state { padding: 24px; border: 1px dashed #cad3ce; border-radius: 8px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.7; }

@media (max-width: 1120px) {
  .app-frame { grid-template-columns: 218px minmax(0,1fr); }
  .inspector { position: fixed; top: 0; right: 0; z-index: 40; width: min(340px, 88vw); transform: translateX(102%); box-shadow: var(--shadow); transition: transform .22s ease; }
  .inspector.open { transform: translateX(0); }
  #open-inspector, #close-inspector { display: grid; }
  .workspace-header { grid-template-columns: minmax(0,1fr) auto auto; gap: 12px; }
  .backdrop { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100%; border: 0; background: rgba(15,30,24,.24); }
  .backdrop:not([hidden]) { display: block; }
}

@media (max-width: 780px) {
  .mobile-only { display: grid; }
  .workspace-app { overflow: auto; }
  .app-frame { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 40; width: min(280px, 86vw); height: 100vh; transform: translateX(-102%); box-shadow: var(--shadow); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .chat-workspace { height: 100dvh; }
  .workspace-header { grid-template-columns: auto minmax(0,1fr) auto auto; min-height: 72px; padding: 11px 14px; }
  .workspace-header h1 { font-size: 18px; }
  .model-picker { width: 145px; }
  .model-picker summary { min-height: 45px; padding: 8px; }
  .model-picker summary small { display: none; }
  .model-menu { position: fixed; top: 69px; right: 10px; width: min(390px, calc(100vw - 20px)); }
  .conversation { padding: 25px 14px 20px; }
  .welcome { margin-top: 3vh; }
  .prompt-examples { grid-template-columns: 1fr; }
  .prompt-examples button { min-height: 76px; }
  .composer-wrap { padding: 7px 10px 9px; }
  .composer-toolbar { align-items: flex-end; }
  .tool-buttons { align-items: flex-start; }
  .analysis-modes { display: none; }
  .submit-analysis { white-space: nowrap; }
  .issue-grid { grid-template-columns: 1fr; }
  .analysis-sections { grid-template-columns: 1fr; }
  .analysis-sections dt { padding-bottom: 2px; border-bottom: 0; }
  .analysis-sections dd { padding-top: 2px; }
  .page-shell { display: block; }
  .page-shell > .sidebar { display: flex; }
  .page-main { padding: 24px 14px 60px; }
  .page-header { align-items: flex-start; }
  .page-header .icon-button { display: grid; }
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 480px) {
  .model-picker { width: 128px; }
  .model-picker summary strong { font-size: 10px; }
  .workspace-header .eyebrow { display: none; }
  .workspace-header h1 { margin: 0; font-size: 15px; }
  .demo-disclosure { line-height: 1.45; }
  .composer { border-radius: 12px; }
  .tool-button { padding-left: 4px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 25px; }
  .category-row { grid-template-columns: 52px minmax(0,1fr) 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.error-card {
  border: 1px solid #d9a6a0;
  background: #fff7f5;
  border-radius: 8px;
  padding: 18px;
  color: #6d2f28;
}
.error-card p { margin: 8px 0 0; line-height: 1.65; }
.retry-button {
  margin-top: 12px;
  border: 1px solid #8f3d34;
  background: #fff;
  color: #71352d;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}
.analysis-progress { margin: 0 0 14px; color: var(--deep-green); font-weight: 700; }
.case-document { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.case-document summary { cursor: pointer; color: var(--deep-green); font-weight: 700; }
.case-document pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  background: #f7f8f6;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}
.reference-list { margin: 0; padding-left: 20px; line-height: 1.7; }
.history-empty { padding: 8px 12px; color: var(--muted); font-size: 13px; }
.model-option:disabled { opacity: .52; cursor: not-allowed; }

/* 2026 visual refresh — calm legal workspace */
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/ibm-plex-sans-kr-latin-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/ibm-plex-sans-kr-korean-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/ibm-plex-sans-kr-latin-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/ibm-plex-sans-kr-korean-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}:root {
  --ink: #14231d;
  --muted: #65736c;
  --faint: #87938d;
  --line: #d9e0da;
  --soft-line: #e7ebe7;
  --canvas: #f1f3ed;
  --paper: #fafbf7;
  --sidebar: #123d31;
  --accent: #14634b;
  --accent-strong: #0d4938;
  --accent-soft: #dcebe3;
  --accent-pale: #eff5f0;
  --acid: #c8e86f;
  --deep-green: var(--accent);
  --text: var(--ink);
  --shadow: 0 18px 55px rgba(20, 46, 36, .11);
  font-family: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-synthesis: weight;
}

body, button, input, textarea, select { font-family: inherit; }
.brand, .brand-mark, .welcome-mark, .workspace-header h1, .page-header h1,
.welcome h2, .avatar.ai, .answer-title, .case-card-head strong,
.inspector h2, .card-heading h2, .metric-card strong { font-family: inherit; }

.app-frame { grid-template-columns: 222px minmax(0, 1fr) 304px; }
.sidebar {
  padding: 26px 15px 18px;
  border: 0;
  color: #e8f0eb;
  background: var(--sidebar);
}
.brand { gap: 11px; padding: 0 5px; color: #f6faf7; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 11px 11px 3px 11px;
  color: var(--sidebar); background: var(--acid); font-size: 13px; font-weight: 700;
}
.new-analysis {
  min-height: 46px; margin: 32px 0 26px; padding: 0 14px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px; color: #123d31; background: var(--acid); box-shadow: none; font-size: 12px;
}
.new-analysis:hover { color: white; background: transparent; border-color: rgba(255,255,255,.45); }
.nav-label, .sidebar .eyebrow { color: #8eaaa0; }
.nav-label, .eyebrow { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 9px; letter-spacing: .14em; }
.history-list { gap: 4px; }
.history-item, .side-link { border-radius: 10px; color: #b9cbc4; }
.history-item { padding: 11px 10px; font-size: 12px; }
.history-item span { color: #759287; font-family: ui-monospace, Consolas, monospace; }
.history-item:hover, .history-item.active, .side-link:hover, .side-link.active { color: white; background: rgba(255,255,255,.09); }
.history-item.active { box-shadow: inset 2px 0 0 var(--acid); }
.privacy-note { color: #7f9b91; }
.sidebar-footer { border-color: rgba(255,255,255,.12); }
.side-link { padding: 11px 9px; font-size: 12px; }
.side-link span { color: #8eaaa0; }

.chat-workspace {
  background:
    linear-gradient(90deg, transparent 47px, rgba(20,99,75,.055) 48px, transparent 49px),
    var(--paper);
}
.workspace-header {
  min-height: 76px; padding: 12px clamp(22px, 3vw, 40px); border: 0;
  background: rgba(250,251,247,.91); backdrop-filter: blur(16px);
}
.workspace-header h1 { margin-top: 4px; font-size: 19px; font-weight: 600; letter-spacing: -.035em; }
.model-picker { width: 202px; }
.model-picker summary {
  min-height: 48px; padding: 8px 11px; border: 1px solid #d4dcd6; border-radius: 14px;
  background: rgba(255,255,255,.68); box-shadow: 0 5px 18px rgba(22,50,40,.04);
}
.model-picker summary:hover { border-color: #93ad9f; background: white; }
.model-picker summary strong { font-size: 11px; font-weight: 600; }
.model-menu { border: 0; border-radius: 16px; box-shadow: 0 22px 60px rgba(16,45,35,.17); }
.model-option { border-radius: 11px; }
.model-option:hover, .model-option.selected { border-color: transparent; background: #edf4ef; }
.status-dot { background: #4bc38f; }

.conversation { padding: 34px clamp(28px, 5.5vw, 86px) 30px; }
.welcome { max-width: 820px; margin: 6.5vh auto 0; text-align: left; }
.welcome-mark {
  width: 46px; height: 46px; margin-bottom: 22px; border-radius: 15px 15px 4px 15px;
  color: var(--sidebar); background: var(--acid); font-size: 16px; font-weight: 700;
}
.welcome h2 { max-width: 620px; margin: 13px 0 12px; font-size: clamp(30px, 3.3vw, 43px); font-weight: 600; letter-spacing: -.055em; line-height: 1.22; }
.welcome > p:not(.eyebrow) { max-width: 590px; margin: 0; font-size: 13px; line-height: 1.8; }
.prompt-examples { grid-template-columns: 1.2fr 1fr 1fr; gap: 0; margin-top: 38px; border-top: 1px solid #cfd8d1; }
.prompt-examples button {
  position: relative; min-height: 116px; padding: 17px 32px 16px 0; border: 0; border-right: 1px solid #dce2dd;
  border-radius: 0; background: transparent; transition: padding .18s ease, color .18s ease;
}
.prompt-examples button + button { padding-left: 18px; }
.prompt-examples button:last-child { border-right: 0; }
.prompt-examples button::after { content: "↗"; position: absolute; right: 15px; bottom: 16px; color: #8a9891; font-size: 14px; }
.prompt-examples button:hover { padding-top: 13px; border-color: #dce2dd; color: var(--accent); background: transparent; transform: none; }
.prompt-examples span { margin-bottom: 21px; font-family: ui-monospace, Consolas, monospace; font-size: 9px; letter-spacing: .08em; }
.prompt-examples strong { max-width: 170px; font-size: 12px; font-weight: 600; }

.message { max-width: 820px; }
.user-message, .ai-message { grid-template-columns: 31px minmax(0,1fr); gap: 15px; }
.avatar { width: 31px; height: 31px; border-radius: 10px 10px 3px 10px; }
.avatar.ai { color: var(--sidebar); background: var(--acid); }
.message-meta { font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; }
.user-copy { font-size: 14px; }
.answer-stack { gap: 0; }
.answer-card { padding: 24px 0 27px; border: 0; border-top: 1px solid #ced7d0; border-radius: 0; background: transparent; }
.answer-card:last-child { border-bottom: 1px solid #ced7d0; }
.answer-title { margin-bottom: 17px; font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.answer-title span { min-width: 24px; font-family: ui-monospace, Consolas, monospace; font-size: 9px; }
.answer-card p { font-size: 12px; line-height: 1.9; }
.issue-grid { gap: 10px; }
.issue { padding: 16px; border: 0; border-radius: 13px 13px 4px 13px; background: #edf2ed; }
.issue small { font-family: ui-monospace, Consolas, monospace; }
.issue p { margin-top: 9px; }
.case-list { gap: 9px; }
.case-card { padding: 15px 16px; border: 1px solid #d7ded8; border-radius: 14px 14px 5px 14px; background: rgba(255,255,255,.66); }
.case-card-head strong { font-size: 12px; font-weight: 600; }
.similarity { padding: 3px 7px; border-radius: 999px; color: #144c3c; background: #dcebe3; }
.analysis-sections { grid-template-columns: 138px minmax(0,1fr); }
.analysis-sections dt, .analysis-sections dd { padding: 13px 0; }
.analysis-sections dt { font-size: 11px; }
.loading-card { border: 0; border-radius: 15px 15px 5px 15px; background: #eef2ed; }

.composer-wrap { padding: 10px clamp(28px, 5.5vw, 86px) 16px; background: linear-gradient(transparent, var(--paper) 22%); }
.demo-disclosure { max-width: 820px; margin-bottom: 9px; }
.composer {
  max-width: 820px; padding: 15px 15px 11px; border: 0; border-radius: 19px 19px 7px 19px;
  background: #fff; box-shadow: 0 14px 42px rgba(18,61,49,.13), 0 0 0 1px rgba(18,61,49,.08);
}
.composer:focus-within { border: 0; box-shadow: 0 18px 48px rgba(18,61,49,.17), 0 0 0 2px rgba(20,99,75,.26); }
.composer textarea { min-height: 69px; font-size: 13px; }
.tool-button, .analysis-modes button { border-radius: 9px; }
.analysis-modes button.active { color: #103f31; background: #e0ece5; }
.submit-analysis { min-height: 38px; border-radius: 11px 11px 4px 11px; background: var(--sidebar); }
.submit-analysis:hover { background: #0a3127; }
.legal-disclaimer { max-width: 820px; }

.inspector { padding: 27px 21px; border: 0; background: #e8eee9; }
.inspector h2 { font-size: 20px; font-weight: 600; letter-spacing: -.04em; }
.pipeline-card { margin: 25px 0 17px; padding: 16px; border: 0; border-radius: 15px 15px 5px 15px; color: white; background: var(--sidebar); }
.pipeline-title { color: white; }
.pipeline-card p { color: #b7cac2; }
.pipeline-line { background: rgba(255,255,255,.14); }
.pipeline-line span { background: var(--acid); }
.analysis-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; }
.analysis-stats div { min-width: 0; padding: 12px; border: 0; border-radius: 11px; background: rgba(255,255,255,.52); }
.analysis-stats div:nth-child(5) { grid-column: 1 / -1; }
.analysis-stats dt { margin-bottom: 8px; }
.analysis-stats dd { font-size: 10px; line-height: 1.45; }
.scope-block { margin-top: 25px; }
.scope-block > .nav-label { padding-left: 0; }
.scope-block > div { border-color: #d1dbd3; }
.info-note { border-radius: 11px 11px 4px 11px; background: rgba(255,255,255,.45); }
.text-link { border-bottom: 1px solid currentColor; padding-bottom: 2px; }

.page-app { background: #eef1eb; }
.page-shell { grid-template-columns: 222px minmax(0,1fr); }
.page-main { padding-top: 50px; }
.page-header h1 { font-size: 33px; font-weight: 600; letter-spacing: -.055em; }
.settings-card, .admin-card { overflow: hidden; border: 0; border-radius: 16px 16px 6px 16px; box-shadow: 0 8px 28px rgba(19,50,39,.06); }
.card-heading { padding: 21px 23px 17px; }
.card-heading h2 { font-size: 17px; font-weight: 600; }
.metric-card { border: 0; border-radius: 15px 15px 5px 15px; box-shadow: 0 8px 28px rgba(19,50,39,.055); }
.metric-card strong { font-size: 24px; font-weight: 600; }
.primary-button, .secondary-button, .danger-button { border-radius: 11px 11px 4px 11px; }
.field-control input[type="text"], .field-control input[type="password"], .field-control input[type="number"], .field-control select { border-radius: 10px; }
.segmented span { border-radius: 10px; }

.error-card { border: 0; border-radius: 14px 14px 4px 14px; background: #f7e9e6; }
.retry-button { border-radius: 10px 10px 3px 10px; }
.case-document summary { color: var(--accent); }
.case-document pre { border-radius: 9px; background: #eef1ec; }

@media (max-width: 1120px) {
  .app-frame { grid-template-columns: 210px minmax(0,1fr); }
  .inspector { background: #e8eee9; }
}
@media (max-width: 780px) {
  .sidebar { background: var(--sidebar); }
  .workspace-header { min-height: 68px; }
  .conversation { padding-inline: 18px; }
  .welcome h2 { font-size: 31px; }
  .prompt-examples { grid-template-columns: 1fr; }
  .prompt-examples button, .prompt-examples button + button { min-height: 77px; padding: 14px 34px 13px 0; border-right: 0; border-bottom: 1px solid #dce2dd; }
  .prompt-examples button::after { bottom: 15px; }
  .prompt-examples span { margin-bottom: 8px; }
  .composer-wrap { padding-inline: 10px; }
  .page-shell { display: block; }
}
@media (max-width: 480px) {
  .welcome { margin-top: 2vh; }
  .welcome-mark { width: 40px; height: 40px; }
  .welcome h2 { font-size: 27px; }
  .model-picker { width: 132px; }
  .composer { border-radius: 16px 16px 5px 16px; }
}
/* Dynamic viewport and short-screen fit */
html, body.workspace-app { height: 100%; height: 100dvh; overflow: hidden; }
.workspace-app .app-frame {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}
.workspace-app .sidebar,
.workspace-app .chat-workspace,
.workspace-app .inspector {
  height: 100%;
  min-height: 0;
  max-height: 100dvh;
}
.workspace-app .composer-wrap {
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

@media (min-width: 781px) and (max-height: 720px) {
  .workspace-header { min-height: 62px; padding-block: 8px; }
  .workspace-header .eyebrow { display: none; }
  .workspace-header h1 { margin-top: 0; font-size: 17px; }
  .model-picker summary { min-height: 43px; }
  .conversation { padding-top: 10px; padding-bottom: 10px; }
  .welcome { margin-top: 0; }
  .welcome-mark { width: 36px; height: 36px; margin-bottom: 9px; border-radius: 12px 12px 3px 12px; font-size: 13px; }
  .welcome h2 { margin: 7px 0 8px; font-size: clamp(25px, 3vw, 34px); }
  .welcome > p:not(.eyebrow) { font-size: 12px; line-height: 1.6; }
  .prompt-examples { margin-top: 18px; }
  .prompt-examples button { min-height: 78px; padding-top: 11px; padding-bottom: 10px; }
  .prompt-examples button:hover { padding-top: 8px; }
  .prompt-examples span { margin-bottom: 9px; }
  .composer-wrap { padding-top: 5px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .demo-disclosure { margin-bottom: 4px; }
  .composer { padding: 10px 11px 8px; }
  .composer textarea { min-height: 42px; max-height: 110px; }
  .composer-toolbar { margin-top: 5px; }
  .legal-disclaimer { display: none; }
  .inspector { padding-top: 18px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .pipeline-card { margin-top: 16px; margin-bottom: 12px; }
}

@media (max-width: 780px) {
  html, body.workspace-app, .workspace-app .app-frame, .workspace-app .chat-workspace { height: 100dvh; min-height: 0; }
  .workspace-app .sidebar, .workspace-app .inspector { height: 100dvh; }
  .workspace-app .composer-wrap { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
/* Collapsible inspector and streaming response UX */
.workspace-app .app-frame { grid-template-columns: 222px minmax(0, 1fr); }
.workspace-app .workspace-header { grid-template-columns: minmax(0,1fr) auto auto; gap: 11px; }
.workspace-app .inspector {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(340px, calc(100vw - 18px));
  height: 100dvh;
  transform: translateX(102%);
  box-shadow: -18px 0 55px rgba(15,45,35,.16);
  transition: transform .22s ease;
}
.workspace-app .inspector.open { transform: translateX(0); }
.workspace-app #open-inspector,
.workspace-app #close-inspector { display: grid; }
.workspace-app .backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(10,29,23,.27);
  backdrop-filter: blur(2px);
}
.workspace-app .backdrop:not([hidden]) { display: block; }

.jump-to-latest {
  position: absolute;
  right: clamp(24px, 5.5vw, 86px);
  bottom: 150px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #c7d3cb;
  border-radius: 12px 12px 4px 12px;
  color: #174d3d;
  background: rgba(255,255,255,.94);
  box-shadow: 0 9px 28px rgba(15,52,40,.14);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.jump-to-latest[hidden] { display: none; }
.jump-to-latest:hover { background: #edf4ef; }
.stream-preview[hidden], .loading-card.has-stream .loading-row { display: none; }
.stream-preview { display: grid; gap: 9px; margin-top: 12px; }
.stream-live-label { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 10px; }
.stream-live-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3ab886; box-shadow: 0 0 0 4px rgba(58,184,134,.1); }
.stream-content { display: grid; gap: 7px; }
.stream-content h4 { margin: 9px 0 0; color: #173f33; font-size: 12px; font-weight: 600; }
.stream-content p { margin: 0; color: #4c5d55; font-size: 12px; line-height: 1.8; }
.stream-content strong { color: #213c32; font-size: 12px; font-weight: 600; line-height: 1.65; }
.stream-chip { justify-self: start; padding: 4px 8px; border-radius: 999px; color: #174d3d; background: #dcebe3; font-size: 9px; }
.stream-bullet { padding-left: 13px; position: relative; }
.stream-bullet::before { content: "·"; position: absolute; left: 2px; color: var(--accent); }
.stream-cursor { display: inline-block; width: 6px; height: 14px; margin-left: 3px; background: var(--accent); vertical-align: -2px; animation: stream-blink .9s steps(1) infinite; }
@keyframes stream-blink { 50% { opacity: 0; } }

@media (max-width: 780px) {
  .workspace-app .workspace-header { grid-template-columns: auto minmax(0,1fr) auto auto; }
  .jump-to-latest { right: 12px; bottom: 137px; }
}
@media (min-width: 781px) and (max-height: 720px) {
  .jump-to-latest { bottom: 104px; }
}
/* Incremental structured response */
.workspace-app .conversation { scroll-behavior: auto; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 9px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #15513f;
  background: #dcebe3;
  font-size: 9px;
  font-weight: 600;
}
.live-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #27a976;
  box-shadow: 0 0 0 4px rgba(39,169,118,.1);
  animation: stream-pulse 1.25s ease-in-out infinite;
}
.stream-card { display: grid; gap: 12px; }
.stream-skeleton[hidden] { display: none; }
.stream-skeleton { display: grid; gap: 8px; }
.stream-output { display: grid; gap: 9px; min-width: 0; }
.stream-section { display: grid; gap: 7px; padding-top: 12px; border-top: 1px solid #d6dfd8; }
.stream-section:first-of-type { border-top: 0; padding-top: 0; }
.stream-section h3 { margin: 0; color: #173f33; font-size: 12px; font-weight: 600; }
.stream-section p,
.stream-copy { margin: 0; color: #42564d; font-size: 12px; line-height: 1.78; white-space: pre-wrap; }
.stream-title { margin-top: 5px; color: #173f33; font-size: 12px; font-weight: 600; }
.stream-list { margin: 0; padding-left: 18px; color: #42564d; font-size: 12px; line-height: 1.75; }
@keyframes stream-pulse { 50% { opacity: .45; transform: scale(.88); } }
@media (prefers-reduced-motion: reduce) {
  .workspace-app .inspector { transition: none; }
  .live-badge::before { animation: none; }
}
/* Shared route viewport: keep navigation visible and make long page content independently scrollable. */
html:has(body.page-app),
body.page-app {
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.page-app .page-shell {
  height: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.page-app .page-shell > .sidebar {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
.page-app .page-main {
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: max(80px, calc(32px + env(safe-area-inset-bottom)));
  padding-bottom: max(80px, calc(32px + env(safe-area-inset-bottom)));
}
@media (max-width: 780px) {
  .page-app .page-shell { display: block; }
  .page-app .page-main { height: 100dvh; padding-bottom: max(68px, calc(28px + env(safe-area-inset-bottom))); }
  .page-app .page-shell > .sidebar { height: 100dvh; }
}
/* Shared entry point for the participatory daily-trial route. */
.feature-navigation { margin: -8px 0 19px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.daily-trial-entry { display: grid; grid-template-columns: 31px minmax(0,1fr); align-items: center; gap: 10px; padding: 10px; border-radius: 11px 11px 4px 11px; color: #b9cec5; text-decoration: none; }
.daily-trial-entry:hover, .daily-trial-entry.active { color: #fff; background: rgba(255,255,255,.09); }
.feature-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px 10px 3px 10px; color: #123d31; background: #c8e86f; font-size: 13px; }
.daily-trial-entry strong, .daily-trial-entry small { display: block; }
.daily-trial-entry strong { font-size: 11px; font-weight: 600; }
.daily-trial-entry small { margin-top: 3px; color: #8faca0; font-size: 8px; line-height: 1.35; }
.daily-trial-entry:focus-visible { outline: 2px solid #c8e86f; outline-offset: 2px; }