:root {
  --purple: #7429d6;
  --purple-dark: #5b1aa8;
  --purple-soft: #f3f1f8;
  --ink: #111111;
  --muted: #625d6a;
  --line: #d8d4e0;
  --line-soft: #e9e6ee;
  --surface: #ffffff;
  --surface-soft: #f8f7fa;
  --success: #246b45;
  --warning: #9a5b0b;
  --danger: #9d2c36;
  --sidebar: #17141b;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--surface-soft);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--surface-soft);
}

body {
  min-height: 100vh;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(116, 41, 214, 0.24);
  outline-offset: 2px;
}

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

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(420px, 1.08fr);
  background: var(--surface);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 42px clamp(28px, 5vw, 76px);
  overflow: hidden;
  color: white;
  background: var(--sidebar);
}

.login-brand::before,
.login-brand::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 42px;
  right: -70px;
  background: var(--purple);
  transform: rotate(-42deg);
}

.login-brand::before {
  top: 18%;
}

.login-brand::after {
  bottom: 16%;
  width: 180px;
  opacity: 0.56;
}

.brand-home,
.brand-lockup {
  position: relative;
  z-index: 1;
  display: block;
  width: 176px;
  height: 46px;
}

.brand-lockup {
  overflow: hidden;
}

.brand-mark {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: transparent;
}

.brand-mark-light {
  filter: brightness(0) invert(1);
}

.brand-mark-color {
  clip-path: inset(0 72% 0 0);
  filter: brightness(0) saturate(100%) invert(24%) sepia(94%) saturate(4615%) hue-rotate(261deg) brightness(86%) contrast(96%);
}

.brand-message {
  position: relative;
  z-index: 1;
  max-width: 470px;
  padding: 70px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--purple);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.login-brand .eyebrow {
  color: #b996ed;
}

