/* styles.css — Pro Se Federal Court Companion */
/* WCAG 2.1 AA compliant: 4.5:1 text contrast, 3:1 UI contrast */

/* ── Reset & Variables ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #f8f9fb;
  --clr-surface:   #ffffff;
  --clr-card:      #ffffff;
  --clr-border:    #d1d5db;
  --clr-primary:   #1a3a5c;
  --clr-primary-hover: #14304e;
  --clr-primary-fg:#ffffff;
  --clr-accent:    #c8902a;
  --clr-accent-fg: #ffffff;
  --clr-text:      #111827;
  --clr-text-muted:#6b7280;
  --clr-success:   #166534;
  --clr-success-bg:#dcfce7;
  --clr-warning:   #92400e;
  --clr-warning-bg:#fef9c3;
  --clr-danger:    #991b1b;
  --clr-danger-bg: #fee2e2;
  --clr-info-bg:   #eff6ff;
  --clr-info:      #1e40af;
  --radius:        10px;
  --radius-sm:     6px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow:        0 2px 8px rgba(0,0,0,.1);
  --header-h:      56px;
  --nav-h:         60px;
  --font-sans:     system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:     'Courier New', Courier, monospace;
  --transition:    150ms ease;
}

[data-theme="dark"] {
  --clr-bg:        #0f172a;
  --clr-surface:   #1e293b;
  --clr-card:      #1e293b;
  --clr-border:    #334155;
  --clr-primary:   #3b82f6;
  --clr-primary-hover: #2563eb;
  --clr-primary-fg:#ffffff;
  --clr-accent:    #f59e0b;
  --clr-text:      #f1f5f9;
  --clr-text-muted:#94a3b8;
  --clr-success:   #4ade80;
  --clr-success-bg:#14532d;
  --clr-warning:   #fbbf24;
  --clr-warning-bg:#451a03;
  --clr-danger:    #f87171;
  --clr-danger-bg: #450a0a;
  --clr-info-bg:   #1e3a5f;
  --clr-info:      #93c5fd;
}

[data-font-size="large"]  { font-size: 18px; }
[data-font-size="xlarge"] { font-size: 21px; }

html { font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip link ────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--clr-primary);
  color: var(--clr-primary-fg);
  padding: 8px 16px;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

/* ── Header ───────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--clr-primary);
  color: var(--clr-primary-fg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
}
.header-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.app-logo { font-size: 1.4rem; }
.app-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
}
.header-case-badge {
  font-size: 0.72rem;
  background: rgba(255,255,255,.15);
  padding: 2px 10px;
  border-radius: 99px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Bottom navigation ────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  display: flex;
  box-shadow: 0 -2px 8px rgba(0,0,0,.07);
}
.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 6px 2px;
  transition: color var(--transition), background var(--transition);
  border-top: 3px solid transparent;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.nav-tab span:first-child { font-size: 1.25rem; }
.nav-tab[aria-selected="true"] {
  color: var(--clr-primary);
  border-top-color: var(--clr-primary);
  font-weight: 700;
}
.nav-tab:hover { color: var(--clr-text); background: var(--clr-bg); }

/* ── Main content ─────────────────────────────────────────── */
.main-content {
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
  padding: 1rem 1rem calc(1rem + var(--nav-h));
  max-width: 680px;
  margin: 0 auto;
}

/* ── Utility ──────────────────────────────────────────────── */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 0.75rem;
}
.card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-primary { background: var(--clr-info-bg); color: var(--clr-info); }
.badge-success { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-warning { background: var(--clr-warning-bg); color: var(--clr-warning); }
.badge-danger  { background: var(--clr-danger-bg); color: var(--clr-danger); }
.badge-neutral { background: var(--clr-bg); color: var(--clr-text-muted); border: 1px solid var(--clr-border); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition), transform 80ms;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--clr-primary); color: var(--clr-primary-fg); }
.btn-primary:hover { background: var(--clr-primary-hover); }
.btn-secondary { background: var(--clr-bg); color: var(--clr-text); border: 1.5px solid var(--clr-border); }
.btn-secondary:hover { background: var(--clr-border); }
.btn-danger { background: var(--clr-danger-bg); color: var(--clr-danger); border: 1px solid var(--clr-danger); }
.btn-danger:hover { background: var(--clr-danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-icon { padding: 0.4rem; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius-sm);
  background: var(--clr-surface);
  color: var(--clr-text);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  transition: border-color var(--transition);
}
.input:focus { outline: none; border-color: var(--clr-primary); }
.input::placeholder { color: var(--clr-text-muted); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 80px; }

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--clr-text);
}
.form-hint {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
}

