/* =========================================================
   Law Book Feature Styles
   Ported from Studable Angular law-book-modal component
   ========================================================= */

/* ---- Toolbar toggle button ---- */
.law-book-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.law-book-toggle:hover,
.law-book-toggle:focus-visible,
.law-book-toggle[aria-expanded="true"] {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  outline: none;
}
.law-book-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
}
.law-book-icon-text {
  font-size: 17px;
  font-weight: 800;
  font-family: "Georgia", "Times New Roman", serif;
  dominant-baseline: middle;
  fill: currentColor;
}

/* ---- Quick search (toolbar) ---- */
.header-law-search.law-book-search-container {
  flex: 0 1 100px;
  max-width: 100px;
}
.header-law-search .law-search-results,
.header-law-search .law-tag-suggestions {
  width: 28rem;
  max-width: 34rem;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.law-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  transition: all 0.2s ease;
  cursor: text;
}
.law-search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}
.law-search-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}
.law-search-results {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 400px;
  overflow-y: auto;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 13000;
  cursor: auto;
}
.law-search-results[hidden] { display: none; }
.law-tag-suggestions {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  z-index: 13001;
  display: none;
}
.law-tag-suggestions:not([hidden]) { display: block; }
.law-tag-suggestion-item {
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.law-tag-suggestion-item::before { content: "#"; color: #2563eb; font-weight: 700; }
.law-tag-suggestion-item:hover { background: #e5e7eb; }
.law-search-result-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.law-search-result-item:last-child { border-bottom: none; }
.law-search-result-item:hover { background-color: #f3f4f6; }
.law-search-result-law { font-size: 0.7rem; color: #9ca3af; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.law-search-result-header { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.law-search-result-number { font-weight: 600; color: #007bff; font-size: 0.875rem; flex-shrink: 0; }
.law-search-result-title { font-size: 0.75rem; color: #1f2937; font-weight: 500; line-height: 1.4; }
.law-search-result-preview { font-size: 0.75rem; color: #6c757d; line-height: 1.5; margin-top: 0.25rem; font-style: italic; }
.law-search-result-preview strong { font-weight: 700; color: #1f2937; background-color: #fef3c7; padding: 0.125rem 0.25rem; border-radius: 2px; }
.law-search-no-results, .law-search-loading { padding: 1rem; text-align: center; color: #9ca3af; font-size: 0.875rem; }
.law-search-loading { color: #007bff; font-style: italic; }
.law-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: #9ca3af; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.law-search-clear:hover { color: #374151; background: rgba(0,0,0,0.06); }
.law-book-search-container { position: relative; }

/* =========================================================
   Overlay & Modal
   ========================================================= */
.law-book-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  pointer-events: none;
  display: none;
}
.law-book-overlay[aria-hidden="false"] {
  display: block;
}
.law-book-overlay.is-embedded {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}
.law-book-overlay.is-embedded.mobile-sheet {
  background: transparent;
  backdrop-filter: none;
  animation: none;
}
.law-book-overlay.mobile-sheet {
  pointer-events: auto;
  background: rgba(7, 23, 33, 0.32);
  backdrop-filter: blur(1px);
  animation: law-mobile-backdrop-in 220ms ease;
}
.law-book-overlay.mobile-sheet.closing {
  animation: law-mobile-backdrop-out 180ms ease forwards;
}

.law-book-modal {
  position: absolute;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #d5e0e7;
  box-shadow: 0 14px 42px rgba(8, 20, 30, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  container-type: inline-size;
}
.law-book-overlay.is-embedded .law-book-modal {
  position: relative;
  left: auto !important;
  top: auto !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.law-book-overlay.mobile-sheet .law-book-modal {
  top: 0 !important;
  right: 0;
  left: auto !important;
  width: min(560px, 85vw) !important;
  height: 100dvh !important;
  max-height: 100dvh;
  border-radius: 16px 0 0 16px;
  border-right: none;
  box-shadow: 0 18px 46px rgba(8, 20, 30, 0.38);
  animation: law-mobile-sheet-in 210ms cubic-bezier(0.22, 1, 0.36, 1);
}
.law-book-overlay.mobile-sheet.closing .law-book-modal {
  animation: law-mobile-sheet-out 180ms cubic-bezier(0.4, 0, 1, 1) forwards;
}

/* ---- Header ---- */
.law-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 9px;
  border-bottom: 1px solid #e4edf3;
  background: linear-gradient(to bottom, #f8fbfd, #eef5f9);
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.law-book-modal.mobile-sheet .law-book-header { cursor: default; }
.law-book-overlay.is-embedded .law-book-header { cursor: default; }
.law-book-overlay.is-embedded .resize-handle { display: none; }
.law-book-header.with-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "title search actions" "stash stash stash";
  align-items: center;
  row-gap: 7px;
  padding-top: 10px;
}
.law-book-header.with-search .law-book-title { grid-area: title; }
.law-book-header.with-search .law-book-header-search { grid-area: search; justify-self: center; width: clamp(150px, 40cqw, 420px); min-width: 0; }
.law-book-header.with-search .law-book-header-right { grid-area: actions; justify-self: end; }
.law-book-header.with-search .law-book-header-stash { grid-area: stash; width: 100%; min-width: 0; flex: 0 1 auto; }

.law-book-header-stash {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 91, 114, 0.28) transparent;
}
.law-book-header-stash::-webkit-scrollbar { height: 5px; }
.law-book-header-stash::-webkit-scrollbar-track { background: transparent; }
.law-book-header-stash::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.26); border-radius: 999px; }

.header-tab-chip {
  flex: 0 0 auto;
  max-width: 180px;
  min-width: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c5d9e4;
  background: #f8fcff;
  color: #3b6271;
  border-radius: 999px;
  padding: 0;
  transition: max-width 140ms ease, border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}
.header-tab-chip-open {
  border: none;
  background: transparent;
  color: inherit;
  width: 100%;
  max-width: 100%;
  text-align: left;
  padding: 5px 9px;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: padding-right 140ms ease;
}
.header-tab-chip:hover,
.header-tab-chip:focus-within {
  max-width: 206px;
  border-color: #7fb3ca;
  color: #1e5971;
  background: #edf7fc;
}
.header-tab-chip:hover .header-tab-chip-open,
.header-tab-chip:focus-within .header-tab-chip-open {
  padding-right: 24px;
}
.header-tab-chip-close {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #4d6c79;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, background-color 120ms ease, color 120ms ease;
}
.header-tab-chip-close svg { width: 12px; height: 12px; }
.header-tab-chip-close:hover { background: rgba(19, 84, 106, 0.12); color: #0f5973; }
.header-tab-chip:hover .header-tab-chip-close,
.header-tab-chip:focus-within .header-tab-chip-close {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none), (pointer: coarse) {
  .header-tab-chip-open { padding-right: 24px; }
  .header-tab-chip-close { opacity: 1; pointer-events: auto; }
}

.law-book-header-right {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}
.law-book-header-search {
  position: relative;
  flex: 0 1 360px;
  min-width: 180px;
  max-width: 420px;
}
.law-book-header-search-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid #c5d7e2;
  border-radius: 9px;
  background: #ffffff;
}
.law-book-header-search-input-wrap:focus-within {
  border-color: #7fb3ca;
  box-shadow: 0 0 0 1px rgba(127, 179, 202, 0.25);
}
.law-book-header-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}
.law-book-header-search-suggestion {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: pre;
}
.law-book-header-search-suggestion .suggestion-prefix { color: transparent; }
.law-book-header-search-suggestion .suggestion-hint {
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 2px;
  font-size: 10px;
  font-weight: bold;
}
.law-book-header-search-suggestion .suggestion-badge { color: #94a3b8; font-size: 9px; margin-left: 4px; }

.law-book-header-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: #274653;
  font-size: 12px;
  line-height: 1.25;
  padding: 6px 9px;
  outline: none;
}
.law-book-header-search-input::placeholder { color: #7a8c96; }
.law-book-header-search-clear {
  border: none;
  background: transparent;
  width: 24px;
  height: 24px;
  color: #59727d;
  border-radius: 6px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.law-book-header-search-clear:hover { background: rgba(14, 78, 101, 0.1); color: #125872; }
.law-book-header-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: min(44vh, 340px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #cfe0e9;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(8, 20, 30, 0.16);
}
.law-book-header-search-result {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
}
.law-book-header-search-result:hover,
.law-book-header-search-result.is-selected { background: #edf6fb; }
.law-book-header-search-result-heading { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.law-book-header-search-result-number { font-weight: bold; color: #20596f; font-size: 12px; line-height: 1.2; white-space: nowrap; }
.law-book-header-search-result-title { color: #4d6775; font-size: 12px; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.law-book-header-search-result-preview { color: #2f4856; font-size: 12px; line-height: 1.3; }
.law-book-header-search-result-preview strong { color: #173f50; font-weight: 750; }
.law-book-header-search-empty { margin: 0; padding: 11px 10px; color: #6e8590; font-size: 12px; }

.law-book-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0e4e65;
  font-weight: bold;
  font-size: 18px;
}
.law-book-title svg { color: inherit; width: 20px; height: 20px; flex-shrink: 0; }
.law-book-title-text {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.law-book-title-toggle {
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  color: #38697b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.law-book-title-toggle:hover {
  background: rgba(14, 78, 101, 0.08);
  color: #155f7e;
}

.law-close-btn,
.law-expand-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #5b6f7a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.law-close-btn:hover,
.law-expand-btn:hover {
  background: rgba(14, 78, 101, 0.08);
  color: #0e4e65;
}
.law-close-btn svg,
.law-expand-btn svg { display: block; }

.law-panel-count-toggle {
  color: #315f70;
  background: rgba(210, 230, 239, 0.52);
  box-shadow: inset 0 0 0 1px rgba(64, 112, 132, 0.14);
}
.law-panel-count-toggle:hover {
  background: rgba(194, 220, 232, 0.72);
}
.law-panel-count-toggle.is-three-panel-mode {
  color: #174e64;
  background: rgba(181, 216, 231, 0.68);
}
.law-panel-count-icon[hidden] {
  display: none !important;
}
.law-panel-count-toggle[hidden] {
  display: none !important;
}

/* ---- Content grid ---- */
.law-book-content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 100px;
  position: relative;
  overflow: hidden;
}
.laws-sidebar-hover-zone {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  z-index: 4;
}
.law-book-content.hover-preview-open .laws-sidebar-hover-zone {
  width: 100px;
}

/* ---- Laws sidebar ---- */
.laws-sidebar {
  grid-column: 1;
  grid-row: 1;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  position: relative;
  z-index: 5;
  transition: width 180ms ease, min-width 180ms ease, max-width 180ms ease, transform 180ms ease, opacity 140ms ease, box-shadow 180ms ease;
  background: #f8fbfd;
  border-right: 1px solid #e4edf3;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.laws-sidebar.collapsed {
  width: 0;
  min-width: 0;
  max-width: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
}
.laws-sidebar.collapsed.preview-open {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  border-right: 1px solid #e4edf3;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  box-shadow: 10px 0 26px rgba(8, 20, 30, 0.12);
}
.laws-sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.laws-sidebar-actions {
  padding: 8px 8px 6px;
  border-bottom: 1px solid #e4edf3;
  flex-shrink: 0;
}
.law-more-btn {
  width: 100%;
  border: 1px solid #b8d7e7;
  border-radius: 12px;
  background: linear-gradient(180deg, #f5fbff 0%, #e8f4fb 100%);
  color: #0f5973;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 10px 9px;
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease, background 140ms ease;
}
.law-more-btn:hover,
.law-more-btn.is-open {
  border-color: #7fb3ca;
  background: linear-gradient(180deg, #edf8fe 0%, #dff0fa 100%);
  box-shadow: 0 8px 18px rgba(34, 96, 122, 0.12);
  transform: translateY(-1px);
}
.law-more-btn-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.law-more-btn-meta {
  font-size: 11px;
  line-height: 1.35;
  color: #476674;
}
.laws-sidebar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid #e4edf3;
  flex-shrink: 0;
}
.laws-sidebar-toggle {
  width: 32px;
  height: 30px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #2d6f89;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.laws-sidebar-toggle:hover { border-color: #8cbfd3; background: #eaf5fb; color: #155f7e; }
.laws-sidebar-toggle.floating {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  z-index: 2;
}
.laws-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 91, 114, 0.34) transparent;
}
.laws-list::-webkit-scrollbar { width: 6px; }
.laws-list::-webkit-scrollbar-track { background: transparent; }
.laws-list::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.28); border-radius: 999px; }
.laws-list:hover::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.42); }
.laws-list-section-title {
  padding: 10px 12px 5px;
  color: #6d8490;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.law-item-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
}
.law-item-wrap:hover .law-item-remove,
.law-item-wrap:focus-within .law-item-remove {
  opacity: 1;
  pointer-events: auto;
}
.law-item-wrap:hover .law-item.is-live,
.law-item-wrap:focus-within .law-item.is-live {
  padding-right: 36px;
}
.law-item {
  width: 100%;
  border: none;
  text-align: left;
  background: transparent;
  padding: 9px 12px;
  color: #2f4856;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  transition: padding-right 120ms ease, background 120ms ease, color 120ms ease;
}
.law-item:hover { background: #ecf5fa; color: #0f5973; }
.law-item.active { background: #d8ebf5; color: #0a4a61; font-weight: bold; }
.law-item-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.law-item-meta {
  display: block;
  margin-top: 2px;
  color: #64808d;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.law-item.active .law-item-meta {
  color: #2e6277;
}
.law-item.is-live {
  padding-top: 10px;
  padding-bottom: 10px;
}
.law-item-remove {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: #6f8995;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  box-sizing: border-box;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 120ms ease;
  z-index: 2;
}
.law-item-remove svg {
  display: block;
}
.law-item-remove:hover {
  background: rgba(14, 78, 101, 0.10);
  color: #0f5973;
  transform: translateY(-50%) scale(1.1);
}

/* ---- Main panel area ---- */
.law-main {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 91, 114, 0.24) transparent;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.law-main::-webkit-scrollbar { width: 6px; }
.law-main::-webkit-scrollbar-track { background: transparent; }
.law-main::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.28); border-radius: 999px; }
.law-main:hover::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.42); }

.law-live-search-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #d8e5ec;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(8, 20, 30, 0.04);
}
.law-live-search-shell[hidden] {
  display: none !important;
}
.law-live-search-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e5edf2;
  background: linear-gradient(180deg, #f9fcfe 0%, #eef6fa 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.law-live-search-copy h3 {
  margin: 0;
  color: #124f68;
  font-size: 16px;
  line-height: 1.2;
}
.law-live-search-copy p {
  margin: 5px 0 0;
  color: #56707d;
  font-size: 12px;
  line-height: 1.45;
}
.law-live-search-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #59727d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.law-live-search-close:hover {
  background: rgba(14, 78, 101, 0.08);
  color: #0e4e65;
}
.law-live-search-frame-wrap {
  flex: 1 1 auto;
  min-height: 0;
  background: #fff;
}
.law-live-search-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.law-panels {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  grid-auto-flow: row;
}
.law-panels.single-panel { gap: 0; }

/* ---- Two-page book view ---- */
.law-book-view-toggle.active {
  background: #d8ebf5;
  color: #0a4a61;
}
.law-book-view-toggle[hidden] { display: none !important; }

.law-book-pages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.law-book-pages[hidden] { display: none !important; }

.law-book-pages-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.law-book-pages-title {
  min-width: 0;
  color: #1a5870;
  font-family: source-sans-bold, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.law-book-pages-title[aria-disabled="false"] {
  cursor: pointer;
}
.law-book-pages-title[aria-disabled="false"]:focus-visible {
  outline: 2px solid rgba(31, 94, 118, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}
.law-book-pages-title span,
.law-book-pages-title small {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.law-book-pages-title > span {
  font-family: source-sans-bold, sans-serif;
  font-weight: 700;
}
.law-book-pages-title small {
  color: #6a7a72;
  font-family: source-sans-regular, sans-serif;
  font-size: 11px;
}

.law-book-pages-controls {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 7;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 8px rgba(43, 34, 20, 0.12);
  backdrop-filter: blur(4px);
}
.law-book-page-count {
  min-width: 48px;
  text-align: center;
  color: #557482;
  font-size: 12px;
  line-height: 1;
}
.law-book-page-nav {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(122, 152, 167, 0.42);
  border-radius: 999px;
  background: #ffffff;
  color: #2f6579;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.law-book-page-nav:hover:not(:disabled) {
  border-color: rgba(94, 139, 160, 0.65);
  background: #f5fbff;
  color: #134f68;
}
.law-book-page-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.law-book-pages-toc-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  box-sizing: border-box;
  padding: 14px 16px 52px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(248, 252, 254, 0.98), rgba(244, 249, 252, 0.99));
  backdrop-filter: blur(3px);
}
.law-book-pages-toc-overlay[hidden] {
  display: none !important;
}
.law-book-pages-toc-overlay .law-panel-toc-content {
  height: 100%;
}

.law-book-spread {
  --book-page-gap: 0px;
  --book-page-padding-x: 22px;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  border: 1px solid #d6e2e9;
  border-radius: 8px;
  overflow: hidden;
  perspective: 1600px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(32, 58, 70, 0.06) 49.2%, rgba(32, 58, 70, 0.24) 50%, rgba(32, 58, 70, 0.06) 50.8%, transparent 100%),
    #f6f1e7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 0 rgba(8, 20, 30, 0.04);
}
.law-book-spread::before,
.law-book-flip-layer::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  z-index: 3;
  background: linear-gradient(180deg, rgba(72, 61, 43, 0.04), rgba(72, 61, 43, 0.26), rgba(72, 61, 43, 0.04));
  pointer-events: none;
}

.law-book-flip-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  perspective: 2200px;
  perspective-origin: 50% 50%;
}
.law-book-flip-static {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.74)), #fbf8ef;
}
.law-book-flip-static.left {
  left: 0;
  box-shadow: inset -12px 0 18px rgba(51, 43, 30, 0.045);
}
.law-book-flip-static.right {
  right: 0;
  box-shadow: inset 12px 0 18px rgba(51, 43, 30, 0.045);
}
.law-book-flip-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 3;
  opacity: 0;
  will-change: opacity;
}
.law-book-flip-shadow.left {
  left: 0;
  background: linear-gradient(270deg, rgba(43, 34, 20, 0.42), rgba(43, 34, 20, 0) 70%);
}
.law-book-flip-shadow.right {
  right: 0;
  background: linear-gradient(90deg, rgba(43, 34, 20, 0.42), rgba(43, 34, 20, 0) 70%);
}
.law-book-flip-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 4;
  transform-style: preserve-3d;
  will-change: transform;
}
.law-book-flip-layer.next .law-book-flip-leaf {
  left: 50%;
  transform-origin: left center;
}
.law-book-flip-layer.previous .law-book-flip-leaf {
  left: 0;
  transform-origin: right center;
}
.law-book-spread.single-page::before,
.law-book-flip-layer.single-page::before {
  display: none;
}
.law-book-spread.single-page .law-book-page.left {
  width: 100%;
  border-right: 0;
}
.law-book-spread.single-page .law-book-page.right {
  display: none;
}
.law-book-spread.single-page .law-book-flow {
  column-count: 1;
}
.law-book-flip-layer.single-page .law-book-flip-leaf,
.law-book-flip-layer.single-page .law-book-flip-shadow {
  width: 100%;
}
.law-book-flip-layer.single-page.next .law-book-flip-leaf {
  left: 0;
  transform-origin: left center;
}
.law-book-flip-layer.single-page.previous .law-book-flip-leaf {
  left: 0;
  transform-origin: right center;
}
.law-book-fast-flip-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 6;
  pointer-events: none;
  backface-visibility: visible;
  will-change: transform, opacity;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 242, 231, 0.94)), #fbf8ef;
  box-shadow: 0 0 12px rgba(51, 43, 30, 0.16);
}
.law-book-fast-flip-leaf.next {
  left: 50%;
  transform-origin: left center;
}
.law-book-fast-flip-leaf.previous {
  left: 0;
  transform-origin: right center;
}
.law-book-spread.single-page .law-book-fast-flip-leaf {
  left: 0;
  width: 100%;
}
.law-book-flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.78)), #fbf8ef;
}
.law-book-flip-face.back { transform: rotateY(180deg); }
.law-book-flip-layer.next .law-book-flip-face.front,
.law-book-flip-layer.previous .law-book-flip-face.back {
  border-radius: 0 3px 3px 0;
  box-shadow: inset 8px 0 12px -6px rgba(51, 43, 30, 0.18), inset -1px 0 0 rgba(51, 43, 30, 0.12);
}
.law-book-flip-layer.next .law-book-flip-face.back,
.law-book-flip-layer.previous .law-book-flip-face.front {
  border-radius: 3px 0 0 3px;
  box-shadow: inset -8px 0 12px -6px rgba(51, 43, 30, 0.18), inset 1px 0 0 rgba(51, 43, 30, 0.12);
}
.law-book-flip-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0;
  background: linear-gradient(90deg, rgba(38, 30, 18, 0.5), rgba(38, 30, 18, 0.16) 55%, rgba(38, 30, 18, 0.34));
  will-change: opacity;
}
.law-book-flip-page-snapshot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  contain: paint;
}
.law-book-flip-page-snapshot .law-book-flow {
  position: absolute;
  top: 0;
  left: 0;
}

