/*
 * The Reporting Desk's component layer (UX Phase 2; docs/handoff/ux-phase2-plan.md, ux-port-list.md),
 * written on the shared design tokens (static/tokens.css) and linked after app.css on every page.
 *
 * The shell: the app shell (G1), the side navigation (G2), the phone's top bar and its <details> menu
 * (G3), the account block (G20), the icons (G21) and the labelled search field (G19). Then the controls:
 * buttons (B1), tabs (TB1) and the data table (T1) with its pager. Then the Cases list's parts: its card (G5),
 * law chips (G8) and filter chips (G9). Then the Overview's parts: the card header (G5), the countdown ring
 * (G10), deadline rows (G12), the checklist (G14) and the progress bar (G13). Then the Case screen's parts.
 * Last the Integrations page's parts: status chips (G7) and the linked tiles (G5); its filter chips are the
 * Cases list's G9. Then Settings' sub-navigation (G4) and item rows (G18).
 * Every colour, space, radius and type step is a tokens.css custom property; the few values tokens.css
 * does not carry are the local --ui-* properties below. Dark mode comes from tokens.css: nothing here
 * names a scheme.
 *
 * app.css and order.css are in the cascade layer "legacy" and this file is in none, so a rule here wins
 * over a legacy rule on every property it sets, whatever the legacy selector's weight; a property it
 * leaves alone keeps its legacy value. A component takes a name no legacy rule has, except the spike's
 * own names (.button, .actions, .table-scroll, .tabs__*), which the pages that have not moved take with
 * it. None of the spike's element rules is here: they would restyle every page at once.
 */

:root {
  --ui-sidebar: 17rem; /* the sidebar's column on a wide screen: the mockups' 272 px, so German
                          "Schwachstellenmeldungen" and its count stay on one line */
  --ui-z-menu: 40; /* the phone's open menu, over the page */
  --ui-target: 2.75rem; /* 44 px: a finger's target */
  --ui-target-lg: 3rem; /* 48 px: a full-width button on a phone */
  --ui-target-sm: 2rem; /* 32 px: above WCAG 2.5.8's 24 px */
  --ui-text-xs: 0.75rem; /* 12 px: the smallest text, a count or a chip */
  --ui-ring-sm: 3.5rem; /* 56 px: a countdown ring in a list */
  --ui-weight-medium: 500;
  --ui-weight-strong: 600;
  --ui-border: 1px;
  --ui-motion: 120ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ui-motion: 0s;
  }
}

/* ---------- G21 Icons: one sprite (static/icons.svg), always beside words ---------- */

.icon {
  width: 1.125em;
  height: 1.125em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- G1 App shell: sidebar and one column; stacked under 60rem ---------- */

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

.shell__skip {
  position: absolute;
  left: var(--space-4);
  top: calc(-1 * var(--space-9));
  z-index: calc(var(--ui-z-menu) + 1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--ink-button);
  color: var(--ink-button-text);
  text-decoration: none;
}

.shell__skip:focus {
  top: var(--space-4);
}

/* The sidebar is drawn only on a wide screen; under 60rem the top bar's menu holds the same list. The
   shell's child selector outranks .side-nav's display, which the sidebar shares. */
.shell > .shell__side {
  display: none;
}

.shell__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shell__main {
  flex: 1 0 auto;
  min-width: 0;
  padding: var(--space-5) var(--gutter) var(--space-7);
}

/* The page frame: one column of the page's parts, at most a comfortable width. */
.shell__page {
  display: grid;
  gap: var(--space-5);
  max-width: 64rem;
}

.shell__page > * {
  min-width: 0;
}

/* The demonstration note: a dashed chip above the page, not a bar (Q-243 (1)). */
.shell__demo {
  justify-self: start;
  margin: 0;
  padding: var(--space-1) var(--space-3);
  border: var(--ui-border) dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--step--1);
}

.shell__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-4) var(--gutter);
  border-top: var(--ui-border) solid var(--line);
}

.shell__footer .footer-links {
  justify-content: flex-start;
  margin: 0;
}

/* The BitHive mark in the footer line: small, monochrome, linking to the website (Q-251 (2)). */
.shell__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target-sm);
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: var(--ui-weight-strong);
  text-decoration: none;
  white-space: nowrap;
}

.shell__brand:hover {
  color: var(--ink);
  text-decoration: underline;
}

.shell__brand svg {
  width: auto;
  height: 0.8rem;
  flex: none;
  fill: var(--color-logo);
}

