:root {
  color-scheme: light;
  --navy-950: #082645;
  --navy-900: #0d3157;
  --navy-800: #123e72;
  --blue-700: #185bb6;
  --blue-600: #246bd1;
  --blue-100: #eaf2ff;
  --green-700: #087354;
  --green-100: #e6f7f0;
  --amber-700: #a95c08;
  --amber-100: #fff3db;
  --violet-700: #6848b8;
  --violet-100: #f0ebff;
  --ink: #152238;
  --muted: #68758a;
  --line: #dce4ee;
  --shadow: 0 10px 32px rgba(13, 49, 87, .08);
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #eef2f7; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; top: -60px; left: 16px; z-index: 1000; padding: 12px 16px; border-radius: 8px; color: #fff; background: var(--navy-950); }
.skip-link:focus { top: 12px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: 250px; color: #dce9f8; background: linear-gradient(180deg, var(--navy-950), #0b345e 62%, #123f6e); box-shadow: 8px 0 24px rgba(4, 27, 51, .08); }
.brand { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 20px 24px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; color: var(--navy-950); background: linear-gradient(145deg, #fff, #9ed2ff); font-size: 21px; font-weight: 900; }
.brand strong, .brand span { display: block; }
.brand strong { color: #fff; font-size: 18px; letter-spacing: .02em; }
.brand div > span { margin-top: 2px; color: #9fb7d1; font-size: 12px; }
.side-nav { flex: 1; overflow-y: auto; padding: 18px 14px; }
.nav-group { margin: 22px 12px 8px; color: #7897b8; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 46px; margin: 3px 0; padding: 0 13px; border: 0; border-radius: 10px; color: #bdd0e4; background: transparent; text-align: left; transition: .16s ease; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav-item.active { color: #fff; background: #1d64ad; box-shadow: 0 6px 16px rgba(0, 0, 0, .14); }
.nav-icon { width: 22px; font-size: 20px; line-height: 1; text-align: center; }
.nav-badge { margin-left: auto; padding: 3px 6px; border-radius: 20px; color: #cae0f8; background: rgba(255, 255, 255, .12); font-size: 10px; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 17px 20px; border-top: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .08); }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { color: #eef6ff; font-size: 12px; }
.sidebar-foot div > span { margin-top: 2px; color: #8fa9c4; font-size: 11px; }
.service-dot { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #23c58b; box-shadow: 0 0 0 4px rgba(35, 197, 139, .13); }
.service-dot.warning { background: #f3a329; box-shadow: 0 0 0 4px rgba(243, 163, 41, .13); }

.workspace { display: flex; flex: 1; flex-direction: column; min-width: 0; margin-left: 250px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; min-height: 92px; padding: 15px clamp(22px, 4vw, 50px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
.topbar-kicker { margin: 0 0 5px; color: var(--blue-700); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.topbar h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.api-status { display: inline-flex; align-items: center; gap: 9px; margin-left: auto; padding: 9px 13px; border: 1px solid #d7e2ee; border-radius: 999px; color: #49627c; background: #f8fbff; font-size: 12px; font-weight: 700; }
.menu-toggle { display: none; width: 42px; height: 42px; margin-right: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy-900); background: #fff; font-size: 20px; }

.content { flex: 1; width: min(1440px, 100%); margin: 0 auto; padding: 34px clamp(22px, 4vw, 50px) 54px; }
.page { display: none; animation: page-in .24s ease; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.section-label { display: block; margin-bottom: 9px; color: var(--blue-700); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.hero-panel { position: relative; display: grid; grid-template-columns: minmax(280px, .85fr) minmax(440px, 1.25fr); align-items: center; gap: 42px; overflow: hidden; padding: clamp(32px, 5vw, 58px); border-radius: 22px; color: #fff; background: linear-gradient(125deg, #0b315a 0%, #155b9e 54%, #2678ce 100%); box-shadow: 0 18px 46px rgba(14, 63, 111, .2); }
.hero-panel::after { position: absolute; right: -110px; bottom: -190px; width: 430px; height: 430px; border: 58px solid rgba(255, 255, 255, .06); border-radius: 50%; content: ""; }
.hero-panel .section-label { color: #a9d6ff; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h2 { margin: 0; font-size: clamp(28px, 3vw, 44px); line-height: 1.24; letter-spacing: -.04em; }
.hero-copy p { max-width: 540px; margin: 18px 0 0; color: #d8e9fa; font-size: 15px; line-height: 1.75; }
.quick-search { position: relative; z-index: 1; padding: 25px; border: 1px solid rgba(255, 255, 255, .24); border-radius: 17px; background: rgba(255, 255, 255, .12); backdrop-filter: blur(9px); }
.quick-search label { color: #fff; }
.quick-search-row { display: flex; align-items: center; margin-top: 10px; padding: 6px 6px 6px 15px; border-radius: 12px; background: #fff; }
.quick-search-row > span { color: #70829a; font-size: 22px; }
.quick-search-row input { height: 48px; border: 0; box-shadow: none; }
.quick-search-row button { min-width: 104px; min-height: 46px; padding: 0 22px; border: 0; border-radius: 9px; color: #fff; background: var(--blue-600); font-weight: 800; white-space: nowrap; }
.quick-search > p { margin: 9px 2px 0; color: #c9dff5; font-size: 11px; }

.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; margin-top: 22px; }
.summary-card { display: flex; align-items: center; gap: 14px; min-height: 116px; padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 6px 20px rgba(20, 50, 82, .045); }
.summary-icon { display: grid; flex: 0 0 auto; place-items: center; width: 48px; height: 48px; border-radius: 14px; font-size: 16px; font-weight: 900; }
.summary-icon.blue { color: var(--blue-700); background: var(--blue-100); }
.summary-icon.green { color: var(--green-700); background: var(--green-100); }
.summary-icon.amber { color: var(--amber-700); background: var(--amber-100); }
.summary-icon.violet { color: var(--violet-700); background: var(--violet-100); }
.summary-icon.red { color: #a61b1b; background: #fee9e9; }
.summary-action { width: 100%; color: var(--ink); text-align: left; }
.summary-action:hover { border-color: #efb9b9; background: #fffafa; transform: translateY(-1px); }
.summary-card div > span, .summary-card strong, .summary-card small { display: block; }
.summary-card div > span { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.summary-card strong { font-size: 16px; }
.summary-card small { margin-top: 5px; color: #8390a2; font-size: 10px; line-height: 1.4; }

.dashboard-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; margin-top: 20px; }
.panel, .search-card { border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.panel { padding: 26px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-heading h2, .page-intro h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.panel-heading .section-label { margin-bottom: 5px; }
.text-button { padding: 6px 0; border: 0; color: var(--blue-700); background: transparent; font-size: 12px; font-weight: 800; }
.source-list { display: grid; gap: 10px; }
.source-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 1px solid #e3e9f1; border-radius: 12px; color: var(--ink); background: #fbfcfe; text-align: left; transition: .16s ease; }
.source-item:hover { border-color: #bdd1ec; background: #f5f9ff; transform: translateY(-1px); }
.source-item > span:nth-child(2) { flex: 1; }
.source-item strong, .source-item small { display: block; }
.source-item strong { margin-bottom: 5px; font-size: 14px; }
.source-item small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.source-logo { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-weight: 900; }
.source-logo.law { color: var(--blue-700); background: var(--blue-100); }
.source-logo.kosha { color: var(--green-700); background: var(--green-100); }
.arrow { color: #93a3b5; font-size: 28px; }
.roadmap { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.roadmap li { position: relative; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 11px; min-height: 55px; }
.roadmap li:not(:last-child)::after { position: absolute; top: 43px; bottom: -11px; left: 15px; width: 2px; background: #e1e7ef; content: ""; }
.roadmap li > span { display: grid; z-index: 1; place-items: center; width: 31px; height: 31px; border: 2px solid #dbe3ec; border-radius: 50%; color: #7e8a9b; background: #fff; font-size: 11px; font-weight: 800; }
.roadmap li.done > span { border-color: var(--green-700); color: #fff; background: var(--green-700); }
.roadmap li.current > span { border-color: var(--blue-600); color: #fff; background: var(--blue-600); }
.roadmap strong, .roadmap small { display: block; }
.roadmap strong { font-size: 13px; }
.roadmap small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.roadmap em { color: #8a96a6; font-size: 10px; font-style: normal; }
.roadmap .done em { color: var(--green-700); }
.roadmap .current em { color: var(--blue-700); font-weight: 800; }
.legal-note { display: flex; align-items: flex-start; gap: 18px; margin-top: 20px; padding: 17px 20px; border: 1px solid #dbe5ef; border-radius: 12px; color: #52657c; background: #f7fafd; }
.legal-note strong { flex: 0 0 auto; color: var(--navy-800); font-size: 12px; }
.legal-note p { margin: 0; font-size: 11px; line-height: 1.65; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 5px 0 25px; }
.page-intro p { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.search-card { min-height: 360px; padding: 28px; }
.search-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.search-card-head h2 { margin: 5px 0 0; font-size: 22px; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.tag.law { color: var(--blue-700); background: var(--blue-100); }
.tag.kosha { color: var(--green-700); background: var(--green-100); }
label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.search-row { display: flex; gap: 8px; }
input { width: 100%; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid #cbd7e5; border-radius: 10px; color: var(--ink); background: #fff; }
textarea { width: 100%; min-width: 0; padding: 12px 14px; border: 1px solid #cbd7e5; border-radius: 10px; color: var(--ink); background: #fff; font: inherit; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus { outline: 3px solid rgba(36, 107, 209, .14); border-color: var(--blue-600); }
.search-row button, .empty-feature button { flex: 0 0 auto; min-width: 74px; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: var(--blue-600); font-weight: 800; }
.results { margin-top: 22px; }
.result { padding: 17px 0; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; }
.result h3 { margin: 0 0 8px; font-size: 16px; line-height: 1.5; }
.meta { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.result a { color: var(--blue-700); font-weight: 800; text-decoration: none; }
.result a:hover { text-decoration: underline; }
.result-actions { margin: 11px 0 0; }
.result-actions button { min-height: 36px; padding: 0 12px; border: 1px solid #bdd1ec; border-radius: 8px; color: var(--blue-700); background: #f6f9fe; font-size: 10px; font-weight: 900; }
.result-actions button:hover { background: var(--blue-100); }
.message { padding: 14px; border-radius: 10px; color: var(--muted); background: #f3f6fa; font-size: 12px; line-height: 1.55; }
.error { color: #a61b1b; background: #fff0f0; }

.feature-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr); gap: 20px; }
.feature-main, .principle-panel { padding: clamp(28px, 4vw, 50px); border: 1px solid var(--line); border-radius: 19px; background: #fff; box-shadow: var(--shadow); }
.feature-symbol { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 24px; border-radius: 17px; color: var(--violet-700); background: var(--violet-100); font-size: 27px; }
.feature-main h2 { max-width: 620px; margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.feature-main > p { max-width: 720px; margin: 17px 0; color: var(--muted); line-height: 1.75; }
.coming-badge, .count-badge { display: inline-block; padding: 7px 10px; border-radius: 999px; color: var(--violet-700); background: var(--violet-100); font-size: 11px; font-weight: 800; }
.count-badge { color: var(--blue-700); background: var(--blue-100); }
.chat-preview { margin-top: 28px; padding: 20px; border: 1px solid #d8e2ee; border-radius: 14px; background: #f8faff; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; padding-bottom: 13px; border-bottom: 1px solid #e1e8f0; }
.chat-toolbar > span { color: #708096; font-size: 9px; font-weight: 700; }
.chat-toolbar > span.error-text { color: #a61b1b; }
.chat-toolbar > div { display: flex; gap: 7px; }
.chat-toolbar button, .chat-answer-actions button { padding: 7px 9px; border: 1px solid #c7d6e6; border-radius: 7px; color: var(--blue-700); background: #fff; font-size: 9px; font-weight: 900; cursor: pointer; }
.chat-toolbar button:hover, .chat-answer-actions button:hover { border-color: #90afd4; background: var(--blue-100); }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-suggestions button { padding: 8px 10px; border: 1px solid #d2dfed; border-radius: 9px; color: #425d79; background: #fff; font-size: 10px; cursor: pointer; }
.chat-suggestions button:hover { border-color: #9ebbe0; color: var(--blue-700); background: #f3f8ff; }
.chat-messages { display: grid; gap: 13px; max-height: 520px; margin-top: 17px; overflow-y: auto; scroll-behavior: smooth; }
.chat-message { display: flex; align-items: flex-start; gap: 10px; }
.chat-message > span { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff; background: var(--violet-700); font-size: 9px; font-weight: 900; }
.chat-message.user { flex-direction: row-reverse; }
.chat-message.user > span { background: var(--blue-700); }
.chat-message > div { max-width: calc(100% - 42px); padding: 13px 15px; border: 1px solid #dce5ef; border-radius: 4px 13px 13px; background: #fff; }
.chat-message.user > div { border-color: #c7d9ef; border-radius: 13px 4px 13px 13px; background: #eef6ff; }
.chat-message p { margin: 0; color: #30475f; font-size: 12px; line-height: 1.75; white-space: pre-wrap; }
.chat-answer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #edf1f5; }
.chat-answer-actions > div { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-answer-actions button.selected { border-color: var(--green-700); color: var(--green-700); background: var(--green-100); }
.chat-answer-actions button:disabled { cursor: wait; opacity: .65; }
.chat-answer-actions span { color: #8491a1; font-size: 8px; }
.chat-citation { display: inline; margin: 0 1px; padding: 1px 3px; border: 0; border-radius: 4px; color: var(--blue-700); background: var(--blue-100); font: inherit; font-weight: 900; line-height: inherit; cursor: pointer; vertical-align: baseline; }
.chat-citation:hover, .chat-citation:focus-visible { color: #fff; background: var(--blue-600); outline: none; }
.chat-message.loading p { color: var(--muted); }
.chat-sources { display: grid; gap: 8px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #e8edf3; }
.chat-source { display: block; border: 1px solid #e0e7ef; border-radius: 8px; color: #425970; background: #fafcff; font-size: 10px; line-height: 1.55; }
.chat-source:hover, .chat-source[open] { border-color: #aac3e2; background: #f2f7fd; }
.chat-source.highlight { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(36, 107, 209, .14); }
.chat-source summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 11px; cursor: pointer; list-style: none; }
.chat-source summary::-webkit-details-marker { display: none; }
.chat-source summary > span { min-width: 0; }
.chat-source-type { display: inline-block; margin: 0 6px 4px 0; padding: 2px 6px; border-radius: 999px; color: var(--blue-700); background: var(--blue-100); font-size: 8px; font-weight: 900; }
.chat-source.kosha { border-color: #cfe6dc; background: #f8fcfa; }
.chat-source.kosha:hover, .chat-source.kosha[open] { border-color: #87c7aa; background: #f0faf5; }
.chat-source.kosha .chat-source-type { color: #08704c; background: #dff5e9; }
.chat-source.kosha strong, .chat-source.kosha summary em { color: #08704c; }
.chat-source summary em { flex: 0 0 auto; color: var(--blue-700); font-size: 9px; font-style: normal; font-weight: 900; }
.chat-source[open] summary em::before { content: "닫기"; }
.chat-source[open] summary em { font-size: 0; }
.chat-source[open] summary em::before { font-size: 9px; }
.chat-source strong { color: var(--blue-700); }
.chat-source-body { padding: 13px 14px 15px; border-top: 1px solid #dce6f1; background: #fff; }
.chat-source-body p { margin: 0; color: #334a62; font-size: 11px; line-height: 1.8; white-space: pre-wrap; }
.chat-source-body a { display: inline-block; margin-top: 12px; padding: 7px 9px; border: 1px solid #b9cce3; border-radius: 7px; color: var(--blue-700); background: #f6f9fe; font-size: 9px; font-weight: 900; text-decoration: none; }
.chat-source-body a:hover { background: var(--blue-100); }
.chat-input { display: flex; gap: 8px; margin-top: 16px; }
.chat-input button { flex: 0 0 auto; padding: 0 18px; border: 0; border-radius: 10px; color: #fff; background: var(--blue-600); font-weight: 800; }
.chat-input button:disabled { color: #8994a3; background: #e6eaf0; cursor: wait; }
.chat-disclaimer { margin: 11px 2px 0 !important; color: #7b899a !important; font-size: 9px !important; line-height: 1.55 !important; }
.principle-panel h3 { margin: 0 0 20px; font-size: 20px; }
.principle-panel ul { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.principle-panel li { display: flex; gap: 12px; }
.principle-panel li > span { color: var(--blue-600); font-size: 11px; font-weight: 900; }
.principle-panel strong { font-size: 13px; }
.principle-panel p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.empty-feature { display: grid; justify-items: center; padding: 80px 30px; border: 1px dashed #cbd7e5; border-radius: 18px; background: #fff; text-align: center; }
.empty-feature > span { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; color: var(--blue-700); background: var(--blue-100); font-size: 29px; }
.empty-feature h3 { margin: 22px 0 8px; }
.empty-feature p { max-width: 580px; margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.empty-feature button { min-height: 43px; }
.law-manager { margin-bottom: 18px; padding: 20px; }
.law-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.law-filter { display: grid; flex: 1; grid-template-columns: minmax(240px, 1fr) 180px; gap: 10px; }
.revision-filter { grid-template-columns: minmax(240px, 1fr) 150px 150px; }
.law-filter input, .law-filter select { height: 44px; }
select { width: 100%; min-width: 0; height: 48px; padding: 0 36px 0 13px; border: 1px solid #cbd7e5; border-radius: 10px; color: var(--ink); background: #fff; }
select:focus { outline: 3px solid rgba(36, 107, 209, .14); border-color: var(--blue-600); }
.law-actions { display: flex; gap: 8px; }
.button { min-height: 44px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 800; }
.button.primary { color: #fff; background: var(--blue-600); }
.button.secondary { border-color: #cbd7e5; color: #425a73; background: #fff; }
.button:hover { filter: brightness(.98); }
.law-add-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; padding: 20px; border: 1px solid #dbe5ef; border-radius: 13px; background: #f7faff; }
.law-add-panel[hidden] { display: none; }
.law-add-panel h3 { grid-column: 1 / -1; margin: 0 0 2px; font-size: 16px; }
.form-field.wide { grid-column: 1 / -1; }
.form-field label { margin-bottom: 7px; }
.form-field label span { color: #c72d2d; }
.form-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; }
.law-manager-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.law-manager-meta > div { display: flex; align-items: center; gap: 9px; }
.law-manager-meta p { margin: 0; color: var(--muted); font-size: 11px; }
.storage-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; color: var(--amber-700); background: var(--amber-100); font-size: 9px; font-weight: 900; white-space: nowrap; }
.storage-badge.shared { color: var(--green-700); background: var(--green-100); }
.law-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.law-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px 14px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 18px rgba(20, 50, 82, .035); }
.law-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--blue-700); background: var(--blue-100); font-size: 11px; font-weight: 900; }
.law-item strong, .law-item small { display: block; }
.law-item strong { font-size: 13px; }
.law-item small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.law-category { padding: 4px 7px; border-radius: 20px; color: #58708b; background: #edf2f7; font-size: 9px; font-weight: 800; }
.law-item-actions { display: flex; grid-column: 2 / -1; justify-content: flex-end; gap: 12px; border-top: 1px solid #edf1f5; padding-top: 10px; }
.law-item-actions button { padding: 2px 0; border: 0; color: var(--blue-700); background: transparent; font-size: 10px; font-weight: 800; }
.law-item-actions .danger-link { color: #ad3434; }
.law-empty { margin-top: 12px; text-align: center; }
.monitor-panel { margin-bottom: 18px; padding: 22px; border-color: #cfe0f3; background: linear-gradient(135deg, #f9fcff, #fff); }
.monitor-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.monitor-heading h3 { margin: 4px 0 0; font-size: 18px; }
.monitor-heading p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.monitor-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.monitor-candidates { display: grid; gap: 10px; margin-top: 17px; }
.monitor-candidate { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.monitor-candidate-copy { min-width: 0; }
.monitor-candidate-copy > div { display: flex; align-items: center; gap: 9px; }
.monitor-candidate h4 { margin: 0; font-size: 14px; }
.monitor-candidate p { margin: 9px 0 6px; color: #445971; font-size: 11px; line-height: 1.55; }
.monitor-candidate small { color: var(--muted); font-size: 10px; }
.monitor-candidate-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.monitor-candidate-actions a { color: var(--blue-700); font-size: 10px; font-weight: 800; text-decoration: none; }
.monitor-candidate-actions .button { min-height: 38px; }
.monitor-empty { margin-top: 16px; text-align: center; }
.monitor-empty[hidden] { display: none; }
.revision-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.revision-summary article { display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20, 50, 82, .035); }
.revision-summary-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 13px; font-size: 10px; font-weight: 900; }
.revision-summary-icon.upcoming { color: var(--amber-700); background: var(--amber-100); }
.revision-summary-icon.reviewing { color: var(--blue-700); background: var(--blue-100); }
.revision-summary-icon.completed { color: var(--green-700); background: var(--green-100); }
.revision-summary-icon.due-soon { color: var(--amber-700); background: #fff3d6; }
.revision-summary-icon.overdue { color: #a61b1b; background: #fee9e9; }
.revision-summary small, .revision-summary strong { display: block; }
.revision-summary small { color: var(--muted); font-size: 10px; }
.revision-summary strong { margin-top: 3px; font-size: 22px; }
.revision-list { display: grid; gap: 12px; }
.revision-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20, 50, 82, .035); }
.revision-item.overdue { border-color: #e7aaaa; box-shadow: 0 5px 18px rgba(166, 27, 27, .08); }
.revision-item.overdue .revision-date { background: #fff5f5; }
.revision-date { display: flex; flex-direction: column; justify-content: center; padding: 19px; border-right: 1px solid var(--line); background: #f8faff; }
.revision-date small, .revision-date strong, .revision-date span { display: block; }
.revision-date small { color: var(--muted); font-size: 9px; }
.revision-date strong { margin-top: 5px; font-size: 14px; }
.revision-date span { margin-top: 7px; color: var(--blue-700); font-size: 10px; font-weight: 900; }
.revision-copy { padding: 18px 20px; }
.revision-title-row { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.revision-title-row h3 { margin: 0; font-size: 16px; }
.impact-level, .deadline-overdue { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.impact-level.high { color: #a61b1b; background: #fee9e9; }
.impact-level.medium { color: var(--amber-700); background: var(--amber-100); }
.impact-level.low { color: var(--green-700); background: var(--green-100); }
.deadline-overdue { color: #fff; background: #b52828; }
.revision-action-copy { padding: 9px 11px; border-radius: 8px; background: #f7f9fc; }
.revision-action-copy b { margin-right: 5px; color: #334a62; }
.revision-copy > strong { font-size: 12px; }
.revision-copy p { margin: 9px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.revision-copy > small { color: #738298; font-size: 10px; }
.revision-status { padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.revision-status.upcoming { color: var(--amber-700); background: var(--amber-100); }
.revision-status.reviewing { color: var(--blue-700); background: var(--blue-100); }
.revision-status.completed { color: var(--green-700); background: var(--green-100); }
.revision-actions { display: flex; align-items: center; align-content: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; min-width: 185px; padding: 18px; }
.revision-actions a, .revision-actions button { border: 0; color: var(--blue-700); background: transparent; font-size: 10px; font-weight: 800; text-decoration: none; }
.revision-actions .danger-link { color: #ad3434; }
.revision-alert-panel { display: grid; grid-template-columns: minmax(210px, .42fr) minmax(0, 1fr); gap: 20px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid #d5dfeb; border-radius: 14px; background: linear-gradient(135deg, #f9fbfe, #fff); }
.revision-alert-panel h3 { margin: 4px 0 6px; font-size: 17px; }
.revision-alert-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.revision-alert-list { display: grid; gap: 8px; }
.revision-alert-empty { align-self: center; padding: 13px 15px; border-radius: 9px; color: #3b6d52; background: #eef9f2; font-size: 10px; font-weight: 800; }
.revision-alert-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid #ead8ae; border-radius: 10px; background: #fffdf7; }
.revision-alert-item.overdue { border-color: #efc5c5; background: #fff8f8; }
.revision-alert-badge { padding: 4px 7px; border-radius: 999px; color: var(--amber-700); background: var(--amber-100); font-size: 8px; font-weight: 900; white-space: nowrap; }
.revision-alert-item.overdue .revision-alert-badge { color: #fff; background: #b52828; }
.revision-alert-copy { min-width: 0; }
.revision-alert-copy strong, .revision-alert-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.revision-alert-copy strong { font-size: 11px; }
.revision-alert-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.revision-alert-edit { border: 0; color: var(--blue-700); background: transparent; font-size: 9px; font-weight: 900; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-grid .panel { min-height: 190px; }
.admin-grid h3 { margin: 0 0 25px; font-size: 16px; }
.admin-grid p { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.admin-status { display: flex; align-items: center; gap: 10px; }
.admin-status strong { font-size: 13px; }
.ai-operations { margin-top: 18px; }
.ai-operations-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.ai-operations-head h3 { margin: 4px 0 0; font-size: 18px; }
.ai-operations-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.ai-operations-head > div:last-child { display: flex; flex: 0 0 auto; gap: 8px; }
.ai-log-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 20px 0 14px; }
.ai-log-summary[hidden] { display: none; }
.ai-log-summary article { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8faff; }
.ai-log-summary small, .ai-log-summary strong { display: block; }
.ai-log-summary small { color: var(--muted); font-size: 9px; }
.ai-log-summary strong { margin-top: 5px; font-size: 20px; }
.ai-log-list { display: grid; gap: 9px; margin-top: 14px; }
.ai-log-item { display: grid; grid-template-columns: 95px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.ai-log-state { padding: 14px; background: #eff8f3; }
.ai-log-state span, .ai-log-state small { display: block; }
.ai-log-state span { color: var(--green-700); font-size: 10px; font-weight: 900; }
.ai-log-state small { margin-top: 7px; color: #718195; font-size: 8px; line-height: 1.5; }
.ai-log-item.failed .ai-log-state { background: #fff0f0; }
.ai-log-item.failed .ai-log-state span { color: #a61b1b; }
.ai-log-copy { min-width: 0; padding: 14px 16px; }
.ai-log-copy strong { font-size: 12px; }
.ai-log-copy p { display: -webkit-box; margin: 7px 0; overflow: hidden; color: #50647a; font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ai-log-copy small { color: #7d8999; font-size: 9px; }
.system-operations { margin-top: 18px; }
.system-backup-note { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px 12px; margin: 20px 0 14px; padding: 15px 17px; border: 1px solid #cfe0f3; border-radius: 11px; background: #f7faff; }
.system-backup-note strong { color: var(--blue-700); font-size: 12px; }
.system-backup-note span { color: #425a73; font-size: 10px; }
.system-backup-note small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.system-event-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.system-event-summary[hidden] { display: none; }
.system-event-summary article { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.system-event-summary small, .system-event-summary strong { display: block; }
.system-event-summary small { color: var(--muted); font-size: 9px; }
.system-event-summary strong { margin-top: 5px; font-size: 20px; }
.system-event-list { display: grid; gap: 9px; margin-top: 14px; }
.system-event-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 15px 16px; border: 1px solid #f0caca; border-left: 4px solid #c53636; border-radius: 11px; background: #fffafa; }
.system-event-item.warning { border-color: #ead8ae; border-left-color: #c98916; background: #fffdf7; }
.system-event-item.info { border-color: #cfe0f3; border-left-color: var(--blue-600); background: #f9fcff; }
.system-event-item.acknowledged { border-color: var(--line); border-left-color: #aab6c3; background: #fafbfc; opacity: .72; }
.system-event-copy { min-width: 0; }
.system-event-copy > div { display: flex; align-items: center; gap: 9px; }
.system-event-copy > div > span { padding: 3px 7px; border-radius: 999px; color: #a61b1b; background: #fee9e9; font-size: 8px; font-weight: 900; }
.system-event-item.warning .system-event-copy > div > span { color: var(--amber-700); background: var(--amber-100); }
.system-event-item.info .system-event-copy > div > span { color: var(--blue-700); background: var(--blue-100); }
.system-event-copy strong { font-size: 12px; }
.system-event-copy > div > small { color: var(--muted); font-size: 9px; }
.system-event-copy p { margin: 8px 0 4px; color: #425a73; font-size: 11px; }
.system-event-copy > small { display: block; overflow: hidden; color: #7d8999; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.system-event-item .button { min-height: 36px; }
.event-checked { color: #6c7d90; font-size: 9px; font-weight: 800; white-space: nowrap; }
.footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px clamp(22px, 4vw, 50px); border-top: 1px solid var(--line); color: #7d8999; background: #fff; font-size: 10px; }
.sidebar-overlay { display: none; }
body.modal-open { overflow: hidden; }
.law-detail-modal[hidden] { display: none; }
.law-detail-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.law-detail-backdrop { position: absolute; inset: 0; background: rgba(5, 24, 44, .68); backdrop-filter: blur(3px); }
.law-detail-dialog { position: relative; display: flex; flex-direction: column; width: min(1080px, 100%); height: min(88vh, 900px); overflow: hidden; border: 1px solid #cfdae7; border-radius: 18px; background: #f7f9fc; box-shadow: 0 30px 80px rgba(0, 24, 52, .3); }
.law-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 25px 17px; border-bottom: 1px solid var(--line); background: #fff; }
.law-detail-header h2 { margin: 4px 0 0; font-size: 22px; }
.law-detail-header p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.law-detail-close { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d4dee9; border-radius: 10px; color: #4f6073; background: #fff; font-size: 24px; line-height: 1; }
.law-detail-tools { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 25px; border-bottom: 1px solid var(--line); background: #fff; }
.law-detail-tools[hidden] { display: none; }
.law-detail-tools input { height: 42px; }
.law-detail-tools span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.law-detail-tools a { padding: 9px 11px; border: 1px solid #cbd7e5; border-radius: 8px; color: var(--blue-700); font-size: 10px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.law-detail-body { flex: 1; overflow-y: auto; padding: 20px 25px 35px; }
.law-article { margin-bottom: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.law-article > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.law-article h3 { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.law-article > header span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: var(--amber-700); background: var(--amber-100); font-size: 9px; font-weight: 900; }
.law-article-text { margin: 13px 0 0; color: #334a62; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.law-paragraph { margin-top: 13px; padding-top: 13px; border-top: 1px solid #edf1f5; }
.law-paragraph p, .law-clause p { margin: 0; color: #334a62; font-size: 12px; line-height: 1.8; white-space: pre-wrap; }
.law-clause { margin: 9px 0 0 16px; }
.law-clause .law-item-text { margin: 5px 0 0 18px; color: #50647a; }
.law-article > small { display: block; margin-top: 13px; color: #8090a3; font-size: 9px; }

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-panel { grid-template-columns: 1fr; gap: 28px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-grid .panel { min-height: 0; }
  .ai-log-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .revision-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 25; display: block; visibility: hidden; background: rgba(6, 28, 51, .42); opacity: 0; transition: .22s ease; }
  .sidebar-overlay.open { visibility: visible; opacity: 1; }
  .workspace { margin-left: 0; }
  .menu-toggle { display: block; }
  .dashboard-grid, .feature-layout { grid-template-columns: 1fr; }
  .law-list { grid-template-columns: 1fr; }
  .revision-item { grid-template-columns: 125px minmax(0, 1fr); }
  .revision-actions { grid-column: 2; justify-content: flex-start; min-width: 0; padding: 0 20px 18px; }
}

@media (max-width: 680px) {
  .topbar { min-height: 74px; padding: 11px 16px; }
  .topbar-kicker { display: none; }
  .topbar h1 { font-size: 18px; }
  .api-status { max-width: 130px; padding: 7px 9px; font-size: 9px; }
  .content { padding: 20px 14px 38px; }
  .hero-panel { padding: 28px 21px; border-radius: 17px; }
  .hero-copy h2 { font-size: 28px; }
  .quick-search { padding: 16px; }
  .quick-search-row { flex-wrap: wrap; padding: 5px 5px 5px 12px; }
  .quick-search-row input { width: calc(100% - 34px); }
  .quick-search-row button { width: 100%; }
  .summary-grid, .search-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 100px; }
  .panel, .search-card, .feature-main, .principle-panel { padding: 21px; border-radius: 14px; }
  .panel-heading, .page-intro { align-items: flex-start; flex-direction: column; }
  .search-row, .chat-input { flex-direction: column; }
  .chat-toolbar { align-items: flex-start; flex-direction: column; }
  .chat-toolbar > div { width: 100%; }
  .chat-toolbar button { flex: 1; }
  .search-row button, .chat-input button { min-height: 46px; }
  .law-item { grid-template-columns: 36px 1fr; }
  .law-category { grid-column: 2; justify-self: start; }
  .law-toolbar, .law-manager-meta { align-items: stretch; flex-direction: column; }
  .law-filter { grid-template-columns: 1fr; }
  .law-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .law-add-panel { grid-template-columns: 1fr; }
  .law-add-panel h3, .form-field.wide, .form-actions { grid-column: 1; }
  .law-item-actions { grid-column: 2; justify-content: flex-start; }
  .revision-summary { grid-template-columns: 1fr; }
  .revision-alert-panel { grid-template-columns: 1fr; }
  .revision-alert-item { grid-template-columns: auto minmax(0, 1fr); }
  .revision-alert-edit { grid-column: 2; justify-self: start; }
  .monitor-heading, .monitor-candidate { align-items: stretch; flex-direction: column; }
  .ai-operations-head { align-items: stretch; flex-direction: column; }
  .ai-operations-head > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
  .ai-log-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-log-item { grid-template-columns: 1fr; }
  .system-event-item { grid-template-columns: 1fr; }
  .system-event-item > div:last-child { justify-self: start; }
  .monitor-actions { justify-content: space-between; }
  .monitor-candidate-actions { flex-wrap: wrap; }
  .revision-item { grid-template-columns: 1fr; }
  .revision-date { border-right: 0; border-bottom: 1px solid var(--line); }
  .revision-actions { grid-column: 1; }
  .legal-note, .footer { flex-direction: column; }
  .law-detail-modal { padding: 0; }
  .law-detail-dialog { width: 100%; height: 100%; border: 0; border-radius: 0; }
  .law-detail-header { padding: 18px 16px 14px; }
  .law-detail-tools { grid-template-columns: 1fr auto; padding: 11px 16px; }
  .law-detail-tools input { grid-column: 1 / -1; }
  .law-detail-body { padding: 15px 14px 28px; }
  .law-article { padding: 16px; }
}

@media print {
  @page { size: A4; margin: 15mm; }
  body.printing-chat { color: #111; background: #fff; }
  body.printing-chat .sidebar,
  body.printing-chat .topbar,
  body.printing-chat .footer,
  body.printing-chat .principle-panel,
  body.printing-chat .chat-toolbar,
  body.printing-chat .chat-suggestions,
  body.printing-chat .chat-input,
  body.printing-chat .chat-disclaimer,
  body.printing-chat .feature-symbol,
  body.printing-chat .coming-badge { display: none !important; }
  body.printing-chat .workspace { display: block; margin: 0; }
  body.printing-chat .content { width: 100%; padding: 0; }
  body.printing-chat .page { display: none !important; }
  body.printing-chat #page-chat { display: block !important; }
  body.printing-chat .feature-layout { display: block; }
  body.printing-chat .feature-main { padding: 0; border: 0; box-shadow: none; }
  body.printing-chat .feature-main h2 { margin-bottom: 5mm; font-size: 22pt; }
  body.printing-chat .feature-main > p { margin: 0 0 7mm; color: #444; }
  body.printing-chat .chat-preview { margin: 0; padding: 0; border: 0; background: #fff; }
  body.printing-chat .chat-messages { display: block; max-height: none; margin: 0; overflow: visible; }
  body.printing-chat .chat-message { margin-bottom: 5mm; break-inside: avoid; }
  body.printing-chat .chat-message > div { max-width: calc(100% - 42px); }
  body.printing-chat .chat-answer-actions { display: none; }
  body.printing-chat .chat-source { break-inside: avoid; }
  body.printing-chat .chat-source-body a { color: #174f91; }
}
