/* The product console, after the team's console design: a pale sidebar with the Knowledge pages
   under one heading, a breadcrumb and search bar, cards with hairline borders, pill marks and
   quiet tables, in Inter. Light only, as the design is. Other stylesheets (document, sync,
   activity, edits) build on these variables. */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/static/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
}

:root {
  --canvas: #ffffff;
  --surface: #ffffff;
  --side: #f6f7f6;
  --panel: #f3f6f4;
  --panel-quiet: #f7f8f7;
  --hover: #ecefed;
  --edge: #e6e9e7;
  --edge-soft: #f0f2f1;
  --edge-strong: #dde2df;
  --edge-dashed: #cbd2ce;
  --ink: #16201c;
  --ink-mid: #4a5550;
  --ink-soft: #5b6661;
  --ink-faint: #7a847f;
  --brand: #0c4e58; /* Lextant teal: the logo, and the accent below */
  --accent: var(--brand);
  --accent-hover: #083a42;
  --accent-ink: #ffffff;
  --accent-soft: #e2eff1;
  --ok: #1a5a40;
  --ok-soft: #e5f1ea;
  --pending: #6e4300;
  --pending-soft: #fff1d2;
  --alert: #8a3b22;
  --alert-soft: #f7e9e4;
  --future: #2e4a7a;
  --future-soft: #e9eef7;
  --gray: #4a524e;
  --gray-soft: #eef0ef;
  --shadow: 0 1px 2px rgb(22 32 28 / 5%);
  --shadow-lift: 0 2px 8px rgb(22 32 28 / 6%);
  --radius: 14px;
  --radius-small: 9px;
  --card-title-size: 17px; /* every card's title, h2 or .card-title */
  --card-title-weight: 620;
  --button-height: 36px; /* every page-level button, .button or button.primary */
  --serif: "Source Serif 4", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The shell: the sidebar, then the page under its top bar. */

.shell {
  display: grid;
  grid-template-columns: 233px minmax(0, 1fr);
  min-height: 100vh;
  background: linear-gradient(to right, var(--side) 233px, var(--canvas) 233px);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100vh;
  padding: 20px 14px;
  overflow-y: auto;
  background: var(--side);
}

.brand {
  display: block;
  padding: 6px 10px 20px;
  color: var(--brand);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 24px;
}

/* The company whose space this is: its own labelled card under the logo, not a tagline. */
.workspace {
  display: grid;
  gap: 2px;
  margin: 0 0 20px;
  padding: 8px 10px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-small);
}

.workspace-label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sections {
  flex: 1;
}

.sections ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav,
.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #2d3833;
  font-weight: 500;
}

.nav svg {
  flex: none;
}

.nav:hover,
.nav-list a:hover,
.nav-sub a:hover {
  background: var(--hover);
  color: var(--ink);
  text-decoration: none;
}

.nav.is-here,
.nav-list a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.nav-list a[aria-current="page"] {
  background: #fff;
  box-shadow: 0 0 0 1px #e3e7e4;
}

.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 8px 22px !important;
}

.nav-sub a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--ink-mid);
  font-size: 13.5px;
}

.nav-sub a[aria-current="page"] {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px #e3e7e4;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.who {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  padding: 12px 10px 0;
  border-top: 1px solid var(--edge);
  font-size: 13px;
}

.who-name {
  font-weight: 600;
}

.sign-out {
  margin: 0;
}

.sign-out .link-button {
  padding: 2px 0;
}

