:root {
  color-scheme: light;
  --bg: #f5f6f2;
  --surface: #ffffff;
  --surface-soft: #f8f8f5;
  --ink: #121316;
  --ink-2: #1d1f25;
  --text: #1b1d22;
  --muted: #6f7480;
  --line: #dedfd8;
  --line-strong: #cccec5;
  --accent: #7c5cff;
  --accent-2: #ede9ff;
  --blue: #2563eb;
  --blue-2: #e8f0ff;
  --blue-3: #bfdbfe;
  --green: #17a77f;
  --green-2: #e2f6ef;
  --amber: #f4b640;
  --amber-2: #fff2d0;
  --red: #ce4b61;
  --red-2: #fde7ec;
  --shadow: 0 18px 44px rgba(20, 22, 28, 0.09);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(circle at top left, rgba(124, 92, 255, 0.08), transparent 34%), var(--bg);
}

.login-card {
  width: min(390px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-mark,
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.login-card h1 {
  margin: 16px 0 7px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: 0;
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span,
.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.input,
.textarea,
.select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 10px;
  outline: none;
}

.textarea {
  min-height: 210px;
  resize: vertical;
  line-height: 1.48;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.primary,
.secondary,
.ghost,
.danger,
.icon-button,
.nav-button,
.chip-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.primary {
  background: var(--ink);
  color: #fff;
  padding: 0 13px;
  font-weight: 850;
}

.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
  padding: 0 12px;
  font-weight: 800;
}

.danger-soft {
  background: var(--red-2);
  border-color: #f0c8d0;
  color: var(--red);
}

.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 0 10px;
  font-weight: 750;
}

.danger {
  background: var(--red-2);
  color: var(--red);
  border-color: #f0c8d0;
  padding: 0 12px;
  font-weight: 820;
}

.icon-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  font-weight: 900;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 16px 12px;
  background: var(--ink);
  color: #fff;
  border-right: 1px solid #272a32;
}

.brand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 4px;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand small {
  color: #a8afbd;
  font-weight: 700;
}

.nav {
  display: grid;
  gap: 4px;
  align-content: start;
}

.nav-button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 10px;
  background: transparent;
  color: #b9bfca;
  font-weight: 800;
}

.nav-button span:first-child {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #202229;
  color: #fff;
  font-size: 12px;
}

.nav-button:hover,
.nav-button.active {
  background: #23262e;
  color: #fff;
}

.nav-button.active span:first-child {
  background: var(--accent);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  color: #a8afbd;
  font-size: 12px;
  padding: 0 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid #30333c;
  border-radius: 999px;
  padding: 7px 9px;
  background: #1b1d22;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex: 0 0 auto;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 246, 242, 0.94);
  backdrop-filter: blur(12px);
}

.search {
  position: relative;
}

.search input {
  height: 38px;
  padding-left: 34px;
  background: #fff;
}

.search span {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 900;
}

.top-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.user-badge {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  font-weight: 800;
}

.user-badge span:nth-child(2) {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge small {
  color: var(--muted);
  font-weight: 850;
}

.main {
  min-width: 0;
  padding: 18px;
}

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

.view-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
}

.view-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  box-shadow: 0 7px 20px rgba(20, 22, 28, 0.04);
}

.metric span {
  color: var(--muted);
  font-weight: 850;
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.metric small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.command-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid #252832;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.overview-command {
  margin-bottom: 12px;
}

.command-panel h3 {
  margin: 3px 0 5px;
  font-size: 20px;
  letter-spacing: 0;
}

.command-panel p {
  margin: 0;
  color: #c7ccd6;
  line-height: 1.42;
}

.command-panel .primary {
  background: #fff;
  color: var(--ink);
}

.command-panel .secondary {
  background: #242731;
  color: #fff;
  border-color: #383c49;
}

.eyebrow {
  color: #9cf0d2;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}

.notice-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #fff8e8;
  border: 1px solid #efd59e;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.notice-band h3,
.notice-band p {
  margin: 0;
}

.notice-band p {
  color: #6e572b;
  margin-top: 3px;
  line-height: 1.4;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.overview-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.status-tile {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px;
}

.status-tile strong {
  display: block;
  font-size: 20px;
}

.status-tile span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.status-tile.accent {
  background: var(--accent-2);
  border-color: #d8d0ff;
}

.status-tile.amber {
  background: var(--amber-2);
  border-color: #ecd6a5;
}

.status-tile.red {
  background: var(--red-2);
  border-color: #f0c8d0;
}

.status-tile.green {
  background: var(--green-2);
  border-color: #c6eadc;
}

.panel,
.list-pane,
.editor-pane {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(20, 22, 28, 0.04);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 15px;
}

.panel-body {
  padding: 14px;
}

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

.item-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
}

.item-card.clickable {
  width: 100%;
  text-align: left;
}

.item-card.clickable:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.10);
}

.active-note {
  border-color: var(--accent);
  background: var(--accent-2);
}

.item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 850;
}

.item-title span:first-child {
  overflow-wrap: anywhere;
}

.item-meta,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.item-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  min-height: 22px;
  padding: 0 8px;
}

.badge {
  background: var(--accent-2);
  color: var(--accent);
}

.badge.green {
  background: var(--green-2);
  color: var(--green);
}

.badge.amber {
  background: var(--amber-2);
  color: #8a5a0a;
}

.badge.red {
  background: var(--red-2);
  color: var(--red);
}

