:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --ink: #13202d;
  --soft-ink: #4f5f6f;
  --muted: #758391;
  --line: #d8e0e7;
  --green: #0f766e;
  --green-soft: #e1f5f1;
  --blue: #2457c5;
  --blue-soft: #e8eef8;
  --violet: #5b4bb7;
  --violet-soft: #ece9fb;
  --red: #b42318;
  --red-soft: #fff0ed;
  --yellow: #946200;
  --yellow-soft: #fff6db;
  --shadow: 0 18px 46px rgba(22, 34, 48, 0.10);
  --radius: 8px;
}

/* BK-ASSISTANT-002: klare Versorgungswege und externe Ergebnisübernahme */
.billing-supply-profile,
.billing-provider-totals {
  margin-block: 1rem;
  padding-block: 1rem;
  border-block: 1px solid var(--border);
}

.billing-supply-profile-grid,
.billing-supply-choice-grid,
.billing-provider-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.billing-supply-profile-card,
.billing-supply-choice-grid > article,
.billing-provider-upload-grid > article,
.billing-profile-unit-overrides > article {
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #fff);
}

.billing-supply-profile-card header,
.billing-provider-upload-grid > article {
  display: grid;
  gap: .65rem;
}

.billing-profile-unit-overrides {
  display: grid;
  gap: .65rem;
  margin-top: .75rem;
}

.billing-profile-unit-overrides > article {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) repeat(3, minmax(9rem, 1fr));
  align-items: end;
  gap: .65rem;
}

.billing-provider-result .billing-summary-band {
  margin-top: .8rem;
}

.billing-step-details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}

.billing-step-details > .panel {
  margin: .75rem 0 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

@media (max-width: 900px) {
  .billing-profile-unit-overrides > article {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .billing-supply-profile-grid,
  .billing-supply-choice-grid,
  .billing-provider-upload-grid,
  .billing-profile-unit-overrides > article {
    grid-template-columns: 1fr;
  }

  .billing-provider-upload-grid button,
  .billing-supply-choice-grid select,
  .billing-provider-result button,
  .billing-provider-result input,
  .billing-provider-result select {
    min-height: 44px;
  }

  .billing-step-details,
  .billing-provider-result,
  .billing-supply-step {
    overflow: clip;
  }
}

/* COMMUNICATIONS-001 */
.circular-tabs,
.circular-stepper,
.circular-editor-toolbar,
.circular-preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.circular-tabs {
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.circular-tabs button,
.circular-stepper button {
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.circular-tabs button.active,
.circular-stepper button.active,
.circular-mode button.active {
  background: var(--accent);
  color: var(--on-accent, #fff);
  border-color: var(--accent);
}

.circular-stepper {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 12px 0;
}

.circular-stepper button {
  display: flex;
  justify-content: center;
  gap: 8px;
  white-space: normal;
}

.circular-stepper button span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.circular-wizard {
  max-width: 1120px;
  margin: 0 auto;
}

.circular-step-panel {
  min-height: 420px;
}

.circular-step-panel > header,
.circular-letter-preview > header,
.circular-tenant-letter > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.circular-mode {
  margin: 16px 0;
}

.circular-selection-grid,
.circular-delivery-grid,
.circular-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.circular-select-card,
.circular-delivery-card,
.circular-template-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.circular-select-card input,
.circular-delivery-card input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.circular-select-card span,
.circular-delivery-card span,
.circular-campaign-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.circular-select-card small,
.circular-delivery-card small,
.circular-campaign-row small {
  color: var(--muted);
}

.circular-campaign-list,
.circular-tenant-list {
  display: grid;
  gap: 8px;
}

.circular-campaign-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

article.circular-campaign-row {
  cursor: default;
}

.circular-letter-preview {
  max-width: 760px;
  margin: 14px auto;
  padding: 28px clamp(18px, 5vw, 52px);
  background: #fff;
  color: #172033;
  border: 1px solid #ccd5df;
  border-radius: 4px;
  box-shadow: 0 12px 28px rgba(21, 38, 55, 0.12);
}

.circular-address {
  display: grid;
  width: min(330px, 100%);
  min-height: 92px;
  margin: 26px 0 34px;
  padding: 12px 0;
  border-bottom: 1px solid #d7dee6;
}

.circular-letter-preview footer {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid #d7dee6;
}

.circular-preview-controls {
  justify-content: center;
}

.circular-output-panel,
.confirm-card {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface-muted);
  border-radius: 6px;
}

.circular-sticky-actions {
  max-width: 1120px;
  margin-inline: auto;
}

.circular-tenant-letter.unread {
  border-left: 4px solid var(--accent);
}

.circular-template-card {
  display: block;
}

.circular-template-editor {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

@media (max-width: 767px) {
  .circular-stepper {
    grid-template-columns: repeat(5, 44px);
    justify-content: space-between;
    overflow-x: auto;
  }

  .circular-stepper button {
    width: 44px;
    min-width: 44px;
    padding: 8px;
    font-size: 0;
  }

  .circular-stepper button span {
    font-size: 14px;
  }

  .circular-selection-grid,
  .circular-delivery-grid,
  .circular-template-grid {
    grid-template-columns: 1fr;
  }

  .circular-step-panel > header,
  .circular-letter-preview > header,
  .circular-tenant-letter > header,
  .circular-campaign-row {
    align-items: stretch;
    flex-direction: column;
  }

  .circular-letter-preview {
    padding: 20px 16px;
  }

  .circular-sticky-actions {
    position: static;
  }

  .circular-sticky-actions button,
  .circular-tabs button,
  .circular-mode button {
    min-height: 44px;
  }

  .circular-step-panel input,
  .circular-step-panel select,
  .circular-step-panel textarea {
    font-size: 16px;
  }
}

.unit-media-panel {
  display: grid;
  gap: 18px;
}

.unit-media-header,
.unit-media-tour-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.unit-media-header h2,
.unit-media-tour-head h3 {
  margin: 0 0 4px;
}

.unit-media-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.unit-media-metrics > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle, var(--panel));
}

.unit-media-metrics strong,
.unit-media-metrics span {
  display: block;
}

.unit-media-metrics strong {
  font-size: 1.35rem;
}

.unit-media-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .86rem;
}

.unit-media-actions {
  margin: 0;
}

.unit-media-tour-list {
  display: grid;
  gap: 10px;
}

.unit-media-tour-list > h3 {
  margin: 0;
}

.unit-media-tour-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.unit-media-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.unit-media-facts div {
  min-width: 0;
}

.unit-media-facts dt {
  color: var(--muted);
  font-size: .78rem;
}

.unit-media-facts dd {
  margin: 2px 0 0;
  font-weight: 700;
}

.unit-media-empty p {
  max-width: 58ch;
}

@media (max-width: 768px) {
  .unit-media-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-media-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-media-header,
  .unit-media-tour-head {
    align-items: stretch;
    flex-direction: column;
  }

  .unit-media-actions .button,
  .unit-media-tour-card .actions .button,
  .unit-media-tour-card .actions button {
    width: 100%;
    min-height: 44px;
  }
}

/* Fixed development marker. This copy is never used by the productive app. */
.development-environment-banner {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 7px 16px;
  color: #ffffff;
  background: #b42318;
  border-bottom: 3px solid #7f1d1d;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
}

body {
  padding-top: 38px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(36, 87, 197, 0.18), transparent 32%),
    linear-gradient(180deg, #f8fbfc 0, var(--bg) 340px, #f6f8fb 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
select,
input,
textarea {
  font: inherit;
}

button,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

button {
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.app-back-button {
  min-height: 40px;
  padding: 7px 11px;
  border-color: #0f2d6e;
  background: #1746ad;
  color: #fff;
  box-shadow: none;
}

.app-back-button:not(:disabled)::before {
  content: "< ";
}

.app-back-button:disabled {
  opacity: 0.42;
  cursor: default;
}

button.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

button.success-button {
  color: #064e3b;
  background: linear-gradient(135deg, #bbf7d0, #ecfdf5);
  border-color: #6ee7b7;
  box-shadow: 0 10px 22px rgba(22, 163, 74, .16), inset 0 0 0 1px rgba(22, 101, 52, .08);
  cursor: default;
}

button.success-button:hover {
  transform: none;
  box-shadow: 0 10px 22px rgba(22, 163, 74, .16), inset 0 0 0 1px rgba(22, 101, 52, .08);
}

.top-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(36, 87, 197, .18);
}

.message-badge {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-weight: 900;
}

.message-badge.none {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #bfdbfe;
}

.message-badge.unread {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(220, 38, 38, .22);
}

.top-save-button {
  color: #0f5132;
  background: linear-gradient(135deg, #e7f8ef, #f7fff9);
  border-color: rgba(15, 118, 110, .28);
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 118, 110, .10);
}

.top-save-button[disabled] {
  opacity: .62;
  cursor: wait;
}

.zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 18px rgba(23, 32, 42, 0.06);
}

.zoom-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  border-radius: 6px;
}

.zoom-button:disabled {
  opacity: 0.38;
  cursor: default;
}

.zoom-level {
  min-width: 44px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

button.danger,
.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #f2b8b1;
}

button.success,
.success {
  color: #126338;
  background: #e7f7ef;
  border-color: #9bd5b4;
}

.topbar {
  position: sticky;
  top: 38px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  min-height: 78px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(23, 32, 42, 0.06);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions,
.actions,
.chips {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.mini-grid button {
  justify-content: center;
  width: 100%;
  min-height: 38px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #2457c5);
  font-weight: 800;
}

.brand-logo {
  width: auto;
  max-width: 170px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
}

.page-header-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--preview-accent);
  border-radius: var(--radius);
  background: var(--preview-bg);
  color: var(--preview-text);
}

.page-header-preview img {
  max-width: 190px;
  height: 64px;
  object-fit: contain;
}

.page-header-preview span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--preview-mark), var(--preview-accent));
  font-weight: 900;
}

.page-header-preview strong,
.page-header-preview small {
  display: block;
}

.page-header-preview small {
  color: inherit;
  opacity: .72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 2px;
  font-size: 24px;
}

h2 {
  margin-bottom: 8px;
  font-size: 21px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

p {
  color: var(--soft-ink);
}

.shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.sidebar {
  padding: 16px;
  background: rgba(19, 32, 45, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbe7ef;
}

nav {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

nav button {
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border-color: transparent;
  color: #dbe7ef;
}

nav button.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.95), rgba(36, 87, 197, 0.92));
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

nav button.locked,
nav button:disabled,
button.locked,
.card.locked-card {
  opacity: .48;
  cursor: not-allowed;
  filter: grayscale(.25);
}

button.locked,
nav button.locked,
nav button:disabled {
  background: rgba(148, 163, 184, .18);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, .24);
  box-shadow: none;
}

nav button.nav-todos {
  color: #ecfdf5;
  border-color: rgba(34, 197, 94, .42);
  background: linear-gradient(135deg, rgba(22, 101, 52, .82), rgba(15, 118, 110, .64));
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .16), 0 10px 24px rgba(20, 83, 45, .22);
}