.law-book-page {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.74)), #fbf8ef;
}
.law-book-page.left {
  left: 0;
  border-right: 1px solid rgba(96, 85, 65, 0.18);
  box-shadow: inset -12px 0 18px rgba(51, 43, 30, 0.045);
}
.law-book-page.right {
  right: 0;
  box-shadow: inset 12px 0 18px rgba(51, 43, 30, 0.045);
}
.law-book-flow-viewport {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  scroll-behavior: smooth;
}
.law-book-flow {
  --book-page-width: 360px;
  height: 100%;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  column-count: 2;
  column-width: auto;
  column-gap: var(--book-page-gap);
  column-fill: auto;
  padding: 18px 0 52px;
  overflow-wrap: break-word;
  word-break: normal;
}
.law-book-norm {
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 var(--book-page-padding-x) 16px;
  margin: 0 0 16px;
  border-bottom: 1px solid rgba(104, 91, 68, 0.16);
  color: #263f4b;
  cursor: pointer;
  display: block;
  break-inside: auto;
  orphans: 3;
  widows: 3;
}
.law-book-norm:last-child {
  margin-bottom: 0;
  border-bottom: none;
}
.law-book-norm.active h3 {
  color: #0a4a61;
  background: rgba(186, 218, 232, 0.42);
}
.law-book-norm.structure-entry {
  padding-top: 2px;
  break-after: avoid;
}
.law-book-norm.structure-entry h3 {
  color: #6b4a1d;
  background: rgba(226, 203, 154, 0.22);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}