.tag {
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(240px, 330px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.list-scroll {
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.editor-body {
  padding: 14px;
}

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

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.button-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.comments {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 12px;
}

.comment {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.comment:last-child {
  border-bottom: 0;
}

.comment p {
  margin: 4px 0 0;
  line-height: 1.42;
}

.upload-zone {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px dashed #aeb3bd;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

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

.file-card {
  min-height: 126px;
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.file-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent-2);
  color: var(--accent);
  font-weight: 950;
}

.file-mini {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 14px;
  align-items: start;
}

.task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(210px, 260px);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fff;
}

.task-row.dragging {
  opacity: 0.65;
  border-color: var(--accent);
}

.order {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 950;
}

.task-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.task-controls {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-actions {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
}

.activity-item::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 999px;
  background: var(--green);
}

.activity-item p {
  margin: 0;
  line-height: 1.36;
}

.team-grid,
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 14px;
  align-items: start;
}

.invite-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 140px auto;
  gap: 8px;
  align-items: center;
}

.invite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.invite-code {
  margin-top: 8px;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 7px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 950;
}

.server-line {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.server-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.server-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.server-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.step-line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.step-line strong {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-2);
  color: var(--accent);
}

.member-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--green-2);
  color: var(--green);
  font-weight: 950;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 110px;
  text-align: center;
  color: var(--muted);
  padding: 20px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  background: var(--ink);
  color: #fff;
  padding: 11px 13px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 1120px) {
  .metrics,
  .file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .plan-grid,
  .team-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

  .task-controls {
    grid-column: 2 / -1;
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #272a32;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(6, minmax(92px, 1fr));
    overflow-x: auto;
  }

  .nav-button {
    justify-content: center;
  }

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

  .top-actions {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .main {
    padding: 14px;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .command-panel,
  .two-pane,
  .form-grid,
  .file-grid,
  .overview-status,
  .invite-card,
  .invite-form {
    grid-template-columns: 1fr;
  }

  .list-scroll {
    max-height: none;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .login-card {
    padding: 20px;
  }

  .metrics,
  .notice-band,
  .task-row,
  .task-controls {
    grid-template-columns: 1fr;
  }

  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .user-badge,
  .top-actions .secondary,
  .top-actions .ghost {
    width: 100%;
  }
}

/* Firmaraum v4: kompakte Kopf-Navigation und Admin-Unterbereiche */
.top-shell.shell {
  display: block;
  min-height: 100vh;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(320px, 1fr) minmax(300px, 520px);
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(245, 246, 242, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand-block {
  min-width: 0;
}

.brand-block .brand-mark {
  background: var(--ink);
}

.brand-block strong,
.brand-block small {
  color: var(--text);
}

.brand-block small {
  display: block;
  color: var(--muted);
}

.header-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.top-nav.nav {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 1px;
}

.top-nav .nav-button {
  width: auto;
  min-height: 34px;
  flex: 0 0 auto;
  justify-content: center;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
}

.top-nav .nav-button span:first-child {
  width: 20px;
  height: 20px;
  background: var(--surface-soft);
  color: var(--muted);
}

.top-nav .nav-button:hover,
.top-nav .nav-button.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.top-nav .nav-button.active span:first-child {
  background: var(--accent);
  color: #fff;
}

.header-meta {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.header-tools {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, auto);
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.header-tools .search input {
  height: 34px;
  min-height: 34px;
}

.top-actions {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-action {
  min-height: 34px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 13px;
}

.header-status {
  min-height: 34px;
  padding: 0 10px;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.view-heading {
  margin-bottom: 12px;
}

.view-heading h2 {
  font-size: 22px;
}

.view-heading p {
  font-size: 13px;
}

.input,
.select {
  min-height: 36px;
  padding: 7px 10px;
}

.textarea {
  min-height: 150px;
  padding: 9px 10px;
}

.panel-header {
  padding: 10px 12px;
}

.panel-body,
.editor-body {
  padding: 12px;
}

.metric {
  padding: 11px;
}

.metric strong {
  font-size: 22px;
}

.overview-command.command-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
  margin-bottom: 12px;
}

.overview-command h3 {
  font-size: 19px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.admin-tab {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  min-height: 34px;
  padding: 0 12px;
  font-weight: 850;
  white-space: nowrap;
}

.admin-tab.active,
.admin-tab:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.admin-content {
  min-width: 0;
}

.compact-invite-form {
  grid-template-columns: minmax(170px, 1fr) 150px auto;
}

.member-admin-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(130px, 170px) auto;
  gap: 10px;
  align-items: center;
}

.member-admin-main {
  min-width: 0;
}

.member-admin-main strong {
  overflow-wrap: anywhere;
}

.compact-member {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.mode-card p {
  margin: 4px 0 0;
}

.empty {
  min-height: 82px;
  padding: 16px;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

  .header-tools {
    grid-column: 1 / -1;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    justify-content: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .header-tools {
    grid-template-columns: 1fr;
  }

  .top-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px;
  }

  .main {
    padding: 12px;
  }

  .overview-command.command-panel,
  .compact-invite-form,
  .member-admin-row,
  .mode-card {
    grid-template-columns: 1fr;
  }

  .member-admin-row .danger,
  .mode-card .secondary {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .top-actions {
    flex-direction: row;
    align-items: center;
  }

  .top-actions .secondary,
  .top-actions .ghost,
  .top-actions .primary,
  .header-status {
    width: auto;
    flex: 0 0 auto;
  }

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

/* Firmaraum v4.6: kompaktere Übersicht und ruhigere Aufgaben */
.overview-top-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

.overview-top-grid .overview-command {
  margin-bottom: 0;
  min-height: 100%;
}

.overview-metrics.metrics {
  margin-bottom: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.overview-metrics .metric {
  padding: 10px;
}

.overview-metrics .metric strong {
  font-size: 20px;
}

.overview-card-grid.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.overview-card-grid .panel-body {
  padding: 10px;
}

.plan-status-strip {
  margin-bottom: 12px;
}

.plan-board {
  overflow: hidden;
}

.plan-toolbar {
  align-items: flex-start;
}

.plan-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 8px;
}

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

.chip-button {
  min-height: 30px;
  padding: 0 9px;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.chip-button span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
}

.chip-button.active,
.chip-button:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip-button.active span,
.chip-button:hover span {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.plan-task-form {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.8fr) 150px 140px 140px auto;
  gap: 9px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.plan-task-form .field {
  margin-bottom: 0;
}

.plan-details-field {
  grid-column: 1 / -2;
}

.plan-task-form .textarea {
  min-height: 64px;
}

.plan-inline-note {
  display: flex;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.plan-task-list {
  gap: 7px;
}

.plan-task-list .task-row {
  padding: 8px;
}

.plan-task-list .task-main strong {
  font-size: 14px;
}

.plan-task-list .item-meta {
  margin-top: 4px;
}

@media (max-width: 1180px) {
  .overview-top-grid,
  .overview-card-grid.dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .plan-title-field,
  .plan-details-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .overview-metrics.metrics,
  .plan-task-form {
    grid-template-columns: 1fr;
  }

  .plan-toolbar {
    flex-direction: column;
  }

  .plan-toolbar .button-row {
    width: 100%;
  }

  .plan-toolbar .button-row .primary,
  .plan-toolbar .button-row .secondary {
    width: 100%;
  }
}


/* Firmaraum v4.9: Seitenmenü, Projekte, Chat und Gruppen */
.with-side {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
}

.content-shell {
  min-width: 0;
}

.side-menu {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 100vh;
  align-self: start;
  background: var(--ink);
  color: #fff;
  border-right: 1px solid #272a32;
  padding: 10px;
  overflow: hidden;
}

.side-open {
  grid-template-columns: 220px minmax(0, 1fr);
}

.side-toggle,
.side-link {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  background: transparent;
  color: #b9bfca;
  padding: 0 8px;
  text-align: left;
  font-weight: 850;
}

.side-toggle span,
.side-link span:first-child {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #202229;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
}

.side-link:hover,
.side-link.active,
.side-toggle:hover {
  background: #23262e;
  color: #fff;
}

.side-link.active span:first-child {
  background: var(--accent);
}

.side-panel {
  display: grid;
  gap: 5px;
  margin-top: 14px;
}

.side-section-title {
  margin: 10px 8px 4px;
  color: #7f8795;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.side-closed .side-link,
.side-closed .side-toggle {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.side-closed .side-link strong,
.side-closed .side-toggle strong,
.side-closed .side-section-title {
  display: none;
}

.muted-link {
  color: #8e96a6;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  gap: 14px;
  align-items: start;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-card {
  display: grid;
  gap: 10px;
}

.project-card p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.project-stats span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.project-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
}

.compact-textarea {
  min-height: 92px;
}

.chat-panel {
  overflow: hidden;
}

.chat-list {
  min-height: 360px;
  max-height: calc(100vh - 280px);
  overflow: auto;
  display: grid;
  align-content: end;
  gap: 8px;
  background: var(--surface-soft);
}

.chat-message {
  max-width: min(680px, 88%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px 10px;
}

.chat-message.mine {
  justify-self: end;
  background: var(--accent-2);
  border-color: #d8d0ff;
}

.chat-message div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}

.chat-message span {
  color: var(--muted);
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.chat-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line);
}

.group-form {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-top: 6px;
}

.group-card {
  display: grid;
  gap: 8px;
}

@media (max-width: 980px) {
  .with-side,
  .side-open,
  .side-closed {
    grid-template-columns: 1fr;
  }

  .side-menu {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #272a32;
  }

  .side-panel {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .side-section-title {
    grid-column: 1 / -1;
  }

  .side-closed .side-link strong,
  .side-closed .side-toggle strong,
  .side-closed .side-section-title {
    display: block;
  }

  .side-closed .side-link,
  .side-closed .side-toggle {
    grid-template-columns: 26px minmax(0, 1fr);
    justify-items: stretch;
    padding: 0 8px;
  }

  .project-layout,
  .project-grid,
  .group-form,
  .chat-form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .side-panel {
    grid-template-columns: 1fr;
  }

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

  .chat-message {
    max-width: 100%;
  }
}


/* Firmaraum v4.9.1: linkes Menü darf nicht die ganze Seite füllen */
.top-shell.shell.with-side {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
}

.top-shell.shell.with-side.side-open {
  grid-template-columns: 220px minmax(0, 1fr);
}

.top-shell.shell.with-side.side-closed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.top-shell.shell.with-side .side-menu {
  grid-column: 1;
  width: auto;
}

.top-shell.shell.with-side .content-shell {
  grid-column: 2;
  min-width: 0;
  background: var(--bg);
}

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 1fr;
  }

  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side .content-shell {
    grid-column: 1;
  }
}


/* Firmaraum v4.9.3: Projektkarten, Projektstatus und einfache Notizen */
.project-card-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.project-card-button:hover {
  border-color: #c9c3ff;
  box-shadow: 0 10px 24px rgba(17, 18, 24, 0.08);
}

.project-card-button .project-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card-button .project-stats span {
  display: grid;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}

.project-card-button .project-stats strong {
  color: var(--text);
  font-size: 16px;
}

.project-card-button .project-stats small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.project-status-strip {
  margin: 10px 0 10px;
}

.project-status-strip .status-tile {
  padding: 9px 10px;
}

.project-status-strip .status-tile strong {
  font-size: 19px;
}

.note-simple-editor {
  display: grid;
  gap: 12px;
}

.note-author-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.note-body-input {
  min-height: 360px;
}

.note-folder-panel {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.note-folder-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.note-folder-entry {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
}

.note-folder-pill,
.note-folder-delete {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 850;
  min-height: 30px;
}

.note-folder-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 0 10px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.note-folder-entry .note-folder-pill {
  border-radius: 999px 0 0 999px;
}

.note-folder-pill strong {
  color: var(--text);
  font-size: 12px;
  background: var(--surface-soft);
  border-radius: 999px;
  min-width: 20px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.note-folder-pill.active,
.note-folder-entry.active .note-folder-pill {
  background: var(--accent-2);
  border-color: #d8ccff;
  color: var(--accent);
}

.note-folder-delete {
  border-left: 0;
  border-radius: 0 999px 999px 0;
  padding: 0 9px;
  color: var(--red);
}

.note-folder-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.note-folder-form .input,
.note-folder-form .secondary {
  min-height: 32px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.note-folder-panel-dropdown {
  grid-template-columns: minmax(220px, 360px) minmax(220px, 1fr);
  align-items: end;
}

.note-folder-selector-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.note-folder-select-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.note-folder-select-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.note-folder-select {
  width: 100%;
  min-height: 34px;
  border-color: var(--blue-3);
  background: var(--blue-2);
  color: var(--blue);
  font-weight: 900;
}

.note-folder-current-delete {
  min-height: 34px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .note-folder-panel-dropdown,
  .note-folder-selector-row {
    grid-template-columns: 1fr;
  }
}

.note-folder-field {
  max-width: 360px;
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #f0c8d0;
  border-radius: var(--radius);
  background: var(--red-2);
  padding: 12px;
}

.danger-zone p {
  margin: 3px 0 0;
}

@media (max-width: 620px) {
  .project-card-button .project-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }
}


/* Firmaraum v4.9.9: Projektanlage nur fuer Admins anzeigen */
.project-layout-wide {
  grid-template-columns: minmax(0, 1fr);
}

.project-layout-wide .project-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
}


/* Firmaraum v4.10.3: Aktivitaet deutlich kompakter */
.activity-panel .panel-header {
  min-height: 38px;
  padding: 8px 10px;
}

.activity-panel .panel-header h3 {
  font-size: 15px;
  line-height: 1.15;
}

.activity-panel .badge {
  padding: 4px 7px;
  font-size: 10px;
}

.activity-panel-body {
  padding: 7px 10px;
}

.activity-panel .activity-list {
  gap: 4px;
}

.activity-panel .activity-item {
  grid-template-columns: 5px minmax(0, 1fr);
  gap: 6px;
  padding: 1px 0;
}

.activity-panel .activity-item::before {
  width: 4px;
  height: 4px;
  margin-top: 7px;
}

.activity-panel .activity-item p {
  font-size: 12px;
  line-height: 1.2;
}

.activity-panel .activity-item .muted {
  display: block;
  margin-top: 0;
  font-size: 10px;
  line-height: 1.15;
}


/* Firmaraum v4.10.4: Marke unten im Menue, Bereichstitel oben */
.app-header {
  grid-template-columns: minmax(220px, 320px) minmax(260px, 1fr) minmax(300px, 520px);
}

.header-title {
  min-width: 0;
}

.header-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0;
}

.header-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main > .view-heading {
  display: none;
}

.side-menu {
  display: flex;
  flex-direction: column;
}

.side-panel {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 10px;
}

.side-brand-bottom {
  flex: 0 0 auto;
  border-top: 1px solid #272a32;
  padding: 10px 2px 0;
  display: grid;
  gap: 8px;
}

.side-brand-main {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.side-brand-main .brand-mark {
  width: 36px;
  height: 36px;
}

.side-brand-main strong {
  display: block;
  color: #fff;
  font-size: 15px;
  line-height: 1.05;
}

.side-brand-main small {
  display: block;
  margin-top: 2px;
  color: #9fa6b5;
  font-size: 11px;
  font-weight: 800;
}

.side-brand-meta {
  display: grid;
  gap: 2px;
  color: #8e96a6;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.25;
}

.side-closed .side-brand-main {
  grid-template-columns: 1fr;
  justify-items: center;
}

.side-closed .side-brand-main strong,
.side-closed .side-brand-main small,
.side-closed .side-brand-meta {
  display: none;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .side-brand-bottom {
    display: none;
  }
}

@media (max-width: 820px) {
  .header-title p {
    white-space: normal;
  }
}


/* Firmaraum v4.10.5: Status und Abmelden unten im Menue */
.side-bottom-actions {
  display: grid;
  gap: 6px;
}

.side-status {
  width: 100%;
  min-height: 31px;
  padding: 0 8px;
  background: #1b1d22;
  border-color: #30333c;
  color: #e7eaf0;
  font-size: 11px;
  font-weight: 850;
}

.side-logout {
  width: 100%;
  min-height: 32px;
  border: 1px solid #30333c;
  border-radius: var(--radius);
  background: #202229;
  color: #c4cad5;
  font-weight: 850;
}

.side-logout:hover {
  background: #2a2d36;
  color: #fff;
}

.side-closed .side-bottom-actions {
  display: none;
}


/* Firmaraum v4.10.6: Online und Version unten sichtbarer */
.side-brand-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.side-brand-meta span {
  min-width: 0;
  border: 1px solid #30333c;
  border-radius: var(--radius);
  background: #17191e;
  padding: 6px 7px;
  color: #9fa6b5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-brand-meta strong {
  display: block;
  color: #fff;
  font-size: 12px;
  line-height: 1.1;
}


/* Firmaraum v4.10.7: Einladungshilfe direkt im Code-Feld */
.invite-create-body {
  gap: 10px;
}

.invite-help-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.invite-help-inline .step-line {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 7px;
}

.invite-help-inline .step-line strong {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.invite-help-inline .step-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

@media (max-width: 1180px) {
  .invite-help-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .invite-help-inline {
    grid-template-columns: 1fr;
  }
}


/* Firmaraum v5.0.0: Account-Login und Unternehmensregistrierung */
.login-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.1fr;
  gap: 14px;
  align-items: stretch;
}

.login-layout .login-card {
  width: 100%;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.1;
}

.login-intro {
  background: var(--ink);
  color: #fff;
}

.login-intro p,
.login-intro h1 {
  color: #fff;
}

.login-intro .login-mark {
  background: #fff;
  color: var(--ink);
}

.legacy-login {
  background: var(--surface-soft);
}

@media (max-width: 980px) {
  .login-layout {
    grid-template-columns: 1fr;
  }
}


/* Firmaraum v5.0.1: UI-Aufraeumrunde */
.app-header-clean {
  grid-template-columns: 1fr !important;
  gap: 0;
  padding: 12px 18px 9px;
}

.app-header-clean .header-title h1 {
  font-size: 23px;
}

.app-header-clean .header-title p {
  max-width: 820px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.main {
  padding: 14px 18px 18px;
}

.side-open {
  grid-template-columns: 196px minmax(0, 1fr);
}

.side-menu {
  padding: 8px;
}

.side-toggle,
.side-link {
  min-height: 32px;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  padding: 0 7px;
  font-size: 12.5px;
  border-radius: 7px;
}

.side-toggle span,
.side-link span:first-child {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
}

.side-link strong,
.project-shortcut strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel {
  gap: 3px;
  margin-top: 10px;
}

.side-section-title {
  margin: 9px 7px 3px;
  font-size: 10px;
}

.side-brand-bottom {
  gap: 6px;
  padding: 8px 1px 0;
}

.side-brand-main {
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  gap: 7px;
}

.side-brand-main .brand-mark {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.side-brand-main strong {
  font-size: 13px;
}

.side-brand-main small {
  font-size: 10px;
}

.side-mini-settings {
  width: 28px;
  height: 28px;
  border: 1px solid #30333c;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #202229;
  color: #d9dee8;
  font-size: 11px;
  font-weight: 950;
}

.side-mini-settings:hover,
.side-mini-settings.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.side-brand-meta {
  gap: 5px;
}

.side-brand-meta span {
  padding: 5px 6px;
}

.side-brand-meta strong {
  font-size: 11px;
}

.side-status {
  min-height: 28px;
  font-size: 10.5px;
}

.side-logout {
  min-height: 30px;
  font-size: 12px;
}

.side-closed .side-mini-settings,
.side-closed .side-bottom-actions {
  display: none;
}

.work-tabs.admin-tabs,
.project-tabs,
.admin-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}

.work-tabs.admin-tabs {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.work-tabs .admin-tab {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.overview-clean-grid {
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.78fr);
  margin-bottom: 12px;
}

.overview-clean-cards.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-clean-grid .panel-body,
.overview-clean-cards .panel-body {
  padding: 10px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.3fr) minmax(250px, 0.85fr) minmax(270px, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.settings-admin {
  margin-top: 14px;
}

.settings-admin .view-heading {
  display: none;
}

.settings-section-title {
  margin: 0 0 10px;
}

.settings-section-title h3 {
  margin: 0;
  font-size: 18px;
}

.settings-section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

@media (max-width: 1280px) {
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .side-open {
    grid-template-columns: 184px minmax(0, 1fr);
  }

  .overview-clean-grid,
  .overview-clean-cards.dashboard-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .app-header-clean {
    padding: 10px 12px 8px;
  }

  .main {
    padding: 12px;
  }
}


/* Firmaraum v5.1.0: Logo, Sicherheit, vertikale Tabs und mobiler Feinschliff */
.app-logo,
.login-logo,
.side-logo {
  display: block;
  object-fit: cover;
  background: #fff;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 18, 24, 0.10);
}

.side-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.security-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.security-points span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.login-error {
  margin-top: 12px;
}

.side-open {
  grid-template-columns: 188px minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.side-open {
  grid-template-columns: 188px minmax(0, 1fr) !important;
}

.side-toggle,
.side-link {
  min-height: 28px !important;
  height: auto;
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 4px 7px !important;
  font-size: 12px;
  align-content: center;
}

.side-link.active {
  min-height: 30px !important;
}

.side-panel {
  gap: 2px !important;
}

.side-section-title {
  margin: 8px 7px 2px !important;
}

.side-brand-main {
  grid-template-columns: 28px minmax(0, 1fr) 30px !important;
}

.side-mini-settings {
  font-size: 15px !important;
}

.main.work-main {
  width: min(1280px, 100%);
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.main.work-main > .work-tabs {
  grid-column: 1;
  grid-row: 1 / span 50;
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin: 0;
  padding: 0 10px 0 0;
  border: 0;
  border-right: 1px solid var(--line);
  overflow: visible;
}

.main.work-main > .work-tabs ~ * {
  grid-column: 2;
}

.vertical-work-tabs .admin-tab {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
}

.floating-chat {
  position: fixed;
  left: 204px;
  bottom: 14px;
  z-index: 60;
  width: min(340px, calc(100vw - 28px));
}

.side-closed + .content-shell ~ .floating-chat,
.side-closed .floating-chat {
  left: 86px;
}

.floating-chat-toggle {
  width: auto;
  min-height: 40px;
  border: 1px solid #30333c;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.floating-chat-toggle strong {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}

.floating-chat-open {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.floating-chat-head,
.floating-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}

.floating-chat-switch,
.floating-chat-target {
  padding: 8px 9px 0;
}

.floating-chat-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.floating-chat-switch button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  min-height: 30px;
  border-radius: 8px;
  font-weight: 900;
}

.floating-chat-switch button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.floating-chat-form {
  border-bottom: 0;
  border-top: 1px solid var(--line);
}

.floating-chat-list {
  max-height: 240px;
  overflow: auto;
  display: grid;
  gap: 7px;
  padding: 9px;
  background: var(--surface-soft);
}

.floating-chat-list .empty {
  min-height: 70px;
}

.team-board {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(240px, 0.95fr) minmax(260px, 1fr) minmax(280px, 0.9fr);
  gap: 12px;
  align-items: start;
}

.team-board .textarea {
  min-height: 120px;
}

.checkbox-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.info-text {
  line-height: 1.45;
  margin: 0;
}

.security-panel {
  min-width: 0;
}

.security-grid {
  display: grid;
  gap: 9px;
}

.link-invite-form {
  grid-template-columns: minmax(170px, 1fr) minmax(190px, 1fr) 140px auto;
}

.invite-link {
  font-size: 12px;
}

.overview-clean-grid .panel:first-child .panel-header .badge.green {
  display: none;
}

@media (max-width: 1380px) {
  .team-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 56px minmax(0, 1fr) !important;
  }

  .side-menu {
    position: sticky !important;
    height: 100vh !important;
    border-right: 1px solid #272a32 !important;
    border-bottom: 0 !important;
  }

  .side-panel {
    grid-template-columns: 1fr !important;
  }

  .side-link strong,
  .side-toggle strong,
  .side-section-title,
  .side-brand-bottom {
    display: none !important;
  }

  .side-link,
  .side-toggle {
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    padding: 4px 0 !important;
  }

  .main.work-main {
    display: block;
  }

  .main.work-main > .work-tabs {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 8px;
    margin-bottom: 12px;
  }

  .vertical-work-tabs .admin-tab {
    width: auto;
    flex: 0 0 auto;
  }

  .floating-chat {
    left: 68px !important;
    bottom: 10px;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 12px 10px;
  }

  .team-board,
  .settings-grid,
  .settings-grid-wide,
  .overview-clean-grid,
  .overview-clean-cards.dashboard-grid,
  .dashboard-grid,
  .two-pane,
  .project-layout,
  .file-grid,
  .form-grid,
  .link-invite-form,
  .invite-card {
    grid-template-columns: 1fr !important;
  }

  .overview-status {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .floating-chat {
    left: 64px !important;
    width: calc(100vw - 76px);
  }
}

/* Firmaraum v5.1.1: Einstellungen bleiben mobil erreichbar */
@media (max-width: 980px) {
  .side-brand-bottom {
    display: grid !important;
    margin-top: auto;
    padding: 8px 0 0 !important;
  }

  .side-brand-main {
    grid-template-columns: 1fr !important;
    justify-items: center;
    gap: 6px !important;
  }

  .side-brand-main > div,
  .side-brand-meta,
  .side-bottom-actions {
    display: none !important;
  }

  .side-logo,
  .side-mini-settings {
    display: grid !important;
  }
}


/* Firmaraum v5.2.0: persoenlicher Account-Start und Projektprofil */
.single-auth-layout {
  grid-template-columns: minmax(280px, 460px);
  justify-content: center;
}

.auth-choice-card,
.auth-form-card {
  min-height: auto;
}

.auth-choice-card h1 {
  margin: 12px 0 6px;
}

.auth-choice-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.auth-back {
  width: max-content;
  margin-bottom: 8px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(320px, 1fr);
  gap: 12px;
  align-items: start;
}

.profile-projects-panel {
  grid-column: 1 / -1;
}

.account-project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.danger-profile-panel {
  border-color: #f3c0cb;
}

.side-link {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.side-link.active {
  width: 100%;
}

@media (max-width: 760px) {
  .profile-grid,
  .account-project-card {
    grid-template-columns: 1fr;
  }
}

/* Firmaraum v5.3.1: stabile Klickflaechen und responsive Arbeitsflaechen */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.content-shell,
.main,
.panel,
.item-card,
.two-pane,
.project-layout,
.team-board,
.settings-grid,
.profile-grid {
  min-width: 0;
}

.app-header-clean {
  padding: 10px 14px 8px;
}

.header-title p,
.view-heading p,
.settings-section-title p {
  display: none !important;
}

.view-heading {
  margin-bottom: 8px;
}

.side-menu {
  overflow-x: hidden;
}

.side-panel {
  gap: 4px !important;
}

.side-toggle,
.side-link,
.side-link.active {
  width: 100% !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  align-content: center;
}

.side-link strong,
.side-toggle strong {
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-link span:first-child,
.side-toggle span:first-child {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}

.side-section-title {
  margin: 8px 8px 3px !important;
  font-size: 10px !important;
}

.main {
  width: min(100%, 1280px);
  max-width: 100%;
}

.main.work-main {
  width: min(100%, 1320px);
  grid-template-columns: minmax(96px, 10%) minmax(0, 1fr);
  gap: 12px;
}

.main.work-main > .work-tabs {
  top: 58px;
  min-width: 0;
}

.main.work-main > .work-tabs ~ * {
  min-width: 0;
}

.vertical-work-tabs .admin-tab {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.project-layout,
.settings-grid,
.settings-grid-wide,
.profile-grid,
.team-board,
.dashboard-grid,
.overview-clean-grid {
  width: 100%;
  max-width: 100%;
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.project-card,
.project-card .project-stats,
.project-card .project-stat {
  min-width: 0;
}

.team-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)) !important;
}

.overview-status {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-status .status-tile {
  min-width: 0;
}

.overview-clean-grid .panel:first-child .panel-header .badge.green {
  display: none !important;
}

.floating-chat-form-expanded {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.chat-routing-row,
.chat-compose-row {
  display: grid;
  gap: 7px;
}

.chat-routing-row {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
}

.chat-compose-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.group-member-select {
  min-height: 78px;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 58px minmax(0, 1fr) !important;
  }

  .side-menu {
    padding: 8px 7px !important;
  }

  .side-link,
  .side-toggle,
  .side-link.active {
    width: 40px !important;
    min-height: 40px !important;
    height: 40px !important;
    justify-self: center;
    padding: 0 !important;
  }

  .side-brand-bottom {
    display: grid !important;
    margin-top: auto;
    padding-top: 8px !important;
  }

  .side-brand-main > div,
  .side-brand-meta,
  .side-bottom-actions,
  .side-link strong,
  .side-toggle strong,
  .side-section-title {
    display: none !important;
  }

  .main {
    padding: 10px 8px;
  }

  .main.work-main {
    display: block;
    width: 100%;
  }

  .main.work-main > .work-tabs {
    position: sticky;
    top: 0;
    z-index: 25;
    display: flex;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    margin: -10px 0 10px;
    background: var(--paper);
  }

  .vertical-work-tabs .admin-tab {
    width: auto;
    flex: 0 0 auto;
  }

  .floating-chat {
    left: 66px !important;
    width: calc(100vw - 76px);
    max-width: 360px;
  }
}

@media (max-width: 760px) {
  .team-board,
  .settings-grid,
  .settings-grid-wide,
  .overview-clean-grid,
  .overview-clean-cards.dashboard-grid,
  .dashboard-grid,
  .two-pane,
  .project-layout,
  .file-grid,
  .form-grid,
  .link-invite-form,
  .invite-card,
  .profile-grid,
  .account-project-card {
    grid-template-columns: 1fr !important;
  }

  .overview-status {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .chat-routing-row,
  .chat-compose-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 50px minmax(0, 1fr) !important;
  }

  .side-menu {
    padding: 6px 5px !important;
  }

  .side-link,
  .side-toggle,
  .side-link.active {
    width: 36px !important;
    min-height: 36px !important;
    height: 36px !important;
  }

  .floating-chat {
    left: 54px !important;
    width: calc(100vw - 62px);
  }

  .status-tile {
    padding: 10px 8px;
  }
}

/* Firmaraum v5.4.0: Profil ohne Seitenleiste, kompakte Navigation und Freunde */
.profile-shell {
  min-height: 100vh;
  background: var(--bg);
}

.profile-shell .content-shell {
  width: 100%;
}

.profile-main {
  width: min(100%, 1100px);
  margin: 0 auto;
}

.top-shell.shell.with-side.side-open {
  grid-template-columns: 176px minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.side-closed {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}

.side-menu {
  display: flex !important;
  flex-direction: column;
  padding: 8px !important;
}

.side-toggle {
  width: 28px !important;
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  justify-items: center;
  border-radius: 8px !important;
}

.side-toggle span {
  width: 22px !important;
  height: 22px !important;
  background: #202229 !important;
}

.side-toggle strong {
  display: none !important;
}

.side-panel {
  flex: 1;
  display: flex !important;
  flex-direction: column;
  gap: 4px !important;
  margin-top: 10px !important;
  min-height: 0;
}

.side-main-nav {
  display: grid;
  gap: 3px;
}

.side-bottom-nav {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #282b33;
}

.side-link,
.side-link.active {
  width: 100% !important;
  min-height: 24px !important;
  height: 24px !important;
  grid-template-columns: 1fr !important;
  padding: 0 6px !important;
  border-radius: 6px !important;
  background: transparent;
}

.side-link:hover,
.side-link.active {
  background: #22252d;
}

.side-link strong {
  display: block !important;
  font-size: 11px !important;
  line-height: 1;
}

.side-link span:first-child {
  display: none !important;
}

.side-section-title {
  margin: 8px 6px 2px !important;
  font-size: 9px !important;
}

.side-closed .side-panel,
.side-closed .side-brand-bottom {
  display: none !important;
}

.side-closed .side-menu {
  align-items: center;
}

.side-closed .side-toggle {
  justify-self: center;
}

.friends-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1fr);
  gap: 12px;
  align-items: start;
}

.friends-list-panel {
  grid-column: 1 / -1;
}

.friend-code-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.friend-code-box strong {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  letter-spacing: 0.04em;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side.side-open {
    grid-template-columns: 150px minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  .side-open .side-panel {
    display: flex !important;
  }

  .side-open .side-brand-bottom {
    display: grid !important;
  }

  .side-closed .side-panel,
  .side-closed .side-brand-bottom {
    display: none !important;
  }

  .side-menu {
    align-items: center;
  }
}

@media (max-width: 760px) {
  .profile-main {
    padding: 10px 8px;
  }

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

  .friend-code-box {
    grid-template-columns: 1fr;
  }
}

/* Firmaraum v5.4.1: kleine Fenster, lokale Admin-Auswahl und Konto-Loeschung */
.settings-page-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.settings-local-nav {
  position: sticky;
  top: 58px;
  display: grid;
  gap: 5px;
  align-self: start;
}

.settings-local-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 8px;
  min-height: 34px;
  padding: 0 10px;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.settings-local-tab.active {
  background: #111318;
  border-color: #111318;
  color: #fff;
}

.settings-local-content,
.settings-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-local-content > .panel,
.settings-stack > .panel {
  max-width: 860px;
}

.settings-local-content .admin-grid,
.settings-local-content .invite-admin-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

.team-board {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
  align-items: start;
}

.team-board > .panel,
.group-form,
.group-form > * {
  min-width: 0;
}

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

.team-new-info textarea {
  min-height: 120px;
}

.danger-profile-panel .danger,
.danger-profile-panel .ghost {
  width: 100%;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(76vw, 190px);
    z-index: 80;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.28);
  }

  .top-shell.shell.with-side.side-open .side-panel {
    display: flex !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-bottom {
    display: grid !important;
  }

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

  .settings-local-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .settings-local-tab {
    flex: 0 0 auto;
    min-height: 32px;
    white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 36px minmax(0, 1fr) !important;
  }

  .side-menu {
    padding: 6px 4px !important;
  }

  .side-toggle {
    width: 28px !important;
    min-height: 28px !important;
    height: 28px !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    width: min(86vw, 210px);
  }

  .main,
  .main.work-main {
    padding: 10px 8px !important;
  }

  .team-board {
    grid-template-columns: 1fr !important;
  }
}

/* Firmaraum v5.4.3: Seitenleiste bleibt stehen, nur Inhalt scrollt */
.top-shell.shell.with-side {
  min-height: 100vh;
}

.top-shell.shell.with-side .side-menu {
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.top-shell.shell.with-side .content-shell {
  min-height: 100vh;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side.side-open .side-menu {
    position: fixed;
  }
}

/* Firmaraum v5.4.6: robuste Handy-Breite */
html,
body,
#app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

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

.shell,
.top-shell,
.content-shell,
.main,
.panel,
.list-pane,
.editor-pane {
  min-width: 0;
  max-width: 100%;
}

.panel,
.item-card,
.input,
.textarea,
.select,
.primary,
.secondary,
.danger,
.ghost {
  max-width: 100%;
}

@media (max-width: 760px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    width: 100vw !important;
    max-width: 100vw !important;
    grid-template-columns: 36px minmax(0, calc(100vw - 36px)) !important;
    overflow-x: hidden;
  }

  .top-shell.shell.with-side .content-shell {
    width: calc(100vw - 36px);
    max-width: calc(100vw - 36px);
    overflow-x: hidden;
  }

  .profile-shell,
  .profile-shell .content-shell {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-header-clean {
    min-height: auto;
    padding: 9px 10px;
  }

  .header-title h1,
  .view-heading h2 {
    font-size: 22px;
    line-height: 1.08;
  }

  .main,
  .main.work-main,
  .profile-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 10px 8px !important;
    overflow-x: hidden;
  }

  .main.work-main {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .main.work-main > .work-tabs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .main.work-main > .work-tabs::-webkit-scrollbar {
    display: none;
  }

  .team-board,
  .settings-grid,
  .settings-grid-wide,
  .settings-page-layout,
  .settings-local-content,
  .overview-top-grid,
  .overview-card-grid,
  .dashboard-grid,
  .two-pane,
  .project-layout,
  .file-grid,
  .form-grid,
  .profile-grid,
  .account-project-card,
  .projects-grid,
  .group-form,
  .chat-compose-row,
  .chat-routing-row {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .overview-status,
  .project-status-strip,
  .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .panel-header,
  .form-actions,
  .button-row {
    flex-wrap: wrap;
    min-width: 0;
  }

  .panel-body,
  .editor-body,
  .list-scroll {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .group-member-select,
  .note-folder-form,
  .note-folder-scroll {
    max-width: 100%;
  }

  .floating-chat {
    left: 44px !important;
    right: 8px;
    width: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: 32px minmax(0, calc(100vw - 32px)) !important;
  }

  .top-shell.shell.with-side .content-shell {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
  }

  .side-menu {
    padding: 6px 3px !important;
  }

  .side-toggle {
    width: 26px !important;
    min-height: 26px !important;
    height: 26px !important;
  }

  .overview-status,
  .project-status-strip,
  .status-grid {
    grid-template-columns: 1fr !important;
  }

  .floating-chat {
    left: 38px !important;
    right: 6px;
  }
}

/* Firmaraum v5.4.7: Chatfenster hoeher, aber bildschirmfest */
.floating-chat-open {
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100dvh - 28px));
}

.floating-chat-list {
  max-height: min(460px, calc(100dvh - 220px));
  flex: 1 1 auto;
}

@media (max-width: 760px) {
  .floating-chat-open {
    max-height: calc(100dvh - 18px);
  }

  .floating-chat-list {
    max-height: calc(100dvh - 230px);
  }
}

/* Firmaraum v5.4.9: Aufgaben direkt bearbeiten */
.task-edit-row {
  align-items: start;
}

.task-edit-form {
  margin: 0;
  padding: 0;
  width: 100%;
}

.task-edit-controls {
  align-items: stretch;
}

.task-edit-controls .primary,
.task-edit-controls .secondary {
  width: 100%;
}

@media (max-width: 760px) {
  .task-edit-row {
    grid-template-columns: 1fr !important;
  }

  .task-edit-row .order {
    display: none;
  }
}

/* Firmaraum v5.4.10: Projekt klappt neben der Seitenleiste auf */
.top-shell.shell.with-side.with-project-rail.side-open {
  grid-template-columns: 176px 158px minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.with-project-rail .content-shell {
  grid-column: 3 !important;
}

.with-project-rail .main.work-main {
  display: block !important;
  width: min(100%, 1320px);
}

.project-context-rail {
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 14;
  height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #f7f8f4;
  padding: 10px 8px;
  box-shadow: 10px 0 28px rgba(17, 18, 24, 0.04);
}

.project-rail-head {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 10px;
  display: grid;
  gap: 3px;
}

.project-rail-head span,
.project-rail-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-rail-head strong,
.project-rail-project-name {
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.project-rail-section {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.project-rail-link {
  appearance: none;
  width: 100%;
  min-height: 29px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  text-align: left;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.project-rail-link:hover,
.project-rail-link.active {
  background: #111318;
  border-color: #111318;
  color: #fff;
}

.project-rail-open {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.project-rail-project-name {
  display: block;
  padding: 0 8px 4px;
}

.project-shortcut.project-rail-source {
  background: #2a2d35 !important;
  color: #fff !important;
}

@media (max-width: 1180px) {
  .top-shell.shell.with-side.with-project-rail.side-open {
    grid-template-columns: 150px 142px minmax(0, 1fr) !important;
  }
}

@media (max-width: 980px) {
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.with-project-rail .project-context-rail {
    display: none !important;
  }

  .top-shell.shell.with-side.with-project-rail .content-shell {
    grid-column: 2 !important;
  }
}

/* Firmaraum v5.4.11: Aufgaben-Steuerung bricht nicht mehr aus */
.plan-board {
  container-type: inline-size;
}

.task-row {
  grid-template-columns: 34px minmax(180px, 1fr) minmax(268px, max-content);
}

.task-controls {
  grid-template-columns: minmax(118px, 128px) auto;
  justify-content: end;
}

.task-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.task-actions .icon-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1;
}

.task-actions .icon-button:disabled {
  opacity: 0.42;
}

@container (max-width: 760px) {
  .plan-task-list .task-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .plan-task-list .task-controls {
    grid-column: 2 / -1;
    grid-template-columns: minmax(130px, 1fr) auto;
    justify-content: stretch;
    margin-top: 4px;
  }
}

@container (max-width: 520px) {
  .plan-task-list .task-row {
    grid-template-columns: 1fr;
  }

  .plan-task-list .order {
    display: none;
  }

  .plan-task-list .task-controls {
    grid-column: 1;
    grid-template-columns: 1fr;
  }

  .plan-task-list .task-actions {
    justify-content: flex-start;
  }
}

/* Firmaraum v5.4.12: Edit-Modus ohne Ueberlagerung */
.plan-task-list .task-edit-row {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
}

.plan-task-list .task-edit-form {
  display: grid;
  grid-template-columns:
    minmax(180px, 1.35fr)
    minmax(130px, 0.9fr)
    minmax(130px, 0.85fr)
    minmax(120px, 0.75fr)
    minmax(120px, 0.75fr);
  gap: 8px;
  border: 0;
  background: transparent;
}

.plan-task-list .task-edit-form .plan-title-field {
  grid-column: auto;
}

.plan-task-list .task-edit-form .plan-details-field {
  grid-column: 1 / -1;
}

.plan-task-list .task-edit-form .textarea {
  min-height: 62px;
}

.plan-task-list .task-edit-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  min-width: 118px;
  justify-content: stretch;
  margin-top: 22px;
}

.plan-task-list .task-edit-controls .primary,
.plan-task-list .task-edit-controls .secondary {
  min-height: 34px;
  width: 100%;
}

@container (max-width: 980px) {
  .plan-task-list .task-edit-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

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

  .plan-task-list .task-edit-controls {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    margin-top: 0;
  }
}

@container (max-width: 560px) {
  .plan-task-list .task-edit-row {
    grid-template-columns: 1fr;
  }

  .plan-task-list .task-edit-form,
  .plan-task-list .task-edit-controls {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
}

/* Firmaraum v5.4.14: Aktueller Ort ist immer blau markiert */
.app-header-clean .header-title {
  display: grid;
  gap: 6px;
}

.context-path {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.context-path span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  border: 1px solid var(--blue-3);
  border-radius: 999px;
  background: var(--blue-2);
  color: var(--blue);
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.side-link.active,
.side-link.project-rail-source,
.project-shortcut.project-rail-source,
.project-rail-link.active,
.admin-tab.active,
.settings-local-tab.active,
.chip-button.active,
.note-folder-pill.active,
.note-folder-entry.active .note-folder-pill,
.floating-chat-switch button.active {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
}

.side-link.active strong,
.side-link.project-rail-source strong,
.project-shortcut.project-rail-source strong,
.project-rail-link.active,
.admin-tab.active,
.settings-local-tab.active,
.chip-button.active,
.note-folder-pill.active,
.note-folder-entry.active .note-folder-pill,
.floating-chat-switch button.active {
  color: #fff !important;
}

.side-link.active span:first-child,
.side-link.project-rail-source span:first-child,
.chip-button.active span,
.note-folder-pill.active strong,
.note-folder-entry.active .note-folder-pill strong {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

.project-rail-head {
  border-color: var(--blue-3);
  background: var(--blue-2);
}

.project-rail-head span,
.project-rail-head strong {
  color: var(--blue);
}

.active-note,
.active-project-card {
  border-color: var(--blue) !important;
  background: linear-gradient(180deg, #fff, var(--blue-2)) !important;
  box-shadow: 0 0 0 2px var(--blue-3), 0 14px 34px rgba(37, 99, 235, 0.12) !important;
}

.active-note .item-title span:first-child,
.active-project-card .item-title span:first-child {
  color: var(--blue);
}

@media (max-width: 760px) {
  .context-path {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .context-path::-webkit-scrollbar {
    display: none;
  }

  .context-path span {
    flex: 0 0 auto;
  }
}

/* Firmaraum v5.4.16: stabile Responsive-Grundlage */
html,
body,
#app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.shell,
.top-shell,
.content-shell,
.main,
.panel,
.panel-body,
.item-card,
.view-heading,
.app-header,
.app-header-clean {
  min-width: 0;
  max-width: 100%;
}

.top-shell.shell.with-side {
  display: grid !important;
  grid-template-columns: clamp(150px, 13vw, 176px) minmax(0, 1fr) !important;
  align-items: start;
}

.top-shell.shell.with-side.side-closed {
  grid-template-columns: 44px minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.with-project-rail.side-open {
  grid-template-columns: clamp(150px, 13vw, 176px) clamp(136px, 11vw, 158px) minmax(0, 1fr) !important;
}

.top-shell.shell.with-side .side-menu {
  position: sticky !important;
  top: 0;
  height: 100vh !important;
  align-self: start;
  overflow-y: auto;
  overflow-x: hidden;
}

.top-shell.shell.with-side .content-shell {
  grid-column: auto !important;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
}

.main {
  width: 100%;
}

.overview-clean-grid,
.overview-card-grid,
.dashboard-grid,
.team-board,
.settings-grid,
.settings-grid-wide,
.admin-grid,
.invite-admin-grid,
.project-layout,
.file-grid,
.two-pane,
.notes-layout,
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)) !important;
}

.overview-status,
.project-status-strip,
.status-grid,
.overview-metrics.metrics {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)) !important;
}

.plan-task-form,
.task-edit-form,
.group-form,
.link-invite-form,
.invite-form,
.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
}

.plan-details-field,
.plan-task-form .plan-details-field,
.plan-task-list .task-edit-form .plan-details-field {
  grid-column: 1 / -1 !important;
}

.panel-header,
.task-row,
.task-edit-row,
.task-controls,
.task-actions,
.form-actions,
.button-row,
.note-folder-selector-row {
  min-width: 0;
}

.input,
.textarea,
.select,
.primary,
.secondary,
.danger,
.ghost,
.icon-button,
.note-folder-select {
  max-width: 100%;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed,
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    grid-template-columns: 44px minmax(0, calc(100vw - 44px)) !important;
  }

  .top-shell.shell.with-side.with-project-rail .project-context-rail {
    display: none !important;
  }

  .top-shell.shell.with-side .content-shell {
    grid-column: 2 !important;
    width: calc(100vw - 44px);
  }

  .top-shell.shell.with-side .side-menu {
    width: 44px !important;
    min-width: 44px !important;
    z-index: 50;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    position: fixed !important;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(82vw, 220px) !important;
    min-width: 0 !important;
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.28);
  }

  .top-shell.shell.with-side.side-open .side-panel,
  .top-shell.shell.with-side.side-open .side-brand-bottom {
    display: grid !important;
  }

  .top-shell.shell.with-side.side-open .side-link strong,
  .top-shell.shell.with-side.side-open .side-toggle strong,
  .top-shell.shell.with-side.side-open .side-section-title,
  .top-shell.shell.with-side.side-open .side-brand-bottom {
    display: block !important;
  }

  .top-shell.shell.with-side.side-open .side-link,
  .top-shell.shell.with-side.side-open .side-toggle {
    justify-items: start !important;
    text-align: left !important;
  }

  .app-header-clean {
    padding: 10px 12px 8px !important;
  }

  .main {
    padding: 12px !important;
  }

  .floating-chat {
    left: 56px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 13px;
  }

  .app-header-clean .header-title h1 {
    font-size: 22px;
    line-height: 1.08;
  }

  .main {
    padding: 10px !important;
  }

  .panel-body,
  .editor-body {
    padding: 10px !important;
  }

  .panel-header {
    gap: 8px;
    align-items: flex-start;
  }

  .overview-clean-grid,
  .overview-card-grid,
  .dashboard-grid,
  .team-board,
  .settings-grid,
  .settings-grid-wide,
  .admin-grid,
  .invite-admin-grid,
  .project-layout,
  .file-grid,
  .two-pane,
  .notes-layout,
  .profile-grid,
  .settings-page-layout,
  .settings-local-content {
    grid-template-columns: 1fr !important;
  }

  .task-row,
  .plan-task-list .task-row,
  .plan-task-list .task-edit-row {
    grid-template-columns: 1fr !important;
  }

  .task-row .order,
  .plan-task-list .order {
    display: none !important;
  }

  .task-controls,
  .task-actions,
  .plan-task-list .task-edit-controls {
    grid-column: 1 !important;
    width: 100%;
    justify-content: stretch;
  }

  .task-controls,
  .plan-task-list .task-edit-controls {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)) !important;
  }

  .task-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(34px, 1fr));
  }

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

  .floating-chat-open {
    max-height: min(74vh, 560px);
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed,
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    grid-template-columns: 40px minmax(0, calc(100vw - 40px)) !important;
  }

  .top-shell.shell.with-side .content-shell {
    width: calc(100vw - 40px);
  }

  .top-shell.shell.with-side .side-menu {
    width: 40px !important;
    min-width: 40px !important;
  }

  .floating-chat {
    left: 48px !important;
    right: 8px !important;
  }
}


/* Firmaraum v5.4.18: ruhigere Bewegungen und klarere Zustände */
:root {
  --motion-fast: 120ms;
  --motion: 180ms;
  --motion-slow: 260ms;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

@keyframes firmaraum-panel-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes firmaraum-menu-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

button,
.primary,
.secondary,
.danger,
.ghost,
.icon-button,
.chip-button,
.side-link,
.side-toggle,
.project-rail-link,
.admin-tab,
.settings-local-tab,
.note-folder-pill,
.project-card-button,
.item-card.clickable,
.side-mini-settings,
.side-logout,
.floating-chat-toggle,
.floating-chat-switch button {
  transition:
    background-color var(--motion) var(--motion-ease),
    border-color var(--motion) var(--motion-ease),
    color var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}

.input,
.textarea,
.select,
.note-folder-select {
  transition:
    border-color var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    background-color var(--motion) var(--motion-ease);
}

button:not(:disabled):active,
.project-card-button:not(:disabled):active,
.item-card.clickable:not(:disabled):active {
  transform: translateY(1px) scale(0.995);
}

button:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible,
.project-rail-link:focus-visible,
.side-link:focus-visible,
.side-toggle:focus-visible,
.note-folder-select:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.panel,
.list-pane,
.editor-pane,
.item-card,
.project-card-button,
.status-tile,
.notice-band,
.login-card,
.project-context-rail,
.floating-chat-open {
  transition:
    border-color var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    background-color var(--motion) var(--motion-ease),
    transform var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease);
}

.main > section,
.main > .panel,
.main > .view-heading,
.profile-main > *,
.work-main > * {
  animation: firmaraum-panel-in var(--motion-slow) var(--motion-ease) both;
}

.panel:hover,
.list-pane:hover,
.editor-pane:hover {
  box-shadow: 0 12px 30px rgba(20, 22, 28, 0.065);
}

.item-card.clickable:hover,
.project-card-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(20, 22, 28, 0.075);
}

.status-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(20, 22, 28, 0.055);
}

.side-menu,
.project-context-rail,
.content-shell {
  transition:
    width var(--motion-slow) var(--motion-ease),
    min-width var(--motion-slow) var(--motion-ease),
    transform var(--motion-slow) var(--motion-ease),
    opacity var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease);
}

.side-open .side-panel,
.side-open .side-brand-bottom,
.project-context-rail {
  animation: firmaraum-menu-in var(--motion-slow) var(--motion-ease) both;
}

.side-link.active,
.project-rail-link.active,
.chip-button.active,
.admin-tab.active,
.settings-local-tab.active {
  box-shadow: 0 7px 20px rgba(37, 99, 235, 0.18);
}

.context-path span {
  transition:
    background-color var(--motion) var(--motion-ease),
    border-color var(--motion) var(--motion-ease),
    color var(--motion) var(--motion-ease),
    transform var(--motion-fast) var(--motion-ease);
}

.context-path span:hover {
  transform: translateY(-1px);
}

.floating-chat {
  transition:
    left var(--motion-slow) var(--motion-ease),
    right var(--motion-slow) var(--motion-ease),
    width var(--motion-slow) var(--motion-ease),
    transform var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease);
}

.floating-chat-open {
  animation: firmaraum-panel-in var(--motion-slow) var(--motion-ease) both;
  transform-origin: bottom left;
}

.toast {
  animation: firmaraum-panel-in var(--motion-slow) var(--motion-ease) both;
}

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


/* Firmaraum v5.4.19: Profilmenue ohne gequetschte Spalten */
.profile-shell .content-shell {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.profile-main {
  width: min(100%, 980px) !important;
  max-width: 980px !important;
  padding-inline: clamp(12px, 3vw, 24px) !important;
}

.profile-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  align-items: start !important;
}

.profile-grid > .panel {
  min-width: 0 !important;
  width: 100% !important;
}

.profile-projects-panel {
  grid-column: 1 / -1 !important;
}

.profile-projects-panel .panel-body {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.account-project-card {
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto !important;
  overflow: hidden;
}

.account-project-card .item-title,
.account-project-card p,
.account-project-card .muted {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-project-card .item-title {
  flex-wrap: wrap;
}

.account-project-card .primary,
.account-project-card .secondary {
  justify-self: end;
}

@media (max-width: 920px) {
  .profile-main {
    width: 100% !important;
    max-width: 100% !important;
  }

  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-projects-panel {
    grid-column: auto !important;
  }

  .profile-projects-panel .panel-body {
    grid-template-columns: 1fr;
  }

  .account-project-card {
    grid-template-columns: 1fr !important;
  }

  .account-project-card .primary,
  .account-project-card .secondary {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 520px) {
  .profile-main {
    padding: 10px !important;
  }

  .profile-grid {
    gap: 10px !important;
  }

  .profile-projects-panel .panel-body {
    padding: 10px !important;
  }
}


/* Firmaraum v5.4.20: stabile Seitenleiste und Profilmenue */
:root {
  --firmaraum-side-open: 176px;
  --firmaraum-side-closed: 44px;
  --firmaraum-project-rail: 158px;
}

.top-shell.shell.with-side {
  grid-template-columns: var(--firmaraum-side-open) minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.side-closed {
  grid-template-columns: var(--firmaraum-side-closed) minmax(0, 1fr) !important;
}

.top-shell.shell.with-side.with-project-rail.side-open {
  grid-template-columns: var(--firmaraum-side-open) var(--firmaraum-project-rail) minmax(0, 1fr) !important;
}

.top-shell.shell.with-side .side-menu {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: var(--firmaraum-side-open) !important;
  min-width: var(--firmaraum-side-open) !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  z-index: 60;
}

.top-shell.shell.with-side.side-closed .side-menu {
  width: var(--firmaraum-side-closed) !important;
  min-width: var(--firmaraum-side-closed) !important;
}

.top-shell.shell.with-side .side-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 8px;
}

.top-shell.shell.with-side .side-brand-bottom {
  flex: 0 0 auto;
  margin-top: 8px;
}

.top-shell.shell.with-side.with-project-rail .project-context-rail {
  position: fixed !important;
  left: var(--firmaraum-side-open);
  top: 0;
  bottom: 0;
  width: var(--firmaraum-project-rail);
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 40;
}

.profile-shell {
  display: block !important;
  width: 100% !important;
  min-height: 100vh;
}

.profile-shell .content-shell {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.profile-shell .app-header-clean,
.profile-main {
  width: min(100%, 980px) !important;
  max-width: min(980px, calc(100vw - 24px)) !important;
  margin-inline: auto !important;
}

.profile-shell .app-header-clean,
.profile-main {
  padding-inline: clamp(10px, 2vw, 20px) !important;
}

@media (max-width: 1180px) {
  :root {
    --firmaraum-side-open: 150px;
    --firmaraum-project-rail: 136px;
  }
}

@media (max-width: 1040px) {
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    grid-template-columns: var(--firmaraum-side-closed) minmax(0, calc(100vw - var(--firmaraum-side-closed))) !important;
  }

  .top-shell.shell.with-side.with-project-rail .project-context-rail {
    display: none !important;
  }

  .top-shell.shell.with-side.with-project-rail .content-shell {
    grid-column: 2 !important;
  }
}

@media (max-width: 980px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed {
    grid-template-columns: var(--firmaraum-side-closed) minmax(0, calc(100vw - var(--firmaraum-side-closed))) !important;
  }

  .top-shell.shell.with-side .content-shell {
    grid-column: 2 !important;
    width: calc(100vw - var(--firmaraum-side-closed)) !important;
    max-width: calc(100vw - var(--firmaraum-side-closed)) !important;
  }

  .top-shell.shell.with-side .side-menu {
    width: var(--firmaraum-side-closed) !important;
    min-width: var(--firmaraum-side-closed) !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    width: min(82vw, 220px) !important;
    min-width: min(82vw, 220px) !important;
    box-shadow: 18px 0 46px rgba(0, 0, 0, 0.28);
  }

  .top-shell.shell.with-side.side-open .side-panel,
  .top-shell.shell.with-side.side-open .side-brand-bottom {
    display: flex !important;
  }

  .profile-grid {
    grid-template-columns: 1fr !important;
  }

  .profile-projects-panel,
  .danger-profile-panel {
    grid-column: auto !important;
  }
}

@media (max-width: 520px) {
  :root {
    --firmaraum-side-closed: 40px;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    width: min(88vw, 220px) !important;
    min-width: min(88vw, 220px) !important;
  }

  .profile-shell .app-header-clean,
  .profile-main {
    max-width: calc(100vw - 16px) !important;
    padding-inline: 8px !important;
  }
}


/* Firmaraum v5.4.22: Inhalt scrollt, Seitenleiste bleibt fix */
#app:has(.top-shell.shell.with-side) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body:has(#app .top-shell.shell.with-side) {
  overflow: hidden;
}

.top-shell.shell.with-side,
.top-shell.shell.with-side.side-open,
.top-shell.shell.with-side.side-closed,
.top-shell.shell.with-side.with-project-rail,
.top-shell.shell.with-side.with-project-rail.side-open,
.top-shell.shell.with-side.with-project-rail.side-closed {
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .side-menu {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .content-shell {
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}

.top-shell.shell.with-side .side-panel {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
}

.top-shell.shell.with-side .side-brand-bottom {
  flex-shrink: 0 !important;
}

.top-shell.shell.with-side.with-project-rail .project-context-rail {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.profile-shell {
  min-height: 100vh !important;
  min-height: 100dvh !important;
}


/* Firmaraum v5.4.23: performante Bewegungen und Sidebar-Drawer */
:root {
  --motion-fast: 100ms;
  --motion: 150ms;
  --motion-slow: 220ms;
  --motion-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --firmaraum-drawer-width: var(--firmaraum-side-open);
}

.top-shell.shell.with-side .side-menu,
.top-shell.shell.with-side.with-project-rail .project-context-rail,
.floating-chat,
.floating-chat-open {
  backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
  will-change: transform, opacity;
}

.top-shell.shell.with-side .content-shell {
  transition: opacity var(--motion) var(--motion-ease) !important;
  will-change: auto;
}

.top-shell.shell.with-side .side-menu {
  width: var(--firmaraum-drawer-width) !important;
  min-width: var(--firmaraum-drawer-width) !important;
  transform: translate3d(0, 0, 0) !important;
  transition:
    transform var(--motion-slow) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease),
    opacity var(--motion) var(--motion-ease) !important;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

.top-shell.shell.with-side.side-open .side-menu {
  transform: translate3d(0, 0, 0) !important;
  box-shadow: 18px 0 42px rgba(0, 0, 0, 0.18);
}

.top-shell.shell.with-side.side-closed .side-menu {
  width: var(--firmaraum-drawer-width) !important;
  min-width: var(--firmaraum-drawer-width) !important;
  transform: translate3d(calc(var(--firmaraum-side-closed) - var(--firmaraum-drawer-width)), 0, 0) !important;
  box-shadow: none;
}

.top-shell.shell.with-side .side-toggle {
  position: relative;
  z-index: 3;
  margin-left: auto !important;
  flex: 0 0 auto;
}

.top-shell.shell.with-side .side-panel,
.top-shell.shell.with-side .side-brand-bottom {
  transition:
    opacity var(--motion) var(--motion-ease),
    transform var(--motion) var(--motion-ease) !important;
}

.top-shell.shell.with-side.side-open .side-panel,
.top-shell.shell.with-side.side-open .side-brand-bottom {
  display: flex !important;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: flex !important;
  opacity: 0;
  transform: translate3d(-8px, 0, 0);
  pointer-events: none;
}

.top-shell.shell.with-side.with-project-rail .project-context-rail {
  left: var(--firmaraum-drawer-width) !important;
  transform: translate3d(-10px, 0, 0) !important;
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--motion-slow) var(--motion-ease),
    opacity var(--motion) var(--motion-ease),
    box-shadow var(--motion) var(--motion-ease) !important;
}

.top-shell.shell.with-side.with-project-rail.side-open .project-context-rail {
  transform: translate3d(0, 0, 0) !important;
  opacity: 1;
  pointer-events: auto;
}

.top-shell.shell.with-side.with-project-rail.side-closed .project-context-rail {
  transform: translate3d(-10px, 0, 0) !important;
  opacity: 0;
  pointer-events: none;
}

.side-menu,
.project-context-rail,
.content-shell {
  transition-property: transform, opacity, box-shadow !important;
}

.panel,
.item-card,
.status-tile,
.admin-tab,
.settings-local-tab,
.project-rail-link,
.side-link,
.primary,
.secondary,
.danger,
.ghost,
.icon-button {
  transition-duration: var(--motion) !important;
  transition-timing-function: var(--motion-ease) !important;
}

@media (min-width: 1041px) {
  .top-shell.shell.with-side.with-project-rail.side-open .work-tabs {
    display: none !important;
  }
}

@media (max-width: 980px) {
  :root {
    --firmaraum-drawer-width: min(82vw, 220px);
  }

  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.side-closed .side-menu {
    width: var(--firmaraum-drawer-width) !important;
    min-width: var(--firmaraum-drawer-width) !important;
  }
}

@media (max-width: 520px) {
  :root {
    --firmaraum-drawer-width: min(88vw, 220px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side .side-panel,
  .top-shell.shell.with-side .side-brand-bottom,
  .top-shell.shell.with-side.with-project-rail .project-context-rail,
  .floating-chat,
  .floating-chat-open,
  .panel,
  .item-card,
  .status-tile {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}


/* Firmaraum v5.4.25: Handy-Layout, Sidebar als Overlay-Drawer */
@media (max-width: 760px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #app:has(.top-shell.shell.with-side) {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed,
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    display: block !important;
    grid-template-columns: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .top-shell.shell.with-side::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(9, 11, 17, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion) var(--motion-ease);
  }

  .top-shell.shell.with-side.side-open::after {
    opacity: 1;
    pointer-events: auto;
  }

  .top-shell.shell.with-side .content-shell {
    grid-column: auto !important;
    margin: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    padding: 0 !important;
    transform: none !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .top-shell.shell.with-side .app-header-clean {
    padding-left: 56px !important;
    padding-right: 12px !important;
  }

  .top-shell.shell.with-side .main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-inline: 10px !important;
  }

  .top-shell.shell.with-side .side-menu {
    --firmaraum-mobile-peek: 48px;
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: min(84vw, 260px) !important;
    min-width: min(84vw, 260px) !important;
    max-width: calc(100vw - 44px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: 8px 10px !important;
    z-index: 90 !important;
    border-radius: 0 16px 16px 0 !important;
    overflow: hidden !important;
    transform: translate3d(calc(-100% + var(--firmaraum-mobile-peek)), 0, 0) !important;
    box-shadow: none !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    transform: translate3d(0, 0, 0) !important;
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.34) !important;
  }

  .top-shell.shell.with-side.side-closed .side-menu {
    transform: translate3d(calc(-100% + var(--firmaraum-mobile-peek)), 0, 0) !important;
  }

  .top-shell.shell.with-side .side-toggle {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    margin: 0 0 8px auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    place-items: center !important;
    border-radius: 9px !important;
  }

  .top-shell.shell.with-side .side-toggle strong {
    display: none !important;
  }

  .top-shell.shell.with-side .side-toggle span {
    width: 25px !important;
    height: 25px !important;
  }

  .top-shell.shell.with-side .side-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin-top: 4px !important;
    padding: 0 0 8px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
  }

  .top-shell.shell.with-side .side-main-nav,
  .top-shell.shell.with-side .side-bottom-nav {
    display: grid !important;
    gap: 4px !important;
  }

  .top-shell.shell.with-side .side-bottom-nav {
    margin-top: auto !important;
    padding-top: 8px !important;
  }

  .top-shell.shell.with-side .side-section-title {
    margin: 8px 8px 3px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    letter-spacing: 0.04em !important;
  }

  .top-shell.shell.with-side .side-link,
  .top-shell.shell.with-side .side-link.active {
    min-height: 26px !important;
    height: auto !important;
    padding: 5px 8px !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
  }

  .top-shell.shell.with-side .side-link strong {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    line-height: 1.15 !important;
  }

  .top-shell.shell.with-side .side-brand-bottom {
    flex: 0 0 auto !important;
    display: grid !important;
    gap: 6px !important;
    padding: 8px 2px 0 !important;
    margin-top: 8px !important;
  }

  .top-shell.shell.with-side .side-logo,
  .top-shell.shell.with-side .side-brand-main .brand-mark {
    width: 28px !important;
    height: 28px !important;
  }

  .top-shell.shell.with-side .side-brand-main {
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .top-shell.shell.with-side .side-brand-main strong {
    font-size: 13px !important;
  }

  .top-shell.shell.with-side .side-brand-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 5px !important;
  }

  .top-shell.shell.with-side .side-brand-meta span {
    min-height: 34px !important;
    padding: 5px 6px !important;
  }

  .top-shell.shell.with-side .side-status,
  .top-shell.shell.with-side .side-logout {
    min-height: 31px !important;
  }

  .top-shell.shell.with-side.side-closed .side-panel,
  .top-shell.shell.with-side.side-closed .side-brand-bottom {
    display: flex !important;
    opacity: 0 !important;
    transform: translate3d(-8px, 0, 0) !important;
    pointer-events: none !important;
  }

  .top-shell.shell.with-side.side-open .side-panel,
  .top-shell.shell.with-side.side-open .side-brand-bottom {
    opacity: 1 !important;
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
  }

  .top-shell.shell.with-side.with-project-rail .project-context-rail {
    display: none !important;
  }

  .top-shell.shell.with-side .floating-chat {
    z-index: 65 !important;
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side .side-menu {
    width: min(86vw, 244px) !important;
    min-width: min(86vw, 244px) !important;
  }

  .top-shell.shell.with-side .main {
    padding-inline: 8px !important;
  }
}


/* Firmaraum v5.4.25: eingeklapptes Handy-Menue nur als Knopf */
@media (max-width: 760px) {
  .top-shell.shell.with-side.side-closed .side-menu {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    padding: 8px 0 0 8px !important;
    background: transparent !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    transform: translate3d(0, 0, 0) !important;
    pointer-events: none !important;
    overflow: visible !important;
  }

  .top-shell.shell.with-side.side-closed .side-toggle {
    pointer-events: auto !important;
    margin: 0 !important;
    background: #111318 !important;
    border: 1px solid #252831 !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18) !important;
  }

  .top-shell.shell.with-side.side-closed .side-panel,
  .top-shell.shell.with-side.side-closed .side-brand-bottom {
    display: none !important;
  }
}

/* Firmaraum v5.4.26: stabiler Layout-Reset */
:root {
  --fr-side-open: 192px;
  --fr-side-closed: 52px;
  --fr-gap: 12px;
  --fr-radius: 8px;
  --fr-panel-border: #dbddd6;
}

html,
body,
#app {
  min-width: 0 !important;
}

body:has(#app .top-shell.shell.with-side),
#app:has(.top-shell.shell.with-side) {
  height: 100dvh !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side,
.top-shell.shell.with-side.side-open,
.top-shell.shell.with-side.side-closed,
.top-shell.shell.with-side.with-project-rail,
.top-shell.shell.with-side.with-project-rail.side-open,
.top-shell.shell.with-side.with-project-rail.side-closed {
  display: grid !important;
  grid-template-columns: var(--fr-side-open) minmax(0, 1fr) !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  align-items: stretch !important;
  gap: 0 !important;
  transition: grid-template-columns 160ms ease !important;
}

.top-shell.shell.with-side.side-closed {
  grid-template-columns: var(--fr-side-closed) minmax(0, 1fr) !important;
}

.top-shell.shell.with-side .project-context-rail {
  display: none !important;
}

.top-shell.shell.with-side .side-menu {
  position: relative !important;
  inset: auto !important;
  grid-column: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
  transform: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  z-index: 20 !important;
  transition: width 160ms ease, transform 160ms ease !important;
}

.top-shell.shell.with-side .content-shell {
  grid-column: 2 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
  transform: none !important;
  transition: none !important;
}

.top-shell.shell.with-side .app-header-clean {
  position: sticky !important;
  top: 0 !important;
  z-index: 12 !important;
  min-height: 56px !important;
  padding: 12px clamp(12px, 1.8vw, 22px) !important;
  border-bottom: 1px solid var(--fr-panel-border) !important;
  background: rgba(245, 246, 242, 0.96) !important;
  backdrop-filter: blur(12px) !important;
}

.top-shell.shell.with-side .app-header-clean .header-actions,
.top-shell.shell.with-side .quick-actions,
.top-shell.shell.with-side .search-wrap {
  display: none !important;
}

.top-shell.shell.with-side .main {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: clamp(10px, 1.8vw, 20px) !important;
  box-sizing: border-box !important;
}

.side-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}

.side-toggle {
  flex: 0 0 auto !important;
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 8px !important;
  justify-content: center !important;
}

.side-toggle strong,
.side-toggle span:not(.side-icon) {
  display: none !important;
}

.side-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 2px 0 !important;
  gap: 4px !important;
  scrollbar-width: thin !important;
}

.side-section-title {
  margin: 10px 8px 4px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: 0 !important;
}

.side-link,
.side-project-link,
.side-bottom-nav .side-link {
  min-height: 28px !important;
  height: auto !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  gap: 8px !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.side-link strong,
.side-project-link strong,
.side-bottom-nav .side-link strong {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}

.side-icon,
.project-mini-icon {
  flex: 0 0 22px !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
}

.side-brand-bottom {
  flex: 0 0 auto !important;
  margin-top: auto !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
}

.side-brand-bottom .brand-mark,
.side-brand-bottom img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
}

.side-brand-bottom .brand-copy strong {
  font-size: 13px !important;
  line-height: 1.1 !important;
}

.side-brand-bottom .brand-copy span,
.side-brand-bottom .mini-stat,
.side-brand-bottom .pill,
.side-brand-bottom .logout-btn {
  font-size: 11px !important;
  line-height: 1.15 !important;
}

.side-brand-bottom .mini-stats {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
}

.side-brand-bottom .mini-stat {
  min-height: 36px !important;
  padding: 6px !important;
  border-radius: 8px !important;
}

.side-brand-bottom .logout-btn {
  min-height: 34px !important;
  padding: 7px 10px !important;
  border-radius: 8px !important;
}

.side-closed .side-panel,
.side-closed .side-brand-bottom {
  display: none !important;
}

.side-closed .side-menu {
  align-items: center !important;
  padding: 10px 8px !important;
}

.main *,
.panel,
.card,
.item-card,
.note-card,
.file-card,
.project-card,
.metric-card,
.status-tile,
.task-row,
.task-edit-form,
.team-member-row,
.team-member-card,
.settings-card,
.form-card,
.form-grid,
.input-row,
.content-grid,
.dashboard-grid,
.overview-grid,
.overview-top-grid,
.team-grid,
.settings-grid,
.settings-page-layout,
.project-layout,
.notes-layout,
.files-grid,
.admin-grid {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.content-grid,
.dashboard-grid,
.overview-grid,
.overview-top-grid,
.team-grid,
.settings-grid,
.settings-page-layout,
.project-layout,
.notes-layout,
.files-grid,
.admin-grid,
.project-grid,
.status-grid,
.metrics-grid,
.stats-grid,
.task-list,
.card-grid {
  width: 100% !important;
  max-width: 100% !important;
  gap: var(--fr-gap) !important;
}

.panel,
.card,
.item-card,
.note-card,
.file-card,
.project-card,
.settings-card,
.form-card {
  border-radius: var(--fr-radius) !important;
  overflow: hidden !important;
}

.status-grid,
.metrics-grid,
.stats-grid,
.overview-metrics,
.project-status-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
}

.task-row,
.task-edit-form,
.plan-row,
.plan-edit-form {
  display: grid !important;
  grid-template-columns: 32px minmax(160px, 1.4fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto !important;
  gap: 8px !important;
  align-items: center !important;
}

.task-row select,
.task-row input,
.task-edit-form select,
.task-edit-form input,
.plan-row select,
.plan-edit-form select,
.plan-edit-form input {
  width: 100% !important;
  max-width: 100% !important;
}

.team-member-row,
.team-member-card {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: center !important;
}

.chat-float {
  z-index: 90 !important;
}

@media (min-width: 1100px) {
  .team-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    align-items: start !important;
  }

  .settings-page-layout {
    display: grid !important;
    grid-template-columns: 180px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  .project-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) !important;
    align-items: start !important;
  }

  .notes-layout {
    display: grid !important;
    grid-template-columns: minmax(240px, 0.38fr) minmax(0, 1fr) !important;
    align-items: start !important;
  }
}

@media (max-width: 1099px) {
  .status-grid,
  .metrics-grid,
  .stats-grid,
  .overview-metrics,
  .project-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .team-grid,
  .settings-grid,
  .settings-page-layout,
  .project-layout,
  .notes-layout,
  .files-grid,
  .admin-grid,
  .content-grid,
  .dashboard-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .task-row,
  .task-edit-form,
  .plan-row,
  .plan-edit-form {
    grid-template-columns: 28px minmax(0, 1fr) minmax(110px, 0.5fr) auto !important;
  }

  .task-row .details,
  .task-edit-form textarea,
  .plan-edit-form textarea {
    grid-column: 2 / -1 !important;
  }
}

@media (max-width: 760px) {
  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed,
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    display: block !important;
    width: 100vw !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .top-shell.shell.with-side .content-shell {
    width: 100vw !important;
    height: 100dvh !important;
    overflow: auto !important;
  }

  .top-shell.shell.with-side .app-header-clean {
    min-height: 52px !important;
    padding: 10px 10px 10px 58px !important;
  }

  .top-shell.shell.with-side .main {
    padding: 10px !important;
  }

  .top-shell.shell.with-side .side-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: min(82vw, 280px) !important;
    max-width: calc(100vw - 44px) !important;
    height: 100dvh !important;
    transform: translateX(-100%) !important;
    z-index: 100 !important;
    border-radius: 0 12px 12px 0 !important;
    box-shadow: 18px 0 44px rgba(0,0,0,0.28) !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    transform: translateX(0) !important;
    background: #111318 !important;
    pointer-events: auto !important;
  }

  .top-shell.shell.with-side.side-closed .side-menu {
    width: 48px !important;
    max-width: 48px !important;
    height: 52px !important;
    padding: 8px !important;
    overflow: visible !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  .top-shell.shell.with-side.side-closed .side-toggle {
    pointer-events: auto !important;
    background: #181b22 !important;
    border-color: rgba(255,255,255,0.08) !important;
  }

  .top-shell.shell.with-side.side-open::after {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 80 !important;
    background: rgba(0,0,0,0.22) !important;
  }

  .top-shell.shell.with-side.side-open .side-menu {
    z-index: 101 !important;
  }

  .status-grid,
  .metrics-grid,
  .stats-grid,
  .overview-metrics,
  .project-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .task-row,
  .task-edit-form,
  .plan-row,
  .plan-edit-form {
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }

  .task-row > *,
  .task-edit-form > *,
  .plan-row > *,
  .plan-edit-form > * {
    grid-column: auto !important;
    width: 100% !important;
  }

  .team-member-row,
  .team-member-card {
    grid-template-columns: auto minmax(0, 1fr) !important;
  }

  .team-member-row .status-pill,
  .team-member-card .status-pill {
    grid-column: 2 !important;
    justify-self: start !important;
  }

  .chat-float {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
  }
}

@media (max-width: 520px) {
  .status-grid,
  .metrics-grid,
  .stats-grid,
  .overview-metrics,
  .project-status-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  h1,
  .page-title {
    font-size: 24px !important;
    line-height: 1.1 !important;
  }

  h2 {
    font-size: 19px !important;
  }
}

/* Firmaraum v5.4.27: Geraete-unabhaengige Layout-Stufen */
/* Desktop: voll nutzbare Arbeitsflaeche, feste Navigation, keine mobile Logik. */
@media (min-width: 1280px) {
  :root {
    --fr-side-open: 220px;
    --fr-side-closed: 56px;
    --fr-gap: 14px;
  }

  .top-shell.shell.with-side .main {
    padding: 20px 24px !important;
  }

  .side-link,
  .side-project-link,
  .side-bottom-nav .side-link {
    min-height: 30px !important;
    padding: 7px 10px !important;
  }

  .side-link strong,
  .side-project-link strong,
  .side-bottom-nav .side-link strong {
    font-size: 13px !important;
  }

  .team-grid {
    grid-template-columns: repeat(4, minmax(230px, 1fr)) !important;
  }

  .settings-grid,
  .admin-grid,
  .dashboard-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    align-items: start !important;
  }

  .project-grid,
  .files-grid,
  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  }
}

/* Tablet / kleine Fenster: Sidebar bleibt nutzbar, Inhalt bricht geordnet auf 2 Spalten um. */
@media (min-width: 761px) and (max-width: 1279px) {
  :root {
    --fr-side-open: 176px;
    --fr-side-closed: 52px;
    --fr-gap: 10px;
  }

  .top-shell.shell.with-side .main {
    padding: 14px !important;
  }

  .side-menu {
    padding: 8px !important;
  }

  .side-link,
  .side-project-link,
  .side-bottom-nav .side-link {
    min-height: 27px !important;
    padding: 6px 8px !important;
  }

  .side-link strong,
  .side-project-link strong,
  .side-bottom-nav .side-link strong {
    font-size: 12px !important;
  }

  .status-grid,
  .metrics-grid,
  .stats-grid,
  .overview-metrics,
  .project-status-grid,
  .team-grid,
  .settings-grid,
  .admin-grid,
  .dashboard-grid,
  .project-grid,
  .files-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .task-row,
  .task-edit-form,
  .plan-row,
  .plan-edit-form {
    grid-template-columns: 28px minmax(170px, 1.2fr) minmax(120px, 0.8fr) minmax(120px, 0.8fr) auto !important;
  }
}

/* Handy: Inhalt volle Breite, Seitenleiste als ausblendbares Overlay. */
@media (max-width: 760px) {
  body:has(#app .top-shell.shell.with-side),
  #app:has(.top-shell.shell.with-side) {
    width: 100vw !important;
    max-width: 100vw !important;
  }

  .top-shell.shell.with-side .content-shell,
  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side .app-header-clean,
  .panel,
  .card,
  .item-card,
  .form-card,
  .settings-card,
  .project-card,
  .note-card,
  .file-card {
    max-width: 100vw !important;
  }

  .side-open .content-shell {
    filter: none !important;
  }

  .top-shell.shell.with-side.side-open .content-shell {
    pointer-events: auto !important;
  }

  .top-shell.shell.with-side.side-open::after {
    pointer-events: none !important;
  }

  .side-brand-bottom .mini-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .floating-chat-panel,
  .chat-panel,
  .chat-popover {
    width: min(94vw, 420px) !important;
    max-width: 94vw !important;
    max-height: 72dvh !important;
  }
}

/* Firmaraum v5.4.28: Sidebar als echtes Overlay */
/*
  Finale Shell-Regel: Die Sidebar nimmt keinen Platz mehr im Layout ein.
  Geschlossen bleibt nur der Menue-Button sichtbar, geoeffnet liegt die Sidebar ueber der App.
*/
body:has(#app .top-shell.shell.with-side),
#app:has(.top-shell.shell.with-side) {
  width: 100vw !important;
  height: 100dvh !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side,
.top-shell.shell.with-side.side-open,
.top-shell.shell.with-side.side-closed,
.top-shell.shell.with-side.with-project-rail,
.top-shell.shell.with-side.with-project-rail.side-open,
.top-shell.shell.with-side.with-project-rail.side-closed {
  display: block !important;
  position: relative !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  overflow: hidden !important;
  grid-template-columns: none !important;
}

.top-shell.shell.with-side .content-shell {
  position: relative !important;
  z-index: 1 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
}

.top-shell.shell.with-side .main {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: clamp(12px, 1.7vw, 22px) !important;
  box-sizing: border-box !important;
}

.top-shell.shell.with-side .app-header-clean {
  padding-left: 62px !important;
}

.top-shell.shell.with-side .side-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 120 !important;
  display: flex !important;
  flex-direction: column !important;
  width: clamp(220px, 22vw, 280px) !important;
  max-width: calc(100vw - 44px) !important;
  height: 100dvh !important;
  min-height: 0 !important;
  padding: 10px !important;
  overflow: hidden !important;
  border-radius: 0 12px 12px 0 !important;
  background: #111318 !important;
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.28) !important;
  transform: translate3d(-100%, 0, 0) !important;
  transition: transform 180ms ease, box-shadow 180ms ease !important;
  will-change: transform !important;
}

.top-shell.shell.with-side.side-open .side-menu {
  transform: translate3d(0, 0, 0) !important;
}

.top-shell.shell.with-side.side-closed .side-menu {
  width: 52px !important;
  max-width: 52px !important;
  height: 54px !important;
  min-height: 54px !important;
  padding: 8px !important;
  overflow: visible !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  transform: translate3d(0, 0, 0) !important;
  pointer-events: none !important;
}

.top-shell.shell.with-side .side-toggle {
  position: relative !important;
  z-index: 130 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 9px !important;
  background: #1b1f27 !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

.top-shell.shell.with-side .side-toggle span {
  display: inline !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.top-shell.shell.with-side .side-toggle strong {
  display: none !important;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

.top-shell.shell.with-side .side-panel {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  overflow: hidden !important;
  gap: 8px !important;
  padding-top: 14px !important;
}

.top-shell.shell.with-side .side-main-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding-right: 2px !important;
}

.top-shell.shell.with-side .side-bottom-nav {
  flex: 0 0 auto !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
  padding-top: 8px !important;
  margin-top: 8px !important;
}

.top-shell.shell.with-side .side-brand-bottom {
  display: block !important;
  flex: 0 0 auto !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
}

.top-shell.shell.with-side .side-link,
.top-shell.shell.with-side .side-project-link,
.top-shell.shell.with-side .side-bottom-nav .side-link {
  width: 100% !important;
  min-height: 30px !important;
  padding: 7px 9px !important;
  border-radius: 8px !important;
  justify-content: flex-start !important;
}

.top-shell.shell.with-side .side-link strong,
.top-shell.shell.with-side .side-project-link strong {
  display: block !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.top-shell.shell.with-side .side-section-title {
  margin: 10px 8px 5px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
}

.top-shell.shell.with-side.side-open::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  background: rgba(0,0,0,0.18) !important;
  pointer-events: none !important;
}

.top-shell.shell.with-side.side-open .side-menu {
  z-index: 121 !important;
}

.top-shell.shell.with-side .project-context-rail {
  display: none !important;
}

@media (min-width: 1280px) {
  .top-shell.shell.with-side .side-menu {
    width: 260px !important;
  }

  .top-shell.shell.with-side .main {
    padding: 22px 28px !important;
  }
}

@media (min-width: 761px) and (max-width: 1279px) {
  .top-shell.shell.with-side .side-menu {
    width: 220px !important;
  }

  .top-shell.shell.with-side .main {
    padding: 16px !important;
  }
}

@media (max-width: 760px) {
  .top-shell.shell.with-side .side-menu {
    width: min(84vw, 290px) !important;
    max-width: calc(100vw - 42px) !important;
  }

  .top-shell.shell.with-side.side-closed .side-menu {
    width: 52px !important;
    max-width: 52px !important;
  }

  .top-shell.shell.with-side .app-header-clean {
    padding-left: 58px !important;
  }

  .top-shell.shell.with-side .main {
    padding: 10px !important;
  }
}

/* Firmaraum v5.4.29: Sidebar Inhalt hart stabilisieren */
/* Sidebar-Inhalt komplett aus alten Card-/Rail-Regeln herausloesen. */
.top-shell.shell.with-side .side-menu,
.top-shell.shell.with-side.side-open .side-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  contain: layout paint !important;
}

.top-shell.shell.with-side .side-toggle {
  align-self: flex-start !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side.side-open .side-toggle {
  align-self: flex-end !important;
}

.top-shell.shell.with-side .side-toggle span {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  font-size: 18px !important;
  line-height: 30px !important;
  text-align: center !important;
}

.top-shell.shell.with-side .side-toggle strong,
.top-shell.shell.with-side .side-toggle small,
.top-shell.shell.with-side .side-toggle em {
  display: none !important;
  width: 0 !important;
  max-width: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .side-panel {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
  padding: 12px 0 0 !important;
}

.top-shell.shell.with-side .side-main-nav {
  display: block !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 2px 8px 0 !important;
}

.top-shell.shell.with-side .side-bottom-nav {
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  margin: 8px 0 0 !important;
  padding: 8px 0 0 !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
}

.top-shell.shell.with-side .side-section-title {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 10px 8px 6px !important;
  padding: 0 !important;
  color: #8b92a0 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
}

.top-shell.shell.with-side .side-link,
.top-shell.shell.with-side .side-project-link,
.top-shell.shell.with-side .side-link.project-shortcut,
.top-shell.shell.with-side .side-link.project-rail-source,
.top-shell.shell.with-side .side-link.active.project-rail-source,
.top-shell.shell.with-side .side-bottom-nav .side-link {
  display: flex !important;
  position: relative !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  aspect-ratio: auto !important;
  margin: 0 0 4px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  text-align: left !important;
}

.top-shell.shell.with-side .side-link.active,
.top-shell.shell.with-side .side-link.project-shortcut.active,
.top-shell.shell.with-side .side-link.project-rail-source.active,
.top-shell.shell.with-side .side-bottom-nav .side-link.active {
  background: #2f6df0 !important;
  color: #fff !important;
}

.top-shell.shell.with-side .side-link strong,
.top-shell.shell.with-side .side-project-link strong,
.top-shell.shell.with-side .side-link.project-shortcut strong,
.top-shell.shell.with-side .side-link.project-rail-source strong {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.top-shell.shell.with-side .side-brand-bottom {
  display: grid !important;
  flex: 0 0 auto !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 8px 0 0 !important;
  padding: 8px 0 0 !important;
  border-top: 1px solid rgba(255,255,255,0.12) !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .side-brand-main {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.top-shell.shell.with-side .side-brand-main strong,
.top-shell.shell.with-side .side-brand-main div {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 13px !important;
  line-height: 1.15 !important;
}

.top-shell.shell.with-side .side-logo,
.top-shell.shell.with-side .side-brand-main img,
.top-shell.shell.with-side .side-brand-main .brand-mark {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 8px !important;
  object-fit: contain !important;
}

.top-shell.shell.with-side .side-brand-meta {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}

.top-shell.shell.with-side .side-brand-meta span {
  display: block !important;
  min-width: 0 !important;
  padding: 6px 7px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #c9ced8 !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.top-shell.shell.with-side .side-brand-meta strong {
  display: inline !important;
  font-size: 12px !important;
  line-height: 1 !important;
}

.top-shell.shell.with-side .side-bottom-actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  width: 100% !important;
}

.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 32px !important;
  max-height: 34px !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

/* Firmaraum v5.4.31: klickbare Breadcrumbs */
.context-path {
  gap: 4px !important;
}

.context-path .context-crumb,
.context-path button.context-crumb,
.context-path span.context-crumb {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 24px !important;
  max-width: min(220px, 36vw) !important;
  padding: 2px 9px !important;
  border: 1px solid var(--blue-3) !important;
  border-radius: 999px !important;
  background: var(--blue-2) !important;
  color: var(--blue) !important;
  font: inherit !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.context-path .context-crumb-static {
  cursor: default !important;
}

.context-path button.context-crumb:hover {
  transform: translateY(-1px) !important;
  background: #dbeafe !important;
  border-color: #93c5fd !important;
}

.context-arrow {
  display: none !important;
}

@media (max-width: 560px) {
  .context-path .context-crumb,
  .context-path button.context-crumb,
  .context-path span.context-crumb {
    max-width: 30vw !important;
    font-size: 10px !important;
    min-height: 22px !important;
    padding: 2px 7px !important;
  }

  .context-arrow {
    display: none !important;
  }
}

/* Firmaraum v5.4.32: Menuebutton oben links fixieren */
.top-shell.shell.with-side .side-menu,
.top-shell.shell.with-side.side-open .side-menu,
.top-shell.shell.with-side.side-closed .side-menu {
  top: 0 !important;
  left: 0 !important;
}

.top-shell.shell.with-side .side-toggle,
.top-shell.shell.with-side.side-open .side-toggle,
.top-shell.shell.with-side.side-closed .side-toggle {
  position: absolute !important;
  top: 8px !important;
  left: 8px !important;
  right: auto !important;
  align-self: flex-start !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 140 !important;
}

.top-shell.shell.with-side .side-panel {
  padding-top: 48px !important;
}

.top-shell.shell.with-side.side-closed .side-menu {
  width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  max-height: 52px !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.top-shell.shell.with-side.side-closed .side-toggle {
  pointer-events: auto !important;
}

/* Firmaraum v5.4.33: geschlossene Sidebar ohne Strich */
.top-shell.shell.with-side.side-closed .side-menu {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.top-shell.shell.with-side.side-closed .side-toggle {
  position: fixed !important;
  top: 8px !important;
  left: 8px !important;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

/* Firmaraum v5.4.34: Chat unten rechts */
.floating-chat,
.chat-float {
  position: fixed !important;
  right: max(16px, env(safe-area-inset-right)) !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  top: auto !important;
  z-index: 95 !important;
}

.floating-chat-panel,
.chat-panel,
.chat-popover {
  right: 0 !important;
  left: auto !important;
  transform-origin: bottom right !important;
}

@media (max-width: 760px) {
  .floating-chat,
  .chat-float {
    right: max(12px, env(safe-area-inset-right)) !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    left: auto !important;
  }
}

/* Firmaraum v5.4.35: Menuebutton sichtbar bei geschlossener Sidebar */
.top-shell.shell.with-side.side-closed .side-menu {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.top-shell.shell.with-side.side-closed .side-toggle,
.top-shell.shell.with-side .side-toggle {
  position: fixed !important;
  top: 8px !important;
  left: 8px !important;
  right: auto !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  z-index: 200 !important;
  pointer-events: auto !important;
  background: #1b1f27 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 9px !important;
  color: #fff !important;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

/* Firmaraum v5.4.36: Sidebar-Footer proportional */
.top-shell.shell.with-side.side-open .side-menu {
  width: min(86vw, 300px) !important;
  max-width: calc(100vw - 36px) !important;
}

@media (min-width: 761px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: 280px !important;
    max-width: 280px !important;
  }
}

.top-shell.shell.with-side .side-brand-bottom,
.top-shell.shell.with-side.side-open .side-brand-bottom {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 8px 0 0 !important;
  padding: 8px 0 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.top-shell.shell.with-side .side-brand-main,
.top-shell.shell.with-side.side-open .side-brand-main {
  display: grid !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.top-shell.shell.with-side .side-brand-main > div,
.top-shell.shell.with-side .side-brand-main strong {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-shell.shell.with-side .side-brand-meta,
.top-shell.shell.with-side.side-open .side-brand-meta {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side.side-open .side-brand-meta span {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 42px !important;
  padding: 6px 7px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
  font-size: 10.5px !important;
  line-height: 1.08 !important;
}

.top-shell.shell.with-side .side-brand-meta strong,
.top-shell.shell.with-side.side-open .side-brand-meta strong {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 14px !important;
  line-height: 1.05 !important;
}

.top-shell.shell.with-side .side-bottom-actions,
.top-shell.shell.with-side.side-open .side-bottom-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout,
.top-shell.shell.with-side.side-open .side-status,
.top-shell.shell.with-side.side-open .side-logout {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  min-height: 34px !important;
  max-height: none !important;
  padding: 7px 10px !important;
  box-sizing: border-box !important;
  justify-content: center !important;
  align-items: center !important;
  overflow: hidden !important;
  text-align: center !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

/* Firmaraum v5.4.37: Sidebar-Footer gleich grosse Kacheln */
.top-shell.shell.with-side .side-brand-bottom {
  container-type: inline-size !important;
}

.top-shell.shell.with-side .side-brand-meta,
.top-shell.shell.with-side.side-open .side-brand-meta {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: clamp(5px, 2cqw, 8px) !important;
  width: 100% !important;
}

.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side.side-open .side-brand-meta span {
  display: grid !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  justify-items: start !important;
  aspect-ratio: 2.1 / 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  padding: clamp(5px, 2.4cqw, 8px) !important;
  box-sizing: border-box !important;
  white-space: normal !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .side-brand-meta strong,
.top-shell.shell.with-side.side-open .side-brand-meta strong {
  display: block !important;
  width: 100% !important;
  font-size: clamp(11px, 5.4cqw, 15px) !important;
  line-height: 1 !important;
}

.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side.side-open .side-brand-meta span,
.top-shell.shell.with-side .side-brand-meta span:not(strong),
.top-shell.shell.with-side.side-open .side-brand-meta span:not(strong) {
  font-size: clamp(8px, 3.7cqw, 11px) !important;
  line-height: 1.05 !important;
}

.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout,
.top-shell.shell.with-side.side-open .side-status,
.top-shell.shell.with-side.side-open .side-logout {
  width: 100% !important;
  min-width: 0 !important;
  height: clamp(30px, 13cqw, 38px) !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 clamp(7px, 3cqw, 12px) !important;
  font-size: clamp(10px, 4.4cqw, 13px) !important;
  line-height: 1.05 !important;
}

@supports not (container-type: inline-size) {
  .top-shell.shell.with-side .side-brand-meta span,
  .top-shell.shell.with-side.side-open .side-brand-meta span {
    aspect-ratio: 2.1 / 1 !important;
    padding: 7px !important;
  }

  .top-shell.shell.with-side .side-brand-meta strong,
  .top-shell.shell.with-side.side-open .side-brand-meta strong {
    font-size: 13px !important;
  }

  .top-shell.shell.with-side .side-status,
  .top-shell.shell.with-side .side-logout,
  .top-shell.shell.with-side.side-open .side-status,
  .top-shell.shell.with-side.side-open .side-logout {
    height: 34px !important;
    font-size: 12px !important;
  }
}

/* Firmaraum v5.4.38: Sidebar-Footer als proportionaler Block */
.top-shell.shell.with-side.side-open .side-menu {
  width: clamp(248px, 24vw, 300px) !important;
  min-width: clamp(248px, 24vw, 300px) !important;
  max-width: min(300px, calc(100vw - 36px)) !important;
}

@media (max-width: 760px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: min(82vw, 300px) !important;
    min-width: min(82vw, 300px) !important;
    max-width: min(82vw, 300px) !important;
  }
}

.top-shell.shell.with-side .side-brand-bottom,
.top-shell.shell.with-side.side-open .side-brand-bottom {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: clamp(6px, 2.6cqw, 9px) !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  min-inline-size: 0 !important;
  overflow: hidden !important;
  container-type: inline-size !important;
}

.top-shell.shell.with-side .side-brand-main,
.top-shell.shell.with-side.side-open .side-brand-main {
  display: grid !important;
  grid-template-columns: clamp(28px, 13cqw, 36px) minmax(0, 1fr) !important;
  gap: clamp(7px, 3cqw, 10px) !important;
  align-items: center !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
}

.top-shell.shell.with-side .side-brand-main img,
.top-shell.shell.with-side .side-brand-main .brand-mark,
.top-shell.shell.with-side.side-open .side-brand-main img,
.top-shell.shell.with-side.side-open .side-brand-main .brand-mark {
  inline-size: 100% !important;
  block-size: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
}

.top-shell.shell.with-side .side-brand-main > div,
.top-shell.shell.with-side .side-brand-main strong,
.top-shell.shell.with-side.side-open .side-brand-main > div,
.top-shell.shell.with-side.side-open .side-brand-main strong {
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(13px, 6.4cqw, 17px) !important;
  line-height: 1.05 !important;
}

.top-shell.shell.with-side .side-brand-meta,
.top-shell.shell.with-side.side-open .side-brand-meta {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: clamp(6px, 2.4cqw, 8px) !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side.side-open .side-brand-meta span {
  display: grid !important;
  grid-template-rows: min-content min-content !important;
  align-content: center !important;
  justify-items: start !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  aspect-ratio: 2.35 / 1 !important;
  block-size: auto !important;
  min-block-size: 0 !important;
  max-block-size: none !important;
  padding: clamp(5px, 2.4cqw, 8px) !important;
  border-radius: clamp(8px, 3.8cqw, 12px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  font-size: clamp(8px, 3.5cqw, 11px) !important;
  line-height: 1.05 !important;
}

.top-shell.shell.with-side .side-brand-meta strong,
.top-shell.shell.with-side.side-open .side-brand-meta strong {
  display: block !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(11px, 5.3cqw, 15px) !important;
  line-height: 1 !important;
}

.top-shell.shell.with-side .side-bottom-actions,
.top-shell.shell.with-side.side-open .side-bottom-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: clamp(6px, 2.4cqw, 8px) !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  max-inline-size: 100% !important;
}

.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout,
.top-shell.shell.with-side.side-open .side-status,
.top-shell.shell.with-side.side-open .side-logout {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  inline-size: 100% !important;
  min-inline-size: 0 !important;
  block-size: clamp(30px, 13cqw, 38px) !important;
  min-block-size: 0 !important;
  max-block-size: none !important;
  padding: 0 clamp(8px, 3.2cqw, 12px) !important;
  border-radius: clamp(9px, 3.8cqw, 13px) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: clamp(10px, 4.2cqw, 13px) !important;
  line-height: 1 !important;
}

.top-shell.shell.with-side.side-closed .side-brand-bottom {
  display: none !important;
}

/* Firmaraum v5.4.39: Kompakte Overlay-Sidebar fuer enge Fenster */
.top-shell.shell.with-side.side-open .side-menu {
  width: clamp(220px, 18vw, 270px) !important;
  min-width: clamp(220px, 18vw, 270px) !important;
  max-width: min(270px, calc(100vw - 24px)) !important;
  padding: 14px 12px !important;
}

@media (max-width: 900px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: min(64vw, 220px) !important;
    min-width: min(64vw, 220px) !important;
    max-width: min(64vw, 220px) !important;
    padding: 12px 10px !important;
  }
}

@media (max-width: 520px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: min(56vw, 200px) !important;
    min-width: min(56vw, 200px) !important;
    max-width: min(56vw, 200px) !important;
    padding: 10px 8px !important;
  }
}

@media (max-width: 380px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: min(54vw, 184px) !important;
    min-width: min(54vw, 184px) !important;
    max-width: min(54vw, 184px) !important;
  }
}

.top-shell.shell.with-side.side-open .side-panel {
  gap: clamp(8px, 2vw, 14px) !important;
  padding-top: 42px !important;
}

.top-shell.shell.with-side.side-open .side-label {
  margin: 6px 0 2px !important;
  font-size: clamp(9px, 2.5vw, 11px) !important;
  line-height: 1.1 !important;
}

.top-shell.shell.with-side.side-open .side-link,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link {
  min-height: 30px !important;
  height: auto !important;
  padding: 6px 9px !important;
  border-radius: 8px !important;
  font-size: clamp(11px, 3vw, 13px) !important;
  line-height: 1.1 !important;
}

.top-shell.shell.with-side.side-open .side-link strong,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong {
  font-size: clamp(11px, 3vw, 13px) !important;
  line-height: 1.1 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-shell.shell.with-side.side-open .side-brand-bottom {
  gap: clamp(5px, 2cqw, 7px) !important;
  padding-top: 7px !important;
}

.top-shell.shell.with-side.side-open .side-brand-main {
  grid-template-columns: clamp(24px, 14cqw, 32px) minmax(0, 1fr) !important;
  gap: clamp(6px, 3cqw, 9px) !important;
}

.top-shell.shell.with-side.side-open .side-brand-main strong {
  font-size: clamp(11px, 6cqw, 15px) !important;
}

.top-shell.shell.with-side.side-open .side-brand-meta {
  gap: clamp(4px, 2cqw, 6px) !important;
}

.top-shell.shell.with-side.side-open .side-brand-meta span {
  aspect-ratio: 2.15 / 1 !important;
  padding: clamp(4px, 2.2cqw, 7px) !important;
  border-radius: clamp(7px, 3cqw, 10px) !important;
  font-size: clamp(7px, 3.4cqw, 10px) !important;
}

.top-shell.shell.with-side.side-open .side-brand-meta strong {
  font-size: clamp(9px, 5.1cqw, 13px) !important;
}

.top-shell.shell.with-side.side-open .side-status,
.top-shell.shell.with-side.side-open .side-logout {
  block-size: clamp(26px, 12cqw, 34px) !important;
  padding: 0 clamp(6px, 2.8cqw, 10px) !important;
  border-radius: clamp(8px, 3cqw, 11px) !important;
  font-size: clamp(9px, 3.8cqw, 12px) !important;
}

.top-shell.shell.with-side.side-open .side-status span:last-child,
.top-shell.shell.with-side.side-open .side-logout {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Firmaraum v5.4.41: echter Handy-Kompaktmodus fuer Sidebar */
@media (max-width: 760px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: clamp(144px, 42vw, 176px) !important;
    min-width: clamp(144px, 42vw, 176px) !important;
    max-width: clamp(144px, 42vw, 176px) !important;
    padding: 8px 7px !important;
    border-radius: 0 14px 14px 0 !important;
  }

  .top-shell.shell.with-side.side-open .side-toggle {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    top: 8px !important;
    left: 8px !important;
  }

  .top-shell.shell.with-side.side-open .side-panel {
    padding-top: 36px !important;
    gap: 7px !important;
  }

  .top-shell.shell.with-side.side-open .side-main-nav,
  .top-shell.shell.with-side.side-open .side-bottom-nav {
    gap: 5px !important;
  }

  .top-shell.shell.with-side.side-open .side-section-title,
  .top-shell.shell.with-side.side-open .side-label {
    margin: 5px 0 2px !important;
    font-size: 8px !important;
    line-height: 1 !important;
    letter-spacing: .04em !important;
  }

  .top-shell.shell.with-side.side-open .side-link,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut {
    min-height: 24px !important;
    padding: 4px 7px !important;
    border-radius: 7px !important;
    font-size: 10.5px !important;
    line-height: 1 !important;
  }

  .top-shell.shell.with-side.side-open .side-link strong,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut strong {
    font-size: 10.5px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-bottom {
    gap: 5px !important;
    padding-top: 6px !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-main {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-main strong {
    font-size: 11px !important;
    line-height: 1 !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-meta {
    gap: 4px !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-meta span {
    aspect-ratio: 1.75 / 1 !important;
    padding: 4px 5px !important;
    border-radius: 7px !important;
    font-size: 7.5px !important;
    line-height: 1 !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-meta strong {
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .top-shell.shell.with-side.side-open .side-bottom-actions {
    gap: 5px !important;
  }

  .top-shell.shell.with-side.side-open .side-status,
  .top-shell.shell.with-side.side-open .side-logout {
    block-size: 25px !important;
    padding: 0 6px !important;
    border-radius: 8px !important;
    font-size: 10px !important;
    line-height: 1 !important;
  }

  .top-shell.shell.with-side.side-open .side-status .dot {
    width: 6px !important;
    height: 6px !important;
    min-width: 6px !important;
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: clamp(132px, 44vw, 156px) !important;
    min-width: clamp(132px, 44vw, 156px) !important;
    max-width: clamp(132px, 44vw, 156px) !important;
  }

  .top-shell.shell.with-side.side-open .side-link,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut,
  .top-shell.shell.with-side.side-open .side-link strong,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut strong {
    font-size: 10px !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-main {
    grid-template-columns: 22px minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-meta span {
    padding: 3px 4px !important;
    font-size: 7px !important;
  }

  .top-shell.shell.with-side.side-open .side-brand-meta strong {
    font-size: 9px !important;
  }
}


/* Firmaraum v5.4.44: einheitliches Bereichs-Ordnungssystem */
.section-system {
  display: grid !important;
  grid-template-columns: minmax(128px, 180px) minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.section-local-nav,
.settings-local-nav {
  position: sticky !important;
  top: 68px !important;
  display: grid !important;
  gap: 6px !important;
  align-self: start !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.section-nav-button,
.settings-local-tab {
  appearance: none !important;
  width: 100% !important;
  min-height: 34px !important;
  height: auto !important;
  padding: 7px 11px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--muted) !important;
  text-align: left !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.15 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.section-nav-button.active,
.settings-local-tab.active {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.16) !important;
}

.section-local-content,
.settings-local-content {
  display: grid !important;
  gap: 12px !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.section-local-content > .panel,
.settings-local-content > .panel,
.section-local-content > .stack,
.settings-local-content > .stack {
  max-width: min(100%, 980px) !important;
  min-width: 0 !important;
}

.section-local-content .overview-top-grid,
.section-local-content .overview-card-grid,
.section-local-content .dashboard-grid,
.section-local-content .project-layout,
.section-local-content .notes-layout,
.section-local-content .two-pane,
.section-local-content .file-grid,
.section-local-content .admin-grid,
.section-local-content .invite-admin-grid,
.section-local-content .profile-grid {
  max-width: 100% !important;
  min-width: 0 !important;
}

.team-section-system .section-local-content > .panel,
.friends-section-system .section-local-content > .panel,
.settings-page-layout .section-local-content > .panel {
  max-width: min(100%, 980px) !important;
}

.work-section-system .overview-status,
.project-section-system .overview-status {
  margin-bottom: 12px !important;
}

.work-section-system .work-tabs,
.project-section-system .project-tabs {
  display: none !important;
}

@media (min-width: 1180px) {
  .section-system.settings-page-layout {
    grid-template-columns: 180px minmax(0, 1fr) !important;
  }

  .team-section-system,
  .friends-section-system {
    grid-template-columns: 160px minmax(0, 980px) !important;
  }
}

@media (max-width: 980px) {
  .section-system,
  .section-system.settings-page-layout {
    grid-template-columns: 1fr !important;
  }

  .section-local-nav,
  .settings-local-nav {
    position: static !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    overflow-x: auto !important;
    padding: 0 0 6px !important;
    scrollbar-width: none !important;
  }

  .section-local-nav::-webkit-scrollbar,
  .settings-local-nav::-webkit-scrollbar {
    display: none !important;
  }

  .section-nav-button,
  .settings-local-tab {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: min(220px, 70vw) !important;
    min-height: 32px !important;
    padding: 6px 10px !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 520px) {
  .section-system {
    gap: 9px !important;
  }

  .section-nav-button,
  .settings-local-tab {
    min-height: 30px !important;
    padding: 5px 9px !important;
    font-size: 12px !important;
  }

  .section-local-content {
    gap: 10px !important;
  }
}

/* Firmaraum v5.4.51: Overlay-Sidebar in kleinen Fenstern kompakter halten */
@media (min-width: 761px) and (max-width: 980px) {
  .top-shell.shell.with-side.side-open .side-menu {
    width: clamp(190px, 28vw, 220px) !important;
    min-width: clamp(190px, 28vw, 220px) !important;
    max-width: clamp(190px, 28vw, 220px) !important;
    padding: 11px 9px !important;
  }

  .top-shell.shell.with-side.side-open .side-panel {
    padding-top: 40px !important;
    gap: 7px !important;
  }

  .top-shell.shell.with-side.side-open .side-link,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut {
    min-height: 26px !important;
    padding: 5px 8px !important;
    border-radius: 7px !important;
  }

  .top-shell.shell.with-side.side-open .side-link strong,
  .top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong,
  .top-shell.shell.with-side.side-open .side-link.project-shortcut strong {
    font-size: 11px !important;
    line-height: 1.05 !important;
  }
}

/* Firmaraum v5.4.57: konsolidierte Shell- und Bereichsarchitektur */
*,
*::before,
*::after {
  box-sizing: border-box !important;
}

html,
body,
#app {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body:has(#app .top-shell.shell.with-side),
#app:has(.top-shell.shell.with-side) {
  height: 100dvh !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side,
.top-shell.shell.with-side.side-open,
.top-shell.shell.with-side.side-closed,
.top-shell.shell.with-side.with-project-rail,
.top-shell.shell.with-side.with-project-rail.side-open,
.top-shell.shell.with-side.with-project-rail.side-closed {
  position: fixed !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
  isolation: isolate !important;
  grid-template-columns: none !important;
  transform: none !important;
}

.top-shell.shell.with-side .content-shell {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  background: var(--bg) !important;
  transform: none !important;
}

.profile-shell,
.profile-shell .content-shell {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  background: var(--bg) !important;
}

.top-shell.shell.with-side .app-header-clean,
.profile-shell .app-header-clean {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  width: 100% !important;
  min-height: 58px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  background: rgba(246, 247, 244, 0.92) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
}

.top-shell.shell.with-side .app-header-clean {
  padding: 12px clamp(12px, 2vw, 22px) 10px 58px !important;
}

.profile-shell .app-header-clean {
  padding: 12px clamp(12px, 2vw, 22px) 10px !important;
}

.header-title,
.header-title h1,
.context-path,
.context-crumb {
  min-width: 0 !important;
  max-width: 100% !important;
}

.header-title h1,
.context-crumb {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.context-path {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: visible !important;
}

.context-crumb {
  max-width: min(220px, 44vw) !important;
}

.context-arrow {
  display: none !important;
}

.top-shell.shell.with-side .main,
.top-shell.shell.with-side main.main,
.profile-shell .main,
.profile-shell main.main {
  width: 100% !important;
  max-width: min(1180px, 100%) !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: clamp(10px, 1.6vw, 22px) !important;
  overflow: visible !important;
}

.top-shell.shell.with-side .main.work-main,
.top-shell.shell.with-side main.main.work-main {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}

.top-shell.shell.with-side .main.work-main > .section-system,
.top-shell.shell.with-side main.main.work-main > .section-system,
.top-shell.shell.with-side .main.work-main > .project-section-system,
.top-shell.shell.with-side main.main.work-main > .project-section-system,
.top-shell.shell.with-side .main.work-main > .work-section-system,
.top-shell.shell.with-side main.main.work-main > .work-section-system {
  grid-column: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.top-shell.shell.with-side .side-menu,
.top-shell.shell.with-side.side-open .side-menu,
.top-shell.shell.with-side.with-project-rail.side-open .side-menu {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 120 !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(230px, 76vw) !important;
  max-width: calc(100vw - 56px) !important;
  min-width: 0 !important;
  height: 100dvh !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 10px !important;
  overflow: hidden !important;
  color: #f9fafb !important;
  background: #111318 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 18px 18px 0 !important;
  box-shadow: 24px 0 50px rgba(0, 0, 0, 0.28) !important;
  transform: translate3d(0, 0, 0) !important;
  transition: transform 180ms cubic-bezier(.2, .8, .2, 1), box-shadow 180ms ease !important;
  will-change: transform !important;
}

.top-shell.shell.with-side.side-closed .side-menu,
.top-shell.shell.with-side.with-project-rail.side-closed .side-menu {
  width: 50px !important;
  max-width: 50px !important;
  min-width: 50px !important;
  padding: 0 !important;
  overflow: visible !important;
  pointer-events: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  transform: none !important;
}

.top-shell.shell.with-side.side-closed .side-panel,
.top-shell.shell.with-side.side-closed .side-brand-bottom,
.top-shell.shell.with-side.with-project-rail.side-closed .side-panel,
.top-shell.shell.with-side.with-project-rail.side-closed .side-brand-bottom {
  display: none !important;
}

.top-shell.shell.with-side .side-toggle,
.top-shell.shell.with-side.side-open .side-toggle,
.top-shell.shell.with-side.side-closed .side-toggle,
.top-shell.shell.with-side.with-project-rail .side-toggle {
  position: fixed !important;
  top: max(8px, env(safe-area-inset-top)) !important;
  left: max(8px, env(safe-area-inset-left)) !important;
  z-index: 180 !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  pointer-events: auto !important;
  border-radius: 9px !important;
  background: #20242c !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18) !important;
  transform: none !important;
}

.top-shell.shell.with-side.side-open::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 90 !important;
  pointer-events: none !important;
  background: rgba(0, 0, 0, 0.13) !important;
  backdrop-filter: blur(1px) !important;
}

.top-shell.shell.with-side .side-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 42px 0 0 !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side .side-main-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0 2px 8px 0 !important;
}

.top-shell.shell.with-side .side-bottom-nav,
.top-shell.shell.with-side .side-brand-bottom {
  flex: 0 0 auto !important;
  min-height: 0 !important;
}

.top-shell.shell.with-side .side-section-title,
.top-shell.shell.with-side .side-section-label,
.top-shell.shell.with-side .side-label {
  margin: 10px 8px 5px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: .06em !important;
  color: rgba(255, 255, 255, .56) !important;
  text-transform: uppercase !important;
}

.top-shell.shell.with-side .side-section-title-sub {
  margin-top: 7px !important;
}

.top-shell.shell.with-side .side-link,
.top-shell.shell.with-side .side-link.project-shortcut,
.top-shell.shell.with-side .side-bottom-nav .side-link {
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 10px !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  border-radius: 7px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-shell.shell.with-side .side-link strong,
.top-shell.shell.with-side .side-active-project-name,
.top-shell.shell.with-side .side-brand-main strong,
.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-shell.shell.with-side .side-icon {
  display: none !important;
}

.side-quick-grid,
.side-project-quick-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.top-shell.shell.with-side .side-quick-link {
  justify-content: center !important;
  height: 27px !important;
  min-height: 27px !important;
  max-height: 27px !important;
  padding: 0 7px !important;
  font-size: 10.5px !important;
  text-align: center !important;
}

.top-shell.shell.with-side .side-active-project-name {
  padding: 0 2px 2px !important;
  color: rgba(255, 255, 255, .9) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
}

.top-shell.shell.with-side .side-brand-bottom {
  display: grid !important;
  gap: 7px !important;
  margin-top: 8px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.top-shell.shell.with-side .side-brand-main {
  display: grid !important;
  grid-template-columns: 26px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
  min-width: 0 !important;
}

.top-shell.shell.with-side .side-logo,
.top-shell.shell.with-side .side-logo-img {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 7px !important;
}

.top-shell.shell.with-side .side-brand-meta,
.top-shell.shell.with-side .side-bottom-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.top-shell.shell.with-side .side-brand-meta span,
.top-shell.shell.with-side .side-status,
.top-shell.shell.with-side .side-logout {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 8px !important;
  border-radius: 8px !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
}

.top-shell.shell.with-side .side-status-dot,
.top-shell.shell.with-side .side-status .dot {
  flex: 0 0 auto !important;
}

.floating-chat,
.chat-float,
.chat-launcher {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  bottom: max(12px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  z-index: 85 !important;
}

.chat-panel,
.floating-chat-panel,
.chat-window {
  max-width: calc(100vw - 24px) !important;
  max-height: min(78dvh, 680px) !important;
}

.panel,
.card,
.stat-card,
.project-card,
.member-card,
.file-card,
.note-card,
.task-card,
.invite-card,
.info-card,
.form-card,
form,
fieldset,
input,
select,
textarea,
button {
  min-width: 0 !important;
  max-width: 100% !important;
}

input,
select,
textarea {
  width: 100% !important;
}

button:not(.item-card):not(.project-card-button) {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.overview-top-grid,
.overview-card-grid,
.dashboard-grid,
.status-grid,
.file-grid,
.project-grid,
.notes-grid,
.admin-grid,
.invite-admin-grid,
.profile-grid,
.settings-grid,
.team-grid,
.team-board,
.project-layout,
.project-main-grid,
.two-pane,
.notes-layout,
.workspace-grid,
.form-grid,
.task-edit-grid,
.task-form-grid {
  min-width: 0 !important;
  max-width: 100% !important;
}

.status-grid,
.overview-status,
.project-status-strip,
.project-status-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: clamp(8px, 1.2vw, 12px) !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.overview-status > .status-tile,
.project-status-strip > .status-tile {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.team-grid,
.team-board,
.admin-grid,
.profile-grid,
.settings-grid,
.dashboard-grid,
.project-main-grid,
.workspace-grid,
.invite-admin-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)) !important;
  gap: clamp(10px, 1.4vw, 14px) !important;
  align-items: start !important;
}

.project-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  align-items: start !important;
}

.project-layout-wide {
  grid-template-columns: minmax(0, 1fr) !important;
}

.project-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.two-pane,
.notes-layout {
  display: grid !important;
  grid-template-columns: minmax(min(320px, 100%), 420px) minmax(0, 1fr) !important;
  gap: clamp(10px, 1.4vw, 14px) !important;
  align-items: start !important;
}

.task-edit-grid,
.task-form-grid,
.form-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)) !important;
  gap: 8px !important;
  align-items: end !important;
}

.table-wrap,
.table-panel,
.admin-table,
.data-table,
table {
  max-width: 100% !important;
  overflow-x: auto !important;
}

table {
  display: block !important;
}

.section-system,
.work-section-system,
.project-section-system,
.team-section-system,
.profile-section-system,
.friends-section-system,
.settings-page-layout,
.settings-section-system {
  display: grid !important;
  grid-template-columns: 164px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.section-local-nav,
.settings-local-nav,
.project-local-nav {
  position: sticky !important;
  top: 70px !important;
  z-index: 8 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 6px !important;
  align-self: start !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.section-nav-button,
.settings-local-tab,
.project-local-tab {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 30px !important;
  height: auto !important;
  padding: 6px 10px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.section-local-content,
.settings-local-content {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.section-local-content > *,
.settings-local-content > *,
.project-section-system .section-local-content > *,
.work-section-system .section-local-content > *,
.team-section-system .section-local-content > *,
.settings-page-layout .section-local-content > * {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.work-section-system .work-tabs,
.project-section-system .project-tabs {
  display: none !important;
}

.project-section-system .overview-top-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.project-section-system .overview-command {
  order: -1 !important;
}

.project-section-system .overview-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    width: min(210px, 70vw) !important;
    max-width: calc(100vw - 54px) !important;
  }

  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side main.main,
  .profile-shell .main,
  .profile-shell main.main {
    padding: 10px !important;
  }

  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system {
    grid-template-columns: 132px minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .team-grid,
  .team-board,
  .admin-grid,
  .profile-grid,
  .settings-grid,
  .dashboard-grid,
  .project-layout,
  .project-main-grid,
  .workspace-grid,
  .invite-admin-grid,
  .two-pane,
  .notes-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 780px) {
  .top-shell.shell.with-side .app-header-clean {
    min-height: 52px !important;
    padding: 9px 10px 8px 54px !important;
  }

  .profile-shell .app-header-clean {
    min-height: 52px !important;
    padding: 9px 10px 8px !important;
  }

  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    width: min(190px, 68vw) !important;
    max-width: calc(100vw - 50px) !important;
    padding: 8px !important;
    border-radius: 0 16px 16px 0 !important;
  }

  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system {
    grid-template-columns: 112px minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .section-local-nav,
  .settings-local-nav,
  .project-local-nav {
    top: 60px !important;
    gap: 5px !important;
  }

  .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    min-height: 28px !important;
    padding: 5px 7px !important;
    font-size: 11px !important;
  }

  .status-grid,
  .overview-status,
  .project-status-strip,
  .project-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .project-section-system .overview-metrics {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 560px) {
  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    width: min(176px, 62vw) !important;
    max-width: calc(100vw - 46px) !important;
  }

  .top-shell.shell.with-side .side-link,
  .top-shell.shell.with-side .side-link.project-shortcut,
  .top-shell.shell.with-side .side-bottom-nav .side-link {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }

  .top-shell.shell.with-side .side-brand-meta,
  .top-shell.shell.with-side .side-bottom-actions {
    gap: 5px !important;
  }

  .top-shell.shell.with-side .side-brand-meta span,
  .top-shell.shell.with-side .side-status,
  .top-shell.shell.with-side .side-logout {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0 6px !important;
    font-size: 9px !important;
  }

  .side-quick-grid,
  .side-project-quick-grid {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  .top-shell.shell.with-side .side-quick-link {
    height: 25px !important;
    min-height: 25px !important;
    max-height: 25px !important;
    font-size: 10px !important;
  }

  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .section-local-nav,
  .settings-local-nav,
  .project-local-nav {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    min-height: 28px !important;
    padding: 5px 7px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
  }

  .status-grid,
  .overview-status,
  .project-status-strip,
  .project-status-grid,
  .task-edit-grid,
  .task-form-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side main.main,
  .profile-shell .main,
  .profile-shell main.main {
    padding: 8px !important;
  }

  .floating-chat,
  .chat-float,
  .chat-launcher {
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 380px) {
  .section-local-nav,
  .settings-local-nav,
  .project-local-nav,
  .status-grid,
  .overview-status,
  .project-status-strip,
  .project-status-grid,
  .task-edit-grid,
  .task-form-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side .side-toggle,
  .floating-chat,
  .chat-float,
  .chat-launcher,
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Firmaraum v5.4.59: Notiz-Ordnerformular ohne ueberlappenden Plus-Button */
.note-folder-panel-dropdown {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)) !important;
  align-items: end !important;
}

.note-folder-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 38px !important;
  align-items: end !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.note-folder-form .input {
  min-width: 0 !important;
}

.note-folder-form .secondary {
  width: 38px !important;
  min-width: 38px !important;
  max-width: 38px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  flex: 0 0 38px !important;
}

@media (max-width: 420px) {
  .note-folder-form {
    grid-template-columns: minmax(0, 1fr) 36px !important;
  }

  .note-folder-form .secondary {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
  }
}

/* Firmaraum v5.4.60: Direktzugriff als festes Flyout neben der Sidebar */
.top-shell.shell.with-side .side-direct-flyout {
  display: none !important;
}

.top-shell.shell.with-side.side-open .side-direct-flyout {
  position: fixed !important;
  top: 52px !important;
  left: calc(min(230px, 76vw) + 10px) !important;
  z-index: 118 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 7px !important;
  width: min(190px, calc(100vw - min(230px, 76vw) - 22px)) !important;
  max-height: calc(100dvh - 70px) !important;
  padding: 10px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 46px rgba(20, 22, 28, 0.16) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.top-shell.shell.with-side.side-closed .side-direct-flyout {
  display: none !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-section-title {
  margin: 0 0 2px !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-section-title-sub {
  margin-top: 8px !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-active-project-name {
  padding: 0 !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  line-height: 1.2 !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-quick-grid,
.top-shell.shell.with-side .side-direct-flyout .side-project-quick-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px !important;
  width: 100% !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-quick-link {
  justify-content: flex-start !important;
  width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 10px !important;
  color: var(--text) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  text-align: left !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-quick-link strong {
  color: inherit !important;
  font-size: 12px !important;
}

.top-shell.shell.with-side .side-direct-flyout .side-quick-link:hover,
.top-shell.shell.with-side .side-direct-flyout .side-quick-link.active {
  color: #fff !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

@media (max-width: 980px) {
  .top-shell.shell.with-side.side-open .side-direct-flyout {
    left: calc(min(210px, 70vw) + 8px) !important;
    width: min(180px, calc(100vw - min(210px, 70vw) - 18px)) !important;
  }
}

@media (max-width: 780px) {
  .top-shell.shell.with-side.side-open .side-direct-flyout {
    top: 50px !important;
    left: calc(min(190px, 68vw) + 8px) !important;
    right: 8px !important;
    width: auto !important;
  }
}

@media (max-width: 560px) {
  .top-shell.shell.with-side.side-open .side-direct-flyout {
    left: calc(min(176px, 62vw) + 8px) !important;
    right: 8px !important;
    padding: 8px !important;
  }

  .top-shell.shell.with-side .side-direct-flyout .side-quick-link {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
  }
}

/* Firmaraum v5.4.63: Teilprojekt bleibt im Teilprojekte-Bereich */
.inline-project-workspace {
  display: grid !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.inline-project-workspace .project-section-system {
  margin-top: 2px !important;
}

.inline-project-workspace .section-local-nav {
  top: 70px !important;
}


/* Firmaraum v5.4.67: Teilprojekt-Untertabs links unter der Bereichsnavigation */
@media (min-width: 781px) {
  .work-section-system > .section-local-content {
    overflow: visible !important;
  }

  .work-section-system > .section-local-content > .inline-project-workspace {
    --inline-project-nav-width: 164px;
    --inline-project-nav-gap: 12px;
    margin-left: calc(-1 * (var(--inline-project-nav-width) + var(--inline-project-nav-gap))) !important;
    width: calc(100% + var(--inline-project-nav-width) + var(--inline-project-nav-gap)) !important;
    max-width: calc(100% + var(--inline-project-nav-width) + var(--inline-project-nav-gap)) !important;
    min-width: 0 !important;
  }

  .work-section-system > .section-local-content > .inline-project-workspace .project-section-system {
    display: grid !important;
    grid-template-columns: var(--inline-project-nav-width) minmax(0, 1fr) !important;
    gap: var(--inline-project-nav-gap) !important;
    align-items: start !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .work-section-system > .section-local-content > .inline-project-workspace .project-section-system > .section-local-nav {
    top: 70px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .work-section-system > .section-local-content > .inline-project-workspace .project-section-system > .section-local-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@media (min-width: 781px) and (max-width: 980px) {
  .work-section-system > .section-local-content > .inline-project-workspace {
    --inline-project-nav-width: 132px;
    --inline-project-nav-gap: 10px;
  }
}

@media (max-width: 780px) {
  .work-section-system > .section-local-content > .inline-project-workspace {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Firmaraum v5.4.70: Aktionsfenster unter der lokalen Tabwahl */
.work-section-system.has-nav-extra {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) !important;
}

.work-section-system.has-nav-extra > .section-local-nav {
  max-height: calc(100dvh - 86px) !important;
  overflow-y: auto !important;
  padding-right: 2px !important;
}

.section-nav-extra {
  display: grid !important;
  gap: 8px !important;
  margin-top: 10px !important;
  min-width: 0 !important;
  width: 100% !important;
}

.section-nav-extra > .panel,
.nav-extra-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

.nav-extra-panel .panel-header {
  min-height: 36px !important;
  padding: 9px 10px !important;
}

.nav-extra-panel .panel-header h3 {
  font-size: 14px !important;
  line-height: 1.15 !important;
}

.nav-extra-panel .panel-body {
  display: grid !important;
  gap: 8px !important;
  padding: 10px !important;
}

.nav-extra-panel .field {
  gap: 4px !important;
}

.nav-extra-panel .field span {
  font-size: 12px !important;
}

.nav-extra-panel .input,
.nav-extra-panel .select,
.nav-extra-panel .textarea {
  min-height: 34px !important;
  font-size: 13px !important;
}

.nav-extra-panel .compact-textarea {
  min-height: 82px !important;
}

.nav-extra-panel .primary {
  width: 100% !important;
  min-height: 38px !important;
  font-size: 13px !important;
}

.work-section-system.has-nav-extra .project-layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (max-width: 980px) {
  .work-section-system.has-nav-extra {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .work-section-system.has-nav-extra > .section-local-nav {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr)) !important;
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .work-section-system.has-nav-extra .section-nav-button {
    width: 100% !important;
    max-width: 100% !important;
  }

  .work-section-system.has-nav-extra .section-nav-extra {
    grid-column: 1 / -1 !important;
    margin-top: 4px !important;
  }
}

.section-nav-extra-group {
  display: grid !important;
  gap: 6px !important;
  min-width: 0 !important;
  width: 100% !important;
}

.section-nav-extra-label {
  margin: 2px 8px 0 !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.project-open-nav {
  border-top: 1px solid var(--line) !important;
  padding-top: 10px !important;
}

.project-open-nav-name {
  display: block !important;
  min-width: 0 !important;
  padding: 0 8px 2px !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.inline-project-workspace-content-only {
  display: grid !important;
  gap: 12px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

@media (min-width: 781px) {
  .work-section-system > .section-local-content > .inline-project-workspace.inline-project-workspace-content-only {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* Firmaraum v5.4.73: Responsive-Layout stabilisieren */
html,
body,
#app {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

.content-shell,
.main,
.main > *,
.section-system,
.section-local-content,
.panel,
.panel-body,
.item-card,
.project-card,
.task-row,
.note-folder-panel,
.note-folder-selector-row,
.plan-toolbar,
.button-row,
.command-panel {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.panel-header,
.item-title,
.item-meta,
.button-row,
.plan-toolbar,
.mode-card,
.danger-zone,
.command-panel {
  flex-wrap: wrap !important;
}

.button-row,
.command-panel .button-row,
.plan-toolbar .button-row {
  min-width: 0 !important;
}

.button-row > *,
.command-panel .button-row > *,
.plan-toolbar .button-row > * {
  flex: 1 1 auto !important;
  min-width: min(132px, 100%) !important;
}

.command-panel {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
}

.command-panel > :first-child {
  min-width: min(260px, 100%) !important;
  flex: 1 1 320px !important;
}

.command-panel > .button-row {
  flex: 0 1 320px !important;
  justify-content: flex-end !important;
}

.top-shell.shell.with-side.side-open .side-menu {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  width: min(230px, 76vw) !important;
  max-width: calc(100vw - 52px) !important;
  z-index: 121 !important;
}

.top-shell.shell.with-side.side-closed .side-menu {
  position: fixed !important;
  inset: 0 auto auto 0 !important;
  z-index: 121 !important;
}

.top-shell.shell.with-side .content-shell {
  margin-left: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
}

.top-shell.shell.with-side.side-open .content-shell,
.top-shell.shell.with-side.side-closed .content-shell {
  transform: none !important;
}

.top-shell.shell.with-side.side-open .side-direct-flyout {
  left: calc(min(230px, calc(100vw - 52px)) + 10px) !important;
  width: min(240px, calc(100vw - min(230px, calc(100vw - 52px)) - 22px)) !important;
  max-width: calc(100vw - min(230px, calc(100vw - 52px)) - 22px) !important;
  max-height: calc(100dvh - 70px) !important;
  overflow-y: auto !important;
}

@media (max-width: 1120px) {
  .dashboard-grid,
  .overview-card-grid,
  .team-grid,
  .team-board,
  .settings-grid,
  .admin-grid,
  .invite-admin-grid,
  .profile-grid,
  .project-main-grid,
  .workspace-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)) !important;
  }

  .project-layout,
  .two-pane,
  .notes-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .task-row,
  .task-edit-form,
  .plan-row,
  .plan-edit-form {
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: stretch !important;
  }

  .task-row > *,
  .task-edit-form > *,
  .plan-row > *,
  .plan-edit-form > * {
    min-width: 0 !important;
  }
}

@media (max-width: 900px) {
  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system,
  .work-section-system.has-nav-extra {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .section-local-nav,
  .settings-local-nav,
  .project-local-nav,
  .work-section-system.has-nav-extra > .section-local-nav {
    position: static !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(142px, 100%), 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  .section-nav-extra {
    grid-column: 1 / -1 !important;
    margin-top: 4px !important;
  }

  .section-nav-extra > .panel,
  .nav-extra-panel {
    max-width: 100% !important;
  }

  .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 32px !important;
    white-space: nowrap !important;
  }

  .work-section-system > .section-local-content,
  .section-local-content,
  .settings-local-content {
    overflow: visible !important;
  }

  .work-section-system > .section-local-content > .inline-project-workspace,
  .work-section-system > .section-local-content > .inline-project-workspace.inline-project-workspace-content-only {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .status-grid,
  .overview-status,
  .project-status-strip,
  .project-status-grid,
  .overview-metrics,
  .metrics-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-grid,
  .overview-card-grid,
  .project-layout,
  .two-pane,
  .notes-layout,
  .team-grid,
  .team-board,
  .settings-grid,
  .admin-grid,
  .invite-admin-grid,
  .profile-grid,
  .project-main-grid,
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-open .side-direct-flyout {
    left: auto !important;
    right: 10px !important;
    width: min(250px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
  }
}

@media (max-width: 640px) {
  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side main.main,
  .profile-shell .main,
  .profile-shell main.main {
    padding: 8px !important;
  }

  .panel-header {
    gap: 8px !important;
  }

  .panel-header > *,
  .button-row > *,
  .command-panel .button-row > *,
  .plan-toolbar .button-row > * {
    min-width: 0 !important;
  }

  .command-panel {
    align-items: stretch !important;
  }

  .command-panel > .button-row {
    flex: 1 1 100% !important;
    justify-content: stretch !important;
  }

  .form-grid,
  .task-form-grid,
  .task-edit-grid,
  .note-folder-selector-row,
  .note-folder-form,
  .mode-card,
  .danger-zone {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .note-folder-form {
    display: grid !important;
  }

  .note-folder-form .secondary {
    width: 100% !important;
    max-width: 100% !important;
  }

  .project-stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-open .side-direct-flyout {
    top: 50px !important;
    left: auto !important;
    right: 8px !important;
    width: min(220px, calc(100vw - 16px)) !important;
    max-height: calc(100dvh - 66px) !important;
  }
}

@media (max-width: 420px) {
  .section-local-nav,
  .settings-local-nav,
  .project-local-nav,
  .work-section-system.has-nav-extra > .section-local-nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .status-grid,
  .overview-status,
  .project-status-strip,
  .project-status-grid,
  .overview-metrics,
  .metrics-grid,
  .stats-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .button-row,
  .command-panel .button-row,
  .plan-toolbar .button-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .top-shell.shell.with-side.side-open .side-direct-flyout {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
  }
}


/* Firmaraum v5.4.75: Teilprojekt-Anlage kompakter */
.project-create-panel {
  border-radius: 8px !important;
}

.project-create-panel .panel-header {
  min-height: 30px !important;
  padding: 7px 9px !important;
}

.project-create-panel .panel-header h3 {
  font-size: 13px !important;
  line-height: 1.1 !important;
}

.project-create-panel .panel-body {
  gap: 6px !important;
  padding: 8px 9px 9px !important;
}

.project-create-panel .field {
  gap: 3px !important;
}

.project-create-panel .field span {
  font-size: 11px !important;
  line-height: 1.1 !important;
}

.project-create-panel .input,
.project-create-panel .select {
  min-height: 30px !important;
  height: 30px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

.project-create-panel .textarea,
.project-create-panel .compact-textarea {
  min-height: 58px !important;
  height: 58px !important;
  padding: 6px 8px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}

.project-create-panel .primary {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 10px !important;
  font-size: 12px !important;
  border-radius: 7px !important;
}


/* Firmaraum v5.4.77: Teilprojekt-Formular zieht Tabspalte nicht breit */
.work-section-system.has-nav-extra {
  grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) !important;
}

.work-section-system.has-nav-extra > .section-local-nav {
  width: min(220px, 100%) !important;
  max-width: 220px !important;
}

.work-section-system.has-nav-extra .section-nav-extra,
.work-section-system.has-nav-extra .section-nav-extra > .panel,
.work-section-system.has-nav-extra .project-create-panel {
  width: min(220px, 100%) !important;
  max-width: 220px !important;
  justify-self: start !important;
}

.project-create-panel .panel-header {
  padding: 6px 8px !important;
}

.project-create-panel .panel-body {
  padding: 7px 8px 8px !important;
}

.project-create-panel .input,
.project-create-panel .select {
  min-height: 28px !important;
  height: 28px !important;
}

.project-create-panel .textarea,
.project-create-panel .compact-textarea {
  min-height: 50px !important;
  height: 50px !important;
}

.project-create-panel .primary {
  min-height: 30px !important;
  height: 30px !important;
}

@media (min-width: 641px) and (max-width: 900px) {
  .work-section-system.has-nav-extra {
    grid-template-columns: minmax(168px, 220px) minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .work-section-system.has-nav-extra > .section-local-nav {
    position: sticky !important;
    top: 60px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(220px, 100%) !important;
    max-width: 220px !important;
    max-height: calc(100dvh - 76px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 2px !important;
  }

  .work-section-system.has-nav-extra .section-nav-button {
    width: 100% !important;
    max-width: 100% !important;
  }

  .work-section-system.has-nav-extra .section-nav-extra {
    grid-column: auto !important;
    margin-top: 6px !important;
  }
}

@media (max-width: 640px) {
  .work-section-system.has-nav-extra > .section-local-nav {
    max-width: 100% !important;
    width: 100% !important;
  }

  .work-section-system.has-nav-extra .section-nav-extra,
  .work-section-system.has-nav-extra .section-nav-extra > .panel,
  .work-section-system.has-nav-extra .project-create-panel {
    width: min(220px, 100%) !important;
    max-width: 220px !important;
  }
}


/* Firmaraum v5.4.78: Teilprojekt-Karten kompakter bei kleinen Fenstern */
@media (max-width: 1180px) {
  .project-grid {
    gap: 8px !important;
  }

  .project-card-button {
    gap: 7px !important;
    padding: 10px !important;
    border-radius: 8px !important;
  }

  .project-card-button .item-title {
    gap: 8px !important;
  }

  .project-card-button .item-title span:first-child {
    font-size: 14px !important;
    line-height: 1.15 !important;
  }

  .project-card-button .badge {
    padding: 4px 8px !important;
    font-size: 11px !important;
    border-radius: 999px !important;
  }

  .project-card-button p {
    margin: 5px 0 0 !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  .project-card-button .item-meta {
    gap: 6px !important;
    margin-top: 5px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  .project-card-button .project-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .project-card-button .project-stats span {
    min-height: 42px !important;
    padding: 5px 7px !important;
    border-radius: 7px !important;
  }

  .project-card-button .project-stats strong {
    font-size: 16px !important;
    line-height: 1 !important;
  }

  .project-card-button .project-stats small {
    margin-top: 2px !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
  }
}

@media (max-width: 760px) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .project-card-button {
    padding: 9px !important;
  }

  .project-card-button .project-stats span {
    min-height: 38px !important;
    padding: 5px 6px !important;
  }
}

@media (max-width: 420px) {
  .project-card-button .project-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
  }

  .project-card-button .project-stats span {
    min-height: 34px !important;
    padding: 4px 5px !important;
  }

  .project-card-button .project-stats strong {
    font-size: 14px !important;
  }

  .project-card-button .project-stats small {
    font-size: 9px !important;
  }
}

/* Firmaraum v5.4.82: geoeffnete Teilprojektseiten ohne Haupt-Tabliste */
.project-only-work-section .section-nav-extra {
  margin-top: 0 !important;
}

.project-only-work-section .project-open-nav {
  border-top: 0 !important;
  padding-top: 0 !important;
}

/* Firmaraum v5.4.84: Chat wirklich unten rechts verankern */
.floating-chat {
  position: fixed !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  bottom: max(12px, env(safe-area-inset-bottom)) !important;
  left: auto !important;
  top: auto !important;
  z-index: 120 !important;
  width: auto !important;
  max-width: calc(100vw - 24px) !important;
}

.floating-chat-collapsed {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: flex-end !important;
}

.floating-chat-toggle {
  margin: 0 !important;
}

.floating-chat-open {
  width: min(360px, calc(100vw - 24px)) !important;
  max-height: min(76dvh, calc(100dvh - 24px)) !important;
  display: flex !important;
  flex-direction: column !important;
  transform-origin: bottom right !important;
}

.floating-chat-open .floating-chat-list {
  max-height: min(420px, calc(100dvh - 230px)) !important;
}

@media (max-width: 480px) {
  .floating-chat {
    right: max(10px, env(safe-area-inset-right)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    max-width: calc(100vw - 20px) !important;
  }

  .floating-chat-open {
    width: calc(100vw - 20px) !important;
  }
}

/* Firmaraum v5.4.85: Projektnamen in der Pfad-Leiste hervorheben */
.context-path .context-crumb-project,
.context-path button.context-crumb-project,
.context-path span.context-crumb-project {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}

.context-path button.context-crumb-project:hover {
  background: #fecaca !important;
  border-color: #f87171 !important;
  color: #b91c1c !important;
}

/* Firmaraum v5.4.86: Mobile-Shell neu geordnet */
@media (max-width: 760px) {
  html,
  body,
  #app {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body:has(#app .top-shell.shell.with-side.side-open) {
    overflow: hidden !important;
  }

  .top-shell.shell.with-side,
  .top-shell.shell.with-side.side-open,
  .top-shell.shell.with-side.side-closed,
  .top-shell.shell.with-side.with-project-rail,
  .top-shell.shell.with-side.with-project-rail.side-open,
  .top-shell.shell.with-side.with-project-rail.side-closed {
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
  }

  .top-shell.shell.with-side.side-open::after {
    z-index: 150 !important;
    background: rgba(9, 11, 17, 0.72) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }

  .top-shell.shell.with-side .content-shell,
  .top-shell.shell.with-side.side-open .content-shell,
  .top-shell.shell.with-side.side-closed .content-shell {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }

  .top-shell.shell.with-side.side-open .content-shell {
    filter: blur(1.5px) !important;
  }

  .top-shell.shell.with-side .app-header-clean {
    position: sticky !important;
    top: 0 !important;
    z-index: 42 !important;
    min-height: 48px !important;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px 58px !important;
    background: rgba(246, 247, 243, 0.96) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
  }

  .app-header-clean .header-title h1 {
    display: none !important;
  }

  .context-path {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-width: 100% !important;
    padding: 0 2px 2px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .context-path::-webkit-scrollbar {
    display: none !important;
  }

  .context-path .context-crumb,
  .context-path button.context-crumb,
  .context-path span.context-crumb {
    flex: 0 0 auto !important;
    max-width: 46vw !important;
    min-height: 28px !important;
    padding: 3px 10px !important;
    font-size: 12px !important;
  }

  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: min(86vw, 330px) !important;
    min-width: min(86vw, 330px) !important;
    max-width: calc(100vw - 28px) !important;
    height: 100dvh !important;
    z-index: 180 !important;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)) !important;
    border-radius: 0 18px 18px 0 !important;
    overflow: hidden !important;
    transform: translate3d(0, 0, 0) !important;
    box-shadow: 22px 0 54px rgba(0, 0, 0, 0.36) !important;
  }

  .top-shell.shell.with-side.side-closed .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-closed .side-menu {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    height: auto !important;
    padding: max(10px, env(safe-area-inset-top)) 0 0 10px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none !important;
  }

  .top-shell.shell.with-side .side-toggle,
  .top-shell.shell.with-side.side-open .side-toggle,
  .top-shell.shell.with-side.side-closed .side-toggle {
    width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    margin: 0 0 10px 0 !important;
    border-radius: 12px !important;
    pointer-events: auto !important;
  }

  .top-shell.shell.with-side .side-panel {
    gap: 8px !important;
    padding: 4px 0 8px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .top-shell.shell.with-side .side-main-nav,
  .top-shell.shell.with-side .side-bottom-nav {
    gap: 8px !important;
  }

  .top-shell.shell.with-side .side-bottom-nav {
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .top-shell.shell.with-side .side-link,
  .top-shell.shell.with-side .side-link.project-shortcut,
  .top-shell.shell.with-side .side-bottom-nav .side-link {
    min-height: 42px !important;
    padding: 9px 12px !important;
    border-radius: 10px !important;
  }

  .top-shell.shell.with-side .side-link strong,
  .top-shell.shell.with-side .side-link.project-shortcut strong,
  .top-shell.shell.with-side .side-bottom-nav .side-link strong {
    font-size: 15px !important;
    line-height: 1.15 !important;
  }

  .top-shell.shell.with-side .side-section-title {
    margin: 14px 12px 6px !important;
    font-size: 11px !important;
    letter-spacing: .08em !important;
  }

  .top-shell.shell.with-side .side-brand-bottom {
    gap: 8px !important;
    padding: 10px 0 0 !important;
    margin-top: 8px !important;
  }

  .top-shell.shell.with-side .side-brand-main {
    display: none !important;
  }

  .top-shell.shell.with-side .side-brand-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .top-shell.shell.with-side .side-brand-meta span {
    min-height: 46px !important;
    padding: 8px !important;
    border-radius: 10px !important;
  }

  .top-shell.shell.with-side .side-status,
  .top-shell.shell.with-side .side-logout {
    min-height: 40px !important;
    border-radius: 10px !important;
  }

  .top-shell.shell.with-side.side-open .side-direct-flyout,
  .top-shell.shell.with-side.with-project-rail.side-open .side-direct-flyout {
    display: none !important;
  }

  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side main.main {
    padding: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system,
  .work-section-system.has-nav-extra {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .section-local-nav,
  .settings-local-nav,
  .project-local-nav,
  .work-section-system.has-nav-extra > .section-local-nav {
    position: sticky !important;
    top: 48px !important;
    z-index: 35 !important;
    display: flex !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    margin: 0 0 8px !important;
    padding: 4px 0 6px !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    background: rgba(246, 247, 243, 0.94) !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .section-local-nav::-webkit-scrollbar,
  .settings-local-nav::-webkit-scrollbar,
  .project-local-nav::-webkit-scrollbar {
    display: none !important;
  }

  .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    min-height: 36px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
  }

  .section-local-content,
  .work-section-system > .section-local-content,
  .settings-local-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  .section-nav-extra {
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 8px !important;
  }

  .section-nav-extra > .panel,
  .nav-extra-panel,
  .work-section-system.has-nav-extra .section-nav-extra,
  .work-section-system.has-nav-extra .section-nav-extra > .panel,
  .work-section-system.has-nav-extra .project-create-panel {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  .project-open-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .project-open-nav .section-nav-extra-label,
  .project-open-nav .project-open-nav-name {
    grid-column: 1 / -1 !important;
  }

  .project-create-panel .panel-header,
  .project-create-panel .panel-body {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .project-create-panel .input,
  .project-create-panel .select,
  .project-create-panel .textarea,
  .project-create-panel .compact-textarea {
    min-height: 38px !important;
    height: auto !important;
    font-size: 14px !important;
  }

  .project-create-panel .textarea,
  .project-create-panel .compact-textarea {
    min-height: 76px !important;
  }

  .project-create-panel .primary {
    min-height: 40px !important;
    height: auto !important;
    font-size: 14px !important;
  }

  .panel,
  .item-card,
  .project-card-button,
  .status-tile {
    border-radius: 10px !important;
  }

  .panel-header {
    min-height: 44px !important;
    padding: 10px 12px !important;
  }

  .panel-body {
    padding: 10px !important;
  }

  .overview-status,
  .project-status-strip,
  .overview-metrics,
  .metrics-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .dashboard-grid,
  .overview-card-grid,
  .project-layout,
  .two-pane,
  .notes-layout,
  .team-grid,
  .team-board,
  .settings-grid,
  .admin-grid,
  .invite-admin-grid,
  .profile-grid,
  .project-main-grid,
  .workspace-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  .floating-chat {
    z-index: 140 !important;
  }
}

@media (max-width: 420px) {
  .top-shell.shell.with-side .side-menu,
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    width: min(88vw, 340px) !important;
    min-width: min(88vw, 340px) !important;
    max-width: calc(100vw - 22px) !important;
  }

  .overview-status,
  .project-status-strip,
  .overview-metrics,
  .metrics-grid,
  .stats-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .project-open-nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .context-path .context-crumb,
  .context-path button.context-crumb,
  .context-path span.context-crumb {
    max-width: 56vw !important;
  }
}

/* Firmaraum v5.4.87: Mobile-Direktzugriff in der Sidebar und Tabs oben */
.mobile-side-direct {
  display: none !important;
}

@media (max-width: 760px) {
  .top-shell.shell.with-side .side-direct-flyout,
  .top-shell.shell.with-side.side-open .side-direct-flyout,
  .top-shell.shell.with-side.side-closed .side-direct-flyout,
  .top-shell.shell.with-side.with-project-rail.side-open .side-direct-flyout {
    display: none !important;
  }

  .top-shell.shell.with-side.side-open .mobile-side-direct {
    display: grid !important;
    gap: 8px !important;
    margin-top: 8px !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  .mobile-side-direct .side-section-title {
    margin: 4px 12px 2px !important;
    color: rgba(245, 247, 250, 0.62) !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
  }

  .mobile-side-direct .side-section-title-sub {
    margin-top: 8px !important;
  }

  .mobile-side-direct .side-quick-grid,
  .mobile-side-direct .side-project-quick-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }

  .mobile-side-direct .side-quick-link,
  .mobile-side-direct .side-link.side-quick-link {
    min-height: 38px !important;
    padding: 8px 12px !important;
    color: rgba(255, 255, 255, 0.88) !important;
    background: rgba(255, 255, 255, 0.055) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
  }

  .mobile-side-direct .side-quick-link strong,
  .mobile-side-direct .side-link.side-quick-link strong {
    color: inherit !important;
    font-size: 14px !important;
  }

  .mobile-side-direct .side-quick-link.active,
  .mobile-side-direct .side-link.side-quick-link.active {
    color: #fff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
  }

  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    width: min(90vw, 360px) !important;
    min-width: min(90vw, 360px) !important;
    max-width: calc(100vw - 14px) !important;
  }

  .top-shell.shell.with-side .side-panel {
    padding-bottom: 12px !important;
  }

  .work-section-system.has-nav-extra > .section-local-nav,
  .project-only-work-section > .section-local-nav,
  .section-local-nav,
  .settings-local-nav,
  .project-local-nav {
    position: static !important;
    top: auto !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
  }

  .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .work-section-system.has-nav-extra .section-nav-extra,
  .project-only-work-section .section-nav-extra,
  .section-nav-extra {
    order: 20 !important;
    flex: 1 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 4px !important;
  }

  .project-only-work-section .section-local-nav {
    margin-bottom: 8px !important;
  }

  .project-only-work-section .project-open-nav,
  .project-open-nav {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .project-open-nav .section-nav-extra-label,
  .project-open-nav .project-open-nav-name {
    grid-column: 1 / -1 !important;
  }

  .project-open-nav .section-nav-button {
    width: 100% !important;
    min-width: 0 !important;
  }

  .work-section-system.has-nav-extra > .section-local-content,
  .project-only-work-section > .section-local-content,
  .section-local-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  .work-section-system.has-nav-extra > .section-local-content > .inline-project-workspace,
  .work-section-system > .section-local-content > .inline-project-workspace,
  .inline-project-workspace {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 420px) {
  .section-nav-button,
  .settings-local-tab,
  .project-local-tab,
  .project-open-nav .section-nav-button {
    flex-basis: 100% !important;
  }

  .project-only-work-section .project-open-nav,
  .project-open-nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Firmaraum v5.4.89: lokale Bereichsnavigation oben */
.section-system,
.work-section-system,
.project-section-system,
.team-section-system,
.profile-section-system,
.friends-section-system,
.settings-page-layout,
.settings-section-system,
.work-section-system.has-nav-extra,
.project-only-work-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

.section-local-nav,
.settings-local-nav,
.project-local-nav,
.work-section-system.has-nav-extra > .section-local-nav,
.project-only-work-section > .section-local-nav {
  position: static !important;
  top: auto !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
}

.section-nav-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.section-nav-row .section-nav-button,
.section-local-nav > .section-nav-button,
.settings-local-tab,
.project-local-tab {
  flex: 0 1 auto !important;
  width: auto !important;
  min-width: 112px !important;
  max-width: 220px !important;
  min-height: 38px !important;
  padding: 0 14px !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.section-nav-dropdown {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.76) !important;
  overflow: hidden !important;
}

.section-nav-dropdown > summary {
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 0 12px !important;
  cursor: pointer !important;
  color: var(--muted) !important;
  font-weight: 900 !important;
  list-style: none !important;
  user-select: none !important;
}

.section-nav-dropdown > summary::-webkit-details-marker {
  display: none !important;
}

.section-nav-dropdown > summary::after {
  content: "⌄" !important;
  color: var(--muted) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  transition: transform 160ms ease !important;
}

.section-nav-dropdown[open] > summary::after {
  transform: rotate(180deg) !important;
}

.section-nav-dropdown .section-nav-extra,
.work-section-system.has-nav-extra .section-nav-extra,
.project-only-work-section .section-nav-extra {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 10px 10px !important;
  order: initial !important;
}

.section-nav-dropdown .section-nav-extra > .panel,
.work-section-system.has-nav-extra .section-nav-extra > .panel,
.work-section-system.has-nav-extra .project-create-panel {
  width: min(440px, 100%) !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.section-nav-extra-group,
.project-open-nav,
.project-only-work-section .project-open-nav {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr)) !important;
  gap: 8px !important;
  width: min(680px, 100%) !important;
  max-width: 100% !important;
}

.project-open-nav .section-nav-extra-label,
.project-open-nav .project-open-nav-name {
  grid-column: 1 / -1 !important;
}

.project-open-nav .section-nav-button {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

.section-local-content,
.work-section-system.has-nav-extra > .section-local-content,
.project-only-work-section > .section-local-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

@media (max-width: 760px) {
  .section-system,
  .work-section-system,
  .project-section-system,
  .team-section-system,
  .profile-section-system,
  .friends-section-system,
  .settings-page-layout,
  .settings-section-system,
  .work-section-system.has-nav-extra,
  .project-only-work-section {
    gap: 8px !important;
  }

  .section-nav-row {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 4px !important;
    scroll-snap-type: x proximity !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .section-nav-row::-webkit-scrollbar {
    display: none !important;
  }

  .section-nav-row .section-nav-button,
  .section-local-nav > .section-nav-button,
  .settings-local-tab,
  .project-local-tab {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    max-width: min(70vw, 220px) !important;
    scroll-snap-align: start !important;
  }

  .section-nav-dropdown > summary {
    min-height: 36px !important;
  }

  .section-nav-extra-group,
  .project-open-nav,
  .project-only-work-section .project-open-nav {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }
}


/* Firmaraum v5.4.90: lokale Navigation im Breadcrumb-Dropdown */
.app-header-clean,
.top-shell.shell.with-side .app-header-clean,
.profile-shell .app-header-clean {
  overflow: visible !important;
  position: relative !important;
  z-index: 58 !important;
}

.app-header-clean .header-title,
.context-path {
  overflow: visible !important;
}

.section-system,
.work-section-system,
.project-section-system,
.team-section-system,
.profile-section-system,
.friends-section-system,
.settings-page-layout,
.settings-section-system,
.work-section-system.has-nav-extra,
.project-only-work-section {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  gap: 0 !important;
}

.section-system > .section-local-nav,
.work-section-system > .section-local-nav,
.project-section-system > .section-local-nav,
.team-section-system > .section-local-nav,
.profile-section-system > .section-local-nav,
.friends-section-system > .section-local-nav,
.settings-page-layout > .section-local-nav,
.work-section-system.has-nav-extra > .section-local-nav,
.project-only-work-section > .section-local-nav {
  display: none !important;
}

.section-local-content,
.work-section-system.has-nav-extra > .section-local-content,
.project-only-work-section > .section-local-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.context-menu-wrap {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.context-menu-trigger {
  cursor: pointer !important;
}

.context-menu-wrap.menu-open > .context-menu-trigger {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16) !important;
}

.context-menu-panel {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  z-index: 120 !important;
  width: min(520px, calc(100vw - 24px)) !important;
  min-width: min(320px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 620px) !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
  padding: 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  box-shadow: 0 18px 46px rgba(20, 22, 28, 0.16) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.context-menu-tabs {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.context-menu-panel .section-nav-button,
.context-menu-panel .settings-local-tab,
.context-menu-panel .project-local-tab {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.context-menu-extra {
  display: grid !important;
  gap: 9px !important;
  margin-top: 9px !important;
  padding-top: 9px !important;
  border-top: 1px solid var(--line) !important;
}

.context-menu-tabs:empty + .context-menu-extra,
.context-menu-extra:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: 0 !important;
}

.context-menu-extra .section-nav-extra,
.context-menu-extra .section-nav-extra > .panel,
.context-menu-extra .project-create-panel,
.context-menu-extra .nav-extra-panel {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.context-menu-extra .section-nav-extra-group,
.context-menu-extra .project-open-nav {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
  gap: 7px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.context-menu-extra .project-open-nav .section-nav-extra-label,
.context-menu-extra .project-open-nav .project-open-nav-name {
  grid-column: 1 / -1 !important;
}

.context-menu-extra .project-open-nav .section-nav-button {
  width: 100% !important;
  max-width: none !important;
}

@media (max-width: 760px) {
  .app-header-clean,
  .top-shell.shell.with-side .app-header-clean,
  .profile-shell .app-header-clean {
    z-index: 95 !important;
  }

  .context-path {
    overflow: visible !important;
    max-width: 100% !important;
  }

  .context-menu-panel {
    position: fixed !important;
    top: 98px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: calc(100vh - 118px) !important;
    max-height: calc(100dvh - 118px) !important;
  }

  .context-menu-tabs,
  .context-menu-extra .section-nav-extra-group,
  .context-menu-extra .project-open-nav {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Firmaraum v5.4.91: einheitliches breites Inhaltslayout */
:root {
  --fr-content-wide: 1440px;
  --fr-content-gap: clamp(12px, 1.4vw, 18px);
  --fr-panel-pad: clamp(12px, 1.45vw, 18px);
}

.top-shell.shell.with-side .main,
.top-shell.shell.with-side main.main,
.profile-shell .main,
.profile-shell main.main {
  max-width: min(var(--fr-content-wide), 100%) !important;
  padding: clamp(12px, 1.6vw, 24px) !important;
}

.section-local-content,
.work-section-system > .section-local-content,
.project-section-system > .section-local-content,
.team-section-system > .section-local-content,
.profile-section-system > .section-local-content,
.friends-section-system > .section-local-content,
.settings-page-layout > .section-local-content {
  display: grid !important;
  gap: var(--fr-content-gap) !important;
  align-content: start !important;
}

.panel {
  border-radius: 10px !important;
}

.panel-header {
  min-height: 52px !important;
  padding: 12px var(--fr-panel-pad) !important;
}

.panel-body {
  padding: var(--fr-panel-pad) !important;
}

.overview-top-grid,
.overview-clean-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .9fr) !important;
  gap: var(--fr-content-gap) !important;
  align-items: stretch !important;
}

.dashboard-grid,
.overview-card-grid,
.overview-clean-cards.dashboard-grid,
.admin-grid,
.settings-grid,
.settings-grid-wide,
.team-grid,
.project-layout,
.project-layout-wide {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--fr-content-gap) !important;
  align-items: start !important;
}

.overview-status,
.project-status-strip,
.project-stats,
.overview-metrics {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 10px !important;
}

.two-pane,
.notes-layout {
  display: grid !important;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) !important;
  gap: var(--fr-content-gap) !important;
  align-items: stretch !important;
}

.list-pane,
.editor-pane,
.plan-board,
.team-members-panel,
.team-info-panel,
.profile-projects-panel,
.friends-list-panel,
.activity-panel {
  min-width: 0 !important;
}

.list-pane,
.editor-pane {
  max-height: none !important;
}

.list-scroll {
  max-height: min(68vh, 760px) !important;
}

.note-simple-editor,
.editor-body {
  min-height: min(62vh, 720px) !important;
}

.note-body-input {
  min-height: min(48vh, 560px) !important;
}

.plan-toolbar,
.plan-board .panel-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
}

.plan-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 7px !important;
  margin-top: 8px !important;
}

.plan-task-form,
.task-edit-form {
  display: grid !important;
  grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(145px, .8fr)) !important;
  gap: 10px !important;
  align-items: end !important;
}

.plan-details-field,
.plan-task-form > button {
  grid-column: 1 / -1 !important;
}

.task-row {
  grid-template-columns: 42px minmax(0, 1fr) minmax(220px, auto) !important;
  gap: 12px !important;
}

.file-grid,
.files-grid,
.project-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  gap: 12px !important;
}

.file-card,
.project-card,
.account-project-card {
  min-width: 0 !important;
}

.upload-zone {
  display: grid !important;
  grid-template-columns: minmax(260px, 1fr) auto !important;
  gap: 12px !important;
  align-items: end !important;
  margin-bottom: 14px !important;
}

.team-section-system .panel,
.friends-section-system .panel,
.settings-page-layout .panel,
.profile-section-system .panel {
  width: 100% !important;
  max-width: 100% !important;
}

.member-row,
.member-admin-row,
.group-card,
.info-card,
.item-card {
  min-width: 0 !important;
}

.item-meta,
.button-row,
.form-actions {
  flex-wrap: wrap !important;
}

@media (min-width: 1280px) {
  .dashboard-grid,
  .overview-card-grid,
  .overview-clean-cards.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .project-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
  }

  .file-grid,
  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  }
}

@media (max-width: 1100px) {
  .overview-top-grid,
  .overview-clean-grid,
  .dashboard-grid,
  .overview-card-grid,
  .overview-clean-cards.dashboard-grid,
  .admin-grid,
  .settings-grid,
  .settings-grid-wide,
  .team-grid,
  .project-layout,
  .project-layout-wide {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .two-pane,
  .notes-layout {
    grid-template-columns: minmax(260px, 34%) minmax(0, 1fr) !important;
  }

  .plan-task-form,
  .task-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .top-shell.shell.with-side .main,
  .top-shell.shell.with-side main.main,
  .profile-shell .main,
  .profile-shell main.main {
    padding: 10px !important;
  }

  .two-pane,
  .notes-layout,
  .upload-zone,
  .task-row,
  .member-admin-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .overview-status,
  .project-status-strip,
  .project-stats,
  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .plan-task-form,
  .task-edit-form,
  .file-grid,
  .files-grid,
  .project-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .task-controls,
  .file-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  .list-scroll,
  .note-simple-editor,
  .editor-body,
  .note-body-input {
    max-height: none !important;
    min-height: 260px !important;
  }
}

@media (max-width: 430px) {
  .overview-status,
  .project-status-strip,
  .project-stats,
  .overview-metrics {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Firmaraum v5.4.92: Breadcrumb-Dropdown neutral wie Seitenleisten-Flyout */
.context-menu-panel {
  width: min(340px, calc(100vw - 24px)) !important;
  min-width: min(240px, calc(100vw - 24px)) !important;
  padding: 10px !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 46px rgba(20, 22, 28, 0.16) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

.context-menu-tabs {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px !important;
}

.context-menu-panel .section-nav-button,
.context-menu-panel .settings-local-tab,
.context-menu-panel .project-local-tab {
  justify-content: flex-start !important;
  width: 100% !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 10px !important;
  color: var(--text) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  text-align: left !important;
  font-weight: 850 !important;
}

.context-menu-panel .section-nav-button:hover,
.context-menu-panel .settings-local-tab:hover,
.context-menu-panel .project-local-tab:hover,
.context-menu-panel .section-nav-button.active,
.context-menu-panel .settings-local-tab.active,
.context-menu-panel .project-local-tab.active {
  color: #fff !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  box-shadow: none !important;
  transform: none !important;
}

.context-menu-extra {
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid var(--line) !important;
}

.context-menu-extra .section-nav-extra-label {
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
}

.context-menu-extra .project-open-nav-name {
  color: var(--text) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

.context-menu-extra .section-nav-extra-group,
.context-menu-extra .project-open-nav {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px !important;
}

.context-menu-extra .panel,
.context-menu-extra .nav-extra-panel,
.context-menu-extra .project-create-panel {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.context-menu-extra .panel-header {
  min-height: 40px !important;
  padding: 9px 10px !important;
}

.context-menu-extra .panel-body {
  padding: 10px !important;
}

@media (max-width: 760px) {
  .context-menu-panel {
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}


/* Firmaraum v5.4.93: Breadcrumb-Dropdown als Doppel-Pill */
.context-menu-wrap {
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  padding: 2px !important;
  background: transparent !important;
}

.context-menu-wrap.menu-open {
  border-color: #bfdbfe !important;
  background: #dbeafe !important;
}

.context-menu-wrap.menu-open > .context-menu-trigger,
.context-menu-trigger[aria-expanded="true"] {
  min-height: 28px !important;
  padding: 2px 13px !important;
  color: var(--blue) !important;
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.45) !important;
  transform: none !important;
}

.context-menu-panel .section-nav-button:hover,
.context-menu-panel .settings-local-tab:hover,
.context-menu-panel .project-local-tab:hover,
.context-menu-panel .section-nav-button.active,
.context-menu-panel .settings-local-tab.active,
.context-menu-panel .project-local-tab.active {
  color: var(--blue) !important;
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.38) !important;
  transform: none !important;
}


/* Firmaraum v5.4.94: Team-Unterbereiche direkt in der Pfadleiste */
.context-path .context-crumb-current,
.context-path button.context-crumb-current,
.context-path span.context-crumb-current {
  color: var(--blue) !important;
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px #dbeafe, inset 0 0 0 1px rgba(147, 197, 253, 0.45) !important;
  transform: none !important;
}

.context-path button.context-crumb-current:hover {
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px #dbeafe, inset 0 0 0 1px rgba(147, 197, 253, 0.55) !important;
}


/* Firmaraum v5.4.95: Menuebutton-Schatten weich ausblenden */
.top-shell.shell.with-side .side-toggle,
.top-shell.shell.with-side.side-open .side-toggle,
.top-shell.shell.with-side.side-closed .side-toggle,
.top-shell.shell.with-side.with-project-rail .side-toggle {
  position: fixed !important;
  overflow: visible !important;
  isolation: isolate !important;
  background: linear-gradient(145deg, #262a34 0%, #151920 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(7, 9, 13, 0.16) !important;
}

.top-shell.shell.with-side .side-toggle::before,
.top-shell.shell.with-side.side-open .side-toggle::before,
.top-shell.shell.with-side.side-closed .side-toggle::before,
.top-shell.shell.with-side.with-project-rail .side-toggle::before {
  content: "" !important;
  position: absolute !important;
  inset: -14px -18px -16px -16px !important;
  z-index: -1 !important;
  pointer-events: none !important;
  border-radius: 24px !important;
  background:
    radial-gradient(circle at 45% 42%, rgba(12, 15, 21, 0.16) 0%, rgba(12, 15, 21, 0.09) 44%, rgba(12, 15, 21, 0.00) 76%) !important;
  filter: blur(2px) !important;
  opacity: 0.9 !important;
}

.top-shell.shell.with-side .side-toggle::after,
.top-shell.shell.with-side.side-open .side-toggle::after,
.top-shell.shell.with-side.side-closed .side-toggle::after,
.top-shell.shell.with-side.with-project-rail .side-toggle::after {
  content: "" !important;
  position: absolute !important;
  inset: -1px !important;
  z-index: -1 !important;
  pointer-events: none !important;
  border-radius: inherit !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.00)) !important;
}


/* Firmaraum v5.4.96: Haupt-Seitenleiste im hellen Flyout-Stil */
.top-shell.shell.with-side.side-open .side-menu,
.top-shell.shell.with-side.with-project-rail.side-open .side-menu {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  left: max(14px, env(safe-area-inset-left)) !important;
  bottom: max(14px, env(safe-area-inset-bottom)) !important;
  width: min(236px, calc(100vw - 28px)) !important;
  min-width: min(236px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100dvh - 28px) !important;
  padding: 14px !important;
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 22px 54px rgba(20, 22, 28, 0.18) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  overflow: hidden !important;
}

.top-shell.shell.with-side.side-open .side-panel,
.top-shell.shell.with-side.with-project-rail.side-open .side-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 48px 0 0 !important;
  padding: 0 2px 2px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.top-shell.shell.with-side.side-open .side-main-nav,
.top-shell.shell.with-side.side-open .side-bottom-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-main-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
}

.top-shell.shell.with-side.side-open .side-bottom-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav {
  margin-top: auto !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--line) !important;
}

.top-shell.shell.with-side.side-open .side-section-title,
.top-shell.shell.with-side.with-project-rail.side-open .side-section-title {
  margin: 8px 2px 3px !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

.top-shell.shell.with-side.side-open .side-link,
.top-shell.shell.with-side.side-open .side-link.project-shortcut,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link,
.top-shell.shell.with-side.with-project-rail.side-open .side-link,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  grid-template-columns: none !important;
  width: 100% !important;
  min-height: 42px !important;
  height: 42px !important;
  padding: 0 14px !important;
  color: var(--text) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  text-align: left !important;
}

.top-shell.shell.with-side.side-open .side-link strong,
.top-shell.shell.with-side.side-open .side-link.project-shortcut strong,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-link strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link strong {
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

.top-shell.shell.with-side.side-open .side-link:hover,
.top-shell.shell.with-side.side-open .side-link.active,
.top-shell.shell.with-side.side-open .side-link.project-shortcut.active,
.top-shell.shell.with-side.side-open .side-link.project-rail-source.active,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-link:hover,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-rail-source.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link.active {
  color: #fff !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  box-shadow: none !important;
  transform: none !important;
}

.top-shell.shell.with-side.side-open .side-brand-bottom,
.top-shell.shell.with-side.with-project-rail.side-open .side-brand-bottom {
  color: var(--text) !important;
  background: transparent !important;
  border-top: 1px solid var(--line) !important;
}

.top-shell.shell.with-side.side-open .side-brand-meta span,
.top-shell.shell.with-side.side-open .side-bottom-actions > *,
.top-shell.shell.with-side.with-project-rail.side-open .side-brand-meta span,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-actions > * {
  color: var(--text) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  box-shadow: none !important;
}

.top-shell.shell.with-side.side-open .side-logout,
.top-shell.shell.with-side.with-project-rail.side-open .side-logout {
  color: var(--text) !important;
  background: #fff !important;
}

.top-shell.shell.with-side.side-open .side-direct-flyout,
.top-shell.shell.with-side.with-project-rail.side-open .side-direct-flyout {
  left: calc(max(14px, env(safe-area-inset-left)) + min(236px, calc(100vw - 28px)) + 10px) !important;
}

@media (max-width: 520px) {
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    top: max(10px, env(safe-area-inset-top)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: min(86vw, 330px) !important;
    min-width: min(86vw, 330px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 12px !important;
  }
}


/* Firmaraum v5.4.105: Projektchip klappt rechte Header-Leiste ein */
.context-path {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.context-trail {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
  transform-origin: left center !important;
  transition:
    opacity 180ms ease,
    max-width 220ms cubic-bezier(.2, .8, .2, 1),
    transform 220ms cubic-bezier(.2, .8, .2, 1),
    filter 180ms ease,
    margin 220ms cubic-bezier(.2, .8, .2, 1) !important;
}

.context-path.trail-collapsed .context-trail {
  opacity: 0 !important;
  max-width: 0 !important;
  margin-left: -8px !important;
  overflow: hidden !important;
  pointer-events: none !important;
  filter: blur(2px) !important;
  transform: translateX(-18px) translateY(2px) scale(.72) !important;
}

.context-crumb-fold-toggle {
  cursor: pointer !important;
  position: relative !important;
}

.context-crumb-fold-toggle.trail-collapsed {
  box-shadow: 0 0 0 3px rgba(254, 202, 202, 0.64), inset 0 0 0 1px rgba(248, 113, 113, 0.26) !important;
}

.context-inline-tab {
  flex: 0 0 auto !important;
}

.context-path .context-inline-tab.context-crumb-current,
.context-path button.context-inline-tab.context-crumb-current {
  color: var(--blue) !important;
  background: #eef6ff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px #dbeafe, inset 0 0 0 1px rgba(147, 197, 253, 0.45) !important;
}

@media (max-width: 640px) {
  .context-path {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .context-trail {
    flex-wrap: nowrap !important;
  }
}


/* Firmaraum v5.4.107: Sidebar-Navigation wieder sichtbar halten */
.top-shell.shell.with-side .side-brand-bottom,
.top-shell.shell.with-side .side-brand-main,
.top-shell.shell.with-side .side-brand-meta,
.top-shell.shell.with-side .side-bottom-actions,
.top-shell.shell.with-side .side-logo,
.top-shell.shell.with-side .side-logo-img {
  display: none !important;
}

.top-shell.shell.with-side.side-open .side-menu,
.top-shell.shell.with-side.with-project-rail.side-open .side-menu {
  overflow: hidden !important;
}

.top-shell.shell.with-side.side-open .side-panel,
.top-shell.shell.with-side.with-project-rail.side-open .side-panel {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  height: calc(100% - 52px) !important;
  max-height: calc(100dvh - 90px) !important;
  min-height: 0 !important;
  margin: 52px 0 0 !important;
  padding: 0 2px 2px !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.top-shell.shell.with-side.side-open .side-main-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-main-nav {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 2px 0 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.top-shell.shell.with-side.side-open .side-bottom-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  margin-top: 0 !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--line) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.top-shell.shell.with-side.side-open .side-section-title,
.top-shell.shell.with-side.with-project-rail.side-open .side-section-title {
  display: block !important;
  margin: 6px 2px 2px !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.top-shell.shell.with-side.side-open .side-link,
.top-shell.shell.with-side.side-open .side-link.project-shortcut,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link,
.top-shell.shell.with-side.with-project-rail.side-open .side-link,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  height: 42px !important;
  max-height: none !important;
  padding: 0 14px !important;
  color: var(--text) !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  text-align: left !important;
}

.top-shell.shell.with-side.side-open .side-link strong,
.top-shell.shell.with-side.side-open .side-link.project-shortcut strong,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-link strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut strong,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link strong {
  display: block !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.top-shell.shell.with-side.side-open .side-link:hover,
.top-shell.shell.with-side.side-open .side-link.active,
.top-shell.shell.with-side.side-open .side-link.project-shortcut.active,
.top-shell.shell.with-side.side-open .side-bottom-nav .side-link.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-link:hover,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut.active,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav .side-link.active {
  color: #fff !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

.top-shell.shell.with-side.side-open .mobile-side-direct,
.top-shell.shell.with-side.with-project-rail.side-open .mobile-side-direct {
  display: none !important;
}

@media (max-width: 760px) {
  .top-shell.shell.with-side.side-open .side-panel,
  .top-shell.shell.with-side.with-project-rail.side-open .side-panel {
    height: calc(100% - 50px) !important;
    max-height: calc(100dvh - 78px) !important;
    margin-top: 50px !important;
  }

  .top-shell.shell.with-side.side-open .mobile-side-direct,
  .top-shell.shell.with-side.with-project-rail.side-open .mobile-side-direct {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 8px !important;
    padding-top: 10px !important;
    border-top: 1px solid var(--line) !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .top-shell.shell.with-side.side-open .mobile-side-direct .side-quick-grid,
  .top-shell.shell.with-side.side-open .mobile-side-direct .side-project-quick-grid,
  .top-shell.shell.with-side.with-project-rail.side-open .mobile-side-direct .side-quick-grid,
  .top-shell.shell.with-side.with-project-rail.side-open .mobile-side-direct .side-project-quick-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
  }
}


/* Firmaraum v5.4.108: Neue Info im Infos-Bereich */
.team-info-stack {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: var(--fr-content-gap, 14px) !important;
  width: 100% !important;
  min-width: 0 !important;
}

.team-info-stack .team-new-info {
  width: 100% !important;
  max-width: 100% !important;
}


/* Firmaraum v5.4.109: Sidebar als echtes hohes Flyout */
.top-shell.shell.with-side.side-open .side-menu,
.top-shell.shell.with-side.with-project-rail.side-open .side-menu {
  position: fixed !important;
  top: max(14px, env(safe-area-inset-top)) !important;
  left: max(14px, env(safe-area-inset-left)) !important;
  bottom: auto !important;
  width: min(236px, calc(100vw - 28px)) !important;
  min-width: min(236px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  height: calc(100dvh - 28px) !important;
  min-height: min(520px, calc(100dvh - 28px)) !important;
  max-height: calc(100dvh - 28px) !important;
  padding: 14px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.top-shell.shell.with-side.side-open .side-panel,
.top-shell.shell.with-side.with-project-rail.side-open .side-panel {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 52px 0 0 !important;
  padding: 0 2px 2px !important;
  overflow: hidden !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.top-shell.shell.with-side.side-open .side-main-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-main-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

.top-shell.shell.with-side.side-open .side-bottom-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-bottom-nav {
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

.top-shell.shell.with-side.side-open .side-direct-flyout,
.top-shell.shell.with-side.with-project-rail.side-open .side-direct-flyout {
  top: max(92px, calc(env(safe-area-inset-top) + 92px)) !important;
  left: calc(max(14px, env(safe-area-inset-left)) + min(236px, calc(100vw - 28px)) + 12px) !important;
  max-height: calc(100dvh - 114px) !important;
  overflow-y: auto !important;
}

@media (max-width: 760px) {
  .top-shell.shell.with-side.side-open .side-menu,
  .top-shell.shell.with-side.with-project-rail.side-open .side-menu {
    top: max(10px, env(safe-area-inset-top)) !important;
    left: max(10px, env(safe-area-inset-left)) !important;
    width: min(86vw, 330px) !important;
    min-width: min(86vw, 330px) !important;
    max-width: calc(100vw - 20px) !important;
    height: calc(100dvh - 20px) !important;
    min-height: min(480px, calc(100dvh - 20px)) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 12px !important;
  }

  .top-shell.shell.with-side.side-open .side-panel,
  .top-shell.shell.with-side.with-project-rail.side-open .side-panel {
    margin-top: 50px !important;
  }
}


/* Firmaraum v5.4.110: Sidebar-Projekte laufen von oben */
.top-shell.shell.with-side.side-open .side-main-nav,
.top-shell.shell.with-side.with-project-rail.side-open .side-main-nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  align-content: flex-start !important;
  gap: 8px !important;
}

.top-shell.shell.with-side.side-open .side-main-nav > *,
.top-shell.shell.with-side.with-project-rail.side-open .side-main-nav > * {
  flex: 0 0 auto !important;
}

.top-shell.shell.with-side.side-open .side-link.project-shortcut,
.top-shell.shell.with-side.with-project-rail.side-open .side-link.project-shortcut {
  margin: 0 !important;
}


/* Firmaraum v5.4.111: Einladungsformular wiederherstellen */
.invite-create-form {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
  gap: 10px !important;
  align-items: end !important;
}

.invite-create-form > button {
  min-height: 42px !important;
}


/* Firmaraum v5.4.112: Teilprojekt-Erstellung im Listenbereich */
.project-list-header {
  align-items: center !important;
}

.project-list-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
}

.project-create-toggle {
  min-height: 34px !important;
  padding: 0 14px !important;
}

.project-list-body {
  gap: 14px !important;
}

.project-inline-create-form {
  display: grid !important;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, .8fr) minmax(160px, .8fr) auto !important;
  gap: 10px !important;
  align-items: end !important;
  padding: 12px !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
}

.project-inline-create-form .project-inline-description {
  grid-column: 1 / -1 !important;
}

.project-inline-create-form > button {
  min-height: 42px !important;
}

@media (max-width: 900px) {
  .project-inline-create-form {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
  }

  .project-inline-create-form .project-inline-description {
    grid-column: 1 / -1 !important;
  }
}


/* Firmaraum v5.4.113: Projekt-Erstellung in der Sidebar */
.top-shell.shell.with-side.side-open .side-project-create-toggle,
.top-shell.shell.with-side.with-project-rail.side-open .side-project-create-toggle {
  color: var(--text) !important;
  background: #fff !important;
  border-style: dashed !important;
}

.top-shell.shell.with-side.side-open .side-project-create-toggle:hover,
.top-shell.shell.with-side.with-project-rail.side-open .side-project-create-toggle:hover {
  color: #fff !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

.side-project-create-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  padding: 10px !important;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
}

.side-project-create-form .input,
.side-project-create-form .textarea {
  width: 100% !important;
  min-width: 0 !important;
  font-size: 13px !important;
}

.side-project-create-form .textarea {
  min-height: 70px !important;
}

.side-project-create-form .primary {
  min-height: 38px !important;
  width: 100% !important;
}

.side-empty-note {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 8px 2px !important;
}


/* Firmaraum v5.4.114: Team-Unterseiten dunkelblau */
.context-path .context-crumb-team-sub,
.context-path button.context-crumb-team-sub,
.context-path span.context-crumb-team-sub {
  color: #1e3a8a !important;
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16) !important;
}

.context-path button.context-crumb-team-sub:hover {
  color: #fff !important;
  background: #1e3a8a !important;
  border-color: #1e3a8a !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.14) !important;
}

.context-path .context-crumb-team-sub.context-crumb-current,
.context-path button.context-crumb-team-sub.context-crumb-current,
.context-path span.context-crumb-team-sub.context-crumb-current,
.context-path button.context-crumb-team-sub.context-crumb-current:hover {
  color: #fff !important;
  background: #1e3a8a !important;
  border-color: #172554 !important;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}


/* Firmaraum v5.4.115: Teilprojekt-Einstellungen mit Einladungen */
.project-settings-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px) !important;
  gap: var(--fr-content-gap, 14px) !important;
  align-items: start !important;
}

.project-settings-form,
.project-invite-form {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
  gap: 10px !important;
  align-items: end !important;
}

.project-settings-form > button,
.project-invite-form > button {
  min-height: 42px !important;
}

.project-invite-list {
  gap: 8px !important;
}

.project-invite-card {
  grid-template-columns: minmax(0, 1fr) auto !important;
}

@media (max-width: 980px) {
  .project-settings-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Firmaraum v5.4.116: Mitarbeiter in Teilprojekt-Einstellungen */
.project-members-panel {
  grid-column: 1 / -1 !important;
}

.project-member-row {
  grid-template-columns: 38px minmax(0, 1fr) minmax(130px, 170px) !important;
}

@media (max-width: 700px) {
  .project-member-row {
    grid-template-columns: 34px minmax(0, 1fr) !important;
  }

  .project-member-row .select,
  .project-member-row .badge {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }
}


/* Firmaraum v5.4.117: Breadcrumb-Dropdown oeffnet seitlich */
@media (min-width: 761px) {
  .context-menu-panel {
    top: 0 !important;
    left: calc(100% + 8px) !important;
    right: auto !important;
    transform: none !important;
    max-height: min(80vh, 620px) !important;
  }
}

@media (max-width: 760px) {
  .context-menu-panel {
    transform: none !important;
  }
}
