:root {
  --navy-950: #081525;
  --navy-900: #0d1d31;
  --navy-800: #142a45;
  --navy-700: #1d3c5f;
  --ink-950: #142033;
  --ink-800: #26374d;
  --ink-600: #52647a;
  --ink-500: #718196;
  --ink-300: #b7c1ce;
  --line: #dfe5ec;
  --line-soft: #e9edf2;
  --surface: #ffffff;
  --surface-soft: #f6f8fa;
  --canvas: #edf1f5;
  --teal-700: #087667;
  --teal-600: #0a8c79;
  --teal-100: #d8f3ed;
  --blue-700: #1e5aa8;
  --blue-100: #e0edff;
  --amber-700: #99610b;
  --amber-100: #fff0ca;
  --red-700: #b1373c;
  --red-100: #fde3e3;
  --purple-700: #6846a5;
  --purple-100: #eee6fc;
  --shadow-xs: 0 1px 2px rgba(8, 21, 37, .06);
  --shadow-sm: 0 4px 16px rgba(8, 21, 37, .07);
  --shadow-lg: 0 18px 48px rgba(8, 21, 37, .18);
  --radius-sm: 7px;
  --radius-md: 11px;
  --radius-lg: 16px;
  --sidebar-width: 252px;
  --topbar-height: 68px;
  --transition: 160ms ease;
  color-scheme: light;
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink-950); background: var(--canvas); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(26px, 3vw, 34px); line-height: 1.24; letter-spacing: -.03em; }
h2 { margin-bottom: 4px; font-size: 18px; line-height: 1.35; letter-spacing: -.015em; }
h3 { margin-bottom: 4px; font-size: 15px; }
a { color: inherit; }

