/* Dashboard Shared CSS
   Cleaned from uploaded shared dashboard styles.
   Cascade order is preserved.
   Dark mode values are intentionally unchanged.
   Light mode uses the active pastel blue/purple palette below. */

/* Shared Theme SSOT
   Shared by shell and standalone pages.
   Keep cross-page colors/sizing here. */
:root {
  /* Colors: shared */
  --brand-gold: #f3c969;
  --brand-mint: #7ef0cf;

  /* Colors: dark */
  --bg: #1e0e41;
  --panel: rgba(46, 31, 88, 0.9);
  --panel-soft: rgba(255, 255, 255, 0.05);
  --text: #faf6ff;
  --muted: #c7b9e4;
  --border: rgba(255, 255, 255, 0.11);
  --accent: var(--brand-gold);
  --accent-2: var(--brand-mint);
  --ui-accent: var(--brand-gold);
  --ui-icon-color: color-mix(in srgb, var(--ui-accent) 68%, var(--text) 32%);
  --ui-icon-active: var(--ui-accent);
  --ok: #95f4cd;
  --warn: #ffd97d;
  --bad: #ff93b4;
  --shadow: 0 24px 60px rgba(4, 3, 18, 0.42);
  --ui-picker-bg: color-mix(in srgb, var(--panel-soft) 86%, rgba(255, 255, 255, 0.04));
  --ui-picker-text: var(--text);
  --ui-picker-border: color-mix(in srgb, var(--ui-accent) 28%, var(--border));
  --ui-picker-option-bg: rgba(255, 255, 255, 0.03);
  --ui-picker-option-bg-hover: rgba(243, 201, 105, 0.12);
  --ui-picker-option-border-hover: rgba(243, 201, 105, 0.36);
  --ui-picker-option-bg-selected: rgba(159, 247, 211, 0.18);
  --ui-picker-option-border-selected: rgba(159, 247, 211, 0.48);
  --ui-picker-check: rgba(159, 247, 211, 0.95);
  --ui-picker-empty: rgba(199, 185, 228, 0.95);
  --ui-picker-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
  --searchable-select-trigger-bg: var(--ui-picker-bg);
  --searchable-select-menu-bg: var(--panel-strong, #130d29);
  --searchable-select-input-bg: var(--ui-picker-bg);
  --searchable-select-text: var(--ui-picker-text);
  --searchable-select-caret: rgba(199, 185, 228, 0.9);
  --searchable-select-border: var(--ui-picker-border);
  --searchable-select-control-height: var(--control-height);
  --searchable-select-control-radius: var(--control-radius);
  --searchable-select-control-padding-inline: 12px;
  --searchable-select-option-bg: var(--ui-picker-option-bg);
  --searchable-select-hover-bg: var(--ui-picker-option-bg-hover);
  --searchable-select-hover-border: var(--ui-picker-option-border-hover);
  --searchable-select-selected-bg: var(--ui-picker-option-bg-selected);
  --searchable-select-selected-border: var(--ui-picker-option-border-selected);
  --searchable-select-check: var(--ui-picker-check);
  --searchable-select-empty: var(--ui-picker-empty);
  --searchable-select-shadow: var(--ui-picker-shadow);

  /* Space: shell/body */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --dashboard-shell-max-width: 1820px;
  --dashboard-shell-top: 30px;
  --dashboard-shell-bottom: 20px;
  --dashboard-shell-inline: 18px;
  --dashboard-shell-gap: 8px;
  --dashboard-sidebar-width: 320px;
  --dashboard-main-padding: 12px;
  --dashboard-rail-clearance: 56px;
  --dashboard-embedded-pane-floor-height: 940px;
  --dashboard-z-sidebar: 20;
  --dashboard-z-hero: 24;
  --dashboard-z-subview-modal-shell: 13050;
  --dashboard-z-page-modal: 13060;

  /* Space: sidebar */
  --dashboard-sidebar-padding: 8px;
  --dashboard-sidebar-gap: 8px;

  /* Space: buttons/pills/badges/cards */
  --panel-radius: 22px;
  --card-radius: 18px;

  /* Shared controls */
  --control-height: 36px;
  --control-radius: 10px;
  --control-padding: 6px 12px;
  --control-gap: 6px;
  --control-transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease, transform 120ms ease;
  --button-transition: transform 120ms ease, box-shadow 120ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, filter 160ms ease;

  /* Typography */
  --font-display: "Crimson Pro", Georgia, serif;
  --font-body: "Space Grotesk", system-ui, -apple-system, sans-serif;

}

/* Light mode overrides: active pastel blue/purple palette. */
:root[data-theme="light"] {
  /* Colors: light */
  --bg: #edf4ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-soft: rgba(224, 231, 255, 0.42);
  --text: #17233f;
  --muted: #64708f;
  --border: rgba(132, 155, 213, 0.34);
  --accent: #8b74f7;
  --accent-2: #6bbcff;
  --ui-accent: #7b68f2;
  --ui-icon-color: color-mix(in srgb, var(--ui-accent) 74%, var(--text) 26%);
  --ui-icon-active: var(--ui-accent);
  --ok: #1b8f72;
  --warn: #a46f15;
  --bad: #b85282;
  --shadow: 0 22px 48px rgba(99, 118, 174, 0.18);
  --ui-picker-bg: color-mix(in srgb, var(--panel) 82%, rgba(255, 255, 255, 0.18));
  --ui-picker-text: var(--text);
  --ui-picker-border: color-mix(in srgb, var(--ui-accent) 44%, var(--border));
  --ui-picker-option-bg: rgba(15, 23, 42, 0.03);
  --ui-picker-option-bg-hover: rgba(210, 167, 49, 0.16);
  --ui-picker-option-border-hover: rgba(210, 167, 49, 0.46);
  --ui-picker-option-bg-selected: rgba(13, 148, 136, 0.15);
  --ui-picker-option-border-selected: rgba(13, 148, 136, 0.42);
  --ui-picker-check: #047857;
  --ui-picker-empty: #58647b;
  --ui-picker-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
  --searchable-select-trigger-bg: var(--ui-picker-bg);
  --searchable-select-menu-bg: var(--panel-strong, #ffffff);
  --searchable-select-input-bg: var(--ui-picker-bg);
  --searchable-select-text: var(--ui-picker-text);
  --searchable-select-caret: rgba(56, 67, 86, 0.82);
  --searchable-select-border: var(--ui-picker-border);
  --searchable-select-control-height: var(--control-height);
  --searchable-select-control-radius: var(--control-radius);
  --searchable-select-control-padding-inline: 12px;
  --searchable-select-option-bg: var(--ui-picker-option-bg);
  --searchable-select-hover-bg: var(--ui-picker-option-bg-hover);
  --searchable-select-hover-border: var(--ui-picker-option-border-hover);
  --searchable-select-selected-bg: var(--ui-picker-option-bg-selected);
  --searchable-select-selected-border: var(--ui-picker-option-border-selected);
  --searchable-select-check: var(--ui-picker-check);
  --searchable-select-empty: var(--ui-picker-empty);
  --searchable-select-shadow: var(--ui-picker-shadow);

}

/* Optional light mode palettes.
   Swap the active :root[data-theme="light"] values above with one set below.

   Palette: Bluebell Frost
   --bg: #f1f6ff;
   --panel: rgba(255, 255, 255, 0.84);
   --panel-soft: rgba(216, 228, 255, 0.44);
   --text: #182542;
   --muted: #62708e;
   --border: rgba(127, 153, 218, 0.34);
   --accent: #7f74f2;
   --accent-2: #68b7ff;
   --shadow: 0 22px 48px rgba(95, 116, 178, 0.17);

   Palette: Lilac Cloud
   --bg: #f5f1ff;
   --panel: rgba(255, 255, 255, 0.83);
   --panel-soft: rgba(231, 219, 255, 0.46);
   --text: #241b3f;
   --muted: #766b95;
   --border: rgba(164, 142, 220, 0.34);
   --accent: #9a76f5;
   --accent-2: #83bfff;
   --shadow: 0 22px 48px rgba(122, 91, 177, 0.16);

   Palette: Periwinkle Glass
   --bg: #eef2ff;
   --panel: rgba(255, 255, 255, 0.8);
   --panel-soft: rgba(205, 218, 255, 0.42);
   --text: #18213d;
   --muted: #626d8c;
   --border: rgba(118, 145, 212, 0.36);
   --accent: #8278ff;
   --accent-2: #72d6ff;
   --shadow: 0 22px 50px rgba(86, 104, 168, 0.18);
*/

/* Dark mode uses :root defaults above (no duplicate dark override block). */

/* ===== Section: Base Page Styles ===== */
* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

html.law-dashboard-shell-document,
html.law-dashboard-shell-document body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg);
}

/* Section: Shared component chrome */
.shared-field-host {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.searchable-native-select {
  display: none !important;
}

.shared-field:not(.searchable-native-select),
.searchable-select-trigger,
.searchable-select-input {
  font: inherit;
  min-height: var(--control-height);
  padding: var(--control-padding);
  border: 1px solid var(--ui-picker-border);
  border-radius: var(--control-radius);
  background: var(--ui-picker-bg);
  color: var(--ui-picker-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-picker-border) 78%, transparent), inset 0 1px 0 color-mix(in srgb, var(--text) 14%, transparent), 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: var(--control-transition);
}

:root[data-theme="light"] :is(.shared-field:not(.searchable-native-select), .searchable-select-trigger, .searchable-select-input) {
  border-color: var(--ui-picker-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 244, 255, 0.9));
  color: var(--ui-picker-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-picker-border) 82%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 1px 2px rgba(96, 91, 166, 0.08);
}

.shared-field:not(.searchable-native-select)::placeholder {
  color: rgba(199, 185, 228, 0.78);
}

:root[data-theme="light"] .shared-field:not(.searchable-native-select)::placeholder {
  color: rgba(83, 94, 132, 0.68);
}

