:root {
  --portal-green: #0b5d3b;
  --portal-green-dark: #073f2a;
  --portal-red: #b4232d;
  --portal-navy: #06213f;
  --portal-lime: #dcedc7;
  --portal-ink: #17201b;
  --portal-muted: #627068;
  --portal-surface: #ffffff;
  --portal-canvas: #f6f4ee;
  --portal-line: #dce3dc;
  --portal-warning: #8d4c00;
}

body {
  background: var(--portal-canvas);
  color: var(--portal-ink);
}

.portal-scroll-region {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.portal-action-row {
  max-width: 100%;
}

.portal-action-row .btn {
  white-space: normal;
}

.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 3px solid var(--portal-red);
  background: linear-gradient(105deg, var(--portal-green-dark) 0%, var(--portal-green) 68%, var(--portal-navy) 100%) !important;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: .65rem;
  min-width: 0;
  margin-right: 1.35rem;
  padding-block: .35rem;
  color: white;
  text-decoration: none;
}

.portal-brand:hover,
.portal-brand:focus-visible {
  color: white;
}

.portal-brand-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 10px;
}

.portal-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.08;
}

.portal-brand-name {
  color: white;
  font-size: 1rem;
  font-weight: 750;
  white-space: nowrap;
}

.portal-brand-name-short {
  display: none;
}

.portal-brand-subtitle {
  margin-top: .18rem;
  color: rgb(255 255 255 / 82%);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .035em;
}

.app-navbar .nav-link {
  border-radius: .38rem;
  color: rgb(255 255 255 / 88%);
  font-size: .86rem;
  padding-inline: .45rem !important;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus-visible {
  background: rgb(255 255 255 / 12%);
  color: white;
}

.app-navbar button.nav-link {
  border: 0;
  background: transparent;
}

.app-navbar .dropdown-menu {
  max-width: min(26rem, calc(100vw - 1rem));
}

.app-navbar .dropdown-item {
  white-space: normal;
}

.login-brand-icon {
  display: block;
  width: 72px;
  height: 72px;
  border-radius: 16px;
}

.login-brand-subtitle {
  margin: -.2rem 0 .8rem;
  color: var(--portal-green);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1120px;
  margin: 0 auto 1.75rem;
}

.portal-page-heading h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.15rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.portal-page-heading p:not(.portal-eyebrow) {
  margin: .65rem 0 0;
  color: var(--portal-muted);
}

.portal-eyebrow {
  margin: 0 0 .45rem;
  color: var(--portal-green);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.portal-heading-actions {
  align-items: center;
}

.portal-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto;
}

.portal-dashboard-card {
  grid-column: span 4;
  min-height: 170px;
  padding: 1.35rem;
  border: 1px solid var(--portal-line);
  border-radius: 1.15rem;
  background: var(--portal-surface);
  box-shadow: 0 10px 34px rgb(7 63 42 / 7%);
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: end;
  transition: transform .16s ease, box-shadow .16s ease;
}

.portal-dashboard-card:hover,
.portal-dashboard-card:focus-visible {
  color: inherit;
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgb(7 63 42 / 13%);
}

.portal-dashboard-card strong {
  margin: .45rem 0 .2rem;
  font-size: 1.18rem;
}

.portal-dashboard-card span:last-child {
  color: var(--portal-muted);
}

.portal-dashboard-card.portal-card-has-new {
  border-color: var(--portal-green);
  box-shadow: 0 10px 34px rgb(7 63 42 / 16%);
}

.portal-task-today {
  display: flex;
  align-items: baseline;
  gap: .35rem;
  margin-top: .35rem;
  color: var(--portal-text) !important;
  font-size: 1rem;
  font-weight: 700;
}

.portal-task-today strong {
  margin: 0;
  color: var(--portal-green-dark);
  font-size: 2.2rem;
  line-height: 1;
}

.portal-task-secondary {
  color: var(--portal-muted) !important;
  font-size: .78rem;
}

.portal-task-preview {
  display: grid;
  gap: .2rem;
  margin: .5rem 0 0;
  padding: .45rem 0 0;
  border-top: 1px solid var(--portal-line);
  list-style: none;
}

.portal-task-preview li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  font-size: .78rem;
}

.portal-task-preview li > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-task-preview small {
  flex: 0 0 auto;
  color: var(--portal-muted);
}

.portal-card-new-badge {
  display: inline-block;
  margin-left: .4rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  background: var(--portal-green-dark);
  color: #fff !important;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: none;
}

.portal-card-shift {
  grid-column: span 8;
  color: white;
  background: linear-gradient(125deg, var(--portal-green-dark), var(--portal-green));
}