:focus-visible { outline: 3px solid rgba(10, 140, 121, .32); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 12px; transform: translateY(-160%); padding: 10px 14px; border-radius: var(--radius-sm); color: #fff; background: var(--teal-700); text-decoration: none; box-shadow: var(--shadow-lg); transition: transform var(--transition); }
.skip-link:focus { transform: translateY(0); }
.is-hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: var(--sidebar-width); flex-direction: column;
  padding: 24px 16px 18px; color: #d8e2ed; background: var(--navy-950); box-shadow: 1px 0 0 rgba(255,255,255,.04);
}
.brand { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 11px; color: #c7f5e8; background: var(--teal-700); }
.brand-mark svg { width: 25px; height: 25px; }
.brand strong, .brand span { display: block; }
.brand strong { color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand span { margin-top: 1px; color: #8fa2b8; font-size: 9px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; margin-top: 24px; }
.nav-item { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 9px; color: #aab9ca; background: transparent; text-align: left; transition: color var(--transition), background var(--transition); }
.nav-item svg { width: 19px; height: 19px; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.065); }
.nav-item.is-active { color: #fff; background: var(--navy-700); box-shadow: inset 3px 0 0 #54cfb6; }
.nav-item span:nth-child(2) { flex: 1; font-weight: 650; }
.nav-count { min-width: 24px; padding: 2px 7px; border-radius: 999px; color: #bcefe4; background: rgba(84,207,182,.14); font-size: 11px; font-weight: 800; text-align: center; }
.sidebar-note { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 14px 12px; border: 1px solid rgba(255,255,255,.09); border-radius: var(--radius-md); background: rgba(255,255,255,.035); }
.sidebar-note strong, .sidebar-note span { display: block; }
.sidebar-note strong { color: #dce9e6; font-size: 12px; }
.sidebar-note span { margin-top: 2px; color: #7f93a9; font-size: 10px; }
.signal-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 4px; border: 2px solid rgba(74,222,185,.25); border-radius: 50%; background: #4adeb9; box-shadow: 0 0 0 4px rgba(74,222,185,.1); }
.sidebar-version { margin: 12px 0 0; color: #61758b; font-size: 10px; text-align: center; letter-spacing: .04em; }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: var(--topbar-height); align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: var(--shadow-xs); }
.menu-button { display: none !important; }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; border-radius: 8px; background: transparent; }
.icon-button:hover { background: var(--surface-soft); }
.global-search { position: relative; display: flex; width: min(460px, 42vw); align-items: center; }
.global-search > svg, .inline-search > svg { position: absolute; z-index: 1; left: 12px; width: 18px; height: 18px; color: var(--ink-500); pointer-events: none; }
.global-search input, .inline-search input { width: 100%; height: 40px; padding: 0 42px 0 39px; border: 1px solid transparent; border-radius: 9px; color: var(--ink-800); background: var(--surface-soft); transition: border-color var(--transition), box-shadow var(--transition), background var(--transition); }
.global-search input:focus, .inline-search input:focus { border-color: rgba(10,140,121,.46); outline: 0; background: #fff; box-shadow: 0 0 0 3px rgba(10,140,121,.1); }
.global-search kbd { position: absolute; right: 11px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; color: var(--ink-500); background: #fff; font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.api-state { display: flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: 11px; }
.api-state > span:first-child { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-700); box-shadow: 0 0 0 3px var(--amber-100); }
.api-state.is-online > span:first-child { background: var(--teal-600); box-shadow: 0 0 0 3px var(--teal-100); }
.api-state.is-demo > span:first-child { background: var(--blue-700); box-shadow: 0 0 0 3px var(--blue-100); }
.role-control select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 650; }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #fff; background: var(--navy-700); font-size: 11px; font-weight: 800; }

main { width: min(1500px, 100%); margin: 0 auto; padding: 32px 30px 56px; }
.view { display: none; }
.view.is-visible { display: block; animation: view-in 220ms ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading > div > p:last-child { margin-bottom: 0; color: var(--ink-600); }
.page-heading.compact { align-items: flex-start; }
.eyebrow, .section-kicker { margin-bottom: 5px; color: var(--teal-700); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.back-link { margin: 0 0 12px -5px; padding: 5px; color: var(--ink-600); background: transparent; font-weight: 650; }
.back-link:hover { color: var(--teal-700); }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 750; white-space: nowrap; transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition); }
.button svg { width: 17px; height: 17px; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .54; }
.button-primary { color: #fff; background: var(--teal-700); box-shadow: 0 3px 8px rgba(8,118,103,.18); }
.button-primary:hover:not(:disabled) { background: #06695c; box-shadow: 0 5px 12px rgba(8,118,103,.24); }
.button-secondary { border-color: var(--line); color: var(--ink-800); background: #fff; }
.button-secondary:hover:not(:disabled) { border-color: var(--ink-300); background: var(--surface-soft); }
.button-danger { border-color: #efc6c8; color: var(--red-700); background: #fff7f7; }
.button-small { min-height: 33px; padding: 0 11px; font-size: 11px; }
.text-button { padding: 5px; color: var(--teal-700); background: transparent; font-size: 12px; font-weight: 750; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.panel-header { display: flex; min-height: 70px; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2, .panel-header p { margin-bottom: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { position: relative; min-height: 136px; overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-xs); }
.kpi-card::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--kpi-accent, var(--teal-600)); content: ""; }
.kpi-blue { --kpi-accent: #1e5aa8; }
.kpi-amber { --kpi-accent: #99610b; }
.kpi-purple { --kpi-accent: #6846a5; }
.kpi-teal { --kpi-accent: #087667; }
.kpi-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-600); font-size: 12px; font-weight: 650; }
.kpi-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: var(--kpi-accent, var(--teal-700)); background: color-mix(in srgb, var(--kpi-accent, var(--teal-600)) 11%, white); }
.kpi-icon svg { width: 17px; height: 17px; }
.kpi-value { display: flex; align-items: baseline; gap: 5px; margin-top: 13px; font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.kpi-value small { color: var(--ink-500); font-size: 12px; letter-spacing: 0; }
.kpi-foot { margin: 10px 0 0; color: var(--ink-500); font-size: 11px; }
.kpi-foot strong { color: var(--teal-700); }
.skeleton-card { background: linear-gradient(90deg, #f4f6f8 25%, #e9edf1 37%, #f4f6f8 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 16px; margin-bottom: 16px; }
.flow-chart { display: grid; gap: 13px; padding: 20px; }
.flow-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 36px; align-items: center; gap: 12px; font-size: 12px; }
.flow-row > span:first-child { color: var(--ink-600); font-weight: 650; }
.flow-row > strong { text-align: right; font-size: 13px; }
.flow-track { height: 9px; overflow: hidden; border-radius: 999px; background: #eef1f4; }
.flow-fill { height: 100%; min-width: 3px; border-radius: inherit; background: var(--bar-color, var(--teal-600)); transition: width 500ms ease; }
.flow-progress { width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 999px; background: #eef1f4; appearance: none; }
.flow-progress::-webkit-progress-bar { border-radius: 999px; background: #eef1f4; }
.flow-progress::-webkit-progress-value { border-radius: 999px; background: var(--flow-color, var(--teal-600)); transition: width 500ms ease; }
.flow-progress::-moz-progress-bar { border-radius: 999px; background: var(--flow-color, var(--teal-600)); }
.flow-blue { --flow-color: #1e5aa8; }
.flow-teal { --flow-color: #0a8c79; }
.flow-amber { --flow-color: #99610b; }
.flow-green { --flow-color: #2f7a4c; }
.flow-red { --flow-color: #b1373c; }
.attention-list { display: grid; }
.attention-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: start; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.attention-item:last-child { border-bottom: 0; }
.attention-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; color: var(--red-700); background: var(--red-100); }
.attention-icon.warning { color: var(--amber-700); background: var(--amber-100); }
.attention-icon svg { width: 16px; height: 16px; }
.attention-item strong, .attention-item span { display: block; }
.attention-item strong { font-size: 12px; }
.attention-item span { margin-top: 2px; color: var(--ink-500); font-size: 10px; }
.attention-item button { padding: 4px; color: var(--teal-700); background: transparent; font-size: 11px; font-weight: 750; }
.request-panel { overflow: hidden; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.data-table th { padding: 11px 15px; color: var(--ink-500); background: #fafbfc; font-size: 10px; font-weight: 800; text-align: left; letter-spacing: .03em; text-transform: uppercase; }
.data-table td { padding: 12px 15px; border-top: 1px solid var(--line-soft); color: var(--ink-800); vertical-align: middle; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #f8fbfb; }
.data-table tbody tr[data-id] { cursor: pointer; }
.data-table-spacious td { padding-top: 15px; padding-bottom: 15px; }
.cell-primary { display: block; color: var(--ink-950); font-weight: 750; }
.cell-secondary { display: block; max-width: 260px; overflow: hidden; margin-top: 2px; color: var(--ink-500); font-size: 10px; text-overflow: ellipsis; }
.route-cell { display: flex; align-items: center; gap: 7px; }
.route-cell span { display: inline-flex; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.route-cell b { color: var(--ink-300); font-weight: 400; }
.amount { font-variant-numeric: tabular-nums; font-weight: 750; }
.unknown { color: var(--ink-500); font-style: normal; }
.mobile-card-list { display: none; }

.badge { display: inline-flex; min-height: 23px; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; color: var(--ink-600); background: #edf0f3; font-size: 9px; font-weight: 850; letter-spacing: .025em; white-space: nowrap; }
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.badge-approved, .badge-firm, .badge-ok { color: var(--teal-700); background: var(--teal-100); }
.badge-pending, .badge-review, .badge-budgetary, .badge-medium { color: var(--amber-700); background: var(--amber-100); }
.badge-indicative, .badge-intake, .badge-calculated { color: var(--blue-700); background: var(--blue-100); }
.badge-high, .badge-blocked, .badge-error { color: var(--red-700); background: var(--red-100); }
.badge-low { color: var(--teal-700); background: #e5f5ec; }
.badge-draft { color: var(--purple-700); background: var(--purple-100); }

.filter-bar { display: flex; min-height: 64px; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); }
.inline-search { position: relative; width: min(360px, 42vw); }
.inline-search input { height: 38px; padding-right: 12px; border-color: var(--line); background: #fff; }
.filter-bar select { height: 38px; min-width: 135px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 11px; font-weight: 650; }
.result-count { margin-left: auto; color: var(--ink-500); font-size: 11px; font-weight: 700; white-space: nowrap; }
.empty-state { padding: 65px 20px; color: var(--ink-500); text-align: center; }
.empty-state svg { width: 38px; height: 38px; margin-bottom: 10px; color: var(--ink-300); }
.empty-state h3 { color: var(--ink-800); }

.form-layout { display: grid; gap: 16px; max-width: 1080px; }
.form-section { padding: 23px; }
.section-title { display: flex; gap: 13px; margin-bottom: 22px; padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.section-title > span { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); font-size: 10px; font-weight: 850; }
.section-title h2, .section-title p { margin-bottom: 0; }
.section-title p { margin-top: 2px; color: var(--ink-500); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: 6px; color: var(--ink-600); font-size: 11px; font-weight: 700; }
.field-wide { grid-column: 1 / -1; }
.field b { color: var(--red-700); }
.field input, .field select, .field textarea, .cost-form input, .cost-form select { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-950); background: #fff; font-size: 13px; font-weight: 500; transition: border-color var(--transition), box-shadow var(--transition); }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .cost-form input:focus, .cost-form select:focus { border-color: rgba(10,140,121,.6); outline: 0; box-shadow: 0 0 0 3px rgba(10,140,121,.1); }
.field input::placeholder, .field textarea::placeholder { color: #9ba8b7; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 4px 0; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.detail-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.detail-title-row h1 { margin: 0; }
.detail-subline { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 8px; color: var(--ink-600); font-size: 11px; }
.detail-actions { display: flex; gap: 8px; }
.progress-panel { margin-bottom: 16px; padding: 18px 22px; }
.progress-steps { display: grid; grid-template-columns: repeat(5, 1fr); }
.progress-step { position: relative; display: grid; justify-items: center; gap: 7px; color: var(--ink-400, var(--ink-500)); font-size: 10px; font-weight: 700; text-align: center; }
.progress-step:not(:last-child)::after { position: absolute; z-index: 0; top: 12px; left: calc(50% + 16px); width: calc(100% - 32px); height: 2px; background: var(--line); content: ""; }
.progress-step.is-done:not(:last-child)::after { background: var(--teal-600); }
.progress-dot { position: relative; z-index: 1; display: grid; width: 26px; height: 26px; place-items: center; border: 2px solid var(--line); border-radius: 50%; color: var(--ink-500); background: #fff; font-size: 9px; }
.progress-step.is-done { color: var(--teal-700); }
.progress-step.is-done .progress-dot { border-color: var(--teal-600); color: #fff; background: var(--teal-600); }
.progress-step.is-current { color: var(--blue-700); }
.progress-step.is-current .progress-dot { border-color: var(--blue-700); color: var(--blue-700); box-shadow: 0 0 0 4px var(--blue-100); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .78fr); gap: 16px; align-items: start; }
.detail-stack { display: grid; gap: 16px; }
.detail-panel { overflow: hidden; }
.detail-panel-body { padding: 20px; }
.definition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 16px; }
.definition-grid-2 { grid-template-columns: 1fr 1fr; }
.quote-definition { margin-top: 18px; }
.definition-item dt { color: var(--ink-500); font-size: 10px; font-weight: 700; }
.definition-item dd { margin: 4px 0 0; color: var(--ink-950); font-size: 12px; font-weight: 700; word-break: break-word; }
.definition-item dd small { display: block; color: var(--ink-500); font-weight: 500; }
.callout { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 13px; border-left: 3px solid var(--amber-700); border-radius: 0 7px 7px 0; color: #6c500f; background: #fff8e9; font-size: 11px; }
.callout svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.callout.info { border-color: var(--blue-700); color: #234d80; background: #f0f6ff; }
.hs-classify-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; gap: 12px 14px; margin-top: 16px; padding: 16px; border: 1px solid #bedbd5; border-radius: 10px; background: #f7fbfa; }
.hs-classify-form .button { min-height: 40px; }
.hs-classify-form select { width: 100%; min-height: 40px; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.hs-list { display: grid; gap: 9px; }
.hs-card { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; }
.hs-rank { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: var(--teal-700); background: var(--teal-100); font-size: 11px; font-weight: 850; }
.hs-card strong, .hs-card span { display: block; }
.hs-card span { margin-top: 3px; color: var(--ink-500); font-size: 10px; }
.hs-card .hs-path { margin-top: 7px; color: var(--ink-700); font-weight: 700; line-height: 1.5; }
.hs-card .hs-evidence { color: var(--teal-700); font-weight: 700; }
.confidence { color: var(--ink-600); font-size: 10px; font-weight: 750; white-space: nowrap; }

.agent-panel { overflow: hidden; border-color: #bedbd5; }
.agent-header { display: flex; align-items: center; gap: 10px; padding: 16px 17px; color: #fff; background: var(--navy-800); }
.agent-header-icon { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 9px; color: #bdf0e5; background: rgba(84,207,182,.13); }
.agent-header h2, .agent-header p { margin: 0; }
.agent-header p { color: #9db3c7; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.agent-header .badge { margin-left: auto; }
.agent-content { padding: 17px; }
.agent-summary { margin-bottom: 14px; color: var(--ink-800); font-size: 11px; line-height: 1.7; }
.agent-section { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.agent-section h3 { display: flex; align-items: center; gap: 7px; color: var(--ink-600); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.agent-section ul { display: grid; gap: 6px; margin: 9px 0 0; padding: 0; list-style: none; }
.agent-section li { position: relative; padding-left: 14px; color: var(--ink-800); font-size: 10px; }
.agent-section li::before { position: absolute; top: .62em; left: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--teal-600); content: ""; }
.agent-section li.risk::before { background: var(--red-700); }
.agent-run { width: 100%; margin-top: 7px; }

.cost-table td input, .cost-table td select { min-width: 88px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 11px; }
.cost-form { display: grid; grid-template-columns: 1.1fr 1.3fr .85fr .85fr .7fr 1fr auto; gap: 8px; padding: 13px 15px; border-top: 1px solid var(--line-soft); background: #fafbfc; }
.cost-form input, .cost-form select { min-height: 36px; padding: 7px 9px; font-size: 11px; }
.cost-summary { display: flex; align-items: center; justify-content: flex-end; gap: 25px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fbfcfd; }
.cost-summary span { color: var(--ink-500); font-size: 10px; }
.cost-summary strong { font-size: 16px; font-variant-numeric: tabular-nums; }

.quote-tabs { display: flex; gap: 3px; padding: 10px 15px 0; border-bottom: 1px solid var(--line); }
.quote-tab { padding: 9px 13px; border-bottom: 2px solid transparent; color: var(--ink-500); background: transparent; font-size: 11px; font-weight: 750; }
.quote-tab.is-active { border-color: var(--teal-600); color: var(--teal-700); }
.quote-document { margin: 18px; padding: 22px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-xs); }
.quote-top { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 2px solid var(--navy-800); }
.quote-top h3 { margin: 0; color: var(--navy-800); font-size: 20px; letter-spacing: -.02em; }
.quote-top p { margin: 3px 0 0; color: var(--ink-500); font-size: 10px; }
.quote-meta { text-align: right; }
.quote-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 18px 0; padding: 16px; color: #fff; background: var(--navy-800); }
.quote-amount span { font-size: 11px; }
.quote-amount strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.quote-lines { width: 100%; border-collapse: collapse; font-size: 10px; }
.quote-lines th, .quote-lines td { padding: 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.quote-lines th:last-child, .quote-lines td:last-child { text-align: right; }
.quote-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 9px; line-height: 1.7; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 0 18px 18px; padding: 9px 11px; border-radius: 7px; color: var(--teal-700); background: var(--teal-100); font-size: 10px; font-weight: 650; }

.audit-timeline { padding: 8px 20px 24px; }
.audit-item { position: relative; display: grid; grid-template-columns: 130px 28px 1fr; gap: 12px; min-height: 78px; padding-top: 16px; }
.audit-item:not(:last-child)::after { position: absolute; top: 42px; bottom: -14px; left: 155px; width: 1px; background: var(--line); content: ""; }
.audit-time { color: var(--ink-500); font-size: 10px; text-align: right; }
.audit-time strong { display: block; color: var(--ink-700); font-size: 11px; }
.audit-dot { position: relative; z-index: 1; display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid #b8ddd5; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); }
.audit-dot svg { width: 13px; height: 13px; }
.audit-body { padding: 0 0 12px; }
.audit-body h3 { margin: 0; font-size: 12px; }
.audit-body p { margin: 4px 0 0; color: var(--ink-600); font-size: 10px; }
.audit-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.intake-kpis, .quote-db-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.quote-db-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-kpi { min-height: 96px; padding: 17px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-xs); }
.mini-kpi span, .mini-kpi small { display: block; color: var(--ink-500); font-size: 10px; font-weight: 700; }
.mini-kpi strong { display: block; margin: 5px 0 2px; color: var(--navy-800); font-size: 24px; font-variant-numeric: tabular-nums; }
.mini-kpi.wide strong { font-size: 20px; }
.panel-subtitle { margin: 4px 0 0; color: var(--ink-500); font-size: 10px; }
.panel-actions { display: flex; align-items: center; gap: 12px; }
.intake-upload-panel, .intake-preview-panel { margin-bottom: 16px; }
.intake-upload-body { display: flex; align-items: center; gap: 14px; padding: 20px; }
.file-drop { display: grid; grid-template-columns: 36px 1fr; flex: 1; gap: 2px 12px; padding: 18px; border: 1px dashed #9ebcc2; border-radius: 10px; color: var(--ink-700); background: #f8fbfb; cursor: pointer; }
.file-drop svg { grid-row: 1 / 4; width: 34px; height: 34px; color: var(--teal-700); }
.file-drop strong { font-size: 12px; }
.file-drop span { color: var(--ink-500); font-size: 10px; font-weight: 500; }
.file-drop input { grid-column: 2; margin-top: 7px; color: var(--ink-600); font-size: 10px; }
.intake-warning { margin: 0 20px 18px; padding: 10px 12px; border-left: 3px solid var(--amber-700); border-radius: 0 7px 7px 0; color: #6c500f; background: #fff8e9; font-size: 10px; }
.check-label { display: inline-flex; }
.intake-select, #intake-select-all { width: 15px; height: 15px; accent-color: var(--teal-700); }
.channel-badge { display: inline-flex; align-items: center; width: max-content; margin-bottom: 4px; padding: 3px 7px; border-radius: 999px; color: var(--ink-700); background: var(--line-soft); font-size: 9px; font-weight: 800; white-space: nowrap; }
.channel-web_form { color: var(--blue-700); background: var(--blue-100); }
.channel-sales_call { color: #6c3fa0; background: #f1e9fb; }
.channel-sms { color: var(--teal-700); background: var(--teal-100); }
.channel-kakao { color: #69580a; background: #fff6c7; }
.channel-email { color: #9a451c; background: #fff0e8; }
.excerpt-cell { max-width: 280px; color: var(--ink-600); font-size: 10px; line-height: 1.55; }
.intake-results { padding: 18px 20px 22px; }
.result-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.result-summary article { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.result-summary span { display: block; color: var(--ink-500); font-size: 9px; }
.result-summary strong { display: block; margin-top: 3px; font-size: 19px; }
.result-list { display: grid; max-height: 480px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.result-row { display: grid; grid-template-columns: 100px minmax(160px, 1fr) 110px 150px 100px; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 10px; }
.result-row:last-child { border-bottom: 0; }
.result-row strong, .result-row span { display: block; }
.quote-db-filter { flex-wrap: wrap; }
.quote-db-filter .button { height: 38px; }
.data-table tr[data-request-id] { cursor: pointer; }
.data-table tr[data-request-id]:hover { background: #f7fbfa; }

.loading-overlay { position: fixed; z-index: 80; inset: 0; display: grid; place-content: center; justify-items: center; color: var(--navy-800); background: rgba(244,247,249,.82); backdrop-filter: blur(3px); }
.loading-overlay[hidden] { display: none; }
.spinner { width: 34px; height: 34px; border: 3px solid #ccdadf; border-top-color: var(--teal-700); border-radius: 50%; animation: spin .75s linear infinite; }
.loading-overlay p { margin: 12px 0 0; font-size: 11px; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; width: min(360px, calc(100vw - 40px)); gap: 9px; }
.toast { display: grid; grid-template-columns: 26px 1fr auto; align-items: start; gap: 10px; padding: 13px; border: 1px solid #bddfd7; border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); animation: toast-in 220ms ease both; }
.toast.is-error { border-color: #f2c4c6; }
.toast-icon { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); }
.toast.is-error .toast-icon { color: var(--red-700); background: var(--red-100); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 11px; }
.toast span { margin-top: 2px; color: var(--ink-600); font-size: 10px; }
.toast button { padding: 2px; color: var(--ink-500); background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal { width: min(470px, calc(100vw - 32px)); padding: 25px; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgba(8,21,37,.52); backdrop-filter: blur(2px); }
.modal-icon { display: grid; width: 44px; height: 44px; margin-bottom: 15px; place-items: center; border-radius: 50%; color: var(--teal-700); background: var(--teal-100); }
.modal h2 { font-size: 20px; }
.modal > form > p { color: var(--ink-600); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.mobile-scrim { position: fixed; z-index: 25; inset: 0; background: rgba(8,21,37,.5); }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .agent-panel { order: -1; }
  .definition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .intake-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quote-db-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-row { grid-template-columns: 90px 1fr 100px; }
  .result-row > :nth-child(4), .result-row > :nth-child(5) { grid-column: 2 / -1; }
  :root { --sidebar-width: 248px; }
  .sidebar { transform: translateX(-102%); box-shadow: var(--shadow-lg); transition: transform 220ms ease; }
  .sidebar.is-open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-button { display: inline-grid !important; }
  .topbar { padding: 0 18px; }
  .global-search { width: min(420px, 52vw); }
  main { padding: 26px 18px 50px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .intake-kpis, .quote-db-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intake-upload-body { display: grid; padding: 15px; }
  .panel-actions { align-items: flex-end; flex-direction: column; }
  .result-summary { grid-template-columns: repeat(3, 1fr); }
  .result-row { grid-template-columns: 75px 1fr; }
  .result-row > :nth-child(n+3) { grid-column: 2; }
  body { font-size: 13px; }
  .topbar { min-height: 60px; gap: 8px; padding: 0 12px; }
  .global-search { flex: 1; width: auto; }
  .global-search input { padding-right: 10px; }
  .global-search kbd, .api-state, .role-control { display: none; }
  main { padding: 22px 12px 42px; }
  .page-heading { align-items: flex-start; }
  .page-heading > .button { min-width: 42px; padding: 0 12px; font-size: 0; }
  .page-heading > .button svg { width: 18px; height: 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { min-height: 120px; padding: 15px; }
  .kpi-value { font-size: 25px; }
  .panel-header { padding: 14px 15px; }
  .table-wrap { display: none; }
  .mobile-card-list { display: grid; }
  .mobile-request-card { display: grid; gap: 10px; padding: 15px; border-top: 1px solid var(--line-soft); background: #fff; cursor: pointer; }
  .mobile-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
  .mobile-card-head strong { font-size: 12px; }
  .mobile-card-head span { display: block; margin-top: 2px; color: var(--ink-500); font-size: 9px; }
  .mobile-card-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-600); font-size: 10px; }
  .filter-bar { flex-wrap: wrap; }
  .inline-search { width: 100%; }
  .filter-bar label { flex: 1; }
  .filter-bar select { width: 100%; min-width: 0; }
  .result-count { margin-left: 0; }
  .form-section { padding: 17px 15px; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .detail-head { display: grid; }
  .detail-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .detail-actions .button { padding: 0 10px; }
  .progress-panel { overflow-x: auto; padding: 16px 10px; }
  .progress-steps { min-width: 520px; }
  .definition-grid { grid-template-columns: 1fr 1fr; }
  .hs-classify-form { grid-template-columns: 1fr; padding: 13px; }
  .cost-form { grid-template-columns: 1fr 1fr; }
  .cost-form .button { grid-column: 1 / -1; }
  .quote-document { margin: 12px; padding: 15px; }
  .quote-top { display: grid; }
  .quote-meta { text-align: left; }
  .quote-amount strong { font-size: 19px; }
  .audit-timeline { padding-inline: 13px; }
  .audit-item { grid-template-columns: 28px 1fr; }
  .audit-time { grid-column: 2; grid-row: 1; text-align: left; }
  .audit-dot { grid-column: 1; grid-row: 1 / 3; }
  .audit-body { grid-column: 2; }
  .audit-item:not(:last-child)::after { left: 13px; }
}

@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 112px; }
  .flow-row { grid-template-columns: 74px minmax(0,1fr) 28px; gap: 8px; }
  .attention-item { grid-template-columns: 30px 1fr; }
  .attention-item button { grid-column: 2; justify-self: start; }
  .definition-grid { grid-template-columns: 1fr; }
  .detail-actions { grid-template-columns: 1fr; }
  .cost-form { grid-template-columns: 1fr; }
  .cost-form .button { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
