:root {
  --navy: #123468;
  --navy-2: #0c2346;
  --blue: #4379c9;
  --blue-light: #e0f2fe;
  --red: #d71920;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --page: #f3f7fa;
  --border: #dbe5ef;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --success: #047857;
  --warning-bg: #fff7ed;
  --warning-border: #fed7aa;
  --warning-text: #7c2d12;
  --primary: #116e69;
  --primary-hover: #0f5f5b;
  --rules-panel-width: 480px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: default; opacity: 0.75; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 999;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  transition: top 140ms ease;
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  height: 108px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #d9e2eb;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.site-header-inner {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 430px) 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 10px 28px;
}
.brand-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
  background: #fff;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 16px;
  padding: 5px 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.brand-logo {
  width: min(390px, 42vw);
  height: 82px;
  object-fit: contain;
  object-position: left center;
}
.header-center-note {
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  text-align: center;
}
.header-center-note:empty::before { content: ""; }
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.ghost-button,
.primary-link-button,
.notepad-launch-button,
.chrome-notepad-actions button,
.chrome-notepad-titlebar button,
.chrome-notepad-toolbar button {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-weight: 800;
  padding: 8px 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}
.ghost-button:hover,
.chrome-notepad-actions button:hover,
.chrome-notepad-titlebar button:hover,
.chrome-notepad-toolbar button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  border-color: #94a3b8;
}
.primary-link-button,
.notepad-launch-button {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
  box-shadow: 0 12px 24px rgba(18, 52, 104, 0.18);
}
.primary-link-button:hover,
.notepad-launch-button:hover {
  transform: translateY(-1px);
  background: var(--navy-2);
  box-shadow: 0 16px 30px rgba(18, 52, 104, 0.24);
}

.workspace {
  width: min(1920px, 100%);
  height: calc(100vh - 108px);
  min-height: 660px;
  margin: 0 auto;
  padding: 14px 16px 14px;
  display: grid;
  grid-template-columns: minmax(300px, var(--rules-panel-width)) minmax(620px, 1fr) minmax(340px, 430px);
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
  transition: grid-template-columns 240ms ease;
}
.workspace.rules-collapsed {
  grid-template-columns: 58px minmax(620px, 1fr) minmax(340px, 430px);
}