.brand-message h1 {
  max-width: 430px;
  margin: 0;
  font-size: clamp(2.45rem, 5vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.brand-message p:last-child {
  max-width: 420px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.7;
}

.login-brand small {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.46);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 48px 28px;
}

.login-form {
  width: min(430px, 100%);
}

.login-stack {
  width: min(430px, 100%);
}

.login-stack .login-form {
  width: 100%;
}

.login-form-secondary {
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.login-method-label {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-pin-form input {
  font-size: 1.25rem;
}

.login-form h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.login-copy {
  margin: 0 0 34px;
  color: var(--muted);
  line-height: 1.65;
}

.field {
  display: grid;
  gap: 9px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
}

.field input,
.field select {
  min-height: 48px;
  padding: 0 14px;
}

.field textarea {
  min-height: 120px;
  padding: 13px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--purple);
  outline: none;
}

.primary-button,
.secondary-button,
.quiet-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.primary-button {
  padding: 0 18px;
  background: var(--purple);
  color: white;
}

.primary-button:hover {
  background: var(--purple-dark);
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
}

.quiet-button {
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
}

.quiet-button:hover {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.icon-button {
  width: 38px;
  min-height: 38px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--purple);
  color: var(--purple);
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.login-form .primary-button {
  width: 100%;
  margin-top: 18px;
}

.form-note {
  display: flex;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.demo-button {
  width: 100%;
  margin-top: 12px;
}

.message-band {
  margin-top: 20px;
  padding: 14px 15px;
  border-left: 3px solid var(--purple);
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 0.86rem;
  line-height: 1.5;
}

.portal-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  background: var(--surface-soft);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px 20px 22px;
  color: white;
  background: var(--sidebar);
}

.sidebar-overlay {
  display: none;
}

.sidebar .brand-home,
.sidebar .brand-lockup {
  width: 156px;
  height: 41px;
  margin-left: 2px;
}

.nav-label {
  margin: 52px 12px 10px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-nav {
  display: grid;
  gap: 4px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.64);
  cursor: pointer;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nav-button.active {
  box-shadow: inset 3px 0 var(--purple);
}

.sidebar-profile {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-profile strong,
.sidebar-profile span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile strong {
  font-size: 0.86rem;
}

.sidebar-profile span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.72rem;
}

.sidebar-profile .quiet-button {
  margin: 12px 0 0 -12px;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-profile .admin-push-button {
  width: calc(100% + 12px);
  justify-content: flex-start;
  margin-bottom: -6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-profile .admin-push-button:hover {
  border-color: var(--purple);
  background: var(--purple);
  color: white;
}

.sidebar-profile .admin-push-button.push-enabled {
  color: #b9f6cc;
}

.sidebar-profile .admin-push-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.portal-main {
  min-width: 0;
  overflow: hidden;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 clamp(20px, 4vw, 52px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.96);
}

.breadcrumbs {
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.topbar-actions {
  display: flex;
  gap: 8px;
}

.menu-button {
  display: none;
}

.content {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 52px) 72px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.page-heading p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 28px;
  border: 1px solid var(--line-soft);
  background: white;
}

.summary-item {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line-soft);
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-item strong {
  display: block;
  margin-top: 7px;
  font-size: 1.45rem;
}

.service-budget {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-soft);
  background: white;
}

.service-budget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.service-budget-header .eyebrow {
  margin-bottom: 7px;
}

.service-budget-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.service-budget-header p:last-child {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.service-budget-package {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid #d8c6f1;
  border-radius: 4px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.service-budget-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
  border: 1px solid var(--line-soft);
}

.service-budget-stats > div {
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line-soft);
}

.service-budget-stats > div:last-child {
  border-right: 0;
}

.service-budget-stats span,
.service-budget-stats strong {
  display: block;
}

.service-budget-stats span {
  color: var(--muted);
  font-size: 0.69rem;
}

.service-budget-stats strong {
  margin-top: 5px;
  font-size: 1rem;
}

.service-budget-progress {
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 3px;
  background: #ece9f0;
}

.service-budget-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width 280ms ease;
}

.service-budget-client .service-budget-progress {
  height: 14px;
  margin-top: 24px;
}

.service-budget-client .service-budget-footer {
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
}

.service-budget-over .service-budget-progress span {
  background: var(--danger);
}

.service-budget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.7rem;
}

.service-budget-footer strong {
  color: var(--danger);
}

.service-budget-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.workspace {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: white;
}

.customer-dashboard-stack,
.admin-task-stack {
  display: grid;
  gap: 20px;
}

.project-roadmap {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line-soft);
  background: white;
}

.roadmap-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.roadmap-header .eyebrow {
  margin-bottom: 7px;
}

.roadmap-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.roadmap-phase {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid #d8c6f1;
  border-radius: 3px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 0.7rem;
  font-weight: 700;
}

.roadmap-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roadmap-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding-right: 20px;
}

.roadmap-step:not(:last-child)::after {
  position: absolute;
  top: 8px;
  right: 0;
  left: 18px;
  height: 1px;
  background: var(--line);
  content: "";
}

.roadmap-marker {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  border: 4px solid white;
  border-radius: 50%;
  background: #bbb6c2;
  box-shadow: 0 0 0 1px var(--line);
}

.roadmap-step-active .roadmap-marker {
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.roadmap-step-ongoing .roadmap-marker {
  background: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.roadmap-step-complete .roadmap-marker {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.roadmap-step > div {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding-right: 6px;
  background: white;
}

.roadmap-step span,
.roadmap-step strong,
.roadmap-step small {
  display: block;
}

.roadmap-step > div > span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.roadmap-step strong {
  margin-top: 5px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.roadmap-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.workspace-context {
  margin: 0 0 7px;
  color: var(--purple-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.filter-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.filter-button.active {
  border-color: var(--line);
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.document-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.document-table .col-document {
  width: 43%;
}

.document-table .col-status {
  width: 22%;
}

.document-table .col-category {
  width: 12%;
}

.document-table .col-date {
  width: 16%;
}

.document-table .col-actions {
  width: 7%;
}

.document-table th {
  padding: 12px 18px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.document-table td {
  padding: 17px 18px;
  border-top: 1px solid var(--line-soft);
  vertical-align: middle;
}

.document-table tbody tr {
  transition: background 120ms ease;
}

.document-table tbody tr:hover {
  background: #fbfaff;
}

.document-name {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.document-name > span:last-child {
  min-width: 0;
}

.file-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 42px;
  border: 1px solid #d9d2e5;
  border-radius: 3px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 0.65rem;
  font-weight: 800;
}

.document-name strong,
.document-name small {
  display: block;
}

.document-name strong {
  font-size: 0.85rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.document-name small {
  max-width: 100%;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.71rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-muted {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-wartet {
  color: var(--warning);
  background: #fff8e8;
}

.status-aenderung {
  color: var(--danger);
  background: #fff1f2;
}

.status-info {
  color: #315b77;
  background: #eef7fb;
}

.status-arbeitsstand {
  color: #62517a;
  background: #f4effa;
}

.status-freigegeben {
  color: var(--success);
  background: #edf8f1;
}

.status-archiv {
  color: #555b63;
  background: #f1f3f5;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--purple);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.section-header .eyebrow {
  margin-bottom: 7px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-header p:last-child {
  max-width: 660px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.task-list,
.compact-task-list {
  display: grid;
}

.grouped-task-list {
  display: grid;
}

.task-group {
  border-top: 1px solid var(--line-soft);
}

.task-group:first-child {
  border-top: 0;
}

.task-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  list-style: none;
  padding: 22px 22px 14px;
  background: var(--surface-soft);
  cursor: pointer;
}

.task-group-header::-webkit-details-marker {
  display: none;
}

.task-group-heading {
  display: grid;
  min-width: 0;
}

.task-group-heading .eyebrow {
  margin-bottom: 7px;
  font-size: 0.66rem;
}

.task-group-heading strong {
  font-size: 1rem;
}

.task-group-heading > span:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.task-group-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.task-group-count {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.task-group-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.task-group-toggle::before,
.task-group-toggle::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 1.5px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
}

.task-group-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
  transition: transform 160ms ease;
}

.task-group[open] .task-group-toggle::after {
  transform: translate(-50%, -50%) rotate(0);
}

.project-document-intro {
  background: var(--surface-soft);
}

.project-document-groups {
  display: grid;
}

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

.document-phase:first-child {
  border-top: 0;
}

.document-phase-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto 28px;
  align-items: center;
  gap: 16px;
  min-height: 92px;
  padding: 18px 22px;
  list-style: none;
  cursor: pointer;
}

.document-phase-header::-webkit-details-marker {
  display: none;
}

.document-phase-header:hover {
  background: #fbfaff;
}

.document-phase-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cbb8ec;
  border-radius: 3px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-size: 0.68rem;
  font-weight: 800;
}

.document-phase-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.document-phase-copy strong {
  font-size: 0.94rem;
}

.document-phase-copy small {
  max-width: 680px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.document-phase-status {
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
}

.document-phase[open] > .document-phase-header {
  background: #fbfaff;
}

.document-phase[open] .task-group-toggle::after {
  transform: translate(-50%, -50%) rotate(0);
}

.document-phase-body {
  border-top: 1px solid var(--line-soft);
}

.compact-empty-state {
  min-height: 130px;
  padding: 34px 22px;
}

.evidence-link-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.evidence-link {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}

.document-check-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.document-check-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.document-check-list li::before {
  position: absolute;
  top: 0.22em;
  left: 0;
  color: var(--success);
  content: "✓";
  font-weight: 800;
}

.drawer-status-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.task-row {
  display: grid;
  grid-template-columns: 138px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row[hidden] {
  display: none !important;
}

.task-copy {
  min-width: 0;
}

.task-copy h3 {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.task-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
}

.task-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 600;
}

.task-meta-item svg {
  width: 13px;
  height: 13px;
}

.task-owner-njume {
  color: var(--purple-dark);
}

.task-owner-client {
  color: #315b77;
}

.task-priority-hoch {
  color: var(--danger);
}

.task-time {
  color: var(--purple-dark);
}

.task-admin-actions,
.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

#admin-create-task,
#admin-create-document {
  flex: 0 0 auto;
  white-space: nowrap;
}

.task-admin-actions .secondary-button {
  min-height: 36px;
  padding: 0 11px;
  font-size: 0.72rem;
}

.task-state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.69rem;
  font-weight: 700;
}

.task-offen {
  color: var(--warning);
  background: #fff8e8;
}

.task-vorbereitung {
  color: #625d6a;
  background: #f3f2f4;
}

.task-laufend {
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.task-erledigt {
  color: var(--success);
  background: #edf8f1;
}

.task-question p,
.task-answer {
  margin: 0;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.task-answer {
  padding: 14px 15px;
  border-left: 3px solid var(--purple);
  background: var(--purple-soft);
}

.task-file-field {
  margin-top: 14px;
}

.admin-support-list {
  max-height: 420px;
  overflow-y: auto;
}

.admin-support-message {
  border-bottom: 1px solid var(--line-soft);
}

.admin-support-message:last-child {
  border-bottom: 0;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: start;
  gap: 28px;
}

.support-messages {
  display: grid;
  min-height: 260px;
}

.support-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  min-height: 260px;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.support-empty svg {
  width: 26px;
  height: 26px;
  color: var(--purple);
}

.support-empty p {
  max-width: 390px;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
}

.support-message {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.support-conversation {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.support-conversation:last-child {
  border-bottom: 0;
}

.conversation-head > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.conversation-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.64rem;
  font-weight: 700;
}

.status-open {
  color: var(--warning);
  background: #fff8e8;
}

.status-answered {
  color: var(--success);
  background: #edf8f1;
}

.status-unread {
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.status-read {
  color: var(--success);
  background: #edf8f1;
}

.status-sent {
  color: var(--muted);
  background: #f3f2f4;
}

.chat-thread {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.chat-message {
  width: min(88%, 620px);
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.chat-message-client {
  justify-self: start;
  background: var(--surface-soft);
}

.chat-message-admin {
  justify-self: end;
  border-color: #d8c6f1;
  background: var(--purple-soft);
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 0.68rem;
}

.chat-message-meta time {
  color: var(--muted);
}

.chat-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.reply-support {
  width: 100%;
}

.admin-support-reply {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.admin-support-reply textarea {
  min-height: 86px;
}

.admin-support-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 10px;
}

.admin-support-actions .primary-button,
.admin-support-actions .secondary-button {
  width: 100%;
}

@media (max-width: 640px) {
  .admin-support-actions {
    grid-template-columns: 1fr;
  }
}

.support-message:last-child {
  border-bottom: 0;
}

.support-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.support-type {
  color: var(--purple-dark);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.support-message time,
.support-message small {
  color: var(--muted);
  font-size: 0.7rem;
}

.support-message h3 {
  margin: 10px 0 5px;
  font-size: 0.9rem;
}

.support-message p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.support-message small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.support-message .quiet-button {
  min-height: 32px;
  margin-top: 10px;
  padding: 0;
}

.support-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.support-form .primary-button {
  width: 100%;
}

.support-image-field {
  min-height: 52px;
}

.support-image-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-helper {
  margin: -9px 0 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.support-task-links {
  display: grid;
  gap: 3px;
  padding: 18px 22px 22px;
  border-top: 1px solid var(--line-soft);
}

.support-task-links > p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.support-task-links .quiet-button {
  justify-content: flex-start;
  min-height: 36px;
  padding: 0;
  text-align: left;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 28px;
  border: 1px solid var(--line-soft);
  background: white;
}

.admin-metrics > div {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--line-soft);
}

.admin-metrics > div:last-child {
  border-right: 0;
}

.admin-metrics span,
.admin-metrics strong {
  display: block;
}

.admin-metrics span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.admin-metrics strong {
  margin-top: 8px;
  font-size: 1.5rem;
}

.admin-section-nav {
  position: sticky;
  z-index: 4;
  top: 84px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 20px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.97);
}

.admin-section-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-section-tab:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.admin-section-tab.active {
  border-color: #d8c6f1;
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.admin-section-tab svg {
  flex: 0 0 auto;
}

.admin-section-tab > span:not(.admin-tab-count) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tab-label-mobile {
  display: none;
}

.admin-tab-count {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: white;
  color: var(--muted);
  font-size: 0.66rem;
}

.admin-section-tab.active .admin-tab-count {
  background: var(--purple);
  color: white;
}

.admin-view-panel {
  margin-bottom: 0;
}

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

.admin-search-field {
  width: min(420px, 100%);
}

.admin-search-field input {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
}

.admin-search-field input:focus {
  border-color: var(--purple);
  outline: none;
}

.admin-view-panel .compact-task-list {
  max-height: min(64vh, 760px);
  overflow-y: auto;
}

.admin-chat-panel .admin-support-list {
  min-height: 220px;
  max-height: min(64vh, 760px);
}

.admin-feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-feedback-grid .workspace {
  min-width: 0;
}

.admin-client-button {
  align-items: flex-start;
  min-height: 58px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.admin-client-button > span {
  min-width: 0;
}

.admin-client-button > .nav-count {
  flex: 0 0 22px;
  align-self: center;
  min-width: 22px;
  margin-left: auto;
}

.admin-client-button strong,
.admin-client-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-client-button strong {
  color: inherit;
  font-size: 0.8rem;
}

.admin-client-button small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.68rem;
}

.admin-todos,
.admin-communication-grid {
  margin-bottom: 28px;
}

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

.admin-communication-grid .workspace {
  min-width: 0;
}

.admin-support-workspace {
  grid-column: 1 / -1;
}

.admin-empty {
  min-height: 132px;
  display: grid;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: center;
}

.admin-documents {
  margin-top: 0;
}

.admin-clients {
  margin-bottom: 28px;
}

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

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.78rem;
  text-align: left;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.client-name strong,
.client-name small {
  display: block;
}

.client-name small {
  max-width: 280px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
}

.compact-task-list .task-row {
  grid-template-columns: 112px minmax(0, 1fr);
}

.compact-task-list .task-row .secondary-button {
  grid-column: 2;
  justify-self: start;
}

.compact-task-list .task-admin-actions {
  grid-column: 2;
}

.activity-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.activity-row strong {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
}

.activity-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.admin-inbox-list {
  display: grid;
}

.activity-entry {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.activity-entry:last-child {
  border-bottom: 0;
}

.activity-entry-new {
  background: #fbf8ff;
  box-shadow: inset 3px 0 0 var(--purple);
}

.activity-symbol {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
}

.activity-symbol svg {
  width: 17px;
  height: 17px;
}

.activity-symbol-support {
  color: var(--purple-dark);
  background: var(--purple-soft);
}

.activity-entry-copy {
  min-width: 0;
}

.activity-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.activity-entry-head span,
.activity-entry-head time,
.activity-entry-copy small {
  color: var(--muted);
  font-size: 0.66rem;
}

.activity-entry-head span {
  color: var(--purple-dark);
  font-weight: 700;
  text-transform: uppercase;
}

.activity-entry-copy > strong {
  display: block;
  margin-top: 5px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.activity-entry-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.activity-entry-copy small {
  display: block;
  margin-top: 7px;
}

.activity-entry > .quiet-button {
  align-self: center;
  min-height: 34px;
}

.empty-state {
  padding: 62px 24px;
  color: var(--muted);
  text-align: center;
}

.mobile-documents {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 17, 17, 0.38);
}

.drawer {
  width: min(520px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 28px;
  background: white;
  box-shadow: -12px 0 38px rgba(0, 0, 0, 0.16);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-header h2 {
  margin: 5px 0 0;
  font-size: 1.4rem;
  line-height: 1.25;
}

.drawer-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
}

.drawer-section h3 {
  margin: 0 0 15px;
  font-size: 0.85rem;
}

.meta-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px 18px;
  margin: 0;
  font-size: 0.82rem;
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  margin: 0;
  font-weight: 600;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.drawer-actions .primary-button,
.drawer-actions .secondary-button {
  width: 100%;
}

.approve-button {
  min-height: 56px;
  border-color: var(--success);
  background: #f7fcf9;
  color: var(--success);
  font-size: 0.92rem;
  font-weight: 700;
}

.approve-button:hover {
  border-color: #174a2f;
  background: #edf8f1;
  color: #174a2f;
}

.drawer-download {
  width: 100%;
}

.drawer-form {
  display: grid;
  gap: 16px;
  padding: 24px 0;
}

.drawer-form > .primary-button {
  width: 100%;
  min-height: 50px;
}

.document-admin-status {
  display: grid;
  gap: 14px;
}

.document-admin-status .primary-button {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-size: 0.8rem;
  font-weight: 600;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.comment-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.comment {
  padding: 13px 14px;
  border-left: 3px solid var(--purple);
  background: var(--surface-soft);
}

.comment strong,
.comment time {
  font-size: 0.72rem;
}

.comment time {
  margin-left: 8px;
  color: var(--muted);
}

.comment p {
  margin: 8px 0 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.comment-attachment {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

#comment-form {
  display: grid;
  gap: 14px;
}

#comment-form .primary-button {
  width: 100%;
}

.comment-image-field {
  min-height: 50px;
}

.comment-image-field span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
}

.file-field:hover {
  border-color: var(--purple);
  color: var(--purple-dark);
}

.file-field input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 13px 16px;
  border-left: 4px solid var(--purple);
  background: #17141b;
  color: white;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.contract-overview {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(170px, 0.75fr) minmax(300px, 1.6fr);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.contract-overview-cancellable {
  grid-template-columns:
    repeat(3, minmax(140px, 0.55fr))
    minmax(300px, 1.6fr);
}

.contract-fact,
.contract-action {
  min-width: 0;
  padding: 20px 22px;
}

.contract-fact {
  border-right: 1px solid var(--line-soft);
}

.contract-fact span,
.contract-fact strong {
  display: block;
}

.contract-fact span {
  color: var(--muted);
  font-size: 0.7rem;
}

.contract-fact strong {
  margin-top: 6px;
  font-size: 0.95rem;
}

.contract-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.contract-action p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.cancellation-button {
  flex: 0 0 auto;
  border-color: rgba(157, 44, 54, 0.45);
  color: var(--danger);
}

.cancellation-button:hover {
  border-color: var(--danger);
  background: #fff7f7;
  color: #771d27;
}

.cancellation-confirm {
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
}

.cancellation-submit {
  min-height: 52px;
  border: 1px solid var(--danger);
  border-radius: 4px;
  background: var(--danger);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

.cancellation-submit:hover {
  border-color: #771d27;
  background: #771d27;
}

.cancellation-submit:disabled {
  cursor: wait;
  opacity: 0.6;
}

@media (max-width: 1320px) {
  .document-table th:nth-child(3),
  .document-table td:nth-child(3),
  .document-table .col-category {
    display: none;
  }

  .document-table .col-document {
    width: 51%;
  }

  .document-table .col-status {
    width: 24%;
  }

  .document-table .col-date {
    width: 17%;
  }

  .document-table .col-actions {
    width: 8%;
  }
}

@media (max-width: 1120px) {
  .contract-overview-cancellable {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contract-overview-cancellable .contract-action {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-soft);
  }

  .document-table th:nth-child(4),
  .document-table td:nth-child(4),
  .document-table .col-date {
    display: none;
  }

  .document-table .col-document {
    width: 62%;
  }

  .document-table .col-status {
    width: 28%;
  }

  .document-table .col-actions {
    width: 10%;
  }

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

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

  .task-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .task-row .secondary-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 1020px) {
  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-item:nth-child(3) {
    border-right: 0;
  }

  .summary-item:nth-child(n + 4) {
    border-top: 1px solid var(--line-soft);
  }

  .document-table th:nth-child(3),
  .document-table td:nth-child(3) {
    display: none;
  }

  .admin-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .admin-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .admin-metrics > div:nth-child(n + 3) {
    border-top: 1px solid var(--line-soft);
  }

  .admin-communication-grid {
    grid-template-columns: 1fr;
  }

  .admin-feedback-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .contract-overview {
    grid-template-columns: 1fr 1fr;
  }

  .contract-fact:nth-child(2) {
    border-right: 0;
  }

  .contract-fact:nth-child(n + 3) {
    border-top: 1px solid var(--line-soft);
  }

  .contract-action {
    grid-column: 1 / -1;
    align-items: stretch;
    flex-direction: column;
    border-top: 1px solid var(--line-soft);
  }

  .contract-action .secondary-button {
    width: 100%;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 330px;
    padding: 28px 24px;
  }

  .brand-message {
    padding: 58px 0 18px;
  }

  .brand-message h1 {
    max-width: 360px;
    font-size: 2.7rem;
  }

  .brand-message p:last-child,
  .login-brand small {
    display: none;
  }

  .login-panel {
    min-height: auto;
    padding: 48px 24px 68px;
  }

  .portal-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(286px, calc(100vw - 44px));
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(17, 17, 17, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-button {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .topbar-actions {
    min-width: 0;
    align-items: center;
  }

  .breadcrumbs {
    font-size: 0.76rem;
  }

  .content {
    padding: 28px 16px 52px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .page-heading h1 {
    font-size: 2rem;
  }

  .page-heading p:last-child {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .summary-strip,
  .admin-metrics,
  .admin-todos,
  .admin-communication-grid {
    margin-bottom: 20px;
  }

  .admin-section-nav {
    top: 72px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
    margin-bottom: 16px;
    overflow: visible;
  }

  .admin-section-tab {
    min-width: 0;
    padding: 0 8px;
  }

  .admin-tab-label-desktop {
    display: none;
  }

  .admin-tab-label-mobile {
    display: inline;
  }

  .admin-panel-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
  }

  .admin-search-field {
    width: 100%;
  }

  .admin-panel-toolbar .table-muted {
    white-space: normal;
  }

  .admin-view-panel .compact-task-list,
  .admin-chat-panel .admin-support-list {
    max-height: none;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-item,
  .summary-item:nth-child(3) {
    border-right: 1px solid var(--line-soft);
    border-top: 1px solid var(--line-soft);
  }

  .summary-item:nth-child(-n + 2) {
    border-top: 0;
  }

  .summary-item:nth-child(2n) {
    border-right: 0;
  }

  .summary-item,
  .admin-metrics > div {
    padding: 15px 16px;
  }

  .service-budget {
    padding: 18px;
  }

  .service-budget-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .service-budget-package {
    width: 100%;
    white-space: normal;
  }

  .service-budget-stats {
    grid-template-columns: 1fr;
  }

  .service-budget-stats > div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .service-budget-stats > div:last-child {
    border-bottom: 0;
  }

  .service-budget-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .section-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .section-header > .secondary-button,
  .section-header > .primary-button {
    width: 100%;
  }

  .project-roadmap {
    padding: 18px;
  }

  .roadmap-header {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .roadmap-steps {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .roadmap-step {
    padding: 0 0 0 2px;
  }

  .roadmap-step:not(:last-child)::after {
    top: 16px;
    right: auto;
    bottom: -16px;
    left: 10px;
    width: 1px;
    height: auto;
  }

  .roadmap-step > div {
    padding: 0 0 2px;
  }

  .workspace-toolbar {
    padding: 14px 16px;
  }

  .document-table {
    display: none;
  }

  .mobile-documents {
    display: grid;
  }

  .mobile-document {
    padding: 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .mobile-document:last-child {
    border-bottom: 0;
  }

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

  .mobile-document h3 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
  }

  .mobile-document p {
    margin: 8px 0 15px;
    color: var(--muted);
    font-size: 0.74rem;
  }

  .mobile-document .secondary-button {
    width: 100%;
  }

  .mobile-document-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .task-row,
  .compact-task-list .task-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 18px;
  }

  .task-row .secondary-button,
  .compact-task-list .task-row .secondary-button {
    grid-column: auto;
    width: 100%;
  }

  .task-admin-actions,
  .section-actions {
    width: 100%;
  }

  .task-admin-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-admin-actions .secondary-button:only-child {
    grid-column: 1 / -1;
  }

  .section-actions .secondary-button {
    width: 100%;
  }

  .task-group-header {
    padding: 19px 18px 14px;
  }

  .task-group-controls {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .document-phase-header {
    grid-template-columns: auto minmax(0, 1fr) 28px;
    gap: 12px;
    min-height: 0;
    padding: 17px 16px;
  }

  .document-phase-index {
    min-width: 66px;
  }

  .document-phase-copy small {
    display: none;
  }

  .document-phase-status {
    grid-column: 2;
    white-space: normal;
  }

  .document-phase-header > .task-group-toggle {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .support-form {
    padding: 18px;
  }

  .support-empty {
    min-height: 210px;
    padding: 28px 18px;
  }

  .support-conversation {
    padding: 16px;
  }

  .support-message-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .chat-message {
    width: 100%;
  }

  .chat-message-meta {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-support-list {
    max-height: none;
  }

  .activity-row {
    grid-template-columns: 74px minmax(0, 1fr);
    padding: 15px 16px;
  }

  .activity-entry {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 16px;
  }

  .activity-entry > .quiet-button {
    grid-column: 2;
    justify-self: start;
    padding: 0;
  }

  .empty-state {
    padding: 42px 18px;
  }

  .drawer {
    width: 100%;
    height: 100dvh;
    padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
  }

  .drawer-header {
    gap: 14px;
  }

  .drawer-header > div {
    min-width: 0;
  }

  .drawer-header h2 {
    font-size: 1.18rem;
    overflow-wrap: anywhere;
  }

  .drawer-header .icon-button {
    flex: 0 0 auto;
  }

  .drawer-section,
  .drawer-form {
    padding: 20px 0;
  }

  .meta-list dd,
  .comment p,
  .comment-attachment {
    overflow-wrap: anywhere;
  }

  .toast {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .contract-overview {
    grid-template-columns: 1fr;
  }

  .contract-fact {
    border-right: 0;
  }

  .contract-fact:nth-child(2),
  .contract-action {
    grid-column: auto;
    border-top: 1px solid var(--line-soft);
  }

  .topbar .secondary-button {
    display: none;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-item,
  .summary-item:nth-child(3) {
    border-right: 1px solid var(--line-soft);
    border-top: 1px solid var(--line-soft);
  }

  .summary-item:nth-child(-n + 2) {
    border-top: 0;
  }

  .summary-item:nth-child(2n) {
    border-right: 0;
  }

  .workspace-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .filter-button {
    width: 100%;
    min-width: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }

  .drawer {
    padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
  }

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

  .mobile-document-actions {
    grid-template-columns: 1fr;
  }

  .meta-list {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .meta-list dd {
    margin-bottom: 8px;
  }

  .activity-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .roadmap-header,
  .activity-entry-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .activity-entry {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .activity-symbol {
    width: 32px;
    height: 32px;
  }

  .activity-entry > .quiet-button {
    grid-column: 1;
  }

  .comment strong,
  .comment time {
    display: block;
  }

  .comment time {
    margin: 4px 0 0;
  }

  .file-field {
    min-height: 54px;
    padding: 10px 12px;
  }

  .file-field span {
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .login-brand {
    min-height: 280px;
    padding: 24px 18px;
  }

  .brand-message {
    padding: 42px 0 12px;
  }

  .brand-message h1 {
    font-size: 2.25rem;
  }

  .login-panel {
    padding: 36px 18px 52px;
  }

  .summary-item span,
  .admin-metrics span {
    font-size: 0.68rem;
  }

  .mobile-document-head {
    grid-template-columns: 1fr;
  }

  .mobile-document-head .status {
    justify-self: start;
  }

  .task-admin-actions {
    grid-template-columns: 1fr;
  }

  .task-admin-actions .secondary-button {
    width: 100%;
  }

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

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