main {
  min-width: 0;
  width: 100%;
  max-width: calc(1120px + 88px);
  padding: 28px 44px 64px;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  margin-bottom: 28px;
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

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

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

.crumb .sep {
  color: #a3aca7;
}

/* In the top bar the crumb takes what the search leaves, its last step (a document's or a
   counterparty's name) cut with an ellipsis, so the search stays at its right on a laptop; only
   where the crumb would have less than 12rem, on a phone, does the search wrap under it. */

.top > .crumb {
  flex: 1 1 0;
  flex-wrap: nowrap;
  min-width: 12rem;
}

.top > .crumb > * {
  flex: none;
}

.top > .crumb > span:last-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masthead {
  padding: 20px 24px;
}

main.alone {
  max-width: 30rem;
  margin: 4rem auto;
  padding: 0 16px;
}

/* Headings and page heads. */

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h2,
.card-title {
  margin: 32px 0 12px;
  font-size: var(--card-title-size);
  font-weight: var(--card-title-weight);
  letter-spacing: -0.01em;
}

.card-title {
  margin: 0 0 14px;
}

h3 {
  margin: 20px 0 8px;
  font-size: 15px;
  font-weight: 600;
}

.page-head {
  margin-bottom: 24px;
}

.page-head .marks {
  margin-top: 8px;
}

.eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 13px;
}

.lede,
.holds {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.quiet,
.code,
.coverage {
  color: var(--ink-soft);
}

.coverage {
  font-size: 13px;
}

.small {
  font-size: 12.5px;
}

.strong {
  font-weight: 600;
}

.sub {
  display: block;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.label {
  margin-bottom: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.count {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--gray-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.nowrap {
  white-space: nowrap;
}

.mono {
  font-family: var(--mono);
}

.serif {
  font-family: var(--serif);
}

/* Controls. */

input,
button,
select,
textarea,
.button {
  font: inherit;
  font-size: 13.5px;
  padding: 7px 11px;
  border: 1px solid var(--edge-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: #8a938f;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 550;
  cursor: pointer;
}

button:hover,
.button:hover {
  border-color: #c9d0cc;
  background: var(--panel-quiet);
  color: var(--ink);
  text-decoration: none;
}

.button,
button.primary {
  justify-content: center;
  min-height: var(--button-height);
}

button.primary,
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

button.primary:hover,
.button.primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.link-button {
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: inherit;
  font-weight: 500;
}

.link-button:hover {
  background: none;
  color: var(--accent-hover);
  text-decoration: underline;
}

select[multiple] {
  padding: 0.25rem;
}

label.field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  font-weight: 550;
}

/* Sign-in. */

.sign-in {
  display: grid;
  gap: 18px;
  padding: 32px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
}

.sign-in h1 {
  font-size: 24px;
}

.sign-in .notice {
  margin: 0;
}

.sign-in-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.sign-in-select {
  position: relative;
  display: flex;
  align-items: center;
}

.sign-in-select select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  appearance: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.sign-in-select select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sign-in-select svg {
  position: absolute;
  right: 12px;
  color: var(--ink-faint);
  pointer-events: none;
}

.sign-in-go {
  justify-content: center;
  padding: 10px 14px;
  font-size: 14px;
}

/* A failure page: what was not found or not shown, and the way on. */

/* The heading sits where a section page's h1 does, below the crumb row it has none of. */
.failure {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 34rem;
  margin: 23px 0 0;
}

.failure-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

main.alone .failure {
  margin-top: 0;
}

.failure-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gray-soft);
  color: var(--gray);
}

.failure .lede {
  margin: 0;
}

.failure-search {
  width: 100%;
  margin-top: 8px;
}

.failure-search .search {
  width: 100%;
}

.failure-way {
  margin: 8px 0 0;
}

.failure-code {
  margin: 18px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
}

/* Search: the compact box in the top bar, the wide one leading the Overview. */

.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 380px);
  margin: 0;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--ink-soft);
  pointer-events: none;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px 8px 34px;
  border-color: #e1e5e2;
  border-radius: 10px;
  font-size: 14px;
}

.search input:focus {
  border-color: #b9c4be;
  outline: none;
  box-shadow: 0 0 0 3px rgb(30 91 69 / 10%);
}

.search-wide {
  width: 100%;
}

.search-wide .search-icon {
  left: 16px;
}

.search-wide input {
  padding: 14px 16px 14px 44px;
  border-radius: var(--radius);
  font-size: 16px;
  box-shadow: var(--shadow);
}