:is(.shared-field:not(.searchable-native-select), .searchable-select-trigger, .searchable-select-input):focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ui-accent) 44%, var(--ui-picker-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-picker-border) 82%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.16), 0 0 0 3px color-mix(in srgb, var(--ui-accent) 16%, transparent);
}

:root[data-theme="light"] :is(.shared-field:not(.searchable-native-select), .searchable-select-trigger, .searchable-select-input):focus {
  border-color: color-mix(in srgb, var(--ui-accent) 48%, var(--ui-picker-border));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-picker-border) 86%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 1px 2px rgba(96, 91, 166, 0.08), 0 0 0 3px color-mix(in srgb, var(--ui-accent) 16%, transparent);
}

:is(select.shared-field:not(.searchable-native-select), textarea.shared-field) {
  width: 100%;
  max-width: 100%;
}

.shared-field-host .searchable-select-wrap {
  width: 100%;
  min-width: 0;
}

.searchable-select-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.searchable-select-host-open {
  position: relative;
  z-index: 40;
}

.searchable-select-field-open {
  position: relative;
  z-index: 41;
}

.searchable-select-trigger {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.searchable-select-caret {
  color: var(--searchable-select-caret);
  font-size: 0.8em;
}

.searchable-select-menu {
  position: fixed;
  z-index: 200000;
  min-width: 220px;
  max-width: min(520px, calc(100vw - 24px)) !important;
  border: 1px solid var(--searchable-select-border);
  border-radius: 12px;
  background: var(--searchable-select-menu-bg);
  box-shadow: var(--searchable-select-shadow);
  padding: 8px;
  display: none;
}

.searchable-select-menu.open {
  display: block;
}

.searchable-select-input {
  width: 100%;
  margin-bottom: 8px;
}

.searchable-select-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.searchable-select-action,
.searchable-select-option {
  border: 1px solid var(--searchable-select-border);
  border-radius: 8px;
  background: var(--searchable-select-option-bg);
  color: var(--searchable-select-text);
  font: inherit;
}

.searchable-select-action {
  font-size: 0.85em;
  line-height: 1.2;
  padding: 7px 10px;
  cursor: pointer;
}

.searchable-select-action:hover,
.searchable-select-action:focus,
.searchable-select-option:hover,
.searchable-select-option:focus {
  outline: none;
  border-color: var(--searchable-select-hover-border);
  background: var(--searchable-select-hover-bg);
}

.searchable-select-action:disabled,
.searchable-select-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.searchable-select-options {
  max-height: min(320px, 48vh);
  overflow: auto;
  display: grid;
  gap: 4px;
}

.searchable-select-option {
  width: 100%;
  font-size: 0.92em;
  line-height: 1.34;
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: border-color 140ms ease, background 140ms ease, transform 120ms ease;
}

.searchable-select-option.is-selected {
  border-color: var(--searchable-select-selected-border);
  background: var(--searchable-select-selected-bg);
}

.searchable-select-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.searchable-select-option-row > span:first-child {
  min-width: 0;
}

.searchable-select-check {
  color: var(--searchable-select-check);
  font-weight: 700;
  opacity: 0;
  margin-top: 2px;
}

.searchable-select-option.is-selected .searchable-select-check {
  opacity: 1;
}

.searchable-select-empty {
  color: var(--searchable-select-empty);
  font-size: 0.9em;
  padding: 8px 10px;
}

/* PRIMITIVES: icon controls
   Use for icon-only clickable controls.
   Do not use for text actions, tabs, or pills. */
.ui-icon-control,
.ui-inline-icon-control {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  border: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: var(--ui-icon-color);
  transition: transform 120ms ease, color 160ms ease, filter 160ms ease;
}

.ui-inline-icon-control {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  height: 28px;
}

:is(.ui-icon-control, .ui-inline-icon-control):hover,
:is(.ui-icon-control, .ui-inline-icon-control):focus-visible {
  color: var(--ui-icon-active);
}

:is(.ui-icon-control, .ui-inline-icon-control) :is(i, svg, .icon) {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: currentColor;
}

:is(.ui-icon-control, .ui-inline-icon-control):hover :is(i, svg, .icon),
:is(.ui-icon-control, .ui-inline-icon-control):focus-visible :is(i, svg, .icon) {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ui-icon-active) 56%, transparent)) drop-shadow(0 0 12px color-mix(in srgb, var(--ui-icon-active) 34%, transparent));
}

/* PRIMITIVES: star controls
   Use for save/star toggles and starred-state glyphs. */
.ui-icon-control--star {
  color: var(--ui-icon-color);
  text-shadow: none;
  filter: none;
}

.ui-icon-control--star:hover,
.ui-icon-control--star:focus-visible {
  color: var(--ui-icon-active);
  text-shadow: 0 0 7px color-mix(in srgb, var(--ui-icon-active) 40%, transparent), 0 0 14px color-mix(in srgb, var(--ui-icon-active) 26%, transparent);
}

.ui-icon-control--star.is-starred,
.ui-icon-control--star[aria-pressed="true"] {
  color: var(--ui-icon-active);
  text-shadow: 0 0 8px color-mix(in srgb, var(--ui-icon-active) 58%, transparent), 0 0 18px color-mix(in srgb, var(--ui-icon-active) 42%, transparent), 0 0 30px color-mix(in srgb, var(--ui-icon-active) 28%, transparent);
}

.ui-icon-control--star:is(.is-starred, [aria-pressed="true"]) :is(i, svg, .icon) {
  color: var(--ui-icon-active);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--ui-icon-active) 56%, transparent)) drop-shadow(0 0 14px color-mix(in srgb, var(--ui-icon-active) 40%, transparent));
}

.ui-star-glyph {
  color: var(--ui-icon-color);
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, color 160ms ease, text-shadow 160ms ease;
}

.ui-star-glyph.is-off {
  opacity: 1;
  text-shadow: none;
}

.ui-star-glyph.is-on,
.ui-star-glyph:hover,
.ui-star-glyph:focus-visible {
  color: var(--ui-icon-active);
  text-shadow: 0 0 7px color-mix(in srgb, var(--ui-icon-active) 40%, transparent), 0 0 14px color-mix(in srgb, var(--ui-icon-active) 26%, transparent);
}


/* Shared card preview modal */
.shared-card-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px 16px 32px;
  background: rgba(5, 8, 20, 0.65);
}

.shared-card-preview-overlay.open {
  display: flex;
}

.shared-card-preview-modal {
  width: min(840px, 96vw);
  max-height: 86vh;
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  font-size: 1.04rem;
}

.shared-card-preview-title {
  font-size: 1.18rem;
  line-height: 1.3;
}

.shared-card-preview-question {
  font-size: 1.12rem;
  line-height: 1.5;
}

.shared-card-preview-options {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 1.08rem;
  line-height: 1.52;
}

.shared-card-preview-meta {
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ui-action,
a.ui-action {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--border));
  border-radius: var(--control-radius);
  min-height: var(--control-height);
  padding: var(--control-padding);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--control-gap);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 84%, white 16%), color-mix(in srgb, var(--accent) 70%, var(--panel-soft)));
  color: color-mix(in srgb, var(--bg) 80%, #000);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 26%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
  transition: var(--button-transition);
}

:is(.ui-action, a.ui-action):hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 80%, white 20%), color-mix(in srgb, var(--accent) 66%, var(--panel-soft)));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  filter: brightness(1.04) saturate(1.03);
}

:is(.ui-action, a.ui-action):active {
  transform: translateY(1px);
  box-shadow: none;
}

.ui-action--ghost,
a.ui-action--ghost {
  background: color-mix(in srgb, var(--panel-soft) 84%, rgba(255, 255, 255, 0.05));
  border-color: color-mix(in srgb, var(--border) 84%, rgba(255, 255, 255, 0.22));
  color: var(--text);
  box-shadow: none;
}

:is(.ui-action--ghost, a.ui-action--ghost):hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
  background: color-mix(in srgb, var(--panel-soft) 92%, rgba(255, 255, 255, 0.08));
}

:is(.ui-action, a.ui-action).is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 20%, rgba(255, 255, 255, 0.08));
}

:root[data-theme="light"] :is(.ui-action, a.ui-action).is-active {
  border-color: color-mix(in srgb, var(--accent) 54%, rgba(132, 155, 213, 0.34));
  background: linear-gradient(135deg, rgba(245, 248, 255, 0.98), rgba(229, 235, 255, 0.97) 64%, rgba(241, 235, 255, 0.95));
}

/* PRIMITIVES: pills
   Use for compact status, metric, and count chips.
   Do not use button names for non-button UI. */
.ui-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3, 8px);
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--panel-soft) 78%, rgba(255, 255, 255, 0.06));
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.ui-pill strong {
  color: var(--text);
}

.ui-pill--metric {
  font-variant-numeric: tabular-nums;
}

/* Section: Reusable layout primitives */
.layout-page-shell {
  width: min(var(--layout-page-max-width, 1680px), 100%);
  max-width: 100%;
  margin: 0 auto;
  display: grid;
  gap: var(--layout-page-gap, 14px);
  min-width: 0;
  min-height: 0;
}

.layout-surface {
  border: 1px solid var(--border);
  border-radius: var(--layout-surface-radius, 14px);
  background: var(--panel);
  padding: var(--layout-surface-padding, 14px);
  display: grid;
  gap: var(--layout-surface-gap, 12px);
  min-width: 0;
  min-height: 0;
  align-content: start;
}

.layout-card {
  border-radius: var(--layout-card-radius, 12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: var(--layout-card-padding, 12px 14px);
  display: grid;
  gap: var(--layout-card-gap, 10px);
  min-width: 0;
  align-content: start;
}

.layout-region-stack {
  display: grid;
  gap: var(--layout-region-gap, 12px);
  min-width: 0;
  min-height: 0;
}

.layout-region-grid {
  display: grid;
  gap: var(--layout-region-gap, 12px);
  min-width: 0;
  min-height: 0;
}

html.embedded-page body .dashboard-embedded-pane-shell,
body.embedded-page .dashboard-embedded-pane-shell {
  min-height: var(--dashboard-embedded-pane-floor-height);
}

html.embedded-page body .dashboard-embedded-pane-shell.is-fill-layout,
body.embedded-page .dashboard-embedded-pane-shell.is-fill-layout {
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
}

html.embedded-page body .dashboard-embedded-pane-fill,
body.embedded-page .dashboard-embedded-pane-fill {
  min-height: 0;
  height: 100%;
}

.layout-inline-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--layout-inline-gap, 10px);
  min-width: 0;
}