@media (min-width: 60rem) {
  .shell {
    grid-template-columns: var(--ui-sidebar) minmax(0, 1fr);
  }

  /* The sidebar is its column's whole height and stays in view while the page scrolls (Q-242 (C)(3)).
     The account block at its head and the reader's foot stay put; only the list between them scrolls,
     its scrollbar hidden until the pointer or the focus is in it (UX3 A5). */
  .shell > .shell__side {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    border-right: var(--ui-border) solid var(--line);
    background: var(--surface);
  }

  .shell__side > .account-block,
  .shell__side > .side-nav__foot {
    flex: none;
  }

  .shell__side > .side-nav__scroll {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
    min-height: 0;
    margin: 0 calc(-1 * var(--space-2));
    padding: 0 var(--space-2);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  .shell__side > .side-nav__scroll::-webkit-scrollbar {
    width: 0;
  }

  .shell__side > .side-nav__scroll:hover,
  .shell__side > .side-nav__scroll:focus-within {
    scrollbar-width: thin;
  }

  .shell__side > .side-nav__scroll:hover::-webkit-scrollbar,
  .shell__side > .side-nav__scroll:focus-within::-webkit-scrollbar {
    width: 6px;
  }

  .shell__main {
    padding-top: var(--space-6);
  }
}

/* ---------- G2 Side navigation: groups, items, count, the reader's foot ---------- */

.side-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2);
  font-size: var(--step--1);
}

.side-nav__group {
  display: grid;
  gap: 0.125rem;
}

/* The workspace's pages at the foot, under the task groups. */
.side-nav__group--bottom {
  margin-top: auto;
  padding-top: var(--space-4);
}

.side-nav__heading {
  margin: 0;
  padding: var(--space-3) var(--space-2) var(--space-1);
  color: var(--muted);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-strong);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.side-nav__list {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: var(--ui-weight-medium);
  text-decoration: none;
  transition: background-color var(--ui-motion), color var(--ui-motion);
}

.side-nav__item:hover {
  background: var(--paper);
  color: var(--ink);
}

/* The current page: the highlight's soft fill and its colour, in the stronger weight. */
.side-nav__item[aria-current='page'] {
  background: var(--highlight-soft);
  color: var(--highlight);
  font-weight: var(--ui-weight-strong);
}

.side-nav__item .icon {
  color: var(--muted);
}

.side-nav__item[aria-current='page'] .icon {
  color: currentColor;
}

.side-nav__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* A count: the number seen, its words heard (the visually hidden text beside it). */
.side-nav__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: auto;
  padding: 0 var(--space-1);
  border-radius: var(--radius-pill);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--ui-text-xs);
  font-weight: 700;
  line-height: 1;
}

/* The reader's foot: by name or address with the role, linking to their settings, and beside it the
   small menu with the language switch and Sign out, each a finger high (UX3 A6). */
.side-nav__foot {
  display: grid;
  gap: var(--space-1);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: var(--ui-border) solid var(--line);
}

.side-nav__identity {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.side-nav__identity .side-nav__me {
  flex: 1;
  min-width: 0;
}

/* The menu's toggle beside the name, a finger's square; open, its controls stand above it, over the
   list, the foot's width, so the foot never grows. */
.side-nav__more {
  position: relative;
  flex: none;
}

.side-nav__more-toggle {
  display: grid;
  place-items: center;
  width: var(--ui-target);
  height: var(--ui-target);
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.side-nav__more-toggle::-webkit-details-marker {
  display: none;
}

.side-nav__more-toggle:hover {
  background: var(--paper);
  color: var(--ink);
}

.side-nav__more[open] .side-nav__more-toggle .icon {
  transform: rotate(180deg);
}

.side-nav__more .side-nav__controls {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--space-1));
  z-index: 2;
  display: grid;
  min-width: 12rem;
  padding: var(--space-1);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.side-nav__more .side-nav__control {
  width: 100%;
}

.side-nav__me {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}

.side-nav__me:hover {
  background: var(--paper);
}

.side-nav__me:hover .side-nav__me-name {
  text-decoration: underline;
}

.side-nav__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 700;
}

.side-nav__me-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

/* The reader's name on one line, cut short with an ellipsis and whole in the title (Q-251 (2)). */
.side-nav__me-name {
  overflow: hidden;
  font-weight: var(--ui-weight-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav__me-role {
  color: var(--muted);
  font-size: var(--ui-text-xs);
}

.side-nav__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-2);
}

.side-nav__controls form {
  margin: 0;
}

/* A control at the foot: a button that reads as a link, with its icon. Its own colours on hover, so
   app.css's button:hover never fills it and it never changes size under the pointer. */