.found {
  list-style: none;
  margin: 0;
  padding: 0;
}

.found li {
  position: relative;
  padding: 12px 16px;
  border-top: 1px solid var(--edge-soft);
}

.found li:hover {
  background: var(--panel);
}

.found a {
  color: var(--ink);
  font-weight: 600;
}

.found a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.found li:hover a {
  text-decoration: underline;
}

.snippet {
  display: block;
  margin-top: 6px;
  color: #2d3833;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
}

/* Cards: a hairline border, a heading row with its action at the right. */

.card {
  margin: 0 0 22px;
  padding: 20px 22px;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}

.card > h2:first-child,
.card > header:first-child h3,
.card-head h2 {
  margin-top: 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-head h2 {
  margin-bottom: 0;
}

.card-link {
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card-link:hover {
  border-color: #bfcac4;
  box-shadow: var(--shadow-lift);
}

.card-link h2 a {
  color: var(--ink);
}

.card-link h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

.grid-2 > .card {
  margin: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.line-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.line-list > li,
.line-list > a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--edge-soft);
  color: var(--ink);
}

.line-list > a:hover {
  color: var(--accent);
  text-decoration: none;
}

.empty {
  padding: 16px 18px;
  border: 1px dashed var(--edge-dashed);
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.notice {
  padding: 12px 16px;
  border: 1px solid #cfe3d8;
  border-radius: 10px;
  background: var(--accent-soft);
}

.notice-warning {
  border-color: #f2dfae;
  background: var(--pending-soft);
}

.note {
  color: var(--ink-soft);
  font-size: 13px;
}

/* Pills: a status with its dot; marks and badges share the shape. */

.pending {
  color: var(--pending);
}

.pill,
.mark,
.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 9px;
  background: currentColor;
}

.mark {
  margin-left: 6px;
}

.pill-force,
.badge-current,
.badge-up-to-date {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-gray,
.badge-outdated,
.badge-neutral {
  background: var(--gray-soft);
  color: var(--gray);
}

.pill-draft {
  background: #fff;
  color: var(--gray);
  box-shadow: inset 0 0 0 1px var(--edge-dashed);
}

.pill-future {
  background: var(--future-soft);
  color: var(--future);
}

.pill-flag,
.mark-pending,
.mark-warning,
.badge-pending,
.badge-updating {
  background: var(--pending-soft);
  color: var(--pending);
}

.pill-out,
.mark-withheld,
.mark-missing,
.badge-cannot-reach {
  background: var(--alert-soft);
  color: var(--alert);
}

.mark-withheld {
  white-space: normal;
}

.mark-link {
  margin-left: 6px;
  font-size: 12.5px;
  font-weight: 500;
}

.chip {
  border: 1px solid #e1e5e2;
  background: #fff;
  color: #2d3833;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
}

a.chip:hover {
  border-color: #c9d0cc;
  color: var(--ink);
  text-decoration: none;
}

/* Facts and summaries. */

.facts,
.summary {
  display: grid;
  gap: 16px 28px;
  margin: 0;
}

.facts {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}

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

.facts.one {
  grid-template-columns: 1fr;
  gap: 10px;
}

.facts div,
.summary div {
  display: grid;
  gap: 2px;
  align-content: start;
}

.summary div {
  grid-template-columns: 10rem 1fr;
}

dt {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

dd {
  margin: 0;
}

.plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.plain li + li {
  margin-top: 0.25rem;
}

.prose {
  max-width: 780px;
  font-size: 15px;
}

.prose p {
  margin: 0 0 12px;
}

.prose p:last-child {
  margin-bottom: 0;
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  padding: 10px 0;
  border-top: 1px solid var(--edge-soft);
}

.rows .name {
  font-weight: 600;
}

/* Tables: a card holding a quiet table; a row is one link. */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}

.list {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap .list {
  margin: 0;
}

.list th,
.list td {
  padding: 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--edge-soft);
}

.list tbody tr:last-child > td {
  border-bottom: 0;
}

.list thead th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--edge);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.list .number {
  text-align: right;
  white-space: nowrap;
}

.list td.lead > a:first-child {
  color: var(--ink);
  font-weight: 600;
}

.rows-link tbody tr:hover > td {
  background: var(--panel);
}

.rows-link tbody tr:hover td.lead > a:first-child {
  text-decoration: underline;
}

/* A row that is one link: static/rows.js opens its lead link on a click elsewhere in the row. */

.rows-link tbody tr {
  cursor: pointer;
}

h2[id] {
  scroll-margin-top: 16px;
}

.is-pending > td {
  background: color-mix(in srgb, var(--pending-soft) 45%, transparent);
}

.is-flagged > td {
  background: color-mix(in srgb, var(--pending-soft) 70%, transparent);
}

.sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
}

