/* 법령 · 모달 · 공통 부품 · 급여 — styles.css 에서 잘라 낸 조각. 자른 순서대로 읽힌다 · 순서를 바꾸면 생김새가 바뀐다 */
.popup-formula {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7db;
  border: 1px solid #f1deb1;
}
.popup-formula-title {
  margin-bottom: 8px;
  color: #9a6700;
  font-weight: 700;
}
.popup-formula-line {
  padding: 4px 0;
  color: #8a5a00;
  text-align: left;
  white-space: pre-wrap;
  line-height: 1.5;
}
.popup-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.popup-total strong {
  font-size: 24px;
}

@media (max-width: 1200px) {
  .client-popup-form .client-address-field { grid-column: auto; }
  .topbar, .layout, .summary-grid, .content-grid, .form-grid,
  .mini-grid.four, .mini-grid.three, .result-summary, .tab-summary {
    grid-template-columns: 1fr;
  }
    .tool-split-grid {
      grid-template-columns: 1fr;
    }
    .modal-shell {
      width: min(920px, calc(100vw - 32px));
      left: 16px !important;
      top: 16px !important;
      transform: none !important;
    }
    #credit-detail-close {
      top: -12px;
      right: 0;
      transform: none;
    }
    .inline-form,
  .note-form {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .check-grid.monthly,
  .check-grid.compact,
  .vat-card-grid,
  .vat-period-grid,
  .month-board-labels,
  .month-board-cells {
    grid-template-columns: 1fr;
  }
  .vat-client-top,
  .vat-period-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .vat-client-summary {
    justify-items: start;
  }
  .month-board-labels.compact,
  .month-board-cells.compact {
    grid-template-columns: 1fr;
  }
  .popup-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .monthly-task-grid,
  .monthly-focus-card,
  .monthly-row-grid {
    grid-template-columns: 1fr;
  }

  .monthly-company-cell,
  .monthly-status-cell {
    min-height: 0;
  }

  #view-credit .form-grid,
  #view-credit .employee-line-inputs.compact-two,
  #view-credit .section-line-inputs.compact-four {
    grid-template-columns: 1fr;
  }

  #view-credit .employee-line-card,
  #view-credit .section-line-card.refined {
    grid-template-columns: 1fr;
  }

  .client-board-head {
    align-items: stretch;
  }

  .inline-actions,
  .tab-row,
  .search-inline,
  .form-actions {
    width: 100%;
  }

  .search-inline {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== 병원 매출 ===== */
.hr-shell { min-height: 100vh; padding: 20px; }
.hr-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; }
.hr-sidebar { display: grid; gap: 16px; align-content: start; }
.hr-main { display: grid; gap: 18px; align-content: start; }
.hr-hospital-list { display: grid; gap: 8px; margin: 10px 0; }
.hr-hospital-item {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 4px 8px 4px 4px; background: #fff;
}
.hr-hospital-item.active { border-color: var(--primary); background: var(--primary-soft); }
.hr-hospital-pick {
  flex: 1; display: grid; gap: 2px; text-align: left;
  border: none; background: transparent; cursor: pointer; padding: 8px 10px; color: var(--text);
}
.hr-hospital-pick strong { font-size: 14px; }
.hr-hospital-pick span { font-size: 12px; color: var(--muted); }
.hr-hospital-edit { padding: 6px 10px; font-size: 12px; }
.hr-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hr-summary .summary-card { min-width: 0; container-type: inline-size; }
.hr-summary .summary-card strong { font-size: clamp(20px, 12cqw, 34px); white-space: nowrap; }
.hr-kind-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.hr-kind-tag.yy { background: var(--progress-bg); color: var(--progress-text); }
.hr-kind-tag.uy { background: var(--warn-bg); color: var(--warn-text); }
.hr-amt { text-align: right; font-variant-numeric: tabular-nums; }
#hr-monthly-board table td:nth-child(n+3),
#hr-monthly-board table th:nth-child(n+3) { text-align: right; }
.hr-advance-row { color: var(--muted); background: rgba(148, 163, 184, 0.08); }
.hr-excl {
  display: inline-block; padding: 1px 6px; border-radius: 6px;
  background: #f1f5f9; color: var(--muted); font-size: 11px; margin-left: 4px;
}
.hr-kind-tag.sum { background: var(--dark); color: #fff; }
.hr-year-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.hr-closed-badge { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-text); font-size: 12px; font-weight: 600; }
.payroll-title-label { display: flex; flex: 1 1 auto; min-width: 0; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.payroll-title-label input { flex: 1 1 auto; width: 100%; min-width: 320px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--text); background: #fff; }
#view-payroll .panel-head { flex-wrap: wrap; }
/* 네트급여 인원 입력: 엑셀식 격자 셀 */
.payroll-grid-wrap { overflow-x: auto; }
.payroll-grid-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.payroll-grid-table th { padding: 9px 10px; background: #eef2f7; border: 1px solid #d3dbe6; font-size: 13px; font-weight: 600; color: #40506a; text-align: center; }
.payroll-grid-table th.payroll-manage-col { width: 72px; }
.payroll-grid-table td { padding: 0; border: 1px solid #d3dbe6; }
.payroll-grid-cell { position: relative; height: 40px; cursor: cell; background: #fff; }
.payroll-grid-cell input { width: 100%; height: 100%; margin: 0; border: 0; background: transparent; padding: 8px 10px; font-size: 14px; color: var(--text); outline: none; box-sizing: border-box; text-align: center; }
.payroll-grid-cell input::placeholder { color: #b6c0cd; }
.payroll-grid-cell input { caret-color: transparent; }
.payroll-grid-cell.is-editing input { caret-color: auto; }
.payroll-grid-cell:not(.is-editing) input::selection { background: transparent; color: inherit; }
.payroll-grid-cell:focus-within { outline: 2px solid #4c91d6; outline-offset: -2px; background: rgba(76, 145, 214, 0.08); z-index: 1; }
.payroll-grid-cell.is-editing { outline: 2px solid #2f7fce; background: #fff; z-index: 2; }
.payroll-manage-cell { padding: 4px 6px !important; text-align: center; }
.payroll-manage-cell .secondary-button { padding: 5px 12px; font-size: 13px; }
.table-wrap.is-locked .payroll-grid-cell { cursor: default; background: #f6f6f4; }
.table-wrap.is-locked .payroll-grid-cell input { color: var(--muted); }
.payroll-total-row { background: rgba(21, 101, 192, 0.07); }
.payroll-total-row td { font-weight: 600; border-top: 2px solid var(--line); }
/* 네트급여 화면: 좌우 폭 정리 + 거래처 선택 */
.payroll-view { max-width: 1080px; width: 100%; justify-self: center; }
.payroll-client-panel { gap: 12px; }
.payroll-client-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.payroll-client-field { display: grid; gap: 8px; }
.payroll-client-field:first-child { flex: 1 1 340px; min-width: 240px; }
.payroll-month-field { flex: 0 0 auto; }
.payroll-field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.payroll-month-selects { display: flex; gap: 8px; }
.payroll-month-selects select { min-width: 104px; height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--text); font-size: 15px; }
.payroll-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
#view-payroll .form-actions { flex-wrap: wrap; }
.payroll-actions-spacer { flex: 1 1 auto; }
/* 원천세 탭 마감 / 인쇄 버튼 (툴바) */
.withholding-tab-actions { display: flex; align-items: center; }
.withholding-close-btn { border-color: #f0b46a; color: #9a5b12; background: #fff7ed; font-weight: 600; }
.withholding-close-btn.is-closed { border-color: #f0a3a3; color: #b91c1c; background: #fee2e2; }
.withholding-print-btn { border-color: #a9c6f2; color: #1d4ed8; background: #eef4ff; font-weight: 600; }
.withholding-workflow-wrap.is-locked { position: relative; }
.withholding-workflow-wrap.is-locked::after { content: "🔒 마감됨 · 수정하려면 마감을 해제하세요"; position: sticky; left: 0; display: block; padding: 6px 12px; background: rgba(185, 28, 28, 0.08); color: #b91c1c; font-size: 12.5px; font-weight: 600; }
.withholding-workflow-wrap.is-locked .withholding-grid-cell { background: #f6f6f4; }
.withholding-workflow-wrap.is-locked .withholding-grid-cell input { color: var(--muted); }
/* 홈: 이달의 주요 세무일정 */
.home-schedule-panel { gap: 12px; }
.home-schedule-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.home-schedule-item { display: flex; align-items: baseline; gap: 14px; padding: 9px 6px; border-bottom: 1px solid var(--line); }
.home-schedule-item:last-child { border-bottom: 0; }
.home-schedule-date { flex: 0 0 82px; font-weight: 700; color: #1d4ed8; font-size: 14px; }
.home-schedule-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.home-schedule-title { font-weight: 600; color: var(--text); font-size: 14px; }
.home-schedule-note { color: var(--muted); font-size: 12.5px; }
/* 홈: 원천세 진행 현황 */
.home-withholding-panel { gap: 14px; }
.home-wh-row { display: grid; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.home-wh-row:last-child { border-bottom: 0; }
.home-wh-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.home-wh-label { font-weight: 600; font-size: 14px; color: var(--text); }
.home-wh-count { font-size: 13px; color: var(--muted); }
.home-wh-bar { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.home-wh-bar-fill { height: 100%; border-radius: 999px; background: #4c91d6; transition: width .2s ease; }
.home-wh-bar-fill.is-done { background: #16a34a; }
.home-withholding-panel .summary-progress { margin-top: 2px; }
.home-withholding-clear { margin: 0; color: #15803d; font-weight: 600; }
.home-withholding-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.home-withholding-chip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 12px; border-radius: 999px; background: rgba(185, 28, 28, 0.07); color: #b91c1c; font-size: 13px; font-weight: 500; border: 1px solid rgba(185, 28, 28, 0.18); }
#payroll-close-button.is-active { background: var(--warn-bg, #fff4e5); border-color: #f0b46a; color: #9a5b12; font-weight: 600; }
.table-wrap.is-locked { position: relative; opacity: 0.92; padding-top: 36px; }
.table-wrap.is-locked::before { content: "🔒 마감된 월"; position: absolute; top: 6px; left: 2px; z-index: 2; padding: 4px 10px; border-radius: 999px; background: rgba(154, 91, 18, 0.12); color: #9a5b12; font-size: 12px; font-weight: 600; pointer-events: none; }
.table-wrap.is-locked .table-input { background: #f6f6f4; color: var(--muted); }
@media (max-width: 720px) { .payroll-actions-spacer { display: none; } }
@media (max-width: 720px) {
  .payroll-client-field:first-child, .payroll-month-field { flex: 1 1 100%; }
  .payroll-month-selects select { flex: 1 1 0; }
}
.hr-matrix { font-size: 12.5px; border-collapse: collapse; white-space: nowrap; }
.hr-matrix th, .hr-matrix td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.hr-matrix thead th { position: sticky; top: 0; background: var(--primary-soft); color: var(--dark); font-weight: 600; }
.hr-matrix tbody td.hr-amt { font-variant-numeric: tabular-nums; }
.hr-subtotal-row { background: rgba(21, 101, 192, 0.06); font-weight: 600; }
.hr-subtotal-row:last-child { background: rgba(15, 23, 42, 0.08); }
.hr-tab-row { margin-top: 2px; }
.hr-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 13px;
  font-weight: 600;
  cursor: pointer;
}
.hr-tab.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.hr-panel { min-width: 0; }
.hr-journal-balance {
  color: #166534;
  font-size: 13px;
  font-weight: 700;
}
.hr-journal-balance.is-error { color: #b91c1c; }
.hr-journal-month-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
.hr-journal-months {
  display: grid;
  grid-template-columns: repeat(12, 112px);
  width: max-content;
  min-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.hr-journal-month {
  min-height: 64px;
  padding: 9px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
}
.hr-journal-month:last-child { border-right: 0; }
.hr-journal-month span { display: block; color: var(--muted); font-size: 11px; }
.hr-journal-month strong { display: block; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hr-journal-month.active { background: var(--primary-soft); color: var(--primary); }
#hr-journal-board table { min-width: 1000px; }
#hr-journal-board th:nth-child(4), #hr-journal-board th:nth-child(5),
#hr-journal-board td:nth-child(4), #hr-journal-board td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hr-journal-total { background: rgba(21, 101, 192, 0.12); }
.hr-journal-total td { border-top: 2px solid rgba(21, 101, 192, 0.35); }
.hr-journal-sections { display: grid; gap: 24px; min-width: 0; }
.hr-journal-section { min-width: 0; }
.hr-journal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.hr-journal-section-head h4 { margin: 0; font-size: 15px; }
.hr-journal-code-button {
  min-width: 64px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.hr-journal-code-button:hover,
.hr-journal-code-button:focus-visible {
  border-color: var(--primary);
  background: var(--primary-soft);
  outline: none;
}
.hr-master-upload-grid { display: grid; gap: 0; }
.hr-master-upload-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.hr-master-upload-section:first-child { padding-top: 6px; }
.hr-master-upload-section:last-child { border-bottom: 0; }
.hr-master-upload-section h4 { margin: 0 0 6px; font-size: 15px; }
.hr-master-search-shell { width: min(520px, calc(100vw - 32px)); }
.hr-master-search-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
}
.hr-master-search-input:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.hr-master-search-results {
  display: grid;
  max-height: 340px;
  margin-top: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.hr-master-search-result {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.hr-master-search-result:last-child { border-bottom: 0; }
.hr-master-search-result:hover,
.hr-master-search-result:focus-visible { background: var(--primary-soft); outline: none; }
.hr-master-search-result strong { color: var(--primary); font-variant-numeric: tabular-nums; }
.hr-master-search-result span { min-width: 0; overflow-wrap: anywhere; }
.hr-manual-table input { min-width: 96px; }
.hr-manual-table td:first-child,
.hr-manual-table th:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 210px;
}
.hr-manual-table thead th:first-child { background: var(--primary-soft); }
.hr-advance-summary {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  background: #fff;
}
.hr-advance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: #f5f7fa;
  min-width: 1344px;
}
.hr-advance-head div { display: flex; align-items: baseline; gap: 10px; }
.hr-advance-head span { color: var(--muted); font-size: 12px; }
.hr-advance-months {
  display: grid;
  grid-template-columns: repeat(12, minmax(112px, 1fr));
  min-width: 1344px;
  border-top: 1px solid var(--line);
}
.hr-advance-months > div { padding: 10px; border-right: 1px solid var(--line); }
.hr-advance-months > div:last-child { border-right: 0; }
.hr-advance-months span { display: block; color: var(--muted); font-size: 12px; }
.hr-advance-months strong { display: block; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hr-advance-summary > .status-text { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); }
.hr-row-delete { padding: 6px 9px; }
@media (max-width: 900px) {
  .hr-layout { grid-template-columns: 1fr; }
  .hr-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-master-upload-section { align-items: stretch; flex-direction: column; }
}

/* 국가법령정보센터 3단 비교 */
.law-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.law-hero p:not(.hero-label) { margin: 8px 0 0; color: var(--muted); }
.law-source-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 8px; }
.law-source-tabs button { padding: 9px 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #526579; font-weight: 700; cursor: pointer; }
.law-source-tabs button:hover { background: #f0f5fa; color: var(--primary); }
.law-source-tabs button.active { border-color: #9fc0e3; background: #e7f1fc; color: #075fc0; box-shadow: inset 0 -2px #1971c9; }
.law-prototype-label { margin-left: auto; padding: 5px 9px; border-radius: 999px; background: #fff7ed; color: #9a4d05; font-size: 11px; font-weight: 800; }
.law-search-panel { display: grid; gap: 12px; }
.law-search-form { display: grid; grid-template-columns: 170px minmax(260px, 1fr) auto; gap: 10px; align-items: end; }
.law-search-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.law-search-mode-field { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }
.law-search-mode-field select, .law-search-field input, .law-find-panel input {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text);
}
.law-search-mode-field select:focus, .law-search-field input:focus, .law-find-panel input:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.law-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.law-presets button {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--primary); cursor: pointer;
}
.law-presets button:hover { border-color: var(--primary); background: var(--primary-soft); }
.law-workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.law-results-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: hidden; }
.law-search-results { display: grid; gap: 8px; max-height: calc(100vh - 160px); overflow-y: auto; padding-right: 3px; }
.law-result-card {
  display: grid; gap: 5px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); text-align: left; cursor: pointer;
}
.law-result-card strong { color: var(--dark); }
.law-result-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.law-result-card .law-result-article { color: var(--primary); font-size: 13px; font-weight: 800; }
.law-result-card .law-result-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: #526579;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.law-result-card:hover, .law-result-card.active { border-color: var(--primary); background: var(--primary-soft); }
.law-result-card.active { box-shadow: inset 3px 0 var(--primary); }
.law-comparison-area { min-width: 0; }
.law-compare-toolbar { display: flex; align-items: flex-start; flex-direction: column; gap: 14px; }
.law-compare-toolbar h3 { margin-top: 4px; }
.law-compare-toolbar .meta-line { margin: 7px 0 0; }
.law-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; }
.law-mode-toggle { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #f5f7fa; }
.law-mode-toggle button { padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.law-mode-toggle button.active { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.law-find-panel { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.law-find-panel label { display: grid; grid-template-columns: auto minmax(180px, 340px); align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.law-find-panel input { padding: 8px 10px; }
.law-column-head { position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; border: 1px solid #b9c9d9; border-radius: 10px 10px 0 0; overflow: hidden; background: #e9f1f9; box-shadow: 0 5px 10px rgba(15,23,42,.07); }
.law-column-head strong { min-width: 0; padding: 12px 14px; border-right: 1px solid #c8d5e2; color: #23415f; font-size: 14px; overflow-wrap: anywhere; }
.law-column-head strong:last-child { border-right: 0; }
.law-comparison-board { border: 1px solid #c8d5e2; border-top: 0; border-radius: 0 0 10px 10px; overflow: hidden; background: #fff; }
.law-comparison-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid #c8d5e2; }
.law-comparison-row:last-child { border-bottom: 0; }
.law-cell { min-width: 0; padding: 12px; border-right: 1px solid #d8e1ea; background: #fff; }
.law-cell:last-child { border-right: 0; }
.law-cell-law { background: #fbfdff; }
.law-article-card { margin-bottom: 10px; border: 1px solid #dce4ec; border-radius: 8px; overflow: hidden; background: #fff; }
.law-article-card:last-child { margin-bottom: 0; }
.law-article-heading { display: grid; gap: 3px; padding: 9px 10px; border-bottom: 1px solid #e3e9ef; background: #f5f8fb; }
.law-article-heading span { color: var(--primary); font-size: 11px; font-weight: 700; }
.law-article-heading strong { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.law-article-content { max-height: 320px; padding: 10px; overflow-y: auto; color: #334155; font-size: 12px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.law-empty-cell, .law-empty-content { display: grid; place-items: center; min-height: 64px; margin: 0; padding: 12px; color: #8a98a9; font-size: 12px; text-align: center; }
.law-empty-content { min-height: 0; line-height: 1.5; }
.law-comparison-board mark { padding: 0 1px; background: #fde68a; color: inherit; }
.law-disclaimer { margin: 10px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.law-reference-preview { margin-top: 14px; }
.law-reference-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; align-items: start; transition: grid-template-columns .2s ease; }
.law-reference-layout.results-collapsed { grid-template-columns: 0 minmax(0, 1fr); gap: 0; }
.law-reference-results { position: sticky; top: 14px; min-width: 0; max-height: 74vh; padding-bottom: 14px; overflow: hidden; transition: opacity .15s ease; }
.law-reference-layout.results-collapsed .law-reference-results { padding: 0; border: 0; opacity: 0; pointer-events: none; }
.law-reference-result-list { display: grid; gap: 8px; max-height: calc(74vh - 58px); overflow-y: auto; }
.law-reference-result { display: grid; gap: 7px; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.law-reference-result strong { color: #173b60; font-size: 14px; line-height: 1.45; }
.law-reference-result span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.law-reference-result .law-result-keywords, .law-result-card .law-result-keywords { color: #075fc0; font-size: 11px; font-weight: 700; }
.law-reference-result em { color: #9a4d05; font-size: 11px; font-style: normal; font-weight: 700; }
.law-reference-result:hover, .law-reference-result.active { border-color: var(--primary); background: #f1f7fe; }
.law-reference-result.active { box-shadow: inset 3px 0 var(--primary); }
.law-reference-chain-main { min-width: 0; }
.law-reference-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; }
.law-reference-chain-board { margin-top: 12px; }
.law-reference-pane-summary { display: grid; gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.law-reference-pane-summary div { display: grid; gap: 4px; padding: 10px 12px; background: #fff; }
.law-reference-pane-summary span { color: var(--muted); font-size: 10px; font-weight: 700; }
.law-reference-pane-summary strong { color: #263b50; font-size: 12px; line-height: 1.5; }
.law-reference-pane-body { display: grid; gap: 0; padding: 4px 13px 20px; background: #fff; }
.law-reference-pane-body section { padding: 15px 0; border-bottom: 1px solid #e3e9ef; }
.law-reference-pane-body section:last-child { border-bottom: 0; }
.law-reference-pane-body h4 { margin: 0 0 8px; color: #173b60; font-size: 14px; }
.law-reference-pane-body p { margin: 0; color: #334155; font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.law-reference-document { min-width: 0; min-height: 640px; padding: 0; overflow: hidden; }
.law-reference-document-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: #f4f8fc; }
.law-reference-document-head h3 { margin: 5px 0 7px; color: #173b60; font-size: 22px; line-height: 1.4; }
.law-reference-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.law-reference-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; border-bottom: 1px solid var(--line); background: var(--line); }
.law-reference-summary div { display: grid; gap: 6px; padding: 14px 18px; background: #fff; }