[data-layout-node] {
  min-width: 0;
}

/* Section: Shared page content surfaces */
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .layout-surface,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .layout-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .panel,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .card:not(#card),
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .tile,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .box,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .section-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .modal-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .dashboard-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .hero:not(.dashboard-hero-shell),
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .queue-list > .card:not(#card),
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .billing-step-block,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .billing-map-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .billing-step-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .billing-config-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .billing-advanced,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .affiliate-subpane .panel,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .citation-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .kpi,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .plan-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .plan-access-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .setting-field,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .history-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .plan-access-matrix-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .settings-section,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .option,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .note-modal-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .points-rules-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .points-rules-table-wrap,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .badge-catalog-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .badge-item-card,
:root[data-theme="light"] body:not(.law-dashboard-shell-page) .event-row {
  background: var(--panel) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow) !important;
}

:root[data-theme="light"] body:not(.law-dashboard-shell-page):not(.team-space-page) :where(.layout-surface, .layout-card, .panel, .card, .dashboard-card) :where(.layout-surface, .layout-card, .panel, .card, .dashboard-card):not(#card) {
  box-shadow: none !important;
  background: color-mix(in srgb, var(--panel-soft) 54%, white 46%) !important;
  border-color: color-mix(in srgb, var(--border) 70%, white 30%) !important;
}

:root[data-theme="light"] body:not(.law-dashboard-shell-page) :where(.list, .queue-list, .deck-list, .report-list, .badge-list) > :where(.item, .queue-item, .list-item, article, .card, .panel):not(.empty):not(.tiny):not(.table-wrap):not(.citation-table-wrap) {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 64%, white 36%);
  box-shadow: none;
}

:root[data-theme="light"] body:not(.law-dashboard-shell-page):not(.team-space-page) :where(.panel, .card, .dashboard-card) :where(.panel, .card, .dashboard-card):not(#card) {
  box-shadow: none !important;
  background: color-mix(in srgb, var(--panel-soft) 54%, white 46%) !important;
  border-color: color-mix(in srgb, var(--border) 70%, white 30%) !important;
}

/* Section: Support and citation light-mode surfaces */
:root[data-theme="light"] .card-citation-info {
  background: linear-gradient(180deg, rgba(237, 247, 255, 0.99), rgba(223, 238, 250, 0.98));
  border-color: rgba(66, 116, 167, 0.3);
  color: #17324d;
  box-shadow: 0 12px 26px rgba(54, 96, 145, 0.14);
}

:root[data-theme="light"] .card-citation-info:hover {
  background: linear-gradient(180deg, rgba(245, 251, 255, 1), rgba(230, 242, 252, 0.98));
  border-color: rgba(66, 116, 167, 0.42);
  color: #10263c;
}

:root[data-theme="light"] .card-citation-info.is-speaking {
  background: linear-gradient(180deg, rgba(255, 243, 204, 0.99), rgba(255, 229, 164, 0.98));
  border-color: rgba(166, 121, 42, 0.46);
  color: #241732;
  box-shadow: 0 12px 26px rgba(166, 121, 42, 0.2);
}

:root[data-theme="light"].law-support-style-page {
  --panel: #e3f1ff;
  --panel-strong: #d9ebfc;
  --panel-soft: rgba(82, 126, 172, 0.2);
  --border: rgba(64, 111, 161, 0.38);
  --card-border: rgba(64, 111, 161, 0.48);
  --shadow: 0 22px 48px rgba(54, 96, 145, 0.16);
  --glow: 0 0 0 1px rgba(98, 165, 240, 0.09), 0 0 18px rgba(98, 165, 240, 0.06), 0 0 40px rgba(34, 200, 175, 0.04);
}

:root[data-theme="light"].law-support-style-page :is(
  .panel,
  .card,
  .tile,
  .box,
  .section-card,
  .dashboard-card,
  .settings-section,
  .option,
  .support-panel,
  .points-rules-card,
  .points-rules-table-wrap,
  .note-modal-card,
  .badge-catalog-card,
  .badge-item-card,
  .event-row,
  .table-wrap,
  .citation-table-wrap
) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 247, 255, 0.94));
  border-color: rgba(64, 111, 161, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.72), 0 16px 36px rgba(54, 96, 145, 0.12);
}

:root[data-theme="light"].law-support-style-page :is(.settings-section, .support-panel) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 255, 0.96));
  border-color: rgba(64, 111, 161, 0.3);
}

:root[data-theme="light"].law-support-style-page .option {
  background: linear-gradient(180deg, rgba(253, 255, 255, 0.96), rgba(239, 248, 255, 0.94));
  border-color: rgba(64, 111, 161, 0.22);
}

:root[data-theme="light"].law-support-style-page :is(.support-panel .status, .section-copy, .tiny) {
  color: rgba(38, 67, 98, 0.88);
}

:is(body.law-dashboard-shell-page, body.law-dashboard-rail-page) {
  min-height: 100dvh;
  --dashboard-frame-height: calc(100dvh - var(--dashboard-shell-top, 18px) - var(--dashboard-shell-bottom, 20px));
}

body.law-dashboard-rail-page {
  --dashboard-shell-max-width: 1500px;
  padding:
    var(--dashboard-main-padding, 12px)
    calc(var(--dashboard-main-padding, 12px) + var(--dashboard-rail-clearance, 56px))
    var(--dashboard-main-padding, 12px)
    var(--dashboard-main-padding, 12px);
  overflow-x: hidden;
  overflow-y: auto;
}

body.law-dashboard-shell-page.sidebar-collapsed {
  --dashboard-sidebar-width: 70px;
  --dashboard-sidebar-padding: var(--space-3) var(--space-3);
  --dashboard-sidebar-gap: var(--space-3);
}

body:not(.dashboard-ready).law-dashboard-shell-page .dashboard-shell-root {
  opacity: 0;
  pointer-events: none;
}

body.dashboard-ready.law-dashboard-shell-page .dashboard-shell-root {
  opacity: 1;
  transition: opacity 120ms ease;
}

body.law-dashboard-shell-page a {
  color: inherit;
}

body.law-dashboard-shell-page h1,
body.law-dashboard-shell-page h2,
body.law-dashboard-shell-page h3,
body.law-dashboard-shell-page p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Section: Site title treatment */
:is(.site-name, .law-site-title) {
  display: inline-block;
  position: relative;
  padding-bottom: 0.12em;
  color: #fff2bf;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  :is(.site-name, .law-site-title) {
    color: transparent;
    background: linear-gradient(180deg, #fffbe9 0%, #ffe08d 42%, #8e3aee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(24, 12, 48, 0.42), 0 0 10px rgba(255,248,216,0.48), 0 0 20px rgba(243,201,105,0.18), 0 0 30px rgba(167,120,255,0.14);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
  }
}

:root[data-theme="light"] :is(.site-name, .law-site-title) {
  color: #2c154b;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  :root[data-theme="light"] :is(.site-name, .law-site-title) {
    background-image: linear-gradient(180deg, #2a0f4d 0%, #56309a 46%, #7b4bd1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 9px rgba(122, 83, 201, 0.34),
      0 0 18px rgba(153, 104, 230, 0.22),
      0 0 28px rgba(180, 128, 255, 0.18);
    filter: drop-shadow(0 8px 14px rgba(76, 44, 128, 0.24));
  }
}

:is(.site-name, .law-site-title)::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 92%;
  bottom: -0.14em;
  height: 0.14em;
  border-radius: 999px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 224, 141, 0.62), transparent);
  opacity: 0.72;
}

:root[data-theme="light"] :is(.site-name, .law-site-title)::after {
  background: linear-gradient(90deg, transparent, rgba(138, 95, 233, 0.64), transparent);
  opacity: 0.88;
}

/* Section: Dashboard hero shell */
.dashboard-hero-shell {
  padding: 8px 10px;
  margin-block-end: 0;
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  border: 1px solid rgba(243, 201, 105, 0.18);
  border-bottom: 1px solid rgba(243, 201, 105, 0.18);
  background: linear-gradient(135deg, rgba(55, 35, 105, 0.96), rgba(38, 24, 78, 0.94));
  box-shadow: 0 12px 24px rgba(5, 3, 18, 0.28);
  backdrop-filter: blur(12px) saturate(112%);
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 104px;
}

:root[data-theme="light"] .dashboard-hero-shell {
  border-color: rgba(132, 155, 213, 0.3);
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(235, 241, 255, 0.96) 38%, rgba(241, 235, 255, 0.95) 72%, rgba(247, 251, 255, 0.96));
  box-shadow: 0 10px 24px rgba(99, 118, 174, 0.12);
  backdrop-filter: blur(12px) saturate(112%);
}

.dashboard-section-hero {
  position: relative;
  z-index: 3;
  margin-top: 0;
}

/* Section: Dashboard shell layout */
.dashboard-shell-root {
  width: min(var(--dashboard-shell-max-width, 1820px), 100%);
  max-width: calc(100dvw - (var(--dashboard-shell-inline, 18px) * 2));
  margin: 0 auto;
  padding-block: var(--dashboard-shell-top, 18px) var(--dashboard-shell-bottom, 20px);
  height: auto;
  max-height: none;
  min-height: 100dvh;
  display: block;
  overflow: visible;
}