nav button.nav-todos.active {
  background: linear-gradient(135deg, #15803d, #0f766e);
  box-shadow: 0 0 0 1px rgba(187, 247, 208, .28), 0 16px 32px rgba(20, 83, 45, .35);
}

.nav-group {
  margin: 14px 0 4px;
  color: #91a6b6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.task-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
}

.task-link-row p {
  margin: 3px 0 0;
}

.task-file-link {
  border-color: rgba(22, 163, 74, .35);
  background: #16a34a;
  color: #fff;
}

.side-panel,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.side-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.side-panel label {
  color: #c3d3df;
  font-size: 13px;
  font-weight: 800;
}

.recent-dossiers-panel {
  margin-top: 12px;
}

.recent-dossiers-head {
  color: #c3d3df;
  font-size: 13px;
  font-weight: 900;
}

.recent-dossiers-list {
  display: grid;
  gap: 8px;
}

.recent-dossier-button {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
  color: #eef6fb;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.recent-dossier-button:hover {
  color: #fff;
  background: rgba(36, 87, 197, 0.24);
  border-color: rgba(148, 163, 184, 0.42);
}

.recent-dossier-button span {
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-dossier-button small {
  color: #a9bac7;
  font-size: 11px;
  line-height: 1.25;
}

main {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
}

.panel {
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.wide {
  grid-column: 1 / -1;
}

.letterhead-preview {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.letterhead-preview span,
.letterhead-preview small,
.letterhead-preview p {
  margin: 0;
  color: var(--soft-ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(19, 32, 45, 0.96), rgba(15, 118, 110, 0.84)),
    linear-gradient(135deg, #ffffff, #eef7f4);
  color: #fff;
  border: 0;
}

.hero p {
  color: #dbe7ef;
}

.hero .chip {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.hero button {
  color: #13202d;
  background: #fff;
  border-color: #fff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
}

.metric {
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(22, 34, 48, 0.06);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.dashboard-hero {
  margin-bottom: 14px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
  gap: 14px;
  align-items: start;
}

.dashboard-column {
  display: grid;
  gap: 14px;
}

.dashboard-widget {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(120, 139, 158, .28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(248, 251, 252, .96)),
    #fff;
  box-shadow: 0 14px 32px rgba(22, 34, 48, .08);
}

.dashboard-widget header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.dashboard-widget h3,
.dashboard-widget h4 {
  margin: 0 0 5px;
}

.dashboard-widget p {
  margin-bottom: 0;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.dashboard-metrics .metric {
  padding: 11px;
  box-shadow: none;
}

.dashboard-metrics .metric strong {
  font-size: 20px;
}

.dashboard-subgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-list .important-row {
  padding: 9px 0;
}

.dashboard-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dashboard-quicklinks .card {
  min-height: 118px;
  box-shadow: none;
}

.dashboard-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.dashboard-admin-row {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) 110px minmax(170px, 1fr) minmax(150px, .8fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.dashboard-admin-row small {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: 0 10px 26px rgba(22, 34, 48, 0.06);
}

.card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.tenant-rent-card {
  align-content: start;
}

.tenant-rent-summary {
  display: grid;
  gap: 7px;
}

.tenant-rent-line,
.tenant-rent-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
}

.tenant-rent-line span {
  color: var(--text);
  font-weight: 650;
}

.tenant-rent-line strong {
  white-space: nowrap;
  color: var(--blue);
}

.tenant-rent-total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.tenant-rent-total span,
.tenant-rent-total strong {
  font-weight: 900;
}

.unit-overview-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.unit-overview-card {
  align-content: start;
  min-height: unset;
}

.unit-overview-card header {
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.unit-overview-card h3 {
  margin: 0;
}

.unit-overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.unit-overview-table th,
.unit-overview-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.unit-overview-table th {
  width: 38%;
  color: var(--muted);
  font-weight: 900;
}

.unit-overview-table tr:last-child th,
.unit-overview-table tr:last-child td {
  border-bottom: 0;
}

.unit-overview-note {
  line-height: 1.55;
}

.unit-overview-check-card {
  border-color: #f2a84b;
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 45%);
}

.missing-inline {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #0f4d40;
  font-size: 12px;
  font-weight: 800;
}

.profile-menu-root {
  position: relative;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  overflow: hidden;
  background: linear-gradient(135deg, #0f766e, #2457c5);
  color: #fff;
  font-weight: 900;
  flex: 0 0 auto;
}

.user-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 1.35rem;
}

.user-avatar.xlarge {
  width: 96px;
  height: 96px;
  font-size: 1.8rem;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 230px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
}

.profile-menu button {
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 6px;
}

.profile-menu button.profile-action.blue {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  color: var(--blue);
}

.profile-menu button.profile-action.green {
  background: var(--green-soft);
  border-color: #9bd5b4;
  color: #126338;
}

.profile-menu button.profile-action.red {
  background: var(--red-soft);
  border-color: #fecaca;
  color: var(--red);
}

.profile-menu button.profile-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-menu p {
  margin: 6px 4px 0;
}

.user-avatar-editor {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.account-hero,
.account-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.account-identity {
  justify-content: flex-start;
}

.message-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.message-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.message-card.sent {
  border-color: rgba(15, 118, 110, .22);
  background: #f0fdf4;
}

.message-card.received {
  border-color: rgba(36, 87, 197, .2);
  background: #eff6ff;
}

.message-card.message-unread {
  border-color: rgba(220, 38, 38, .35);
  background: #fff1f2;
  box-shadow: 0 10px 24px rgba(220, 38, 38, .08);
}

.message-thread-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.message-thread-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 10px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.message-thread-row:hover {
  border-color: rgba(36, 87, 197, .34);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .08);
}

.message-thread-row.message-unread {
  border-color: rgba(220, 38, 38, .35);
  background: #fff7f7;
}

.message-thread-row b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: #dc2626;
  font-size: 12px;
}

.message-thread-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #2457c5, #0f766e);
  font-weight: 900;
}

.message-thread-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.message-thread-main span,
.message-thread-main small {
  overflow: hidden;
  color: var(--soft-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-modal {
  display: grid;
  grid-template-rows: auto minmax(260px, 56vh) auto;
  max-height: 88vh;
}

.message-thread-header {
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.message-thread-history {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 16px 4px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.chat-bubble {
  max-width: min(76%, 680px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.chat-bubble.own {
  justify-self: end;
  border-color: rgba(15, 118, 110, .24);
  background: #ecfdf5;
}

.chat-bubble.other {
  justify-self: start;
  border-color: rgba(36, 87, 197, .2);
  background: #eff6ff;
}

.chat-bubble p {
  white-space: pre-wrap;
}

.chat-bubble small {
  color: var(--soft-ink);
}

.message-reply-box {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.chip.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.chip.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.chip.red {
  background: var(--red-soft);
  color: var(--red);
}

.chip.yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.chip.orange {
  background: #fff1df;
  color: #a34d00;
}

.chip.signed {
  background: #bbf7d0;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, .16);
}

.chip.green {
  background: #bbf7d0;
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 101, 52, .16);
}

.success-panel {
  border-color: rgba(15, 118, 110, .42);
  background: linear-gradient(180deg, #f0fdf9 0%, #ffffff 54%);
  box-shadow: 0 12px 30px rgba(15, 118, 110, .10);
}

.tenant-create-collapsible {
  padding: 0;
  overflow: hidden;
}

.tenant-create-collapsible summary {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 1.2fr) max-content;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.tenant-create-collapsible summary::-webkit-details-marker {
  display: none;
}

.tenant-create-collapsible summary strong {
  color: #0f4d40;
  font-size: 17px;
}

.tenant-create-collapsible summary span:not(.chip) {
  color: var(--muted);
  font-weight: 750;
}

.tenant-create-collapsible[open] summary {
  border-bottom: 1px solid rgba(15, 118, 110, .22);
}

.tenant-create-collapsible > p,
.tenant-create-collapsible > .form-grid,
.tenant-create-collapsible > .actions {
  margin: 14px 16px;
}

.attention-panel {
  border-color: #f59e0b;
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 44%);
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading-row h2 {
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
}

.operating-unit-check-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.operating-unit-check-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.operating-unit-check-card > summary {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) minmax(160px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(90deg, #f8fafc 0%, #fff 100%);
}

.operating-unit-check-card > summary::-webkit-details-marker {
  display: none;
}

.operating-unit-check-card > summary strong {
  color: var(--ink);
}

.operating-unit-check-card > summary span:not(.chip) {
  color: var(--muted);
  font-size: 13px;
}

.operating-unit-check-body {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.operating-unit-check-fields {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(220px, 1fr) minmax(190px, .9fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: end;
}

.operating-unit-check-fields label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.operating-unit-check-fields .check-row {
  align-self: center;
}

.operating-heating-link {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.operating-heating-link:hover {
  filter: brightness(.97);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .14);
}

.operating-vacancy-row {
  background: #fff7ed;
}

.operating-vacancy-row td {
  border-top: 1px solid rgba(234, 88, 12, .18);
  border-bottom: 1px solid rgba(234, 88, 12, .12);
}

.operating-vacancy-row strong {
  color: #9a3412;
}

.field-jump-highlight {
  border-radius: 8px;
  outline: 3px solid rgba(37, 99, 235, .28);
  background: #eff6ff;
  transition: outline-color .25s ease, background .25s ease;
}

@media (max-width: 980px) {
  .operating-unit-check-card > summary,
  .operating-unit-check-fields {
    grid-template-columns: 1fr;
  }
}

.compact-list-head {
  display: grid;
  gap: 10px;
}

.compact-list-head label {
  display: grid;
  gap: 6px;
  max-width: 720px;
  color: var(--soft-ink);
  font-weight: 800;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.record-row summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.6fr) repeat(3, max-content) max-content;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  list-style: none;
}

.record-row summary::-webkit-details-marker {
  display: none;
}

.record-row summary::before {
  content: "+";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.record-row summary strong {
  padding-left: 34px;
}

.record-row[open] summary::before {
  content: "-";
}

.record-row[open] summary {
  border-bottom: 1px solid var(--line);
}

.record-summary-action {
  justify-self: end;
  white-space: nowrap;
}

.record-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
}

.record-row .actions {
  padding: 0 14px 14px;
}

.brunata-cost-row > summary {
  grid-template-columns: minmax(260px, 1fr) max-content;
  gap: 18px;
}

.brunata-cost-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brunata-cost-title b {
  padding-left: 34px;
}

.brunata-cost-title small {
  display: block;
  padding-left: 34px;
  color: var(--muted);
  line-height: 1.35;
  white-space: normal;
}

.brunata-cost-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.brunata-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.brunata-sum-overview {
  margin: 0 14px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f8fbff;
}

.brunata-sum-overview h3 {
  margin: 0 0 10px;
}

.brunata-sum-overview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.brunata-sum-overview th,
.brunata-sum-overview td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.brunata-sum-overview tfoot th {
  background: #eaf3ff;
  color: var(--ink);
}

.brunata-sum-overview .align-right {
  text-align: right;
  white-space: nowrap;
}

.brunata-year-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.brunata-year-buttons button {
  min-width: 116px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.brunata-year-buttons button.active {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22), 0 12px 24px rgba(22, 163, 74, 0.24);
}

.brunata-work-panel {
  margin: 0 14px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 94%, var(--soft));
}

.brunata-work-panel h3 {
  margin: 0 0 4px;
}

.brunata-work-head,
.brunata-work-row {
  display: grid;
  grid-template-columns: 130px minmax(190px, 1.2fr) minmax(230px, 1.6fr) 82px 92px 96px minmax(190px, 1fr) 92px;
  gap: 8px;
  align-items: center;
}

.brunata-work-head {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brunata-work-row {
  margin-top: 8px;
}

.brunata-work-row input,
.brunata-work-row select {
  width: 100%;
}

.brunata-work-row [data-brunata-work-amount] {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.admin-user-editor > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 12px 0;
}

.admin-user-editor > summary strong {
  font-size: 1.1rem;
}

.admin-user-editor code {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .brunata-work-head {
    display: none;
  }

  .brunata-work-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
}

.object-unit-group {
  background: color-mix(in srgb, var(--surface) 92%, var(--soft));
}

.object-unit-group > summary {
  background: var(--surface);
}

.unit-subgroup {
  background: #fbfdff;
  border-color: #dbe8f0;
}

.unit-subgroup > summary {
  grid-template-columns: minmax(220px, 1.3fr) minmax(200px, 1.4fr) repeat(3, max-content);
  background: #f5f9fc;
  padding-top: 11px;
  padding-bottom: 11px;
}

.unit-subgroup > summary::before {
  background: #e6f1f8;
  color: var(--blue);
}

.unit-subgroup.ancillary {
  border-left: 4px solid #f59e0b;
}

.unit-subgroup.residential {
  border-left: 4px solid var(--blue);
}

.unit-subgroup.other {
  border-left: 4px solid var(--muted);
}

.applicant-tenant-group {
  border-color: #f2a84b;
  background: #fff7ec;
}

.applicant-tenant-group > summary {
  background: #fff1df;
}

.applicant-tenant-group > summary::before {
  background: #ffd9a8;
  color: #8a3f00;
}

.applicant-actions-panel {
  border-color: #f2a84b;
  background: #fff7ec;
}

.applicant-actions-panel h2 {
  color: #8a3f00;
}

.nested-record-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.nested-metrics {
  padding: 12px 12px 0;
}

.inline-edit-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 12px;
  margin: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, #fff7ed);
}

.inline-edit-panel label {
  display: grid;
  gap: 6px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.inline-edit-panel .actions {
  grid-column: 1 / -1;
  padding: 0;
}

.repair-actions {
  padding: 8px 0 0;
  gap: 8px;
}

.span-all {
  grid-column: 1 / -1;
}

.inline-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 5px 8px;
  max-height: 340px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.inline-check-list legend {
  padding: 0 6px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.compact-check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.compact-check-row small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.compact-check-row .warning-text {
  color: #9a3412;
  font-weight: 800;
}

.market-region-selection-note {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 8px;
  background: rgba(219, 234, 254, 0.72);
  color: #1e3a8a;
  font-weight: 800;
}

.nested-record-list .record-row {
  border-radius: 10px;
  background: var(--bg);
}

.nested-record-list .record-row summary {
  grid-template-columns: minmax(180px, 1.4fr) minmax(160px, 1.2fr) repeat(3, max-content);
  padding-top: 11px;
  padding-bottom: 11px;
}

.masterdata-blocks {
  display: grid;
  gap: 10px;
}

.masterdata-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.masterdata-block summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .9fr) 1.5fr;
  gap: 12px;
  align-items: center;
  padding: 13px 14px 13px 48px;
  cursor: pointer;
  list-style: none;
}

.masterdata-block summary::-webkit-details-marker {
  display: none;
}

.masterdata-block summary::before {
  content: "+";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 900;
}

.masterdata-block[open] summary {
  border-bottom: 1px solid var(--line);
}

.masterdata-block[open] summary::before {
  content: "-";
}

.masterdata-block summary span {
  color: var(--soft-ink);
  font-size: .92rem;
}

.masterdata-block .form-grid {
  padding: 14px;
}

@media (max-width: 900px) {
  .record-row summary,
  .record-detail-grid,
  .masterdata-block summary {
    grid-template-columns: 1fr;
  }

  .record-summary-action {
    justify-self: start;
  }

  .record-row summary strong {
    padding-left: 34px;
  }

  .rent-increase-metrics,
  .rent-increase-layout,
  .rent-process-help,
  .rent-work-fields,
  .rent-linked-data-panel summary {
    grid-template-columns: 1fr;
  }

  .rent-action-strip {
    position: static;
  }

  .rent-reason-field textarea {
    min-height: 240px;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
}

tbody tr:hover {
  background: #f8fbff;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: #33414f;
  background: #f8fafb;
  font-size: 13px;
}

td input {
  width: 100%;
  min-width: 110px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.issue-list {
  display: grid;
  gap: 9px;
}

.issue {
  padding: 12px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: #fff;
}

.issue.error {
  border-left-color: var(--red);
}

.issue.warn {
  border-left-color: var(--yellow);
}

.issue.info {
  border-left-color: var(--blue);
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.search-row input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tabs button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.tabs button.rent-tab-signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(245, 158, 11, 0.62);
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.16), 0 0 18px rgba(245, 158, 11, 0.2);
}

.tabs button.rent-tab-signal.has-count {
  color: #7c2d12;
}

.tabs button.rent-tab-signal .tab-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
}

.tabs button.rent-tab-signal.active {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #ea580c;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.32), 0 0 24px rgba(249, 115, 22, 0.3);
}

.tabs button.rent-tab-signal.active .tab-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #9a3412;
}

.tabs button.voluntary-tab-signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: rgba(22, 163, 74, 0.62);
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.08), 0 0 18px rgba(22, 163, 74, 0.16);
}

.tabs button.voluntary-tab-signal .tab-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  color: #166534;
  background: #dcfce7;
  font-size: 11px;
  font-weight: 800;
}

.tabs button.voluntary-tab-signal.active {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: #15803d;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.32), 0 0 24px rgba(22, 163, 74, 0.3);
}

.tabs button.voluntary-tab-signal.active .tab-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #166534;
}

.tabs.sub-tabs {
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 85%, var(--soft));
}

.tabs.sub-tabs button {
  min-height: 38px;
  border-radius: calc(var(--radius) - 2px);
}

.dossier-tabs {
  padding-block: 12px;
}

.dossier-tabs .tabs {
  margin: 0;
}

.dossier-tabs .tabs button {
  min-height: 38px;
}

.dossier-category-navigation {
  display: grid;
  gap: 8px;
}

.dossier-category-groups,
.dossier-category-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: thin;
}

.dossier-category-groups {
  border-bottom: 1px solid var(--line, var(--border));
  padding-bottom: 8px;
}

.dossier-category-groups button,
.dossier-category-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  white-space: nowrap;
}

.dossier-category-groups button {
  color: var(--soft-ink, var(--text-muted));
  background: transparent;
}

.dossier-category-groups button.active,
.dossier-category-tabs button.active {
  color: var(--on-accent, #fff);
  background: var(--accent, #2457c5);
}

.dossier-category-tabs button {
  min-height: 36px;
  padding-block: 6px;
  font-size: .86rem;
}

.dossier-category-mobile {
  display: none;
}

@media (max-width: 780px) {
  .dossier-category-groups,
  .dossier-category-tabs {
    display: none;
  }

  .dossier-category-mobile {
    display: grid;
    gap: 5px;
    font-weight: 700;
  }

  .dossier-category-mobile select {
    min-height: 46px;
    font-size: 16px;
  }
}

.admin-controls {
  display: grid;
  grid-template-columns: minmax(220px, 360px);
  gap: 10px;
}

.admin-controls label,
.form-grid label,
.search-row label {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.span-2 {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.raw-editor textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.form-grid textarea {
  min-height: 112px;
  resize: vertical;
}

.staffel-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
}

.staffel-grid-head {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.staffel-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(140px, 1fr) minmax(130px, 1fr) minmax(180px, 1.2fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.communication-body {
  width: 100%;
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
  resize: vertical;
}

.communication-hero {
  align-items: flex-start;
}

.communication-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.communication-compose,
.communication-context {
  min-width: 0;
}

.communication-compose .form-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.communication-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid #d8e0ea;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.communication-step + .communication-step {
  margin-top: 14px;
}

.step-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #122033;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(18, 32, 51, .2);
}

.editor-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.communication-token-buttons {
  margin: 8px 0 12px;
}

.communication-preview-panel {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow: auto;
}

.communication-live-preview {
  justify-items: center;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.communication-paper {
  width: min(100%, calc(520px * var(--preview-zoom, 1)));
}

.communication-preview-body {
  position: absolute;
  left: 9.5%;
  right: 9.5%;
  top: 43%;
  color: #172033;
  font-size: 7.3px;
  line-height: 1.38;
}

.communication-preview-body p {
  margin: 0 0 5px;
}

.communication-preview-body .paragraph-spacer {
  height: 5px;
}

.communication-preview-signoff {
  margin-top: 10px !important;
}

.communication-preview-subject {
  max-width: 62%;
  overflow-wrap: anywhere;
}

.communication-preview-recipient {
  max-width: 42%;
}

.communication-context-card {
  display: grid;
  gap: 10px;
}

.communication-template-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.list-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.list-button:hover,
.list-button.active {
  border-color: var(--blue);
  background: #eef5ff;
}

.list-button span {
  font-weight: 800;
}

.list-button small {
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .communication-workspace {
    grid-template-columns: 1fr;
  }

  .communication-compose .form-grid {
    grid-template-columns: 1fr;
  }
}

.letter-preview {
  max-width: 820px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.letter-preview h4 {
  margin: 22px 0 12px;
  font-size: 18px;
}

.legal-hint {
  padding: 12px;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  background: #fff8d7;
  color: #554414;
  font-weight: 700;
}

.death-case-panel,
.death-case-alert {
  border-color: #f2b8b1;
  background: linear-gradient(180deg, #fff7f5, #ffffff 42%);
}

.death-case-alert h2,
.death-case-panel h2 {
  color: var(--red);
}

.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.option-group legend {
  padding: 0 6px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.note-panel {
  border-left: 4px solid var(--blue);
}

.document-upload-panel {
  border-left: 4px solid var(--green);
}

.doc-controls {
  display: grid;
  gap: 7px;
  min-width: 220px;
}

.doc-controls input[type="text"],
.doc-controls input:not([type]) {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.preflight-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(19, 32, 45, 0.58);
  backdrop-filter: blur(8px);
}

.preflight-dialog {
  width: min(720px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 26px 70px rgba(19, 32, 45, 0.28);
}

.preflight-dialog p {
  max-width: 62ch;
}

.preflight-dialog ul {
  display: grid;
  gap: 8px;
  max-height: 45vh;
  margin: 14px 0 18px;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.preflight-dialog li {
  padding: 10px 12px;
  border: 1px solid #f1d9a8;
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--yellow-soft);
  color: #563900;
}

.preflight-error {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #f1d9a8;
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--yellow-soft);
  color: #563900;
}

.preflight-error ul {
  margin-bottom: 0;
}

.preflight-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.preflight-list h3 {
  margin: 8px 0 0;
}

.doc-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.doc-choice-grid button:last-child {
  grid-column: 1 / -1;
}

.digital-protocol {
  display: grid;
  gap: 16px;
}

.template-paragraphs {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}

.attachment-choice.is-warning {
  border-color: #f1d9a8;
  background: var(--yellow-soft);
}

.template-paragraph {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.template-paragraph > summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.template-paragraph .form-grid {
  grid-template-columns: 150px 150px minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 12px;
}

.template-paragraph label {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.template-paragraph textarea {
  width: 100%;
  min-height: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  line-height: 1.5;
}

.template-subpoints {
  display: grid;
  gap: 10px;
}

.template-subpoint-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #eef6ff;
  color: var(--ink);
}

.template-subpoint {
  display: grid;
  grid-template-columns: 120px minmax(680px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
}

.template-subpoint textarea {
  min-height: 130px;
}

.token-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 2px;
}

.template-editor-tools {
  display: grid;
  gap: 8px;
}

.snippet-toolbar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(15, 23, 42, 0.03);
}

.snippet-toolbar .actions {
  justify-content: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.template-format-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.template-bold-button {
  min-width: 62px;
  border-color: #162230;
  color: #162230;
}

.token-buttons .small {
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.rent-increase-workflow {
  display: grid;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, .72), rgba(255, 255, 255, .94) 180px),
    var(--panel);
}

.rent-increase-workflow > .section-head {
  padding: 4px 2px 2px;
}

.rent-increase-workflow > .section-head h2 {
  margin-bottom: 4px;
  font-size: 24px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.section-head.compact h3 {
  margin-bottom: 2px;
}

.section-head.compact p {
  margin-bottom: 0;
}

.rent-increase-metrics {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}

.rent-increase-metrics .metric {
  min-height: 86px;
  border-color: rgba(249, 115, 22, .18);
  background: linear-gradient(180deg, #ffffff, #fffaf5);
}

.rent-increase-metrics .metric strong {
  font-size: clamp(18px, 1.65vw, 23px);
}

.rent-increase-layout {
  display: grid;
  grid-template-columns: minmax(330px, .95fr) minmax(420px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.rent-work-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.rent-work-fields {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.rent-reason-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(248, 250, 252, .9));
}

.rent-reason-field {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.rent-reason-field textarea {
  width: 100%;
  min-height: 310px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  line-height: 1.48;
  resize: vertical;
}

.rent-linked-data-panel {
  margin-top: 2px;
  border-color: rgba(14, 116, 144, .22);
  background: rgba(236, 254, 255, .46);
}

.rent-linked-data-panel summary {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, .8fr) max-content;
}

.rent-linked-data-panel .form-grid {
  padding: 12px;
}

.snippet-toolbar,
.token-buttons.communication-token-buttons {
  border-color: rgba(249, 115, 22, .18);
  background: rgba(255, 247, 237, .58);
}

.snippet-toolbar strong,
.token-buttons.communication-token-buttons strong {
  color: #7c2d12;
}

.rent-action-strip {
  position: sticky;
  bottom: 10px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
  backdrop-filter: blur(12px);
}

.rent-process-help {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.rent-process-help article {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 10px;
  background: rgba(248, 250, 252, .84);
}

.rent-process-help strong {
  color: #0f766e;
  font-size: 13px;
}

.rent-process-help span {
  color: var(--soft-ink);
  font-size: 12px;
  line-height: 1.35;
}

.template-house-rules {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.template-house-rules textarea {
  width: 100%;
  min-height: 170px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.digital-checklist {
  display: grid;
  gap: 10px;
}

.digital-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.digital-row p {
  margin: 4px 0 0;
  font-size: 13px;
}

.digital-row textarea {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
  font-size: 13px;
  font-weight: 800;
}

.attachment-accordion {
  display: grid;
  gap: 10px;
}

.attachment-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.attachment-details summary {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  cursor: pointer;
}

.attachment-details[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.attachment-details .template-paragraph {
  border: 0;
  border-radius: 0;
  margin: 0;
}

.attachment-rule-box {
  display: grid;
  gap: 10px;
}

.attachment-rule-box > label {
  display: grid;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.attachment-rule-box p {
  margin: 0;
}

.signature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px;
}

.signature-grid label {
  display: grid;
  gap: 8px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.signature-grid canvas {
  width: 100%;
  max-width: 100%;
  height: 150px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  touch-action: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 28px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(980px, 96vw);
  max-height: calc(100vh - 56px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  padding: 18px;
}

.modal.wide {
  width: min(1680px, 98vw);
}

.temporary-password-modal {
  width: min(560px, 96vw);
}

.temporary-password-value {
  margin: 16px 0;
  padding: 16px;
  overflow-wrap: anywhere;
  border: 2px solid #2457c5;
  border-radius: var(--radius);
  background: #eef5ff;
  color: #102033;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.modal .table-wrap {
  max-height: 66vh;
  overflow: auto;
}

.greeting-modal {
  max-width: 560px;
  background: #ffffff;
  color: #102033;
  border-color: rgba(36, 87, 197, .22);
  box-shadow: 0 30px 90px rgba(15, 23, 42, .38);
  text-align: left;
}

.greeting-icon {
  display: inline-grid;
  place-items: center;
  min-width: 82px;
  min-height: 38px;
  margin-bottom: 10px;
  padding: 7px 13px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 900;
}

.greeting-modal h2 {
  margin-top: 0;
  color: #102033;
}

.greeting-modal p {
  color: #334155;
  font-weight: 700;
}

.greeting-joke {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid rgba(36, 87, 197, .16);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #eef6ff, #ffffff);
  color: #0f172a;
  font-weight: 800;
  line-height: 1.55;
}

.quick-task-modal {
  width: min(900px, 96vw);
}

.quick-task-modal .task-create-panel {
  margin-top: 14px;
  box-shadow: none;
}

.quick-task-modal .task-create-panel > .actions:first-child {
  display: none;
}

.quick-task-footer {
  justify-content: flex-end;
  margin-top: 14px;
}

.action-choice-modal {
  width: min(760px, 96vw);
}

.action-choice-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.action-choice {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  justify-items: start;
  text-align: left;
  background: #f8fafc;
}

.action-choice strong {
  font-size: 1rem;
}

.action-choice span {
  color: var(--soft-ink);
  font-size: .92rem;
  line-height: 1.35;
}

.action-choice.success span,
.action-choice.danger span {
  color: inherit;
  opacity: .82;
}

.payment-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(110px, 0.8fr);
  gap: 7px;
  min-width: 360px;
}

.payment-controls > * {
  min-width: 0;
}

.payment-controls > .notice,
.payment-controls > [data-bank-expense-target],
.payment-controls > input,
.payment-controls > button {
  grid-column: 1 / -1;
}

.payment-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.payment-controls input,
.payment-controls select {
  min-height: 34px;
  padding: 7px 9px;
}

.payment-controls button,
.payment-controls input {
  grid-column: span 2;
}

.bank-expense-refund-card,
.bank-refund-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.bank-source-strip,
.bank-refund-impact {
  grid-column: 1 / -1;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.bank-source-strip span,
.bank-refund-impact span {
  color: var(--muted);
  font-size: 12px;
}

.bank-source-strip small,
.bank-refund-impact small {
  color: var(--soft-ink);
}

.expense-refund-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(110px, .6fr);
  gap: 8px;
}

.rent-alternative,
.bank-expense-refund-card > details,
.payment-controls > details {
  grid-column: 1 / -1;
}

.bank-refund-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(140px, .8fr);
  gap: 10px;
  padding-top: 12px;
}

.bank-refund-editor > [data-expense-refund-target],
.bank-refund-editor > details,
.bank-refund-editor > button,
.bank-refund-editor > .check,
.bank-refund-editor > .bank-refund-impact {
  grid-column: 1 / -1;
}

.finance-refund-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 8px 10px;
  border-left: 3px solid var(--success);
  background: var(--surface-subtle, #f7f9fb);
  font-size: 13px;
}

.finance-receipt-optional > summary,
.finance-form-details > summary,
.payment-controls details > summary {
  cursor: pointer;
  font-weight: 700;
}

.bank-identity-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 8px 0;
}

.bank-identity-summary div {
  min-width: 0;
}

.bank-identity-summary dt,
.legacy-assignment-preview span {
  color: var(--muted);
  font-size: 12px;
}

.bank-identity-summary dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.legacy-assignment-wizard {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt, var(--blue-soft));
}

.legacy-assignment-wizard h3,
.legacy-assignment-wizard p {
  margin: 0;
}

.legacy-assignment-wizard label:not(.check-line),
.legacy-assignment-wizard .choice-field {
  display: grid;
  gap: 6px;
}

.legacy-assignment-wizard textarea {
  min-height: 84px;
  resize: vertical;
}

.legacy-similar-list,
.legacy-assignment-preview {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.legacy-similar-list > div,
.legacy-assignment-preview > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.legacy-assignment-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.legacy-assignment-preview small {
  color: var(--muted);
}

.legacy-assignment-wizard .check-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.legacy-assignment-wizard .check-line input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.preview-targets {
  display: grid;
  gap: 8px;
  min-width: 380px;
}

.preview-targets > div:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.preview-targets label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--soft-ink);
  font-weight: 800;
}

.preview-targets input,
.preview-targets select {
  min-height: 34px;
  padding: 7px 9px;
}

.preview-targets > input {
  width: 100%;
}

.dunning-controls {
  display: grid;
  gap: 8px;
}

.dunning-controls input,
.dunning-controls select {
  min-height: 34px;
  padding: 7px 9px;
}

.task-complete {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.task-complete textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.task-history {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.task-history summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--soft-ink);
}

.task-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.task-history-entry {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.task-history-entry p {
  margin: 5px 0;
}

.task-comments {
  border-left: 4px solid var(--violet);
}

.task-comment-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.task-comment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.task-comment.internal {
  background: var(--yellow-soft);
  border-color: #f1d38b;
}

.task-comment header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.task-comment p {
  margin: 8px 0;
}

.soft-panel {
  margin-top: 14px;
  box-shadow: none;
  background: #f8fbfc;
}

.admin-focus {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid #d8c26a;
  border-radius: var(--radius);
  background: #fff8d7;
  color: #3b3315;
}

.admin-focus p {
  margin: 6px 0 10px;
}

.admin-valid,
.admin-validation {
  margin: 14px 0;
  padding: 12px;
  border-radius: var(--radius);
}

.admin-valid {
  border: 1px solid #b9ded8;
  background: var(--green-soft);
  color: #164640;
}

.admin-validation {
  border: 1px solid #f1c784;
  background: #fff7e8;
  color: #4b3412;
}

.admin-validation ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.admin-validation li {
  margin: 6px 0;
}

.admin-party-panel {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
}

.admin-party-panel h3 {
  margin-bottom: 4px;
}

.admin-party-panel td input {
  width: 100%;
  margin: 2px 0;
}

.unit-work-center {
  border-left: 4px solid var(--green);
}

.unit-work-center .metric-grid {
  margin: 12px 0;
}

.unit-maintenance-panel {
  border-left: 4px solid var(--yellow);
}

.task-card {
  border-left: 4px solid var(--line);
}

.task-card-summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  list-style: none;
}

.task-card-summary::-webkit-details-marker {
  display: none;
}

.task-card-summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--green);
  font-weight: 800;
  grid-row: 1;
  grid-column: 1;
}

.task-card[open] .task-card-summary::before {
  content: "-";
}

.task-summary-main {
  display: grid;
  gap: 4px;
  padding-left: 36px;
  min-width: 0;
}

.task-summary-main strong,
.task-summary-main .muted {
  overflow-wrap: anywhere;
}

.task-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.task-card-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list .task-card {
  width: 100%;
}

.task-list .task-card header {
  align-items: flex-start;
}

@media (max-width: 760px) {
  .task-card-summary {
    grid-template-columns: 1fr;
  }

  .task-summary-meta {
    justify-content: flex-start;
    padding-left: 36px;
  }

  .calendar-month-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-day {
    min-height: 96px;
  }

  .calendar-agenda-row {
    grid-template-columns: 1fr;
  }
}

.task-create-panel {
  border-left: 4px solid var(--blue);
}

.task-create-panel .actions {
  align-items: flex-start;
  margin-bottom: 14px;
}

.task-create-collapsed summary,
.task-calendar-panel summary {
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  list-style: none;
}

.task-create-collapsed summary::-webkit-details-marker,
.task-calendar-panel summary::-webkit-details-marker {
  display: none;
}

.task-create-collapsed[open] summary,
.task-calendar-panel[open] summary {
  margin-bottom: 12px;
}

.task-calendar-panel {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: var(--radius);
  background: #f8fffb;
}

.task-calendar-card .task-calendar-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.task-filter-panel {
  background: #f8fafc;
}

.calendar-plan-card {
  border-left: 4px solid var(--blue);
}

.calendar-plan-card.danger {
  border-left-color: var(--red);
}

.top-primary.secondary {
  background: var(--green);
}

.calendar-sync-panel {
  border-left: 4px solid var(--green);
}

.termination-panel {
  border-left: 4px solid var(--red);
}

.termination-panel textarea {
  min-height: 180px;
  line-height: 1.45;
}

.operating-assistant-card {
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  min-height: 520px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.operating-taxlike-shell {
  max-width: 1460px;
  margin: 0 auto;
}

.operating-wizard-shell {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.operating-wizard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 30px;
  border-radius: 12px;
  color: #0f172a;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(235,247,255,0.96)),
    radial-gradient(circle at 92% 12%, rgba(30, 111, 191, 0.14), transparent 34%);
  border: 1px solid var(--border);
}

.operating-wizard-hero h2 {
  margin: 10px 0;
  font-size: 2.35rem;
}

.operating-wizard-status {
  border-radius: 10px;
  background: #0f2744;
  color: #fff;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.operating-wizard-status span,
.operating-wizard-status small {
  color: rgba(255, 255, 255, 0.82);
}

.operating-progress-bar {
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.operating-progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #7dd3fc;
}

.full-backup-panel {
  border-top: 4px solid #16854b;
}

.full-backup-main,
.full-backup-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.full-backup-main > div {
  max-width: 760px;
}

.full-backup-button {
  min-height: 52px;
  max-width: 360px;
  background: #16854b;
  border-color: #116b3d;
  color: #fff;
  font-weight: 800;
}

.full-backup-button:hover:not(:disabled) {
  background: #116b3d;
}

.full-backup-status {
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.full-backup-status > div {
  display: grid;
  gap: 4px;
}

.full-backup-status span {
  color: var(--muted);
  font-size: .84rem;
}

.full-backup-progress {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  overflow: hidden;
}

.full-backup-progress::before {
  content: "";
  height: 10px;
  border-radius: 99px;
  background: #d8e5ec;
}

.full-backup-progress i {
  position: absolute;
  top: 0;
  left: -35%;
  width: 35%;
  height: 10px;
  border-radius: 99px;
  background: #16854b;
  animation: full-backup-progress 1.15s ease-in-out infinite;
}

.backup-lock-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #123d66;
  color: #fff;
  font-weight: 900;
}

.notice.confidentiality {
  border-left-color: #123d66;
  background: #eef5fa;
}

.backup-restore-panel {
  min-width: 0;
  max-width: 100%;
  border-top: 4px solid #2457c5;
}

.backup-restore-heading,
.restore-upload-row,
.restore-last-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.backup-restore-heading > div {
  max-width: 780px;
}

.restore-shield {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  background: #2457c5;
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
}

.restore-upload-row {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--border);
  background: #f6f9fb;
}

.restore-file-field {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 7px;
  font-weight: 800;
}

.restore-file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.restore-file-button {
  width: fit-content;
  padding: 9px 13px;
  border: 1px solid #9bb0bf;
  background: #fff;
  color: #123d66;
  font-weight: 800;
  cursor: pointer;
}

.restore-file-field:focus-within .restore-file-button {
  outline: 3px solid rgba(36, 87, 197, .25);
  outline-offset: 2px;
}

.restore-file-field small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 500;
}

.restore-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.restore-progress::before {
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 10px;
  border-radius: 99px;
  background: #d8e5ec;
}

.restore-progress span {
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  height: 10px;
  max-width: 100%;
  border-radius: 99px;
  background: #2457c5;
  transition: width .18s ease;
}

.restore-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 16px 0;
  border: 1px solid var(--border);
  background: var(--border);
}

.restore-facts > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  background: #fff;
}

.restore-facts span,
.restore-last-status span,
.restore-last-status small {
  color: var(--muted);
  font-size: .82rem;
}

.restore-facts strong {
  overflow-wrap: anywhere;
}

.ok-text {
  color: #116b3d;
}

.restore-comparison {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
}

.restore-comparison table {
  min-width: 620px;
  width: 100%;
  border-collapse: collapse;
}

.restore-comparison th,
.restore-comparison td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.restore-comparison th:first-child,
.restore-comparison td:first-child {
  text-align: left;
}

.restore-comparison th {
  background: #eaf1f6;
}

.restore-warning,
.restore-confirmation {
  margin: 18px 0;
  padding: 18px;
  border-left: 4px solid #c2410c;
  background: #fff5eb;
}

.restore-confirmation {
  display: grid;
  gap: 14px;
  border-left-color: #b42318;
  background: #fff1f0;
}

.restore-confirmation .checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.restore-confirmation .checkline input {
  width: auto;
  margin-top: 3px;
}

.restore-confirmation .danger {
  justify-self: start;
  background: #b42318;
  border-color: #8f1c13;
  color: #fff;
}

.restore-last-status {
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@keyframes full-backup-progress {
  to { left: 100%; }
}

@media (max-width: 760px) {
  .full-backup-main,
  .full-backup-status {
    align-items: stretch;
    flex-direction: column;
  }

  .full-backup-button {
    max-width: none;
    width: 100%;
  }

  .backup-restore-heading,
  .restore-upload-row {
    align-items: stretch;
    flex-direction: column;
  }

  .restore-facts {
    grid-template-columns: 1fr 1fr;
  }
}

.operating-wizard-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.assistant-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #eef7ff 100%);
}

.assistant-landing h2 {
  margin: 10px 0;
  font-size: 2.25rem;
}

.assistant-dialog-card {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.assistant-dialog-card h3 {
  margin: 8px 0 12px;
  font-size: 1.85rem;
  line-height: 1.25;
}

.assistant-dialog-eyebrow {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.assistant-mini-sources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.assistant-fact {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.assistant-fact span,
.assistant-fact small {
  display: block;
  color: var(--muted);
}

.assistant-fact strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
}

.assistant-answer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.assistant-answer-row .secondary,
.assistant-answer-row button.secondary {
  background: #e8f0fe;
  color: var(--blue);
}

.assistant-answer-row .ghost,
.assistant-answer-row button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.operating-topic-card {
  max-width: 1240px;
}

.operating-topic-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.operating-topic-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 4px;
}

.operating-topic-strip button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.operating-topic-strip button b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.78rem;
}

.operating-topic-strip button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.operating-topic-strip button.active {
  border-color: var(--blue);
  background: #eef7ff;
}

.operating-topic-strip button.active b,
.operating-topic-strip button.done b {
  background: var(--blue);
  color: #fff;
}

.operating-topic-strip button.done {
  background: #f8fafc;
}

.operating-topic-strip button.topic-green {
  border-color: #86d39f;
  background: #ecfdf3;
}

.operating-topic-strip button.topic-green b {
  background: #14823b;
  color: #fff;
}

.operating-topic-strip button.topic-blue {
  border-color: #93c5fd;
  background: #eff6ff;
}

.operating-topic-strip button.topic-blue b {
  background: #2563eb;
  color: #fff;
}

.operating-topic-strip button.topic-red {
  border-color: #fca5a5;
  background: #fff1f2;
}

.operating-topic-strip button.topic-red b {
  background: #dc2626;
  color: #fff;
}

.operating-topic-strip button.topic-yellow {
  border-color: #facc15;
  background: #fffbeb;
}

.operating-topic-strip button.topic-yellow b {
  background: #ca8a04;
  color: #fff;
}

.operating-special-panel .compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.insurance-cost-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.insurance-cost-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(90px, auto) minmax(135px, auto) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.insurance-cost-row small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 860px) {
  .insurance-cost-row {
    grid-template-columns: 1fr;
  }
}

.operating-topic-cost-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.operating-topic-cost-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.operating-topic-cost-list small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.clean-list {
  margin: 10px 0 0;
  padding-left: 20px;
}

.clean-list li {
  margin: 5px 0;
}

.assistant-hint {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  background: #eef7ff;
}

.assistant-hint.warn {
  border-left-color: #f59e0b;
  background: #fff7ed;
}

.operating-overview-list {
  margin-top: 18px;
}

.operating-object-row > summary {
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) repeat(3, auto) auto;
  align-items: center;
}

.operating-child-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.operating-child-guide span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef7ff;
  color: var(--blue);
  font-weight: 700;
}

.operating-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.operating-year-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 6px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07);
}

.operating-year-card.ready,
.operating-year-card.done {
  border-left-color: var(--blue);
}

.operating-year-card.work {
  border-left-color: #f59e0b;
  background: #fffaf0;
}

.operating-year-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.operating-year-card header strong {
  display: block;
  margin-top: 3px;
  font-size: 1.1rem;
}

.operating-year {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
}

.operating-year-card p {
  margin: 0;
  color: var(--muted);
}

.operating-year-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.operating-year-facts span {
  display: block;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.operating-year-facts b,
.operating-year-facts small {
  display: block;
}

.operating-year-facts small {
  margin-top: 2px;
  color: var(--muted);
}

.operating-year-missing {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 28px;
}

.operating-gap-chip {
  border: 0;
  cursor: pointer;
  box-shadow: none;
}

.operating-gap-chip:hover {
  filter: brightness(0.96);
}

.operating-gap-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.operating-gap-editor > summary {
  cursor: pointer;
  padding: 12px 14px;
  background: #fff7ed;
  color: #92400e;
  font-weight: 800;
}

.operating-gap-sections {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.operating-gap-sections section {
  display: grid;
  gap: 8px;
}

.operating-gap-sections h4 {
  margin: 0;
  color: var(--ink);
}

.operating-gap-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.65fr) minmax(105px, 0.45fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.operating-gap-row div {
  min-width: 0;
}

.operating-gap-row strong,
.operating-gap-row small {
  display: block;
}

.operating-gap-row small {
  color: var(--muted);
}

.operating-gap-row input[type="file"] {
  min-width: 0;
}

@media (max-width: 900px) {
  .operating-gap-row {
    grid-template-columns: 1fr;
  }
}

.operating-missing-list {
  display: grid;
  gap: 10px;
}

.operating-missing-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.operating-missing-card > summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  background: #f8fafc;
}

.operating-missing-card > summary strong {
  min-width: 0;
}

.operating-missing-card > summary small {
  color: var(--muted);
}

.operating-missing-body {
  padding: 14px;
}

.inline-cost-editor {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 10px;
  background: #fbfdff;
}

.receipt-drop-zone {
  display: grid;
  gap: 7px;
  align-items: center;
  justify-items: center;
  margin-bottom: 14px;
  padding: 18px;
  border: 2px dashed #9bb8d8;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fbff, #eef6ff);
  color: var(--ink);
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.receipt-drop-zone strong {
  font-size: 1rem;
}

.receipt-drop-zone span {
  max-width: 520px;
  color: var(--muted);
}

.receipt-drop-zone input[type="file"] {
  width: min(100%, 420px);
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.receipt-drop-zone.drag-over {
  border-color: var(--blue);
  background: #e7f3ff;
  transform: translateY(-1px);
}

.compact-form {
  margin-top: 10px;
}

.object-document-topics {
  display: grid;
  gap: 10px;
}

.object-document-topic {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.object-document-topic > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}

.object-document-topic > summary span:first-child {
  display: grid;
  gap: 2px;
}

.object-document-topic > summary small {
  color: var(--muted);
  font-weight: 500;
}

.object-document-topic .panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.operating-prep-panel {
  border-left: 4px solid var(--blue);
}

.operating-prep-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.operating-prep-topic {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.operating-prep-topic > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}

.operating-prep-topic > summary span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.operating-prep-topic > summary small {
  color: var(--muted);
  font-weight: 500;
}

.operating-prep-topic .form-grid,
.operating-prep-topic .assistant-hint,
.operating-prep-topic .actions {
  margin: 14px;
}

.assistant-prepared-suggestion {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #b7d7ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f2f8ff;
}

.assistant-prepared-suggestion.empty {
  border-color: var(--border);
  border-left-color: #94a3b8;
  background: #f8fafc;
}

.assistant-prepared-suggestion p {
  margin: 4px 0 0;
  color: var(--muted);
}

.prepared-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.prepared-facts span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.prepared-facts small {
  color: var(--muted);
}

.operating-live-preview {
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.operating-live-preview > .section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}

.operating-live-preview > .section-title-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.operating-live-preview .assistant-hint {
  margin: 12px 14px;
}

.operating-live-preview iframe {
  display: block;
  width: 100%;
  height: 680px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}

.document-live-frame {
  margin: 0 14px 14px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef4fb 100%);
}

.assistant-question {
  max-width: 920px;
  margin-bottom: 18px;
}

.assistant-question h3 {
  margin: 8px 0 6px;
  font-size: 1.35rem;
  color: var(--ink);
}

.assistant-known-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.single-question-controls {
  max-width: 720px;
  align-items: end;
}

.operating-assistant-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.assistant-main-question,
.assistant-source-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.assistant-source-panel {
  position: sticky;
  top: 92px;
}

.assistant-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.assistant-secondary-editor,
.operating-assistant-health,
.assistant-progress {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin: 14px 0;
  overflow: hidden;
}

.assistant-secondary-editor > summary,
.operating-assistant-health > summary,
.assistant-progress > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f6f8fb;
}

.assistant-secondary-editor > *:not(summary),
.operating-assistant-health > *:not(summary),
.assistant-progress > *:not(summary) {
  margin: 12px;
}

.assistant-sub-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f9fbff;
  margin: 12px;
  overflow: hidden;
}

.assistant-sub-panel > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 11px 12px;
  background: #eef4ff;
}

.assistant-sub-panel > *:not(summary) {
  margin: 12px;
}

.heating-unit-stack {
  display: grid;
  gap: 10px;
}

.heating-unit-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.heating-unit-card > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f7fafc;
}

.heating-unit-body {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.heating-segment-list {
  display: grid;
  gap: 6px;
}

.heating-segment-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e7edf5;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1.4fr) minmax(150px, 1fr) minmax(120px, .8fr);
  padding: 8px 10px;
}

.heating-reading-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.heating-reading-head,
.heating-reading-row {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(110px, .9fr) minmax(110px, .9fr) minmax(90px, .7fr) minmax(90px, .7fr) minmax(130px, .9fr) minmax(130px, .9fr) minmax(130px, 1fr);
  min-width: 900px;
}

.heating-reading-head {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.heating-reading-row input {
  min-width: 0;
}

.heating-reading-row.is-new {
  opacity: .88;
}

@media (max-width: 980px) {
  .operating-wizard-hero,
  .assistant-landing {
    grid-template-columns: 1fr;
  }

  .operating-wizard-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .operating-assistant-split {
    grid-template-columns: 1fr;
  }

  .assistant-source-panel {
    position: static;
  }
}

.calendar-board-panel {
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.calendar-toolbar h2 {
  margin: 0;
  min-width: 220px;
  text-transform: capitalize;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.calendar-weekday {
  padding: 8px 10px;
  background: #eef6ff;
  color: var(--blue);
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  min-height: 128px;
  padding: 8px;
  background: #fff;
}

.calendar-day-head {
  appearance: none;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  text-align: left;
  cursor: pointer;
}

.calendar-day-head span {
  color: var(--muted);
  font-size: .82rem;
}

.calendar-day.today {
  background: #fffdf2;
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, .45);
}

.calendar-day.muted-month {
  background: #f8fafc;
  color: var(--muted);
}

.calendar-day-events {
  display: grid;
  gap: 5px;
}

.calendar-mini-event {
  appearance: none;
  width: 100%;
  min-height: 0;
  padding: 5px 6px;
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 6px;
  background: #eef6ff;
  color: var(--ink);
  text-align: left;
  line-height: 1.2;
}

.calendar-mini-event.task {
  border-color: rgba(15, 118, 110, .22);
  background: #ecfdf5;
}

.calendar-mini-event span {
  display: inline-block;
  margin-right: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.calendar-mini-event strong {
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.calendar-more {
  color: var(--muted);
  font-size: .78rem;
}

.calendar-agenda {
  display: grid;
  gap: 10px;
}

.calendar-agenda-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.calendar-agenda-row h3 {
  margin: 0 0 4px;
}

.calendar-agenda-date {
  display: grid;
  gap: 4px;
  color: var(--blue);
}

.calendar-agenda-date span {
  color: var(--muted);
}

.calendar-selected-panel {
  border-left: 4px solid var(--yellow);
}

.calendar-settings-panel summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.calendar-settings-panel summary::-webkit-details-marker {
  display: none;
}

.calendar-day-panel {
  border-left: 4px solid var(--blue);
}

.calendar-day-timeline {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.calendar-time-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}

.calendar-time-row:last-child {
  border-bottom: 0;
}

.calendar-time-row.busy {
  background: #f8fbff;
}

.calendar-time-row.blocked {
  background: #fff7ed;
}

.calendar-time {
  padding: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.calendar-time-content {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.calendar-time-event,
.calendar-free-slot {
  appearance: none;
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
}

.calendar-time-event {
  border: 1px solid rgba(37, 99, 235, .22);
  background: #eef6ff;
}

.calendar-time-event.task {
  border-color: rgba(15, 118, 110, .22);
  background: #ecfdf5;
}

.calendar-time-event strong,
.calendar-time-event span {
  display: block;
}

.calendar-time-event span {
  color: var(--muted);
  font-size: .84rem;
}

.calendar-free-slot {
  border: 1px dashed var(--line);
  background: #fff;
  color: var(--muted);
}

.calendar-blocked-slot {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: #ffedd5;
  color: #9a3412;
  font-weight: 700;
}

.calendar-availability-preview {
  margin-top: 12px;
}

.today-important {
  border-left: 4px solid var(--green);
}

.important-card {
  border-left: 4px solid var(--blue);
}

.important-card.overdue {
  border-left-color: var(--red);
}

.important-list {
  display: grid;
  gap: 10px;
}

.important-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.important-row p {
  margin: 4px 0 0;
}

.compact-form {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.compact-form input,
.compact-form select {
  min-height: 36px;
}

.hkv-card-list,
.meter-card-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.unit-meter-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.unit-meter-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
  overflow: hidden;
}

.unit-meter-block summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 900;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.unit-meter-block .meter-management-panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.unit-meter-block.has-warning {
  border-left: 4px solid var(--yellow);
}

.unit-meter-block.has-error {
  border-left: 4px solid var(--red);
}

.room-inventory-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.room-inventory-block {
  border-left: 4px solid var(--blue);
}

.room-inventory-block summary {
  justify-content: flex-start;
}

.room-inventory-block summary .muted {
  margin-left: auto;
  font-weight: 750;
}

.room-inventory-body {
  display: grid;
  gap: 12px;
  padding: 12px;
  background: #fbfdff;
}

.room-inventory-room-fields {
  grid-template-columns: minmax(220px, 1.2fr) minmax(140px, .5fr) auto;
  align-items: end;
}

.room-inventory-room-actions {
  margin-bottom: 0;
}

.room-inventory-add-form {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) 90px minmax(170px, 1fr) minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.measurement-panel {
  display: grid;
  gap: 14px;
}

.measurement-new-block {
  border-left: 4px solid var(--green);
}

.measurement-form {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.measurement-grid {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) minmax(240px, 1.2fr);
}

.measurement-method-box {
  display: grid;
  grid-template-columns: 1.35fr .85fr;
  gap: 12px;
}

.measurement-method-box > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 12px;
}

.measurement-method-box h3 {
  margin: 0 0 6px;
}

.measurement-side-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.measurement-result-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  border-radius: 8px;
  background: #f5f9fc;
}

.measurement-result-row .muted {
  margin-right: auto;
}

.measurement-block {
  border-left: 4px solid var(--green);
}

.measurement-floorplan-block {
  border-left: 4px solid var(--blue);
}

.floorplan-calibration-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(280px, .75fr);
  gap: 14px;
  padding: 14px;
  align-items: stretch;
}

.floorplan-calibration-canvas {
  position: relative;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f8fb;
  overflow: hidden;
}

.floorplan-calibration-image,
.floorplan-calibration-frame {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: block;
  border: 0;
  object-fit: fill;
  background: white;
}

.floorplan-click-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  border: 0;
  background: transparent;
  cursor: crosshair;
  appearance: none;
  touch-action: none;
}

.floorplan-calibration-overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floorplan-calibration-overlay * {
  pointer-events: none;
}

.floorplan-calibration-line {
  stroke: #0f73d9;
  stroke-width: .45;
  vector-effect: non-scaling-stroke;
}

.floorplan-calibration-point {
  fill: #ff7a00;
  stroke: white;
  stroke-width: .28;
  vector-effect: non-scaling-stroke;
}

.floorplan-calibration-label {
  fill: #08324f;
  font-size: 1.35px;
  font-weight: 800;
  paint-order: stroke;
  stroke: white;
  stroke-width: .22;
}

.floorplan-room-polygon {
  fill: rgba(22, 126, 80, .2);
  stroke: #167e50;
  stroke-width: .55;
  vector-effect: non-scaling-stroke;
}

.floorplan-room-line {
  fill: none;
  stroke: #167e50;
  stroke-width: .55;
  stroke-dasharray: 1.4 1;
  vector-effect: non-scaling-stroke;
}

.floorplan-room-point {
  fill: #167e50;
  stroke: white;
  stroke-width: .18;
  vector-effect: non-scaling-stroke;
}

.floorplan-room-label {
  fill: #0f3d2b;
  font-size: 1.15px;
  font-weight: 800;
  paint-order: stroke;
  stroke: white;
  stroke-width: .2;
}

.floorplan-saved-wall {
  fill: none;
  stroke: #263238;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: none;
  opacity: .72;
}

.floorplan-saved-wall.wall,
.floorplan-saved-wall.outside,
.floorplan-saved-wall.inside {
  stroke: rgba(38, 50, 56, .78);
}

.floorplan-saved-wall.door {
  stroke: rgba(135, 75, 24, .9);
  stroke-linecap: butt;
}

.floorplan-saved-wall.window {
  stroke: rgba(15, 115, 217, .9);
  stroke-linecap: butt;
}

.floorplan-saved-wall-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.floorplan-saved-wall-list h4 {
  margin: 0;
}

.floorplan-saved-wall-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.4fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.clean-floorplan-block {
  border-left: 4px solid var(--green);
}

.clean-floorplan-preview {
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.clean-floorplan-preview svg {
  display: block;
  width: 100%;
  min-height: 420px;
  max-height: 720px;
  background: #fff;
  border: 1px solid #dfe6ea;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 35, 55, .08);
}

.clean-floorplan-paper {
  fill: #fff;
}

.clean-floorplan-room {
  fill: rgba(15, 115, 217, .045);
  stroke: rgba(15, 115, 217, .18);
  stroke-width: .16;
}

.clean-floorplan-line {
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
  opacity: .95;
}

.clean-floorplan-line.wall {
  stroke: #1f2933;
}

.clean-floorplan-line.door {
  stroke: #8a4b18;
  stroke-linecap: butt;
}

.clean-floorplan-line.window {
  stroke: #0f73d9;
  stroke-linecap: butt;
}

.clean-floorplan-corner {
  fill: #263238;
  opacity: .18;
}

.clean-floorplan-label {
  fill: #2e4658;
  font-size: 1.05px;
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, .95);
  stroke-width: .18;
}

.floorplan-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: .88rem;
}

.floorplan-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.floorplan-legend i {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 999px;
  background: rgba(38, 50, 56, .78);
}

.floorplan-legend i.door {
  background: rgba(135, 75, 24, .9);
}

.floorplan-legend i.window {
  background: rgba(15, 115, 217, .9);
}

.floorplan-wall-draft {
  fill: none;
  stroke: #9b3fdb;
  stroke-dasharray: .65 .45;
  stroke-linecap: square;
  stroke-linejoin: miter;
  vector-effect: none;
  opacity: .72;
}

.floorplan-calibration-shell:has([data-measure-wall-type] option[value="door"]:checked) .floorplan-wall-draft {
  stroke: rgba(135, 75, 24, .9);
}

.floorplan-calibration-shell:has([data-measure-wall-type] option[value="window"]:checked) .floorplan-wall-draft {
  stroke: rgba(15, 115, 217, .9);
}

.floorplan-wall-point {
  fill: #9b3fdb;
  stroke: white;
  stroke-width: .18;
  vector-effect: non-scaling-stroke;
}

.floorplan-wall-label {
  fill: #4a126c;
  font-size: .75px;
  font-weight: 800;
  paint-order: stroke;
  stroke: white;
  stroke-width: .13;
}

.floorplan-saved-corner {
  fill: #ffffff;
  stroke: #263238;
  stroke-width: .2;
  vector-effect: non-scaling-stroke;
}

.floorplan-corner-draft {
  fill: #e9f3ff;
  stroke: #0f73d9;
  stroke-width: .2;
  vector-effect: non-scaling-stroke;
}

.floorplan-corner-label {
  fill: #172331;
  font-size: .72px;
  font-weight: 800;
  paint-order: stroke;
  stroke: white;
  stroke-width: .12;
}

.floorplan-saved-polygon {
  fill: rgba(15, 115, 217, .12);
  stroke: rgba(15, 115, 217, .78);
  stroke-width: .42;
  vector-effect: non-scaling-stroke;
}

.floorplan-saved-label {
  fill: #07345f;
  font-size: 1.05px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: .18;
}

.floorplan-calibration-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floorplan-calibration-panel h3 {
  margin: 0;
}

.readonly-value {
  display: block;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 9px 10px;
  font-weight: 700;
  color: var(--ink);
}

.measurement-mode-control {
  justify-content: flex-start;
}

[data-measure-start].active,
.measurement-mode-control button.active {
  background: #0f73d9;
  color: white;
  border-color: #0f73d9;
  box-shadow: 0 8px 18px rgba(15, 115, 217, .18);
}

.floorplan-room-draw-box {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  gap: 10px;
}

.floorplan-room-draw-box h3 {
  margin: 0;
}

@media (max-width: 980px) {
  .floorplan-calibration-shell {
    grid-template-columns: 1fr;
  }
}

.garden-block {
  border-left: 4px solid var(--green);
}

.garden-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin: 14px 0 6px;
}

.garden-overview-tile {
  min-height: 118px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(22, 126, 80, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, #e8f7ee, #c9ead6);
  color: #123d29;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  text-align: left;
  box-shadow: 0 10px 22px rgba(18, 61, 41, 0.08);
}

.garden-overview-tile:hover {
  transform: translateY(-1px);
  border-color: var(--green);
}

.garden-overview-tile strong {
  font-size: 16px;
}

.garden-overview-tile span {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.garden-overview-tile small {
  color: #3f6d55;
  font-weight: 800;
}

.garden-overview-tile.muted-tile {
  background: linear-gradient(180deg, #eef4ef, #dfe9e1);
  color: #526157;
}

.subpanel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
}

.hkv-card,
.meter-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(22, 34, 48, 0.05);
}

.meter-card summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  font-weight: 900;
}

.meter-card[open] summary {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.meter-card.has-warning {
  border-left: 4px solid var(--yellow);
}

.meter-card.has-error {
  border-left: 4px solid var(--red);
}

.hkv-card h4 {
  margin: 0 0 4px;
}

.hkv-card p {
  margin: 0;
}

.hkv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.hkv-grid label {
  display: grid;
  gap: 6px;
  color: var(--soft-ink);
  font-size: 12px;
  font-weight: 800;
}

.hkv-grid input,
.hkv-grid select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.key-row-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.key-row-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.key-row-block summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  background: #fff;
}

.key-row-block[open] summary {
  border-bottom: 1px solid var(--line);
}

.key-row-block.has-warning {
  border-left: 4px solid var(--yellow);
}

.key-row-block.has-error {
  border-left: 4px solid var(--red);
}

.key-validation {
  border-left: 4px solid var(--yellow);
}

.key-validation-ok {
  border-left: 4px solid var(--green);
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  min-height: 30px;
  font-size: 13px;
  font-weight: 800;
}

.app-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2000;
  width: min(460px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  font-weight: 800;
}

.app-notice-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.floorplan-panel {
  border-left: 4px solid var(--blue);
}

.floorplan-viewer {
  display: grid;
  place-items: center;
  min-height: 360px;
  max-height: 620px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
  overflow: hidden;
}

.floorplan-frame {
  width: 100%;
  height: 620px;
  border: 0;
  background: #fff;
}

.floorplan-image {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
}

.unit-photos-panel {
  border-left: 4px solid var(--green);
}

.unit-photo-grid,
.advertising-media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.unit-photo-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.unit-photo-grid img,
.advertising-media-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f8fbfc;
}

.image-file-placeholder {
  width: 100%;
  min-height: 116px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  background: #f8fbfc;
  color: var(--muted);
  text-align: center;
}

.image-file-placeholder strong {
  color: var(--ink);
  font-size: 13px;
}

.image-file-placeholder span {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
}

.heic-preview-box {
  width: 100%;
  min-height: 116px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px dashed var(--line);
  background: #f8fbfc;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
}

.heic-preview-box span {
  font-weight: 900;
  color: var(--ink);
}

.heic-preview-box small {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.heic-preview-box.is-ready {
  display: block;
  padding: 0;
  border: 0;
}

.heic-preview-box.has-error {
  border-color: var(--red);
  color: var(--red);
}

.heic-preview-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f8fbfc;
}

.unit-photo-grid figcaption {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
}

.advertising-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.advertising-card {
  border-left: 4px solid var(--blue);
}

.advertising-property-group,
.advertising-unit-detail {
  overflow: hidden;
}

.advertising-property-group > summary,
.advertising-unit-detail > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.advertising-property-group > summary::-webkit-details-marker,
.advertising-unit-detail > summary::-webkit-details-marker {
  display: none;
}

.advertising-property-group > summary::before,
.advertising-unit-detail > summary::before {
  content: ">";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4f8;
  color: var(--blue);
  font-weight: 900;
  transition: transform 0.18s ease;
}

.advertising-property-group[open] > summary::before,
.advertising-unit-detail[open] > summary::before {
  transform: rotate(90deg);
}

.advertising-unit-detail > summary {
  padding: 2px 0;
}

.advertising-unit-body {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.expose-format-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.expose-format-option {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.expose-format-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.expose-format-option span {
  display: grid;
  gap: 5px;
  min-height: 84px;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.expose-format-option strong {
  color: var(--ink);
  font-size: 15px;
}

.expose-format-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.expose-format-option input:checked + span {
  border-color: var(--blue);
  background: #eef5ff;
  box-shadow: inset 4px 0 0 var(--blue);
}

.expose-output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.expose-output-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #f8fbfc;
}

.expose-output-card-short {
  border-left-color: var(--green);
}

.expose-output-card > div:first-child {
  display: grid;
  gap: 3px;
}

.expose-output-card span {
  color: var(--muted);
  font-size: 12px;
}

.advertising-secondary-actions {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.advertising-workflow {
  margin: 0;
  padding: 10px 12px 10px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbfc;
  color: var(--soft-ink);
  font-weight: 800;
}

.advertising-workflow li + li {
  margin-top: 4px;
}

.advertising-card textarea {
  min-height: 150px;
}

.advertising-media-strip .empty-state {
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.compact-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.task-maintenance {
  border-left-color: var(--yellow);
}

.task-reports {
  border-left-color: var(--blue);
}

.task-documents {
  border-left-color: var(--violet);
}

.task-documents-panel {
  border-left: 4px solid var(--blue);
}

.task-proof-panel {
  border-left: 4px solid var(--yellow);
}

.task-template-help {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.task-template-help summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--soft-ink);
}

.task-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}

.task-gallery-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.image-button {
  display: block;
  width: 120px;
  height: 90px;
  min-height: 90px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.image-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-file-card {
  border-left: 4px solid var(--violet);
}

.task-deadlines {
  border-left-color: var(--red);
}

.task-general {
  border-left-color: var(--green);
}

.preflight-checks {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.preflight-checks li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.preflight-checks button {
  margin-top: 8px;
}

.field-highlight {
  border-color: #d8c26a !important;
  background: #fffdf0 !important;
}

.field-highlight input,
.field-highlight select,
.field-highlight textarea {
  border-color: #c6a900 !important;
  box-shadow: 0 0 0 2px rgba(198, 169, 0, 0.12);
}

.field-warning {
  border-color: #f1b66f !important;
  background: #fff8ee !important;
}

.field-warning input,
.field-warning select,
.field-warning textarea {
  border-color: #dc8a2d !important;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 700;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.form-grid input[readonly] {
  color: var(--muted);
  background: #f4f7f9;
}

.raw-editor {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.raw-editor summary {
  cursor: pointer;
  font-weight: 800;
}

.raw-editor textarea {
  min-height: 280px;
  margin: 12px 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.history-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.history-block h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 800;
  text-align: left;
}

.admin-item-label {
  display: grid;
  gap: 2px;
  color: var(--ink);
  line-height: 1.25;
}

.admin-item-label strong {
  color: var(--blue);
  font-size: 12px;
}

.admin-item-label span {
  font-weight: 700;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.button-like input {
  display: none;
}

.workflow-box {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.workflow-box input,
.workflow-box select,
.workflow-box textarea {
  width: 100%;
}

.timeline-mini {
  display: grid;
  gap: 4px;
  min-width: 180px;
  color: var(--soft-ink);
  font-size: 13px;
}

.rent-template-group {
  border-left: 4px solid #f59e0b;
}

.rent-template-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.rent-template-card {
  box-shadow: none;
  border: 1px solid var(--line);
}

.rent-template-card header {
  align-items: flex-start;
}

.rent-template-editor {
  margin-top: 10px;
}

.rent-template-editor textarea[data-rent-snippet-field="text"] {
  min-height: 260px;
  font-family: inherit;
  line-height: 1.55;
}

.rent-deadline-warning {
  margin-top: 10px;
  max-width: 980px;
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.rent-live-preview {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.letter-preview-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 34px;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  line-height: 1.55;
}

.letter-preview-recipient {
  margin-bottom: 22px;
  min-height: 74px;
  white-space: pre-line;
}

.letter-preview-meta {
  text-align: right;
  margin-bottom: 18px;
  color: var(--soft-ink);
}

.letter-preview-sheet h3 {
  margin: 0 0 16px;
  color: var(--brand);
}

.letter-preview-sheet p {
  margin: 0 0 12px;
}

.missing-variable {
  display: inline;
  padding: 1px 4px;
  border-radius: 4px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 700;
}

.filled-variable {
  font-weight: 700;
}

.letter-preview-signature {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--soft-ink);
}

.rent-required-check {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rent-required-check.warning {
  border-color: #fecaca;
  background: #fff7ed;
}

.rent-required-check.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.rent-unit-checklist {
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.rent-unit-checklist.warning {
  border-color: #fed7aa;
  background: #fff7ed;
}

.rent-unit-checklist.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.rent-unit-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.rent-unit-check-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rent-unit-check-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.rent-unit-check-card p {
  margin: 8px 0 10px;
  color: var(--soft-ink);
}

.compact-field {
  display: grid;
  gap: 4px;
  margin: 8px 0 10px;
  font-size: 13px;
  color: var(--soft-ink);
}

.compact-field input {
  width: 100%;
}

.rent-unit-check-card.needs-work {
  border-color: #fecaca;
}

.voluntary-rent-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.voluntary-rent-workspace {
  display: grid;
  gap: 16px;
}

.voluntary-status-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.voluntary-status-board article {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 132px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: linear-gradient(180deg, #f0fdf4, #fff);
}

.voluntary-status-board span {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.voluntary-status-board strong {
  color: var(--ink);
  font-size: 15px;
}

.voluntary-status-board small {
  color: var(--soft-ink);
  line-height: 1.35;
}

.voluntary-status-board button {
  margin-top: 4px;
  justify-self: start;
}

.voluntary-pdf-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr);
  gap: 14px;
  align-items: stretch;
}

.voluntary-pdf-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.voluntary-pdf-action-group strong {
  flex-basis: 100%;
  color: var(--ink);
}

.voluntary-pdf-action-group.total {
  border-color: rgba(22, 163, 74, 0.38);
  background: linear-gradient(180deg, #f0fdf4, #fff);
}

.voluntary-rent-editor-stack {
  display: grid;
  gap: 12px;
}

.voluntary-folder {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.voluntary-folder summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 14px 16px;
  cursor: pointer;
  background: #f8fafc;
}

.voluntary-folder summary strong {
  color: var(--ink);
  font-size: 15px;
}

.voluntary-folder summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.voluntary-folder-body {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.voluntary-preview-column {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
  align-self: start;
}

.voluntary-schedule {
  display: grid;
  gap: 10px;
}

.voluntary-schedule-compact {
  margin: 10px 0 12px;
}

.voluntary-schedule-compact .staffel-row {
  grid-template-columns: minmax(110px, .8fr) minmax(110px, .85fr) minmax(80px, .55fr) minmax(180px, 1.35fr);
  gap: 8px;
  padding: 8px;
  background: #f8fafc;
}

.voluntary-staffel-card .voluntary-schedule-compact .staffel-row {
  grid-template-columns: minmax(140px, .8fr) minmax(130px, .7fr) minmax(160px, .9fr) minmax(120px, .65fr) minmax(250px, 1.45fr);
  align-items: end;
  padding: 10px 12px;
}

.voluntary-schedule-static {
  display: grid;
  gap: 5px;
  min-height: 58px;
  align-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.voluntary-schedule-static span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.voluntary-schedule-static strong {
  color: var(--ink);
  font-size: 14px;
}

.voluntary-staffel-card .voluntary-schedule-meter {
  min-height: 62px;
}

.voluntary-staffel-card .table-wrap {
  max-width: 760px;
}

.voluntary-option-inputs {
  margin: 8px 0 12px;
}

.voluntary-summary-grid,
.voluntary-decision-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.voluntary-option-card,
.voluntary-board-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.voluntary-board-card.wide {
  grid-column: 1 / -1;
}

.voluntary-collapse-card {
  padding: 0;
  gap: 0;
}

.voluntary-collapse-card > summary {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.voluntary-collapse-card > summary strong {
  font-size: 16px;
}

.voluntary-collapse-card > summary span:not(.chip) {
  grid-column: 1 / -1;
}

.voluntary-collapse-body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.voluntary-collapse-body-embedded > .voluntary-board-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.voluntary-option-card h3,
.voluntary-board-card h3 {
  margin: 0;
}

.voluntary-option-card p,
.voluntary-board-card p {
  margin: 0;
  color: var(--soft-ink);
}

.voluntary-board-card table th {
  width: 34%;
}

.voluntary-board-card table td,
.voluntary-board-card table th {
  vertical-align: top;
}

.voluntary-legal-note {
  padding: 11px 12px;
  border-left: 4px solid #2457c5;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--soft-ink);
  line-height: 1.45;
}

.voluntary-letter-editor {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--soft-ink);
  font-weight: 700;
}

.voluntary-letter-editor textarea {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  font: 14px/1.55 Arial, sans-serif;
  color: var(--ink);
}

.voluntary-template-editor {
  margin-top: 14px;
}

.voluntary-template-editor summary {
  align-items: center;
}

.voluntary-template-buttons {
  margin: 12px 0;
}

.voluntary-template-buttons .actions {
  gap: 6px;
}

.voluntary-live-preview {
  max-width: none;
}

.voluntary-letter-sheet {
  padding: 34px 42px;
}

.voluntary-attachment-sheet {
  padding-top: 28px;
}

.voluntary-attachment-sheet table {
  font-size: 12px;
}

.voluntary-attachment-sheet th,
.voluntary-attachment-sheet td {
  padding: 7px 8px;
}

.voluntary-preview-part {
  display: inline-flex;
  width: max-content;
  margin-bottom: 12px;
  padding: 4px 8px;
  color: #174ea6;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.letter-preview-comparison {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13px;
}

.voluntary-comparison-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
}

.voluntary-schedule-meter {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  color: var(--soft-ink);
}

.voluntary-schedule-meter strong {
  color: var(--ink);
}

.voluntary-meter-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.voluntary-meter-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #f59e0b);
}

.voluntary-kappung-card {
  background: linear-gradient(180deg, #fff, #fff7ed);
  border-color: #fed7aa;
}

.voluntary-kappung-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.voluntary-kappung-summary span {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff;
  color: var(--soft-ink);
}

.voluntary-kappung-summary strong {
  color: var(--ink);
}

.voluntary-kappung-steps {
  display: grid;
  gap: 10px;
}

.voluntary-kappung-step {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.voluntary-kappung-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(150px, 1.2fr);
  gap: 10px;
  align-items: center;
}

.voluntary-kappung-step small {
  color: var(--soft-ink);
}

.mini-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mini-stat-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #f8fafc;
  font-weight: 700;
  text-align: center;
}

.mini-table table {
  font-size: 13px;
}

@media (max-width: 980px) {
  .topbar,
  .shell,
  .hero,
  .dashboard-layout,
  .split {
    display: block;
  }

  .dashboard-column {
    margin-top: 14px;
  }

  .dashboard-admin-row {
    grid-template-columns: 1fr 110px;
  }

  .top-actions {
    margin-top: 12px;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doc-choice-grid,
  .digital-row,
  .expose-format-switch,
  .expose-output-grid,
  .template-paragraph,
  .staffel-row,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .voluntary-rent-layout {
    grid-template-columns: 1fr;
  }

  .voluntary-preview-column {
    position: static;
  }

  .voluntary-summary-grid,
  .voluntary-decision-board,
  .voluntary-status-board,
  .voluntary-pdf-actions,
  .voluntary-kappung-summary,
  .voluntary-kappung-row,
  .mini-stat-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main,
  .sidebar {
    padding: 12px;
  }

  nav,
  .metric-grid,
  .dashboard-metrics,
  .dashboard-subgrid,
  .dashboard-admin-row,
  .search-row,
  .form-grid,
  .compact-form,
  .admin-controls {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .task-gallery-item {
    grid-template-columns: 1fr;
  }

  .image-button {
    width: 100%;
    height: 180px;
  }

  .unit-photo-grid,
  .advertising-media-strip,
  .compact-metrics {
    grid-template-columns: 1fr;
  }
}
.letterhead-live-preview {
  display: grid;
  gap: 10px;
}

.letterhead-preview-panel {
  position: sticky;
  top: 78px;
  align-self: start;
  max-height: calc(100vh - 92px);
  overflow: auto;
}

.letterhead-position-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 10px 0 14px;
}

.letterhead-position-tools > div {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.nudge-grid {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}

.nudge-grid button {
  width: 36px;
  min-width: 36px;
  padding: 6px 0;
}

.letterhead-paper {
  position: relative;
  width: min(100%, calc(420px * var(--preview-zoom, 1)));
  aspect-ratio: 210 / 297;
  background: #fff;
  border: 1px solid #d8e0ea;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .12);
  overflow: hidden;
}

.letterhead-fold-mark {
  position: absolute;
  left: 0;
  width: 7.6%;
  border-top: 1px solid #ef4444;
  z-index: 3;
}

.letterhead-fold-mark.first {
  top: calc(105 / 297 * 100%);
}

.letterhead-fold-mark.second {
  top: calc(210 / 297 * 100%);
}

.letterhead-fold-mark span {
  position: absolute;
  left: 105%;
  top: -8px;
  color: #b91c1c;
  font-size: 5.5px;
  background: rgba(255, 255, 255, .86);
  padding: 1px 3px;
  white-space: nowrap;
}

.letterhead-window-zone {
  position: absolute;
  left: calc(20 / 210 * 100%);
  top: calc(45 / 297 * 100%);
  width: calc(85 / 210 * 100%);
  height: calc(45 / 297 * 100%);
  border: 1px dashed #2563eb;
  background: rgba(37, 99, 235, .055);
  z-index: 1;
  pointer-events: none;
}

.letterhead-window-zone span {
  position: absolute;
  left: 4px;
  top: 4px;
  color: #1d4ed8;
  font-size: 6px;
  font-weight: 700;
  background: rgba(255, 255, 255, .75);
  padding: 1px 3px;
}

.letterhead-paper img[data-letter-preview-logo] {
  position: absolute;
  left: calc(var(--logo-x, 111) / 210 * 100%);
  top: calc(var(--logo-y, 10) / 297 * 100%);
  width: calc(var(--logo-w, 30) / 210 * 100%);
  height: calc(var(--logo-h, 19) / 297 * 100%);
  object-fit: contain;
}

.letterhead-paper img[data-letter-preview-qr],
.letterhead-qr-placeholder {
  position: absolute;
  left: calc(var(--qr-x, 145) / 210 * 100%);
  top: calc(var(--qr-y, 78) / 297 * 100%);
  width: calc(var(--qr-w, 24) / 210 * 100%);
  height: calc(var(--qr-h, 24) / 297 * 100%);
  object-fit: contain;
  z-index: 2;
}

.letterhead-qr-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed #94a3b8;
  color: #64748b;
  font-size: 8px;
  font-weight: 800;
  background: rgba(248, 250, 252, .8);
}

.letterhead-brand {
  position: absolute;
  left: calc(var(--text-x, 145) / 210 * 100%);
  top: calc(var(--text-y, 10) / 297 * 100%);
  width: 34%;
  display: grid;
  gap: 2px;
  color: #172033;
  font-size: 7px;
  line-height: 1.25;
}

.letterhead-brand strong {
  font-size: 10px;
  color: #15243a;
}

.letterhead-bank {
  position: absolute;
  left: calc(var(--bank-x, 145) / 210 * 100%);
  top: calc(var(--bank-y, 42) / 297 * 100%);
  width: 34%;
  display: grid;
  gap: 2px;
  color: #172033;
  font-size: 6.8px;
  line-height: 1.28;
  font-weight: 500;
}

.letterhead-bank strong {
  font-size: 7.6px;
  font-weight: 800;
  color: #15243a;
}

.letterhead-contact {
  position: absolute;
  left: calc(var(--contact-x, 145) / 210 * 100%);
  top: calc(var(--contact-y, 58) / 297 * 100%);
  width: 30%;
  font-weight: 600;
  color: #172033;
  font-size: 6.5px;
  line-height: 1.25;
}

.letterhead-paper small[data-letter-preview-sender] {
  position: absolute;
  left: calc(var(--sender-x, 20) / 210 * 100%);
  top: calc(var(--sender-y, 57) / 297 * 100%);
  width: 44%;
  color: #64748b;
  font-size: 6px;
}

.letterhead-address-sample {
  position: absolute;
  left: calc(var(--recipient-x, 20) / 210 * 100%);
  top: calc(var(--recipient-y, 65) / 297 * 100%);
  color: #172033;
  font-size: 9px;
  line-height: 1.45;
}

.letterhead-date-sample,
.letterhead-subject-sample,
.letterhead-reference-sample,
.letterhead-document-title-sample,
.letterhead-page-sample {
  position: absolute;
  color: #172033;
  line-height: 1.3;
}

.letterhead-date-sample {
  left: calc(var(--date-x, 135) / 210 * 100%);
  top: calc(var(--date-y, 95) / 297 * 100%);
  font-size: 7px;
}

.letterhead-subject-sample {
  left: calc(var(--subject-x, 20) / 210 * 100%);
  top: calc(var(--subject-y, 112) / 297 * 100%);
  font-size: 9px;
  font-weight: 800;
  color: #2457c5;
}

.letterhead-reference-sample {
  left: calc(var(--reference-x, 135) / 210 * 100%);
  top: calc(var(--reference-y, 88) / 297 * 100%);
  font-size: 6.2px;
  color: #475569;
}

.letterhead-page-sample {
  left: calc(var(--page-x, 170) / 210 * 100%);
  top: calc(var(--page-y, 286) / 297 * 100%);
  font-size: 5.8px;
  color: #64748b;
}

.letterhead-document-title-sample {
  left: 10%;
  top: calc(var(--document-title-y, 276) / 297 * 100%);
  right: 10%;
  font-size: 5.8px;
  color: #334155;
  font-weight: 800;
  text-align: center;
  opacity: .4;
}

.letterhead-footer-sample {
  position: absolute;
  left: calc(var(--footer-x, 20) / 210 * 100%);
  top: calc(var(--footer-y, 282) / 297 * 100%);
  right: 8%;
  color: #64748b;
  font-size: 5.5px;
  line-height: 1.35;
  white-space: pre-wrap;
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
}

.letterhead-footer-paragraph {
  display: block;
  margin-bottom: 2px;
  white-space: pre-wrap;
}

.letterhead-footer-sample strong {
  color: #334155;
  font-weight: 800;
}

.issue-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 58%, #f3f7fb 100%);
  border-color: rgba(15, 115, 217, .18);
}

.issue-hero h2 {
  margin-bottom: 6px;
}

.issue-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}

.issue-filter-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.issue-filter-tile:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 115, 217, .38);
  box-shadow: 0 10px 24px rgba(20, 45, 66, .08);
}

.issue-filter-tile.active {
  border-color: rgba(15, 115, 217, .52);
  background: linear-gradient(180deg, #f7fbff, #fff);
  box-shadow: 0 8px 22px rgba(20, 45, 66, .08);
}

.issue-filter-tile input {
  width: 18px;
  height: 18px;
}

.issue-filter-tile strong {
  display: block;
  color: #172033;
  line-height: 1.2;
}

.issue-filter-tile small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.issue-filter-tile b {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #0f5fb8;
  text-align: center;
}
.website-admin-frame-shell {
  padding: 0;
  overflow: hidden;
}

.website-admin-frame-loading,
.website-admin-frame-error {
  margin: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.website-admin-frame-loading {
  color: var(--muted);
}

.website-admin-frame-error {
  border-color: #c85454;
  background: #fff3f1;
  color: #612323;
}

.website-admin-frame-error p {
  margin: 6px 0 12px;
}

.website-admin-frame-error[hidden],
.website-admin-frame-loading[hidden],
.website-admin-frame[hidden] {
  display: none;
}

.website-admin-frame {
  display: block;
  width: 100%;
  min-height: 980px;
  border: 0;
  background: #f5f8fa;
}

.worktime-month-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.worktime-month-controls label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.worktime-time-edit {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) auto minmax(94px, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 260px;
}

.worktime-time-edit label {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 82px;
  align-items: center;
  gap: 8px;
}

@media (max-width: 700px) {
  .worktime-month-controls {
    width: 100%;
    align-items: end;
  }

  .worktime-month-controls label {
    min-width: 0;
    flex: 1;
  }

  .worktime-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .worktime-time-edit {
    min-width: 230px;
  }
}

/* APP-WORKSPACE-001: shared, compact management shell. */
.sr-only,
.workspace-skip-link {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow-y: auto;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.workspace-skip-link:focus {
  inset: 46px auto auto 12px;
  z-index: 1200;
  width: auto;
  height: auto;
  clip: auto;
  padding: 9px 12px;
  border: 2px solid var(--focus);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}

body {
  min-width: 320px;
  background: var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, auto) minmax(260px, 620px) minmax(0, auto);
  gap: 14px;
  min-height: 70px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.brand {
  min-width: 0;
  flex-wrap: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--brand);
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
}

.workspace-search {
  position: relative;
  width: 100%;
  align-self: center;
}

.workspace-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 68px 9px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-alt);
  color: var(--ink);
}

.workspace-search input:focus {
  background: var(--surface);
  border-color: var(--brand);
}

.workspace-search-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 750;
}

.workspace-search-results {
  position: absolute;
  inset: calc(100% + 7px) 0 auto;
  z-index: 150;
  max-height: min(68vh, 540px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 34, 50, .2);
}

.workspace-search-group {
  margin: 6px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.workspace-search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 48px;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.workspace-search-result:hover,
.workspace-search-result:focus-visible {
  background: var(--surface-alt);
}

.workspace-search-result span,
.workspace-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-search-result small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.workspace-search-result b {
  align-self: center;
  color: var(--brand);
  font-size: 12px;
}

.top-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
}

.top-actions > .zoom-controls,
.top-actions > #manualSaveReloadButton,
.top-actions > #quickEventButton,
.top-actions > #cloudUser,
.top-actions > #changePasswordButton,
.top-actions > #saveState,
.top-actions > #exportData,
.top-actions > #logoutButton {
  display: none;
}

.message-badge,
.top-primary,
.profile-trigger {
  min-height: 42px;
}

.workspace-nav-toggle,
.workspace-nav-close,
.sidebar-head {
  display: none;
}

.shell {
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 108px);
}

.sidebar {
  position: sticky;
  top: 108px;
  align-self: start;
  height: calc(100vh - 108px);
  overflow: hidden;
  padding: 12px;
  background: var(--brand-strong);
}

#nav {
  display: grid;
  gap: 5px;
}

#nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 39px;
  padding: 7px 10px;
  border-radius: 6px;
  background: transparent;
  color: #e4edf2;
  font-size: 13px;
}

#nav .nav-root-button,
#nav .nav-section-toggle {
  min-height: 42px;
  font-weight: 850;
}

#nav .nav-section-toggle {
  color: rgba(239, 246, 250, .92);
  background: rgba(255, 255, 255, .055);
}

#nav .nav-section.open > .nav-section-toggle {
  background: rgba(255, 255, 255, .1);
}

.nav-section {
  display: grid;
  gap: 3px;
}

.nav-section-items {
  display: grid;
  gap: 2px;
  padding: 1px 0 3px 8px;
  border-left: 1px solid rgba(255, 255, 255, .16);
}

.nav-section-items[hidden] {
  display: none;
}

#nav .nav-section-items .nav-item {
  min-height: 35px;
  padding: 6px 9px;
  font-size: 12.5px;
}

.nav-section-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.nav-chevron {
  display: inline-grid;
  width: 18px;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  transition: transform .16s ease;
}

.nav-section.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-badge {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--danger);
  font-size: 11px;
  text-align: center;
}

#nav button:hover:not(:disabled) {
  background: rgba(255, 255, 255, .1);
}