.side-nav__control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target);
  margin: 0;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  color: var(--link);
  font: inherit;
  font-weight: var(--ui-weight-medium);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.side-nav__control:hover {
  background: var(--paper);
  box-shadow: none;
  color: var(--link-hover);
}

/* The switcher inside the navigation keeps its r41 rules (app.css .regime*); here it only sits. */
.side-nav .regime {
  margin: var(--space-2) 0 0;
}

/* ---------- G20 Account block: the company and its plan ---------- */

.account-block {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target-lg);
  padding: var(--space-2) var(--space-3);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
}

/* With a menu (UX3 A2): the block is a <details>, its summary the full-width button. Open, its menu lies
   over the list below the block, the block's width, rather than pushing the list down (CTO queue
   Q-1176 (2)), as the reader's menu at the foot lies over the list above it. */
.account-block--menu {
  position: relative;
  z-index: var(--ui-z-menu);
  display: block;
  padding: 0;
}

.account-block__button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target-lg);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.account-block__button::-webkit-details-marker {
  display: none;
}

.account-block__button:hover {
  background: var(--surface);
}

.account-block__chevron {
  display: grid;
  flex: none;
  margin-left: auto;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.account-block--menu[open] .account-block__chevron {
  transform: rotate(180deg);
}

.account-block__text {
  display: grid;
  flex: 1;
  gap: 0.125rem;
  min-width: 0;
  line-height: 1.3;
}

/* The company's whole name, in whole words and balanced over its lines, however long it is: never cut
   short, no ellipsis (the founder's review, 10 October 2026; CTO queue Q-1170 (2)). A single word longer
   than the block still breaks rather than leaving it. */
.account-block__name {
  font-weight: var(--ui-weight-strong);
  overflow-wrap: break-word;
  text-wrap: balance;
}

.account-block__plan {
  color: var(--muted);
  font-size: var(--ui-text-xs);
}

.account-block__menu {
  position: absolute;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.account-block__link {
  display: flex;
  align-items: center;
  min-height: var(--ui-target);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.account-block__link:hover {
  background: var(--surface);
  text-decoration: underline;
}

/* ---------- G3 Phone top bar and its <details> menu (CTO ruling Q-974 (5)) ---------- */

.top-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--gutter);
  border-bottom: var(--ui-border) solid var(--line);
  background: var(--surface);
}

.top-bar__menu {
  flex: none;
}

/* The menu's button: an icon in a 44 px square (B1's icon-only button), its word visually hidden but read.
   Closed it shows the menu's lines, open a cross, so the same button closes the menu. */
.top-bar__toggle {
  display: inline-grid;
  place-items: center;
  width: var(--ui-target);
  height: var(--ui-target);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  list-style: none;
  cursor: pointer;
}

.top-bar__toggle .icon {
  width: 1.25rem;
  height: 1.25rem;
}

.top-bar__open,
.top-bar__close {
  display: grid;
}

.top-bar__close,
.top-bar__menu[open] .top-bar__open {
  display: none;
}

.top-bar__menu[open] .top-bar__close {
  display: grid;
}

.top-bar__toggle::-webkit-details-marker {
  display: none;
}

.top-bar__menu[open] > .top-bar__toggle {
  border-color: var(--highlight);
  color: var(--highlight);
}

/* The open menu lies over the page under the bar, the bar's full width. */
.top-bar__panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--ui-z-menu);
  border-bottom: var(--ui-border) solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

/* The open menu scrolls inside itself when the navigation is longer than the screen below the bar, so the
   bar and its close button stay in view. */
.top-bar__panel > .side-nav--menu {
  max-height: calc(100vh - var(--ui-target) - 2 * var(--space-2));
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* In the menu the items read at the body's size, as the mockup's do (Phone.dc.html: 15 px items, 12 px
   group headings); the sidebar keeps its smaller step. The workspace group follows the others there:
   a menu has no foot to push it to. */
.side-nav--menu {
  padding: var(--space-2) var(--gutter) var(--space-5);
  font-size: var(--step-0);
}

.side-nav--menu .side-nav__group--bottom {
  margin-top: 0;
}

/* The account's name beside the menu (UX3 A1), in whole words, never cut short (the founder, 10 Oct). */
.top-bar__account {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: var(--step--1);
  font-weight: var(--ui-weight-strong);
  overflow-wrap: break-word;
  text-wrap: balance;
}

@media (min-width: 60rem) {
  .top-bar {
    display: none;
  }
}

/* ---------- G19 Search field: a labelled type=search input in a GET form ---------- */

/* The shell's search entry waits for search (CTO ruling Q-974 (6)); the field is the catalogue's. */
.search-field {
  display: grid;
  gap: var(--space-1);
  max-width: 28rem;
}

.search-field__label {
  font-weight: var(--ui-weight-strong);
}

.search-field__input {
  width: 100%;
  min-height: var(--ui-target);
  padding: var(--space-2) var(--space-3);
  border: var(--ui-border) solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--text);
  font: inherit;
}

