:root {
  color-scheme: light;
  --navy-950: #0b2540;
  --navy-900: #123656;
  --navy-800: #17466f;
  --navy-700: #1d588a;
  --blue-600: #2673b6;
  --blue-100: #e9f2fa;
  --teal-700: #16756d;
  --teal-100: #e7f5f2;
  --amber-700: #9b6417;
  --amber-100: #fff3da;
  --red-700: #a43f43;
  --red-100: #fdecee;
  --violet-700: #6750a4;
  --violet-100: #f0ebfa;
  --ink-900: #192631;
  --ink-800: #263743;
  --ink-700: #425563;
  --ink-600: #5c6d79;
  --ink-500: #71808a;
  --line-strong: #c7d1d9;
  --line: #dce3e8;
  --line-soft: #e9eef1;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --canvas: #eef2f5;
  --shadow-sm: 0 1px 2px rgba(14, 37, 57, .08);
  --shadow-md: 0 10px 30px rgba(18, 46, 68, .1);
  --radius: 8px;
  --radius-lg: 12px;
  --header-height: 72px;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink-900);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .56;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: -60px;
  left: 16px;
  padding: 10px 16px;
  border-radius: 0 0 6px 6px;
  background: #fff;
  color: var(--navy-900);
  font-weight: 800;
  box-shadow: var(--shadow-md);
  transition: top .15s ease;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 3px solid rgba(38, 115, 182, .38);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: #fff;
  box-shadow: 0 2px 9px rgba(10, 33, 52, .18);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-seal,
.login-seal {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .08);
  font-family: "Batang", "Noto Serif KR", serif;
  font-size: 21px;
  font-weight: 700;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.2;
}