.portal-card-shift:hover,
.portal-card-shift:focus-visible {
  color: white;
}

.portal-card-shift span:last-child {
  color: rgb(255 255 255 / 75%);
}

/* HOTFIX BEGIN: dashboard-shift-fluid-text-2026-08-03 */

/*
 * Die Schrift richtet sich nach der tatsächlichen Breite der grünen
 * Schichtkarte. cqi entspricht einem Prozent der Kartenbreite.
 */
.portal-dashboard-card.portal-card-shift {
  container-name: dashboard-shift-card;
  container-type: inline-size;
}

@media (min-width: 801px) {
  .portal-dashboard-card.portal-card-shift {
    padding: clamp(1.3rem, 4cqi, 2rem) !important;
  }

  .portal-dashboard-card.portal-card-shift .portal-card-kicker {
    font-size: clamp(.95rem, 3.6cqi, 1.4rem) !important;
    font-weight: 750 !important;
    letter-spacing: .08em !important;
    line-height: 1.2 !important;
  }

  .portal-dashboard-card.portal-card-shift > strong {
    font-size: clamp(1.8rem, 9cqi, 3.6rem) !important;
    font-weight: 780 !important;
    line-height: 1.06 !important;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }

  .portal-dashboard-card.portal-card-shift > span:last-child {
    font-size: clamp(1.1rem, 5.4cqi, 2rem) !important;
    font-weight: 680 !important;
    line-height: 1.2 !important;
  }
}

/* HOTFIX END: dashboard-shift-fluid-text-2026-08-03 */

.portal-time-dashboard-card {
  justify-content: flex-start;
  gap: .35rem;
}

.time-dashboard-actions,
.portal-admin-heading-actions,
.portal-quick-filters,
.portal-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
}

.portal-time-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .65rem;
  max-width: 1120px;
  margin: 0 auto 1rem;
}

.portal-time-stat-grid article {
  padding: .8rem;
  border: 1px solid var(--portal-line);
  border-radius: .75rem;
  background: var(--portal-surface);
}

.portal-time-stat-grid span,
.portal-time-stat-grid strong {
  display: block;
}

.portal-time-stat-grid span {
  color: var(--portal-muted);
  font-size: .78rem;
}

.portal-time-stat-grid strong {
  margin-top: .2rem;
  font-size: 1.15rem;
}

.portal-quick-filters {
  max-width: 1120px;
  margin: 0 auto .75rem;
}

.portal-quick-filters a {
  padding: .38rem .65rem;
  border: 1px solid var(--portal-line);
  border-radius: 999px;
  background: var(--portal-surface);
  color: inherit;
  font-size: .86rem;
  text-decoration: none;
}

.portal-time-admin-filter {
  max-width: 1120px;
  margin-inline: auto;
}

.portal-time-admin-table-wrap,
.portal-employee-time-group {
  max-width: 1120px;
  margin: 1rem auto;
}

.portal-time-admin-table {
  width: 100%;
  table-layout: auto;
  font-size: .88rem;
}

.portal-time-admin-table th,
.portal-time-admin-table td {
  white-space: normal;
  vertical-align: top;
}

.portal-time-admin-table details {
  min-width: 5.5rem;
}

.portal-inline-time-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(15rem, 1fr));
  gap: .75rem;
  margin-top: .65rem;
  padding: .75rem;
  border: 1px solid var(--portal-line);
  border-radius: .75rem;
  background: var(--portal-surface);
  box-shadow: 0 .75rem 2rem rgb(19 38 63 / 18%);
}

@media (min-width: 768px) {
  .portal-time-admin-table td:last-child {
    position: relative;
  }

  .portal-time-admin-table details[open] {
    position: relative;
    z-index: 30;
  }

  .portal-inline-time-details {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    z-index: 40;
    width: min(44rem, calc(100vw - 3rem));
    max-width: min(44rem, calc(100vw - 3rem));
    min-width: min(36rem, calc(100vw - 3rem));
  }
}

.portal-inline-time-details section {
  padding: .7rem;
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
  background: var(--portal-canvas);
}

.portal-inline-time-details h3 {
  font-size: .95rem;
}

.portal-status-badge {
  display: inline-block;
  padding: .2rem .45rem;
  border-radius: 999px;
  background: var(--portal-lime);
  font-size: .78rem;
  font-weight: 700;
}

.portal-status-badge.warning {
  background: #fff2cc;
  color: var(--portal-warning);
}

.portal-employee-time-group > header {
  padding: .8rem 1rem;
  border-radius: .75rem;
  background: var(--portal-navy);
  color: white;
}