/* ---------- B1 Buttons: primary, secondary, quiet, danger; small, block and icon-only ---------- */

/* app.css still styles the bare button element, and .secondary, .danger and .quiet on it, for the pages that
   have not moved. A .button sets each property those rules set but its width, which the order's sheet sets
   (order.css). A button says what it does on one line on a wide screen (the interface check holds it); on a
   phone its words wrap rather than push the page sideways. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--ui-target);
  padding: var(--space-2) var(--space-5);
  border: var(--ui-border) solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-action);
  color: var(--color-action-text);
  font: inherit;
  font-weight: var(--ui-weight-strong);
  line-height: var(--leading-tight);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ui-motion), border-color var(--ui-motion), color var(--ui-motion);
}

.button:hover {
  background: var(--color-action-hover);
  color: var(--color-action-text);
}

.button:active {
  background: var(--color-action-active);
}

/* .button.secondary is the legacy modifier on the pages that have not moved (fifteen links and buttons); it
   reads as .button--secondary until they do. */
.button--secondary,
.button.secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--color-text);
}

.button--secondary:hover,
.button--secondary:active,
.button.secondary:hover,
.button.secondary:active {
  border-color: var(--color-link);
  background: transparent;
  color: var(--color-link);
}

.button--quiet {
  background: transparent;
  color: var(--color-link);
  font-weight: var(--ui-weight-medium);
}

.button--quiet:hover,
.button--quiet:active {
  background: var(--color-surface-tint);
  color: var(--color-action-hover);
}

/* A destructive action: the danger colour with the primary button's text colour, which reads at 4.5:1 or more
   on it in both schemes, and states of its own, so pointing at it never turns it into the primary blue (CTO
   queue Q-183 (b)(2)). */
.button--danger {
  background: var(--color-danger);
  color: var(--color-action-text);
}

.button--danger:hover,
.button--danger:active {
  background: var(--color-danger-hover);
  color: var(--color-action-text);
}

.button--sm {
  min-height: var(--ui-target-sm);
  padding: var(--space-1) var(--space-3);
  font-size: var(--step--1);
}

/* The width of its column, 48 px high: a phone's main action (Phone.dc.html, "Record an incident"). In a page's
   head it fills the phone's width under the title and lead; from 60rem, where the sidebar shows, it stands
   beside the title at a button's own size. */
.button--block {
  display: flex;
  width: 100%;
  min-height: var(--ui-target-lg);
}

@media (min-width: 60rem) {
  .page__head > .button--block {
    display: inline-flex;
    width: auto;
    min-height: var(--ui-target);
  }
}

/* An icon alone, in a 44 px square. It has no words to read, so it carries its name in aria-label, a text of
   internal/i18n in the page's language, and its icon stays aria-hidden. */
.button--icon {
  width: var(--ui-target);
  min-width: var(--ui-target);
  padding: 0;
}

.button--icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* A disabled button keeps 4.5:1 text: it is muted, not faded (WCAG 1.4.3 exempts it, we do not). */
.button:disabled,
.button[aria-disabled='true'] {
  border-color: var(--color-border);
  background: var(--color-surface-tint);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* A group of actions, the primary first, with even gaps, wrapping as a whole. */
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* In a table that app.css draws as cards of labels and values on a phone, a button keeps the narrower padding
   app.css gives it there, or its label leaves the value column. */
@media (max-width: 47.99rem) {
  td .button,
  .report-action .button {
    padding-inline: var(--space-3);
  }
}

@media (max-width: 30rem) {
  .button {
    white-space: normal;
  }
}

/* ---------- TB1 Tabs: ARIA tabs with in-page panels (web/tabs.js), or links to a page each ---------- */

/* The list stays on one line and scrolls inside itself when its tabs are wider than the screen (German at
   360 px); the page never scrolls sideways. Its line is drawn inside its box, so that the scroll does not clip
   the chosen tab's mark where it lies over the line. Link tabs are a <ul> in a named <nav>, the current one
   marked aria-current="page"; ARIA tabs mark theirs aria-selected. */
.tabs__list {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-5);
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
  box-shadow: inset 0 calc(-1 * var(--ui-border)) 0 var(--color-border);
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tabs__list > li {
  display: flex;
  flex: none;
}

.tabs__tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--ui-target);
  padding: 0;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-weight: var(--ui-weight-strong);
  text-decoration: none;
  white-space: nowrap;
}