.brand-copy small {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 19px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-link {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 5px;
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}

.public-link:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.user-badge {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-left: 8px;
  padding-left: 16px;
  gap: 9px;
  border-left: 1px solid rgba(255, 255, 255, .18);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.user-badge > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-badge small {
  color: rgba(255, 255, 255, .56);
  font-size: 10px;
}

.user-badge strong {
  max-width: 130px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 15px;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: -.01em;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.button.primary {
  border-color: var(--navy-800);
  background: var(--navy-800);
  color: #fff;
}

.button.primary:hover {
  border-color: var(--navy-700);
  background: var(--navy-700);
  box-shadow: 0 3px 10px rgba(23, 70, 111, .2);
}

.button.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink-800);
}

.button.secondary:hover {
  border-color: #8fa3b2;
  background: var(--surface-soft);
}

.button.publish {
  border-color: var(--teal-700);
  background: var(--teal-700);
  color: #fff;
}

.button.publish:hover {
  background: #0f645e;
}

.button.danger-text,
.danger-text {
  color: var(--red-700);
}

.top-logout {
  min-height: 34px;
  border-color: rgba(255, 255, 255, .3);
  background: transparent;
  color: #fff;
}

.top-logout:hover {
  background: rgba(255, 255, 255, .1);
}

.loading-view {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #f4f6f8;
  color: var(--ink-700);
}

.loading-view strong {
  margin-top: 18px;
  color: var(--ink-900);
  font-size: 16px;
}

.loading-view p {
  margin-top: 4px;
  font-size: 13px;
}

.loading-mark {
  position: relative;
  width: 45px;
  height: 45px;
  border: 3px solid #d7e1e8;
  border-top-color: var(--navy-700);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.loading-mark span {
  position: absolute;
  inset: 8px;
  border: 2px solid #e5ebef;
  border-bottom-color: var(--teal-700);
  border-radius: 50%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-view {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 48px 20px 30px;
  background:
    linear-gradient(rgba(238, 242, 245, .93), rgba(238, 242, 245, .97)),
    repeating-linear-gradient(135deg, #dfe6eb 0, #dfe6eb 1px, transparent 1px, transparent 14px);
}

.login-card {
  width: min(100%, 472px);
  padding: 38px 40px 34px;
  border: 1px solid #cfd9e0;
  border-top: 4px solid var(--navy-800);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(20, 52, 76, .12);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-seal {
  width: 54px;
  height: 54px;
  border-color: var(--navy-800);
  background: var(--navy-900);
  color: #fff;
  font-size: 25px;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
}

.login-heading h1 {
  font-size: 23px;
  letter-spacing: -.04em;
}

.login-intro {
  margin: 22px 0 18px;
  color: var(--ink-600);
  font-size: 13px;
  line-height: 1.75;
}

.security-notice {
  display: flex;
  align-items: flex-start;
  margin-bottom: 23px;
  padding: 12px 13px;
  gap: 10px;
  border: 1px solid #d9e4ec;
  border-radius: 5px;
  background: #f2f7fa;
}

.security-notice > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--navy-700);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.security-notice p {
  color: var(--ink-700);
  font-size: 12px;
  line-height: 1.6;
}

.form-alert {
  margin-bottom: 17px;
  padding: 11px 13px;
  border: 1px solid #e8bfc2;
  border-radius: 5px;
  background: var(--red-100);
  color: #8d3036;
  font-size: 13px;
  font-weight: 700;
}

.field {
  min-width: 0;
}

.field + .field {
  margin-top: 16px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-800);
  font-size: 12px;
  font-weight: 750;
}

.field label em {
  margin-left: 3px;
  color: var(--red-700);
  font-size: 10px;
  font-style: normal;
}

.field input,
.field select,
.field textarea,
.law-search select,
.audit-toolbar select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  padding: 0 11px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.field input,
.field select,
.law-search select,
.audit-toolbar select {
  height: 42px;
}

.field textarea {
  min-height: 78px;
  resize: vertical;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 1.55;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.law-search select:hover,
.audit-toolbar select:hover {
  border-color: #9aabb7;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.law-search select:focus,
.audit-toolbar select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(38, 115, 182, .11);
}

.login-submit {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
  margin-top: 24px;
  padding: 0 17px;
  font-size: 14px;
}

.discord-login {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  text-align: center;
}

.discord-mark {
  color: #fff;
  font-size: 12px;
  letter-spacing: -2px;
}

.login-footnote {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}

.login-footnote strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-700);
  font-size: 11px;
}

.login-footnote p {
  color: var(--ink-500);
  font-size: 11px;
  line-height: 1.6;
}

.login-copyright {
  margin-top: 20px;
  color: var(--ink-500);
  font-size: 11px;
}

.application {
  display: grid;
  min-height: calc(100vh - var(--header-height));
  grid-template-columns: 242px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: var(--header-height);
  display: flex;
  height: calc(100vh - var(--header-height));
  min-height: 600px;
  flex-direction: column;
  border-right: 1px solid #cad5dc;
  background: #fff;
}

.sidebar-context {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  border-bottom: 1px solid var(--line);
}

.context-label {
  margin-bottom: 3px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.sidebar-context strong {
  font-size: 17px;
  letter-spacing: -.03em;
}

.system-state {
  display: inline-flex;
  align-items: center;
  margin-top: 11px;
  gap: 6px;
  color: var(--teal-700);
  font-size: 11px;
  font-weight: 750;
}

.system-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #29a47d;
  box-shadow: 0 0 0 3px rgba(41, 164, 125, .13);
}

.main-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 11px;
  gap: 4px;
}

.nav-item {
  display: grid;
  width: 100%;
  min-height: 45px;
  align-items: center;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-600);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--navy-800);
}

.nav-item.active {
  background: var(--blue-100);
  color: var(--navy-800);
  box-shadow: inset 3px 0 var(--navy-700);
}

.nav-icon {
  color: currentColor;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1;
}

.nav-count {
  display: inline-flex;
  min-width: 24px;
  height: 20px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(29, 88, 138, .1);
  font-size: 10px;
}

.sidebar-help {
  margin: auto 17px 14px;
  padding: 14px;
  border: 1px solid #dbe4ea;
  border-radius: 6px;
  background: var(--surface-soft);
}

.sidebar-help strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-700);
  font-size: 11px;
}

.sidebar-help p {
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.65;
}

.sidebar-version {
  padding: 0 22px 16px;
  color: #9aa6ae;
  font-size: 9px;
  letter-spacing: .1em;
}

.page-area {
  min-width: 0;
  padding: 30px 34px 44px;
}

.page {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 24px;
}

.page-header.compact {
  margin-bottom: 20px;
}

.breadcrumb {
  margin-bottom: 8px;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
}

.breadcrumb span {
  margin: 0 5px;
  color: #aeb8be;
}

.page-header h1 {
  color: var(--ink-900);
  font-size: 27px;
  letter-spacing: -.045em;
}