.rules-library-panel,
.rule-viewer-panel,
.tool-card {
  position: relative;
  min-width: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.rules-library-panel::before,
.rule-viewer-panel::before,
.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--blue);
}
.rules-library-panel::before { background: linear-gradient(90deg, #0284c7, #22d3ee); }
.rule-viewer-panel::before { background: linear-gradient(90deg, var(--navy), var(--blue)); }
.case-converter-card::before { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.days-calculator-card::before { background: linear-gradient(90deg, #ea580c, #fb923c); }
.interest-calculator-card::before { background: linear-gradient(90deg, #facc15, #fde047); }
.notepad-launch-card::before { background: linear-gradient(90deg, #0f766e, #14b8a6); }

.rules-library-panel {
  padding: 14px;
  display: grid;
  min-height: 0;
}
.rules-panel-content {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  opacity: 1;
  transition: opacity 160ms ease;
}
.workspace.rules-collapsed .rules-library-panel {
  padding: 0;
}
.workspace.rules-collapsed .rules-panel-content {
  display: none;
  opacity: 0;
  pointer-events: none;
}
.rules-rail-button {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.workspace.rules-collapsed .rules-rail-button { display: inline-flex; align-items: center; justify-content: center; }
.workspace.rules-collapsed .rules-rail-button:hover { background: #f8fafc; color: var(--primary); }
.rules-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rules-panel-heading h1,
.tool-card-heading h2,
.heading-title,
.rules-article h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.01em;
}
.rules-panel-heading p,
.tool-card-heading p,
.heading-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 500;
}
.official-rules-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  border-bottom: 1px solid rgba(67, 121, 201, 0.35);
}
.official-rules-link:hover,
.official-rules-link:focus-visible {
  color: var(--navy);
  border-bottom-color: currentColor;
  outline: none;
}
.rules-collapse-button {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #f0f9ff;
  color: #0369a1;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 7px 11px;
}
.rules-collapse-button:hover { background: #e0f2fe; }
.rules-toolbar-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: #334155;
  font-weight: 780;
  font-size: 0.82rem;
}
.rules-toolbar-row label { display: grid; gap: 5px; }
.rules-toolbar-row select,
.rules-search,
.case-converter-card textarea,
.date-row input,
.days-offset-row input,
.interest-row input,
.chrome-notepad-title-input input {
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: #111827;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.rules-toolbar-row select {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.rules-search {
  width: 100%;
  min-height: 40px;
  border-radius: 12px;
  padding: 10px 12px;
}
.rules-search::placeholder,
.case-converter-card textarea::placeholder { color: #94a3b8; }
.rules-toolbar-row select:focus,
.rules-search:focus,
.case-converter-card textarea:focus,
.date-row input:focus,
.days-offset-row input:focus,
.interest-row input:focus,
.chrome-notepad-title-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 94, 89, 0.14);
}
.rules-count {
  min-height: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
}
.rules-tree-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rules-tree-controls button {
  min-height: 31px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 850;
  padding: 6px 10px;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.rules-tree-controls button:hover {
  transform: translateY(-1px);
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.rules-tree {
  min-height: 0;
  overflow: auto;
  padding-right: 5px;
  scrollbar-color: #94a3b8 transparent;
}
.rules-tree-part {
  margin: 12px 0 5px;
  color: var(--text);
  font-weight: 900;
  font-size: 0.88rem;
}
.rules-tree-section {
  margin: 8px 0 4px;
  padding-left: 8px;
  color: #475569;
  font-weight: 780;
  font-size: 0.78rem;
  line-height: 1.25;
}
.rules-tree-part-toggle,
.rules-tree-section-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  text-align: left;
  border-radius: 9px;
  transition: background 150ms ease, color 150ms ease;
}
.rules-tree-part-toggle {
  margin: 12px 0 5px;
  padding: 7px 8px;
  color: var(--text);
  font-weight: 950;
  font-size: 0.88rem;
}
.rules-tree-section-toggle {
  margin: 6px 0 3px;
  padding: 6px 8px 6px 18px;
  color: #475569;
  font-weight: 820;
  font-size: 0.78rem;
  line-height: 1.25;
}
.rules-tree-part-toggle:hover,
.rules-tree-section-toggle:hover { background: #f1f5f9; }
.tree-caret {
  width: 18px;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 950;
}
.tree-group-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-group-count {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
}
.rules-tree-rule.hidden-by-group { display: none; }
.rules-tree-rule {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #111827;
  padding: 7px 9px 7px 13px;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.25;
  transition: background 150ms ease, color 150ms ease;
}
.rules-tree-rule:hover { background: #f1f5f9; }
.rules-tree-rule.active {
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}
.rules-tree-rule.repealed,
.rules-tree-rule.suspended,
.rules-tree-rule.omitted { color: #64748b; }
.rules-load-status {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.45;
}

.rules-panel-resizer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 12;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
  outline: none;
}
.rules-panel-resizer::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 150ms ease, box-shadow 150ms ease;
}
.rules-panel-resizer:hover::before,
.rules-panel-resizer:focus-visible::before,
body.resizing-rules-panel .rules-panel-resizer::before {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 94, 89, 0.12);
}
.workspace.rules-collapsed .rules-panel-resizer { display: none; }
body.resizing-rules-panel { cursor: col-resize; user-select: none; }

.rule-viewer-panel {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  scrollbar-color: #94a3b8 transparent;
}
.rules-article {
  max-width: 1120px;
  margin: 0 auto;
  color: #111827;
}
.rules-article h2 {
  font-size: clamp(1.1rem, 1.5vw, 1.42rem);
  margin-bottom: 7px;
}
.rules-meta {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}
.rules-copy-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.rules-copy-row button,
.case-button-row button,
.days-action-grid button,
.interest-action-row button {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-weight: 780;
  font-size: 0.8rem;
  line-height: 1;
  padding: 8px 12px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.rules-copy-row button:hover,
.case-button-row button:hover,
.days-action-grid button:hover,
.interest-action-row button:hover {
  transform: translateY(-1px);
  background: #eef2f7;
  border-color: #94a3b8;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}
.rules-copy-row span,
.tool-status {
  color: var(--success);
  font-size: 0.8rem;
  min-height: 1em;
  margin: 0;
}
.rules-body-text,
.rules-notes-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.1vw, 1.08rem);
  line-height: 1.62;
}
.rules-body-text p,
.rules-notes-text p { margin: 0 0 0.92rem; }
.rules-notes-text {
  border-top: 1px solid #e2e8f0;
  margin-top: 18px;
  padding-top: 16px;
}
.rules-notes-text h3,
.article-empty-state h2 {
  margin: 0 0 9px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}
mark {
  border-radius: 4px;
  padding: 0 2px;
  background: #fef08a;
  color: inherit;
}
.article-empty-state {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.tools-rail {
  min-height: 0;
  display: grid;
  grid-auto-rows: max-content;
  gap: 12px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-color: #94a3b8 transparent;
}
.tool-card {
  padding: 18px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.tool-card-heading { display: grid; gap: 4px; }
.case-converter-card textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  border-radius: 12px;
  padding: 12px 13px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  line-height: 1.42;
}
.case-button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.tool-card-body {
  display: grid;
  gap: 12px;
}
.date-row,
.days-offset-row,
.interest-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 780;
}
.interest-row { grid-template-columns: 92px minmax(0, 1fr); }
.percent-row { grid-template-columns: 92px minmax(0, 1fr) auto; }
.percent-row em { font-style: normal; color: var(--muted); font-weight: 900; }
.date-row input,
.days-offset-row input,
.interest-row input {
  height: 38px;
  padding: 7px 10px;
}
.days-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.days-action-grid button:first-child {
  grid-column: 1 / -1;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 94, 89, 0.18);
}
.days-action-grid button:first-child:hover,
.interest-action-row button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.days-result,
.interest-result {
  min-height: 42px;
  border: 1px solid var(--warning-border);
  border-radius: 12px;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 10px 11px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.tool-card-accordion-toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}
.tool-card-accordion-toggle .tool-card-heading { display: grid; }
.accordion-symbol {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  background: #f8fafc;
  font-weight: 950;
  line-height: 1;
}
.collapsible-tool.collapsed { min-height: 74px; }
.interest-action-row button {
  width: 100%;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(17, 94, 89, 0.18);
}
.notepad-launch-button { width: max-content; }
.tool-fine-print {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.site-footer {
  display: none;
  padding: 16px 22px 24px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}
.site-footer p { margin: 0; }

.chrome-notepad {
  position: fixed;
  left: 22px;
  bottom: 18px;
  z-index: 80;
  pointer-events: none;
}
.chrome-notepad-tab,
.chrome-notepad-window {
  pointer-events: auto;
  border: 1px solid rgba(148, 163, 184, 0.72);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(226, 232, 240, 0.98) 22%, rgba(255, 255, 255, 0.94) 42%, rgba(203, 213, 225, 0.96) 67%, rgba(248, 250, 252, 0.96) 100%);
  color: #0f172a;
  box-shadow:
    0 26px 60px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(100, 116, 139, 0.18);
  position: relative;
  overflow: hidden;
}
.chrome-notepad-tab {
  min-width: 126px;
  min-height: 44px;
  border-radius: 0 16px 16px 0;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.chrome-notepad-window {
  width: min(46vw, 540px);
  height: min(52vh, 550px);
  min-width: 360px;
  min-height: 420px;
  border-radius: 20px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
  animation: chrome-notepad-glimmer 100s ease-in-out infinite;
}
.chrome-notepad-window::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -70%;
  width: 45%;
  height: 180%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.12) 35%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0.12) 65%, transparent 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: chrome-notepad-sheen 100s ease-in-out infinite;
}
@keyframes chrome-notepad-sheen {
  0%, 97% { left: -70%; opacity: 0; }
  98% { opacity: 0.62; }
  100% { left: 130%; opacity: 0; }
}
@keyframes chrome-notepad-glimmer {
  0%, 97% { filter: brightness(1); }
  98.5% { filter: brightness(1.04); }
  100% { filter: brightness(1); }
}
.chrome-notepad-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.42);
  padding-bottom: 10px;
}
.chrome-notepad-titlebar div { display: grid; gap: 2px; }
.chrome-notepad-titlebar strong { margin: 0; color: var(--navy); line-height: 1.1; }
.chrome-notepad-titlebar span,
.chrome-notepad-title-input,
.chrome-notepad-status {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}
.chrome-notepad-titlebar button {
  min-width: 32px;
  min-height: 32px;
  padding: 0;
}
.chrome-notepad-title-input {
  display: grid;
  gap: 4px;
  font-weight: 850;
}
.chrome-notepad-title-input input {
  height: 36px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.88);
}
.chrome-notepad-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chrome-notepad-toolbar button {
  min-height: 31px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.8rem;
}
.chrome-notepad-editor {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(100, 116, 139, 0.38);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  padding: 12px;
  line-height: 1.48;
  outline: none;
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.06);
}
.chrome-notepad-editor:empty::before {
  content: "Type or paste notes here...";
  color: #94a3b8;
}
.chrome-notepad-editor:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(17, 94, 89, 0.14), inset 0 2px 8px rgba(15, 23, 42, 0.06);
}
.chrome-notepad-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.chrome-notepad-status {
  min-height: 1.1em;
  margin: 0;
  color: var(--success);
}

