@font-face {
  font-family: "Exo";
  src: url("/assets/exo-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #16323b;
  --ink-muted: #62757c;
  --paper: #f5f7f7;
  --surface: #ffffff;
  --surface-muted: #f0f5f5;
  --line: rgb(15 114 143 / 16%);
  --line-strong: rgb(15 114 143 / 30%);
  --brand: #0f728f;
  --brand-hover: #09566d;
  --brand-deep: #073b4a;
  --brand-soft: #e8f4f6;
  --accent: #0f728f;
  --danger: #9a3329;
  --danger-soft: #f9e8e5;
  --success: #276746;
  --success-soft: #e4f2e9;
  --warning: #8a5a17;
  --warning-soft: #fff1d7;
  --info: #2d5f73;
  --info-soft: #e5f1f5;
  --shadow-sm: 0 1px 2px rgb(9 86 109 / 6%), 0 7px 22px rgb(9 86 109 / 6%);
  --shadow-md: 0 4px 12px rgb(5 43 54 / 10%), 0 24px 60px rgb(5 43 54 / 12%);
  --radius-sm: 5px;
  --radius-md: 7px;
  --radius-lg: 14px;
  --content: 1240px;
  --font-sans: "Exo", Arial, sans-serif;
  --font-serif: "Exo", Arial, sans-serif;
}

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

html {
  min-height: 100%;
  background: var(--paper);
  font-family: var(--font-sans);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--brand);
  text-underline-offset: 0.17em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: var(--brand-hover);
}

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

button,
select {
  cursor: pointer;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0.55rem;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4vw, 3.55rem);
  font-weight: 300;
}

h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.3rem, 2vw, 1.65rem);
}

h2,
h3 {
  font-weight: 550;
}

h3 {
  margin-bottom: 0.35rem;
  font-size: 1.04rem;
}