.page-header p {
  margin-top: 6px;
  color: var(--ink-600);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: flex;
  min-height: 132px;
  align-items: flex-start;
  padding: 23px 21px;
  gap: 15px;
  border: 1px solid #d7e0e6;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.metric-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  border-radius: 8px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 800;
}

.metric-icon.blue {
  background: var(--blue-100);
  color: var(--navy-700);
}

.metric-icon.teal {
  background: var(--teal-100);
  color: var(--teal-700);
}

.metric-icon.amber {
  background: var(--amber-100);
  color: var(--amber-700);
}

.metric-icon.violet {
  background: var(--violet-100);
  color: var(--violet-700);
}

.metric-card > div {
  min-width: 0;
}

.metric-card > div > span {
  display: block;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 750;
}

.metric-card strong {
  display: flex;
  align-items: baseline;
  margin-top: 2px;
  color: var(--ink-900);
  line-height: 1.2;
}

.metric-card strong b {
  font-size: 29px;
  letter-spacing: -.04em;
}

.metric-card strong small {
  margin-left: 4px;
  color: var(--ink-500);
  font-size: 12px;
}

.metric-card p {
  margin-top: 7px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  margin-top: 18px;
  gap: 18px;
}

.panel {
  border: 1px solid #d6e0e6;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 19px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  font-size: 15px;
  letter-spacing: -.02em;
}

.panel-header p {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 10px;
}

.text-button {
  flex: 0 0 auto;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--navy-700);
  font-size: 11px;
  font-weight: 750;
}

.text-button span {
  margin-left: 3px;
}

.recent-list,
.activity-list {
  min-height: 306px;
}

.recent-item {
  display: grid;
  min-height: 69px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 19px;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
}

button.recent-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
  text-align: left;
}

.recent-item:last-child {
  border-bottom: 0;
}

button.recent-item:hover {
  background: #f8fafb;
}

.recent-item-main {
  min-width: 0;
}

.recent-item-main strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item-main span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
}

.recent-item-side time {
  color: var(--ink-500);
  font-size: 9px;
}

.activity-item {
  position: relative;
  display: grid;
  min-height: 61px;
  grid-template-columns: 31px minmax(0, 1fr);
  padding: 10px 17px;
  gap: 10px;
}

.activity-item::after {
  position: absolute;
  top: 42px;
  bottom: -6px;
  left: 32px;
  width: 1px;
  background: #dce5ea;
  content: "";
}

.activity-item:last-child::after {
  display: none;
}

.activity-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  margin-top: 1px;
  border: 1px solid #d4e0e7;
  border-radius: 50%;
  background: #f3f7f9;
  color: var(--navy-700);
  font-size: 11px;
  font-weight: 900;
}

.activity-copy {
  min-width: 0;
}

.activity-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-copy p {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-600);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-copy time {
  display: block;
  margin-top: 2px;
  color: #8a979f;
  font-size: 9px;
}

.status-badge,
.action-badge {
  display: inline-flex;
  width: fit-content;
  min-height: 20px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.active,
.status-badge.published {
  border-color: #b8ded5;
  background: var(--teal-100);
  color: var(--teal-700);
}

.status-badge.pending,
.status-badge.proposal,
.status-badge.draft {
  border-color: #ead5a5;
  background: var(--amber-100);
  color: var(--amber-700);
}

.status-badge.repealed,
.status-badge.archived {
  border-color: #d8dfe3;
  background: #f0f3f5;
  color: var(--ink-600);
}

.empty-block {
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px;
  color: var(--ink-500);
  text-align: center;
}

.empty-block > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 9px;
  border-radius: 50%;
  background: var(--surface-soft);
  font-family: Georgia, serif;
  font-size: 18px;
}

.empty-block strong {
  color: var(--ink-700);
  font-size: 12px;
}

.empty-block p {
  margin-top: 4px;
  font-size: 10px;
}

.workbench {
  display: grid;
  min-height: 730px;
  grid-template-columns: 304px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #cfd9df;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.law-browser {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
}

.browser-head {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px 0 17px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.browser-head strong {
  font-size: 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-600);
  font-weight: 800;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.law-search {
  display: grid;
  padding: 13px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  display: flex;
  height: 39px;
  align-items: center;
  padding: 0 10px;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-500);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.search-box:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(38, 115, 182, .1);
}

.search-box input {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.law-search select {
  height: 36px;
  font-size: 11px;
}

.browser-summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-500);
  font-size: 10px;
}