.tabs__tab:hover {
  color: var(--color-text);
}

.tabs__tab[aria-selected='true'],
.tabs__tab[aria-current='page'] {
  border-bottom-color: var(--color-action);
  color: var(--color-text);
}

/* The focus ring inside the tab, where the list's scroll cannot clip it. */
.tabs__tab:focus-visible {
  outline-offset: -2px;
}

.tabs__count {
  padding: 0 var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--color-text-muted);
  font-size: var(--ui-text-xs);
}

.tabs__panel > * + * {
  margin-top: var(--space-3);
}

/* Without the script the panels stack, each under its heading. */
.tabs__panel + .tabs__panel {
  margin-top: var(--space-5);
  padding-top: 0;
  border-top: 0;
}

.tabs--live .tabs__panel + .tabs__panel {
  margin-top: 0;
}

.tabs__heading {
  margin-bottom: var(--space-3);
}

.tabs--live .tabs__heading {
  display: none;
}

/* ---------- T1 Data table: a scroll region, a row header, chips and a due cell ---------- */

/* Below 48rem app.css turns every table into cards of labels and values (td::before with data-label). A
   .table stays a table at every width, in a scroll region that is focusable and named (tabindex="0",
   role="region" and aria-label), so at 360 px the table scrolls and the page does not. Each property
   app.css's card rules set is set back here; the other tables keep their cards. */
.table-scroll:has(> .table) {
  overflow-x: auto;
}

.table {
  display: table;
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.table > thead {
  display: table-header-group;
}

.table > tbody {
  display: table-row-group;
  width: auto;
}

.table tr {
  display: table-row;
  width: auto;
  padding: 0;
  border: 0;
}

.table th,
.table td {
  display: table-cell;
  width: auto;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-bottom: var(--ui-border) solid var(--color-border);
  color: var(--color-text);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  overflow-wrap: normal;
}

.table td::before {
  content: none;
}

.table thead th {
  background: var(--color-surface-tint);
  color: var(--color-text-muted);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-strong);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  /* A head wraps between its words, never inside one: beside the sidebar at 1280 px the cases list's six
     heads held on one line each made the table 3 to 6 px wider than its column (Interface check, #328). */
  white-space: normal;
}

.table tbody tr:last-child > * {
  border-bottom: 0;
}

.table tbody tr:hover {
  background: var(--color-surface-tint);
}

/* A product's name is never broken (Q-242 (C)(5)), in this table as in the cards. */
.table .nowrap {
  white-space: nowrap;
}

/* The row header names its row: an identifier in the mono face where the row has one, the title, which links
   to the row's page, and a line on what it is. On a phone it keeps 320 px, inside the scroll region. */
.table__rowhead {
  min-width: 14rem;
}

.table__rowhead > * {
  display: block;
}

.table__id {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.table__title {
  font-weight: var(--ui-weight-strong);
}

.table__meta {
  color: var(--color-text-muted);
}

@media (max-width: 47.99rem) {
  .table__rowhead {
    min-width: 20rem;
  }
}

/* Several chips in one cell, wrapping between chips and never inside one. */
.table__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.table__chips > .pill {
  white-space: nowrap;
}

/* The due cell: a dot and the words that say how the deadline stands (overdue, or the time left), which
   deadline it is, and when it falls, with its zone. The words carry the meaning; the dot's colour repeats it. */
.table__due {
  display: grid;
  gap: var(--space-1);
  justify-items: start;
}

.table__due > .table__due-state {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--ui-weight-strong);
  white-space: nowrap;
}

.table__due-state::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  border-radius: 50%;
  background: currentColor;
}

.table__due--overdue .table__due-state {
  color: var(--danger);
}

.table__due--running .table__due-state {
  color: var(--warning);
}