.law-book-norm h3 {
  margin: 0 0 9px;
  padding: 4px 6px;
  border-radius: 5px;
  color: #1b5066;
  font-family: source-sans-bold, sans-serif;
  font-size: 15px;
  line-height: 1.25;
  break-after: avoid;
  font-weight: bold;
}
.law-book-structure-label {
  margin: 0 0 7px;
  padding: 4px 6px;
  border-top: 1px solid rgba(125, 103, 62, 0.18);
  border-bottom: 1px solid rgba(125, 103, 62, 0.18);
  color: #725423;
  font-family: source-sans-bold, sans-serif;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}
.law-book-norm-content {
  font-size: 13px;
  line-height: 1.45;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.law-book-norm-content * {
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.law-book-norm-content table {
  width: 100% !important;
  table-layout: fixed;
}
.law-book-norm-content dl {
  display: grid;
  grid-template-columns: minmax(18px, auto) minmax(0, 1fr);
  column-gap: 6px;
  max-width: 100%;
  margin-left: 0;
}
.law-book-norm-content dt,
.law-book-norm-content dd { min-width: 0; }
.law-book-norm-content td,
.law-book-norm-content th {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.law-book-norm-content pre,
.law-book-norm-content code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.law-book-norm-content img,
.law-book-norm-content svg,
.law-book-norm-content canvas,
.law-book-norm-content iframe {
  max-width: 100%;
  height: auto;
}

/* ---- Individual panels ---- */
.law-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #d8e5ec;
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(8, 20, 30, 0.04);
  cursor: pointer;
}
.law-panel.active {
  border-color: #38697b;
  box-shadow: 0 0 0 2px rgba(127, 179, 202, 0.28);
}
.law-panel.span-two-rows { grid-row: span 2; }
.law-panel.single-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.law-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5edf2;
  background: #f4f9fc;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}
.law-panel.single-panel .law-panel-header {
  padding: 4px 2px 8px;
  border-bottom: none;
  background: transparent;
}
.law-panel-title {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a5870;
  font-size: 15px;
  cursor: pointer;
}
.law-panel-title-main,
.law-panel-title-path {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.law-panel-title-prefix { font-weight: bold; }
.law-panel-title-path {
  margin-top: 2px;
  color: #6d838d;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 400;
}
.law-panel-pin,
.law-panel-close {
  border: none;
  background: transparent;
  color: #59727d;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.law-panel-pin {
  display: none;
}
.law-panel:not(.single-panel) .law-panel-pin:not([hidden]) {
  display: inline-flex;
}
.law-panel-pin.active {
  color: #b45309;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(249, 115, 22, 0.16));
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.24);
}
.law-panel-pin.active svg {
  fill: rgba(245, 158, 11, 0.28);
}
.law-panel-pin:hover,
.law-panel-close:hover { background: rgba(14, 78, 101, 0.14); }
.law-panel-pin.active:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(249, 115, 22, 0.22));
}