.browser-summary strong {
  color: var(--navy-700);
}

.law-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.law-list-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 82px;
  padding: 13px 14px 12px 17px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
}

.law-list-item:hover {
  background: #f3f7f9;
}

.law-list-item.selected {
  background: var(--blue-100);
  box-shadow: inset 3px 0 var(--navy-700);
}

.law-list-item strong {
  display: block;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 12px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-list-item .short-title {
  display: block;
  min-height: 16px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  gap: 8px;
}

.law-item-meta time {
  overflow: hidden;
  color: #8a979f;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-list-empty {
  padding: 45px 20px;
  color: var(--ink-500);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}

.editor-shell {
  min-width: 0;
  background: #fff;
}

.editor-empty {
  display: flex;
  height: 100%;
  min-height: 620px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--ink-500);
  text-align: center;
}

.editor-empty > span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 17px;
  border: 1px solid #d7e1e7;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--navy-700);
  font-family: Georgia, serif;
  font-size: 27px;
}

.editor-empty h2 {
  color: var(--ink-800);
  font-size: 16px;
}

.editor-empty p {
  margin-top: 6px;
  font-size: 11px;
}

.editor {
  min-width: 0;
}

.editor-header {
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 19px 14px 22px;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.editor-heading {
  min-width: 200px;
}

.editor-kicker {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  gap: 8px;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 700;
}

.editor-heading h2 {
  overflow: hidden;
  font-size: 19px;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-heading p {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.editor-actions .button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 11px;
}

.dirty-banner {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px 0 22px;
  border-bottom: 1px solid #eadbb9;
  background: #fff9eb;
  color: #765019;
  font-size: 10px;
  font-weight: 700;
}

.dirty-banner span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dirty-banner i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ca891f;
}

.dirty-banner button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #865817;
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.editor-tabs {
  display: flex;
  min-height: 47px;
  align-items: flex-end;
  padding: 0 22px;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.editor-tab {
  position: relative;
  height: 47px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 750;
}

.editor-tab:hover {
  color: var(--navy-800);
}

.editor-tab.active {
  color: var(--navy-800);
}

.editor-tab.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--navy-700);
  content: "";
}

.editor-tab span {
  display: inline-flex;
  min-width: 19px;
  height: 17px;
  align-items: center;
  justify-content: center;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e8edf1;
  color: var(--ink-600);
  font-size: 9px;
}

.editor-content {
  min-width: 0;
}

.editor-panel {
  padding: 24px 25px 30px;
}

.editor-panel fieldset {
  margin: 0;
  padding: 0 0 24px;
  border: 0;
}

.editor-panel fieldset + fieldset {
  padding-top: 23px;
  border-top: 1px solid var(--line);
}

.editor-panel legend {
  display: flex;
  width: 100%;
  align-items: baseline;
  margin-bottom: 18px;
  gap: 9px;
}

.editor-panel legend span {
  font-size: 14px;
  font-weight: 800;
}