.dashboard-sidebar {
  position: fixed;
  top: var(--dashboard-shell-top, 18px);
  left: max(var(--dashboard-shell-inline, 18px), calc((100dvw - min(var(--dashboard-shell-max-width, 1820px), calc(100dvw - (var(--dashboard-shell-inline, 18px) * 2)))) / 2));
  z-index: var(--dashboard-z-sidebar);
  padding: var(--dashboard-sidebar-padding, 8px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--dashboard-sidebar-gap, 8px);
  min-width: 0;
  width: var(--dashboard-sidebar-width, 320px);
  height: var(--dashboard-frame-height);
  max-height: var(--dashboard-frame-height);
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 1px solid rgba(176, 154, 226, 0.34);
  border-radius: var(--panel-radius);
  background: rgba(41, 24, 79, 0.909);
  box-shadow: 0 10px 24px rgba(22, 14, 42, 0.26);
  backdrop-filter: blur(20px);
}

.dashboard-sidebar::-webkit-scrollbar {
  display: none;
}

:root[data-theme="light"] .dashboard-sidebar {
  border-color: rgba(132, 155, 213, 0.36);
  background: linear-gradient(180deg, rgba(236, 244, 255, 0.96), rgba(231, 236, 255, 0.95) 52%, rgba(243, 238, 255, 0.95));
  box-shadow: 0 10px 24px rgba(99, 118, 174, 0.13);
}