/* ── Search box ───────────────────────────────────────────── */
.search-box-wrap {
  position: relative;
  margin-bottom: 1rem;
}
.search-box-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-text-muted);
  pointer-events: none;
  font-style: normal;
  font-size: 1rem;
}
.search-box {
  padding-left: 2.25rem;
}

/* ── Rules list ───────────────────────────────────────────── */
.rules-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.filter-chip {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.filter-chip.active { background: var(--clr-primary); color: var(--clr-primary-fg); border-color: var(--clr-primary); }

.rule-card {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.rule-card:hover { border-color: var(--clr-primary); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.rule-card-header {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.rule-num {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--clr-primary);
  background: var(--clr-info-bg);
  padding: 1px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.rule-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--clr-text);
  flex: 1;
}
.rule-plain {
  font-size: 0.82rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
}
.rule-card mark {
  background: var(--clr-warning-bg);
  color: var(--clr-warning);
  border-radius: 2px;
  padding: 0 2px;
}

.rule-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.rule-detail-sheet {
  background: var(--clr-surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.25rem;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  overflow-y: auto;
}
.rule-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.rule-detail-close {
  margin-left: auto;
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--clr-text);
}
.rule-detail-summary {
  font-size: 0.88rem;
  color: var(--clr-text);
  line-height: 1.6;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--clr-info-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--clr-info);
}
.rule-detail-plain-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 0.35rem;
}
.rule-detail-plain {
  font-size: 0.88rem;
  color: var(--clr-text);
  line-height: 1.6;
}

/* ── Walkthrough ──────────────────────────────────────────── */
.motion-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 440px) { .motion-grid { grid-template-columns: 1fr; } }

.motion-card {
  background: var(--clr-card);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.9rem;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  text-align: left;
}
.motion-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow); }
.motion-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.motion-card-rule {
  font-size: 0.72rem;
  color: var(--clr-text-muted);
}
.motion-card-progress {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--clr-success);
  font-weight: 600;
}

.wt-header { margin-bottom: 1.25rem; }
.wt-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.wt-desc { font-size: 0.82rem; color: var(--clr-text-muted); }
.wt-progress-bar {
  height: 6px;
  background: var(--clr-border);
  border-radius: 99px;
  margin: 0.75rem 0;
  overflow: hidden;
}
.wt-progress-fill {
  height: 100%;
  background: var(--clr-primary);
  border-radius: 99px;
  transition: width 300ms ease;
}

.step-item {
  display: flex;
  gap: 0.9rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
  transition: background var(--transition);
  border-radius: var(--radius-sm);
}
.step-item:last-child { border-bottom: none; }
.step-item:hover { background: var(--clr-bg); }
.step-check {
  width: 24px;
  height: 24px;
  border: 2px solid var(--clr-border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  transition: all var(--transition);
  margin-top: 2px;
}
.step-item.done .step-check {
  background: var(--clr-success);
  border-color: var(--clr-success);
  color: #fff;
}
.step-body { flex: 1; }
.step-num { font-size: 0.7rem; font-weight: 700; color: var(--clr-text-muted); margin-bottom: 2px; }
.step-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: 0.35rem;
}
.step-item.done .step-title {
  text-decoration: line-through;
  color: var(--clr-text-muted);
}
.step-detail {
  font-size: 0.8rem;
  color: var(--clr-text-muted);
  line-height: 1.5;
  margin-bottom: 0.4rem;
}
.step-rule {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--clr-primary);
  background: var(--clr-info-bg);
  padding: 1px 8px;
  border-radius: 4px;
  display: inline-block;
}