.portal-employee-time-group > header h2 {
  margin: 0 0 .35rem;
  font-size: 1.1rem;
}

.portal-employee-time-group > header div {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  font-size: .82rem;
}

.portal-time-event-list {
  display: grid;
  gap: .5rem;
}

.portal-time-event {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem;
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
}

.portal-time-event.is-cancelled {
  background: #f0f0f0;
  color: var(--portal-muted);
}

.portal-pagination {
  justify-content: center;
  margin: 1rem auto;
}

.portal-card-kicker {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.portal-priority,
.portal-admin-section,
.portal-action-box,
.portal-form-card,
.portal-schedule,
.portal-list,
.portal-facts {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.portal-priority {
  margin-bottom: 1.25rem;
}

.portal-priority h2,
.portal-admin-section h2,
.portal-form-card h2 {
  font-size: 1.15rem;
}

.portal-notice,
.portal-list-row,
.portal-shift,
.portal-document-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--portal-line);
  border-radius: .8rem;
  background: var(--portal-surface);
}

.portal-notice div,
.portal-list-row div,
.portal-document-version > div {
  display: flex;
  flex-direction: column;
}

.portal-list {
  display: grid;
  gap: .65rem;
}

.portal-list-row {
  color: inherit;
  text-decoration: none;
}

.portal-list-row:hover,
.portal-list-row:focus-visible {
  color: inherit;
  border-color: var(--portal-green);
}

.portal-list-row span,
.portal-document-version span {
  color: var(--portal-muted);
}

.portal-status,
.portal-own-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: .22rem .55rem;
  border-radius: 999px;
  background: var(--portal-lime);
  color: var(--portal-green-dark) !important;
  font-size: .75rem;
  font-weight: 750;
}

.portal-notification-button,
.portal-message-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: .35rem;
  line-height: 1;
}

.portal-header-icon {
  display: block;
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  overflow: visible;
}

.portal-notification-badge,
.portal-message-badge {
  position: absolute;
  top: -.35rem;
  right: -.35rem;
  min-width: 1.35rem;
  padding: .1rem .3rem;
  border: 2px solid var(--portal-green-dark);
  border-radius: 999px;
  background: var(--portal-red);
  color: white;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
}

.portal-notification-menu {
  width: min(25rem, calc(100vw - 1rem));
  max-height: min(32rem, 80vh);
  overflow: hidden;
  z-index: 1085;
}

.portal-notification-menu.show {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.portal-notification-menu [data-notification-list] {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.portal-notification-menu-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem;
  border-bottom: 1px solid var(--portal-line);
  background: white;
}

.portal-notification-item {
  display: grid;
  gap: .18rem;
  padding: .75rem;
  border-bottom: 1px solid var(--portal-line);
  color: var(--portal-ink);
  text-decoration: none;
}

.portal-notification-item.is-unread {
  border-left: .3rem solid var(--portal-green);
  background: #f1f8f3;
}

.portal-notification-item span,
.portal-notification-item time,
.portal-notification-empty {
  color: var(--portal-muted);
  font-size: .82rem;
}

.portal-notification-empty {
  margin: 0;
  padding: 1rem;
}

.portal-toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1090;
  display: grid;
  width: min(25rem, calc(100vw - 2rem));
  gap: .6rem;
}

.portal-notification-toast {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--portal-line);
  border-left: .35rem solid var(--portal-green);
  border-radius: .75rem;
  background: white;
  box-shadow: 0 12px 32px rgb(6 33 63 / 18%);
}

.portal-notification-toast > div {
  display: grid;
}

.portal-notification-toast span {
  color: var(--portal-muted);
  font-size: .85rem;
}

.portal-attachment-image {
  display: block;
  width: fit-content;
  max-width: 100%;
}

.portal-attachment-image img {
  display: block;
  width: auto;
  max-width: min(100%, 34rem);
  max-height: 28rem;
  border-radius: .65rem;
  object-fit: contain;
}

.portal-empty {
  padding: 2.5rem;
  text-align: center;
  color: var(--portal-muted);
  border: 1px dashed var(--portal-line);
  border-radius: .9rem;
}

.portal-admin-section {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--portal-line);
}

.portal-form-card,
.portal-action-box {
  padding: 1.4rem;
  border: 1px solid var(--portal-line);
  border-radius: 1rem;
  background: var(--portal-surface);
}

.portal-form-card {
  display: grid;
  gap: 1.1rem;
}

.portal-form-card > div {
  display: grid;
  gap: .4rem;
}