.table__due-at {
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* A deadline that has passed or falls within 24 hours: the danger colour, as the overdue one, with its time in
   the words. */
.table__due--urgent .table__due-state {
  color: var(--danger);
}

/* The row header's link holds the identifier over the title, so its name is both and every row's link differs. */
.table__link {
  display: block;
}

.table__link > * {
  display: block;
}

.table__caption {
  padding: var(--space-3);
  caption-side: top;
  color: var(--color-text-muted);
  font-size: var(--step--1);
  text-align: left;
}

/* The pager under a list: which rows are shown, and the links to the page before and after. */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
  border-top: var(--ui-border) solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* ---------- G5 The Cases list's card: the table reaches its edges, the pager is its foot ---------- */

.cases-card {
  padding: 0;
  overflow: hidden;
}

.cases-card > * + * {
  margin-top: 0;
}

/* The card clips what overflows its rounded corners, so the scroll region's focus ring is drawn inside it. */
.cases-card .table-scroll:focus-visible {
  outline-offset: -2px;
}

.cases-card > .empty {
  border: 0;
  border-radius: 0;
}

/* ---------- G8 Law chip: a case's law in a list (CRA, NIS2, GDPR, contract clocks) or its practice mark ---------- */

.law-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.law-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 var(--space-2);
  border: var(--ui-border) solid transparent;
  border-radius: var(--radius-pill);
  background: var(--color-callout);
  color: var(--color-link);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-strong);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Practice is no law: an outlined chip in the muted colour, never a law's. */
.law-chip--practice {
  border-color: var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
}

/* ---------- G9 Filter chips: groups of links the server filters on, the chosen one aria-current ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

.filter-chips,
.filter-chips__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.filter-chips > li,
.filter-chips__list > li {
  margin: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--ui-target);
  padding: 0 var(--space-3);
  border: var(--ui-border) solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: var(--ui-weight-strong);
  text-decoration: none;
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--highlight);
}

.filter-chip[aria-current='true'] {
  border-color: var(--highlight);
  background: var(--highlight-soft);
  color: var(--highlight);
}

.filter-chip__count {
  color: var(--color-text-muted);
  font-weight: normal;
}

.filter-chip[aria-current='true'] .filter-chip__count {
  color: inherit;
}

/* ---------- G5 Card parts: a card's header, its heading and one link beside it ---------- */

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
}

.card__header > h2 {
  font-size: var(--step-1);
}

/* ---------- G10 Countdown ring: the share of a deadline's window left, and the time left inside ---------- */

/* The ring is aria-hidden: the words beside it say the time for a screen reader (web/overview.templ,
   remainingWords). Its colour is its class, never a style, which the page's policy refuses: teal while the
   deadline runs, danger once it has passed or falls within 24 hours. The arc's length is an SVG attribute. */
.countdown {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  border-radius: var(--radius-pill);
  background: var(--highlight-soft);
  color: var(--highlight);
}

.countdown--sm {
  width: var(--ui-ring-sm);
  height: var(--ui-ring-sm);
}

.countdown--urgent {
  background: var(--danger-soft);
  color: var(--danger);
}

.countdown__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.countdown__ring circle {
  fill: none;
  stroke-width: 3;
}

.countdown__track {
  stroke: var(--line);
}

.countdown__fill {
  stroke: currentColor;
  stroke-linecap: round;
}

/* "23 h 12 min" on two balanced lines, "überfällig" hyphenated by the page's language, never wider than
   the ring. */
.countdown__time {
  position: relative;
  max-width: 100%;
  padding-inline: 0.2rem;
  font-size: var(--ui-text-xs);
  font-variant-numeric: tabular-nums;
  font-weight: var(--ui-weight-strong);
  line-height: 1.1;
  text-align: center;
  text-wrap: balance;
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* ---------- G12 Deadline rows: ring, stage, the case, and its product and due moment ---------- */

.deadline-list {
  padding: 0;
  list-style: none;
}

/* On a phone the ring and the words sit 12 px apart, as in Phone.dc.html, which leaves the case's name the
   most of a 360 px line; from 60rem 16 px. */
.deadline-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-top: var(--ui-border) solid var(--color-border);
}

@media (min-width: 60rem) {
  .deadline-row {
    gap: var(--space-4);
  }
}

.deadline-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.deadline-row:last-child {
  padding-bottom: 0;
}

.deadline-row__body {
  display: grid;
  flex: 1 1 auto;
  gap: var(--space-1);
  min-width: 0;
}

.deadline-row__stage {
  color: var(--color-text);
  font-size: var(--step--1);
  font-weight: var(--ui-weight-strong);
}

.deadline-row__stage--urgent {
  color: var(--danger);
}

.deadline-row__title {
  font-weight: var(--ui-weight-strong);
  overflow-wrap: anywhere;
}

.deadline-row__meta {
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

/* ---------- G14 Checklist: steps with an open mark, in their order ---------- */

.checklist {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.checklist__mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
}

.checklist__label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: var(--ui-weight-strong);
}