.wt-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ── Hearing prep ─────────────────────────────────────────── */
.checklist-group { margin-bottom: 1.25rem; }
.checklist-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clr-text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--clr-border);
}
.checklist-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--clr-border);
  cursor: pointer;
}
.checklist-row:last-child { border-bottom: none; }
.checklist-row:hover { background: var(--clr-bg); border-radius: var(--radius-sm); }
.checklist-cb {
  width: 20px;
  height: 20px;
  border: 2px solid var(--clr-border);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: transparent;
  margin-top: 2px;
  transition: all var(--transition);
}
.checklist-row.checked .checklist-cb {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
}
.checklist-row-body { flex: 1; }
.checklist-row-label {
  font-size: 0.88rem;
  color: var(--clr-text);
  font-weight: 500;
  line-height: 1.4;
}
.checklist-row.checked .checklist-row-label {
  text-decoration: line-through;
  color: var(--clr-text-muted);
}
.checklist-row-detail {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.priority-critical { border-left: 3px solid var(--clr-danger); padding-left: 0.5rem; }
.priority-high     { border-left: 3px solid var(--clr-warning); padding-left: 0.5rem; }

.hearing-summary {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem;
  background: var(--clr-info-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--clr-info);
}
.hearing-summary-count { font-weight: 700; font-size: 1.5rem; color: var(--clr-primary); }

/* ── Tracker ──────────────────────────────────────────────── */
.tracker-empty {
  text-align: center;
  padding: 2rem;
  color: var(--clr-text-muted);
}
.tracker-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.deadline-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  align-items: flex-start;
}
.deadline-item.overdue { border-left: 3px solid var(--clr-danger); }
.deadline-item.urgent  { border-left: 3px solid var(--clr-warning); }
.deadline-item.soon    { border-left: 3px solid var(--clr-accent); }
.deadline-date-block {
  text-align: center;
  min-width: 52px;
  flex-shrink: 0;
}
.deadline-month { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; color: var(--clr-text-muted); }
.deadline-day { font-size: 1.4rem; font-weight: 800; color: var(--clr-primary); line-height: 1; }
.deadline-year { font-size: 0.62rem; color: var(--clr-text-muted); }
.deadline-body { flex: 1; }
.deadline-title { font-size: 0.9rem; font-weight: 600; color: var(--clr-text); margin-bottom: 2px; }
.deadline-meta { font-size: 0.75rem; color: var(--clr-text-muted); }
.deadline-badge { margin-top: 4px; }
.deadline-actions { display: flex; gap: 0.3rem; align-items: flex-start; }

.add-deadline-form {
  background: var(--clr-card);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  background: var(--clr-card);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0 1rem;
  margin-bottom: 1rem;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--clr-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-label { flex: 1; font-size: 0.88rem; font-weight: 500; color: var(--clr-text); }
.settings-row-hint { font-size: 0.75rem; color: var(--clr-text-muted); margin-top: 1px; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--clr-border);
  border-radius: 99px;
  transition: background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--clr-primary); }
.toggle-thumb {
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
  pointer-events: none;
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(20px); }
.toggle input:focus + .toggle-track { outline: 2px solid var(--clr-primary); outline-offset: 2px; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--clr-text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.85rem; }

/* ── Loading ──────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--clr-text-muted);
  gap: 0.5rem;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.toast {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--clr-text);
  color: var(--clr-surface);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms, transform 200ms;
  pointer-events: none;
}
.toast.toast-visible { opacity: 1; transform: translateY(0); }
.toast-error { background: var(--clr-danger); color: #fff; }
.toast-success { background: var(--clr-success); color: #fff; }

/* ── Motion-specific theming ─────────────────────────────── */
.motion-card.has-progress .motion-card-title::after {
  content: ' ✓';
  color: var(--clr-success);
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (min-width: 560px) {
  .main-content { padding: 1.25rem 1.5rem calc(1.25rem + var(--nav-h)); }
}

/* ── Focus visible (WCAG 2.4.7) ──────────────────────────── */
:focus-visible {
  outline: 3px solid var(--clr-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Glossary ─────────────────────────────────────────────── */
.glossary-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--clr-border);
}
.glossary-item:last-child { border-bottom: none; }
.glossary-term-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.glossary-term {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--clr-primary);
}
.glossary-also {
  font-size: 0.75rem;
  color: var(--clr-text-muted);
  font-style: italic;
}
.glossary-def {
  font-size: 0.82rem;
  color: var(--clr-text);
  line-height: 1.6;
  margin: 0;
}
.glossary-def mark {
  background: var(--clr-warning-bg);
  color: var(--clr-warning);
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Motion Template ──────────────────────────────────────── */
.motion-card-wrapper {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
  align-items: stretch;
}
.motion-card-wrapper .motion-card {
  margin: 0;
}
.template-btn {
  align-self: center;
  white-space: nowrap;
}
.template-preview {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  overflow: auto;
  max-height: 60vh;
}
.template-pre {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--clr-text);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 1rem;
  margin: 0;
}

/* ── Deadline Calculator ──────────────────────────────────── */
.radio-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--clr-text);
  cursor: pointer;
  line-height: 1.4;
  padding: 0.25rem 0;
}
.radio-opt input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--clr-primary);
  flex-shrink: 0;
}
#calc-panel { border-color: var(--clr-info); }

details summary { user-select: none; }
details summary::-webkit-details-marker { color: var(--clr-primary); }