.portal-form-card input:not([type="checkbox"]):not([type="radio"]),
.portal-form-card select,
.portal-form-card textarea {
  width: 100%;
  min-height: 44px;
  padding: .65rem .75rem;
  border: 1px solid #aab7af;
  border-radius: .55rem;
  font-size: 1rem;
}

.portal-form-card textarea {
  min-height: 100px;
}

.portal-form-card .errorlist {
  margin: 0;
  color: #9c1c1c;
}

.portal-form-card small,
.helptext {
  color: var(--portal-muted);
}

.portal-form-actions {
  display: flex !important;
  grid-template-columns: repeat(2, minmax(0, auto));
  flex-direction: row;
  gap: .65rem !important;
}

.portal-day {
  margin-bottom: 1.2rem;
}

.portal-day h2,
.portal-day h3 {
  margin: 0 0 .55rem;
  font-size: 1rem;
}

/* Keep the viewport as the sticky scroll container on this page, including mobile. */
body.portal-continuous-schedule {
  overflow-x: clip;
}

.portal-schedule-filter {
  max-width: 1120px;
  margin-right: auto;
  margin-left: auto;
  position: sticky;
  top: var(--schedule-filter-top, 5rem);
  z-index: 20;
  max-height: 55vh;
  max-height: 55dvh;
  overflow-y: auto;
  background: var(--portal-surface, #fff);
}

.portal-schedule-filter .card-body {
  padding: .75rem;
}

.portal-schedule-filter-toggle {
  width: 100%;
  min-height: 44px;
  padding: .55rem .75rem;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  border-radius: inherit;
  background: var(--portal-surface, #fff);
  color: inherit;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  font-weight: 700;
  text-align: left;
}

.portal-schedule-filter.is-collapsed .portal-schedule-filter-toggle {
  border-bottom: 0;
}

.portal-schedule-filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: .5rem 1rem;
}

.portal-schedule-filter-actions > div {
  flex: 1 1 12rem;
  min-width: 0;
}

.portal-schedule-filter-actions label {
  min-height: 0;
  margin-bottom: .25rem;
}

.portal-schedule-employee-options {
  max-height: 24vh;
  overflow-y: auto;
}

.portal-schedule-page .portal-schedule-week,
.portal-schedule-page #dienstplan-verwaltung {
  scroll-margin-top: var(--schedule-filter-offset, 20rem);
}

@media print {
  .portal-schedule-filter {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .portal-schedule-filter-toggle {
    display: none;
  }

  .portal-schedule-filter [data-schedule-filter-body][hidden] {
    display: block !important;
  }
}

@media screen and (max-width: 575.98px) {
  .portal-schedule-filter-toggle {
    display: flex;
  }

  .portal-schedule-filter.is-collapsed {
    width: max-content;
    max-width: 100%;
    margin-right: 0;
  }

  .portal-schedule-filter.is-collapsed .portal-schedule-filter-toggle {
    width: auto;
    padding-inline: .75rem;
  }
}

.portal-schedule-filter-modes,
.portal-schedule-employee-options {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
}

.portal-schedule-filter label {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
}

.portal-schedule-week {
  padding: 1rem;
  border: 1px solid var(--portal-line);
  border-radius: .9rem;
  background: var(--portal-surface);
  scroll-margin-top: 1rem;
}

.portal-schedule-week + .portal-schedule-week {
  margin-top: 1rem;
}

.portal-schedule-week.is-current {
  border-color: var(--portal-green);
  box-shadow: 0 0 0 2px rgb(11 93 59 / 12%);
}

.portal-schedule-week > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .75rem;
  margin-bottom: 1rem;
}

.portal-schedule-week > header .portal-eyebrow,
.portal-schedule-week > header h2 {
  margin: 0;
}

.portal-schedule-week > header h2 {
  font-size: 1.15rem;
}

.portal-shift {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) minmax(180px, 1fr) auto auto;
  border-radius: .55rem;
}

.portal-shift.is-own {
  border-color: var(--portal-green);
  box-shadow: inset 4px 0 var(--portal-green);
}