.law-panel-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 91, 114, 0.3) transparent;
  padding: 10px 12px 12px;
}
.law-panel.single-panel .law-panel-body { padding: 2px 2px 4px; }
.law-panel-body.toc-open { overflow: hidden; }
.law-panel-body::-webkit-scrollbar { width: 6px; }
.law-panel-body::-webkit-scrollbar-track { background: transparent; }
.law-panel-body::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.28); border-radius: 999px; }
.law-panel-body:hover::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.42); }

.law-panel-toc-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, rgba(248, 252, 254, 0.96) 0%, rgba(244, 249, 252, 0.98) 100%);
  backdrop-filter: blur(3px);
}
.law-panel.single-panel .law-panel-toc-overlay {
  padding: 2px 2px 4px;
  border-radius: 10px;
  border: 1px solid #d8e5ec;
  background: linear-gradient(180deg, rgba(248, 252, 254, 0.9) 0%, rgba(244, 249, 252, 0.94) 100%);
}
.law-panel-toc-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.law-panel-toc-content {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 91, 114, 0.26) transparent;
  padding-right: 2px;
}
.law-panel-toc-content::-webkit-scrollbar { width: 6px; }
.law-panel-toc-content::-webkit-scrollbar-track { background: transparent; }
.law-panel-toc-content::-webkit-scrollbar-thumb { background: rgba(22, 91, 114, 0.28); border-radius: 999px; }

