:root {
  --ink: #111827;
  --muted: #64748b;
  --accent: #1a56db;
  --accent-soft: #2563eb;
  --highlight: #d97706;
  --bg-0: #ffffff;
  --bg-1: #f8fafc;
  --bg-2: #f1f5f9;
  --panel: #ffffff;
  --panel-border: #e2e8f0;
  --page-max: 1440px;
  --page-gutter: clamp(1rem, 2vw, 2rem);
  --surface-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg-1);
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.background-grid {
  display: none;
}

.background-watermark {
  display: none;
}

.layout {
  width: min(var(--page-max), calc(100vw - (var(--page-gutter) * 2)));
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

body > main {
  flex: 1 0 auto;
}

.home-layout {
  display: grid;
  align-content: start;
  padding: 3.2rem 0 1.6rem;
}

.domain-layout {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 0.7rem 0 1.2rem;
}

.page-header,
.domain-header {
  display: grid;
  gap: 0.42rem;
  padding: 0.35rem 0 0.65rem;
}

.page-header h1,
.domain-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
}

.home-shell,
.content {
  width: min(1180px, 94vw);
  margin-inline: auto;
  animation: slide-up 0.85s ease-out;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

h1 {
  font-family: "Sora", "Space Grotesk", sans-serif;
  margin: 0.65rem 0 1rem;
  font-size: clamp(2rem, 6vw, 3.7rem);
  line-height: 1.1;
}

/* ── Home Header ───────────────────────────────────── */
.home-shell {
  display: grid;
  gap: 1rem;
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.home-brand img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.home-brand-name {
  display: block;
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1e3a8a;
  line-height: 1.1;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 1.5rem;
  align-items: center;
  padding: 0.65rem 0 0.3rem;
  justify-content: center;
}

.home-title-block {
  min-width: 0;
}

.home-heading {
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.9rem);
  line-height: 1.03;
  margin: 0.45rem 0 0.75rem;
  max-width: 15ch;
  letter-spacing: 0;
}

.lead {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  max-width: 62ch;
  color: #334155;
}

.home-snapshot {
  display: grid;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.snapshot-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.68rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.snapshot-row:last-child {
  border-bottom: none;
}

.snapshot-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snapshot-row strong {
  color: var(--ink);
  font-size: 0.92rem;
  text-align: right;
}

.ip-line {
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  font-size: clamp(0.84rem, 1.2vw, 0.94rem);
}

.ip-label {
  color: var(--muted);
  font-size: 0.93em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ip-meta {
  color: var(--muted);
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  font-size: 0.93em;
}

/* ── Phase Tracker ─────────────────────────────────── */
.phase-tracker {
  margin: 1.8rem 0 0;
}

.phase-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.phase-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.phase-num {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: 2px solid var(--panel-border);
  background: var(--panel);
  color: var(--muted);
  transition: background 200ms, border-color 200ms, color 200ms;
  position: relative;
  z-index: 1;
}

.phase-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  max-width: 7rem;
  white-space: normal;
}

.phase-node.phase-active .phase-num {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-color: rgba(245, 158, 11, 0.7);
  color: #fff;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
}

.phase-node.phase-active .phase-label {
  color: var(--ink);
  font-weight: 600;
}

.phase-connector {
  flex: 1;
  height: 2px;
  background: var(--panel-border);
  margin-top: 1.18rem;
  min-width: 0.5rem;
}

/* ── Module List ────────────────────────────────────── */
.module-list {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  justify-content: center;
}

.home-card-list {
  width: min(860px, 92vw);
}

.home-lifecycle {
  min-height: min(640px, calc(100dvh - 12rem));
  display: grid;
  align-content: center;
  gap: clamp(2.2rem, 5vw, 4.5rem);
  padding: clamp(1.5rem, 5vw, 4rem) 0;
}

.home-lifecycle-header {
  width: min(780px, 100%);
  display: grid;
  gap: 0.55rem;
}

.home-lifecycle-header h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.95;
}

.home-lifecycle-header p {
  max-width: 44rem;
  margin: 0;
  color: #475569;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.45;
}

.lifecycle-graph {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(2.8rem, 0.35fr) minmax(9rem, 1fr) minmax(2.8rem, 0.35fr) minmax(9rem, 1fr) minmax(2.8rem, 0.35fr) minmax(9rem, 1fr);
  align-items: center;
  width: 100%;
}

.lifecycle-node {
  position: relative;
  min-width: 0;
  min-height: 10.5rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.8rem;
  padding: 1.2rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.82);
}

.lifecycle-node-active {
  border-color: #93c5fd;
  background: #ffffff;
}

.lifecycle-dot {
  display: inline-grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #174a75;
  font-size: 1.2rem;
}

.lifecycle-node-active .lifecycle-dot {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.lifecycle-label {
  color: #0f172a;
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 700;
  text-align: center;
}

.lifecycle-node-planned .lifecycle-label,
.lifecycle-node-planned .lifecycle-dot {
  color: #64748b;
}

.lifecycle-edge {
  position: relative;
  display: block;
  height: 2px;
  background: #b8c5d6;
}

.lifecycle-edge::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  width: 0.52rem;
  height: 0.52rem;
  border-top: 2px solid #b8c5d6;
  border-right: 2px solid #b8c5d6;
  transform: translateY(-50%) rotate(45deg);
}

.lifecycle-branch {
  position: absolute;
  top: calc(100% + 1.1rem);
  left: 50%;
  width: min(15rem, 100%);
  transform: translateX(-50%);
}

.lifecycle-branch::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 2px;
  height: 1.1rem;
  background: #93c5fd;
}

.lifecycle-branch a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  background: #eff6ff;
  color: #12355c;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.lifecycle-branch a:hover {
  border-color: #2563eb;
  background: #ffffff;
  color: #1d4ed8;
}

.domain-module-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.domain-module-list .module-link {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 4.4rem;
  padding: 0.85rem 1rem;
}

.domain-module-list .module-copy {
  grid-column: auto;
  align-self: center;
  gap: 0;
}

.domain-module-list .module-name {
  font-size: 1.1rem;
}

.domain-module-list .module-arrow {
  align-self: center;
}

.review-layout {
  padding-bottom: 5.25rem;
}