.simple-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.simple-card {
  width: min(620px, 100%);
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}
.simple-card img { width: min(280px, 100%); }
.simple-card h1 { margin: 0; }
.simple-card p { margin: 0; color: var(--muted); }

@media (max-width: 1440px) {
  .workspace {
    grid-template-columns: minmax(300px, min(var(--rules-panel-width), 430px)) minmax(500px, 1fr) minmax(320px, 380px);
    gap: 12px;
  }
  .tool-card { padding: 16px; }
}
@media (max-width: 1160px) {
  .site-header { height: auto; min-height: 98px; }
  .site-header-inner {
    grid-template-columns: 1fr auto;
  }
  .header-center-note { display: none; }
  .workspace,
  .workspace.rules-collapsed {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .rules-library-panel,
  .rule-viewer-panel,
  .tools-rail { min-height: 520px; }
  .workspace.rules-collapsed .rules-library-panel { padding: 14px; }
  .workspace.rules-collapsed .rules-panel-content { display: grid; opacity: 1; pointer-events: auto; }
  .workspace.rules-collapsed .rules-rail-button { display: none; }
  .rules-collapse-button,
  .rules-panel-resizer { display: none; }
  .site-footer { display: block; }
}
@media (max-width: 760px) {
  .site-header-inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
    padding: 8px 14px;
  }
  .brand-logo { width: min(330px, 82vw); height: 76px; }
  .header-actions { justify-content: flex-start; flex-wrap: wrap; }
  .workspace { padding: 12px; gap: 12px; }
  .rules-library-panel,
  .rule-viewer-panel,
  .tool-card { border-radius: 12px; }
  .rules-toolbar-row,
  .days-action-grid { grid-template-columns: 1fr; }
  .date-row,
  .days-offset-row,
  .interest-row,
  .percent-row { grid-template-columns: 1fr; gap: 6px; }
  .rules-panel-heading { flex-direction: column; }
  .rules-copy-row button,
  .case-button-row button { flex: 1 1 auto; }
  .chrome-notepad { left: 12px; right: 12px; bottom: 12px; }
  .chrome-notepad-window { width: 100%; min-width: 0; height: min(70vh, 560px); }
}