.sort:hover {
  color: var(--ink);
}

th[aria-sort="ascending"] .sort,
th[aria-sort="descending"] .sort {
  color: var(--ink);
}

th[aria-sort="ascending"] .sort::after {
  content: "↑";
}

th[aria-sort="descending"] .sort::after {
  content: "↓";
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 12px;
  font-size: 13px;
}

.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
}

.filters select {
  padding: 5px 8px;
  font-size: 13px;
}

.filters button {
  padding: 5px 11px;
  font-size: 13px;
}

/* Tabs: the design's underlined tabs, each with its count. */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--edge);
}

.tabs a {
  padding: 8px 0 10px;
  color: var(--ink-mid);
  font-weight: 500;
}

.tabs a:hover {
  color: var(--ink);
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.tabs .count,
.tabs .tab-count {
  margin-left: 2px;
  padding: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: inherit;
  font-weight: 500;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.pager a {
  padding: 5px 10px;
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.pager a:hover {
  background: var(--panel-quiet);
  text-decoration: none;
}

.term {
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  margin-bottom: 1rem;
}

/* The Overview: the company card, the wide search and its suggestions, the area cards. */

.overview-head {
  margin: 40px 0 18px;
}

.overview-lead {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 0 36px;
}

.overview-lead .card {
  margin: 0;
}

.overview-company h2 {
  margin: 0 0 6px;
}

/* The company card shows the summary's first whole sentences (overview.opening); the clamp only
   guards an unusually long first sentence. */

.clamp {
  display: -webkit-box;
  margin: 0 0 14px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.entity-names {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin: 0;
}

.try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

/* Three cards side by side down to a small laptop (1024 wide), one above another on a phone. */

.area-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.area-note {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--edge-soft);
  color: var(--ink-soft);
  font-size: 12px;
}

.area-card {
  margin: 0;
}

.area-card h2 a {
  color: var(--ink);
}

.area-card .card-head {
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-bottom: 6px;
}

/* The Company page and the summaries on the counterparty and document pages. */

.company-facts {
  margin-top: 16px;
}


/* A counterparty's page: its marks, summary, and documents grouped by agreement. */

.marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
}

.how {
  color: var(--ink-soft);
  font-size: 12.5px;
}

.how summary {
  cursor: pointer;
}

.how p {
  max-width: 40rem;
  margin: 6px 0 0;
}

/* A source's tile: Data sources and Permissions draw its icon in it. */

.tile {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  margin-right: 0.35rem;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--panel);
  font-weight: 700;
  vertical-align: middle;
}

/* The shared controls (templates/controls.html): the filter bar with its chips and menus, the
   source chip and the pager. Built for every list page; another page reuses them as they are. */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.filter-bar .spacer {
  flex: 1;
}

.bar-count {
  white-space: nowrap;
}

.menu {
  position: relative;
}

.menu > summary {
  list-style: none;
  cursor: pointer;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.add-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px dashed var(--edge-strong);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--ink-mid);
  font-size: 13px;
  font-weight: 550;
}