.review-filters {
  margin-top: 0.6rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.review-filter-row {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}

.review-filter-row-workspace {
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
}

.review-filter-row-primary {
  grid-template-columns: minmax(260px, 1fr) minmax(210px, 0.75fr) auto auto;
}

.review-filter-row-secondary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-filter-row-books {
  grid-template-columns: minmax(0, 1fr);
}

.review-field-search {
  min-width: 0;
}

.review-field-export,
.review-field-workspace-action {
  justify-self: end;
  min-width: 160px;
}

.workspace-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.review-field-proponent-action {
  justify-self: end;
  min-width: 160px;
}

.review-books-field {
  padding-top: 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0;
}

.summary-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.summary-card strong {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 1.8rem;
  margin-top: 0.3rem;
}

.summary-label {
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.review-live-stats {
  position: fixed;
  left: 50%;
  bottom: 0.8rem;
  z-index: 1100;
  display: grid;
  grid-template-columns: repeat(3, minmax(6.2rem, auto)) auto;
  gap: 0.45rem;
  width: min(46rem, calc(100vw - 1.6rem));
  padding: 0.45rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
  transform: translateX(-50%);
}

.review-live-stat {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.38rem 0.55rem;
  border-radius: 0.45rem;
  background: #f8fafc;
}

.review-live-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
}

.review-live-stat strong {
  color: var(--ink);
  font-family: "Sora", sans-serif;
  font-size: 1.05rem;
  line-height: 1.05;
}

.review-live-stat strong[data-delta="negative"] {
  color: #166534;
}

.review-live-stat strong[data-delta="positive"] {
  color: #92400e;
}

.review-live-refresh {
  align-self: stretch;
  min-width: 5.4rem;
  border: 1px solid #1d4ed8;
  border-radius: 0.45rem;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
}

.review-live-refresh:hover {
  background: #1d4ed8;
}

.review-grid {
  align-items: start;
  grid-template-columns: 1fr !important;
}

.review-main-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.meta-note {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: normal;
  margin-left: 0.3rem;
}

/* ── Book filter chips ───────────────────────────────── */
.book-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.book-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.26rem 0.65rem;
  border: 1.5px solid var(--panel-border);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #f1f5f9;
  color: var(--muted);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  -webkit-user-select: none;
  user-select: none;
  letter-spacing: 0.02em;
}

.book-chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.book-chip:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.24);
  outline-offset: 2px;
}

.review-card,
.occurrence-card,
.comparison-card {
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
}

.review-list {
  display: grid;
  gap: 1rem;
}

.review-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.review-card[data-disposition="unreviewed"] {
  outline: 2px solid #3b82f6;
  outline-offset: -1px;
}

.review-card[data-requires-additional-review="true"] {
  border: 2px solid #dc2626;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.2);
}

.review-card-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  margin-top: 1rem;
}

.review-card-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.review-card-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  overflow-x: hidden;
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: start;
}

.review-card-header h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0;
  font-size: 1.12rem;
}

.ready-final-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  font-size: 0.72rem;
  line-height: 1;
}

.review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: end;
}

.review-card-tools {
  display: grid;
  justify-items: end;
  gap: 0.45rem;
}

.review-card-tool-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.4rem;
}

.diff-visibility-toggle,
.share-card-link-btn,
.copy-card-image-btn,
.copy-card-markup-btn,
.email-card-image-btn,
.qr-card-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.3rem 0.58rem;
  white-space: nowrap;
}

.diff-visibility-toggle:hover,
.share-card-link-btn:hover,
.copy-card-image-btn:hover,
.copy-card-markup-btn:hover,
.email-card-image-btn:hover,
.qr-card-link-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.diff-visibility-toggle[aria-pressed="true"] {
  background: #f8fafc;
  color: #64748b;
}

.share-card-link-btn:disabled,
.copy-card-image-btn:disabled,
.copy-card-markup-btn:disabled,
.email-card-image-btn:disabled,
.qr-card-link-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.review-card-qr-wrap {
  position: relative;
  display: inline-flex;
}

.review-card-qr-panel {
  position: absolute;
  z-index: 80;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(220px, 80vw);
  padding: 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  color: var(--ink);
  text-align: center;
}

.definition-qr-code {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 0.55rem;
  shape-rendering: crispEdges;
}

.review-card-qr-caption {
  display: block;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
}

.definition-email-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.42);
}

.definition-email-dialog {
  width: min(980px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.definition-email-dialog,
.definition-email-dialog * {
  user-select: text;
}

.definition-email-dialog button {
  user-select: none;
}

.definition-email-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

.definition-email-header h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.15rem;
  line-height: 1.2;
}

.definition-email-header p {
  margin: 0.2rem 0 0;
  color: #64748b;
  font-size: 0.9rem;
}

.definition-email-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.definition-email-form {
  display: grid;
  gap: 1rem;
  padding: 1rem 1.1rem 1.1rem;
}

.definition-email-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.74fr);
  gap: 1rem;
  align-items: start;
}

.definition-email-fields {
  display: grid;
  gap: 0.8rem;
}

.definition-email-recipient-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.65rem;
  padding: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #ffffff;
}

.definition-email-recipient-field:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.definition-email-recipient-chips {
  display: contents;
}

.definition-email-recipient-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 0.28rem;
  padding: 0.22rem 0.28rem 0.22rem 0.48rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.84rem;
  font-weight: 700;
}

.definition-email-recipient-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.definition-email-recipient-chip button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #1d4ed8;
  cursor: pointer;
}

.definition-email-recipient-chip button:hover {
  background: #dbeafe;
}

.definition-email-to-input {
  flex: 1 1 13rem;
  min-width: 10rem;
  border: 0;
  outline: 0;
  padding: 0.35rem 0.2rem;
  font: inherit;
}

.definition-email-recipient-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.definition-email-recipient-suggestions[hidden] {
  display: none;
}

.definition-email-recipient-suggestion {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
}

.definition-email-recipient-suggestion:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.definition-email-editor-field {
  display: grid;
  gap: 0.35rem;
}

.definition-email-editor {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: #ffffff;
}

.definition-email-editor .pell-actionbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0.45rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.definition-email-editor .pell-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.9rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
}

.definition-email-editor .pell-button:hover,
.definition-email-editor .pell-button-selected {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.definition-email-editor .pell-content {
  min-height: 320px;
  max-height: 46vh;
  overflow: auto;
  padding: 0.85rem 0.95rem;
  color: #0f172a;
  line-height: 1.5;
  outline: none;
}

.definition-email-editor .pell-content:focus {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.definition-email-editor .pell-content p {
  margin: 0 0 0.75rem;
}

.definition-email-editor .pell-content h1,
.definition-email-editor .pell-content h2,
.definition-email-editor .pell-content h3 {
  margin: 0.85rem 0 0.45rem;
  line-height: 1.2;
}

.definition-email-editor .pell-content ul,
.definition-email-editor .pell-content ol {
  margin: 0.4rem 0 0.85rem 1.35rem;
  padding: 0;
}

.definition-email-editor .pell-content blockquote {
  margin: 0.65rem 0;
  padding-left: 0.85rem;
  border-left: 3px solid #bfdbfe;
  color: #475569;
}

.definition-email-attachment {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
}

.definition-email-attachment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #0f172a;
  font-weight: 700;
}

.definition-email-preview {
  max-height: 220px;
  overflow: auto;
  padding: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #ffffff;
}

.definition-email-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.definition-email-policy,
.definition-email-status {
  margin: 0;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.35;
}

.definition-email-status-error {
  color: #b91c1c;
  font-weight: 700;
}

.definition-email-status-success {
  color: #047857;
  font-weight: 700;
}

.definition-email-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 0.55rem;
}

@media (max-width: 760px) {
  .definition-email-grid {
    grid-template-columns: 1fr;
  }

  .definition-email-attachment {
    grid-template-columns: 1fr;
  }

  .definition-email-actions .finder-btn {
    flex: 1 1 10rem;
  }
}