/* The state in words at the line's end, so that done and open never rest on the mark's colour alone. */
.checklist__state {
  flex: none;
  color: var(--muted);
  font-size: var(--step--1);
}

.checklist__item--done .checklist__mark {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--paper);
}

.checklist__item--done .checklist__mark .icon {
  width: 0.75rem;
  height: 0.75rem;
}

.checklist__item--done .checklist__label {
  color: var(--muted);
  font-weight: inherit;
  text-decoration: line-through;
}

/* ---------- G13 Progress bar: the native <progress>, its words beside it ---------- */

.progress-line {
  display: grid;
  gap: var(--space-2);
}

.progress {
  display: block;
  width: 100%;
  height: 0.5rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--highlight);
  appearance: none;
  overflow: hidden;
}

.progress::-webkit-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
}

.progress::-webkit-progress-value {
  border-radius: var(--radius-pill);
  background: var(--highlight);
}

.progress::-moz-progress-bar {
  border-radius: var(--radius-pill);
  background: var(--highlight);
}

/* ---------- Case screen: the link tabs (TB1), "More actions" (G17) and the facts (G15) ---------- */

/* The case's link tabs: the list scrolls inside itself (TB1), so German at 360 px never widens the page. */
.case-tabs {
  margin-top: var(--space-5);
}

/* G17: a <details> disclosure with plain links, no ARIA menu and no script. On a wide screen its list floats
   under the button at the page head's right edge; on a phone it opens in the flow, where it cannot overflow. */
.more-actions {
  position: relative;
}

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

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

.more-actions__list {
  display: grid;
  gap: 2px;
  margin: var(--space-2) 0 0;
  padding: var(--space-2);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: var(--shadow-2);
  list-style: none;
}

@media (min-width: 40rem) {
  .more-actions__list {
    position: absolute;
    inset-inline-end: 0;
    z-index: var(--ui-z-menu);
    min-width: 18rem;
  }
}

.more-actions__item {
  display: flex;
  align-items: center;
  min-height: var(--ui-target);
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: var(--ui-weight-strong);
  text-decoration: none;
}

.more-actions__item:hover {
  background: var(--surface-strong);
}

/* G15: terms and values side by side, in one column under 40rem. */
.desc-list {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr);
  gap: var(--space-3) var(--space-5);
  margin: 0;
}

.desc-list > dt {
  color: var(--muted);
  font-size: var(--step--1);
}

.desc-list > dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.desc-list__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.desc-list__values {
  margin: 0;
  padding-inline-start: var(--space-4);
}

@media (max-width: 39.99rem) {
  .desc-list {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1) 0;
  }

  .desc-list > dd {
    margin-bottom: var(--space-3);
  }
}

/* ---------- Integrations: the find line, status chips (G7) and tiles (G5); its filter chips are G9 above ---------- */

/* The search field and the filter chips on one line on a wide screen, the chips under it on a phone. */
.integrations-find {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
}

.integrations-find__form {
  flex: 1 1 18rem;
  max-width: 28rem;
}

.search-field__row {
  display: flex;
  gap: var(--space-2);
}

.search-field__row > .search-field__input {
  flex: 1 1 auto;
  min-width: 0;
}

/* G7 Status chip: the words say the state; the colour only repeats it. */
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  padding: 0 var(--space-3);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--ui-text-xs);
  font-weight: var(--ui-weight-strong);
  line-height: var(--leading-tight);
}

.status-chip--ok {
  border-color: transparent;
  background: var(--ok-soft);
  color: var(--ok);
}

.status-chip--planned {
  border-color: transparent;
  background: var(--surface-strong);
  color: var(--muted);
}

.status-chip--attention {
  border-color: transparent;
  background: var(--warning-soft);
  color: var(--warning);
}

/* The Integrations page's callout for an integration whose last attempt to send failed: a sign, a
   sentence naming it and the link to put it right. */
.banner--warning {
  background: var(--warning-soft);
  color: var(--ink);
  font-weight: 500;
}

.banner--warning .banner__sign {
  color: var(--warning);
}

.banner--warning p {
  margin: 0;
}

/* A group: its heading with a muted lead, then its tiles. */
.integration-group {
  display: grid;
  gap: var(--space-3);
}

.integration-group > h2 {
  font-size: var(--step-1);
}

.integration-group__lead {
  color: var(--muted);
  font-size: var(--step--1);
  font-weight: normal;
}