#nav button.active {
  background: var(--accent);
  box-shadow: none;
}

#nav button.nav-todos,
#nav button.nav-todos.active {
  color: #e4edf2;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

#nav button.nav-todos:hover,
#nav button.nav-todos.active {
  background: var(--accent);
}

.side-panel {
  padding: 10px;
}

.workspace-main {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.workspace-context {
  position: sticky;
  top: 108px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(10px);
}

.workspace-breadcrumbs {
  min-width: 0;
}

.workspace-context-navigation {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.workspace-breadcrumbs small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.workspace-breadcrumbs strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context-actions {
  display: flex;
  gap: 7px;
}

.workspace-context-actions button {
  min-height: 38px;
  padding: 7px 10px;
}

main {
  gap: 12px;
  padding: 14px 20px 28px;
}

.panel {
  min-width: 0;
  padding: 15px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(19, 39, 55, .055);
  backdrop-filter: none;
}

.panel.hero {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(19, 39, 55, .055);
}

.panel.hero p {
  color: var(--muted);
}

.panel.hero .chip {
  color: var(--brand);
  background: var(--surface-alt);
}

.panel.hero button,
.button,
button.top-primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: none;
}

.panel.hero button:hover,
.button:hover,
button.top-primary:hover {
  background: var(--brand-strong);
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 9px;
}

.metric {
  padding: 11px;
  background: var(--surface);
  box-shadow: none;
}

.metric strong {
  font-size: 20px;
}

.dashboard-layout {
  gap: 11px;
}

.dashboard-column {
  gap: 11px;
}

.dashboard-widget,
.card {
  padding: 13px;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(19, 39, 55, .05);
}

.card {
  min-height: 118px;
}

.record-row summary {
  padding-block: 10px;
}

.workspace-nav-backdrop {
  position: fixed;
  inset: 38px 0 0;
  z-index: 89;
  background: rgba(9, 20, 29, .48);
}

.profile-theme-label {
  display: grid;
  gap: 5px;
  margin: 2px 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.profile-theme-label select {
  width: 100%;
  min-height: 38px;
}

.workspace-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 9px;
}

.workspace-overview-card {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 112px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.rental-overview-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.rental-center-unit {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.rental-center-unit > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rental-center-unit h3,
.rental-center-unit p {
  margin: 0;
}

.workspace-overview-card:hover {
  border-color: var(--brand);
  background: var(--surface-alt);
}

.workspace-overview-card.attention {
  border-top-color: var(--warning);
}

.workspace-overview-card.danger {
  border-top-color: var(--danger);
}

.workspace-overview-card > span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-overview-card > strong {
  font-size: 24px;
  line-height: 1.15;
}

.workspace-overview-card > small {
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}

.workspace-activities > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.workspace-activity-list {
  display: grid;
}

.workspace-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 8px 4px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.workspace-activity-row:hover {
  background: var(--surface-alt);
}

.workspace-activity-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.workspace-activity-row time {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.document-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 180px;
}

.document-context-links .link-button,
.document-context-links .button {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .workspace-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .topbar {
    grid-template-columns: auto minmax(220px, 1fr) auto;
  }

  .brand p,
  #messageBadgeButton {
    display: none;
  }

  .profile-trigger > span:not(.user-avatar) {
    display: none;
  }
}

@media (max-width: 700px) {
  .rental-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rental-center-unit > header {
    display: grid;
  }

  .rental-center-unit .actions > * {
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  body.workspace-nav-open {
    overflow: hidden;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 8px 12px;
  }

  .workspace-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 44px;
    padding: 7px 9px;
    background: var(--surface);
  }

  .brand {
    display: none;
  }

  .workspace-search-hint {
    display: none;
  }

  .workspace-search input {
    padding-right: 12px;
  }

  .top-actions > #quickTaskButton {
    display: none;
  }

  .shell {
    display: block;
    min-height: calc(100vh - 104px);
  }

  .sidebar {
    position: fixed;
    inset: 38px auto 0 0;
    z-index: 100;
    width: min(320px, 88vw);
    height: calc(100vh - 38px);
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 16px 0 40px rgba(5, 15, 22, .24);
  }

  body.workspace-nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    color: #fff;
    font-weight: 800;
  }

  .workspace-nav-close {
    display: inline-flex;
    min-height: 38px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
  }

  .workspace-context {
    top: 104px;
    padding: 7px 12px;
  }

  .workspace-context-actions button:not([data-quick-task-open]) {
    display: none;
  }

  main {
    padding: 10px 12px 24px;
    grid-template-columns: minmax(0, 1fr);
  }

  #nav button {
    min-height: 44px;
  }

  .dashboard-layout,
  .grid,
  .split {
    grid-template-columns: 1fr;
  }

  .record-row summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .record-row summary > span:not(.chip) {
    grid-column: 1 / -1;
  }

  .record-row summary .chip {
    display: none;
  }

  .record-summary-action {
    grid-column: 2;
    grid-row: 1;
  }

  .record-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .sidebar nav button,
  .topbar button,
  .workspace-context button,
  .profile-menu button,
  #app button,
  #app select,
  #app input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
  }
}