.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.diff-exact {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.diff-punctuation {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.diff-wording {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.review-columns {
  margin-top: 1rem;
}

.occurrence-grid,
.comparison-list {
  display: grid;
  gap: 0.75rem;
}

.occurrence-card,
.comparison-card {
  padding: 0.8rem;
}

.occurrence-card header,
.comparison-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.45rem;
}

.occurrence-card pre {
  white-space: pre-wrap;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0.6rem 0;
  color: #111827;
}

.source-link-btn {
  display: inline;
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.source-link-btn:hover {
  background: transparent;
  border: none;
  color: #1e40af;
}

.diff-preview {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.32rem;
}

.reason-box {
  border: 1px solid #93c5fd;
  background: #dbeafe;
  border-radius: 0.6rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.7rem;
  color: #0c4a6e;
}

.reason-box strong {
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: #0369a1;
}

.diff-line {
  margin: 0;
  padding: 0.5rem 0.58rem;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  line-height: 1.45;
  color: #111827;
}

.diff-token-remove {
  display: inline;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: #dc2626;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 0.2rem;
  padding: 0 0.08rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.diff-token-add {
  display: inline;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: #0d9488;
  color: #115e59;
  background: #ccfbf1;
  border-radius: 0.2rem;
  padding: 0 0.08rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.diff-space,
.redline-space {
  white-space: break-spaces;
  min-width: 0.55ch;
}

.master-preview {
  margin-top: 0.75rem;
  border: 1px solid #bae6fd;
  border-left: 3px solid #0369a1;
  border-radius: 0.7rem;
  padding: 0.65rem;
  background: #f0f9ff;
}

.master-preview strong {
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: #0c4a6e;
}

.master-preview pre {
  margin: 0.45rem 0 0;
  white-space: pre-wrap;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #111827;
}

.compact-field {
  margin-top: 0.7rem;
  min-width: 0;
}

.compact-field textarea,
.compact-field select,
.compact-field input[type="text"] {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  padding: 0.48rem 0.58rem;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 0;
  box-sizing: border-box;
}

.compact-field textarea:focus,
.compact-field select:focus,
.compact-field input[type="text"]:focus {
  outline: 3px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.review-card textarea {
  max-width: 100%;
  resize: none;
  overflow-y: hidden;
}

.field-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.field-mini-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  padding: 0.22rem 0.48rem;
}

.field-mini-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.compact-checkbox-field {
  margin-top: 0.9rem;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"]:disabled + span {
  color: #94a3b8;
}

.ready-final-hint {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.save-review-btn,
.print-slip-btn {
  width: 100%;
  min-height: 2.35rem;
  white-space: nowrap;
}

.save-review-btn {
  min-width: 8.75rem;
}

.review-notes-required {
  border-color: #f59e0b !important;
  background: #fffbeb !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.18);
}

/* ── Disposition badges in card header ────────────── */
.diff-disp-unreviewed {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #475569;
}

.diff-disp-notes-only {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.diff-disp-benign {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.diff-disp-editorial,
.diff-disp-errata {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.diff-disp-priority {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  font-weight: 800;
}

.diff-disp-delete {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #334155;
  font-weight: 800;
}

/* ── Inline analyst notes in card ─────────────────── */
.card-analyst-notes {
  margin: 0.3rem 0 0.55rem;
  padding: 0.4rem 0.65rem;
  background: #fffbeb;
  border-left: 3px solid #fbbf24;
  border-radius: 0 0.4rem 0.4rem 0;
  font-size: 0.88rem;
  color: #78350f;
}

/* ── Occurrence table inside review cards ──────────── */
.review-card .occ-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.7rem 0;
  border: 1px solid var(--panel-border);
  border-radius: 0.55rem;
  overflow: hidden;
}

.review-card .occ-table th {
  text-align: left;
  border-bottom: 2px solid var(--panel-border);
  padding: 0.28rem 0.55rem;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.review-card .occ-table td {
  vertical-align: top;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #f0f4f8;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.45;
}

.review-card .occ-table tr:last-child td {
  border-bottom: none;
}

.review-card .occ-table tr.occ-row-master td {
  background: #eff6ff;
}

.review-card .occ-table tr.occ-row-master .occ-code strong {
  color: #1d4ed8;
}

.review-card .occ-table tr.occ-row-filtered-heading td {
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.review-card .occ-table tr.occ-row-filtered-out td {
  background: #f8fafc;
  color: #64748b;
  opacity: 0.72;
}

.review-card .occ-table tr.occ-row-filtered-out .occ-def-text {
  color: #64748b;
}

.review-card .occ-table tr.occ-row-filtered-out .redline-add,
.review-card .occ-table tr.occ-row-filtered-out .redline-remove {
  color: #64748b;
  text-decoration-color: #94a3b8;
}

.review-card .occ-table tr.occ-row-filtered-out .occ-diff-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.review-card .occ-code {
  white-space: nowrap;
  width: 4.5rem;
}

.review-card .occ-slug {
  color: var(--muted);
  width: 5.5rem;
}

.review-card .occ-slug-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.review-card .occ-slug-link {
  flex-shrink: 0;
  line-height: 1;
}

.review-card .occ-slug > div {
  margin-bottom: 0.3rem;
}

.review-card .occ-diff-inline {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.review-card .occ-usage {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.15rem;
  padding: 0.15rem 0.45rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

.review-card .occ-usage-muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: var(--muted);
}

.review-card .occ-link {
  width: 2.2rem;
  text-align: right;
}

.review-card .occ-def-text {
  margin-top: 0.2rem;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-card .occ-def-text .diff-token-add,
.review-card .occ-def-text .diff-token-remove {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.review-card-diffs-hidden .occ-def-text .diff-token-remove {
  display: none;
}

.review-card-diffs-hidden .occ-def-text .diff-token-add {
  text-decoration: none;
  color: inherit;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.review-card td.occ-def {
  position: relative;
}

.occ-copy-btn {
  display: none;
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  padding: 0.18rem 0.38rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
  line-height: 1;
}

.occ-copy-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.review-card td.occ-def:hover .occ-copy-btn {
  display: inline-flex;
  align-items: center;
}

.review-card .occ-def-diff-inline {
  margin-bottom: 0.1rem;
}

.occ-diff-pill {
  display: inline-block;
  padding: 0.12rem 0.48rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.22rem;
}

.occ-diff-master {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.diff-excluded {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}

.diff-delete {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.diff-custom {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
}

.diff-source-corrected {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #92400e;
}

.term-override-note {
  color: #7c2d12;
}

.term-override-details {
  border-top: 1px dashed #d6dce5;
  grid-column: 1 / -1;
  margin-top: 0.25rem;
  padding-top: 0.35rem;
}

.term-override-details summary {
  color: #64748b;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.term-override-details[open] summary {
  margin-bottom: 0.35rem;
}

.review-card .occ-table tr.occ-row-excluded td {
  background: #f8fafc;
  color: #64748b;
}

.review-card .occ-table tr.occ-row-delete td {
  background: #fef2f2;
}

.discussion-panel {
  display: grid;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.discussion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
}

.discussion-toggle::before {
  content: "\25BE";
  color: #64748b;
}

.discussion-collapsed .discussion-toggle::before {
  content: "\25B8";
}

.discussion-count {
  margin-left: auto;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
}

.discussion-unread {
  border: 1px solid #fca5a5;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.72rem;
  padding: 2px 7px;
}

.discussion-body {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.discussion-collapsed .discussion-body {
  display: none;
}

.discussion-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}

.discussion-item {
  display: block !important;
  border-left: 2px solid #cbd5e1;
  background: transparent;
  padding: 7px 0 7px 10px;
}

.discussion-item.discussion-resolved {
  background: transparent;
  color: #64748b;
  border-left-color: #e2e8f0;
}

.discussion-line {
  display: block !important;
  width: 100% !important;
  min-width: 0;
  margin: 0 0 4px;
}

.discussion-meta,
.discussion-item-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.discussion-meta {
  color: #64748b;
  font-size: 0.72rem;
  min-width: 0;
}

.discussion-meta strong,
.discussion-meta em {
  display: inline;
}

.discussion-meta strong {
  color: var(--ink);
}

.discussion-meta em,
.discussion-resolved-pill {
  border: none;
  background: transparent;
  color: #64748b;
  font-style: normal;
  padding: 0;
}

.discussion-meta em {
  color: #0369a1;
}

.discussion-resolved-pill {
  color: #15803d !important;
}

.discussion-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.discussion-icon-btn:hover {
  background: #e2e8f0;
}

.discussion-resolve-btn {
  color: #15803d;
}

.discussion-delete-btn {
  color: #b91c1c;
}

.discussion-text {
  color: var(--ink);
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.discussion-item-footer {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
  color: #64748b;
  font-size: 0.72rem;
}

.discussion-resolved .discussion-text,
.discussion-resolved .discussion-meta,
.discussion-resolved .discussion-meta strong {
  color: #94a3b8;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: #94a3b8;
}


.discussion-composer {
  display: grid;
  gap: 8px;
}

.discussion-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.discussion-suggestion {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.discussion-suggestion input[type="checkbox"] {
  cursor: pointer;
}

.occ-override-controls {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.occ-exclude-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.occ-exclude-row input {
  margin: 0;
  cursor: pointer;
}

.occ-source-definition,
.occ-custom-definition {
  width: 100%;
  min-height: 3rem;
  resize: none;
  overflow-y: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  padding: 0.42rem 0.5rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--ink);
  background: #ffffff;
}

.source-correction-details {
  border-left: 2px solid #f59e0b;
  padding-left: 0.45rem;
}

.source-correction-details summary {
  color: #92400e;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.source-correction-details[open] summary {
  margin-bottom: 0.3rem;
}

.occ-original-preview {
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 0.3rem;
}

.occ-custom-preview {
  margin-top: 0.35rem;
  padding: 0.4rem 0.5rem;
  border-left: 3px solid #6366f1;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.82rem;
}



.review-card .occ-link .source-link-btn {
  margin-top: 0;
  padding: 0.18rem 0.35rem;
  font-size: 0.75rem;
}

/* ── Review controls section ───────────────────────── */
.review-controls {
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--panel-border);
  border-radius: 0.6rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-controls-dirty {
  border-color: #f59e0b;
  background: #fffbeb;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.review-controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0rem;
}

.review-save-status {
  min-height: 1rem;
  margin: -0.2rem 0 0;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
}

.review-save-status[data-state="dirty"] {
  color: #92400e;
}

.review-save-status[data-state="saving"] {
  color: #1d4ed8;
}

.review-save-status[data-state="saved"] {
  color: #166534;
}

.review-save-status[data-state="error"] {
  color: #b91c1c;
}

/* ── Export dialog ───────────────────────────────────── */
.field-action {
  align-items: center;
}

.export-dialog {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  color: var(--ink);
  padding: 1.5rem 1.75rem 1.25rem;
  max-width: 380px;
  width: 90vw;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
}

.export-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.export-dialog h3 {
  margin: 0 0 1rem;
  font-family: "Sora", sans-serif;
  font-size: 1.1rem;
}

.export-dialog .field {
  margin-bottom: 1.1rem;
}

.workspace-user-dialog {
  max-width: 560px;
}

.workspace-user-results {
  margin: 0.8rem 0 1rem;
  display: grid;
  gap: 0.45rem;
  max-height: 18rem;
  overflow: auto;
}

.workspace-user-option {
  display: grid;
  gap: 0.12rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #dbe3ef;
  border-radius: 0.55rem;
  background: #ffffff;
  text-align: left;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.workspace-user-option:hover,
.workspace-user-option:focus {
  border-color: #93c5fd;
  background: #f8fbff;
  outline: none;
}

.workspace-user-name {
  font-weight: 700;
}

.workspace-user-meta,
.workspace-user-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace-user-empty {
  margin: 0;
  padding: 0.7rem 0;
}

.me-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.me-dialog {
  width: min(100%, 500px);
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
  color: var(--ink);
  padding: 1.25rem;
}

.me-dialog h2 {
  margin: 0 0 0.4rem;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
}

.me-dialog-current {
  display: grid;
  gap: 0.25rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
  margin-top: 0.9rem;
  padding: 0.7rem;
}

.me-dialog-current span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.me-dialog-history {
  display: grid;
  gap: 0.45rem;
  max-height: 240px;
  overflow: auto;
  margin: 1rem 0;
  padding-right: 0.15rem;
}

.me-dialog-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.4rem;
}

.me-dialog-history-use,
.me-dialog-history-delete {
  border: 1px solid #dbe4ef;
  border-radius: 0.45rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.me-dialog-history-use {
  min-width: 0;
  padding: 0.55rem 0.65rem;
  text-align: left;
  line-height: 1.35;
}

.me-dialog-history-use:hover,
.me-dialog-history-use:focus {
  border-color: #8ab5e6;
  background: #f8fbff;
}

.me-dialog-history-delete {
  padding: 0 0.55rem;
  color: #b91c1c;
  font-size: 0.78rem;
}

.me-dialog-history-delete:hover,
.me-dialog-history-delete:focus {
  border-color: #fecaca;
  background: #fff5f5;
}

.me-dialog-empty {
  border: 1px dashed #dbe4ef;
  border-radius: 0.5rem;
  color: var(--muted);
  padding: 0.75rem;
}

.me-dialog-entry.is-hidden {
  display: none;
}

.me-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
}

.export-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

.export-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 1rem 0;
}

.slip-reports-section {
  margin: 0.75rem 0;
}

.slip-reports-label {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 0.75rem 0;
}

.finder-btn-secondary {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--muted);
}

.finder-btn-primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.finder-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
}

/* ── Public shared definition card ─────────────────── */
body.shared-page {
  display: flex;
  flex-direction: column;
}

.shared-card-layout {
  flex: 1 0 auto;
  max-width: 1040px;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.shared-page .site-footer {
  margin-top: auto;
}

.shared-card-root {
  width: 100%;
}

.shared-definition-card {
  padding: 0;
  overflow: hidden;
}

.shared-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  border-bottom: 1px solid #dbe4ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 1.35rem 1.45rem 1.15rem;
}

.shared-card-header h1 {
  margin: 0.1rem 0 0.3rem;
  font-size: clamp(1.75rem, 4vw, 3rem);
  letter-spacing: 0;
}

.shared-subtitle {
  color: #475569;
  font-size: 0.95rem;
  margin: 0.2rem 0 0;
}

.shared-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.shared-diff-toggle,
.shared-link-btn,
.shared-copy-image-btn,
.shared-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.shared-qr-wrap {
  position: relative;
  display: inline-flex;
}

.shared-qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
}

.shared-diff-toggle[aria-pressed="true"] {
  background: #f8fafc;
  color: #475569;
}

.shared-qr-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(250px, 80vw);
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.55rem;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
  color: #0f172a;
  text-align: center;
}

.shared-qr-code {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 0.6rem;
  shape-rendering: crispEdges;
}

.shared-qr-caption {
  font-weight: 700;
  font-size: 0.86rem;
}

.shared-master-definition,
.shared-occurrence-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.15rem 1.45rem;
}

.shared-master-definition {
  background: #ffffff;
  border-bottom: 1px solid #edf2f7;
}

.shared-occurrence-list {
  background: #f8fafc;
}

.shared-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.shared-master-definition h2,
.shared-occurrence-list h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 0.95rem;
}

.shared-section-heading span {
  color: #64748b;
  font-size: 0.82rem;
  text-align: right;
}

.shared-master-controls {
  display: grid;
  gap: 0.65rem;
}

.shared-master-selector {
  margin: 0;
}

.shared-export-master-label {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #f8fafc;
}

.shared-export-master-label span,
.shared-export-master-label small {
  color: #64748b;
  font-size: 0.82rem;
}

.shared-export-master-label strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.shared-heading-with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.shared-help-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  cursor: help;
  font-size: 0.95rem;
  line-height: 1;
}

.shared-help-icon:hover,
.shared-help-icon:focus-visible {
  color: #1e40af;
  outline: none;
}

.shared-help-tooltip {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  left: 50%;
  width: min(320px, 78vw);
  padding: 0.75rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -0.2rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.shared-help-icon:hover .shared-help-tooltip,
.shared-help-icon:focus-visible .shared-help-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.shared-occurrence {
  border-top: 1px solid #e2e8f0;
  padding: 0.9rem 0 0.15rem;
}

.shared-occurrence header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.shared-occurrence header strong {
  font-size: 0.93rem;
}

.shared-occurrence header span {
  color: #64748b;
  font-size: 0.78rem;
  text-align: right;
}

.shared-definition-text {
  margin: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.shared-master-text {
  padding: 0.9rem 0 0.15rem;
  border-top: 1px solid #e2e8f0;
}

.shared-compared-text {
  padding: 0;
}

.shared-occurrence > .shared-custom-definition {
  margin-top: 0.6rem;
}

.shared-definition-text .redline-add {
  color: #115e59;
  text-decoration-thickness: 2px;
  text-decoration-color: #0d9488;
  background: #ccfbf1;
  border-radius: 0.2rem;
  padding: 0 0.08rem;
}

.shared-definition-text .redline-remove {
  color: #991b1b;
  text-decoration-thickness: 2px;
  text-decoration-color: #dc2626;
  background: #fee2e2;
  border-radius: 0.2rem;
  padding: 0 0.08rem;
}

.shared-diffs-hidden .shared-definition-text .redline-remove {
  display: none;
}

.shared-diffs-hidden .shared-definition-text .redline-add {
  color: inherit;
  text-decoration: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-weight: inherit;
}

.shared-custom-definition {
  margin-top: 0.6rem;
  border-left: 3px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
}

.shared-print-disclaimer {
  display: none;
}

@media (max-width: 1080px) {
  .review-card-body {
    grid-template-columns: 1fr;
  }

  .review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-controls-grid {
    grid-template-columns: 1fr;
  }

  .review-actions {
    grid-template-columns: 1fr;
  }

  .review-card .occ-table {
    table-layout: fixed;
    max-width: 100%;
  }

  .review-card .occ-code {
    width: 3.5rem;
  }

  .review-card .occ-slug {
    width: 4rem;
  }

  .review-card .occ-def {
    width: auto;
  }

  table {
    min-width: auto;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .review-summary {
    grid-template-columns: 1fr;
  }

  .review-live-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
  }

  .review-live-refresh {
    min-height: 2.35rem;
  }

  .review-card {
    overflow: hidden;
  }

  .review-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .review-card-tools {
    justify-items: stretch;
  }

  .review-card-tool-actions,
  .review-badges {
    justify-content: flex-start;
  }

  .diff-visibility-toggle,
  .share-card-link-btn,
  .copy-card-image-btn,
  .copy-card-markup-btn,
  .email-card-image-btn,
  .qr-card-link-btn {
    justify-content: center;
  }

  .review-card .occ-table,
  .review-card .occ-table tbody,
  .review-card .occ-table tr,
  .review-card .occ-table td {
    display: block;
    width: 100%;
  }

  .review-card .occ-table {
    border: 0;
    border-radius: 0;
    margin: 0.75rem 0;
    table-layout: auto;
  }

  .review-card .occ-table thead {
    display: none;
  }

  .review-card .occ-table tbody {
    display: grid;
    gap: 0.7rem;
  }

  .review-card .occ-table tr {
    border: 1px solid #dbe3ee;
    border-radius: 0.55rem;
    background: #ffffff;
    overflow: hidden;
  }

  .review-card .occ-table tr.occ-row-filtered-heading {
    border: 0;
    border-radius: 0;
  }

  .review-card .occ-table tr.occ-row-filtered-heading td {
    padding: 0.5rem 0.2rem;
  }

  .review-card .occ-table td {
    position: relative;
    padding: 0.64rem 0.7rem;
    border-bottom: 1px solid #eef2f7;
    min-height: 2.35rem;
    font-size: 0.84rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .review-card .occ-table td:last-child {
    border-bottom: 0;
  }

  .review-card .occ-table td::before {
    display: block;
    position: static;
    width: auto;
    margin: 0 0 0.28rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .review-card .occ-table td:nth-child(1)::before {
    content: "Code";
  }

  .review-card .occ-table td:nth-child(2)::before {
    content: "Book";
  }

  .review-card .occ-table td:nth-child(3)::before {
    content: "Definition";
  }

  .review-card .occ-code,
  .review-card .occ-slug,
  .review-card .occ-def {
    width: auto;
    max-width: 100%;
    white-space: normal;
  }

  .review-card .occ-def-text,
  .review-card .occ-def-diff-inline,
  .review-card .redline-add,
  .review-card .redline-remove {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.48;
  }

  .review-card .occ-slug-row {
    align-items: flex-start;
  }

  .review-card .occ-link {
    width: auto;
    text-align: left;
  }

  .review-card td.occ-def {
    padding-right: 0.7rem;
  }

  .occ-copy-btn {
    position: static;
    display: inline-flex;
    margin-top: 0.45rem;
  }

  .review-card-header,
  .occurrence-card header,
  .comparison-card header {
    flex-direction: column;
  }
}

.module-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.1rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1rem;
  padding: 1.35rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.5rem;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 180ms, background 180ms, transform 140ms, box-shadow 180ms;
  min-height: 10rem;
}

.module-link-primary {
  border-color: var(--panel-border);
  background: var(--panel);
}

.module-link:hover {
  border-color: #b6c4d5;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  transform: translateY(-1px);
}

.module-link-disabled {
  cursor: default;
  color: #64748b;
  background: #f8fafc;
}

.module-link-disabled:hover {
  border-color: var(--panel-border);
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transform: none;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #0f3b63;
  font-size: 0.95rem;
}

.module-name {
  display: block;
  font-family: "Sora", "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  line-height: 1.2;
}

.module-copy {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  grid-column: 1 / -1;
  align-self: start;
}

.module-desc {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.45;
  max-width: 30rem;
}

.module-arrow {
  color: var(--muted);
  font-size: 0.9rem;
  transition: transform 140ms;
  justify-self: end;
  align-self: end;
}

.module-link:hover .module-arrow {
  transform: translateX(2px);
  color: #1d4ed8;
}

.home-workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0;
}

.workflow-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.62rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 750;
}

.workflow-item i {
  color: #d97706;
  font-size: 0.82rem;
}

@media (max-width: 1080px) {
  .home-hero {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1.25rem;
  }

  .home-heading {
    max-width: 14ch;
  }
}

@media (max-width: 720px) {
  .home-layout {
    min-height: auto;
    padding: 1.2rem 0 0.75rem;
  }

  .home-heading {
    font-size: 1.95rem;
    max-width: none;
    margin-bottom: 0.55rem;
  }

  .lead {
    font-size: 0.94rem;
    line-height: 1.35;
  }

  .home-shell {
    gap: 0.7rem;
  }

  .home-hero {
    gap: 0.7rem;
    padding-top: 0.25rem;
  }

  .module-list {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .module-link {
    min-height: 8rem;
    padding: 1rem;
  }

  .module-desc {
    font-size: 0.88rem;
  }

  .home-workflow {
    gap: 0.35rem;
  }

  .workflow-item {
    padding: 0.28rem 0.48rem;
    font-size: 0.72rem;
  }
}

.system-notice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.system-notice-dialog {
  width: min(100%, 560px);
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
  padding: 24px;
  color: var(--ink);
}

.system-notice-kicker {
  margin-bottom: 8px;
  color: #506783;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.system-notice-dialog h2 {
  margin: 0 0 14px;
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
}

.system-notice-body {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  color: #334155;
  line-height: 1.5;
}

.system-notice-body p {
  margin: 0;
}

.system-notice-body a {
  color: #0f4c81;
  font-weight: 700;
}

.system-notice-ack {
  width: 100%;
}

@media (max-width: 720px) {
  .review-card-qr-panel,
  .shared-qr-panel {
    position: fixed;
    z-index: 160;
    top: 50%;
    right: auto;
    left: 50%;
    width: min(260px, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    transform: translate(-50%, -50%);
  }

  .definition-qr-code,
  .shared-qr-code {
    width: min(180px, calc(100vw - 5rem));
    height: auto;
    aspect-ratio: 1;
  }

  .shared-card-header,
  .shared-section-heading,
  .shared-occurrence header {
    display: grid;
    justify-content: stretch;
  }

  .shared-master-controls {
    grid-template-columns: 1fr;
  }

  .shared-section-heading span,
  .shared-occurrence header span {
    text-align: left;
  }

  .shared-card-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.8rem, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .shared-card-actions > .shared-diff-toggle,
  .shared-card-actions > .shared-link-btn,
  .shared-card-actions > .shared-qr-wrap,
  .shared-card-actions > .shared-copy-image-btn,
  .shared-card-actions > .shared-print-btn {
    min-width: 0;
  }

  .shared-card-actions .finder-btn {
    width: 100%;
    justify-content: center;
    padding-inline: 0.45rem;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .shared-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media print {
  @page {
    margin: 0.65in;
  }

  .shared-card-layout {
    max-width: none;
    padding: 0;
  }

  .shared-definition-card {
    border: 0;
    box-shadow: none;
  }

  .shared-print-btn,
  .shared-link-btn,
  .shared-copy-image-btn,
  .shared-qr-wrap,
  .shared-master-controls,
  .system-notice-backdrop,
  .explorer-header,
  .background-grid,
  .background-watermark {
    display: none !important;
  }

  .shared-page .explorer-header {
    display: flex !important;
    width: auto;
    margin: 0 0 0.24in;
    padding: 0 0 0.16in;
    border-bottom: 1px solid #cbd5e1;
  }

  .shared-page .brand-link {
    gap: 0.12in;
    font-size: 10pt;
  }

  .shared-page .brand-logo {
    width: 0.34in;
    height: 0.34in;
  }

  .shared-page .header-nav {
    display: none !important;
  }

  .shared-card-header,
  .shared-master-definition,
  .shared-occurrence-list {
    padding-left: 0;
    padding-right: 0;
  }

  .site-footer {
    display: none;
  }

  .shared-occurrence {
    break-inside: avoid;
  }

  .shared-print-disclaimer {
    display: block;
    margin-top: 0.28in;
    padding: 8px 0 0;
    border-top: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 8pt;
    line-height: 1.32;
    text-align: left;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f5f7fb;
}

.auth-panel,
.admin-panel {
  width: min(100%, 420px);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--surface-shadow);
  padding: 24px;
}

.user-panel.admin-panel {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.auth-logo {
  display: block;
  margin-bottom: 16px;
}

.auth-panel h1,
.admin-panel h2 {
  margin: 0 0 12px;
}

.auth-copy,
.auth-message,
.admin-result {
  color: var(--muted);
}

.admin-result[data-tone="success"] {
  color: #166534;
}

.admin-result[data-tone="error"] {
  color: #b91c1c;
}

.admin-panel-subtitle {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.field-help,
.user-field small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.auth-form-secondary {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.auth-secondary-actions {
  margin-top: 12px;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.admin-layout {
  display: grid;
  align-content: start;
  gap: 0.8rem;
  padding: 0.7rem 0 1.2rem;
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.admin-header h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.user-panel-header {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.user-panel-header h2 {
  margin-bottom: 0.28rem;
}

.user-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 0.65rem;
  align-items: end;
}

.user-tools label {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.user-tools span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.user-tools input,
.user-tools select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.5rem;
  padding: 0.48rem 0.55rem;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
}

.user-list {
  min-width: 0;
  overflow: hidden;
}

.admin-user-table-wrap {
  overflow-x: auto;
}

.admin-user-table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  table-layout: fixed;
  background: #ffffff;
}

.admin-user-table th,
.admin-user-table td {
  padding: 0.64rem 0.78rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.admin-user-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-user-table tbody tr:hover td {
  background: #f8fafc;
}

.admin-user-table tr.is-pending td {
  background: #fffbe6;
}

.admin-user-table td:first-child strong,
.admin-user-table td:first-child span {
  display: block;
}

.admin-user-muted {
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-user-role,
.admin-user-status {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0.18rem 0.48rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-user-status-active {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.admin-user-status-disabled {
  border-color: #e5e7eb;
  background: #f3f4f6;
  color: #6b7280;
}

.admin-user-status-pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.admin-user-action-cell {
  text-align: right;
  width: 7rem;
}

.user-delete-invite-btn {
  color: #b91c1c;
  border-color: #fecaca;
}

.user-delete-invite-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.user-empty {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.admin-user-dialog {
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.55rem;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.22);
}

.admin-user-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.admin-user-dialog form {
  display: grid;
  max-height: calc(100vh - 2rem);
}

.admin-user-dialog-header,
.admin-user-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-user-dialog-header h2 {
  margin: 0 0 0.2rem;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
}

.admin-user-dialog-actions {
  border-top: 1px solid #e2e8f0;
  border-bottom: 0;
}

.admin-user-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  overflow: auto;
}

.admin-user-scope-field {
  grid-column: 1 / -1;
}

.admin-user-scope-field select[multiple] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.scope-multiselect {
  position: relative;
  min-width: 0;
}

.scope-multiselect-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
}

.scope-multiselect.is-disabled .scope-multiselect-control {
  background: #f8fafc;
  color: var(--muted);
}

.scope-multiselect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
  max-height: 5.8rem;
  overflow: auto;
}

.scope-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 100%;
  min-height: 1.7rem;
  padding: 0.18rem 0.28rem 0.18rem 0.48rem;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  background: #eef6ff;
  color: #17365d;
  font-size: 0.78rem;
  font-weight: 800;
}

.scope-tag span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-tag-all {
  background: #f8fafc;
  color: #475569;
}

.scope-tag button {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.09);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.scope-tag button:hover,
.scope-tag button:focus {
  background: rgba(15, 23, 42, 0.17);
}

.scope-multiselect-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.9rem;
  padding: 0 0.55rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.42rem;
  background: #f8fafc;
  color: #334155;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.scope-multiselect-toggle:hover,
.scope-multiselect-toggle:focus {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.scope-multiselect-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.scope-multiselect-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.scope-multiselect-search-row input {
  min-width: 0;
  height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  font: inherit;
}

.scope-multiselect-search-row button {
  height: 2rem;
  padding: 0 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.scope-multiselect-options {
  display: grid;
  max-height: 14rem;
  overflow: auto;
}

.scope-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.scope-option:last-child {
  border-bottom: 0;
}

.scope-option:hover,
.scope-option:focus,
.scope-option.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
}

.scope-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-option-empty {
  padding: 0.8rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-user-permission-field {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: #f8fafc;
}

.admin-user-permission-field legend {
  padding: 0 0.25rem;
  font-weight: 800;
  color: var(--ink);
}

.admin-permission-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}

.admin-permission-group {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  background: #ffffff;
  overflow: hidden;
}

.admin-permission-group h3 {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-family: "Sora", sans-serif;
  font-size: 0.78rem;
}

.admin-permission-rows {
  display: grid;
}

.admin-user-permission-field .admin-permission-row {
  display: flex;
  align-items: center;
  gap: 0.48rem;
  margin: 0;
  padding: 0.48rem 0.58rem;
  border-bottom: 1px solid #eef2f7;
  color: var(--ink);
  font-weight: 600;
}

.admin-user-permission-field .admin-permission-row:last-child {
  border-bottom: 0;
}

.admin-user-permission-field .admin-permission-row.is-off {
  color: var(--muted);
}

.admin-user-permission-field .admin-permission-row.is-added-permission {
  background: #ecfdf5;
}

.admin-user-permission-field .admin-permission-row.is-denied-default {
  background: #fff7ed;
}

.admin-permission-toggle {
  display: inline-flex;
  padding-top: 0.12rem;
}

.admin-user-permission-field input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.admin-permission-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.admin-permission-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
}

.admin-permission-badge {
  flex: 0 0 auto;
  padding: 0.14rem 0.34rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-permission-row.is-role-default .admin-permission-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-permission-row.is-added-permission .admin-permission-badge {
  background: #bbf7d0;
  color: #166534;
}

.admin-permission-row.is-denied-default .admin-permission-badge {
  background: #fed7aa;
  color: #9a3412;
}

.admin-user-dialog-spacer {
  flex: 1;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid #dbe3ee;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  font: inherit;
}

.icon-button:hover,
.icon-button:focus {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.explorer-layout {
  align-content: start;
  padding: 0.7rem 0 1.2rem;
}

.codes-page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.codes-page-header h1 {
  line-height: 1.1;
}

.codes-page-subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.codes-header-action,
.filter-reset-btn,
.panel-action-btn,
.table-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.codes-header-action {
  padding: 0.55rem 0.75rem;
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.codes-header-action:hover,
.filter-reset-btn:hover,
.panel-action-btn:hover,
.table-action-link:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.finder-toolbar,
.filters {
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.finder-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  padding: 0.7rem;
}

.finder-actions {
  display: inline-flex;
  gap: 0.4rem;
}

.finder-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
}

.finder-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.finder-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.finder-btn-danger {
  border-color: #fecaca;
  color: #991b1b;
  background: #fff7f7;
}

.finder-btn-danger:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumb .crumb {
  color: var(--ink);
}

.filters:not(.review-filters) {
  margin-top: 0.7rem;
  padding: 0.7rem;
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(130px, 1fr)) minmax(190px, 1.1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.field {
  display: grid;
  gap: 0.3rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.field-inline {
  align-content: end;
}

.toggle-wrap {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #475569;
}

.toggle-wrap input {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
}

.field input,
.field select {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  padding: 0.48rem 0.58rem;
  background: #ffffff;
  color: var(--ink);
  font-family: inherit;
  min-width: 0;
  box-sizing: border-box;
}

.field input:focus,
.field select:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.field input.filter-active,
.field select.filter-active {
  border-color: #cbd5e1;
}

.field.filter-field-active > span:first-child {
  align-self: flex-start;
  color: #92400e;
  background: #fef3c7;
  border-radius: 0.35rem;
  padding: 0 0.25rem;
  font-weight: 700;
}

.book-filter-chips.filter-active {
  border-radius: 0.7rem;
}

.field .toggle-wrap input[type="checkbox"] {
  width: auto;
  height: auto;
  margin: 0;
}

.filter-reset-btn {
  min-height: 2.45rem;
  padding: 0 0.72rem;
}

.codes-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.7rem;
}

.codes-summary-card {
  position: relative;
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.codes-summary-icon {
  position: absolute;
  top: 0.82rem;
  right: 0.82rem;
  color: #64748b;
}

.codes-summary-card strong {
  display: block;
  margin-top: 0.28rem;
  font-family: "Sora", sans-serif;
  font-size: 1.45rem;
}

.summary-detail {
  display: block;
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.explorer-grid {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
  gap: 0.7rem;
  min-height: 66vh;
}

.panel {
  min-width: 0;
  border: 1px solid var(--panel-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.panel header {
  padding: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.details-panel > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
}

.panel h2 {
  margin: 0;
  font-size: 1rem;
}

.panel-action-btn {
  padding: 0.43rem 0.65rem;
  color: #334155;
}

.panel-action-btn:disabled {
  opacity: 0.46;
  cursor: default;
  background: #f8fafc;
  color: #64748b;
}

.meta {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.item-list {
  list-style: none;
  margin: 0;
  padding: 0.38rem;
  max-height: calc(66vh - 56px);
  overflow: auto;
}

.item-list li button {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--ink);
  padding: 0.52rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
}

.jurisdiction-list-main {
  min-width: 0;
  display: grid;
  gap: 0.16rem;
}

.jurisdiction-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.jurisdiction-list-meta {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.item-list li button:hover,
.item-list li button.active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.item-list .count-pill {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  font-size: 0.76rem;
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
}

.empty-list-state {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding: 0.7rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.table-wrap {
  overflow: auto;
  max-height: calc(66vh - 56px);
}

.live-load-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(22rem, calc(100vw - 2rem));
  z-index: 1000;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.live-load-panel[hidden] {
  display: none;
}

.live-load-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem 0.2rem;
  color: #1e3a8a;
  font-weight: 800;
}

.live-load-log {
  overflow: hidden;
  padding: 0 0.8rem 0.75rem 2.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
}

@media (max-width: 720px) {
  .live-load-panel {
    right: 0.65rem;
    bottom: 0.65rem;
    width: calc(100vw - 1.3rem);
  }

  .review-card,
  .review-card-body,
  .review-card-main {
    min-width: 0;
  }

  .review-card .occ-table,
  .review-card .occ-table tbody,
  .review-card .occ-table tr,
  .review-card .occ-table td {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.52rem 0.6rem;
  text-align: left;
  vertical-align: top;
  font-size: 0.84rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(3, 19, 32, 0.95);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td a {
  color: #9cd2ff;
}

.codes-table {
  min-width: 1080px;
}

.codes-table th,
.codes-table td {
  background: #ffffff;
}

.codes-table th {
  background: #f8fafc;
  color: #475569;
  border-bottom: 1px solid #cbd5e1;
}

.codes-table tbody tr:hover td {
  background: #f8fafc;
}

.codes-table td:first-child {
  font-weight: 700;
  color: #334155;
}

.code-cell,
.label-cell {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.code-cell strong {
  font-family: "Sora", sans-serif;
  font-size: 0.86rem;
}

.code-cell span,
.label-cell span {
  color: var(--muted);
  font-size: 0.76rem;
}

.label-cell strong {
  font-weight: 600;
  line-height: 1.35;
}

.table-action-link {
  width: fit-content;
  min-height: 1.9rem;
  padding: 0.22rem 0.5rem;
  color: #1d4ed8;
}

.missing-link {
  color: #94a3b8;
  font-size: 0.82rem;
}

.table-empty-state {
  display: grid;
  justify-items: center;
  gap: 0.28rem;
  padding: 2rem 1rem;
  color: var(--muted);
  text-align: center;
}

.table-empty-state i {
  font-size: 1.35rem;
  color: #94a3b8;
}

.table-empty-state strong {
  color: var(--ink);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  font-size: 0.74rem;
  border: 1px solid transparent;
}

.status-current {
  color: #166534;
  border-color: #86efac;
  background: #dcfce7;
}

.status-historical {
  color: #92400e;
  border-color: #fcd34d;
  background: #fef3c7;
}

.status-reference {
  color: #1e40af;
  border-color: #93c5fd;
  background: #dbeafe;
}


@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .codes-page-header {
    align-items: start;
  }

  .filters:not(.review-filters) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-reset-btn {
    width: fit-content;
  }

  .codes-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .review-filter-row-workspace,
  .review-filter-row-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-field-export,
  .review-field-workspace-action,
  .review-field-proponent-action {
    justify-self: start;
    min-width: 0;
  }

  .workspace-action-row {
    justify-content: flex-start;
  }

  .review-filter-row-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .phase-track {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  .phase-connector {
    display: none;
  }

  .module-link {
    max-width: 100%;
  }
}

@media (max-width: 820px) {
  .home-layout {
    align-content: start;
    padding: 1.4rem 0;
  }

  .home-lifecycle {
    min-height: auto;
    gap: 2rem;
    padding: 1.4rem 0 3.2rem;
  }

  .home-lifecycle-header h1 {
    max-width: 10ch;
    font-size: clamp(2.4rem, 13vw, 4.2rem);
  }

  .lifecycle-graph {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lifecycle-node {
    min-height: 6.8rem;
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-content: center;
    padding: 1rem;
  }

  .lifecycle-label {
    text-align: left;
  }

  .lifecycle-edge {
    width: 2px;
    height: 2.2rem;
    justify-self: start;
    margin-left: 2.5rem;
  }

  .lifecycle-edge::after {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) rotate(135deg);
  }

  .lifecycle-branch {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    transform: none;
    padding-left: 4rem;
  }

  .lifecycle-branch::before {
    left: 2.5rem;
    top: 4.1rem;
    bottom: auto;
    height: calc(100% - 4.1rem);
  }

  .codes-page-header,
  .details-panel > header {
    flex-direction: column;
    align-items: stretch;
  }

  .codes-header-action,
  .panel-action-btn,
  .filter-reset-btn {
    width: 100%;
  }

  .filters:not(.review-filters),
  .codes-summary {
    grid-template-columns: 1fr;
  }

  .explorer-grid {
    grid-template-columns: 1fr;
  }

  .user-tools {
    grid-template-columns: 1fr;
  }

  .admin-header {
    display: grid;
    align-items: stretch;
  }

  .admin-header .finder-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-user-table {
    min-width: 0;
  }

  .admin-user-table thead {
    display: none;
  }

  .admin-user-table,
  .admin-user-table tbody,
  .admin-user-table tr,
  .admin-user-table td {
    display: block;
    width: 100%;
  }

  .admin-user-table tbody {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem;
    background: #f8fafc;
  }

  .admin-user-table tr {
    border: 1px solid #dbe3ee;
    border-radius: 0.5rem;
    background: #ffffff;
    overflow: hidden;
  }

  .admin-user-table th,
  .admin-user-table td {
    border-bottom: 1px solid #eef2f7;
  }

  .admin-user-table td {
    padding: 0.62rem 0.75rem;
  }

  .admin-user-table td::before {
    display: block;
    content: attr(data-label);
    margin-bottom: 0.25rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .admin-user-table td:last-child {
    border-bottom: 0;
  }

  .admin-user-action-cell {
    text-align: left;
  }

  .admin-user-action-cell .finder-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-user-dialog-grid {
    grid-template-columns: 1fr;
  }

  .scope-multiselect-control {
    grid-template-columns: 1fr;
  }

  .scope-multiselect-toggle {
    justify-content: space-between;
    width: 100%;
  }

  .scope-multiselect-menu {
    position: static;
    margin-top: 0.35rem;
    box-shadow: none;
  }

  .admin-permission-grid {
    grid-template-columns: 1fr;
  }

  .admin-user-permission-field .admin-permission-row {
    align-items: flex-start;
  }

  .admin-user-dialog-actions {
    flex-wrap: wrap;
  }

  .admin-user-dialog-spacer {
    display: none;
  }

  .review-filter-row-workspace,
  .review-filter-row-primary,
  .review-filter-row-secondary {
    grid-template-columns: 1fr;
  }

  .item-list,
  .table-wrap {
    max-height: 42vh;
  }

  .codes-table {
    min-width: 0;
  }

  .codes-table thead {
    display: none;
  }

  .codes-table,
  .codes-table tbody,
  .codes-table tr,
  .codes-table td {
    display: block;
    width: 100%;
  }

  .codes-table tbody {
    padding: 0.55rem;
  }

  .codes-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 0.7rem;
    margin-bottom: 0.55rem;
    overflow: hidden;
    background: #ffffff;
  }

  .codes-table td {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.7rem;
    align-items: start;
    border-bottom: 1px solid #eef2f7;
    padding: 0.55rem 0.65rem;
  }

  .codes-table td:last-child {
    border-bottom: none;
  }

  .codes-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .codes-table td:first-child {
    color: var(--ink);
  }

  .table-action-link {
    width: fit-content;
  }
}