.law-panel-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(0.6px);
}
.law-panel.single-panel .law-panel-loading-overlay { border-radius: 0; }

.law-panel-nav {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
  z-index: 3;
}
.law-panel:hover .law-panel-nav,
.law-panel:focus-within .law-panel-nav {
  opacity: 1;
  pointer-events: auto;
}
.law-panel.single-panel .law-panel-nav {
  opacity: 1;
  pointer-events: auto;
}
.law-panel-nav-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(122, 152, 167, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #2f6579;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.law-panel-nav-btn:hover:not(:disabled) {
  background: #ffffff;
  border-color: rgba(94, 139, 160, 0.65);
  color: #134f68;
}
.law-panel-nav-btn:disabled { opacity: 0.45; cursor: default; }

/* ---- Paragraphs sidebar ---- */
.paragraphs-sidebar {
  grid-column: 3;
  grid-row: 1;
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  border-left: 1px solid #e4edf3;
  background: linear-gradient(180deg, #f9fcfe 0%, #f2f8fb 100%);
  min-height: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar-search { 
  padding: 6px 0; 
  border-bottom: 1px solid #e4edf3; 
  flex-shrink: 0; 
  width: 40px;
  align-self: center;
}

.paragraph-search-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c9dae4;
  border-radius: 7px;
  background: #ffffff;
  color: #2f4856;
  font-size: 10px;
  line-height: 1.2;
  padding: 5px 0;
  text-align: center;
  outline: none;
}
.paragraph-search-input::placeholder { color: #7a8d97; }
.paragraph-search-input:focus { border-color: #7fb3ca; box-shadow: 0 0 0 1px rgba(127, 179, 202, 0.25); }

.paragraph-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 0 6px;
}
.paragraph-list::-webkit-scrollbar { width: 0; display: none; }

.paragraph-item {
  width: 100%;
  border: none;
  text-align: center;
  background: transparent;
  padding: 7px 0;
  color: #2f4856;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  border-radius: 9px;
}
.paragraph-item:hover { background: #ecf5fa; color: #0f5973; }
.paragraph-item.active { background: #d8ebf5; color: #0a4a61; font-weight: bold; }
.paragraph-item-number {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-weight: bold;
  color: inherit;
  line-height: 1.05;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  text-align: center;
  font-size: 11px;
}
.paragraph-item.table-of-contents .paragraph-item-number { color: #1f5e76; }

/* ---- Error bar ---- */
.error-bar {
  border-top: 1px solid #f2c9c9;
  background: #fff5f5;
  color: #963d3d;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.error-bar button {
  border: 1px solid #d9a6a6;
  background: #fff;
  color: #8d3e3e;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}
.error-bar.is-transient {
  justify-content: center;
}

/* ---- Resize handles ---- */
.resize-handle {
  position: absolute;
  z-index: 3;
  pointer-events: auto;
}
.resize-handle.right, .resize-handle.left { top: 10px; bottom: 10px; width: 10px; }
.resize-handle.right { right: -5px; cursor: ew-resize; }
.resize-handle.left { left: -5px; cursor: ew-resize; }
.resize-handle.top, .resize-handle.bottom { left: 10px; right: 10px; height: 10px; }
.resize-handle.top { top: -5px; cursor: ns-resize; }
.resize-handle.bottom { bottom: -5px; cursor: ns-resize; }
.resize-handle.top-left, .resize-handle.top-right,
.resize-handle.bottom-left, .resize-handle.bottom-right { width: 24px; height: 24px; z-index: 30; }
.resize-handle.top-left { top: -6px; left: -6px; cursor: nwse-resize; }
.resize-handle.top-right { top: -6px; right: -6px; cursor: nesw-resize; }
.resize-handle.bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
.resize-handle.bottom-right { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* ---- Loading & empty states ---- */
.loading-state {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px;
  color: #49616d;
  font-size: 13px;
}
.loading-state.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d2e2eb;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(8, 20, 30, 0.1);
  padding: 10px 12px;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(24, 91, 115, 0.2);
  border-top-color: #185b73;
  animation: law-spinner 0.7s linear infinite;
  flex-shrink: 0;
}
.empty-state { margin: 0; padding: 12px; color: #6f8792; font-size: 13px; }
.empty-state.large { padding: 20px 0; text-align: center; }

.law-empty-picker {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 12px 18px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.law-empty-picker.overlay-mode {
  position: absolute;
  inset: 8px;
  z-index: 6;
  background: linear-gradient(180deg, rgba(248, 252, 254, 0.94) 0%, rgba(244, 249, 252, 0.97) 100%);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(216, 229, 236, 0.92);
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(8, 20, 30, 0.1);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.law-empty-picker-shell {
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.law-empty-picker-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  gap: 12px;
}

.law-empty-picker-copy p {
  margin: 0;
  color: #46626f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.law-empty-picker-view-toggle {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #d9e6ed;
  border-radius: 9px;
  background: rgba(240, 247, 250, 0.9);
}

.law-empty-picker-view-toggle button {
  width: 27px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #718892;
  background: transparent;
  cursor: pointer;
  transition: color 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.law-empty-picker-view-toggle button:hover,
.law-empty-picker-view-toggle button:focus-visible {
  color: #185b73;
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.law-empty-picker-view-toggle button.active {
  color: #185b73;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 73, 91, 0.14);
}

.law-empty-picker-view-toggle svg {
  width: 17px;
  height: 17px;
}

.law-empty-picker-alphabet {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 4px;
}

.law-empty-picker-more {
  padding-top: 2px;
}

.law-empty-picker-more-btn {
  align-items: center;
  text-align: center;
}

.law-empty-picker-letter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.law-empty-picker-letter-group h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #54717e;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.055em;
}

.law-empty-picker-letter-group h3::after {
  content: '';
  height: 1px;
  flex: 1 1 auto;
  background: linear-gradient(90deg, rgba(194, 214, 223, 0.82), rgba(194, 214, 223, 0));
}

.law-empty-picker-list {
  overflow: hidden;
  border: 1px solid #dce8ee;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(28, 69, 84, 0.045);
}

.law-empty-list-row {
  width: 100%;
  min-height: 47px;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid #e5eef2;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto 18px;
  align-items: center;
  column-gap: 9px;
  color: #284754;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: color 130ms ease, background 130ms ease;
}

.law-empty-list-row:last-child {
  border-bottom: 0;
}

.law-empty-list-row:hover,
.law-empty-list-row:focus-visible {
  color: #0f5973;
  background: #f2f8fb;
  outline: none;
}

.law-empty-list-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #286b82;
  background: linear-gradient(180deg, #edf7fb 0%, #e0f0f6 100%);
}

.law-empty-list-icon svg {
  width: 15px;
  height: 15px;
}

.law-empty-list-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.law-empty-list-title,
.law-empty-list-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-empty-list-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.22;
}

.law-empty-list-subtitle {
  color: #6b818b;
  font-size: 10.5px;
  line-height: 1.2;
}

.law-empty-list-meta {
  max-width: 120px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid #dce8ed;
  border-radius: 999px;
  color: #607a86;
  background: #f7fafb;
  font-size: 9.5px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.law-empty-list-chevron {
  color: #87a0ab;
}

.law-empty-list-chevron svg {
  display: block;
  width: 17px;
  height: 17px;
}

.law-empty-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  justify-content: center;
  align-content: flex-start;
}

.law-empty-card {
  border: 1px solid #d9e6ed;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
  width: 77px;
  flex: 0 0 77px;
  min-height: 88px;
  padding: 10px 8px 9px;
  color: #284754;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 160ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.law-empty-card:hover,
.law-empty-card:focus-visible {
  border-color: #9cc3d3;
  background: linear-gradient(180deg, #ffffff 0%, #eef7fb 100%);
  box-shadow: 0 12px 24px rgba(19, 73, 93, 0.12);
  color: #0f5973;
  transform: translateY(-1px);
  outline: none;
}

.law-empty-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(180deg, #ebf6fb 0%, #dceef7 100%);
  color: #1b627c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 5px;
}

.law-empty-card-title {
  display: block;
  width: 100%;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.law-empty-card-meta {
  display: block;
  width: 100%;
  color: #5c7a88;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Paragraph content ---- */
.paragraph-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid #e5edf2;
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.paragraph-number { margin: 0; font-weight: bold; color: #1f5e76; font-size: 16px; }
.paragraph-title { margin: 0; color: #4b6472; font-size: 14px; }

.paragraph-content,
.law-panel-toc-content {
  color: #1b2e39;
  line-height: 1.5;
  font-size: 17px;
}
.paragraph-content p { margin: 0 0 10px 0; }
.paragraph-content b,
.paragraph-content strong {
  font-weight: bold;
  color: #2a5f73;
}
.paragraph-content sup.law-sentence-number {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
  color: #4a7d93;
  font-weight: 600;
  margin-right: 1px;
  user-select: none;
}
.paragraph-content .jnhtml .jurAbsatz,
.paragraph-content .jnhtml .jurAbschnitt {
  margin: 0 0 10px 0;
  line-height: inherit;
}
.paragraph-content .law-citation-target-highlight {
  background: rgba(49, 130, 206, 0.12);
  box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.12);
  border-radius: 4px;
  transition: background 220ms ease, box-shadow 220ms ease;
}
.paragraph-content .law-panel-same-law-citation {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: rgba(21, 77, 102, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.paragraph-content .law-panel-same-law-citation:hover,
.paragraph-content .law-panel-same-law-citation:focus-visible {
  color: #0f5973;
  text-decoration-color: rgba(15, 89, 115, 0.82);
  outline: none;
}
.paragraph-content .jnhtml .jurAbsatz > dl,
.paragraph-content .jnhtml .jurAbschnitt > dl {
  margin: 12px 0 12px 1.2rem;
}
.paragraph-content .jnhtml .jurAbsatz:last-child,
.paragraph-content .jnhtml .jurAbschnitt:last-child {
  margin-bottom: 0;
}
.paragraph-content .jnhtml h1,
.paragraph-content .jnhtml h2,
.paragraph-content .jnhtml h3,
.paragraph-content .jnhtml h4,
.paragraph-content .jnhtml h5,
.paragraph-content .jnhtml h6 {
  margin: 0 0 10px 0;
  color: #1f5e76;
  font-weight: 700;
  line-height: 1.3;
}
.paragraph-content .jnhtml ul,
.paragraph-content .jnhtml ol {
  margin: 0 0 10px 1.2rem;
  padding: 0;
}
.paragraph-content .jnhtml li {
  margin: 0 0 4px 0;
}
.paragraph-content .jnhtml table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px 0;
}
.paragraph-content .jnhtml th,
.paragraph-content .jnhtml td {
  padding: 6px 8px;
  vertical-align: top;
  border: 1px solid #d9e5eb;
  text-align: left;
}
.paragraph-content .jnhtml th {
  color: #2a5f73;
  background: #f3f8fb;
  font-weight: 700;
}

/* Dejure Live-Laws Styling (.gesetzestext) */
.paragraph-content .gesetzestext table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 10px 0;
  border: none;
}
.paragraph-content .gesetzestext td {
  vertical-align: top;
  padding: 0 0 8px 0;
  border: none;
  line-height: 1.45;
}
.paragraph-content .gesetzestext td:first-child:empty {
  width: 24px;
  padding: 0;
}
.paragraph-content .gesetzestext td:nth-child(2) {
  padding-right: 8px;
  white-space: nowrap;
  color: #2a5f73;
  font-weight: 500;
}
.paragraph-content .gesetzestext p {
  margin: 0 0 10px 0;
  line-height: 1.45;
}
.paragraph-content .gesetzestext a.link_extern {
  color: #3b7f9a;
  text-decoration: none;
  transition: color 150ms ease;
}
.paragraph-content .gesetzestext a.link_extern:hover {
  color: #24586d;
  text-decoration: underline;
}
.paragraph-content dl {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 8px;
  align-items: start;
  margin: 0 0 10px 0;
}
.paragraph-content dt, .paragraph-content dd { margin: 0 !important; padding: 0; line-height: 1.45; }
.paragraph-content dt > p, .paragraph-content dd > p { margin-top: 0 !important; }
.paragraph-content dt { grid-column: 1; font-weight: bold; color: #2a5f73; overflow-wrap: anywhere; word-break: break-word; }
.paragraph-content dd { grid-column: 2; min-width: 0; }
.law-panel.is-live-administrative .paragraph-content > br,
.law-panel.is-live-administrative .paragraph-content dl > br,
.law-panel.is-live-administrative .paragraph-content dt > br,
.law-panel.is-live-administrative .paragraph-content dd > br {
  display: none;
}
.law-panel.is-live-administrative .paragraph-content dl {
  grid-template-columns: max-content minmax(0, 1fr);
}
.law-panel.is-live-administrative .paragraph-content dt {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.paragraph-content mark.law-search-hit {
  background: rgba(255, 220, 72, 0.78);
  box-shadow: 0 0 0 3px rgba(255, 220, 72, 0.2);
  color: inherit;
  border-radius: 3px;
  padding: 0;
  line-height: inherit;
  transition: background-color 600ms ease, box-shadow 600ms ease;
}
.paragraph-content mark.law-search-hit.is-fading {
  background: transparent;
  box-shadow: 0 0 0 3px transparent;
}

/* ---- TOC styles ---- */
.law-toc, .law-toc-tree, .law-toc-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.law-toc-node { display: flex; flex-direction: column; gap: 2px; }
.law-toc-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 4px;
  align-items: start;
}
.law-toc-row > * { min-width: 0; }
.law-toc-toggle, .law-toc-toggle-spacer {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-top: 2px;
}
.law-toc-toggle {
  display: block;
  position: relative;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.82;
  transition: background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease, transform 120ms ease;
}
.law-toc-toggle:hover { background: rgba(22, 91, 114, 0.07); box-shadow: inset 0 0 0 1px rgba(47, 101, 121, 0.22); opacity: 1; }
.law-toc-toggle:active { transform: scale(0.96); }
.law-toc-toggle:focus-visible { outline: none; box-shadow: inset 0 0 0 1px rgba(47, 101, 121, 0.22), 0 0 0 3px rgba(22, 91, 114, 0.12); opacity: 1; }
.law-toc-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid rgba(47, 101, 121, 0.9);
  border-bottom: 1.5px solid rgba(47, 101, 121, 0.9);
  transform: translate(-62%, -50%) rotate(-45deg);
  transition: transform 120ms ease;
}
.law-toc-node.expanded > .law-toc-row .law-toc-toggle::before { transform: translate(-50%, -62%) rotate(45deg); }
.law-toc-toggle-spacer { display: block; flex-shrink: 0; }
.law-toc-children { display: none; margin-left: 9px; padding-left: 7px; border-left: 1px solid rgba(47, 101, 121, 0.16); }
.law-toc-node.expanded > .law-toc-children { display: flex; }
.law-toc-entry {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 8px;
  text-decoration: none;
  line-height: 1.15;
  transition: background-color 120ms ease;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  color: inherit;
}
.law-toc-entry:hover { background: rgba(22, 91, 114, 0.08); }
.law-toc-entry.is-active {
  background: rgba(22, 91, 114, 0.13);
  color: #0f5973;
}
.law-toc-entry:active { background: rgba(22, 91, 114, 0.14); }
.law-toc-entry.is-disabled { cursor: default; }
.law-toc-entry.is-disabled:hover, .law-toc-entry.is-disabled:active { background: transparent; }
.law-toc-entry-ident, .law-toc-entry-title,
.law-toc-ident, .law-toc-title {
  display: inline;
  margin: 0;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}
.law-toc-entry-ident, .law-toc-ident { color: #2f6579; font-weight: bold; font-size: 12px; margin-right: 6px; }
.law-toc-entry-title, .law-toc-title { color: #1b2e39; font-size: 13px; }

/* ---- Panel drag-and-drop ---- */
.law-panel.drag-source {
  opacity: 0.5;
  border-style: dashed;
}
.law-panel.drag-over {
  border-color: #7fb3ca;
  box-shadow: 0 0 0 3px rgba(127, 179, 202, 0.45);
}
.law-panel-drag-ghost {
  position: fixed;
  z-index: 20000;
  background: #f4f9fc;
  border: 1px solid #7fb3ca;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(8, 20, 30, 0.22);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: bold;
  color: #1a5870;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.92;
  transform: translate(-50%, -50%);
}

/* ---- Animations ---- */
@keyframes law-spinner { to { transform: rotate(360deg); } }
@keyframes law-mobile-sheet-in {
  from { transform: translateX(34px); opacity: 0.01; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes law-mobile-sheet-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(34px); opacity: 0.01; }
}
@keyframes law-mobile-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes law-mobile-backdrop-out { from { opacity: 1; } to { opacity: 0; } }

/* ---- Mobile ---- */
@media (max-width: 48rem) {
  .law-book-modal { border-radius: 12px; }
  .law-book-overlay.mobile-sheet .law-book-modal { border-radius: 12px 0 0 12px; }
  .law-book-header { padding: 8px 10px; flex-wrap: wrap; row-gap: 7px; align-items: flex-start; }
  .law-book-header.with-search {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "title search actions" "stash stash stash";
    align-items: center;
  }
  .law-book-header.with-search .law-book-header-search { max-width: none; width: 100%; min-width: 0; justify-self: stretch; }
  .law-book-content { grid-template-columns: 40px minmax(0, 1fr) 70px; }
  .law-main { padding: 10px 10px 12px; }
  .law-live-search-header { padding: 10px 12px; }
  .law-live-search-copy p { font-size: 11px; }
  .law-panel-header { padding: 7px 8px; }
  .law-panel-body { padding: 8px 9px 10px; }
}

/* Schmales Law-Book-Panel: Suchfeld in eigene Zeile umbrechen, statt Titel
   und Aktionen zu überlagern. Greift anhand der Modal-Breite, nicht anhand
   der gesamten Viewport-Breite. */
@container (max-width: 23rem) {
  .law-book-header.with-search {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title actions"
      "search search"
      "stash stash";
  }

  .law-book-header.with-search .law-book-header-search {
    justify-self: center;
    width: min(360px, 100%);
    min-width: 0;
  }
}

@container (max-width: 36rem) {
  .law-empty-picker {
    padding: 10px 8px 12px;
  }

  .law-empty-picker-shell {
    gap: 8px;
  }

  .law-empty-picker-copy {
    min-height: 27px;
  }

  .law-empty-picker-alphabet {
    gap: 12px;
  }

  .law-empty-list-row {
    min-height: 42px;
    padding: 6px 7px;
    grid-template-columns: 25px minmax(0, 1fr) 15px;
    column-gap: 7px;
  }

  .law-empty-list-icon {
    width: 24px;
    height: 24px;
  }

  .law-empty-list-icon svg {
    width: 14px;
    height: 14px;
  }

  .law-empty-list-title {
    font-size: 11.5px;
  }

  .law-empty-list-subtitle,
  .law-empty-list-meta {
    display: none;
  }

  .law-empty-list-chevron,
  .law-empty-list-chevron svg {
    width: 15px;
    height: 15px;
  }

  .law-empty-picker-grid {
    gap: 10px 8px;
  }

  .law-empty-card {
    width: 54px;
    flex-basis: 54px;
    min-height: 62px;
    padding: 6px 4px 5px;
    border-radius: 9px;
    gap: 3px;
  }

  .law-empty-card-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    margin-bottom: 1px;
  }

  .law-empty-card-icon svg {
    width: 14px;
    height: 14px;
  }

  .law-empty-card-title {
    font-size: 10.5px;
    line-height: 1.05;
  }

  .law-empty-card-meta {
    font-size: 8.5px;
    line-height: 1.05;
  }
}

/* ── Touch-Norm-Eingabe (Number-Pad) ───────────────────────────── */
.paragraph-pad-backdrop {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 28, 38, 0.34);
  backdrop-filter: blur(2px);
  animation: paragraph-pad-fade-in 140ms ease;
}
.paragraph-pad {
  width: min(264px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #ffffff;
  border: 1px solid #dbe6ed;
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(8, 20, 30, 0.28);
  animation: paragraph-pad-pop-in 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.paragraph-pad-display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 6px 40px;
  border-radius: 12px;
  background: #f4f8fb;
  border: 1px solid #e1ebf1;
}
.paragraph-pad-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #2f4856;
}
.paragraph-pad-placeholder {
  font-size: 14px;
  color: #9aabb5;
}
.paragraph-pad-backspace {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #6b8593;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.paragraph-pad-backspace svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}
.paragraph-pad-backspace:hover {
  background: rgba(127, 179, 202, 0.16);
  color: #2f6579;
}
.paragraph-pad-backspace:active {
  background: rgba(127, 179, 202, 0.28);
}
.paragraph-pad-backspace:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}
.paragraph-pad-suffixes {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.paragraph-pad-suffix {
  flex: 1;
  height: 28px;
  border: 1px solid #e1ebf1;
  border-radius: 9px;
  background: #fbfdfe;
  color: #5d7682;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 110ms ease, border-color 110ms ease, color 110ms ease;
}
.paragraph-pad-suffix:hover {
  background: #eef5f9;
  border-color: #cfe0e9;
  color: #2f6579;
}
.paragraph-pad-suffix:active {
  background: #e2eef4;
}
.paragraph-pad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.paragraph-pad-key {
  height: 48px;
  border: 1px solid #e3edf2;
  border-radius: 13px;
  background: #ffffff;
  color: #2f4856;
  font-size: 21px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 110ms ease, border-color 110ms ease, transform 60ms ease;
}
.paragraph-pad-key:hover {
  background: #f4f8fb;
  border-color: #cfe0e9;
}
.paragraph-pad-key:active {
  background: #e7f0f5;
  transform: scale(0.96);
}
.paragraph-pad-key-zero {
  grid-column: 2;
}
.paragraph-pad-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.paragraph-pad-action {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}
.paragraph-pad-cancel {
  border: 1px solid #dde7ed;
  background: #ffffff;
  color: #66808d;
}
.paragraph-pad-cancel:hover {
  background: #f4f8fb;
  color: #2f4856;
}
.paragraph-pad-cancel:active {
  background: #eaf1f5;
}
.paragraph-pad-confirm {
  border: 1px solid transparent;
  background: #2f6579;
  color: #ffffff;
}
.paragraph-pad-confirm:hover {
  background: #27576a;
}
.paragraph-pad-confirm:active {
  background: #214b5b;
}
.paragraph-pad-confirm:disabled {
  opacity: 0.45;
  cursor: default;
  background: #2f6579;
}
@keyframes paragraph-pad-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes paragraph-pad-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