.portal-shift > div {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.portal-warning {
  color: var(--portal-warning);
  font-weight: 700;
}

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

.portal-facts > div,
.portal-document-version dl > div {
  padding: .9rem;
  border-radius: .7rem;
  background: white;
}

.portal-facts dt,
.portal-document-version dt {
  color: var(--portal-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-facts dd,
.portal-document-version dd {
  margin: .25rem 0 0;
}

.portal-chat-main {
  height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
  padding-top: .75rem !important;
  padding-bottom: .75rem !important;
}

.portal-chat-page {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: .5rem;
}

.portal-chat-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.portal-chat-header .portal-eyebrow {
  margin-bottom: .15rem;
}

.portal-chat-header h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.65rem);
  line-height: 1.15;
}

.portal-chat-participants {
  margin: .15rem 0 0;
  color: var(--portal-muted);
  font-size: .78rem;
  line-height: 1.2;
}

.portal-thread {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  padding: .35rem .2rem .35rem 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.portal-message {
  width: fit-content;
  min-width: 0;
  max-width: min(80%, 70rem);
  padding: .08rem .6rem;
  border: 1px solid var(--portal-line);
  border-radius: .8rem .8rem .8rem .25rem;
  background: white;
  overflow-wrap: anywhere;
  text-align: left;
}

.portal-message.is-own {
  align-self: flex-end;
  border-radius: .8rem .8rem .25rem .8rem;
  background: #eaf3e6;
}

.portal-message header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  margin: 0 0 .04rem;
  line-height: 1.15;
  text-align: left;
}

.portal-message time {
  color: var(--portal-muted);
  font-size: .7rem;
}

.portal-message-sender {
  display: block;
  margin: 0;
  font-size: .78rem;
  line-height: 1.15;
}

.portal-message-body {
  margin: 0;
  line-height: 1.28;
  white-space: pre-wrap;
}

.portal-message :where(p, ul, ol, figure) {
  margin-block: 0;
}

.time-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .75rem;
  margin-block: 1rem;
}

.time-action-button {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.time-current-card,
.time-action-confirm {
  max-width: 70rem;
}

.time-summary {
  margin-block: 1rem;
}

.portal-month-navigation {
  align-items: center;
  display: grid;
  gap: .75rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  margin-bottom: 1rem;
  text-align: center;
}

.portal-month-navigation a:first-child { justify-self: start; }
.portal-month-navigation a:last-child { justify-self: end; }

.portal-completed-corrections > summary {
  cursor: pointer;
  font-weight: 700;
}

.portal-completed-corrections[open] > summary { margin-bottom: .75rem; }

/* Bootstrap keeps navbar-expand-xxl collapsed below 1400px.  In that whole
   range the bell sits inside the collapse, so its menu must be positioned
   against the viewport rather than against the trigger. */
@media (max-width: 1399.98px) {
  .portal-notification-dropdown {
    position: static;
    z-index: 1085;
  }

  .portal-notification-menu {
    position: fixed !important;
    top: max(4.5rem, calc(env(safe-area-inset-top) + 4rem)) !important;
    right: max(.5rem, env(safe-area-inset-right)) !important;
    bottom: auto !important;
    left: max(.5rem, env(safe-area-inset-left)) !important;
    width: auto !important;
    max-width: none;
    max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom));
    margin: 0;
    transform: none !important;
  }
}