@media (max-width: 520px) {
  .development-environment-banner {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 11px;
  }

  body {
    padding-top: 36px;
  }

  .topbar {
    top: 36px;
  }

  .workspace-search input {
    min-width: 0;
    font-size: 14px;
  }

  .profile-trigger {
    padding: 4px;
  }

  .workspace-context {
    top: 102px;
  }

  .workspace-breadcrumbs strong {
    font-size: 14px;
  }

  .panel.hero {
    grid-template-columns: 1fr;
  }

  .panel.hero > .actions {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-overview-card {
    min-height: 104px;
  }

  .workspace-activity-row {
    grid-template-columns: 1fr;
  }

  .record-detail-grid,
  .dashboard-subgrid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .payment-controls {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .payment-controls > *,
  .payment-controls input,
  .payment-controls select,
  .payment-controls button {
    grid-column: 1;
    width: 100%;
    max-width: 100%;
  }

  .expense-refund-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-refund-editor {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-expense-refund-card,
  .bank-refund-card {
    padding: 12px;
  }

  .bank-identity-summary,
  .legacy-assignment-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .legacy-assignment-wizard {
    padding: 12px;
  }

  .legacy-assignment-wizard button,
  .legacy-assignment-wizard select,
  .legacy-assignment-wizard input {
    min-height: 44px;
  }

  .form-grid .span-2,
  .wide {
    grid-column: auto;
  }

  button,
  select,
  input {
    min-height: 44px;
  }
}

/* BANK-IMPORT-RECONCILIATION-001 */
.bank-reconciliation-panel,
.bank-reconciliation-list,
.bank-reconciliation-row-card,
.bank-reconciliation-scroll,
.bank-reconciliation-evidence {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.bank-reconciliation-metrics {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.bank-reconciliation-filters {
  align-items: end;
}

.bank-reconciliation-group-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.bank-reconciliation-group-card > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bank-reconciliation-group-card strong,
.bank-reconciliation-group-card small,
.bank-reconciliation-row-card dd {
  overflow-wrap: anywhere;
}

.bank-reconciliation-backdrop {
  z-index: 1600;
  padding: 20px;
}

.bank-reconciliation-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1180px, calc(100vw - 40px));
  max-height: min(920px, calc(100dvh - 40px));
  overflow: hidden;
}

.bank-reconciliation-scroll {
  overflow: auto;
  padding: 18px;
  overscroll-behavior: contain;
}

.bank-reconciliation-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bank-reconciliation-row-card {
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.bank-reconciliation-row-card header {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.bank-reconciliation-row-card header > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bank-reconciliation-row-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.bank-reconciliation-row-card dl > div,
.bank-reconciliation-evidence article {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: 4px;
  background: var(--surface-subtle, #f6f8fa);
}

.bank-reconciliation-row-card dt {
  color: var(--muted, #53636f);
  font-size: .78rem;
  font-weight: 700;
}

.bank-reconciliation-row-card dd {
  margin: 3px 0 0;
}

.bank-reconciliation-modal .bank-wizard-head,
.bank-reconciliation-modal .bank-wizard-actions {
  padding: 14px 18px;
  background: var(--surface, #fff);
}

@media (max-width: 768px) {
  .bank-reconciliation-group-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bank-reconciliation-group-card > .chips {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bank-reconciliation-compare-grid,
  .bank-reconciliation-evidence .grid.three {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-reconciliation-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .bank-reconciliation-backdrop {
    padding: 12px;
  }
}

@media (max-width: 430px) {
  .bank-reconciliation-group-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-reconciliation-group-card > .chips,
  .bank-reconciliation-group-card > button {
    grid-column: 1;
  }

  .bank-reconciliation-group-card > button,
  .bank-reconciliation-modal button,
  .bank-reconciliation-modal select,
  .bank-reconciliation-modal input {
    min-height: 44px;
  }

  .bank-reconciliation-row-card dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-reconciliation-modal .bank-wizard-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-reconciliation-modal .bank-wizard-actions button {
    width: 100%;
  }
}

.rent-ledger-property-grid,
.rent-ledger-contract-list,
.rent-ledger-list {
  display: grid;
  gap: var(--space-3, 12px);
}

.rent-ledger-property-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin-block: var(--space-4, 16px);
}

.rent-ledger-contract {
  padding: 0;
  overflow: clip;
}

.rent-ledger-contract > summary {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 16px);
  padding: var(--space-4, 16px);
  cursor: pointer;
  list-style: none;
}

.rent-ledger-contract > summary::-webkit-details-marker {
  display: none;
}

.rent-ledger-contract > summary span,
.rent-ledger-contract > summary small,
.rent-ledger-portal-row span {
  min-width: 0;
}

.rent-ledger-contract > summary small,
.rent-ledger-row small,
.rent-ledger-portal-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted, #53636f);
  overflow-wrap: anywhere;
}

.rent-ledger-summary-values {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--space-2, 8px);
}

.rent-ledger-contract-body {
  display: grid;
  gap: var(--space-4, 16px);
  padding: 0 var(--space-4, 16px) var(--space-4, 16px);
  border-top: 1px solid var(--border, #ccd5dc);
}

.rent-ledger-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4, 16px);
}

.rent-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3, 12px);
  min-width: 0;
  padding: var(--space-3, 12px);
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface, #fff);
}

.rent-ledger-action {
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface-subtle, #f5f7f8);
}

.rent-ledger-action > summary {
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
}

.rent-ledger-action > .form-grid {
  padding: 0 16px 16px;
}

.compact-metrics .metric {
  min-height: 76px;
}

.rent-ledger-portal-row > span:last-child {
  text-align: right;
}

.rent-allocation-modal {
  width: min(900px, 96vw);
  max-height: calc(100dvh - 32px);
}

.rent-allocation-list {
  display: grid;
  gap: 10px;
  margin-block: 16px;
}

.rent-allocation-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(200px, 1.4fr) minmax(130px, .7fr) 44px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-sm, 6px);
}

.rent-allocation-row label,
.rent-allocation-modal > label:not(.check) {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.rent-allocation-row select,
.rent-allocation-row input,
.rent-allocation-modal > label:not(.check) input {
  width: 100%;
  min-width: 0;
}

.rent-allocation-modal > .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.rent-allocation-modal > .actions {
  flex-wrap: wrap;
}

.rent-allocation-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block: 16px;
  padding: 14px;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-sm, 6px);
  background: var(--surface-subtle, #f5f7f8);
}

@media (max-width: 768px) {
  .finance-tab-nav .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-tab-nav .tabs button {
    min-width: 0;
    width: 100%;
    white-space: normal;
  }

  .rent-ledger-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .rent-ledger-contract > summary,
  .rent-ledger-summary-values {
    align-items: flex-start;
  }

  .rent-ledger-contract > summary {
    flex-direction: column;
  }

  .rent-ledger-summary-values {
    width: 100%;
    justify-content: space-between;
  }

  .rent-allocation-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .rent-allocation-row label {
    grid-column: 1 / -1;
  }

  .rent-allocation-row [data-rent-allocation-remove] {
    grid-column: 2;
    grid-row: 1;
  }

  .rent-allocation-modal {
    width: min(100%, 620px);
  }
}

@media (max-width: 430px) {
  .finance-tab-nav .tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  .rent-ledger-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rent-ledger-row .chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .rent-ledger-contract-body .actions,
  .rent-ledger-action button {
    width: 100%;
  }

  .rent-ledger-contract-body .actions > *,
  .rent-ledger-action button {
    min-height: 44px;
  }

  .rent-allocation-total {
    align-items: flex-start;
    flex-direction: column;
  }

  .rent-allocation-modal > .actions > * {
    width: 100%;
  }
}

/* APP-WORKSPACE-001-R5: one durable shell and lossless form state. */
.topbar {
  grid-template-columns: minmax(300px, auto) minmax(240px, 620px) minmax(0, auto);
  align-items: center;
}

.topbar-brand-area {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.topbar-brand-area .brand {
  flex: 0 1 auto;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1,
.brand-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-logo,
.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.brand-logo {
  object-fit: contain;
}

.topbar-back-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--surface-alt);
}

.topbar-back-button[hidden] {
  display: none;
}

.topbar-back-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 65%, white);
  outline-offset: 2px;
}

