﻿:root {
  --bg: #eef1f3;
  --surface: #ffffff;
  --surface-soft: #edf2f0;
  --surface-tint: #f7f9fb;
  --ink: #1d2422;
  --muted: #65716d;
  --line: #dce3e2;
  --line-strong: #b9c8c5;
  --green: #176b5b;
  --green-dark: #0f4f43;
  --plum: #59446f;
  --amber: #a86e12;
  --brick: #984237;
  --focus: #2f6f9f;
  --source-blue: #0a2a4f;
  --source-blue-mid: #1d5d93;
  --source-blue-soft: #edf6fc;
  --source-ice: #f6fbff;
  --shadow: 0 10px 28px rgba(22, 31, 29, 0.09);
  --shadow-soft: 0 4px 14px rgba(22, 31, 29, 0.07);
  --font-ui: "Aptos", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --font-reader: "Source Serif 4", "Literata", Cambria, Georgia, "Times New Roman", serif;
  --font-mono: "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  --type-ui: 15px;
  --type-reader: 16px;
  --reader-line: 1.66;
  --reader-measure: 74ch;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--type-ui);
  line-height: 1.45;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.11), rgba(89, 68, 111, 0.11)),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding: min(10vh, 92px) 18px 18px;
  background: rgba(20, 28, 26, 0.28);
  backdrop-filter: blur(10px);
}

.command-panel {
  width: min(680px, 100%);
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(185, 200, 197, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(20, 28, 26, 0.24);
}

.command-search {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
  padding: 6px 7px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.command-search > svg {
  color: var(--green-dark);
}

.command-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.command-title {
  padding: 0 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.command-list {
  max-height: min(56vh, 460px);
  overflow-y: auto;
  display: grid;
  gap: 6px;
}

.command-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.command-item:hover,
.command-item.is-active {
  border-color: #b7d3ca;
  background: #f3faf7;
}

.command-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #dce7e4;
  border-radius: 8px;
  background: var(--surface);
  color: var(--green-dark);
}

.command-item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.command-item-copy strong,
.command-item-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-item-copy strong {
  font-size: 14px;
  font-weight: 850;
}

.command-item-copy span,
.command-item-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.command-item-meta {
  white-space: nowrap;
}

.command-empty {
  padding: 18px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-tint);
  text-align: center;
  font-weight: 750;
}

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

.auth-error {
  min-height: 20px;
  color: var(--brick);
  font-weight: 650;
}

.app-shell.auth-pending {
  filter: blur(2px);
  pointer-events: none;
}

.app-shell.boot-pending {
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  display: grid;
  grid-template-columns:
    var(--lp-filter-col, 300px)
    6px
    minmax(360px, 1fr)
    6px
    var(--lp-reader-col, minmax(450px, 48vw));
  grid-template-rows: 74px minmax(0, 1fr);
  height: 100vh;
  min-height: 620px;
  min-width: 0;
  overflow: hidden;
}

.app-shell.case-view-active {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.app-shell.case-view-active .cases-view,
.app-shell.case-view-active .cases-layout,
.app-shell.case-view-active .case-main {
  height: auto;
  min-height: 0;
  overflow: visible;
}

.app-shell.reader-empty-state {
  grid-template-columns:
    var(--lp-filter-col, 300px)
    6px
    minmax(420px, 1fr)
    0
    0;
}

.app-shell.reader-empty-state .reader-resizer,
.app-shell.reader-empty-state .reader-pane {
  display: none;
}

.app-shell.reader-empty-state .results-pane {
  grid-column: 3 / -1;
}

.app-shell.filters-collapsed {
  grid-template-columns:
    62px
    6px
    minmax(420px, 1fr)
    6px
    var(--lp-reader-col, minmax(450px, 48vw));
}

.app-shell.reader-empty-state.filters-collapsed {
  grid-template-columns:
    62px
    6px
    minmax(420px, 1fr)
    0
    0;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(174px, 0.72fr) minmax(0, 1.72fr) minmax(210px, 0.72fr);
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 250, 0.92)),
    var(--surface);
  border-bottom: 1px solid var(--line);
  min-width: 0;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  display: grid;
  align-content: center;
  gap: 2px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.98), rgba(69, 83, 111, 0.98));
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(23, 107, 91, 0.18);
}

.brand-mark-logo {
  width: 48px;
  height: 48px;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
}

.brand-mark-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(9, 35, 63, 0.12));
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.1;
  color: #08264d;
}

.brand-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.brand-tagline {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding-bottom: 7px;
  color: #1669a8;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.012em;
  text-transform: none;
}

.brand-tagline::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(8, 38, 77, 0.08), rgba(24, 135, 214, 0.74), rgba(23, 107, 91, 0.48), rgba(8, 38, 77, 0.04));
}

.brand-mode-label {
  margin-top: 2px;
  color: rgba(10, 42, 79, 0.50);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.command-trigger {
  flex: 0 0 auto;
  background: var(--surface);
  border-color: rgba(185, 200, 197, 0.9);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.command-trigger[aria-expanded="true"] {
  color: var(--green-dark);
  border-color: #9fc8bb;
  background: #edf7f3;
}

.account-menu-wrap {
  position: relative;
  min-width: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 145px;
  max-width: 230px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  text-align: left;
}

.account-trigger {
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.user-pill-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.user-pill strong,
.user-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pill strong {
  font-size: 12px;
}

.user-pill span {
  color: var(--muted);
  font-size: 11px;
}

.account-chevron {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--muted);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  width: min(280px, 86vw);
  display: grid;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 58px rgba(26, 38, 52, 0.18);
}

.account-menu-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.account-menu-item:hover {
  border-color: var(--line);
  background: var(--surface-tint);
}

.account-menu-item svg {
  width: 18px;
  height: 18px;
  color: var(--green-dark);
}

.account-menu-item span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.account-menu-item strong {
  font-size: 13px;
  line-height: 1.2;
}

.account-menu-item small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
}

.top-tabs {
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  align-items: center;
  gap: 5px;
  width: min(100%, 780px);
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 249, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.top-tab {
  position: relative;
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.top-tab svg {
  width: 19px;
  height: 19px;
  justify-self: center;
  color: currentColor;
}

.top-tab-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.top-tab-copy strong,
.top-tab-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-tab-copy strong {
  color: inherit;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.1;
}

.top-tab-copy small {
  color: rgba(101, 113, 109, 0.86);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.1;
}

.top-tab:hover {
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
}

.top-tab.active {
  background: var(--surface);
  color: var(--green-dark);
  border-color: rgba(159, 200, 187, 0.9);
  box-shadow:
    0 8px 20px rgba(22, 31, 29, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.top-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--focus));
}

.top-tab.active .top-tab-copy small {
  color: rgba(15, 79, 67, 0.76);
}

.status-pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-tint);
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.status-pill.ready .dot {
  background: var(--green);
}

.status-pill.offline .dot {
  background: var(--brick);
}

.icon-button,
.primary-button,
.quiet-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  min-height: 36px;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 120ms ease;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex: 0 0 36px;
  text-decoration: none;
}

.icon-button.active {
  border-color: #9fc8bb;
  background: #e4f1ec;
  color: var(--green-dark);
}

#favoriteDocBtn.active {
  border-color: #e0c15b;
  background: #fff7d9;
  color: #8a6400;
}

#copyCitationBtn.copied {
  border-color: var(--green);
  background: #edf7f3;
  color: var(--green-dark);
}

#copyCitationBtn[data-copy-state="failed"] {
  border-color: var(--amber);
  background: #fff8e7;
  color: #8a6400;
}

.icon-button:hover,
.quiet-button:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.icon-button:active,
.primary-button:active,
.quiet-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.danger-button {
  color: var(--brick);
}

.danger-button:hover {
  border-color: #d8aaa4;
  background: #fff3f1;
  color: #7e3028;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-dark);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  background: var(--surface-tint);
}

.full-width {
  width: 100%;
}

.filters-pane,
.results-pane,
.reader-pane {
  min-height: 0;
  overflow: hidden;
}

.filters-pane {
  grid-column: 1;
  grid-row: 2;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-tint);
  overflow-y: auto;
}

.workspace-resizer {
  grid-row: 2;
  position: relative;
  z-index: 6;
  cursor: col-resize;
  background:
    linear-gradient(90deg, transparent 0, transparent 2px, var(--line) 2px, var(--line) 4px, transparent 4px);
  transition:
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.workspace-resizer::after {
  content: "";
  position: absolute;
  inset: 0 1px;
  border-radius: 999px;
}

.workspace-resizer:hover,
.workspace-resizer.is-dragging {
  background-color: rgba(47, 111, 159, 0.08);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 159, 0.18);
}

.filter-resizer {
  grid-column: 2;
}

.reader-resizer {
  grid-column: 4;
}

body.is-resizing-workspace {
  cursor: col-resize;
  user-select: none;
}

.pane-heading,
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
}

.pane-heading {
  margin-bottom: 18px;
}

.filter-pane-heading {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-heading-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.filter-heading-copy svg {
  flex: 0 0 auto;
}

.filter-heading-copy > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.filter-heading-copy span {
  color: var(--ink);
  font-weight: 850;
}

.filter-heading-copy small {
  color: var(--muted);
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-panel-body {
  display: grid;
  gap: 10px;
}

.app-shell.filters-collapsed .filters-pane {
  padding: 16px 10px;
  overflow: hidden;
  background: #f7faf9;
}

.app-shell.filters-collapsed .filter-pane-heading {
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

.app-shell.filters-collapsed .filter-heading-copy {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  color: var(--green-dark);
}

.app-shell.filters-collapsed .filter-panel-body,
.app-shell.filters-collapsed .filter-heading-copy > div {
  display: none;
}

.app-shell.filters-collapsed .filter-heading-copy::after {
  content: "Filtre";
  color: #58756c;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.app-shell.filters-collapsed #filterPaneToggle {
  margin: 0 auto;
  border-color: rgba(159, 200, 187, 0.78);
  background: #ffffff;
  color: var(--green-dark);
  box-shadow: 0 6px 18px rgba(22, 31, 29, 0.05);
}

.filter-group,
.advanced-filter-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.02);
}

.filter-group-title {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.advanced-filter-panel > summary {
  display: grid;
  gap: 2px;
  cursor: pointer;
  list-style: none;
}

.advanced-filter-panel > summary::-webkit-details-marker {
  display: none;
}

.advanced-filter-panel > summary strong {
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
}

.advanced-filter-panel > summary span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.filter-group .field,
.advanced-filter-panel .field {
  margin-bottom: 0;
}

.compact-field {
  margin-bottom: 8px;
}

.field span {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 111, 159, 0.16);
}

.year-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.source-stack {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.source-stack-heading {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-line strong {
  font-size: 13.5px;
}

.stat-line span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.compact-stat {
  padding: 8px 9px;
}

.results-pane {
  grid-column: 3;
  grid-row: 2;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    linear-gradient(180deg, rgba(247, 250, 249, 0.92), rgba(255, 255, 255, 0) 180px),
    var(--surface);
}

.research-command {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.08), rgba(47, 111, 159, 0.06)),
    var(--surface);
}

.searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 0;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-input-wrap input {
  height: 48px;
  padding-left: 42px;
  border-color: rgba(185, 200, 197, 0.95);
  background: rgba(255, 255, 255, 0.96);
  font-size: 15.5px;
  box-shadow: 0 8px 24px rgba(22, 31, 29, 0.06);
}

.search-submit {
  min-width: 164px;
  min-height: 48px;
  font-weight: 850;
}

.active-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.active-filter-bar {
  align-items: center;
}

.active-filter-bar:empty {
  display: none;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 3px 8px 3px 10px;
  border: 1px solid #cbd9d5;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.active-filter-chip span {
  color: var(--muted);
  font-weight: 800;
}

.active-filter-chip strong {
  font-weight: 800;
}

.active-filter-chip svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.active-filter-chip .chip-leading-icon {
  width: 14px;
  height: 14px;
  color: currentColor;
}

.active-filter-chip .chip-remove-icon {
  width: 13px;
  height: 13px;
  margin-left: 1px;
  color: rgba(101, 113, 109, 0.72);
}

.active-filter-chip:hover .chip-remove-icon {
  color: var(--brick);
}

.query-token-chip {
  border-color: #a9c7bd;
  background: #edf7f3;
  color: var(--green-dark);
}

.query-token-chip span {
  color: #58756c;
}

.query-token-chip svg {
  color: var(--green-dark);
}

.query-token-chip:hover {
  border-color: #7fac9e;
  background: #e3f1ec;
}

.favorite-filter-chip {
  border-color: rgba(212, 167, 44, 0.42);
  background: #fffaf0;
  color: #73510f;
}

.favorite-filter-chip strong {
  color: #73510f;
}

.favorite-filter-chip:hover {
  border-color: rgba(212, 167, 44, 0.72);
  background: #fff6dc;
}

.research-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.research-toggle-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(185, 200, 197, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #38413e;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    transform 120ms ease;
}

.research-toggle-button svg {
  width: 16px;
  height: 16px;
}

.research-toggle-button:hover {
  border-color: #caa747;
  background: #fffaf0;
  color: #73510f;
  transform: translateY(-1px);
}

.research-toggle-button.active {
  border-color: #d4a72c;
  background: linear-gradient(135deg, rgba(212, 167, 44, 0.18), rgba(255, 255, 255, 0.86));
  color: #6a490c;
  box-shadow: inset 0 0 0 1px rgba(212, 167, 44, 0.16);
}

.research-toggle-button.is-applied {
  display: none;
}

.research-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(112px, 0.55fr));
  gap: 8px;
}

.research-overview:empty {
  display: none;
}

.research-overview-card {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(185, 200, 197, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.research-overview-card span {
  color: var(--muted);
  overflow: hidden;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.research-overview-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-overview-card.primary {
  border-color: rgba(23, 107, 91, 0.20);
  background: linear-gradient(135deg, rgba(23, 107, 91, 0.08), rgba(255, 255, 255, 0.86));
}

.results-toolbar,
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.results-toolbar select {
  width: 88px;
}

.results-toolbar.is-start-state {
  display: none;
}

.results-toolbar.is-start-state .result-limit-control {
  display: none;
}

.pager.is-start-state {
  display: none;
}

.result-list {
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background: #fbfcfc;
}

.result-list.is-loading {
  opacity: 0.76;
}

.research-start-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 42px 20px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 24%, rgba(23, 107, 91, 0.08), transparent 32%),
    #fbfcfc;
}

.research-start-main {
  max-width: 560px;
  display: grid;
  gap: 8px;
}

.research-start-main span {
  color: var(--green-dark);
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.research-start-main strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.22;
}

.research-start-main p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.research-start-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.research-start-actions button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(185, 200, 197, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.90);
  color: #2d3935;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(22, 31, 29, 0.06);
}

.research-start-actions button:hover {
  border-color: rgba(23, 107, 91, 0.30);
  background: #f2faf7;
  color: var(--green-dark);
  transform: translateY(-1px);
}

.research-start-actions svg {
  width: 17px;
  height: 17px;
}

.result-skeleton {
  display: grid;
  gap: 9px;
}

.skeleton-row {
  display: grid;
  gap: 11px;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #edf2f0 0%, #f7faf9 48%, #edf2f0 100%);
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-line.short {
  width: 38%;
}

.skeleton-line.medium {
  width: 64%;
}

.skeleton-line.long {
  width: 86%;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.result-row {
  display: grid;
  gap: 9px;
  margin-bottom: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.result-row:hover,
.result-row.active {
  background: #f8fcfa;
  border-color: #b7d3ca;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.result-row:focus-visible,
.direct-match-card:focus-visible {
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px rgba(47, 111, 159, 0.14),
    var(--shadow-soft);
  outline: none;
}

.result-row.active {
  border-left-color: var(--green);
  background: #f5fbf8;
  box-shadow:
    inset 0 0 0 1px rgba(23, 107, 91, 0.10),
    0 12px 28px rgba(22, 31, 29, 0.08);
}

.result-row.favorite {
  border-left-color: #d4a72c;
}

.result-row.favorite.active {
  border-left-color: #b8860b;
}

.authority-rail {
  --authority-color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.authority-rail strong {
  color: var(--ink);
  font-size: 12.5px;
}

.authority-rail span,
.authority-rail time {
  line-height: 1.2;
}

.authority-rank {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--authority-color) 42%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--authority-color) 12%, white);
  color: color-mix(in srgb, var(--authority-color) 72%, black);
  font-variant-numeric: tabular-nums;
}

.authority-rail.very-high {
  --authority-color: var(--green);
}

.authority-rail.high {
  --authority-color: var(--focus);
}

.authority-rail.medium {
  --authority-color: var(--amber);
}

.authority-rail.low {
  --authority-color: var(--brick);
}

.authority-rail.support {
  --authority-color: #1f7a62;
}

.quiet-tags {
  opacity: 0.92;
}

.result-title-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.result-open-hint {
  align-self: start;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  opacity: 0;
  transform: translateX(-2px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.result-row:hover .result-open-hint,
.result-row.active .result-open-hint {
  border-color: rgba(23, 107, 91, 0.18);
  background: #edf7f3;
  color: var(--green-dark);
  opacity: 1;
  transform: translateX(0);
}

.result-authority-signal {
  --authority-color: var(--muted);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.result-authority-signal strong {
  color: #26312d;
  font-size: 12.5px;
}

.result-authority-signal.very-high {
  --authority-color: var(--green);
}

.result-authority-signal.high {
  --authority-color: var(--focus);
}

.result-authority-signal.medium {
  --authority-color: var(--amber);
}

.result-authority-signal.low {
  --authority-color: var(--brick);
}

.result-authority-signal.support {
  --authority-color: #1f7a62;
}

.result-relevance-line {
  --relevance-color: var(--muted);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--relevance-color) 18%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--relevance-color) 6%, white);
  color: #3b4642;
  font-size: 12.5px;
  line-height: 1.35;
}

.result-relevance-line strong {
  color: color-mix(in srgb, var(--relevance-color) 74%, #26312d);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.result-relevance-line span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-relevance-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--relevance-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--relevance-color) 14%, transparent);
}

.result-relevance-line.favorite {
  --relevance-color: #b8860b;
}

.result-relevance-line.direct,
.result-relevance-line.content {
  --relevance-color: var(--green);
}

.result-relevance-line.very-high {
  --relevance-color: var(--green);
}

.result-relevance-line.high {
  --relevance-color: var(--focus);
}

.result-relevance-line.medium {
  --relevance-color: var(--amber);
}

.result-relevance-line.low {
  --relevance-color: var(--brick);
}

.result-relevance-line.support {
  --relevance-color: #1f7a62;
}

.muted-chip {
  border-style: dashed;
  color: var(--muted);
  background: #f6f7f5;
}

.direct-match-stack {
  display: grid;
  gap: 8px;
  padding: 0 0 10px;
  border-bottom: 0;
  background: #f7faf8;
}

.direct-match-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #9fc8bb;
  border-left: 4px solid var(--green);
  border-radius: 10px;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.direct-match-card:hover {
  border-color: #74aa99;
  box-shadow:
    0 0 0 1px rgba(23, 107, 91, 0.08),
    0 14px 28px rgba(22, 31, 29, 0.09);
  transform: translateY(-1px);
}

.direct-match-head,
.result-card-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.direct-match-card.active {
  outline: 2px solid rgba(23, 107, 91, 0.16);
}

.direct-match-card.djv-direct,
.result-row.djv-row {
  border-color: rgba(31, 122, 98, 0.28);
  background:
    linear-gradient(90deg, rgba(31, 122, 98, 0.10), rgba(255, 255, 255, 0) 34%),
    var(--surface);
}

.direct-match-card.djv-direct {
  border-left-color: #1f7a62;
  box-shadow: inset 4px 0 0 rgba(31, 122, 98, 0.68), var(--shadow-soft);
}

.direct-match-kicker {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.result-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.result-identity > * {
  min-width: 0;
}

.result-identity > * + *::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 7px;
  border-radius: 999px;
  background: #b9c8c5;
  vertical-align: middle;
}

.result-citation {
  color: var(--ink);
  font-weight: 900;
}

.authority-badge {
  flex: 0 0 auto;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #cbd9d5;
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.authority-badge.very-high {
  border-color: #abd2c5;
  background: #edf8f3;
  color: var(--green-dark);
}

.authority-badge.high {
  border-color: #b8d0df;
  background: #edf5fa;
  color: #285b78;
}

.authority-badge.medium {
  border-color: #e5cf94;
  background: #fff9e9;
  color: #7b520f;
}

.authority-badge.low {
  border-color: #e5b8ad;
  background: #fff1ee;
  color: #8d3325;
}

.authority-badge.support {
  border-color: rgba(31, 122, 98, 0.30);
  background: rgba(31, 122, 98, 0.09);
  color: #1f6b58;
}

.direct-match-title {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 850;
  line-height: 1.35;
}

.direct-match-meta,
.direct-match-reason {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.djv-chip {
  border-color: rgba(31, 122, 98, 0.34);
  background: rgba(31, 122, 98, 0.10);
  color: #1f6b58;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}

.result-title {
  border: 0;
  padding: 0;
  background: transparent;
  display: -webkit-box;
  overflow: hidden;
  text-align: left;
  font-weight: 750;
  font-size: 16px;
  line-height: 1.32;
  color: var(--ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-title:hover {
  color: var(--green-dark);
}

.result-snippet {
  display: -webkit-box;
  overflow: hidden;
  color: #38413e;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.result-preview-fallback {
  color: #59645f;
  background:
    linear-gradient(90deg, rgba(247, 250, 249, 0.96), rgba(255, 255, 255, 0));
  border-left: 2px solid rgba(185, 200, 197, 0.82);
  padding-left: 9px;
}

.result-empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
}

.result-empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.result-empty-state span {
  max-width: 440px;
  color: var(--muted);
  line-height: 1.5;
}

.result-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}

mark {
  background: #ffec99;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 28px;
  overflow: hidden;
}

.chip,
.label-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: #3c4541;
  font-size: 12.5px;
  line-height: 1.2;
}

.label-remove {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.label-remove:hover {
  background: rgba(152, 66, 55, 0.1);
  color: var(--brick);
}

.label-remove svg {
  width: 12px;
  height: 12px;
}

.ai-chip {
  background: #e8eef8;
  color: #254b7a;
  border: 1px solid #bfd1ea;
}

.legal-chip {
  background: #edf7f3;
  color: var(--green-dark);
  border: 1px solid #9fc8bb;
  font-weight: 750;
}

.pager {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.reader-pane {
  grid-column: 5;
  grid-row: 2;
  background: var(--surface-tint);
  border-left: 1px solid var(--line);
}

.app-shell.reader-wide {
  grid-template-columns: 260px 6px minmax(320px, 0.72fr) 6px minmax(650px, 62vw);
}

.app-shell.reader-focus {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.reader-focus .filters-pane,
.app-shell.reader-focus .results-pane,
.app-shell.reader-focus .workspace-resizer {
  display: none;
}

.app-shell.reader-focus .reader-pane {
  grid-column: 1 / -1;
  border-left: 0;
}

.app-shell.reader-minimized {
  grid-template-columns: var(--lp-filter-col, 300px) 6px minmax(390px, 1fr) 6px 56px;
}

.app-shell.reader-minimized .reader-pane {
  overflow: hidden;
}

.app-shell.reader-wide.filters-collapsed {
  grid-template-columns: 62px 6px minmax(320px, 0.72fr) 6px minmax(650px, 62vw);
}

.app-shell.reader-minimized.filters-collapsed {
  grid-template-columns: 62px 6px minmax(390px, 1fr) 6px 56px;
}

.reader-empty {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.reader-empty svg {
  width: 38px;
  height: 38px;
  color: var(--green);
}

.reader-content {
  --reader-zoom: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.view-hidden {
  display: none !important;
}

.doc-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.doc-actions {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.reader-size-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid rgba(185, 200, 197, 0.78);
  border-radius: 10px;
  background: #f7faf9;
}

.reader-navigation-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border: 1px solid rgba(185, 200, 197, 0.78);
  border-radius: 10px;
  background: #f7faf9;
}

.reader-navigation-actions .icon-button,
.reader-navigation-actions .compact-text-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  background: transparent;
}

.reader-navigation-actions .icon-button:hover,
.reader-navigation-actions .icon-button.active,
.reader-navigation-actions .compact-text-button:hover {
  border-color: rgba(159, 200, 187, 0.78);
  background: #ffffff;
}

.compact-text-button {
  color: #283632;
  font-size: 17px;
  font-weight: 850;
  line-height: 1;
}

.reader-zoom-value {
  min-width: 50px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.reader-zoom-value:hover,
.reader-zoom-value.active {
  border-color: rgba(159, 200, 187, 0.78);
  background: #ffffff;
  color: var(--green-dark);
}

.reader-size-actions .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  background: transparent;
}

.reader-size-actions .icon-button:hover,
.reader-size-actions .icon-button.active {
  border-color: rgba(159, 200, 187, 0.78);
  background: #ffffff;
}

.reader-more-actions-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 34;
  width: max-content;
  max-width: min(230px, 88vw);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 55px rgba(26, 38, 52, 0.18);
}

.reader-find-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 36;
  width: min(520px, calc(100vw - 36px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 55px rgba(26, 38, 52, 0.18);
}

.reader-find-row {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto auto auto auto;
  gap: 6px;
  align-items: center;
}

.reader-find-row > svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.reader-find-row input {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.reader-find-row .icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
}

.reader-find-count {
  min-width: 54px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.print-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 30;
  width: min(290px, 86vw);
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(26, 38, 52, 0.18);
}

.citation-copy-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 32;
  width: min(380px, 90vw);
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(26, 38, 52, 0.18);
}

.reader-settings-panel {
  position: absolute;
  top: 44px;
  right: 0;
  z-index: 33;
  width: min(280px, 90vw);
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 55px rgba(26, 38, 52, 0.18);
}

.reader-setting-group {
  display: grid;
  gap: 7px;
}

.reader-setting-group > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.reader-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.reader-toggle-row button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: #34413d;
  font-size: 12.5px;
  font-weight: 750;
}

.reader-toggle-row button:hover {
  border-color: var(--line-strong);
  background: #edf7f3;
}

.reader-toggle-row button.active {
  border-color: #8fbbae;
  background: #e3f1ec;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 91, 0.08);
}

.citation-copy-panel textarea {
  min-height: 118px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.45;
}

.print-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.print-panel input {
  width: auto;
  min-height: 0;
  margin: 0;
}

.print-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.print-notes-summary {
  display: none;
}

.doc-kicker {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
}

.doc-header h1 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.28;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reader-content.doc-header-collapsed {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.reader-content.doc-header-collapsed .doc-header {
  align-items: center;
  padding: 8px 10px 8px 12px;
  gap: 10px;
  background: rgba(255, 255, 255, 0.96);
}

.reader-content.doc-header-collapsed .doc-header > div:first-child {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.reader-content.doc-header-collapsed .doc-kicker {
  min-width: max-content;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.reader-content.doc-header-collapsed .doc-header h1 {
  min-width: 0;
  overflow: hidden;
  color: #26312d;
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-content.doc-header-collapsed .meta-grid,
.reader-content.doc-header-collapsed .legal-compass,
.reader-content.doc-header-collapsed .source-identity-banner,
.reader-content.doc-header-collapsed .doc-outline {
  display: none !important;
}

.doc-data-panel {
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.doc-data-panel > summary {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.doc-data-panel > summary::-webkit-details-marker {
  display: none;
}

.doc-data-panel > summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.doc-data-panel > summary strong {
  min-width: 0;
  overflow: hidden;
  color: #26312d;
  font-size: 12.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-data-panel > summary small {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-height: 136px;
  overflow: auto;
  background: var(--line);
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.meta-item {
  min-width: 0;
  padding: 9px 12px;
  background: var(--surface-tint);
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 4px;
}

.meta-item strong {
  display: -webkit-box;
  overflow-wrap: anywhere;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.reader-context-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(23, 107, 91, 0.14);
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.08), rgba(47, 111, 159, 0.05)),
    #fbfcfc;
}

.reader-context-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.reader-context-main span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.reader-context-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-context-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.reader-context-facts span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid rgba(185, 200, 197, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #38413e;
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}

.legal-compass {
  max-height: 154px;
  overflow: auto;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
  scrollbar-width: thin;
}

.legal-compass-card {
  --compass-color: var(--focus);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
  gap: 10px 14px;
  padding: 10px 14px;
  border-left: 4px solid var(--compass-color);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--compass-color) 7%, transparent), transparent 34%),
    #fbfcfc;
}

.legal-compass-card.very-high {
  --compass-color: var(--green);
}

.legal-compass-card.high {
  --compass-color: var(--focus);
}

.legal-compass-card.medium {
  --compass-color: var(--amber);
}

.legal-compass-card.low {
  --compass-color: var(--brick);
}

.legal-compass-card.support {
  --compass-color: #1f7a62;
}

.legal-compass-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.legal-compass-main span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.legal-compass-main strong {
  color: var(--ink);
  font-size: 15px;
}

.legal-compass-main small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.legal-compass-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.legal-compass-metrics span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.legal-compass-metrics strong {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.legal-compass-signals {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.legal-compass-signals span {
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--compass-color) 22%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--compass-color) 8%, white);
  color: #34413d;
  font-size: 11.5px;
  font-weight: 750;
}

.source-identity-banner {
  max-height: 88px;
  overflow: auto;
  padding: 0;
  border-bottom: 1px solid rgba(31, 122, 98, 0.18);
  background: #fbfdfa;
  scrollbar-width: thin;
}

.source-identity-details {
  padding: 8px 12px 8px 14px;
  border-left: 3px solid rgba(31, 122, 98, 0.66);
}

.source-identity-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 750;
  list-style: none;
}

.source-identity-details summary::-webkit-details-marker {
  display: none;
}

.source-identity-details summary::after {
  content: "Vis";
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.source-identity-details[open] summary::after {
  content: "Skjul";
}

.source-identity-details strong {
  color: var(--ink);
  font-size: 13.5px;
}

.source-identity-details p {
  max-width: 860px;
  margin: 6px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-pill {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid rgba(31, 122, 98, 0.30);
  border-radius: 999px;
  background: rgba(31, 122, 98, 0.10);
  color: #1f6b58;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.source-identity-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

.source-identity-facts span {
  padding: 5px 7px;
  border: 1px solid rgba(84, 97, 114, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
  white-space: nowrap;
}

.doc-outline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-height: 50px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.doc-outline > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.doc-outline > div {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.doc-outline button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: #38413e;
  font-size: 12px;
  font-weight: 750;
}

.doc-outline button:hover {
  border-color: var(--line-strong);
  background: #edf7f3;
}

.workspace-split {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
}

.reader-focus .workspace-split {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.doc-text-panel {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 248, 0)),
    #f4f7f6;
}

.doc-text-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  min-width: 100%;
  min-height: 100%;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.doc-text-panel pre {
  position: relative;
  z-index: 2;
  width: min(100%, var(--reader-measure));
  min-height: 100%;
  margin: 0 auto;
  padding: 34px 42px 50px;
  border-left: 1px solid rgba(185, 200, 197, 0.55);
  border-right: 1px solid rgba(185, 200, 197, 0.55);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: #222c29;
  font-family: var(--font-reader);
  font-size: calc(var(--type-reader) * var(--reader-zoom, 1));
  line-height: var(--reader-line);
  background: var(--surface);
  tab-size: 2;
}

.reader-font-serif .doc-text-panel pre {
  font-family: var(--font-reader);
}

.reader-font-sans .doc-text-panel pre {
  font-family: var(--font-ui);
}

.reader-density-comfort .doc-text-panel pre {
  width: min(100%, 74ch);
  padding: 36px 44px 54px;
  font-size: calc(16px * var(--reader-zoom, 1));
  line-height: 1.66;
}

.reader-density-compact .doc-text-panel pre {
  width: min(100%, 82ch);
  padding: 24px 34px 42px;
  font-size: calc(15px * var(--reader-zoom, 1));
  line-height: 1.52;
}

.reader-focus .reader-density-comfort .doc-text-panel pre {
  width: min(100%, 78ch);
}

.reader-focus .reader-density-compact .doc-text-panel pre {
  width: min(100%, 88ch);
}

.side-workbench {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface-tint);
}

.workbench-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 250, 249, 0.96);
  backdrop-filter: blur(12px);
}

.workbench-tabs button {
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.workbench-tabs button:hover {
  border-color: rgba(23, 107, 91, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: var(--green-dark);
}

.workbench-tabs button.active {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px rgba(23, 107, 91, 0.08);
}

.workbench-tab-panel {
  display: none;
}

.workbench-tab-panel.active {
  display: block;
}

.reader-collapsed {
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  background: var(--surface-tint);
}

.reader-collapsed span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0;
}

.workbench-section {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-bridge-card {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid rgba(24, 135, 214, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.13), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 255, 0.72));
  box-shadow: 0 12px 28px rgba(6, 26, 51, 0.045);
}

.profile-bridge-card strong {
  color: var(--water-deep, var(--source-blue, #0a2a4f));
  font-size: 13px;
  font-weight: 880;
  line-height: 1.25;
}

.profile-bridge-card span {
  color: rgba(10, 42, 79, 0.66);
  font-size: 12px;
  font-weight: 710;
  line-height: 1.45;
}

.bridge-primary-action {
  min-height: 38px;
  margin-top: 2px;
  border-color: rgba(15, 76, 154, 0.28);
  background:
    linear-gradient(180deg, rgba(18, 91, 174, 0.98), rgba(8, 61, 131, 0.98));
  color: #fff;
  box-shadow: 0 14px 30px rgba(8, 61, 131, 0.16);
}

.bridge-primary-action svg {
  width: 16px;
  height: 16px;
}

.bridge-primary-action:hover {
  background:
    linear-gradient(180deg, rgba(20, 104, 192, 0.98), rgba(10, 71, 150, 0.98));
}

.bridge-secondary-action {
  margin-top: 8px;
  color: var(--water-deep, var(--source-blue, #0a2a4f));
  font-weight: 780;
}

.section-title {
  margin-bottom: 10px;
}

.mini-heading {
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compact-empty {
  padding: 10px 0;
  text-align: left;
}

.citator-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.source-status-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(185, 200, 197, 0.84);
  border-left: 4px solid var(--focus);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 250, 0.92)),
    var(--surface);
  box-shadow: 0 8px 22px rgba(22, 31, 29, 0.06);
}

.source-status-card.very-high {
  border-left-color: var(--green);
}

.source-status-card.high {
  border-left-color: var(--focus);
}

.source-status-card.medium {
  border-left-color: var(--amber);
}

.source-status-card.low {
  border-left-color: var(--line-strong);
}

.source-status-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.source-status-head span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.source-status-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.source-status-head em {
  max-width: 112px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #4b5653;
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
  text-align: right;
}

.source-status-card p {
  margin: 0;
  color: #3e4a47;
  font-size: 12.5px;
  line-height: 1.35;
}

.source-status-verdict {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  border: 1px solid rgba(185, 200, 197, 0.72);
  border-left: 3px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.source-status-verdict.watch {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.source-status-verdict.linked {
  border-left-color: var(--focus);
  background: rgba(47, 111, 159, 0.055);
}

.source-status-verdict.stable {
  border-left-color: var(--green);
  background: rgba(31, 122, 98, 0.055);
}

.source-status-verdict strong {
  font-size: 12.5px;
  line-height: 1.25;
}

.source-status-verdict span {
  color: var(--muted);
  font-size: 11.6px;
  line-height: 1.3;
}

.source-status-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.source-status-metrics span {
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid rgba(185, 200, 197, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 10.4px;
  font-weight: 720;
  line-height: 1.2;
  text-align: center;
}

.source-status-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.1;
}

.source-hierarchy {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.source-hierarchy span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px 3px 4px;
  border: 1px solid rgba(185, 200, 197, 0.64);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #59625f;
  font-size: 10px;
  font-weight: 760;
}

.source-hierarchy span.active {
  border-color: rgba(23, 107, 91, 0.36);
  background: rgba(23, 107, 91, 0.09);
  color: var(--green-dark);
}

.source-hierarchy i {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: rgba(22, 31, 29, 0.07);
  color: inherit;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
}

.authority-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 10px;
  background: var(--surface);
}

.authority-card.very-high {
  border-left-color: var(--green);
}

.authority-card.high {
  border-left-color: var(--focus);
}

.authority-card.medium {
  border-left-color: var(--amber);
}

.authority-card.low {
  border-left-color: var(--brick);
}

.authority-card span,
.authority-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.authority-card strong {
  display: block;
  margin-top: 2px;
}

.citator-verdict {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 9px;
  background: #fbfcfb;
}

.citator-verdict.watch,
.citator-verdict.linked {
  border-left-color: var(--amber);
  background: #fffdf7;
}

.citator-verdict.stable {
  border-left-color: var(--green);
  background: #f2f8f5;
}

.citator-verdict.quiet {
  border-left-color: var(--line-strong);
}

.citator-verdict strong {
  font-size: 13px;
}

.citator-verdict span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.authority-signals,
.authority-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.authority-signals span,
.authority-levels span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: #38413e;
  font-size: 11.5px;
  font-weight: 750;
}

.authority-levels {
  grid-column: 1 / -1;
}

.authority-levels span {
  justify-content: space-between;
  border-radius: 8px;
}

.authority-levels strong {
  margin: 0;
  color: var(--muted);
}

.citator-priority {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
}

.citator-priority .mini-heading {
  margin-top: 0;
}

.citator-priority-list {
  display: grid;
  gap: 7px;
}

.citator-priority-item {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.relation-pill {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 159, 0.22);
  background: rgba(47, 111, 159, 0.08);
  color: #245f8e;
  font-size: 11px;
  font-weight: 750;
}

.citator-list {
  display: grid;
  gap: 8px;
}

.citator-relation-group {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 9px;
  background: #fbfcfb;
}

.citator-relation-group.watch {
  border-left-color: var(--amber);
  background: #fffaf0;
}

.citator-relation-group.linked {
  border-left-color: var(--focus);
  background: rgba(47, 111, 159, 0.045);
}

.citator-relation-group.stable {
  border-left-color: var(--green);
  background: rgba(31, 122, 98, 0.045);
}

.citator-group-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.citator-group-head strong {
  display: block;
  color: var(--ink);
  font-size: 12.8px;
  line-height: 1.25;
}

.citator-group-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.6px;
  line-height: 1.35;
}

.citator-group-head em {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(185, 200, 197, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #41514d;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.citator-group-items {
  display: grid;
  gap: 7px;
}

.citator-item {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.4;
}

.citator-item.watch {
  border-color: rgba(212, 167, 44, 0.24);
}

.citator-item.linked {
  border-color: rgba(47, 111, 159, 0.22);
}

.citator-item.stable {
  border-color: rgba(31, 122, 98, 0.20);
}

.citator-item.unlinked {
  background: #fbfaf6;
}

.djv-support-section {
  border-left: 3px solid rgba(126, 142, 138, 0.34);
  opacity: 0.88;
}

.djv-support-list {
  display: grid;
  gap: 8px;
}

.djv-support-details {
  border: 1px solid rgba(185, 200, 197, 0.62);
  border-radius: 9px;
  background: rgba(248, 251, 250, 0.72);
}

.djv-support-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.djv-support-details > summary::-webkit-details-marker,
.citation-context-details summary::-webkit-details-marker {
  display: none;
}

.djv-support-details > summary strong {
  color: #4b5653;
  font-size: 13px;
}

.djv-support-details > summary span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 750;
}

.djv-support-items {
  display: grid;
  gap: 8px;
  padding: 0 8px 8px;
}

.djv-support-item {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(185, 200, 197, 0.62);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  line-height: 1.4;
}

.citator-title {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 750;
  line-height: 1.3;
}

.citator-title:hover {
  color: var(--green-dark);
}

.citator-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.citator-context {
  margin-top: 7px;
  color: #38413e;
  font-size: 13px;
  line-height: 1.5;
}

.citation-context-details {
  margin-top: 7px;
}

.citation-context-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 800;
  list-style: none;
}

.citation-context-details[open] summary {
  border-color: #b5c8bf;
  background: #edf7f3;
  color: var(--green-dark);
}

.label-list,
.notes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.notes-list {
  display: grid;
}

.annotation-manager {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(250, 252, 251, 0.92), rgba(244, 248, 246, 0.72)),
    var(--surface);
}

.annotation-manager-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.annotation-manager-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.annotation-manager-head strong {
  font-size: 12.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.annotation-manager-head span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
}

.annotation-owner-row {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(48px, 1fr));
  gap: 5px;
  align-self: start;
}

.annotation-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.annotation-manager button {
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 750;
}

.annotation-manager button.active {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1px rgba(80, 137, 118, 0.12);
}

.annotation-manager button span {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.note-item {
  position: relative;
  padding: 9px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--note-color, var(--focus));
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  line-height: 1.45;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.note-item:hover {
  border-color: color-mix(in srgb, var(--note-color, var(--focus)) 38%, var(--line));
  box-shadow: 0 10px 22px rgba(22, 31, 29, 0.08);
  transform: translateY(-1px);
}

.note-item:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow:
    0 0 0 3px rgba(47, 111, 159, 0.14),
    var(--shadow-soft);
}

.note-item.star-note {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--note-color, #b57614) 13%, transparent), transparent 46%),
    var(--surface);
  border-color: color-mix(in srgb, var(--note-color, #b57614) 42%, var(--line));
  border-left-color: var(--note-color, #b57614);
}

.note-item.mark-note {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--note-color, #2f6f9f) 10%, transparent), transparent 44%),
    var(--surface);
}

.note-item.active {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(47, 111, 159, 0.12);
}

.note-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.passage-card {
  display: grid;
  gap: 8px;
}

.passage-card-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.passage-card-title strong {
  color: var(--ink);
  font-size: 13px;
}

.passage-card-title span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
}

.passage-card-body {
  color: #2f3b38;
  font-size: 13px;
  line-height: 1.5;
}

.passage-card-empty {
  padding: 8px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfb;
  font-size: 12.5px;
}

.passage-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.passage-card-footer > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--note-color, var(--focus)) 28%, var(--line));
  border-radius: 999px;
  color: color-mix(in srgb, var(--note-color, var(--focus)) 74%, #26322f);
  background: color-mix(in srgb, var(--note-color, var(--focus)) 10%, white);
  font-size: 11px;
  font-weight: 850;
}

.note-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef4f7;
  color: #315469;
  font-size: 11px;
  font-weight: 800;
}

.note-type-badge i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--note-color, var(--focus));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--note-color, var(--focus)) 18%, transparent);
}

.note-type-badge.star {
  background: color-mix(in srgb, var(--note-color, #b57614) 18%, white);
  color: color-mix(in srgb, var(--note-color, #b57614) 78%, black);
}

.note-type-badge.mark {
  background: color-mix(in srgb, var(--note-color, #2f6f9f) 15%, white);
  color: color-mix(in srgb, var(--note-color, #2f6f9f) 78%, black);
}

.note-quote,
.selection-preview {
  padding: 8px;
  border-left: 3px solid var(--note-color, var(--focus));
  background: color-mix(in srgb, var(--note-color, var(--focus)) 13%, white);
  color: #25445f;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.passage-card .note-quote {
  margin: 0;
  border-radius: 8px;
  color: #22332f;
}

.passage-empty {
  margin-top: 2px;
}

.selection-preview:empty {
  display: none;
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.note-color-picker {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.passage-composer {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.passage-composer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.passage-composer-actions .quiet-button {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 850;
}

.note-color-option {
  position: relative;
  min-width: 0;
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.note-color-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(50%);
}

.note-color-option.blue {
  --note-choice: #2f6f9f;
}

.note-color-option.green {
  --note-choice: #1f7a62;
}

.note-color-option.amber {
  --note-choice: #b57614;
}

.note-color-option.red {
  --note-choice: #b44b3f;
}

.note-color-option.violet {
  --note-choice: #6f5aa8;
}

.note-color-option span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border-top: 4px solid var(--note-choice);
}

.note-color-option:has(input:checked) {
  border-color: var(--note-choice);
  background: color-mix(in srgb, var(--note-choice) 12%, white);
  color: var(--ink);
}

.note-form-armed {
  border-radius: 10px;
  outline: 2px solid rgba(47, 111, 159, 0.18);
  outline-offset: 8px;
}

.note-mark {
  background: color-mix(in srgb, var(--note-color, #2f6f9f) 22%, white);
  border-bottom: 2px solid var(--note-color, #2f6f9f);
  color: inherit;
  padding: 0 2px;
  cursor: pointer;
  scroll-margin: 120px;
}

.note-mark.star-mark {
  --note-color: #c58a12;
  position: relative;
  border-bottom: 2px solid #c58a12;
  box-shadow: inset 0 -0.9em 0 rgba(255, 210, 93, 0.34);
  background:
    linear-gradient(90deg, rgba(255, 242, 201, 0.95), rgba(255, 248, 224, 0.72));
  border-radius: 4px;
}

.note-mark.star-mark::before {
  content: "â˜…";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  border-radius: 999px;
  background: #c58a12;
  color: white;
  font-size: 10px;
  line-height: 1;
  vertical-align: 1px;
}

.note-time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.selection-toolbar {
  position: fixed;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 3px;
  max-width: min(320px, calc(100vw - 24px));
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 34px rgba(26, 38, 52, 0.18);
  backdrop-filter: blur(10px);
}

.selection-colors {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  margin-right: 1px;
  border-right: 1px solid var(--line);
}

.selection-color {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--selection-choice);
  box-shadow: inset 0 0 0 2px white;
}

.selection-color.active {
  border-color: var(--ink);
  box-shadow:
    inset 0 0 0 2px white,
    0 0 0 2px color-mix(in srgb, var(--selection-choice) 28%, transparent);
}

.selection-color.blue {
  --selection-choice: #2f6f9f;
}

.selection-color.green {
  --selection-choice: #1f7a62;
}

.selection-color.amber {
  --selection-choice: #b57614;
}

.selection-color.red {
  --selection-choice: #b44b3f;
}

.selection-color.violet {
  --selection-choice: #6f5aa8;
}

.selection-tool {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
}

.selection-tool:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.selection-tool svg {
  width: 15px;
  height: 15px;
}

#selectionStarBtn {
  color: #775000;
}

#selectionStarBtn:hover {
  border-color: rgba(197, 138, 18, 0.38);
  background: #fff4d5;
}

.note-mark.star-mark {
  position: relative;
  padding: 0 4px 0 13px;
  border-bottom: 0;
  border-left: 4px solid var(--note-color, #b57614);
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--note-color, #b57614) 16%, transparent) 0 10px,
      transparent 10px
    );
  border-radius: 9px 3px 3px 9px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.65);
}

.note-mark.star-mark::before {
  content: "\2605";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin: 0 -3px 0 -11px;
  border-radius: 999px;
  background: var(--note-color, #b57614);
  color: white;
  font-size: 10px;
  line-height: 1;
  vertical-align: 1px;
}

.note-mark.star-mark {
  padding: 2px 3px 3px;
  border-left: 0;
  border-top: 2px solid var(--note-color, #b57614);
  border-bottom: 2px solid var(--note-color, #b57614);
  background:
    linear-gradient(
      transparent 0 48%,
      color-mix(in srgb, var(--note-color, #b57614) 24%, transparent) 48% 82%,
      transparent 82% 100%
    );
  border-radius: 2px;
  box-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.note-mark.star-mark::before {
  content: "\2605";
  display: inline;
  width: auto;
  height: auto;
  margin: 0 4px 0 0;
  border-radius: 0;
  background: transparent;
  color: var(--note-color, #b57614);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  vertical-align: 1px;
}

.note-mark.star-mark {
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  box-decoration-break: slice;
  -webkit-box-decoration-break: slice;
}

.note-mark.star-mark::before {
  content: "";
  display: none;
}

.star-frame-segment {
  position: absolute;
  z-index: 3;
  display: block;
  padding: 0;
  border: 0;
  border-left: 2px solid var(--note-color, #b57614);
  border-right: 2px solid var(--note-color, #b57614);
  border-radius: 0;
  background: transparent;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.98;
}

.star-frame-segment::before,
.star-frame-segment::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--note-color, #b57614);
  opacity: 0;
}

.star-frame-segment.first::before {
  top: 0;
  opacity: 1;
}

.star-frame-segment.last::after {
  bottom: 0;
  opacity: 1;
}

.star-frame-segment.first {
  box-shadow: -9px 0 0 -7px var(--note-color, #b57614);
}

.star-frame-segment.first::marker {
  display: none;
}

.star-frame-segment.first::before {
  box-shadow: -11px 0 0 -4px var(--note-color, #b57614);
}

.star-frame-segment.first::after {
  content: "\2605";
  left: -18px;
  right: auto;
  top: -7px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--note-color, #b57614);
  color: white;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 1;
}

.star-frame-segment.last:not(.first)::after {
  content: "";
  left: 0;
  right: 0;
  top: auto;
  width: auto;
  height: 2px;
  display: block;
  border-radius: 0;
  color: transparent;
  font-size: 0;
  opacity: 1;
}

.star-frame-segment::before,
.star-frame-segment::after {
  content: none;
}

.star-frame-segment.first {
  border-top: 2px solid var(--note-color, #b57614);
}

.star-frame-segment.last {
  border-bottom: 2px solid var(--note-color, #b57614);
}

.star-frame-segment.first::before {
  content: "\2605";
  position: absolute;
  left: -18px;
  top: -9px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--note-color, #b57614);
  color: white;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.star-frame-segment.active {
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--note-color, #b57614) 32%, transparent));
}

.annotation-segment {
  position: absolute;
  z-index: 3;
  display: block;
  padding: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.mark-segment,
.note-segment {
  z-index: 2;
  border-radius: 2px;
  background: color-mix(in srgb, var(--note-color, #2f6f9f) 18%, transparent);
  border-bottom: 2px solid var(--note-color, #2f6f9f);
  mix-blend-mode: multiply;
}

.note-segment {
  background: color-mix(in srgb, var(--note-color, #2f6f9f) 24%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--note-color, #2f6f9f) 20%, transparent);
}

.find-segment {
  z-index: 1;
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(255, 243, 188, 0.18), rgba(255, 224, 122, 0.34));
  box-shadow: inset 0 -1px 0 rgba(176, 119, 20, 0.42);
  mix-blend-mode: multiply;
}

.find-segment.active {
  z-index: 5;
  background:
    linear-gradient(180deg, rgba(255, 239, 166, 0.42), rgba(255, 211, 86, 0.56));
  box-shadow:
    inset 0 -2px 0 rgba(176, 103, 10, 0.72),
    0 0 0 1px rgba(47, 111, 159, 0.16),
    0 10px 24px rgba(28, 72, 106, 0.10);
}

.star-segment {
  z-index: 4;
  border-left: 2px solid color-mix(in srgb, var(--note-color, #b57614) 86%, #5c4210);
  border-right: 2px solid color-mix(in srgb, var(--note-color, #b57614) 86%, #5c4210);
  border-radius: 0;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--note-color, #b57614) 9%, transparent),
      transparent 18%,
      transparent 82%,
      color-mix(in srgb, var(--note-color, #b57614) 9%, transparent));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--note-color, #b57614) 14%, transparent);
  opacity: 0.94;
}

.star-block-frame,
.star-block-frame.first,
.star-block-frame.last {
  border: 2px solid color-mix(in srgb, var(--note-color, #b57614) 84%, #5c4210);
  border-radius: 8px;
  background: transparent;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--note-color, #b57614) 10%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--note-color, #b57614) 10%, transparent);
}

.star-segment.first {
  border-top: 2px solid color-mix(in srgb, var(--note-color, #b57614) 86%, #5c4210);
  border-top-left-radius: 7px;
  border-top-right-radius: 7px;
}

.star-segment.last {
  border-bottom: 2px solid color-mix(in srgb, var(--note-color, #b57614) 86%, #5c4210);
  border-bottom-left-radius: 7px;
  border-bottom-right-radius: 7px;
}

.star-segment.first::before {
  content: none;
}

.annotation-segment.active {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--note-color, #b57614) 24%, transparent));
}

.star-segment.active {
  opacity: 1;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--note-color, #b57614) 28%, transparent),
    0 0 0 2px color-mix(in srgb, var(--note-color, #b57614) 16%, transparent);
}

.star-block-frame.active {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--note-color, #b57614) 18%, transparent),
    0 8px 18px color-mix(in srgb, var(--note-color, #b57614) 10%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--note-color, #b57614) 18%, transparent);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(50%);
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented input:checked + span {
  background: #e4f1ec;
  border-color: #9fc8bb;
  color: var(--green-dark);
}

.ai-section textarea {
  margin-bottom: 8px;
}

.ai-category-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-category-item {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.35;
}

.ai-category-item strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.ai-category-item span {
  color: var(--muted);
  font-size: 12px;
}

.ai-section .quiet-button {
  margin-bottom: 10px;
}

.ai-answer {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.55;
  white-space: pre-wrap;
  min-height: 70px;
  color: #26302d;
}

.empty-state,
.error-state {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

.company-empty-state {
  align-items: flex-start;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 248, 253, 0.76)),
    radial-gradient(circle at 88% 18%, rgba(83, 164, 214, 0.16), transparent 34%);
  border: 1px solid rgba(72, 139, 184, 0.18);
  border-radius: 16px;
  color: var(--ink-900);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  text-align: left;
}

.company-empty-state strong {
  color: #08294d;
  font-size: 0.94rem;
}

.company-empty-state span,
.company-empty-state small {
  color: rgba(8, 41, 77, 0.68);
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
}

.company-field-state {
  align-items: center;
  border: 1px solid rgba(72, 139, 184, 0.2);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 800;
  gap: 6px;
  line-height: 1;
  padding: 6px 9px;
}

.company-field-state.tone-ok {
  background: rgba(235, 250, 245, 0.86);
  color: #0a604c;
}

.company-field-state.tone-warning,
.company-field-state.tone-access {
  background: rgba(255, 249, 232, 0.9);
  color: #77530b;
}

.company-field-state.tone-source,
.company-field-state.tone-neutral,
.company-field-state.tone-muted {
  background: rgba(232, 244, 252, 0.88);
  color: #175b88;
}

.error-state {
  color: var(--brick);
}

.profiles-view,
.admin-view {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.deadlines-view {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.cases-view {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.templates-view {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.companies-view {
  grid-column: 1 / -1;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.profiles-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  background: var(--surface);
}

.admin-sidebar {
  min-height: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(23, 107, 91, 0.05), rgba(247, 249, 251, 0) 260px),
    var(--surface-tint);
  overflow-y: auto;
}

.admin-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.admin-header h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.15;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.admin-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.admin-metric-card {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.admin-metric-card span,
.admin-metric-card small,
.admin-warning span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.admin-metric-card strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.05;
}

.admin-warning-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.admin-warning {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface-tint);
}

.admin-warning.green {
  border-left-color: var(--green);
}

.admin-warning.yellow {
  border-left-color: var(--amber);
}

.admin-warning.red {
  border-left-color: var(--brick);
}

.admin-operations {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcfc, var(--surface));
}

.admin-operations-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--muted);
  font-weight: 750;
}

.admin-operations-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.admin-operations-head.green {
  border-left-color: var(--green);
}

.admin-operations-head.yellow {
  border-left-color: var(--amber);
}

.admin-operations-head.red {
  border-left-color: var(--brick);
}

.admin-operations-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-operations-head span,
.admin-operations-head small,
.admin-health-card span,
.admin-operations-foot {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-operations-head strong {
  font-size: 20px;
  line-height: 1.1;
}

.admin-operations-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.admin-operations-meta span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  white-space: nowrap;
}

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

.admin-health-card {
  min-width: 0;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface-tint);
}

.admin-health-card.green {
  border-left-color: var(--green);
}

.admin-health-card.yellow {
  border-left-color: var(--amber);
}

.admin-health-card.red {
  border-left-color: var(--brick);
}

.admin-health-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-health-card strong,
.admin-health-card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-health-card em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.admin-operations-foot {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.admin-operations-foot div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-operations-foot div span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
}

.admin-quality {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.admin-quality-details {
  display: block;
}

.admin-quality-details summary::-webkit-details-marker {
  display: none;
}

.admin-quality-summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px 11px 14px;
  border-left: 4px solid #c58b19;
  list-style: none;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.admin-quality-summary.green {
  border-left-color: var(--green);
}

.admin-quality-summary.red {
  border-left-color: #b54735;
}

.admin-quality-summary:hover {
  background: #f8fbfa;
}

.admin-quality-details[open] .admin-quality-summary {
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.admin-quality-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(47, 111, 159, 0.06), rgba(255, 255, 255, 0) 42%),
    var(--surface);
}

.admin-quality-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.admin-quality-actions > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.admin-quality-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-quality-head.green,
.admin-quality-head.yellow,
.admin-quality-head.red {
  padding-left: 10px;
  border-left: 4px solid #c58b19;
}

.admin-quality-head.green {
  border-left-color: var(--green);
}

.admin-quality-head.red {
  border-left-color: #b54735;
}

.admin-quality-head > div:first-child,
.admin-quality-score {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-quality-head span,
.admin-quality-head small,
.admin-quality-summary span,
.admin-quality-summary small,
.admin-quality-metric span,
.admin-quality-metric small,
.admin-quality-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.admin-quality-head strong {
  overflow-wrap: anywhere;
}

.admin-quality-summary > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-quality-summary strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.admin-quality-score {
  text-align: right;
}

.admin-quality-score strong {
  font-size: 22px;
}

.admin-quality-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.admin-quality-metric {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-quality-metric strong {
  font-size: 18px;
}

.admin-quality-queues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-quality-queues section {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.admin-quality-item {
  min-width: 0;
  display: grid;
  gap: 7px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #c58b19;
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 150ms ease,
    transform 120ms ease,
    box-shadow 150ms ease;
}

.admin-quality-item.green {
  border-left-color: var(--green);
}

.admin-quality-item.red {
  border-left-color: #b54735;
}

.admin-quality-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.admin-quality-item-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.admin-quality-item-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.admin-quality-item-main:hover {
  color: var(--green-dark);
}

.admin-quality-item strong,
.admin-quality-item-main strong {
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.admin-quality-item-score {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.admin-quality-item-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.admin-quality-item-issues span {
  padding: 3px 7px;
  border: 1px solid #e5cf94;
  border-radius: 999px;
  background: #fff9e9;
  color: #7b520f;
  font-size: 10.5px;
  font-weight: 780;
}

.admin-quality-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 172px;
}

.admin-quality-item-actions button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #44514d;
  font-size: 10.5px;
  font-weight: 800;
}

.admin-quality-item-actions button:hover {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

@media (max-width: 1180px) {
  .admin-quality-item-top {
    grid-template-columns: 1fr;
  }

  .admin-quality-item-actions {
    justify-content: flex-start;
    max-width: none;
  }
}

.admin-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1fr) minmax(300px, 0.75fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.admin-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-tint);
}

.admin-security-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #9fc8bb;
  border-radius: 999px;
  background: #edf7f3;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.admin-principle-card {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  line-height: 1.45;
}

.admin-principle-card.subdued {
  background: rgba(238, 243, 241, 0.56);
}

.admin-principle-card span,
.admin-policy-list span {
  color: var(--muted);
  font-size: 12.5px;
}

.admin-policy-list {
  display: grid;
  gap: 10px;
}

.admin-policy-list article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-audit-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.admin-audit-list {
  display: grid;
  gap: 8px;
}

.admin-audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid #c8d1d0;
  border-radius: 8px;
  background: var(--surface);
}

.admin-audit-item.green {
  border-left-color: var(--green);
}

.admin-audit-item.red {
  border-left-color: var(--brick);
}

.admin-audit-item.blue {
  border-left-color: var(--focus);
}

.admin-audit-item strong,
.admin-audit-item span,
.admin-audit-item small {
  display: block;
}

.admin-audit-item span,
.admin-audit-item small,
.user-list-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-audit-item > span {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  font-size: 11px;
  font-weight: 800;
}

.deadlines-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.deadlines-layout.quick-mode {
  grid-template-columns: minmax(0, 1fr);
}

.cases-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.templates-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  transition: grid-template-columns 180ms ease;
}

.templates-layout.templates-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr) 0;
}

.templates-layout.templates-sidebar-collapsed .templates-workspace {
  grid-template-columns: minmax(390px, 0.42fr) minmax(620px, 1.58fr);
}

.companies-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  min-width: 0;
}

.profiles-sidebar {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-tint);
}

.deadlines-sidebar {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-tint);
}

.deadlines-layout.quick-mode .deadlines-sidebar {
  display: none;
}

.cases-sidebar {
  display: none;
}

.templates-sidebar {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--surface-tint);
  transition:
    opacity 140ms ease,
    padding 180ms ease,
    border-color 180ms ease;
}

.templates-layout.templates-sidebar-collapsed .templates-sidebar {
  padding: 0;
  border-left-color: transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.template-sidebar-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.template-sidebar-close {
  width: 34px;
  height: 34px;
  margin-left: auto;
}

.companies-sidebar {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-tint);
}

.case-guidance-box,
.company-support-box {
  display: grid;
  gap: 5px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid #cddfda;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f4faf7;
  line-height: 1.45;
}

.case-guidance-box span,
.company-support-box span {
  color: var(--muted);
  font-size: 12px;
}

.case-quick-actions {
  display: grid;
  gap: 8px;
}

.case-create-form,
.case-sidebar-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.legal-case-list,
.case-unlinked-list {
  display: grid;
  gap: 8px;
}

.legal-case-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition:
    border-color 150ms ease,
    transform 120ms ease,
    background 150ms ease;
}

.legal-case-item:hover,
.legal-case-item.active {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  transform: translateY(-1px);
}

.legal-case-item strong,
.legal-case-item span,
.legal-case-item small {
  min-width: 0;
  grid-column: 2;
}

.legal-case-item span,
.legal-case-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-status-dot {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}

.case-status-dot.watch,
.case-status-dot.waiting {
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 16%, transparent);
}

.case-status-dot.dormant {
  background: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 15%, transparent);
}

.case-status-dot.closed {
  background: var(--muted);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 12%, transparent);
}

.case-unlinked-pill {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.case-unlinked-pill span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.company-search-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.company-source-box {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.4;
}

.company-source-box.ready {
  border-left-color: var(--green);
}

.company-source-box.offline {
  border-left-color: var(--amber);
}

.company-source-box span,
.company-source-box small {
  color: var(--muted);
  font-size: 12px;
}

.company-result-list {
  display: grid;
  gap: 8px;
}

.company-result-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.company-result-item:hover,
.company-result-item.active {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.company-result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.company-result-status {
  flex: 0 0 auto;
  max-width: 118px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: normal;
}

.company-result-status.green {
  border-color: rgba(22, 163, 74, 0.25);
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}

.company-result-status.yellow {
  border-color: rgba(217, 119, 6, 0.26);
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
}

.company-result-status.amber {
  border-color: rgba(168, 110, 18, 0.24);
  color: #754c08;
  background: rgba(255, 248, 234, 0.92);
}

.company-result-status.slate {
  border-color: rgba(89, 105, 118, 0.22);
  color: #42505d;
  background: rgba(240, 245, 248, 0.90);
}

.company-result-status.red {
  border-color: rgba(220, 38, 38, 0.24);
  color: #991b1b;
  background: rgba(220, 38, 38, 0.08);
}

.company-result-status.blue {
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.company-result-item span {
  color: var(--muted);
  font-size: 12px;
}

.company-lookup-banner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(160px, auto);
  gap: 10px;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-soft);
}

.company-lookup-banner.green {
  border-left-color: var(--green);
}

.company-lookup-banner.yellow {
  border-left-color: var(--amber);
}

.company-lookup-banner.red {
  border-left-color: #dc2626;
}

.company-lookup-signal {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.company-lookup-signal span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.company-lookup-signal strong,
.company-lookup-signal small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-lookup-signal strong {
  color: var(--ink);
  font-size: 14px;
}

.company-lookup-signal small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.company-lookup-actions {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
}

.company-lookup-actions .company-inline-action {
  width: 100%;
}

@media (max-width: 920px) {
  .company-lookup-banner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-lookup-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .company-lookup-banner {
    grid-template-columns: 1fr;
  }

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

.template-search-form {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.template-search-host {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.template-library-search {
  max-width: 1180px;
  margin: 0 auto;
}

.template-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.template-query-field {
  margin: 0;
}

.template-search-tools {
  display: grid;
  grid-template-columns: minmax(164px, 190px) auto;
  align-items: end;
  gap: 8px;
}

.template-sort-field {
  margin: 0;
}

.template-search-row .template-actions-row {
  margin: 0;
  grid-template-columns: auto auto;
}

.template-quick-tracks {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 1px 4px;
  scrollbar-width: thin;
}

.template-quick-tracks > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-quick-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.template-quick-chip:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.template-quick-chip.active {
  border-color: #7db9a7;
  background: #e9f6f1;
  color: #155c4d;
}

.template-filter-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-filter-drawer > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  color: var(--ink);
  font-weight: 800;
}

.template-filter-drawer > summary::-webkit-details-marker {
  display: none;
}

.template-filter-drawer > summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.template-filter-drawer > summary::after {
  content: "Vis";
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-filter-drawer[open] > summary {
  border-bottom: 1px solid var(--line);
}

.template-filter-drawer[open] > summary::after {
  content: "Skjul";
}

.template-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.template-actions-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.template-stat-card {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-stat-card span,
.template-stat-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.template-stat-card strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.template-upload-form,
.template-dashboard-section {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-sidebar-admin {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-sidebar-admin > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
}

.template-sidebar-admin > summary::-webkit-details-marker {
  display: none;
}

.template-sidebar-admin > summary strong {
  min-width: 0;
  font-size: 12.5px;
}

.template-sidebar-admin > summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.template-sidebar-admin > summary::after {
  content: "Vis";
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-sidebar-admin[open] > summary {
  border-bottom: 1px solid var(--line);
}

.template-sidebar-admin[open] > summary::after {
  content: "Skjul";
}

.template-sidebar-admin .template-upload-form {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.template-upload-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-import-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.template-dashboard {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.template-dashboard.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

.template-dashboard-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-dashboard-toolbar > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.template-dashboard-toolbar strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.template-dashboard-toolbar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.template-editor-status-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #c58b19;
  border-radius: 8px;
  background: var(--surface);
}

.template-editor-status-card.ready {
  border-left-color: var(--green);
}

.template-editor-status-card > div {
  display: grid;
  gap: 2px;
}

.template-editor-status-card span,
.template-editor-status-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.template-dash-metric {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-dash-metric span,
.template-dashboard-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.template-dash-metric strong {
  font-size: 20px;
}

.template-dashboard-item {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  color: var(--ink);
  text-align: left;
}

.template-dashboard-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.template-dashboard-item strong {
  overflow-wrap: anywhere;
  font-size: 12.5px;
}

.template-dashboard-item span {
  color: var(--muted);
  font-size: 11px;
}

.templates-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(47, 111, 159, 0.05), rgba(247, 249, 251, 0) 220px),
    var(--surface-tint);
}

.templates-header {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
}

.templates-header h1 {
  margin: 3px 0 0;
  font-size: 22px;
  letter-spacing: 0;
}

.template-header-actions {
  display: flex;
  gap: 8px;
}

.templates-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(390px, 0.88fr) minmax(430px, 1.12fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.template-results-panel,
.template-detail-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-tint);
}

.template-section-title {
  align-items: center;
  justify-content: space-between;
}

.template-section-title small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.template-result-list {
  display: grid;
  gap: 10px;
}

.template-result-item {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.02);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease,
    background-color 150ms ease;
}

.template-result-item:hover,
.template-result-item.active {
  border-color: var(--line-strong);
  border-left-color: var(--green);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.template-open {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px 0 12px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.template-open > span,
.template-open p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-result-top {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.template-result-top strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.template-result-signal {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 3px;
  padding: 2px 7px;
  border: 1px solid #b9d8cc;
  border-radius: 999px;
  background: #eef8f3;
  color: #155c4d;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.2;
}

.template-result-meta {
  display: grid;
  gap: 2px;
}

.template-snippet {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-file-pill {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #cbd7d5;
  border-radius: 8px;
  background: #eef5f1;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
}

.template-fav {
  margin: 10px 10px 0 0;
}

.template-fav.active {
  border-color: #e0c15b;
  background: #fff7d9;
  color: #8a6400;
}

.template-flag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #e2c487;
  border-radius: 999px;
  background: #fff8e8;
  color: #7b520f;
  font-size: 11px;
  font-weight: 750;
}

.template-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}

.template-status-pill.ready {
  border-color: #b9d8cc;
  background: #eef8f3;
  color: #155c4d;
}

.template-status-pill.pending,
.template-status-pill.stale {
  border-color: #e5cf94;
  background: #fff9e9;
  color: #7b520f;
}

.template-status-pill.error {
  border-color: #e6b5a9;
  background: #fff0ed;
  color: #933623;
}

.template-workflow-strip {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 122, 98, 0.08), rgba(255, 255, 255, 0) 42%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-workflow-step {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid #c9d5d2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.template-workflow-step.ready {
  border-left-color: var(--green);
}

.template-workflow-step.pending,
.template-workflow-step.stale {
  border-left-color: #c58b19;
}

.template-workflow-step.error {
  border-left-color: #b54735;
}

.template-workflow-step span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-workflow-step strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

.detail-flags {
  margin-top: -3px;
}

.template-detail-panel {
  background: #fbfcfc;
}

.template-empty {
  min-height: 360px;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  color: var(--muted);
}

.template-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.template-detail-content {
  width: min(100%, 1120px);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.template-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-detail-head h2 {
  margin: 3px 0 6px;
  overflow-wrap: anywhere;
  font-size: 23px;
  line-height: 1.18;
  letter-spacing: 0;
}

.template-detail-head span {
  color: var(--muted);
  font-size: 12px;
}

.template-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-detail-actions.secondary {
  padding-top: 2px;
}

.template-use-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #b9d8cc;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 122, 98, 0.09), rgba(255, 255, 255, 0) 46%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.template-workcopy-strip {
  align-items: stretch;
}

.template-use-strip > div:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.template-use-main {
  align-content: center;
}

.template-use-eyebrow {
  width: fit-content;
  color: var(--green-dark) !important;
  font-size: 11px !important;
  font-weight: 850;
  text-transform: uppercase;
}

.template-use-strip strong {
  color: var(--ink);
  font-size: 14px;
}

.template-use-strip span {
  color: var(--muted);
  font-size: 12px;
}

.template-use-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.template-use-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #c7dad4;
  border-radius: 999px;
  background: rgba(238, 248, 243, 0.86);
  color: #155c4d;
  font-size: 11px;
  font-weight: 800;
}

.template-primary-actions {
  align-content: center;
  justify-content: flex-end;
}

.template-action-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.template-editor-note {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid #c58b19;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.template-editor-note.ready {
  border-left-color: var(--green);
  color: #155c4d;
}

.template-action-status.ready {
  color: #155c4d;
}

.template-action-status.pending,
.template-action-status.stale {
  color: #7b520f;
}

.template-action-status.error {
  color: #933623;
}

.template-document-viewer {
  position: relative;
  min-height: 740px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f0;
  box-shadow: var(--shadow-soft);
}

.template-document-viewer.error,
.template-document-viewer.neutral {
  background: #f4f6f6;
}

.template-document-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.template-document-toolbar > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.template-document-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.template-document-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-preview-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.template-preview-status.ready {
  border-color: #b9d8cc;
  background: #eef8f3;
  color: #155c4d;
}

.template-preview-status.pending,
.template-preview-status.stale {
  border-color: #e5cf94;
  background: #fff9e9;
  color: #7b520f;
}

.template-preview-status.error {
  border-color: #e6b5a9;
  background: #fff0ed;
  color: #933623;
}

.template-preview-guidance {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffdf7;
}

.template-preview-guidance > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.template-preview-guidance strong {
  font-size: 13px;
}

.template-preview-guidance span {
  color: var(--muted);
  font-size: 12px;
}

.template-preview-guidance.error {
  background: #fff7f5;
}

.template-preview-guidance.neutral {
  background: #f8faf9;
}

.template-preview-stage {
  position: relative;
  min-height: 680px;
  background: #eef1f3;
}

.template-preview-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(23, 107, 91, 0.10), rgba(238, 241, 243, 0.95) 42%),
    rgba(238, 241, 243, 0.92);
  color: var(--muted);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.template-preview-loading strong {
  color: var(--ink);
  font-size: 14px;
}

.template-document-viewer.is-loaded .template-preview-loading,
.template-document-viewer.has-preview-error .template-preview-loading {
  opacity: 0;
  visibility: hidden;
}

.template-document-frame {
  width: 100%;
  height: 100%;
  min-height: 680px;
  border: 0;
  background: #eef1f3;
}

.template-secondary-details {
  border-left: 4px solid #cbd7d5;
}

.template-admin-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-admin-details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  cursor: pointer;
  list-style: none;
}

.template-admin-details > summary::-webkit-details-marker {
  display: none;
}

.template-admin-details > summary strong {
  color: var(--ink);
}

.template-admin-details > summary span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.template-admin-details > summary::after {
  content: "Vis";
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-admin-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.template-admin-details[open] > summary::after {
  content: "Skjul";
}

.template-admin-details > :not(summary) {
  margin: 12px;
}

.template-classification-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.template-info-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-info-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-info-card strong {
  overflow-wrap: anywhere;
}

.template-detail-tags {
  margin-top: -2px;
}

.template-usage-note,
.template-metadata-form {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.template-usage-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.template-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-source-panel {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.template-source-panel > summary {
  cursor: pointer;
  list-style: none;
}

.template-source-panel > summary::-webkit-details-marker {
  display: none;
}

.template-source-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.template-source-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.template-source-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
}

.template-preview {
  max-height: 360px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #27302d;
  white-space: pre-wrap;
  overflow: auto;
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.template-no-preview {
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.deadline-case-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.deadline-case-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.deadline-case-item:hover,
.deadline-case-item.active {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.deadline-case-item.green {
  border-left-color: var(--green);
}

.deadline-case-item.yellow {
  border-left-color: var(--amber);
}

.deadline-case-item.red {
  border-left-color: var(--brick);
}

.deadline-case-item.blue {
  border-left-color: var(--focus);
}

.deadline-case-item span,
.deadline-case-item small {
  color: var(--muted);
  font-size: 12px;
}

.profile-create {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-scope-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.profile-scope-field label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.profile-scope-field input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.profile-scope-field span {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.70);
  color: rgba(10, 42, 79, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.profile-scope-field strong,
.profile-scope-field small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-scope-field strong {
  color: var(--water-deep, var(--source-blue));
  font-size: 12px;
  font-weight: 860;
}

.profile-scope-field small {
  color: rgba(10, 42, 79, 0.50);
  font-size: 10.5px;
  font-weight: 720;
}

.profile-scope-field input:checked + span {
  border-color: rgba(15, 76, 154, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 246, 255, 0.82));
  box-shadow:
    0 12px 26px rgba(6, 26, 51, 0.08),
    inset 0 -2px 0 rgba(30, 136, 229, 0.36);
}

.profile-list,
.profile-doc-list,
.insight-list,
.analysis-history,
.user-list,
.profile-annotation-list,
.profile-access-list,
.activity-list {
  display: grid;
  gap: 8px;
}

.profile-source-group {
  display: grid;
  gap: 8px;
}

.profile-source-group + .profile-source-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(10, 42, 79, 0.08);
}

.profile-source-group > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}

.profile-source-group > header div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-source-group > header strong {
  color: var(--water-deep, var(--source-blue));
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.profile-source-group > header span,
.profile-source-group > header small {
  color: rgba(10, 42, 79, 0.54);
  font-size: 11px;
  line-height: 1.35;
}

.profile-source-group > header small {
  flex: 0 0 auto;
  min-width: 24px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 76, 154, 0.16);
  border-radius: 999px;
  background: rgba(232, 246, 255, 0.78);
  color: var(--water-deep, var(--source-blue));
  font-weight: 900;
}

.profile-list-item,
.profile-doc-item,
.insight-item,
.analysis-item,
.user-list-item,
.access-item,
.annotation-item,
.activity-item {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.4;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.profile-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0;
  overflow: hidden;
}

.profile-list-item.active {
  border-color: rgba(15, 76, 154, 0.28);
  background:
    repeating-radial-gradient(ellipse at 92% 4%, rgba(79, 195, 247, 0.12) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 246, 255, 0.76));
  box-shadow:
    inset 3px 0 0 rgba(15, 76, 154, 0.74),
    0 14px 34px rgba(6, 26, 51, 0.08);
}

.profile-list-item:hover,
.profile-doc-item:hover,
.insight-item:hover,
.analysis-item:hover,
.user-list-item:hover,
.access-item:hover,
.annotation-item:hover,
.activity-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.profile-list-item:hover {
  border-color: rgba(30, 136, 229, 0.28);
  box-shadow: 0 12px 30px rgba(6, 26, 51, 0.08);
}

.profile-doc-item {
  position: relative;
  overflow: hidden;
}

.profile-doc-item.processed {
  border-color: rgba(15, 76, 154, 0.18);
  background:
    radial-gradient(circle at 96% 0%, rgba(79, 195, 247, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 249, 253, 0.82));
}

.profile-doc-item.processed::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(30, 136, 229, 0.72), rgba(47, 111, 159, 0.26));
}

.profile-doc-item.saved {
  border-color: rgba(10, 42, 79, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 251, 253, 0.72));
}

.profile-doc-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-doc-status-row small {
  color: rgba(10, 42, 79, 0.54);
  font-size: 10.5px;
  font-weight: 760;
  text-align: right;
}

.profile-doc-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: rgba(10, 42, 79, 0.58);
  font-size: 10.5px;
  font-weight: 900;
}

.profile-doc-status.processed {
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(232, 246, 255, 0.9);
  color: var(--water-deep, var(--source-blue));
}

.profile-doc-status.saved {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.52);
}

.profile-doc-use-state {
  display: block;
  margin-top: 4px;
  color: rgba(10, 42, 79, 0.56);
  font-size: 11.5px;
  line-height: 1.35;
}

.profile-open {
  min-width: 0;
  padding: 11px;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.profile-open:hover {
  color: var(--water-deep, var(--source-blue, #0a2a4f));
}

.profile-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin-bottom: 4px;
}

.profile-card-title strong {
  min-width: 0;
  margin-bottom: 0;
}

.profile-scope-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(10, 42, 79, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(10, 42, 79, 0.68);
  font-size: 10.5px;
  font-weight: 850;
}

.profile-scope-badge.team {
  border-color: rgba(15, 76, 154, 0.22);
  background: rgba(232, 246, 255, 0.9);
  color: var(--water-deep, var(--source-blue, #0a2a4f));
}

.profile-scope-badge.private {
  border-color: rgba(10, 42, 79, 0.22);
  background: rgba(246, 251, 255, 0.94);
  color: var(--water-navy, var(--source-blue, #0a2a4f));
}

.profile-card-access {
  display: block;
  margin-bottom: 3px;
  color: rgba(10, 42, 79, 0.56);
  font-size: 11.5px;
  font-weight: 760;
}

.profile-list-item strong,
.profile-doc-item strong,
.insight-item strong,
.analysis-item strong,
.access-item strong,
.annotation-item strong,
.activity-item strong {
  display: block;
  margin-bottom: 4px;
}

.profile-list-item span,
.profile-doc-item span,
.insight-item span,
.analysis-item span,
.user-list-item span,
.access-item span,
.annotation-item span,
.activity-item span,
.activity-item small,
.annotation-item small,
.byline,
.note-author {
  color: var(--muted);
  font-size: 12px;
}

.byline,
.note-author {
  display: block;
  margin-top: 4px;
  font-weight: 650;
}

.note-author {
  margin-bottom: 8px;
}

.team-panel {
  align-content: start;
}

.team-current {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface-tint);
}

.team-current span {
  color: var(--muted);
  font-size: 12px;
}

.team-create {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.user-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.user-list-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 170px;
}

.password-reset {
  width: 100%;
  max-width: 220px;
}

.password-reset > summary {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  cursor: pointer;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.password-reset > summary::-webkit-details-marker {
  display: none;
}

.password-reset-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.password-reset-form input {
  min-width: 0;
}

.password-reset-form small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  text-align: right;
}

.password-reset-form small.success {
  color: var(--green-dark);
}

.password-reset-form small.error {
  color: #a33a3a;
}

.password-reset-form small.pending {
  color: var(--muted-strong);
}

.access-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.annotation-item {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 10px;
}

.annotation-manager-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.annotation-manager-summary article {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.annotation-manager-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.annotation-manager-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.annotation-author-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.annotation-author-row span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--green-dark);
}

.annotation-strip {
  border-radius: 999px;
  background: var(--note-color, var(--focus));
}

.activity-item {
  display: grid;
  gap: 3px;
}

.profile-access-form,
.client-room-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.profile-access-summary {
  display: grid;
  gap: 10px;
}

.access-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.access-summary-grid article {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.access-summary-grid strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.access-summary-grid span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

.danger-text {
  color: var(--brick);
}

.user-state {
  align-self: start;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.user-state.active {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.profile-actions,
.item-actions,
.insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.profile-actions #profileContributorFilter {
  width: min(260px, 100%);
  min-width: 190px;
}

.profile-visibility-select {
  min-width: 122px;
  color: var(--water-deep, #0a2a4f);
  font-weight: 850;
}

.profile-actions #profileContributorFilter.is-filtered {
  border-color: rgba(15, 76, 154, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 246, 255, 0.76));
  color: var(--water-deep, var(--source-blue, #0a2a4f));
  font-weight: 750;
}

.profile-back-case {
  border-color: rgba(15, 76, 154, 0.24);
  color: var(--water-deep, var(--source-blue, #0a2a4f));
}

.entity-case-link {
  display: grid;
  gap: 4px;
  min-width: 176px;
  max-width: 310px;
}

.entity-case-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.entity-case-row select {
  min-width: 112px;
  max-width: 190px;
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 750;
}

.entity-case-row .quiet-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.entity-case-links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 18px;
}

.entity-case-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid #cddfda;
  border-radius: 999px;
  background: #f4faf7;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.entity-case-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-case-chip strong {
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}

.entity-case-chip:hover:not(:disabled) {
  border-color: #9fc8bb;
  box-shadow: var(--shadow-soft);
}

.entity-case-chip:disabled {
  cursor: default;
  opacity: 0.74;
}

.entity-case-empty,
.entity-case-error {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.entity-case-error {
  color: var(--brick);
}

.template-case-link {
  margin: -2px 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.template-case-link .entity-case-row,
.template-case-link .entity-case-links {
  justify-content: flex-start;
}

.item-actions {
  justify-content: space-between;
  margin-top: 10px;
}

.micro-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  flex-basis: 30px;
}

.micro-button svg {
  width: 15px;
  height: 15px;
}

.insight-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.insight-source {
  width: 100%;
  display: grid;
  gap: 2px;
  margin: 8px 0 10px;
  padding: 8px 9px;
  border: 1px solid #cddfda;
  border-radius: 8px;
  background: #f2faf7;
  color: var(--green-dark);
  text-align: left;
}

.insight-source:hover {
  border-color: #9fc8bb;
  box-shadow: var(--shadow-soft);
}

.insight-source span {
  color: var(--green-dark);
  font-weight: 750;
}

.insight-source small {
  color: var(--muted);
}

.muted-source {
  color: var(--muted);
  background: var(--surface-tint);
}

.profile-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.deadline-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.company-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.case-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.96), rgba(238, 244, 248, 0.92) 58%, rgba(244, 248, 250, 0.98));
}

.case-header {
  display: none;
  order: 1;
}

.case-office-overview {
  order: 1;
}

.case-room-empty,
.case-room-content {
  display: none !important;
  order: 2;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.deadline-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.company-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}

.case-header {
  display: none;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.profile-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.profile-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-tint));
  overflow-x: auto;
}

.profile-mode-tabs button {
  min-width: 132px;
  display: grid;
  gap: 2px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  box-shadow: none;
}

.profile-mode-tabs button span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.profile-mode-tabs button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.profile-mode-tabs button.active {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  box-shadow: inset 0 -2px 0 var(--green);
}

.deadline-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-tint));
  overflow-x: auto;
}

.deadline-mode-tabs button {
  min-width: 168px;
  display: grid;
  gap: 2px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: left;
}

.deadline-mode-tabs button span {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.deadline-mode-tabs button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.deadline-mode-tabs button.active {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 8%, var(--surface));
  box-shadow: inset 0 -2px 0 var(--green);
}

.deadline-mode-quick #deadlineAssistantWorkspace,
.deadline-mode-assistant #deadlineQuickWorkspace {
  display: none;
}

.deadline-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.company-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.case-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.case-room-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.case-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.case-header-actions select {
  max-width: 142px;
  border-color: rgba(10, 42, 79, 0.08);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
}

.case-office-overview {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 22px 24px 26px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 82% 0%, rgba(47, 111, 159, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.88));
}

.case-office-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 255, 0.78)),
    var(--surface);
  box-shadow: 0 18px 48px rgba(10, 42, 79, 0.07);
}

.case-office-heading p {
  max-width: 560px;
  margin: 4px 0 0;
  color: color-mix(in srgb, var(--source-blue) 54%, var(--muted));
  font-size: 13px;
  line-height: 1.45;
}

.case-office-heading-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.case-office-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.case-office-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid rgba(10, 42, 79, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--source-blue);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(6, 26, 51, 0.05);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.case-office-action svg {
  width: 15px;
  height: 15px;
}

.case-office-action:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 159, 0.34);
  background: color-mix(in srgb, var(--source-blue-soft) 78%, white);
  box-shadow: 0 12px 26px rgba(10, 42, 79, 0.1);
}

.case-office-action.primary {
  border-color: rgba(47, 111, 159, 0.32);
  background:
    linear-gradient(135deg, #0a2a4f 0%, #1d5d93 58%, #2f6f9f 100%);
  color: white;
  box-shadow:
    0 12px 28px rgba(47, 111, 159, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.case-office-action.primary:hover {
  border-color: rgba(47, 111, 159, 0.52);
  background:
    linear-gradient(135deg, #071f3d 0%, #174f82 58%, #2f6f9f 100%);
}

.case-office-create {
  grid-template-columns: minmax(220px, 1.2fr) minmax(170px, 0.9fr) minmax(120px, 0.55fr) minmax(140px, 0.65fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 252, 0.72));
  box-shadow: 0 16px 42px rgba(10, 42, 79, 0.08);
}

.case-office-create.hidden {
  display: none;
}

.case-office-create-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 2px;
}

.case-office-create-head div {
  display: grid;
  gap: 1px;
}

.case-office-create-head span {
  color: var(--source-blue-mid);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-office-create-head strong {
  color: var(--ink);
  font-size: 14px;
}

.case-office-create .field {
  margin: 0;
}

.case-office-create .primary-button {
  min-height: 38px;
  white-space: nowrap;
}

.case-office-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 0;
}

.case-office-toolbar p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.case-office-filters,
.case-team-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 3px;
  border: 1px solid rgba(10, 42, 79, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.case-office-filter,
.case-team-chip {
  flex: 0 0 auto;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.case-office-filter {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
}

.case-office-filter:hover,
.case-team-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 159, 0.16);
  background: rgba(255, 255, 255, 0.76);
  color: var(--source-blue);
}

.case-office-filter.active,
.case-team-chip.active {
  border-color: rgba(47, 111, 159, 0.22);
  background: white;
  color: var(--source-blue);
  box-shadow: 0 8px 20px rgba(10, 42, 79, 0.08);
}

.case-office-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 8px;
  margin-left: auto;
}

.case-office-controls label,
.case-operation-editor label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.case-office-controls span,
.case-operation-editor span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-office-controls select,
.case-operation-editor input,
.case-operation-editor select,
.case-operation-editor textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(10, 42, 79, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.case-operation-editor textarea {
  min-height: 58px;
  resize: vertical;
}

.case-office-metrics {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.case-office-metric {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(10, 42, 79, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: inherit;
  font: inherit;
  box-shadow: 0 8px 22px rgba(10, 42, 79, 0.04);
}

button.case-office-metric {
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

button.case-office-metric:hover,
button.case-office-metric.active {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 159, 0.32);
  box-shadow: 0 12px 28px rgba(10, 42, 79, 0.09);
}

button.case-office-metric.active {
  background: color-mix(in srgb, var(--source-blue-soft) 78%, white);
}

.case-office-metric.tone-danger {
  border-color: rgba(152, 66, 55, 0.28);
  background: #fff1ef;
}

.case-office-metric.tone-watch {
  border-color: rgba(168, 110, 18, 0.28);
  background: #fff8e8;
}

.case-office-metric.tone-missing {
  border-color: rgba(89, 68, 111, 0.22);
  background: #f7f3fb;
}

.case-office-metric.tone-calm {
  border-color: rgba(47, 111, 159, 0.16);
  background: #f3f9fd;
}

.case-office-metric span,
.case-office-metric small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.case-office-metric strong {
  color: var(--source-blue);
  font-size: 13px;
}

.case-team-chip {
  display: grid;
  gap: 2px;
  padding: 7px 10px;
  border-radius: 8px;
  text-align: left;
}

.case-team-chip strong {
  color: inherit;
  font-size: 12px;
}

.case-team-chip span,
.case-office-empty-inline {
  color: var(--muted);
  font-size: 11px;
}

.case-team-strip {
  display: none;
}

.case-office-controls {
  grid-template-columns: minmax(160px, 220px);
}

.case-office-table {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(237, 246, 252, 0.42));
  box-shadow:
    0 22px 60px rgba(10, 42, 79, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  overflow-x: auto;
  overflow-y: hidden;
}

.case-office-head,
.case-office-row {
  display: grid;
  grid-template-columns: minmax(250px, 1.12fr) minmax(150px, 0.72fr) minmax(230px, 1fr) minmax(250px, 1.1fr) 118px 145px;
  gap: 10px;
  align-items: center;
  min-width: 1230px;
}

.case-office-head {
  padding: 7px 12px 4px;
  background: transparent;
  color: color-mix(in srgb, var(--source-blue) 54%, var(--muted));
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-office-row {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 13px 12px 13px 16px;
  border: 1px solid rgba(10, 42, 79, 0.07);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 255, 0.86));
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(10, 42, 79, 0.04);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 120ms ease;
}

.case-office-row::before {
  content: "";
  position: absolute;
  inset: 10px auto 10px 6px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.case-office-row:hover,
.case-office-row.active {
  border-color: rgba(47, 111, 159, 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 255, 0.96));
  box-shadow: 0 14px 34px rgba(10, 42, 79, 0.09);
}

.case-office-row.tone-overdue::before,
.case-office-row.tone-due::before {
  background: var(--brick);
}

.case-office-row.tone-soon::before,
.case-office-row.tone-watch::before {
  background: var(--amber);
}

.case-office-row.tone-waiting::before,
.case-office-row.tone-missing::before {
  background: var(--plum);
}

.case-office-row.tone-steady::before {
  background: color-mix(in srgb, var(--source-blue-mid) 68%, white);
}

.case-office-row.tone-dormant::before,
.case-office-row.tone-closed::before {
  background: var(--line-strong);
}

.case-office-row:hover {
  transform: translateY(-2px);
}

.case-office-row > span,
.case-office-case {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.case-office-case {
  display: grid;
  gap: 3px;
}

.case-office-case strong,
.case-office-case small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-office-case small {
  color: color-mix(in srgb, var(--source-blue) 40%, var(--muted));
  font-size: 11px;
}

.case-office-next {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.case-office-next strong,
.case-office-next small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-office-next small {
  color: var(--muted);
  font-size: 11px;
}

.case-office-next.tone-overdue strong,
.case-office-next.tone-due strong {
  color: var(--brick);
}

.case-office-next.tone-soon strong,
.case-office-next.tone-watch strong {
  color: #7b520f;
}

.case-office-next.tone-missing strong {
  color: var(--plum);
}

.case-office-process {
  min-width: 0;
  display: grid;
  gap: 5px;
  white-space: normal;
}

.case-process-chip {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid rgba(10, 42, 79, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.case-process-chip strong,
.case-process-chip small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-process-chip strong {
  color: color-mix(in srgb, var(--source-blue) 72%, var(--ink));
  font-size: 10px;
  font-weight: 950;
}

.case-process-chip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.case-process-chip.tone-pending {
  border-color: rgba(168, 110, 18, 0.22);
  background: linear-gradient(180deg, #fffaf0, #fff6df);
}

.case-process-chip.tone-done {
  border-color: rgba(47, 111, 159, 0.18);
  background: linear-gradient(180deg, #f4fbff, #edf6fc);
}

.case-process-chip.tone-blocked {
  border-color: rgba(152, 66, 55, 0.28);
  background: #fff1ef;
}

.case-process-chip.tone-unset {
  color: rgba(101, 113, 109, 0.82);
  background: rgba(248, 250, 252, 0.72);
}

.case-stage-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(10, 42, 79, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.case-stage-cell strong,
.case-stage-cell small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-stage-cell strong {
  color: var(--source-blue);
  font-size: 11px;
  font-weight: 900;
}

.case-stage-cell small {
  color: var(--muted);
  font-size: 10px;
}

.case-stage-cell.pending {
  border-color: #e2c487;
  background: #fff8e8;
}

.case-stage-cell.overdue,
.case-stage-cell.due {
  border-color: rgba(152, 66, 55, 0.32);
  background: #fff1ef;
}

.case-stage-cell.overdue strong,
.case-stage-cell.due strong {
  color: var(--brick);
}

.case-stage-cell.soon,
.case-stage-cell.watch {
  border-color: rgba(168, 110, 18, 0.3);
  background: #fff8e8;
}

.case-stage-cell.soon strong,
.case-stage-cell.watch strong {
  color: #7b520f;
}

.case-stage-cell.good {
  border-color: rgba(47, 111, 159, 0.18);
  background: #f3f9fd;
}

.case-stage-cell.unset {
  background: rgba(248, 250, 252, 0.76);
}

.case-stage-cell.done {
  border-color: rgba(47, 111, 159, 0.2);
  background: #edf6fc;
}

.case-stage-cell b {
  color: var(--ink);
  font-weight: 950;
}

.case-stage-cell.blocked {
  border-color: #d99a92;
  background: #fff1ef;
}

.case-estimate-pill {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  background: rgba(255, 255, 255, 0.84);
  color: var(--source-blue);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.case-estimate-pill.unset {
  color: var(--muted);
  background: rgba(248, 250, 252, 0.72);
}

.case-office-owner {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.case-office-owner strong,
.case-office-owner small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-office-owner strong {
  color: var(--source-blue);
  font-size: 12px;
  font-weight: 950;
}

.case-office-owner small {
  color: var(--muted);
  font-size: 10px;
}

.case-office-inline-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin: -3px 4px 4px;
  padding: 16px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 8px;
  background:
    radial-gradient(circle at right top, rgba(47, 111, 159, 0.11), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 253, 0.9));
  box-shadow:
    0 16px 42px rgba(10, 42, 79, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  overflow: hidden;
}

.case-office-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.case-office-inline-head div {
  display: grid;
  gap: 2px;
}

.case-office-inline-head span,
.case-office-inline-grid label > span {
  color: color-mix(in srgb, var(--source-blue) 58%, var(--muted));
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-office-inline-head strong {
  color: var(--ink);
  font-size: 15px;
}

.case-office-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.case-office-inline-grid label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.case-office-inline-grid label.wide {
  grid-column: span 2;
}

.case-office-inline-grid input,
.case-office-inline-grid select,
.case-office-inline-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(10, 42, 79, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.case-office-inline-grid input:focus,
.case-office-inline-grid select:focus,
.case-office-inline-grid textarea:focus,
.case-office-controls select:focus,
.case-operation-editor input:focus,
.case-operation-editor select:focus,
.case-operation-editor textarea:focus {
  outline: none;
  border-color: rgba(47, 111, 159, 0.42);
  background: white;
  box-shadow:
    0 0 0 3px rgba(47, 111, 159, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.case-office-inline-grid textarea {
  min-height: 72px;
  resize: vertical;
}

.case-office-inline-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.case-office-action:focus-visible,
.case-office-filter:focus-visible,
.case-team-chip:focus-visible,
.case-office-metric:focus-visible,
.case-office-row:focus-visible {
  outline: 3px solid rgba(47, 111, 159, 0.18);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .case-office-overview {
    padding: 12px;
  }

  .case-office-heading,
  .case-office-toolbar {
    display: grid;
    gap: 8px;
  }

  .case-office-heading-side {
    justify-items: start;
    width: 100%;
  }

  .case-office-actions {
    justify-content: flex-start;
  }

  .case-office-create {
    grid-template-columns: minmax(0, 1fr);
  }

  .case-office-controls {
    margin-left: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .case-office-table {
    overflow: visible;
  }

  .case-office-head {
    display: none;
  }

  .case-office-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(108px, auto);
    align-items: start;
    gap: 8px 10px;
    padding: 12px 12px 12px 16px;
  }

  .case-office-case {
    grid-column: 1;
  }

  .case-stage-cell {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    max-width: 132px;
  }

  .case-office-next {
    grid-column: 1 / -1;
  }

  .case-office-process {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-process-chip {
    grid-template-columns: minmax(62px, auto) minmax(0, 1fr);
  }

  .case-estimate-pill {
    grid-column: 1;
    justify-self: start;
  }

  .case-office-owner {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }

  .case-office-inline-grid {
    grid-template-columns: 1fr;
  }

  .case-office-inline-grid label.wide {
    grid-column: 1;
  }
}

.case-next-pill {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.case-next-pill.good {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.case-next-pill.watch,
.case-next-pill.soon {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.case-next-pill.due,
.case-next-pill.overdue {
  border-color: #d99a92;
  background: #fff1ef;
  color: #8d2f24;
}

.case-process-pill,
.case-status-pill {
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.case-status-pill.active {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.case-status-pill.waiting {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.case-status-pill.dormant {
  border-color: #bdd5e8;
  background: #eef5fa;
  color: #25445f;
}

.case-status-pill.closed {
  border-color: #d4d8de;
  background: #f4f6f8;
  color: #5f6b78;
}

.case-office-empty {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
}

.case-office-empty strong {
  color: var(--text);
}

.case-room-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.case-room-empty strong {
  color: var(--text);
  font-size: 18px;
}

.case-room-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(23, 107, 91, 0.04), rgba(247, 249, 251, 0) 240px),
    var(--surface-tint);
}

.case-room-hero {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.case-room-hero-main,
.case-link-panel,
.case-room-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.case-room-hero-main > .section-title {
  order: 1;
}

.case-room-hero-main > #caseProcessCards {
  order: 2;
}

.case-room-hero-main > #caseStatusActions {
  order: 3;
}

.case-room-hero-main > #caseProcessRail {
  order: 4;
}

.case-room-hero-main > #caseSummaryGrid {
  order: 5;
}

.case-room-hero-main > #caseNextBox {
  order: 6;
}

.case-link-panel small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-room-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 18px 0;
  overflow-x: auto;
}

.case-room-tabs button {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.case-room-tabs button.active {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--green-dark);
}

.case-room-panels {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
}

.case-room-panel {
  max-width: 1180px;
}

.case-overview-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-overview-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.case-overview-item small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-overview-item.wide {
  grid-column: span 2;
}

.case-overview-item span {
  color: var(--muted);
  font-size: 12px;
}

.case-overview-item strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
}

.case-empty-action {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.case-empty-action span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.case-activity-list {
  display: grid;
  gap: 10px;
}

.case-activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
}

.case-activity-item span,
.case-activity-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.deadline-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.company-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.company-tabs {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.company-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-tab:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.company-tab.active {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
  box-shadow: inset 0 -2px 0 var(--green);
}

.deadline-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.deadline-status.green {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.deadline-status.yellow {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.deadline-status.red {
  border-color: #d8aaa4;
  background: #fff3f1;
  color: #7e3028;
}

.deadline-status.blue {
  border-color: #bdd5e8;
  background: #eef5fa;
  color: #25445f;
}

.profile-grid,
.profile-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.profile-workspace {
  grid-template-columns: minmax(520px, 1.2fr) minmax(380px, 0.8fr);
}

.profile-workspace[data-profile-mode="notat"] .profile-contribution-panel,
.profile-workspace[data-profile-mode="notat"] .profile-report-panel,
.profile-workspace[data-profile-mode="sources"] .profile-contribution-panel,
.profile-workspace[data-profile-mode="sources"] .profile-report-panel,
.profile-workspace[data-profile-mode="contributions"] .profile-source-panel,
.profile-workspace[data-profile-mode="contributions"] .profile-report-panel,
.profile-workspace[data-profile-mode="report"] .profile-source-panel,
.profile-workspace[data-profile-mode="report"] .profile-contribution-panel {
  display: none;
}

.profile-workspace[data-profile-mode="sources"] {
  grid-template-columns: minmax(380px, 0.75fr) minmax(560px, 1.25fr);
}

.profile-workspace[data-profile-mode="sources"] .profile-source-panel {
  order: -1;
}

.profile-workspace[data-profile-mode="contributions"] {
  grid-template-columns: minmax(420px, 0.8fr) minmax(560px, 1.2fr);
}

.profile-workspace[data-profile-mode="contributions"] .profile-contribution-panel {
  order: -1;
}

.profile-workspace[data-profile-mode="report"] {
  grid-template-columns: minmax(420px, 0.8fr) minmax(620px, 1.2fr);
}

.profile-workspace[data-profile-mode="report"] .profile-report-panel {
  order: -1;
  background: var(--surface);
}

.deadline-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(460px, 1.1fr) minmax(360px, 0.9fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.deadline-quick-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(440px, 0.88fr) minmax(480px, 1.12fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.company-workspace {
  min-height: 0;
  min-width: 0;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(23, 107, 91, 0.04), rgba(247, 249, 251, 0) 220px),
    var(--surface-tint);
  overflow-y: auto;
  overflow-x: hidden;
}

.case-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 1px;
  background: var(--line);
  overflow: hidden;
}

.profile-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-tint);
}

.profile-issue-panel {
  background:
    linear-gradient(180deg, rgba(23, 107, 91, 0.055), rgba(247, 249, 251, 0) 220px),
    var(--surface-tint);
}

.profile-form-title {
  margin-top: 18px;
}

.profile-issue-board,
.issue-insight-list {
  display: grid;
  gap: 10px;
}

.profile-empty-notat {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.profile-empty-notat span {
  color: var(--muted);
  font-size: 13px;
}

.issue-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.issue-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.issue-card header strong {
  display: block;
  font-size: 15px;
}

.issue-card header span,
.issue-card header small {
  color: var(--muted);
  font-size: 12px;
}

.issue-card header small {
  max-width: 220px;
  text-align: right;
}

.issue-card-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.issue-status-select {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 800;
}

.issue-status-select.working {
  border-color: #bdd5e8;
  background: #eef5fa;
  color: #25445f;
}

.issue-status-select.review {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.issue-status-select.ready {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.issue-status-select.blocked {
  border-color: #d8aaa4;
  background: #fff3f1;
  color: #7e3028;
}

.issue-insight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.45fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--note-color, var(--green));
  border-radius: 8px;
  background: var(--surface);
}

.issue-insight[draggable="true"] {
  cursor: grab;
}

.issue-insight.dragging {
  opacity: 0.58;
  border-style: dashed;
  box-shadow: 0 18px 36px rgba(27, 40, 36, 0.16);
}

.issue-insight-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.issue-insight-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drag-handle {
  color: var(--muted);
  font-size: 15px;
  font-weight: 900;
}

.issue-order-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.micro-text-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.issue-insight-main > span {
  color: var(--muted);
  font-size: 12px;
}

.issue-insight-main p {
  margin: 0;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
}

.issue-insight blockquote {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--note-color, var(--green));
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--note-color, var(--green)) 8%, white);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.issue-source-link {
  align-self: start;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid #cddfda;
  border-radius: 8px;
  background: #f2faf7;
  color: var(--green-dark);
  text-align: left;
}

.issue-source-link span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.issue-source-link small {
  color: var(--muted);
  font-size: 11px;
}

.source-pin {
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e5f2ed;
  color: var(--green-dark);
  font-size: 10.5px;
  font-weight: 800;
}

.source-pin.legal-weight {
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  color: #6a4a08;
}

.insight-source-preview {
  min-height: 46px;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #cddfda;
  border-radius: 8px;
  background: #f2faf7;
  color: var(--green-dark);
  font-size: 12px;
}

.insight-source-preview.muted {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.profile-report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.profile-report-summary article {
  display: grid;
  gap: 3px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-report-summary article.wide {
  grid-column: 1 / -1;
}

.profile-report-summary span,
.profile-report-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-report-summary strong {
  min-width: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.15;
}

.profile-report-preview {
  display: grid;
  gap: 12px;
}

.report-preview-cover,
.report-preview-sources,
.report-preview-issue {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.report-preview-cover {
  border-top: 4px solid var(--green);
}

.report-preview-cover span {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-preview-cover h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.report-preview-cover p,
.report-preview-sources span,
.report-preview-issue span,
.report-preview-issue small,
.report-preview-issue p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.report-preview-sources ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-preview-sources li {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.report-preview-issue header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.report-preview-issue article {
  display: grid;
  gap: 6px;
  padding: 11px 0 0;
}

.report-preview-issue blockquote {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--green) 7%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.report-preview-issue p {
  margin: 0;
}

.insight-source-preview strong {
  font-size: 12px;
}

.insight-source-preview span {
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

.annotation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-2px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.annotation-item:hover .annotation-actions,
.annotation-item:focus-within .annotation-actions {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.profile-collaboration {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-collaboration summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.profile-collaboration > * + * {
  margin-top: 10px;
}

.deadline-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-tint);
}

.company-panel {
  width: min(100%, 1180px);
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  overflow: visible;
}

.case-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface-tint);
}

.company-overview-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.case-overview-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.case-summary-grid {
  display: block;
}

.case-status-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.case-status-action {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(10, 42, 79, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: left;
  font-weight: 850;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease;
}

.case-status-action span {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(10, 42, 79, 0.04);
}

.case-status-action strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.case-status-action:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(6, 26, 51, 0.07);
}

.case-status-action.is-selected {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 10%, white);
  color: var(--green-dark);
}

.case-status-action.is-selected span {
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 13%, transparent);
}

.case-status-action.tone-waiting.is-selected {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.case-status-action.tone-waiting.is-selected span {
  background: var(--amber);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 15%, transparent);
}

.case-status-action.tone-dormant.is-selected {
  border-color: #bdd5e8;
  background: #eef5fa;
  color: #25445f;
}

.case-status-action.tone-dormant.is-selected span {
  background: var(--focus);
}

.case-status-action.tone-closed.is-selected {
  border-color: #d4d8de;
  background: #f4f6f8;
  color: #5f6b78;
}

.case-status-action.tone-closed.is-selected span {
  background: #8a97a5;
}

.case-process-rail {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(23, 107, 91, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(237, 247, 243, 0.82), rgba(255, 255, 255, 0.76));
}

.case-process-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.case-process-panel-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.case-process-panel-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-process-panel-head strong {
  color: var(--green-dark);
  font-size: 20px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0;
}

.case-process-panel-head small {
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.case-process-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.case-process-check {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.case-process-check > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-process-check > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-process-check button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background 130ms ease,
    color 130ms ease;
}

.case-process-check button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
  color: var(--ink);
}

.case-process-check button.active {
  border-color: color-mix(in srgb, var(--green) 45%, var(--line));
  background: color-mix(in srgb, var(--green) 11%, white);
  color: var(--green-dark);
}

.case-process-check button.active.pending {
  border-color: #e2c487;
  background: #fff8e8;
  color: #7b520f;
}

.case-process-check button.active.done {
  border-color: #9fc8bb;
  background: #edf7f3;
  color: var(--green-dark);
}

.case-process-check button.active.blocked {
  border-color: #d99a92;
  background: #fff1ef;
  color: #8d2f24;
}

.case-process-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.case-status-actions,
.case-next-box,
.case-room-tabs,
.case-room-panels,
.case-support-data {
  display: none !important;
}

.case-command-card {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 250, 0.86));
  box-shadow: 0 18px 38px rgba(10, 42, 79, 0.07);
  overflow: hidden;
  scroll-margin-top: 18px;
}

.case-command-card.case-focus-pulse {
  animation: case-focus-pulse 1100ms ease;
}

@keyframes case-focus-pulse {
  0% {
    border-color: rgba(23, 107, 91, 0.36);
    box-shadow: 0 0 0 0 rgba(23, 107, 91, 0.16), 0 18px 38px rgba(10, 42, 79, 0.07);
  }
  100% {
    border-color: rgba(10, 42, 79, 0.10);
    box-shadow: 0 0 0 14px rgba(23, 107, 91, 0), 0 18px 38px rgba(10, 42, 79, 0.07);
  }
}

.case-command-card::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green) 70%, white);
}

.case-command-card.tone-overdue::before,
.case-command-card.tone-due::before {
  background: var(--brick);
}

.case-command-card.tone-soon::before,
.case-command-card.tone-watch::before {
  background: var(--amber);
}

.case-command-card.tone-missing::before,
.case-command-card.tone-waiting::before {
  background: var(--plum);
}

.case-command-card.tone-dormant::before,
.case-command-card.tone-closed::before {
  background: var(--line-strong);
}

.case-command-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.case-command-top > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.case-command-top span,
.case-command-field span,
.case-command-note summary,
.case-process-workbench-title span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-command-top strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 18px;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-command-top small {
  color: var(--muted);
  font-size: 12px;
}

.case-command-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.case-command-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 900;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.case-command-chip.tone-overdue,
.case-command-chip.tone-due {
  border-color: rgba(152, 66, 55, 0.28);
  background: #fff1ef;
  color: var(--brick) !important;
}

.case-command-chip.tone-soon,
.case-command-chip.tone-watch {
  border-color: rgba(168, 110, 18, 0.28);
  background: #fff8e8;
  color: #7b520f !important;
}

.case-command-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(170px, 0.9fr) minmax(260px, 1.35fr) minmax(180px, 0.9fr) minmax(96px, 0.55fr) minmax(116px, 0.65fr) auto;
  gap: 8px;
  align-items: end;
}

.case-command-field {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.case-command-main {
  min-width: 220px;
}

.case-command-field input,
.case-command-field select,
.case-command-note textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.case-command-date-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.case-command-date-tools button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  transition:
    border-color 130ms ease,
    background 130ms ease,
    color 130ms ease;
}

.case-command-date-tools button:hover {
  border-color: color-mix(in srgb, var(--green) 30%, var(--line));
  background: #fff;
  color: var(--green-dark);
}

.case-command-save {
  min-height: 36px;
  white-space: nowrap;
}

.case-command-note {
  border-top: 1px solid rgba(10, 42, 79, 0.08);
  padding-top: 8px;
}

.case-command-note summary {
  width: fit-content;
  cursor: pointer;
  color: var(--green-dark);
}

.case-command-note textarea {
  margin-top: 8px;
  min-height: 58px;
  resize: vertical;
}

.case-process-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(10, 42, 79, 0.055);
}

.case-process-card.primary,
.case-process-card.full {
  grid-column: 1 / -1;
}

.case-process-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.case-process-card-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.case-process-card-head span,
.case-process-card-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-process-card-head strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.case-process-card-head small {
  max-width: 360px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.case-process-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.case-process-card-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-process-card-grid label {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.case-process-card-grid .wide {
  grid-column: span 2;
}

.case-process-card-grid input,
.case-process-card-grid select,
.case-process-card-grid textarea {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.case-process-card-grid textarea {
  min-height: 58px;
  resize: vertical;
}

.case-process-save {
  align-self: end;
  min-height: 38px;
  white-space: nowrap;
}

.case-process-actions {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 7px;
}

.case-process-step {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 66px;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-align: center;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease;
}

.case-process-step:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 136, 229, 0.24);
  background: #fff;
  box-shadow: 0 10px 22px rgba(6, 26, 51, 0.06);
}

.case-process-step i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--line-strong) 26%, white);
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.case-process-step.done {
  border-color: color-mix(in srgb, var(--green) 18%, var(--line));
  color: color-mix(in srgb, var(--green-dark) 72%, var(--muted));
}

.case-process-step.done i {
  background: color-mix(in srgb, var(--green) 18%, white);
  color: var(--green-dark);
}

.case-process-step.current {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 9%, white);
  color: var(--green-dark);
  box-shadow: 0 8px 20px rgba(23, 107, 91, 0.08);
}

.case-process-step.selected {
  border-color: color-mix(in srgb, var(--focus) 42%, var(--green) 22%);
  box-shadow:
    0 0 0 3px rgba(30, 136, 229, 0.08),
    0 12px 26px rgba(6, 26, 51, 0.08);
}

.case-process-step.current i {
  background: var(--green);
  color: white;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 12%, transparent);
}

.case-process-step strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-process-step span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(71, 92, 118, 0.72);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.case-process-step.current span {
  color: color-mix(in srgb, var(--green-dark) 72%, var(--muted));
}

.case-process-workbench {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(0, 1.45fr);
  gap: 10px;
  min-width: 0;
  padding-top: 2px;
}

.case-process-workbench-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.case-process-workbench-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.case-process-step-list {
  display: grid;
  gap: 6px;
  align-content: start;
}

.case-process-step-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 2px 8px;
  padding: 9px 10px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-align: left;
  transition:
    transform 130ms ease,
    border-color 130ms ease,
    background 130ms ease,
    box-shadow 130ms ease;
}

.case-process-step-row:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--green) 24%, var(--line));
  background: #fff;
  box-shadow: 0 12px 22px rgba(6, 26, 51, 0.06);
}

.case-process-step-row.active {
  border-color: color-mix(in srgb, var(--focus) 36%, var(--line));
  background: color-mix(in srgb, var(--focus) 5%, white);
}

.case-process-step-row.current {
  box-shadow: inset 3px 0 0 var(--green);
}

.case-process-step-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-process-step-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-process-step-row small {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-process-step-row.done strong {
  color: var(--green-dark);
}

.case-process-step-row.blocked strong {
  color: #8d2f24;
}

.case-process-editor-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(10, 42, 79, 0.1);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 250, 0.86));
  box-shadow: 0 18px 36px rgba(10, 42, 79, 0.07);
}

.case-process-editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.case-operation-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(148px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.case-operation-editor .wide {
  grid-column: span 3;
}

.case-operation-editor .primary-button {
  min-height: 36px;
  align-self: end;
  white-space: nowrap;
}

.case-next-box {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.45;
}

.case-next-box.green {
  border-left-color: var(--green);
}

.case-next-box.yellow {
  border-left-color: var(--amber);
}

.case-next-box.red {
  border-left-color: var(--brick);
}

.case-next-box.blue {
  border-left-color: var(--focus);
}

.case-next-box span,
.case-next-box small {
  color: var(--muted);
  font-size: 12px;
}

.case-list {
  display: grid;
  gap: 9px;
}

.case-work-item {
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease;
}

.case-work-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.case-work-item.green {
  border-left-color: var(--green);
}

.case-work-item.yellow {
  border-left-color: var(--amber);
}

.case-work-item.red {
  border-left-color: var(--brick);
}

.case-work-item.blue {
  border-left-color: var(--focus);
}

.case-work-item.profile-linked {
  border-left-color: color-mix(in srgb, var(--gold) 70%, var(--line));
}

.case-work-main {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.case-work-open {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  line-height: 1.4;
}

.case-work-open:hover {
  color: var(--green-dark);
}

.case-work-open span,
.case-work-open small {
  color: var(--muted);
  font-size: 12px;
}

.case-work-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-work-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.case-work-chip.ready,
.case-work-chip.green {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  background: color-mix(in srgb, var(--green) 11%, var(--surface));
}

.case-work-chip.review,
.case-work-chip.yellow {
  border-color: color-mix(in srgb, var(--amber) 42%, var(--line));
  background: color-mix(in srgb, var(--amber) 13%, var(--surface));
}

.case-work-chip.blocked,
.case-work-chip.red {
  border-color: color-mix(in srgb, var(--brick) 42%, var(--line));
  background: color-mix(in srgb, var(--brick) 10%, var(--surface));
}

.case-work-chip.working,
.case-work-chip.blue {
  border-color: color-mix(in srgb, var(--focus) 36%, var(--line));
  background: color-mix(in srgb, var(--focus) 10%, var(--surface));
}

.case-work-chip.muted {
  color: var(--muted);
  font-weight: 600;
}

.case-work-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-work-warning {
  color: var(--brick);
  font-weight: 700;
}

.case-work-note {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  font-size: 12px;
  line-height: 1.35;
}

.case-work-note span {
  color: var(--muted);
}

.case-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.case-analysis-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid color-mix(in srgb, var(--gold) 70%, var(--line));
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.case-analysis-head {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(220px, 0.75fr);
  gap: 14px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.case-analysis-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.case-analysis-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.case-issue-matrix {
  display: grid;
  gap: 8px;
}

.case-issue-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1.6fr) minmax(180px, 0.75fr);
  gap: 12px;
  align-items: stretch;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 64%, var(--surface));
}

.case-issue-row.ready {
  border-color: color-mix(in srgb, var(--green) 28%, var(--line));
}

.case-issue-row.review {
  border-color: color-mix(in srgb, var(--amber) 32%, var(--line));
}

.case-issue-row.blocked {
  border-color: color-mix(in srgb, var(--brick) 30%, var(--line));
}

.case-issue-status,
.case-issue-note {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.case-issue-status strong,
.case-issue-note strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.case-issue-status small,
.case-issue-note span,
.case-issue-note small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.case-issue-source {
  min-width: 0;
  display: grid;
  align-content: start;
}

.case-source-button {
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  line-height: 1.25;
}

.case-source-button:hover {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
  color: var(--green-dark);
  box-shadow: var(--shadow-soft);
}

.case-source-button span,
.case-source-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-source-button small {
  color: var(--muted);
  font-size: 11px;
}

.case-empty-action.compact {
  padding: 12px;
}

.insight-form {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
}

.deadline-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.deadline-quick-form.tax-mode .deadline-quick-vat-only,
.deadline-quick-form.vat-mode .deadline-quick-tax-only {
  display: none;
}

.legacy-deadline-field,
.deadline-form [data-deadline-group] {
  display: none !important;
}

.deadline-info-box,
.deadline-inline-help {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid #cddfda;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: #f4faf7;
  color: var(--ink);
  line-height: 1.45;
}

.deadline-info-box {
  margin-top: 10px;
}

.deadline-info-box strong {
  font-size: 13px;
}

.deadline-info-box span,
.deadline-inline-help {
  color: var(--muted);
  font-size: 12px;
}

.field-hint {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.deadline-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.deadline-line-form {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.deadline-item-builder {
  grid-column: 1 / -1;
}

.deadline-kind-toggle {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
}

.deadline-kind-toggle label {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 750;
}

.deadline-kind-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.deadline-kind-toggle label:has(input:checked) {
  background: var(--surface);
  color: var(--green-dark);
  box-shadow: var(--shadow-soft);
}

.deadline-kind-toggle.premium-toggle {
  width: 100%;
}

.deadline-kind-toggle.premium-toggle label {
  flex: 1;
  justify-content: center;
}

.deadline-line-form.tax-mode .deadline-vat-only,
.deadline-line-form.vat-mode .deadline-tax-only {
  display: none;
}

.deadline-item-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.deadline-line-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.deadline-line-card.green {
  border-left-color: var(--green);
}

.deadline-line-card.yellow {
  border-left-color: var(--amber);
}

.deadline-line-card.red {
  border-left-color: var(--brick);
}

.deadline-line-card.blue {
  border-left-color: var(--focus);
}

.deadline-line-open {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.deadline-line-open span,
.deadline-line-open small {
  color: var(--muted);
  font-size: 12px;
}

.deadline-subsection {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.knowledge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
}

.deadline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deadline-analysis-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.deadline-next-action {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.deadline-next-action.green {
  border-left-color: var(--green);
}

.deadline-next-action.yellow {
  border-left-color: var(--amber);
}

.deadline-next-action.red {
  border-left-color: var(--brick);
}

.deadline-next-action.blue {
  border-left-color: var(--focus);
}

.deadline-next-action strong {
  font-size: 15px;
}

.deadline-next-action span,
.deadline-next-action small {
  color: var(--muted);
}

.deadline-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deadline-summary-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.deadline-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 4px;
}

.deadline-summary-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.deadline-period-grid {
  display: grid;
  gap: 8px;
}

.deadline-period-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.deadline-period-card.green {
  border-left-color: var(--green);
}

.deadline-period-card.yellow {
  border-left-color: var(--amber);
}

.deadline-period-card.red {
  border-left-color: var(--brick);
}

.deadline-period-card.blue {
  border-left-color: var(--focus);
}

.deadline-period-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.deadline-period-card header div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.deadline-period-card header span,
.deadline-period-card p,
.deadline-period-card li span,
.deadline-period-warnings small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.deadline-period-card mark {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef5fa;
  color: #25445f;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.deadline-period-card.green mark {
  background: #edf7f3;
  color: #176b5b;
}

.deadline-period-card.yellow mark {
  background: #fff8e8;
  color: #7b520f;
}

.deadline-period-card.red mark {
  background: #fff3f1;
  color: #7e3028;
}

.deadline-period-card ul {
  display: grid;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.deadline-period-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.deadline-period-card li strong {
  font-size: 12px;
}

.deadline-period-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.deadline-period-warnings small {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-tint);
}

.vertical-actions {
  display: grid;
}

.company-empty {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 10px;
  background: linear-gradient(135deg, #f8fbfa, #ffffff);
  line-height: 1.45;
}

.company-empty span {
  color: var(--muted);
}

.company-status-panel {
  display: grid;
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--focus);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff, #f8faf9);
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.04);
}

.company-status-panel.green {
  border-left-color: var(--green);
  background: linear-gradient(135deg, #f5fbf8, #ffffff);
}

.company-status-panel.yellow {
  border-left-color: var(--amber);
  background: linear-gradient(135deg, #fffaf0, #ffffff);
}

.company-status-panel.red {
  border-left-color: var(--brick);
  background: linear-gradient(135deg, #fff6f4, #ffffff);
}

.company-status-panel.blue {
  border-left-color: var(--focus);
}

.company-status-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}

.company-status-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-status-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
  letter-spacing: 0;
}

.company-status-main small,
.company-status-action small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.company-status-body {
  min-width: 0;
  display: grid;
  gap: 10px;
  align-content: center;
}

.company-status-body p {
  margin: 0;
  color: #2f3a37;
  line-height: 1.45;
}

.company-status-action {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(185, 200, 197, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.company-status-action span {
  font-weight: 750;
  line-height: 1.35;
}

.company-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.company-summary-grid,
.company-owner-insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.company-summary-card,
.company-insight-card {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 10px;
  background: var(--surface);
  line-height: 1.4;
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.company-summary-card:nth-child(2),
.company-insight-card:nth-child(2) {
  border-left-color: var(--focus);
}

.company-summary-card:nth-child(3),
.company-insight-card:nth-child(3) {
  border-left-color: var(--plum);
}

.company-summary-card:nth-child(4),
.company-insight-card:nth-child(4) {
  border-left-color: var(--amber);
}

.company-summary-card span,
.company-insight-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.company-summary-card strong,
.company-insight-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.company-insight-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.company-quality {
  display: grid;
  grid-template-columns: minmax(145px, 0.24fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.company-quality-score {
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 10px;
  background: var(--surface);
}

.company-quality-score.high {
  border-left-color: var(--green);
}

.company-quality-score.low {
  border-left-color: var(--brick);
}

.company-quality-score span,
.company-quality-score small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.company-quality-score strong {
  display: block;
  margin: 2px 0;
  font-size: 22px;
}

.company-quality-checks {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.company-quality-checks-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.company-quality-check {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: default;
}

.company-quality-check i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.company-quality-check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-quality-check.ok {
  color: var(--green-dark);
}

.company-quality-check.ok i {
  background: var(--green);
}

.company-quality-check.missing {
  color: var(--brick);
}

.company-quality-check.missing i {
  background: var(--brick);
}

.company-metric,
.company-detail,
.company-check,
.company-relation-item,
.ownership-row,
.company-report-item {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.company-metric span,
.company-detail span,
.company-check span,
.company-relation-item span,
.ownership-row span,
.company-report-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.company-metric span,
.company-detail span {
  display: block;
  margin-bottom: 4px;
  font-weight: 750;
}

.company-metric strong,
.company-detail strong,
.company-relation-item strong,
.ownership-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.company-detail-grid,
.company-report-list,
.company-risk-list,
.company-relation-list,
.ownership-chart,
.company-timeline,
.company-evidence-list {
  display: grid;
  gap: 8px;
}

[data-company-panel="risk"] .company-risk-list,
[data-company-panel="risk"] .company-relation-list {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  align-items: start;
}

[data-company-panel="risk"] .company-relation-item {
  grid-template-columns: 1fr;
  height: 100%;
}

[data-company-panel="risk"] .company-relation-side {
  justify-content: flex-start;
  max-width: none;
}

[data-company-panel="risk"] .company-risk-list {
  grid-template-columns: 1fr;
}

.company-risk-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(105, 181, 224, 0.13), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 253, 0.9));
  box-shadow: 0 16px 36px rgba(20, 76, 114, 0.07);
}

.company-risk-overview.red {
  border-color: rgba(152, 66, 55, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(152, 66, 55, 0.10), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 245, 0.82));
}

.company-risk-overview.yellow {
  border-color: rgba(168, 110, 18, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(168, 110, 18, 0.10), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 240, 0.84));
}

.company-risk-overview.green {
  border-color: rgba(23, 107, 91, 0.18);
}

.company-risk-overview span,
.company-risk-overview-metrics span,
.company-risk-support summary span {
  display: block;
  color: rgba(8, 38, 77, 0.56);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-risk-overview strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 18px;
  line-height: 1.18;
}

.company-risk-overview small {
  display: block;
  max-width: 720px;
  margin-top: 5px;
  color: rgba(8, 38, 77, 0.64);
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.45;
}

.company-risk-overview-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.company-risk-overview-metrics article {
  min-width: 82px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 159, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.company-risk-overview-metrics strong {
  margin-top: 2px;
  font-size: 17px;
  text-align: right;
}

.company-risk-card-list,
.company-risk-support-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 9px;
}

.company-risk-card.signal-coverage,
.company-risk-card.signal-compliance {
  border-left-color: rgba(47, 111, 159, 0.42);
  background: rgba(255, 255, 255, 0.72);
}

.company-risk-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 3px;
}

.company-risk-card-grid div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(47, 111, 159, 0.09);
  border-radius: 10px;
  background: rgba(244, 249, 252, 0.68);
}

.company-risk-card-grid span {
  display: block;
  margin-bottom: 2px;
  color: rgba(8, 38, 77, 0.52);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-risk-card-grid strong {
  color: rgba(8, 38, 77, 0.78);
  font-size: 12px;
  line-height: 1.35;
}

.company-risk-empty {
  padding: 14px;
  border: 1px dashed rgba(47, 111, 159, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.company-risk-empty strong,
.company-risk-empty span {
  display: block;
}

.company-risk-empty strong {
  color: var(--brand-navy, var(--ink));
}

.company-risk-empty span {
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.60);
  font-size: 12.5px;
  line-height: 1.4;
}

.company-risk-support {
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.company-risk-support summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.company-risk-support summary::-webkit-details-marker {
  display: none;
}

.company-risk-support summary strong {
  color: var(--source-blue);
  font-size: 12px;
}

.company-risk-support[open] .company-risk-support-list {
  padding: 0 12px 12px;
}

.company-detail-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.company-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.company-filter-row select {
  width: 100%;
}

.company-accounts-shell {
  display: grid;
  gap: 10px;
}

.company-accounts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(8, 38, 77, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.company-accounts-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

.company-accounts-head strong {
  color: var(--brand-navy);
  font-size: 18px;
  line-height: 1.2;
}

.company-accounts-list {
  display: grid;
  gap: 9px;
}

.company-report-register {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(8, 38, 77, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.company-report-register-head,
.company-report-item {
  display: grid;
  grid-template-columns: minmax(105px, 0.62fr) minmax(260px, 1.55fr) minmax(150px, 0.82fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
}

.company-report-register-head {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(8, 38, 77, 0.08);
  color: var(--muted);
  font-size: 10.8px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  background: rgba(244, 249, 252, 0.72);
}

.company-accounts-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--premium-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.company-accounts-empty strong {
  color: var(--brand-navy);
  font-size: 14px;
}

.company-report-item {
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(8, 38, 77, 0.08);
  color: var(--ink);
  text-decoration: none;
}

.company-report-item:last-child {
  border-bottom: 0;
}

.company-report-period,
.company-report-source,
.company-report-main {
  min-width: 0;
}

.company-report-period strong {
  display: block;
  color: var(--brand-navy);
  font-size: 14px;
  line-height: 1.2;
}

.company-report-period span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.company-report-item strong,
.company-report-main strong {
  display: block;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
  color: var(--brand-navy);
  font-size: 14px;
  line-height: 1.28;
}

.company-report-item span,
.company-report-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.company-report-source small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.25;
}

.company-report-availability {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(8, 69, 111, 0.14);
  border-radius: 999px;
  background: rgba(232, 244, 250, 0.74);
  color: var(--brand-blue);
  font-size: 11.5px;
  font-weight: 900;
}

.company-report-availability.source {
  border-color: rgba(154, 111, 18, 0.18);
  background: rgba(255, 250, 231, 0.72);
  color: #85620f;
}

.company-report-availability.muted {
  border-color: rgba(16, 42, 67, 0.10);
  background: rgba(246, 248, 249, 0.82);
  color: var(--muted);
}

.company-report-availability.technical {
  border-color: rgba(8, 69, 111, 0.12);
  background: rgba(244, 249, 252, 0.92);
  color: var(--muted);
}

.company-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.company-report-open,
.company-report-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(8, 69, 111, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-navy);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.company-report-open {
  background: var(--brand-blue);
  color: #fff;
}

.company-report-open.technical {
  border-color: rgba(8, 69, 111, 0.18);
  background: rgba(232, 244, 250, 0.88);
  color: var(--brand-navy);
}

.company-report-download {
  color: var(--focus);
}

.company-report-download.technical {
  color: var(--muted);
}

.company-report-download.source {
  color: #85620f;
}

.company-report-item.technical-report {
  background: linear-gradient(90deg, rgba(244, 249, 252, 0.62), rgba(255, 255, 255, 0.84));
}

.company-report-item:hover {
  background: rgba(244, 249, 252, 0.58);
}

.company-group-structure {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #fbfcfc, #f6f9f8);
}

.company-network-expand {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.company-owner-insights[hidden],
.ownership-chart[hidden],
.company-role-ledger[hidden] {
  display: none !important;
}

.company-folded-section {
  display: block;
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 161, 205, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 34px rgba(8, 38, 77, 0.055);
}

.company-folded-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.company-folded-section > summary::-webkit-details-marker {
  display: none;
}

.company-folded-section > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(47, 111, 159, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #2f6f9f;
  font-size: 13px;
  font-weight: 900;
}

.company-folded-section[open] > summary::after {
  content: "-";
}

.company-folded-section > summary span {
  display: block;
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 850;
}

.company-folded-section > summary strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 900;
}

.company-folded-section-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.company-folded-section:not([open]) > .company-folded-section-body {
  display: none;
}

.company-network-expand {
  display: block;
}

.company-network-expand-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.company-network-expand-summary::-webkit-details-marker {
  display: none;
}

.company-network-expand-summary span {
  color: rgba(8, 38, 77, 0.54);
  font-size: 11px;
  font-weight: 850;
}

.company-network-expand-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
}

.company-network-expand-summary em {
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(47, 111, 159, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #2f6f9f;
  font-style: normal;
  font-size: 12px;
  font-weight: 850;
}

.company-network-expand[open] .company-network-expand-summary em {
  color: var(--muted);
}

.company-network-expand[open] .company-network-expand-summary em::before {
  content: "Luk";
}

.company-network-expand[open] .company-network-expand-summary em {
  font-size: 0;
}

.company-network-expand[open] .company-network-expand-summary em::before {
  font-size: 12px;
}

.company-network-expand-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(47, 111, 159, 0.12);
}

.company-network-expand:not([open]) > .company-network-expand-body {
  display: none;
}

.company-network-expand-head,
.company-network-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-network-expand-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-network-expand-head strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
}

.company-network-options {
  border: 1px solid rgba(31, 84, 76, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.company-network-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.company-network-options summary::-webkit-details-marker {
  display: none;
}

.company-network-options summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--premium-border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 850;
}

.company-network-options[open] summary {
  border-bottom: 1px solid var(--premium-border);
  background: rgba(247, 250, 249, 0.86);
}

.company-network-options[open] summary::after {
  content: "-";
}

.company-network-controls {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 12px;
}

.company-network-controls > label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-network-controls select {
  min-width: 112px;
}

.company-network-type-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.company-network-type-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.company-network-status {
  min-height: 34px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 750;
}

.company-network-status.ready {
  border-left: 4px solid var(--green);
}

.company-network-status.loading,
.company-network-status.stale {
  border-left: 4px solid var(--focus);
}

.company-network-status.warning {
  border-left: 4px solid var(--amber);
  background: #fffaf0;
  color: #6b4a13;
}

.company-network-status.error {
  border-left: 4px solid var(--brick);
  background: #fff7f5;
  color: #8f2e1c;
}

.company-expanded-network {
  display: grid;
  gap: 12px;
}

.company-network-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.company-network-warnings {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #d9c99f;
  border-radius: 8px;
  background: #fffaf0;
}

.company-network-warnings span {
  color: #6b4a13;
  font-size: 12px;
}

.company-network-depths,
.company-network-edge-list {
  display: grid;
  gap: 10px;
}

.company-network-depth {
  display: grid;
  gap: 8px;
}

.company-network-node-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.company-network-node,
.company-network-edge {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.company-network-node.green {
  border-left-color: var(--green);
}

.company-network-node.yellow {
  border-left-color: var(--amber);
}

.company-network-node.amber {
  border-left-color: var(--amber);
}

.company-network-node.slate {
  border-left-color: #6b7b88;
}

.company-network-node.red {
  border-left-color: var(--brick);
}

.company-network-node span,
.company-network-edge span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-network-node strong,
.company-network-edge strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.company-network-node small,
.company-network-edge small,
.company-network-edge em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.company-network-node-side {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 6px;
}

.company-network-node-side em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

@media (max-width: 860px) {
  .company-network-summary,
  .company-network-node-list {
    grid-template-columns: 1fr;
  }
}

/* Public SEO landing page */
.public-landing.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  padding: 28px clamp(34px, 5vw, 86px);
  overflow: auto;
  background:
    radial-gradient(circle at 68% 18%, rgba(73, 158, 211, 0.22), transparent 30%),
    radial-gradient(circle at 14% 88%, rgba(8, 38, 77, 0.10), transparent 32%),
    linear-gradient(135deg, #f8fcff 0%, #edf7fc 48%, #ffffff 100%);
}

.public-landing.auth-gate::before,
.public-landing.auth-gate::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(25, 101, 151, 0.13);
  border-radius: 50%;
  transform: rotate(-7deg) scaleY(0.42);
}

.public-landing.auth-gate::before {
  width: min(62vw, 760px);
  height: min(62vw, 760px);
  top: 8vh;
  right: -10vw;
  box-shadow:
    0 0 0 42px rgba(50, 151, 213, 0.035),
    0 0 0 106px rgba(50, 151, 213, 0.025),
    0 0 0 174px rgba(50, 151, 213, 0.018);
}

.public-landing.auth-gate::after {
  width: min(48vw, 620px);
  height: min(48vw, 620px);
  left: -12vw;
  bottom: -19vh;
  opacity: 0.82;
  box-shadow:
    0 0 0 36px rgba(10, 42, 79, 0.026),
    0 0 0 90px rgba(30, 136, 229, 0.022);
}

.landing-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  gap: 26px;
  padding-bottom: 34px;
}

.landing-nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 2px;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--source-blue);
  text-decoration: none;
}

.landing-brand img {
  width: 160px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 12px 26px rgba(8, 38, 77, 0.14));
}

.landing-brand span {
  position: relative;
  padding: 0 6px 9px 2px;
  color: rgba(8, 38, 77, 0.84);
  font-size: 14px;
  font-weight: 920;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.landing-brand span::after {
  content: "";
  position: absolute;
  left: 0;
  right: -22px;
  bottom: 1px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(30, 136, 229, 0.72), rgba(10, 42, 79, 0.58), rgba(30, 136, 229, 0.12));
  box-shadow: 0 4px 14px rgba(30, 136, 229, 0.14);
}

.landing-nav nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 14px 38px rgba(8, 38, 77, 0.07);
  backdrop-filter: blur(16px);
}

.landing-nav nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  color: rgba(8, 38, 77, 0.72);
  font-size: 13px;
  font-weight: 820;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.landing-nav nav a:hover,
.landing-nav nav a:focus-visible {
  background: rgba(255, 255, 255, 0.82);
  color: var(--source-blue);
  outline: none;
  transform: translateY(-1px);
}

.landing-main {
  display: grid;
  gap: 26px;
}

.landing-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.landing-hero-copy {
  display: grid;
  gap: 18px;
  align-content: center;
}

.landing-kicker {
  width: max-content;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: rgba(8, 38, 77, 0.68);
  font-size: 12px;
  font-weight: 900;
}

.landing-hero h1 {
  max-width: 850px;
  margin: 0;
  color: var(--source-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 4.1vw, 72px);
  font-weight: 760;
  line-height: 0.99;
  letter-spacing: 0;
}

.landing-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(8, 38, 77, 0.70);
  font-size: 18px;
  font-weight: 610;
  line-height: 1.58;
}

.landing-practice-line {
  width: min(820px, 100%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  margin-top: 2px;
  color: rgba(8, 38, 77, 0.66);
  font-size: 13px;
  font-weight: 820;
}

.landing-practice-line span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
}

.landing-practice-line span + span::before {
  content: "";
  width: 4px;
  height: 4px;
  margin: 0 12px;
  border-radius: 999px;
  background: rgba(30, 136, 229, 0.52);
  box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.08);
}

.landing-search-card {
  width: min(720px, 100%);
  min-height: 68px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 18px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 26px 74px rgba(8, 38, 77, 0.12);
}

.landing-search-card svg {
  color: var(--source-blue-mid);
}

.landing-search-card span {
  min-width: 0;
  color: rgba(8, 38, 77, 0.54);
  font-size: 15px;
  font-weight: 760;
}

.landing-search-card a,
.landing-primary,
.landing-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.landing-search-card a,
.landing-primary {
  border: 1px solid rgba(8, 38, 77, 0.08);
  background: linear-gradient(180deg, #0f5f99, #0a3e73);
  color: #fff;
  box-shadow: 0 16px 34px rgba(8, 38, 77, 0.20);
}

.landing-secondary {
  border: 1px solid rgba(47, 111, 159, 0.16);
  background: rgba(255, 255, 255, 0.62);
  color: var(--source-blue);
}

.landing-search-card a:hover,
.landing-primary:hover,
.landing-secondary:hover,
.landing-search-card a:focus-visible,
.landing-primary:focus-visible,
.landing-secondary:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-water-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.88), transparent 14%),
    radial-gradient(ellipse at 50% 56%, rgba(16, 94, 151, 0.20), transparent 22%),
    radial-gradient(ellipse at 50% 58%, rgba(47, 111, 159, 0.12), transparent 38%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.58), rgba(222, 241, 251, 0.46));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 24px 64px rgba(8, 38, 77, 0.08);
}

.water-ring {
  position: absolute;
  border: 1px solid rgba(20, 88, 132, 0.24);
  border-radius: 50%;
  transform: rotate(-8deg) scaleY(0.36);
}

.ring-one {
  width: 170px;
  height: 170px;
}

.ring-two {
  width: 300px;
  height: 300px;
  opacity: 0.7;
}

.ring-three {
  width: 430px;
  height: 430px;
  opacity: 0.42;
}

.water-drop {
  position: absolute;
  top: 34%;
  width: 18px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(9, 67, 115, 0.86));
  box-shadow:
    0 0 0 7px rgba(255, 255, 255, 0.32),
    0 18px 42px rgba(8, 38, 77, 0.32);
}

.landing-proof-card {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 6px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 54px rgba(8, 38, 77, 0.12);
  backdrop-filter: blur(16px);
}

.landing-proof-card strong {
  color: var(--source-blue);
  font-size: 18px;
}

.landing-proof-card span {
  color: rgba(8, 38, 77, 0.62);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.landing-modules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-workflow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 22px;
  background: rgba(47, 111, 159, 0.12);
  box-shadow: 0 18px 54px rgba(8, 38, 77, 0.07);
}

.landing-workflow div {
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px;
  background:
    radial-gradient(circle at 86% 16%, rgba(73, 158, 211, 0.16), transparent 28%),
    rgba(255, 255, 255, 0.76);
}

.landing-workflow span {
  color: rgba(30, 136, 229, 0.72);
  font-size: 12px;
  font-weight: 950;
}

.landing-workflow strong {
  color: var(--source-blue);
  font-size: 19px;
}

.landing-workflow p {
  margin: 0;
  color: rgba(8, 38, 77, 0.62);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.48;
}

.landing-pricing {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(360px, 0.52fr);
  gap: 22px;
  align-items: stretch;
  padding: 22px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 28%, rgba(73, 158, 211, 0.14), transparent 30%),
    radial-gradient(ellipse at 88% 14%, rgba(255, 255, 255, 0.92), transparent 36%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.82), rgba(227, 244, 253, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 24px 72px rgba(8, 38, 77, 0.10);
}

.landing-pricing-copy {
  display: grid;
  align-content: center;
  gap: 13px;
  min-height: 420px;
  padding: 10px clamp(12px, 2vw, 22px);
}

.landing-section-kicker {
  width: max-content;
  max-width: 100%;
  padding: 7px 11px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(8, 38, 77, 0.72);
  font-size: 12px;
  font-weight: 920;
}

.landing-pricing h2 {
  max-width: 650px;
  margin: 0;
  color: var(--source-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 3vw, 52px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: 0;
}

.landing-pricing-copy p {
  max-width: 690px;
  margin: 0;
  color: rgba(8, 38, 77, 0.68);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.62;
}

.landing-price-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: clamp(20px, 2.2vw, 28px);
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(76, 169, 221, 0.18), transparent 28%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 76px rgba(8, 38, 77, 0.13);
}

.landing-price-card::before {
  content: "";
  position: absolute;
  inset: auto -18% -42% 18%;
  height: 260px;
  pointer-events: none;
  border: 1px solid rgba(30, 136, 229, 0.12);
  border-radius: 50%;
  transform: rotate(-8deg) scaleY(0.36);
  box-shadow:
    0 0 0 34px rgba(30, 136, 229, 0.026),
    0 0 0 82px rgba(30, 136, 229, 0.018);
}

.landing-price-card > * {
  position: relative;
  z-index: 1;
}

.landing-price-head,
.landing-price-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.landing-price-head div {
  display: grid;
  gap: 4px;
}

.landing-price-head span {
  color: rgba(8, 38, 77, 0.52);
  font-size: 12px;
  font-weight: 900;
  text-transform: none;
}

.landing-price-head strong {
  color: var(--source-blue);
  font-size: 21px;
}

.landing-price-head em {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(226, 245, 255, 0.95);
  color: var(--source-blue-mid);
  font-size: 12px;
  font-style: normal;
  font-weight: 920;
}

.landing-price-main {
  display: grid;
  gap: 4px;
  padding: 8px 0 2px;
}

.landing-price-main strong {
  color: var(--source-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 4.4vw, 66px);
  font-weight: 760;
  line-height: 0.92;
}

.landing-price-main span,
.landing-price-vat,
.landing-price-note {
  color: rgba(8, 38, 77, 0.62);
  font-size: 13px;
  font-weight: 680;
  line-height: 1.48;
}

.landing-price-annual {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 16px;
  background: rgba(239, 249, 255, 0.86);
}

.landing-price-annual strong {
  color: var(--source-blue);
  font-size: 14px;
}

.landing-price-annual span {
  color: rgba(8, 38, 77, 0.66);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.landing-price-features {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.landing-price-features li {
  position: relative;
  padding-left: 22px;
  color: rgba(8, 38, 77, 0.72);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.48;
}

.landing-price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2e8bd1, #0a3e73);
  box-shadow: 0 0 0 4px rgba(46, 139, 209, 0.1);
}

.landing-checkout-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(231, 246, 255, 0.72)),
    rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.landing-checkout-form label {
  display: grid;
  gap: 5px;
}

.landing-checkout-form label > span,
.landing-checkout-status {
  color: rgba(8, 38, 77, 0.62);
  font-size: 11.5px;
  font-weight: 850;
}

.landing-checkout-form input[type="text"],
.landing-checkout-form input:not([type]) {
  width: 100%;
}

.landing-checkout-form input {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 111, 159, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--source-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.landing-checkout-form input:focus-visible {
  border-color: rgba(23, 92, 150, 0.46);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 4px rgba(46, 139, 209, 0.13);
}

.landing-billing-cycle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.landing-billing-cycle label {
  position: relative;
  min-height: 38px;
}

.landing-billing-cycle input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.landing-billing-cycle span {
  height: 100%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(8, 38, 77, 0.66);
  font-size: 12px;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.landing-billing-cycle input:checked + span {
  border-color: rgba(23, 92, 150, 0.34);
  background: linear-gradient(135deg, rgba(226, 245, 255, 0.98), rgba(255, 255, 255, 0.94));
  color: var(--source-blue);
  box-shadow: 0 10px 24px rgba(8, 38, 77, 0.08);
}

.landing-checkout-form .landing-primary {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.landing-checkout-form .landing-primary:disabled {
  cursor: wait;
  opacity: 0.72;
}

.landing-checkout-status {
  min-height: 17px;
  line-height: 1.35;
}

.landing-checkout-status.error {
  color: #a33b29;
}

.landing-price-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: 2px;
}

.landing-price-note {
  margin: 0;
  padding-top: 2px;
}

.landing-modules article {
  min-height: 172px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 16px 44px rgba(8, 38, 77, 0.065);
}

.landing-modules svg {
  width: 28px;
  height: 28px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(237, 246, 252, 0.96);
  color: var(--source-blue-mid);
}

.landing-modules strong {
  color: var(--source-blue);
  font-size: 17px;
}

.landing-modules span {
  color: rgba(8, 38, 77, 0.62);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}

.landing-card-link {
  width: max-content;
  max-width: 100%;
  margin-top: 3px;
  color: var(--source-blue-mid);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.landing-card-link:hover,
.landing-card-link:focus-visible {
  color: var(--source-blue);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.landing-trust {
  display: grid;
  grid-template-columns: minmax(260px, 0.56fr) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(120deg, rgba(8, 38, 77, 0.94), rgba(15, 76, 118, 0.88)),
    var(--source-blue);
  box-shadow: 0 22px 62px rgba(8, 38, 77, 0.18);
}

.landing-trust span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-trust strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.12;
}

.landing-trust p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 620;
  line-height: 1.58;
}

.public-landing .auth-card {
  display: none;
}

.public-landing .auth-card:target,
.public-landing.auth-panel-required .auth-card {
  position: fixed;
  top: 94px;
  right: clamp(22px, 5vw, 72px);
  z-index: 80;
  width: min(410px, calc(100vw - 44px));
  display: grid;
  gap: 16px;
  padding: 24px;
  margin: 0;
}

.auth-panel-close {
  position: absolute;
  top: 13px;
  right: 16px;
  z-index: 2;
  color: rgba(8, 38, 77, 0.58);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.auth-panel-close:hover,
.auth-panel-close:focus-visible {
  color: var(--source-blue);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (max-width: 1180px) {
  .public-landing.auth-gate {
    grid-template-columns: 1fr;
  }

  .public-landing .auth-card {
    position: relative;
    top: auto;
    width: min(560px, 100%);
    margin: 0 auto 38px;
  }

  .landing-shell {
    max-width: none;
  }

  .landing-hero h1 {
    max-width: 560px;
    font-size: clamp(42px, 5vw, 58px);
  }
}

@media (max-width: 920px) {
  .landing-nav,
  .landing-hero,
  .landing-pricing,
  .landing-trust {
    grid-template-columns: 1fr;
  }

  .landing-pricing-copy {
    min-height: auto;
    padding: 2px;
  }

  .landing-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-nav nav {
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .landing-water-visual {
    min-height: 360px;
  }

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

  .landing-price-card {
    max-width: 720px;
  }

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

@media (max-width: 640px) {
  .public-landing.auth-gate {
    padding: 18px;
  }

  .landing-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .landing-brand img {
    width: 138px;
  }

  .landing-hero {
    min-height: 0;
  }

  .landing-hero h1 {
    font-size: 40px;
  }

  .landing-search-card {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .landing-search-card a {
    grid-column: 1 / -1;
  }

  .landing-modules {
    grid-template-columns: 1fr;
  }

  .landing-pricing {
    padding: 14px;
    border-radius: 22px;
  }

  .landing-price-head,
  .landing-price-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-workflow {
    grid-template-columns: 1fr;
  }
}

.public-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 70% 8%, rgba(73, 158, 211, 0.20), transparent 30%),
    radial-gradient(circle at 8% 82%, rgba(8, 38, 77, 0.10), transparent 34%),
    linear-gradient(135deg, #f8fcff 0%, #eef8fd 48%, #ffffff 100%);
  color: var(--source-blue);
}

.public-page-nav {
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 14px 0;
}

.public-page-nav nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 14px 38px rgba(8, 38, 77, 0.07);
  backdrop-filter: blur(16px);
}

.public-page-nav nav a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: rgba(8, 38, 77, 0.72);
  font-size: 13px;
  font-weight: 860;
  text-decoration: none;
}

.public-page-nav nav a:hover,
.public-page-nav nav a:focus-visible,
.public-page-nav nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.86);
  color: var(--source-blue);
  outline: none;
}

.public-page-shell {
  width: min(1180px, calc(100% - 48px));
  display: grid;
  gap: 28px;
  margin: 0 auto;
  padding: 44px 0 72px;
}

.public-page-hero {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 18px;
  padding: clamp(28px, 5vw, 62px);
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 82% 42%, rgba(47, 111, 159, 0.20), transparent 30%),
    radial-gradient(ellipse at 78% 44%, rgba(255, 255, 255, 0.84), transparent 14%),
    rgba(255, 255, 255, 0.66);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 28px 80px rgba(8, 38, 77, 0.10);
}

.public-page-hero h1 {
  max-width: 860px;
  margin: 0;
  color: var(--source-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 5.6vw, 76px);
  font-weight: 760;
  line-height: 1;
}

.public-page-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(8, 38, 77, 0.70);
  font-size: 18px;
  font-weight: 620;
  line-height: 1.6;
}

.public-content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.public-content-grid article {
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 48px rgba(8, 38, 77, 0.06);
}

.public-content-grid h2 {
  margin: 0;
  color: var(--source-blue);
  font-size: 21px;
  line-height: 1.16;
}

.public-content-grid p {
  margin: 0;
  color: rgba(8, 38, 77, 0.64);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.62;
}

.public-page-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 22px;
  background: linear-gradient(120deg, rgba(8, 38, 77, 0.94), rgba(15, 76, 118, 0.88));
  box-shadow: 0 22px 62px rgba(8, 38, 77, 0.18);
}

.public-page-cta strong {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.1;
}

.landing-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: 1px solid rgba(47, 111, 159, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.landing-seo-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--source-blue);
  font-size: 13px;
  font-weight: 860;
  text-decoration: none;
}

.landing-seo-links a:hover,
.landing-seo-links a:focus-visible {
  outline: none;
  border-color: rgba(47, 111, 159, 0.24);
  box-shadow: 0 12px 28px rgba(8, 38, 77, 0.08);
}

.public-longform {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 14px;
}

.public-longform article {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 24px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 16px 48px rgba(8, 38, 77, 0.055);
}

.public-longform h2 {
  margin: 0;
  color: var(--source-blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.12;
}

.public-longform p {
  margin: 0;
  color: rgba(8, 38, 77, 0.66);
  font-size: 15px;
  font-weight: 640;
  line-height: 1.68;
}

@media (max-width: 980px) {
  .public-page-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-page-nav nav {
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .public-content-grid {
    grid-template-columns: 1fr;
  }

  .public-longform {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .public-page-nav,
  .public-page-shell {
    width: min(100% - 32px, 1180px);
  }

  .public-page-hero h1 {
    font-size: 40px;
  }

  .public-page-cta {
    align-items: flex-start;
    flex-direction: column;
  }
}

.company-group-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.company-group-header span,
.company-group-header small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-group-header strong {
  display: block;
  margin-top: 2px;
  font-size: 16px;
}

.company-group-header.premium {
  padding: 2px 2px 0;
}

.company-group-header.premium span,
.company-group-header.premium small {
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-group-header.premium strong {
  color: var(--brand-navy, var(--ink));
  font-size: 17px;
  font-weight: 900;
  line-height: 1.25;
}

.company-structure-route {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 8px;
  padding: 11px 0;
  border-top: 1px solid rgba(47, 111, 159, 0.12);
  border-bottom: 1px solid rgba(47, 111, 159, 0.12);
  background: rgba(250, 253, 255, 0.54);
}

.company-structure-route-item {
  min-width: 0;
  padding: 1px 16px;
}

.company-structure-route-item + .company-structure-route-item {
  border-left: 1px solid rgba(47, 111, 159, 0.12);
}

.company-structure-route-item span,
.company-structure-route-item strong,
.company-structure-route-item small {
  display: block;
}

.company-structure-route-item span {
  color: rgba(8, 38, 77, 0.52);
  font-size: 10.5px;
  font-weight: 820;
}

.company-structure-route-item strong {
  margin-top: 3px;
  overflow: hidden;
  color: var(--brand-navy, var(--ink));
  font-size: 14px;
  font-weight: 880;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-structure-route-item small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 670;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-structure-route-item .company-inline-action {
  margin-top: 7px;
}

.company-structure-route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

#companyPanelNetwork .company-group-structure {
  margin: 0 0 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.company-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.company-group-grid.columns-1 {
  grid-template-columns: minmax(0, 1fr);
}

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

.company-group-grid.columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-group-column {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.company-structure-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 0.92fr) minmax(260px, 1.08fr) minmax(230px, 1fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 42%, rgba(79, 161, 205, 0.10), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.92));
  box-shadow:
    0 18px 44px rgba(8, 38, 77, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.company-structure-board::before,
.company-structure-board::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 111, 159, 0.34), transparent);
}

.company-structure-board::before {
  left: 30.5%;
}

.company-structure-board::after {
  right: 30.5%;
}

.company-structure-lane,
.company-structure-center {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.company-structure-lane {
  display: grid;
  align-content: start;
  gap: 10px;
}

.company-structure-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  padding: 0 2px;
}

.company-structure-lane-head span,
.company-structure-admin > span {
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-structure-lane-head strong {
  color: rgba(8, 38, 77, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.company-structure-stack {
  display: grid;
  gap: 8px;
}

.company-structure-center {
  display: grid;
  align-content: start;
  gap: 10px;
}

.company-structure-company-card {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid rgba(47, 111, 159, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.14), transparent 38%),
    #fff;
  box-shadow: 0 14px 28px rgba(8, 38, 77, 0.08);
}

.company-structure-company-card span {
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-structure-company-card strong {
  color: var(--brand-navy, var(--ink));
  font-size: 18px;
  font-weight: 950;
  line-height: 1.18;
}

.company-structure-company-card small {
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.company-structure-company-card em {
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 4px 9px;
  border: 1px solid rgba(47, 111, 159, 0.20);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: var(--brand-navy, var(--ink));
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.company-structure-board.watch .company-structure-company-card em {
  border-color: rgba(186, 76, 54, 0.30);
  background: rgba(186, 76, 54, 0.10);
  color: var(--brick);
}

.company-structure-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-structure-signal-row span,
.company-structure-more {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(8, 38, 77, 0.64);
  font-size: 11px;
  font-weight: 850;
}

.company-structure-admin {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.company-structure-gapline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-structure-gapline span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: rgba(8, 38, 77, 0.54);
  font-size: 11px;
  font-weight: 800;
}

.company-group-node,
.company-group-empty {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.company-structure-board .company-group-node,
.company-structure-board .company-group-empty {
  border-color: rgba(47, 111, 159, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(8, 38, 77, 0.045);
}

.company-structure-board .company-group-node-top span {
  color: rgba(8, 38, 77, 0.48);
  font-size: 10px;
}

.company-structure-board .company-group-node strong {
  color: var(--brand-navy, var(--ink));
  font-size: 13px;
  line-height: 1.25;
}

.company-structure-board .company-group-node small {
  color: rgba(8, 38, 77, 0.58);
}

.company-group-empty {
  display: grid;
  gap: 4px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.48);
}

.company-group-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.company-group-node.current {
  box-shadow: 0 1px 0 rgba(22, 31, 29, 0.03);
}

.company-group-node.exited {
  border-style: dashed;
  background: #fffaf0;
}

.company-group-node-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.company-group-column.parent .company-group-node {
  border-left: 4px solid var(--plum);
}

.company-group-column.center .company-group-node {
  border-left: 4px solid var(--green);
}

.company-group-column.subsidiary .company-group-node {
  border-left: 4px solid var(--focus);
}

.company-group-node span,
.company-group-node small,
.company-group-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.company-group-node span {
  display: block;
  margin-bottom: 3px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-lifecycle-pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.company-lifecycle-pill.current {
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  color: var(--green-dark);
}

.company-lifecycle-pill.exited {
  border-color: color-mix(in srgb, var(--amber) 45%, var(--line));
  color: #6b4a13;
}

.company-group-node strong {
  display: block;
  overflow-wrap: anywhere;
}

.company-group-node small {
  display: block;
  margin-top: 4px;
}

.company-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.company-inline-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.company-inline-action:hover,
.company-inline-action:focus-visible {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
  outline: none;
}

.company-inline-action.primary {
  border-color: color-mix(in srgb, var(--focus) 46%, var(--line));
  color: var(--focus);
  background: color-mix(in srgb, var(--focus) 8%, #fff);
}

.company-group-subhead {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.company-group-gaps {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid #d9c99f;
  border-radius: 10px;
  background: #fffaf0;
}

.company-group-gaps span {
  color: #6b4a13;
  font-size: 12px;
  line-height: 1.35;
}

.company-structure-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(185, 200, 197, 0.78);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
}

.company-structure-note.company-history-handoff {
  border-color: rgba(47, 111, 159, 0.14);
  border-left: 3px solid rgba(47, 111, 159, 0.32);
  background:
    radial-gradient(circle at 4% 0%, rgba(79, 161, 205, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.72);
}

.company-structure-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-structure-note strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.company-history-handoff strong {
  color: rgba(8, 38, 77, 0.76);
  font-weight: 850;
}

.company-control-spine {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(260px, 1.05fr) minmax(220px, 0.95fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(79, 161, 205, 0.16), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 253, 0.90));
  box-shadow:
    0 16px 38px rgba(8, 38, 77, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.company-control-spine::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 111, 159, 0.38), rgba(79, 161, 205, 0.42), transparent);
}

.company-control-spine-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 9px 22px rgba(8, 38, 77, 0.045);
}

.company-control-spine-card.center {
  border-color: rgba(47, 111, 159, 0.22);
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.15), transparent 42%),
    rgba(255, 255, 255, 0.94);
  box-shadow:
    0 14px 30px rgba(8, 38, 77, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.90);
}

.company-control-spine-card.upstream {
  border-left: 4px solid rgba(16, 82, 135, 0.46);
}

.company-control-spine-card.downstream {
  border-left: 4px solid rgba(79, 161, 205, 0.58);
}

.company-control-spine-card span {
  color: rgba(8, 38, 77, 0.54);
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.company-control-spine-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy, var(--ink));
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.company-control-spine-card.center strong {
  font-size: 17px;
}

.company-control-spine-card small {
  min-width: 0;
  color: rgba(8, 38, 77, 0.62);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
}

.company-control-spine-card em {
  width: max-content;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(47, 111, 159, 0.20);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: var(--brand-navy, var(--ink));
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.company-subsidiary-layer {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(47, 111, 159, 0.15);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 4%, rgba(79, 161, 205, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 253, 0.93));
  box-shadow:
    0 16px 36px rgba(8, 38, 77, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.company-subsidiary-layer.empty {
  padding: 12px 14px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.10), transparent 38%),
    rgba(255, 255, 255, 0.84);
}

.company-subsidiary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.company-subsidiary-head > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-subsidiary-head span {
  color: rgba(8, 38, 77, 0.54);
  font-size: 10.5px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-subsidiary-head strong {
  min-width: 0;
  color: var(--brand-navy, var(--ink));
  font-size: 15px;
  font-weight: 950;
  line-height: 1.2;
}

.company-subsidiary-head small {
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.company-subsidiary-metrics {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  gap: 8px;
}

.company-subsidiary-metrics article {
  display: grid;
  gap: 2px;
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.company-subsidiary-metrics article span {
  color: rgba(8, 38, 77, 0.50);
  font-size: 10px;
  font-weight: 900;
}

.company-subsidiary-metrics article strong {
  color: var(--brand-navy, var(--ink));
  font-size: 16px;
  font-weight: 950;
}

.company-subsidiary-list {
  display: grid;
  gap: 7px;
}

.company-subsidiary-list.compact {
  margin-top: 8px;
}

.company-subsidiary-list.historical {
  padding-top: 2px;
}

.company-subsidiary-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-left: 4px solid rgba(47, 111, 159, 0.34);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(8, 38, 77, 0.04);
}

.company-subsidiary-row.current {
  border-left-color: rgba(24, 113, 173, 0.58);
}

.company-subsidiary-row.historical {
  border-left-color: rgba(124, 145, 163, 0.44);
  border-style: dashed;
  background: rgba(248, 251, 253, 0.78);
}

.company-subsidiary-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(47, 111, 159, 0.15);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 20%, rgba(79, 161, 205, 0.20), transparent 52%),
    rgba(255, 255, 255, 0.92);
  color: rgba(8, 38, 77, 0.64);
  font-size: 10px;
  font-weight: 950;
}

.company-subsidiary-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.company-subsidiary-main span {
  color: rgba(8, 38, 77, 0.50);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-subsidiary-main strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy, var(--ink));
  font-size: 13.5px;
  font-weight: 950;
  line-height: 1.2;
}

.company-subsidiary-main small {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(8, 38, 77, 0.60);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

.company-subsidiary-main .company-subsidiary-ownership {
  color: #165f96;
  font-size: 12px;
  font-weight: 850;
}

.company-subsidiary-actions {
  display: flex;
  justify-content: flex-end;
  min-width: max-content;
}

.company-subsidiary-more,
.company-subsidiary-history {
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
  overflow: hidden;
}

.company-subsidiary-more summary,
.company-subsidiary-history summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 12px;
  color: var(--brand-navy, var(--ink));
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

.company-subsidiary-more summary::-webkit-details-marker,
.company-subsidiary-history summary::-webkit-details-marker {
  display: none;
}

.company-subsidiary-more summary::after,
.company-subsidiary-history summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--focus);
  font-size: 14px;
  font-weight: 950;
}

.company-subsidiary-more[open] summary::after,
.company-subsidiary-history[open] summary::after {
  content: "-";
}

.company-subsidiary-more summary:hover,
.company-subsidiary-more summary:focus-visible,
.company-subsidiary-history summary:hover,
.company-subsidiary-history summary:focus-visible {
  background: rgba(47, 111, 159, 0.06);
  outline: none;
}

.company-subsidiary-more .company-subsidiary-list,
.company-subsidiary-history .company-subsidiary-list {
  padding: 0 10px 10px;
}

.company-subsidiary-more:not([open]) > .company-subsidiary-list,
.company-subsidiary-history:not([open]) > .company-subsidiary-list {
  display: none;
}

.company-subsidiary-note {
  padding: 9px 10px;
  border: 1px dashed rgba(47, 111, 159, 0.16);
  border-radius: 11px;
  background: rgba(248, 251, 253, 0.82);
  color: rgba(8, 38, 77, 0.60);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.35;
}

.company-corporate-tree {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 48% 50%, rgba(79, 161, 205, 0.12), transparent 31%),
    radial-gradient(circle at 84% 8%, rgba(47, 111, 159, 0.08), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(244, 250, 253, 0.92));
  box-shadow:
    0 20px 46px rgba(8, 38, 77, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.company-tree-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
}

.company-corporate-tree > summary.company-tree-header {
  cursor: pointer;
  list-style: none;
}

.company-corporate-tree > summary.company-tree-header::-webkit-details-marker {
  display: none;
}

.company-corporate-tree > summary.company-tree-header::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid rgba(47, 111, 159, 0.20);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #2f6f9f;
  font-size: 14px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(8, 38, 77, 0.07);
}

.company-corporate-tree[open] > summary.company-tree-header::after {
  content: "-";
}

.company-corporate-tree:not([open]) {
  padding: 14px 16px;
}

.company-corporate-tree:not([open]) > .company-tree-flow {
  display: none;
}

.company-tree-header > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-tree-header span {
  color: rgba(8, 38, 77, 0.54);
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.company-tree-header strong {
  min-width: 0;
  color: var(--brand-navy, var(--ink));
  font-size: 15.5px;
  font-weight: 950;
  line-height: 1.18;
}

.company-tree-header small {
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.company-tree-legend {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 410px;
}

.company-tree-legend span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(47, 111, 159, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  color: rgba(8, 38, 77, 0.62);
  font-size: 11px;
  font-weight: 900;
  text-transform: none;
}

.company-tree-flow {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.90fr) minmax(280px, 0.96fr) minmax(260px, 1.18fr);
  gap: 16px;
  align-items: start;
}

.company-tree-track {
  position: absolute;
  z-index: 0;
  top: 114px;
  left: 19%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(47, 111, 159, 0.34), rgba(47, 111, 159, 0.34), transparent);
}

.company-tree-track::before,
.company-tree-track::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(47, 111, 159, 0.26);
  border-radius: 999px;
  background: #fff;
}

.company-tree-track::before {
  left: 31%;
}

.company-tree-track::after {
  right: 31%;
}

.company-tree-tier,
.company-tree-anchor {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.company-tree-anchor {
  align-content: start;
  padding-top: 36px;
}

.company-tree-tier-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: baseline;
  min-height: 38px;
  padding: 0 2px;
}

.company-tree-tier-head span {
  grid-column: 1 / -1;
  color: rgba(8, 38, 77, 0.55);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-tree-tier-head strong {
  min-width: 0;
  color: var(--brand-navy, var(--ink));
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
}

.company-tree-tier-head small {
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.company-tree-node-list {
  display: grid;
  gap: 8px;
}

.company-tree-node,
.company-tree-empty {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(47, 111, 159, 0.13);
  border-left: 4px solid rgba(47, 111, 159, 0.32);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 9px 20px rgba(8, 38, 77, 0.045);
}

.company-corporate-tree.premium-tree .company-tree-node,
.company-corporate-tree.premium-tree .company-tree-empty {
  padding: 9px 10px;
}

.company-corporate-tree.premium-tree .company-tree-node strong {
  font-size: 13.5px;
}

.company-corporate-tree.premium-tree .company-tree-node small,
.company-corporate-tree.premium-tree .company-tree-empty span {
  font-size: 11.5px;
}

.company-tree-tier.upstream .company-tree-node {
  border-left-color: rgba(16, 82, 135, 0.42);
}

.company-tree-tier.downstream .company-tree-node {
  border-left-color: rgba(79, 161, 205, 0.55);
}

.company-tree-node.person {
  border-left-color: rgba(120, 96, 140, 0.36);
}

.company-tree-node.exited {
  opacity: 0.72;
  border-style: dashed;
  background: rgba(255, 250, 240, 0.78);
}

.company-tree-node.compact {
  padding: 9px;
  box-shadow: none;
}

.company-tree-node-kicker {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.company-tree-node-kicker span {
  display: block;
  color: rgba(8, 38, 77, 0.50);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.company-tree-node strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy, var(--ink));
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.company-tree-node small,
.company-tree-empty span {
  min-width: 0;
  color: rgba(8, 38, 77, 0.58);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
}

.company-tree-empty {
  border-style: dashed;
  border-left-color: rgba(47, 111, 159, 0.20);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
}

.company-tree-empty strong {
  color: var(--brand-navy, var(--ink));
  font-size: 13px;
  font-weight: 900;
}

.company-tree-more {
  min-width: 0;
}

.company-tree-more summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--brand-navy, var(--ink));
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.company-tree-more summary::-webkit-details-marker {
  display: none;
}

.company-tree-more summary:hover,
.company-tree-more summary:focus-visible {
  border-color: rgba(47, 111, 159, 0.28);
  background: #fff;
  outline: none;
  box-shadow: 0 10px 22px rgba(8, 38, 77, 0.06);
}

.company-tree-more-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.company-tree-more:not([open]) .company-tree-more-grid {
  display: none;
}

.company-tree-more[open] .company-tree-more-grid {
  display: grid;
}

.company-tree-company-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(47, 111, 159, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.18), transparent 38%),
    linear-gradient(180deg, #fff, rgba(250, 253, 255, 0.98));
  box-shadow:
    0 18px 34px rgba(8, 38, 77, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.company-tree-company-card span,
.company-tree-admin-strip > span {
  color: rgba(8, 38, 77, 0.56);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-tree-company-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy, var(--ink));
  font-size: 20px;
  font-weight: 950;
  line-height: 1.14;
}

.company-tree-company-card small {
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.company-tree-company-card em {
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(47, 111, 159, 0.20);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: var(--brand-navy, var(--ink));
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1.2;
}

.company-corporate-tree.watch .company-tree-company-card em {
  border-color: rgba(186, 76, 54, 0.34);
  background: rgba(186, 76, 54, 0.11);
  color: var(--brick);
}

.company-corporate-tree.red .company-tree-company-card em {
  border-color: rgba(142, 49, 32, 0.34);
  background: rgba(142, 49, 32, 0.11);
  color: var(--brick);
}

.company-corporate-tree.amber .company-tree-company-card em {
  border-color: rgba(168, 110, 18, 0.26);
  background: rgba(255, 248, 234, 0.92);
  color: #754c08;
}

.company-corporate-tree.slate .company-tree-company-card em {
  border-color: rgba(89, 105, 118, 0.22);
  background: rgba(240, 245, 248, 0.88);
  color: #42505d;
}

.company-tree-signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-tree-signal-row span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(8, 38, 77, 0.63);
  font-size: 11px;
  font-weight: 850;
}

.company-tree-signal-row .current-only {
  border-color: rgba(47, 111, 159, 0.20);
  background: linear-gradient(135deg, rgba(235, 247, 253, 0.96), rgba(255, 255, 255, 0.82));
  color: var(--brand-navy, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.company-tree-admin-strip {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.company-tree-admin-strip div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-tree-admin-strip em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(8, 38, 77, 0.66);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.company-large-structure-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.16), transparent 36%),
    radial-gradient(circle at 92% 70%, rgba(47, 111, 159, 0.09), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 253, 0.92));
  box-shadow:
    0 18px 44px rgba(8, 38, 77, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.company-large-structure-brief.premium-relation-intel {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 13px;
}

.premium-relation-intel-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.company-large-structure-brief > div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-large-structure-brief span {
  color: rgba(8, 38, 77, 0.56);
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.company-large-structure-brief strong {
  min-width: 0;
  color: var(--brand-navy, var(--ink));
  font-size: 16px;
  font-weight: 950;
  line-height: 1.22;
}

.company-large-structure-brief small {
  color: rgba(8, 38, 77, 0.60);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

.company-large-structure-metrics,
.company-large-structure-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.company-large-structure-metrics article {
  min-width: 78px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.company-large-structure-actions .company-inline-action {
  min-height: 32px;
}

.premium-relation-intel-grid,
.company-relation-intel-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.premium-relation-intel-card,
.company-relation-intel-row button {
  min-width: 0;
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 9px 11px;
  border: 1px solid rgba(47, 111, 159, 0.13);
  border-radius: 13px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.90), rgba(246, 251, 254, 0.78)),
    radial-gradient(circle at 10% 0%, rgba(79, 161, 205, 0.12), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.premium-relation-intel-card {
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.premium-relation-intel-card:hover,
.premium-relation-intel-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 159, 0.30);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(237, 248, 253, 0.92));
  outline: none;
  box-shadow: 0 12px 24px rgba(8, 38, 77, 0.07);
}

.company-relation-intel-row button {
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.company-relation-intel-row button:hover,
.company-relation-intel-row button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 111, 159, 0.28);
  background: #fff;
  outline: none;
  box-shadow: 0 12px 24px rgba(8, 38, 77, 0.07);
}

.company-relation-intel-row button.active {
  border-color: rgba(20, 81, 128, 0.36);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(234, 247, 253, 0.94));
  box-shadow: 0 14px 30px rgba(8, 38, 77, 0.08);
}

.premium-relation-intel-card span,
.company-relation-intel-row button span {
  display: block;
  color: rgba(8, 38, 77, 0.54);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.premium-relation-intel-card strong,
.company-relation-intel-row button strong {
  display: block;
  color: var(--brand-navy, var(--ink));
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
}

.premium-relation-intel-card small,
.company-relation-intel-row button small {
  min-width: 0;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(8, 38, 77, 0.62);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

@media (max-width: 1180px) {
  .company-large-structure-brief,
  .premium-relation-intel-head {
    grid-template-columns: 1fr;
  }

  .company-large-structure-metrics,
  .company-large-structure-actions {
    justify-content: flex-start;
  }

  .premium-relation-intel-grid,
  .company-relation-intel-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .premium-relation-intel-grid,
  .company-relation-intel-row {
    grid-template-columns: 1fr;
  }
}

.company-role-ledger {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-role-ledger:empty {
  display: none;
}

.company-role-ledger-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-role-ledger-head span,
.company-role-ledger-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-role-ledger-head strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.company-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.company-role-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.company-role-card.owner {
  border-left: 4px solid var(--green);
}

.company-role-card.management,
.company-role-card.board {
  border-left: 4px solid var(--focus);
}

.company-role-card.auditor,
.company-role-card.administration {
  border-left: 4px solid var(--plum);
}

.company-role-card.insolvency {
  border-left: 4px solid var(--amber);
}

.company-role-card.founder {
  border-left: 4px solid var(--amber);
}

.company-role-row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(185, 200, 197, 0.7);
  border-radius: 8px;
  background: var(--surface);
}

.company-role-row strong,
.company-role-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-role-row span,
.company-role-more {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.company-role-more {
  font-weight: 800;
}

.ownership-row {
  display: grid;
  gap: 8px;
}

.ownership-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eceb;
}

.ownership-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--focus));
}

.company-graph-shell {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.company-graph-shell-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.company-graph-shell-head span,
.company-graph-shell-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-graph-shell-head strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.company-graph-mode {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-graph-mode button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.company-graph-mode button.active {
  background: var(--ink);
  color: #fff;
}

.company-graph {
  min-height: 330px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfc, #f7faf9);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.company-graph--cytoscape {
  min-height: 560px;
  background:
    radial-gradient(circle at 32% 18%, rgba(47, 111, 159, 0.10), transparent 34%),
    radial-gradient(circle at 76% 72%, rgba(127, 183, 214, 0.12), transparent 36%),
    linear-gradient(180deg, #ffffff, #f7fbfd);
}

.company-cytoscape-frame {
  display: grid;
  gap: 10px;
  height: 100%;
  min-height: 560px;
  padding: 10px;
}

.company-cytoscape-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.05);
}

.company-cytoscape-toolbar span,
.company-cytoscape-inspector span {
  display: block;
  color: rgba(8, 38, 77, 0.56);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.company-cytoscape-toolbar strong {
  display: block;
  margin-top: 2px;
  color: var(--brand-navy, var(--ink));
  font-size: 13px;
  font-weight: 900;
}

.company-cytoscape-toolbar > div:last-child {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.company-graph-layerbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  padding: 4px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.58);
}

.company-graph-layer {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 6px 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(8, 38, 77, 0.66);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  transition:
    background-color 160ms var(--ease-premium),
    border-color 160ms var(--ease-premium),
    box-shadow 160ms var(--ease-premium),
    color 160ms var(--ease-premium);
}

.company-graph-layer span {
  display: inline-block;
}

.company-graph-layer em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: rgba(8, 38, 77, 0.56);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
}

.company-graph-layer:hover,
.company-graph-layer:focus-visible {
  border-color: rgba(47, 111, 159, 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-navy, var(--ink));
  outline: none;
}

.company-graph-layer.active,
.company-graph-layer[aria-pressed="true"] {
  border-color: rgba(47, 111, 159, 0.28);
  background: linear-gradient(180deg, rgba(235, 247, 253, 0.96), rgba(255, 255, 255, 0.90));
  box-shadow: 0 7px 20px rgba(16, 42, 67, 0.08);
  color: #174c76;
}

.company-graph-layer.active em,
.company-graph-layer[aria-pressed="true"] em {
  border-color: rgba(47, 111, 159, 0.24);
  background: #fff;
  color: #174c76;
}

.company-cytoscape-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-height: 420px;
}

.company-cytoscape-body.has-inspector {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
}

.company-cytoscape-canvas {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(rgba(47, 111, 159, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 111, 159, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.92), rgba(239, 247, 252, 0.68));
  background-size: 34px 34px, 34px 34px, auto;
}

.company-cytoscape-canvas:focus-visible {
  border-color: rgba(47, 111, 159, 0.42);
  box-shadow: 0 0 0 4px rgba(47, 111, 159, 0.10);
  outline: none;
}

.company-cytoscape-inspector {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  min-height: 180px;
  padding: 16px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 14px;
  background:
    radial-gradient(circle at 14% 0%, rgba(127, 183, 214, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 32px rgba(16, 42, 67, 0.06);
}

.company-cytoscape-inspector[hidden] {
  display: none !important;
}

.company-cytoscape-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.company-cytoscape-inspector-head button {
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  color: rgba(8, 38, 77, 0.68);
  font: inherit;
  font-size: 11px;
  font-weight: 780;
  cursor: pointer;
}

.company-cytoscape-inspector-head button:hover,
.company-cytoscape-inspector-head button:focus-visible {
  border-color: rgba(47, 111, 159, 0.34);
  background: #fff;
  color: var(--brand-navy, var(--ink));
  outline: none;
}

.company-cytoscape-inspector strong {
  color: var(--brand-navy, var(--ink));
  font-size: 15px;
  line-height: 1.25;
}

.company-cytoscape-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 1px 0 2px;
}

.company-cytoscape-facts span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(237, 247, 252, 0.92), rgba(255, 255, 255, 0.84));
  color: rgba(8, 38, 77, 0.68);
  font-size: 10.5px;
  font-weight: 850;
  white-space: nowrap;
}

.company-cytoscape-inspector small {
  color: rgba(8, 38, 77, 0.58);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.company-cytoscape-direction {
  display: block;
  padding: 7px 9px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 10px;
  background: rgba(247, 252, 255, 0.76);
  color: rgba(8, 38, 77, 0.72) !important;
  font-weight: 800 !important;
}

.company-cytoscape-inspector-actions {
  margin-top: 8px;
}

.company-cytoscape-cluster-note {
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 161, 205, 0.10), transparent 42%),
    rgba(247, 252, 255, 0.78);
  color: rgba(8, 38, 77, 0.68);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.42;
}

.company-cytoscape-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.company-cytoscape-preview span {
  display: block;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(8, 38, 77, 0.76);
  font-size: 11px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-cytoscape-keyhint {
  min-height: 24px;
  padding: 1px 4px 0;
  color: rgba(8, 38, 77, 0.50);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.company-cytoscape-rolechips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.company-cytoscape-rolechips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(237, 247, 252, 0.96), rgba(255, 255, 255, 0.86));
  color: rgba(8, 38, 77, 0.72);
  font-size: 11px;
  font-weight: 850;
  text-transform: none;
  letter-spacing: 0;
}

.company-graph.is-collapsed {
  min-height: 0;
}

.company-graph-detail {
  display: block;
}

.company-graph-detail summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background:
    radial-gradient(circle at 2% 0%, rgba(79, 161, 205, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.78);
}

.company-graph-detail summary::-webkit-details-marker {
  display: none;
}

.company-graph-detail summary span {
  color: var(--brand-navy, var(--ink));
  font-size: 13px;
  font-weight: 900;
}

.company-graph-detail summary strong {
  grid-column: 1;
  color: rgba(8, 38, 77, 0.58);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.company-graph-detail summary em {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  padding: 5px 10px;
  border: 1px solid rgba(47, 111, 159, 0.22);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: var(--focus);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.company-graph-detail[open] summary {
  border-bottom: 1px solid rgba(47, 111, 159, 0.10);
}

.company-graph svg {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  display: block;
}

.company-graph-band {
  fill: rgba(255, 255, 255, 0.62);
  stroke: rgba(185, 200, 197, 0.68);
  stroke-width: 1;
}

.company-graph-band-label {
  fill: var(--muted);
  stroke: none;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-anchor: middle;
  text-transform: uppercase;
}

.company-graph-note {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border: 1px solid #d9c99f;
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: #fffaf0;
  color: #6b4a13;
  font-size: 12px;
  line-height: 1.45;
}

.company-graph-note.neutral {
  border-color: var(--line);
  border-left-color: var(--focus);
  background: #f7fafb;
  color: var(--muted);
}

.company-graph-note.compact {
  width: max-content;
  max-width: calc(100% - 24px);
  margin-top: 8px;
  padding: 6px 9px;
  border-left-width: 1px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(10, 42, 79, 0.70);
  font-size: 11.5px;
  font-weight: 750;
}

.company-graph-note.history-hint,
.company-graph-note.history-active {
  border-color: rgba(47, 111, 159, 0.13);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(8, 38, 77, 0.68);
}

.company-graph-note.history-active {
  border-left-color: rgba(120, 96, 140, 0.46);
}

.company-graph-note button {
  appearance: none;
  margin-left: 6px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--focus);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.company-graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px 0;
}

.company-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.company-graph-legend i {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--focus);
}

.company-graph-legend .legend-owner {
  background: var(--plum);
}

.company-graph-legend .legend-company {
  background: var(--green);
}

.company-graph-legend .legend-control {
  background: var(--focus);
}

.company-graph-legend .legend-exited {
  background: #a8a29a;
  background-image: repeating-linear-gradient(90deg, #a8a29a 0 5px, transparent 5px 9px);
}

.company-edge {
  fill: none;
  stroke: #9fb2ae;
  stroke-width: 1.8;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.company-edge.ownership {
  stroke: var(--green);
  stroke-width: 2.2;
}

.company-edge.management,
.company-edge.board {
  stroke: var(--focus);
}

.company-edge.parent {
  stroke: var(--plum);
  stroke-width: 2.2;
}

.company-edge.subsidiary {
  stroke: var(--green);
  stroke-width: 2.2;
}

.company-edge.auditor {
  stroke: var(--plum);
  stroke-dasharray: 5 5;
}

.company-edge.administration,
.company-edge.founder {
  stroke: var(--amber);
  stroke-dasharray: 5 5;
}

.company-edge.production_unit {
  stroke: var(--amber);
  stroke-dasharray: 2 6;
}

.company-edge.exited {
  stroke: #a8a29a;
  stroke-dasharray: 6 5;
  stroke-width: 1.6;
  opacity: 0.78;
}

.company-edge.role {
  stroke-dasharray: 4 4;
}

.company-edge-label {
  fill: #53605c;
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.company-node rect {
  fill: #fff;
  stroke: var(--line-strong);
  stroke-width: 1.2;
  filter: drop-shadow(0 5px 10px rgba(21, 34, 31, 0.08));
}

.company-node.openable {
  cursor: pointer;
}

.company-node.openable:hover rect,
.company-node.openable:focus-visible rect {
  stroke: var(--focus);
  stroke-width: 2;
  filter: drop-shadow(0 8px 14px rgba(47, 111, 159, 0.18));
}

.company-node.company rect {
  fill: #edf7f3;
  stroke: #9fc8bb;
}

.company-node.owner rect {
  fill: #eef5fa;
  stroke: #bdd5e8;
}

.company-node.management rect,
.company-node.board rect {
  fill: #eef5fa;
  stroke: #9fc3df;
}

.company-node.auditor rect {
  fill: #f4f0f7;
  stroke: #c9bbd4;
}

.company-node.administration rect,
.company-node.founder rect {
  fill: #fff8e8;
  stroke: #e2c487;
}

.company-node.parent rect {
  fill: #f4f0f7;
  stroke: #b9aac8;
}

.company-node.subsidiary rect {
  fill: #edf7f3;
  stroke: #9fc8bb;
}

.company-node.production_unit rect {
  fill: #fff8e8;
  stroke: #e2c487;
}

.company-node.relation rect {
  fill: #f8faf9;
}

.company-node.exited rect {
  fill: #f7f4ef;
  stroke: #b8aea3;
  stroke-dasharray: 5 4;
  filter: none;
}

.company-node.exited text {
  fill: #6d6259;
}

.company-node text {
  fill: var(--ink);
  stroke: none;
  text-anchor: middle;
}

.company-node .node-title {
  font-size: 11.5px;
  font-weight: 850;
}

.company-node .node-meta {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.company-check {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--focus);
}

.company-check-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.company-check-top small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.company-check em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.company-check.green {
  border-left-color: var(--green);
}

.company-check.yellow {
  border-left-color: var(--amber);
}

.company-check.blue {
  border-left-color: var(--focus);
}

.company-check.red {
  border-left-color: var(--brick);
  background: #fff7f5;
}

.company-relation-workbench {
  margin-bottom: 12px;
}

.company-relation-workspace {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.company-relation-filter-hidden {
  display: none !important;
}

.company-relation-heading {
  margin-top: 2px;
  color: #315c79;
}

.company-control-advanced {
  margin-bottom: 10px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
}

.company-control-advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
}

.company-control-advanced summary::-webkit-details-marker {
  display: none;
}

.company-control-advanced summary span {
  color: var(--brand-navy, var(--ink));
  font-size: 12px;
  font-weight: 900;
}

.company-control-advanced summary small {
  color: rgba(8, 38, 77, 0.54);
  font-size: 11px;
  font-weight: 750;
}

.company-control-advanced:not([open]) .company-filter-row {
  display: none;
}

.company-control-advanced[open] .company-filter-row {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0 0 12px 12px;
  background: rgba(255, 255, 255, 0.76);
}

.company-relation-workbench-shell {
  display: grid;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(43, 128, 181, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 0%, rgba(105, 181, 224, 0.13), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(243, 250, 254, 0.88));
  box-shadow: 0 16px 36px rgba(20, 76, 114, 0.07);
}

.company-control-room {
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 253, 0.92)),
    radial-gradient(circle at 6% 0%, rgba(47, 111, 159, 0.12), transparent 28%),
    radial-gradient(circle at 100% 100%, rgba(23, 107, 91, 0.08), transparent 34%);
}

.company-control-room-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.company-control-room-head span,
.company-control-metrics span,
.company-relation-control-rail button span {
  display: block;
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-control-room-head strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 18px;
  font-weight: 950;
}

.company-control-room-head small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.company-control-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 520px;
}

.company-control-metrics article {
  min-width: 74px;
  padding: 7px 9px;
  border: 1px solid rgba(47, 111, 159, 0.10);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.76);
}

.company-control-metrics strong {
  display: block;
  margin-top: 2px;
  color: var(--brand-navy, var(--ink));
  font-size: 16px;
  font-weight: 950;
}

.company-relation-control-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(47, 111, 159, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
}

.company-relation-control-rail button {
  min-width: 0;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.company-relation-control-rail button:hover {
  transform: translateY(-0.5px);
  border-color: rgba(47, 111, 159, 0.24);
  background: rgba(255, 255, 255, 0.92);
}

.company-relation-control-rail button.active {
  border-color: rgba(20, 81, 128, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 252, 0.94));
  box-shadow: 0 10px 20px rgba(16, 42, 67, 0.08);
}

.company-relation-control-rail button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  margin-top: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.10);
  color: var(--brand-navy, var(--ink));
  font-size: 12px;
  font-weight: 950;
}

.company-relation-control-rail button span {
  font-size: 11px;
  font-weight: 780;
  text-transform: none;
}

.company-relation-control-rail button small {
  display: none;
}

.company-relation-workbench-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.company-relation-workbench-head span,
.company-relation-view-grid button span,
.company-relation-workbench-stats span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-relation-workbench-head strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 16px;
  font-weight: 900;
}

.company-relation-workbench-head small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.56);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.company-relation-workbench-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 7px;
  min-width: 250px;
}

.company-relation-workbench-stats article {
  padding: 8px 10px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.company-relation-workbench-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 18px;
  font-weight: 900;
}

.company-relation-view-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.company-relation-view-grid button {
  min-width: 0;
  min-height: 86px;
  padding: 10px 11px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.company-relation-view-grid button.active {
  border-color: rgba(8, 38, 77, 0.22);
  background: #fff;
  box-shadow: 0 13px 28px rgba(16, 42, 67, 0.08);
}

.company-relation-view-grid button strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-navy, var(--ink));
  font-size: 19px;
  font-weight: 900;
}

.company-relation-view-grid button small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.56);
  font-size: 11px;
  line-height: 1.32;
}

.company-relation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px 12px;
  border-color: rgba(16, 42, 67, 0.10);
  background: rgba(255, 255, 255, 0.82);
}

.company-relation-item.clustered {
  border-color: rgba(47, 111, 159, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 252, 255, 0.86)),
    radial-gradient(circle at 0% 0%, rgba(47, 111, 159, 0.08), transparent 34%);
  box-shadow: 0 13px 32px rgba(16, 42, 67, 0.055);
}

.company-relation-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.company-relation-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.company-relation-title-row small {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(23, 107, 91, 0.08);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 850;
}

.company-relation-main em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.company-relation-lines {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.company-relation-lines b {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(47, 111, 159, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: rgba(8, 38, 77, 0.76);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.company-relation-main p {
  margin: 3px 0 0;
  color: rgba(8, 38, 77, 0.68);
  font-size: 12px;
  line-height: 1.4;
}

.company-relation-detail {
  margin-top: 2px;
}

.company-relation-detail summary {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: rgba(247, 252, 255, 0.82);
  color: rgba(8, 38, 77, 0.64);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  list-style: none;
}

.company-relation-detail summary::-webkit-details-marker {
  display: none;
}

.company-relation-detail[open] {
  padding-top: 2px;
}

.company-relation-side {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-items: end;
  justify-content: flex-end;
  align-content: flex-start;
  gap: 6px;
  max-width: 260px;
}

.company-relation-item.exited {
  border-left: 4px solid rgba(168, 110, 18, 0.62);
  background: rgba(255, 250, 240, 0.74);
}

.company-relation-item.exited .company-relation-title-row small {
  background: rgba(168, 110, 18, 0.10);
  color: #6b4a13;
}

.company-relation-dedupe {
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(47, 111, 159, 0.07);
  color: rgba(8, 38, 77, 0.72) !important;
  font-size: 11px !important;
  font-weight: 800;
}

.company-relation-item small {
  color: var(--muted);
  white-space: nowrap;
}

.company-exit-summary {
  display: block;
  margin-bottom: 10px;
}

.company-exit-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid rgba(168, 110, 18, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 251, 244, 0.86));
}

.company-exit-compact.empty {
  border-color: rgba(47, 111, 159, 0.12);
  background: rgba(255, 255, 255, 0.72);
}

.company-exit-compact span,
.company-control-heading {
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-exit-compact strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 15px;
  font-weight: 950;
}

.company-exit-compact small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.60);
  font-size: 12px;
  font-weight: 700;
}

.company-exit-compact-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.company-exit-compact-metrics article {
  min-width: 72px;
  padding: 7px 9px;
  border: 1px solid rgba(168, 110, 18, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.company-exit-compact-metrics strong {
  font-size: 16px;
}

.company-exit-stat {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.company-exit-stat span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-exit-stat strong {
  font-size: 21px;
}

.company-exit-list {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.company-exit-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 6px;
}

.company-exit-strip.preview {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.company-exit-strip.expanded {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-height: 760px;
  overflow: auto;
  padding-right: 2px;
}

.company-exit-item {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 10px;
  background: #fffdf8;
}

.company-exit-item.person {
  border-left-color: var(--focus);
}

.company-exit-item.company {
  border-left-color: var(--plum);
}

.company-exit-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.company-exit-top strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.company-exit-top time {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(168, 110, 18, 0.26);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.92);
  color: #6b4a13;
  font-size: 11px;
  font-weight: 850;
}

.company-exit-type {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-exit-meta,
.company-exit-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-exit-strip.preview .company-exit-periods {
  display: none;
}

.company-exit-more {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(168, 110, 18, 0.14);
  border-radius: 999px;
  background: rgba(255, 251, 244, 0.82);
  color: #6b4a13;
  font-size: 11px;
  font-weight: 850;
}

.company-exit-meta span,
.company-exit-periods span {
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.company-exit-periods {
  padding-top: 2px;
}

.company-timeline {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.company-change-overview {
  display: grid;
  gap: 12px;
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 159, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(79, 161, 205, 0.12), transparent 34%),
    radial-gradient(circle at 82% 12%, rgba(23, 107, 91, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.92));
  box-shadow: 0 18px 44px rgba(8, 38, 77, 0.07);
}

.company-change-overview.watch {
  border-color: rgba(186, 76, 54, 0.18);
  background:
    radial-gradient(circle at 9% 0%, rgba(186, 76, 54, 0.09), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(249, 252, 254, 0.93));
}

.company-change-overview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.company-change-overview-head span,
.company-change-card span {
  display: block;
  color: rgba(8, 38, 77, 0.58);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-change-overview-head strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 18px;
  font-weight: 950;
  line-height: 1.22;
}

.company-change-overview-head small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.56);
  font-size: 12px;
  font-weight: 650;
}

.company-change-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.company-change-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.company-change-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid rgba(16, 42, 67, 0.09);
  border-left: 3px solid rgba(47, 111, 159, 0.48);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 10px 24px rgba(8, 38, 77, 0.045);
}

.company-change-card.current {
  border-left-color: var(--brand-green, var(--green));
}

.company-change-card.history {
  border-left-color: #78608c;
}

.company-change-overview.watch .company-change-card.latest {
  border-left-color: var(--brick);
}

.company-change-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy, var(--ink));
  font-size: 14px;
  font-weight: 900;
  line-height: 1.24;
}

.company-change-card small {
  min-width: 0;
  color: rgba(8, 38, 77, 0.58);
  font-size: 12px;
  line-height: 1.38;
}

.company-change-river {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.company-change-mini-event {
  min-width: 0;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-left: 3px solid var(--relation-accent, var(--focus));
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.70);
}

.company-change-mini-event.grouped {
  grid-template-columns: 92px minmax(0, 1fr);
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.76);
}

.company-change-mini-event.entry {
  border-left-color: rgba(47, 111, 159, 0.62);
}

.company-change-mini-event.exit {
  border-left-color: #8e6f53;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(250, 248, 244, 0.82));
}

.company-change-mini-event.status {
  border-left-color: var(--brick);
}

.company-change-mini-event time {
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 900;
}

.company-change-mini-event strong,
.company-change-mini-event span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-change-mini-event strong {
  color: var(--brand-navy, var(--ink));
  font-size: 12.5px;
  font-weight: 900;
  line-height: 1.25;
}

.company-change-mini-event span {
  margin-top: 2px;
  color: rgba(8, 38, 77, 0.56);
  font-size: 11.2px;
  line-height: 1.32;
}

.company-role-change-panel {
  display: grid;
  gap: 0;
  padding: 14px;
  border: 1px solid var(--premium-border, var(--line));
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 249, 0.96)),
    radial-gradient(circle at 12% 10%, rgba(23, 107, 91, 0.08), transparent 30%);
  box-shadow: 0 18px 44px rgba(16, 42, 67, 0.06);
}

.company-role-change-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  cursor: pointer;
  list-style: none;
}

.company-role-change-head::-webkit-details-marker {
  display: none;
}

.company-role-change-head em {
  align-self: center;
  padding: 5px 10px;
  border: 1px solid rgba(47, 111, 159, 0.18);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: var(--focus);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.company-role-change-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.company-role-change-head span,
.company-raw-timeline-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-role-change-head strong,
.company-raw-timeline-head strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy, var(--ink));
  font-size: 16px;
  font-weight: 900;
}

.company-role-change-head small {
  display: block;
  margin-top: 4px;
  color: rgba(8, 38, 77, 0.55);
  font-size: 12px;
  font-weight: 650;
}

.company-role-change-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.company-role-change-pills button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid rgba(16, 42, 67, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.company-role-change-pills button.active {
  border-color: rgba(8, 38, 77, 0.22);
  background: var(--brand-navy, var(--ink));
  color: #fff;
  box-shadow: 0 10px 22px rgba(8, 38, 77, 0.14);
}

.company-role-change-pills button strong {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(8, 38, 77, 0.08);
  color: inherit;
  font-size: 11px;
}

.company-role-change-pills button.active strong {
  background: rgba(255, 255, 255, 0.18);
}

.company-role-change-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.company-role-change-grid article {
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.company-role-change-grid span {
  display: block;
  color: rgba(8, 38, 77, 0.58);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-role-change-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--brand-navy, var(--ink));
  font-size: 21px;
  font-weight: 900;
}

.company-role-change-list {
  display: grid;
  gap: 7px;
  max-height: 620px;
  overflow: auto;
  padding-right: 2px;
}

.company-role-change-more {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(47, 111, 159, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(8, 38, 77, 0.62);
  font-size: 11px;
  font-weight: 850;
}

.company-role-change-event {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  border-left: 4px solid var(--relation-accent, var(--brand-green, var(--green)));
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.80);
}

.company-role-change-event.exit {
  border-left-color: #8e6f53;
  background: rgba(250, 248, 244, 0.88);
}

.company-role-change-event.status {
  border-left-color: var(--amber);
  background: rgba(255, 250, 240, 0.88);
}

.company-role-change-event time {
  color: rgba(8, 38, 77, 0.62);
  font-size: 12px;
  font-weight: 850;
}

.company-role-change-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.company-role-change-main strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.company-role-change-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.company-role-change-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.company-role-change-side small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(16, 42, 67, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.company-legal-timeline {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(43, 128, 181, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 0%, rgba(102, 178, 221, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(242, 250, 254, 0.78));
  box-shadow: 0 22px 54px rgba(18, 73, 112, 0.10);
  overflow: hidden;
}

.company-legal-timeline::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(32, 111, 164, 0.88), rgba(119, 187, 224, 0.18));
}

.company-legal-timeline.watch {
  border-color: rgba(154, 86, 34, 0.28);
  background:
    radial-gradient(circle at 14% 0%, rgba(242, 180, 92, 0.17), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 252, 0.78));
}

.company-legal-timeline.empty {
  min-height: 132px;
}

.company-legal-timeline-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.company-legal-timeline-head span,
.company-legal-timeline-range span,
.company-legal-event-title span {
  color: #2d668d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.company-legal-timeline-head strong {
  display: block;
  margin-top: 4px;
  color: #102f4a;
  font-size: 18px;
  line-height: 1.2;
}

.company-legal-timeline-head small {
  display: block;
  margin-top: 5px;
  color: #547087;
  font-size: 12px;
  line-height: 1.45;
}

.company-legal-timeline-range {
  min-width: 158px;
  padding: 10px 12px;
  border: 1px solid rgba(43, 128, 181, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.company-legal-timeline-range strong,
.company-legal-timeline-range em {
  display: block;
  color: #173650;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.company-legal-timeline-range em {
  color: #63798a;
  font-weight: 750;
}

.company-legal-timeline-tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.company-legal-timeline-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(43, 128, 181, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: #315c79;
  font-size: 11px;
  font-weight: 850;
}

.company-legal-timeline-tags strong {
  color: #0e527c;
  font-size: 12px;
}

.company-legal-timeline-tags .insolvency strong,
.company-legal-timeline-tags .status strong {
  color: #8f4b16;
}

.company-timeline-priority-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(43, 128, 181, 0.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% 0%, rgba(102, 178, 221, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(246, 251, 254, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.company-timeline-priority-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.company-timeline-priority-head span,
.company-timeline-priority-card span {
  color: #2d668d;
  font-size: 10.5px;
  font-weight: 950;
  text-transform: uppercase;
}

.company-timeline-priority-head strong {
  color: #102f4a;
  font-size: 13px;
  font-weight: 950;
}

.company-timeline-priority-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.company-timeline-priority-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  min-height: 104px;
  padding: 11px 12px;
  border: 1px solid rgba(43, 128, 181, 0.12);
  border-left: 4px solid rgba(47, 127, 177, 0.62);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(20, 76, 114, 0.06);
}

.company-timeline-priority-card.insolvency,
.company-timeline-priority-card.status {
  border-left-color: rgba(181, 109, 37, 0.78);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(255, 249, 240, 0.78));
}

.company-timeline-priority-card.ownership,
.company-timeline-priority-card.group {
  border-left-color: rgba(31, 124, 146, 0.72);
}

.company-timeline-priority-card.governance {
  border-left-color: rgba(37, 95, 156, 0.74);
}

.company-timeline-priority-card strong {
  color: #102f4a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.company-timeline-priority-card small {
  display: -webkit-box;
  overflow: hidden;
  color: #5f7486;
  font-size: 11.5px;
  font-weight: 720;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.company-legal-timeline-stream {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.company-legal-year {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
}

.company-legal-year-label {
  position: sticky;
  top: 12px;
  align-self: start;
  padding-top: 6px;
  color: #164463;
  font-size: 13px;
  font-weight: 950;
}

.company-legal-year-events {
  position: relative;
  display: grid;
  gap: 9px;
}

.company-legal-year-events::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(58, 135, 184, 0.42), rgba(58, 135, 184, 0.06));
}

.company-legal-event {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px 12px 12px 28px;
  border: 1px solid rgba(43, 128, 181, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.80);
  box-shadow: 0 12px 26px rgba(20, 76, 114, 0.07);
}

.company-legal-event-marker {
  position: absolute;
  top: 18px;
  left: 2px;
  width: 14px;
  height: 14px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: #2f7fb1;
  box-shadow: 0 0 0 1px rgba(47, 127, 177, 0.36);
}

.company-legal-event.insolvency .company-legal-event-marker,
.company-legal-event.status .company-legal-event-marker {
  background: #b56d25;
  box-shadow: 0 0 0 1px rgba(181, 109, 37, 0.34);
}

.company-legal-event.ownership .company-legal-event-marker,
.company-legal-event.group .company-legal-event-marker {
  background: #1f7c92;
}

.company-legal-event.governance .company-legal-event-marker {
  background: #255f9c;
}

.company-legal-event.assurance .company-legal-event-marker {
  background: #4b6f83;
}

.company-legal-event.report .company-legal-event-marker {
  background: #326c64;
}

.company-legal-event.clustered {
  border-color: rgba(43, 128, 181, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(241, 249, 253, 0.84));
}

.company-legal-event.clustered .company-legal-event-marker {
  width: 18px;
  height: 18px;
  border-width: 4px;
}

.company-legal-event time {
  color: #547087;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.company-legal-event-main {
  min-width: 0;
}

.company-legal-event-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.company-legal-event-title strong {
  color: #102f4a;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.company-legal-event-main p,
.company-legal-event-main small {
  display: block;
  margin: 5px 0 0;
  color: #5f7486;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.company-legal-event-main small {
  color: #6f8798;
  font-weight: 800;
}

.company-raw-timeline {
  display: grid;
  gap: 0;
  border: 1px solid var(--premium-border, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.company-raw-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
}

.company-raw-timeline-head::-webkit-details-marker {
  display: none;
}

.company-raw-timeline-list {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--premium-border, var(--line));
  background: rgba(247, 250, 249, 0.54);
}

.company-raw-timeline:not([open]) .company-raw-timeline-list {
  display: none;
}

.company-timeline-digest {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.company-timeline-digest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.company-timeline-digest-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-timeline-digest-head strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.company-timeline-digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.company-timeline-signal {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 8px;
  background: var(--surface);
}

.company-timeline-signal.insolvency {
  border-left-color: var(--amber);
}

.company-timeline-signal span,
.company-timeline-signal small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.company-timeline-signal span {
  margin-bottom: 3px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-timeline-signal strong {
  display: block;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.company-timeline-item,
.company-evidence-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.company-timeline-item.ownership,
.company-timeline-item.ownership_exit {
  border-left: 4px solid var(--green);
}

.company-timeline-item.insolvency,
.company-timeline-item.insolvency_exit {
  border-left: 4px solid var(--amber);
}

.company-timeline-item time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-timeline-item strong,
.company-evidence-item strong {
  display: block;
  margin-bottom: 3px;
}

.company-timeline-item span,
.company-evidence-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.company-evidence-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.company-evidence-disclosure {
  border: 1px solid var(--premium-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.company-evidence-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 11px 13px;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.company-evidence-disclosure summary::-webkit-details-marker {
  display: none;
}

.company-evidence-disclosure summary strong {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.company-evidence-disclosure-body {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--premium-border);
  background: rgba(247, 250, 249, 0.58);
}

.company-evidence-item a,
.company-evidence-item small {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.company-evidence-item.compliance {
  border-left: 4px solid var(--amber);
  background: #fffaf0;
}

.company-report-preview {
  min-height: 520px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: #27302d;
  white-space: pre-wrap;
  overflow: auto;
  font-family: Consolas, "Segoe UI Mono", monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.deadline-timeline,
.deadline-warning-list {
  display: grid;
  gap: 8px;
}

.deadline-event {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.deadline-event-dot {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--focus);
}

.deadline-event.done .deadline-event-dot {
  background: var(--green);
}

.deadline-event.due .deadline-event-dot {
  background: var(--amber);
}

.deadline-event.missed .deadline-event-dot {
  background: var(--brick);
}

.deadline-event span,
.deadline-event small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.deadline-warning {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: var(--surface);
}

.deadline-warning.green {
  border-left-color: var(--green);
}

.deadline-warning.yellow {
  border-left-color: var(--amber);
}

.deadline-warning.blue {
  border-left-color: var(--focus);
}

.deadline-warning.red {
  border-left-color: var(--brick);
}

.deadline-warning span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.print-notes-summary {
  padding: 0 0 18px;
}

.print-notes-summary h2 {
  margin: 0 0 10px;
  color: black;
  font-size: 15pt;
}

.print-note-item {
  break-inside: avoid;
  margin: 0 0 10px;
  padding: 9px 10px;
  border-left: 4px solid var(--note-color, var(--focus));
  background: #f7f7f4;
}

.print-note-item strong {
  display: block;
  color: #111;
  font-size: 10pt;
}

.print-note-item blockquote {
  margin: 6px 0;
  color: #222;
  font-size: 9.5pt;
  line-height: 1.45;
}

.print-note-item p {
  margin: 6px 0 0;
  color: #333;
  font-size: 9pt;
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .filters-pane,
  .results-pane,
  .side-workbench,
  .reader-collapsed,
  .doc-actions,
  .print-panel,
  .reader-settings-panel,
  .selection-toolbar {
    display: none !important;
  }

  .app-shell,
  .reader-pane,
  .reader-content,
  .workspace-split,
  .doc-text-panel {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: white !important;
    box-shadow: none !important;
    border: 0 !important;
  }

  .reader-pane,
  .reader-content {
    padding: 0 !important;
  }

  .doc-header,
  .meta-grid,
  .doc-text-panel {
    padding: 0 0 14px !important;
    border: 0 !important;
  }

  .doc-header h1 {
    color: black;
    font-size: 18pt;
  }

  .doc-kicker,
  .meta-item span,
  .meta-item strong {
    color: #333 !important;
  }

  #docText {
    white-space: pre-wrap;
    color: black;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  .note-mark {
    background: #f4f0c8 !important;
    border-bottom: 1px solid #8a6400 !important;
  }

  html[data-print-mode="with-notes"] .print-notes-summary,
  html[data-print-mode="passages"] .print-notes-summary {
    display: block !important;
  }

  html[data-print-mode="passages"] .source-identity-banner,
  html[data-print-mode="passages"] .doc-outline,
  html[data-print-mode="passages"] #docText {
    display: none !important;
  }
}

@media (max-width: 1260px) {
  .app-shell {
    grid-template-columns: 280px minmax(360px, 1fr);
    grid-template-rows: 74px minmax(0, 46vh) minmax(0, 1fr);
  }

  .app-shell.reader-empty-state {
    grid-template-columns: 280px minmax(360px, 1fr);
    grid-template-rows: 74px minmax(0, 1fr);
  }

  .app-shell.filters-collapsed,
  .app-shell.reader-empty-state.filters-collapsed {
    grid-template-columns: 62px minmax(360px, 1fr);
  }

  .workspace-resizer {
    display: none;
  }

  .filters-pane {
    grid-column: 1;
    grid-row: 2;
  }

  .results-pane {
    grid-column: 2;
    grid-row: 2;
  }

  .reader-pane {
    grid-column: 1 / -1;
    grid-row: 3;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .app-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    overflow: visible;
  }

  .app-shell.reader-empty-state {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .app-shell.filters-collapsed,
  .app-shell.reader-empty-state.filters-collapsed,
  .app-shell.reader-wide.filters-collapsed,
  .app-shell.reader-focus.filters-collapsed,
  .app-shell.reader-minimized.filters-collapsed {
    grid-template-columns: 1fr;
  }

  .topbar,
  .searchbar,
  .workspace-split,
  .meta-grid,
  .legal-compass-card,
  .legal-compass-metrics,
  .profiles-layout,
  .admin-layout,
  .admin-grid,
  .admin-dashboard,
  .admin-dashboard-metrics,
  .admin-quality-head,
  .admin-quality-summary,
  .admin-quality-metrics,
  .admin-quality-queues,
  .admin-audit-controls,
  .profile-grid,
  .profile-workspace,
  .deadlines-layout,
  .deadline-workspace,
  .deadline-quick-workspace,
  .cases-layout,
  .case-workspace,
  .case-room-hero,
  .case-overview-list,
  .case-summary-grid,
  .templates-layout,
  .templates-workspace,
  .template-stats-grid,
  .template-dashboard-toolbar,
  .template-dashboard-metrics,
  .template-workflow-steps,
  .template-classification-grid,
  .template-edit-grid,
  .companies-layout,
  .company-workspace,
  .company-detail-grid,
  .deadline-form-grid,
  .knowledge-grid {
    grid-template-columns: 1fr;
  }

  .issue-insight {
    grid-template-columns: 1fr;
  }

  .case-analysis-head,
  .case-issue-row {
    grid-template-columns: 1fr;
  }

  .profile-workspace[data-profile-mode="notat"],
  .profile-workspace[data-profile-mode="sources"],
  .profile-workspace[data-profile-mode="contributions"],
  .profile-workspace[data-profile-mode="report"],
  .profile-report-summary,
  .annotation-manager-summary {
    grid-template-columns: 1fr;
  }

  .case-analysis-meta {
    justify-content: flex-start;
  }

  .issue-card header {
    display: grid;
  }

  .issue-card header small {
    max-width: none;
    text-align: left;
  }

  .issue-card-actions {
    justify-items: start;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .top-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    width: auto;
  }

  .user-pill {
    max-width: 172px;
  }

  .top-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    overflow: hidden;
  }

  .top-tab {
    min-width: 0;
    min-height: 48px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 3px;
    padding: 7px 4px;
    text-align: center;
  }

  .top-tab svg {
    width: 18px;
    height: 18px;
  }

  .top-tab-copy strong {
    font-size: 11.5px;
  }

  .top-tab-copy small {
    display: none;
  }

  .status-pill {
    display: none;
  }

  .filters-pane,
  .results-pane,
  .reader-pane,
  .profiles-view,
  .profiles-layout,
  .admin-view,
  .admin-layout,
  .deadlines-view,
  .deadlines-layout,
  .cases-view,
  .cases-layout,
  .templates-view,
  .templates-layout,
  .companies-view,
  .companies-layout {
    overflow: visible;
  }

  .cases-sidebar {
    order: 2;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .case-main {
    order: 1;
  }

  .case-room-content,
  .case-room-panels {
    overflow: visible;
  }

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

  .case-room-hero,
  .case-room-panels {
    padding-left: 12px;
    padding-right: 12px;
  }

  .case-link-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .case-link-panel .mini-heading,
  .case-link-panel small {
    grid-column: 1 / -1;
  }

  .case-link-panel small {
    display: none;
  }

  .case-link-panel .field {
    margin: 0;
  }

  .case-room-panel {
    max-width: none;
  }

  .admin-main,
  .admin-grid {
    overflow: visible;
  }

  .filters-pane,
  .results-pane,
  .reader-pane {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .results-pane {
    order: 1;
  }

  .filters-pane {
    order: 2;
  }

  .app-shell.filters-collapsed .filters-pane {
    padding: 10px 12px;
  }

  .app-shell.filters-collapsed .filter-pane-heading {
    justify-content: space-between;
  }

  .app-shell.filters-collapsed .filter-heading-copy > div {
    display: grid;
  }

  .reader-pane {
    order: 3;
  }

  .templates-main {
    grid-column: 1;
    grid-row: 1;
    order: 1;
  }

  .templates-sidebar {
    grid-column: 1;
    grid-row: 2;
    order: 2;
    border-left: 0;
    border-bottom: 1px solid var(--line);
  }

  .templates-layout.templates-sidebar-collapsed .templates-sidebar {
    display: none;
  }

  .templates-main,
  .template-results-panel,
  .template-detail-panel {
    overflow: visible;
  }

  .templates-header {
    flex-wrap: wrap;
  }

  .templates-workspace {
    min-height: 0;
  }

  .templates-view .template-results-panel {
    max-height: 48vh;
    overflow-y: auto;
  }

  .template-search-row,
  .template-search-tools,
  .template-filter-grid {
    grid-template-columns: 1fr;
  }

  .template-search-row .template-actions-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .template-use-strip,
  .template-preview-guidance {
    grid-template-columns: 1fr;
  }

  .template-primary-actions,
  .template-preview-guidance .template-detail-actions {
    justify-content: flex-start;
  }

  .template-document-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .template-document-toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .template-source-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .companies-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .company-main {
    overflow: visible;
  }

  .company-header {
    flex-wrap: wrap;
  }

  .company-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .company-workspace {
    padding: 12px;
    overflow: visible;
  }

  .company-panel {
    padding: 14px;
    border-radius: 10px;
  }

  .company-quality {
    grid-template-columns: 1fr;
  }

  .company-status-panel {
    grid-template-columns: 1fr;
  }

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

  .company-accounts-head,
  .company-accounts-empty {
    align-items: flex-start;
    flex-direction: column;
  }

  .company-group-grid,
  .company-report-item {
    grid-template-columns: 1fr;
  }

  .company-report-actions {
    justify-content: flex-start;
  }

  .company-graph-shell-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .company-graph-summary,
  .company-expanded-network .company-network-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-graph {
    min-height: 280px;
  }

  .reader-content {
    height: auto;
  }

  .app-shell.reader-wide,
  .app-shell.reader-focus,
  .app-shell.reader-minimized {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.reader-minimized .reader-pane {
    width: auto;
    min-width: 0;
  }

  .workspace-split {
    min-height: 0;
  }

  .doc-text-panel {
    max-height: 70vh;
  }

  .doc-text-panel pre,
  .reader-density-comfort .doc-text-panel pre,
  .reader-density-compact .doc-text-panel pre {
    width: 100%;
    padding: 24px 22px 38px;
  }

  .reader-context-strip {
    grid-template-columns: 1fr;
  }

  .research-command {
    gap: 8px;
    padding: 12px;
  }

  .research-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .research-overview-card {
    padding: 7px 9px;
  }

  .research-overview-card span {
    font-size: 10px;
  }

  .research-overview-card strong {
    font-size: 12.5px;
  }

  .results-toolbar,
  .pager {
    padding: 8px 12px;
  }

  .result-list {
    padding: 10px;
  }

  .result-row {
    padding: 13px 14px;
  }

  .reader-context-facts {
    justify-content: flex-start;
  }

  .reader-content.doc-header-collapsed .doc-header {
    grid-template-columns: 1fr;
  }

  .reader-content.doc-header-collapsed .doc-header > div:first-child {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .reader-content.doc-header-collapsed .doc-kicker {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .source-identity-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-identity-facts {
    min-width: 0;
    justify-content: flex-start;
  }

  .side-workbench {
    order: 1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

/* Final safety guard: hidden overlays must never block interaction after responsive/theme overrides. */
#selectionToolbar.hidden,
#commandPalette.hidden,
.reader-find-panel.hidden,
.reader-settings-panel.hidden,
.print-panel.hidden {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 480px) {
  .top-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .top-tab {
    flex: 0 0 132px;
    grid-template-columns: 24px minmax(0, 1fr);
    justify-items: start;
    text-align: left;
    scroll-snap-align: start;
  }
}

/* Premium cohesion layer: keeps existing functionality, but removes visual noise. */
:root {
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --ease-premium: cubic-bezier(0.2, 0.8, 0.2, 1);
  --brand-navy: #08264d;
  --brand-green: #176b5b;
  --premium-border: rgba(16, 42, 67, 0.12);
  --premium-shadow: 0 14px 42px rgba(16, 42, 67, 0.08);
}

button,
a,
input,
select,
textarea,
.result-row,
.company-result-item,
.company-panel,
.company-inline-action,
.company-tab,
.top-tab {
  transition:
    background-color 170ms var(--ease-premium),
    border-color 170ms var(--ease-premium),
    box-shadow 170ms var(--ease-premium),
    color 170ms var(--ease-premium),
    opacity 170ms var(--ease-premium),
    transform 170ms var(--ease-premium);
}

.top-tabs {
  gap: 4px;
  padding: 3px;
  border-color: var(--premium-border);
  background: rgba(248, 250, 249, 0.74);
  box-shadow: none;
}

.top-tab {
  min-height: 44px;
  border-radius: var(--radius-md);
  color: #54615d;
}

.top-tab:hover {
  background: rgba(255, 255, 255, 0.74);
  color: var(--brand-navy);
}

.top-tab.active {
  border-color: rgba(8, 38, 77, 0.18);
  background: #fff;
  color: var(--brand-navy);
  box-shadow: 0 7px 20px rgba(16, 42, 67, 0.08);
  transform: none;
}

.top-tab.active::after {
  left: 11px;
  right: 11px;
  bottom: 4px;
  background: linear-gradient(90deg, var(--brand-navy), var(--brand-green));
}

.top-tab.active .top-tab-copy small {
  color: rgba(8, 38, 77, 0.62);
}

.primary-button,
.quiet-button,
.icon-button,
.company-inline-action,
.company-tab,
.company-graph-mode,
.company-graph-mode button {
  border-radius: var(--radius-md);
}

.primary-button {
  border-color: #0f6b5b;
  background: #0f6b5b;
  box-shadow: none;
}

.primary-button:hover,
.quiet-button:hover,
.icon-button:hover,
.company-inline-action:hover,
.company-inline-action:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.11);
}

.quiet-button,
.icon-button,
.company-inline-action {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.78);
}

.chip,
.label-chip,
.muted-chip,
.active-filter-chip,
.query-token-chip,
.favorite-filter-chip,
.source-pill,
.relation-pill,
.deadline-status,
.template-status-pill,
.template-preview-status,
.company-result-status,
.company-lifecycle-pill {
  border-color: var(--premium-border);
  border-radius: 999px;
  box-shadow: none;
}

.active-filter-bar {
  background: transparent;
}

.active-filter-chip,
.query-token-chip,
.favorite-filter-chip {
  background: rgba(255, 255, 255, 0.72);
}

.admin-quality,
.admin-dashboard,
.admin-operations,
.admin-panel {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: none;
}

.admin-quality-summary {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.82);
}

.admin-quality-details:not([open]) .admin-quality-summary {
  opacity: 0.78;
}

.admin-quality-head,
.admin-quality-metric,
.admin-quality-item,
.admin-health-card,
.admin-warning {
  border-color: var(--premium-border);
  background: #fff;
  box-shadow: none;
}

.companies-layout,
.company-main {
  background:
    linear-gradient(180deg, rgba(8, 38, 77, 0.035), rgba(247, 249, 251, 0) 260px),
    var(--surface-tint);
}

.companies-sidebar {
  border-right: 1px solid var(--premium-border);
  background: rgba(248, 250, 249, 0.88);
}

.company-support-box,
.company-source-box {
  padding: 10px 11px;
  border: 1px solid var(--premium-border);
  border-left: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.company-support-box strong,
.company-source-box strong {
  color: var(--brand-navy);
  font-size: 12px;
}

.company-support-box span,
.company-source-box span,
.company-source-box small {
  color: var(--muted);
  font-size: 12px;
}

.company-header {
  border-bottom-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.92);
}

.company-header h1 {
  color: var(--brand-navy);
  font-size: 28px;
  line-height: 1.08;
}

.company-tabs {
  margin: 0;
  padding: 8px 18px;
  border-top: 0;
  border-bottom-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: none;
}

.company-tab {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: #65716d;
}

.company-tab:hover {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.76);
  color: var(--brand-navy);
}

.company-tab.active {
  border-color: var(--brand-navy);
  background: var(--brand-navy);
  color: #fff;
  box-shadow: none;
}

.company-workspace {
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(8, 38, 77, 0.026), rgba(247, 249, 251, 0) 260px),
    var(--surface-tint);
}

.company-panel {
  border-color: var(--premium-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: none;
}

.company-overview-panel {
  background: #fff;
}

.company-lawyer-summary {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(15, 76, 129, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(232, 246, 255, 0.64)),
    #fff;
  box-shadow: 0 18px 44px rgba(8, 38, 77, 0.08);
}

.company-lawyer-summary.red {
  border-color: rgba(166, 54, 54, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 238, 0.76)),
    #fff;
}

.company-lawyer-summary.yellow {
  border-color: rgba(183, 126, 31, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 226, 0.7)),
    #fff;
}

.company-lawyer-summary.green {
  border-color: rgba(23, 107, 91, 0.16);
}

.company-lawyer-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.42fr);
  gap: 14px;
  align-items: stretch;
}

.company-lawyer-summary-main,
.company-lawyer-next {
  min-width: 0;
}

.company-lawyer-summary-main > span,
.company-lawyer-next > span,
.company-lawyer-card > span {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.company-lawyer-summary-main > strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-navy);
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.08;
}

.company-lawyer-summary-main > p,
.company-lawyer-next > small,
.company-lawyer-card > small {
  display: block;
  margin-top: 6px;
  color: #42556f;
  font-size: 13px;
  line-height: 1.45;
}

.company-lawyer-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.company-lawyer-signals em {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(15, 76, 129, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand-navy);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 850;
}

.company-lawyer-summary.red .company-lawyer-signals em:first-child {
  border-color: rgba(166, 54, 54, 0.28);
  background: rgba(255, 242, 240, 0.84);
  color: #9a2f2f;
}

.company-lawyer-next {
  padding: 12px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.company-lawyer-next > strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-navy);
  font-size: 14px;
  line-height: 1.25;
}

.company-lawyer-next .company-action-row,
.company-lawyer-next > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.company-lawyer-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.company-lawyer-card {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(15, 76, 129, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
}

.company-lawyer-card > strong {
  display: block;
  margin-top: 5px;
  color: var(--brand-navy);
  font-size: 14px;
  line-height: 1.22;
}

.company-lawyer-summary.red .company-lawyer-card.status {
  border-color: rgba(166, 54, 54, 0.26);
  background: rgba(255, 246, 244, 0.84);
}

.company-lawyer-summary.red .company-lawyer-card.status > strong {
  color: #9a2f2f;
}

@media (max-width: 1180px) {
  .company-lawyer-summary-head {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .company-lawyer-summary {
    padding: 12px;
  }

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

.company-empty {
  border: 1px solid var(--premium-border);
  border-left: 0;
  background:
    radial-gradient(circle at 50% 10%, rgba(23, 107, 91, 0.08), transparent 32%),
    #fff;
}

.company-lookup-banner,
.company-status-panel,
.company-summary-card,
.company-insight-card,
.company-metric,
.company-detail,
.company-check,
.company-relation-item,
.ownership-row,
.company-report-item,
.company-group-structure,
.company-network-expand,
.company-role-ledger,
.company-graph-shell,
.company-exit-item,
.company-timeline-item,
.company-evidence-item {
  border-color: var(--premium-border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.company-status-panel {
  border-left-width: 0;
  background: #fff;
}

.company-status-panel.green,
.company-status-panel.yellow,
.company-status-panel.red,
.company-status-panel.blue {
  background: #fff;
}

.company-status-eyebrow,
.company-quality-checks-title,
.company-group-node span,
.company-group-header span,
.company-group-header small,
.company-role-ledger-head span,
.company-role-ledger-head small,
.company-graph-shell-head span,
.company-graph-shell-head small,
.company-network-expand-head span,
.company-network-controls > label,
.company-network-node span,
.company-network-edge span {
  text-transform: none;
  letter-spacing: 0;
}

.company-quality {
  opacity: 0.9;
}

.company-quality-score,
.company-quality-checks {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.76);
}

.company-quality-check {
  opacity: 0.78;
}

.company-quality-check.ok,
.company-quality-check.missing {
  color: var(--muted);
}

.company-summary-card,
.company-insight-card {
  border-left-width: 0;
}

.company-group-structure,
.company-network-expand,
.company-role-ledger,
.company-graph-shell {
  background: rgba(255, 255, 255, 0.78);
}

.company-group-node,
.company-group-empty,
.company-role-card,
.company-role-row,
.company-network-node,
.company-network-edge {
  border-color: var(--premium-border);
  box-shadow: none;
}

.company-graph-shell {
  padding: 14px;
}

.company-graph-shell-head {
  align-items: center;
}

.company-graph-shell-head small {
  display: block;
  margin-top: 3px;
  color: rgba(8, 38, 77, 0.52);
  font-size: 12px;
  font-weight: 650;
  text-transform: none;
}

.company-graph-mode {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(16, 42, 67, 0.06);
}

.company-graph-mode button {
  min-width: 96px;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.company-graph-mode button.active {
  background: var(--brand-navy);
  box-shadow: 0 8px 16px rgba(8, 38, 77, 0.15);
}

.company-graph-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.company-graph-summary.is-large-company {
  grid-template-columns: 1fr;
  gap: 6px;
}

.company-graph-summary-card {
  min-height: 74px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.045);
}

.company-graph-summary.is-large-company .company-graph-summary-card {
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.company-graph-summary.is-large-company .company-graph-summary-card strong {
  font-size: 14px;
  line-height: 1.2;
}

.company-graph-summary.is-large-company .company-graph-summary-card small {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  overflow: hidden;
  text-align: right;
}

.company-graph-summary-card.large-compact {
  border-color: rgba(47, 111, 159, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(241, 250, 254, 0.80));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.company-graph-summary-card.current {
  border-left: 3px solid rgba(47, 111, 159, 0.54);
  background:
    radial-gradient(circle at 6% 0%, rgba(79, 161, 205, 0.11), transparent 34%),
    rgba(255, 255, 255, 0.76);
}

.company-graph-summary-card.history,
.company-graph-summary-card.history-muted {
  border-left: 3px solid rgba(120, 96, 140, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.70), rgba(247, 250, 252, 0.74));
}

.company-graph-summary-card.history-muted {
  opacity: 0.82;
}

.company-graph-summary-card.compacted {
  border-left: 3px solid rgba(47, 111, 159, 0.44);
  background:
    radial-gradient(circle at 8% 0%, rgba(79, 161, 205, 0.13), transparent 35%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(241, 249, 253, 0.84));
}

.company-graph-summary-card.compacted strong {
  color: #174c76;
}

.company-graph-summary-card span {
  display: block;
  color: rgba(8, 38, 77, 0.58);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-graph-summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--brand-navy);
  font-size: 17px;
  font-weight: 900;
}

.company-graph-summary-card.history strong,
.company-graph-summary-card.history-muted strong {
  color: rgba(74, 64, 92, 0.88);
}

.company-graph-summary-card small {
  display: block;
  margin-top: 3px;
  color: rgba(8, 38, 77, 0.55);
  font-size: 11px;
  font-weight: 650;
}

.company-graph {
  min-height: 380px;
  border-color: var(--premium-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 38%, rgba(23, 107, 91, 0.055), transparent 30%),
    linear-gradient(180deg, #ffffff, #f8faf9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.company-graph.company-graph--cytoscape {
  min-height: 560px;
  border-color: rgba(47, 111, 159, 0.16);
  background:
    radial-gradient(circle at 32% 18%, rgba(47, 111, 159, 0.10), transparent 34%),
    radial-gradient(circle at 76% 72%, rgba(127, 183, 214, 0.12), transparent 36%),
    linear-gradient(180deg, #ffffff, #f7fbfd);
}

.company-graph-band {
  fill: rgba(255, 255, 255, 0.52);
  stroke: rgba(16, 42, 67, 0.08);
}

.company-graph-band-label {
  fill: rgba(8, 38, 77, 0.58);
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
}

.company-graph-legend {
  opacity: 0.78;
}

.company-graph-legend span {
  border-color: rgba(16, 42, 67, 0.08);
  background: rgba(255, 255, 255, 0.66);
}

.company-graph-note {
  border-color: rgba(168, 110, 18, 0.22);
  border-left: 0;
  background: rgba(255, 250, 240, 0.76);
}

.company-graph-note.neutral {
  border-color: rgba(16, 42, 67, 0.10);
  background: rgba(255, 255, 255, 0.74);
}

.company-edge {
  opacity: 0.84;
}

.company-edge.family-ownership,
.company-edge.family-group {
  stroke: var(--brand-green);
  stroke-width: 2.35;
}

.company-edge.family-governance,
.company-edge.family-insolvency {
  stroke: var(--brand-blue);
}

.company-edge.family-assurance {
  stroke: #78608c;
  stroke-dasharray: 5 5;
}

.company-edge.exited {
  opacity: 0.34;
}

.company-graph.is-history .company-edge.exited {
  opacity: 0.54;
}

.company-graph.is-dense .company-edge {
  opacity: 0.72;
}

.company-edge-label {
  opacity: 0.74;
}

.company-graph.is-dense .company-edge-label {
  font-size: 8.8px;
  opacity: 0.58;
}

.company-node rect {
  filter: drop-shadow(0 9px 18px rgba(16, 42, 67, 0.10));
}

.company-node.openable:hover rect,
.company-node.openable:focus-visible rect {
  filter: drop-shadow(0 14px 24px rgba(16, 42, 67, 0.16));
}

.company-node.family-ownership rect,
.company-node.family-group rect {
  fill: #edf7f3;
  stroke: rgba(23, 107, 91, 0.34);
}

.company-node.family-governance rect,
.company-node.family-insolvency rect {
  fill: #eef5fa;
  stroke: rgba(47, 111, 159, 0.30);
}

.company-node.family-assurance rect {
  fill: #f4f0f7;
  stroke: rgba(120, 96, 140, 0.30);
}

.company-network-controls {
  padding-top: 2px;
}

@media (max-width: 1040px) {
  .company-timeline-priority-grid {
    grid-template-columns: 1fr;
  }

  .company-timeline-priority-head {
    display: grid;
  }

  .company-cytoscape-body {
    grid-template-columns: 1fr;
  }

  .company-cytoscape-inspector {
    min-height: 120px;
  }

  .company-control-spine {
    grid-template-columns: 1fr;
  }

  .company-control-spine::before {
    display: none;
  }

  .company-subsidiary-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .company-subsidiary-metrics {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-subsidiary-metrics article {
    text-align: left;
  }

  .company-subsidiary-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .company-subsidiary-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .company-tree-header {
    display: grid;
    grid-template-columns: 1fr;
  }

  .company-tree-legend {
    justify-content: flex-start;
    max-width: none;
  }

  .company-tree-flow {
    grid-template-columns: 1fr;
  }

  .company-tree-track {
    display: none;
  }

  .company-tree-anchor {
    align-content: start;
    padding-top: 0;
  }

  .company-structure-board {
    grid-template-columns: 1fr;
  }

  .company-change-overview-head,
  .company-legal-timeline-head,
  .company-change-cards {
    grid-template-columns: 1fr;
  }

  .company-change-actions {
    justify-content: flex-start;
  }

  .company-control-room-head,
  .company-exit-compact {
    grid-template-columns: 1fr;
  }

  .company-control-metrics,
  .company-exit-compact-metrics {
    justify-content: flex-start;
    max-width: none;
  }

  .company-structure-board::before,
  .company-structure-board::after {
    display: none;
  }

  .company-graph-detail summary {
    grid-template-columns: 1fr;
  }

  .company-graph-detail summary em {
    grid-row: auto;
    grid-column: auto;
    justify-self: start;
  }
}

.company-network-type-grid label {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.72);
}

.company-network-status {
  border-color: var(--premium-border);
  border-left-width: 0;
  background: rgba(255, 255, 255, 0.72);
}

.company-expanded-network .company-network-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.company-filter-row {
  padding: 8px;
  border: 1px solid var(--premium-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.company-truth-strip {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(170px, 0.8fr) minmax(260px, 1.4fr);
  gap: 9px;
  margin-bottom: 12px;
}

.company-truth-card {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--premium-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 249, 0.78));
}

.company-truth-card.primary {
  border-color: rgba(8, 38, 77, 0.18);
  background:
    radial-gradient(circle at 12% 0%, rgba(47, 111, 159, 0.11), transparent 34%),
    #fff;
}

.company-truth-card span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 820;
}

.company-truth-card strong {
  color: var(--brand-navy);
  font-size: 17px;
  line-height: 1.15;
}

.company-truth-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.company-profile-brief {
  margin-bottom: 12px;
}

.company-profile-brief:empty {
  display: none;
}

.company-brief-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(420px, 1.12fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(8, 38, 77, 0.14);
  border-radius: 12px;
  background:
    radial-gradient(circle at 14% 4%, rgba(47, 111, 159, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff, #f4f8fb 58%, #eef5fa);
  box-shadow: 0 16px 44px rgba(16, 42, 67, 0.08);
}

.company-brief-shell.red,
.company-brief-shell.yellow {
  background:
    radial-gradient(circle at 12% 0%, rgba(168, 110, 18, 0.13), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fafb 56%, #fff8ea);
}

.company-brief-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 8px;
}

.company-brief-main > span,
.company-brief-card > span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

.company-brief-main > strong {
  color: var(--brand-navy);
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: 0;
}

.company-brief-main p {
  max-width: 58ch;
  margin: 0;
  color: #33413e;
  font-size: 13.5px;
  line-height: 1.48;
}

.company-brief-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.company-brief-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(16, 42, 67, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  color: #34423f;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.25;
}

.company-brief-facts b {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.company-brief-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.company-brief-card {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  border-left: 3px solid color-mix(in srgb, var(--relation-accent, #2f6f9f) 74%, transparent);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.74);
}

.company-brief-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy);
  font-size: 15px;
  line-height: 1.24;
}

.company-brief-card small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.36;
}

.company-status-panel-compact {
  display: block;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  border-left-width: 0;
  background: transparent;
}

.company-status-disclosure,
.company-quality-disclosure {
  border: 1px solid var(--premium-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.company-status-disclosure summary,
.company-quality-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  cursor: pointer;
}

.company-status-disclosure summary span,
.company-quality-disclosure summary span,
.company-quality-disclosure summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.company-status-disclosure summary strong,
.company-quality-disclosure summary strong {
  min-width: 0;
  color: var(--brand-navy);
  font-size: 13px;
  text-align: right;
}

.company-status-panel-compact .company-status-body {
  padding: 0 12px 12px;
}

.company-quality {
  display: block;
  margin-bottom: 12px;
  opacity: 1;
}

.company-source-disclosure {
  margin-top: 2px;
}

.company-source-disclosure summary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 249, 0.68));
}

.company-source-disclosure-body {
  display: grid;
  gap: 11px;
  padding: 12px;
  border-top: 1px solid var(--premium-border);
}

.company-source-passport {
  border-color: rgba(32, 120, 166, 0.24);
  background:
    radial-gradient(circle at 10% 10%, rgba(61, 154, 209, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.86);
}

.company-source-passport.warning {
  border-color: rgba(181, 118, 20, 0.28);
  background:
    radial-gradient(circle at 10% 10%, rgba(181, 118, 20, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.90);
}

.company-source-passport summary strong {
  color: var(--brand-navy);
}

.company-source-passport-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(32, 120, 166, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(235, 247, 253, 0.74)),
    #fff;
}

.company-source-passport.warning .company-source-passport-card {
  border-color: rgba(181, 118, 20, 0.20);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 230, 0.70)),
    #fff;
}

.company-source-passport-card span,
.company-source-legal-grid > article > span {
  color: color-mix(in srgb, var(--source-blue) 72%, var(--muted));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.company-source-passport-card strong {
  display: block;
  margin-top: 3px;
  color: var(--brand-navy);
  font-size: 17px;
  line-height: 1.22;
}

.company-source-passport-card p {
  max-width: 780px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
}

.company-source-legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.company-source-legal-grid article {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.company-source-legal-grid article div {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  gap: 6px;
}

.company-source-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(32, 120, 166, 0.14);
  border-radius: 10px;
  background: rgba(240, 248, 252, 0.86);
  color: var(--brand-navy);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
}

.company-source-pill.muted {
  border-color: rgba(16, 42, 67, 0.08);
  background: rgba(246, 248, 249, 0.82);
  color: var(--muted);
}

.company-source-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-source-checks span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 800;
}

.company-source-checks i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #b9c7c9;
}

.company-source-checks .ok i {
  background: var(--source-blue);
}

.company-source-checks .missing i {
  background: #c5963a;
}

.company-source-raw-facts {
  border-top: 1px solid rgba(16, 42, 67, 0.08);
  padding-top: 9px;
}

.company-source-raw-facts summary {
  width: fit-content;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 850;
  list-style: none;
}

.company-source-raw-facts summary::-webkit-details-marker {
  display: none;
}

.company-source-raw-facts .company-source-fact-grid {
  margin-top: 9px;
}

@media (max-width: 1180px) {
  .company-source-passport-card,
  .company-source-legal-grid {
    grid-template-columns: 1fr;
  }

  .company-source-passport-card .company-inline-action {
    width: fit-content;
  }
}

.company-source-note {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-left: 3px solid var(--focus);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.company-source-note strong {
  color: var(--brand-navy);
  font-size: 13px;
}

.company-source-note span,
.company-source-note small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
}

.company-source-fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 8px;
}

.company-source-fact {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(16, 42, 67, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.70);
}

.company-source-fact span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-source-fact strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1d2c2a;
  font-size: 12.5px;
  line-height: 1.34;
}

.company-quality-disclosure .company-quality-checks {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.company-metrics {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.company-metric {
  background: rgba(255, 255, 255, 0.78);
}

.company-truth-strip:empty,
.company-summary-grid:empty,
.company-metrics:empty,
.company-detail-grid:empty {
  display: none;
}

.company-family-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-family-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(16, 42, 67, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.relation-family-ownership,
.company-family-pill.relation-family-ownership {
  --relation-accent: #176b5b;
}

.relation-family-group,
.company-family-pill.relation-family-group {
  --relation-accent: #08264d;
}

.relation-family-governance,
.company-family-pill.relation-family-governance {
  --relation-accent: #2f6f9f;
}

.relation-family-assurance,
.company-family-pill.relation-family-assurance {
  --relation-accent: #54615d;
}

.relation-family-administration,
.company-family-pill.relation-family-administration {
  --relation-accent: #5d7184;
}

.relation-family-insolvency,
.company-family-pill.relation-family-insolvency {
  --relation-accent: #a86e12;
}

.relation-family-formation,
.company-family-pill.relation-family-formation {
  --relation-accent: #59446f;
}

.relation-family-unit,
.company-family-pill.relation-family-unit {
  --relation-accent: #6aa8c8;
}

.company-family-pill[class*="relation-family-"] {
  border-color: color-mix(in srgb, var(--relation-accent, #65716d) 28%, rgba(16, 42, 67, 0.10));
  background: color-mix(in srgb, var(--relation-accent, #65716d) 8%, white);
  color: color-mix(in srgb, var(--relation-accent, #65716d) 82%, #1d2422);
}

.company-relation-item[class*="relation-family-"] {
  border-left: 3px solid color-mix(in srgb, var(--relation-accent, #65716d) 72%, transparent);
}

.company-edge.insolvency,
.company-edge.curator,
.company-edge.reconstructor,
.company-edge.liquidator {
  stroke: #a86e12;
  stroke-width: 2.2;
}

.company-node.insolvency rect,
.company-node.curator rect,
.company-node.reconstructor rect,
.company-node.liquidator rect {
  fill: #fff7e8;
  stroke: rgba(168, 110, 18, 0.42);
}

@media (max-width: 920px) {
  .company-brief-shell {
    grid-template-columns: 1fr;
  }

  .company-brief-grid {
    grid-template-columns: 1fr;
  }

  .company-truth-strip {
    grid-template-columns: 1fr;
  }

  .company-graph-shell-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .company-graph-mode {
    width: 100%;
  }

  .company-graph-mode button {
    flex: 1 1 0;
  }

  .company-graph-summary,
  .company-expanded-network .company-network-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-role-change-head,
  .company-legal-year,
  .company-legal-event,
  .company-role-change-main {
    grid-template-columns: 1fr;
  }

  .company-legal-timeline-range {
    min-width: 0;
  }

  .company-legal-year-label {
    position: static;
    padding-top: 0;
  }

  .company-legal-event {
    padding-left: 28px;
  }

  .company-role-change-pills,
  .company-role-change-side {
    justify-content: flex-start;
  }

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

  .company-relation-workbench-head,
  .company-relation-item {
    grid-template-columns: 1fr;
  }

  .company-relation-workbench-stats {
    min-width: 0;
  }

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

  .company-relation-side {
    justify-content: flex-start;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .company-graph-summary,
  .company-expanded-network .company-network-summary,
  .company-role-change-grid,
  .company-relation-workbench-stats,
  .company-relation-view-grid {
    grid-template-columns: 1fr;
  }

  .company-role-change-event {
    grid-template-columns: 1fr;
  }
}

/* Fase 8: Water Authority Legal UI design system. */
:root {
  --water-deep: #061a33;
  --water-navy: #0a2a4f;
  --water-royal: #0f4c9a;
  --water-blue: #1e88e5;
  --water-aqua: #4fc3f7;
  --water-ice: #f5faff;
  --water-foam: #ffffff;
  --water-mist: #eaf5fb;
  --water-teal: #0f766e;
  --water-amber: #b9871d;
  --ink: #0b1f38;
  --muted: #5c7188;
  --bg: #f3f8fc;
  --surface: #ffffff;
  --surface-tint: #f7fbff;
  --surface-soft: #eef7fb;
  --line: rgba(10, 42, 79, 0.12);
  --line-strong: rgba(10, 42, 79, 0.22);
  --green: var(--water-teal);
  --green-dark: #075e63;
  --focus: var(--water-royal);
  --brand-navy: var(--water-navy);
  --brand-green: var(--water-teal);
  --premium-border: rgba(10, 42, 79, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --shadow-soft: 0 10px 28px rgba(6, 26, 51, 0.07);
  --shadow: 0 22px 70px rgba(6, 26, 51, 0.13);
  --premium-shadow: 0 18px 54px rgba(6, 26, 51, 0.10);
  --water-glass: rgba(255, 255, 255, 0.78);
  --water-glass-strong: rgba(255, 255, 255, 0.90);
  --water-focus-ring: 0 0 0 3px rgba(79, 195, 247, 0.24);
  --water-gradient: linear-gradient(135deg, var(--water-navy), var(--water-royal) 58%, #1479c9);
  --water-sheen: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 255, 0.72));
}

body {
  background:
    repeating-radial-gradient(ellipse at 74% -8%, rgba(79, 195, 247, 0.11) 0 1px, transparent 1px 42px),
    linear-gradient(135deg, rgba(245, 250, 255, 0.98), rgba(232, 244, 252, 0.88) 48%, rgba(247, 251, 255, 0.98));
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.45), transparent 28%, rgba(79, 195, 247, 0.08) 54%, transparent 78%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 22px);
  opacity: 0.58;
}

.app-shell {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 160px),
    transparent;
}

.auth-gate {
  background:
    repeating-radial-gradient(ellipse at 70% 12%, rgba(79, 195, 247, 0.15) 0 1px, transparent 1px 54px),
    linear-gradient(135deg, #f8fcff, #eaf5fb 52%, #ffffff);
}

.auth-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(10, 42, 79, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 30px 90px rgba(6, 26, 51, 0.16);
  backdrop-filter: blur(18px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(79, 195, 247, 0.13), transparent 34%),
    repeating-radial-gradient(ellipse at 86% 12%, rgba(30, 136, 229, 0.08) 0 1px, transparent 1px 34px);
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 20;
  grid-template-columns: minmax(238px, 0.58fr) minmax(760px, 1.75fr) minmax(208px, 0.50fr);
  min-height: 78px;
  padding: 10px 20px 10px 18px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(245, 250, 255, 0.76)),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(6, 26, 51, 0.07);
  backdrop-filter: blur(18px) saturate(1.15);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.55), rgba(15, 76, 154, 0.26), transparent);
}

.brand {
  gap: 13px;
  min-width: 262px;
}

.brand-mark-logo {
  width: 72px;
  height: 56px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  margin-left: -2px;
}

.auth-card .brand-mark-logo {
  width: 112px;
  height: 88px;
  flex-basis: 112px;
  margin-left: -4px;
}

.brand-mark-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 22px rgba(6, 26, 51, 0.16));
}

.brand-name {
  color: var(--water-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  letter-spacing: 0;
}

.auth-card .brand-name {
  font-size: 25px;
}

.brand-meta {
  color: rgba(10, 42, 79, 0.62);
}

.brand-tagline {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
  padding-bottom: 7px;
  color: var(--water-royal);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.012em;
  text-transform: none;
}

.brand-tagline::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(8, 38, 77, 0.08), rgba(24, 135, 214, 0.74), rgba(23, 107, 91, 0.48), rgba(8, 38, 77, 0.04));
}

.brand-mode-label {
  margin-top: 2px;
  color: rgba(10, 42, 79, 0.50);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-tabs {
  width: min(100%, 812px);
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(245, 250, 255, 0.58));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 12px 30px rgba(6, 26, 51, 0.06);
  overflow: visible;
}

.top-tab {
  min-height: 48px;
  flex: 1 1 124px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: rgba(10, 42, 79, 0.68);
  overflow: hidden;
}

.top-tab::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(79, 195, 247, 0.12), rgba(255, 255, 255, 0.72));
  opacity: 0;
  transition: opacity 170ms var(--ease-premium);
}

.top-tab svg {
  width: 18px;
  height: 18px;
  color: rgba(10, 42, 79, 0.62);
}

.top-tab-copy strong {
  font-size: 12.05px;
  font-weight: 860;
}

.top-tab-copy small {
  color: rgba(10, 42, 79, 0.48);
  font-size: 9.25px;
}

.top-tab:hover {
  border-color: transparent;
  background: transparent;
  color: var(--water-navy);
  transform: translateY(-1px);
}

.top-tab:hover::before {
  opacity: 1;
}

.top-tab.active {
  border-color: rgba(15, 76, 154, 0.16);
  background: var(--water-gradient);
  color: #fff;
  box-shadow:
    0 13px 26px rgba(15, 76, 154, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

.top-tab.active svg,
.top-tab.active .top-tab-copy small {
  color: rgba(255, 255, 255, 0.80);
}

.top-tab.active::after {
  left: 28px;
  right: 28px;
  bottom: 5px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.88), transparent);
}

.top-actions {
  gap: 9px;
}

.user-pill,
.command-trigger,
.account-menu,
.icon-button,
.quiet-button,
.company-inline-action {
  border-color: rgba(10, 42, 79, 0.12);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(10px);
}

.user-pill {
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"],
.command-trigger:hover,
.icon-button:hover,
.quiet-button:hover {
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 30px rgba(6, 26, 51, 0.10);
}

.primary-button {
  position: relative;
  overflow: hidden;
  border-color: rgba(15, 76, 154, 0.82);
  background: var(--water-gradient);
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 76, 154, 0.18);
}

.primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.32) 46%, transparent 58%);
  transform: translateX(-120%);
  transition: transform 420ms var(--ease-premium);
}

.primary-button:hover {
  border-color: rgba(79, 195, 247, 0.72);
  background: linear-gradient(135deg, #082f5f, #1062b8 58%, #1e88e5);
  box-shadow: 0 18px 36px rgba(15, 76, 154, 0.22);
}

.primary-button:hover::after {
  transform: translateX(120%);
}

.filters-pane,
.results-pane,
.reader-pane,
.profiles-view,
.deadlines-view,
.cases-view,
.templates-view,
.companies-view,
.admin-view {
  border-color: rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.40), transparent 210px),
    rgba(247, 251, 255, 0.82);
}

.filters-pane {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.70), rgba(240, 248, 253, 0.86)),
    rgba(245, 250, 255, 0.88);
}

.results-pane {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(241, 248, 253, 0.78) 260px, rgba(247, 251, 255, 0.94));
}

.research-command {
  position: relative;
  overflow: hidden;
  gap: 12px;
  padding: 18px 18px 16px;
  border-bottom-color: rgba(10, 42, 79, 0.10);
  background:
    repeating-radial-gradient(ellipse at 78% 0%, rgba(79, 195, 247, 0.12) 0 1px, transparent 1px 38px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 246, 255, 0.82));
}

.research-command::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.50), transparent);
}

.searchbar {
  position: relative;
  z-index: 1;
  gap: 12px;
}

.search-input-wrap input {
  height: 54px;
  padding-left: 48px;
  border: 1px solid rgba(10, 42, 79, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--water-deep);
  font-size: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 44px rgba(6, 26, 51, 0.09);
}

.search-input-wrap svg {
  left: 16px;
  color: var(--water-royal);
}

.search-input-wrap input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(30, 136, 229, 0.48);
  box-shadow: var(--water-focus-ring), 0 18px 44px rgba(6, 26, 51, 0.08);
  outline: none;
}

.search-submit {
  min-height: 54px;
  min-width: 174px;
  border-radius: 16px;
}

.filter-group,
.advanced-filter-panel,
.research-overview-card,
.result-row,
.skeleton-row,
.doc-header,
.doc-text-panel pre,
.side-workbench,
.reader-settings-panel,
.print-panel,
.legal-compass-card,
.source-identity-banner,
.company-panel,
.company-result-item,
.template-preview-card,
.template-result-card,
.case-card,
.profile-card,
.deadline-card,
.admin-panel {
  border-color: rgba(10, 42, 79, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 28px rgba(6, 26, 51, 0.055);
}

.filter-group,
.advanced-filter-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(246, 251, 255, 0.78));
}

.filter-group-title,
.command-title,
.research-start-main span,
.company-status-eyebrow,
.section-title,
.mini-heading {
  color: rgba(10, 42, 79, 0.70);
  letter-spacing: 0.02em;
}

.result-list {
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.86), rgba(255, 255, 255, 0.74));
}

.result-row {
  border-left-width: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 253, 255, 0.88));
}

.result-row:hover,
.result-row.active {
  border-color: rgba(30, 136, 229, 0.24);
  background: #fff;
  box-shadow:
    0 18px 42px rgba(6, 26, 51, 0.10),
    inset 0 0 0 1px rgba(79, 195, 247, 0.10);
}

.result-row.active {
  box-shadow:
    inset 4px 0 0 var(--water-royal),
    0 18px 42px rgba(6, 26, 51, 0.11);
}

.result-row.favorite {
  box-shadow: inset 4px 0 0 var(--water-amber);
}

.result-open-hint,
.active-filter-chip,
.query-token-chip,
.favorite-filter-chip,
.research-toggle-button,
.source-pill,
.relation-pill,
.label-chip,
.muted-chip,
.chip {
  border-color: rgba(10, 42, 79, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--water-navy);
}

.query-token-chip,
.research-toggle-button.active {
  border-color: rgba(30, 136, 229, 0.25);
  background: rgba(232, 246, 255, 0.82);
}

.research-toggle-button:hover,
.active-filter-chip:hover,
.query-token-chip:hover,
.favorite-filter-chip:hover {
  border-color: rgba(30, 136, 229, 0.28);
  background: #fff;
  box-shadow: 0 10px 26px rgba(6, 26, 51, 0.08);
}

.research-start-state {
  position: relative;
  isolation: isolate;
  min-height: clamp(460px, calc(100vh - 240px), 720px);
  overflow: hidden;
  padding: clamp(62px, 9vh, 108px) 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.80));
}

.research-start-state::before {
  content: "";
  position: absolute;
  inset: -22% -18%;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-radial-gradient(ellipse at 50% 42%, rgba(79, 195, 247, 0.22) 0 1px, transparent 1px 58px);
  opacity: 0.88;
  transform: scaleX(1.16);
}

.research-start-state::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.36) 34%, rgba(255, 255, 255, 0.00) 62%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.14) 50%, rgba(255, 255, 255, 0.72));
}

.research-start-main {
  max-width: 620px;
  gap: 10px;
}

.research-start-main span {
  color: rgba(7, 70, 122, 0.78);
}

.research-start-main strong {
  color: var(--water-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
  font-weight: 850;
  line-height: 1.08;
}

.research-start-actions {
  margin-top: 4px;
}

.research-start-actions button {
  min-height: 44px;
  padding: 0 16px;
  border-color: rgba(10, 42, 79, 0.12);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(6, 26, 51, 0.08);
  backdrop-filter: blur(10px);
}

.reader-pane {
  background:
    linear-gradient(180deg, rgba(246, 251, 255, 0.94), rgba(237, 247, 253, 0.84));
}

.doc-header {
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 250, 255, 0.86));
  box-shadow: 0 12px 34px rgba(6, 26, 51, 0.06);
}

.doc-header h1 {
  color: var(--water-deep);
}

.doc-text-panel {
  background:
    repeating-radial-gradient(ellipse at 50% -10%, rgba(79, 195, 247, 0.08) 0 1px, transparent 1px 58px),
    linear-gradient(180deg, rgba(239, 248, 254, 0.95), rgba(248, 252, 255, 0.86));
}

.doc-text-panel pre {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.96);
  color: #17263a;
  box-shadow: 0 22px 70px rgba(6, 26, 51, 0.10);
}

.side-workbench {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(243, 250, 255, 0.86));
}

.workbench-tabs,
.profile-mode-tabs,
.deadline-mode-tabs,
.case-room-tabs,
.company-tabs {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.company-tab,
.profile-mode-tabs button,
.deadline-mode-tabs button,
.case-room-tabs button,
.workbench-tab {
  border-radius: 999px;
}

.company-tab.active,
.profile-mode-tabs button.active,
.deadline-mode-tabs button.active,
.case-room-tabs button.active,
.workbench-tab.active {
  background: var(--water-gradient);
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 76, 154, 0.17);
}

.empty-state,
.error-state,
.result-empty-state {
  border-color: rgba(10, 42, 79, 0.10);
  background:
    repeating-radial-gradient(ellipse at 50% 0%, rgba(79, 195, 247, 0.08) 0 1px, transparent 1px 38px),
    rgba(255, 255, 255, 0.68);
  border-radius: var(--radius-lg);
}

.skeleton-line {
  background:
    linear-gradient(90deg, rgba(232, 246, 255, 0.86) 0%, rgba(255, 255, 255, 0.96) 48%, rgba(232, 246, 255, 0.86) 100%);
  background-size: 220% 100%;
}

@media (max-width: 1260px) {
  .topbar {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.72fr) minmax(190px, 0.72fr);
  }

  .top-tabs {
    width: min(100%, 700px);
  }

  .top-tab-copy small {
    display: none;
  }
}

@media (max-width: 820px) {
  .brand-mark-logo {
    width: 72px;
    height: 52px;
    flex-basis: 72px;
  }

  .top-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  .top-tab {
    flex: 0 0 142px;
    scroll-snap-align: start;
  }
}

/* Fase 8C: Module coherence polish. */
.profiles-view,
.deadlines-view,
.cases-view,
.templates-view,
.companies-view {
  --module-card-bg: rgba(255, 255, 255, 0.88);
  --module-card-border: rgba(10, 42, 79, 0.105);
  --module-muted-bg: rgba(244, 250, 255, 0.72);
}

.profile-header,
.deadline-header,
.case-header,
.company-header,
.templates-header {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 249, 255, 0.82));
  box-shadow: 0 14px 34px rgba(6, 26, 51, 0.045);
}

.profile-header h1,
.deadline-header h1,
.case-header h1,
.company-header h1,
.templates-header h1 {
  color: var(--water-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(21px, 1.7vw, 29px);
  font-weight: 850;
  line-height: 1.08;
}

.profile-actions,
.case-header-actions,
.company-actions,
.template-header-actions {
  align-items: center;
  gap: 7px;
}

.profile-header {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(520px, 0.92fr);
}

.profile-header > div:first-child {
  min-width: 0;
}

.profile-actions {
  justify-content: flex-end;
}

.profile-actions .quiet-button,
.case-header-actions .quiet-button,
.company-actions .quiet-button,
.template-header-actions .quiet-button,
.profile-actions select,
.case-header-actions select,
.company-actions select {
  min-height: 38px;
  border-radius: 13px;
}

.profile-actions #profileDownloadBtn,
.profile-actions #profileHtmlBtn,
.profile-actions #profilePrintBtn,
.profile-actions #profileRefreshBtn,
.company-actions #companyCopyReportBtn,
.company-actions #companyDownloadReportBtn {
  padding-inline: 11px;
  color: rgba(10, 42, 79, 0.74);
  font-size: 13px;
}

.profile-actions #deleteProfileBtn,
.company-actions .entity-case-link button:disabled,
.profile-actions .entity-case-link button:disabled {
  opacity: 0.62;
}

.profile-actions .entity-case-link,
.company-actions .entity-case-link {
  border-color: rgba(10, 42, 79, 0.08);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
}

.profile-panel,
.case-room-hero-main,
.case-link-panel,
.case-room-panel,
.template-results-panel,
.template-detail-panel,
.company-panel {
  border-color: var(--module-card-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 252, 255, 0.86));
  box-shadow: 0 16px 42px rgba(6, 26, 51, 0.055);
}

.profile-mode-tabs,
.deadline-mode-tabs,
.case-room-tabs,
.company-tabs {
  gap: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(242, 249, 255, 0.68));
}

.profile-mode-tabs button,
.deadline-mode-tabs button,
.case-room-tabs button,
.company-tab {
  border-color: rgba(10, 42, 79, 0.12);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition:
    transform 150ms var(--ease-premium),
    box-shadow 150ms var(--ease-premium),
    border-color 150ms var(--ease-premium),
    background-color 150ms var(--ease-premium);
}

.profile-mode-tabs button:hover,
.deadline-mode-tabs button:hover,
.case-room-tabs button:hover,
.company-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 136, 229, 0.24);
  box-shadow: 0 12px 24px rgba(6, 26, 51, 0.07);
}

.profile-mode-tabs button.active small,
.deadline-mode-tabs button.active small {
  color: rgba(255, 255, 255, 0.78);
}

.profile-issue-board article,
.profile-doc-list article,
.profile-annotation-list article,
.case-overview-item,
.case-activity-item {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 14px;
  background: var(--module-card-bg);
  box-shadow: 0 10px 24px rgba(6, 26, 51, 0.04);
}

.case-room-hero {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.case-link-panel {
  align-self: start;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 251, 255, 0.66));
}

.case-link-panel .mini-heading {
  color: rgba(10, 42, 79, 0.62);
  font-size: 11px;
}

.case-link-panel small {
  color: rgba(71, 92, 118, 0.78);
}

.case-link-panel .field {
  gap: 5px;
}

.case-link-panel button {
  min-height: 38px;
}

.templates-workspace {
  grid-template-columns: minmax(340px, 0.70fr) minmax(620px, 1.30fr);
}

.template-results-panel,
.template-detail-panel {
  padding: 16px;
}

.template-result-list {
  gap: 8px;
}

.template-result-item {
  border-left-width: 0;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 252, 255, 0.88));
  box-shadow: 0 8px 22px rgba(6, 26, 51, 0.045);
}

.template-result-item:hover,
.template-result-item.active {
  border-color: rgba(30, 136, 229, 0.24);
  box-shadow: 0 18px 38px rgba(6, 26, 51, 0.085);
}

.template-result-item.active {
  background:
    linear-gradient(90deg, rgba(232, 246, 255, 0.92), rgba(255, 255, 255, 0.94));
  box-shadow:
    inset 4px 0 0 var(--water-royal),
    0 18px 38px rgba(6, 26, 51, 0.085);
}

.template-open {
  gap: 6px;
  padding: 12px 0 12px 12px;
}

.template-result-top strong {
  color: var(--water-deep);
  font-size: 14px;
  line-height: 1.25;
}

.template-result-signal {
  border-color: rgba(30, 136, 229, 0.20);
  background: rgba(232, 246, 255, 0.82);
  color: var(--water-royal);
}

.template-file-pill {
  min-width: 42px;
  min-height: 26px;
  border-color: rgba(10, 42, 79, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: rgba(10, 42, 79, 0.68);
}

.template-result-meta {
  gap: 1px;
}

.template-result-meta span,
.template-snippet {
  color: rgba(71, 92, 118, 0.82);
  font-size: 11.7px;
}

.template-result-item:not(.active):not(:hover) .result-tags,
.template-result-item:not(.active):not(:hover) .template-snippet {
  display: none;
}

.template-result-item .result-tags .chip:nth-child(n+3),
.template-use-facts span:nth-child(n+3) {
  display: none;
}

.template-snippet {
  -webkit-line-clamp: 2;
}

.template-fav {
  margin: 10px 10px 0 0;
  border-radius: 13px;
}

.template-detail-content {
  width: min(100%, 1180px);
  gap: 12px;
}

.template-detail-head,
.template-use-strip,
.template-document-viewer,
.template-admin-details {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 16px;
}

.template-detail-head {
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.13), transparent 36%),
    rgba(255, 255, 255, 0.92);
}

.template-use-strip {
  border-color: rgba(30, 136, 229, 0.18);
  background:
    linear-gradient(100deg, rgba(232, 246, 255, 0.92), rgba(255, 255, 255, 0.88) 58%);
}

.template-use-eyebrow {
  color: var(--water-royal) !important;
}

.template-use-facts span {
  border-color: rgba(30, 136, 229, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.70);
}

.template-document-toolbar-actions > a.quiet-button {
  display: none;
}

.template-document-toolbar {
  background: rgba(255, 255, 255, 0.92);
}

.template-preview-status {
  min-height: 26px;
}

.template-admin-details {
  background: rgba(255, 255, 255, 0.72);
}

.template-admin-details > summary {
  border-radius: 14px;
}

.company-support-box,
.company-source-box {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 15px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.11), transparent 38%),
    rgba(255, 255, 255, 0.74);
}

.company-support-box strong,
.company-source-box strong {
  color: var(--water-deep);
}

.company-support-box span,
.company-source-box span,
.company-source-box small {
  color: rgba(71, 92, 118, 0.84);
}

.company-search-form .primary-button span {
  letter-spacing: 0;
}

@media (max-width: 1180px) {
  .profile-header {
    grid-template-columns: 1fr;
  }

  .templates-workspace,
  .case-room-hero {
    grid-template-columns: 1fr;
  }

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

  .case-office-head {
    display: none;
  }

  .case-office-row {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
    gap: 7px 10px;
  }

  .case-office-case {
    grid-column: 1 / -1;
  }

  .case-office-heading,
  .case-office-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .case-office-metrics {
    justify-content: flex-start;
  }

  .case-office-controls {
    margin-left: 0;
  }

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

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

  .case-command-top {
    display: grid;
  }

  .case-command-status {
    justify-content: flex-start;
  }

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

  .case-command-main {
    min-width: 0;
    grid-column: 1 / -1;
  }

  .case-command-save {
    grid-column: 1 / -1;
  }

  .case-process-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-process-checks {
    grid-template-columns: 1fr;
  }

  .case-process-cards,
  .case-process-card-grid,
  .case-process-card-grid.compact {
    grid-template-columns: 1fr;
  }

  .case-process-workbench {
    grid-template-columns: 1fr;
  }

  .case-process-card-grid .wide {
    grid-column: 1 / -1;
  }

  .case-operation-editor .wide,
  .case-operation-editor .primary-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .case-office-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .case-office-controls,
  .case-status-actions,
  .case-operation-editor,
  .case-command-grid {
    grid-template-columns: 1fr;
  }

  .case-command-top strong {
    white-space: normal;
  }

  .case-process-panel-head {
    display: grid;
  }

  .case-process-panel-head small {
    max-width: none;
    text-align: left;
  }

  .case-process-step-row {
    grid-template-columns: 1fr;
  }

  .case-process-step-row small {
    grid-column: 1;
  }

  .case-link-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .brand-mark-logo {
    width: 64px;
    height: 48px;
    flex-basis: 64px;
  }

  .brand-name {
    font-size: 17px;
  }

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

  .search-submit {
    width: 100%;
  }
}

/* Sager is a long workflow surface; it must scroll like a page, not like the fixed document reader. */
.app-shell.case-view-active {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

.app-shell.case-view-active .cases-view,
.app-shell.case-view-active .cases-layout,
.app-shell.case-view-active .case-main,
.app-shell.case-view-active .case-room-content,
.app-shell.case-view-active .case-room-hero,
.app-shell.case-view-active .case-room-hero-main,
.app-shell.case-view-active .case-room-panels {
  height: auto;
  min-height: 0;
  overflow: visible;
}

/* Launch polish: Sager should feel like one calm Retskilden workspace, not stacked utility blocks. */
.app-shell.case-view-active .case-main {
  background:
    linear-gradient(180deg, rgba(247, 252, 255, 0.98) 0%, rgba(241, 248, 252, 0.94) 48%, rgba(247, 250, 252, 0.98) 100%);
}

.case-office-overview {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(14px, 1.6vw, 24px);
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 251, 255, 0.52));
}

.case-office-heading {
  position: relative;
  align-items: center;
  padding: 15px 18px 14px;
  border-color: rgba(10, 42, 79, 0.075);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(249, 253, 255, 0.84));
  box-shadow:
    0 18px 50px rgba(6, 26, 51, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.case-office-heading::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: -1px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(10, 42, 79, 0.04), rgba(30, 136, 229, 0.46), rgba(23, 107, 91, 0.22), rgba(10, 42, 79, 0.03));
}

.case-office-heading .mini-heading {
  margin: 0;
  color: var(--source-blue);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.035em;
}

.case-office-heading p {
  max-width: 620px;
  margin-top: 4px;
  color: rgba(10, 42, 79, 0.62);
  font-size: 13px;
}

.case-office-heading-side {
  gap: 10px;
}

.case-office-metrics {
  gap: 8px;
}

.case-office-metric {
  min-height: 38px;
  padding: 7px 12px;
  border-color: rgba(10, 42, 79, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(6, 26, 51, 0.035);
}

.case-office-metric span,
.case-office-metric small {
  color: rgba(10, 42, 79, 0.54);
}

.case-office-metric strong {
  color: var(--source-blue);
  font-size: 13.5px;
}

.case-office-action {
  border-radius: 999px;
}

.case-office-action.primary {
  min-height: 40px;
  padding-inline: 16px;
  background: linear-gradient(135deg, #08264d 0%, #0f4c9a 55%, #1e88e5 100%);
  box-shadow:
    0 16px 32px rgba(15, 76, 154, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.case-office-toolbar {
  align-items: center;
  padding-top: 0;
}

.case-office-filters,
.case-team-strip {
  padding: 4px;
  border-color: rgba(10, 42, 79, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.case-office-filter {
  min-height: 32px;
  border-radius: 999px;
  padding-inline: 13px;
  color: rgba(10, 42, 79, 0.62);
}

.case-office-filter.active,
.case-team-chip.active {
  background: linear-gradient(180deg, #ffffff, #f6fbff);
  box-shadow:
    0 10px 22px rgba(6, 26, 51, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.case-office-controls select {
  min-height: 36px;
  border-radius: 999px;
  padding-inline: 13px;
}

.case-office-table {
  gap: 9px;
  padding: 9px;
  border-color: rgba(10, 42, 79, 0.07);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(239, 248, 253, 0.54));
  box-shadow:
    0 24px 64px rgba(6, 26, 51, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.case-office-head {
  padding: 8px 13px 3px;
  color: rgba(10, 42, 79, 0.48);
  font-size: 10.5px;
}

.case-office-row {
  padding: 14px 13px 14px 18px;
  border-color: rgba(10, 42, 79, 0.065);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(250, 253, 255, 0.9));
  box-shadow:
    0 9px 24px rgba(6, 26, 51, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.case-office-row::before {
  inset: 11px auto 11px 7px;
  width: 4px;
}

.case-office-row:hover,
.case-office-row.active {
  border-color: rgba(30, 136, 229, 0.20);
  background:
    linear-gradient(180deg, #ffffff, rgba(247, 252, 255, 0.98));
  box-shadow:
    0 18px 38px rgba(6, 26, 51, 0.085),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.case-office-case strong {
  color: var(--source-blue);
  font-size: 13.2px;
  font-weight: 950;
}

.case-office-case small,
.case-office-next small,
.case-office-owner small {
  color: rgba(10, 42, 79, 0.50);
}

.case-office-next strong {
  color: var(--ink);
  font-size: 12.2px;
}

.case-process-chip {
  grid-template-columns: 84px minmax(0, 1fr);
  min-height: 30px;
  padding: 5px 9px;
  border-color: rgba(10, 42, 79, 0.075);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.70);
}

.case-process-chip strong {
  color: rgba(10, 42, 79, 0.74);
  font-size: 10.2px;
}

.case-process-chip small {
  color: rgba(10, 42, 79, 0.54);
  font-size: 10.5px;
}

.case-process-chip.tone-done {
  border-color: rgba(30, 136, 229, 0.16);
  background: linear-gradient(180deg, #f7fcff, #edf7fd);
}

.case-process-chip.tone-pending {
  border-color: rgba(168, 110, 18, 0.20);
  background: linear-gradient(180deg, #fffaf0, #fff7e6);
}

.case-stage-cell {
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 252, 255, 0.76));
}

.case-estimate-pill {
  min-height: 26px;
  border-color: rgba(10, 42, 79, 0.075);
  background: rgba(255, 255, 255, 0.72);
}

.case-office-inline-editor {
  margin-top: -2px;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 254, 0.92));
  transform-origin: top center;
  animation: caseInlineReveal 170ms var(--ease-premium, ease) both;
}

.case-office-inline-editor.is-dirty {
  border-color: rgba(168, 110, 18, 0.30);
  box-shadow:
    0 18px 46px rgba(10, 42, 79, 0.09),
    0 0 0 3px rgba(168, 110, 18, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.case-office-inline-editor.needs-attention {
  animation:
    caseInlineReveal 170ms var(--ease-premium, ease) both,
    caseInlineNudge 460ms ease both;
}

.case-office-inline-head {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.07);
}

.case-office-inline-grid {
  gap: 12px;
}

.case-office-inline-grid input,
.case-office-inline-grid select,
.case-office-inline-grid textarea {
  min-height: 38px;
  border-radius: 10px;
}

.case-office-inline-actions {
  gap: 8px;
}

.case-office-delete {
  color: #8d2f28;
}

.case-office-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(152, 66, 55, 0.20);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 247, 246, 0.96), rgba(255, 241, 239, 0.84));
}

.case-office-delete-confirm.hidden {
  display: none;
}

.case-office-delete-confirm span {
  margin-right: auto;
  color: #7d312b;
  font-size: 12px;
  font-weight: 850;
}

.case-delete-confirm-button {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 999px;
}

.case-office-overview.is-dense {
  gap: 10px;
}

.case-office-overview.is-dense .case-office-heading {
  padding: 12px 16px;
  box-shadow:
    0 12px 32px rgba(6, 26, 51, 0.052),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.case-office-overview.is-dense .case-office-heading p {
  display: none;
}

.case-office-table.is-dense {
  gap: 6px;
  padding: 7px;
}

.case-office-table.is-dense .case-office-head {
  padding: 6px 11px 2px;
}

.case-office-table.is-dense .case-office-row {
  min-height: 92px;
  padding: 10px 11px 10px 16px;
  border-radius: 9px;
}

.case-office-table.is-dense .case-office-row::before {
  inset-block: 9px;
}

.case-office-table.is-dense .case-process-chip {
  min-height: 25px;
  padding-block: 3px;
}

.case-office-table.is-dense .case-stage-cell {
  padding-block: 6px;
}

.case-office-inline-status {
  margin-right: auto;
  color: rgba(10, 42, 79, 0.54);
  font-size: 11.5px;
  font-weight: 850;
}

.case-office-inline-editor.is-dirty .case-office-inline-status {
  color: #7b520f;
}

.case-office-discard {
  display: none;
}

.case-office-inline-editor.is-dirty .case-office-discard {
  display: inline-flex;
}

/* Sager launch polish: one calm work surface, no duplicate scaffolding. */
.app-shell.case-view-active .cases-layout {
  display: block;
}

.app-shell.case-view-active .cases-sidebar,
.app-shell.case-view-active .case-header,
.app-shell.case-view-active .case-room-empty,
.app-shell.case-view-active .case-room-tabs,
.app-shell.case-view-active .case-room-panels,
.app-shell.case-view-active .case-status-actions,
.app-shell.case-view-active .case-room-hero-main > #caseSummaryGrid,
.app-shell.case-view-active .case-room-hero-main > #caseProcessRail,
.app-shell.case-view-active .case-room-hero-main > #caseNextBox {
  display: none !important;
}

.app-shell.case-view-active .case-main {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 100vh;
  padding: clamp(12px, 1.5vw, 22px);
}

.app-shell.case-view-active .case-office-overview,
.app-shell.case-view-active .case-room-content {
  width: min(100%, 1500px);
}

.app-shell.case-view-active .case-room-content.hidden {
  display: none !important;
}

.app-shell.case-view-active .case-room-content {
  margin: 0 auto 34px;
  border: 1px solid rgba(10, 42, 79, 0.075);
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 249, 255, 0.70));
  box-shadow:
    0 22px 58px rgba(6, 26, 51, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.80);
}

.app-shell.case-view-active .case-room-hero {
  padding: 0;
  border-bottom: 0;
}

.app-shell.case-view-active .case-room-hero-main {
  gap: 14px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.app-shell.case-view-active .case-room-hero-main > .section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  padding: 0 2px;
  color: rgba(10, 42, 79, 0.68);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.app-shell.case-view-active .case-room-hero-main > .section-title svg {
  width: 16px;
  height: 16px;
  color: var(--source-blue);
}

.app-shell.case-view-active .case-process-workbench,
.app-shell.case-view-active .case-command-card {
  border-color: rgba(10, 42, 79, 0.085);
  box-shadow:
    0 16px 38px rgba(6, 26, 51, 0.052),
    inset 0 1px 0 rgba(255, 255, 255, 0.80);
}

.app-shell.case-view-active .case-command-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 252, 255, 0.90));
}

.app-shell.case-view-active .case-process-workbench {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(245, 251, 255, 0.74));
}

/* Final VA polish: Sager should read like a legal work ledger, not a technical dashboard. */
.app-shell.case-view-active .case-office-heading {
  border-color: rgba(10, 42, 79, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 252, 255, 0.58));
  box-shadow:
    0 12px 34px rgba(6, 26, 51, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.app-shell.case-view-active .case-office-heading p {
  color: rgba(10, 42, 79, 0.56);
}

.app-shell.case-view-active .case-office-metric {
  min-height: 34px;
  padding: 5px 10px;
  border-color: rgba(10, 42, 79, 0.065);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.app-shell.case-view-active .case-office-metric strong {
  font-size: 13px;
}

.app-shell.case-view-active .case-office-metric.tone-danger {
  border-color: rgba(152, 66, 55, 0.18);
  background: linear-gradient(180deg, rgba(255, 248, 247, 0.88), rgba(255, 241, 239, 0.58));
}

.app-shell.case-view-active .case-office-metric.tone-missing {
  border-color: rgba(89, 68, 111, 0.15);
  background: linear-gradient(180deg, rgba(250, 248, 252, 0.88), rgba(246, 242, 250, 0.58));
}

.app-shell.case-view-active .case-office-metric.tone-calm {
  border-color: rgba(30, 136, 229, 0.11);
  background: linear-gradient(180deg, rgba(248, 253, 255, 0.9), rgba(240, 248, 253, 0.58));
}

.app-shell.case-view-active .case-office-table {
  border-color: rgba(10, 42, 79, 0.055);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(238, 247, 253, 0.34));
  box-shadow:
    0 16px 44px rgba(6, 26, 51, 0.052),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.app-shell.case-view-active .case-office-head,
.app-shell.case-view-active .case-office-row {
  grid-template-columns: minmax(270px, 1.22fr) minmax(136px, 0.58fr) minmax(270px, 1.18fr) minmax(230px, 0.92fr) minmax(92px, 0.38fr) minmax(132px, 0.56fr);
  min-width: 1210px;
}

.app-shell.case-view-active .case-office-head {
  padding-inline: 14px;
  color: rgba(10, 42, 79, 0.44);
  font-size: 10px;
  letter-spacing: 0.055em;
}

.app-shell.case-view-active .case-office-row {
  min-height: 82px;
  padding: 12px 12px 12px 18px;
  border-color: rgba(10, 42, 79, 0.055);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 255, 0.82));
  box-shadow:
    0 6px 18px rgba(6, 26, 51, 0.032),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.app-shell.case-view-active .case-office-row:hover,
.app-shell.case-view-active .case-office-row.active {
  border-color: rgba(30, 136, 229, 0.18);
  box-shadow:
    0 14px 32px rgba(6, 26, 51, 0.072),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-shell.case-view-active .case-office-row.active {
  background:
    linear-gradient(180deg, #ffffff, rgba(245, 251, 255, 0.96));
}

.app-shell.case-view-active .case-office-case strong {
  font-size: 13.6px;
  letter-spacing: 0;
}

.app-shell.case-view-active .case-office-case small {
  color: rgba(10, 42, 79, 0.48);
  font-size: 11px;
}

.app-shell.case-view-active .case-office-next strong {
  font-size: 12.8px;
  line-height: 1.32;
}

.app-shell.case-view-active .case-office-next small {
  color: rgba(10, 42, 79, 0.46);
}

.app-shell.case-view-active .case-stage-cell {
  padding: 7px 9px;
  border-color: rgba(10, 42, 79, 0.06);
  background: rgba(255, 255, 255, 0.66);
}

.app-shell.case-view-active .case-stage-cell strong {
  font-size: 11.5px;
}

.app-shell.case-view-active .case-stage-cell small {
  color: rgba(10, 42, 79, 0.46);
}

.app-shell.case-view-active .case-office-process {
  gap: 4px;
}

.app-shell.case-view-active .case-process-chip {
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 26px;
  padding: 3px 8px;
  border-color: rgba(10, 42, 79, 0.055);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: none;
}

.app-shell.case-view-active .case-process-chip strong {
  color: rgba(10, 42, 79, 0.66);
  font-size: 9.8px;
}

.app-shell.case-view-active .case-process-chip small {
  color: rgba(10, 42, 79, 0.48);
  font-size: 10px;
}

.app-shell.case-view-active .case-process-chip.tone-unset {
  border-color: rgba(10, 42, 79, 0.075);
  background:
    linear-gradient(180deg, rgba(249, 251, 253, 0.92), rgba(243, 247, 250, 0.72));
}

.app-shell.case-view-active .case-process-chip.tone-unset strong {
  color: rgba(10, 42, 79, 0.56);
}

.app-shell.case-view-active .case-process-chip.tone-unset small {
  color: rgba(10, 42, 79, 0.44);
}

.app-shell.case-view-active .case-process-chip.tone-requested {
  border-color: rgba(30, 136, 229, 0.30);
  background:
    linear-gradient(180deg, rgba(244, 251, 255, 0.98), rgba(225, 241, 252, 0.84));
}

.app-shell.case-view-active .case-process-chip.tone-requested strong {
  color: #0f4c9a;
}

.app-shell.case-view-active .case-process-chip.tone-requested small {
  color: rgba(15, 76, 154, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-partial {
  border-color: rgba(168, 110, 18, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 244, 219, 0.82));
}

.app-shell.case-view-active .case-process-chip.tone-partial strong {
  color: #7b520f;
}

.app-shell.case-view-active .case-process-chip.tone-partial small {
  color: rgba(123, 82, 15, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-pending {
  border-color: rgba(168, 110, 18, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 244, 219, 0.82));
}

.app-shell.case-view-active .case-process-chip.tone-pending strong {
  color: #7b520f;
}

.app-shell.case-view-active .case-process-chip.tone-pending small {
  color: rgba(123, 82, 15, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-received {
  border-color: rgba(23, 107, 91, 0.26);
  background:
    linear-gradient(180deg, rgba(240, 250, 247, 0.98), rgba(225, 243, 238, 0.82));
}

.app-shell.case-view-active .case-process-chip.tone-received strong {
  color: #176b5b;
}

.app-shell.case-view-active .case-process-chip.tone-received small {
  color: rgba(23, 107, 91, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-done {
  border-color: rgba(23, 107, 91, 0.26);
  background:
    linear-gradient(180deg, rgba(240, 250, 247, 0.98), rgba(225, 243, 238, 0.82));
}

.app-shell.case-view-active .case-process-chip.tone-done strong {
  color: #176b5b;
}

.app-shell.case-view-active .case-process-chip.tone-done small {
  color: rgba(23, 107, 91, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-blocked {
  border-color: rgba(152, 66, 55, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 247, 246, 0.98), rgba(255, 235, 232, 0.82));
}

.app-shell.case-view-active .case-process-chip.tone-blocked strong {
  color: #8d2f28;
}

.app-shell.case-view-active .case-process-chip.tone-blocked small {
  color: rgba(141, 47, 40, 0.74);
}

.app-shell.case-view-active .case-estimate-pill {
  min-height: 24px;
  padding-inline: 9px;
  border-color: rgba(10, 42, 79, 0.06);
  color: rgba(10, 42, 79, 0.68);
  background: rgba(255, 255, 255, 0.58);
}

.app-shell.case-view-active .case-office-owner strong {
  color: rgba(10, 42, 79, 0.78);
  font-size: 12px;
}

.app-shell.case-view-active .case-office-inline-editor {
  margin: -1px 8px 8px;
  padding: 15px;
  border-color: rgba(30, 136, 229, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 254, 0.90));
  box-shadow:
    0 14px 34px rgba(6, 26, 51, 0.064),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.app-shell.case-view-active .case-office-inline-head {
  min-height: 38px;
}

.app-shell.case-view-active .case-office-inline-head span,
.app-shell.case-view-active .case-office-inline-grid label > span {
  color: rgba(10, 42, 79, 0.52);
  font-size: 10.5px;
}

.app-shell.case-view-active .case-office-inline-head strong {
  color: var(--source-blue);
  font-size: 14.5px;
}

.app-shell.case-view-active .case-office-inline-grid {
  grid-template-columns: minmax(150px, 0.7fr) minmax(180px, 0.85fr) minmax(260px, 1.35fr) minmax(150px, 0.65fr);
  gap: 11px;
}

.app-shell.case-view-active .case-office-inline-grid label.wide {
  grid-column: span 2;
}

.app-shell.case-view-active .case-office-inline-grid input,
.app-shell.case-view-active .case-office-inline-grid select,
.app-shell.case-view-active .case-office-inline-grid textarea {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.86);
}

.app-shell.case-view-active .case-office-inline-grid input:focus,
.app-shell.case-view-active .case-office-inline-grid select:focus,
.app-shell.case-view-active .case-office-inline-grid textarea:focus {
  border-color: rgba(30, 136, 229, 0.34);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.09);
}

.app-shell.case-view-active .case-office-inline-actions {
  padding-top: 2px;
}

.app-shell.case-view-active .case-office-inline-status {
  color: rgba(10, 42, 79, 0.46);
}

.app-shell.case-view-active .case-office-delete-confirm {
  background:
    linear-gradient(180deg, rgba(255, 249, 248, 0.96), rgba(255, 244, 242, 0.78));
}

@keyframes caseInlineReveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

@keyframes caseInlineNudge {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-3px);
  }

  50% {
    transform: translateX(3px);
  }

  75% {
    transform: translateX(-2px);
  }
}

.top-tabs {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(245, 250, 255, 0.52));
}

.top-tab {
  min-height: 46px;
  border-radius: 14px;
}

.top-tab.active {
  border-radius: 14px;
  box-shadow:
    0 12px 24px rgba(15, 76, 154, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

@media (max-width: 1180px) {
  .case-office-heading {
    align-items: stretch;
  }

  .case-office-metrics {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .research-start-state {
    min-height: 420px;
    padding: 54px 18px;
  }

  .research-start-state::before {
    inset: -14% -48%;
    transform: scaleX(1.08);
  }

  .research-start-main strong {
    font-size: 29px;
  }

  .case-office-overview {
    padding: 12px;
  }

  .case-office-heading {
    padding: 15px;
  }

  .case-office-metric {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .case-office-filters {
    border-radius: 12px;
  }

  .case-office-table {
    padding: 7px;
    border-radius: 10px;
  }

  .case-office-row {
    border-radius: 10px;
  }

  .case-process-chip {
    grid-template-columns: 88px minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .case-office-overview {
    padding: 16px;
  }

  .case-office-heading {
    padding: 16px;
  }

  .case-office-table {
    padding: 8px;
    overflow: visible;
  }

  .case-office-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(138px, auto);
    align-items: start;
    gap: 9px 12px;
    padding: 14px 14px 14px 18px;
  }

  .case-office-case {
    grid-column: 1;
  }

  .case-stage-cell {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    max-width: none;
  }

  .case-office-next,
  .case-office-process {
    grid-column: 1 / -1;
  }

  .case-office-process {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .case-estimate-pill {
    grid-column: 1;
    justify-self: start;
  }

  .case-office-owner {
    grid-column: 2;
    justify-self: end;
    text-align: right;
  }
}

@media (max-width: 720px) {
  .case-office-overview {
    padding: 12px;
  }

  .case-office-heading,
  .case-office-toolbar {
    border-radius: 8px;
  }

  .case-office-actions,
  .case-office-metrics {
    width: 100%;
  }

  .case-office-action.primary {
    flex: 1 1 auto;
    justify-content: center;
  }

  .case-office-table {
    gap: 7px;
    padding: 6px;
  }

  .case-office-row {
    grid-template-columns: minmax(0, 1fr);
    padding: 13px 12px 13px 16px;
  }

  .case-office-case,
  .case-stage-cell,
  .case-office-next,
  .case-office-process,
  .case-estimate-pill,
  .case-office-owner {
    grid-column: 1;
  }

  .case-stage-cell,
  .case-office-owner {
    justify-self: stretch;
    text-align: left;
  }

  .case-office-process {
    grid-template-columns: 1fr;
  }

  .case-process-chip {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .case-office-inline-editor {
    margin-inline: 0;
    padding: 13px;
  }
}

/* Fix F5E: Sager is desktop/laptop-first. Keep the legal ledger dense, calm and readable at 1280px+. */
.case-office-date-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: -4px;
  padding: 8px 10px;
  border: 1px solid rgba(10, 42, 79, 0.06);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(248, 253, 255, 0.92), rgba(238, 248, 254, 0.68));
}

.case-office-date-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.62);
  font-size: 11px;
  font-weight: 800;
}

.case-office-date-strip strong {
  color: rgba(10, 42, 79, 0.78);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.case-office-date-strip.muted {
  color: rgba(10, 42, 79, 0.52);
}

@media (min-width: 1181px) {
  .app-shell.case-view-active .case-office-table {
    overflow-x: hidden;
  }

  .app-shell.case-view-active .case-office-head,
  .app-shell.case-view-active .case-office-row {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(220px, 1.24fr) minmax(116px, 0.56fr) minmax(210px, 1.14fr) minmax(258px, 1.12fr) minmax(76px, 0.34fr) minmax(112px, 0.50fr);
    gap: 8px;
  }

  .app-shell.case-view-active .case-office-row {
    min-height: 88px;
    padding: 9px 10px 9px 18px;
  }

  .app-shell.case-view-active .case-office-row:hover {
    transform: translateY(-1px);
  }

  .app-shell.case-view-active .case-stage-cell {
    padding: 6px 8px;
  }

  .app-shell.case-view-active .case-office-process {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 4px;
  }

  .app-shell.case-view-active .case-process-chip {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: minmax(78px, 0.55fr) minmax(0, 1fr);
    min-height: 21px;
    padding: 1px 7px;
    border-radius: 999px;
  }

  .app-shell.case-view-active .case-process-chip strong {
    font-size: 9.4px;
  }

  .app-shell.case-view-active .case-process-chip small {
    font-size: 9.6px;
  }

  .app-shell.case-view-active .case-estimate-pill {
    min-height: 23px;
    padding-inline: 8px;
  }

  .app-shell.case-view-active .case-office-inline-editor {
    margin: -2px 4px 8px;
    padding: 13px;
    scroll-margin-top: 96px;
  }

  .app-shell.case-view-active .case-office-inline-head {
    min-height: 34px;
  }

  .app-shell.case-view-active .case-office-inline-grid {
    grid-template-columns: minmax(130px, 0.58fr) minmax(160px, 0.72fr) minmax(240px, 1.22fr) minmax(136px, 0.58fr);
    gap: 9px;
  }

  .app-shell.case-view-active .case-office-inline-grid input,
  .app-shell.case-view-active .case-office-inline-grid select,
  .app-shell.case-view-active .case-office-inline-grid textarea {
    min-height: 34px;
  }

  .app-shell.case-view-active .case-office-table.is-dense .case-office-row {
    min-height: 86px;
    padding-block: 8px;
  }

  .app-shell.case-view-active .case-office-table.is-dense .case-process-chip {
    min-height: 22px;
    padding-block: 2px;
  }
}

@media (max-width: 1180px) {
  .app-shell.case-view-active .case-office-head {
    display: none;
  }

  .app-shell.case-view-active .case-office-table {
    overflow: visible;
  }

  .app-shell.case-view-active .case-office-row {
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(138px, auto);
  }

  .app-shell.case-view-active .case-office-process {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell.case-view-active .case-process-chip {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .app-shell.case-view-active .case-office-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell.case-view-active .case-office-process {
    grid-template-columns: 1fr;
  }

  .case-office-date-strip {
    align-items: stretch;
  }

  .case-office-date-strip span {
    width: 100%;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* Retskilden visual language: the water-ring motif should belong to every module, not only search. */
.profiles-view,
.deadlines-view,
.cases-view,
.templates-view,
.companies-view,
.admin-view {
  background:
    repeating-radial-gradient(ellipse at 78% -10%, rgba(79, 195, 247, 0.10) 0 1px, transparent 1px 66px),
    linear-gradient(180deg, rgba(247, 252, 255, 0.96), rgba(239, 248, 255, 0.80) 310px, rgba(247, 251, 255, 0.92));
}

.profile-header,
.deadline-header,
.case-header,
.templates-header,
.company-header,
.admin-header {
  position: relative;
  overflow: hidden;
  background:
    repeating-radial-gradient(ellipse at 86% -22%, rgba(79, 195, 247, 0.13) 0 1px, transparent 1px 54px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 249, 255, 0.84));
}

.profile-card-title > strong {
  margin-bottom: 0;
}

/* Fase 9A: Blue Retskilden alignment for reader, authority and module controls. */
.app-shell.reader-wide.filters-collapsed {
  grid-template-columns: 62px 6px minmax(270px, 0.46fr) 6px minmax(760px, 1.34fr);
}

.app-shell.reader-wide .reader-pane {
  background:
    radial-gradient(ellipse at 72% -16%, rgba(79, 195, 247, 0.13), transparent 45%),
    linear-gradient(180deg, rgba(246, 251, 255, 0.98), rgba(238, 248, 254, 0.88));
}

.reader-navigation-actions,
.reader-size-actions,
.reader-find-panel,
.reader-settings-panel,
.print-panel {
  border-color: rgba(10, 42, 79, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 250, 255, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 42px rgba(6, 26, 51, 0.10);
}

.reader-navigation-actions .icon-button:hover,
.reader-navigation-actions .icon-button.active,
.reader-navigation-actions .compact-text-button:hover,
.reader-size-actions .icon-button:hover,
.reader-size-actions .icon-button.active,
.reader-zoom-value:hover,
.reader-zoom-value.active,
.reader-toggle-row button:hover,
.reader-toggle-row button.active {
  border-color: rgba(30, 136, 229, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(231, 246, 255, 0.86));
  color: var(--water-navy);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(15, 76, 154, 0.10);
}

.reader-find-row > svg,
.reader-find-count,
.doc-data-panel > summary small {
  color: var(--water-royal);
}

.doc-data-panel,
.legal-compass {
  border-bottom-color: rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(242, 249, 255, 0.78));
}

.legal-compass-card,
.source-status-card,
.authority-rail {
  --compass-color: var(--water-royal);
  --authority-color: var(--water-royal);
  background:
    radial-gradient(ellipse at 10% -16%, rgba(79, 195, 247, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 255, 0.86));
  box-shadow: 0 12px 32px rgba(6, 26, 51, 0.06);
}

.legal-compass-card.very-high,
.legal-compass-card.high,
.source-status-card.very-high,
.source-status-card.high,
.authority-rail.very-high,
.authority-rail.high {
  --compass-color: var(--water-royal);
  --authority-color: var(--water-royal);
  border-left-color: var(--water-royal);
}

.legal-compass-card.medium,
.source-status-card.medium,
.authority-rail.medium {
  --compass-color: var(--water-blue);
  --authority-color: var(--water-blue);
  border-left-color: rgba(30, 136, 229, 0.72);
}

.legal-compass-card.low,
.legal-compass-card.support,
.source-status-card.low,
.authority-rail.low,
.authority-rail.support {
  --compass-color: var(--water-teal);
  --authority-color: var(--water-teal);
  border-left-color: rgba(15, 118, 110, 0.72);
}

.legal-compass-main strong,
.source-status-head strong,
.authority-rail strong {
  color: var(--water-deep);
}

.legal-compass-main small,
.source-status-card p,
.source-status-head em,
.authority-rail span,
.authority-rail time {
  color: rgba(10, 42, 79, 0.62);
}

/* Fase 9B: Module chrome should feel like one Retskilden product. */
.profile-mode-tabs button.active,
.deadline-mode-tabs button.active,
.case-room-tabs button.active,
.company-tab.active,
.template-quick-chip.active,
.case-office-filter.active,
.case-team-chip.active,
button.case-office-metric.active {
  border-color: rgba(15, 76, 154, 0.26);
  background: var(--water-gradient);
  color: #fff;
  box-shadow:
    0 13px 28px rgba(15, 76, 154, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.profile-mode-tabs button.active span,
.profile-mode-tabs button.active small,
.deadline-mode-tabs button.active span,
.deadline-mode-tabs button.active small,
.case-room-tabs button.active small,
.company-tab.active small,
.template-quick-chip.active small,
.case-office-filter.active small,
.case-team-chip.active span,
.case-team-chip.active strong,
button.case-office-metric.active span,
button.case-office-metric.active strong {
  color: rgba(255, 255, 255, 0.82);
}

.profile-list-item.active,
.deadline-case-item.active,
.legal-case-item.active,
.template-result-item.active,
.company-result-item.active,
.case-office-row.active,
.user-list-item.active,
.access-item.active {
  border-color: rgba(30, 136, 229, 0.24);
  background:
    repeating-radial-gradient(ellipse at 94% 4%, rgba(79, 195, 247, 0.13) 0 1px, transparent 1px 42px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 246, 255, 0.78));
  box-shadow:
    inset 4px 0 0 var(--water-royal),
    0 16px 38px rgba(6, 26, 51, 0.08);
}

.profile-list-item:hover,
.deadline-case-item:hover,
.legal-case-item:hover,
.template-result-item:hover,
.company-result-item:hover,
.case-office-row:hover,
.user-list-item:hover,
.access-item:hover {
  border-color: rgba(30, 136, 229, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(242, 249, 255, 0.90));
  box-shadow: 0 14px 32px rgba(6, 26, 51, 0.075);
}

.profile-scope-badge.team,
.profile-scope-badge.private,
.entity-case-chip,
.template-file-pill {
  border-color: rgba(10, 42, 79, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(232, 246, 255, 0.72));
  color: var(--water-navy);
}

.activity-dot,
.template-fav.active,
.company-graph-mode-button.active::before {
  background: var(--water-blue);
  box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.16);
}

.templates-view .section-title,
.profiles-view .section-title,
.deadlines-view .section-title,
.cases-view .section-title,
.companies-view .section-title,
.admin-view .section-title {
  color: rgba(10, 42, 79, 0.72);
}

.templates-view .section-title svg,
.profiles-view .section-title svg,
.deadlines-view .section-title svg,
.cases-view .section-title svg,
.companies-view .section-title svg,
.admin-view .section-title svg {
  color: var(--water-royal);
}

/* Final responsive guard: collapsed research state must not squeeze the source header into the content column. */
@media (max-width: 820px) {
  .app-shell,
  .app-shell.reader-empty-state,
  .app-shell.filters-collapsed,
  .app-shell.reader-empty-state.filters-collapsed,
  .app-shell.reader-wide.filters-collapsed,
  .app-shell.reader-focus.filters-collapsed,
  .app-shell.reader-minimized.filters-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
  }

  .topbar {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    padding: 10px 12px 12px;
    overflow: hidden;
  }

  .topbar > .brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .topbar .brand-mark-logo {
    width: 58px;
    height: 46px;
    flex-basis: 58px;
  }

  .topbar .brand-name {
    font-size: 19px;
  }

  .topbar .brand-tagline {
    max-width: min(260px, 62vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .top-actions {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-width: 0;
    justify-content: flex-end;
  }

  .user-pill {
    max-width: 150px;
  }

  .top-tabs {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100%;
    display: flex !important;
    justify-content: flex-start;
    gap: 6px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .top-tab {
    flex: 0 0 138px;
    scroll-snap-align: start;
  }

  .filters-pane {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
  }

  .results-pane {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100%;
  }

  .app-shell.filters-collapsed .results-pane,
  .app-shell.reader-empty-state.filters-collapsed .results-pane {
    grid-row: 2 !important;
  }

  .reader-pane,
  .profiles-view,
  .deadlines-view,
  .cases-view,
  .templates-view,
  .companies-view,
  .admin-view {
    grid-column: 1 / -1 !important;
  }
}

/* Fix F5B: final guard for premium top navigation responsiveness and semantics. */
@media (max-width: 820px) {
  .app-shell,
  .app-shell.filters-collapsed,
  .app-shell.reader-wide.filters-collapsed,
  .app-shell.reader-focus.filters-collapsed,
  .app-shell.reader-minimized.filters-collapsed {
    grid-template-rows: auto 56px minmax(0, 0.38fr) minmax(0, 0.62fr) !important;
    height: 100vh;
    overflow: hidden;
  }

  .app-shell.reader-empty-state,
  .app-shell.reader-empty-state.filters-collapsed {
    grid-template-rows: auto 56px minmax(0, 1fr) !important;
  }

  .filters-pane {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    max-height: 56px;
    overflow: hidden !important;
  }

  .app-shell:not(.filters-collapsed) .filters-pane {
    max-height: min(52vh, 420px);
    overflow-y: auto !important;
  }

  .results-pane,
  .app-shell.reader-empty-state .results-pane {
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell.filters-collapsed .results-pane,
  .app-shell.reader-empty-state.filters-collapsed .results-pane {
    grid-row: 3 !important;
  }

  .reader-pane {
    grid-column: 1 / -1 !important;
    grid-row: 4 !important;
    min-height: 0;
    overflow: hidden;
  }
}

@media (min-width: 821px) and (max-width: 1360px) {
  .topbar {
    grid-template-columns: minmax(210px, 0.52fr) minmax(780px, 1.95fr) minmax(188px, 0.48fr);
    gap: 12px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .top-tabs {
    width: min(100%, 780px);
  }

  .top-tab {
    flex-basis: 120px;
    min-height: 46px;
    grid-template-columns: 19px minmax(0, 1fr);
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .top-tab svg {
    width: 17px;
    height: 17px;
  }

  .top-tab-copy strong {
    font-size: 11.55px;
  }

  .top-tab-copy small {
    display: none;
  }

  .user-pill {
    max-width: 170px;
  }
}

@media (max-width: 820px) {
  .topbar > .brand {
    gap: 9px;
  }

  .topbar .brand-mark-logo {
    width: 50px;
    height: 42px;
    flex-basis: 50px;
  }

  .topbar .brand-name {
    font-size: 18px;
  }

  .topbar .brand-tagline {
    max-width: min(150px, 42vw);
    font-size: 10px;
  }

  .top-tabs {
    padding: 4px;
    border-radius: 22px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%);
  }

  .top-tabs::-webkit-scrollbar {
    display: none;
  }

  .top-tab {
    flex: 0 0 clamp(110px, 31vw, 128px);
    min-height: 42px;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 8px;
  }

  .top-tab svg {
    width: 17px;
    height: 17px;
  }

  .top-tab-copy strong {
    font-size: 11.35px;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 8px 10px;
  }

  .top-actions {
    gap: 6px;
  }

  .user-pill {
    min-width: 88px;
    max-width: 104px;
    padding: 6px 8px;
  }

  .user-pill span {
    display: none;
  }

  .user-pill strong {
    font-size: 11.5px;
  }

  .topbar .brand-tagline {
    max-width: min(132px, 36vw);
  }

  #refreshBtn {
    width: 34px;
    height: 34px;
  }

  .top-tab {
    flex-basis: 108px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
}

/* Fix F5C: calmer source-search start state and denser premium result cards. */
.result-list {
  overflow-x: hidden;
}

.research-start-state {
  width: 100%;
  max-width: 100%;
  contain: paint;
  padding-inline: clamp(18px, 4vw, 36px);
}

.research-start-state::before {
  inset: -18% 0 -12%;
  transform: none;
  background:
    repeating-radial-gradient(ellipse at 50% 42%, rgba(79, 195, 247, 0.18) 0 1px, transparent 1px 64px);
  opacity: 0.82;
  mask-image: radial-gradient(ellipse at 50% 42%, #000 0 52%, transparent 76%);
}

.research-start-state::after {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.34) 36%, rgba(255, 255, 255, 0.00) 64%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0.82));
}

.research-start-main {
  max-width: min(620px, calc(100% - 24px));
  margin-inline: auto;
}

.result-row {
  gap: 7px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: 14px;
}

.result-card-head {
  gap: 10px;
  align-items: center;
}

.result-title {
  font-size: 15.25px;
  line-height: 1.28;
}

.result-relevance-line {
  min-height: 0;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 10px;
  font-size: 11.8px;
  line-height: 1.25;
}

.result-relevance-line strong {
  font-size: 11.7px;
}

.result-snippet {
  font-size: 13.75px;
  line-height: 1.46;
  -webkit-line-clamp: 2;
}

/* LSR-2: Landsskatteretten source-preserving visual polish. */
.result-row.lsr-row,
.direct-match-card.lsr-direct {
  border-left-color: rgba(30, 136, 229, 0.58);
  background:
    radial-gradient(ellipse at 102% -18%, rgba(79, 195, 247, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 250, 255, 0.82));
}

.result-row.lsr-row:hover,
.result-row.lsr-row.active,
.direct-match-card.lsr-direct:hover,
.direct-match-card.lsr-direct.active {
  border-color: rgba(30, 136, 229, 0.28);
  border-left-color: var(--water-royal);
  background:
    radial-gradient(ellipse at 98% -14%, rgba(79, 195, 247, 0.20), transparent 44%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 247, 255, 0.90));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 14px 32px rgba(6, 26, 51, 0.08);
}

.lsr-chip,
.source-pill.lsr-pill {
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(231, 246, 255, 0.92);
  color: var(--water-navy);
}

.source-identity-details.lsr-source-identity {
  border-left-color: rgba(30, 136, 229, 0.64);
  background:
    radial-gradient(ellipse at 82% -26%, rgba(79, 195, 247, 0.14), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(242, 249, 255, 0.84));
}

.source-identity-details.lsr-source-identity summary strong {
  color: var(--water-deep);
}

.source-identity-details.lsr-source-identity .source-identity-facts span {
  border-color: rgba(30, 136, 229, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(10, 42, 79, 0.72);
}

.reader-context-strip.lsr-context {
  border-bottom-color: rgba(30, 136, 229, 0.14);
  background:
    radial-gradient(ellipse at 82% -32%, rgba(79, 195, 247, 0.14), transparent 48%),
    linear-gradient(135deg, rgba(244, 250, 255, 0.96), rgba(255, 255, 255, 0.86));
}

.doc-outline.source-structured-outline {
  grid-template-columns: minmax(98px, auto) minmax(0, 1fr);
  max-height: 58px;
  border-bottom-color: rgba(30, 136, 229, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(242, 249, 255, 0.82));
}

.doc-outline.source-structured-outline > span {
  color: rgba(10, 42, 79, 0.72);
}

.doc-outline button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.doc-outline button em {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(30, 136, 229, 0.10);
  color: var(--water-royal);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.doc-outline.source-structured-outline button {
  border-color: rgba(30, 136, 229, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: var(--water-deep);
}

.doc-outline.source-structured-outline button:hover {
  border-color: rgba(30, 136, 229, 0.30);
  background: rgba(232, 247, 255, 0.92);
}

.result-snippet mark {
  background: rgba(79, 195, 247, 0.24);
  box-shadow: inset 0 -1px 0 rgba(15, 76, 154, 0.24);
}

.result-tags {
  gap: 5px;
  max-height: 24px;
}

.result-tags .chip {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 11.75px;
}

@media (max-width: 820px) {
  .research-start-state {
    min-height: 390px;
    padding-block: 54px;
  }

  .research-start-main strong {
    font-size: clamp(25px, 7vw, 32px);
  }

  .result-row {
    padding: 11px 12px;
  }
}

/* F5D: Frister becomes a quiet Retskilden control tool, not a parallel case module. */
.deadlines-view {
  --deadline-blue: #0f4c9a;
  --deadline-blue-soft: rgba(79, 195, 247, 0.16);
  --deadline-panel-bg: rgba(255, 255, 255, 0.88);
}

.deadlines-layout,
.deadlines-layout.quick-mode {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.deadlines-sidebar,
#deadlineCaseLinkBox,
#deleteDeadlineCaseBtn,
#saveDeadlineInsightBtn,
.deadline-support-field {
  display: none !important;
}

.deadline-main {
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 82% -8%, rgba(79, 195, 247, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(247, 252, 255, 0.96), rgba(239, 248, 255, 0.80));
}

.deadline-header {
  margin: 14px 14px 0;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 18px;
  background:
    repeating-radial-gradient(ellipse at 88% -38%, rgba(79, 195, 247, 0.16) 0 1px, transparent 1px 52px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.97), rgba(233, 247, 255, 0.84));
  box-shadow: 0 18px 46px rgba(6, 26, 51, 0.075);
}

.deadline-header::after {
  content: "";
  position: absolute;
  right: 28px;
  bottom: 14px;
  width: min(420px, 38vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(15, 76, 154, 0.34), transparent);
}

.deadline-header-actions {
  min-width: 0;
}

.deadline-status {
  border-color: rgba(15, 76, 154, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: var(--water-navy);
}

.deadline-mode-tabs {
  width: min(760px, calc(100% - 28px));
  margin: 12px 14px;
  padding: 5px;
  border-radius: 999px;
  justify-self: center;
}

.deadline-mode-tabs button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 18px;
}

.deadline-quick-workspace,
.deadline-workspace {
  min-width: 0;
  margin: 0 14px 14px;
  gap: 14px;
  background: transparent;
  overflow: auto;
}

.deadline-quick-workspace {
  grid-template-columns: minmax(420px, 0.82fr) minmax(460px, 1.18fr);
}

.deadline-workspace {
  grid-template-columns: minmax(430px, 0.88fr) minmax(450px, 1.12fr);
}

.deadline-panel {
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 255, 0.84));
  box-shadow: 0 16px 42px rgba(6, 26, 51, 0.06);
}

.deadline-info-box,
.deadline-inline-help {
  border-color: rgba(15, 76, 154, 0.13);
  border-left-color: var(--water-royal);
  background:
    radial-gradient(ellipse at 94% 0%, rgba(79, 195, 247, 0.12), transparent 42%),
    rgba(246, 251, 255, 0.92);
}

.deadline-kind-toggle {
  position: relative;
  border-color: rgba(10, 42, 79, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.deadline-kind-toggle input {
  display: none;
}

.deadline-kind-toggle label {
  border-radius: 999px;
  cursor: pointer;
}

.deadline-kind-toggle label:has(input:checked) {
  background: var(--water-gradient);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 76, 154, 0.16);
}

.deadline-summary-card,
.deadline-period-card,
.deadline-next-action,
.deadline-event,
.deadline-warning,
.deadline-subsection,
.deadline-line-card {
  border-color: rgba(10, 42, 79, 0.10);
  background: var(--deadline-panel-bg);
  box-shadow: 0 10px 26px rgba(6, 26, 51, 0.045);
}

.deadline-next-action.blue,
.deadline-period-card.blue,
.deadline-warning.blue,
.deadline-line-card.blue {
  border-left-color: var(--water-royal);
}

.deadline-period-card mark {
  background: rgba(232, 246, 255, 0.90);
  color: var(--water-navy);
}

.deadline-detail-drawer {
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  overflow: hidden;
}

.deadline-detail-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--water-navy);
  font-weight: 850;
  list-style: none;
}

.deadline-detail-drawer summary::-webkit-details-marker {
  display: none;
}

.deadline-detail-drawer summary small {
  color: rgba(10, 42, 79, 0.58);
  font-size: 12px;
  font-weight: 750;
}

.deadline-detail-drawer summary::after {
  content: "Ã…bn";
  padding: 5px 9px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 999px;
  background: rgba(232, 246, 255, 0.72);
  color: var(--water-royal);
  font-size: 11px;
}

.deadline-detail-drawer[open] summary::after {
  content: "Luk";
}

.deadline-detail-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

@media (max-width: 1180px) {
  .deadline-quick-workspace,
  .deadline-workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }
}

@media (max-width: 820px) {
  .deadline-header,
  .deadline-mode-tabs,
  .deadline-quick-workspace,
  .deadline-workspace {
    margin-inline: 10px;
  }

  .deadline-header {
    border-radius: 16px;
  }

  .deadline-mode-tabs {
    width: calc(100% - 20px);
    overflow-x: auto;
    justify-self: stretch;
  }

  .deadline-mode-tabs button {
    flex: 1 0 170px;
    padding-inline: 12px;
  }

  .deadline-form-grid,
  .deadline-summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .deadline-actions {
    flex-wrap: wrap;
  }
}

/* F5E correction: case process text and status colors must stay readable and consistent. */
.app-shell.case-view-active .case-office-process {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

.app-shell.case-view-active .case-process-chip {
  --case-chip-border: rgba(10, 42, 79, 0.08);
  --case-chip-bg: linear-gradient(180deg, rgba(249, 251, 253, 0.95), rgba(243, 247, 250, 0.78));
  --case-chip-title: rgba(10, 42, 79, 0.62);
  --case-chip-value: rgba(10, 42, 79, 0.50);
  width: 100%;
  max-width: none;
  grid-template-columns: minmax(104px, 0.46fr) minmax(0, 1fr);
  min-height: 24px;
  padding: 2px 8px;
  border-color: var(--case-chip-border);
  background: var(--case-chip-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.app-shell.case-view-active .case-process-chip strong {
  color: var(--case-chip-title);
  font-size: 9.5px;
}

.app-shell.case-view-active .case-process-chip small {
  color: var(--case-chip-value);
  font-size: 9.8px;
}

.app-shell.case-view-active .case-process-chip.tone-requested {
  --case-chip-border: rgba(30, 136, 229, 0.26);
  --case-chip-bg: linear-gradient(180deg, rgba(244, 251, 255, 0.98), rgba(225, 241, 252, 0.86));
  --case-chip-title: #0f4c9a;
  --case-chip-value: rgba(15, 76, 154, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-received,
.app-shell.case-view-active .case-process-chip.tone-done {
  --case-chip-border: rgba(23, 107, 91, 0.24);
  --case-chip-bg: linear-gradient(180deg, rgba(240, 250, 247, 0.98), rgba(225, 243, 238, 0.84));
  --case-chip-title: #176b5b;
  --case-chip-value: rgba(23, 107, 91, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-partial,
.app-shell.case-view-active .case-process-chip.tone-pending {
  --case-chip-border: rgba(168, 110, 18, 0.25);
  --case-chip-bg: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 244, 219, 0.84));
  --case-chip-title: #7b520f;
  --case-chip-value: rgba(123, 82, 15, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-blocked {
  --case-chip-border: rgba(152, 66, 55, 0.28);
  --case-chip-bg: linear-gradient(180deg, rgba(255, 247, 246, 0.98), rgba(255, 235, 232, 0.84));
  --case-chip-title: #8d2f28;
  --case-chip-value: rgba(141, 47, 40, 0.74);
}

.app-shell.case-view-active .case-process-chip.tone-unset,
.app-shell.case-view-active .case-process-chip.tone-requested,
.app-shell.case-view-active .case-process-chip.tone-received,
.app-shell.case-view-active .case-process-chip.tone-done,
.app-shell.case-view-active .case-process-chip.tone-partial,
.app-shell.case-view-active .case-process-chip.tone-pending,
.app-shell.case-view-active .case-process-chip.tone-blocked {
  border-color: var(--case-chip-border);
  background: var(--case-chip-bg);
}

.app-shell.case-view-active .case-process-chip.tone-unset strong,
.app-shell.case-view-active .case-process-chip.tone-requested strong,
.app-shell.case-view-active .case-process-chip.tone-received strong,
.app-shell.case-view-active .case-process-chip.tone-done strong,
.app-shell.case-view-active .case-process-chip.tone-partial strong,
.app-shell.case-view-active .case-process-chip.tone-pending strong,
.app-shell.case-view-active .case-process-chip.tone-blocked strong {
  color: var(--case-chip-title);
}

.app-shell.case-view-active .case-process-chip.tone-unset small,
.app-shell.case-view-active .case-process-chip.tone-requested small,
.app-shell.case-view-active .case-process-chip.tone-received small,
.app-shell.case-view-active .case-process-chip.tone-done small,
.app-shell.case-view-active .case-process-chip.tone-partial small,
.app-shell.case-view-active .case-process-chip.tone-pending small,
.app-shell.case-view-active .case-process-chip.tone-blocked small {
  color: var(--case-chip-value);
}

@media (min-width: 1181px) {
  .app-shell.case-view-active .case-office-head,
  .app-shell.case-view-active .case-office-row {
    grid-template-columns: minmax(220px, 1.18fr) minmax(116px, 0.54fr) minmax(200px, 1.02fr) minmax(280px, 1.24fr) minmax(76px, 0.34fr) minmax(112px, 0.48fr);
  }

  .app-shell.case-view-active .case-office-row {
    min-height: 96px;
  }

  .app-shell.case-view-active .case-office-table.is-dense .case-office-row {
    min-height: 92px;
  }
}

/* F5F: Paradigmer as a premium office folder library, not a metadata dashboard. */
.templates-view .templates-layout {
  grid-template-columns: minmax(268px, 300px) minmax(0, 1fr);
  background:
    radial-gradient(circle at 0 0, rgba(96, 190, 231, 0.14), transparent 330px),
    linear-gradient(180deg, rgba(247, 252, 255, 0.96), rgba(241, 247, 251, 0.88));
}

.templates-view .templates-layout.templates-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.templates-view .templates-layout.templates-sidebar-collapsed .templates-sidebar {
  display: none;
}

.templates-view .templates-main {
  grid-column: 2;
  background:
    radial-gradient(circle at 70% 0, rgba(79, 195, 247, 0.10), transparent 380px),
    transparent;
}

.templates-view .templates-layout.templates-sidebar-collapsed .templates-main {
  grid-column: 1;
}

.templates-view .templates-sidebar {
  grid-column: 1;
  border-right: 1px solid rgba(10, 42, 79, 0.10);
  border-left: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 248, 253, 0.82)),
    radial-gradient(circle at 0 0, rgba(96, 190, 231, 0.18), transparent 250px);
  padding: 14px 12px;
}

.templates-view .template-sidebar-heading {
  margin-bottom: 12px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.08);
}

.template-folder-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.template-folder-panel .mini-heading {
  padding: 0 7px;
  color: rgba(10, 42, 79, 0.58);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.template-folder-tree {
  display: grid;
  gap: 3px;
}

.template-folder-item {
  --folder-depth: 0;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px 6px calc(8px + (var(--folder-depth) * 13px));
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(10, 42, 79, 0.78);
  text-align: left;
  transition:
    transform 150ms var(--ease-premium),
    border-color 150ms var(--ease-premium),
    background 150ms var(--ease-premium),
    box-shadow 150ms var(--ease-premium);
}

.template-folder-item:hover {
  transform: translateX(1px);
  border-color: rgba(30, 136, 229, 0.16);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(6, 26, 51, 0.045);
}

.template-folder-item.active {
  border-color: rgba(30, 136, 229, 0.24);
  background:
    linear-gradient(90deg, rgba(232, 246, 255, 0.98), rgba(255, 255, 255, 0.78));
  box-shadow:
    inset 3px 0 0 var(--water-royal),
    0 10px 22px rgba(6, 26, 51, 0.055);
}

.template-folder-item span:not(.template-folder-icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
  font-size: 12.2px;
}

.template-folder-item small {
  color: rgba(71, 92, 118, 0.62);
  font-size: 10.5px;
  font-weight: 800;
}

.template-folder-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(232, 246, 255, 0.78);
  color: var(--water-royal);
}

.template-folder-icon svg {
  width: 14px;
  height: 14px;
}

.templates-view .template-stats-grid,
.templates-view .template-dashboard {
  margin-top: 12px;
}

.templates-view .template-sidebar-admin {
  margin-top: 14px;
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: none;
}

.templates-view .template-sidebar-admin > summary {
  border-radius: 13px;
}

.templates-view .templates-header {
  padding: 16px 20px 12px;
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.72);
}

.templates-view .templates-header h1 {
  color: var(--water-deep);
  font-size: 24px;
}

.templates-view .template-search-host {
  padding: 0 18px 14px;
}

.templates-view .template-library-search {
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 18px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.10), transparent 38%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 44px rgba(6, 26, 51, 0.055);
  padding: 12px;
}

.templates-view .template-search-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.templates-view .template-search-tools {
  grid-template-columns: minmax(170px, 220px) auto;
  justify-content: space-between;
}

.templates-view .template-search-row input,
.templates-view .template-search-row select {
  min-height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
}

.templates-view .template-quick-tracks {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.templates-view .template-quick-tracks::-webkit-scrollbar {
  display: none;
}

.templates-view .template-quick-tracks > span {
  flex: 0 0 auto;
  color: rgba(10, 42, 79, 0.54);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.templates-view .template-quick-chip {
  flex: 0 0 auto;
  border-color: rgba(30, 136, 229, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(10, 42, 79, 0.72);
  box-shadow: none;
}

.templates-view .template-quick-chip.active {
  background: linear-gradient(180deg, rgba(232, 246, 255, 0.98), rgba(214, 236, 250, 0.88));
  color: var(--water-deep);
}

.templates-view .template-filter-drawer {
  border-color: rgba(10, 42, 79, 0.08);
  background: rgba(248, 252, 255, 0.72);
}

.templates-view .templates-workspace {
  grid-template-columns: minmax(330px, 0.42fr) minmax(680px, 1.58fr);
  gap: 12px;
  padding: 0 18px 18px;
  background: transparent;
}

.templates-view .templates-layout.templates-sidebar-collapsed .templates-workspace {
  grid-template-columns: minmax(340px, 0.36fr) minmax(760px, 1.64fr);
}

.templates-view .template-results-panel,
.templates-view .template-detail-panel {
  border: 1px solid rgba(10, 42, 79, 0.09);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 255, 0.86));
  box-shadow: 0 20px 48px rgba(6, 26, 51, 0.065);
}

.templates-view .template-results-panel {
  padding: 13px;
}

.templates-view .template-detail-panel {
  padding: 14px;
}

.templates-view .template-section-title {
  min-height: 34px;
  margin-bottom: 8px;
}

.templates-view .template-section-title span {
  color: var(--water-deep);
}

.templates-view .template-section-title small {
  color: rgba(71, 92, 118, 0.66);
  font-size: 11px;
}

.templates-view .template-result-list {
  gap: 7px;
}

.templates-view .template-result-item {
  border-radius: 13px;
  box-shadow: none;
}

.templates-view .template-result-item.active {
  box-shadow:
    inset 3px 0 0 var(--water-royal),
    0 12px 26px rgba(6, 26, 51, 0.065);
}

.templates-view .template-open {
  padding: 10px 0 10px 10px;
}

.templates-view .template-result-top {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
}

.templates-view .template-result-top strong {
  font-size: 13.3px;
}

.templates-view .template-file-pill {
  min-width: 38px;
  min-height: 24px;
  font-size: 10px;
}

.templates-view .template-result-meta {
  display: grid;
  gap: 2px;
}

.templates-view .result-tags {
  gap: 5px;
}

.templates-view .result-tags .chip {
  border-color: rgba(30, 136, 229, 0.13);
  background: rgba(232, 246, 255, 0.72);
  color: rgba(10, 42, 79, 0.72);
}

.templates-view .template-detail-content {
  width: 100%;
  max-width: none;
}

.templates-view .template-detail-head,
.templates-view .template-use-strip,
.templates-view .template-document-viewer,
.templates-view .template-admin-details {
  border-radius: 17px;
}

.templates-view .template-detail-head h2 {
  font-size: clamp(18px, 1.55vw, 24px);
}

.templates-view .template-document-viewer {
  overflow: hidden;
}

.templates-view .template-preview-stage {
  min-height: 620px;
  background:
    linear-gradient(180deg, rgba(237, 246, 252, 0.62), rgba(255, 255, 255, 0.88));
}

.templates-view .template-document-frame {
  background: #fff;
}

@media (max-width: 1180px) {
  .templates-view .templates-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .templates-view .templates-sidebar {
    display: none;
  }

  .templates-view .templates-main {
    grid-column: 1;
  }

  .templates-view .templates-workspace,
  .templates-view .templates-layout.templates-sidebar-collapsed .templates-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .templates-view .template-search-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 1500px) {
  .templates-view .template-search-row {
    grid-template-columns: minmax(420px, 1fr) auto;
  }
}

/* F5I: Admin must be a scrollable office workbench, not stacked hidden panels. */
.admin-view .admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(79, 195, 247, 0.09), transparent 360px),
    linear-gradient(180deg, rgba(247, 252, 255, 0.94), rgba(241, 247, 251, 0.86));
}

.admin-view .admin-header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom-color: rgba(10, 42, 79, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.admin-view .admin-dashboard {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 14px 16px 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-view .admin-dashboard-metrics {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.admin-view .admin-metric-card,
.admin-view .admin-warning,
.admin-view .admin-panel,
.admin-view .admin-technical-details {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 255, 0.86));
  box-shadow: 0 16px 38px rgba(6, 26, 51, 0.055);
}

.admin-view .admin-grid {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(320px, 0.82fr) minmax(360px, 0.96fr);
  gap: 14px;
  margin: 14px 16px;
  background: transparent;
  overflow: visible;
}

.admin-view .admin-panel {
  min-height: 420px;
  max-height: none;
  overflow: visible;
  padding: 16px;
}

.admin-view .admin-audit-panel {
  max-height: 720px;
  overflow-y: auto;
}

.admin-view .admin-technical-details {
  margin: 0 16px 18px;
  overflow: hidden;
}

.admin-view .admin-technical-details > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  list-style: none;
}

.admin-view .admin-technical-details > summary::-webkit-details-marker {
  display: none;
}

.admin-view .admin-technical-details > summary div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-view .admin-technical-details > summary strong {
  color: var(--water-deep);
  font-size: 15px;
}

.admin-view .admin-technical-details > summary span,
.admin-view .admin-technical-details > summary small {
  color: rgba(71, 92, 118, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.admin-view .admin-technical-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.admin-view .admin-operations,
.admin-view .admin-quality {
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-view .admin-health-grid,
.admin-view .admin-quality-metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 1320px) {
  .admin-view .admin-dashboard-metrics,
  .admin-view .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-view .admin-panel,
  .admin-view .admin-audit-panel {
    max-height: none;
    overflow: visible;
  }
}

/* F5J: Analyseprofiler should feel like a calm legal work note, not a control panel. */
.profiles-view .profiles-layout {
  background:
    radial-gradient(circle at 0 0, rgba(96, 190, 231, 0.14), transparent 330px),
    linear-gradient(180deg, rgba(247, 252, 255, 0.96), rgba(241, 247, 251, 0.88));
}

.profiles-view .profiles-sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(240, 248, 253, 0.82)),
    radial-gradient(circle at 0 0, rgba(96, 190, 231, 0.16), transparent 250px);
  border-right-color: rgba(10, 42, 79, 0.10);
}

.profile-create-shell,
.profile-insight-composer {
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(247, 252, 255, 0.82));
  box-shadow: 0 12px 28px rgba(6, 26, 51, 0.045);
  overflow: hidden;
}

.profile-create-shell {
  margin-bottom: 12px;
}

.profile-create-shell > summary,
.profile-insight-composer > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  list-style: none;
}

.profile-create-shell > summary::-webkit-details-marker,
.profile-insight-composer > summary::-webkit-details-marker {
  display: none;
}

.profile-create-shell > summary strong,
.profile-insight-composer > summary strong {
  color: var(--water-deep);
  font-size: 13px;
}

.profile-create-shell > summary span,
.profile-insight-composer > summary span,
.profile-insight-composer > summary small {
  color: rgba(71, 92, 118, 0.72);
  font-size: 11.5px;
  font-weight: 740;
}

.profile-create-shell .profile-create,
.profile-insight-composer .insight-form {
  margin: 0;
  padding: 0 12px 12px;
}

.profiles-view .profile-main {
  background:
    radial-gradient(circle at 76% 0, rgba(79, 195, 247, 0.10), transparent 380px),
    transparent;
}

.profiles-view .profile-header {
  border-bottom-color: rgba(10, 42, 79, 0.08);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.profiles-view .profile-actions {
  flex-wrap: wrap;
  max-width: 760px;
}

.profiles-view .profile-actions .quiet-button,
.profiles-view .profile-actions select {
  flex: 0 0 auto;
  min-height: 34px;
}

.profiles-view .profile-actions .profile-visibility-select {
  width: 132px;
}

.profiles-view .profile-actions #profileContributorFilter {
  width: 260px;
  max-width: 100%;
}

.profiles-view .profile-mode-tabs {
  margin: 12px 18px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(242, 249, 255, 0.72));
  box-shadow: 0 14px 34px rgba(6, 26, 51, 0.045);
}

.profiles-view .profile-mode-tabs button {
  border-radius: 12px;
}

.profiles-view .profile-filter-context {
  align-self: start;
  margin: -2px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(24, 135, 214, 0.16);
  border-radius: 15px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.15), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 246, 255, 0.74));
  box-shadow: 0 12px 30px rgba(6, 26, 51, 0.045);
}

.profiles-view .profile-filter-context.hidden {
  display: none;
}

.profiles-view .profile-filter-context div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profiles-view .profile-filter-context strong {
  color: var(--water-deep);
  font-size: 12.5px;
  font-weight: 880;
}

.profiles-view .profile-filter-context span {
  color: rgba(10, 42, 79, 0.65);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.profiles-view .profile-workspace {
  gap: 12px;
  padding: 0 18px 18px;
  background: transparent;
}

.profiles-view .profile-panel {
  border: 1px solid rgba(10, 42, 79, 0.09);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 252, 255, 0.86));
  box-shadow: 0 20px 48px rgba(6, 26, 51, 0.06);
}

.profiles-view .profile-form-title {
  display: none;
}

.profiles-view .profile-report-panel {
  display: none !important;
}

/* F5J-C: Bidrag -> udledning -> sagsnotat workflow polish. */
.profiles-view .profile-annotation-list {
  gap: 12px;
}

.profiles-view .annotation-manager-summary {
  gap: 9px;
  padding: 12px;
  border-color: rgba(24, 135, 214, 0.13);
  border-radius: 17px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.12), transparent 45%),
    rgba(255, 255, 255, 0.80);
  box-shadow: 0 16px 36px rgba(6, 26, 51, 0.045);
}

.profiles-view .annotation-manager-summary article {
  min-height: 62px;
  border-color: rgba(10, 42, 79, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
}

.profiles-view .annotation-manager-summary strong {
  color: var(--water-deep);
  font-size: 19px;
}

.profiles-view .annotation-manager-summary span {
  color: rgba(10, 42, 79, 0.58);
}

.profiles-view .annotation-author-row span {
  border-color: rgba(24, 135, 214, 0.14);
  background: rgba(232, 246, 255, 0.66);
  color: var(--water-deep);
}

.profiles-view .annotation-item {
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.profiles-view .annotation-strip {
  width: 5px;
  min-height: 100%;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent),
    var(--note-color, var(--water-royal));
}

.profiles-view .annotation-content {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px 14px 13px 13px;
}

.profiles-view .annotation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profiles-view .annotation-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profiles-view .annotation-head strong {
  color: var(--water-deep);
  font-size: 13.5px;
  font-weight: 880;
}

.profiles-view .annotation-head span,
.profiles-view .annotation-head small {
  color: rgba(10, 42, 79, 0.56);
  font-size: 11.5px;
  font-weight: 720;
}

.profiles-view .annotation-content p {
  margin: 0;
  color: rgba(20, 36, 54, 0.82);
  font-size: 12.5px;
  line-height: 1.55;
}

.profiles-view .annotation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  opacity: 1;
}

.profiles-view .annotation-actions .primary-quiet {
  border-color: rgba(24, 135, 214, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 246, 255, 0.78));
  color: var(--water-deep);
  font-weight: 860;
}

.profiles-view .annotation-readonly {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 999px;
  color: rgba(10, 42, 79, 0.52);
  font-size: 11.5px;
  font-weight: 780;
}

.profiles-view .profile-insight-composer[open] {
  border-color: rgba(24, 135, 214, 0.22);
  box-shadow:
    0 18px 42px rgba(6, 26, 51, 0.07),
    inset 0 0 0 1px rgba(79, 195, 247, 0.08);
}

/* F9D-3: account access polish */
.auth-card {
  width: min(492px, 100%);
  gap: 18px;
}

.auth-note {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid rgba(24, 135, 214, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(246, 251, 255, 0.94), rgba(234, 246, 252, 0.76));
  color: var(--water-deep);
}

.auth-note strong {
  font-size: 14px;
  font-weight: 880;
}

.auth-note span {
  color: rgba(10, 42, 79, 0.68);
  font-size: 12.5px;
  line-height: 1.5;
}

.auth-link-button {
  width: max-content;
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--water-royal);
  font: inherit;
  font-size: 12.5px;
  font-weight: 820;
  cursor: pointer;
}

.auth-link-button:hover {
  color: var(--water-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.auth-error.success {
  color: #145f86;
}

.auth-error.muted {
  color: rgba(10, 42, 79, 0.66);
}

.account-password-panel {
  margin: 5px;
  border: 1px solid rgba(24, 135, 214, 0.13);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(248, 252, 255, 0.96), rgba(235, 247, 253, 0.82));
  overflow: hidden;
}

.account-password-panel > summary {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  color: var(--water-deep);
  cursor: pointer;
  list-style: none;
}

.account-password-panel > summary::-webkit-details-marker {
  display: none;
}

.account-password-panel > summary svg {
  width: 18px;
  height: 18px;
  color: var(--water-royal);
}

.account-password-panel > summary span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.account-password-panel > summary strong {
  font-size: 13px;
  font-weight: 860;
}

.account-password-panel > summary small {
  color: rgba(10, 42, 79, 0.57);
  font-size: 11px;
  font-weight: 720;
}

.account-password-form {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.account-password-form label {
  display: grid;
  gap: 5px;
  color: rgba(10, 42, 79, 0.68);
  font-size: 11px;
  font-weight: 820;
}

.account-password-form input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(10, 42, 79, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
}

.account-password-form small {
  min-height: 16px;
  color: var(--brick);
  font-size: 11.5px;
  font-weight: 760;
}

.account-password-form small.success {
  color: #145f86;
}

.profiles-view .issue-card,
.profiles-view .issue-insight,
.profiles-view .profile-doc-list article,
.profiles-view .profile-annotation-list article,
.profiles-view .insight-item {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
}

.profiles-view .profile-empty-notat {
  border-color: rgba(30, 136, 229, 0.20);
  border-radius: 16px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.12), transparent 40%),
    rgba(255, 255, 255, 0.84);
}

@media (max-width: 1320px) {
  .profiles-view .profile-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Reader workbench Retskilden polish */
.side-workbench {
  position: relative;
  isolation: isolate;
  border-left-color: rgba(10, 42, 79, 0.12);
  background:
    radial-gradient(ellipse at 50% -12%, rgba(79, 195, 247, 0.22), transparent 44%),
    repeating-radial-gradient(ellipse at 50% 0%, rgba(79, 195, 247, 0.09) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, rgba(246, 251, 255, 0.96), rgba(233, 246, 255, 0.86));
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.72),
    -12px 0 34px rgba(6, 26, 51, 0.045);
}

.side-workbench::before {
  content: "";
  position: sticky;
  top: 0;
  z-index: -1;
  display: block;
  height: 0;
  pointer-events: none;
  box-shadow: 0 34px 82px 58px rgba(255, 255, 255, 0.28);
}

.workbench-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-bottom-color: rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(235, 248, 255, 0.78));
  box-shadow:
    0 12px 28px rgba(6, 26, 51, 0.055),
    inset 0 -1px 0 rgba(255, 255, 255, 0.64);
}

.workbench-tabs button {
  min-width: 0;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(10, 42, 79, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.workbench-tabs button svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: currentColor;
}

.workbench-tabs button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-tabs button:hover {
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: var(--water-navy);
  box-shadow: 0 10px 24px rgba(6, 26, 51, 0.075);
}

.workbench-tabs button.active {
  border-color: rgba(15, 76, 154, 0.30);
  background: var(--water-gradient);
  color: #fff;
  box-shadow:
    0 14px 30px rgba(15, 76, 154, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.workbench-tab-panel.active {
  display: grid;
  gap: 12px;
}

.workbench-section {
  margin: 10px;
  padding: 12px;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 18px;
  background:
    radial-gradient(circle at 96% 0%, rgba(79, 195, 247, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 251, 255, 0.78));
  box-shadow:
    0 16px 42px rgba(6, 26, 51, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.workbench-section + .workbench-section {
  margin-top: 0;
}

.side-workbench .section-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.08);
  color: var(--water-deep);
}

.side-workbench .section-title svg {
  color: var(--water-royal);
}

.annotation-manager,
.profile-bridge-card,
.source-status-card,
.citator-relation-group,
.citator-item,
.passage-composer {
  border-color: rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 251, 255, 0.78));
  box-shadow:
    0 12px 30px rgba(6, 26, 51, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.70);
}

.annotation-manager {
  padding: 10px;
  border-radius: 15px;
}

.annotation-manager-head strong {
  color: var(--water-deep);
  letter-spacing: 0.03em;
}

.annotation-manager-head span {
  color: rgba(10, 42, 79, 0.58);
}

.annotation-manager button {
  min-height: 32px;
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.62);
}

.annotation-manager button.active {
  border-color: rgba(30, 136, 229, 0.26);
  background: rgba(232, 246, 255, 0.90);
  color: var(--water-navy);
  box-shadow:
    inset 0 0 0 1px rgba(79, 195, 247, 0.12),
    0 8px 20px rgba(15, 76, 154, 0.08);
}

.passage-empty {
  border: 1px dashed rgba(30, 136, 229, 0.22);
  border-radius: 14px;
  background:
    repeating-radial-gradient(ellipse at 50% 0%, rgba(79, 195, 247, 0.08) 0 1px, transparent 1px 36px),
    rgba(255, 255, 255, 0.68);
  color: rgba(10, 42, 79, 0.58);
}

.passage-composer {
  border-radius: 16px;
}

.passage-composer-actions .quiet-button,
.passage-composer > .quiet-button,
.bridge-secondary-action {
  border-color: rgba(10, 42, 79, 0.11);
  background: rgba(255, 255, 255, 0.74);
  color: var(--water-navy);
}

.passage-composer-actions .quiet-button:hover,
.passage-composer > .quiet-button:hover,
.bridge-secondary-action:hover {
  border-color: rgba(30, 136, 229, 0.25);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(6, 26, 51, 0.075);
}

.note-color-option {
  border-color: rgba(10, 42, 79, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.note-color-option span {
  border-radius: 10px;
}

.note-color-option:has(input:checked) {
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--note-choice) 14%, transparent),
    0 10px 22px rgba(6, 26, 51, 0.06);
}

.profile-bridge-card {
  padding: 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at right top, rgba(79, 195, 247, 0.18), transparent 44%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(226, 244, 255, 0.76));
}

.profile-bridge-card strong {
  color: var(--water-deep);
}

.profile-bridge-card span {
  color: rgba(10, 42, 79, 0.62);
}

.source-status-card {
  border-left-width: 0;
  border-radius: 18px;
  overflow: hidden;
}

.source-status-card::before {
  content: "";
  display: block;
  height: 3px;
  margin: -10px -10px 2px;
  background: linear-gradient(90deg, var(--water-royal), rgba(79, 195, 247, 0.28), transparent);
}

.source-status-card.very-high,
.source-status-card.high,
.source-status-card.medium,
.source-status-card.low {
  border-color: rgba(10, 42, 79, 0.10);
}

.source-status-verdict,
.source-status-verdict.stable,
.source-status-verdict.linked,
.source-status-verdict.watch {
  border-color: rgba(30, 136, 229, 0.16);
  border-left-color: rgba(30, 136, 229, 0.70);
  background: rgba(232, 246, 255, 0.62);
}

.source-status-metrics span,
.source-hierarchy span {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.74);
}

.source-status-metrics strong,
.source-hierarchy span.active {
  color: var(--water-deep);
}

.source-hierarchy span.active {
  border-color: rgba(30, 136, 229, 0.28);
  background: rgba(232, 246, 255, 0.88);
}

.source-hierarchy i {
  background: rgba(30, 136, 229, 0.10);
}

.citator-relation-group {
  border-left-width: 0;
  border-radius: 16px;
}

.citator-relation-group.watch,
.citator-relation-group.linked,
.citator-relation-group.stable {
  border-color: rgba(10, 42, 79, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 251, 255, 0.78));
}

.citator-group-head em {
  border-color: rgba(30, 136, 229, 0.20);
  background: rgba(232, 246, 255, 0.78);
  color: var(--water-navy);
}

.citator-item {
  border-radius: 13px;
}

.citator-item.watch,
.citator-item.linked,
.citator-item.stable {
  border-color: rgba(30, 136, 229, 0.16);
}

.citator-title:hover {
  color: var(--water-royal);
}

.citation-context-details summary {
  border-color: rgba(10, 42, 79, 0.10);
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.58);
}

.citation-context-details[open] summary {
  border-color: rgba(30, 136, 229, 0.24);
  background: rgba(232, 246, 255, 0.86);
  color: var(--water-navy);
}

/* Kilder: legal compass polish */
.source-status-card {
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
}

.source-status-card::before {
  height: 4px;
  margin: -12px -12px 2px;
  background:
    linear-gradient(90deg, rgba(15, 76, 154, 0.92), rgba(79, 195, 247, 0.55), rgba(232, 246, 255, 0));
}

.source-status-head {
  align-items: center;
}

.source-status-head span {
  color: rgba(10, 42, 79, 0.58);
  font-size: 10px;
}

.source-status-head strong {
  color: var(--water-deep);
  font-size: 15px;
  line-height: 1.22;
}

.source-status-head em {
  max-width: 150px;
  border-color: rgba(30, 136, 229, 0.18);
  background: rgba(255, 255, 255, 0.76);
  color: var(--water-navy);
  font-size: 10.5px;
  text-align: center;
}

.source-passport-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.source-passport-grid span {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(10, 42, 79, 0.09);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0%, rgba(79, 195, 247, 0.12), transparent 48%),
    rgba(255, 255, 255, 0.68);
  color: rgba(10, 42, 79, 0.70);
  font-size: 11.5px;
  font-weight: 740;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.source-passport-grid b {
  display: block;
  margin-bottom: 2px;
  color: rgba(10, 42, 79, 0.42);
  font-size: 8.7px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.source-status-body {
  padding: 1px 2px;
  color: rgba(10, 42, 79, 0.68);
  font-size: 12.2px;
}

.source-status-verdict,
.source-status-verdict.stable,
.source-status-verdict.linked,
.source-status-verdict.watch,
.source-status-verdict.quiet {
  position: relative;
  padding: 9px 10px;
  border-left-width: 0;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.80), rgba(232, 246, 255, 0.58));
}

.source-status-verdict::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 3px;
  border-radius: 99px;
  background: rgba(30, 136, 229, 0.66);
}

.source-status-verdict.watch::before {
  background: #d8a520;
}

.source-status-verdict.stable::before {
  background: rgba(30, 136, 229, 0.66);
}

.source-status-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.source-status-metrics span {
  padding: 7px 8px;
  border-radius: 13px;
  overflow-wrap: anywhere;
  font-size: 9.8px;
  text-align: left;
}

.source-status-metrics strong {
  margin-bottom: 1px;
  color: var(--water-deep);
  font-size: 15px;
}

.source-hierarchy {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0;
  row-gap: 5px;
  overflow: visible;
  min-height: 35px;
  padding: 4px 1px 6px;
}

.source-hierarchy::before {
  display: none;
}

.source-hierarchy .source-hierarchy-step {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 3px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(10, 42, 79, 0.47);
  transform: translateY(calc((var(--step-index, 0) - 3) * 0.7px));
}

.source-hierarchy .source-hierarchy-step b {
  min-width: 0;
  color: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.source-hierarchy .source-hierarchy-step i {
  display: none;
}

.source-hierarchy .source-hierarchy-step.active {
  border-color: rgba(30, 136, 229, 0.20);
  background:
    linear-gradient(135deg, rgba(15, 76, 154, 0.96), rgba(30, 136, 229, 0.86));
  color: #fff;
  padding-inline: 8px;
  box-shadow:
    0 9px 18px rgba(15, 76, 154, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.source-hierarchy .source-hierarchy-step.active i {
  display: none;
}

.source-hierarchy-divider {
  flex: 0 0 auto;
  margin: 0 4px;
  color: rgba(30, 136, 229, 0.38);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.citator-relation-group {
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
}

.citator-relation-group.watch {
  background:
    radial-gradient(circle at 100% 0%, rgba(216, 165, 32, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 251, 255, 0.78));
}

.citator-group-head {
  align-items: center;
}

.citator-group-head strong {
  color: var(--water-deep);
  font-size: 13px;
}

.citator-group-head span {
  color: rgba(10, 42, 79, 0.56);
}

.citator-group-head em {
  min-width: 28px;
  height: 28px;
}

.citator-group-items {
  gap: 6px;
}

.citator-item {
  gap: 5px;
  padding: 10px;
  border-radius: 15px;
}

.citator-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.citator-item-head > strong {
  min-width: 0;
  color: var(--water-deep);
  font-size: 12.8px;
  line-height: 1.3;
}

.citator-title {
  min-width: 0;
  color: var(--water-deep);
  font-size: 12.8px;
  line-height: 1.3;
}

.relation-pill {
  align-self: start;
  justify-self: end;
  max-width: 128px;
  border-color: rgba(30, 136, 229, 0.16);
  background: rgba(232, 246, 255, 0.78);
  color: var(--water-navy);
  font-size: 10.4px;
  line-height: 1.2;
  text-align: center;
}

.citator-meta {
  color: rgba(10, 42, 79, 0.54);
  font-size: 11.8px;
  line-height: 1.35;
}

.citation-context-details {
  margin-top: 2px;
}

.citation-context-details summary {
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
}

.citation-context-details summary::after {
  content: " +";
  margin-left: 4px;
  color: rgba(30, 136, 229, 0.72);
}

.citation-context-details[open] summary::after {
  content: " -";
}

.citator-context {
  padding: 8px 9px;
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  color: rgba(10, 42, 79, 0.70);
  font-size: 12.2px;
  line-height: 1.52;
}

/* F5K-3A: Kildeautoritet as one calm status line */
.source-status-card {
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
}

.source-status-card::before {
  display: none;
}

.source-authority-statusline {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid rgba(30, 136, 229, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 195, 247, 0.18), transparent 38%),
    linear-gradient(135deg, rgba(232, 246, 255, 0.96), rgba(255, 255, 255, 0.76));
  color: rgba(10, 42, 79, 0.72);
  box-shadow:
    0 12px 26px rgba(6, 26, 51, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.source-authority-statusline strong {
  color: var(--water-deep);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.source-authority-statusline span {
  color: rgba(10, 42, 79, 0.68);
  font-size: 11.6px;
  font-weight: 760;
  line-height: 1.2;
}

.source-authority-statusline i {
  color: rgba(30, 136, 229, 0.48);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.source-authority-orb {
  display: none;
}

.source-authority-line-text {
  min-width: 0;
  color: rgba(10, 42, 79, 0.68);
  font-size: 10.9px;
  font-weight: 760;
  line-height: 1.35;
}

.source-authority-line-text strong {
  color: var(--water-deep);
  font-size: inherit;
  font-weight: 880;
}

.source-passport-details {
  border: 1px solid rgba(10, 42, 79, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.46);
}

.source-passport-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 6px 10px;
  color: rgba(10, 42, 79, 0.58);
  cursor: pointer;
  font-size: 11px;
  font-weight: 820;
  list-style: none;
}

.source-passport-details > summary::-webkit-details-marker {
  display: none;
}

.source-passport-details > summary::after {
  content: "+";
  display: inline-grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(30, 136, 229, 0.16);
  border-radius: 999px;
  background: rgba(232, 246, 255, 0.76);
  color: var(--water-navy);
  font-weight: 900;
}

.source-passport-details[open] > summary {
  color: var(--water-navy);
}

.source-passport-details[open] > summary::after {
  content: "-";
}

.source-passport-content {
  display: grid;
  gap: 9px;
  padding: 0 9px 10px;
}

/* F5K-3C: Citator vigtigst foerst, compact cards and folded context */
.citator-conclusion-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid rgba(30, 136, 229, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 195, 247, 0.16), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(232, 246, 255, 0.72));
  box-shadow: 0 12px 26px rgba(6, 26, 51, 0.06);
}

.citator-conclusion-card::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 99px;
  background: rgba(30, 136, 229, 0.66);
}

.citator-conclusion-card.watch::before {
  background: #d8a520;
}

.citator-conclusion-card.linked::before {
  background: rgba(15, 76, 154, 0.82);
}

.citator-conclusion-card > div:first-child {
  min-width: 0;
  padding-left: 2px;
}

.citator-conclusion-card span {
  display: block;
  margin-bottom: 2px;
  color: rgba(10, 42, 79, 0.46);
  font-size: 9.6px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.citator-conclusion-card strong {
  display: block;
  color: var(--water-deep);
  font-size: 12.8px;
  font-weight: 880;
  line-height: 1.22;
}

.citator-conclusion-card p {
  margin: 4px 0 0;
  color: rgba(10, 42, 79, 0.66);
  font-size: 11.6px;
  font-weight: 650;
  line-height: 1.36;
}

.citator-conclusion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.citator-conclusion-chips em {
  min-height: 22px;
  padding: 4px 7px;
  border: 1px solid rgba(30, 136, 229, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(10, 42, 79, 0.58);
  font-size: 10px;
  font-style: normal;
  font-weight: 780;
  line-height: 1.2;
}

.citator-relation-group {
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
}

.citator-group-head {
  gap: 8px;
}

.citator-group-head strong {
  font-size: 12.6px;
}

.citator-group-head span {
  font-size: 11.2px;
  line-height: 1.3;
}

.citator-group-head em {
  min-width: 26px;
  height: 26px;
  font-size: 11px;
}

.citator-item {
  gap: 4px;
  padding: 8px 9px;
  border-radius: 14px;
}

.citator-title,
.citator-item-head > strong {
  font-size: 12.2px;
  line-height: 1.26;
}

.relation-pill {
  max-width: 112px;
  padding: 4px 7px;
  font-size: 9.8px;
}

.citator-meta {
  font-size: 11.2px;
  line-height: 1.28;
}

.citation-context-details summary {
  min-height: 22px;
  padding: 0 8px;
  font-size: 10.5px;
}

/* F5K-3D: Kilder-panelet skal laeses som en rolig rail, ikke som smalle visitkort. */
.citator-summary {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.citator-conclusion-card {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  gap: 9px;
  padding: 12px 12px 12px 14px;
  border-radius: 18px;
}

.citator-conclusion-card::before {
  inset: 13px auto 13px 0;
}

.citator-conclusion-card > div:first-child {
  padding-left: 4px;
}

.citator-conclusion-card span {
  margin-bottom: 4px;
  font-size: 10px;
}

.citator-conclusion-card strong {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.18;
}

.citator-conclusion-card p {
  max-width: 38ch;
  font-size: 12px;
  line-height: 1.42;
}

.citator-conclusion-chips {
  gap: 6px;
}

.citator-conclusion-chips em {
  max-width: 100%;
  min-height: 23px;
  padding: 5px 8px;
  font-size: 10.2px;
  line-height: 1.15;
}

.side-workbench .source-authority-statusline {
  min-height: auto;
  padding: 8px 10px;
}

.side-workbench .source-authority-line-text {
  line-height: 1.28;
}

.side-workbench .source-hierarchy {
  min-height: auto;
  row-gap: 4px;
  padding: 3px 0 5px;
}

.side-workbench .source-hierarchy .source-hierarchy-step {
  min-height: 21px;
  padding: 2px 2px;
  transform: none;
}

.side-workbench .source-hierarchy .source-hierarchy-step b {
  max-width: 58px;
  overflow: hidden;
  font-size: 9.4px;
  text-overflow: ellipsis;
}

.side-workbench .source-hierarchy .source-hierarchy-step.active {
  padding-inline: 7px;
}

.side-workbench .source-hierarchy-divider {
  margin: 0 2px;
  font-size: 10px;
}

/* F7R-2: Orbis-level company passport */
.company-pass {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(8, 38, 77, 0.14);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% -20%, rgba(66, 158, 213, 0.20), transparent 38%),
    radial-gradient(circle at 86% 6%, rgba(7, 71, 135, 0.10), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 252, 0.88) 58%, rgba(232, 243, 249, 0.92));
  box-shadow: 0 20px 54px rgba(16, 42, 67, 0.11);
}

.company-pass::before {
  content: "";
  position: absolute;
  inset: auto -8% -70px 8%;
  height: 132px;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(47, 111, 159, 0.14), transparent 58%);
  opacity: 0.86;
}

.company-pass.red {
  border-color: rgba(142, 49, 32, 0.28);
  background:
    radial-gradient(circle at 10% -20%, rgba(168, 67, 42, 0.18), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(47, 111, 159, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fafb 56%, #fff1ed);
}

.company-pass.yellow {
  border-color: rgba(168, 110, 18, 0.24);
  background:
    radial-gradient(circle at 10% -20%, rgba(168, 110, 18, 0.13), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(47, 111, 159, 0.10), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fafb 56%, #fff8ea);
}

.company-pass.amber {
  border-color: rgba(168, 110, 18, 0.22);
  background:
    radial-gradient(circle at 10% -20%, rgba(168, 110, 18, 0.11), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(47, 111, 159, 0.11), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fafb 56%, #fff8ea);
}

.company-pass.slate {
  border-color: rgba(89, 105, 118, 0.20);
  background:
    radial-gradient(circle at 10% -20%, rgba(47, 111, 159, 0.13), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(89, 105, 118, 0.08), transparent 34%),
    linear-gradient(135deg, #ffffff, #f7fafb 56%, #eef4f7);
}

.company-pass-rail {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(8, 38, 77, 0.10);
}

.company-pass-rail div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.company-pass-rail span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.company-pass-rail strong {
  color: var(--brand-navy);
  font-size: 13px;
  font-weight: 850;
}

.company-pass-rail small {
  min-width: 0;
  color: #52615f;
  font-size: 12px;
  font-weight: 680;
}

.company-pass-rail-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 7px;
}

.company-pass-rail-meta small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(8, 38, 77, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #34423f;
  font-size: 11.5px;
  line-height: 1.2;
}

.company-pass-rail-meta b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-pass-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(310px, 0.88fr) minmax(430px, 1.12fr);
  gap: 15px;
}

.company-pass-source {
  position: relative;
  z-index: 1;
  width: fit-content;
  color: #425b73;
  font-size: 11px;
}

.company-pass-source summary {
  width: fit-content;
  min-height: 28px;
  padding: 4px 2px;
  cursor: pointer;
  color: inherit;
  font-weight: 720;
  line-height: 20px;
}

.company-pass-source summary:hover {
  color: var(--source-blue);
}

.company-pass-source summary:focus-visible {
  outline: 2px solid #0f4c9a;
  outline-offset: 3px;
  border-radius: 3px;
}

.company-pass-source > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(8, 38, 77, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #3e566d;
}

.company-pass-source strong {
  color: #754c08;
}

.company-pass-identity {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.company-pass-statusline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.company-pass-status,
.company-pass-critical {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.company-pass-status {
  border: 1px solid rgba(47, 111, 159, 0.22);
  background: rgba(238, 245, 250, 0.92);
  color: #12375e;
}

.company-pass-status.green {
  border-color: rgba(23, 107, 91, 0.24);
  background: rgba(228, 241, 236, 0.94);
  color: #0f594d;
}

.company-pass-status.yellow {
  border-color: rgba(168, 110, 18, 0.26);
  background: rgba(255, 248, 234, 0.96);
  color: #754c08;
}

.company-pass-status.amber,
.company-pass-critical.amber {
  border-color: rgba(168, 110, 18, 0.26);
  background: rgba(255, 248, 234, 0.96);
  color: #754c08;
}

.company-pass-status.slate,
.company-pass-critical.slate {
  border-color: rgba(89, 105, 118, 0.22);
  background: rgba(240, 245, 248, 0.92);
  color: #42505d;
}

.company-pass-status.red,
.company-pass-critical {
  border-color: rgba(142, 49, 32, 0.34);
  background: linear-gradient(180deg, #fff2ee, #ffe7df);
  color: #8e3120;
}

.company-pass-critical.red {
  border-color: rgba(142, 49, 32, 0.34);
  background: linear-gradient(180deg, #fff2ee, #ffe7df);
  color: #8e3120;
}

.company-pass-critical {
  box-shadow: 0 8px 18px rgba(142, 49, 32, 0.10);
}

.company-pass-critical.muted {
  border-color: rgba(168, 110, 18, 0.28);
  background: #fff8ea;
  color: #735012;
  box-shadow: none;
}

.company-pass-identity > strong {
  color: var(--brand-navy);
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.3vw, 38px);
  line-height: 1.02;
  letter-spacing: 0;
}

.company-pass-identity p {
  max-width: 62ch;
  margin: 0;
  color: #2f3f3d;
  font-size: 14px;
  line-height: 1.48;
}

.company-pass-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.company-pass-facts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 9px;
  border: 1px solid rgba(8, 38, 77, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #34423f;
  font-size: 12px;
  font-weight: 740;
  line-height: 1.25;
}

.company-pass-facts b {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  text-transform: uppercase;
}

.company-pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.company-pass-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.company-pass-metric {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(8, 38, 77, 0.10);
  border-left: 3px solid color-mix(in srgb, var(--relation-accent, #2f6f9f) 76%, transparent);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.055);
}

.company-pass-metric span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 900;
}

.company-pass-metric strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--brand-navy);
  font-size: 16px;
  line-height: 1.2;
}

.company-pass-metric small {
  min-width: 0;
  color: #5a6966;
  font-size: 12px;
  line-height: 1.35;
}

.company-pass-change {
  grid-column: 1 / -1;
}

.company-group-gaps {
  border-color: rgba(8, 38, 77, 0.10);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(239, 247, 251, 0.62));
}

.company-group-gaps span {
  color: #52615f;
}

@media (max-width: 1120px) {
  .company-pass-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .company-pass {
    padding: 13px;
  }

  .company-pass-rail {
    align-items: flex-start;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .company-pass-rail-meta {
    justify-content: flex-start;
  }

  .company-pass-metrics {
    grid-template-columns: 1fr;
  }
}

/* F7R-15A: Cytoscape graph engine. Keep this late so legacy SVG graph rules
   cannot shrink the interactive canvas. */
.company-graph.company-graph--cytoscape {
  min-height: 0;
  height: auto;
  border-color: rgba(47, 111, 159, 0.16);
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 18%, rgba(47, 111, 159, 0.12), transparent 34%),
    radial-gradient(circle at 78% 72%, rgba(127, 183, 214, 0.13), transparent 38%),
    linear-gradient(180deg, #ffffff, #f7fbfd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 18px 44px rgba(16, 42, 67, 0.07);
}

.company-graph.company-graph--cytoscape .company-cytoscape-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 650px;
  min-height: 0;
}

.company-graph.company-graph--cytoscape .company-cytoscape-body,
.company-graph.company-graph--cytoscape .company-cytoscape-canvas {
  min-height: 0;
}

.company-graph.company-graph--cytoscape .company-cytoscape-body {
  grid-template-columns: minmax(560px, 1fr);
}

.company-graph.company-graph--cytoscape .company-cytoscape-body.has-inspector {
  grid-template-columns: minmax(560px, 1fr) minmax(220px, 248px);
}

.company-graph.company-graph--cytoscape .company-cytoscape-canvas {
  height: 100%;
}

.company-graph.company-graph--cytoscape .company-cytoscape-inspector {
  min-height: 0;
  align-self: start;
  justify-content: flex-start;
  max-height: 260px;
  overflow: auto;
}

/* F7R-27H: keep the CVR relation graph in the first desktop/laptop viewport.
   The relation summary stays available, but the structure itself must not be
   pushed below the fold by repeated meta panels. */
#companyPanelNetwork .company-large-structure-brief.premium-relation-intel {
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
}

#companyPanelNetwork .premium-relation-intel-head {
  gap: 10px;
}

#companyPanelNetwork .premium-relation-intel-head small {
  display: none;
}

#companyPanelNetwork .premium-relation-intel-grid {
  display: none;
}

#companyPanelNetwork .premium-relation-intel-card {
  min-height: 58px;
  padding: 7px 9px;
}

#companyPanelNetwork .premium-relation-intel-card small {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  overflow: hidden;
}

#companyPanelNetwork .company-graph-shell {
  gap: 7px;
  padding: 10px;
}

#companyPanelNetwork .company-graph-shell-head small {
  display: none;
}

#companyPanelNetwork .company-graph-summary.is-large-company .company-graph-summary-card {
  min-height: 38px;
  padding: 6px 10px;
}

#companyPanelNetwork .company-graph-summary {
  display: none;
}

#companyPanelNetwork .company-graph-note.compact {
  display: none;
}

#companyPanelNetwork .company-cytoscape-toolbar {
  padding: 7px 9px;
}

#companyPanelNetwork .company-cytoscape-keyhint {
  display: none;
}

/* F7R-28: final CVR polish. Keep the accepted architecture intact, but make
   the company lookup read less like internal metadata and more like a calm
   legal source surface. */
.company-tab:focus-visible,
.company-graph-mode button:focus-visible,
.company-graph-layer:focus-visible,
.company-inline-action:focus-visible,
.company-report-open:focus-visible,
.company-report-download:focus-visible,
.company-source-disclosure summary:focus-visible,
.company-document-source-disclosure summary:focus-visible {
  outline: none;
  border-color: rgba(15, 76, 154, 0.38);
  box-shadow:
    0 0 0 3px rgba(79, 195, 247, 0.16),
    0 10px 22px rgba(15, 76, 154, 0.10);
}

.company-tab:hover {
  transform: translateY(-1px);
}

/* Online QA 2026-07-13: annual-report actions must never render as blank pills. */
#companyPanelAccounts .company-report-actions .company-report-open,
#companyPanelAccounts .company-report-actions .company-report-download {
  border: 1px solid rgba(15, 76, 154, 0.24);
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-navy);
  box-shadow: 0 7px 18px rgba(15, 76, 154, 0.08);
}

#companyPanelAccounts .company-report-actions .company-report-open {
  background: linear-gradient(180deg, #f7fcff 0%, #e8f5fb 100%);
  color: #0b4f8f;
}

#companyPanelAccounts .company-report-actions .company-report-download {
  border-color: rgba(15, 76, 154, 0.30);
  color: #0f5ea8;
}

#companyPanelAccounts .company-report-actions .company-report-open:hover,
#companyPanelAccounts .company-report-actions .company-report-download:hover {
  border-color: rgba(15, 76, 154, 0.42);
  background: linear-gradient(180deg, #ffffff 0%, #dff1fb 100%);
  color: var(--brand-navy);
  transform: translateY(-1px);
}

.company-tab.active {
  background: linear-gradient(135deg, #0b315f 0%, #1266ad 58%, #3da6d6 100%);
}

.company-cytoscape-toolbar {
  border-color: rgba(47, 111, 159, 0.10);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.company-cytoscape-toolbar span,
.company-cytoscape-inspector span,
.company-graph-summary-card span,
.company-source-passport-card span,
.company-source-legal-grid > article > span,
.company-risk-overview span,
.company-risk-overview-metrics span,
.company-risk-support summary span,
.company-lawyer-summary-main > span,
.company-lawyer-next > span,
.company-lawyer-card > span,
.company-pass-rail span,
.company-pass-rail-meta b,
.company-pass-metric span {
  letter-spacing: 0;
  text-transform: none;
}

.company-risk-overview span,
.company-risk-overview-metrics span,
.company-risk-support summary span,
.company-lawyer-summary-main > span,
.company-lawyer-next > span,
.company-lawyer-card > span,
.company-pass-rail span,
.company-pass-rail-meta b,
.company-pass-metric span {
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 780;
}

.company-cytoscape-toolbar span,
.company-cytoscape-inspector span {
  color: rgba(8, 38, 77, 0.58);
  font-size: 11px;
  font-weight: 780;
}

.company-graph-layerbar {
  border-color: rgba(47, 111, 159, 0.10);
  background: rgba(255, 255, 255, 0.58);
}

.company-graph-layer {
  font-weight: 760;
}

.company-graph-layer.active,
.company-graph-layer[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(236, 248, 254, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.company-source-passport-card {
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.company-source-passport-card p {
  max-width: 720px;
  margin-top: 4px;
}

.company-report-availability {
  max-width: 150px;
  justify-content: center;
  white-space: normal;
  text-align: center;
  line-height: 1.15;
}

/* F7R status correction: insolvency must read as critical in overview, not
   as a soft warning. Keep it calm, but unmistakable. */
.company-pass.red {
  border-color: rgba(137, 35, 24, 0.42);
  background:
    radial-gradient(circle at 10% -18%, rgba(160, 45, 32, 0.24), transparent 38%),
    radial-gradient(circle at 88% 2%, rgba(47, 111, 159, 0.09), transparent 34%),
    linear-gradient(135deg, #ffffff, #f8fafb 52%, #ffebe5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    0 24px 58px rgba(94, 31, 24, 0.10);
}

.company-pass-status.red,
.company-pass-critical.red {
  border-color: rgba(137, 35, 24, 0.42);
  background: linear-gradient(180deg, #ffece6, #ffdcd2);
  color: #7f2419;
}

.company-pass.red .company-pass-identity > strong {
  color: #08264d;
}

.company-result-status.red {
  border-color: rgba(137, 35, 24, 0.34);
  background: #ffe6df;
  color: #7f2419;
}

.company-lookup-banner.red,
.company-status-panel.red {
  border-left-color: #982f24;
}

@media (max-width: 1120px) {
  .company-graph.company-graph--cytoscape .company-cytoscape-frame {
    height: auto;
    min-height: 620px;
  }

  .company-graph.company-graph--cytoscape .company-cytoscape-body {
    grid-template-columns: 1fr;
    min-height: 520px;
  }

  .company-graph.company-graph--cytoscape .company-cytoscape-body.has-inspector {
    grid-template-columns: 1fr;
  }

  .company-structure-route {
    grid-template-columns: 1fr;
  }

  .company-structure-route-item + .company-structure-route-item {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid rgba(47, 111, 159, 0.10);
    border-left: 0;
  }

  .company-graph.company-graph--cytoscape .company-cytoscape-canvas {
    min-height: 430px;
  }

  .company-graph.company-graph--cytoscape .company-cytoscape-inspector {
    min-height: auto;
  }
}

/* Commercial access control - sale-ready admin layer */
.admin-view .commercial-panel {
  grid-column: 1 / -1;
  background:
    radial-gradient(circle at 12% 8%, rgba(72, 158, 210, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 248, 253, 0.9));
  border-color: rgba(105, 163, 198, 0.32);
  box-shadow: 0 24px 70px rgba(11, 52, 87, 0.11);
}

.admin-panel-intro {
  margin: -0.2rem 0 1rem;
  max-width: 760px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.commercial-create {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid rgba(105, 163, 198, 0.26);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.commercial-form-grid,
.commercial-license-form,
.commercial-member-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.commercial-form-grid input,
.commercial-form-grid select,
.commercial-license-form input,
.commercial-license-form select,
.commercial-member-form select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(105, 163, 198, 0.28);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 0.62rem 0.72rem;
  font: inherit;
}

.commercial-module-picker,
.commercial-module-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.commercial-module-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 36px;
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(105, 163, 198, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted-strong);
  font-weight: 750;
  font-size: 0.82rem;
}

.commercial-module-chip.enabled,
.commercial-module-chip:has(input:checked) {
  border-color: rgba(35, 112, 168, 0.42);
  background: linear-gradient(135deg, rgba(230, 246, 255, 0.98), rgba(255, 255, 255, 0.88));
  color: var(--source-blue-dark);
  box-shadow: 0 10px 26px rgba(31, 101, 147, 0.09);
}

.commercial-customer-list {
  display: grid;
  gap: 0.95rem;
  margin-top: 1rem;
}

.commercial-customer-card {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(105, 163, 198, 0.26);
  border-radius: 20px;
  background:
    radial-gradient(circle at 94% 10%, rgba(86, 169, 214, 0.1), transparent 28%),
    rgba(255, 255, 255, 0.84);
}

.commercial-customer-head,
.commercial-license-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.commercial-customer-head strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.28rem;
}

.commercial-customer-head small,
.commercial-license-line,
.commercial-member-list {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.commercial-kicker {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--source-blue);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.commercial-status-stack {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
  min-width: 130px;
}

.commercial-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(105, 163, 198, 0.28);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.commercial-status.green {
  border-color: rgba(42, 154, 111, 0.34);
  color: #116247;
  background: rgba(229, 249, 241, 0.9);
}

.commercial-status.blue {
  border-color: rgba(46, 129, 194, 0.34);
  color: var(--source-blue-dark);
  background: rgba(229, 245, 255, 0.92);
}

.commercial-status.yellow {
  border-color: rgba(194, 143, 36, 0.34);
  color: #806019;
  background: rgba(255, 248, 225, 0.9);
}

.commercial-status.red {
  border-color: rgba(184, 70, 70, 0.3);
  color: #8b2f2f;
  background: rgba(255, 235, 235, 0.9);
}

.commercial-license-line {
  flex-wrap: wrap;
  padding: 0.78rem 0.85rem;
  border-radius: 16px;
  background: rgba(235, 248, 255, 0.58);
}

.commercial-card-section {
  display: grid;
  gap: 0.6rem;
}

.commercial-card-section > strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.commercial-member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.commercial-member-list span {
  padding: 0.34rem 0.58rem;
  border: 1px solid rgba(105, 163, 198, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

@media (max-width: 1180px) {
  .commercial-form-grid,
  .commercial-license-form,
  .commercial-member-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* F7R-26R-E: when a CVR profile is open, keep search available but move the
   lawyer's attention to the company passport, relations and graph. */
@media (min-width: 1181px) {
  .companies-view.company-profile-open .companies-layout {
    grid-template-columns: clamp(238px, 18vw, 276px) minmax(0, 1fr);
  }

  .companies-view.company-profile-open .companies-sidebar {
    padding: clamp(12px, 0.9vw, 15px);
    background:
      radial-gradient(circle at 14% 10%, rgba(78, 166, 223, 0.10), transparent 32%),
      linear-gradient(180deg, rgba(249, 253, 255, 0.88), rgba(241, 249, 253, 0.82));
  }

  .companies-view.company-profile-open .company-support-box {
    display: none;
  }

  .companies-view.company-profile-open .company-search-form {
    gap: 7px;
    margin-bottom: 8px;
  }

  .companies-view.company-profile-open .company-search-form .field {
    gap: 4px;
  }

  .companies-view.company-profile-open .company-search-form .field span {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(10, 42, 79, 0.58);
  }

  .companies-view.company-profile-open .company-search-form input,
  .companies-view.company-profile-open .company-search-form select {
    min-height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
  }

  .companies-view.company-profile-open .company-search-form .primary-button {
    min-height: 36px;
    border-radius: 13px;
  }

  .companies-view.company-profile-open .company-source-box {
    margin: 8px 0;
    padding: 8px 9px;
    border-left-width: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.58);
  }

  .companies-view.company-profile-open .company-source-box summary {
    min-height: 30px;
  }

  .companies-view.company-profile-open .company-source-box small {
    line-height: 1.35;
  }

  .companies-view.company-profile-open .company-result-list {
    gap: 6px;
  }

  .companies-view.company-profile-open .company-result-list .company-result-item:not(.active) {
    display: none;
  }

  .companies-view.company-profile-open .company-result-item {
    gap: 3px;
    padding: 9px 10px;
    border-radius: 14px;
    box-shadow:
      inset 3px 0 0 var(--water-royal, #0f5f9d),
      0 9px 22px rgba(6, 26, 51, 0.055);
  }

  .companies-view.company-profile-open .company-result-top {
    display: grid;
    gap: 5px;
  }

  .companies-view.company-profile-open .company-result-top strong {
    font-size: 13px;
    line-height: 1.22;
    overflow-wrap: anywhere;
  }

  .companies-view.company-profile-open .company-result-status {
    justify-self: start;
  }

  .companies-view.company-profile-open .company-result-item > span {
    font-size: 11.5px;
    line-height: 1.35;
  }
}