.dashboard-main {
  display: grid;
  gap: var(--space-5, 12px);
  min-width: 0;
  min-height: var(--dashboard-frame-height);
  height: var(--dashboard-frame-height);
  max-height: var(--dashboard-frame-height);
  align-content: start;
  overflow-x: visible;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding:
    0
    var(--dashboard-main-padding, 12px)
    var(--space-1, 2px);
  margin-left: calc(var(--dashboard-sidebar-width, 320px) + var(--dashboard-shell-gap, 8px));
  width: calc(100% - var(--dashboard-sidebar-width, 320px) - var(--dashboard-shell-gap, 8px));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding-right: calc(var(--dashboard-main-padding, 12px) + var(--dashboard-rail-clearance, 56px));
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dashboard-main::-webkit-scrollbar {
  display: none;
}

.dashboard-main.has-subview {
  height: var(--dashboard-frame-height);
  max-height: var(--dashboard-frame-height);
  overflow-y: auto;
  overflow-x: visible;
  align-content: start;
  gap: 24px;
}

.dashboard-main.has-subview.is-study-cards-surface {
  gap: 0;
  overflow: hidden;
  --dashboard-study-surface-height: calc(var(--dashboard-frame-height) - (var(--dashboard-main-padding, 12px) * 2));
}

.dashboard-main.is-study-cards-surface .dashboard-section-hero {
  display: none;
}

.dashboard-main.has-subview.is-study-cards-surface .dashboard-subview-native-host {
  padding-top: 0;
}

.dashboard-main.has-subview.is-study-cards-surface .dashboard-subview-panel {
  border-color: transparent;
  box-shadow: none;
}

.dashboard-main.has-subview.is-study-cards-surface .dashboard-subview-panel,
.dashboard-main.has-subview.is-study-cards-surface .dashboard-subview-native-host {
  min-height: 0;
  height: var(--dashboard-study-surface-height);
  max-height: var(--dashboard-study-surface-height);
  overflow: hidden;
}

body.law-dashboard-shell-page.study-subview-immersive .dashboard-sidebar {
  display: none;
}

body.law-dashboard-shell-page.study-subview-immersive .dashboard-shell-root {
  max-width: calc(100dvw - (var(--dashboard-shell-inline, 18px) * 2));
}

body.law-dashboard-shell-page.study-subview-immersive .dashboard-main {
  margin-left: 0;
  width: 100%;
  padding-left: 0;
  padding-right: var(--dashboard-rail-clearance, 56px);
}

.dashboard-main.has-subview.is-page-studio {
  padding-right: var(--dashboard-main-padding, 12px);
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.dashboard-main.has-subview .dashboard-subview-panel {
  min-height: 0;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 1;
}

.dashboard-main.has-subview .dashboard-subview-panel.has-page-modal {
  position: fixed;
  top: var(--dashboard-shell-top, 18px);
  left: max(var(--dashboard-shell-inline, 18px), calc((100dvw - min(var(--dashboard-shell-max-width, 1820px), calc(100dvw - (var(--dashboard-shell-inline, 18px) * 2)))) / 2));
  right: max(var(--dashboard-shell-inline, 18px), calc((100dvw - min(var(--dashboard-shell-max-width, 1820px), calc(100dvw - (var(--dashboard-shell-inline, 18px) * 2)))) / 2));
  bottom: var(--dashboard-shell-bottom, 20px);
  z-index: var(--dashboard-z-subview-modal-shell);
  min-height: 0;
  height: auto;
  border: 0;
  border-radius: var(--panel-radius);
  box-shadow: none;
  background: transparent;
}

.dashboard-main.has-subview .dashboard-subview-native-host {
  min-height: 0;
  height: auto;
  margin: 0;
  padding: var(--dashboard-main-padding, 12px);
  box-sizing: border-box;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.dashboard-main.has-subview .dashboard-subview-panel.has-page-modal .dashboard-subview-native-host {
  height: 100%;
  min-height: 0;
  padding: 0;
}

.dashboard-main.has-subview.is-page-studio .dashboard-subview-native-host {
  padding: 0;
  background: transparent;
}

.dashboard-subview-panel {
  min-width: 0;
  min-height: 320px;
  height: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 8px);
  overflow: visible;
  padding: 0;
  border-radius: 0 0 20px 20px;
  background: transparent;
  border: 1px solid rgba(176, 154, 226, 0.22);
  box-shadow: 0 0 0 1px rgba(176, 154, 226, 0.08), 0 0 24px rgba(141, 103, 216, 0.16);
  backdrop-filter: none;
}

:root[data-theme="light"] .dashboard-subview-panel {
  border-color: rgba(171, 193, 223, 0.32);
  box-shadow: 0 0 0 1px rgba(171, 193, 223, 0.16), 0 0 28px rgba(198, 173, 227, 0.22);
}

.dashboard-subview-panel.immersive-study {
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.dashboard-subview-panel.immersive-study .card-head {
  display: none;
}

.dashboard-subview-panel.immersive-study .dashboard-subview-native-host {
  min-height: 100%;
  height: auto;
  border-radius: 0;
  overflow: auto;
}

.dashboard-subview-native-host {
  width: 100%;
}

.dashboard-overview-section {
  display: grid;
  gap: inherit;
  padding-top: 24px;
}

.dashboard-overview-grid {
  align-items: stretch;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-overview-card {
  align-self: stretch;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-4, 10px);
  gap: var(--space-5, 12px);
  align-content: start;
}

.dashboard-overview-grid > .dashboard-overview-card:nth-child(odd) {
  grid-column: span 3;
}

.dashboard-overview-grid > .dashboard-overview-card:nth-child(even) {
  grid-column: span 2;
}

.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5, 12px);
  flex-wrap: wrap;
}

.dashboard-card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.dashboard-chart-head-actions {
  display: grid;
  gap: var(--space-3, 8px);
  justify-items: end;
  min-width: 0;
}

.dashboard-chart-head-actions .legend {
  justify-content: flex-end;
}

.dashboard-timeseries-plot {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: var(--space-5, 12px);
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

.dashboard-summary-grid {
  display: grid;
  gap: var(--space-5, 12px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  align-self: stretch;
}

.dashboard-overview-card .deck-list {
  flex: 1 1 auto;
  min-height: 0;
}

.dashboard-record-row {
  padding: var(--space-4, 10px);
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
  display: grid;
  gap: var(--space-5, 12px);
  min-width: 0;
}

.dashboard-record-meta {
  display: flex;
  gap: var(--space-3, 8px);
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-progress-row {
  display: grid;
  gap: var(--space-3, 8px);
}

.dashboard-card-surface {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

/* Section: Dashboard page chrome */
body.law-dashboard-shell-page .brand {
  display: grid;
  gap: var(--space-3, 8px);
}

body.law-dashboard-shell-page .brand-mark {
  width: 50px;
  height: 50px;
  padding: var(--space-2, 4px);
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 700;
  color: #180f0b;
  background: linear-gradient(135deg, var(--accent), #ffe8a8);
  border: 1px solid color-mix(in srgb, #8d67d8 62%, #d7c5f2);
  box-shadow:
    0 0 0 0.75px color-mix(in srgb, #efc764 72%, #f8e4a8),
    0 0 10px color-mix(in srgb, #efc764 26%, transparent),
    0 10px 24px rgba(244, 202, 107, 0.22);
}

body.law-dashboard-shell-page .brand-mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

body.law-dashboard-shell-page .brand h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.01em;
}

body.law-dashboard-shell-page .sidebar-copy {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

body.law-dashboard-shell-page .sidebar-scroll,
body.law-dashboard-shell-page .nav-list,
body.law-dashboard-shell-page .side-actions {
  display: grid;
  gap: var(--space-5, 12px);
  min-width: 0;
}

body.law-dashboard-shell-page .side-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3, 8px);
}

body.law-dashboard-shell-page .side-actions > * {
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
}

body.law-dashboard-shell-page .sidebar-scroll {
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: auto;
  padding-right: 0;
  padding-bottom: var(--space-3, 8px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.law-dashboard-shell-page .sidebar-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body.law-dashboard-shell-page .nav-list {
  align-content: start;
}

body.law-dashboard-shell-page .nav-group {
  display: grid;
  gap: var(--space-3, 8px);
  padding: var(--space-3, 8px);
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background: linear-gradient(180deg, rgba(244, 202, 107, 0.08), rgba(141, 103, 216, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.law-dashboard-shell-page .nav-group-overview {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.law-dashboard-shell-page .nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 8px);
  margin: 0 var(--space-2, 4px) var(--space-2, 4px);
  color: color-mix(in srgb, var(--accent) 58%, var(--text));
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.law-dashboard-shell-page .nav-group-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

body.law-dashboard-shell-page .nav-link,
body.law-dashboard-shell-page .admin-subnav-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3, 8px);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}

body.law-dashboard-shell-page .nav-link {
  padding: var(--space-5, 12px);
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

body.law-dashboard-shell-page .admin-subnav-link {
  font-size: 0.92rem;
  padding: var(--space-3, 8px) var(--space-5, 12px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

body.law-dashboard-shell-page .nav-link > span:nth-of-type(2),
body.law-dashboard-shell-page .admin-subnav-link > span:nth-of-type(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.law-dashboard-shell-page .nav-link span:last-child,
body.law-dashboard-shell-page .admin-subnav-link span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

body.law-dashboard-shell-page .nav-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--accent) 74%, var(--text));
  flex-shrink: 0;
}

body.law-dashboard-shell-page .nav-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.law-dashboard-shell-page .nav-icon i {
  width: 22px;
  min-width: 22px;
  font-size: 1.08rem;
  line-height: 1;
  text-align: center;
}

:root[data-theme="light"] body.law-dashboard-shell-page .nav-icon {
  color: #7062e7;
}

body.law-dashboard-shell-page .nav-link.is-active {
  background: linear-gradient(135deg, rgba(244, 202, 107, 0.18), rgba(126, 240, 207, 0.08));
  border-color: color-mix(in srgb, var(--accent) 80%, #fff2c8);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

body.law-dashboard-shell-page .admin-subnav-link:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

body.law-dashboard-shell-page .admin-subnav-link.is-active {
  color: var(--text);
  border-color: rgba(244, 202, 107, 0.42);
  background: rgba(244, 202, 107, 0.12);
  pointer-events: none;
}

body.law-dashboard-shell-page .nav-link.is-disabled,
body.law-dashboard-shell-page .is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

body.law-dashboard-shell-page .sidebar-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5, 12px);
}

body.law-dashboard-shell-page .sidebar-collapse-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: 0.02em;
}

body.law-dashboard-shell-page.sidebar-collapsed .dashboard-sidebar {
  align-content: start;
}

body.law-dashboard-shell-page.sidebar-collapsed .brand {
  gap: var(--space-3, 8px);
}

body.law-dashboard-shell-page.sidebar-collapsed .brand :is(h1, .sidebar-copy),
body.law-dashboard-shell-page.sidebar-collapsed .nav-link span,
body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-link span,
body.law-dashboard-shell-page.sidebar-collapsed .nav-group-title,
body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-title {
  display: none;
}

body.law-dashboard-shell-page.sidebar-collapsed .sidebar-toggle-row {
  flex-direction: column-reverse;
  justify-content: center;
  align-items: center;
}

body.law-dashboard-shell-page.sidebar-collapsed .brand-mark {
  margin-inline: auto;
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-link,
body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-link {
  grid-template-columns: auto;
  justify-items: center;
  padding-inline: 0;
  min-height: 42px;
  gap: 0;
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-link {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-link.is-active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border));
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-list {
  gap: var(--space-3, 8px);
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-group {
  position: relative;
  padding: var(--space-3, 8px);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  background: linear-gradient(180deg, rgba(244, 202, 107, 0.07), rgba(141, 103, 216, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-group-overview,
body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.law-dashboard-shell-page.sidebar-collapsed .nav-link .nav-icon,
body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-link .nav-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
}

body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav {
  margin-left: 0;
  padding-left: 0;
  padding-right: 0;
  border-left: none;
}

body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-link {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--accent-2) 45%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
}

body.law-dashboard-shell-page.sidebar-collapsed .admin-subnav-link.is-active {
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent-2) 70%, var(--border));
  background: color-mix(in srgb, var(--accent-2) 18%, transparent);
}

body.law-dashboard-shell-page.sidebar-collapsed .sidebar-scroll {
  padding-right: 0;
}

body.law-dashboard-shell-page.sidebar-collapsed .sidebar-footer {
  justify-items: center;
  padding-inline: var(--space-3, 8px);
}

body.law-dashboard-shell-page.sidebar-collapsed .side-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

body.law-dashboard-shell-page.sidebar-collapsed #sidebar-home-btn,
body.law-dashboard-shell-page.sidebar-collapsed #logout-btn {
  font-size: 0;
  padding-inline: var(--space-3, 8px);
}

body.law-dashboard-shell-page.sidebar-collapsed #sidebar-home-btn::before {
  content: "⌂";
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
}

body.law-dashboard-shell-page.sidebar-collapsed #logout-btn::before {
  content: "⎋";
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
}

body.law-dashboard-shell-page .admin-subnav {
  display: grid;
  gap: var(--space-3, 8px);
  margin-top: var(--space-3, 8px);
  margin-left: 0;
  padding: var(--space-5, 12px);
  border: 1px solid color-mix(in srgb, var(--accent-2) 28%, var(--border));
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(126, 240, 207, 0.08), rgba(118, 192, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.law-dashboard-shell-page .admin-subnav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3, 8px);
  margin: 0 0 var(--space-2, 4px);
  color: color-mix(in srgb, var(--accent-2) 70%, var(--text));
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.law-dashboard-shell-page .admin-subnav-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: color-mix(in srgb, var(--accent-2) 24%, transparent);
}

body.law-dashboard-shell-page .sidebar-footer {
  display: grid;
  gap: var(--space-3, 8px);
  padding: var(--space-3, 8px) var(--space-5, 12px);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.law-dashboard-shell-page .ui-pill.ui-pill--metric {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3, 8px);
  padding: var(--space-3, 8px) var(--space-5, 12px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.84rem;
}

body.law-dashboard-shell-page .ui-pill.ui-pill--metric strong {
  color: var(--text);
}

body.law-dashboard-shell-page .chart-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 10px);
  height: 100%;
  min-height: 0;
}

body.law-dashboard-shell-page .timeseries-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: var(--space-3, 8px) 0;
  height: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  user-select: none;
}

body.law-dashboard-shell-page .timeseries-y-axis span {
  display: block;
  min-height: 1em;
  text-align: right;
}

body.law-dashboard-shell-page .bar-chart {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  align-items: end;
  gap: var(--space-3, 8px);
  height: 100%;
  min-height: clamp(180px, 30vh, 250px);
  padding-top: var(--space-3, 8px);
}

body.law-dashboard-shell-page .bar-axis {
  position: relative;
  flex: 0 0 auto;
  height: 24px;
  margin-top: 0;
}

body.law-dashboard-shell-page .bar-axis-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1;
  pointer-events: none;
}

body.law-dashboard-shell-page .bar-axis-label.is-start {
  transform: none;
}

body.law-dashboard-shell-page .bar-axis-label.is-end {
  transform: translateX(-100%);
}

body.law-dashboard-shell-page .bar-col {
  display: grid;
  gap: var(--space-3, 8px);
  justify-items: center;
  min-width: 0;
}

body.law-dashboard-shell-page .bar-stack {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 0;
  height: 100%;
}

body.law-dashboard-shell-page .bar {
  width: 100%;
  max-width: 18px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--accent), #ffedb9);
  box-shadow: 0 12px 24px rgba(244, 202, 107, 0.18);
  min-height: 4px;
}

body.law-dashboard-shell-page .bar.zero {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

body.law-dashboard-shell-page .legend {
  display: flex;
  gap: var(--space-5, 12px);
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

body.law-dashboard-shell-page .legend span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3, 8px);
}

body.law-dashboard-shell-page .swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}

body.law-dashboard-shell-page .swatch.alt {
  background: var(--accent-2);
}

body.law-dashboard-shell-page .summary-cell {
  position: relative;
  border-radius: 16px;
  padding: var(--space-5, 12px);
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

body.law-dashboard-shell-page .summary-cell strong {
  display: block;
  font-size: 1.35rem;
  margin-top: var(--space-3, 8px);
}

body.law-dashboard-shell-page .summary-info {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

body.law-dashboard-shell-page .summary-info summary {
  list-style: none;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

body.law-dashboard-shell-page .summary-info summary::-webkit-details-marker {
  display: none;
}

body.law-dashboard-shell-page .summary-info[open] summary {
  color: var(--text);
  border-color: rgba(244, 202, 107, 0.5);
  background: rgba(244, 202, 107, 0.14);
}

body.law-dashboard-shell-page .summary-info-panel {
  position: absolute;
  top: auto;
  bottom: calc(100% + 6px);
  right: 0;
  width: min(260px, 70vw);
  max-height: min(260px, calc(100vh - 160px));
  overflow: auto;
  padding: var(--space-3, 8px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(12, 16, 31, 0.96);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

body.law-dashboard-shell-page .deck-list,
body.law-dashboard-shell-page .report-list {
  display: grid;
  gap: var(--space-5, 12px);
}

body.law-dashboard-shell-page .overview-report-card .report-list {
  max-height: min(46vh, 520px);
  overflow: auto;
  padding-right: 0;
  scrollbar-gutter: auto;
}

body.law-dashboard-shell-page .deck-list {
  max-height: min(760px, calc(100vh - 300px));
  overflow-y: auto;
  padding-right: 0;
  scrollbar-gutter: auto;
  overscroll-behavior: auto;
}

body.law-dashboard-shell-page .progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

body.law-dashboard-shell-page .progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

body.law-dashboard-shell-page .report-status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3, 8px);
  padding: var(--space-3, 8px);
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: fit-content;
}

body.law-dashboard-shell-page .status-open {
  color: var(--warn);
  background: rgba(255, 217, 125, 0.09);
}

body.law-dashboard-shell-page .status-in_review {
  color: #9ec8ff;
  background: rgba(158, 200, 255, 0.1);
}

body.law-dashboard-shell-page .status-resolved {
  color: var(--ok);
  background: rgba(149, 244, 205, 0.11);
}

body.law-dashboard-shell-page .status-dismissed {
  color: var(--bad);
  background: rgba(255, 147, 180, 0.11);
}

body.law-dashboard-shell-page .report-note,
body.law-dashboard-shell-page .admin-note {
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

body.law-dashboard-shell-page .admin-note {
  color: var(--accent-2);
  font-size: 0.92rem;
}

body.law-dashboard-shell-page .empty {
  padding: var(--space-5, 12px);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--muted);
  line-height: 1.6;
}

body.law-dashboard-shell-page .msg {
  min-height: 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

body.law-dashboard-shell-page .msg.error {
  color: var(--bad);
}

body.law-dashboard-shell-page .msg.success {
  color: var(--ok);
}

body.law-dashboard-shell-page .msg.global-toast {
  position: fixed;
  top: 18px;
  left: 24px;
  right: 24px;
  margin: 0 auto;
  z-index: 10020;
  min-height: 0;
  width: fit-content;
  max-width: min(560px, calc(100vw - 48px));
  padding: var(--space-5, 12px) var(--space-4, 10px);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 17, 43, 0.96);
  box-shadow: 0 22px 44px rgba(8, 6, 16, 0.34);
  backdrop-filter: blur(14px);
  line-height: 1.45;
  word-break: break-word;
  pointer-events: none;
}

body.law-dashboard-shell-page .msg.global-toast.error {
  color: #ffd2d2;
  border-color: rgba(255, 120, 120, 0.4);
  background: rgba(84, 20, 34, 0.94);
}

body.law-dashboard-shell-page .msg.global-toast.success {
  color: #dff8e8;
  border-color: rgba(90, 210, 140, 0.28);
  background: rgba(18, 58, 39, 0.94);
}

body.law-dashboard-shell-page .msg.global-toast:empty {
  display: none;
}

/* Section: Shared floating rail */
.floating-admin-link,
#site-theme-toggle,
.floating-notifications-link,
.floating-share-link,
.floating-open-deck {
  width: 42px;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

:root :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-admin-link, .floating-open-deck) {
  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

:root :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-admin-link, .floating-open-deck) :is(i, svg) {
  color: currentColor;
  stroke: currentColor;
  filter: drop-shadow(0 0 10px currentColor);
}

:root[data-theme="dark"] :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-admin-link, .floating-open-deck) {
  color: #ffe45c !important;
  box-shadow:
    0 0 0 1px rgba(255, 228, 92, 0.62),
    0 0 20px rgba(255, 228, 92, 0.62),
    0 0 38px rgba(255, 228, 92, 0.4),
    0 0 58px rgba(255, 201, 92, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

:root[data-theme="light"] :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-admin-link, .floating-open-deck) {
  background: linear-gradient(135deg, rgba(250, 252, 255, 0.98), rgba(234, 239, 255, 0.95) 70%, rgba(244, 238, 255, 0.92)) !important;
  border-color: rgba(139, 116, 247, 0.46) !important;
  color: #7463f4 !important;
  box-shadow:
    0 0 0 1px rgba(139, 116, 247, 0.32),
    0 0 20px rgba(139, 116, 247, 0.28),
    0 0 38px rgba(107, 188, 255, 0.24),
    0 0 58px rgba(139, 116, 247, 0.14),
    0 10px 24px rgba(70, 78, 140, 0.16) !important;
}

:root[data-theme="light"] :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-admin-link, .floating-open-deck) :is(i, svg) {
  filter: drop-shadow(0 0 13px rgba(116, 99, 244, 0.68));
}

html.law-embedded-surface :is(#site-theme-toggle, .floating-notifications-link, .floating-share-link, .floating-open-deck, .floating-admin-link) {
  display: none !important;
}

:is(.floating-admin-link, .floating-notifications-link, .floating-share-link, #site-theme-toggle, body.law-dashboard-shell-page .floating-open-deck) {
  position: fixed;
  right: max(
    10px,
    calc(
      max(
        var(--dashboard-main-padding, 12px),
        (100vw - min(var(--dashboard-shell-max-width, 1820px), calc(100vw - (var(--dashboard-main-padding, 12px) * 2)))) / 2
      ) + 10px
    )
  );
  z-index: 8999;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(126, 240, 207, 0.1));
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

:root:not(.law-theme-ready) :is(.floating-admin-link, .floating-open-deck, .floating-notifications-link, .floating-share-link, #site-theme-toggle) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

:root.law-theme-ready :is(.floating-admin-link, .floating-open-deck, .floating-notifications-link, .floating-share-link, #site-theme-toggle) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

:is(.floating-admin-link, .floating-open-deck, .floating-notifications-link, .floating-share-link, #site-theme-toggle):hover {
  transform: translateX(-1px);
}

.floating-admin-link {
  top: calc(50% + 124px);
  left: auto !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  flex: 0 0 42px !important;
  text-decoration: none;
  font: 700 16px/1 var(--font-body);
  cursor: pointer;
}

.floating-admin-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

#floating-admin-link {
  left: auto !important;
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  flex: 0 0 42px !important;
}

/* Section: Dashboard floating rail */
body.law-dashboard-shell-page .floating-open-deck {
  top: calc(50% + 66px);
  font: 700 18px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.floating-share-link {
  top: calc(50% - 108px);
  font: 700 16px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
}

#site-theme-toggle {
  top: calc(50% - 50px);
  z-index: 9000;
  font: 700 18px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.floating-notifications-link {
  top: calc(50% + 8px);
  font: 700 16px/1 var(--font-body);
  letter-spacing: 0.01em;
  cursor: pointer;
}

.floating-notifications-link.has-unread {
  color: var(--accent, #f4ca6b) !important;
  border-color: rgba(244, 202, 107, 0.82) !important;
  box-shadow:
    0 0 0 1px rgba(244, 202, 107, 0.44),
    0 0 22px rgba(244, 202, 107, 0.52),
    0 10px 24px rgba(0, 0, 0, 0.24) !important;
}

.floating-notifications-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #ff4f8f;
  color: #fff;
  font: 800 0.66rem/16px var(--font-body);
  text-align: center;
}

.dashboard-notification-popup {
  position: fixed;
  right: max(
    62px,
    calc(
      max(
        var(--dashboard-main-padding, 12px),
        (100vw - min(var(--dashboard-shell-max-width, 1820px), calc(100vw - (var(--dashboard-main-padding, 12px) * 2)))) / 2
      ) + 62px
    )
  );
  top: calc(50% - 8px);
  z-index: 9010;
  width: min(430px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 56px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(38, 22, 72, 0.98), rgba(22, 12, 43, 0.99));
  box-shadow:
    0 28px 72px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(243, 201, 105, 0.14),
    0 0 34px rgba(159, 120, 255, 0.22);
  padding: 12px;
}

.dashboard-notification-popup[hidden] {
  display: none;
}

.dashboard-notification-popup-head,
.dashboard-notification-popup-actions,
.dashboard-notification-popup-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-notification-popup-head {
  cursor: grab;
  user-select: none;
}

.dashboard-notification-popup.is-dragging .dashboard-notification-popup-head {
  cursor: grabbing;
}

.dashboard-notification-popup-body {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
  max-height: min(520px, calc(100vh - 180px));
}

.dashboard-notification-popup-item {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
}

.dashboard-notification-popup-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-notification-action-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(243, 201, 105, 0.42);
  border-radius: 999px;
  background: rgba(243, 201, 105, 0.12);
  color: var(--accent, #f3c969);
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.dashboard-notification-popup-buttons {
  justify-content: flex-start;
}

.dashboard-notification-popup-buttons button,
.dashboard-notification-popup-actions a {
  min-height: 34px;
  border-radius: 9px;
  padding: 0 12px;
}

:root[data-theme="light"] .dashboard-notification-popup {
  border-color: rgba(139, 116, 247, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 249, 255, 0.99));
  box-shadow:
    0 30px 80px rgba(70, 78, 140, 0.28),
    0 0 0 1px rgba(139, 116, 247, 0.12),
    0 0 36px rgba(139, 116, 247, 0.18);
}

:root[data-theme="light"] .dashboard-notification-popup-item {
  border-color: rgba(139, 116, 247, 0.18);
  background: rgba(94, 66, 152, 0.05);
}

@media (max-width: 900px) {
  .floating-notifications-link {
    top: 132px;
    bottom: auto;
  }
  body.law-dashboard-shell-page .floating-open-deck {
    top: 190px;
    bottom: auto;
  }
  .floating-admin-link {
    top: 248px;
    bottom: auto;
  }
  .dashboard-notification-popup {
    top: 132px;
    right: 64px;
  }
}

body.law-dashboard-shell-page .hidden {
  display: none !important;
}

body.law-dashboard-shell-page .sidebar-footer .tiny,
body.law-dashboard-shell-page .tiny {
  color: var(--muted);
  font-size: 0.85rem;
}

body.law-dashboard-shell-page .subview-native-host {
  height: auto;
  min-height: 320px;
  max-height: none;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  display: block;
  overflow: visible;
  overscroll-behavior: auto;
}

/* Section: Dashboard auth modal */
body.law-dashboard-shell-page .auth-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

body.law-dashboard-shell-page .auth-modal.is-open {
  display: flex;
}

body.law-dashboard-shell-page .auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 20, 0.72);
  backdrop-filter: blur(10px);
}

body.law-dashboard-shell-page .auth-modal-card {
  position: relative;
  width: min(520px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(36, 16, 70, 0.98), rgba(20, 10, 39, 0.98));
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.42);
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
  z-index: 1;
}

body.law-dashboard-shell-page .auth-modal-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: flex-start;
}

body.law-dashboard-shell-page .auth-modal-title {
  display: grid;
  gap: var(--space-3);
}

body.law-dashboard-shell-page .auth-modal-title h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.15;
}

body.law-dashboard-shell-page .auth-modal-copy {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

body.law-dashboard-shell-page .auth-modal-form {
  display: grid;
  gap: var(--space-5);
}

body.law-dashboard-shell-page .auth-modal-form label {
  display: grid;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 0.86rem;
}

body.law-dashboard-shell-page .auth-modal-form input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  padding: var(--space-5) var(--space-5);
  font: inherit;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

body.law-dashboard-shell-page .auth-modal-form .password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

body.law-dashboard-shell-page .auth-modal-form .password-field input[type="password"]::-ms-reveal,
body.law-dashboard-shell-page .auth-modal-form .password-field input[type="password"]::-ms-clear,
body.law-dashboard-shell-page .auth-modal-form .password-field input[type="password"]::-webkit-credentials-auto-fill-button,
body.law-dashboard-shell-page .auth-modal-form .password-field input[type="password"]::-webkit-contacts-auto-fill-button,
body.law-dashboard-shell-page .auth-modal-form .password-field input[type="password"]::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.law-dashboard-shell-page .auth-modal-form .password-field input {
  grid-column: 1;
  min-width: 0;
}

body.law-dashboard-shell-page .auth-modal-form .password-toggle {
  all: unset;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  transition: color 140ms ease, transform 140ms ease;
  appearance: none;
  -webkit-appearance: none;
}

body.law-dashboard-shell-page .auth-modal-form .password-toggle:hover,
body.law-dashboard-shell-page .auth-modal-form .password-toggle:focus-visible {
  outline: none;
  color: var(--text);
  transform: translateY(-1px);
}

body.law-dashboard-shell-page .auth-modal-form .password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

body.law-dashboard-shell-page .auth-modal-form .password-toggle .icon-eye-off,
body.law-dashboard-shell-page .auth-modal-form .password-toggle.is-visible-password .icon-eye {
  display: none;
}

body.law-dashboard-shell-page .auth-modal-form .password-toggle.is-visible-password .icon-eye-off {
  display: block;
}

body.law-dashboard-shell-page .auth-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

body.law-dashboard-shell-page .auth-modal-actions button {
  min-height: 42px;
  padding-inline: var(--space-4);
}

:root[data-theme="light"] body.law-dashboard-shell-page .auth-modal-backdrop {
  background: rgba(47, 62, 114, 0.18);
}

:root[data-theme="light"] body.law-dashboard-shell-page .auth-modal-card {
  border-color: rgba(132, 155, 213, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 243, 255, 0.97));
  box-shadow: 0 24px 56px rgba(99, 118, 174, 0.16);
}

:root[data-theme="light"] body.law-dashboard-shell-page .auth-modal-form input {
  border-color: rgba(132, 155, 213, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

:root[data-theme="light"] body.law-dashboard-shell-page .auth-modal-form input::placeholder {
  color: rgba(99, 111, 144, 0.82);
}

:root[data-theme="dark"] body.law-dashboard-shell-page .auth-modal-form input {
  background: rgba(31, 23, 54, 0.96);
  border-color: rgba(199, 182, 238, 0.2);
}

:root[data-theme="dark"] body.law-dashboard-shell-page .auth-modal-form input::placeholder {
  color: rgba(221, 232, 255, 0.72);
  -webkit-text-fill-color: rgba(221, 232, 255, 0.72);
  opacity: 1;
}

body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill,
body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill:hover,
body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text) !important;
  transition: background-color 9999s ease-out 0s;
  box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.96) inset !important;
}

:root[data-theme="dark"] body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill,
:root[data-theme="dark"] body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill:hover,
:root[data-theme="dark"] body.law-dashboard-shell-page .auth-modal-form input:-webkit-autofill:focus {
  box-shadow: 0 0 0 1000px rgba(31, 23, 54, 0.98) inset !important;
}

.dashboard-hero-shell.is-sticky {
  position: sticky;
  top: 0;
  z-index: var(--dashboard-z-hero);
}

.dashboard-hero-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.28rem;
  line-height: 1.12;
  letter-spacing: 0;
  max-width: none;
  font-weight: 700;
}