.editor-panel legend small {
  color: var(--ink-500);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.form-grid .field + .field {
  margin-top: 0;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.public-field {
  display: flex;
  flex-direction: column;
}

.switch-row {
  display: flex !important;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin: 0 !important;
  padding: 8px 10px 8px 12px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  cursor: pointer;
}

.switch-row > span {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.switch-row strong {
  font-size: 11px;
}

.switch-row small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-row i {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 12px;
  background: #bbc5cb;
  transition: background .15s ease;
}

.switch-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  content: "";
  transition: transform .15s ease;
}

.switch-row input:checked + i {
  background: var(--teal-700);
}

.switch-row input:checked + i::after {
  transform: translateX(16px);
}

.switch-row input:focus-visible + i {
  outline: 3px solid rgba(38, 115, 182, .35);
  outline-offset: 2px;
}

.source-panel {
  padding: 0;
}

.source-toolbar {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 21px;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.source-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.source-toolbar strong {
  font-size: 12px;
}

.source-toolbar span {
  color: var(--ink-500);
  font-size: 9px;
}

.view-switch {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
}

.view-switch button {
  min-width: 47px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 750;
}

.view-switch button.active {
  background: #fff;
  color: var(--navy-800);
  box-shadow: var(--shadow-sm);
}

.source-workspace {
  display: grid;
  min-height: 590px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.source-workspace.edit {
  grid-template-columns: 1fr;
}

.source-workspace.preview {
  grid-template-columns: 1fr;
}

.source-workspace.edit .source-preview-pane,
.source-workspace.preview .source-editor-pane {
  display: none;
}

.source-editor-pane,
.source-preview-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.source-editor-pane {
  border-right: 1px solid var(--line);
  background: #f9fafb;
}

.source-workspace.edit .source-editor-pane {
  border-right: 0;
}

.source-editor-pane > label,
.preview-label {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #f5f7f8;
  color: var(--ink-600);
  font-size: 9px;
  font-weight: 750;
}

.preview-label small {
  color: var(--teal-700);
  font-size: 8px;
}

#lawContent {
  width: 100%;
  min-height: 554px;
  flex: 1;
  resize: vertical;
  padding: 19px 21px 50px;
  border: 0;
  outline: 0;
  background:
    linear-gradient(90deg, transparent 42px, #e8edf0 42px, #e8edf0 43px, transparent 43px),
    #fff;
  color: #24343f;
  font-family: "D2Coding", "NanumGothicCoding", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.8;
  tab-size: 2;
}

#lawContent:focus {
  box-shadow: inset 0 0 0 2px rgba(38, 115, 182, .17);
}

.source-preview-pane {
  background: #f0f2f3;
}

.law-preview {
  width: calc(100% - 34px);
  min-height: 515px;
  margin: 17px auto 24px;
  padding: 40px clamp(28px, 6%, 55px) 60px;
  overflow-wrap: anywhere;
  border: 1px solid #d4d9dc;
  background: #fff;
  box-shadow: 0 3px 12px rgba(21, 42, 56, .08);
  color: #1e272d;
  font-family: "Batang", "Noto Serif KR", serif;
  font-size: 13px;
  line-height: 1.95;
}

.law-preview.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #89959c;
  font-family: inherit;
  font-size: 11px;
  text-align: center;
}

.preview-law-title {
  margin: 0 0 10px;
  padding-bottom: 17px;
  border-bottom: 2px solid #222c32;
  font-size: 22px;
  line-height: 1.4;
  text-align: center;
}

.preview-law-meta {
  margin-bottom: 30px;
  color: #68747c;
  font-family: "Malgun Gothic", sans-serif;
  font-size: 9px;
  text-align: center;
}

.preview-chapter {
  margin: 31px 0 13px;
  font-size: 15px;
  text-align: center;
}

.preview-article {
  margin: 19px 0 5px;
  font-weight: 700;
}

.preview-paragraph {
  margin: 4px 0;
  white-space: pre-wrap;
}

.preview-spacer {
  height: 10px;
}

.history-panel {
  padding: 24px 26px 36px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 18px;
}

.history-heading h3 {
  font-size: 15px;
}

.history-heading p {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 10px;
}

.version-timeline {
  position: relative;
  padding-left: 27px;
}

.version-timeline::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 8px;
  width: 2px;
  background: #dbe3e8;
  content: "";
}

.version-card {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 79px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 11px;
  padding: 13px 15px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  text-align: left;
}

.version-card::before {
  position: absolute;
  top: 26px;
  left: -25px;
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #a9b6bf;
  box-shadow: 0 0 0 2px #dbe3e8;
  content: "";
}

.version-card:hover {
  border-color: #aab9c4;
  background: #fafcfd;
}

.version-card.selected {
  border-color: #93b5d0;
  background: #f2f7fb;
}

.version-card.selected::before {
  background: var(--navy-700);
  box-shadow: 0 0 0 2px #a8c4da;
}

.version-card-main {
  min-width: 0;
}

.version-card-main strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-card-main span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-500);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.version-card-side {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.version-card-side time {
  color: var(--ink-500);
  font-size: 9px;
}

.audit-table-panel {
  overflow: hidden;
}

.audit-toolbar {
  display: grid;
  min-height: 67px;
  align-items: center;
  grid-template-columns: minmax(240px, 390px) 150px;
  padding: 12px 16px;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.audit-toolbar select {
  height: 39px;
  font-size: 11px;
}

.table-wrap {
  overflow-x: auto;
}

.audit-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.audit-table th {
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f9fa;
  color: var(--ink-600);
  text-align: left;
  font-size: 10px;
  font-weight: 800;
}

.audit-table th:nth-child(1) { width: 155px; }
.audit-table th:nth-child(2) { width: 130px; }
.audit-table th:nth-child(3) { width: 105px; }
.audit-table th:nth-child(4) { width: 215px; }

.audit-table td {
  height: 54px;
  padding: 9px 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-700);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-table tr:last-child td {
  border-bottom: 0;
}

.audit-table tbody tr:hover {
  background: #fafcfd;
}

.audit-table td strong {
  color: var(--ink-900);
  font-size: 11px;
}

.action-badge.create,
.action-badge.publish {
  background: var(--teal-100);
  color: var(--teal-700);
}

.action-badge.update {
  background: var(--blue-100);
  color: var(--navy-700);
}

.action-badge.archive {
  background: var(--red-100);
  color: var(--red-700);
}

.table-empty {
  padding: 60px 20px;
  color: var(--ink-500);
  text-align: center;
  font-size: 12px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  width: min(380px, calc(100vw - 32px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  min-height: 54px;
  align-items: center;
  grid-template-columns: 25px minmax(0, 1fr);
  padding: 10px 14px;
  gap: 8px;
  border: 1px solid #2f556d;
  border-radius: 6px;
  background: #17394f;
  color: #fff;
  box-shadow: 0 9px 27px rgba(11, 35, 53, .24);
  font-size: 11px;
  font-weight: 700;
  animation: toast-in .2s ease both;
}

.toast::before {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  content: "✓";
  font-size: 10px;
}

.toast.error {
  border-color: #9c3d43;
  background: #8f343a;
}

.toast.error::before {
  content: "!";
}

.toast.removing {
  animation: toast-out .2s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(5px); }
}

@media (max-width: 1220px) {
  .page-area {
    padding-right: 24px;
    padding-left: 24px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-columns {
    grid-template-columns: 1fr;
  }

  .editor-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-actions {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  :root {
    --header-height: 64px;
  }

  .topbar {
    padding: 0 18px;
  }

  .brand-seal {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .brand-copy small,
  .user-badge,
  .public-link span {
    display: none;
  }

  .brand-copy strong {
    font-size: 16px;
  }

  .application {
    display: block;
  }

  .sidebar {
    position: sticky;
    z-index: 30;
    top: var(--header-height);
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .sidebar-context,
  .sidebar-help,
  .sidebar-version {
    display: none;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 7px 12px;
    gap: 6px;
  }

  .nav-item {
    min-height: 39px;
    grid-template-columns: 22px auto auto;
    justify-content: center;
    padding: 0 9px;
    text-align: center;
  }

  .nav-item.active {
    box-shadow: inset 0 -3px var(--navy-700);
  }

  .page-area {
    padding: 24px 18px 38px;
  }

  .workbench {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .source-workspace.split {
    grid-template-columns: 1fr;
  }

  .source-workspace.split .source-editor-pane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .source-workspace.split #lawContent {
    min-height: 400px;
  }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 12px;
  }

  .brand-copy strong {
    max-width: 190px;
    font-size: 14px;
  }

  .public-link {
    width: 35px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .public-link::after {
    font-size: 15px;
    content: "↗";
  }

  .top-logout {
    padding: 0 9px;
    font-size: 11px;
  }

  .login-card {
    padding: 30px 24px;
  }

  .login-heading h1 {
    font-size: 20px;
  }

  .page-area {
    padding: 20px 12px 32px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .page-header h1 {
    font-size: 23px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 112px;
  }

  .main-nav {
    padding-right: 6px;
    padding-left: 6px;
  }

  .nav-item {
    display: flex;
    min-width: 0;
    gap: 5px;
    font-size: 11px;
  }

  .nav-icon,
  .nav-count {
    display: none;
  }

  .workbench {
    display: block;
    overflow: visible;
  }

  .law-browser {
    height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .editor-header {
    padding: 15px;
  }

  .editor-tabs {
    padding: 0 15px;
  }

  .editor-panel {
    padding: 20px 15px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .editor-panel legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .editor-actions .button {
    flex: 1 1 auto;
  }

  .source-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .view-switch {
    width: 100%;
  }

  .view-switch button {
    flex: 1;
  }

  .law-preview {
    width: calc(100% - 16px);
    padding: 30px 20px 45px;
  }

  .history-panel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .audit-toolbar {
    grid-template-columns: 1fr;
  }

  .toast-region {
    right: 16px;
    bottom: 16px;
  }
}

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