/* v1.0.4: PDF-like structural rendering layer. The XML remains unchanged; these classes
   are produced at runtime from the existing paragraph/source-line text. */
.rules-structured-text {
  display: block;
}
.rules-structured-text p,
.rules-structured-text .rule-content {
  margin: 0;
}
.rules-structured-text .rule-plain {
  margin: 0 0 0.95rem;
}
.rule-section-heading {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin: 1.1rem 0 0.62rem;
  color: #0f172a;
  font-weight: 800;
  line-height: 1.35;
}
.rule-section-heading:first-child {
  margin-top: 0;
}
.rule-section-number {
  flex: 0 0 auto;
  color: #075985;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.rule-section-body {
  margin: -0.18rem 0 0.95rem;
  color: #111827;
  font-weight: 400;
  line-height: 1.58;
}
.rule-item {
  --rule-indent: 0rem;
  --rule-label-width: 3.25rem;
  display: grid;
  grid-template-columns: var(--rule-label-width) minmax(0, 1fr);
  column-gap: 0.72rem;
  align-items: baseline;
  margin: 0 0 0.88rem;
  padding-left: var(--rule-indent);
}
.rule-depth-1 { --rule-indent: 0rem; }
.rule-depth-2 { --rule-indent: 2.15rem; }
.rule-depth-3 { --rule-indent: 4.3rem; }
.rule-depth-4 { --rule-indent: 6.45rem; }
.rule-depth-5 { --rule-indent: 8.6rem; }
.rule-label {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rule-content {
  min-width: 0;
}
.rule-item-title {
  color: #111827;
  font-weight: 800;
}
.rules-notes-panel {
  border-top: 1px solid #e2e8f0;
  margin-top: 20px;
  padding-top: 16px;
}
.rules-notes-panel h3 {
  margin: 0 0 10px;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
}
.rules-notes-panel .rules-notes-text {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.rules-notes-panel .rule-plain {
  text-indent: 1.4rem;
}
@media (max-width: 980px) {
  .rule-item {
    --rule-label-width: 2.6rem;
    column-gap: 0.55rem;
  }
  .rule-depth-2 { --rule-indent: 1.35rem; }
  .rule-depth-3 { --rule-indent: 2.7rem; }
  .rule-depth-4 { --rule-indent: 4.05rem; }
  .rule-depth-5 { --rule-indent: 5.4rem; }
}
@media (max-width: 620px) {
  .rule-section-heading {
    gap: 0.5rem;
  }
  .rule-item {
    --rule-label-width: 2.25rem;
    column-gap: 0.45rem;
  }
  .rule-depth-2 { --rule-indent: 0.85rem; }
  .rule-depth-3 { --rule-indent: 1.7rem; }
  .rule-depth-4 { --rule-indent: 2.55rem; }
  .rule-depth-5 { --rule-indent: 3.4rem; }
}