.dashboard-hero-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 20px 10px 4px 10px;
}

.dashboard-hero-icon {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(134, 215, 255, 0.28);
  background: linear-gradient(180deg, rgba(18, 32, 56, 0.9), rgba(22, 39, 68, 0.82));
  color: #98dcff;
  box-shadow: inset 0 1px 0 rgba(186, 229, 255, 0.12);
  line-height: 1;
}

:root[data-theme="light"] .dashboard-hero-icon {
  border-color: rgba(132, 155, 213, 0.3);
  background: rgba(248, 251, 255, 0.78);
  color: #7062e7;
}

.dashboard-hero-icon i {
  font-size: 0.9rem;
  color: currentColor;
  text-shadow: 0 0 16px rgba(134, 215, 255, 0.22);
}

.dashboard-hero-icon.is-avatar {
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-hero-icon.is-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.dashboard-hero-shell.is-profile {
  padding: 22px 28px 18px;
  background:
    radial-gradient(circle at top right, rgba(126, 240, 207, 0.1), transparent 32%),
    radial-gradient(circle at bottom left, rgba(243, 201, 105, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(68, 43, 128, 0.97), rgba(36, 22, 74, 0.95) 54%, rgba(58, 30, 92, 0.97));
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile {
  background:
    radial-gradient(circle at top right, rgba(139, 116, 247, 0.1), transparent 32%),
    radial-gradient(circle at bottom left, rgba(107, 188, 255, 0.1), transparent 30%),
    linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(232, 238, 255, 0.96) 50%, rgba(244, 238, 255, 0.96));
}

.dashboard-hero-shell.is-profile .dashboard-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.4vw, 3.45rem);
  margin-top: 2px;
  line-height: 0.94;
  font-weight: 600;
  padding-bottom: 0.12em;
  position: relative;
}