.add-button:hover,
.add-filter[open] > .add-button {
  border-color: #b9c4be;
  background: var(--panel-quiet);
  color: var(--ink);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 0;
  border: 1px solid #e1e5e2;
  border-radius: 99px;
  background: #fff;
  color: #2d3833;
  font-size: 13px;
  font-weight: 500;
}

.filter-chip:hover {
  border-color: #c9d0cc;
}

.filter-chip > .menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 4px 5px 11px;
  border-radius: 99px;
}

.filter-chip strong {
  font-weight: 600;
  color: var(--ink);
}

.filter-remove {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 99px;
  color: var(--ink-faint);
}

.filter-remove:hover {
  background: var(--hover);
  color: var(--ink);
}

.chevron {
  flex: none;
  color: var(--ink-faint);
}

.menu-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 13rem;
  max-height: 20rem;
  margin: 0;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(22 32 28 / 12%), 0 1px 2px rgb(22 32 28 / 6%);
  list-style: none;
  font-size: 13.5px;
}

.menu-list a,
.menu-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 450;
  white-space: nowrap;
}

.menu-list a:hover,
.menu-list summary:hover,
.sub-menu[open] > summary {
  background: var(--panel);
  text-decoration: none;
}

.menu-list a[aria-current="true"] {
  font-weight: 600;
}

.menu-list a[aria-current="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 9px;
  background: var(--accent);
}

/* A filter's values open beside the filter's name in the "+ Filter" menu, which does not clip
   them. */

.add-filter > .menu-list {
  max-height: none;
  overflow: visible;
}

.sub-menu > .menu-list {
  top: -6px;
  left: calc(100% + 6px);
}

.src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1px dashed var(--edge-dashed);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
}

a.src-link {
  border-style: solid;
  border-color: #cfd8d3;
  color: var(--accent);
}

a.src-link:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.pager-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager a[aria-current="page"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pager-off {
  padding: 5px 10px;
  border: 1px solid var(--edge-strong);
  border-radius: 8px;
  color: #9aa39f;
  font-size: 13px;
}

/* Long text folded to a few lines; "Show more" shows the rest (static/controls.js). */

.js .folded:not(.is-open) {
  max-height: 7.6em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}

.show-more {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 500;
}

.show-more::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 0 2px 3px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
}

.show-more[aria-expanded="true"]::after {
  margin: 3px 0 0 3px;
  transform: rotate(-135deg);
}

.show-more:hover {
  background: none;
  color: var(--accent-hover);
  text-decoration: underline;
}

/* The search results: one card per kind, each result with its line, status and marked words. */

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

.found-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.found-head .pill {
  position: relative;
  z-index: 1;
}

.found .sub {
  margin-top: 2px;
}

/* The Counterparties list: the design's column widths, names wrapping before the rest. */

.counterparty-list {
  table-layout: fixed;
}

.counterparty-list .col-name {
  width: 31%;
}

.counterparty-list .col-status {
  width: 15%;
}

.counterparty-list .col-date {
  width: 16%;
}

.counterparty-list .col-count {
  width: 17%;
}

.counterparty-list .col-country {
  width: 21%;
}

/* A counterparty's page: its summary, details with names as chips, its group, and its documents,
   each agreement its main document's row with its others nested under it. */

.name-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.name-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: #f2f4f3;
  color: var(--ink-mid);
  font-size: 12.5px;
}

.add-name {
  padding: 2px 4px;
  font-size: 12.5px;
}

.group-list {
  margin-top: -4px;
}

.group-list > li {
  align-items: baseline;
}

.group-list .small {
  text-align: right;
}

.documents-card {
  padding-bottom: 8px;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -10px;
}

.grouped {
  table-layout: fixed;
}

.grouped .col-dates {
  width: 13.5rem;
}

.grouped .col-status {
  width: 11rem;
}

.grouped .col-source {
  width: 11.5rem;
}

/* Narrower, the document's name keeps the room: dates wrap only at their dash, the status and
   source columns take what their pill and chip need (the chip without its store icon), and a
   group member's name sits above what it is. The crumb leaves the top bar's search less room, so a counterparty's name shows whole. */