/* ── FRE Objections ───────────────────────────────────────── */
.objection-card {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.objection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  list-style: none;
  background: var(--clr-surface);
  user-select: none;
  gap: 0.5rem;
}
.objection-summary::-webkit-details-marker { display: none; }
.objection-summary:hover { background: var(--clr-hover); }
.objection-chevron {
  font-size: 0.7rem;
  color: var(--clr-text-muted);
  flex-shrink: 0;
  transition: transform 200ms;
}
details[open] .objection-chevron { transform: rotate(90deg); }
.objection-body {
  padding: 0.85rem;
  border-top: 1px solid var(--clr-border);
  background: var(--clr-bg);
}
.objection-say-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-primary);
  margin-bottom: 0.25rem;
}
.objection-say-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--clr-text);
  font-style: italic;
  background: var(--clr-primary-muted, var(--clr-info-bg));
  border-left: 3px solid var(--clr-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.75rem;
}
.objection-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--clr-text-muted);
  margin-top: 0.6rem;
  margin-bottom: 0.2rem;
}
.objection-text {
  font-size: 0.8rem;
  color: var(--clr-text);
  line-height: 1.6;
  margin: 0;
}

/* ── Discovery Tracker ────────────────────────────────────── */
.disc-item {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--clr-surface);
}
.disc-item-admitted {
  border-color: var(--clr-danger);
  background: var(--clr-danger-bg);
}
.disc-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}
.badge-info {
  background: var(--clr-info-bg);
  color: var(--clr-info);
  border: 1px solid var(--clr-info);
}

/* ── Timeline ─────────────────────────────────────────────── */
.timeline-container { padding: 0.25rem 0; }
.timeline-month { margin-bottom: 1rem; }
.timeline-month-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-text-muted);
  margin-bottom: 0.4rem;
  padding-left: 1.5rem;
}
.timeline-item {
  display: flex;
  gap: 0;
  min-height: 2.5rem;
}
.timeline-line-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.5rem;
  flex-shrink: 0;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
}
.timeline-dot-future  { background: var(--clr-primary); }
.timeline-dot-urgent  { background: var(--clr-warning); }
.timeline-dot-today   { background: var(--clr-danger); box-shadow: 0 0 0 3px var(--clr-danger-bg); }
.timeline-dot-past    { background: var(--clr-border); }
.timeline-line {
  flex: 1;
  width: 2px;
  background: var(--clr-border);
  margin: 2px 0;
}
.timeline-item-body {
  flex: 1;
  padding: 0 0 0.75rem 0.5rem;
}
.timeline-past { opacity: 0.55; }

/* ── Jurisdiction Analyzer ───────────────────────────────── */
.jur-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  color: var(--clr-text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.jur-crumb { padding: 0.15rem 0.35rem; border-radius: 99px; }
.jur-crumb.active { background: var(--clr-primary); color: #fff; font-weight: 600; }
.jur-crumb.done { color: var(--clr-success); font-weight: 600; }
.jur-sep { color: var(--clr-border); }
.jur-card {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--clr-surface);
  margin-bottom: 0.75rem;
}
.jur-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.jur-step-num {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-primary);
  margin-bottom: 0.25rem;
}
.jur-text {
  font-size: 0.82rem;
  color: var(--clr-text);
  line-height: 1.65;
  margin-bottom: 0.5rem;
}
.jur-examples {
  font-size: 0.78rem;
  color: var(--clr-text);
  line-height: 1.8;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}
.jur-def-box {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.jur-def-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--clr-text-muted);
  margin-bottom: 0.35rem;
}
.jur-result {
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.jur-result-success {
  border: 1.5px solid var(--clr-success);
  background: var(--clr-success-bg);
}
.jur-result-fail {
  border: 1.5px solid var(--clr-danger);
  background: var(--clr-danger-bg);
}
.jur-result-icon { font-size: 1.5rem; margin-bottom: 0.4rem; }
.jur-result-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 0.5rem;
}
.jur-result-text {
  font-size: 0.8rem;
  color: var(--clr-text);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}
.jur-basis-block {
  border-top: 1px solid var(--clr-border);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}
.jur-basis-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--clr-text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.jur-result-detail {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--clr-surface);
}

/* ── Motion Status Board ─────────────────────────────────── */
.motion-status-item {
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--clr-surface);
}
.motion-resolved { border-color: var(--clr-border); }

/* ── Rule 11(b) Checklist ────────────────────────────────── */
.r11-checklist {
  border: 1.5px solid var(--clr-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.r11-summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  list-style: none;
  background: var(--clr-surface);
  user-select: none;
}
.r11-summary::-webkit-details-marker { display: none; }
.r11-summary:hover { background: var(--clr-hover); }
.r11-body {
  padding: 0.85rem;
  border-top: 1px solid var(--clr-border);
  background: var(--clr-bg);
}
.r11-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
.r11-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--clr-primary);
  cursor: pointer;
}
.r11-item-body { flex: 1; }