.mobile-page-title {
  display: none;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context {
  position: relative;
  top: auto;
  z-index: 1;
  min-height: 50px;
  background: var(--paper);
  backdrop-filter: none;
}

.workspace-main,
main,
.panel,
.grid > *,
.form-grid > *,
.record-detail-grid > * {
  min-width: 0;
}

.panel,
.workspace-overview-card,
.metric,
.record-row,
td,
th,
.notice,
.message-thread-main {
  overflow-wrap: break-word;
  word-break: normal;
}

.form-draft-status {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-draft-status[data-tone="success"] { color: var(--green, #126338); }
.form-draft-status[data-tone="warning"] { color: var(--yellow, #946200); }
.form-draft-status[data-tone="error"] { color: var(--danger, #b42318); }

[data-form-draft].is-dirty {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--yellow, #946200) 65%, transparent);
}

.message-refresh-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.message-refresh-notice[hidden] { display: none; }

.metric-grid,
.workspace-overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace-overview-card,
.metric {
  min-height: 0;
  height: auto;
}

.workspace-priority-groups {
  display: grid;
  gap: 14px;
}

.workspace-priority-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workspace-priority-section > header {
  margin-bottom: 10px;
}

.workspace-priority-section h2,
.workspace-priority-section p {
  margin: 0;
}

.workspace-priority-section h2 {
  font-size: 17px;
}

.workspace-priority-section p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.workspace-priority-section.system {
  background: var(--surface-alt);
}

.dashboard-hero .eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(190px, auto) minmax(220px, 1fr) auto;
  }

  .brand-copy p,
  .topbar-back-label {
    display: none;
  }

  .metric-grid,
  .workspace-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .topbar-brand-area {
    display: flex;
  }

  .topbar-brand-area .brand {
    display: flex;
  }

  .brand-copy {
    display: none;
  }

  .mobile-page-title {
    display: block;
  }

  .workspace-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workspace-context {
    top: auto;
  }

  .workspace-context-actions {
    display: none;
  }

  #nav button.nav-root-button,
  #nav button.nav-section-toggle,
  #nav .nav-section-items button.nav-item,
  .sidebar button,
  button.small,
  .button.small {
    min-height: 48px;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .workspace-search input {
    font-size: 16px;
  }

  .workspace-breadcrumbs strong {
    white-space: normal;
  }

  .metric-grid,
  .workspace-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .topbar {
    padding-inline: 8px;
  }

  .brand-mark,
  .brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .mobile-page-title {
    font-size: 13px;
  }

  .message-refresh-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .workspace-overview-grid {
    grid-template-columns: 1fr;
  }
}

/* FINANCE-EXPENSES-001: kompakte Finanzarbeitsflaechen */
.finance-toolbar,
.finance-section-head,
.finance-tax-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.finance-toolbar h2,
.finance-section-head h2,
.finance-tax-head h2,
.finance-receipt-stage h3 {
  margin: 2px 0 4px;
  letter-spacing: 0;
}

.finance-toolbar p,
.finance-section-head p,
.finance-tax-head p,
.finance-receipt-stage p {
  margin: 0;
}

.finance-toolbar .search-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(170px, auto) auto;
  gap: 8px;
  width: min(100%, 760px);
}

.finance-editor {
  display: grid;
  gap: 18px;
  max-width: 1080px;
  margin-inline: auto;
  border-left: 4px solid var(--accent);
}

.finance-receipt-stage {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.finance-analysis-list,
.finance-card-list {
  display: grid;
  gap: 10px;
}

.finance-analysis-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.finance-analysis-list small {
  grid-column: 1 / -1;
}

.finance-analysis-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 6px 0 0;
}

.finance-analysis-fields div {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.finance-analysis-fields dt,
.finance-analysis-fields dd {
  margin: 0;
}

.finance-analysis-fields dt,
.finance-analysis-fields small {
  color: var(--muted);
  font-size: 12px;
}

.finance-route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.finance-route-list button {
  display: grid;
  min-height: 62px;
  gap: 3px;
  text-align: left;
}

.finance-record-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  box-shadow: 0 2px 8px rgb(15 23 42 / 5%);
}

.finance-record-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.finance-record-card header > div,
.finance-record-card header small {
  display: block;
  min-width: 0;
}

.finance-record-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.finance-record-card dl > div {
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.finance-record-card dt {
  color: var(--muted);
  font-size: 12px;
}

.finance-record-card dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.finance-tax-head .actions {
  flex: 0 0 auto;
}

.finance-primary-actions {
  justify-content: flex-end;
}

.finance-form-details {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.finance-form-details summary {
  min-height: 44px;
  padding: 11px 13px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.finance-form-details[open] summary {
  border-bottom: 1px solid var(--border);
}

.finance-form-details > .form-grid {
  padding: 13px;
}

.finance-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finance-upload-actions .button {
  min-height: 44px;
  cursor: pointer;
}

.finance-upload-actions input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 820px) {
  .finance-toolbar,
  .finance-section-head,
  .finance-tax-head,
  .field-stage-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-toolbar .search-row {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .finance-record-card dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .finance-tax-head .actions,
  .finance-primary-actions,
  .finance-upload-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .finance-tax-head .actions > *,
  .finance-primary-actions > *,
  .finance-toolbar button,
  .finance-section-head button,
  .finance-upload-actions .button,
  .finance-editor input,
  .finance-editor select,
  .finance-editor button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .finance-record-card header {
    display: grid;
  }

  .finance-editor,
  .finance-record-card,
  .finance-receipt-stage {
    padding: 11px;
  }
}

/* BK-ASSISTANT-001: kompakter, gefuehrter Jahresabschluss */
.billing-hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.billing-hero > div {
  max-width: 780px;
}

.billing-case-fieldset {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.billing-case-fieldset:disabled {
  opacity: 1;
}

.billing-case-list,
.billing-card-list,
.billing-timeline-list {
  display: grid;
  gap: 10px;
}

.billing-case-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.4fr) auto repeat(4, minmax(110px, 1fr)) auto;
}

.billing-case-row > div,
.billing-case-row > span {
  min-width: 0;
}

.billing-case-row small,
.billing-edit-card small {
  display: block;
  margin-top: 3px;
}

.billing-step-nav {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.billing-step-nav button {
  align-items: center;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #cbd5e1);
  color: var(--text, #172033);
  display: flex;
  font-size: 13px;
  gap: 8px;
  justify-content: flex-start;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
}

.billing-step-nav button span {
  align-items: center;
  background: var(--surface-muted, #eef2f6);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 26px;
  height: 26px;
  justify-content: center;
}

.billing-step-nav button.active {
  border-color: var(--primary, #174c66);
  box-shadow: inset 3px 0 0 var(--accent, #bd5f43);
}

.billing-step-nav button.active span {
  background: var(--primary, #174c66);
  color: #fff;
}

.billing-summary-band {
  align-items: center;
  background: var(--surface-muted, #f4f6f8);
  border-left: 4px solid var(--primary, #174c66);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 12px 0 18px;
  padding: 12px 14px;
}

.billing-timeline,
.billing-edit-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
  padding: 14px;
}

.billing-timeline header,
.billing-edit-card header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.billing-timeline > div:not(.notice) {
  border-top: 1px solid var(--border, #e2e8f0);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(170px, .7fr) minmax(200px, 1fr) auto;
  padding: 9px 0;
}

.billing-catalog-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-catalog-grid > label {
  align-content: start;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.billing-catalog-grid label > span,
.billing-catalog-grid small {
  display: block;
}

.billing-cost-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.billing-basis-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 16px;
}

.input-pair {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
}

.restricted-costs {
  border-top: 1px solid var(--border, #d6dde3);
  margin-top: 16px;
  padding-top: 12px;
}

.restricted-costs li {
  margin-bottom: 7px;
}

.billing-issue-group {
  margin-top: 18px;
}

.billing-issue-group h3 {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.billing-issue-group .notice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-block: 7px;
}

.billing-sticky-actions {
  align-items: center;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  border: 1px solid var(--border, #d6dde3);
  bottom: 10px;
  box-shadow: 0 4px 18px rgb(15 23 42 / 12%);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
  padding: 10px;
  position: sticky;
  z-index: 12;
}

.billing-legacy > summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding-block: 10px;
}

.is-collapsed > :not(header) {
  display: none;
}

@media (max-width: 1180px) {
  .billing-case-row {
    grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(110px, 1fr)) auto;
  }

  .billing-case-row > :nth-child(5),
  .billing-case-row > :nth-child(6) {
    display: none;
  }

  .billing-cost-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .billing-hero,
  .billing-timeline header,
  .billing-edit-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-step-nav,
  .billing-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-case-row {
    align-items: stretch;
    grid-template-columns: 1fr auto;
  }

  .billing-case-row > :nth-child(3),
  .billing-case-row > :nth-child(4),
  .billing-case-row > :nth-child(5),
  .billing-case-row > :nth-child(6) {
    display: block;
  }

  .billing-timeline > div:not(.notice),
  .billing-cost-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .billing-step-nav,
  .billing-catalog-grid,
  .billing-case-row {
    grid-template-columns: 1fr;
  }

  .billing-step-nav button {
    font-size: 14px;
  }

  .billing-sticky-actions {
    bottom: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .billing-sticky-actions button {
    min-width: 0;
    width: 100%;
  }
}

/* BK-ASSISTANT-001-R1: progressive Kostenpruefung und zentrale Grundlagen */
.billing-cost-workspace,
.billing-profile-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 288px;
  margin-inline: auto;
  max-width: 1420px;
}

.billing-cost-workspace > main,
.billing-profile-layout > main {
  min-width: 0;
}

.billing-cost-intro header,
.billing-category-editor > header,
.billing-profile-panel > header,
.billing-co2-panel > header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.billing-cost-intro h2,
.billing-category-editor h3,
.billing-profile-panel h2,
.billing-co2-panel h2 {
  margin: 5px 0 4px;
}

.billing-cost-toolbar {
  align-items: end;
  border-top: 1px solid var(--border, #d6dde3);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.7fr);
  margin-top: 14px;
  padding-top: 14px;
}

.billing-search-field {
  display: grid;
  gap: 5px;
}

.billing-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.billing-filter-bar button.active {
  background: var(--primary, #174c66);
  border-color: var(--primary, #174c66);
  color: #fff;
}

.billing-cost-group {
  margin: 18px 0 22px;
}

.billing-cost-group > h3 {
  font-size: 15px;
  margin: 0 0 9px;
}

.billing-cost-card-grid,
.billing-profile-key-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-cost-card,
.billing-profile-key-grid > article,
.billing-profile-unit-list > article,
.billing-category-editor,
.billing-co2-card,
.billing-allocation-help {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
}

.billing-cost-card {
  display: grid;
  gap: 10px;
  min-height: 224px;
  padding: 13px;
}

.billing-cost-card > header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.billing-cost-card h4 {
  font-size: 14px;
  margin: 0 0 6px;
}

.billing-cost-order {
  align-items: center;
  background: var(--surface-muted, #eef2f6);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 30px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
}

.billing-cost-card dl,
.billing-cost-summary dl,
.billing-profile-summary dl,
.billing-profile-unit-list dl {
  display: grid;
  gap: 6px;
  margin: 0;
}

.billing-cost-card dl > div,
.billing-cost-summary dl > div,
.billing-profile-summary dl > div,
.billing-profile-unit-list dl > div {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.billing-cost-card dt,
.billing-cost-summary dt,
.billing-profile-summary dt,
.billing-profile-unit-list dt {
  color: var(--muted, #596575);
  font-size: 12px;
}

.billing-cost-card dd,
.billing-cost-summary dd,
.billing-profile-summary dd,
.billing-profile-unit-list dd {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  text-align: right;
}

.billing-cost-card > button {
  align-self: end;
  width: 100%;
}

.billing-card-warning,
.billing-card-complete {
  font-size: 12px;
  margin: 0;
}

.billing-card-warning {
  color: var(--warning-text, #744700);
}

.billing-card-complete {
  color: var(--success-text, #14532d);
}

.billing-cost-summary,
.billing-profile-summary {
  align-self: start;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
  padding: 15px;
  position: sticky;
  top: 12px;
}

.billing-cost-summary h3,
.billing-profile-summary h3 {
  font-size: 16px;
  margin: 0 0 12px;
}

.billing-cost-summary button,
.billing-profile-summary button {
  margin-top: 14px;
  width: 100%;
}

.billing-progress {
  background: var(--surface-muted, #e8edf1);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}

.billing-progress > span {
  background: var(--primary, #174c66);
  display: block;
  height: 100%;
}

.billing-category-editor {
  padding: 15px;
}

.billing-category-editor > header > div {
  align-items: center;
  display: flex;
  gap: 9px;
}

.billing-category-decision {
  background: var(--surface-muted, #f4f6f8);
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 12px;
}

.billing-cost-detail {
  padding: 0;
}

.billing-cost-detail > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 52px;
  padding: 11px 13px;
}

.billing-cost-detail > .form-grid {
  border-top: 1px solid var(--border, #d6dde3);
  padding: 13px;
}

.billing-allocation-help {
  background: color-mix(in srgb, var(--surface-muted, #f4f6f8) 78%, var(--surface, #fff));
  padding: 13px;
}

.billing-allocation-help header {
  margin-bottom: 6px;
}

.billing-allocation-help p {
  margin: 5px 0;
}

.billing-basis-explanation {
  border-left: 3px solid var(--primary, #174c66);
  padding-left: 11px;
}

.billing-formula {
  background: var(--surface, #fff);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  padding: 8px;
}

.billing-expert-details {
  border-top: 1px solid var(--border, #d6dde3);
  margin-top: 10px;
  padding-top: 8px;
}

.billing-expert-details > summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding-block: 10px;
}

.billing-meter-source-list {
  margin-top: 16px;
}

.billing-meter-source-list > article {
  align-items: center;
  border-top: 1px solid var(--border, #d6dde3);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 10px 0;
}

.billing-meter-source-list small {
  display: block;
}

.billing-co2-card {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 15px;
  padding: 13px;
}

.billing-co2-card > div {
  background: var(--surface-muted, #f4f6f8);
  border-radius: 4px;
  display: grid;
  gap: 5px;
  padding: 11px;
}

.billing-co2-card > div.tenant {
  border-left: 3px solid var(--primary, #174c66);
}

.billing-co2-card > div.owner {
  border-left: 3px solid var(--accent, #bd5f43);
}

.billing-co2-card span {
  color: var(--muted, #596575);
  font-size: 12px;
}

.billing-co2-card > p {
  grid-column: 1 / -1;
  margin: 0;
}

.billing-source-change {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.billing-profile-unit-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.billing-profile-unit-list > article,
.billing-profile-key-grid > article {
  padding: 12px;
}

.billing-profile-unit-list small,
.billing-profile-key-grid small {
  display: block;
  margin-top: 7px;
}

.billing-profile-key-grid > article {
  display: grid;
  gap: 8px;
}

.billing-profile-key-grid p {
  color: var(--muted, #596575);
  font-size: 12px;
  margin: 0;
}

@media (max-width: 1120px) {
  .billing-cost-card-grid,
  .billing-profile-key-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .billing-cost-workspace,
  .billing-profile-layout {
    grid-template-columns: 1fr;
  }

  .billing-cost-summary,
  .billing-profile-summary {
    position: static;
  }

  .billing-cost-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .billing-cost-card-grid,
  .billing-profile-key-grid,
  .billing-profile-unit-list,
  .billing-co2-card {
    grid-template-columns: 1fr;
  }

  .billing-cost-intro header,
  .billing-category-editor > header,
  .billing-profile-panel > header,
  .billing-co2-panel > header,
  .billing-source-change {
    align-items: stretch;
    flex-direction: column;
  }

  .billing-filter-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-filter-bar button,
  .billing-category-editor > header button {
    min-height: 44px;
    width: 100%;
  }

  .billing-meter-source-list > article {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .billing-cost-card,
  .billing-cost-card > *,
  .billing-cost-card dl,
  .billing-cost-card dl > div {
    min-width: 0;
  }

  .billing-cost-card dl > div {
    align-items: start;
    display: grid;
    grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr);
  }

  .billing-cost-card dd {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
  }
}

/* BK-ASSISTANT-002-R1: zeitbezogene Nutzung und Mischobjekte */
.billing-usage-editor,
.billing-mixed-profile,
.billing-property-tax-card,
.billing-commercial-profile {
  min-width: 0;
}

.billing-usage-list,
.billing-mixed-decision-grid {
  display: grid;
  gap: 12px;
}

.billing-usage-entry,
.billing-mixed-decision-grid > article,
.billing-property-tax-card,
.billing-commercial-profile {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
  padding: 13px;
}

.billing-usage-entry > header,
.billing-mixed-profile > header,
.billing-mixed-decision-grid > article > header,
.billing-property-tax-card > header,
.billing-commercial-profile > header {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.billing-usage-entry fieldset {
  border: 0;
  margin: 12px 0;
  padding: 0;
}

.billing-usage-entry legend {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.billing-usage-tiles,
.billing-scope-unit-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.billing-usage-tile {
  cursor: pointer;
  min-width: 0;
}

.billing-usage-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.billing-usage-tile span {
  align-items: center;
  border: 1px solid var(--border, #d6dde3);
  border-radius: 6px;
  display: flex;
  font-size: 12px;
  justify-content: center;
  min-height: 44px;
  padding: 7px;
  text-align: center;
}

.billing-usage-tile input:checked + span {
  background: var(--primary, #174c66);
  border-color: var(--primary, #174c66);
  color: #fff;
}

.billing-usage-tile input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--primary, #174c66) 35%, transparent);
  outline-offset: 2px;
}

.billing-mixed-profile {
  border-block: 1px solid var(--border, #d6dde3);
  margin-block: 16px;
  padding-block: 16px;
}

.billing-mixed-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-block: 12px;
}

.billing-mixed-decision-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.billing-mixed-decision-grid > article {
  display: grid;
  gap: 9px;
}

.billing-property-tax-card,
.billing-commercial-profile {
  background: var(--surface-muted, #f4f6f8);
}

@media (max-width: 900px) {
  .billing-usage-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .billing-mixed-decision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .billing-usage-tiles,
  .billing-scope-unit-grid,
  .billing-mixed-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-usage-entry > header,
  .billing-mixed-profile > header {
    flex-direction: column;
  }

  .billing-usage-editor button,
  .billing-property-tax-card input,
  .billing-property-tax-card select,
  .billing-commercial-profile input,
  .billing-commercial-profile select {
    min-height: 44px;
  }
}

/* MOBILE-FIELD-001 */
.field-media-workspace,
.handover-workspace {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.field-media-heading,
.handover-heading,
.field-photo-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.field-media-heading h3,
.handover-heading h2,
.handover-step h3 {
  margin: 0 0 4px;
}

.field-upload-panel {
  margin: 14px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.field-upload-panel > summary {
  min-height: 44px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

.field-upload-grid,
.handover-step-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.field-upload-actions,
.field-upload-queue {
  margin: 0 14px 14px;
}

.field-camera-button {
  background: var(--accent, #2457c5);
  color: #fff;
}

.field-upload-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 1fr) minmax(110px, auto) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.field-upload-row.error strong {
  color: var(--danger, #a92121);
}

.field-upload-row > img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
}

.field-stage {
  margin: 14px;
  padding: 14px;
  border: 1px solid var(--border-strong, #8b98a7);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.field-stage-title,
.field-stage-footer,
.field-stage-heading,
.field-stage-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field-stage-title h3,
.field-stage-title p,
.field-stage-footer small {
  margin: 0;
}

.field-stage-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.field-stage-common {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.field-stage-common > summary {
  min-height: 44px;
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 700;
}

.field-stage-common-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 9px;
  align-items: end;
  padding: 0 12px 12px;
}

.field-stage-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.field-stage-card.error {
  border-color: var(--danger, #a92121);
}

.field-stage-preview {
  position: relative;
  display: grid;
  min-height: 190px;
  overflow: hidden;
  place-items: center;
  background: #e8edf2;
}

.field-stage-preview img {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: contain;
  transition: transform .18s ease;
}

.field-stage-placeholder {
  display: grid;
  gap: 5px;
  padding: 20px;
  text-align: center;
}

.field-stage-order {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  color: #fff;
  background: rgba(19, 32, 45, .82);
  font-weight: 700;
  place-items: center;
}

.field-stage-body {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
}

.field-stage-filename,
.field-stage-heading small,
.field-stage-meta span {
  display: block;
  overflow-wrap: anywhere;
}

.field-stage-heading .chip {
  flex: 0 0 auto;
}

.field-stage-meta {
  justify-content: flex-start;
  color: var(--text-muted, #596579);
  font-size: .84rem;
}

.field-stage-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.field-stage-fields label {
  min-width: 0;
}

.field-stage-footer {
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.field-stage-footer small {
  display: block;
  color: var(--text-muted, #596579);
}

.notice.compact {
  margin: 0;
  padding: 8px 10px;
}

.field-gallery-toolbar,
.field-batch-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(150px, .8fr) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0;
}

.field-batch-panel {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface-subtle, #f7f9fb);
}

.field-photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.field-photo-gallery.view-list,
.field-photo-gallery.view-timeline {
  grid-template-columns: minmax(0, 1fr);
}

.field-photo-gallery.view-list .field-photo-card,
.field-photo-gallery.view-timeline .field-photo-card {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
}

.field-photo-gallery.view-timeline {
  border-left: 3px solid var(--accent, #2457c5);
  padding-left: 18px;
}

.field-photo-gallery.view-timeline .field-photo-card {
  position: relative;
}

.field-photo-gallery.view-timeline .field-photo-card::before {
  position: absolute;
  top: 24px;
  left: -26px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent, #2457c5);
  content: "";
}

.field-photo-card.archived { opacity: .68; }
.field-photo-title .check { min-height: 32px; }

.field-photo-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.field-photo-preview {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #e8edf2;
  aspect-ratio: 4 / 3;
}

.field-photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.field-photo-copy {
  padding: 11px 12px 12px;
}

.field-photo-edit {
  margin: 10px 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.field-photo-edit summary {
  min-height: 44px;
  cursor: pointer;
  color: var(--accent, #2457c5);
  font-weight: 700;
}

.field-photo-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.field-photo-edit-grid label,
.field-photo-edit-grid input,
.field-photo-edit-grid select,
.field-photo-edit-grid textarea {
  min-width: 0;
  max-width: 100%;
}

.field-photo-copy p,
.field-photo-copy small {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.handover-progress {
  display: grid;
  grid-template-columns: repeat(8, minmax(70px, 1fr));
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.handover-progress button {
  min-height: 52px;
  padding: 7px 4px;
  border: 0;
  color: var(--text-muted, #596579);
  background: transparent;
  font-size: .76rem;
}

.handover-progress button span {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto 3px;
  border: 1px solid currentColor;
  border-radius: 50%;
  line-height: 20px;
}

.handover-progress button.active {
  color: #fff;
  background: var(--accent, #2457c5);
}

.handover-progress button.done {
  color: var(--success, #17643b);
  background: color-mix(in srgb, var(--success, #17643b) 10%, white);
}

.handover-step {
  max-width: 980px;
  margin: 0 auto;
}

.handover-card-list,
.handover-list {
  display: grid;
  gap: 10px;
}

.handover-edit-card,
.summary-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.handover-edit-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
}

.handover-edit-card label,
.handover-signatures label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.handover-components {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.handover-components > div {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(150px, .8fr) minmax(180px, 1.2fr);
  gap: 8px;
  align-items: center;
}

.handover-photo-picks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.handover-photo-picks label {
  display: grid;
  grid-template-columns: auto 64px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  margin: 0;
}

.handover-photo-picks img {
  width: 64px;
  height: 48px;
  object-fit: cover;
}

.handover-camera {
  padding: 12px;
  border: 1px dashed var(--border-strong, #8b98a7);
  border-radius: 6px;
}

.handover-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 18px -4px -4px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent);
  backdrop-filter: blur(8px);
}

.handover-signatures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.handover-signatures canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 32 / 9;
  border: 1px solid var(--border-strong, #8b98a7);
  border-radius: 4px;
  background: #fff;
  touch-action: none;
}

.print-dialog {
  width: min(660px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text, #13202d);
  background: var(--surface, #fff);
}

.print-dialog::backdrop {
  background: rgba(19, 32, 45, .58);
}

.print-dialog form {
  padding: 18px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dialog-header h2,
.dialog-header p {
  margin: 0 0 5px;
}

.print-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.print-option-grid .check {
  min-height: 44px;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

@media (max-width: 780px) {
  .field-media-heading,
  .handover-heading,
  .field-photo-title {
    align-items: stretch;
    flex-direction: column;
  }

  .field-upload-grid,
  .handover-step-grid,
  .handover-signatures,
  .print-option-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-gallery-toolbar,
  .field-batch-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-upload-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .field-upload-row progress {
    grid-column: 1 / -1;
    width: 100%;
  }

  .field-stage {
    margin: 12px 8px;
    padding: 10px;
  }

  .field-stage-title,
  .field-stage-footer,
  .field-stage-heading,
  .field-stage-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .field-stage-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-stage-preview {
    min-height: 220px;
    aspect-ratio: 4 / 3;
  }

  .field-stage-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-stage-common-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-stage-actions,
  .field-stage-footer .actions,
  .field-upload-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .field-stage-actions button,
  .field-stage-footer button,
  .field-upload-actions .button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
    width: 100%;
  }

  .handover-progress {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
  }

  .handover-components > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .handover-actions {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .handover-actions button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .field-photo-gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-photo-gallery.view-list .field-photo-card,
  .field-photo-gallery.view-timeline .field-photo-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .handover-progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .handover-progress button {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    text-align: left;
  }

  .handover-progress button span {
    margin: 0;
    text-align: center;
  }

  .handover-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* MOBILE-FIELD-001-R3: iOS-Auswahl und stabile Tablet-Aktenansichten */
.field-upload-actions {
  position: relative;
}

.field-photo-native-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.field-upload-diagnostics {
  margin-top: 10px;
  border-top: 1px solid var(--line, var(--border));
  color: var(--muted);
  font-size: 12px;
}

.field-upload-diagnostics summary {
  min-height: 38px;
  padding: 9px 0;
  cursor: pointer;
  font-weight: 700;
}

.field-upload-diagnostics ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field-upload-diagnostics li {
  display: grid;
  grid-template-columns: auto minmax(100px, .6fr) minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line, var(--border));
}

.field-upload-actions button,
.field-stage-actions button,
.field-stage-footer button {
  min-height: 44px;
}

.field-stage-filename,
.field-stage-heading small,
.field-stage-meta span,
.field-photo-copy p,
.field-photo-copy small {
  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 1100px) {
  .dossier-category-groups,
  .dossier-category-tabs,
  .document-desktop-list,
  .dossier-document-desktop {
    display: none;
  }

  .dossier-category-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dossier-category-mobile-tabs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding: 2px 0 5px;
    overscroll-behavior-inline: contain;
  }

  .dossier-category-mobile-tabs button {
    min-height: 44px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .document-mobile-list,
  .dossier-document-mobile {
    display: grid;
  }

  .field-stage-common-grid,
  .field-gallery-toolbar,
  .field-batch-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-stage-card {
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  }

  .field-stage-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-overview-board,
  .record-detail-grid,
  .dossier-overview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel,
  .workspace-overview-card,
  .metric,
  .record-row,
  td,
  th,
  .notice,
  .message-thread-main {
    overflow-wrap: break-word;
    word-break: normal;
  }
}

@media (max-width: 820px) {
  .dossier-category-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-stage-card,
  .field-stage-common-grid,
  .field-gallery-toolbar,
  .field-batch-panel,
  .field-upload-grid,
  .field-photo-edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-stage-preview {
    min-height: 210px;
    aspect-ratio: 4 / 3;
  }

  .field-upload-actions,
  .field-stage-actions,
  .field-stage-footer .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .field-upload-actions button,
  .field-stage-actions button,
  .field-stage-footer button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .field-upload-diagnostics li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* MOBILE-FIELD-001-R3: ruhige, rollenbezogene Anmeldung */
.cloud-login-page {
  min-height: 100dvh;
  padding: 0;
  background: #eef3f5;
}

.cloud-login-page [hidden] {
  display: none !important;
}

.cloud-login-development {
  display: grid;
  min-height: 32px;
  place-items: center;
  padding: max(5px, env(safe-area-inset-top)) 12px 5px;
  color: #fff;
  background: #a32019;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
}

.cloud-login-shell {
  width: min(100%, 1040px);
  min-height: calc(100dvh - 32px);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 72px) clamp(18px, 5vw, 54px) 24px;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-content: center;
  align-items: center;
  gap: clamp(28px, 6vw, 74px);
}

.cloud-login-intro {
  display: grid;
  min-width: 0;
  gap: 34px;
}

.cloud-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cloud-login-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #174c66;
  font-weight: 900;
}

.cloud-login-brand strong,
.cloud-login-brand span {
  display: block;
}

.cloud-login-brand strong {
  color: #13202d;
  font-size: 17px;
}

.cloud-login-brand div > span {
  margin-top: 2px;
  color: #596979;
  font-size: 12px;
}

.cloud-login-intro-copy .eyebrow,
.cloud-login-kicker {
  margin: 0 0 7px;
  color: #8b3f2a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cloud-login-intro-copy h1 {
  margin: 0;
  color: #13202d;
  font-size: clamp(30px, 4vw, 45px);
  line-height: 1.08;
}

.cloud-login-intro-copy p:last-child {
  max-width: 48ch;
  margin: 14px 0 0;
  color: #4c5b69;
  font-size: 16px;
}

.cloud-login-assurances {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: #324350;
  font-size: 13px;
  list-style: none;
}

.cloud-login-assurances li {
  position: relative;
  padding-left: 22px;
}

.cloud-login-assurances li::before {
  position: absolute;
  left: 0;
  color: #0f766e;
  content: "✓";
  font-weight: 900;
}

.cloud-login-card {
  min-width: 0;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #cfd9df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(28, 47, 58, .12);
}

.cloud-login-card-head h2 {
  margin: 0;
  color: #13202d;
  font-size: 24px;
}

.cloud-login-card-head p {
  margin: 7px 0 20px;
  color: #5b6874;
  font-size: 14px;
}

.cloud-login-form {
  display: grid;
  gap: 8px;
}

.cloud-login-form.compact {
  margin-top: 14px;
}

.cloud-login-form label {
  margin-top: 6px;
  color: #293947;
  font-size: 13px;
  font-weight: 800;
}

.cloud-login-form input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #aebdc8;
  border-radius: 6px;
  color: #13202d;
  background: #fff;
  font-size: 16px;
}

.cloud-login-form input:focus,
.cloud-password-toggle:focus-visible,
.cloud-login-form button:focus-visible,
.cloud-login-footer a:focus-visible {
  outline: 3px solid rgba(36, 87, 197, .28);
  outline-offset: 2px;
}

.cloud-password-field {
  position: relative;
}

.cloud-password-field input {
  padding-right: 54px;
}

.cloud-password-toggle {
  position: absolute;
  inset: 2px 2px 2px auto;
  display: grid;
  width: 46px;
  min-height: 44px;
  place-items: center;
  padding: 0;
  border-radius: 5px;
  color: #465968;
  background: transparent;
}

.cloud-password-toggle:hover,
.cloud-password-toggle[aria-pressed="true"] {
  color: #174c66;
  background: #e8f0f4;
}

.cloud-password-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.cloud-login-submit,
.cloud-login-form > button {
  min-height: 48px;
  margin-top: 12px;
  border-radius: 6px;
  color: #fff;
  background: #174c66;
  font-weight: 900;
}

.cloud-login-submit:disabled {
  cursor: wait;
  opacity: .68;
}

.cloud-login-message {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 750;
}

.cloud-login-message.error {
  border-color: #b42318;
  color: #7d1e17;
  background: #fff0ed;
}

.cloud-login-message.info {
  border-color: #2457c5;
  color: #173d8a;
  background: #eef4ff;
}

.cloud-caps-lock {
  color: #8b5900;
  font-size: 12px;
  font-weight: 800;
}

.cloud-login-reset {
  margin-top: 18px;
  border-top: 1px solid #d9e1e6;
  padding-top: 12px;
}

.cloud-login-reset summary {
  min-height: 44px;
  cursor: pointer;
  color: #174c66;
  font-size: 13px;
  font-weight: 850;
  line-height: 44px;
}

.cloud-login-privacy {
  margin: 18px 0 0;
  color: #687783;
  font-size: 11px;
}

.cloud-login-footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 4px 0 0;
}

.cloud-login-footer a {
  min-height: 44px;
  color: #415563;
  font-size: 12px;
  line-height: 44px;
}

@media (max-width: 760px) {
  .cloud-login-shell {
    min-height: auto;
    padding: 22px 16px max(20px, env(safe-area-inset-bottom));
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .cloud-login-intro {
    gap: 18px;
  }

  .cloud-login-intro-copy h1 {
    font-size: 30px;
  }

  .cloud-login-intro-copy p:last-child {
    margin-top: 8px;
    font-size: 14px;
  }

  .cloud-login-assurances {
    display: none;
  }

  .cloud-login-card {
    padding: 20px;
  }
}

@media print {
  .workspace-sidebar,
  .workspace-header,
  .dossier-tabs,
  .actions,
  .handover-actions,
  .field-upload-panel,
  .print-dialog {
    display: none !important;
  }

  .panel,
  .card,
  .handover-edit-card,
  .field-photo-card {
    break-inside: avoid;
    box-shadow: none !important;
  }
}

/* MOBILE-FIELD-001-R2: kompakte Arbeitsoberflaeche und akteninterne Medien */
.workspace-search-toggle,
.document-mobile-list,
.dossier-category-mobile-tabs {
  display: none;
}

.dossier-mobile-tile b {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--on-accent, #fff);
  background: var(--accent, #2457c5);
  font-size: 12px;
  text-align: center;
}

.document-file-name,
.document-mobile-card strong,
.document-mobile-card small,
.document-context-links {
  overflow-wrap: break-word;
  word-break: normal;
}

.document-mobile-list {
  gap: 10px;
}

.document-mobile-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line, var(--border));
  border-radius: var(--radius, 6px);
  background: var(--surface, #fff);
}

.document-mobile-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.document-mobile-card header div,
.document-mobile-card header small {
  display: block;
  min-width: 0;
}

.document-mobile-card header strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.dossier-document-mobile {
  display: none;
}

.document-mobile-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.document-mobile-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.document-mobile-card dd {
  margin: 2px 0 0;
}

.handover-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.handover-center-card,
.handover-comparison {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line, var(--border));
  border-radius: var(--radius, 6px);
  background: var(--surface, #fff);
}

.handover-center-card.planned {
  background: var(--surface-alt, #f4f7f8);
}

.handover-center-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.handover-center-card small {
  display: block;
  margin-top: 3px;
}

.handover-comparison {
  display: grid;
  gap: 10px;
}

.handover-comparison h4,
.handover-comparison p {
  margin: 0;
}

.handover-comparison-result {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line, var(--border));
  border-left: 5px solid #c77800;
  border-radius: var(--radius, 6px);
  background: var(--surface-alt, #f8fafc);
}

.handover-comparison-list {
  display: grid;
  gap: 8px;
}

.handover-comparison-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 9px;
}

.handover-comparison-list small {
  grid-column: 2;
}

.role-preview-banner {
  position: sticky;
  top: 0;
  z-index: 130;
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 6px 12px;
  border-bottom: 2px solid #915800;
  color: #3a2500;
  background: #fff3c4;
  font-weight: 800;
}

.role-preview-banner[hidden] {
  display: none;
}

.role-preview-banner button {
  min-height: 32px;
  padding: 5px 10px;
}

.role-preview-picker {
  padding: 8px 0;
  border-top: 1px solid var(--line, var(--border));
  border-bottom: 1px solid var(--line, var(--border));
}

.role-preview-picker summary {
  cursor: pointer;
  font-weight: 800;
}

.role-preview-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  margin-top: 8px;
}

.role-preview-choice label {
  min-width: 0;
}

.role-preview-choice select {
  width: 100%;
}

.role-preview-menu-state {
  display: grid;
  gap: 2px;
  padding: 9px;
  border-left: 4px solid #c77800;
  background: #fff3c4;
}

body.profile-menu-open {
  overflow: hidden;
}

/* A backdrop filter creates a containing block for fixed descendants in Chromium. */
body.profile-menu-open .topbar {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.profile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 58;
  width: auto !important;
  margin: 0 !important;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(12, 24, 37, 0.32);
}

.profile-menu {
  z-index: 60;
  width: min(380px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 88px));
  padding: 0;
  overflow: hidden;
}

.profile-menu-head,
.profile-menu-head > div,
.profile-menu-section,
.role-preview-card > div {
  display: flex;
  align-items: center;
}

.profile-menu-head {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.profile-menu-head > div {
  min-width: 0;
  gap: 9px;
}

.profile-menu-head span span,
.profile-menu-head span:last-child,
.profile-menu-head strong,
.profile-menu-head small {
  display: block;
}

.profile-menu-head small,
.role-preview-card small {
  color: var(--muted);
}

.profile-menu .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 0;
  justify-content: center;
  font-size: 1.45rem;
}

.profile-menu-scroll {
  max-height: calc(min(720px, 100dvh - 88px) - 69px);
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.profile-menu-section {
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.profile-menu-section h3 {
  margin: 0 4px 4px;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
}

.profile-worktime-compact {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted, #f7faf9);
}

.profile-worktime-compact .actions {
  margin-top: 6px;
}

.role-preview-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.role-preview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted, #f7faf9);
}

.role-preview-card > div {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.role-preview-card select {
  grid-column: 1 / -1;
  width: 100%;
}

.role-preview-card button {
  grid-column: 1 / -1;
  margin: 0;
}

.tenant-portal-head,
.tenant-portal-head > div,
.bank-import-launch,
.bank-wizard-head,
.bank-wizard-actions {
  display: flex;
  align-items: center;
}

.tenant-portal-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.tenant-portal-head > div {
  align-items: flex-start;
  flex-direction: column;
}

.tenant-portal-head h1,
.tenant-portal-head p {
  margin: 0;
}

.tenant-portal-head h1 {
  font-size: 1.55rem;
}

.tenant-portal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tenant-portal-tab {
  min-height: 44px;
  flex: 0 0 auto;
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.tenant-portal-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tenant-portal-content {
  max-width: 1080px;
}

.tenant-portal-legal {
  max-width: 1080px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tenant-portal-legal a {
  display: inline-block;
  min-height: 44px;
  padding: 11px 2px;
}

.tenant-portal-grid,
.tenant-portal-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 14px;
}

.tenant-primary-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.tenant-primary-card h2 {
  margin: 5px 0;
  font-size: 1.35rem;
}

.tenant-facts,
.tenant-action-grid,
.tenant-detail-grid,
.tenant-rent-events,
.bank-wizard-metrics,
.bank-final-check {
  display: grid;
  gap: 9px;
}

.tenant-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}

.tenant-facts span,
.tenant-action-grid button,
.tenant-rent-events article,
.bank-final-check > div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted, #f7faf9);
}

.tenant-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tenant-action-grid button {
  min-height: 86px;
  align-items: flex-start;
  flex-direction: column;
  color: var(--ink);
  text-align: left;
}

.tenant-action-grid strong {
  font-size: 1.35rem;
}

.tenant-record-list,
.tenant-document-grid {
  display: grid;
  gap: 9px;
}

.tenant-record-card header,
.tenant-inline-row,
.tenant-document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tenant-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0;
}

.tenant-detail-grid div {
  min-width: 0;
}

.tenant-detail-grid dt,
.tenant-inline-row small,
.tenant-document-card small,
.tenant-rent-events span,
.tenant-rent-events small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.tenant-detail-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.tenant-rent-events {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tenant-rent-events strong {
  display: block;
  margin: 4px 0;
}

.tenant-inline-row,
.tenant-document-card {
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.bank-import-launch {
  justify-content: space-between;
  gap: 20px;
}

.bank-import-launch h2,
.bank-import-launch p {
  margin: 3px 0;
}

.bank-wizard-backdrop {
  z-index: 80;
}

.bank-wizard-modal {
  display: flex;
  width: min(1180px, calc(100vw - 28px));
  height: min(860px, calc(100dvh - 28px));
  max-width: none;
  padding: 0;
  overflow: hidden;
  flex-direction: column;
}

.bank-wizard-head,
.bank-wizard-actions {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.bank-wizard-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.bank-wizard-head .icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.45rem;
}

.bank-wizard-progress {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 10px 16px;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.bank-wizard-progress li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.bank-wizard-progress span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.bank-wizard-progress li.active,
.bank-wizard-progress li.done {
  color: var(--ink);
}

.bank-wizard-progress li.active span,
.bank-wizard-progress li.done span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.bank-wizard-scroll {
  min-height: 0;
  flex: 1 1 auto;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}

.bank-wizard-step {
  max-width: 1040px;
  margin: 0 auto;
}

.bank-wizard-step > h3 {
  margin-top: 0;
}

.bank-wizard-metrics {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
}

.bank-transaction-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.bank-wizard-review-toolbar,
.bank-wizard-bulk,
.bank-wizard-pagination,
.bank-import-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bank-wizard-review-toolbar {
  align-items: flex-end;
  margin: 12px 0;
}

.bank-wizard-search {
  min-width: min(100%, 280px);
}

.bank-wizard-filters {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bank-wizard-bulk,
.bank-wizard-pagination,
.bank-import-progress {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle, var(--surface));
}

.bank-wizard-bulk small,
.bank-wizard-pagination span,
.bank-import-progress span {
  color: var(--muted);
}

.bank-wizard-pagination label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.bank-wizard-pagination select {
  width: auto;
  min-width: 70px;
}

.bank-import-progress progress {
  width: 100%;
  height: 12px;
  margin-top: 8px;
  accent-color: var(--primary);
}

.bank-wizard-final-confirm {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.bank-transaction-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.bank-transaction-card.duplicate {
  border-left-color: var(--muted);
  opacity: 0.82;
}

.bank-transaction-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bank-transaction-card > header small,
.bank-suggestion small {
  display: block;
  color: var(--muted);
}

.bank-amount {
  white-space: nowrap;
  font-weight: 900;
}

.bank-amount.income {
  color: var(--success, #126338);
}

.bank-amount.expense {
  color: var(--danger, #a61b1b);
}

.bank-suggestion {
  margin: 9px 0;
  padding: 9px;
  border-left: 4px solid var(--blue, #2457c5);
  background: var(--blue-soft, #eef5ff);
}

.bank-suggestion p {
  margin: 3px 0;
}

.bank-split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bank-final-check {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0;
}

.bank-final-check strong,
.bank-final-check span {
  display: block;
}

.bank-wizard-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--surface);
}

@media (max-width: 820px) {
  .profile-menu {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
    border-radius: 8px 8px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .profile-menu-scroll {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 82px);
  }

  .tenant-portal-grid,
  .tenant-portal-columns,
  .tenant-detail-grid,
  .tenant-rent-events,
  .bank-split-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tenant-facts,
  .bank-final-check {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tenant-portal-head {
    align-items: flex-start;
  }

  .tenant-record-card header,
  .tenant-inline-row,
  .tenant-document-card,
  .bank-import-launch {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-wizard-modal {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .bank-wizard-progress {
    display: flex;
    overflow-x: auto;
  }

  .bank-wizard-progress li {
    min-width: 138px;
  }

  .bank-wizard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bank-wizard-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }

  .bank-wizard-review-toolbar,
  .bank-wizard-bulk,
  .bank-wizard-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-wizard-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .bank-wizard-bulk .actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 430px) {
  .tenant-portal-head {
    flex-direction: column;
  }

  .tenant-portal-head > button,
  .bank-import-launch > button {
    width: 100%;
  }

  .tenant-action-grid,
  .tenant-facts,
  .bank-wizard-metrics,
  .bank-final-check {
    grid-template-columns: minmax(0, 1fr);
  }

  .bank-wizard-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
  }

  .bank-wizard-actions button:last-child {
    justify-self: stretch;
  }
}

@media (max-width: 780px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    min-height: 60px;
    gap: 6px;
    padding-block: 6px;
  }

  .topbar-brand-area {
    gap: 5px;
  }

  .workspace-nav-toggle {
    min-width: 48px;
  }

  .top-actions,
  .profile-trigger {
    min-width: 44px;
  }

  .dossier-category-navigation {
    padding: 10px;
  }

  .dossier-category-groups,
  .dossier-category-tabs {
    display: none;
  }

  .dossier-category-mobile {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .dossier-mobile-tile {
    display: grid;
    min-height: 72px;
    align-content: center;
    justify-items: start;
    gap: 5px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface-alt, #f3f6f8);
    text-align: left;
  }

  .dossier-mobile-tile.active {
    color: var(--on-accent, #fff);
    background: var(--accent, #2457c5);
  }

  .dossier-mobile-tile.active b {
    color: var(--accent, #2457c5);
    background: #fff;
  }

  .dossier-category-mobile-tabs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding: 2px 0 4px;
    overscroll-behavior-inline: contain;
  }

  .dossier-category-mobile-tabs button {
    min-height: 44px;
    flex: 0 0 auto;
    padding: 7px 11px;
    white-space: nowrap;
  }

  .dossier-category-mobile-tabs button.active {
    color: var(--on-accent, #fff);
    border-color: var(--accent, #2457c5);
    background: var(--accent, #2457c5);
  }

  .document-desktop-list {
    display: none;
  }

  .document-mobile-list {
    display: grid;
  }

  .dossier-document-desktop {
    display: none;
  }

  .dossier-document-mobile {
    display: grid;
  }

  .search-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-search-toggle {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
  }

  .workspace-search {
    display: none;
  }

  .workspace-search-mobile-open .workspace-search {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topbar-back-button:not(:disabled)::before {
    content: none;
  }

  .panel,
  .workspace-overview-card,
  .metric,
  .record-row,
  td,
  th,
  .notice,
  .message-thread-main {
    overflow-wrap: break-word;
    word-break: normal;
  }
}

@media (max-width: 430px) {
  .mobile-page-title {
    display: none;
  }

  .development-environment-banner {
    min-height: 30px;
    padding: 3px 8px;
    font-size: 10px;
  }

  body {
    padding-top: 30px;
  }

  .topbar {
    top: 30px;
  }

  .metric-grid,
  .workspace-overview-grid,
  .unit-media-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric,
  .workspace-overview-card,
  .unit-media-metrics > div {
    min-height: 74px;
    padding: 9px;
  }

  .metric span {
    overflow-wrap: anywhere;
  }

  .dossier-mobile-tile {
    min-height: 72px;
  }

  .handover-center-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-preview-banner {
    position: relative;
    min-height: 34px;
    align-items: stretch;
    justify-content: space-between;
    font-size: 11px;
  }

  .role-preview-banner span {
    min-width: 0;
  }

  .role-preview-banner button {
    min-height: 32px;
    flex: 0 0 auto;
  }
}

/* R3 tablet override follows the R2 desktop defaults in the cascade. */
@media (max-width: 1100px) {
  .dossier-category-groups,
  .dossier-category-tabs,
  .document-desktop-list,
  .dossier-document-desktop {
    display: none;
  }

  .dossier-category-mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dossier-category-mobile-tabs {
    display: flex;
  }

  .document-mobile-list,
  .dossier-document-mobile {
    display: grid;
  }
}

@media (max-width: 820px) {
  .dossier-category-mobile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* MOBILE-FIELD-001-R4: einheitliche, sofort sichtbare Fotoauswahl */
.photo-capture-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-subtle, #f7f9fb);
}

.photo-capture-panel h2,
.photo-capture-panel h3,
.photo-capture-panel p {
  margin: 0;
}

.photo-capture-panel .field-upload-actions,
.photo-capture-panel .field-stage {
  margin: 0;
}

.field-capture-optional,
.field-stage-optional {
  border-top: 1px solid var(--border);
}

.field-capture-optional > summary,
.field-stage-optional > summary {
  min-height: 44px;
  padding: 11px 2px;
  cursor: pointer;
  color: var(--accent, #2457c5);
  font-weight: 700;
}

.field-stage-optional .field-stage-fields {
  padding: 0 0 4px;
}

.report-photo-queue {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.report-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.report-photo-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
}

.report-photo-card > div:last-child {
  display: grid;
  gap: 5px;
  min-width: 0;
  align-content: start;
}

.report-photo-card strong,
.report-photo-card small {
  overflow-wrap: anywhere;
}

.report-photo-preview {
  display: grid;
  width: 96px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8edf2;
  aspect-ratio: 4 / 3;
  place-items: center;
}

.report-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 820px) {
  .photo-capture-panel {
    padding: 12px;
  }

  .report-photo-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo-capture-panel .field-upload-actions button,
  .report-photo-card button {
    min-height: 44px;
  }
}

@media (max-width: 430px) {
  .report-photo-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .report-photo-preview {
    width: 80px;
  }
}
.readiness-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: var(--space-3, 12px);
  margin-top: var(--space-4, 16px);
}

.readiness-check {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: var(--space-4, 16px);
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
}

.readiness-check h3,
.readiness-check p {
  margin: 0;
}

.readiness-check p {
  margin-top: 4px;
  color: var(--muted, #53636f);
  overflow-wrap: anywhere;
}

.readiness-check .chip {
  flex: 0 0 auto;
  max-width: 13rem;
  white-space: normal;
  text-align: center;
}

@media (max-width: 520px) {
  .readiness-check {
    flex-direction: column;
  }

  .readiness-check .chip {
    max-width: 100%;
  }
}

.clean-start-workspace {
  width: min(100%, 1180px);
  margin-inline: auto;
  display: grid;
  gap: var(--space-4, 16px);
}

.clean-start-header,
.clean-start-progress,
.clean-start-finance-state > article,
.clean-start-decision > summary,
.clean-start-reference,
.clean-start-review-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4, 16px);
}

.clean-start-header {
  align-items: center;
}

.clean-start-header h2,
.clean-start-header p,
.clean-start-finance-state h3,
.clean-start-finance-state p,
.clean-start-reference strong,
.clean-start-reference span {
  margin: 0;
}

.clean-start-progress {
  align-items: center;
  padding: var(--space-4, 16px);
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
}

.clean-start-progress > div,
.clean-start-reference > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.clean-start-progress progress {
  width: min(360px, 45%);
  min-height: 12px;
  accent-color: var(--accent, #0a6e83);
}

.clean-start-metrics,
.clean-start-finance-state {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3, 12px);
}

.clean-start-metrics > article,
.clean-start-state {
  min-width: 0;
  padding: var(--space-4, 16px);
  border-left: 4px solid var(--accent, #0a6e83);
  background: var(--surface-alt, #f4f7f8);
}

.clean-start-metrics span,
.clean-start-metrics strong {
  display: block;
}

.clean-start-metrics strong {
  margin-top: 4px;
  font-size: 1.6rem;
}

.clean-start-finance-state > article {
  min-width: 0;
  padding: var(--space-4, 16px);
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
}

.clean-start-filters {
  display: flex;
  gap: var(--space-2, 8px);
  overflow-x: auto;
  padding-block: 2px 8px;
  scrollbar-width: thin;
}

.clean-start-filters button {
  flex: 0 0 auto;
}

.clean-start-list {
  display: grid;
  gap: var(--space-3, 12px);
}

.clean-start-decision {
  overflow: clip;
  border: 1px solid var(--border, #ccd5dc);
  border-radius: var(--radius-md, 8px);
  background: var(--surface, #fff);
}

.clean-start-decision > summary {
  align-items: center;
  min-height: 58px;
  padding: var(--space-3, 12px) var(--space-4, 16px);
  cursor: pointer;
}

.clean-start-decision > summary > span:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.clean-start-decision > summary small {
  color: var(--muted, #53636f);
  overflow-wrap: anywhere;
}

.clean-start-decision-body {
  display: grid;
  gap: var(--space-4, 16px);
  padding: 0 var(--space-4, 16px) var(--space-4, 16px);
  border-top: 1px solid var(--border, #ccd5dc);
}

.clean-start-reference {
  align-items: center;
  padding-block: var(--space-3, 12px);
  border-bottom: 1px solid var(--border, #ccd5dc);
}

.clean-start-reference span {
  color: var(--muted, #53636f);
  overflow-wrap: anywhere;
}

.clean-start-explanation {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3, 12px);
  margin: 0;
}

.clean-start-explanation > div {
  min-width: 0;
  padding: var(--space-3, 12px);
  background: var(--surface-alt, #f4f7f8);
}

.clean-start-explanation dt {
  font-weight: 700;
}

.clean-start-explanation dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.clean-start-review-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3, 12px);
}

.clean-start-review-form .wide,
.clean-start-review-actions {
  grid-column: 1 / -1;
}

.clean-start-review-actions {
  align-items: center;
}

@media (max-width: 768px) {
  .clean-start-header,
  .clean-start-progress,
  .clean-start-finance-state > article,
  .clean-start-reference,
  .clean-start-review-actions {
    display: grid;
  }

  .clean-start-metrics,
  .clean-start-finance-state,
  .clean-start-explanation,
  .clean-start-review-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .clean-start-progress progress {
    width: 100%;
  }

  .clean-start-review-form .wide,
  .clean-start-review-actions {
    grid-column: 1;
  }

  .clean-start-decision > summary {
    align-items: flex-start;
  }

  .clean-start-decision button,
  .clean-start-header button,
  .clean-start-review-form select,
  .clean-start-review-form textarea {
    min-height: 44px;
  }
}