@media (max-width: 80rem) {
  .grouped .col-dates {
    width: 7.5rem;
  }

  .grouped .col-status {
    width: 9.5rem;  /* "Starts 1 Mar 2027" on one line, clear of the source chip */
  }

  .grouped .col-source {
    width: 9.5rem;
  }

  .grouped .src > svg:first-child {
    display: none;
  }

  .group-list > li {
    flex-direction: column;
    gap: 2px;
  }

  .group-list .small {
    text-align: left;
  }

  .top .search {
    width: min(100%, 300px);
  }

  .top .search input {
    text-overflow: ellipsis;
  }

  .area-cards {
    gap: 16px;
  }

  .area-card {
    padding: 18px;
  }

  .area-card .card-head {
    flex-direction: column;
  }
}

.list td.lead > a.strong,
.list td.lead > a:first-child {
  color: var(--ink);
  font-weight: 550;
}

.grouped .family-head > td {
  background: var(--panel-quiet);
}

.grouped .family-head td.lead {
  position: relative;
  padding-left: 34px;
}

.grouped td.lead > a.strong {
  color: var(--accent);
}

.grouped .family-head td.lead > a.strong {
  font-weight: 600;
}

.fold {
  position: absolute;
  top: 12px;
  left: 6px;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--ink-mid);
}

.fold:hover {
  background: var(--hover);
}

.fold[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.grouped tr.member td.lead {
  padding-left: 34px;
  background-image: linear-gradient(var(--edge-strong), var(--edge-strong));
  background-position: 18px 0;
  background-repeat: no-repeat;
  background-size: 1px 100%;
}

.grouped tbody + tbody tr:first-child > td {
  border-top: 1px solid var(--edge-soft);
}

.group-documents {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--edge-soft);
}

.group-documents > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 10px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.group-documents > summary::-webkit-details-marker {
  display: none;
}

.group-documents[open] > summary .chevron {
  transform: rotate(90deg);
}

.group-documents .group-company {
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.group-documents .group-company a {
  color: inherit;
}

/* The Company page. */

/* Entity cards side by side end level, whatever each holds. */

.entity-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.entity-card .card-head {
  margin-bottom: 12px;
}

.entity-card h3 {
  margin: 0;
  font-size: 15px;
}

.multiline {
  white-space: pre-line;
}


/* Narrow screens: the sidebar becomes a bar of sections above the page. */

@media (max-width: 52rem) {
  .shell {
    grid-template-columns: 1fr;
    background: none;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px 16px;
    border-bottom: 1px solid var(--edge);
  }

  .brand {
    padding: 0 0 8px;
  }

  .workspace {
    margin-bottom: 10px;
  }

  .sections {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
  }

  .sections > .nav {
    display: none;
  }

  .nav-sub,
  .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0 !important;
  }

  .nav-list a svg {
    display: none;
  }

  .nav-sub a,
  .nav-list a {
    padding: 5px 9px;
    font-size: 13px;
  }

  .who {
    padding-top: 8px;
  }

  main {
    padding: 20px 16px 48px;
  }

  .top {
    margin-bottom: 18px;
  }

  .search,
  .top .search {
    width: 100%;
  }

  .area-cards {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 25px;
  }

  .facts.two,
  .summary div {
    grid-template-columns: 1fr;
  }

  .card,
  .document {
    padding: 16px;
  }
}

.list-note {
  margin: -8px 0 14px;
}

/* Search results: one stacked card per kind. */

.result-group {
  margin-bottom: 26px;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.group-head h2 {
  margin: 0;
}

.found.card {
  padding: 0;
  overflow: hidden;
}

.found.card li:first-child {
  border-top: 0;
}

/* Faked status choices show on the row pointed at, so a list stays calm. */

.rows-link .edit-choice {
  opacity: 0;
  transition: opacity 0.12s;
}

.rows-link tr:hover .edit-choice,
.rows-link .edit-choice:focus-within {
  opacity: 1;
}