code {
  padding: 0.1rem 0.28rem;
  border-radius: 4px;
  background: var(--surface-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 0.75rem;
  left: 0.75rem;
  transform: translateY(-160%);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: white;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgb(15 114 143 / 32%);
  outline-offset: 3px;
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgb(15 114 143 / 10%);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 8px 26px rgb(9 86 109 / 10%);
  backdrop-filter: blur(14px) saturate(1.08);
}

.app-header__inner {
  display: grid;
  grid-template-columns: minmax(215px, 1fr) auto minmax(215px, 1fr);
  gap: 1rem;
  align-items: center;
  width: min(calc(100% - 2.5rem), var(--content));
  min-height: 72px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  min-width: 0;
  gap: 0.62rem;
  align-items: center;
  width: fit-content;
  color: var(--ink);
  text-decoration: none;
}

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

.brand__mark {
  display: grid;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  grid-template-columns: 1fr;
  place-content: center;
  border: 1px solid var(--brand);
  border-radius: 10px 3px 10px 3px;
  background: linear-gradient(145deg, var(--brand-deep), var(--brand));
  box-shadow: 0 6px 16px rgb(9 86 109 / 16%);
  color: white;
  line-height: 0.82;
  text-align: center;
}

.brand__mark > span {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand__text {
  display: grid;
  min-width: 0;
  line-height: 1.12;
}

.brand__text strong {
  color: var(--brand-deep);
  font-size: 1.08rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand__text small {
  margin-top: 0.22rem;
  color: var(--ink-muted);
  font-size: 0.62rem;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.brand__maker {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.3rem;
  align-items: center;
  margin-left: 0.12rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-muted);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.brand__maker-logo {
  display: block;
  width: 2.8rem;
  height: 1.15rem;
  object-fit: contain;
}

.brand--public .brand__mark {
  border-color: rgb(255 255 255 / 50%);
  background: rgb(255 255 255 / 13%);
  box-shadow: none;
}

.brand--public .brand__text,
.brand--public:hover {
  color: white;
}

.brand--public .brand__text strong {
  color: white;
}

.brand--public .brand__text small {
  color: rgb(255 255 255 / 64%);
}

.brand--public .brand__maker {
  border-color: rgb(255 255 255 / 34%);
  color: rgb(255 255 255 / 72%);
}

.brand--public .brand__maker-logo {
  filter: invert(1);
}

.primary-nav {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 0.28rem;
  align-items: center;
  justify-content: center;
}

.primary-nav__link,
.nav-group > summary {
  position: relative;
  display: flex;
  min-height: 42px;
  gap: 0.42rem;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.78rem;
  border-radius: 999px;
  color: #394c53;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav__link:hover,
.nav-group > summary:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.primary-nav__link[aria-current="page"],
.nav-group--active > summary,
.nav-group[open] > summary {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-group {
  position: relative;
  flex: 0 0 auto;
}

.nav-group > summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.nav-group__chevron {
  width: 0.42rem;
  height: 0.42rem;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: translateY(-0.1rem) rotate(45deg);
  transition: transform 150ms ease;
}

.nav-group[open] .nav-group__chevron {
  transform: translateY(0.12rem) rotate(225deg);
}

.nav-group__menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.65rem);
  left: 50%;
  display: grid;
  width: max-content;
  min-width: 13.5rem;
  gap: 0.18rem;
  padding: 0.42rem;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.nav-group__menu::before {
  position: absolute;
  top: -0.36rem;
  left: 50%;
  width: 0.7rem;
  height: 0.7rem;
  transform: translateX(-50%) rotate(45deg);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
  content: "";
}

.nav-group__menu a {
  position: relative;
  min-height: 42px;
  padding: 0.66rem 0.78rem;
  border-radius: 7px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
}

.nav-group__menu a:hover {
  background: var(--surface-muted);
  color: var(--brand);
}

.nav-group__menu a[aria-current="page"] {
  padding-left: 1.05rem;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.nav-group__menu a[aria-current="page"]::before {
  position: absolute;
  top: 0.75rem;
  bottom: 0.75rem;
  left: 0.5rem;
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
}

.user-menu {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-self: end;
}

.language-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.28rem;
  align-items: center;
  padding: 0.26rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.language-switcher a {
  min-width: 1.65rem;
  padding: 0.14rem 0.2rem;
  border-radius: 999px;
  color: var(--ink-muted);
  text-align: center;
  text-decoration: none;
}

.language-switcher a:hover {
  color: var(--brand);
}

.language-switcher a[aria-current="true"] {
  background: var(--brand);
  color: white;
}

.public-language-switcher {
  position: fixed;
  z-index: 80;
  top: 1rem;
  right: 1rem;
}

.public-language-switcher .language-switcher {
  border-color: rgb(255 255 255 / 28%);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow-sm);
}

.user-menu__identity {
  display: flex;
  gap: 0.55rem;
  align-items: center;
}

.user-menu__identity--link {
  color: inherit;
  text-decoration: none;
}

.user-menu__identity--link:hover strong,
.user-menu__identity--link:focus-visible strong {
  color: var(--brand);
}

.user-menu__identity > span:last-child {
  display: grid;
  max-width: 150px;
  line-height: 1.15;
}

.user-menu__identity strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu__identity small {
  margin-top: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.user-menu__avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.page-shell {
  width: min(calc(100% - 2.5rem), var(--content));
  min-height: calc(100vh - 142px);
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.public-shell {
  min-height: 100vh;
}

.app-footer {
  width: min(calc(100% - 2.5rem), var(--content));
  margin: 0 auto;
  padding: 0 0 2rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.app-footer p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-bottom: 0;
}

.app-footer__maker {
  display: inline-flex;
  gap: 0.22rem;
  align-items: center;
  padding-left: 0.3rem;
  border-left: 1px solid var(--line-strong);
  font-size: 0.66rem;
}

.app-footer__maker img {
  display: block;
  width: 2.45rem;
  height: 1rem;
  object-fit: contain;
}

.app-footer p {
  margin: 0;
}

.page-heading {
  max-width: 790px;
  margin-bottom: 2.25rem;
}

.page-heading p:last-child,
.property-hero > div > p:last-child {
  margin-bottom: 0;
  color: var(--ink-muted);
  font-size: 1.04rem;
}

.page-heading--split {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-end;
  max-width: none;
}

.page-heading--split > div:first-child {
  max-width: 790px;
}

.eyebrow {
  margin-bottom: 0.48rem;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 2.65rem;
  justify-content: center;
  align-items: center;
  padding: 0.66rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  appearance: none;
  font-weight: 650;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  box-shadow: 0 5px 14px rgb(9 86 109 / 18%);
}

.button--primary:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
  color: white;
}

.button--secondary {
  border-color: rgb(15 114 143 / 34%);
  background: var(--surface);
  color: var(--brand);
}

.button--secondary:hover,
.button--quiet:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
  box-shadow: none;
}

.button--small {
  min-height: 2.1rem;
  padding: 0.44rem 0.65rem;
  font-size: 0.77rem;
}

.button--wide {
  width: 100%;
}

.text-link,
.table-primary-link {
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover,
.table-primary-link:hover {
  text-decoration: underline;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel--padded,
.panel--form {
  padding: clamp(1.3rem, 3vw, 2.2rem);
}

.panel--form {
  max-width: 790px;
}

.panel__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.panel__header h2,
.panel__header p {
  margin-bottom: 0;
}

.panel__header--subtle {
  min-height: 58px;
  background: #f8fbfb;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.panel__header--subtle h2 {
  color: var(--ink);
}

.account-password-panel {
  max-width: 790px;
}

.account-password-panel__body {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem;
}

.account-identity {
  margin: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  position: relative;
  display: grid;
  min-height: 166px;
  align-content: space-between;
  padding: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  position: absolute;
  content: "";
  top: -2rem;
  right: -2rem;
  width: 7rem;
  height: 7rem;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: 0.55;
}

.stat-card--attention::after {
  background: var(--warning-soft);
}

.stat-card__label {
  position: relative;
  z-index: 1;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-card__value {
  position: relative;
  z-index: 1;
  margin: 0.2rem 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1;
}

.stat-card a,
.stat-card__meta {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.stat-card a {
  width: fit-content;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.content-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.content-grid--dashboard {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
}

.content-grid--detail {
  grid-template-columns: minmax(0, 1fr) 350px;
}

.content-grid--detail-view {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.content-grid--documents {
  grid-template-columns: minmax(320px, 0.62fr) minmax(0, 1.38fr);
}

.benchmark-body,
.integrity-body {
  padding: 1.4rem 1.5rem 1.6rem;
}

.benchmark-body > p,
.integrity-body > p {
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 0;
}

.benchmark-grid > div {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.benchmark-grid dt {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.benchmark-grid dd {
  margin: 0.25rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
}

.integrity-body .status-pill {
  margin-bottom: 1rem;
}

.dashboard-first-step {
  margin-top: 1.25rem;
}

.entity-list,
.timeline,
.audit-list,
.tag-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entity-list li + li {
  border-top: 1px solid var(--line);
}

.entity-list a {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--ink);
  text-decoration: none;
}

.entity-list a:hover {
  background: #fafbf9;
}

.entity-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.entity-list__body {
  display: grid;
  min-width: 0;
  flex: 1;
}

.entity-list__body small,
.entity-list__meta {
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.timeline {
  padding: 1.25rem 1.5rem 1.5rem;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0.7rem;
  padding-bottom: 1.15rem;
}

.timeline li:not(:last-child)::after {
  position: absolute;
  content: "";
  top: 13px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.timeline__dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 0.28rem;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.timeline strong,
.timeline p,
.timeline small {
  display: block;
}

.timeline p {
  margin: 0.12rem 0;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.timeline small {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.empty-state {
  display: grid;
  min-height: 330px;
  justify-items: center;
  align-content: center;
  padding: 2.4rem;
  text-align: center;
}

.empty-state--compact {
  min-height: 225px;
  padding: 1.5rem;
}

.empty-state__mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-serif);
}

.empty-state p {
  max-width: 510px;
  margin-bottom: 1.2rem;
  color: var(--ink-muted);
}

.breadcrumbs {
  margin-bottom: 1.25rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.45rem;
  color: var(--line-strong);
}

.breadcrumbs a {
  color: var(--ink-muted);
}

.form-stack {
  display: grid;
  gap: 1.25rem;
}

.form-stack--compact {
  gap: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

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

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

.field--span-2 {
  grid-column: span 2;
}

.field {
  display: grid;
  gap: 0.38rem;
  align-content: start;
}

.field label {
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 750;
}

.field small,
.optional {
  color: var(--ink-muted);
  font-size: 0.73rem;
  font-weight: 450;
}

.optional {
  margin-left: 0.25rem;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.67rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: white;
  color: var(--ink);
}

.field input[type="file"] {
  padding: 0.5rem;
  background: var(--surface-muted);
}

.field input[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.46rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
  color: var(--brand);
  font-weight: 700;
}

.field textarea {
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #94a099;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(21 60 54 / 13%);
}

.form-actions {
  justify-content: flex-end;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 0.86rem;
}

.notice p,
.notice ul {
  margin: 0;
}

.notice ul {
  padding-left: 1.2rem;
}

.notice__icon {
  flex: 0 0 auto;
  width: 0.72rem;
  height: 0.72rem;
  margin-top: 0.3rem;
  border-radius: 50%;
  background: currentColor;
}

.notice--success {
  border-color: #bdd8c8;
  background: var(--success-soft);
  color: var(--success);
}

.notice--error {
  border-color: #e4bdb8;
  background: var(--danger-soft);
  color: var(--danger);
}

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

.flash-stack {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(390px, 0.9fr);
  min-height: 100vh;
  background: var(--brand);
}

.auth-intro {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 6vw, 5rem);
  color: white;
  background:
    linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px),
    linear-gradient(150deg, rgb(255 255 255 / 6%), transparent 52%),
    var(--brand);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.auth-intro h1 {
  max-width: 760px;
  color: white;
  font-size: clamp(2.8rem, 5vw, 5.3rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.auth-intro > div > p:last-child {
  max-width: 650px;
  color: rgb(255 255 255 / 72%);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
}

.auth-intro .eyebrow {
  color: rgb(255 255 255 / 78%);
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgb(255 255 255 / 72%);
  font-size: 0.8rem;
}

.trust-list li::before {
  content: "✓";
  margin-right: 0.42rem;
  color: white;
  font-weight: 800;
}

.auth-card {
  align-self: center;
  width: min(calc(100% - 3rem), 480px);
  margin: 2rem auto;
  padding: clamp(1.7rem, 5vw, 3.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-md);
}

.auth-card__heading {
  margin-bottom: 1.6rem;
}

.auth-card__heading h2 {
  margin-bottom: 0.3rem;
  font-family: var(--font-serif);
  font-size: 2.05rem;
  font-weight: 400;
}

.auth-card__heading p:last-child,
.auth-card__help {
  color: var(--ink-muted);
}

.auth-card__help {
  margin: 1.25rem 0 0;
  font-size: 0.72rem;
  text-align: center;
}

.setup-shell {
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  background: linear-gradient(90deg, var(--brand) 0, var(--brand) 42%, var(--paper) 42%, var(--paper) 100%);
}

.setup-header {
  display: flex;
  max-width: var(--content);
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 3.5rem;
}

.setup-header .status-pill {
  background: rgb(255 255 255 / 88%);
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(430px, 1.25fr);
  gap: clamp(2rem, 8vw, 7rem);
  align-items: start;
  max-width: 1050px;
  margin: 0 auto;
}

.setup-copy {
  padding-top: 2rem;
  padding-right: 1rem;
  color: white;
}

.setup-copy h1 {
  color: white;
}

.setup-copy > p:last-of-type {
  color: rgb(255 255 255 / 72%);
}

.setup-copy .eyebrow {
  color: rgb(255 255 255 / 78%);
}

.callout {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 7%);
}

.callout p {
  margin: 0.35rem 0 0;
  color: rgb(255 255 255 / 68%);
  font-size: 0.82rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fbfb;
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #f8fbfb;
}

.table-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.table-action {
  text-align: right;
}

.table--compact th,
.table--compact td {
  padding: 0.75rem 0.9rem;
}

.property-hero {
  display: flex;
  gap: 2rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 0 0.15rem;
}

.property-hero__aside {
  display: grid;
  gap: 0.75rem;
  justify-items: end;
}

.hero-facts {
  display: flex;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 92%);
}

.hero-facts div {
  min-width: 105px;
  padding: 0.8rem 1rem;
}

.hero-facts div + div {
  border-left: 1px solid var(--line);
}

.hero-facts dt {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 0.15rem 0 0;
  color: var(--brand-deep);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 550;
}

.section-stack {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: #f8fbfb;
}

.building-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
}

.building-section__header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.building-section__header > div {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.building-section__header h3,
.building-section__header p {
  margin-bottom: 0;
}

.building-section__header p {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.section-code {
  display: grid;
  flex: 0 0 auto;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.4rem;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: white;
  font-size: 0.73rem;
  font-weight: 850;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.status-pill--neutral {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

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

.inline-empty,
.unassigned-block {
  margin: 0;
  padding: 1rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.unassigned-block {
  border-top: 1px solid var(--line);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-list li {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.72rem;
}

.detail-sidebar {
  display: grid;
  gap: 1rem;
}

.disclosure summary {
  padding: 1rem 1.15rem;
  color: var(--ink);
  font-weight: 800;
  list-style-position: inside;
}

.disclosure[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.disclosure__body {
  padding: 1rem 1.15rem 1.2rem;
}

.disclosure__body > p {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.evidence-note {
  background: var(--brand-deep);
  color: white;
}

.evidence-note h2,
.evidence-note .text-link {
  color: white;
}

.evidence-note p:not(.eyebrow) {
  color: rgb(255 255 255 / 72%);
  font-size: 0.83rem;
}

.evidence-note .eyebrow {
  color: rgb(255 255 255 / 72%);
}

.edit-mode-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgb(15 114 143 / 24%);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}

.edit-mode-banner__mark {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--brand);
  font-size: 1.05rem;
  box-shadow: var(--shadow-sm);
}

.edit-mode-banner h2,
.edit-mode-banner p,
.edit-mode-banner .eyebrow {
  margin-bottom: 0;
}

.edit-mode-banner h2 {
  font-size: 1.15rem;
}

.edit-mode-banner div > p:last-child {
  margin-top: 0.22rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.structure-read-note {
  max-width: 330px;
  padding: 0.42rem 0.62rem;
  white-space: normal;
  text-align: right;
}

.units-table tbody tr.is-editing {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand);
}

.unit-editor {
  scroll-margin-top: 110px;
  border-top: 4px solid var(--brand);
}

.unit-editor > p:not(.eyebrow) {
  color: var(--ink-muted);
  font-size: 0.83rem;
}

.locked-fields {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.locked-fields > p {
  margin-bottom: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.locked-fields dl {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}

.locked-fields dl > div {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.locked-fields dt {
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.locked-fields dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 650;
  text-align: right;
}

.upload-panel {
  position: sticky;
  top: 98px;
}

.upload-panel > p:not(.eyebrow) {
  margin-bottom: 1.5rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.document-list {
  display: grid;
}

.document-row {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.15rem 1.4rem;
}

.document-row + .document-row {
  border-top: 1px solid var(--line);
}

.document-row__type {
  display: grid;
  width: 3.2rem;
  height: 3.7rem;
  place-items: end center;
  padding-bottom: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px 12px 5px 5px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.document-row__body h3,
.document-row__body > p {
  margin-bottom: 0;
}

.document-row__body h3 {
  overflow-wrap: anywhere;
}

.document-row__body > p {
  margin-top: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.7rem 0 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.document-meta div {
  display: flex;
  gap: 0.28rem;
}

.document-meta dt {
  font-weight: 750;
}

.document-meta dd {
  margin: 0;
}

.document-hash code {
  display: block;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-row__actions {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.filter-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
}

.filter-form {
  display: grid;
  grid-template-columns: 1fr 1fr 0.75fr 0.75fr auto;
  gap: 0.8rem;
  align-items: end;
}

.filter-form__actions {
  display: flex;
  gap: 0.35rem;
}

.audit-list {
  padding: 1rem 1.5rem;
}

.audit-event {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
}

.audit-event__rail {
  position: relative;
}

.audit-event:not(:last-child) .audit-event__rail::after {
  position: absolute;
  content: "";
  top: 14px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  background: var(--line);
}

.audit-event__dot {
  position: relative;
  z-index: 1;
  display: block;
  width: 11px;
  height: 11px;
  margin-top: 0.42rem;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.audit-event__content {
  padding: 0 0 1.5rem 0.3rem;
}

.audit-event__content > header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.audit-event__content h3,
.audit-event__content header p {
  margin-bottom: 0;
}

.audit-event__content header p,
.audit-event__content time {
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.audit-event__content time {
  white-space: nowrap;
}

.audit-event__summary {
  margin: 0.6rem 0;
  color: var(--ink-muted);
  font-size: 0.83rem;
}

.change-list {
  display: grid;
  gap: 0.35rem;
  margin: 0.7rem 0;
  padding: 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 0.75rem;
}

.change-list > div {
  display: grid;
  grid-template-columns: minmax(90px, 0.35fr) 1fr;
  gap: 0.7rem;
}

.change-list dt {
  color: var(--ink-muted);
  font-weight: 750;
}

.change-list dd {
  display: flex;
  gap: 0.55rem;
  margin: 0;
  flex-wrap: wrap;
}

.change-list del {
  color: var(--danger);
}

.change-list ins {
  color: var(--success);
  text-decoration: none;
}

.audit-event__content > footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.audit-hash code {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.pagination > *:last-child {
  justify-self: end;
}

.error-page {
  display: grid;
  min-height: calc(100vh - 250px);
  align-content: center;
  justify-items: start;
  max-width: 680px;
  padding: 3rem 0;
}

.error-page h1 {
  max-width: 650px;
}

.error-page > p:not(.eyebrow, .error-code, .request-id) {
  max-width: 580px;
  color: var(--ink-muted);
}

.error-code {
  margin-bottom: -1rem;
  color: var(--brand-soft);
  font-family: var(--font-serif);
  font-size: clamp(6rem, 18vw, 13rem);
  line-height: 0.8;
}

.request-id {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

@media (max-width: 1080px) {
  .app-header__inner {
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
  }

  .app-header .brand__text small,
  .app-header .brand__maker,
  .user-menu__identity > span:last-child {
    display: none;
  }

  .content-grid--detail,
  .content-grid--documents {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .filter-form {
    grid-template-columns: repeat(4, 1fr);
  }

  .filter-form__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .app-header {
    position: static;
  }

  .app-header__inner {
    grid-template-columns: auto 1fr;
    gap: 0.7rem;
    padding: 0.7rem 0;
  }

  .primary-nav {
    grid-column: 1 / -1;
    order: 3;
    display: grid;
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
    border-top: 1px solid var(--line);
    padding: 0.55rem 0 0.65rem;
  }

  .primary-nav__link,
  .nav-group > summary {
    width: 100%;
    min-width: 0;
    padding-right: 0.42rem;
    padding-left: 0.42rem;
    text-align: center;
  }

  .nav-group {
    position: static;
    min-width: 0;
  }

  .nav-group__menu {
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    width: auto;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    transform: none;
  }

  .nav-group__menu::before {
    display: none;
  }

  .user-menu {
    grid-column: 2;
    grid-row: 1;
  }

  .content-grid--dashboard,
  .content-grid--detail,
  .content-grid--documents,
  .setup-grid {
    grid-template-columns: 1fr;
  }

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

  .upload-panel {
    position: static;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-intro {
    min-height: 390px;
  }

  .auth-intro h1 {
    font-size: clamp(2.4rem, 8vw, 4rem);
  }

  .auth-card {
    margin: 2rem auto;
  }

  .setup-shell {
    background: linear-gradient(var(--brand) 0, var(--brand) 330px, var(--paper) 330px, var(--paper) 100%);
  }

  .setup-grid {
    gap: 1.5rem;
  }

  .setup-copy {
    padding: 0;
  }

  .setup-header {
    margin-bottom: 2rem;
  }

  .property-hero {
    display: grid;
  }

  .property-hero__aside {
    justify-items: start;
  }

  .structure-read-note {
    max-width: 100%;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .app-header__inner,
  .page-shell,
  .app-footer {
    width: min(calc(100% - 1.25rem), var(--content));
  }

  .page-shell {
    padding-top: 2rem;
  }

  .user-menu__identity {
    display: none;
  }

  .primary-nav {
    gap: 0.2rem;
    overflow: visible;
  }

  .primary-nav__link,
  .nav-group > summary {
    min-width: 0;
    min-height: 44px;
    padding: 0.55rem 0.22rem;
    font-size: clamp(0.64rem, 2.85vw, 0.75rem);
    white-space: nowrap;
  }

  .nav-group > summary {
    gap: 0.28rem;
  }

  .nav-group__menu {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  }

  .nav-group__menu a {
    min-height: 44px;
    white-space: normal;
  }

  .page-heading--split {
    display: grid;
    align-items: start;
  }

  .page-actions,
  .page-actions .button,
  .form-actions,
  .form-actions .button {
    width: 100%;
  }

  .stat-grid,
  .form-grid--2,
  .form-grid--3,
  .filter-form {
    grid-template-columns: 1fr;
  }

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

  .field--span-2,
  .filter-form__actions {
    grid-column: auto;
  }

  .stat-card {
    min-height: 135px;
  }

  .panel__header,
  .building-section__header {
    align-items: flex-start;
  }

  .panel__header:has(.structure-read-note) {
    display: grid;
  }

  .structure-read-note {
    width: 100%;
  }

  .entity-list__meta {
    display: none;
  }

  .hero-facts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .property-hero__aside {
    width: 100%;
    justify-items: stretch;
  }

  .property-hero__aside > .button {
    width: 100%;
  }

  .edit-mode-banner {
    grid-template-columns: 1fr;
  }

  .edit-mode-banner__mark {
    display: none;
  }

  .hero-facts div + div {
    border-left: 0;
  }

  .hero-facts div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .hero-facts div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .document-row {
    grid-template-columns: 2.8rem minmax(0, 1fr);
    padding: 1rem;
  }

  .document-row__type {
    width: 2.8rem;
    height: 3.25rem;
  }

  .document-row__actions {
    grid-column: 2;
    grid-row: 2;
    grid-auto-flow: column;
    justify-content: start;
    justify-items: start;
  }

  .audit-event__content > header {
    display: grid;
    gap: 0.3rem;
  }

  .change-list > div {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .auth-intro {
    min-height: 330px;
    padding: 1.5rem;
  }

  .auth-intro h1 {
    font-size: 2.5rem;
  }

  .trust-list {
    display: none;
  }

  .auth-card {
    width: min(calc(100% - 1.25rem), 480px);
  }

  .setup-shell {
    padding: 1rem 0.7rem 2rem;
  }

  .setup-header .brand__text {
    display: grid;
  }

  .table-wrap table {
    min-width: 610px;
  }

  .table-wrap .units-table {
    min-width: 760px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  .app-header,
  .app-footer,
  .page-actions,
  .filter-panel,
  .detail-sidebar,
  .button {
    display: none !important;
  }

  body,
  .page-shell {
    width: 100%;
    background: white;
  }

  .page-shell {
    padding: 0;
  }

  .panel {
    break-inside: avoid;
    box-shadow: none;
  }
}

/* Complete annual settlement workflow */

.annual-settlement-hero {
  align-items: end;
}

.annual-settlement-hero__actions {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.annual-settlement-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.annual-settlement-progress__step {
  display: grid;
  min-width: 0;
  grid-template-columns: 1.8rem minmax(0, 1fr);
  gap: 0.05rem 0.55rem;
  padding: 0.8rem;
  color: var(--ink);
  text-decoration: none;
}

.annual-settlement-progress__step + .annual-settlement-progress__step {
  border-left: 1px solid var(--line);
}

.annual-settlement-progress__step > span {
  display: grid;
  width: 1.7rem;
  height: 1.7rem;
  grid-row: span 2;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.annual-settlement-progress__step strong {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-settlement-progress__step small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-settlement-progress__step--complete > span {
  background: var(--success-soft);
  color: var(--success);
}

.annual-settlement-progress__step--blocked > span {
  background: var(--danger-soft);
  color: var(--danger);
}

.annual-settlement-progress__step:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.annual-settlement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 0.29fr);
  gap: 1rem;
  align-items: start;
}

.annual-reference-candidate {
  margin-bottom: 1.5rem;
}

.annual-reference-candidate__header {
  align-items: flex-start;
}

.annual-reference-candidate__header > div {
  max-width: 72rem;
}

.annual-reference-candidate__metrics {
  margin: 1rem 0 1.25rem;
}

.annual-reference-candidate table caption {
  padding: 0 0 0.75rem;
  color: var(--ink-muted);
  text-align: left;
}

.annual-reference-candidate__meta {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.annual-reference-candidate__meta div,
.annual-reference-candidate__meta code {
  min-width: 0;
}

.annual-reference-candidate__meta code {
  display: block;
  overflow-wrap: anywhere;
}

.annual-settlement-main {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

.annual-settlement-step {
  min-width: 0;
  scroll-margin-top: 96px;
}

.annual-settlement-step .panel__header > div {
  min-width: 0;
  max-width: 72ch;
}

.annual-settlement-step .panel__header p:last-child {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
}

.annual-settlement-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.annual-settlement-setting {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.annual-settlement-setting > p,
.annual-settlement-reference-heading > p {
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.annual-settlement-definition {
  margin: 0 0 0.8rem;
}

.annual-settlement-definition > div {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
}

.annual-settlement-definition dt {
  color: var(--ink-muted);
}

.annual-settlement-definition dd {
  margin: 0;
  font-weight: 650;
  text-align: right;
}

.annual-settlement-chip-list {
  display: flex;
  margin: 0 0 0.8rem;
  padding: 0;
  gap: 0.4rem;
  flex-wrap: wrap;
  list-style: none;
}

.annual-settlement-chip-list li {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.7rem;
}

.annual-settlement-chip-list li span {
  margin-right: 0.35rem;
  color: var(--brand);
  font-weight: 750;
}

.annual-settlement-metrics {
  margin-top: 0;
}

.annual-settlement-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.annual-settlement-table th,
.annual-settlement-table td {
  padding: 0.72rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.annual-settlement-table thead th {
  background: var(--brand-deep);
  color: white;
  font-size: 0.66rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.annual-settlement-table tbody tr:nth-child(even) {
  background: var(--surface-muted);
}

.annual-settlement-table th small,
.annual-settlement-table td small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 450;
}

.annual-settlement-table .number-cell {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.annual-settlement-issues {
  display: grid;
  margin: 0.8rem 0 0;
  padding: 0;
  gap: 0.4rem;
  list-style: none;
}

.annual-settlement-issues li {
  display: grid;
  grid-template-columns: minmax(120px, 0.25fr) minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
  font-size: 0.75rem;
}

.annual-settlement-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.annual-settlement-form .field--wide {
  grid-column: 1 / -1;
}

.annual-settlement-form > .button {
  width: fit-content;
}

.annual-settlement-advance-list {
  display: grid;
  gap: 0.55rem;
}

.annual-settlement-advance {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(120px, 0.35fr) minmax(120px, 0.35fr) auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.annual-settlement-advance__identity {
  align-self: center;
}

.annual-settlement-advance__identity strong,
.annual-settlement-advance__identity small {
  display: block;
}

.annual-settlement-advance__identity small {
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.annual-settlement-control-list {
  display: grid;
  gap: 0.65rem;
}

.annual-settlement-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.4fr);
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--surface);
}

.annual-settlement-control--blocking {
  border-left-color: var(--danger);
}

.annual-settlement-control--warning {
  border-left-color: var(--warning);
}

.annual-settlement-control--resolved {
  border-left-color: var(--success);
  opacity: 0.76;
}

.annual-settlement-control h3 {
  margin: 0.4rem 0 0.25rem;
}

.annual-settlement-control p,
.annual-settlement-control small {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.annual-settlement-control form {
  align-self: center;
}

.annual-settlement-control form textarea {
  width: 100%;
}

.annual-settlement-control form .button {
  margin-top: 0.4rem;
}

.annual-settlement-reference-heading {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.annual-settlement-calculate {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.annual-settlement-calculate small {
  color: var(--ink-muted);
}

.annual-settlement-version-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.annual-settlement-version-meta code {
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.annual-settlement-sidebar {
  display: grid;
  position: sticky;
  top: 88px;
  gap: 1rem;
}

.annual-settlement-sidebar__panel {
  padding: 1rem;
}

.annual-settlement-sidebar__panel h2 {
  font-size: 1.08rem;
}

.annual-settlement-sidebar__panel p,
.annual-settlement-sidebar__panel li {
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.annual-settlement-sidebar__panel ul,
.annual-settlement-sidebar__panel ol {
  margin: 0;
  padding-left: 1.15rem;
}

.annual-settlement-sidebar__panel li + li {
  margin-top: 0.45rem;
}

.status-pill--blocking {
  border-color: rgb(154 51 41 / 25%);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill--confirmed {
  border-color: rgb(39 103 70 / 25%);
  background: var(--success-soft);
  color: var(--success);
}

.status-pill--muted {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.rule-weight-fieldset > p {
  margin: 0 0 0.65rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.rule-weight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.rule-weight-grid > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 0.5fr);
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.rule-weight-grid > label > span {
  font-size: 0.75rem;
  font-weight: 650;
}

.rule-weight-grid small {
  display: block;
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 450;
}

.tenant-allocation-fieldset .field {
  margin-top: 0.55rem;
}

@media (max-width: 1060px) {
  .annual-settlement-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .annual-settlement-progress__step:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .annual-settlement-progress__step:nth-child(5),
  .annual-settlement-progress__step:nth-child(6) {
    border-top: 1px solid var(--line);
  }

  .annual-settlement-layout {
    grid-template-columns: 1fr;
  }

  .annual-settlement-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .annual-settlement-hero__actions,
  .annual-settlement-calculate,
  .annual-settlement-version-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .annual-settlement-hero__actions .button,
  .annual-settlement-calculate .button {
    width: 100%;
  }

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

  .annual-settlement-progress__step:nth-child(odd) {
    border-left: 0;
  }

  .annual-settlement-progress__step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .annual-settlement-progress__step:nth-child(4) {
    border-left: 1px solid var(--line);
  }

  .annual-settlement-two-column,
  .annual-settlement-form,
  .annual-settlement-sidebar {
    grid-template-columns: 1fr;
  }

  .annual-settlement-form .field--wide {
    grid-column: auto;
  }

  .annual-settlement-advance,
  .annual-settlement-control {
    grid-template-columns: 1fr;
  }

  .rule-weight-grid {
    grid-template-columns: 1fr;
  }

  .annual-settlement-advance .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .annual-settlement-progress {
    grid-template-columns: 1fr;
  }

  .annual-settlement-progress__step + .annual-settlement-progress__step,
  .annual-settlement-progress__step:nth-child(4) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .annual-settlement-issues li {
    grid-template-columns: 1fr;
  }
}

/* Tenant directory, contacts and leases ---------------------------------- */

.tenant-directory-heading {
  margin-bottom: 1.25rem;
}

.tenant-filter-panel {
  margin-bottom: 1.25rem;
  padding: 1rem;
}

.tenant-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, 0.75fr)) auto;
  gap: 0.8rem;
  align-items: end;
}

.tenant-filter-form__actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  padding-bottom: 0.05rem;
}

.tenant-directory .panel__header > div,
.tenant-profile-panel .panel__header > div,
.tenant-current-panel .panel__header > div,
.tenant-contacts-panel .panel__header > div,
.tenant-addresses-panel .panel__header > div,
.tenant-authorizations-panel .panel__header > div,
.tenant-leases-panel .panel__header > div,
.unit-tenancy-panel .panel__header > div {
  min-width: 0;
}

.tenant-directory .panel__header .eyebrow,
.tenant-profile-panel .panel__header .eyebrow,
.tenant-current-panel .panel__header .eyebrow,
.tenant-contacts-panel .panel__header .eyebrow,
.tenant-addresses-panel .panel__header .eyebrow,
.tenant-authorizations-panel .panel__header .eyebrow,
.tenant-leases-panel .panel__header .eyebrow,
.unit-tenancy-panel .panel__header .eyebrow {
  margin-bottom: 0.2rem;
}

.tenant-directory .panel__header p:last-child,
.tenant-profile-panel .panel__header p:last-child,
.tenant-current-panel .panel__header p:last-child,
.tenant-contacts-panel .panel__header p:last-child,
.tenant-addresses-panel .panel__header p:last-child,
.tenant-authorizations-panel .panel__header p:last-child,
.tenant-leases-panel .panel__header p:last-child,
.unit-tenancy-panel .panel__header p:last-child {
  max-width: 720px;
  margin: 0.28rem 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.tenant-table {
  min-width: 1160px;
}

.tenant-table th,
.tenant-table td {
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  vertical-align: middle;
}

.tenant-table tbody th {
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}

.tenant-row--inactive {
  background: #fafbfb;
  color: var(--ink-muted);
}

.tenant-identity {
  display: flex;
  min-width: 180px;
  gap: 0.7rem;
  align-items: center;
}

.tenant-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.tenant-avatar,
.tenant-hero__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.tenant-avatar {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.78rem;
}

.tenant-row--inactive .tenant-avatar {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.tenant-assignment,
.tenant-preferences {
  display: grid;
  min-width: 145px;
  gap: 0.15rem;
  font-size: 0.72rem;
}

.tenant-assignment-list {
  display: grid;
  min-width: 165px;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  font-size: 0.72rem;
  list-style: none;
}

.tenant-assignment-list li {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.tenant-assignment-list li + li {
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

.tenant-assignment-list strong {
  color: var(--brand-deep);
}

.tenant-assignment-list small {
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.tenant-assignment strong {
  color: var(--brand-deep);
}

.tenant-assignment small,
.tenant-preferences small {
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.tenant-preferences {
  justify-items: start;
}

.tenant-preferences > strong,
.language-pill,
.tenant-type-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 1.55rem;
  align-items: center;
  padding: 0.25rem 0.48rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--brand-deep);
  font-size: 0.65rem;
  font-weight: 800;
}

.tenant-contact-list {
  display: grid;
  min-width: 180px;
  gap: 0.22rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tenant-contact-list a {
  display: grid;
  min-width: 0;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.35rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.7rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-contact-list a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.tenant-contact-list a span {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.authorization-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 1.65rem;
  align-items: center;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 800;
}

.authorization-pill--granted {
  background: var(--success-soft);
  color: var(--success);
}

.authorization-pill--revoked,
.authorization-pill--objected {
  background: var(--danger-soft);
  color: var(--danger);
}

.authorization-summary-pill--granted {
  background: var(--success-soft);
  color: var(--success);
}

.authorization-summary-pill--blocked {
  background: var(--danger-soft);
  color: var(--danger);
}

.authorization-summary-pill--partial,
.authorization-summary-pill--mixed {
  background: var(--warning-soft);
  color: var(--warning);
}

.authorization-summary-pill--unknown {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.lease-temporal-pill--current {
  background: var(--success-soft);
  color: var(--success);
}

.lease-temporal-pill--scheduled {
  background: var(--info-soft);
  color: var(--info);
}

.lease-temporal-pill--ending_scheduled {
  background: var(--warning-soft);
  color: var(--warning);
}

.lease-temporal-pill--cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.lease-temporal-pill--draft,
.lease-temporal-pill--ended {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.tenant-form-panel {
  max-width: 980px;
}

.tenant-form-panel__body,
.tenant-panel__body,
.unit-tenancy-panel__body {
  padding: 1.4rem 1.5rem 1.6rem;
}

.tenant-form-errors {
  margin-bottom: 1rem;
}

.tenant-inline-form-error {
  margin-bottom: 0.75rem;
}

.tenant-inline-form-error p,
.field-group-help {
  margin: 0.2rem 0 0;
}

.field-group-help {
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--info);
  font-size: 0.74rem;
}

.tenant-form-section {
  display: grid;
  gap: 1rem;
  padding: 0.15rem 0 1.35rem;
  border-bottom: 1px solid var(--line);
}

.tenant-form-section--last {
  border-bottom: 0;
}

.tenant-form-section > header h2,
.tenant-form-section > header p {
  margin-bottom: 0;
}

.tenant-form-section > header > p:last-child {
  max-width: 680px;
  margin-top: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.tenant-preference-note,
.tenant-next-step-note,
.tenant-append-only-note,
.tenant-contract-note {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--info);
}

.tenant-preference-note > span,
.tenant-next-step-note > span,
.tenant-append-only-note > span,
.tenant-contract-note > span {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 0.68rem;
  font-weight: 850;
}

.tenant-preference-note p,
.tenant-next-step-note p,
.tenant-append-only-note p,
.tenant-contract-note p {
  margin: 0;
  font-size: 0.74rem;
}

.tenant-active-control {
  margin-top: 0.15rem;
}

.tenant-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(480px, 1.2fr);
  gap: clamp(1.3rem, 4vw, 3.2rem);
  align-items: center;
  margin-bottom: 1.25rem;
  padding: clamp(1.35rem, 3vw, 2.1rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 98% 5%, rgb(15 114 143 / 12%), transparent 32%),
    linear-gradient(135deg, var(--surface), #f8fbfb);
  box-shadow: var(--shadow-sm);
}

.tenant-hero__identity {
  display: flex;
  min-width: 0;
  gap: 1rem;
  align-items: center;
}

.tenant-hero__avatar {
  width: clamp(3.9rem, 7vw, 5.3rem);
  height: clamp(3.9rem, 7vw, 5.3rem);
  font-size: clamp(1.2rem, 3vw, 1.75rem);
}

.tenant-hero h1 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  overflow-wrap: anywhere;
}

.tenant-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tenant-hero__contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.tenant-contact-action {
  display: grid;
  min-width: 0;
  grid-template-columns: 2rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 0.55rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 84%);
  color: var(--ink);
  text-decoration: none;
}

.tenant-contact-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.tenant-contact-action > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.tenant-contact-action small,
.tenant-contact-action strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-contact-action small {
  color: var(--ink-muted);
  font-size: 0.61rem;
}

.tenant-contact-action strong {
  font-size: 0.7rem;
}

.tenant-hero__no-contact {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.tenant-assurance {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-soft), #f7fbfb);
}

.tenant-assurance__mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 850;
}

.tenant-assurance h2 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.tenant-assurance p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.tenant-overview-grid,
.tenant-contact-grid {
  display: grid;
  grid-template-columns: minmax(600px, 1.15fr) minmax(360px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

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

.tenant-readonly-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.tenant-readonly-details > div,
.tenant-current-card {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.tenant-readonly-details__wide {
  grid-column: 1 / -1;
}

.tenant-readonly-details dt,
.tenant-current-card dt {
  color: var(--ink-muted);
  font-size: 0.67rem;
  font-weight: 750;
}

.tenant-readonly-details dd,
.tenant-current-card dd {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  white-space: pre-line;
}

.tenant-current-card h3 {
  margin: 0.7rem 0 0.2rem;
  overflow-wrap: anywhere;
}

.tenant-current-list {
  display: grid;
  gap: 0.7rem;
}

.tenant-current-card > p {
  margin-bottom: 0.8rem;
  color: var(--ink-muted);
}

.tenant-current-card dl,
.tenant-lease-meta,
.tenant-authorization-meta,
.unit-tenancy-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 0.85rem;
}

.tenant-current-card dl > div,
.tenant-lease-meta > div,
.tenant-authorization-meta > div,
.unit-tenancy-facts > div {
  min-width: 0;
}

.tenant-record-list,
.tenant-lease-list,
.tenant-authorization-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tenant-record-list > li {
  display: flex;
  min-width: 0;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.tenant-record-list > li + li {
  border-top: 1px solid var(--line);
}

.tenant-record--inactive {
  color: var(--ink-muted);
  opacity: 0.76;
}

.tenant-record__main {
  display: flex;
  min-width: 0;
  gap: 0.7rem;
  align-items: flex-start;
}

.tenant-record__main > div {
  min-width: 0;
}

.tenant-record__icon {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.tenant-record__main h3,
.tenant-record__main p {
  margin-bottom: 0;
}

.tenant-record__main p {
  overflow-wrap: anywhere;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.tenant-record__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.4rem;
}

.tenant-record__tags > span:not(.status-pill) {
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.tenant-address-lines {
  white-space: normal;
}

.tenant-form-disclosure,
.tenant-close-disclosure,
.tenant-verify-disclosure,
.tenant-deactivate-disclosure,
.unit-tenancy-history {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfc;
}

.tenant-form-disclosure > summary,
.tenant-close-disclosure > summary,
.tenant-verify-disclosure > summary,
.tenant-deactivate-disclosure > summary,
.unit-tenancy-history > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.tenant-form-disclosure[open] > summary,
.tenant-close-disclosure[open] > summary,
.tenant-verify-disclosure[open] > summary,
.tenant-deactivate-disclosure[open] > summary,
.unit-tenancy-history[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--brand-soft);
}

.tenant-form-disclosure > form,
.tenant-close-disclosure > form,
.tenant-verify-disclosure > form,
.tenant-deactivate-disclosure > form {
  padding: 1rem;
}

.tenant-record__actions {
  display: grid;
  width: min(100%, 18rem);
  flex: 0 0 auto;
  gap: 0.45rem;
}

.tenant-verify-disclosure,
.tenant-record__actions .tenant-deactivate-disclosure {
  width: 100%;
  margin-top: 0;
}

.tenant-verify-disclosure > summary {
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  font-size: 0.7rem;
}

.tenant-verify-disclosure > form {
  padding: 0.75rem;
}

.tenant-deactivate-disclosure {
  width: min(100%, 18rem);
  flex: 0 0 auto;
  margin-top: 0;
}

.tenant-deactivate-disclosure > summary {
  min-height: 36px;
  padding: 0.45rem 0.65rem;
  color: var(--danger);
  font-size: 0.7rem;
}

.tenant-deactivate-disclosure > form {
  padding: 0.75rem;
}

.tenant-check-grid,
.tenant-co-tenant-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.tenant-address-grid {
  grid-template-columns: minmax(120px, 0.5fr) minmax(180px, 1fr) minmax(150px, 0.65fr);
}

.tenant-authorizations-panel,
.tenant-leases-panel {
  margin-bottom: 1.25rem;
}

.tenant-authorization-layout,
.tenant-lease-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  gap: 1.25rem;
  align-items: start;
}

.tenant-authorization-timeline > li {
  position: relative;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 0.85rem;
  padding-bottom: 1.4rem;
}

.tenant-subsection-heading {
  margin-bottom: 0.75rem;
}

.tenant-subsection-heading h3,
.tenant-subsection-heading p {
  margin-bottom: 0;
}

.tenant-subsection-heading p {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.tenant-effective-authorizations {
  margin-bottom: 1.35rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.tenant-effective-authorization-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tenant-effective-authorization-list li {
  display: flex;
  min-width: 0;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfc;
}

.tenant-effective-authorization-list li > div {
  display: grid;
  min-width: 0;
}

.tenant-effective-authorization-list strong,
.tenant-effective-authorization-list small {
  overflow-wrap: anywhere;
}

.tenant-effective-authorization-list small {
  color: var(--ink-muted);
  font-size: 0.67rem;
}

.tenant-effective-authorization-list .tenant-effective-authorization__warning {
  margin-top: 0.25rem;
  color: var(--danger);
  font-weight: 700;
}

.tenant-effective-authorization--unusable {
  border-color: rgb(154 51 41 / 28%) !important;
  background: var(--danger-soft) !important;
}

.tenant-authorization-timeline > li:not(:last-child)::before {
  position: absolute;
  top: 15px;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.tenant-authorization-dot {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 0.2rem;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--ink-muted);
  box-shadow: 0 0 0 1px var(--ink-muted);
}

.tenant-authorization-dot--granted {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.tenant-authorization-dot--revoked,
.tenant-authorization-dot--objected {
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.tenant-authorization-timeline article > header,
.tenant-lease-list article > header {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  justify-content: space-between;
}

.tenant-authorization-timeline h4,
.tenant-lease-list h3 {
  margin: 0.1rem 0 0;
}

.tenant-authorization-date,
.tenant-lease-list article > header p {
  margin: 0.25rem 0 0.55rem;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.tenant-authorization-meta {
  margin-top: 0.6rem;
  font-size: 0.7rem;
}

.tenant-authorization-meta dt,
.tenant-lease-meta dt {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.tenant-authorization-meta dd,
.tenant-lease-meta dd {
  margin: 0.12rem 0 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.tenant-append-only-note,
.tenant-contract-note {
  margin-bottom: 1rem;
}

.tenant-lease-list > li {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfc;
}

.tenant-lease-list > li + li {
  margin-top: 0.7rem;
}

.tenant-lease-meta {
  margin-top: 0.8rem;
}

.tenant-lease-meta__wide {
  grid-column: 1 / -1;
}

.tenant-co-tenant-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tenant-co-tenant-fieldset legend {
  padding: 0;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 750;
}

.tenant-co-tenant-fieldset > p {
  margin: 0.18rem 0 0.6rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.tenant-choice {
  display: flex;
  min-height: 2.55rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 650;
}

.tenant-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.tenant-choice input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
}

/* Unit-side tenant context ------------------------------------------------ */

.unit-tenancy-panel {
  margin-bottom: 1.25rem;
}

.unit-tenancy-current {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
  gap: 1rem;
  align-items: start;
}

.unit-tenancy-facts {
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.unit-tenancy-facts dt {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.unit-tenancy-facts dd {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  font-weight: 700;
}

.unit-tenant-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.unit-tenant-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 2.1rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.unit-tenant-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.unit-tenant-card > span:first-child {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.unit-tenant-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.unit-tenant-card strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-tenant-card small {
  color: var(--ink-muted);
  font-size: 0.65rem;
}

.unit-tenancy-history > ol {
  margin: 0;
  padding: 0 0.85rem;
  list-style: none;
}

.unit-tenancy-history li {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.unit-tenancy-history li + li {
  border-top: 1px solid var(--line);
}

.unit-tenancy-history li > div {
  display: grid;
}

.unit-tenancy-history li small {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

@media (max-width: 1120px) {
  .tenant-overview-grid,
  .tenant-authorization-layout,
  .tenant-lease-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tenant-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-filter-form__actions {
    grid-column: 1 / -1;
  }

  .tenant-hero,
  .tenant-contact-grid,
  .unit-tenancy-current {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tenant-table-wrap {
    overflow: visible;
  }

  .tenant-table-wrap .tenant-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .tenant-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .tenant-table tbody {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 0.8rem;
  }

  .tenant-table tr {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .tenant-table tbody th,
  .tenant-table tbody td {
    display: grid;
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(110px, 0.72fr) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: right;
    white-space: normal;
  }

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

  .tenant-table tbody th::before,
  .tenant-table tbody td::before {
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .tenant-table tbody th > *,
  .tenant-table tbody td > * {
    max-width: 100%;
    justify-self: end;
    text-align: left;
  }

  .tenant-contact-list,
  .tenant-assignment,
  .tenant-assignment-list,
  .tenant-preferences {
    min-width: 0;
  }

  .tenant-contact-list a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 620px) {
  .tenant-filter-form,
  .tenant-hero__contact,
  .tenant-readonly-details,
  .tenant-current-card dl,
  .tenant-lease-meta,
  .tenant-authorization-meta,
  .tenant-check-grid,
  .tenant-co-tenant-grid,
  .tenant-address-grid,
  .unit-tenant-list,
  .unit-tenancy-facts {
    grid-template-columns: 1fr;
  }

  .tenant-filter-form__actions {
    grid-column: auto;
    display: grid;
  }

  .tenant-filter-form__actions,
  .tenant-filter-form__actions .button {
    width: 100%;
  }

  .tenant-form-panel__body,
  .tenant-panel__body,
  .unit-tenancy-panel__body {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .tenant-hero {
    padding: 1rem;
  }

  .tenant-hero__identity {
    align-items: flex-start;
  }

  .tenant-hero__avatar {
    width: 3.5rem;
    height: 3.5rem;
  }

  .tenant-assurance {
    grid-template-columns: 1fr;
  }

  .tenant-assurance__mark {
    display: none;
  }

  .tenant-record-list > li,
  .tenant-effective-authorization-list li,
  .tenant-authorization-timeline article > header,
  .tenant-lease-list article > header,
  .unit-tenancy-history li {
    display: grid;
  }

  .tenant-record-list > li form,
  .tenant-record-list > li form .button {
    width: 100%;
  }

  .tenant-record__actions,
  .tenant-verify-disclosure,
  .tenant-deactivate-disclosure {
    width: 100%;
  }

  .tenant-readonly-details__wide,
  .tenant-lease-meta__wide {
    grid-column: auto;
  }
}

@media (max-width: 440px) {
  .tenant-table tbody th,
  .tenant-table tbody td {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    text-align: left;
  }

  .tenant-table tbody th > *,
  .tenant-table tbody td > * {
    justify-self: start;
  }

  .tenant-hero__identity {
    display: grid;
  }

  .tenant-contact-action {
    overflow: hidden;
  }
}

@media print {
  .tenant-filter-panel,
  .tenant-form-panel form,
  .tenant-profile-panel form,
  .tenant-form-disclosure,
  .tenant-verify-disclosure,
  .tenant-deactivate-disclosure,
  .tenant-authorization-form,
  .tenant-lease-form,
  .tenant-close-disclosure {
    display: none !important;
  }

  .tenant-hero,
  .tenant-table tr,
  .tenant-lease-list > li {
    box-shadow: none;
  }
}

/* Document scanner and human-review workspace */
.documents-heading {
  align-items: center;
}

.documents-heading__assurance {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  max-width: 270px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 255 255 / 72%);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.3;
}

.assurance-dot {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-soft);
}

.document-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.document-summary__item {
  display: flex;
  min-width: 0;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.82rem 1rem;
  border-bottom: 3px solid transparent;
  color: var(--ink-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.document-summary__item + .document-summary__item {
  border-left: 1px solid var(--line);
}

.document-summary__item:hover,
.document-summary__item--active {
  background: #f8fbfb;
  color: var(--brand);
}

.document-summary__item--active {
  border-bottom-color: var(--brand);
}

.document-summary__item--attention.document-summary__item--active {
  border-bottom-color: var(--warning);
}

.document-summary__item--success.document-summary__item--active {
  border-bottom-color: var(--success);
}

.document-summary__item strong {
  color: var(--ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.document-inbox-layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.scan-panel {
  position: sticky;
  top: 92px;
}

.scan-panel__header {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.scan-panel__header h2,
.scan-panel__header .eyebrow {
  margin-bottom: 0;
}

.scan-panel__mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
}

.scan-panel__mark svg,
.scan-dropzone__icon svg,
.document-empty-state .empty-state__mark svg {
  width: 1.45rem;
  height: 1.45rem;
}

.scan-panel__intro {
  margin: 0.9rem 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.scan-form,
.scan-panel .form-grid--2 {
  grid-template-columns: 1fr;
}

.scan-dropzone {
  display: grid;
  justify-items: center;
  padding: 1.15rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #fbfdfd, var(--brand-soft));
  text-align: center;
}

.scan-dropzone:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(15 114 143 / 12%);
}

.scan-dropzone__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 0.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.scan-dropzone > label {
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 800;
}

.scan-dropzone > p {
  margin: 0.2rem 0 0.7rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.scan-file-input {
  width: 100%;
  min-width: 0;
  padding: 0.38rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.scan-file-input::file-selector-button {
  margin-right: 0.55rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 4px;
  background: var(--brand);
  color: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.scan-dropzone > small {
  margin-top: 0.55rem;
  color: var(--ink-muted);
  font-size: 0.66rem;
}

.scan-dropzone .scan-camera-hint {
  margin-top: 0.28rem;
  color: var(--brand);
  font-weight: 650;
}

.check-control {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  cursor: pointer;
}

.check-control input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
  margin: 0.18rem 0 0;
  accent-color: var(--brand);
}

.check-control > span {
  display: grid;
  gap: 0.15rem;
}

.check-control strong {
  font-size: 0.79rem;
}

.check-control small {
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.scan-assurance {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border-left: 3px solid var(--brand);
  background: #f8fbfb;
}

.scan-assurance > div {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.scan-assurance span {
  color: var(--success);
  font-weight: 900;
}

.scan-assurance p {
  margin: 0;
}

.document-inbox {
  min-width: 0;
}

.document-inbox__header .status-pill {
  flex: 0 0 auto;
}

.document-filter-bar {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 145px minmax(170px, 0.75fr) auto;
  gap: 0.7rem;
  align-items: end;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.document-filter-bar .field {
  min-width: 0;
}

.document-filter-bar .field label {
  font-size: 0.69rem;
}

.document-filter-bar .field input,
.document-filter-bar .field select {
  min-height: 2.35rem;
  padding: 0.48rem 0.58rem;
  font-size: 0.74rem;
}

.document-filter-bar__actions {
  display: flex;
  gap: 0.25rem;
}

.document-list--inbox .document-row {
  position: relative;
  grid-template-columns: 3.2rem minmax(0, 1fr) minmax(112px, auto);
}

.document-list--inbox .document-row::before {
  position: absolute;
  content: "";
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: transparent;
}

.document-list--inbox .document-row--needs_review::before {
  background: var(--warning);
}

.document-list--inbox .document-row--confirmed::before {
  background: var(--success);
}

.document-list--inbox .document-row--failed::before {
  background: var(--danger);
}

.document-row__heading {
  display: flex;
  min-width: 0;
  gap: 0.55rem;
  align-items: center;
}

.document-row__heading h3 {
  min-width: 0;
}

.warning-count {
  display: inline-grid;
  min-width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.64rem;
  font-weight: 850;
}

.document-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0.7rem 0 0;
}

.document-facts > div {
  display: grid;
  gap: 0.05rem;
}

.document-facts dt {
  color: var(--ink-muted);
  font-size: 0.61rem;
  font-weight: 750;
  text-transform: uppercase;
}

.document-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 650;
}

.document-facts__amount dd {
  color: var(--brand-deep);
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}

.document-list--inbox .document-hash {
  max-width: 145px;
}

.document-list--inbox .document-hash code {
  max-width: 90px;
}

.document-download-link {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.document-empty-state .empty-state__mark {
  color: var(--brand);
}

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

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

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

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

.document-detail-header__identity {
  display: flex;
  min-width: 0;
  gap: 1rem;
  align-items: center;
}

.document-detail-header__identity > div {
  min-width: 0;
}

.document-detail-header__identity h1 {
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 450;
}

.document-detail-header__identity p:last-child {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.77rem;
}

.document-detail-header__type {
  display: grid;
  width: 3.5rem;
  height: 4rem;
  flex: 0 0 auto;
  place-items: end center;
  padding-bottom: 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px 13px 5px 5px;
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
  font-size: 0.62rem;
  font-weight: 850;
}

.document-detail-header__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.document-detail-header__actions form {
  margin: 0;
}

.document-reprocess-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.document-reprocess-form input[type="text"] {
  width: min(18rem, 36vw);
  min-height: 2.35rem;
}

.processing-pipeline {
  margin-bottom: 1.25rem;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.processing-pipeline ol {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  min-width: 700px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-step {
  position: relative;
  display: flex;
  min-width: 0;
  gap: 0.55rem;
  align-items: center;
  color: var(--ink-muted);
}

.pipeline-step:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  content: "";
  top: 50%;
  right: 0.65rem;
  left: 2.35rem;
  height: 1px;
  background: var(--line-strong);
}

.pipeline-step__marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 0.68rem;
  font-weight: 850;
}

.pipeline-step > span:last-child {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  padding-right: 0.45rem;
  background: var(--surface);
}

.pipeline-step strong {
  overflow: hidden;
  color: currentColor;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-step small {
  font-size: 0.59rem;
  white-space: nowrap;
}

.pipeline-step--done {
  color: var(--success);
}

.pipeline-step--done .pipeline-step__marker {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.pipeline-step--current {
  color: var(--brand);
}

.pipeline-step--current .pipeline-step__marker {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.pipeline-step--failed {
  color: var(--danger);
}

.pipeline-step--failed .pipeline-step__marker {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.processing-failure {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgb(154 51 41 / 22%);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
}

.processing-failure p {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}

.document-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.document-viewer,
.review-panel {
  min-width: 0;
}

.document-viewer {
  position: sticky;
  top: 92px;
}

.document-viewer__toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.document-viewer__toolbar h2,
.document-viewer__toolbar p {
  margin: 0;
}

.document-viewer__toolbar h2 {
  font-size: 1rem;
}

.document-viewer__canvas {
  display: grid;
  height: min(68vh, 760px);
  min-height: 520px;
  place-items: center;
  overflow: auto;
  background-color: #e9eeee;
  background-image: linear-gradient(45deg, rgb(15 114 143 / 3%) 25%, transparent 25%), linear-gradient(-45deg, rgb(15 114 143 / 3%) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgb(15 114 143 / 3%) 75%), linear-gradient(-45deg, transparent 75%, rgb(15 114 143 / 3%) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.document-viewer__canvas iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.document-viewer__canvas > img {
  max-width: calc(100% - 2rem);
  max-height: calc(100% - 2rem);
  margin: 1rem;
  object-fit: contain;
  box-shadow: var(--shadow-md);
}

.document-preview-unavailable {
  display: grid;
  max-width: 340px;
  justify-items: center;
  padding: 2rem;
  text-align: center;
}

.document-preview-unavailable > span {
  display: grid;
  width: 4rem;
  height: 4.7rem;
  margin-bottom: 1rem;
  place-items: end center;
  padding-bottom: 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px 16px 6px 6px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.document-preview-unavailable p {
  color: var(--ink-muted);
  font-size: 0.79rem;
}

.document-viewer__integrity {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--success);
  font-size: 0.67rem;
}

.document-viewer__integrity p {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  margin: 0;
}

.document-viewer__integrity code {
  overflow: hidden;
  color: var(--ink-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fbfdfd;
}

.review-tabs a {
  position: relative;
  padding: 0.9rem 0.55rem;
  color: var(--ink-muted);
  font-size: 0.73rem;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.review-tabs a + a {
  border-left: 1px solid var(--line);
}

.review-tabs a:hover,
.review-tabs a[aria-current="page"] {
  background: var(--surface);
  color: var(--brand);
}

.review-tabs a[aria-current="page"]::after {
  position: absolute;
  content: "";
  right: 1rem;
  bottom: -1px;
  left: 1rem;
  height: 3px;
  background: var(--brand);
}

.review-panel__body {
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
}

.review-panel__body > section > p,
.ocr-editor > p {
  color: var(--ink-muted);
  font-size: 0.79rem;
}

.review-section-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.review-section-heading h3,
.review-section-heading p {
  margin-bottom: 0;
}

.provenance-pill,
.confidence-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 0.62rem;
  font-weight: 800;
}

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

.extraction-form {
  display: grid;
  gap: 1rem;
}

.field-group {
  min-width: 0;
  margin: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfdfd;
}

.field-group legend {
  padding: 0 0.35rem;
  color: var(--brand-deep);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-group legend .optional {
  margin-left: 0.2rem;
  text-transform: none;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.extraction-form input:disabled,
.extraction-form select:disabled {
  border-color: transparent;
  background: var(--surface-muted);
  color: var(--ink);
  cursor: default;
  opacity: 1;
}

.field--invalid label {
  color: var(--danger);
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea,
.extraction-form .field--invalid input:disabled,
.extraction-form .field--invalid select:disabled {
  border-color: var(--danger);
  background: linear-gradient(0deg, rgb(249 232 229 / 48%), rgb(249 232 229 / 48%)), var(--surface);
  box-shadow: inset 3px 0 0 var(--danger);
}

.field--invalid input:focus,
.field--invalid select:focus,
.field--invalid textarea:focus,
.field--invalid input:target,
.field--invalid select:target,
.field--invalid textarea:target {
  border-color: var(--danger);
  outline: 3px solid rgb(154 51 41 / 24%);
  outline-offset: 2px;
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  scroll-margin-top: 110px;
}

.field .field__error {
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: start;
  margin: 0;
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.field__error-icon {
  display: inline-grid;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.02rem;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.allocation-choice,
.reconciliation-decisions {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.allocation-choice > legend,
.reconciliation-decisions > legend {
  width: 100%;
  padding: 0;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: normal;
  text-transform: none;
}

.allocation-choice__help,
.reconciliation-decisions > p {
  margin: 0.3rem 0 0.7rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.allocation-choice__options,
.reconciliation-decisions__options {
  display: grid;
  gap: 0.55rem;
}

.choice-card {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.72rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.choice-card:hover,
.choice-card:focus-within {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.choice-card input[type="radio"] {
  width: 1rem;
  height: 1rem;
  margin: 0.15rem 0 0;
  accent-color: var(--brand);
}

.choice-card > span {
  display: grid;
  gap: 0.15rem;
}

.choice-card strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.choice-card small {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.4;
}

.choice-card:has(input:disabled) {
  cursor: default;
  opacity: 0.8;
}

.allocation-choice__partial {
  margin-top: 0.75rem;
}

.allocation-choice--invalid > legend {
  color: var(--danger);
}

.required-marker {
  margin-left: 0.25rem;
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 800;
}

.amount-reconciliation {
  margin-top: 1.25rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  background: #fbfdfd;
}

.amount-reconciliation--attention {
  border-left-color: var(--danger);
  background: rgb(249 232 229 / 18%);
}

.amount-reconciliation__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.amount-reconciliation__header h3,
.amount-reconciliation__header p {
  margin-bottom: 0;
}

.amount-reconciliation__intro {
  margin: 0.6rem 0 0.85rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.amount-reconciliation__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
}

.amount-reconciliation__summary > div {
  min-width: 0;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.amount-reconciliation__summary dt {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 700;
}

.amount-reconciliation__summary dd {
  margin: 0.16rem 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.amount-reconciliation__difference--attention dd {
  color: var(--danger);
}

.amount-reconciliation__record {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--success-soft);
}

.amount-reconciliation__record > div,
.amount-reconciliation__record > div > small {
  display: grid;
  gap: 0.15rem;
}

.amount-reconciliation__record p,
.amount-reconciliation__record small {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.amount-reconciliation__record strong {
  color: var(--success);
  font-size: 0.78rem;
}

.amount-reconciliation__form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.amount-reconciliation__permission-note {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
}

.validation-panel {
  margin-top: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.validation-panel > header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
  background: #f8fbfb;
}

.validation-panel > header h3,
.validation-panel > header p {
  margin: 0;
}

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

.validation-item {
  display: grid;
  grid-template-columns: 1.65rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  color: var(--info);
  font-size: 0.72rem;
}

.validation-item + .validation-item {
  border-top: 1px solid var(--line);
}

.validation-item--warning {
  color: var(--warning);
  background: rgb(255 241 215 / 35%);
}

.validation-item--error {
  color: var(--danger);
  background: rgb(249 232 229 / 40%);
}

.validation-item--success {
  color: var(--success);
  background: rgb(228 242 233 / 35%);
}

.validation-item__icon {
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.validation-item p,
.validation-item small {
  display: block;
  margin: 0.18rem 0 0;
  color: var(--ink-muted);
}

.validation-item small {
  color: currentColor;
  font-weight: 750;
}

.validation-item__link {
  color: inherit;
  text-underline-offset: 0.18em;
}

.validation-item__link:hover {
  color: inherit;
}

.validation-item__field {
  color: var(--ink);
  font-weight: 800;
}

.validation-empty {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  color: var(--success);
  font-size: 0.75rem;
}

.validation-empty span {
  display: grid;
  width: 1.4rem;
  height: 1.4rem;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  font-weight: 900;
}

.validation-empty p {
  margin: 0;
}

.review-actionbar {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-top: 1px solid var(--line-strong);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 -12px 24px rgb(9 86 109 / 8%);
  backdrop-filter: blur(12px);
}

.review-actionbar > div {
  display: grid;
  gap: 0.12rem;
}

.review-actionbar strong {
  font-size: 0.77rem;
}

.review-actionbar small {
  color: var(--ink-muted);
  font-size: 0.64rem;
}

.review-actionbar__blocked {
  grid-column: 1 / -1;
  color: var(--danger) !important;
  font-weight: 700;
}

.button:disabled {
  transform: none;
  border-color: var(--line-strong);
  background: var(--surface-muted);
  color: var(--ink-muted);
  box-shadow: none;
  cursor: not-allowed;
}

.ocr-editor__raw {
  margin: 1rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.ocr-editor__raw summary {
  padding: 0.8rem 0.9rem;
  background: #f8fbfb;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.ocr-editor__raw-body {
  padding: 0.9rem;
  border-top: 1px solid var(--line);
}

.ocr-editor__raw-body > p,
.ocr-editor__raw-body > small {
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.ocr-editor pre,
.ocr-editor__corrected-readonly pre {
  max-height: 440px;
  margin: 0.65rem 0;
  padding: 0.9rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fafa;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.69rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ocr-textarea {
  min-height: 430px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important;
  font-size: 0.74rem !important;
  line-height: 1.55;
}

.ocr-editor__corrected-readonly {
  margin-top: 1rem;
}

.document-history {
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.document-history li {
  position: relative;
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr);
  gap: 0.7rem;
  padding-bottom: 1.2rem;
}

.document-history li:not(:last-child)::before {
  position: absolute;
  content: "";
  top: 0.8rem;
  bottom: 0;
  left: 0.37rem;
  width: 1px;
  background: var(--line-strong);
}

.document-history__marker {
  position: relative;
  z-index: 1;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.15rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.document-history header {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  justify-content: space-between;
}

.document-history strong {
  font-size: 0.76rem;
}

.document-history time,
.document-history small {
  color: var(--ink-muted);
  font-size: 0.64rem;
}

.document-history p {
  margin: 0.25rem 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

@media (max-width: 1100px) {
  .document-inbox-layout,
  .document-review-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .scan-panel,
  .document-viewer {
    position: static;
  }

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

  .scan-panel {
    max-width: none;
  }

  .document-review-layout {
    gap: 1rem;
  }

  .document-detail-header {
    display: grid;
  }

  .document-detail-header__actions {
    justify-content: flex-start;
  }

  .document-viewer__canvas {
    height: 58vh;
    min-height: 460px;
  }
}

@media (max-width: 760px) {
  .documents-heading {
    display: grid;
    align-items: start;
  }

  .documents-heading__assurance {
    max-width: none;
  }

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

  .document-summary__item:nth-child(3) {
    border-left: 0;
  }

  .document-summary__item:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .document-filter-bar__search,
  .document-filter-bar__actions {
    grid-column: 1 / -1;
  }

  .document-filter-bar__actions .button {
    flex: 1;
  }

  .document-list--inbox .document-row {
    grid-template-columns: 2.8rem minmax(0, 1fr);
  }

  .document-list--inbox .document-row__actions {
    grid-column: 2;
    grid-row: auto;
  }

  .document-detail-header {
    display: grid;
  }

  .document-detail-header__actions {
    justify-content: flex-start;
  }

  .document-viewer__canvas {
    height: 50vh;
    min-height: 380px;
  }
}

@media (max-width: 520px) {
  .amount-reconciliation {
    padding: 0.75rem;
  }

  .amount-reconciliation__header {
    display: grid;
  }

  .amount-reconciliation__summary {
    grid-template-columns: 1fr;
  }

  .document-summary__item {
    padding: 0.7rem 0.75rem;
  }

  .scan-panel .form-grid--2,
  .document-filter-bar,
  .amount-grid {
    grid-template-columns: 1fr;
  }

  .document-filter-bar__search,
  .document-filter-bar__actions {
    grid-column: auto;
  }

  .document-detail-header__identity {
    align-items: flex-start;
  }

  .document-detail-header__type {
    width: 2.8rem;
    height: 3.3rem;
  }

  .document-detail-header__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .document-detail-header__actions .button,
  .document-detail-header__actions form,
  .document-detail-header__actions form .button {
    width: 100%;
  }

  .document-reprocess-form {
    display: grid;
  }

  .document-reprocess-form input[type="text"] {
    width: 100%;
  }

  .processing-pipeline {
    /* Match the 0.625rem page gutter exactly so the scroller reaches the
       viewport edge without creating a one-pixel page-level overflow. */
    margin-right: -0.625rem;
    margin-left: -0.625rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .document-viewer__canvas {
    min-height: 320px;
  }

  .review-tabs {
    display: flex;
    overflow-x: auto;
  }

  .review-tabs a {
    min-width: 130px;
    flex: 1 0 auto;
  }

  .review-panel__body {
    padding: 1rem;
  }

  .field-group {
    padding: 0.75rem;
  }

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

  .review-actionbar form,
  .review-actionbar .button {
    width: 100%;
  }

  .review-actionbar__blocked {
    grid-column: auto;
  }

  .review-section-heading {
    display: grid;
  }

  .provenance-pill,
  .confidence-pill {
    justify-self: start;
  }

  .document-history header {
    display: grid;
    gap: 0.15rem;
  }
}

@media print {
  .document-summary,
  .scan-panel,
  .document-filter-bar,
  .processing-pipeline,
  .document-detail-header__actions,
  .review-tabs,
  .review-actionbar {
    display: none !important;
  }

  .document-review-layout {
    display: block;
  }

  .document-viewer {
    margin-bottom: 1rem;
  }
}

/* Unit operations and profitability */

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.condition-pill--not_assessed {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.condition-pill--needs_renovation {
  background: var(--danger-soft);
  color: var(--danger);
}

.condition-pill--basic {
  background: var(--warning-soft);
  color: var(--warning);
}

.condition-pill--good,
.condition-pill--renovated {
  background: var(--success-soft);
  color: var(--success);
}

.condition-pill--under_renovation {
  background: var(--info-soft);
  color: var(--info);
}

.unit-hero {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(560px, 1.3fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  margin-bottom: 2rem;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, rgb(15 114 143 / 11%), transparent 34%),
    linear-gradient(135deg, var(--surface), #f8fbfb);
  box-shadow: var(--shadow-sm);
}

.unit-hero__copy > p:last-of-type {
  max-width: 590px;
  margin-bottom: 0;
  color: var(--ink-muted);
}

.unit-hero__status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}

.unit-facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 88%);
}

.unit-facts > div {
  min-width: 0;
  padding: 0.8rem 0.85rem;
}

.unit-facts > div + div {
  border-left: 1px solid var(--line);
}

.unit-facts dt {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.unit-facts dd {
  margin: 0.18rem 0 0;
  overflow: hidden;
  color: var(--brand-deep);
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-heading {
  margin-bottom: 1rem;
}

.section-heading--split {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading > div > p:last-child {
  max-width: 720px;
  margin-top: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.84rem;
}

.year-chip,
.count-chip {
  display: inline-grid;
  min-width: 2.4rem;
  min-height: 2.15rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.unit-year-filter {
  display: flex;
  flex: 0 0 auto;
  gap: 0.55rem;
  align-items: end;
}

.unit-year-filter .field {
  gap: 0.22rem;
}

.unit-year-filter .field label {
  font-size: 0.68rem;
}

.unit-year-filter .field select {
  min-width: 108px;
  min-height: 2.1rem;
  padding: 0.35rem 1.8rem 0.35rem 0.6rem;
  font-size: 0.76rem;
}

.unit-performance {
  margin-bottom: 1.25rem;
}

.unit-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 138px;
  align-content: space-between;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  content: "";
  top: -2.5rem;
  right: -2.5rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: var(--brand-soft);
  opacity: 0.65;
}

.metric-card > span,
.metric-card > strong,
.metric-card > small {
  position: relative;
  z-index: 1;
}

.metric-card > span {
  color: var(--ink-muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.metric-card > strong {
  margin: 0.45rem 0;
  color: var(--brand-deep);
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.metric-card > small {
  color: var(--ink-muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.metric-card--expense {
  border-top-color: var(--warning);
}

.metric-card--expense::after {
  background: var(--warning-soft);
}

.metric-card--positive {
  border-top-color: var(--success);
}

.metric-card--positive::after {
  background: var(--success-soft);
}

.metric-card--negative {
  border-top-color: var(--danger);
}

.metric-card--negative > strong {
  color: var(--danger);
}

.metric-card--negative::after {
  background: var(--danger-soft);
}

.metric-card--margin {
  border-top-color: var(--info);
}

.metric-card--margin::after {
  background: var(--info-soft);
}

.unit-workspace-grid,
.unit-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.unit-history-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  margin-bottom: 0;
}

.unit-panel-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.unit-section-intro,
.permission-note,
.form-help {
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.unit-section-intro {
  margin-bottom: 1.15rem;
}

.form-help {
  display: block;
  margin-top: -0.45rem;
}

.permission-note {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.condition-readonly {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.condition-readonly > div {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.condition-readonly dt {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.condition-readonly dd {
  margin: 0.22rem 0 0;
  font-size: 0.82rem;
}

.unit-activity-form-panel {
  margin-bottom: 1.25rem;
}

.unit-activity-form-panel .panel__header p:last-child,
.profitability-comparison .panel__header p:last-child {
  max-width: 760px;
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.unit-empty-state {
  min-height: 190px;
}

.unit-timeline {
  padding-top: 1.5rem;
}

.unit-timeline li {
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 0.85rem;
  padding-bottom: 1.45rem;
}

.unit-timeline__entry > header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.unit-timeline__entry h3 {
  margin: 0.12rem 0 0;
}

.activity-kind {
  color: var(--brand);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.unit-timeline .unit-timeline__date {
  margin: 0.25rem 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.unit-timeline__entry > p:not(.unit-timeline__date) {
  white-space: pre-line;
}

.activity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.65rem 0 0.4rem;
}

.activity-meta > div {
  display: flex;
  gap: 0.3rem;
  align-items: baseline;
}

.activity-meta dt,
.activity-meta dd {
  font-size: 0.7rem;
}

.activity-meta dt {
  color: var(--ink-muted);
  font-weight: 700;
}

.activity-meta dd {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.activity-status--planned {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.activity-status--in_progress {
  background: var(--info-soft);
  color: var(--info);
}

.activity-status--completed {
  background: var(--success-soft);
  color: var(--success);
}

.activity-status--cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.activity-dot--planned {
  background: var(--ink-muted);
  box-shadow: 0 0 0 1px var(--ink-muted);
}

.activity-dot--in_progress {
  background: var(--info);
  box-shadow: 0 0 0 1px var(--info);
}

.activity-dot--cancelled {
  background: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}

.unit-income-table th[scope="row"] {
  background: transparent;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: normal;
  text-transform: none;
}

.unit-income-table td {
  font-variant-numeric: tabular-nums;
}

.profitability-heading {
  align-items: center;
}

.report-year-badge {
  display: grid;
  min-width: 105px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.report-year-badge small {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.report-year-badge strong {
  color: var(--brand-deep);
  font-size: 1.35rem;
}

.profitability-filter-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.2rem;
}

.profitability-filter-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.45fr) minmax(250px, 1fr) auto;
  gap: 1rem;
  align-items: end;
}

.profitability-filter-form__actions {
  display: flex;
  gap: 0.55rem;
}

.profitability-summary {
  margin-bottom: 1.25rem;
}

.profitability-coverage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.8rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: var(--radius-md);
  background: var(--info-soft);
  color: var(--info);
}

.profitability-coverage--missing {
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.profitability-coverage > span {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: white;
  font-size: 0.74rem;
  font-weight: 900;
}

.profitability-coverage h3,
.profitability-coverage p {
  margin: 0;
  color: inherit;
}

.profitability-coverage h3 {
  font-size: 0.84rem;
  font-weight: 800;
}

.profitability-coverage p {
  margin-top: 0.15rem;
  font-size: 0.72rem;
}

.profitability-comparison {
  margin-bottom: 1.25rem;
}

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

.profitability-table th,
.profitability-table td {
  padding-right: 0.8rem;
  padding-left: 0.8rem;
}

.profitability-table tbody th {
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.profitability-result {
  color: var(--success);
  font-weight: 800;
}

.profitability-result--negative {
  color: var(--danger);
}

.profitability-row--empty {
  background: #fbfcfc;
  color: var(--ink-muted);
}

.data-coverage {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 750;
  white-space: nowrap;
}

.data-coverage::before {
  width: 0.48rem;
  height: 0.48rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.data-coverage--available {
  color: var(--success);
}

.data-coverage--empty {
  color: var(--ink-muted);
}

.profitability-method {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
}

.profitability-method__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 850;
}

.profitability-method h2,
.profitability-method .eyebrow {
  margin-bottom: 0;
}

.profitability-method__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.profitability-method__grid p {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid rgb(15 114 143 / 18%);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 70%);
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.profitability-method__grid strong {
  color: var(--ink);
}

.profitability-method__scope {
  margin: 0.8rem 0 0;
  color: var(--ink-muted);
  font-size: 0.73rem;
}

@media (max-width: 1060px) {
  .unit-hero {
    grid-template-columns: 1fr;
  }

  .unit-facts {
    grid-template-columns: repeat(5, minmax(110px, 1fr));
  }

  .unit-history-grid {
    grid-template-columns: 1fr;
  }

  .unit-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profitability-total-grid .metric-card:nth-child(n + 4) {
    grid-column: span 1;
  }
}

@media (max-width: 820px) {
  .unit-workspace-grid {
    grid-template-columns: 1fr;
  }

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

  .profitability-filter-form__actions {
    grid-column: 1 / -1;
  }

  .profitability-method__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .profitability-table-wrap {
    overflow: visible;
  }

  .profitability-table-wrap .profitability-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .profitability-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .profitability-table tbody {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 0.8rem;
  }

  .profitability-table tr {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .profitability-table tbody th,
  .profitability-table tbody td {
    display: grid;
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(105px, 0.7fr) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: right;
    white-space: normal;
  }

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

  .profitability-table tbody th::before,
  .profitability-table tbody td::before {
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .profitability-table tbody th > *,
  .profitability-table tbody td > * {
    justify-self: end;
  }

  .profitability-table .table-note {
    display: block;
    margin-top: 0.15rem;
  }
}

@media (max-width: 620px) {
  .unit-hero,
  .unit-panel-body {
    padding: 1rem;
  }

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

  .unit-facts > div + div {
    border-left: 0;
  }

  .unit-facts > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .unit-facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

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

  .metric-card {
    min-height: 125px;
  }

  .metric-card--margin {
    grid-column: 1 / -1;
  }

  .unit-activity-form-panel .form-grid--3,
  .unit-workspace-grid .form-grid--3 {
    grid-template-columns: 1fr;
  }

  .unit-activity-form-panel .field--span-2 {
    grid-column: auto;
  }

  .profitability-heading,
  .section-heading--split,
  .unit-timeline__entry > header {
    display: grid;
  }

  .unit-year-filter {
    width: 100%;
  }

  .unit-year-filter .field {
    min-width: 0;
    flex: 1;
  }

  .unit-year-filter .field select {
    width: 100%;
  }

  .report-year-badge {
    width: 100%;
  }

  .profitability-filter-form {
    grid-template-columns: 1fr;
  }

  .profitability-filter-form__actions {
    grid-column: auto;
  }

  .profitability-filter-form__actions,
  .profitability-filter-form__actions .button {
    width: 100%;
  }

  .profitability-filter-form__actions {
    display: grid;
  }

  .profitability-method {
    grid-template-columns: 1fr;
  }

  .profitability-method__mark {
    display: none;
  }

  .table-actions {
    flex-wrap: nowrap;
  }
}

@media (max-width: 520px) {
  .unit-metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card--margin {
    grid-column: auto;
  }

  .unit-income-table-wrap {
    overflow: visible;
  }

  .unit-income-table-wrap .unit-income-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .unit-income-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .unit-income-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .unit-income-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }

  .unit-income-table th[scope="row"] {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: var(--brand-soft);
    color: var(--brand-deep);
  }

  .unit-income-table td {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1fr);
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    text-align: right;
  }

  .unit-income-table td::before {
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.64rem;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }
}

@media print {
  .unit-condition-panel form,
  .unit-activity-form-panel,
  .profitability-filter-panel {
    display: none !important;
  }

  .unit-hero,
  .profitability-method,
  .metric-card {
    box-shadow: none;
  }
}

/* Service provider directory and communication history */

.provider-directory-heading {
  align-items: center;
}

.provider-filter-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.2rem;
}

.provider-filter-form {
  display: grid;
  grid-template-columns: minmax(250px, 1.3fr) minmax(180px, 0.8fr) minmax(160px, 0.65fr) auto;
  gap: 0.9rem;
  align-items: end;
}

.provider-filter-form__actions {
  display: flex;
  gap: 0.45rem;
}

.provider-directory .panel__header > div,
.provider-profile-panel .panel__header > div,
.provider-communication-form-panel .panel__header > div,
.provider-history-grid .panel__header > div {
  min-width: 0;
}

.provider-directory .panel__header .eyebrow,
.provider-profile-panel .panel__header .eyebrow,
.provider-communication-form-panel .panel__header .eyebrow,
.provider-history-grid .panel__header .eyebrow {
  margin-bottom: 0.2rem;
}

.provider-directory .panel__header p:last-child,
.provider-profile-panel .panel__header p:last-child,
.provider-communication-form-panel .panel__header p:last-child,
.provider-history-grid .panel__header p:last-child {
  max-width: 680px;
  margin: 0.28rem 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.provider-table {
  min-width: 1120px;
}

.provider-table th,
.provider-table td {
  padding-right: 0.75rem;
  padding-left: 0.75rem;
  vertical-align: middle;
}

.provider-table tbody th {
  background: transparent;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: normal;
  text-transform: none;
}

.provider-row--inactive {
  background: #fafbfb;
  color: var(--ink-muted);
}

.provider-row--inactive .provider-avatar {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.provider-identity {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  min-width: 190px;
}

.provider-identity > span:last-child {
  display: grid;
  min-width: 0;
}

.provider-avatar,
.provider-hero__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}

.provider-avatar {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.78rem;
}

.specialty-tags,
.provider-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.specialty-tags > span,
.specialty-tag,
.channel-pill,
.direction-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 750;
  line-height: 1.2;
}

.specialty-tags > span,
.specialty-tag {
  padding: 0.28rem 0.48rem;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.specialty-tag--muted {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.channel-pill {
  padding: 0.3rem 0.52rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
}

.provider-contact-list,
.provider-activity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-contact-list {
  display: grid;
  gap: 0.22rem;
  min-width: 180px;
}

.provider-contact-list a {
  display: grid;
  grid-template-columns: 2.9rem minmax(0, 1fr);
  gap: 0.35rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.7rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-contact-list a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.provider-contact-list a span {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 750;
}

.muted-value {
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.provider-usage {
  display: grid;
  min-width: 145px;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.provider-usage strong {
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.provider-usage small {
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.62rem;
}

.provider-empty-state__mark {
  font-family: var(--font-sans);
}

.provider-form-panel {
  max-width: 980px;
}

.provider-form-panel__body,
.provider-profile-panel__body,
.provider-communication-form-panel__body {
  padding: 1.4rem 1.5rem 1.6rem;
}

.provider-form-section {
  display: grid;
  gap: 1rem;
  padding: 0.15rem 0 1.35rem;
  border-bottom: 1px solid var(--line);
}

.provider-form-section > header h2,
.provider-form-section > header p {
  margin-bottom: 0;
}

.provider-form-section > header > p:last-child {
  max-width: 680px;
  margin-top: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.provider-specialty-fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.provider-specialty-fieldset legend {
  padding: 0;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 750;
}

.provider-specialty-fieldset > p {
  margin: 0.18rem 0 0.6rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.specialty-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.48rem;
}

.specialty-choice {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  min-height: 2.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfc;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 650;
}

.specialty-choice:hover {
  border-color: var(--line-strong);
  background: var(--brand-soft);
}

.specialty-choice:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.specialty-choice input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
}

.provider-contact-help {
  margin-top: -0.6rem;
}

.provider-address-grid {
  grid-template-columns: minmax(120px, 0.45fr) minmax(220px, 1fr) minmax(160px, 0.65fr);
}

.provider-active-control {
  margin-top: 0.15rem;
}

.provider-hero {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(520px, 1.25fr);
  gap: clamp(1.3rem, 4vw, 3.2rem);
  align-items: center;
  margin-bottom: 1.25rem;
  padding: clamp(1.35rem, 3vw, 2.1rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 98% 5%, rgb(15 114 143 / 12%), transparent 32%),
    linear-gradient(135deg, var(--surface), #f8fbfb);
  box-shadow: var(--shadow-sm);
}

.provider-hero__identity {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

.provider-hero__avatar {
  width: clamp(3.9rem, 7vw, 5.3rem);
  height: clamp(3.9rem, 7vw, 5.3rem);
  font-size: clamp(1.2rem, 3vw, 1.75rem);
}

.provider-hero h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
}

.provider-hero__company {
  margin-bottom: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.provider-hero__contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.provider-contact-action {
  display: grid;
  min-width: 0;
  grid-template-columns: 2rem minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 0.55rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 84%);
  color: var(--ink);
  text-decoration: none;
}

.provider-contact-action:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.provider-contact-action > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 850;
}

.provider-contact-action small {
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-contact-action strong {
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-workspace-grid,
.provider-history-grid {
  display: grid;
  grid-template-columns: minmax(600px, 1.15fr) minmax(380px, 0.85fr);
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.provider-history-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.provider-readonly-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.provider-readonly-details > div {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.provider-readonly-details__wide {
  grid-column: 1 / -1;
}

.provider-readonly-details dt {
  color: var(--ink-muted);
  font-size: 0.67rem;
  font-weight: 750;
}

.provider-readonly-details dd {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  white-space: pre-line;
}

.communication-scope-note {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  margin-bottom: 1rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--info);
}

.communication-scope-note > span {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-size: 0.68rem;
  font-weight: 850;
}

.communication-scope-note p {
  margin: 0;
  font-size: 0.72rem;
}

.provider-communication-timeline {
  padding-top: 1.5rem;
}

.provider-communication-timeline li {
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 0.85rem;
  padding-bottom: 1.5rem;
}

.communication-entry > header,
.provider-activity-list article > header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  justify-content: space-between;
}

.communication-entry h3,
.provider-activity-list h3 {
  margin: 0.12rem 0 0;
}

.communication-channel {
  color: var(--brand);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.direction-pill {
  flex: 0 0 auto;
  padding: 0.3rem 0.5rem;
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.direction-pill--incoming {
  background: var(--info-soft);
  color: var(--info);
}

.direction-pill--outgoing {
  background: var(--success-soft);
  color: var(--success);
}

.direction-pill--bidirectional {
  background: var(--brand-soft);
  color: var(--brand);
}

.communication-dot--incoming {
  background: var(--info);
  box-shadow: 0 0 0 1px var(--info);
}

.communication-dot--outgoing {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.communication-dot--internal {
  background: var(--ink-muted);
  box-shadow: 0 0 0 1px var(--ink-muted);
}

.provider-communication-timeline .communication-entry__date,
.provider-activity-list .provider-activity-list__date {
  margin: 0.25rem 0 0.45rem;
  color: var(--ink-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.provider-communication-timeline .communication-entry__summary,
.provider-activity-list article > p:not(.provider-activity-list__date) {
  color: var(--ink);
  white-space: pre-line;
}

.communication-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0.7rem 0 0.45rem;
}

.communication-meta > div {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
  font-size: 0.7rem;
}

.communication-meta dt {
  color: var(--ink-muted);
  font-weight: 700;
}

.communication-meta dd {
  margin: 0;
  font-weight: 700;
}

.communication-meta__follow-up {
  width: fit-content;
  padding: 0.3rem 0.48rem;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--warning);
}

.provider-activity-list {
  padding: 0 1.5rem;
}

.provider-activity-list > li {
  padding: 1.25rem 0;
}

.provider-activity-list > li + li {
  border-top: 1px solid var(--line);
}

@media (max-width: 1120px) {
  .provider-workspace-grid {
    grid-template-columns: 1fr;
  }

  .provider-profile-panel,
  .provider-communication-form-panel {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .provider-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-filter-form__actions {
    grid-column: 1 / -1;
  }

  .provider-hero {
    grid-template-columns: 1fr;
  }

  .provider-history-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .provider-table-wrap {
    overflow: visible;
  }

  .provider-table-wrap .provider-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .provider-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .provider-table tbody {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 0.8rem;
  }

  .provider-table tr {
    display: grid;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .provider-table tbody th,
  .provider-table tbody td {
    display: grid;
    width: auto;
    min-width: 0;
    grid-template-columns: minmax(110px, 0.72fr) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: right;
    white-space: normal;
  }

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

  .provider-table tbody th::before,
  .provider-table tbody td::before {
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
  }

  .provider-table tbody th > *,
  .provider-table tbody td > * {
    max-width: 100%;
    justify-self: end;
    text-align: left;
  }

  .provider-contact-list,
  .provider-usage {
    min-width: 0;
  }

  .provider-contact-list a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 620px) {
  .provider-filter-form,
  .provider-hero__contact,
  .specialty-choice-grid,
  .provider-address-grid,
  .provider-readonly-details {
    grid-template-columns: 1fr;
  }

  .provider-filter-form__actions {
    grid-column: auto;
  }

  .provider-filter-form__actions,
  .provider-filter-form__actions .button {
    width: 100%;
  }

  .provider-filter-form__actions {
    display: grid;
  }

  .provider-form-panel__body,
  .provider-profile-panel__body,
  .provider-communication-form-panel__body,
  .provider-activity-list {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .provider-hero {
    padding: 1rem;
  }

  .provider-hero__identity {
    align-items: flex-start;
  }

  .provider-hero__avatar {
    width: 3.5rem;
    height: 3.5rem;
  }

  .provider-readonly-details__wide {
    grid-column: auto;
  }

  .communication-entry > header,
  .provider-activity-list article > header {
    display: grid;
  }

  .direction-pill,
  .provider-activity-list .status-pill {
    justify-self: start;
  }
}

@media (max-width: 440px) {
  .provider-table tbody th,
  .provider-table tbody td {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    text-align: left;
  }

  .provider-table tbody th > *,
  .provider-table tbody td > * {
    justify-self: start;
  }

  .provider-hero__identity {
    display: grid;
  }

  .provider-contact-action {
    overflow: hidden;
  }
}

@media print {
  .provider-filter-panel,
  .provider-form-panel form,
  .provider-profile-panel form,
  .provider-communication-form-panel {
    display: none !important;
  }

  .provider-hero,
  .provider-table tr {
    box-shadow: none;
  }
}

/* Nebenkosten workbench --------------------------------------------------- */

.nebenkosten-heading {
  margin-bottom: 1.4rem;
}

.workbench-mode-badge {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.58rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workbench-mode-badge > span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.settlement-boundary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.4rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid rgb(15 114 143 / 22%);
  border-radius: var(--radius-md);
  background: linear-gradient(120deg, var(--brand-deep), #0b5266);
  box-shadow: var(--shadow-sm);
  color: white;
}

.settlement-boundary__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  background: rgb(255 255 255 / 10%);
  font-weight: 750;
}

.settlement-boundary h2 {
  margin-bottom: 0.3rem;
  color: white;
  font-size: 1rem;
  letter-spacing: 0;
}

.settlement-boundary p,
.settlement-boundary ul {
  color: rgb(255 255 255 / 80%);
  font-size: 0.84rem;
}

.settlement-boundary p {
  margin-bottom: 0;
}

.settlement-boundary ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.5rem;
  margin: 0.65rem 0 0;
  padding-left: 1.15rem;
}

.settlement-boundary--compact {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.settlement-boundary--compact .status-pill {
  border: 1px solid rgb(255 255 255 / 22%);
}

.nebenkosten-index-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.settlement-start-panel > p:not(.eyebrow),
.settlement-method-card .panel__header p:last-child,
.settlement-periods-panel .panel__header p:last-child,
.settlement-expenses .panel__header p:last-child,
.settlement-preview .panel__header p:last-child {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.settlement-start-panel .form-actions {
  margin-top: 1rem;
}

.settlement-method-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.settlement-method-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 1rem 1.3rem;
}

.settlement-method-list li + li {
  border-top: 1px solid var(--line);
}

.settlement-method-list li > span,
.form-step {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.66rem;
  font-weight: 850;
}

.settlement-method-list strong {
  display: block;
  color: var(--ink);
  font-size: 0.86rem;
}

.settlement-method-list p {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.settlement-periods-panel .panel__header,
.settlement-expenses .panel__header,
.settlement-preview .panel__header {
  align-items: flex-start;
}

.settlement-empty-state {
  padding: 2.4rem 1.4rem;
}

.settlement-period-table strong {
  color: var(--brand-deep);
}

.status-pill--draft,
.status-pill--provisional {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill--review,
.status-pill--reviewed,
.status-pill--confirmed,
.status-pill--ready {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill--excluded,
.status-pill--closed,
.status-pill--pending {
  background: var(--surface-muted);
  color: var(--ink-muted);
}

.settlement-hero {
  align-items: center;
  margin-bottom: 1.3rem;
}

.settlement-hero__meta {
  display: grid;
  gap: 0.55rem;
  justify-items: end;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.settlement-readiness {
  margin: 2rem 0 1.2rem;
}

.section-heading-inline {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.section-heading-inline h2,
.section-heading-inline p {
  margin-bottom: 0;
}

.section-heading-inline > p {
  max-width: 540px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  text-align: right;
}

.settlement-readiness-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.readiness-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  min-height: 112px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.readiness-card__icon {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.61rem;
  font-weight: 850;
}

.readiness-card > div {
  display: grid;
  min-width: 0;
}

.readiness-card > div > span {
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.readiness-card strong {
  margin-top: 0.15rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.readiness-card small {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.readiness-card--ready,
.readiness-card--complete {
  border-color: rgb(39 103 70 / 24%);
}

.readiness-card--ready .readiness-card__icon,
.readiness-card--complete .readiness-card__icon {
  background: var(--success-soft);
  color: var(--success);
}

.readiness-card--partial,
.readiness-card--provisional,
.readiness-card--missing {
  border-color: rgb(138 90 23 / 24%);
}

.readiness-card--partial .readiness-card__icon,
.readiness-card--provisional .readiness-card__icon,
.readiness-card--missing .readiness-card__icon {
  background: var(--warning-soft);
  color: var(--warning);
}

.readiness-card--locked {
  border-style: dashed;
  background: #fafbfb;
}

.settlement-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.2rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settlement-metrics article {
  display: grid;
  min-width: 0;
  padding: 1rem 1.15rem;
}

.settlement-metrics article + article {
  border-left: 1px solid var(--line);
}

.settlement-metrics span {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settlement-metrics strong {
  margin-top: 0.25rem;
  color: var(--brand-deep);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.settlement-metrics small {
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.67rem;
}

.settlement-metric--muted {
  background: #fafbfb;
}

.settlement-metric--muted strong {
  color: var(--ink-muted);
}

.settlement-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
}

.settlement-workspace-main,
.settlement-workspace-sidebar {
  display: grid;
  width: 100%;
  gap: 1.2rem;
  min-width: 0;
}

.settlement-expenses,
.settlement-preview,
.settlement-expense-table-wrap {
  width: 100%;
  min-width: 0;
}

.settlement-expense-table {
  width: 100%;
  min-width: 1080px;
}

.settlement-expense-table th,
.settlement-expense-table td {
  padding-right: 0.9rem;
  padding-left: 0.9rem;
}

.settlement-expense-table th:nth-child(3),
.settlement-expense-table td:nth-child(3),
.settlement-expense-table th:nth-child(4),
.settlement-expense-table td:nth-child(4),
.settlement-expense-table th:nth-child(5),
.settlement-expense-table td:nth-child(5) {
  white-space: nowrap;
}

.settlement-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.settlement-expense-row--excluded {
  background: #fafbfb;
  color: var(--ink-muted);
}

.settlement-expense-row--excluded th,
.settlement-expense-row--excluded td:not(:last-child) {
  text-decoration-color: rgb(98 117 124 / 35%);
}

.expense-status-form {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-top: 0.45rem;
}

.expense-status-form select {
  min-width: 0;
  max-width: 8.5rem;
  padding: 0.32rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  font-size: 0.68rem;
}

.workbench-form-card {
  overflow: visible;
}

.workbench-form-card summary {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.workbench-form-card summary::-webkit-details-marker {
  display: none;
}

.workbench-form-card summary::after {
  color: var(--brand);
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
}

.workbench-form-card[open] summary::after {
  content: "−";
}

.workbench-form-card summary > span {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 750;
}

.workbench-form-card summary > small {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 500;
}

.workbench-form-card[open] summary {
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.workbench-form-card form {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.workbench-form-card .form-grid {
  gap: 0.65rem;
}

.workbench-form-card .field label,
.service-period-fieldset legend {
  font-size: 0.7rem;
}

.workbench-form-card .field input,
.workbench-form-card .field select,
.workbench-form-card .field textarea {
  padding: 0.62rem 0.7rem;
  font-size: 0.78rem;
}

.money-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: white;
}

.money-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(15 114 143 / 12%);
}

.money-input input {
  min-width: 0;
  border: 0 !important;
  box-shadow: none !important;
}

.money-input span {
  display: grid;
  padding: 0 0.65rem;
  place-items: center;
  border-left: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.service-period-fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  padding: 0;
  border: 0;
}

.service-period-fieldset legend {
  grid-column: 1 / -1;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-weight: 750;
}

.service-period-fieldset .form-grid {
  grid-column: 1 / -1;
  width: 100%;
}

.choice-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafcfc;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.choice-card input {
  margin-top: 0.2rem;
  accent-color: var(--brand);
}

.choice-card span {
  display: grid;
}

.choice-card strong {
  font-size: 0.68rem;
}

.choice-card small {
  margin-top: 0.14rem;
  color: var(--ink-muted);
  font-size: 0.61rem;
  line-height: 1.35;
}

.checkbox-row--assumption {
  align-items: start;
  padding: 0.7rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fafcfc;
}

.checkbox-row--assumption span {
  display: grid;
}

.checkbox-row--assumption strong {
  font-size: 0.72rem;
}

.checkbox-row--assumption small {
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.64rem;
}

.form-assurance {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.64rem;
}

.fixed-period-note {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.fixed-period-note strong {
  color: var(--brand-deep);
}

.form-assurance span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
}

.inline-guidance {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.inline-guidance--warning {
  border-color: rgb(138 90 23 / 22%);
  background: var(--warning-soft);
}

.inline-guidance strong {
  display: block;
  font-size: 0.8rem;
}

.inline-guidance p {
  margin: 0.25rem 0 0.5rem;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

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

.rule-register-list > li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.rule-register-list > li + li {
  border-top: 1px solid var(--line);
}

.rule-register-list li > div:first-child {
  display: grid;
  min-width: 0;
}

.rule-register-list strong {
  font-size: 0.78rem;
}

.rule-register-list small {
  overflow: hidden;
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rule-register__review {
  display: grid;
  flex: 0 0 auto;
  gap: 0.25rem;
  justify-items: end;
}

.rule-register__review form {
  margin: 0;
}

.rule-register__review .button {
  min-height: auto;
  padding: 0.2rem 0;
  font-size: 0.62rem;
}

.settlement-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: #fafcfc;
}

.settlement-preview-meta > div {
  display: grid;
  min-width: 150px;
  padding-right: 1rem;
}

.settlement-preview-meta > div + div {
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.settlement-preview-meta span:not(.status-pill) {
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.settlement-preview-meta strong {
  margin-top: 0.1rem;
  color: var(--ink);
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

.settlement-preview-meta > .status-pill {
  margin-left: auto;
}

.version-chip {
  display: inline-flex;
  padding: 0.34rem 0.58rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.68rem;
  font-weight: 800;
}

.allocation-breakdown {
  display: grid;
  gap: 0.25rem;
  max-width: 430px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.allocation-breakdown li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  color: var(--ink-muted);
  font-size: 0.72rem;
}

.allocation-breakdown strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.allocation-total,
.settlement-result-table tfoot td {
  color: var(--brand-deep);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.settlement-result-table tfoot th,
.settlement-result-table tfoot td {
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
  background: var(--brand-soft);
}

.settlement-preview-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 170px;
  padding: 2rem;
}

.settlement-preview-empty > span {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.35rem;
}

.settlement-preview-empty h3 {
  margin-bottom: 0.3rem;
}

.settlement-preview-empty p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.settlement-preview__footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--line);
  background: #fafcfc;
}

.settlement-preview__footer > p {
  max-width: 570px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.settlement-preview__footer form {
  display: grid;
  flex: 0 0 auto;
  gap: 0.3rem;
  justify-items: end;
}

.settlement-preview__footer small {
  max-width: 240px;
  color: var(--warning);
  font-size: 0.62rem;
  text-align: right;
}

@media (max-width: 1120px) {
  .settlement-readiness-grid,
  .settlement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settlement-metrics article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .settlement-metrics article:nth-child(4) {
    border-top: 1px solid var(--line);
  }

}

@media (max-width: 920px) {
  .nebenkosten-index-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .settlement-boundary--compact {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .settlement-boundary--compact .status-pill {
    grid-column: 2;
  }

  .section-heading-inline {
    display: grid;
    gap: 0.4rem;
  }

  .section-heading-inline > p {
    text-align: left;
  }

  .settlement-period-table-wrap,
  .settlement-expense-table-wrap,
  .settlement-result-table-wrap {
    overflow: visible;
  }

  .settlement-period-table-wrap .settlement-period-table,
  .settlement-expense-table-wrap .settlement-expense-table,
  .settlement-result-table-wrap .settlement-result-table {
    min-width: 0;
  }

  .settlement-period-table thead,
  .settlement-expense-table thead,
  .settlement-result-table thead {
    display: none;
  }

  .settlement-period-table tbody,
  .settlement-expense-table tbody,
  .settlement-result-table tbody {
    display: grid;
    gap: 0.7rem;
    padding: 0.75rem;
  }

  .settlement-period-table tbody tr,
  .settlement-expense-table tbody tr,
  .settlement-result-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
  }

  .settlement-period-table tbody th,
  .settlement-period-table tbody td,
  .settlement-expense-table tbody th,
  .settlement-expense-table tbody td,
  .settlement-result-table tbody th,
  .settlement-result-table tbody td {
    display: grid;
    gap: 0.25rem;
    align-content: start;
    padding: 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: right;
  }

  .settlement-period-table tbody th:nth-child(odd),
  .settlement-period-table tbody td:nth-child(odd),
  .settlement-expense-table tbody th:nth-child(odd),
  .settlement-expense-table tbody td:nth-child(odd),
  .settlement-result-table tbody th:nth-child(odd),
  .settlement-result-table tbody td:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .settlement-period-table tbody th::before,
  .settlement-period-table tbody td::before,
  .settlement-expense-table tbody th::before,
  .settlement-expense-table tbody td::before,
  .settlement-result-table tbody th::before,
  .settlement-result-table tbody td::before {
    color: var(--ink-muted);
    content: attr(data-label);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .settlement-period-table tbody th > *,
  .settlement-period-table tbody td > *,
  .settlement-expense-table tbody th > *,
  .settlement-expense-table tbody td > *,
  .settlement-result-table tbody th > *,
  .settlement-result-table tbody td > * {
    justify-self: end;
  }

  .settlement-expense-table tbody td:nth-child(2),
  .settlement-result-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
    border-right: 0;
    text-align: left;
  }

  .settlement-expense-table tbody td:nth-child(2) > *,
  .settlement-result-table tbody td:nth-child(2) > * {
    justify-self: stretch;
  }

  .settlement-expense-table tbody td:last-child {
    grid-column: 1 / -1;
    border-bottom: 0;
    border-right: 0;
  }

  .settlement-status-stack,
  .expense-status-form {
    justify-content: flex-end;
  }

  .settlement-result-table tfoot {
    display: table;
    width: calc(100% - 1.5rem);
    margin: 0 0.75rem 0.75rem;
  }
}

@media (max-width: 620px) {
  .nebenkosten-heading {
    gap: 0.8rem;
  }

  .workbench-mode-badge {
    width: fit-content;
  }

  .settlement-boundary {
    padding: 1rem;
  }

  .settlement-boundary ul {
    display: grid;
  }

  .settlement-readiness-grid,
  .settlement-metrics,
  .settlement-workspace-sidebar {
    grid-template-columns: 1fr;
  }

  .settlement-workspace-sidebar > :first-child,
  .settlement-workspace-sidebar > :last-child {
    grid-column: auto;
  }

  .settlement-metrics article + article,
  .settlement-metrics article:nth-child(3),
  .settlement-metrics article:nth-child(4) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .settlement-hero__meta {
    justify-items: start;
  }

  .settlement-preview-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .settlement-preview-meta > div {
    min-width: 0;
    padding: 0;
  }

  .settlement-preview-meta > div + div {
    padding: 0;
    border-left: 0;
  }

  .settlement-preview-meta > .status-pill {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .settlement-preview__footer {
    display: grid;
  }

  .settlement-preview__footer form,
  .settlement-preview__footer .button {
    width: 100%;
    justify-items: stretch;
  }

  .settlement-preview__footer small {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 460px) {
  .settlement-boundary,
  .settlement-boundary--compact {
    grid-template-columns: 1fr;
  }

  .settlement-boundary__mark {
    display: none;
  }

  .settlement-boundary--compact .status-pill {
    grid-column: auto;
  }

  .service-period-fieldset,
  .service-period-fieldset .form-grid,
  .settlement-period-table tbody tr,
  .settlement-expense-table tbody tr,
  .settlement-result-table tbody tr {
    grid-template-columns: 1fr;
  }

  .settlement-period-table tbody th,
  .settlement-period-table tbody td,
  .settlement-expense-table tbody th,
  .settlement-expense-table tbody td,
  .settlement-result-table tbody th,
  .settlement-result-table tbody td,
  .settlement-period-table tbody th:nth-child(odd),
  .settlement-period-table tbody td:nth-child(odd),
  .settlement-expense-table tbody th:nth-child(odd),
  .settlement-expense-table tbody td:nth-child(odd),
  .settlement-result-table tbody th:nth-child(odd),
  .settlement-result-table tbody td:nth-child(odd) {
    grid-column: auto;
    border-right: 0;
    text-align: left;
  }

  .settlement-period-table tbody th > *,
  .settlement-period-table tbody td > *,
  .settlement-expense-table tbody th > *,
  .settlement-expense-table tbody td > *,
  .settlement-result-table tbody th > *,
  .settlement-result-table tbody td > * {
    justify-self: start;
  }

  .settlement-status-stack,
  .expense-status-form {
    justify-content: flex-start;
  }

  .workbench-form-card summary > small {
    display: none;
  }
}

@media print {
  .settlement-workspace-sidebar,
  .settlement-preview__footer form,
  .expense-status-form,
  .rule-register__review form {
    display: none !important;
  }

  .settlement-boundary {
    border: 1px solid #999;
    background: white;
    box-shadow: none;
    color: #222;
  }

  .settlement-boundary h2,
  .settlement-boundary p,
  .settlement-boundary ul {
    color: #222;
  }
}

/* Controlled communications workflow ------------------------------------- */

.communication-directory-heading,
.communication-form-heading {
  align-items: center;
}

.communication-readonly-notice,
.communication-outcome-warning,
.communication-transport-note {
  margin-bottom: 1rem;
}

.communication-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.communication-metric {
  display: grid;
  min-width: 0;
  min-height: 5.7rem;
  align-content: space-between;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
}

.communication-metric:hover,
.communication-metric--selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.communication-metric--pending {
  border-top-color: var(--warning);
}

.communication-metric--approved,
.communication-metric--sent {
  border-top-color: var(--success);
}

.communication-metric--received {
  border-top-color: var(--info);
}

.communication-metric--failed {
  border-top-color: var(--danger);
}

.communication-metric span {
  overflow-wrap: anywhere;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.2;
}

.communication-metric strong {
  color: inherit;
  font-size: 1.65rem;
  font-weight: 650;
  line-height: 1;
}

.communication-filter-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
}

.communication-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(150px, 0.72fr));
  gap: 0.8rem;
  align-items: end;
}

.communication-filter-form__search {
  grid-column: span 2;
}

.communication-filter-form__actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: flex-end;
}

.communication-inbox .panel__header > div,
.communication-actions-panel .panel__header > div,
.communication-timeline-panel .panel__header > div {
  min-width: 0;
}

.communication-inbox .panel__header p:last-child,
.communication-actions-panel .panel__header p:last-child,
.communication-timeline-panel .panel__header p:last-child {
  max-width: 720px;
  margin: 0.28rem 0 0;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.communication-inbox-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.communication-inbox-list > li + li {
  border-top: 1px solid var(--line);
}

.communication-inbox-card {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(138px, 0.28fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 1.25rem;
  background: var(--surface);
}

.communication-inbox-card:hover {
  background: #f9fbfb;
}

.communication-inbox-card--failed {
  box-shadow: inset 3px 0 var(--danger);
}

.communication-inbox-card__state {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
}

.communication-status,
.communication-direction,
.communication-authorization-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 0.34rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.2;
}

.communication-status--pending_approval {
  background: var(--warning-soft);
  color: var(--warning);
}

.communication-status--approved,
.communication-status--sent {
  background: var(--success-soft);
  color: var(--success);
}

.communication-status--received,
.communication-direction--inbound {
  background: var(--info-soft);
  color: var(--info);
}

.communication-status--failed,
.communication-status--delivery_unknown {
  background: var(--danger-soft);
  color: var(--danger);
}

.communication-status--cancelled {
  text-decoration: line-through;
}

.communication-direction--outbound {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
}

.communication-inbox-card__content {
  min-width: 0;
}

.communication-inbox-card__recipient {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.69rem;
}

.communication-inbox-card__recipient > span {
  font-weight: 750;
}

.communication-inbox-card__recipient a {
  font-weight: 700;
  text-decoration: none;
}

.communication-inbox-card h3 {
  margin-bottom: 0.45rem;
}

.communication-inbox-card h3 a {
  color: var(--ink);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.communication-inbox-card h3 a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.communication-inbox-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0;
}

.communication-inbox-card__meta > div {
  display: flex;
  min-width: 0;
  gap: 0.3rem;
  align-items: baseline;
  font-size: 0.67rem;
}

.communication-inbox-card__meta dt {
  color: var(--ink-muted);
  font-weight: 650;
}

.communication-inbox-card__meta dd {
  margin: 0;
  font-weight: 700;
}

.communication-inbox-card__attention {
  width: fit-content;
  margin: 0.55rem 0 0;
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.67rem;
  font-weight: 700;
}

.communication-inbox-card__open {
  white-space: nowrap;
}

.communication-empty-state {
  min-height: 260px;
}

.communication-boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin-bottom: 1rem;
}

.communication-boundary {
  display: grid;
  min-width: 0;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--info);
}

.communication-boundary--warning {
  border-color: #e9cc97;
  border-left-color: var(--warning);
  background: var(--warning-soft);
  color: var(--warning);
}

.communication-boundary__mark,
.communication-capability__mark {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: 50%;
  background: currentColor;
  color: white;
  font-size: 0.72rem;
  font-weight: 850;
}

.communication-boundary h2 {
  margin-bottom: 0.25rem;
  color: inherit;
  font-size: 0.9rem;
}

.communication-boundary p,
.communication-boundary ul {
  margin: 0;
  font-size: 0.74rem;
}

.communication-boundary ul {
  display: grid;
  gap: 0.25rem;
  padding-left: 1rem;
}

.communication-form-panel {
  max-width: 1100px;
}

.communication-form-panel__body {
  padding: clamp(1.15rem, 3vw, 2rem);
}

.communication-form-section {
  display: grid;
  min-width: 0;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.communication-form-section + .communication-form-section {
  padding-top: 0.25rem;
}

.communication-form-section--last {
  padding-bottom: 0;
  border-bottom: 0;
}

.communication-form-section > header h2,
.communication-form-section > header p {
  margin-bottom: 0;
}

.communication-form-section > header p:last-child {
  max-width: 720px;
  margin-top: 0.28rem;
  color: var(--ink-muted);
  font-size: 0.76rem;
}

.communication-channel-advisories:empty {
  display: none;
}

.communication-channel-advisories .notice {
  margin: 0;
}

.communication-authorization-check {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #bdd8c8;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.72rem;
}

.communication-authorization-check--blocked {
  border-color: #e9cc97;
  background: var(--warning-soft);
  color: var(--warning);
}

.communication-authorization-check > span {
  font-weight: 650;
}

.communication-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.communication-form-actions > div {
  display: grid;
  min-width: 0;
  margin-right: auto;
}

.communication-form-actions > div strong {
  font-size: 0.8rem;
}

.communication-form-actions > div small {
  max-width: 580px;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.communication-detail-hero {
  display: flex;
  min-width: 0;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 96% 8%, rgb(15 114 143 / 12%), transparent 30%),
    linear-gradient(135deg, var(--surface), #f8fbfb);
  box-shadow: var(--shadow-sm);
}

.communication-detail-hero > div:first-child {
  min-width: 0;
}

.communication-detail-hero h1 {
  max-width: 850px;
  overflow-wrap: anywhere;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
}

.communication-detail-hero__recipient {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  color: var(--ink-muted);
}

.communication-detail-hero__recipient > span {
  font-weight: 700;
}

.communication-detail-hero__recipient a {
  font-weight: 750;
  text-decoration: none;
}

.communication-detail-hero__state {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.communication-detail-grid,
.communication-content-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.communication-content-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.communication-metadata,
.communication-delivery-panel__body,
.communication-message,
.communication-links,
.communication-actions-panel__body {
  padding: 1.15rem 1.25rem;
}

.communication-metadata {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0;
}

.communication-metadata > div {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.communication-metadata dt,
.communication-authorization-result dt,
.communication-send-summary dt {
  color: var(--ink-muted);
  font-size: 0.66rem;
  font-weight: 750;
}

.communication-metadata dd {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.communication-capability {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  padding: 0.8rem;
  border: 1px solid #bdd8c8;
  border-radius: var(--radius-sm);
  background: var(--success-soft);
  color: var(--success);
}

.communication-capability--blocked {
  border-color: #e9cc97;
  background: var(--warning-soft);
  color: var(--warning);
}

.communication-capability--record-only {
  border-color: var(--line-strong);
  background: var(--info-soft);
  color: var(--info);
}

.communication-capability h3,
.communication-capability strong,
.communication-capability p {
  color: inherit;
}

.communication-capability p {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
}

.communication-authorization-result {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}

.communication-authorization-result > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
}

.communication-authorization-result dd,
.communication-send-summary dd {
  margin: 0;
}

.communication-authorization-status--granted,
.communication-authorization-status--not_required {
  background: var(--success-soft);
  color: var(--success);
}

.communication-authorization-status--missing,
.communication-authorization-status--revoked,
.communication-authorization-status--objected {
  background: var(--danger-soft);
  color: var(--danger);
}

.communication-message h3 {
  margin-bottom: 0.85rem;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
}

.communication-message__body {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.communication-message__redacted {
  display: block;
  padding: 0.8rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-style: normal;
}

.communication-links {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  list-style: none;
}

.communication-links li {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbfb;
}

.communication-links li > span {
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 750;
}

.communication-links a {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.communication-links-panel__empty {
  margin: 0;
  padding: 1.15rem 1.25rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.communication-actions-panel,
.communication-timeline-panel {
  margin-bottom: 1rem;
}

.communication-action-error {
  margin-bottom: 0.85rem;
}

.communication-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.communication-action-card {
  display: grid;
  min-width: 0;
  gap: 0.85rem;
  align-content: space-between;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f8fbfb;
}

.communication-action-card--danger {
  border-color: #e4bdb8;
  background: var(--danger-soft);
}

.communication-action-card--warning {
  grid-column: 1 / -1;
  border-color: #e9cc97;
  background: var(--warning-soft);
}

.communication-action-card--send {
  grid-column: 1 / -1;
  border-color: #bdd8c8;
  background: var(--success-soft);
}

.communication-action-card h3,
.communication-action-card p {
  margin-bottom: 0;
}

.communication-action-card p {
  margin-top: 0.25rem;
  color: var(--ink-muted);
  font-size: 0.73rem;
}

.communication-action-card form > .button,
.communication-action-card > form > .button {
  width: fit-content;
}

.communication-action-card details summary {
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #d59f99;
  border-radius: var(--radius-sm);
  background: white;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 750;
}

.communication-action-card details[open] summary {
  margin-bottom: 0.75rem;
}

.button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: white;
}

.button--danger:hover {
  border-color: #74251e;
  background: #74251e;
  color: white;
}

.communication-send-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0;
}

.communication-send-summary > div {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgb(39 103 70 / 24%);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 70%);
}

.communication-send-summary dd {
  margin-top: 0.15rem;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  font-weight: 700;
}

.communication-send-confirmation {
  display: flex;
  min-height: 44px;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem;
  border: 1px solid rgb(39 103 70 / 30%);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 650;
}

.communication-send-confirmation--invalid {
  border-color: var(--danger);
  color: var(--danger);
}

.communication-send-confirmation input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin: 0.1rem 0 0;
  accent-color: var(--brand);
}

.communication-timeline-safety {
  margin: 0;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.communication-audit-timeline {
  display: grid;
  margin: 0;
  padding: 1.2rem 1.25rem 1.2rem 2rem;
  list-style: none;
}

.communication-audit-timeline > li {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 1rem minmax(0, 1fr);
  gap: 0.8rem;
  padding-bottom: 1.15rem;
}

.communication-audit-timeline > li:not(:last-child)::before {
  position: absolute;
  top: 0.95rem;
  bottom: -0.05rem;
  left: 0.43rem;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.communication-audit-timeline__dot {
  z-index: 1;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.18rem;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 1px var(--brand);
}

.communication-audit-timeline article,
.communication-audit-timeline article header {
  min-width: 0;
}

.communication-audit-timeline article header {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  justify-content: space-between;
}

.communication-audit-timeline h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.communication-audit-timeline time,
.communication-audit-timeline__actor {
  color: var(--ink-muted);
  font-size: 0.67rem;
}

.communication-audit-timeline time {
  flex: 0 0 auto;
}

.communication-audit-timeline__transition {
  width: fit-content;
  margin: 0.35rem 0 0;
  padding: 0.25rem 0.42rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 0.68rem;
  font-weight: 700;
}

.communication-audit-timeline__actor {
  margin: 0.3rem 0 0;
}

@media (max-width: 1100px) {
  .communication-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .communication-filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .communication-filter-form__search {
    grid-column: span 2;
  }

  .communication-filter-form__actions {
    justify-content: flex-start;
  }

  .communication-detail-grid,
  .communication-content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .communication-inbox-card {
    grid-template-columns: minmax(120px, 0.3fr) minmax(0, 1fr);
  }

  .communication-inbox-card__open {
    grid-column: 2;
    justify-self: start;
  }

  .communication-boundary-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .communication-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .communication-filter-form__search {
    grid-column: 1 / -1;
  }

  .communication-filter-form__actions {
    grid-column: 1 / -1;
  }

  .communication-recipient-grid,
  .communication-form-section .form-grid--3,
  .communication-action-grid {
    grid-template-columns: 1fr;
  }

  .communication-action-card--send {
    grid-column: auto;
  }

  .communication-action-card--warning {
    grid-column: auto;
  }

  .communication-detail-hero {
    display: grid;
    align-items: start;
  }

  .communication-detail-hero__state {
    justify-content: flex-start;
  }

  .communication-form-actions {
    grid-template-columns: 1fr auto auto;
  }
}

@media (max-width: 620px) {
  .communication-directory-heading {
    align-items: stretch;
  }

  .communication-directory-heading .button,
  .communication-filter-form__actions,
  .communication-filter-form__actions .button {
    width: 100%;
  }

  .communication-filter-form,
  .communication-filter-form__actions,
  .communication-metadata,
  .communication-send-summary {
    grid-template-columns: 1fr;
  }

  .communication-filter-form__search,
  .communication-filter-form__actions {
    grid-column: auto;
  }

  .communication-filter-form__actions {
    display: grid;
  }

  .communication-inbox-card {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .communication-inbox-card__state {
    display: flex;
    flex-wrap: wrap;
  }

  .communication-inbox-card__open {
    grid-column: auto;
  }

  .communication-form-panel__body,
  .communication-metadata,
  .communication-delivery-panel__body,
  .communication-message,
  .communication-links,
  .communication-actions-panel__body,
  .communication-audit-timeline {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .communication-form-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .communication-form-actions > div {
    margin: 0 0 0.3rem;
  }

  .communication-form-actions .button,
  .communication-action-card form > .button,
  .communication-action-card > form > .button {
    width: 100%;
  }

  .communication-audit-timeline article header {
    display: grid;
    gap: 0.2rem;
  }
}

@media (max-width: 440px) {
  .communication-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .communication-boundary {
    grid-template-columns: 1fr;
  }

  .communication-detail-hero,
  .communication-inbox-card {
    padding: 0.9rem;
  }
}

@media (max-width: 390px) {
  .communication-metrics,
  .communication-filter-form,
  .communication-inbox-card,
  .communication-boundary-grid,
  .communication-detail-grid,
  .communication-content-grid,
  .communication-metadata,
  .communication-action-grid,
  .communication-send-summary {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .communication-inbox-card *,
  .communication-detail-hero *,
  .communication-message *,
  .communication-action-card *,
  .communication-metadata * {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

@media print {
  .communication-filter-panel,
  .communication-actions-panel,
  .communication-form-panel form,
  .communication-directory-heading > .button {
    display: none !important;
  }

  .communication-detail-hero,
  .communication-metric,
  .communication-inbox-card {
    box-shadow: none;
  }
}

/* Tenant-facing annual statement ----------------------------------------- */

.tenant-statement-page {
  background:
    radial-gradient(circle at 8% 2%, rgb(15 114 143 / 8%), transparent 27rem),
    var(--paper);
}

.tenant-statement-toolbar {
  display: flex;
  width: min(100%, 1080px);
  margin: 0 auto 1rem;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
}

.tenant-statement-sheet {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.6rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.tenant-statement-draft {
  display: flex;
  margin: calc(clamp(1.2rem, 3vw, 2.6rem) * -1) calc(clamp(1.2rem, 3vw, 2.6rem) * -1) 2rem;
  padding: 0.72rem clamp(1.2rem, 3vw, 2.6rem);
  gap: 0.35rem 1rem;
  align-items: baseline;
  justify-content: center;
  border-bottom: 1px solid rgb(138 90 23 / 24%);
  background: var(--warning-soft);
  color: var(--warning);
  text-align: center;
}

.tenant-statement-draft strong {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tenant-statement-draft span {
  font-size: 0.78rem;
}

.tenant-statement-draft--stale {
  border-color: rgb(154 51 41 / 30%);
  background: var(--danger-soft);
  color: var(--danger);
}

.tenant-statement-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.42fr);
  gap: clamp(1.3rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: 1.8rem;
  border-bottom: 2px solid var(--brand);
}

.tenant-statement-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tenant-statement-header h1 {
  max-width: 18ch;
  margin: 0 0 1.2rem;
  color: var(--brand-deep);
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  line-height: 1.05;
}

.tenant-statement-address {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.tenant-statement-address strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.tenant-statement-version,
.tenant-statement-parties dl,
.tenant-statement-notes dl {
  margin: 0;
}

.tenant-statement-version {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.tenant-statement-version > div {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.65rem 0.8rem;
}

.tenant-statement-version > div + div {
  border-top: 1px solid var(--line);
}

.tenant-statement-version dt,
.tenant-statement-parties dt,
.tenant-statement-notes dt {
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tenant-statement-version dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: right;
}

.tenant-statement-parties {
  margin: 1.8rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-soft), var(--surface) 72%);
}

.tenant-statement-parties > dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 2rem;
}

.tenant-statement-parties dd {
  margin: 0.14rem 0 0;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.tenant-statement-occupancy {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.tenant-statement-occupancy h3 {
  margin: 0 0 0.35rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tenant-statement-occupancy ul {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 0.35rem 1.4rem;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.8rem;
}

.tenant-statement-occupancy li span {
  margin-right: 0.35rem;
  color: var(--ink-muted);
}

.tenant-statement-summary {
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--brand-soft);
}

.tenant-statement-summary header h2,
.tenant-statement-annex h2,
.tenant-statement-notes h2 {
  margin: 0;
  color: var(--brand-deep);
}

.tenant-statement-summary header h2,
.tenant-statement-annex h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
}

.tenant-statement-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(220px, 1.15fr);
  margin-top: 1rem;
  gap: 0.75rem;
}

.tenant-statement-summary-grid > div {
  display: grid;
  min-height: 112px;
  padding: 1rem;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.tenant-statement-summary-grid span {
  color: var(--ink-muted);
  font-size: 0.74rem;
  font-weight: 650;
}

.tenant-statement-summary-grid strong {
  display: block;
  margin-top: 0.4rem;
  color: var(--brand-deep);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-variant-numeric: tabular-nums;
}

.tenant-statement-result {
  border-width: 2px !important;
}

.tenant-statement-result--additional_payment {
  border-color: rgb(154 51 41 / 35%) !important;
  background: var(--danger-soft) !important;
}

.tenant-statement-result--additional_payment strong {
  color: var(--danger);
}

.tenant-statement-result--credit {
  border-color: rgb(39 103 70 / 35%) !important;
  background: var(--success-soft) !important;
}

.tenant-statement-result--credit strong {
  color: var(--success);
}

.tenant-statement-result--balanced {
  border-color: var(--line-strong) !important;
}

.tenant-statement-result small {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.tenant-statement-equation {
  width: fit-content;
  margin: 0.9rem 0 0 auto;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.tenant-statement-owner-notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--brand);
  background: var(--surface-muted);
}

.tenant-statement-owner-notice strong {
  color: var(--brand-deep);
  font-size: 0.78rem;
}

.tenant-statement-owner-notice p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

.tenant-statement-annex {
  margin-top: 2.4rem;
}

.tenant-statement-annex > header {
  max-width: 72ch;
  margin-bottom: 1rem;
}

.tenant-statement-annex > header > p:last-child {
  margin: 0.45rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

.tenant-statement-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.tenant-statement-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.tenant-statement-table th,
.tenant-statement-table td {
  padding: 0.72rem 0.65rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.tenant-statement-table thead th {
  background: var(--brand-deep);
  color: white;
  font-size: 0.64rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.tenant-statement-table tbody tr:nth-child(even) {
  background: var(--surface-muted);
}

.tenant-statement-table tbody th {
  color: var(--brand-deep);
}

.tenant-statement-table small {
  display: block;
  margin-top: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
  font-weight: 450;
}

.tenant-statement-table .number-cell {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tenant-statement-ratio {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tenant-statement-share {
  color: var(--brand-deep);
  font-weight: 700;
}

.tenant-statement-table-total {
  display: flex;
  padding: 0.8rem 0.65rem;
  gap: 1rem;
  justify-content: space-between;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tenant-statement-table a {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.65rem;
}

.tenant-statement-empty {
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-muted);
}

.tenant-statement-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.5rem;
  gap: 0.8rem;
}

.tenant-statement-notes article {
  padding: 0.9rem 1rem;
  border-top: 2px solid var(--line-strong);
  background: var(--surface-muted);
}

.tenant-statement-notes h2 {
  font-size: 0.82rem;
}

.tenant-statement-notes p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.tenant-statement-notes dl {
  margin-top: 0.6rem;
}

.tenant-statement-notes dd {
  margin: 0.15rem 0 0;
}

.tenant-statement-notes code {
  color: var(--ink);
  font-size: 0.61rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.tenant-statement-draft-footer {
  margin: 1.6rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgb(138 90 23 / 25%);
  color: var(--warning);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

@media (max-width: 820px) {
  .tenant-statement-header,
  .tenant-statement-summary-grid {
    grid-template-columns: 1fr;
  }

  .tenant-statement-version {
    width: 100%;
  }

  .tenant-statement-summary-grid > div {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .tenant-statement-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tenant-statement-toolbar .button {
    width: 100%;
  }

  .tenant-statement-sheet {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .tenant-statement-draft {
    display: grid;
  }

  .tenant-statement-parties > dl,
  .tenant-statement-notes {
    grid-template-columns: 1fr;
  }

  .tenant-statement-header h1 {
    max-width: none;
  }
}

@page tenant-statement {
  size: A4 portrait;
  margin: 13mm;
}

@media print {
  html,
  body.tenant-statement-page {
    min-height: auto;
    background: white !important;
    color: #16323b;
    font-size: 9pt;
  }

  .tenant-statement-page .app-header,
  .tenant-statement-page .app-footer,
  .tenant-statement-page .public-language-switcher,
  .tenant-statement-page .skip-link,
  .tenant-statement-page .flash-stack,
  .tenant-statement-toolbar {
    display: none !important;
  }

  .tenant-statement-page .page-shell,
  .tenant-statement-page .public-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .tenant-statement-sheet {
    page: tenant-statement;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .tenant-statement-draft {
    margin: 0 0 7mm;
    padding: 2.5mm 4mm;
    border: 1px solid #8a5a17;
  }

  .tenant-statement-header,
  .tenant-statement-parties,
  .tenant-statement-summary,
  .tenant-statement-owner-notice,
  .tenant-statement-notes article,
  .tenant-statement-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tenant-statement-header {
    grid-template-columns: minmax(0, 1fr) 62mm;
    gap: 10mm;
  }

  .tenant-statement-header h1 {
    font-size: 21pt;
  }

  .tenant-statement-parties {
    margin: 7mm 0;
    padding: 4mm;
  }

  .tenant-statement-summary {
    padding: 4mm;
  }

  .tenant-statement-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(48mm, 1.15fr);
    gap: 2.5mm;
  }

  .tenant-statement-summary-grid > div {
    min-height: 25mm;
    padding: 3.5mm;
  }

  .tenant-statement-summary-grid strong {
    font-size: 14pt;
  }

  .tenant-statement-annex {
    margin-top: 0;
    break-before: page;
    page-break-before: always;
  }

  .tenant-statement-table-wrap {
    overflow: visible;
    border-color: #b7c8cd;
  }

  .tenant-statement-table {
    min-width: 0;
    font-size: 7pt;
  }

  .tenant-statement-table th,
  .tenant-statement-table td {
    padding: 2.2mm 1.7mm;
  }

  .tenant-statement-table thead th {
    background: #073b4a !important;
    color: white !important;
  }

  .tenant-statement-notes,
  .tenant-statement-summary-grid {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .tenant-statement-notes code {
    font-size: 5.8pt;
  }

  .tenant-statement-sheet,
  .tenant-statement-sheet * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