.dashboard-hero-shell.is-profile :is(.dashboard-hero-title, .dashboard-hero-meta-primary) {
  display: block;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #fff2bf;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .dashboard-hero-shell.is-profile :is(.dashboard-hero-title, .dashboard-hero-meta-primary) {
    color: transparent;
    background: linear-gradient(180deg, #fffbe9 0%, #ffe08d 42%, #cda1ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(24, 12, 48, 0.42), 0 0 10px rgba(255,248,216,0.48), 0 0 20px rgba(243,201,105,0.18), 0 0 30px rgba(167,120,255,0.14);
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-title {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
  }

  :root[data-theme="light"] .dashboard-hero-shell.is-profile :is(.dashboard-hero-title, .dashboard-hero-meta-primary) {
    background-image: linear-gradient(180deg, #17233f 0%, #6d5ee7 48%, #8b74f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 1px 0 rgba(255,255,255,0.9), 0 0 14px rgba(139,116,247,0.42), 0 0 34px rgba(107,188,255,0.26);
  }
}

.dashboard-hero-shell.is-profile .dashboard-hero-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.12em;
  height: 0.12em;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 141, 0.62), transparent);
  opacity: 0.72;
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile .dashboard-hero-title {
  color: #2c154b;
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile .dashboard-hero-title::after {
  background: linear-gradient(90deg, transparent, rgba(139, 116, 247, 0.46), transparent);
}

.dashboard-hero-heading {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.dashboard-hero-meta {
  min-width: 0;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.88rem;
  line-height: 1.28;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.dashboard-hero-meta-accent {
  color: var(--accent-2);
  font-weight: 700;
}

.dashboard-hero-shell.is-profile .dashboard-hero-meta-primary {
  margin-top: 0;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.dashboard-hero-shell.is-profile .dashboard-hero-meta {
  font-size: 1rem;
}

.dashboard-hero-shell.is-profile .dashboard-hero-meta-accent {
  display: block;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.dashboard-hero-shell.is-profile .dashboard-hero-section {
  display: none;
}

.dashboard-hero-shell.is-profile .dashboard-hero-heading {
  gap: 6px;
}

.dashboard-hero-shell.is-profile .dashboard-hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 999px;
  border-width: 1px;
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
  padding: 0;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(244, 202, 107, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dashboard-hero-shell.is-profile .dashboard-profile-avatar-chip {
  --avatar-size: 96px;
  box-shadow: 0 14px 32px rgba(244, 202, 107, 0.22);
}

.dashboard-hero-shell.is-profile .dashboard-profile-avatar-chip .avatar-chip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.dashboard-hero-shell.is-profile .dashboard-profile-avatar-chip .avatar-chip-fallback {
  font-size: 1.55rem;
  letter-spacing: 0.04em;
}

.dashboard-hero-shell.is-profile .dashboard-hero-top {
  align-items: center;
  gap: 14px 20px;
  padding: 2px 10px 0;
}

.dashboard-hero-shell.is-profile .dashboard-hero-identity {
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0;
}

.dashboard-hero-shell.is-profile .dashboard-hero-actions {
  align-items: flex-start;
  gap: 8px;
}

.dashboard-hero-shell.is-profile .dashboard-hero-control-btn {
  min-height: 40px;
  border-radius: 10px;
  padding-inline: 13px;
}

.dashboard-hero-shell.is-profile .dashboard-hero-action-btn.is-secondary {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: none;
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile .dashboard-hero-action-btn.is-secondary {
  background: rgba(139, 116, 247, 0.1);
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile .dashboard-hero-icon {
  border-color: rgba(139, 116, 247, 0.26);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 14px 28px rgba(99, 118, 174, 0.14), 0 0 0 1px rgba(139, 116, 247, 0.08);
}

:root[data-theme="light"] .dashboard-hero-shell.is-profile .dashboard-profile-avatar-chip {
  box-shadow: 0 14px 28px rgba(99, 118, 174, 0.14);
}

.dashboard-hero-section {
  color: color-mix(in srgb, var(--muted) 88%, var(--accent) 12%);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

/* Section: Dashboard hero layout + controls */
.dashboard-hero-top,
.dashboard-hero-actions,
.dashboard-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dashboard-hero-top {
  width: 100%;
  justify-content: space-between;
}

.dashboard-hero-identity {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-hero-actions {
  margin-left: auto;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.dashboard-hero-custom-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-hero-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-hero-action-btn i {
  font-size: 0.86rem;
}

.dashboard-hero-action-btn.is-primary {
  background: linear-gradient(135deg, rgba(255, 219, 131, 0.98), rgba(243, 201, 105, 0.96) 72%, rgba(215, 164, 52, 0.92));
  border-color: rgba(244, 202, 107, 0.42);
  color: #eef5ff;
  box-shadow: 0 10px 24px rgba(66, 113, 168, 0.2);
}

.dashboard-hero-action-btn.is-primary:hover,
.dashboard-hero-action-btn.is-primary:focus-visible {
  border-color: rgba(255, 227, 160, 0.58);
  filter: brightness(1.04) saturate(1.03);
}

:root[data-theme="light"] .dashboard-hero-action-btn.is-primary {
  background: linear-gradient(135deg, rgba(223, 241, 255, 0.98), rgba(207, 233, 255, 0.97) 64%, rgba(216, 251, 244, 0.95));
  border-color: rgba(142, 201, 243, 0.6);
  color: #17233f;
  box-shadow: 0 10px 22px rgba(115, 90, 165, 0.14);
}

.dashboard-hero-toggle {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #eef5ff;
  font-size: 0.78rem;
  line-height: 1.1;
  cursor: pointer;
}

:root[data-theme="light"] .dashboard-hero-toggle {
  border-color: rgba(132, 155, 213, 0.26);
  background: rgba(248, 251, 255, 0.74);
  color: #17233f;
}

.dashboard-hero-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dashboard-hero-toggle-track {
  width: 38px;
  height: 22px;
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(113, 101, 139, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.dashboard-hero-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(6, 4, 18, 0.24);
  transition: transform 140ms ease;
}

.dashboard-hero-toggle input:checked + .dashboard-hero-toggle-track {
  background: #2f6d8f;
}

.dashboard-hero-toggle input:checked + .dashboard-hero-toggle-track::after {
  transform: translateX(16px);
}

.dashboard-hero-toggle-copy {
  display: grid;
  gap: 2px;
}

.dashboard-hero-toggle-copy strong,
.dashboard-hero-toggle-copy span {
  display: block;
}

.dashboard-hero-toggle-copy strong {
  font-size: 0.78rem;
}

.dashboard-hero-toggle-copy span {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.72rem;
}

.dashboard-hero-info-wrap {
  position: relative;
  display: inline-flex;
}

.dashboard-hero-info-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 26;
  width: min(760px, calc(100vw - 48px));
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(243, 201, 105, 0.38);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  color: var(--text);
  box-shadow: var(--shadow);
  max-height: min(78vh, 760px);
  overflow: auto;
}

:root[data-theme="light"] .dashboard-hero-info-popover {
  border-color: rgba(139, 116, 247, 0.34);
}

.dashboard-hero-info-popover[hidden] {
  display: none;
}

.dashboard-hero-info-title,
.dashboard-hero-info-body {
  margin: 0;
}

.dashboard-hero-info-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero-info-body {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.58;
  white-space: pre-line;
}

.dashboard-hero-badges {
  width: 100%;
  align-items: stretch;
}

.dashboard-overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-hero-badges > * {
  flex: 0 0 auto;
}

.dashboard-overview-stats > * {
  min-width: 0;
}

.dashboard-hero-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 92%, white 8%);
  background: color-mix(in srgb, var(--panel) 82%, white 18%);
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.78rem;
  line-height: 1.15;
}

:root[data-theme="light"] .dashboard-hero-badge {
  border-color: rgba(132, 155, 213, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 244, 255, 0.82));
}

.dashboard-overview-stats .dashboard-hero-badge {
  min-height: 62px;
  width: 100%;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
}

.dashboard-hero-badge-label {
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-overview-stats .dashboard-hero-badge-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.dashboard-hero-badge-value {
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
}

.dashboard-overview-stats .dashboard-hero-badge-value {
  font-size: 1.05rem;
  line-height: 1.12;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.dashboard-hero-shell .dashboard-hero-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 32px;
  padding-inline: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #eef5ff;
  font-size: 0.84rem;
  line-height: 1;
  font-weight: 700;
}

:root[data-theme="light"] .dashboard-hero-shell .dashboard-hero-control-btn {
  border-color: rgba(132, 155, 213, 0.26);
  background: rgba(248, 251, 255, 0.74);
  color: #17233f;
}

.dashboard-hero-shell .dashboard-hero-control-btn.icon-only {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.dashboard-hero-shell :is(.dashboard-hero-control-btn, .dashboard-hero-action-btn).icon-only i {
  color: currentColor;
}

.dashboard-hero-shell .dashboard-hero-control-btn:hover,
.dashboard-hero-shell .dashboard-hero-control-btn:focus-visible {
  border-color: rgba(243, 201, 105, 0.38);
  background: rgba(255, 255, 255, 0.12);
}

:root[data-theme="light"] .dashboard-hero-shell .dashboard-hero-control-btn:hover,
:root[data-theme="light"] .dashboard-hero-shell .dashboard-hero-control-btn:focus-visible {
  border-color: rgba(139, 116, 247, 0.36);
  background: rgba(248, 251, 255, 0.94);
}

@media (max-width: 540px) {
  .dashboard-hero-top {
    flex-wrap: wrap;
  }

  .dashboard-hero-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .dashboard-hero-shell.is-profile {
    padding: 18px 16px 14px;
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-title {
    font-size: clamp(1.95rem, 8.4vw, 2.6rem);
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-identity {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-icon {
    width: 72px;
    height: 72px;
  }

  .dashboard-hero-shell.is-profile .dashboard-profile-avatar-chip {
    --avatar-size: 72px;
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .dashboard-hero-shell.is-profile .dashboard-hero-action-btn:not(.icon-only) {
    flex: 1 1 auto;
    justify-content: center;
  }

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

  .dashboard-hero-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
  }
  .dashboard-hero-badges .dashboard-hero-badge {
    width: 100%;
    justify-content: space-between;
  }
  .dashboard-hero-actions,
  .dashboard-hero-badges {
    width: 100%;
  }
  .dashboard-hero-actions > *,
  .dashboard-hero-badges > * {
    flex: 1 1 auto;
  }
  .dashboard-card-head,
  .dashboard-record-meta {
    width: 100%;
  }
  .dashboard-card-head > * {
    flex: 1 1 auto;
  }
}

@media (max-width: 1180px) {
  :root {
    --dashboard-shell-top: 0px;
    --dashboard-shell-inline: 14px;
    --dashboard-rail-clearance: 44px;
  }

  .dashboard-shell-root {
    width: 100%;
  }

  .dashboard-overview-grid > .dashboard-overview-card:nth-child(odd),
  .dashboard-overview-grid > .dashboard-overview-card:nth-child(even) {
    grid-column: 1 / -1;
  }

  .dashboard-sidebar {
    position: static;
    width: 100%;
    max-height: calc(100dvh - var(--dashboard-shell-top, 18px) - var(--dashboard-shell-bottom, 20px));
    overflow: hidden;
    overscroll-behavior: auto;
  }

  .dashboard-main {
    margin-left: 0;
    width: 100%;
  }

  body.law-dashboard-shell-page .sidebar-scroll {
    max-height: min(48vh, 560px);
    overflow-y: auto;
  }
}

@media (max-width: 1100px) {
  :root {
    --dashboard-main-padding: var(--space-4);
  }
}

@media (max-width: 860px) {
  :is(body.law-dashboard-shell-page, body.law-dashboard-rail-page) {
    --dashboard-shell-inline: 12px;
    --dashboard-shell-bottom: 24px;
  }

  .dashboard-shell-root {
    height: auto;
    max-height: none;
  }

  .dashboard-sidebar {
    --dashboard-sidebar-padding: var(--space-5);
  }

  body.law-dashboard-shell-page .sidebar-scroll {
    max-height: min(42vh, 460px);
  }
}

@media (max-width: 760px) {
  :is(body.law-dashboard-shell-page, body.law-dashboard-rail-page) {
    --dashboard-shell-inline: 14px;
    --dashboard-shell-bottom: 32px;
  }

  body.law-dashboard-shell-page .floating-open-deck {
    top: 132px;
    bottom: auto;
  }

  .floating-admin-link {
    top: 190px;
  }

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

  body.law-dashboard-shell-page .bar-chart {
    gap: var(--space-3);
  }

  body.law-dashboard-shell-page .bar {
    max-width: 14px;
  }

  .dashboard-chart-head-actions {
    width: 100%;
    justify-items: start;
  }

  .dashboard-chart-head-actions .legend {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  :is(body.law-dashboard-shell-page, body.law-dashboard-rail-page) {
    --dashboard-shell-inline: 10px;
    --dashboard-shell-bottom: 20px;
  }

  .dashboard-main {
    --dashboard-main-padding: var(--space-5);
  }

  .dashboard-overview-card {
    padding: var(--space-5);
  }
}

@media (max-width: 640px) {
  .dashboard-sidebar {
    --dashboard-sidebar-gap: var(--space-5);
  }

  body.law-dashboard-shell-page .nav-link,
  body.law-dashboard-shell-page .admin-subnav-link {
    padding: var(--space-3);
  }
}

@media (max-width: 540px) {
  body.law-dashboard-shell-page .bar-chart {
    grid-template-columns: repeat(15, minmax(0, 1fr));
    min-height: clamp(140px, 24vh, 190px);
  }
}

@media (max-width: 520px) {
  :root {
    --dashboard-shell-inline: 7px;
  }

  .dashboard-shell-root {
    height: calc(100dvh - 18px);
    max-height: calc(100dvh - 18px);
  }

  .dashboard-sidebar {
    --dashboard-sidebar-padding: var(--space-3);
    border-radius: 18px;
  }

  .dashboard-main {
    border-radius: 18px;
    --dashboard-main-padding: var(--space-3);
  }

  body.law-dashboard-shell-page .nav-link,
  body.law-dashboard-shell-page .admin-subnav-link {
    gap: var(--space-3);
  }
}

/* Section: Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(186, 173, 216, 0.92) rgba(206, 196, 230, 0.18);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(224, 216, 241, 0.26);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(223, 216, 239, 0.96), rgba(190, 177, 219, 0.94));
  border-radius: 999px;
  border: 2px solid rgba(246, 240, 255, 0.42);
}

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