/* G5 tile variant: the whole tile is one link, its name, line and state its one accessible name. */
.integration-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.integration-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4) var(--space-5);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  text-decoration: none;
}

a.integration-tile:hover {
  border-color: var(--highlight);
}

.integration-tile__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.integration-tile__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.integration-tile__name {
  font-weight: var(--ui-weight-strong);
  overflow-wrap: anywhere;
}

.integration-tile__line {
  color: var(--muted);
  font-size: var(--step--1);
}

.integration-tile__state {
  margin-top: auto;
}

/* A tile that leads to more than one page lists its links between the line and the state. */
.integration-tile__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
}

/* ---------- G4 Sub navigation: Settings' pages in groups, beside the page or in a <details> ---------- */

/* The sub-navigation's card and the page share a row while both fit (a 14rem list beside a 32rem page), and the
   page goes under the list where they do not. The page keeps the frame's column of parts and its gaps. */
.settings-frame {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-5);
}

/* The page's head spans the frame, above the sub-navigation and the page (ux3 C2). */
.settings-frame__head {
  flex: 1 1 100%;
  min-width: 0;
}

.settings-frame__side {
  flex: 1 1 14rem;
  max-width: 16rem;
}

.settings-frame__body {
  display: grid;
  flex: 999 1 32rem;
  gap: var(--space-5);
  min-width: 0;
}

.settings-frame__body > * {
  min-width: 0;
}

.settings-frame__side > .sub-nav {
  padding: var(--space-2);
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.sub-nav {
  display: grid;
  gap: var(--space-1);
}

.sub-nav__heading {
  margin: 0;
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: var(--step--1);
  font-weight: var(--ui-weight-strong);
}

.sub-nav__list {
  display: grid;
  gap: 0.125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A full finger high on every screen: the list is the phone's too. */
.sub-nav__item {
  display: flex;
  align-items: center;
  min-height: var(--ui-target);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--step--1);
  text-decoration: none;
  overflow-wrap: anywhere;
  hyphens: auto;
  transition: background-color var(--ui-motion), color var(--ui-motion);
}

.sub-nav__item:hover {
  background: var(--surface);
  color: var(--ink);
}

/* The current page: the highlight's soft fill and its colour, as in the side navigation. */
.sub-nav__item[aria-current='page'] {
  background: var(--highlight-soft);
  color: var(--highlight);
  font-weight: var(--ui-weight-strong);
}

.sub-nav__note {
  margin: var(--space-2) var(--space-3) var(--space-1);
  color: var(--muted);
  font-size: var(--step--1);
}

/* The phone's disclosure: hidden on a wide screen, where the card stands beside the page. */
.sub-nav-menu {
  display: none;
  flex: 1 1 100%;
  border: var(--ui-border) solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.sub-nav-menu__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: var(--ui-target-lg);
  padding: var(--space-2) var(--space-4);
  font-weight: var(--ui-weight-strong);
  list-style: none;
  cursor: pointer;
}

.sub-nav-menu__toggle::-webkit-details-marker {
  display: none;
}

.sub-nav-menu__label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sub-nav-menu__current {
  font-weight: var(--ui-weight-medium);
}

.sub-nav-menu__toggle .icon {
  flex: none;
  transition: transform var(--ui-motion);
}

.sub-nav-menu[open] > .sub-nav-menu__toggle .icon {
  transform: rotate(180deg);
}

.sub-nav-menu > .sub-nav {
  padding: 0 var(--space-2) var(--space-2);
}

@media (max-width: 47.99rem) {
  .sub-nav-menu {
    display: block;
  }

  .settings-frame__side {
    display: none;
  }
}

/* ---------- G18 Item list rows: a name, its detail and one action, wrapping at 360 px ---------- */

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

.item-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) 0;
  border-top: var(--ui-border) solid var(--line);
}

.item-list__row:first-child {
  border-top: 0;
}

.item-list__text {
  display: grid;
  flex: 1 1 18rem;
  gap: 0.125rem;
  min-width: 0;
}

.item-list__name {
  margin: 0;
  font-size: var(--step-0);
  font-weight: var(--ui-weight-strong);
}

.item-list__detail {
  margin: 0;
  color: var(--muted);
  font-size: var(--step--1);
}

/* The row's action: a link, or a one-choice form whose field and button stay together. */
.item-list__action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.item-list__action select {
  min-height: var(--ui-target);
  max-width: 100%;
}

/* The parts of a Settings page, each under its heading. */
.settings-section {
  display: grid;
  gap: var(--space-3);
}

.settings-section > h2 {
  margin: 0;
}
