﻿: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);
}

.product-entry-gate {
  position: fixed;
  inset: 0;
  z-index: 55;
  overflow: auto;
  padding: 24px clamp(30px, 5vw, 84px) 54px;
  color: #08264d;
  background:
    radial-gradient(ellipse at 82% 18%, rgba(71, 165, 220, 0.2), transparent 34%),
    repeating-radial-gradient(ellipse at 72% 10%, rgba(26, 115, 170, 0.1) 0 1px, transparent 1px 54px),
    linear-gradient(135deg, #f8fcff 0%, #eaf5fb 52%, #ffffff 100%);
}

.product-entry-header {
  width: min(1240px, 100%);
  min-height: 70px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(15, 76, 154, 0.13);
}

.product-entry-brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  font-weight: 820;
}

.product-entry-brand img {
  width: 74px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.product-entry-brand-copy {
  display: grid;
  gap: 2px;
}

.product-entry-brand-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.product-entry-brand-copy small {
  color: rgba(8, 38, 77, 0.65);
  font-size: 12px;
}

.product-entry-user {
  color: rgba(8, 38, 77, 0.62);
  font-size: 13px;
  font-weight: 720;
}

.product-entry-main {
  width: min(920px, 100%);
  margin: clamp(72px, 11vh, 132px) auto 0;
}

.product-entry-intro {
  max-width: 620px;
  margin-bottom: 36px;
}

.product-entry-intro > span {
  color: #15639c;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-entry-intro h1 {
  margin: 9px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 650;
}

.product-entry-intro h1:focus {
  outline: none;
}

.product-entry-intro p {
  margin: 0;
  color: rgba(8, 38, 77, 0.68);
  font-size: 17px;
}

.product-entry-options {
  display: grid;
  border-top: 1px solid rgba(15, 76, 154, 0.14);
}

.product-entry-option {
  width: 100%;
  min-height: 104px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 20px 6px;
  border: 0;
  border-bottom: 1px solid rgba(15, 76, 154, 0.14);
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: background-color 160ms ease, padding 160ms ease;
}

.product-entry-option:hover,
.product-entry-option:focus-visible {
  padding-inline: 16px;
  outline: 0;
  background: rgba(255, 255, 255, 0.7);
}

.product-entry-option-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(21, 99, 156, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: #0f4c9a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 700;
}

.product-entry-option-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.product-entry-option-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.product-entry-option-copy small {
  color: rgba(8, 38, 77, 0.64);
  font-size: 14px;
}

.product-entry-option-action {
  color: #0f4c9a;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .product-entry-gate { padding-inline: 20px; }
  .product-entry-header { align-items: flex-start; }
  .product-entry-user { display: none; }
  .product-entry-main { margin-top: 54px; }
  .product-entry-intro h1 { font-size: 42px; }
  .product-entry-option { grid-template-columns: 46px minmax(0, 1fr); }
  .product-entry-option-action { grid-column: 2; }
}

.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);
}

#bootMetadataStatus:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
  font-size: 13px;
}

#bootMetadataMessage {
  flex: 1 1 240px;
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#bootMetadataRetry {
  flex: 0 0 auto;
}

.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: 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 {
  /* Wraps instead of a fixed two-column grid, so the facts never overlap the
     reference when the strip sits in a narrow column. */
  display: flex;
  flex-wrap: wrap;
  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 {
  flex: 1 1 160px;
  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;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}

.company-network-terminal-alert {
  flex: 1 0 100%;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d8aaa4;
  border-left: 4px solid var(--brick);
  border-radius: 10px;
  background: #fff7f5;
  color: #7e3028;
}

.company-network-terminal-alert-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  line-height: 1.4;
}

.company-network-terminal-alert-copy strong {
  font-size: 13px;
}

.company-network-terminal-alert-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
}

.company-network-terminal-alert-link {
  max-width: 100%;
  justify-self: end;
}

.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-create-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: rgba(10, 42, 79, 0.68);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.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(230px, 1.2fr) minmax(126px, 0.56fr) minmax(220px, 1.08fr) minmax(290px, 1.28fr) minmax(86px, 0.38fr);
  gap: 10px;
  align-items: center;
  min-width: 1030px;
}

.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);
}

.deadline-editor,
.deadline-quick-panel {
  container-type: inline-size;
}

.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-vat-period-field,
.deadline-extraordinary-wide,
.deadline-source-adjustment {
  grid-column: 1 / -1;
}

.deadline-source-adjustment {
  min-width: 0;
  border-top: 1px solid color-mix(in srgb, var(--water-royal) 14%, var(--line));
  padding-top: 8px;
}

.deadline-source-adjustment > summary {
  width: fit-content;
  color: var(--water-deep);
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.deadline-source-adjustment > summary::marker {
  color: var(--water-royal);
}

.deadline-source-adjustment-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid color-mix(in srgb, var(--water-royal) 38%, transparent);
  background: color-mix(in srgb, var(--water-pale) 48%, transparent);
}

.deadline-track-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.deadline-control-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.deadline-track-toggle {
  min-width: 0;
}

.deadline-extraordinary-only[hidden] {
  display: none !important;
}

.deadline-tax-ordinary-only[hidden],
.deadline-ordinary-confirmation[hidden] {
  display: none !important;
}

.deadline-ordinary-variant-control {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  padding-block: 2px 4px;
}

.deadline-rule-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 9px 0 8px;
  color: var(--ink);
  cursor: pointer;
}

.deadline-rule-confirm input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--water-royal);
}

.deadline-rule-confirm > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.deadline-rule-confirm strong {
  font-size: 12px;
  line-height: 1.35;
}

.deadline-rule-confirm small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.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);
  }
}

@container (max-width: 540px) {
  .deadline-track-control {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .deadline-track-toggle {
    width: 100%;
  }

  .deadline-track-toggle label {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding-inline: 9px;
  }
}

@media (max-width: 920px) {
  .landing-shell,
  .landing-main,
  .landing-hero,
  .landing-hero-copy {
    min-width: 0;
  }

  .landing-nav,
  .landing-hero,
  .landing-pricing,
  .landing-trust {
    grid-template-columns: 1fr;
  }

  .landing-pricing-copy {
    min-height: auto;
    padding: 2px;
  }

  .landing-nav {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .landing-nav nav {
    width: 100%;
    min-width: 0;
    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 14px;
  }

  .landing-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .landing-brand img {
    width: 138px;
  }

  .landing-brand span {
    max-width: 100%;
    white-space: normal;
  }

  .landing-brand span::after {
    right: 0;
  }

  .landing-nav nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    border-radius: 22px;
  }

  .landing-nav nav a {
    min-width: 0;
    justify-content: center;
    padding-inline: 8px;
    text-align: center;
    white-space: normal;
  }

  .landing-hero {
    min-height: 0;
  }

  .landing-hero h1 {
    max-width: 100%;
    font-size: clamp(34px, 10.25vw, 40px);
    overflow-wrap: anywhere;
  }

  .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-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-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) minmax(210px, 260px);
  gap: 10px;
  min-height: 420px;
}

.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 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: 6px;
  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: 7px;
  min-height: 34px;
  padding: 6px 10px;
  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: 24px;
  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 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: 0;
  max-width: 80ch;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--reader-ink, var(--ink));
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: var(--reader-ui-font, var(--font-ui));
  font-size: 14px;
  line-height: 1.7;
}

.company-report-preview :is(h1, h2, h3, h4, h5, h6) { margin: 1.5em 0 .5em; color: inherit; font-family: inherit; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.company-report-preview h1 { font-size: 22px; }
.company-report-preview h2 { font-size: 18px; }
.company-report-preview :is(h3, h4, h5, h6) { font-size: 15px; }
.company-report-preview p { margin: 0 0 .85em; }
.company-report-preview :is(ul, ol) { margin: 0 0 1em; padding-inline-start: 1.5em; }
.company-report-preview ul { list-style: disc; }
.company-report-preview ol { list-style: decimal; }
.company-report-preview li { margin-block: .3em; }
.company-report-preview > :first-child { margin-top: 0; }

.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-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-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-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-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(230px, 1.2fr) minmax(126px, 0.56fr) minmax(220px, 1.08fr) minmax(290px, 1.28fr) minmax(86px, 0.38fr);
  min-width: 1030px;
}

.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.2fr) minmax(116px, 0.54fr) minmax(220px, 1.08fr) minmax(290px, 1.3fr) minmax(84px, 0.38fr);
    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: auto;
  max-width: calc(100% - 28px);
  margin: 12px 14px;
  padding: 5px;
  border-radius: 999px;
  justify-self: center;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 8px 24px rgba(6, 26, 51, 0.045);
}

.deadline-mode-tabs button {
  min-width: 190px;
  min-height: 46px;
  padding: 7px 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(390px, 0.72fr) minmax(760px, 1.28fr);
}

.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-context-note {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0 0 14px;
  padding: 7px 11px;
  border: 1px solid rgba(15, 76, 154, 0.10);
  border-left: 2px solid rgba(15, 76, 154, 0.54);
  border-radius: 7px;
  background: rgba(239, 248, 253, 0.54);
  color: rgba(10, 42, 79, 0.68);
  font-size: 12.5px;
  font-weight: 680;
  line-height: 1.4;
}

.deadline-context-note strong,
.deadline-context-note span {
  display: inline;
}

.deadline-context-note strong::after {
  content: " · ";
  color: rgba(15, 76, 154, 0.36);
}

.deadline-form-section-title {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 1px 0 -2px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.08);
}

.deadline-form-section-title strong,
.deadline-section-heading strong {
  color: var(--water-navy);
  font-size: 13px;
  font-weight: 850;
}

.deadline-form-section-title span,
.deadline-section-heading span {
  color: rgba(10, 42, 79, 0.52);
  font-size: 11.5px;
  font-weight: 680;
}

.deadline-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.deadline-section-heading > div {
  display: grid;
  gap: 2px;
}

.deadline-section-heading > small,
.deadline-save-state {
  flex: 0 0 auto;
  color: rgba(10, 42, 79, 0.50);
  font-size: 11px;
  font-weight: 760;
}

.deadline-inline-validation {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(176, 49, 62, 0.18);
  border-left: 3px solid #b83f4b;
  border-radius: 7px;
  background: rgba(255, 241, 243, 0.78);
  color: #842933;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.45;
}

.deadline-inline-validation[hidden] {
  display: none;
}

.deadline-form input[aria-invalid="true"],
.deadline-form select[aria-invalid="true"] {
  border-color: rgba(184, 63, 75, 0.66);
  box-shadow: 0 0 0 3px rgba(184, 63, 75, 0.08);
}

.deadline-section-heading > small.is-dirty,
.deadline-save-state.is-dirty {
  color: #806019;
}

.deadline-section-heading > small.is-saving,
.deadline-save-state.is-saving {
  color: var(--water-royal);
}

.deadline-section-heading > small.is-saved,
.deadline-save-state.is-saved {
  color: #2d7a60;
}

.deadline-section-heading > small.is-error,
.deadline-save-state.is-error {
  color: #9d3440;
}

.deadline-actions .primary-button[aria-busy="true"] svg {
  animation: deadline-save-pulse 850ms ease-in-out infinite alternate;
}

.deadlines-view[aria-busy="true"] .deadline-panel {
  cursor: progress;
}

.deadline-case-list .deadline-loading-state {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.deadline-loading-state span {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(210, 230, 242, 0.52), rgba(239, 248, 253, 0.94), rgba(210, 230, 242, 0.52));
  background-size: 220% 100%;
  animation: deadline-loading 1.1s linear infinite;
}

.deadline-loading-state span:nth-child(2) {
  width: 68%;
}

@keyframes deadline-loading {
  to { background-position: -220% 0; }
}

@keyframes deadline-save-pulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.deadline-save-state {
  align-self: center;
  margin-left: auto;
}