@media (max-width: 575.98px) {
  .portal-month-navigation {
    grid-template-columns: 1fr 1fr;
  }

  .portal-month-navigation strong {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .portal-month-navigation a {
    font-size: .9rem;
    white-space: normal;
  }
}

.time-table th,
.time-table td {
  white-space: nowrap;
}

.time-qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.time-qr-grid img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.time-location-layout {
  display: grid;
  grid-template-columns: minmax(18rem, .8fr) minmax(20rem, 1.2fr);
  gap: 1rem;
}

.time-location-qr img,
.time-location-print-code {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin-inline: auto;
}

.time-terminal-card {
  max-width: 38rem;
  margin-inline: auto;
}

.time-terminal-clock {
  text-align: center;
  font-size: 1.15rem;
}

.time-terminal-clock strong {
  font-size: clamp(2.2rem, 12vw, 4rem);
  line-height: 1;
}

.time-terminal-actions {
  display: grid;
  gap: .8rem;
}

.time-terminal-form {
  display: grid;
  gap: .6rem;
}

.time-terminal-form textarea {
  min-height: 6rem;
  font-size: 1rem;
}

.time-terminal-button {
  min-height: 3.5rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.time-location-print {
  margin: 0;
  background: #fff;
  color: #000;
  font-family: system-ui, sans-serif;
  text-align: center;
}

.time-location-print main {
  box-sizing: border-box;
  max-width: 210mm;
  min-height: 285mm;
  margin: 0 auto;
  padding: 20mm;
}

.time-location-print-brand {
  width: 32mm;
  height: 32mm;
}

.time-location-print-code {
  width: 120mm;
  margin-block: 12mm 8mm;
}

.time-location-print > main > p:not(.time-location-print-help) {
  font-size: 1.8rem;
  font-weight: 700;
}

.customer-reservation-print {
  background: #fff;
  color: #17201b;
}

.customer-reservation-print main {
  box-sizing: border-box;
  width: min(100%, 52rem);
  margin: 0 auto;
  padding: 1.25rem;
}

.customer-reservation-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.customer-reservation-print-header {
  padding-bottom: .65rem;
  border-bottom: 2px solid var(--portal-green);
}

.customer-reservation-print-kicker,
.customer-reservation-print-header h1,
.customer-reservation-print-contact p,
.customer-reservation-print-note p {
  margin: 0;
}

.customer-reservation-print-kicker {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.customer-reservation-print-header h1 {
  margin-block: .15rem .4rem;
  font-size: 1.4rem;
  line-height: 1.15;
}

.customer-reservation-print-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: .2rem .75rem;
  margin: 0;
  font-size: .85rem;
}

.customer-reservation-print-meta div {
  min-width: 0;
}

.customer-reservation-print-meta dt,
.customer-reservation-print-meta dd {
  display: inline;
  margin: 0;
}

.customer-reservation-print-meta dt::after {
  content: ": ";
}

.customer-reservation-print-meta dd {
  overflow-wrap: anywhere;
}

.customer-reservation-print-contact {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem 1rem;
  margin-top: .4rem;
  font-size: .9rem;
}

.customer-reservation-print section {
  margin-top: .75rem;
}

.customer-reservation-print section h2 {
  margin: 0 0 .3rem;
  font-size: 1rem;
}

.customer-reservation-print-position {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .4rem .8rem;
  padding: .45rem 0;
  border-top: 1px solid #cfd8d1;
  break-inside: avoid;
}

.customer-reservation-print-position:last-child {
  border-bottom: 1px solid #cfd8d1;
}

.customer-reservation-print-position-main,
.customer-reservation-print-position-state {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.customer-reservation-print-position-main span,
.customer-reservation-print-position-state span {
  font-size: .82rem;
  color: #4f5f56;
}

.customer-reservation-print-position-state {
  align-items: end;
  text-align: right;
  font-size: .9rem;
}

.customer-reservation-print-note {
  padding-top: .45rem;
  border-top: 1px solid #cfd8d1;
}

@media (max-width: 575.98px) {
  .customer-reservation-print-position {
    grid-template-columns: 1fr;
  }

  .customer-reservation-print-position-state {
    align-items: start;
    text-align: left;
  }
}

@media print {
  .app-navbar,
  .portal-filter-row,
  .btn,
  .scroll-to-top,
  .portal-notification-dropdown {
    display: none !important;
  }

  .portal-schedule-filter .btn {
    display: inline-flex !important;
  }

  main {
    padding: 0 !important;
  }

  .time-location-print main {
    padding: 12mm !important;
  }

  .customer-reservation-print main {
    width: 100%;
    padding: 0 !important;
  }

  .customer-reservation-print .no-print {
    display: none !important;
  }
}

.portal-attachment {
  display: inline-block;
  margin-top: .25rem;
}

.portal-chat-reply {
  display: grid;
  flex: 0 0 auto;
  gap: .35rem;
}

.portal-chat-input {
  width: 100%;
  min-height: 4.6rem;
  max-height: 10rem;
  padding: .55rem .65rem;
  border: 1px solid #aab7af;
  border-radius: .55rem;
  font-size: 1rem;
  line-height: 1.3;
  resize: vertical;
}

.portal-chat-reply-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.portal-chat-reply-actions .btn {
  min-height: 44px;
}

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

.portal-chat-file-name {
  flex: 1 1 100%;
  color: var(--portal-muted);
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.portal-chat-notice,
.portal-chat-secondary-action {
  flex: 0 0 auto;
  margin: 0;
}

.portal-document-version {
  align-items: start;
  flex-wrap: wrap;
}

.portal-document-version dl {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin: 0;
}

.portal-document-version form {
  flex: 1 1 100%;
}

.portal-document-version form .btn {
  white-space: normal;
}

.portal-schedule-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 1rem;
  max-width: 1120px;
  margin: 0 auto 1.4rem;
}

.portal-pdf-panel,
.portal-review-panel {
  padding: 1rem;
  border: 1px solid var(--portal-line);
  border-radius: .9rem;
  background: white;
}

.portal-pdf-panel h2,
.portal-review-panel h2 {
  font-size: 1rem;
}

.portal-pdf-panel iframe {
  width: 100%;
  height: min(62vh, 680px);
  border: 1px solid var(--portal-line);
  border-radius: .5rem;
  background: #f1f3f1;
}

.portal-pdf-fallback {
  margin: .65rem 0 0;
  font-size: .9rem;
}

.portal-issue-list {
  display: grid;
  gap: .45rem;
}

.portal-issue-list a {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  padding: .65rem;
  border: 1px solid var(--portal-line);
  border-radius: .55rem;
  color: inherit;
  text-decoration: none;
}

*:focus-visible {
  outline: 3px solid #f1b82d !important;
  outline-offset: 3px;
}

@media (max-width: 800px) {
  .time-location-layout {
    grid-template-columns: 1fr;
  }
  .portal-dashboard-card,
  .portal-card-shift {
    grid-column: span 6;
  }

  .portal-shift {
    grid-template-columns: 1fr auto;
  }

  .portal-schedule-review-layout {
    grid-template-columns: 1fr;
  }

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

}

@media (max-width: 767px) {
  .portal-time-admin-table thead {
    display: none;
  }

  .portal-time-admin-table,
  .portal-time-admin-table tbody,
  .portal-time-admin-table tr,
  .portal-time-admin-table td {
    display: block;
    width: 100%;
  }

  .portal-time-admin-table tr {
    margin-bottom: .8rem;
    padding: .65rem;
    border: 1px solid var(--portal-line);
    border-radius: .75rem;
    background: var(--portal-surface);
  }

  .portal-time-admin-table td {
    display: grid;
    grid-template-columns: minmax(7rem, .8fr) minmax(0, 1.2fr);
    gap: .5rem;
    padding: .3rem 0;
    border: 0;
  }

  .portal-time-admin-table td::before {
    content: attr(data-label);
    color: var(--portal-muted);
    font-weight: 700;
  }

  .portal-time-admin-table details {
    min-width: 0;
  }

  .portal-time-admin-table td:last-child details {
    grid-column: 1 / -1;
  }

  .portal-inline-time-details {
    position: static;
    right: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;
    box-shadow: none;
  }
}

@media (max-width: 575px) {
  .portal-brand {
    gap: .5rem;
    margin-right: .5rem;
  }

  .portal-brand-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    border-radius: 9px;
  }

  .portal-brand-name-full,
  .portal-brand-subtitle {
    display: none;
  }

  .portal-brand-name-short {
    display: block;
    font-size: .96rem;
  }

  main.container-fluid {
    padding: 1.15rem .85rem !important;
  }

  .portal-page-heading,
  .portal-heading-actions {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 1.25rem;
  }

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

  .portal-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .portal-dashboard-card,
  .portal-card-shift {
    grid-column: 1;
    min-height: 132px;
    padding: 1.05rem;
  }

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

  .portal-time-event {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-notice,
  .portal-list-row,
  .portal-shift {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-list-row {
    min-height: 72px;
  }

  .portal-shift {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-shift > div {
    align-items: start;
    flex-direction: column;
  }

  .portal-facts,
  .portal-document-version dl {
    grid-template-columns: 1fr;
  }

  .portal-message {
    max-width: 92%;
  }

  .portal-chat-main {
    height: calc(100dvh - 67px);
    padding: .55rem .65rem !important;
  }

  .portal-chat-header {
    align-items: flex-start;
  }

  .portal-chat-header h1 {
    font-size: 1.15rem;
  }

  .portal-notification-menu-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-notification-menu-header .btn {
    min-height: 44px;
    padding-left: 0;
  }

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

  .portal-form-actions .btn,
  .portal-action-row .btn,
  .portal-heading-actions .btn,
  .portal-document-version .btn {
    min-height: 44px;
  }

  .portal-action-row {
    width: 100%;
  }

  .portal-action-row > .btn,
  .portal-action-row > form {
    flex: 1 1 100%;
  }
}

.portal-settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

.portal-settings-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .8rem;
  border: 1px solid var(--portal-line);
  border-radius: .65rem;
  background: white;
  color: var(--portal-green-dark);
  font-weight: 700;
  text-decoration: none;
}

.portal-settings-nav a:focus-visible,
.portal-settings-nav a:hover {
  border-color: var(--portal-green);
  box-shadow: 0 0 0 .2rem rgb(11 93 59 / 16%);
}

.portal-settings-grid {
  display: grid;
  gap: 1rem;
  max-width: 58rem;
}

.portal-settings-section {
  scroll-margin-top: 1rem;
}

.portal-settings-section > h2,
.portal-settings-section > p {
  padding-inline: 1rem;
}

.portal-settings-section > h2 {
  padding-top: 1rem;
}

@media (max-width: 575px) {
  .portal-settings-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .portal-settings-nav a {
    width: 100%;
  }
}
.time-booking-toast,
.time-booking-success { position: fixed; inset: calc(env(safe-area-inset-top, 0px) + .75rem) .75rem auto auto; z-index: 1090; max-width: min(28rem, calc(100vw - 1.5rem)); box-shadow: 0 .35rem 1rem rgba(0,0,0,.18); transition: opacity .2s ease, transform .2s ease; }
.time-booking-toast.is-hiding,
.time-booking-success.is-hiding { opacity: 0; transform: translateY(-.5rem); }

/* Gut zu wissen: readable instructions and stacked editing on small screens. */
.knowledge-reader { max-width: 54rem; overflow-wrap: anywhere; }
.knowledge-editor { max-width: 48rem; overflow-wrap: anywhere; }
.knowledge-section { margin: 1.5rem 0; }
.knowledge-step { border-left: .25rem solid var(--bs-primary); padding: .8rem 1rem; background: var(--bs-tertiary-bg, #f8f9fa); }
.knowledge-text { line-height: 1.65; }
.knowledge-image { display: block; max-width: 100%; height: auto; max-height: 38rem; object-fit: contain; object-position: left; }
.knowledge-preview { max-height: 15rem; }
.knowledge-card { overflow-wrap: anywhere; }
.knowledge-card:hover { border-color: var(--bs-primary); }
.knowledge-editor input, .knowledge-editor select, .knowledge-editor textarea { max-width: 100%; min-width: 0; }
.knowledge-editor .btn, .knowledge-reader .btn { white-space: normal; }
@media (max-width: 430px) { .knowledge-step { padding: .7rem; } }

/* 1.4.29: instructions keep their information hierarchy on every screen. */
.knowledge-header { padding-bottom: 1rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--bs-border-color); }
.knowledge-intro { max-width: 65ch; color: var(--bs-secondary-color); font-size: 1.08rem; }
.knowledge-steps { counter-reset: knowledge-step; list-style: none; padding: 0; margin: 1rem 0 2rem; }
.knowledge-step { position: relative; counter-increment: knowledge-step; margin: 0; padding: 1rem 0 1.4rem 3rem; border: 0; background: transparent; }
.knowledge-step + .knowledge-step { border-top: 1px solid var(--bs-border-color); }
.knowledge-step::before { content: counter(knowledge-step); position: absolute; left: 0; top: 1rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--bs-primary); color: white; font-weight: 700; }
.knowledge-step .knowledge-section-title { font-size: 1.12rem; }
.knowledge-text { max-width: 70ch; }
.knowledge-text p:last-child, .knowledge-text ul:last-child, .knowledge-text ol:last-child { margin-bottom: 0; }
.knowledge-text li + li { margin-top: .35rem; }
.knowledge-text ul, .knowledge-text ol { padding-left: 1.3rem; }
.knowledge-group { margin-top: 2.5rem; padding-top: 1rem; border-top: 2px solid var(--bs-primary); }
.knowledge-group .knowledge-section-title { font-size: 1.5rem; }
.knowledge-timeline { border-left: 2px solid var(--bs-border-color); margin-left: .4rem; padding-left: 1.3rem; }
.knowledge-time { position: relative; margin: 0 0 1.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; background: var(--bs-body-bg); }
.knowledge-time::before { content: ''; position: absolute; left: -1.7rem; top: 1.3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--bs-primary); }
.knowledge-time .knowledge-section-title { display: inline-block; font-size: 1.08rem; font-weight: 700; padding: .3rem .6rem; color: var(--bs-primary-text-emphasis); background: var(--bs-primary-bg-subtle); border-radius: .35rem; margin-bottom: .8rem; }
.knowledge-checklist { padding: 1.2rem; border: 1px solid var(--bs-border-color); border-radius: .6rem; }
.knowledge-checklist ul { list-style-type: square; }
.knowledge-checklist li::marker { color: var(--bs-primary); }
.knowledge-locations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.knowledge-location .knowledge-section-title { font-size: 1.18rem; }
.knowledge-images { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-top: 1rem; }
.knowledge-images figure { margin: 0; max-width: min(100%, 21rem); }
.knowledge-reader .knowledge-image { max-width: 100%; max-height: 15rem; border: 1px solid var(--bs-border-color); border-radius: .4rem; }
.knowledge-images figcaption { font-size: .8rem; color: var(--bs-secondary-color); margin-top: .35rem; }
@media (max-width: 430px) {
  .knowledge-step { padding: 1rem 0 1.2rem 2.55rem; }
  .knowledge-timeline { padding-left: .9rem; }
  .knowledge-time { padding: .85rem; }
  .knowledge-time::before { left: -1.3rem; }
  .knowledge-checklist { padding: .9rem; }
}