.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 {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: 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-kind-toggle label:has(input:focus-visible) {
  outline: 2px solid rgba(15, 76, 154, 0.34);
  outline-offset: 2px;
}

.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-summary-grid {
  display: flex;
  min-height: 40px;
  gap: 0;
  margin: 0;
  border: 1px solid rgba(10, 42, 79, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.64);
  overflow: hidden;
}

.deadline-summary-grid .deadline-summary-card {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.deadline-summary-grid .deadline-summary-card span,
.deadline-summary-grid .deadline-summary-card strong {
  display: inline;
  margin: 0;
}

.deadline-summary-grid .deadline-summary-card span::after {
  content: " ";
}

.deadline-summary-grid .deadline-summary-card + .deadline-summary-card {
  border-left: 1px solid rgba(10, 42, 79, 0.08);
}

.deadline-summary-grid .deadline-summary-card span {
  font-size: 10px;
}

.deadline-summary-grid .deadline-summary-card strong {
  font-size: 15px;
}

.deadline-matrix-note {
  margin: 10px 1px 7px;
  color: rgba(10, 42, 79, 0.58);
  font-size: 11.5px;
  line-height: 1.45;
}

.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;
  min-width: 0;
  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 {
  min-width: 0;
  color: rgba(10, 42, 79, 0.58);
  font-size: 12px;
  font-weight: 750;
}

.deadline-detail-drawer summary::after {
  content: "\00C5 bn";
  flex: 0 0 auto;
  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;
  white-space: nowrap;
}

.deadline-detail-drawer[open] summary::after {
  content: "Luk";
}

.deadline-detail-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.deadline-quick-facts {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  margin: 0;
  border-block: 1px solid rgba(10, 42, 79, 0.09);
}

.deadline-quick-facts div {
  min-width: 0;
  padding: 11px 13px;
}

.deadline-quick-facts div + div {
  border-left: 1px solid rgba(10, 42, 79, 0.09);
}

.deadline-quick-facts dt,
.deadline-quick-facts dd {
  margin: 0;
}

.deadline-quick-facts dt {
  color: rgba(10, 42, 79, 0.55);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.deadline-quick-facts dd {
  margin-top: 3px;
  color: var(--water-navy);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.4;
}

.deadline-period-matrix-wrap {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(10, 42, 79, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(6, 26, 51, 0.045);
}

.deadline-period-matrix {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  table-layout: fixed;
}

.deadline-period-matrix th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.09);
  background: rgba(237, 247, 253, 0.72);
  color: rgba(10, 42, 79, 0.58);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0;
  text-align: left;
  text-transform: uppercase;
}

.deadline-period-matrix th:nth-child(1) { width: 20%; }
.deadline-period-matrix th:nth-child(2) { width: 18%; }
.deadline-period-matrix th:nth-child(3),
.deadline-period-matrix th:nth-child(4) { width: 15%; }
.deadline-period-matrix th:nth-child(5) { width: 32%; }

.deadline-period-matrix td {
  min-width: 0;
  padding: 11px;
  border-bottom: 1px solid rgba(10, 42, 79, 0.07);
  color: var(--water-navy);
  font-size: 12.5px;
  line-height: 1.35;
  vertical-align: top;
}

.deadline-period-matrix tbody tr:last-child td {
  border-bottom: 0;
}

.deadline-period-matrix tbody tr {
  box-shadow: inset 3px 0 0 rgba(15, 76, 154, 0.35);
  transition: background 150ms ease;
}

.deadline-period-matrix tbody tr:hover {
  background: rgba(237, 248, 255, 0.52);
}

.deadline-period-matrix tbody tr.is-selected {
  background: rgba(226, 243, 253, 0.72);
  box-shadow: inset 3px 0 0 var(--water-royal), inset 0 0 0 1px rgba(15, 76, 154, 0.12);
}

.deadline-period-matrix tbody tr.is-selected td:first-child strong {
  color: var(--water-royal);
}

.deadline-period-matrix tbody tr.green { box-shadow: inset 3px 0 0 #3d9a78; }
.deadline-period-matrix tbody tr.yellow { box-shadow: inset 3px 0 0 #d79a2b; }
.deadline-period-matrix tbody tr.red { box-shadow: inset 3px 0 0 #c74d58; }

.deadline-period-matrix td > strong,
.deadline-period-matrix td > small,
.deadline-matrix-open strong,
.deadline-matrix-open small {
  display: block;
  min-width: 0;
}

.deadline-period-matrix td > small,
.deadline-matrix-open small {
  margin-top: 2px;
  color: rgba(10, 42, 79, 0.56);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.deadline-period-matrix .deadline-verdict-context {
  color: rgba(10, 42, 79, 0.52);
}

.deadline-matrix-open {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

button.deadline-matrix-open {
  cursor: pointer;
}

button.deadline-matrix-open:hover strong,
button.deadline-matrix-open:focus-visible strong {
  color: var(--water-royal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.deadline-period-matrix mark {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(230, 244, 252, 0.92);
  color: var(--water-navy);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.deadline-period-matrix tr.red mark {
  background: rgba(255, 235, 237, 0.94);
  color: #8c2631;
}

.deadline-period-matrix tr.yellow mark {
  background: rgba(255, 246, 221, 0.94);
  color: #76500f;
}

.deadline-matrix-empty {
  color: rgba(10, 42, 79, 0.46);
  font-size: 12px;
}

.deadline-bulk-years {
  margin: 10px 0 12px;
  border-block: 1px solid rgba(10, 42, 79, 0.09);
}

.deadline-bulk-years summary {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 2px;
  color: var(--water-royal);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 820;
  list-style: none;
}

.deadline-bulk-years summary::-webkit-details-marker {
  display: none;
}

.deadline-bulk-years summary::before {
  content: "+";
  display: grid;
  width: 20px;
  height: 20px;
  margin-right: 7px;
  place-items: center;
  border: 1px solid rgba(15, 76, 154, 0.18);
  border-radius: 50%;
  background: rgba(235, 248, 255, 0.78);
  line-height: 1;
}

.deadline-bulk-years[open] summary::before {
  content: "−";
}

.deadline-bulk-years-body {
  display: grid;
  grid-template-columns: 100px 100px minmax(210px, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding: 2px 2px 12px;
}

.deadline-bulk-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: rgba(10, 42, 79, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.deadline-bulk-copy input {
  flex: 0 0 auto;
}

#deadlineBulkYearsStatus {
  grid-column: 1 / -1;
  min-height: 16px;
  color: rgba(10, 42, 79, 0.58);
  font-size: 11.5px;
}

/* Desktop Frister: let the header row accommodate the actual topbar height. */
@media (min-width: 1261px) {
  .app-shell:has(> .deadlines-view:not(.view-hidden)) {
    grid-template-rows: auto minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .deadline-quick-workspace,
  .deadline-workspace {
    grid-template-columns: minmax(0, 1fr);
    overflow: auto;
  }

  .deadline-bulk-years-body {
    grid-template-columns: 100px 100px minmax(180px, 1fr);
  }

  .deadline-bulk-years-body .quiet-button {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 820px) {
  .deadlines-view:not(.view-hidden) {
    grid-row: 2 / -1 !important;
  }

  .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-quick-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .deadline-quick-facts div + div {
    border-top: 1px solid rgba(10, 42, 79, 0.09);
    border-left: 0;
  }

  .deadline-bulk-years-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deadline-bulk-copy,
  .deadline-bulk-years-body .quiet-button {
    grid-column: 1 / -1;
  }

  .deadline-track-control {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .deadline-ordinary-variant-control {
    grid-template-columns: minmax(0, 1fr);
  }

  .deadline-track-toggle {
    width: 100%;
  }

  .deadline-track-toggle label {
    flex: 1;
    justify-content: center;
  }

  .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.2fr) minmax(116px, 0.54fr) minmax(220px, 1.08fr) minmax(290px, 1.3fr) minmax(84px, 0.38fr);
  }

  .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-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) 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-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;
  }
}

@media (max-width: 520px) {








  .top-tabs {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    justify-content: stretch;
    gap: 2px;
    padding: 2px;
    overflow: visible !important;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .top-tab {
    width: 100%;
    min-width: 0;
    min-height: 49px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 18px auto;
    justify-items: center;
    gap: 2px;
    padding: 4px 0;
    text-align: center;
  }

  .top-tab:focus-visible {
    outline: 2px solid var(--water-navy);
    outline-offset: -3px;
    transition: none;
  }

  .top-tab.active:focus-visible {
    outline-color: var(--water-foam);
  }

  .top-tab-copy {
    width: 100%;
  }

  .top-tab-copy strong {
    font-size: 10.5px;
    letter-spacing: -0.025em;
  }

  .company-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 12px;
    overflow: visible;
  }

  .company-tab {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 4px;
    font-size: 10.5px;
    line-height: 1.15;
    white-space: normal;
  }
}

/* Frister keyboard focus stays inside the existing painted control. */
.deadlines-view:not(.view-hidden) .deadline-mode-tabs button:focus-visible {
  outline: 2px solid var(--water-navy);
  outline-offset: -3px;
  transition: none;
}

.deadlines-view:not(.view-hidden) .deadline-mode-tabs button.active:focus-visible {
  outline-color: var(--water-foam);
}

.deadlines-view:not(.view-hidden) .deadline-track-toggle label:has(input:focus-visible) {
  outline-color: var(--water-navy);
}

/* Compact Frister: reserve room for full labels, not smaller type. */
@media (max-width: 380px) {
  .app-shell:has(> .deadlines-view:not(.view-hidden)) > .topbar .top-tabs {
    grid-template-columns: repeat(5, minmax(max-content, 1fr));
  }

  .app-shell:has(> .deadlines-view:not(.view-hidden)) > .topbar .top-tab {
    padding-inline: 2px;
  }

  .app-shell:has(> .deadlines-view:not(.view-hidden)) > .topbar .top-tab-copy strong {
    line-height: 16px;
  }

  .deadlines-view:not(.view-hidden) .deadline-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deadlines-view:not(.view-hidden) .deadline-mode-tabs button {
    min-width: 0;
  }

  .deadlines-view:not(.view-hidden) .deadline-track-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content minmax(0, 1fr);
  }
}

/* Direct person lookup: keep its two fields and action in normal mobile flow. */
@media (max-width: 820px) {
  .app-shell:has(.companies-view:not(.view-hidden)[data-company-search-type="person"]) {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto !important;
    overflow: visible;
  }

  .companies-view[data-company-search-type="person"] {
    grid-row: 2;
    height: auto;
    overflow: visible;
  }

  .companies-view[data-company-search-type="person"] .companies-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .companies-view[data-company-search-type="person"] .companies-sidebar {
    overflow: visible;
  }

  .companies-view[data-company-search-type="person"] .companies-sidebar > .pane-heading,
  .companies-view[data-company-search-type="person"] .company-support-box {
    display: none;
  }
}

/* Mid-width guard (821-1180px): the 760px content minimums above made the
   shell, and the topbar spanning it, wider than the window. */
@media (min-width: 821px) and (max-width: 1180px) {
  .app-shell.reader-wide.filters-collapsed {
    grid-template-columns: 62px 6px minmax(240px, 0.46fr) 6px minmax(0, 1.34fr);
  }

  .deadline-workspace {
    grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  }

  .templates-view .templates-layout.templates-sidebar-collapsed .templates-workspace {
    grid-template-columns: minmax(300px, 0.36fr) minmax(0, 1.64fr);
  }
}

/* Visible while the authenticated shell is shown but still booting (deep links). */
.boot-indicator {
  display: none;
}

body:has(> #appShell.boot-pending:not([hidden])) > .boot-indicator {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a2a4f;
  font-size: 15px;
  font-weight: 650;
  pointer-events: none;
}

/* 821-1260px with filters open: the shell has two columns, but the empty-state
   placement (3 / -1) created an implicit third column and a blank gap. */
@media (min-width: 821px) and (max-width: 1260px) {
  .app-shell.reader-empty-state:not(.filters-collapsed) .results-pane {
    grid-column: 2 / -1;
  }
}

/* Public entry only; authentication and the application keep their own styles. */
@font-face{font-family:"Retskilden Inter";src:url("/assets/landing/inter-regular.ttf") format("truetype");font-style:normal;font-weight:400;font-display:swap}
#authGate.rk-home{display:block;align-items:normal;justify-items:normal;padding:0;background:#f5f7fa;color:#183448;font:400 16px/1.55 "Retskilden Inter","Segoe UI",sans-serif;overflow-x:hidden;overflow-y:auto;isolation:isolate;scroll-behavior:smooth}
#authGate.rk-home.hidden,#authGate.rk-home[hidden]{display:none!important}
#authGate.rk-home::before,#authGate.rk-home::after{content:none}
.rk-home-shell{width:100%;min-height:100%;display:flex;flex-direction:column}
.rk-home-shell *,.rk-home-shell *::before,.rk-home-shell *::after{box-sizing:border-box}
.rk-home-shell :is(h1,h2,h3,p){margin:0}
.rk-home-shell a{color:inherit;text-decoration:none}
.rk-home-shell :is(a,button,summary):focus-visible{outline:3px solid #3389e4;outline-offset:5px;border-radius:4px}
.rk-container{width:min(1120px,calc(100% - 64px));margin-inline:auto}
.rk-skip{position:absolute;left:24px;top:-120px;z-index:9;padding:12px 20px;background:white;color:#183448}
.rk-skip:focus{top:16px}
.rk-header{background:#112e43;color:#fff;border-bottom:1px solid #25465c}
.rk-header-inner{display:flex;justify-content:space-between;align-items:center;gap:32px;padding-block:24px}
.rk-identity{display:flex;flex-direction:column;gap:8px;flex-shrink:0}
.rk-brand{display:inline-flex;align-items:center;gap:14px;width:fit-content}
.rk-brand img{content:url("/assets/retskilden-mark.png?v=20260927-2");mix-blend-mode:screen;width:64px;height:50px;object-fit:contain}
.rk-brand span{font-family:Georgia,serif;font-size:30px;letter-spacing:-.6px}
.rk-maker{display:flex;align-items:center;gap:14px;width:fit-content;padding:0;border:0}
.rk-maker span{width:64px;text-align:right;color:#b3c4cf;font-size:10px;letter-spacing:.01em;white-space:nowrap}
.rk-maker img{width:136px;height:auto;display:block;object-fit:contain}
.rk-nav{display:flex;align-items:center;gap:28px;font-size:14px}
.rk-nav a{min-height:44px;display:inline-flex;align-items:center;padding-block:10px}
.rk-nav a:hover{color:#a8d2ff}
.rk-login-link{gap:10px;border:1px solid #527084;border-radius:8px;padding-inline:16px}
.rk-icon{filter:brightness(0) invert(1);flex-shrink:0}
.rk-menu-toggle{display:none}
#landingMain{flex:1;padding-bottom:50px}
.rk-hero{display:flex;align-items:center;justify-content:space-between;gap:32px;padding-block:52px 40px}
.rk-eyebrow{font-size:12px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#527183;margin-bottom:10px!important}
.rk-hero h1{font-size:clamp(30px,3.2vw,42px);line-height:1.2;letter-spacing:-1.2px;font-weight:600}
.rk-hero-description{color:#586c7c;margin-top:14px!important;font-size:16px;max-width:520px}
.rk-button{background:#1765b4;color:white!important;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;gap:20px;min-height:50px;padding:13px 22px;white-space:nowrap}
.rk-button:hover{background:#125395}
.rk-tools{scroll-margin-top:24px}
.rk-tools>h2{font-size:15px;font-weight:600;color:#526b7e;margin-bottom:17px}
.rk-tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.rk-tool{display:flex;flex-direction:column;gap:18px;background:#fff;border:1px solid #dce4eb;border-radius:12px;padding:26px 24px;min-height:154px;transition:border-color .15s,box-shadow .15s}
.rk-tool:hover{border-color:#6ba2cc;box-shadow:0 4px 18px #193c5710}
.rk-tool-heading{display:flex;align-items:center;gap:12px}
.rk-tool h3{font-size:18px;font-weight:600;line-height:1.3;letter-spacing:-.25px}
.rk-tool-icon{width:28px;height:28px;flex-shrink:0;opacity:.8}
.rk-tool-arrow{margin-left:auto;opacity:.45;flex-shrink:0}
.rk-tool p{font-size:14px;line-height:1.6;color:#5b6e7d}
.rk-footer{border-top:1px solid #dce4eb;padding-block:22px;display:flex;justify-content:space-between;align-items:center;gap:20px;color:#657988;font-size:12px}
.rk-footer a{display:inline-flex;align-items:center;gap:8px;min-height:44px}
.rk-footer a:hover{text-decoration:underline}
#authGate.rk-home .auth-card { color: #182b3e; font-family: var(--font-ui); }
#authGate.rk-home .auth-card:target,
#authGate.rk-home.auth-panel-required .auth-card {
  top: 100px; right: max(24px, 5vw); max-height: calc(100dvh - 130px); overflow-y: auto;
  background: #fff; box-shadow: 0 18px 100px #0008; border: 1px solid #cbd5de; border-radius: 8px;
}
#authGate.rk-home .auth-card::before { content: none; }
#authGate.rk-home .auth-panel-close { position: absolute; top: 8px; right: 12px; padding: 8px; font-weight: 400; font-size: 13px; }
#authGate.rk-home .auth-card .brand { min-width: 0; gap: 14px; padding-top: 14px; margin-bottom: 8px; }
#authGate.rk-home .auth-card .brand-mark-logo { width: 70px; height: 58px; flex-basis: 70px; margin-left: 0; }
#authGate.rk-home .auth-card .brand-mark-logo img { filter: none; }
#authGate.rk-home .auth-card .brand-name { font: 400 25px/1.25 "Retskilden Inter", "Segoe UI", sans-serif; }
#authGate.rk-home .auth-card .brand-tagline { display: none; }
#authGate.rk-home .auth-card input { font-size: 16px; min-height: 46px; border-radius: 4px; }
#authGate.rk-home .auth-card .primary-button { background: #1e61df; color: white; border-radius: 4px; min-height: 48px; box-shadow: none; font-weight: 500; }
#authGate.rk-home .auth-card .primary-button::after { content: none; }
#authGate.rk-home .auth-card .primary-button:hover { background: #3478ed; }
#authGate.rk-home .auth-card :is(a,button,input):focus-visible { outline: 2px solid #1e61df; outline-offset: 3px; }

@media(max-width:1000px){.rk-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.rk-nav{gap:18px}.rk-container{width:calc(100% - 48px)}}
@media(max-width:760px){
 .rk-container{width:calc(100% - 36px)}
 .rk-header-inner{position:relative;flex-wrap:wrap;align-items:flex-start;padding-block:20px;gap:0}
 .rk-brand img{width:52px;height:41px}.rk-brand span{font-size:26px}.rk-identity{gap:6px}
 .rk-maker{gap:14px;padding-top:0}.rk-maker span{width:52px;font-size:9px}.rk-maker img{width:120px}
 .rk-menu-toggle:not([hidden]){position:absolute;right:0;top:20px;display:inline-flex;align-items:center;gap:8px;min-height:44px;border:0;background:transparent;color:white;padding:8px 0 8px 12px;font:inherit;font-size:13px}
 .rk-nav{width:100%;flex-direction:column;align-items:stretch;gap:0;padding-top:20px;font-size:15px}
 .rk-nav a{border-top:1px solid #365167;padding:12px 0;min-height:48px}.rk-nav .rk-login-link{border:0;border-top:1px solid #365167;border-radius:0;justify-content:space-between}
 .rk-hero{flex-direction:column;align-items:flex-start;gap:24px;padding-block:34px 30px}.rk-hero-description{font-size:15px}.rk-hero h1{letter-spacing:-.8px}
 .rk-button{width:100%}.rk-tool-grid{grid-template-columns:1fr;gap:12px}.rk-tool{padding:22px;min-height:130px;gap:12px}.rk-tool h3{font-size:18px}
 #landingMain{padding-bottom:32px}.rk-footer{font-size:11px}
 #authGate.rk-home .auth-card:target,#authGate.rk-home.auth-panel-required .auth-card{position:fixed;inset:92px 5% auto;width:90%;max-height:calc(100dvh - 110px);margin:0}
}
@media(prefers-reduced-motion:reduce){#authGate.rk-home{scroll-behavior:auto}.rk-home-shell *{transition:none!important}}

/* Selected Skat reading-desk direction. The workspace extension at the end
   reuses these tokens; public landing, access rules and source text are untouched. */
@font-face {
  font-family: "Skat Inter";
  src: url("/assets/reader/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.app-shell.skat-reader-design {
  --reader-ink: #12243d;
  --reader-muted: #526784;
  --reader-line-color: #dce4ee;
  --reader-blue: #0965d8;
  --reader-navy: #102840;
  --reader-side: #f6f8fb;
  --reader-ui-font: "Skat Inter", "Segoe UI", sans-serif;
  grid-template-rows: 72px minmax(0, 1fr);
}
.skat-reader-design .topbar {
  grid-template-columns: 250px minmax(0, 1fr) auto;
  min-height: 72px;
  padding: 0 28px;
  gap: 22px;
  color: #f6f8fc;
  background: var(--reader-navy);
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  font-family: var(--reader-ui-font);
}
.skat-reader-design .topbar::after { display: none; }
.skat-reader-design .topbar .brand { min-width: 0; gap: 14px; }
.skat-reader-design .topbar .brand-mark { width: 72px; height: 56px; min-width: 72px; flex: 0 0 72px; padding: 0; background: none; border: 0; box-shadow: none; }
.skat-reader-design .topbar .brand-mark img { width: 72px; height: 56px; object-fit: contain; filter: none; }
.skat-reader-design .topbar .brand-name { font-family: Georgia, serif; font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: -.7px; color: #fff; }
.skat-reader-design .topbar .brand-tagline { display: none; }
.reader-product-label { display: block; margin-top: 5px; color: #c1d0e3; font-size: 14px; line-height: 1; font-weight: 400; }
.skat-reader-design .top-tabs { display: flex; justify-content: flex-start; align-self: stretch; gap: 20px; min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design .top-tab { display: flex; flex: 0 1 auto; gap: 10px; min-width: 0; min-height: 0; margin: 0; padding: 0 6px; color: #e1eaf7; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; box-shadow: none; transform: none; font-family: var(--reader-ui-font); }
.skat-reader-design .top-tab::before, .skat-reader-design .top-tab::after { display: none; }
.skat-reader-design .top-tab:hover { color: #fff; background: #193751; }
.skat-reader-design .top-tab.active { color: #fff; border-bottom-color: #459cff; background: none; box-shadow: none; }
.skat-reader-design .top-tab-copy strong { font-family: inherit; font-size: 15px; font-weight: 500; line-height: 1.3; letter-spacing: -.15px; }
.skat-reader-design .top-tab-copy small { display: none; }
.reader-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.skat-reader-design .top-tab .reader-icon { width: 24px; height: 24px; filter: invert(92%) sepia(14%) saturate(350%) hue-rotate(179deg); }
.skat-reader-design .top-tab.active .reader-icon { filter: invert(56%) sepia(77%) saturate(1200%) hue-rotate(188deg); }
.skat-reader-design .top-actions { gap: 8px; }
.skat-reader-design .account-trigger { min-width: 0; max-width: 160px; min-height: 40px; padding: 4px 10px; border: 1px solid #39546f; border-radius: 8px; background: transparent; box-shadow: none; color: #fff; }
.skat-reader-design .user-pill-copy strong { font: 500 13px/1.3 var(--reader-ui-font); color: #fff; }
.skat-reader-design .user-pill-copy > span { display: none; }
.skat-reader-design .account-chevron { color: #d8e6f8; }
.skat-reader-design .top-actions > .icon-button { display: none; }
.skat-reader-design .topbar .account-menu { color: var(--reader-ink); }
.skat-reader-design .reader-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app-shell.skat-reader-design.reader-workspace-open {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  height: 100dvh;
  background: #fff;
}
.skat-reader-design.reader-workspace-open > .filters-pane,
.skat-reader-design.reader-workspace-open > .results-pane,
.skat-reader-design.reader-workspace-open > .workspace-resizer { display: none; }
.skat-reader-design.reader-workspace-open > .reader-pane { grid-column: 1 / -1; grid-row: 2; width: auto; min-width: 0; padding: 0; border: 0; background: #fff; box-shadow: none; overflow: hidden; }
.skat-reader-design .reader-content { display: grid; grid-template-rows: 64px auto minmax(0, 1fr); height: 100%; min-height: 0; min-width: 0; font-family: var(--reader-ui-font); color: var(--reader-ink); }
.skat-reader-design .reader-workspace-toolbar { display: grid; grid-template-columns: 228px minmax(130px, 1fr) auto; align-items: center; min-width: 0; gap: 24px; padding: 0 28px; background: #f8fafd; border-bottom: 1px solid var(--reader-line-color); }
.skat-reader-design .reader-content :is(button, input, textarea, select) { font-family: var(--reader-ui-font); }
.skat-reader-design .reader-content :is(.icon-button, .quiet-button, .reader-text-button, .reader-zoom-value) { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 36px; min-height: 36px; padding: 7px 9px; color: var(--reader-ink); font-size: 14px; line-height: 1.35; font-weight: 400; border: 1px solid transparent; border-radius: 6px; background: transparent; box-shadow: none; text-shadow: none; transform: none; cursor: pointer; }
.skat-reader-design .reader-content :is(.icon-button, .quiet-button, .reader-text-button):hover { background: #eaf0f8; }
.skat-reader-design .reader-content :is(button, a, input, select, textarea):focus-visible,
.skat-reader-design .topbar :is(button, a):focus-visible { outline: 2px solid #3989eb; outline-offset: 3px; }
.skat-reader-design .reader-content [hidden] { display: none !important; }
.skat-reader-design .reader-workspace-search { display: flex; align-items: center; gap: 12px; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: #fff; }
.skat-reader-design .reader-workspace-search input { width: 100%; min-width: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none; font-size: 15px; color: var(--reader-ink); }
.skat-reader-design #readerBackToResults { justify-content: flex-start; padding-left: 0; white-space: nowrap; }
.skat-reader-design .doc-actions { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: nowrap; position: relative; }
.skat-reader-design .reader-navigation-actions,
.skat-reader-design .reader-size-actions { display: flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; box-shadow: none; }
.skat-reader-design #readerFindBtn { width: auto; flex: 0 0 auto; gap: 9px; margin-right: 14px; padding: 8px 12px; border-color: var(--reader-line-color); background: #fff; color: var(--reader-muted); white-space: nowrap; }
.skat-reader-design #readerZoomValue { font-size: 14px; min-width: 54px; font-variant-numeric: tabular-nums; }
.skat-reader-design #readerHeaderCollapseBtn,
.skat-reader-design #readerWideBtn,
.skat-reader-design #readerMinimizeBtn { display: none; }
.skat-reader-design .reader-more-actions-panel { top: calc(100% + 12px); right: 0; width: auto; padding: 8px; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #10284018; }
.skat-reader-design .reader-more-actions-panel .icon-button { display: flex; }
.skat-reader-design .reader-find-panel,
.skat-reader-design .reader-settings-panel,
.skat-reader-design .citation-copy-panel,
.skat-reader-design .print-panel { top: calc(100% + 12px); right: 0; z-index: 30; color: var(--reader-ink); border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #10284018; }
.skat-reader-design .reader-workspace-body { display: grid; grid-template-columns: 228px minmax(0, 1fr) 300px; min-height: 0; min-width: 0; overflow: hidden; }
.skat-reader-design .reader-workspace-body.outline-collapsed { grid-template-columns: 52px minmax(0, 1fr) 300px; }
.skat-reader-design .reader-workspace-body.workbench-collapsed { grid-template-columns: 228px minmax(0, 1fr); }
.skat-reader-design .reader-workspace-body.outline-collapsed.workbench-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
.skat-reader-design .reader-workspace-body.reader-workspace-focus { grid-template-columns: minmax(0, 1fr); }
.skat-reader-design .reader-workspace-outline { min-width: 0; min-height: 0; padding: 24px 16px; border-right: 1px solid var(--reader-line-color); overflow-y: auto; background: var(--reader-side); }
.skat-reader-design .reader-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin: 0 0 16px 5px; }
.skat-reader-design .reader-panel-heading strong { font-size: 15px; line-height: 1.4; font-weight: 600; }
.skat-reader-design .outline-collapsed .reader-workspace-outline { padding: 24px 8px; }
.skat-reader-design .outline-collapsed .reader-panel-heading { margin: 0; }
.skat-reader-design .outline-collapsed .reader-panel-heading strong { display: none; }
.skat-reader-design .doc-outline { display: block; max-height: none; padding: 0; margin: 0 0 28px; border: 0; background: none; box-shadow: none; }
.skat-reader-design .doc-outline > span { display: none; }
.skat-reader-design .doc-outline > div { display: flex; flex-direction: column; align-items: stretch; gap: 5px; overflow: visible; }
.skat-reader-design .doc-outline button { display: flex; align-items: flex-start; text-align: left; width: 100%; padding: 12px; min-height: 42px; white-space: normal; border: 0; border-left: 3px solid transparent; border-radius: 4px; background: transparent; color: var(--reader-ink); font: 400 14px/1.55 var(--reader-ui-font); }
.skat-reader-design .doc-outline button:hover { background: #eaf0f8; }
.skat-reader-design .doc-outline button[aria-current="true"] { color: #074c9f; border-left-color: var(--reader-blue); background: #e7f0fd; }
.skat-reader-design .reader-content.doc-header-collapsed .doc-outline { display: block; }
.skat-reader-design .doc-outline em { display: none; }
.skat-reader-design .doc-data-panel { margin: 0; padding: 20px 0 0; border: 0; border-top: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design .doc-data-panel summary { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 9px 5px; color: var(--reader-ink); font-size: 14px; font-weight: 500; background: none; }
.skat-reader-design .doc-data-panel summary::after { display: none; }
.skat-reader-design .doc-data-panel summary > span { color: var(--reader-ink); font-size: 14px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.skat-reader-design .doc-data-panel .meta-grid { grid-template-columns: minmax(0, 1fr); padding: 14px 5px; gap: 14px; border: 0; background: none; }
.skat-reader-design .meta-item { padding: 0; border: 0; background: none; }
.skat-reader-design .meta-item > span { font-size: 12px; font-weight: 400; color: var(--reader-muted); }
.skat-reader-design .meta-item strong { font-size: 13px; font-weight: 500; }
.skat-reader-design .reader-workspace-document { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; background: #fff; }
.skat-reader-design .reader-workspace-document > .doc-text-panel { grid-row: 3; }
.skat-reader-design .doc-header,
.skat-reader-design .reader-content.doc-header-collapsed .doc-header { display: block; position: relative; margin: 0; padding: 34px 36px 22px; border: 0; border-bottom: 1px solid var(--reader-line-color); background: #fff; box-shadow: none; }
.skat-reader-design .doc-header > div:first-child { display: block; min-width: 0; }
.skat-reader-design .doc-kicker { padding-right: 118px; color: var(--reader-ink); font: 500 14px/1.4 var(--reader-ui-font); letter-spacing: 0; text-transform: none; }
.skat-reader-design .reader-document-metadata { margin-top: 5px; padding-right: 80px; color: var(--reader-muted); font: 400 14px/1.45 var(--reader-ui-font); }
.skat-reader-design .doc-header #docTitle,
.skat-reader-design .reader-content.doc-header-collapsed .doc-header #docTitle { display: block; margin: 28px 0 0; max-height: none; overflow: visible; white-space: normal; color: var(--reader-ink); font: 600 28px/1.3 var(--reader-ui-font); letter-spacing: -.65px; -webkit-line-clamp: unset; text-overflow: clip; }
.skat-reader-design .reader-document-actions { position: absolute; top: 28px; right: 26px; display: flex; gap: 1px; }
.skat-reader-design .reader-document-actions .active { background: #e7f0fd; border-color: #afc9ed; }
.skat-reader-design .source-identity-banner { margin: 0; padding: 10px 36px; border: 0; border-bottom: 1px solid var(--reader-line-color); border-radius: 0; background: #f8fafd; font-size: 13px; }
.skat-reader-design .doc-text-panel { background: #fff; scroll-behavior: smooth; overflow-x: hidden; }
.skat-reader-design .doc-text-overlay { min-width: 0; max-width: 100%; min-height: 0; }
.skat-reader-design .reader-content .doc-text-panel pre { width: min(100%, 80ch); min-height: 0; padding: 26px 36px 64px; border: 0; color: var(--reader-ink); font-family: var(--reader-ui-font); font-size: calc(18px * var(--reader-zoom, 1)); line-height: 1.65; letter-spacing: -.12px; background: #fff; box-shadow: none; }
.skat-reader-design .reader-content.reader-font-serif .doc-text-panel pre { font-family: Georgia, "Times New Roman", serif; }
.skat-reader-design .reader-content.reader-density-compact .doc-text-panel pre { font-size: calc(16px * var(--reader-zoom, 1)); line-height: 1.5; padding-top: 20px; }
.skat-reader-design .reader-section-heading { font-size: 1.28em; font-weight: 600; line-height: 1.65; letter-spacing: -.4px; }
.skat-reader-design .side-workbench { border-left: 1px solid var(--reader-line-color); border-radius: 0; background: var(--reader-side); box-shadow: none; }
.skat-reader-design .workbench-tabs { display: flex; justify-content: space-between; gap: 12px; min-height: 70px; padding: 20px 18px 0; border: 0; background: var(--reader-side); backdrop-filter: none; }
.skat-reader-design .workbench-tabs button { display: flex; flex: 1; align-items: center; justify-content: center; min-height: 48px; padding: 0 0 14px; border: 0; border-radius: 0; border-bottom: 2px solid transparent; background: none; box-shadow: none; color: var(--reader-muted); font: 400 14px/1.4 var(--reader-ui-font); }
.skat-reader-design .workbench-tabs button.active { color: var(--reader-blue); border-bottom-color: var(--reader-blue); font-weight: 500; }
.skat-reader-design .workbench-tabs button svg { display: none; }
.skat-reader-design .workbench-tab-panel { padding: 0; border-top: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design .workbench-section { margin: 0; padding: 22px 20px; border: 0; border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design [data-workbench-panel="notes"] > .workbench-section > .section-title { display: none; }
.skat-reader-design .reader-notes-empty { padding-top: 132px; text-align: center; }
.skat-reader-design .reader-notes-empty > img { display: block; width: 48px; height: 48px; margin: 0 auto 22px; opacity: .4; }
.skat-reader-design .reader-notes-empty strong { display: block; color: var(--reader-ink); font-size: 17px; line-height: 1.5; font-weight: 500; }
.skat-reader-design .reader-notes-empty p { margin: 12px 0 22px; color: var(--reader-muted); font-size: 14px; line-height: 1.65; }
.skat-reader-design .reader-content .reader-primary-button { display: flex; width: 100%; min-height: 42px; padding: 10px 14px; border: 1px solid var(--reader-blue); border-radius: 6px; background: var(--reader-blue); color: #fff; font-weight: 500; }
.skat-reader-design .reader-content .reader-primary-button:hover { background: #0756ba; }
.skat-reader-design .reader-primary-button img { filter: invert(1); }
.skat-reader-design .passage-composer { padding: 0; margin-top: 0; border: 0; background: none; }
.skat-reader-design .passage-composer textarea { width: 100%; padding: 12px; border: 1px solid #c4d0e0; border-radius: 6px; font: 400 14px/1.6 var(--reader-ui-font); background: #fff; }
.skat-reader-design .passage-composer button[type="submit"] { width: 100%; color: #fff; background: var(--reader-blue); }
.skat-reader-design .passage-composer-actions { flex-wrap: wrap; }
.skat-reader-design .note-color-picker { gap: 5px; }
.skat-reader-design .note-color-option { min-width: 0; padding: 4px; font-size: 12px; }
.skat-reader-design .annotation-manager,
.skat-reader-design .note-item,
.skat-reader-design .profile-bridge-card,
.skat-reader-design .citator-summary,
.skat-reader-design .legal-compass { margin: 0 0 16px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: #fff; box-shadow: none; }
.skat-reader-design .annotation-manager { padding: 10px; }
.skat-reader-design .annotation-manager-head { flex-wrap: wrap; gap: 12px; }
.skat-reader-design .reader-content :is(.mini-heading, .section-title, .profile-bridge-card strong, .note-card-top) { font-weight: 500; }
.skat-reader-design .reader-content :is(.profile-bridge-card span, .citator-summary, .note-item) { font-size: 13px; line-height: 1.6; }
.skat-reader-design .reader-content .primary-button { min-height: 40px; font-size: 14px; font-weight: 500; border-radius: 6px; background: var(--reader-blue); box-shadow: none; }
.skat-reader-design .reader-content .icon-button.active { background: #e7f0fd; border-color: #bfd5f0; }
.skat-reader-design .annotation-owner-row button,
.skat-reader-design .annotation-filter-grid button { font: 400 12px/1.4 var(--reader-ui-font); border: 1px solid var(--reader-line-color); border-radius: 5px; background: #fff; box-shadow: none; }
.skat-reader-design .annotation-owner-row button.active,
.skat-reader-design .annotation-filter-grid button.active { background: #e7f0fd; color: #0756ba; border-color: #bfd5f0; font-weight: 500; }
.skat-reader-design .annotation-manager-head strong { font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.skat-reader-design .annotation-manager-head > div > span { font-size: 12px; }
.skat-reader-design .note-type-badge { font-size: 12px; font-weight: 500; }
/* Open states are part of the reading desk, not legacy floating cards. */
.skat-reader-design .reader-icon { flex: 0 0 auto; }
.skat-reader-design .reader-workspace-toolbar { grid-row: 1; }
.skat-reader-design .reader-workspace-body { grid-row: 3; }
.skat-reader-design .reader-tool-tray { grid-row: 2; min-width: 0; padding: 12px 28px; border-bottom: 1px solid var(--reader-line-color); background: #fff; }
.skat-reader-design .reader-tool-tray:not(:has(> :not(.hidden):not([hidden]))) { display: none; }
.skat-reader-design .reader-tool-tray > :is(.reader-more-actions-panel, .reader-settings-panel, .reader-find-panel, .citation-copy-panel, .print-panel) { position: static; width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design .reader-tool-tray .mini-heading { color: var(--reader-ink); font: 500 14px/1.5 var(--reader-ui-font); letter-spacing: 0; text-transform: none; }
.skat-reader-design .reader-tool-tray .reader-more-actions-panel { display: flex; justify-content: flex-start; align-items: center; gap: 12px; }
.skat-reader-design .reader-tool-tray .reader-labeled-tool { flex: 0 0 auto; width: auto; height: auto; min-height: 38px; padding: 8px 12px; white-space: nowrap; border-color: var(--reader-line-color); }
.skat-reader-design .reader-tool-close { margin-left: auto; }
.skat-reader-design .reader-tool-tray .reader-settings-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; }
.skat-reader-design .reader-setting-group { display: flex; align-items: center; gap: 12px; }
.skat-reader-design .reader-setting-group > span { font-size: 13px; font-weight: 400; color: var(--reader-muted); text-transform: none; }
.skat-reader-design .reader-toggle-row { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: var(--reader-side); }
.skat-reader-design .reader-toggle-row button { min-width: 84px; min-height: 32px; padding: 5px 12px; border: 1px solid transparent; border-radius: 4px; background: transparent; box-shadow: none; color: var(--reader-muted); font-size: 13px; font-weight: 400; }
.skat-reader-design .reader-toggle-row button.active { border-color: #bfd5f0; background: #e7f0fd; color: #0756ba; font-weight: 500; box-shadow: none; }
.skat-reader-design .reader-find-row { width: min(100%, 800px); margin: 0 auto; grid-template-columns: auto minmax(100px, 1fr) auto auto auto auto; gap: 10px; }
.skat-reader-design .reader-tool-tray :is(input[type="search"], textarea) { padding: 8px 12px; border: 1px solid #c4d0e0; border-radius: 6px; background: #fff; box-shadow: none; font: 400 14px/1.5 var(--reader-ui-font); }
.skat-reader-design .reader-find-count { font-size: 13px; font-weight: 400; font-variant-numeric: tabular-nums; color: var(--reader-muted); }
.skat-reader-design .reader-tool-tray .print-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.skat-reader-design .print-panel label { min-height: 38px; padding: 8px 12px; border-color: var(--reader-line-color); border-radius: 6px; font-weight: 400; color: var(--reader-ink); }
.skat-reader-design .print-panel label:has(input:checked) { background: #e7f0fd; border-color: #bfd5f0; }
.skat-reader-design .print-panel input { accent-color: var(--reader-blue); }
.skat-reader-design .print-panel-actions { margin-left: auto; }
.skat-reader-design .reader-tool-tray .citation-copy-panel { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; }
.skat-reader-design .citation-copy-panel textarea { min-height: 72px; max-height: 140px; }
.skat-reader-design .side-workbench { min-width: 0; overflow-x: hidden; }
.skat-reader-design .workbench-section { min-width: 0; }
.skat-reader-design .passage-composer { gap: 12px; border-radius: 0; box-shadow: none; }
.skat-reader-design #readerCloseComposer { justify-content: flex-end; min-height: 32px; padding: 0; color: var(--reader-muted); }
.skat-reader-design .passage-composer-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skat-reader-design .passage-composer-actions #noteFromSelectionBtn { grid-column: 1 / -1; }
.skat-reader-design .passage-composer-actions .quiet-button { min-height: 36px; padding: 8px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 400; box-shadow: none; }
.skat-reader-design .passage-composer-actions .quiet-button:hover { background: #eaf0f8; box-shadow: none; }
.skat-reader-design .note-color-picker { gap: 6px; margin: 0; }
.skat-reader-design .note-color-option { min-height: 36px; padding: 0; border: 1px solid var(--reader-line-color); border-bottom: 3px solid var(--note-choice); border-radius: 5px; background: #fff; font-size: 11px; font-weight: 400; color: var(--reader-muted); box-shadow: none; }
.skat-reader-design .note-color-option span { border: 0; border-radius: 0; }
.skat-reader-design .note-color-option:has(input:checked) { background: color-mix(in srgb, var(--note-choice) 10%, white); color: var(--reader-ink); border-color: var(--note-choice); box-shadow: none; font-weight: 600; }
.skat-reader-design .note-color-option:has(input:focus-visible) { outline: 2px solid var(--reader-blue); outline-offset: 3px; }
.skat-reader-design .selection-preview { margin: 0; border-radius: 0; font-size: 13px; line-height: 1.6; }
.skat-reader-design .passage-composer textarea:focus { box-shadow: none; }
.skat-reader-design .annotation-manager-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.skat-reader-design .annotation-owner-row { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.skat-reader-design .annotation-manager button { padding: 6px 8px; }
.skat-reader-design .note-item { min-width: 0; margin: 0 0 12px; padding: 12px; border-left: 3px solid var(--note-color, var(--reader-blue)); }
.skat-reader-design .note-item:hover { transform: none; box-shadow: none; }
.skat-reader-design .note-item.active { border-color: #96bae9; border-left-color: var(--note-color, var(--reader-blue)); box-shadow: none; }
.skat-reader-design .note-card-top { flex-wrap: wrap; align-items: flex-start; }
.skat-reader-design .note-time { white-space: normal; overflow-wrap: anywhere; font-size: 11px; font-weight: 400; }
.skat-reader-design .note-type-badge { border-radius: 4px; font-size: 11px; font-weight: 500; }
.skat-reader-design .note-type-badge i { box-shadow: none; }
.skat-reader-design .passage-card-title strong { font-size: 14px; font-weight: 500; }
.skat-reader-design .passage-card-title span { font-size: 12px; }
.skat-reader-design .passage-card .note-quote { border-radius: 3px; font-size: 13px; line-height: 1.6; }
.skat-reader-design .passage-card-footer { flex-wrap: wrap; gap: 6px; }
.skat-reader-design .passage-card-footer > span { border-radius: 4px; font-weight: 400; }
.skat-reader-design .passage-card-footer .note-actions { margin: 0 0 0 auto; }
.skat-reader-design .side-workbench::before { display: none; }
.skat-reader-design .profile-bridge-card > span { font-weight: 400; color: var(--reader-muted); line-height: 1.6; }
.skat-reader-design .side-workbench :is(select, .field-label) { font-size: 13px; font-weight: 400; }
.skat-reader-design .side-workbench select { min-width: 0; width: 100%; padding: 10px; border: 1px solid #c4d0e0; border-radius: 6px; background: #fff; color: var(--reader-ink); box-shadow: none; }
.skat-reader-design .legal-compass { max-height: none; overflow: visible; margin: 20px 20px 0; }
.skat-reader-design .legal-compass-card { min-width: 0; grid-template-columns: minmax(0, 1fr); padding: 14px; gap: 14px; border: 0; border-radius: 6px; background: #fff; box-shadow: none; }
.skat-reader-design .legal-compass-main { gap: 8px; }
.skat-reader-design .legal-compass-main > span { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--reader-muted); }
.skat-reader-design .legal-compass-main strong { font-size: 16px; font-weight: 500; color: var(--reader-ink); }
.skat-reader-design .legal-compass-main small { font-size: 13px; font-weight: 400; line-height: 1.6; }
.skat-reader-design .legal-compass-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skat-reader-design :is(.legal-compass-metrics, .source-status-metrics) > span { min-width: 0; padding: 8px; border: 1px solid var(--reader-line-color); border-radius: 4px; background: var(--reader-side); font-size: 12px; font-weight: 400; color: var(--reader-muted); }
.skat-reader-design :is(.legal-compass-metrics, .source-status-metrics) strong { font-size: 17px; font-weight: 500; color: var(--reader-ink); }
.skat-reader-design .legal-compass-signals { gap: 6px; }
.skat-reader-design .legal-compass-signals span { max-width: 100%; padding: 4px 6px; border: 1px solid var(--reader-line-color); border-radius: 4px; background: var(--reader-side); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.skat-reader-design .citator-summary { min-width: 0; border: 0; background: none; }
.skat-reader-design .source-status-card { padding: 12px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: #fff; box-shadow: none; }
.skat-reader-design .source-authority-statusline { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.skat-reader-design .source-authority-statusline .source-authority-line-text { font-size: 13px; font-weight: 400; line-height: 1.6; color: var(--reader-muted); }
.skat-reader-design .source-authority-statusline strong { font-size: inherit; font-weight: 500; }
.skat-reader-design .side-workbench .source-hierarchy { gap: 4px; margin: 8px 0; }
.skat-reader-design .side-workbench .source-hierarchy .source-hierarchy-step { padding: 4px; border-radius: 4px; background: none; transform: none; box-shadow: none; color: var(--reader-muted); }
.skat-reader-design .side-workbench .source-hierarchy .source-hierarchy-step b { max-width: none; overflow: visible; font-size: 12px; font-weight: 400; }
.skat-reader-design .side-workbench .source-hierarchy .source-hierarchy-step.active { background: #e7f0fd; border-color: #bfd5f0; color: #0756ba; }
.skat-reader-design .side-workbench .source-hierarchy .source-hierarchy-divider { border: 0; background: none; color: var(--reader-muted); }
.skat-reader-design .source-passport-details { border: 1px solid var(--reader-line-color); border-radius: 5px; background: #fff; }
.skat-reader-design .source-passport-details > summary { min-height: 40px; font-size: 13px; font-weight: 400; color: var(--reader-ink); }
.skat-reader-design .source-passport-details > summary::after { content: ""; width: 18px; height: 18px; border: 0; border-radius: 0; background: url("/assets/reader/chevron-down.svg") center / 18px no-repeat; }
.skat-reader-design .source-passport-details[open] > summary::after { transform: rotate(180deg); }
.skat-reader-design .source-status-head { flex-wrap: wrap; gap: 8px; }
.skat-reader-design .source-status-head strong { font-size: 14px; font-weight: 500; line-height: 1.5; }
.skat-reader-design .source-status-head :is(span, em) { font-size: 12px; font-weight: 400; border-radius: 4px; }
.skat-reader-design .source-passport-grid { grid-template-columns: minmax(0, 1fr); }
.skat-reader-design .source-passport-grid span { padding: 8px; border: 1px solid var(--reader-line-color); border-radius: 4px; background: var(--reader-side); font-size: 13px; font-weight: 400; line-height: 1.5; }
.skat-reader-design .source-passport-grid b { font-size: 12px; font-weight: 400; text-transform: none; color: var(--reader-muted); }
.skat-reader-design .source-status-verdict { border-radius: 4px; background: var(--reader-side); font-size: 13px; line-height: 1.6; }
.skat-reader-design .source-status-verdict strong { font-weight: 500; }
.skat-reader-design .reader-content .empty-state { border-radius: 6px; background: none; font-size: 13px; font-weight: 400; line-height: 1.6; box-shadow: none; }
body:has(.skat-reader-design.reader-workspace-open) .selection-toolbar { width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid #c4d0e0; border-radius: 8px; background: #fff; box-shadow: 0 4px 14px #10284020; backdrop-filter: none; }
body:has(.skat-reader-design.reader-workspace-open) .selection-colors { flex: 0 0 auto; gap: 5px; padding-right: 10px; margin-right: 2px; border-right-color: #dce4ee; }
body:has(.skat-reader-design.reader-workspace-open) .selection-color { flex: 0 0 24px; width: 24px; height: 24px; }
body:has(.skat-reader-design.reader-workspace-open) .selection-tool { flex: 0 0 auto; min-height: 34px; padding: 6px 8px; border-radius: 5px; font-family: "Skat Inter", "Segoe UI", sans-serif; font-size: 13px; font-weight: 400; color: #12243d; }
body:has(.skat-reader-design.reader-workspace-open) .selection-tool :is(svg, img) { flex: 0 0 18px; width: 18px; height: 18px; }
body:has(.skat-reader-design.reader-workspace-open) .selection-tool:focus-visible,
body:has(.skat-reader-design.reader-workspace-open) .selection-color:focus-visible { outline: 2px solid #0965d8; outline-offset: 2px; }

@media (max-width: 1250px) {
  .skat-reader-design .topbar { grid-template-columns: 190px minmax(0, 1fr) auto; gap: 14px; padding: 0 20px; }
  .skat-reader-design .top-tabs { gap: 12px; }
  .skat-reader-design .top-tab .reader-icon { width: 20px; height: 20px; }
  .skat-reader-design .top-tab-copy strong { font-size: 14px; }
  .skat-reader-design .reader-workspace-body { grid-template-columns: 194px minmax(0, 1fr) 266px; }
  .skat-reader-design .reader-workspace-body.outline-collapsed { grid-template-columns: 52px minmax(0, 1fr) 266px; }
  .skat-reader-design .reader-workspace-body.workbench-collapsed { grid-template-columns: 194px minmax(0, 1fr); }
  .skat-reader-design .reader-workspace-body.outline-collapsed.workbench-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
  .skat-reader-design .reader-workspace-body.reader-workspace-focus { grid-template-columns: minmax(0, 1fr); }
  .skat-reader-design .reader-workspace-toolbar { grid-template-columns: 194px minmax(100px, 1fr) auto; gap: 12px; padding: 0 20px; }
  .skat-reader-design #readerFindBtn > span { display: none; }
  .skat-reader-design #readerFindBtn { margin-right: 4px; }
  .skat-reader-design .doc-header { padding-left: 26px; padding-right: 26px; }
  .skat-reader-design .reader-content .doc-text-panel pre { padding-left: 26px; padding-right: 26px; }
  .skat-reader-design .user-pill-copy strong { max-width: 90px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .skat-reader-design .doc-text-panel { scroll-behavior: auto; }
}
@media print {
  .skat-reader-design .reader-workspace-toolbar,
  .skat-reader-design .reader-tool-tray,
  .skat-reader-design .reader-workspace-outline,
  .skat-reader-design .reader-document-actions { display: none !important; }
  .skat-reader-design .reader-content,
  .skat-reader-design .reader-workspace-body,
  .skat-reader-design .reader-workspace-document { display: block !important; overflow: visible; height: auto; }
  .skat-reader-design .doc-header { padding: 0 0 20px; }
}

/* Workspace extension: existing controls and DOM remain the source of truth.
   Screen-only, module-local tokens protect the reader, landing and print output.
   Status colors, hidden/inert states, native form types and busy states survive. */
@media screen {
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) {
    --font-ui: var(--reader-ui-font);
    --ink: var(--reader-ink);
    --muted: var(--reader-muted);
    --line: var(--reader-line-color);
    --surface-tint: var(--reader-side);
    --shadow: none;
    --shadow-soft: none;
    font-family: var(--reader-ui-font);
    color: var(--reader-ink);
    background: #fff;
  }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(button, input, select, textarea, h1, h2, h3) {
    font-family: var(--reader-ui-font);
  }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(strong, b, button) { font-weight: 500; }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(.field > span, .field-label) {
    color: var(--reader-muted); font-size: 13px; font-weight: 500; line-height: 1.5; letter-spacing: 0;
  }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea) {
    min-width: 0; min-height: 40px; padding: 9px 11px; border: 1px solid #c4d0e0; border-radius: 6px;
    background: #fff; color: var(--reader-ink); font-size: 14px; line-height: 1.45; box-shadow: none;
  }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(input, select, textarea)[aria-invalid="true"] { border-color: #a53d47; }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--reader-blue); outline-offset: 2px; box-shadow: none;
  }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(.primary-button, .quiet-button, .icon-button, .case-office-action) {
    min-height: 38px; border-radius: 6px; font-size: 14px; font-weight: 500; line-height: 1.4; box-shadow: none; text-shadow: none; transform: none;
  }
  .skat-reader-design :is(.results-pane, .companies-view, .deadlines-view, .cases-view) :is(.primary-button, .case-office-action.primary) {
    color: #fff; background: var(--reader-blue); border: 1px solid var(--reader-blue);
  }
  .skat-reader-design :is(.results-pane, .companies-view, .deadlines-view, .cases-view) :is(.primary-button, .case-office-action.primary):hover:not(:disabled) { background: #0756ba; border-color: #0756ba; }
  .skat-reader-design :is(.results-pane, .companies-view, .deadlines-view, .cases-view) .primary-button::after { display: none; }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(.quiet-button, .icon-button) { background: #fff; border-color: var(--reader-line-color); }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(.quiet-button, .icon-button):hover:not(:disabled) { background: #edf3fb; }
  .skat-reader-design :is(.filters-pane, .results-pane, .companies-view, .deadlines-view, .cases-view) :is(.pane-heading, .section-title, .mini-heading, .filter-group-title) {
    font-family: var(--reader-ui-font); font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: 0; text-transform: none; color: var(--reader-ink);
  }
  .skat-reader-design :is(.companies-view, .deadlines-view, .cases-view) h1 { margin: 5px 0 0; font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; }
  .skat-reader-design :is(.companies-view, .deadlines-view) .doc-kicker { color: var(--reader-muted); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }

  /* Search: one quiet command area; readable results instead of floating tiles. */
  .skat-reader-design .filters-pane { background: var(--reader-side); border-right-color: var(--reader-line-color); }
  .skat-reader-design :is(.filter-group, .advanced-filter-panel) { padding: 16px 0; border: 0; border-bottom: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
  .skat-reader-design .filter-group-title { margin-bottom: 14px; }
  .skat-reader-design .filter-pane-heading { border-color: var(--reader-line-color); }
  .skat-reader-design .filter-heading-copy small { font-size: 12px; color: var(--reader-muted); font-weight: 400; }
  .skat-reader-design .advanced-filter-panel summary strong { font-size: 14px; }
  .skat-reader-design .research-command { gap: 12px; padding: 24px 28px 18px; background: #fff; border-bottom: 1px solid var(--reader-line-color); }
  .skat-reader-design .research-command::after { display: none; }
  .skat-reader-design .results-pane .searchbar .search-input-wrap input { min-height: 46px; height: 46px; padding-left: 44px; font-size: 15px; }
  .skat-reader-design .search-submit { min-height: 46px; min-width: 164px; }
  .skat-reader-design :is(.research-toggle-button, .active-filter-chip) { border: 1px solid var(--reader-line-color); border-radius: 5px; background: #fff; box-shadow: none; font-size: 13px; font-weight: 400; }
  .skat-reader-design .research-toggle-button.active,
  .skat-reader-design .research-toggle-button[aria-pressed="true"] { color: #0756ba; background: #e7f0fd; border-color: #a6c5ee; }
  .skat-reader-design .results-toolbar { min-height: 56px; padding: 10px 28px; background: var(--reader-side); color: var(--reader-muted); border-color: var(--reader-line-color); font-size: 14px; }
  .skat-reader-design .result-list { padding: 0 28px; background: #fff; }
  .skat-reader-design :is(.result-row, .direct-match-card) { gap: 10px; margin: 0; padding: 22px 16px; border: 0; border-bottom: 1px solid var(--reader-line-color); border-left: 3px solid transparent; border-radius: 0; background: #fff; box-shadow: none; transform: none; }
  .skat-reader-design :is(.result-row, .direct-match-card):hover { background: #f6f8fb; box-shadow: none; transform: none; }
  .skat-reader-design :is(.result-row, .direct-match-card).active { background: #edf4fe; border-left-color: var(--reader-blue); box-shadow: none; }
  .skat-reader-design .result-row.favorite { border-left-color: #b57614; }
  .skat-reader-design .result-title { font: 500 18px/1.45 var(--reader-ui-font); letter-spacing: -.2px; color: var(--reader-ink); }
  .skat-reader-design .result-card-head { align-items: baseline; gap: 12px; }
  .skat-reader-design .result-row .result-citation { font-size: 13px; font-weight: 600; }
  .skat-reader-design .result-snippet { font-size: 14px; line-height: 1.65; color: var(--reader-muted); -webkit-line-clamp: 3; }
  .skat-reader-design .result-relevance-line { padding: 6px 8px; border-radius: 4px; font-size: 12px; line-height: 1.5; box-shadow: none; }
  .skat-reader-design .result-relevance-line strong { font-weight: 500; font-size: 12px; }
  .skat-reader-design .result-tags { max-height: none; flex-wrap: wrap; }
  .skat-reader-design .result-tags .chip { border-radius: 4px; font-size: 12px; font-weight: 400; background: var(--reader-side); }
  .skat-reader-design .pager { padding: 12px 28px; background: #fff; border-color: var(--reader-line-color); font-size: 13px; }
  .skat-reader-design .research-start-state { min-height: 320px; background: #fff; }
  .skat-reader-design .research-start-state::before,
  .skat-reader-design .research-start-state::after { display: none; }
  .skat-reader-design .research-start-main strong { font: 600 28px/1.35 var(--reader-ui-font); letter-spacing: -.5px; }
  .skat-reader-design .research-start-main :is(span, p) { font-family: var(--reader-ui-font); font-weight: 400; line-height: 1.65; }

  /* CVR: keep every source/status signal, simplify only neutral scaffolding. */
  .skat-reader-design .companies-layout { grid-template-columns: 300px minmax(0, 1fr); }
  .skat-reader-design .companies-sidebar { padding: 24px 20px; background: var(--reader-side); border-color: var(--reader-line-color); }
  .skat-reader-design .company-support-box { padding: 14px 0; margin: 8px 0 16px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .skat-reader-design .company-support-box span { font-size: 13px; line-height: 1.6; color: var(--reader-muted); }
  .skat-reader-design .company-header { padding: 24px 28px; background: #fff; border-color: var(--reader-line-color); box-shadow: none; }
  .skat-reader-design .company-header::after { display: none; }
  .skat-reader-design .company-actions { gap: 8px; flex-wrap: wrap; }
  .skat-reader-design .company-tabs { gap: 16px; padding: 0 28px; border-radius: 0; background: #fff; border-color: var(--reader-line-color); box-shadow: none; }
  .skat-reader-design .company-tab { min-height: 48px; padding: 10px 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; color: var(--reader-muted); font-size: 14px; font-weight: 500; transform: none; }
  .skat-reader-design .company-tab:hover { color: var(--reader-ink); background: var(--reader-side); }
  .skat-reader-design .company-tab.active { color: var(--reader-blue); background: none; border-bottom-color: var(--reader-blue); box-shadow: none; }
  .skat-reader-design .company-tab.active:focus-visible { outline-color: var(--reader-blue); }
  .skat-reader-design .company-workspace { padding: 24px 28px; background: var(--reader-side); }
  .skat-reader-design .company-panel { padding: 22px; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .skat-reader-design .company-empty { padding: 28px 0; border: 0; background: none; font-size: 14px; line-height: 1.65; box-shadow: none; }
  .skat-reader-design .company-empty strong { font-size: 18px; font-weight: 500; }
  .skat-reader-design :is(.company-result-item, .company-source-box, .company-summary-card, .company-metric, .company-detail, .company-brief-shell, .company-brief-card, .company-lawyer-summary, .company-report-item, .company-source-passport-card, .company-timeline-priority-panel, .company-timeline-priority-card, .company-timeline-item) {
    border-radius: 6px; background-image: none; box-shadow: none;
  }
  .skat-reader-design .company-result-item { padding: 14px 12px; background: #fff; border-color: var(--reader-line-color); }
  .skat-reader-design .company-result-item.active { background: #e7f0fd; border-color: #a6c5ee; }
  .skat-reader-design .companies-view.company-profile-open .companies-sidebar { background: var(--reader-side); }
  .skat-reader-design .companies-view.company-profile-open .company-search-form .field span { font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; text-transform: none; color: var(--reader-muted); }
  .skat-reader-design .companies-view.company-profile-open .company-search-form :is(input, select, .primary-button) { border-radius: 6px; min-height: 40px; }
  .skat-reader-design .companies-view.company-profile-open .company-result-item { border-radius: 6px; box-shadow: none; }
  .skat-reader-design .company-result-top strong { font-size: 14px; font-weight: 600; }
  .skat-reader-design .company-brief-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; background-color: var(--reader-side); }
  .skat-reader-design .company-brief-main > strong { font-size: 24px; font-weight: 600; line-height: 1.35; }
  .skat-reader-design :is(.company-summary-card, .company-metric, .company-detail) :is(span, small) { font-size: 12px; line-height: 1.5; font-weight: 400; }
  .skat-reader-design .company-report-preview { padding: 20px; border-radius: 6px; background: var(--reader-side); font-size: 13px; line-height: 1.7; }
  .skat-reader-design .company-pass { border-radius: 6px; background: var(--reader-side); box-shadow: none; }
  .skat-reader-design .company-pass::before { display: none; }
  .skat-reader-design .company-pass-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 20px; }
  .skat-reader-design .company-pass-identity > strong { font: 600 24px/1.35 var(--reader-ui-font); letter-spacing: -.4px; overflow-wrap: anywhere; }
  .skat-reader-design .company-pass-rail :is(span, b),
  .skat-reader-design .company-pass-facts b { font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--reader-muted); }
  .skat-reader-design .company-pass-rail-meta small { flex-wrap: wrap; border-radius: 4px; font-weight: 400; line-height: 1.5; }
  .skat-reader-design .company-pass-facts span { border-radius: 4px; font-weight: 400; line-height: 1.5; flex-wrap: wrap; }
  .skat-reader-design :is(.company-pass-status, .company-pass-critical) { border-radius: 4px; font-weight: 500; line-height: 1.5; box-shadow: none; }
  .skat-reader-design .company-pass-metric { border-radius: 5px; background: #fff; box-shadow: none; }
  .skat-reader-design .company-pass-metric span { font-size: 12px; font-weight: 400; }
  .skat-reader-design .company-pass-metric :is(strong, small) { line-height: 1.5; }
  .skat-reader-design :is(.company-legal-timeline, .company-change-overview) { border-radius: 6px; background: var(--reader-side); box-shadow: none; }

  /* Deadlines: left input / right conclusion, no business-rule changes. */
  .skat-reader-design .deadline-main { background: var(--reader-side); }
  .skat-reader-design .deadline-header { margin: 0; padding: 24px 28px; border: 0; border-bottom: 1px solid var(--reader-line-color); border-radius: 0; background: #fff; box-shadow: none; }
  .skat-reader-design .deadline-header::after { display: none; }
  .skat-reader-design .deadline-mode-tabs { justify-self: start; margin: 0 28px 20px; padding: 0; border: 0; border-bottom: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
  .skat-reader-design .deadline-mode-tabs button { min-width: 210px; min-height: 66px; padding: 12px 16px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--reader-muted); box-shadow: none; transform: none; }
  .skat-reader-design .deadline-mode-tabs button span { font-size: 14px; font-weight: 500; }
  .skat-reader-design .deadline-mode-tabs button small { margin-top: 4px; font-size: 12px; font-weight: 400; }
  .skat-reader-design .deadline-mode-tabs button.active { color: var(--reader-blue); background: #fff; border-bottom-color: var(--reader-blue); }
  .skat-reader-design .deadline-mode-tabs button.active :is(span, small) { color: inherit; }
  .skat-reader-design .deadlines-view .deadline-mode-tabs button.active:focus-visible { outline-color: var(--reader-blue); }
  .skat-reader-design :is(.deadline-quick-workspace, .deadline-workspace) { margin: 0 28px 24px; gap: 20px; grid-template-columns: minmax(380px, .85fr) minmax(0, 1.15fr); }
  .skat-reader-design .deadline-panel { padding: 22px; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .skat-reader-design .deadline-context-note { padding: 0 0 16px; border: 0; border-radius: 0; background: none; color: var(--reader-muted); font-size: 13px; font-weight: 400; line-height: 1.6; }
  .skat-reader-design .deadline-context-note { display: block; }
  .skat-reader-design .deadline-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 0 0 auto; align-self: start; min-height: 0; height: auto; overflow: visible; border-radius: 6px; }
  .skat-reader-design .deadline-summary-grid .deadline-summary-card :is(span, strong) { display: block; line-height: 1.5; overflow-wrap: anywhere; }
  .skat-reader-design .deadline-summary-grid .deadline-summary-card span { font-size: 12px; color: var(--reader-muted); }
  .skat-reader-design .deadline-quick-facts dt { color: var(--reader-muted); font-size: 12px; font-weight: 400; text-transform: none; }
  .skat-reader-design .deadline-quick-facts dd { font-size: 14px; font-weight: 500; line-height: 1.5; }
  .skat-reader-design .deadline-detail-drawer { border-radius: 6px; background: #fff; box-shadow: none; }
  .skat-reader-design .deadline-detail-drawer summary { font-weight: 500; }
  .skat-reader-design .deadline-detail-drawer summary small { color: var(--reader-muted); font-weight: 400; }
  .skat-reader-design .deadline-detail-drawer summary::after { border-radius: 4px; font-weight: 400; }
  .skat-reader-design :is(.deadline-kind-toggle, .deadline-track-toggle) { padding: 4px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: var(--reader-side); box-shadow: none; }
  .skat-reader-design :is(.deadline-kind-toggle, .deadline-track-toggle) label { border-radius: 4px; font-size: 13px; font-weight: 500; background: none; box-shadow: none; }
  .skat-reader-design :is(.deadline-kind-toggle, .deadline-track-toggle) label:has(input:checked) { color: #0756ba; background: #e3edfc; box-shadow: none; }
  .skat-reader-design :is(.deadline-form-section-title strong, .deadline-section-heading strong) { font-size: 14px; font-weight: 600; }
  .skat-reader-design :is(.deadline-summary-card, .deadline-next-action, .deadline-quick-conclusion, .deadline-warning, .deadline-period-card) { border-radius: 6px; background-image: none; box-shadow: none; }

  /* Cases: content-sized rows remove the former full-height stretched header. */
  .app-shell.skat-reader-design.case-view-active { grid-template-columns: minmax(0, 1fr); }
  .app-shell.skat-reader-design.case-view-active .case-main { min-height: calc(100dvh - 72px); grid-template-rows: auto; grid-auto-rows: auto; padding: 28px; gap: 24px; background: var(--reader-side); }
  .app-shell.skat-reader-design.case-view-active .case-office-overview { align-content: start; grid-auto-rows: max-content; gap: 24px; padding: 0; margin: 0 auto; background: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-heading { align-items: flex-start; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-heading .mini-heading { margin: 0 0 10px; font-size: 26px; font-weight: 600; line-height: 1.3; letter-spacing: -.5px; text-transform: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-heading p { color: var(--reader-muted); font-size: 14px; line-height: 1.6; }
  .app-shell.skat-reader-design.case-view-active .case-office-metric { border-radius: 5px; background-image: none; box-shadow: none; font-size: 12px; }
  .app-shell.skat-reader-design.case-view-active .case-office-toolbar { padding: 0; }
  .app-shell.skat-reader-design.case-view-active .case-office-filters { padding: 4px; border: 1px solid var(--reader-line-color); border-radius: 6px; background: #fff; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-filter { min-height: 36px; padding: 7px 16px; border: 0; border-radius: 4px; background: none; color: var(--reader-muted); font-size: 14px; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-filter.active { background: #e7f0fd; color: #0756ba; }
  .app-shell.skat-reader-design.case-view-active .case-office-table { padding: 0; gap: 0; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-head { padding: 14px 18px; color: var(--reader-muted); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; background: var(--reader-side); }
  .app-shell.skat-reader-design.case-view-active .case-office-row { min-height: 90px; padding: 16px 18px; border: 0; border-top: 1px solid var(--reader-line-color); border-radius: 0; background: #fff; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-row:hover { background: #f6f8fb; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-row.active { background: #edf4fe; box-shadow: inset 3px 0 var(--reader-blue); }
  .app-shell.skat-reader-design.case-view-active :is(.case-office-case, .case-office-next) strong { font-size: 14px; font-weight: 500; line-height: 1.5; }
  .app-shell.skat-reader-design.case-view-active :is(.case-office-case, .case-office-next, .case-stage-cell) small { font-size: 12px; line-height: 1.5; }
  .app-shell.skat-reader-design.case-view-active .case-office-row :is(strong, small) { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
  .app-shell.skat-reader-design.case-view-active .case-estimate-pill { white-space: normal; font-size: 12px; font-weight: 500; line-height: 1.5; border-radius: 4px; }
  .app-shell.skat-reader-design.case-view-active .case-office-empty { padding: 32px; gap: 10px; background: #fff; }
  .app-shell.skat-reader-design.case-view-active :is(.case-office-create, .case-office-inline-editor, .case-command-card, .case-process-workbench, .case-room-content) { border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-office-create { padding: 22px; gap: 18px; }
  .app-shell.skat-reader-design.case-view-active .case-process-chip { border-radius: 4px; background-image: none; box-shadow: none; }
  .app-shell.skat-reader-design.case-view-active .case-process-chip :is(strong, small) { font-size: 12px; font-weight: 400; line-height: 1.5; }

  @media (min-width: 1181px) {
    .app-shell.skat-reader-design.case-view-active :is(.case-office-head, .case-office-row) { grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .65fr) minmax(200px, 1fr) minmax(250px, 1.15fr) minmax(110px, .5fr); }
  }
  @media (max-width: 999px) {
    .skat-reader-design :is(.deadline-quick-workspace, .deadline-workspace) {
      margin-inline: 12px;
      grid-template-columns: minmax(0, 1fr);
    }
    .skat-reader-design .deadline-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 820px) {
    .app-shell.skat-reader-design:has(> .deadlines-view:not(.view-hidden)) {
      height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: auto auto !important;
    }
    .skat-reader-design .deadlines-view:not(.view-hidden) { height: auto; grid-row: 2; }
    .skat-reader-design :is(.deadlines-layout, .deadline-main) {
      height: auto; overflow: visible; grid-template-rows: auto; grid-auto-rows: auto;
    }
    .skat-reader-design :is(.deadline-quick-workspace, .deadline-workspace) {
      height: auto; overflow: visible; grid-template-rows: auto; grid-auto-rows: auto;
    }
    .skat-reader-design .deadline-panel { height: auto; overflow: visible; grid-template-columns: minmax(0, 1fr); }
    .skat-reader-design .deadline-panel > * { min-width: 0; overflow-wrap: anywhere; }
    .skat-reader-design .deadline-header { padding: 18px 12px; flex-wrap: wrap; }
    .skat-reader-design .deadline-header > div { min-width: 0; }
    .skat-reader-design .deadline-header-actions { flex: 0 0 auto; }
    .skat-reader-design .deadline-mode-tabs { margin-inline: 12px; max-width: calc(100% - 24px); }
    .skat-reader-design .deadline-mode-tabs button { min-width: 0; flex: 1 1 0; padding-inline: 10px; }
    .skat-reader-design .deadline-panel { padding: 16px; }
  }
  @media (min-width: 1000px) and (max-width: 1250px) {
    .skat-reader-design .companies-layout { grid-template-columns: 266px minmax(0, 1fr); }
    .skat-reader-design :is(.company-header, .company-workspace) { padding-inline: 20px; }
    .skat-reader-design .company-tabs { gap: 12px; padding-inline: 20px; flex-wrap: wrap; }
    .skat-reader-design .company-brief-shell { grid-template-columns: minmax(0, 1fr); }
    .skat-reader-design .company-pass-body { grid-template-columns: minmax(0, 1fr); }
    .skat-reader-design :is(.deadline-quick-workspace, .deadline-workspace) { margin-inline: 20px; grid-template-columns: minmax(360px, 1fr) minmax(0, 1.15fr); }
  }
}

/* The document owns the phone workspace. Override the legacy search layout's
   !important rows only while an actual document is open. Original controls,
   source text and note handlers stay in place; secondary panels expand in flow. */
@media screen and (max-width: 820px) {
  html:has(.app-shell.skat-reader-design.reader-workspace-open),
  body:has(> .app-shell.skat-reader-design.reader-workspace-open) { overflow: clip; }
  .app-shell.skat-reader-design.reader-workspace-open {
    position: fixed; inset: 0;
    grid-template-rows: auto minmax(0, 1fr) !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .app-shell.skat-reader-design.reader-workspace-open > .reader-pane {
    grid-row: 2 !important; height: 100%; min-height: 0;
  }
  .skat-reader-design.reader-workspace-open .reader-content {
    display: flex; flex-direction: column; height: 100%; overflow: hidden;
  }
  .skat-reader-design .reader-workspace-toolbar {
    flex: 0 0 auto; grid-template-columns: 44px minmax(0, 1fr);
    gap: 4px 8px; padding: 8px 12px;
  }
  .skat-reader-design #readerBackToResults { min-width: 0; gap: 6px; }
  .skat-reader-design #readerBackToResults span { display: none; }
  .skat-reader-design .reader-workspace-search { grid-row: 1; grid-column: 2; }
  .skat-reader-design .reader-workspace-toolbar .doc-actions {
    grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; justify-content: space-between; gap: 2px;
  }
  .skat-reader-design .reader-content :is(.icon-button, .reader-text-button) { min-width: 40px; min-height: 44px; }
  .skat-reader-design #readerZoomValue { min-width: 44px; padding-inline: 4px; }
  .skat-reader-design #readerFindBtn { margin: 0; padding: 8px; }
  .skat-reader-design .reader-tool-tray { flex: 0 0 auto; min-height: 0; max-height: 50dvh; overflow: auto; padding: 12px; }
  .skat-reader-design .reader-tool-tray :is(.reader-more-actions-panel, .reader-setting-group) { flex-wrap: wrap; gap: 8px; }
  .skat-reader-design .reader-find-row { display: flex; flex-wrap: wrap; gap: 6px; }
  .skat-reader-design .reader-find-row input { flex: 1 1 180px; width: auto; min-width: 0; }
  .skat-reader-design .reader-tool-tray .citation-copy-panel { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .skat-reader-design .reader-workspace-body {
    display: flex; flex-direction: column; flex: 1 1 auto; overflow-x: hidden; overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .skat-reader-design .reader-workspace-body > * { flex: 0 0 auto; width: 100%; box-sizing: border-box; }
  .skat-reader-design .reader-workspace-body .reader-workspace-outline {
    padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--reader-line-color); overflow: visible;
  }
  .skat-reader-design .reader-workspace-body .reader-panel-heading { margin: 0; }
  .skat-reader-design .reader-workspace-body .reader-panel-heading strong { display: block; }
  .skat-reader-design .reader-workspace-body .reader-workspace-document { display: block; overflow: visible; }
  .skat-reader-design .reader-workspace-body .side-workbench { height: auto; overflow: visible; border-left: 0; border-bottom: 1px solid var(--reader-line-color); }
  .skat-reader-design .reader-workspace-body .workbench-panel { height: auto; max-height: none; overflow: visible; }
  .skat-reader-design .reader-notes-empty { padding-top: 20px; }
  .skat-reader-design .doc-header,
  .skat-reader-design .reader-content.doc-header-collapsed .doc-header { padding: 20px 16px 16px; }
  .skat-reader-design .reader-document-actions { position: static; margin-top: 12px; justify-content: flex-end; }
  .skat-reader-design :is(.doc-kicker, .reader-document-metadata) { padding-right: 0; overflow-wrap: anywhere; }
  .skat-reader-design .doc-header #docTitle { margin-top: 12px; font-size: 23px; overflow-wrap: anywhere; }
  .skat-reader-design .reader-workspace-document > .doc-text-panel { height: auto; max-height: none; overflow: visible; }
  .skat-reader-design .doc-text-panel pre { width: 100%; padding: 20px 16px 48px; box-sizing: border-box; overflow-wrap: anywhere; }
  .skat-reader-design .source-identity-banner { padding-inline: 16px; }
  .skat-reader-design .workbench-tabs { flex-wrap: wrap; }
}

@media (max-width: 760px) and (max-height: 480px) {
  .skat-reader-design .reader-workspace-body .workbench-tabs { position: static; }
}

@media screen and (max-width: 820px) {
  /* Returning to results minimizes the reader. Give that space back to the list. */
  .app-shell.skat-reader-design.reader-minimized:has(> .results-pane:not(.view-hidden)) {
    grid-template-rows: auto 56px minmax(0, 1fr) 48px !important;
  }
  .skat-reader-design:not(.reader-workspace-open) > .results-pane:not(.view-hidden) {
    grid-template-rows: auto auto minmax(max-content, 1fr) auto;
    overflow-y: auto;
  }
  .skat-reader-design.reader-minimized .reader-collapsed:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .skat-reader-design.reader-minimized .reader-collapsed span {
    writing-mode: horizontal-tb;
    transform: none;
  }
}

/* Skat desktop completion. Presentation only: no hidden/inert, permission,
   annotation-color, print, public landing or source-content overrides. */
@media screen {
  /* Dark reader header only; keep the original mark on light auth surfaces. */
  .skat-reader-design .topbar .brand-mark-logo img {
    content: url("/assets/retskilden-mark.png?v=20260927-2");
    mix-blend-mode: screen;
  }
  /* Non-reader views must not inherit the reader's fixed-width grid tracks. */
  .skat-reader-design:has(> :is(.profiles-view, .admin-view, .deadlines-view, .companies-view)[aria-hidden="false"]) { grid-template-columns: minmax(0, 1fr); }
  .skat-reader-design :is(.profiles-view, .admin-view) {
    --font-ui: var(--reader-ui-font);
    --ink: var(--reader-ink);
    --muted: var(--reader-muted);
    --line: var(--reader-line-color);
    --surface-tint: var(--reader-side);
    font-family: var(--reader-ui-font);
    color: var(--reader-ink);
    background: var(--reader-side);
  }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(button, input, textarea, select) {
    font-family: var(--reader-ui-font);
    font-size: 14px;
    line-height: 1.5;
    border-radius: 6px;
    box-shadow: none;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(input:not([type="radio"]):not([type="checkbox"]), select, textarea) {
    min-width: 0;
    max-width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--reader-line-color);
    color: var(--reader-ink);
    background: #fff;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) textarea { resize: vertical; }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(.quiet-button, .primary-button, .icon-button) {
    min-height: 38px;
    font-weight: 500;
    background-image: none;
    transform: none;
    text-shadow: none;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) .primary-button {
    color: #fff;
    border-color: var(--reader-blue);
    background: var(--reader-blue);
  }
  .skat-reader-design :is(.profiles-view, .admin-view) .primary-button::after { content: none; }
  .skat-reader-design :is(.profiles-view, .admin-view) .quiet-button { background-color: #fff; }
  .skat-reader-design :is(.profiles-view, .admin-view) .quiet-button:hover:not(:disabled) { background-color: #edf4fe; }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(button, a, input, textarea, select, summary):focus-visible,
  .skat-reader-design .account-menu :is(a, button):focus-visible {
    outline: 2px solid var(--reader-blue);
    outline-offset: 3px;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) [aria-invalid="true"] { border-color: #b44b3f; }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(button, input, select, textarea):disabled {
    opacity: .65;
    cursor: not-allowed;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(.doc-kicker, .section-title, .pane-heading, .mini-heading) {
    font-family: var(--reader-ui-font);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }
  .skat-reader-design :is(.profiles-view, .admin-view) :is(.empty-state, .empty-card, .admin-operations-empty) {
    padding: 24px 16px;
    border-radius: 6px;
    background-image: none;
    box-shadow: none;
    color: var(--reader-muted);
    font-size: 14px;
    line-height: 1.65;
  }

  /* Analyse: fluid header actions, readable material and explicit modes. */
  .skat-reader-design .profiles-layout { grid-template-columns: 280px minmax(0, 1fr); }
  .skat-reader-design .profiles-sidebar { padding: 24px 18px; background: var(--reader-side); }
  .skat-reader-design .profiles-view .profile-main { min-width: 0; background: #fff; }
  .skat-reader-design .profiles-view .profile-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 28px;
    background: #fff;
    border-bottom: 1px solid var(--reader-line-color);
    box-shadow: none;
  }
  .skat-reader-design .profile-header::after { content: none; }
  .skat-reader-design .profile-header > div:first-child { flex: 1 1 260px; }
  .skat-reader-design .profile-header .doc-kicker { font-size: 12px; line-height: 1.5; color: var(--reader-muted); }
  .skat-reader-design :is(.profile-header, .admin-header) h1 {
    margin: 6px 0 0;
    font: 600 26px/1.35 var(--reader-ui-font);
    letter-spacing: -.5px;
    overflow-wrap: anywhere;
  }
  .skat-reader-design .profile-actions { flex: 1 1 390px; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  .skat-reader-design .profile-actions :is(select, .entity-case-link) { max-width: 100%; min-width: 0; }
  .skat-reader-design .profile-mode-tabs {
    margin: 0;
    padding: 0 28px;
    gap: 24px;
    border: 0;
    border-bottom: 1px solid var(--reader-line-color);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    flex-wrap: wrap;
  }
  .skat-reader-design .profile-mode-tabs button {
    min-width: 0;
    min-height: 64px;
    padding: 12px 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: none;
    color: var(--reader-muted);
    box-shadow: none;
    transform: none;
  }
  .skat-reader-design .profile-mode-tabs button span { font-size: 14px; font-weight: 500; }
  .skat-reader-design .profile-mode-tabs button small { font-size: 12px; font-weight: 400; line-height: 1.5; }
  .skat-reader-design .profile-mode-tabs button.active { color: var(--reader-blue); border-bottom-color: var(--reader-blue); background: none; box-shadow: none; }
  .skat-reader-design .profile-mode-tabs button.active :is(span, small) { color: inherit; }
  .skat-reader-design .profile-mode-tabs button:hover { background: var(--reader-side); }
  .skat-reader-design .profile-workspace {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 20px;
    padding: 24px 28px;
    background: var(--reader-side);
    overflow: auto;
    align-content: start;
    grid-template-rows: max-content;
    grid-auto-rows: max-content;
    align-items: start;
  }
  .skat-reader-design .profile-workspace:is([data-profile-mode="sources"], [data-profile-mode="contributions"], [data-profile-mode="report"]) {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }
  .skat-reader-design .profile-panel { min-width: 0; padding: 20px; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; overflow: visible; }
  .skat-reader-design .profile-card-title { display: flex; flex-wrap: wrap; gap: 6px; }
  .skat-reader-design .profile-card-title strong { flex: 1 1 100%; }
  .skat-reader-design .profiles-view .issue-insight { grid-template-columns: minmax(0, 1fr); }
  .skat-reader-design .profiles-view :is(.issue-insight-title strong, .profile-doc-item strong, .profile-source-group > header strong) { font-size: 14px; font-weight: 500; line-height: 1.5; }
  .skat-reader-design .profiles-view .profile-doc-item { border-radius: 6px; background-image: none; box-shadow: none; }
  .skat-reader-design .profiles-view :is(.profile-create-shell, .profile-insight-composer, .profile-collaboration) {
    border: 1px solid var(--reader-line-color);
    border-radius: 6px;
    background: #fff;
    box-shadow: none;
  }
  .skat-reader-design .profile-create-shell > summary { flex-direction: column; gap: 5px; padding: 14px; }
  .skat-reader-design :is(.profile-create-shell, .profile-insight-composer) > summary :is(strong, span, small) { font-weight: 400; line-height: 1.5; }
  .skat-reader-design :is(.profile-create-shell, .profile-insight-composer) > summary strong { font-size: 14px; font-weight: 500; }
  .skat-reader-design :is(.profile-create-shell, .profile-insight-composer) > summary :is(span, small) { color: var(--reader-muted); font-size: 12px; }
  .skat-reader-design .profile-scope-field { grid-template-columns: minmax(0, 1fr); }
  .skat-reader-design .profile-scope-field label { padding: 0; border-radius: 5px; box-shadow: none; background-image: none; }
  .skat-reader-design .profile-scope-field label > span { min-width: 0; border-radius: 5px; background: #fff; box-shadow: none; }
  .skat-reader-design .profile-scope-field input:checked + span { border-color: var(--reader-blue); background: #edf4fe; box-shadow: none; }
  .skat-reader-design .profile-scope-field input:focus-visible + span { outline: 2px solid var(--reader-blue); outline-offset: 3px; }
  .skat-reader-design .profile-scope-field :is(strong, small) { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
  .skat-reader-design .profile-scope-field strong { font-size: 14px; font-weight: 500; }
  .skat-reader-design .profile-scope-field small { color: var(--reader-muted); font-size: 12px; font-weight: 400; }
  .skat-reader-design .profiles-view :is(.profile-list-item, .profile-item, .profile-doc, .issue-card, .issue-insight, .insight-item, .annotation-item, .activity-item, .insight-source-preview) {
    min-width: 0;
    border-radius: 6px;
    background-image: none;
    box-shadow: none;
    transform: none;
  }
  .skat-reader-design .profiles-view :is(.profile-issue-board, .profile-doc-list, .profile-annotation-list) article { border-radius: 6px; box-shadow: none; background-image: none; }
  .skat-reader-design .profiles-view :is(.issue-card header strong, .insight-item strong, .annotation-item strong, .profile-list-item strong) { font-size: 14px; font-weight: 500; line-height: 1.5; }
  .skat-reader-design .profiles-view :is(.issue-insight-main p, .issue-insight blockquote, .insight-item p, .annotation-item p) { font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
  .skat-reader-design .profiles-view :is(.profile-scope-badge, .issue-status-select, .profile-filter-context) { border-radius: 4px; font-weight: 500; box-shadow: none; }
  .skat-reader-design .profiles-view :is(.annotation-manager-summary, .profile-filter-context) { border-radius: 6px; background: var(--reader-side); box-shadow: none; }
  .skat-reader-design .profiles-view .annotation-manager-summary article strong { font-size: 22px; font-weight: 600; }
  .skat-reader-design .profiles-view .annotation-manager-summary article span { font-size: 12px; font-weight: 400; line-height: 1.5; }

  /* Administration uses page scrolling, not three clipped narrow columns. */
  .skat-reader-design .admin-layout { grid-template-columns: 260px minmax(0, 1fr); background: var(--reader-side); }
  .skat-reader-design .admin-sidebar { padding: 24px 18px; background: var(--reader-side); }
  .skat-reader-design .admin-main { display: block; min-width: 0; overflow-y: auto; overflow-x: hidden; background: var(--reader-side); }
  .skat-reader-design .admin-header { padding: 24px 28px; flex-wrap: wrap; align-items: flex-start; background: #fff; }
  .skat-reader-design .admin-dashboard { margin: 0; padding: 20px 28px; gap: 16px; grid-template-columns: minmax(0, 1fr); background: var(--reader-side); }
  .skat-reader-design .admin-dashboard-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .skat-reader-design .admin-grid { margin: 0; padding: 0 28px 24px; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); background: none; overflow: visible; }
  .skat-reader-design .admin-panel { padding: 20px; overflow: visible; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .skat-reader-design .admin-audit-panel { grid-column: 1 / -1; min-height: 0; }
  .skat-reader-design .admin-view :is(.admin-metric-card, .admin-health-card, .admin-quality-metric, .admin-quality-item, .admin-audit-item, .admin-principle-card, .admin-warning, .user-list-item, .access-item) { border-radius: 6px; background-image: none; box-shadow: none; }
  .skat-reader-design .admin-metric-card { padding: 14px; background: #fff; }
  .skat-reader-design .admin-metric-card strong { font-size: 24px; font-weight: 600; }
  .skat-reader-design .admin-metric-card :is(span, small) { font-weight: 400; }
  .skat-reader-design .admin-view :is(.admin-metric-card span, .admin-metric-card small, .admin-principle-card span, .user-list-item small) { color: var(--reader-muted); font-size: 12px; line-height: 1.6; }
  .skat-reader-design .admin-security-pill { border-radius: 4px; font-weight: 500; }
  .skat-reader-design .team-create { padding-block: 16px; gap: 12px; }
  .skat-reader-design .team-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skat-reader-design .admin-view :is(.user-list-item, .admin-audit-item, .profile-access-list) { overflow-wrap: anywhere; }
  .skat-reader-design .admin-technical-details { margin: 0 28px 24px; border: 1px solid var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: none; }
  .skat-reader-design .admin-technical-details > summary { padding: 18px 20px; border-radius: 8px; background: #fff; box-shadow: none; }
  .skat-reader-design .admin-technical-details > summary strong { font-size: 14px; font-weight: 500; }
  .skat-reader-design .admin-technical-details > summary :is(span, small) { font-size: 12px; font-weight: 400; line-height: 1.6; }
  .skat-reader-design .admin-technical-body { padding: 0 20px 20px; }
  .skat-reader-design .admin-view :is(.admin-quality-head, .admin-quality-summary, .admin-operations-head) { border-radius: 6px; background-image: none; box-shadow: none; }

  /* Secondary workspaces retain all graph, status and business-state rules. */
  .skat-reader-design :is(.cases-view, .companies-view, .deadlines-view) :is(.case-room-panel, .case-room-hero-main, .case-link-panel, .case-overview-item, .case-activity-item, .company-relation-item, .company-report-item, .company-network-expand, .company-network-node, .company-network-edge, .company-financial-card, .company-source-card, .deadline-case-item) {
    border-radius: 6px;
    background-image: none;
    box-shadow: none;
  }
  .skat-reader-design .case-room-tabs { gap: 20px; border-radius: 0; border-bottom: 1px solid var(--reader-line-color); background: #fff; box-shadow: none; flex-wrap: wrap; }
  .skat-reader-design .case-room-tabs button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 2px; color: var(--reader-muted); font: 500 14px/1.5 var(--reader-ui-font); background: none; box-shadow: none; transform: none; }
  .skat-reader-design .case-room-tabs button.active { border-bottom-color: var(--reader-blue); color: var(--reader-blue); background: none; }
  .skat-reader-design .case-room-tabs button.active :is(span, small) { color: inherit; }
  .skat-reader-design .case-room-tabs button:focus-visible { outline: 2px solid var(--reader-blue); outline-offset: 3px; }
  .skat-reader-design .companies-view :is(.company-graph-shell, .company-corporate-tree, .company-relation-workbench-shell, .company-brief-actions, .company-graph .empty-state) { border-radius: 6px; background-image: none; box-shadow: none; }
  .skat-reader-design .company-graph-mode { border-radius: 5px; background: var(--reader-side); box-shadow: none; }
  .skat-reader-design .company-graph-mode button { min-height: 36px; border-radius: 4px; font: 500 13px/1.5 var(--reader-ui-font); background: none; box-shadow: none; }
  .skat-reader-design .company-graph-mode button.active { color: #0756ba; background: #e3edfc; box-shadow: none; }
  .skat-reader-design .companies-view .company-accounts-empty { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; padding: 16px; border-radius: 6px; background-image: none; box-shadow: none; }
  .skat-reader-design .company-accounts-empty > div { display: grid; flex: 1 1 300px; min-width: 0; gap: 6px; }
  .skat-reader-design .company-accounts-empty strong { font-size: 14px; font-weight: 500; line-height: 1.5; }
  .skat-reader-design .company-accounts-empty span { font-size: 14px; font-weight: 400; line-height: 1.6; color: var(--reader-muted); }
  .skat-reader-design .companies-view .company-inline-action { min-height: 38px; flex-shrink: 0; border-radius: 5px; padding: 8px 12px; font: 500 13px/1.5 var(--reader-ui-font); box-shadow: none; background-image: none; }

  /* CVR desktop: retain source facts and controls; remove redundant framing. */
  @media (min-width: 1121px) {
    .skat-reader-design #companyPanelNetwork .company-graph-shell { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
    .skat-reader-design #companyGraph[data-company-graph-state="ready"] { min-width: 0; min-height: 0; border: 0; border-radius: 0; background: var(--surface, #fff); box-shadow: none; }
    .skat-reader-design #companyGraph .company-cytoscape-frame { display: flex; flex-direction: column; width: 100%; max-width: 100%; height: clamp(480px, 70vh, 760px); min-height: 0; box-sizing: border-box; overflow: auto; }
    .skat-reader-design #companyGraph .company-cytoscape-frame > :not(.company-cytoscape-body) { flex-shrink: 0; }
    .skat-reader-design #companyGraph .company-cytoscape-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 240px); flex: 1 1 auto; min-width: 0; min-height: 320px; }
    .skat-reader-design #companyGraph .company-cytoscape-canvas { width: 100%; height: 100%; min-width: 0; min-height: 320px; }
    .skat-reader-design #companyGraph .company-cytoscape-inspector { min-width: 0; min-height: 0; max-height: 100%; overflow: auto; padding: 12px; box-sizing: border-box; }
    .skat-reader-design #companyGraph .company-cytoscape-inspector > strong { display: block; max-width: 100%; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; -webkit-line-clamp: unset; font-size: 15px; line-height: 1.45; }
    .skat-reader-design #companyGraph[data-company-graph-state="empty"] { height: auto; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
    .skat-reader-design #companyGraph[data-company-graph-state="empty"] > .empty-state { height: auto; min-height: 0; max-width: 80ch; margin: 0; padding: 12px 0; border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left; }
    .skat-reader-design #companyGraph[data-company-graph-state="empty"] > .empty-state p { margin-block: 6px; }
    .skat-reader-design #companyGraph:fullscreen { width: 100vw; height: 100dvh; max-width: none; max-height: none; min-height: 0; margin: 0; padding: 16px; box-sizing: border-box; border: 0; border-radius: 0; background: var(--surface, #fff); overflow: auto; }
    .skat-reader-design #companyGraph:fullscreen .company-cytoscape-frame { height: 100%; min-height: 0; max-height: none; }
    .skat-reader-design #companyGraph:fullscreen .company-cytoscape-body { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); }
    /* The persistent company header remains primary; passport facts stay visible. */
    .skat-reader-design #companyProfileBrief .company-pass { padding: 12px 0 12px 14px; border: 0; border-left: 3px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
    .skat-reader-design #companyProfileBrief .company-pass.red { border-left-color: #982f24; }
    .skat-reader-design #companyProfileBrief .company-pass-rail { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 16px; width: auto; padding: 0 0 10px; border: 0; border-bottom: 1px solid var(--reader-line-color); background: none; }
    .skat-reader-design #companyProfileBrief .company-pass-rail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; min-width: 0; }
    .skat-reader-design #companyProfileBrief .company-pass-rail-meta small { min-width: 0; overflow-wrap: anywhere; }
    .skat-reader-design #companyProfileBrief .company-pass-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; padding: 12px 0 0; }
    .skat-reader-design #companyProfileBrief .company-pass-identity { min-width: 0; padding: 0; }
    .skat-reader-design #companyProfileBrief .company-pass-identity > strong { display: block; margin-block: 6px; font-size: 16px; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; }
    .skat-reader-design #companyProfileBrief .company-pass-identity > p { margin: 6px 0 10px; max-width: 65ch; font-size: 13px; line-height: 1.6; }
    .skat-reader-design #companyProfileBrief .company-pass-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; }
    .skat-reader-design #companyProfileBrief .company-pass-facts > span { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
    .skat-reader-design #companyProfileBrief .company-pass-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
    .skat-reader-design #companyProfileBrief .company-pass-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; min-width: 0; padding: 0; }
    .skat-reader-design #companyProfileBrief .company-pass-metric { min-width: 0; padding: 8px 0; border: 0; border-top: 1px solid var(--reader-line-color); border-radius: 0; background: none; box-shadow: none; }
    .skat-reader-design #companyProfileBrief .company-pass-change { grid-column: 1 / -1; grid-row: 1; }
    .skat-reader-design #companyProfileBrief .company-pass-metric > strong { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
    .skat-reader-design #companyProfileBrief .company-pass-metric > small { font-size: 12px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
  }

  .skat-reader-design .account-menu { padding: 8px; border-color: var(--reader-line-color); border-radius: 8px; background: #fff; box-shadow: 0 8px 28px #1028401f; }
  .skat-reader-design .account-menu-item { min-height: 44px; border-radius: 5px; font: 400 14px/1.5 var(--reader-ui-font); }
  .skat-reader-design a.account-menu-item { display: flex; text-decoration: none; }
  .skat-reader-design .account-menu-item strong { font-size: 14px; font-weight: 500; }
  .skat-reader-design .account-menu-item small { font-size: 12px; line-height: 1.5; }
  .skat-reader-design .account-menu-item svg { color: var(--reader-blue); }
  .skat-reader-design .account-password-panel { border: 1px solid var(--reader-line-color); border-radius: 5px; background: var(--reader-side); box-shadow: none; font: 400 14px/1.5 var(--reader-ui-font); }
  .skat-reader-design .account-password-panel summary { background: none; box-shadow: none; }
  .skat-reader-design .account-password-panel strong { font-size: 14px; font-weight: 500; }
  .skat-reader-design .account-password-panel small { font-size: 12px; font-weight: 400; color: var(--reader-muted); }
  .skat-reader-design .account-password-panel :is(input, button) { min-width: 0; max-width: 100%; border-radius: 5px; font-family: var(--reader-ui-font); font-size: 14px; }
  .skat-reader-design .account-password-panel :is(input, button, summary):focus-visible { outline: 2px solid var(--reader-blue); outline-offset: 3px; }

  /* These two UI surfaces live outside appShell. The public page is untouched. */
  #commandPalette { font-family: "Skat Inter", "Segoe UI", sans-serif; }
  #commandPalette .command-panel { border-radius: 8px; background: #fff; border-color: #dce4ee; }
  #commandPalette .command-search { background: #fff; border-bottom-color: #dce4ee; }
  #commandPalette .command-search input { font: 400 16px/1.5 "Skat Inter", "Segoe UI", sans-serif; }
  #commandPalette .command-item { min-height: 52px; border-radius: 5px; background-image: none; box-shadow: none; }
  #commandPalette .command-item-copy strong { font-size: 14px; font-weight: 500; }
  #commandPalette .command-item-copy span { font-size: 12px; line-height: 1.5; }
  #commandPalette .command-item:is(:hover, .is-active) { color: #0756ba; background: #edf4fe; }
  #commandPalette :is(button, input):focus-visible { outline: 2px solid #0965d8; outline-offset: 2px; }
  #authGate.rk-home #loginPanel { font-family: "Skat Inter", "Segoe UI", sans-serif; border: 1px solid #dce4ee; border-radius: 8px; background: #fff; box-shadow: 0 16px 64px #10284026; }
  #authGate.rk-home #loginPanel .auth-note { padding: 16px 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
  #authGate.rk-home #loginPanel .auth-note strong { font-size: 18px; font-weight: 600; line-height: 1.5; }
  #authGate.rk-home #loginPanel .auth-note span { color: #526784; font-size: 14px; line-height: 1.65; }
  #authGate.rk-home #loginPanel :is(input, button) { font-family: "Skat Inter", "Segoe UI", sans-serif; border-radius: 6px; }
  #authGate.rk-home #loginPanel .auth-link-button { min-height: 38px; font-size: 14px; font-weight: 500; }
  #authGate.rk-home #loginPanel .auth-error:not(:empty) { margin-top: 16px; padding: 12px; border-left: 3px solid #b44b3f; border-radius: 4px; color: #842f26; background: #fff3f0; font-size: 14px; line-height: 1.6; }
  #authGate.rk-home #loginPanel .auth-error.success:not(:empty) { border-color: #217452; color: #18583f; background: #eef8f3; }
  #authGate.rk-home #loginPanel .auth-error.muted:not(:empty) { border-color: #8a9bb2; color: #526784; background: #f6f8fb; }

  @media (max-width: 1250px) {
    .skat-reader-design .profiles-layout { grid-template-columns: 244px minmax(0, 1fr); }
    .skat-reader-design .admin-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .skat-reader-design .profile-header { padding-inline: 20px; }
    .skat-reader-design .profile-header > div:first-child,
    .skat-reader-design .profile-actions { flex-basis: auto; width: 100%; }
    .skat-reader-design .profile-workspace,
    .skat-reader-design .profile-workspace:is([data-profile-mode="sources"], [data-profile-mode="contributions"], [data-profile-mode="report"]) { grid-template-columns: minmax(0, 1fr); padding-inline: 20px; }
    .skat-reader-design .admin-dashboard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }
  @media (max-width: 1000px) {
    .skat-reader-design .admin-grid { grid-template-columns: minmax(0, 1fr); }
    .skat-reader-design .admin-header { padding-inline: 20px; }
    .skat-reader-design .admin-dashboard { padding-inline: 20px; }
    .skat-reader-design .admin-grid { padding-inline: 20px; }
  }
}

/* CVR finish: scoped desktop layout; no global navigation/theme changes. */
@media screen and (min-width: 1121px) {
  #companiesView .companies-sidebar,
  #companiesView .company-main,
  #companiesView .company-result-list,
  #companiesView .company-result-item,
  #companiesView .company-result-top,
  #companiesView .company-search-form .field { min-width: 0; max-width: 100%; box-sizing: border-box; }
  #companiesView .companies-sidebar { overflow-x: hidden; }
  #companiesView .company-search-form :is(input, select),
  #companiesView .company-result-controls select { width: 100%; min-width: 0; box-sizing: border-box; }
  #companiesView .company-result-item :is(strong, span) { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; min-width: 0; }
  #companiesView .company-result-top { flex-wrap: wrap; }
  #companiesView .company-result-top strong { flex: 1 1 160px; line-height: 1.45; }
  #companiesView .company-result-status { flex: 0 0 auto; max-width: 100%; }
  #companiesView .company-result-controls { display: grid; gap: 6px; margin: 12px 0; }
  #companiesView #companyResultSummary { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
  #companiesView :is(.company-result-item, .company-tab, select, .company-inline-action):focus-visible { outline: 2px solid #0756ba; outline-offset: 3px; }

  /* Browse the bounded result pool in the main space before choosing a profile. */
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .companies-layout { display: block; overflow-y: auto; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .companies-sidebar { width: 100%; padding: 24px 32px; border-right: 0; overflow: visible; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-search-form { grid-template-columns: minmax(260px, 2fr) minmax(160px, 1fr) auto; align-items: end; max-width: 1100px; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-result-controls { grid-template-columns: minmax(180px, 260px) 1fr; align-items: end; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-result-list { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-result-item { min-height: 88px; padding: 16px; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-main { overflow: visible; }
  #companiesView:not(.company-profile-open):not([data-company-search-type="person"]) .company-header { padding-block: 12px; }
  #companiesView.company-profile-open .companies-layout { grid-template-columns: clamp(260px, 21vw, 320px) minmax(0, 1fr); }
  #companiesView.company-profile-open .company-result-list .company-result-item:not(.active) { display: grid; }
  #companiesView.company-profile-open .company-result-item { padding: 10px; border-radius: 6px; box-shadow: none; }
  #companiesView.company-profile-open .company-result-item.active { border-left: 3px solid #0756ba; }
  #companiesView .company-header { gap: 12px; padding: 18px 24px; }
  #companiesView .company-header h1 { margin-block: 4px; overflow-wrap: anywhere; }
  #companiesView .company-actions { flex-wrap: wrap; gap: 6px; }
  #companiesView .company-workspace { padding: 16px 24px; }
  #companiesView .company-panel { padding: 16px; min-width: 0; }
  #companiesView .company-summary-grid { gap: 10px; margin-block: 10px; }
  #companiesView .company-pass-facts { gap: 8px 16px; }
  #companiesView .company-pass-facts > span { white-space: normal; overflow-wrap: anywhere; }

  /* Keep real source caveats and all controls; compress framing, enlarge canvas. */
  .skat-reader-design #companiesView #companyPanelNetwork .company-graph-shell-head { gap: 8px; padding: 8px 0; margin-bottom: 8px; }
  .skat-reader-design #companiesView #companyGraphSummary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0; }
  .skat-reader-design #companiesView .company-graph-summary-card { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 0; border: 0; background: none; box-shadow: none; }
  .skat-reader-design #companiesView .company-graph-summary-card strong { font-size: 14px; }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-frame { height: clamp(560px, 74vh, 860px); }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-body { grid-template-columns: minmax(0, 1fr) minmax(200px, 24%); min-height: 380px; }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-canvas { min-height: 380px; }
  #companiesView .company-cytoscape-toolbar { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px; align-items: center; }
  #companiesView .company-cytoscape-toolbar > div:first-child { flex: 1 1 210px; }
  #companiesView .company-cytoscape-toolbar .company-graph-layerbar { flex: 1 1 350px; border-radius: 6px; padding: 3px; }
  #companiesView .company-cytoscape-toolbar > div:last-child { display: flex; flex-wrap: wrap; gap: 4px; }
  #companiesView .company-graph-selection { display: grid; gap: 3px; flex: 1 1 220px; min-width: 0; max-width: 320px; }
  #companiesView .company-graph-selection select { width: 100%; min-width: 0; min-height: 34px; }
  #companiesView .company-cytoscape-inspector :is(strong, small, span) { white-space: normal; overflow-wrap: anywhere; }
  #companiesView .company-cytoscape-keyhint { padding: 5px 10px; }
  #companiesView .company-graph-legend { gap: 8px 16px; padding-block: 6px; }
  .skat-reader-design #companiesView #companyGraph:fullscreen .company-cytoscape-frame { height: 100%; }
}

/* Administration is a complete page on phones, not the reader's 56px filter row.
   Scope the shell override to the visible view so returning to the library or
   chat restores their own layouts. Keep the register's wide table scroll local. */
@media screen and (max-width: 820px) {
  .app-shell.skat-reader-design:has(> .admin-view:not(.view-hidden)) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    grid-template-rows: auto auto !important;
  }
  .skat-reader-design .admin-view:not(.view-hidden) {
    grid-row: 2;
    height: auto;
    min-width: 0;
    overflow: visible;
  }
  .skat-reader-design .admin-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .skat-reader-design :is(.admin-sidebar, .admin-main) {
    height: auto;
    overflow: visible;
  }
  .skat-reader-design .admin-sidebar {
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--reader-line-color);
  }
  .skat-reader-design :is(.admin-header, .admin-dashboard, .admin-grid) { padding-inline: 16px; }
  .skat-reader-design .admin-header { position: static; }
  .skat-reader-design :is(.admin-grid, .admin-dashboard-metrics, .team-row, .register-editor-columns) {
    grid-template-columns: minmax(0, 1fr);
  }
  .skat-reader-design #adminAnalysisRegisterPanel { min-width: 0; padding: 16px; }
  /* Native fieldsets otherwise preserve a min-content width from long quotes. */
  .skat-reader-design #adminAnalysisRegisterPanel fieldset {
    min-inline-size: 0;
    max-inline-size: 100%;
    box-sizing: border-box;
  }
  .skat-reader-design #adminAnalysisRegisterPanel legend { max-inline-size: 100%; overflow-wrap: anywhere; }
  .skat-reader-design .research-review-observation { min-width: 0; overflow-wrap: anywhere; }
  .skat-reader-design .research-review-observation blockquote { margin-inline: 0; }
  .skat-reader-design .admin-technical-details { margin-inline: 16px; }
  .skat-reader-design .admin-header-actions { flex-wrap: wrap; }
  .skat-reader-design .register-pagination { flex-wrap: wrap; }
}

/* Integrated CVR facts and report periods: readable labels, no fact chips. */
@media screen and (min-width: 1121px) {
  #companiesView #companyProfileBrief .company-overview-facts .company-pass-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
  #companiesView #companyProfileBrief .company-overview-facts .company-pass-facts > span { display: block; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.5; }
  #companiesView #companyProfileBrief .company-overview-facts .company-pass-facts > span > b { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.4; text-transform: none; letter-spacing: normal; }
  #companiesView .company-accounts-head > div { min-width: 0; }
  #companiesView .company-accounts-head > div > :is(span, strong, small) { display: block; margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
  #companiesView .company-accounts-head > div > :is(span, strong, small) + :is(span, strong, small) { margin-top: 6px; }
  #companiesView .company-accounts-head > div > strong { font-size: 16px; }
  #companiesView .company-accounts-head > div > small { font-size: 13px; }
}
@media screen and (min-width: 1400px) {
  #companiesView #companyProfileBrief .company-overview-facts .company-pass-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Extended CVR: one desktop relation workspace; existing tools/details retained. */
@media screen and (min-width: 1121px) {
  #companiesView #companyPanelAccounts .company-document-source-item { display: grid; gap: 10px; min-width: 0; padding-block: 10px; }
  #companiesView #companyPanelAccounts .company-document-source-item > div:first-child { display: grid; gap: 5px; min-width: 0; }
  #companiesView #companyPanelAccounts .company-document-source-item > div:first-child > :is(strong, span, small) { display: block; margin: 0; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
  #companiesView #companyPanelAccounts .company-document-source-item small:empty { display: none; }
  #companiesView #companyPanelAccounts .company-report-main > :is(strong, span, small) { display: block; margin: 0 0 5px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
  #companiesView #companyPanelAccounts .company-report-actions { flex-wrap: wrap; gap: 8px 12px; }
  #companiesView #companyEmptyState > ul > li { margin-block: 12px; }
  #companiesView #companyEmptyState > ul > li > :is(strong, span, small) { display: block; margin-block: 0 5px; line-height: 1.5; overflow-wrap: anywhere; }
}

@media screen and (min-width: 1121px) {
  #companiesView [data-company-timeline-form] { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; margin-block: 12px; }
  #companiesView [data-company-timeline-form] label { display: flex; flex: 1 1 150px; min-width: 0; flex-direction: column; gap: 5px; }
  #companiesView [data-company-timeline-form] :is(input, select) { width: 100%; min-width: 0; box-sizing: border-box; }
  #companiesView [data-company-timeline-form] button { flex: 0 1 auto; white-space: normal; }
  #companiesView .company-relation-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px; }
  #companiesView .company-relation-toolbar label { font-weight: 600; }
  #companiesView #companyRelationFilter { display: block; position: static; width: min(100%, 360px); height: auto; min-height: 40px; opacity: 1; clip-path: none; }
  #companiesView :is(select, button, a, summary):focus-visible { outline: 3px solid #1466a5; outline-offset: 3px; }
  #companiesView .company-relation-scope { margin: 4px 0 10px; font-size: 13px; line-height: 1.5; color: #42566a; }
  .skat-reader-design #companiesView #companyPanelNetwork .company-graph-shell-head { padding: 0; margin: 0 0 8px; }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-frame { height: auto; min-height: 0; overflow: visible; }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-body { height: clamp(380px, 49vh, 560px); min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(210px, 25%); }
  .skat-reader-design #companiesView #companyGraph .company-cytoscape-canvas { height: 100%; min-height: 0; }
  #companiesView .company-cytoscape-inspector { overflow-y: auto; min-height: 0; }
  #companiesView .company-cytoscape-toolbar { gap: 6px 12px; padding: 8px; }
  #companiesView .company-cytoscape-toolbar > div:first-child { flex: 1 1 180px; }
  #companiesView .company-relation-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  #companiesView .company-relation-main { min-width: 0; }
  #companiesView .company-relation-main > span { display: block; line-height: 1.5; }
  #companiesView .company-relation-source { margin: 8px 0; font-size: 13px; line-height: 1.5; }
  #companiesView .company-relation-source > div { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr); gap: 12px; margin-block: 6px; }
  #companiesView .company-relation-source dt { color: #42566a; }
  #companiesView .company-relation-source dd { margin: 0; overflow-wrap: anywhere; }
  #companiesView .company-cytoscape-inspector .company-relation-source > div { display: block; }
  #companiesView .company-structure-details { border-top: 1px solid #dce4eb; padding-block: 14px; margin-top: 16px; }
  #companiesView .company-structure-details > summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
  #companiesView .company-ownership-facts > p { line-height: 1.5; max-width: 85ch; }
  #companiesView .company-ownership-facts .ownership-row { display: block; padding-block: 12px; border-bottom: 1px solid #dce4eb; }
  #companiesView .company-ownership-facts .ownership-row > :is(strong, span) { display: block; }
  .skat-reader-design #companiesView #companyGraph:fullscreen .company-cytoscape-frame { display: flex; height: 100%; overflow: hidden; }
  .skat-reader-design #companiesView #companyGraph:fullscreen .company-cytoscape-body { flex: 1 1 auto; height: auto; min-height: 0; }
}

.sporg-view { grid-column: 1 / -1; min-width: 0; overflow: auto; padding: 24px 32px; color: var(--ink, #08264d); background: var(--surface, #fff); }
/* Share the reading desk's flat controls, including focus and disabled states. */
.sporg-view { font-family: var(--reader-ui-font, "Segoe UI", sans-serif); }
.sporg-view :is(.primary-button, .quiet-button) { min-height: 40px; max-width: 100%; padding: 9px 12px; border-radius: 6px; font: 500 14px/1.4 var(--reader-ui-font, "Segoe UI", sans-serif); white-space: normal; overflow-wrap: anywhere; box-shadow: none; text-shadow: none; transform: none; }
.sporg-view .primary-button { background: var(--reader-blue, #0965d8); border-color: var(--reader-blue, #0965d8); color: #fff; }
.sporg-view .primary-button::after { content: none; }
.sporg-view .primary-button:hover:not(:disabled) { background: #0756ba; border-color: #0756ba; }
.sporg-view .quiet-button { background: #fff; border-color: var(--reader-line-color, #dce4ee); color: var(--reader-ink, #12243d); }
.sporg-view .quiet-button:hover:not(:disabled) { background: #edf4fe; }
.sporg-view :is(.primary-button, .quiet-button):disabled { opacity: .65; cursor: not-allowed; }
@media (max-width: 600px) { .sporg-view :is(.primary-button, .quiet-button) { min-height: 44px; } }
.sporg-view header { margin-bottom: 24px; }
.sporg-view h1 { font-size: 24px; margin: 0 0 8px; }
.sporg-view h2 { font-size: 18px; margin: 0 0 16px; }
.sporg-view h3 { font-size: 16px; }
.sporg-view p { line-height: 1.5; }
.sporg-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 32px; max-width: 1500px; }
.sporg-layout > * { min-width: 0; }
.sporg-layout aside { border-left: 1px solid #d9e3ea; padding-left: 24px; }
.sporg-view label { display: block; font-weight: 600; margin-bottom: 8px; }
.sporg-view textarea { box-sizing: border-box; display: block; width: 100%; resize: vertical; min-height: 110px; padding: 12px; font: inherit; border: 1px solid #8da4b7; border-radius: 6px; }
.sporg-view #sporgFacts, .sporg-view #sporgContext { min-height: 76px; }
.sporg-view #sporgPeriod { box-sizing: border-box; display: block; width: 100%; padding: 10px 12px; font: inherit; border: 1px solid #8da4b7; border-radius: 6px; }
.sporg-view #sporgLength { font-size: 13px; color: #52616b; }
.sporg-view form label:not(:first-child) { margin-top: 16px; }
.sporg-view p, .sporg-view li, .sporg-view blockquote { max-width: 80ch; overflow-wrap: anywhere; }
.sporg-view #sporgPrivacy { font-size: 13px; color: #52616b; }
.sporg-status { min-height: 24px; }
.sporg-result-question { font-weight: 600; white-space: pre-wrap; }
.sporg-result-question:empty, .sporg-revision-note:empty { display: none; }
.sporg-revision-note { color: #52616b; }
.sporg-counts { margin: 16px 0; }
.sporg-counts div { display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e2e9ee; padding: 8px 0; }
.sporg-counts dd { margin: 0; font-weight: 600; }
.sporg-findings { padding-left: 24px; }
.sporg-findings > li { padding: 0 0 20px; margin: 20px 0; border-bottom: 1px solid #d9e3ea; }
.sporg-findings summary { cursor: pointer; padding: 10px 0; }
.sporg-findings blockquote { white-space: pre-wrap; margin: 8px 0; border-left: 3px solid #8da4b7; padding-left: 16px; }
.sporg-view :is(button, a, input, textarea, summary, [tabindex]):focus-visible { outline: 2px solid #145884 !important; outline-offset: 3px; }
.sporg-answer { border-bottom: 1px solid #d9e3ea; padding-bottom: 20px; margin-bottom: 20px; }
.sporg-answer-section { margin: 20px 0; }
.sporg-answer-section h4 { margin: 0 0 6px; font-size: 14px; }
.sporg-answer-section p { white-space: pre-wrap; }
.sporg-answer-section button, .sporg-view form button { margin-right: 8px; margin-top: 8px; }
.sporg-findings blockquote:focus { outline: 2px solid #145884 !important; outline-offset: 3px; }
.sporg-view [hidden] { display: none !important; }
/* Persistent workspace: personal history remains separate from source reading. */
.sporg-workspace.sporg-chat-mode { display: grid; grid-template-columns: 248px minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); column-gap: 32px; }
.sporg-workspace.sporg-chat-mode > header { grid-column: 2; grid-row: 1; }
.sporg-workspace.sporg-chat-mode > .sporg-layout { grid-column: 2; grid-row: 2; min-height: 0; }
.conversation-sidebar { grid-column: 1; grid-row: 1 / 3; min-height: 0; overflow-y: auto; border-right: 1px solid #dce4ee; padding-right: 18px; font-size: 13px; }
.conversation-sidebar .history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.conversation-sidebar h2 { font-size: 16px; margin: 0; }
.conversation-sidebar .history-toggle { display: none; }
.conversation-sidebar input:not([type=checkbox]) { width: 100%; box-sizing: border-box; min-height: 40px; border: 1px solid #bdccda; border-radius: 6px; padding: 8px; font: inherit; margin-top: 6px; }
.conversation-sidebar label { font-size: 12px; font-weight: 500; }
.conversation-sidebar .history-archive { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.conversation-sidebar .history-archive input { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; margin: 0; padding: 0; }
.conversation-sidebar .history-list { display: flex; flex-direction: column; gap: 4px; margin-block: 12px 24px; }
.sporg-view .history-item { width: 100%; display: block; text-align: left; background: transparent; color: #17364d; border: 1px solid transparent; border-radius: 8px; padding: 10px; font: inherit; box-shadow: none; white-space: normal; }
.sporg-view a.history-item { text-decoration: none; box-sizing: border-box; }
.history-item span { display: block; overflow-wrap: anywhere; }
.history-item small { display: block; color: #647385; margin-top: 5px; font-size: 11px; }
.sporg-view .history-item.selected { background: #eaf2fa; border-color: #c4d8e8; }
.sporg-view .history-item:hover { background: #f0f4f8; }
.history-empty, .history-status { color: #52616b; line-height: 1.5; }
.conversation-actions { border-top: 1px solid #dce4ee; padding-top: 16px; }
.conversation-actions > div { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 10px; }
.conversation-actions details > button { margin-block: 4px; }
.conversation-actions summary { cursor: pointer; padding-block: 10px; }
@media (max-width: 900px), (max-height: 600px) {
  .sporg-workspace.sporg-chat-mode { display: block; overflow-y: auto; }
  .conversation-sidebar { border: 0; padding: 0; margin-bottom: 12px; overflow: visible; }
  .conversation-sidebar .history-toggle { display: block; min-height: 44px; }
  .conversation-sidebar #conversationHistory { display: none; }
  .conversation-sidebar.history-open #conversationHistory { display: block; padding: 16px; margin-block: 8px 20px; background: #f7f9fb; border: 1px solid #dce4ee; border-radius: 8px; }
  .sporg-workspace .history-item { min-height: 44px; }
}
.analysis-register { max-width: 1500px; min-width: 0; }
#adminAnalysisRegisterPanel[hidden], .analysis-register[hidden] { display: none !important; }
.analysis-register p { max-width: 80ch; overflow-wrap: anywhere; line-height: 1.5; }
.analysis-register h2 { font-size: 18px; margin: 16px 0; }
.analysis-register label { display: block; font-weight: 600; }
.register-filters { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.register-filters label { flex: 1 1 180px; min-width: 0; }
.register-filters input, .register-filters select { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px; font: inherit; border: 1px solid #8da4b7; border-radius: 4px; }
.register-status { min-height: 24px; }
.register-counts { display: flex; flex-wrap: wrap; gap: 20px; padding: 12px 0; }
.register-counts dd { margin: 4px 0 0; font-weight: 700; }
.register-processing-grid { overflow-x: auto; margin: 12px 0; }
.register-processing-grid:focus-visible { outline: 2px solid #245f80; outline-offset: 2px; }
.register-processing-grid table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px; }
.register-processing-grid th, .register-processing-grid td { padding: 10px 8px; text-align: right; vertical-align: top; border-bottom: 1px solid #d9e3ea; }
.register-processing-grid th:first-child { text-align: left; min-width: 210px; }
.register-processing-grid caption { text-align: left; margin-bottom: 8px; color: #52616b; }
.register-results table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; }
.register-results th, .register-results td { text-align: left; vertical-align: top; overflow-wrap: anywhere; padding: 10px 8px; border-bottom: 1px solid #d9e3ea; }
.register-results th:first-child { width: 34%; }
.register-results small { display: block; margin-top: 4px; color: #52616b; }
.register-caption { text-align: left; margin-bottom: 8px; }
.register-pagination { display: flex; align-items: center; gap: 16px; margin: 20px 0; }
.analysis-register :is(input,select,button,[tabindex]):focus-visible { outline: 2px solid #145884 !important; outline-offset: 3px; }
.analysis-register [hidden] { display: none !important; }
.register-document { max-width: 100%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .register-results table, .register-results tbody, .register-results tr, .register-results td { display: block; width: auto; }
  .register-results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .register-results tbody tr { margin: 0 0 14px; border: 1px solid #d9e3ea; border-radius: 8px; background: #fff; }
  .register-results td { border: 0; padding: 10px 12px; overflow-wrap: break-word; }
  .register-results td + td { border-top: 1px solid #edf1f4; }
  .register-results td:nth-child(2)::before { content: 'Status'; }
  .register-results td:nth-child(3)::before { content: 'Dækket'; }
  .register-results td:nth-child(4)::before { content: 'Mangler'; }
  .register-results td::before { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: #52616b; }
  .register-document { width: 100%; min-height: 44px; }
}
.register-editor-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.register-editor-columns > section { min-width: 0; }
.register-editor-columns textarea { display: block; box-sizing: border-box; width: 100%; min-width: 0; padding: 10px; font: inherit; line-height: 1.5; resize: vertical; border: 1px solid #8da4b7; border-radius: 4px; }
.register-editor-columns select { max-width: 100%; padding: 8px; font: inherit; }
.register-editor-fields fieldset { min-width: 0; border: 0; border-top: 1px solid #d9e3ea; padding: 16px 0; margin: 16px 0; }
.register-editor-fields legend { font-weight: 700; padding: 0 8px 0 0; }
.register-editor-fields label { margin: 10px 0; }
.register-editor-columns [data-source-text] { min-height: 540px; max-height: 75vh; white-space: pre-wrap; }
.register-observation { margin: 12px 0; }
.register-observation blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid #8da4b7; white-space: pre-wrap; overflow-wrap: anywhere; }
.register-editor-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.register-editor-history { margin-top: 24px; border-top: 1px solid #d9e3ea; }
.register-editor-notice { border-left: 3px solid #8da4b7; padding-left: 12px; }
.analysis-register textarea:focus-visible { outline: 2px solid #145884 !important; outline-offset: 3px; }
@media (max-width: 900px) { .sporg-layout { grid-template-columns: minmax(0, 1fr); } .sporg-layout aside { border-left: 0; border-top: 1px solid #d9e3ea; padding: 20px 0 0; } .sporg-view { padding: 20px; } }
.research-topic-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.65rem;margin-block:1rem}
.research-topic-grid label,.research-review-observation{display:block;padding:.5rem;border:1px solid var(--border,#d4d9df);border-radius:6px}
.research-review-observation{margin-block:.75rem}
.research-topic-grid input,.research-review-observation input{width:auto;margin-right:.5rem}
.research-library{margin-block:2rem;padding:1.25rem;border:1px solid var(--border,#d4d9df);border-radius:10px}
.research-library button{margin:.25rem .4rem .25rem 0}
.research-library li{margin-block:.75rem}

.research-topic-family{border:1px solid var(--border,#d4d9df);border-radius:8px;padding:.5rem}
.research-topic-family label{border:0;margin:.2rem 0}
.research-topic-family .research-subtopic{padding-left:1.2rem}
.sporg-context { margin-block: 16px; }
.sporg-context > summary { cursor: pointer; padding-block: 10px; }
.research-discovery { margin-block: 28px; border-top: 2px solid #d9e3ea; padding-top: 24px; }
.discovery-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.discovery-controls label { flex: 1 1 240px; min-width: 0; }
.discovery-controls select { display: block; box-sizing: border-box; width: 100%; max-width: 100%; margin-top: 8px; padding: 10px; font: inherit; }
.discovery-controls button { white-space: normal; }
.discovery-results { padding-left: 22px; }
.discovery-results > li { border-bottom: 1px solid #d9e3ea; padding-block: 12px; }
.discovery-evidence { border: 1px solid #8da4b7; border-radius: 8px; padding: 18px; margin-top: 20px; }
.discovery-evidence summary { cursor: pointer; padding-block: 12px; }
.discovery-evidence blockquote { white-space: pre-wrap; border-left: 3px solid #8da4b7; padding-left: 14px; margin-inline: 0; }
.discovery-evidence dd { margin-left: 0; overflow-wrap: anywhere; }
.discovery-source { font: inherit; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto; }
.sporg-layout.sporg-private-layout { grid-template-columns: minmax(0, 1fr); max-width: 1000px; }
.sporg-native-answer { margin-block: 24px; padding: 20px; border: 1px solid #8da4b7; border-radius: 8px; }
.sporg-native-answer article { margin-block: 20px; }
.sporg-native-answer summary { cursor: pointer; padding-block: 12px; }
.sporg-native-answer blockquote { white-space: pre-wrap; border-left: 3px solid #8da4b7; padding-left: 14px; margin-inline: 0; }
.sporg-native-answer small { display: block; overflow-wrap: anywhere; }
.app-shell:has(> #sporgView:not(.view-hidden)) { grid-template-rows: auto minmax(0, 1fr) !important; }
#sporgView:not(.view-hidden) { grid-row: 2 / -1 !important; min-height: 0; }
@media (max-width: 600px) { .sporg-native-answer { padding: 12px; } }
.sporg-chat-mode { display: flex; flex-direction: column; overflow: hidden; }
.sporg-chat-mode .sporg-private-layout { max-width: 920px; margin-inline: auto; width: 100%; flex: 1; min-height: 0; }
.sporg-chat-mode .sporg-private-layout > section { display: flex; flex-direction: column; min-height: 0; }
.sporg-chat-mode header { max-width: 920px; width: 100%; margin: 0 auto 8px; }
.sporg-chat-mode header p { margin: 8px 0; }
.sporg-chat-mode .sporg-status:empty { display: none; }
.research-chat { flex: 1; min-height: 100px; overflow-y: auto; padding-right: 4px; }
.chat-welcome { padding: 40px 0 24px; }
.chat-turn { margin-block: 24px 36px; }
.chat-speaker { display: block; font-weight: 600; font-size: 13px; color: #52616b; margin-bottom: 8px; }
.chat-user { margin-left: auto; padding: 14px 18px; width: fit-content; max-width: min(85%, 70ch); background: #edf4fe; border-radius: 14px 14px 3px 14px; }
.chat-user p { white-space: pre-wrap; margin: 0; }
.chat-assistant { padding-top: 24px; }
.chat-feedback { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:20px; color:#52616b; font-size:13px; }
.chat-feedback details { flex-basis:auto; max-width:100%; }
.chat-feedback details[open] { flex-basis:100%; }
.chat-feedback summary { cursor:pointer; padding:8px; }
.chat-feedback button, .chat-quality button { min-height:40px; white-space:normal; }
.chat-quality { margin-top:12px; max-width:100%; }
.chat-quality p, .chat-quality article { overflow-wrap:anywhere; }
.chat-quality article { padding:12px 0; border-top:1px solid #d9e0e5; }
.chat-assistant .sporg-native-answer { margin: 0; padding: 0; border: 0; }
.chat-assistant .sporg-native-answer > h2 { font-size: 16px; }
.chat-assistant .sporg-native-answer > p:first-of-type { font-size: 12px; color: #52616b; }
.chat-assistant .sporg-native-answer article { margin: 12px 0; }
.chat-assistant .sporg-native-answer article h3 { font-size: 12px; color: #52616b; margin: 6px 0; }
.chat-assistant .sporg-native-answer article p { margin: 8px 0; }
.chat-assistant .sporg-native-answer summary { padding-block: 6px; font-size: 13px; }
.chat-answer-status > summary { font-size: 12px; color: #52616b; }
.chat-progress { color: #52616b; }
.chat-notice:empty { display: none; }
.chat-browse { flex: none; margin-block: 4px; max-height: 35vh; overflow-y: auto; }
.chat-browse > summary { cursor: pointer; padding-block: 10px; color: #0965d8; }
.chat-browse .research-discovery { border: 0; padding-top: 12px; margin-block: 0; }
.sporg-chat-mode form { flex: none; padding: 14px; border: 1px solid #c5d3e1; border-radius: 14px; background: #fff; max-height: 55vh; overflow-y: auto; }
.sporg-chat-mode .chat-privacy { font-size: 12px; margin-block: 6px; }
.sporg-chat-mode .chat-privacy summary { cursor: pointer; }
.sporg-chat-mode #sporgLength { margin-block: 4px; }
.sporg-chat-mode #sporgQuestion { min-height: 64px; border-color: #dce4ee; }
.sporg-chat-mode #sporgQuestionLabel { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sporg-chat-mode .sporg-context > summary { padding-block: 4px; font-size: 13px; }
.sporg-chat-mode #sporgPrivacy { font-size: 12px; }
.sporg-chat-mode .sporg-context { margin-block: 6px; }
@media(max-width:600px){ .sporg-chat-mode { padding: 16px; } .chat-user { max-width: 90%; } .sporg-chat-mode form { padding: 12px; } }

/* The conversation is the primary reading surface. Tools and provenance are
   available on demand, while source gaps stay beside the affected answer. */
.sporg-chat-mode { padding: 20px 28px 14px; }
html:has(#sporgView:not(.view-hidden)), body:has(#sporgView:not(.view-hidden)) { overflow: clip; }
body:has(#sporgView:not(.view-hidden)) { position: fixed; inset: 0; }
.app-shell:has(> #sporgView:not(.view-hidden)) { height: 100dvh; min-height: 0; }
.sporg-chat-mode header { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; flex: none; margin-bottom: 12px; max-height: 40vh; overflow-y: auto; }
.sporg-chat-mode header h1 { grid-column: 1; font-size: 22px; margin: 0; }
.sporg-chat-mode header > p { grid-column: 1; font-size: 13px; color: #52616b; margin: 5px 0 8px; }
.sporg-chat-mode header > [data-clear] { grid-column: 2; grid-row: 1 / 3; align-self: start; margin: 0; }
.chat-tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: start; border-bottom: 1px solid #dce4ee; padding-bottom: 6px; }
.chat-tools > details { margin: 0; max-height: none; max-width: 100%; overflow: visible; overflow-wrap: anywhere; font-size: 13px; }
.chat-tools > details[open] { flex-basis: 100%; order: 1; }
.chat-tools > details > summary { min-height: 32px; box-sizing: border-box; padding: 7px 0; cursor: pointer; color: #38516a; }
.chat-tools .research-discovery { margin: 8px 0 16px; padding: 0; }
.chat-tools #sporgPrivacy { max-width: 76ch; line-height: 1.6; margin: 6px 0 12px; }
.sporg-chat-mode .research-chat { padding: 0 12px 20px 0; scrollbar-width: thin; scroll-padding: 16px; }
.sporg-chat-mode .chat-welcome { max-width: 620px; margin: 6vh auto; padding: 28px 0; }
.chat-welcome h2 { font-size: 28px; letter-spacing: -.4px; margin-bottom: 12px; }
.chat-welcome p { color: #52616b; }
.sporg-chat-mode .chat-turn { margin: 16px 0 32px; }
.sporg-chat-mode .chat-user { max-width: min(86%, 68ch); background: #f0f4f8; border-radius: 12px; padding: 12px 16px; }
.chat-user .chat-speaker { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chat-assistant > .chat-speaker { color: #17364d; font-size: 14px; margin-bottom: 12px; }
.sporg-chat-mode .chat-assistant { padding-top: 22px; }
.chat-assistant .chat-answer-section { margin: 18px 0 22px; }
.chat-assistant .chat-answer-section p { font-size: 16px; line-height: 1.75; margin: 0 0 8px; max-width: 76ch; }
.chat-assistant .chat-answer-group > h3 { color: #38516a; font-size: 13px; margin: 0 0 10px; }
.chat-answer-limit { background: #faf7ee; border-left: 3px solid #b79348; padding: 10px 14px; border-radius: 0 6px 6px 0; margin-bottom: 18px; }
.chat-answer-limit p, .chat-assistant .sporg-native-answer > .chat-answer-limit { color: #5e4d27; font-size: 13px; line-height: 1.55; margin: 0; }
.chat-answer-limit p + p { margin-top: 5px; }
.chat-citations { display: flex; flex-wrap: wrap; gap: 6px; }
.sporg-view .chat-citations .citation-chip { min-width: 32px; min-height: 32px; padding: 3px 8px; margin: 0; font-size: 12px; font-weight: 600; color: #245882; background: #f3f7fa; border-color: #dce4ee; border-radius: 6px; }
.chat-source-list { border-top: 1px solid #dce4ee; margin-top: 24px; padding-top: 6px; }
.chat-source-list > summary { font-weight: 600; color: #245882; }
.chat-source-document { border-bottom: 1px solid #dce4ee; padding: 8px 0 12px; }
.chat-source-document > summary { font-weight: 600; line-height: 1.5; }
.chat-source-quote { margin: 8px 0; padding: 8px 14px; background: #f7f9fb; border-radius: 6px; }
.chat-source-other { margin-block: 8px; }
.chat-source-quote blockquote { font-size: 15px; line-height: 1.75; background: #fff; padding: 12px 16px; }
.sporg-view .source-caption, .sporg-view .source-technical { color: #52616b; font-size: 12px; line-height: 1.6; }
.source-technical > summary { font-size: 12px; }
.chat-answer-gaps, .chat-answer-status { margin-block: 6px; }
.chat-answer-status { color: #52616b; }
.chat-assistant .sporg-native-answer summary { min-height: 32px; box-sizing: border-box; padding-block: 7px; }
.sporg-chat-mode .discovery-source { max-height: none; overflow: visible; font-family: inherit; font-size: 15px; }
.sporg-chat-mode:has(.chat-source-reading) form { display: none; }
.sporg-chat-mode:has(.chat-turn) header > p { display: none; }
.sporg-chat-mode:has(.chat-source-reading) .chat-tools { display: none; }
.chat-source-reading .discovery-evidence { border: 0; padding: 16px 0; margin: 0; }
.chat-source-reading > button:first-child { position: sticky; top: 0; z-index: 1; width: 100%; text-align: left; background: #fff; }
.sporg-chat-mode form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px 8px; border: 1px solid #bdccda; border-radius: 12px; box-shadow: 0 3px 16px #132d4510; }
.sporg-chat-mode #sporgQuestion { grid-column: 1; grid-row: 1; min-height: 54px; max-height: 160px; resize: vertical; border: 0; border-radius: 4px; padding: 8px 4px; font-size: 15px; line-height: 1.5; }
.sporg-chat-mode form > button[type=submit] { grid-column: 2; grid-row: 1; align-self: end; margin: 0 0 4px; min-width: 64px; }
.sporg-chat-mode form > .sporg-context { grid-column: 1 / -1; grid-row: 2; margin: 0; }
.sporg-chat-mode .sporg-context > summary { min-height: 28px; box-sizing: border-box; padding: 5px 0; color: #52616b; font-size: 12px; }
.sporg-chat-mode #sporgLength { grid-column: 1 / -1; display: none; }
.sporg-chat-mode #sporgLength.near-limit { display: block; margin: 4px 0; }
.chat-confidentiality { display: none; }
.sporg-chat-mode .chat-confidentiality { display: block; grid-column: 1 / -1; margin: 0; color: #52616b; font-size: 11px; line-height: 1.5; }
.sporg-chat-mode form > .sporg-context[open] { margin-bottom: 12px; }

/* Keep the product names readable on the chat route without changing other views. */
@media (min-width: 1101px) {
  .skat-reader-design:has(> #sporgView:not(.view-hidden)) .topbar { grid-template-columns: 220px minmax(0, 1fr) auto; gap: 20px; }
  .skat-reader-design:has(> #sporgView:not(.view-hidden)) .top-tabs { gap: 14px; }
  .skat-reader-design:has(> #sporgView:not(.view-hidden)) .top-tab { flex: 0 0 auto; min-width: 0; max-width: none; gap: 6px; }
  .skat-reader-design:has(> #sporgView:not(.view-hidden)) .top-tab-copy { width: auto; max-width: none; }
  .skat-reader-design:has(> #sporgView:not(.view-hidden)) .top-tab-copy strong { font-size: 12px; overflow: visible; text-overflow: clip; }
}

.sporg-view .normative-analysis { margin-block: 24px; min-width: 0; }
@media (min-width: 1101px) and (min-height: 601px) {
  .sporg-workspace .research-chat.has-open-source { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: minmax(0,1fr) auto; gap: 16px; overflow: hidden; }
  .sporg-workspace .research-chat.has-open-source > .chat-transcript { display: block !important; overflow-y: auto; min-height: 0; grid-column: 1; grid-row: 1; }
  .sporg-workspace .research-chat.has-open-source > .chat-source-reading { overflow-y: auto; min-height: 0; grid-column: 2; grid-row: 1; padding-left: 16px; border-left: 1px solid #dce4ee; }
  .sporg-workspace .research-chat.has-open-source > .chat-notice { grid-column: 1 / -1; grid-row: 2; }
}
.sporg-view .chat-search-results { padding-inline-start: 24px; }
.sporg-view .chat-search-results > li { padding: 12px 0; border-bottom: 1px solid #e1e6ea; overflow-wrap: anywhere; }
.sporg-view .chat-search-results :is(strong, details) { display: block; margin-bottom: 8px; }
.sporg-view .normative-limit { border-left: 3px solid #a38147; padding: 10px 14px; background: #faf8f2; line-height: 1.6; }
.sporg-view .normative-navigation { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-block: 18px; }
.sporg-view .normative-navigation label { flex: 1 1 220px; min-width: 0; }
.sporg-view .normative-navigation select { display: block; max-width: 100%; width: 100%; margin-top: 6px; }
.sporg-view .normative-section { border: 1px solid #dbe3e7; border-radius: 8px; margin-block: 8px; padding: 10px 14px; }
.sporg-view .normative-section > summary { font-weight: 650; scroll-margin-block: 16px; }
.sporg-view .normative-section summary span { display: block; font-size: 13px; font-weight: 400; color: #52616c; margin: 4px 0 0 18px; }
.sporg-view .normative-subsection { margin-block: 12px; padding: 10px; background: #f6f8fa; border-radius: 6px; }
.sporg-view .normative-observation { margin-block: 16px; border-top: 1px solid #e1e6ea; padding-block: 8px; }
.sporg-view .normative-analysis :is(p, blockquote, summary) { overflow-wrap: anywhere; }
.sporg-chat-mode:has(.discovery-reading) header { flex: 1 1 auto; max-height: none; min-height: 0; display: block; }
.sporg-chat-mode:has(.discovery-reading) :is(.sporg-private-layout, .chat-privacy, header > [data-clear], .chat-browse > summary) { display: none; }
.sporg-chat-mode:has(.discovery-reading) .chat-tools { display: block; }
.sporg-view .discovery-reading { font-size: 15px; line-height: 1.65; }
.discovery-reading > button { position: sticky; top: 0; z-index: 1; background: #fff; }
/* One reading surface on compact screens; answers and originals must not be
   squeezed between a fixed header and independently scrolling composer. */
@media (max-width: 700px), (max-height: 600px) {
  html:has(#sporgView:not(.view-hidden)), body:has(#sporgView:not(.view-hidden)) { overflow: clip; }
  body:has(#sporgView:not(.view-hidden)) { position: fixed; inset: 0; }
  .app-shell:has(> #sporgView:not(.view-hidden)) { height: 100dvh; min-height: 0; }
  .sporg-chat-mode { display: block; overflow-y: auto; overflow-x: hidden; padding: 16px; scroll-padding-block: 16px; }
  .sporg-chat-mode .sporg-private-layout { display: block; width: 100%; min-height: 0; }
  .sporg-chat-mode .sporg-private-layout > section { display: block; }
  .sporg-chat-mode .research-chat { overflow: visible; min-height: 0; padding: 0; }
  .sporg-chat-mode :is(.chat-browse, form, .discovery-source) { max-height: none; overflow: visible; }
  .sporg-chat-mode header h1 { font-size: 22px; }
  .sporg-chat-mode header p { font-size: 14px; }
  .sporg-chat-mode .chat-welcome { padding-block: 12px; }
  .sporg-chat-mode .chat-turn { margin-block: 16px 24px; }
  .sporg-chat-mode .discovery-evidence { padding: 12px; }
  .sporg-chat-mode :is(button, summary, select) { min-height: 44px; }
  .sporg-chat-mode .chat-user { box-sizing: border-box; max-width: 94%; }
  .sporg-chat-mode .chat-assistant { padding-top: 16px; }
  .sporg-chat-mode .discovery-source { white-space: pre-wrap; word-break: normal; }
}
@media (max-width: 700px), (max-height: 600px) {
  .sporg-chat-mode header { max-height: none; overflow: visible; gap: 4px 10px; }
  .sporg-chat-mode header > p { margin-top: 0; }
  .sporg-chat-mode header > [data-clear] { min-height: 36px; padding: 7px 9px; font-size: 12px; }
  .sporg-chat-mode header h1 { font-size: 20px; }
  .sporg-chat-mode .chat-tools > details > summary { min-height: 44px; padding-block: 12px; }
  .sporg-chat-mode .research-chat { padding: 0 0 16px; }
  .sporg-chat-mode .chat-answer-section p { font-size: 15px; line-height: 1.75; }
  .sporg-chat-mode .chat-answer-limit { padding: 10px 12px; }
  .sporg-chat-mode .chat-user { max-width: 94%; }
  .sporg-view .chat-citations .citation-chip { min-width: 44px; min-height: 44px; }
  .sporg-chat-mode form { gap: 5px 8px; padding: 10px 12px; }
  .sporg-chat-mode #sporgQuestion { min-height: 64px; }
  .sporg-chat-mode .sporg-context > summary { min-height: 44px; padding-block: 12px; }
}

/* Selected design, round 2 / option 1. The native conversation owns the screen;
   the shared product navigation stays visible above every workspace. */
.sporg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sporg-icon { display: inline-block; width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: currentColor; stroke-width: 1.7; vertical-align: middle; }
.app-shell:has(> .sporg-modern:not(.view-hidden)) { grid-template-columns: minmax(0,1fr) !important; grid-template-rows: auto minmax(0,1fr) !important; }
#sporgView.sporg-modern:not(.view-hidden) { grid-row: 2 !important; position: relative; }
.sporg-workspace.sporg-modern { --chat-navy: #102b42; --chat-ink: #101e3a; --chat-muted: #637793; --chat-blue: #0065ed; display: grid; grid-template-columns: clamp(260px,23vw,342px) minmax(0,1fr); grid-template-rows: auto minmax(0,1fr); column-gap: 0; padding: 0; color: var(--chat-ink); background: #fff; overflow: hidden; }
.sporg-modern .conversation-sidebar { grid-row: 1 / -1; padding: 28px 24px 20px; border: 0; margin: 0; background: var(--chat-navy); color: #f7faff; font-size: 15px; overflow: auto; scrollbar-width: thin; scrollbar-color: #47617a transparent; }
.sporg-modern #conversationHistory { display: flex; flex-direction: column; }
.sporg-modern #conversationHistory[hidden] { display: none !important; }
.sporg-modern .history-drawer-heading { display: none; }
.sporg-modern .history-close { display: none; }
.sporg-modern .history-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; width: 100%; margin: -8px 0 14px; padding: 8px; border: 0; background: transparent; color: #dce8f4; font: inherit; cursor: pointer; }
.sporg-modern .conversation-sidebar :is(.history-toggle, .history-new-compact):hover:not(:disabled) { background: #234660; color: #f0f6ff; }
.sporg-modern .conversation-sidebar :is(.history-toggle, .history-new-compact):focus-visible { outline: 2px solid #67c8ff; outline-offset: 2px; }
.sporg-modern .history-new-compact { display: none; }
.sporg-workspace.sporg-modern:has(.conversation-sidebar.history-collapsed) { grid-template-columns: 64px minmax(0,1fr); }
.sporg-modern .conversation-sidebar.history-collapsed { padding: 28px 10px 20px; }
.sporg-modern .history-collapsed .history-toggle { justify-content: center; padding: 8px; }
.sporg-modern .history-collapsed .history-toggle span { display: none; }
.sporg-modern .history-collapsed .history-new-compact { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; padding: 8px; border: 0; background: transparent; color: #dce8f4; cursor: pointer; }
.sporg-modern .history-new { display: flex; align-items: center; justify-content: flex-start; gap: 20px; width: 100%; min-height: 52px; border-radius: 10px; padding: 12px 18px; margin: 0 0 16px; font-size: 16px; background: var(--chat-blue); border: 1px solid #2681ef; }
.sporg-modern .history-search-label { position: relative; margin: 0 0 24px; }
.sporg-modern .history-search-label > .sporg-icon { position: absolute; left: 13px; top: 14px; color: #bfd0e0; }
.sporg-modern .history-search-label input { margin: 0; background: transparent; border: 1px solid #456078; border-radius: 8px; padding: 12px 12px 12px 43px; min-height: 48px; color: #fff; font-size: 15px; }
.sporg-modern .history-search-label input::placeholder { color: #bbccdd; opacity: 1; }
.sporg-modern .history-list-heading { display: flex; align-items: center; justify-content: space-between; color: #bfd0e0; font-size: 13px; }
.sporg-modern .history-list-heading button { border: 0; color: #bfd0e0; background: transparent; padding: 7px 9px; font: inherit; cursor: pointer; border-radius: 6px; }
.sporg-modern .history-list-heading button[aria-pressed=true] { background: #294a66; color: #fff; }
.sporg-modern .history-list { margin: 8px -8px 16px; gap: 6px; }
.sporg-modern .history-group { margin: 14px 10px 4px; font-size: 13px; color: #b9cadd; }
.sporg-modern .history-item { color: #f5f8fc; padding: 15px 18px; border: 0; border-left: 4px solid transparent; border-radius: 7px; font-size: 14px; line-height: 1.5; }
.sporg-modern .history-item:hover { background: #1a3b56; }
.sporg-modern .history-item.selected { background: #234660; border-left-color: #12a3f3; }
.sporg-modern .history-item small { color: #b9cee0; font-size: 12px; margin-top: 4px; }
.sporg-modern .history-item span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sporg-modern .history-empty { padding: 10px; color: #b9cee0; font-size: 14px; }
.sporg-modern .history-status { color: #e1eaf4; font-size: 12px; margin-block: 8px; }
.sporg-modern .history-status:empty { display: none; }
.sporg-modern .history-main-status:not([hidden]) {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 8px 12px;
  border-inline-start: 3px solid #477493;
  background: #edf4f8;
  color: #18324b;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sporg-modern .history-feedback { color: #c8d9e8; font-size: 14px; line-height: 1.6; margin: 16px 0 0; }
.sporg-modern .history-feedback:empty { display: none; }
.sporg-modern [data-history-retry] { min-height: 44px; color: #fff; background: #234660; border: 1px solid #607f99; font: inherit; }
.sporg-modern [data-history-retry]:hover { background: #345a78; }
.sporg-modern .conversation-actions { position: relative; padding: 0; border: 0; }
.sporg-modern .history-menu-trigger { display: flex; align-items: center; gap: 9px; color: #bacddd; background: none; border: 0; padding: 10px 0; font: inherit; font-size: 12px; cursor: pointer; }
.sporg-modern .history-menu { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; border: 1px solid #4e657b; padding: 12px; border-radius: 10px; background: #1a3851; }
.sporg-modern .history-menu button { background: none; border: 0; color: #f0f6ff; text-align: left; font: inherit; font-size: 13px; padding: 10px 6px; border-radius: 5px; cursor: pointer; }
.sporg-modern .history-menu button:hover { background: #2a4b66; }
.sporg-modern .history-menu input { color: #11223e; background: white; }
.sporg-modern .history-account { margin-top: auto; padding-top: 16px; border-top: 1px solid #3a5268; }
.sporg-modern .history-account:empty { display: none; }
.sporg-modern .history-menu .chat-privacy { position: relative; color: #b6c8d9; font-size: 12px; }
.sporg-modern .history-menu .chat-privacy summary { cursor: pointer; padding: 8px 6px; }
.sporg-modern .history-menu #sporgPrivacy { color: #d2ddeb; line-height: 1.7; font-size: 12px; }
.sporg-modern .history-menu .chat-quality .quiet-button { color: #fff; background: #234660; border: 1px solid #607f99; margin: 4px 0; width: 100%; }
.sporg-modern .history-menu .chat-quality .quiet-button:hover:not(:disabled) { color: #fff; background: #345a78; }
.sporg-modern .history-menu .chat-quality .quiet-button:focus-visible { outline: 3px solid #77c9ff; outline-offset: 2px; }
.sporg-modern .conversation-sidebar :is(button,input,summary):focus-visible { outline-color: #77c9ff !important; }
.sporg-modern > header { grid-column: 2; grid-row: 1; position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; width: auto; max-width: none; max-height: none; overflow: visible; margin: 0; padding: 28px 40px 18px 52px; gap: 12px; }
.sporg-modern > header h1 { grid-column: 1; font-size: 20px; font-weight: 650; line-height: 1.4; letter-spacing: -.3px; max-width: 900px; }
.sporg-modern .conversation-cases { grid-column: 1 / -1; position: relative; min-width: 0; font-size: 13px; }
.sporg-modern .conversation-cases > summary { cursor: pointer; color: #304b65; padding: 8px 0; overflow-wrap: anywhere; }
.sporg-modern .case-overview { position: absolute; z-index: 35; top: 100%; left: 0; width: min(540px,100%); max-height: 60dvh; overflow: auto; box-sizing: border-box; padding: 20px; border: 1px solid #ccd8e8; border-radius: 12px; background: white; box-shadow: 0 12px 38px #102b4224; }
.sporg-modern .case-overview label { display: grid; gap: 6px; color: #243b53; font-weight: 600; }
.sporg-modern .case-overview :is(select,textarea) { box-sizing: border-box; width: 100%; min-width: 0; color: #172b42; background: white; font: inherit; padding: 10px; border: 1px solid #9cafc2; border-radius: 6px; }
.sporg-modern .case-overview button { min-height: 36px; margin: 4px 6px 4px 0; }
.sporg-modern .case-overview p { margin: 8px 0; line-height: 1.5; overflow-wrap: anywhere; }
.sporg-modern .case-facts { list-style: none; padding: 0; margin: 14px 0; }
.sporg-modern .case-facts li { border-top: 1px solid #e0e7ef; padding: 12px 0; }
.sporg-modern .case-facts small { color: #52667a; }
.sporg-modern .case-editor { padding-top: 12px; border-top: 1px solid #b8c9da; }
.sporg-modern .case-editor > p { color: #52667a; font-size: 12px; }
.sporg-modern .case-change-status:empty { display: none; }
.sporg-modern .case-overview :focus-visible, .sporg-modern .conversation-cases > summary:focus-visible { outline: 3px solid #126eb4; outline-offset: 3px; }
@media (max-width: 700px), (max-height: 600px) {
  .sporg-modern .case-overview { position: static; max-height: none; box-shadow: none; width: 100%; padding: 12px; }
  .sporg-modern .case-overview :is(select,textarea) { font-size: 16px; }
  .sporg-modern .case-overview button, .sporg-modern .conversation-cases > summary { min-height: 44px; }
}
.sporg-modern > header > p:not(.conversation-date), .sporg-modern > header > [data-clear] { display: none; }
.sporg-modern.sporg-chat-mode > header > p.conversation-date { display: block; grid-column: 2; grid-row: 1; align-self: start; white-space: nowrap; margin: 5px 0 0; color: var(--chat-muted); font-size: 12px; }
.sporg-modern .chat-tools { grid-column: 1 / -1; grid-row: 2; position: static; border: 0; margin: 0; padding: 0; gap: 4px 18px; font-size: 12px; }
.sporg-modern .chat-browse { position: static; }
.sporg-modern .chat-browse > summary { color: var(--chat-muted); padding: 6px 0; min-height: 32px; font-size: 13px; }
.sporg-modern .chat-browse[open] { flex-basis: auto; }
.sporg-modern .chat-browse > .research-discovery { position: absolute; left: 0; bottom: calc(100% + 12px); z-index: 20; width: min(560px,100%); box-sizing: border-box; margin: 0; background: #fff; box-shadow: 0 12px 38px #102b4224; border: 1px solid #d8e1ec; border-radius: 12px; padding: 20px; max-height: 60dvh; overflow: auto; }
.sporg-modern .sporg-private-layout { grid-column: 2; grid-row: 2; width: auto; max-width: none; margin: 0; padding: 0 34px 22px 42px; min-height: 0; }
.sporg-modern .sporg-private-layout > section { min-height: 0; }
.sporg-modern .research-chat { padding: 0 8px 24px 10px; min-height: 0; overflow: auto; }
.sporg-modern .chat-turn { margin: 12px 0 44px; }
.sporg-modern .chat-user { background: #e5f0ff; border-radius: 12px; padding: 16px 20px; max-width: min(88%,730px); font-size: 17px; line-height: 1.6; }
.sporg-modern .chat-user p { font-size: inherit; }
.sporg-modern .chat-assistant { position: relative; padding: 38px 0 0 90px; min-width: 0; }
.sporg-modern .chat-assistant-mark { position: absolute; top: 33px; left: 0; width: 46px; height: 46px; object-fit: contain; }
.sporg-modern .chat-answer-section { margin: 0 0 24px; }
.sporg-modern .chat-answer-section p { font-size: 18px; line-height: 1.8; margin: 0; max-width: 66ch; white-space: pre-wrap; }
.sporg-modern .chat-answer-group + .chat-answer-group { border-top: 1px solid #e0e7ef; padding-top: 20px; }
.sporg-modern .chat-citations { display: inline; white-space: normal; }
.sporg-modern .chat-citations .citation-chip { display: inline-flex; align-items: center; justify-content: center; vertical-align: baseline; width: 28px; height: 28px; min-width: 28px; min-height: 28px; margin: 0 2px; padding: 0; background: #e5f1ff; border: 0; border-radius: 50%; color: #0060d8; font: 500 13px/1 inherit; }
.sporg-modern .chat-citations .citation-chip:hover { background: #cfe4ff; }
.sporg-modern .chat-answer-actions { border-top: 1px solid #e0e7ef; display: flex; align-items: start; justify-content: flex-end; flex-wrap: wrap; gap: 8px 22px; padding-top: 10px; margin-top: 32px; }
.sporg-modern .chat-source-list { border: 0; padding: 0; margin: 0; }
.sporg-modern .chat-source-list > summary, .sporg-modern .chat-answer-actions > button { border: 0; font-weight: 400; font-size: 13px; color: var(--chat-muted); padding: 8px 0; min-height: 34px; background: none; }
.sporg-modern .chat-source-list[open] { flex: 1 1 100%; }
.sporg-modern .chat-source-document { padding: 12px 0; font-size: 14px; line-height: 1.5; }
.sporg-modern .chat-source-document > div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sporg-modern .chat-source-document button { font-size: 12px; min-height: 34px; }
.sporg-modern .chat-answer-gaps { margin-top: 14px; color: #4e627c; font-size: 13px; }
.sporg-modern .chat-answer-status { font-size: 11px; color: #637793; margin-top: 10px; }
.sporg-modern .chat-answer-status > summary { font-size: 11px; padding: 4px 0; }
.sporg-modern .chat-answer-limit { margin: 0 0 24px; font-size: 13px; line-height: 1.6; background: #faf7ef; }
.sporg-modern .chat-notice { font-size: 12px; color: #5b708b; }
.sporg-modern form { display: grid; grid-template-columns: minmax(0,1fr) 54px; gap: 4px 16px; border: 1px solid #ccd8e8; border-radius: 14px; padding: 14px 20px; box-shadow: 0 5px 18px #102b420c; overflow: visible; max-height: none; position: relative; }
.sporg-modern #sporgQuestion { grid-column: 1; grid-row: 1; border: 0; box-shadow: none; padding: 4px 0; min-height: 48px; max-height: 160px; resize: vertical; font-size: 18px; line-height: 1.6; background: transparent; }
.sporg-modern #sporgQuestion::placeholder { color: #70829b; }
.sporg-modern form > button[type=submit] { grid-column: 2; grid-row: 1; align-self: center; margin: 0; min-height: 48px; min-width: 0; width: 54px; border-radius: 12px; background: var(--chat-blue); }
.sporg-modern form > button[type=submit] .sporg-icon { width: 26px; height: 26px; }
.sporg-modern form > .sporg-context { grid-column: 1; grid-row: 2; margin: 0; }
.sporg-modern .sporg-context > summary { width: fit-content; list-style: none; color: var(--chat-muted); padding: 6px 0; font-size: 13px; min-height: 28px; cursor: pointer; }
.sporg-modern .sporg-context > summary::-webkit-details-marker { display: none; }
.sporg-modern .sporg-context[open] { position: absolute; bottom: calc(100% + 12px); left: 0; right: 0; z-index: 30; background: #fff; border: 1px solid #ccd8e8; border-radius: 12px; box-shadow: 0 10px 32px #102b421a; padding: 18px; max-height: 65dvh; overflow: auto; }
.sporg-modern .sporg-context[open] > summary { font-weight: 600; color: #142b47; }
.sporg-modern form > .chat-confidentiality { display: none; }
.sporg-modern #sporgLength.near-limit { grid-column: 1 / -1; }
.sporg-modern .chat-welcome { margin: 10vh auto 14vh; max-width: 650px; }
.sporg-modern .chat-welcome h2 { font-size: 32px; }
.sporg-modern .chat-welcome p { color: var(--chat-muted); line-height: 1.8; }
.sporg-modern .chat-quote-peek { position: fixed; z-index: 80; box-sizing: border-box; width: min(clamp(320px,26vw,380px),calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid #cedaea; border-radius: 13px; padding: 22px; background: #fff; color: #142344; box-shadow: 0 12px 38px #102b421c; }
.sporg-modern .chat-quote-peek h3 { font-size: 15px; line-height: 1.6; margin: 0 28px 20px 0; }
.sporg-modern .chat-quote-peek blockquote { white-space: pre-wrap; font-size: 17px; line-height: 1.75; margin: 0; padding: 0 0 22px; border: 0; }
.sporg-modern .quote-close { position: absolute; right: 8px; top: 10px; padding: 6px; border: 0; min-height: 34px; background: none; color: #637793; }
.sporg-modern .quote-read { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 0; border-top: 1px solid #d8e2ed; border-radius: 0; padding: 18px 0 0; color: #0065ed; font-size: 15px; }
.sporg-modern .research-chat.has-open-source { display: block; overflow: auto; }
.sporg-modern .research-chat.has-open-source > .chat-transcript { display: none !important; }
.sporg-modern .chat-source-reading { overflow: visible; padding: 4px 12px 24px 0; border: 0; font-size: 16px; }
.sporg-modern .chat-source-reading > h2 { margin: 24px 0 16px; font-size: 24px; line-height: 1.4; }
.sporg-modern .source-reader-tabs { display: flex; gap: 8px; border-bottom: 1px solid #d8e1ec; margin: 0 0 24px; }
.sporg-modern .source-reader-tabs button { background: transparent; color: #546a86; border: 0; border-bottom: 2px solid transparent; padding: 12px 14px; cursor: pointer; font: inherit; }
.sporg-modern .source-reader-tabs button[aria-pressed=true] { color: #005fd7; border-bottom-color: #0065ed; }
.sporg-modern .source-original { white-space: pre-wrap; line-height: 1.85; overflow-wrap: anywhere; max-width: 80ch; }
.sporg-modern .source-original mark { background: #e5f0ff; color: inherit; scroll-margin-block: 70px; }
.sporg-modern .source-technical { margin-top: 30px; }
@media (max-width: 1050px) {
  .sporg-workspace.sporg-modern { grid-template-columns: 250px minmax(0,1fr); }
  .sporg-modern .conversation-sidebar { padding-inline: 18px; }
  .sporg-modern > header { padding: 28px 25px 16px; }
  .sporg-modern .sporg-private-layout { padding: 0 22px 20px; }
  .sporg-modern .chat-assistant { padding-left: 48px; }
  .sporg-modern .chat-assistant-mark { width: 32px; height: 32px; }
  .sporg-modern .chat-answer-section p { font-size: 16px; }
}
@media (max-width: 760px), (max-height: 600px) {
  .sporg-workspace.sporg-modern { display: block; overflow-y: auto; overflow-x: hidden; padding: 0 16px 16px; }
  .sporg-modern .conversation-sidebar { padding: 0; height: 0; overflow: visible; position: static; border: 0; }
  .sporg-modern .history-toggle { display: flex; align-items: center; gap: 8px; position: absolute; z-index: 35; top: 8px; left: 12px; width: auto; margin: 0; border: 0; background: #fff; min-height: 44px; color: #18324b; }
  .sporg-modern .conversation-sidebar .history-toggle:hover:not(:disabled) { background: #e5f0ff; color: #18324b; }
  .sporg-modern #conversationHistory { display: none; }
  .sporg-modern .conversation-sidebar.history-open #conversationHistory { display: flex; position: fixed; z-index: 70; inset: 0 auto 0 0; width: min(320px,100vw); box-sizing: border-box; height: 100dvh; min-height: 0; overflow-y: auto; margin: 0; padding: 24px; background: var(--chat-navy); border: 0; border-radius: 0; box-shadow: 15px 0 60px #102b4260; }
  .sporg-modern .history-close { display: block; color: #d8e7f5; background: none; border: 0; padding: 6px; margin-left: auto; cursor: pointer; }
  .sporg-modern .history-drawer-heading { display: flex; align-items: center; margin-bottom: 20px; gap: 12px; }
  .sporg-modern .history-drawer-heading strong { font-size: 18px; color: #fff; }
  .sporg-modern > header { display: block; padding: 68px 0 14px; width: auto; }
  .sporg-modern > header h1 { font-size: 18px; line-height: 1.4; letter-spacing: -.2px; }
  .sporg-modern.sporg-chat-mode > header > p.conversation-date { display: none; }
  .sporg-modern .chat-tools { position: static; margin-top: 0; gap: 4px 14px; }
  .sporg-modern .chat-browse[open] { flex-basis: 100%; }
  .sporg-modern .chat-browse > .research-discovery { position: relative; bottom: auto; width: 100%; box-sizing: border-box; max-height: none; padding: 12px; }
  .sporg-modern .sporg-private-layout { padding: 0; display: block; }
  .sporg-modern .research-chat { overflow: visible; padding: 0 0 22px; }
  .sporg-modern .chat-turn { margin: 14px 0 32px; }
  .sporg-modern .chat-user { font-size: 15px; max-width: 94%; padding: 14px 16px; }
  .sporg-modern .chat-assistant { padding: 52px 0 0; }
  .sporg-modern .chat-assistant-mark { width: 28px; height: 28px; top: 16px; }
  .sporg-modern .chat-answer-section p { font-size: 16px; line-height: 1.8; }
  .sporg-modern .chat-citations .citation-chip { min-width: 36px; min-height: 36px; margin: 2px; }
  .sporg-modern form { padding: 12px; gap: 4px 8px; grid-template-columns: minmax(0,1fr) 46px; }
  .sporg-modern #sporgQuestion { font-size: 16px; min-height: 52px; }
  .sporg-modern form > button[type=submit] { width: 46px; min-height: 46px; padding: 8px; }
  .sporg-modern .sporg-context > summary { font-size: 12px; min-height: 36px; }
  .sporg-modern .sporg-context[open] { position: static; grid-column: 1 / -1; padding: 12px; max-height: none; box-shadow: none; }
  .sporg-modern .chat-welcome { margin: 6vh 0 10vh; }
  .sporg-modern .chat-welcome h2 { font-size: 27px; }
  .sporg-modern .chat-quote-peek { width: calc(100vw - 24px); max-height: 75dvh; }
  .sporg-modern .chat-quote-peek blockquote { font-size: 16px; }
  .sporg-modern .chat-source-reading { padding: 0; }
  .sporg-modern .research-chat.has-open-source { overflow: visible; }
}

/* One permanent, entitlement-filtered navigation for the whole product.
   Full labels must remain readable; never squeeze six destinations into five cells. */
@media (min-width: 821px) {
  #appShell.app-shell { grid-template-rows: auto minmax(0,1fr); }
}
#appShell.app-shell > .topbar { display: grid; grid-template-columns: auto minmax(0,1fr) auto; grid-template-rows: auto; gap: 12px; padding: 10px 18px; min-width: 0; background: #102b42; color: #f7faff; }
#appShell.app-shell > .topbar .top-tabs { display: flex !important; flex-wrap: wrap; justify-content: center; width: 100%; min-width: 0; gap: 4px; padding: 0; background: transparent; border: 0; border-radius: 0; mask-image: none; overflow: visible !important; }
#appShell.app-shell > .topbar .top-tab:where(:not(.hidden):not([hidden])) { display: flex; align-items: center; justify-content: center; flex: 0 1 auto; width: auto; min-width: 0; min-height: 44px; padding: 8px 10px; gap: 7px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #e6eef7; text-align: center; }
#appShell.app-shell > .topbar .top-tab-copy { width: auto; min-width: 0; overflow: visible; }
#appShell.app-shell > .topbar .top-tab-copy strong { display: block; overflow: visible; white-space: normal; text-overflow: clip; font-size: 13px; line-height: 1.35; letter-spacing: 0; color: inherit; }
#appShell.app-shell > .topbar .top-tab-copy small { display: none; }
#appShell.app-shell > .topbar .top-tab :is(svg,.reader-icon) { display: block; width: 18px; height: 18px; flex: 0 0 18px; color: inherit; }
#appShell.app-shell > .topbar .top-tab:hover { background: #254862; color: #fff; }
#appShell.app-shell > .topbar .top-tab.active { background: #225b91; border-color: #518dc3; color: #fff; box-shadow: none; }
#appShell.app-shell > .topbar .top-tab:focus-visible { outline: 3px solid #8bd6ff; outline-offset: 1px; }
#appShell.app-shell > .topbar .top-actions { min-width: 0; }
@media (max-width: 1100px) {
  #appShell.app-shell > .topbar { grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 8px 12px; }
  #appShell.app-shell > .topbar > .brand { grid-column: 1; grid-row: 1; }
  #appShell.app-shell > .topbar .top-actions { grid-column: 2; grid-row: 1; }
  #appShell.app-shell > .topbar .top-tabs { grid-column: 1 / -1; grid-row: 2; }
  #appShell.app-shell > .topbar .brand-mark-logo { width: 36px; min-width: 36px; height: 36px; flex-basis: 36px; }
  #appShell.app-shell > .topbar .brand-mark-logo img { width: 36px; height: 36px; }
  #appShell.app-shell > .topbar .brand-name { font-size: 18px; }
  #appShell.app-shell > .topbar .brand-tagline { display: none; }
  #appShell.app-shell > .topbar .top-tab :is(svg,.reader-icon) { display: none; }
}
@media (max-width: 760px) {
  #appShell.app-shell > .topbar .top-tabs { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)); }
  #appShell.app-shell > .topbar .top-tab:where(:not(.hidden):not([hidden])) { width: 100%; padding: 6px 4px; }
}
.sporg-modern .history-followup-choice { grid-column: 1 / -1; min-width: 0; }
.sporg-modern .history-followup-choice label { display: grid; gap: 4px; }
.sporg-modern .history-followup-choice select { width: 100%; min-width: 0; }
