:root {
  --accent: #2bb673;
  --accent-dark: #14945a;
  --active-day: #fff7e6;
  --bg: #9ebbd4;
  --border: #d1d5db;
  --card: rgba(248, 251, 255, 0.96);
  --current-week: #f59e0b;
  --muted: #6b7280;
  --selected-week: #2bb673;
}

/* =========================================================
   Basis
   ========================================================= */

* {
  box-sizing: border-box;
}

html {
  overflow-anchor: none;
  overflow-x: hidden;
}

html,
body {
  background: var(--bg);
  color: #0f172a;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: clamp(14px, 2vw, 16px);
  margin: 5px;
  min-height: 100%;
  overflow-x: hidden;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  width: 100%;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

button,
.primary,
.ghost,
.week-date-btn {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 10px;
}

button,
.primary,
.ghost {
  font-size: clamp(15px, 2vw, 17px);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.ghost:hover,
.week-date-btn:hover {
  background: #f8fafc;
}

#btnAddS2:disabled,
.s2-add-btn:disabled {
  background: #9ca3af !important;
  border-color: #9ca3af !important;
  cursor: not-allowed !important;
  opacity: 0.55;
}

/* =========================================================
   Layout
   ========================================================= */

.wrap {
  margin: 0 auto;
  max-width: 1800px;
  padding: 16px 20px;
  width: 100%;
}

@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 900px) {
    .wrap {
      padding-top: calc(12px + env(safe-area-inset-top));
    }

    .s2-day-nav-sticky {
      top: env(safe-area-inset-top);
    }
  }
}

html.s2-ios-standalone body {
  padding-top: max(34px, env(safe-area-inset-top, 0px)) !important;
}

html.s2-ios-standalone .wrap {
  padding-top: 10px !important;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 14px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mt-10 {
  margin-top: 10px;
}

.card-head,
.day-nav,
.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar {
  justify-content: space-between;
}

.spacer {
  flex: 1;
}

.date-wrap {
  min-width: 180px;
}

.tech-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 160px minmax(220px, 1fr);
  margin-top: 10px;
}

.label-mini {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.error-text {
  color: #b91c1c;
  display: block;
  margin-top: 8px;
}

.panel-title {
  margin: 0;
}

.badge {
  background: #e8f7ef;
  border: 1px solid #bfe9d2;
  border-radius: 999px;
  color: #14532d;
  display: inline-block;
  font-size: clamp(13px, 2vw, 15px);
  padding: 4px 10px;
}

/* =========================================================
   Kopfbereich / Tagesstart / Tagesende
   ========================================================= */

.entry-head {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
  padding: 3px;
  text-align: center;
}

.s2-day-nav-sticky {
  background: transparent;
  margin: 0 0 10px;
  padding: 0;
  position: static;
  z-index: 70;
}

.s2-day-remark-toggle {
  margin: 6px 0 8px;
  text-align: center;
}

.s2-day-nav-sticky .day-nav {
  background: rgba(239, 247, 255, 0.96);
  border: 2px solid #8eb3d4;
  border-radius: 10px;
  padding: 10px;
}

@supports (backdrop-filter: blur(8px)) {
  .s2-day-nav-sticky .day-nav {
    backdrop-filter: blur(8px);
  }
}

.entry-head-center {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

.entry-head-right {
  align-items: center;
  display: flex;
  justify-content: center;
  width: 100%;
}

.time-inline {
  align-items: end;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  justify-content: center;
  max-width: 430px;
  width: 100%;
}

.time-inline>div {
  min-width: 0;
  width: 100%;
}

.time-inline input[type="time"] {
  box-sizing: border-box;
  max-width: 140px;
  min-width: 0;
  width: 100%;
}

.timeStart {
  margin-top: 5px;
}

.day-nav {
  justify-content: center;
  margin-top: 2px;
}

.day-date-control {
  align-items: center;
  display: flex;
  justify-content: center;
  min-width: 240px;
  position: relative;
}

.day-date-picker {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.day-date-control:hover .day-date-picker,
.day-date-control:focus-within .day-date-picker,
.day-date-picker:hover,
.day-date-picker:focus-visible {
  background: rgba(47, 128, 237, 0.08);
  outline: 2px solid rgba(47, 128, 237, 0.35);
  outline-offset: 2px;
}

.day-date-native {
  -webkit-appearance: auto;
  appearance: auto;
  background: transparent;
  border: 0;
  color: transparent;
  cursor: pointer;
  font-size: 16px;
  height: 100%;
  inset: 0;
  max-width: none !important;
  min-width: 0 !important;
  opacity: 0.01;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 3;
}

.day-date-native::-webkit-calendar-picker-indicator {
  cursor: pointer;
  height: 100%;
  opacity: 0.01;
  width: 100%;
}

.s2-day-calendar[hidden] {
  display: none !important;
}

.s2-day-calendar {
  background: #ffffff;
  border: 2px solid #6f9fc8;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
  left: 50%;
  min-width: 286px;
  padding: 10px;
  position: absolute;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 1000;
}

.s2-day-calendar-head {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 36px 1fr 36px;
  margin-bottom: 8px;
}

.s2-day-calendar-head button,
.s2-day-calendar-footer button,
.s2-day-calendar-day {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #d5e2ef;
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
}

.s2-day-calendar-head strong {
  color: #0f172a;
  font-size: 15px;
  text-align: center;
}

.s2-day-calendar-weekdays,
.s2-day-calendar-grid {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.s2-day-calendar-weekdays {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-align: center;
}

.s2-day-calendar-empty {
  min-height: 34px;
}

.s2-day-calendar-day.is-today {
  background: #ff8c00;
  border-color: #cc7000;
  color: #ffffff;
}

.s2-day-calendar-day.is-selected {
  background: #2f80ed;
  border-color: #1d64c8;
  color: #ffffff;
}

.s2-day-calendar-footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.s2-day-calendar-footer button {
  min-height: 32px;
  padding: 0 16px;
}

.s2-day-calendar-footer button:hover {
  background: #fff3e0;
  border-color: #ff8c00;
}

.day-label,
#dayLabelS2 {
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 700;
  min-width: 240px;
  text-align: center;
}

@media (max-width: 520px) {
  .day-nav {
    align-items: center !important;
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: 44px minmax(0, 1fr) 44px !important;
    justify-content: center !important;
    margin: 2px auto 0 !important;
    max-width: 340px !important;
    width: 100% !important;
  }

  .day-date-control {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: auto !important;
  }

  .day-date-control .day-date-picker {
    min-width: 0 !important;
    padding: 0 8px !important;
    width: 100% !important;
  }

  #prevDayS2 {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  #dayLabelS2,
  .day-label {
    align-items: center !important;
    display: flex !important;
    justify-content: center !important;
    line-height: 1.15 !important;
    margin: 0 !important;
    min-height: 44px !important;
    min-width: 0 !important;
    order: 0 !important;
    text-align: center !important;
    width: auto !important;
  }

  #nextDayS2 {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .day-nav .ghost {
    align-items: center !important;
    display: inline-flex !important;
    height: 44px !important;
    justify-content: center !important;
    min-width: 44px !important;
    padding: 0 !important;
    width: 44px !important;
  }

  .day-nav .day-date-picker {
    min-width: 0 !important;
    padding: 0 8px !important;
    width: 100% !important;
  }
}

.day-hours-preview {
  color: #475569;
  display: block;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1.2;
  margin-top: 8px;
  text-align: center;
  width: 100%;
}

.day-hours-preview.is-empty {
  color: #94a3b8;
  font-weight: 600;
}

/* =========================================================
   Tagesstunden-Box
   ========================================================= */

.day-summary-box {
  align-items: center;
  background: linear-gradient(135deg, rgba(95, 125, 153, 0.14), rgba(255, 255, 255, 0.82));
  border: 1px solid rgba(95, 125, 153, 0.22);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px auto 0;
  max-width: 560px;
  padding: 8px;
  width: min(100%, 560px);
}

.day-summary-main {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.day-summary-title {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-summary-box .day-hours-preview {
  color: #1f2937;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
  text-align: center;
}

.day-summary-box .day-hours-preview.is-empty {
  color: #8795a8;
}

.day-summary-sub {
  color: #7b8797;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.day-summary-grid,
.day-summary-grid--compact {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 330px;
  width: 100%;
}

.day-summary-pill {
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  min-height: 50px;
  padding: 2px 6px;
  text-align: center;
}

.day-summary-pill--drive {
  background: rgba(219, 234, 254, 0.72);
  border-color: rgba(96, 165, 250, 0.28);
}

.day-summary-pill--entries {
  background: rgba(248, 250, 252, 0.86);
}

.day-summary-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.day-summary-value {
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}

/* =========================================================
   Formular
   ========================================================= */

.s2-form-grid {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns:
    110px 110px 110px minmax(170px, 1fr) 118px minmax(200px, 1.35fr) minmax(140px, 0.9fr) 56px;
  width: 100%;
}

.s2-form-grid>label,
.s2-form-grid>button,
.s2-form-grid>div {
  min-width: 0;
}

.s2-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.s2-form-grid label>span,
.s2-article-box>.label-mini {
  font-weight: 700;
}

.s2-form-grid input,
.s2-form-grid select {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

.s2-form-grid .s2-add-btn {
  align-self: end;
  justify-self: stretch;
}

.s2-add-btn {
  font-size: 24px;
  height: 44px;
  line-height: 1;
  min-width: 56px;
  padding: 0;
  width: 56px;
}

.s2-memory-dropdown {
  background: #fff;
  border: 1px solid #b8c7d9;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(16, 24, 40, 0.16);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  position: absolute;
  z-index: 10000;
}

.s2-memory-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: #061128;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 8px;
  text-align: left;
  width: 100%;
}

.s2-memory-option:hover,
.s2-memory-option.is-active {
  background: #eef6ff;
}

.s2-memory-option.is-active {
  box-shadow: inset 3px 0 0 #2f80ed;
}

.s2-memory-option span:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.s2-memory-option strong,
.s2-memory-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s2-memory-option small {
  color: #5a6f89;
  font-size: 13px;
}

.s2-memory-meta {
  font-size: 12px !important;
  opacity: 0.82;
}

.s2-memory-delete {
  align-items: center;
  border-radius: 999px;
  color: #b42318;
  display: inline-flex;
  flex: 0 0 28px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
}

.s2-memory-delete:hover {
  background: #fee4e2;
}

.day-part-wrap[hidden] {
  display: none !important;
}

.s2-note {
  color: var(--muted);
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "daypart daypart message message message message message message";
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from;
  }

  .s2-form-grid label[for="s2To"] {
    grid-area: to;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type;
  }

.s2-form-grid label[for="s2Tid"] {
    grid-area: tid;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city;
  }

  .s2-form-grid #dayPartWrapS2 {
    grid-area: daypart;
  }

  .s2-form-grid #s2TimeConflictMessage {
    grid-area: message;
  }

  .s2-form-grid .s2-add-btn {
    grid-area: add;
    justify-self: end;
    min-width: 56px;
    width: 56px;
  }


}

/* =========================================================
   Bemerkungen
   ========================================================= */

.auto-remark-box {
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 10px;
}

.auto-remark-text {
  line-height: 1.4;
  white-space: pre-wrap;
}

.week-remark-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.remark-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

button#btnWeekRemarkToggle {
  background-color: #add4f041;
  border: 2px solid rgba(88, 154, 220, 0.62);
  border-radius: 12px;
}

.ghost.has-remark,
button.has-remark,
#btnWeekRemarkToggle.has-remark {
  background: #fff3e6;
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.14);
  color: #9a5b00;
  font-weight: 700;
}

.ghost.has-remark:hover,
button.has-remark:hover,
#btnWeekRemarkToggle.has-remark:hover {
  background: #ffe8cc;
}

/* =========================================================
   Tabellen allgemein
   ========================================================= */

.s2-list-wrap,
.week-table-wrap {
  overflow-x: auto;
}

.s2-list-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.s2-list-table col.col-time {
  width: 150px;
}

.s2-list-table col.col-duration {
  width: 110px;
}

.s2-list-table col.col-customer {
  width: 22%;
}

.s2-list-table col.col-city {
  width: 16%;
}

.s2-list-table col.col-type {
  width: 18%;
}

.s2-list-table col.col-actions {
  width: 96px;
}

.s2-list-table th,
.s2-list-table td {
  background: #fff;
  border: 1px solid var(--border);
  padding: 5px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.s2-list-table th {
  background: #f8fafc;
  text-align: left;
}

.s2-mini-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.s2-mini-actions button {
  height: 34px;
  min-width: 36px;
  padding: 0;
}

/* =========================================================
   Einträge heute - Desktop
   ========================================================= */

@media (min-width: 901px) {
  .s2-list-table {
    border-collapse: collapse !important;
    display: table !important;
    table-layout: fixed !important;
    width: 100% !important;
  }

  .s2-list-table thead {
    display: table-header-group !important;
  }

  .s2-list-table tbody {
    display: table-row-group !important;
  }

  .s2-list-table tr.today-entry-row {
    display: table-row !important;
  }

  .s2-list-table tr.today-entry-row>td {
    border: 1px solid var(--border) !important;
    display: table-cell !important;
    padding: 6px !important;
    vertical-align: middle !important;
  }

  .today-list-card-cell {
    border: 1px solid var(--border) !important;
    display: table-cell !important;
    padding: 8px !important;
    vertical-align: middle !important;
  }

  .today-list-card,
  .today-list-main,
  .today-list-top {
    display: contents !important;
  }

  .today-list-line,
  .today-list-line--city,
  .today-list-line--customer,
  .today-list-line--duration,
  .today-list-line--time,
  .today-list-line--type {
    background: transparent !important;
    border-radius: 0 !important;
    color: inherit !important;
    display: inline !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .today-list-actions {
    align-items: center !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    justify-content: center !important;
  }

  .today-list-actions button {
    align-items: center !important;
    display: inline-flex !important;
    height: 34px !important;
    justify-content: center !important;
    min-width: 36px !important;
    padding: 0 !important;
    width: 36px !important;
  }

  .s2-list-table tbody tr.today-entry-row td:nth-child(1),
  .s2-list-table tbody tr.today-entry-row td:nth-child(2),
  .s2-list-table tbody tr.today-entry-row td:nth-child(4),
  .s2-list-table tbody tr.today-entry-row td:nth-child(5),
  .s2-list-table tbody tr.today-entry-row td:nth-child(6) {
    white-space: nowrap;
  }
}

/* =========================================================
   Einträge heute - Mobile
   ========================================================= */

@media (max-width: 900px) {
  .s2-list-wrap {
    overflow: visible;
    width: 100%;
  }

  .s2-list-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    table-layout: auto !important;
    width: 100%;
  }

  .s2-list-table colgroup,
  .s2-list-table thead {
    display: none;
  }

  .s2-list-table,
  .s2-list-table tbody,
  .s2-list-table tr,
  .s2-list-table td {
    max-width: 100% !important;
    width: 100% !important;
  }

  .s2-list-table tr {
    margin-bottom: 10px;
  }

  .s2-list-table td {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
  }

  .today-list-card-cell {
    padding: 0 !important;
  }

  .today-list-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .today-list-main {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
  }

  .today-list-time {
    color: #0f172a;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 4px;
  }

  .today-list-customer {
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    word-break: break-word;
  }

  .today-list-meta {
    color: #667085;
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
  }

  .today-list-actions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 8px;
  }

  .today-list-actions button {
    align-items: center;
    display: inline-flex;
    font-size: 18px;
    height: 42px;
    justify-content: center;
    min-width: 42px;
    padding: 0;
    width: 42px;
  }

  .today-list-line.today-list-line--customer,
  .today-list-line.today-list-line--time {
    border-radius: 10px;
    font-size: clamp(15px, 2vw, 17px);
    font-weight: 750;
    margin-left: -9px;
    padding: 2px 8px;
  }

  .today-list-line.today-list-line--customer {
    background-color: #f4dfb5;
  }
}

@media (max-width: 520px) {
  .today-list-card {
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
  }

  .today-list-time {
    font-size: 17px;
  }

  .today-list-customer {
    font-size: clamp(16px, 2vw, 18px);
  }

  .today-list-meta {
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 600;
  }

  .today-list-actions {
    gap: 6px;
  }

  .today-list-actions button {
    height: 40px;
    min-width: 40px;
    width: 40px;
  }
}

/* =========================================================
   KW-Strip
   ========================================================= */

.week-head-right {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-left: auto;
}

#weekTitleS2 {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 150px;
  text-align: center;
}

.week-strip-wrap {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 44px 1fr 44px;
  margin-bottom: 12px;
  margin-top: 10px;
}

.kw-strip {
  display: flex;
  gap: 10px;
  justify-content: center;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.kw-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  flex: 0 0 auto;
  min-width: 140px;
  padding: 4px 8px;
  text-align: center;
  transition: 0.15s ease;
}

.kw-chip:hover {
  background: #f8fafc;
}

.kw-chip.active {
  background: #e8f7ef;
  border-color: var(--selected-week);
  box-shadow: 0 0 0 2px rgba(43, 182, 115, 0.16);
  font-weight: 700;
}

.kw-chip.current-week {
  outline: 3px solid var(--current-week);
  outline-offset: 1px;
}

.kw-chip.active.current-week {
  box-shadow: 0 0 0 2px rgba(43, 182, 115, 0.18);
  outline: 3px solid var(--current-week);
}

/* =========================================================
   Übersicht Woche
   ========================================================= */

.week-overview-table th,
.year-overview-table th {
  background: #eef3f8;
  font-weight: 700;
}

.week-overview-table th,
.week-overview-table td {
  padding-bottom: 3px;
  padding-top: 3px;
}

.week-overview-table tbody tr:nth-child(even) td,
.year-overview-table tbody tr:nth-child(even) td {
  background: #fafbfd;
}

.week-date-btn,
.week-date-btn--stack {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
  min-height: 42px;
  padding: 2px 6px;
  text-align: center;
  width: 100%;
}

.week-day-head,
.week-day-cell {
  min-width: 110px;
  width: 110px;
}

.week-day-name {
  display: block;
  font-weight: 700;
  line-height: 1.1;
}

.week-day-date {
  display: block;
  font-size: clamp(13px, 2vw, 15px);
  line-height: 1.15;
  margin-top: 2px;
  opacity: 0.9;
}

.week-day-time {
  color: #4b5563;
  display: block;
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 600;
  line-height: 1.15;
  margin-top: 4px;
}

.week-overview-table thead th.week-day-head {
  display: table-cell;
}

.week-overview-table td.week-day-cell::before {
  content: none !important;
  display: none !important;
}

.week-table td.active-day {
  background: var(--active-day) !important;
}

.week-overview-table tbody tr.has-data {
  background: rgba(37, 99, 235, 0.08);
}

.week-overview-table tbody tr.has-overtime {
  background: rgba(168, 85, 247, 0.10);
}

.week-overview-table tbody tr.has-pikett {
  background: rgba(20, 184, 166, 0.10);
}

.week-overview-table tbody tr.has-sick {
  background: rgba(239, 68, 68, 0.10);
}

.week-overview-table tbody tr.has-vacation {
  background: rgba(245, 158, 11, 0.12);
}

.week-overview-table tbody tr.has-work {
  background: rgba(56, 203, 110, 0.10);
}

.week-overview-table tbody tr.has-data td,
.week-overview-table tbody tr.has-overtime td,
.week-overview-table tbody tr.has-pikett td,
.week-overview-table tbody tr.has-sick td,
.week-overview-table tbody tr.has-vacation td,
.week-overview-table tbody tr.has-work td {
  font-weight: 600;
}

@media (min-width: 901px) {

  .week-overview-table tbody tr.has-data td,
  .week-overview-table tbody tr.has-overtime td,
  .week-overview-table tbody tr.has-pikett td,
  .week-overview-table tbody tr.has-sick td,
  .week-overview-table tbody tr.has-vacation td,
  .week-overview-table tbody tr.has-work td {
    background: #eef8f0 !important;
  }

  .week-overview-table tbody tr.has-data td.has-cell-data,
  .week-overview-table tbody tr.has-overtime td.has-cell-data,
  .week-overview-table tbody tr.has-pikett td.has-cell-data,
  .week-overview-table tbody tr.has-sick td.has-cell-data,
  .week-overview-table tbody tr.has-vacation td.has-cell-data,
  .week-overview-table tbody tr.has-work td.has-cell-data {
    background: #d3e7d778 !important;
    font-weight: 700;
  }

  .week-overview-table tbody td.week-day-cell .week-date-btn,
  .week-overview-table tbody td:first-child .week-date-btn {
    align-items: center;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 76px;
    width: 100%;
  }

  .week-overview-table tbody tr.week-day-complete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-complete > td:first-child,
  .week-overview-table tbody tr.week-day-incomplete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-incomplete > td:first-child {
    background: #eef8f0 !important;
    box-shadow: none !important;
  }

  .week-overview-table tbody tr.week-day-complete > td.week-day-cell .week-date-btn,
  .week-overview-table tbody tr.week-day-complete > td:first-child .week-date-btn {
    background: linear-gradient(
      180deg,
      rgba(56, 203, 110, 0.13) 0%,
      rgba(56, 203, 110, 0.05) 34%,
      rgba(56, 203, 110, 0.00) 100%
    ) !important;
    border-color: #38cb6e !important;
    box-shadow: inset 4px 0 0 #38cb6e, inset 0 3px 0 rgba(56, 203, 110, 0.52);
  }

  .week-overview-table tbody tr.week-day-incomplete > td.week-day-cell .week-date-btn,
  .week-overview-table tbody tr.week-day-incomplete > td:first-child .week-date-btn {
    background: linear-gradient(
      180deg,
      rgba(230, 137, 23, 0.24) 0%,
      rgba(230, 137, 23, 0.10) 34%,
      rgba(230, 137, 23, 0.00) 100%
    ) !important;
    border-color: #e68917 !important;
    box-shadow: inset 4px 0 0 #e68917, inset 0 3px 0 rgba(230, 137, 23, 0.62);
  }
  .week-overview-table tbody tr.is-selected-day.week-day-complete > td.week-day-cell .week-date-btn,
  .week-overview-table tbody tr.is-selected-day.week-day-complete > td:first-child .week-date-btn,
  .week-overview-table tbody tr.is-selected-day.week-day-incomplete > td.week-day-cell .week-date-btn,
  .week-overview-table tbody tr.is-selected-day.week-day-incomplete > td:first-child .week-date-btn {
    border-color: var(--border) !important;
    box-shadow: none !important;
  }
}

/* =========================================================
   KW-Übersicht / Jahresübersicht
   ========================================================= */

.year-overview-table {
  border-collapse: collapse;
  font-size: clamp(15px, 2vw, 17px);
  table-layout: fixed;
  width: 100%;
}

.year-overview-table thead {
  display: table-header-group;
}

.year-overview-table tbody {
  display: table-row-group;
}

.year-overview-table tbody tr {
  display: table-row;
}

.year-overview-table tbody td,
.year-overview-table tbody th {
  background: #fff !important;
  border: 1px solid #dde4ec;
  box-shadow: none;
  display: table-cell;
  line-height: 1.45;
  min-height: unset;
  padding: 12px 14px;
  text-align: center;
  vertical-align: middle;
}

.year-overview-table thead th {
  background: #eef3f8;
  border: 1px solid #dde4ec;
  font-weight: 700;
  padding: 10px 14px;
  text-align: center;
}

.year-overview-table tbody tr:nth-child(even) td {
  background: #fafbfd !important;
}

.year-overview-table tbody td::before {
  content: none;
  display: none;
}

.year-overview-table tbody td:nth-child(4) {
  background: #f8fbff !important;
  border-color: #cfe0f2;
}

.year-overview-table strong {
  color: #0f172a;
  font-weight: 800;
}

.year-stat-stack {
  display: inline-grid;
  gap: 1px;
  justify-content: start;
  min-width: 124px;
  text-align: left;
}

.year-stat-line {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: max-content minmax(56px, max-content);
}

.year-stat-line span {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.year-overview-table td.kw-cell button {
  background: transparent;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
  width: 100%;
}

.year-overview-table td.kw-cell button:hover {
  text-decoration: underline;
}

.period-cell {
  font-size: inherit;
  line-height: 1.45;
  white-space: normal;
}

@media (max-width: 520px) {
  .year-overview-table tbody tr {
    grid-template-columns: 1fr;
  }

  .year-overview-table tbody td {
    min-height: auto;
  }
}

/* =========================================================
   Total Woche
   ========================================================= */

.week-totals-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-total-card {
  background: #eaf7ee;
  border: 1px solid #c5cfda;
  border-radius: 12px;
  min-width: 0;
  padding: 6px 10px;
  text-align: center;
}

.mini-label {
  color: #667085;
  font-size: clamp(14px, 2vw, 16px);
  margin-bottom: 4px;
}

.mini-value {
  color: #0f172a;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 700;
}

.mini-total-card--overtime42 {
  background: #fff8ed;
  border-color: #f3cf96;
}

.mini-total-card--overtime42 .mini-label {
  color: #667085;
  font-weight: 700;
}

.mini-total-card--overtime42 .mini-value {
  color: #000;
}

.mini-total-card--overtime42,
#overtime42TotalS2 .special-item {
  cursor: pointer;
}

.mini-total-card.week-total-net,
.mini-total-card.week-total-vacation {
  background: #eaf7ee;
  border-color: #7ecf98;
}

.mini-total-card.week-total-work {
  background: #dff1e3;
  border-color: #67b883;
}

.mini-total-card.week-total-active {
  background: #f3ecff;
  border-color: #8bbcf3;
}

.mini-total-card.week-total-drive {
  background: #b9e8f6d9;
  border-color: #9bbcf2;
}

.mini-total-card.week-total-overtime,
.mini-total-card.week-total-passive,
.mini-total-card.week-total-pikett {
  background: #f3ecff;
  border-color: #c7b1f3;
}

.mini-total-card.week-overtime-minus,
.mini-total-card.week-total-break,
.mini-total-card.week-total-sick {
  background: #fff4e8;
  border-color: #f2bc72;
}

.mini-total-card.week-overtime-plus {
  background: #eaf4ff;
  border-color: #8bbcf3;
}

.mini-total-card.week-overtime-minus .mini-label,
.mini-total-card.week-overtime-plus .mini-label,
.mini-total-card.week-total-active .mini-label,
.mini-total-card.week-total-break .mini-label,
.mini-total-card.week-total-drive .mini-label,
.mini-total-card.week-total-net .mini-label,
.mini-total-card.week-total-overtime .mini-label,
.mini-total-card.week-total-passive .mini-label,
.mini-total-card.week-total-pikett .mini-label,
.mini-total-card.week-total-sick .mini-label,
.mini-total-card.week-total-vacation .mini-label,
.mini-total-card.week-total-work .mini-label {
  color: #3d5873;
}

.mini-total-card.week-total-active .mini-value,
.mini-total-card.week-total-break .mini-value,
.mini-total-card.week-total-drive .mini-value,
.mini-total-card.week-total-net .mini-value,
.mini-total-card.week-total-overtime .mini-value,
.mini-total-card.week-total-passive .mini-value,
.mini-total-card.week-total-pikett .mini-value,
.mini-total-card.week-total-sick .mini-value,
.mini-total-card.week-total-vacation .mini-value,
.mini-total-card.week-total-work .mini-value {
  color: #0f172a;
}

.mini-total-card.is-empty-total {
  background: rgba(248, 250, 252, 0.74);
  border-color: rgba(148, 163, 184, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.mini-total-card.is-empty-total .mini-label {
  color: #6f7e91;
}

.mini-total-card.is-empty-total .mini-value {
  color: #334155;
  font-weight: 650;
}

.mini-total-card.week-overtime-plus .mini-value {
  color: #1d4ed8;
}

.mini-total-card.week-overtime-minus .mini-value {
  color: #b45309;
}



/* Timeline 3.1 article/infos alignment overrides */
.s2-form-grid label[for="s2Info"],
.s2-article-box {
  align-self: start;
}

.s2-article-box>.label-mini {
  display: block;
  margin-bottom: 6px;
  min-height: 17px;
}

.s2-article-grid {
  align-items: start;
  grid-template-columns: minmax(220px, 1fr) 112px 72px;
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "info info info info article article article article"
      "daypart daypart message message message message message message" !important;
  }

  .s2-form-grid label[for="s2Info"] {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .s2-form-grid {
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-article-grid {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  .s2-article-picker {
    grid-column: 1 / -1;
  }
}

/* Keep Artikel, Lager and Anzahl in one row on mobile */
@media (max-width: 900px) {
  .s2-article-grid {
    grid-template-columns: minmax(120px, 1fr) 92px 64px !important;
  }

  .s2-article-picker {
    grid-column: auto !important;
  }
}

/* Compact article search, wider infos - final override */
.s2-article-grid {
  grid-template-columns: minmax(130px, 1fr) 92px 64px;
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "info info info info article article article article"
      "daypart daypart message message message message message message" !important;
  }

  .s2-article-picker {
    max-width: 230px;
  }
}

@media (max-width: 900px) {
  .s2-article-grid {
    grid-template-columns: minmax(120px, 1fr) 92px 64px;
  }

  .s2-article-picker {
    grid-column: auto;
  }
}

/* Compact article search, wider infos */
.s2-article-grid {
  grid-template-columns: minmax(130px, 1fr) 92px 64px;
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "info info info info article article article article"
      "daypart daypart message message message message message message" !important;
  }

  .s2-article-picker {
    max-width: 230px;
  }
}

@media (max-width: 900px) {
  .s2-article-grid {
    grid-template-columns: minmax(120px, 1fr) 92px 64px;
  }

  .s2-article-picker {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .week-totals-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .mini-total-card.mobile-empty-total {
    display: none !important;
  }
}

/* =========================================================
   Überzeit 42+ Info
   ========================================================= */

.week-over42-info {
  align-items: center;
  background: #fff8ed;
  border: 1px solid #f3cf96;
  border-radius: 14px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 10px 0 12px;
  padding: 12px 14px;
}

.week-over42-info__label {
  color: #9a5b00;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 700;
}

.week-over42-info__value {
  color: #9a5b00;
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 800;
  line-height: 1;
}

/* =========================================================
   Spezialkarten / Jahreswerte
   ========================================================= */

.special-cards-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.special-list {
  display: grid;
  gap: 8px;
}

.special-item {
  background: #ffffff;
  border: 1px solid #2a435f;
  border-radius: 12px;
  padding: 10px 12px;
}

.special-item .row-top {
  align-items: center;
  display: flex;
  font-size: clamp(15px, 2vw, 17px);
  gap: 10px;
  justify-content: space-between;
}

.special-item .date {
  color: #0f172a;
  font-weight: 750;
}

.special-item .value {
  color: #14532d;
  font-weight: 700;
}

.special-item .meta {
  color: #667085;
  font-size: clamp(14px, 2vw, 16px);
  margin-top: 4px;
}

.special-toggle-head {
  padding-bottom: 0;
}

.special-toggle-btn {
  align-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  font: inherit;
  gap: 10px;
  justify-content: space-between;
  padding: 0;
  text-align: left;
  width: 100%;
}

.special-toggle-btn .panel-title {
  margin: 0;
}

.special-list-wrap {
  padding-top: 8px;
}

.special-list-wrap[hidden] {
  display: none !important;
}

.has-value {
  background: #eaf4ff;
  border-radius: 12px;
}

.special-count.has-value,
.has-value .special-count,
[id$="CountS2"].has-value {
  align-items: center;
  background: #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-width: 42px;
  padding: 4px 10px;
}

#overtime42TotalS2.has-value,
.has-value #overtime42TotalS2 {
  border-radius: 12px;
}

.special-item--compact .row-top {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.special-item--compact .date {
  font-weight: 650;
}

.special-item--compact .value {
  color: #1d4ed8;
  font-weight: 750;
  white-space: nowrap;
}

.special-separator {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin: 10px 0;
}

/* =========================================================
   Spezial-Overlay
   ========================================================= */

.special-overlay[hidden] {
  display: none !important;
}

.special-overlay {
  display: block;
  inset: 0 !important;
  position: fixed !important;
  z-index: 999999 !important;
}

.special-overlay-backdrop {
  background: rgba(15, 23, 42, 0.55);
  inset: 0 !important;
  position: fixed !important;
}

.special-overlay-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  left: 50% !important;
  max-height: 80vh;
  max-width: 760px;
  overflow: hidden;
  position: fixed !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(92vw, 760px);
  z-index: 1000000 !important;
}

.special-overlay-head {
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.special-overlay-body {
  max-height: calc(80vh - 70px);
  overflow: auto;
  padding: 14px 16px 18px;
}

.overtime-correction-panel {
  display: grid;
  gap: 14px;
}

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

.overtime-correction-stats div {
  background: #eef6ff;
  border: 1px solid #b8d7f7;
  border-radius: 10px;
  padding: 10px;
}

.overtime-correction-stats span,
.overtime-correction-field span {
  color: #51647a;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.overtime-correction-stats strong {
  color: #0f172a;
  font-size: 18px;
}

.overtime-correction-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 150px minmax(180px, 1fr) auto;
}

.overtime-correction-field input,
.overtime-correction-field select {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  color: #0f172a;
  font: inherit;
  min-height: 38px;
  padding: 7px 10px;
  width: 100%;
}

.overtime-correction-title {
  color: #0f172a;
  font-size: 15px;
  margin: 4px 0 0;
}

.overtime-correction-logs {
  display: grid;
  gap: 8px;
}

.overtime-correction-log {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #d8e2ed;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 10px;
}

.overtime-correction-log span {
  color: #51647a;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.overtime-correction-log--snapshot {
  background: #fff8ed;
  border-color: #f0bd73;
}

.overtime-correction-empty {
  color: #64748b;
  font-size: 13px;
}

/* =========================================================
   Login
   ========================================================= */

.login-overlay {
  align-items: center;
  backdrop-filter: blur(3px);
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 10px;
  position: fixed;
  z-index: 10000;
}

.login-overlay[hidden] {
  display: none !important;
}

.login-card {
  background: #ffffff;
  border: 2px solid #587a98;
  border-radius: 8px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.28);
  max-width: 520px;
  padding: 22px;
  width: 95%;
}

.login-brand {
  align-items: flex-start;
  border-bottom: 1px solid #d7e2ec;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
}

.login-clock-logo {
  background: #e8f3fb;
  border: 2px solid #2b6f9f;
  border-radius: 50%;
  box-sizing: border-box;
  display: inline-block;
  flex: 0 0 48px;
  height: 48px;
  position: relative;
  width: 48px;
}

.login-clock-logo::before,
.login-clock-logo::after {
  background: #2b6f9f;
  border-radius: 2px;
  content: '';
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.login-clock-logo::before {
  height: 4px;
  width: 4px;
}

.login-clock-logo::after {
  background: transparent;
  border: 1px solid rgba(43, 111, 159, 0.5);
  border-radius: 50%;
  height: 36px;
  width: 36px;
}

.login-clock-hand {
  background: #173f5c;
  border-radius: 2px;
  display: block;
  left: 50%;
  position: absolute;
  top: 50%;
  transform-origin: 50% 100%;
}

.login-clock-hand--hour {
  height: 12px;
  transform: translate(-50%, -100%) rotate(-38deg);
  width: 3px;
}

.login-clock-hand--minute {
  height: 17px;
  transform: translate(-50%, -100%) rotate(48deg);
  width: 2px;
}

.login-intro {
  min-width: 0;
}

.login-card h2 {
  color: #12263a;
  font-size: 24px;
  line-height: 1.15;
  margin: 1px 0 5px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}

.login-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  margin-bottom: 12px;
}

.login-name-field {
  grid-column: 1 / -1;
}

.login-name-preview {
  align-items: center;
  background: #f4f8fb;
  border: 1px solid #bccddd;
  border-radius: 7px;
  display: flex;
  font-weight: 700;
  min-height: 44px;
  padding: 9px 10px;
}

.login-card input {
  border-color: #aebfd0;
  border-radius: 7px;
  min-height: 44px;
}

.login-card input:focus {
  border-color: #2b6f9f;
  box-shadow: 0 0 0 3px rgba(43, 111, 159, 0.16);
  outline: 0;
}

.login-error {
  color: #b91c1c;
  display: none;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 8px;
}

.login-error.show {
  display: block;
}

.login-actions {
  border-top: 1px solid #d7e2ec;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 16px;
}

.login-actions button {
  border-radius: 7px;
  min-height: 42px;
  padding-left: 16px;
  padding-right: 16px;
}

.login-actions .primary {
  background: #255f87;
  border-color: #1f5073;
}

.login-actions .primary:hover,
.login-actions .primary:focus-visible {
  background: #1f5073;
  border-color: #183f5b;
}

.tech-user-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 170px;
  padding: 6px 10px;
}

.tech-user-display {
  font-weight: 700;
  line-height: 1.2;
}

/* =========================================================
   Toast / Save
   ========================================================= */

.toast {
  background: rgba(17, 24, 39, 0.95);
  border-radius: 10px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  color: #fff;
  display: none;
  padding: 10px 14px;
  position: fixed;
  right: 16px;
  z-index: 10001;
}

.save-hint {
  background: #111827;
  border-radius: 999px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  color: #fff;
  left: 50%;
  opacity: 0;
  padding: 8px 12px;
  pointer-events: none;
  position: fixed;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
  z-index: 10001;
}

.save-hint.show {
  opacity: 1;
}

#toastStack {
  bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  z-index: 10001 !important;
}

/* =========================================================
   Farben je Tätigkeit
   ========================================================= */

.s2-row-type td,
.s2-row-type .today-list-card {
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.s2-type-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.92em;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 10px;
  white-space: nowrap;
}

.s2-row-type.type-default td,
.s2-row-type.type-default .today-list-card {
  background: #ffffff;
}

.s2-type-badge.type-default {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #374151;
}

.s2-row-type.type-abendessen td,
.s2-row-type.type-abendessen .today-list-card {
  background: #ffe2b3;
}

.s2-type-badge.type-abendessen {
  background: #fdba74;
  border-color: #f97316;
  color: #7c2d12;
}

.s2-row-type.type-andere td,
.s2-row-type.type-andere .today-list-card {
  background: #f2f4f7;
}

.s2-type-badge.type-andere {
  background: #e5e7eb;
  border-color: #cbd5e1;
  color: #374151;
}

.s2-row-type.type-buero td,
.s2-row-type.type-buero .today-list-card {
  background: #f3f0ff;
}

.s2-type-badge.type-buero {
  background: #95e9ea9c;
  border-color: #075562;
  color: #2c5c96;
}

.s2-row-type.type-ferien td,
.s2-row-type.type-ferien .today-list-card {
  background: #e7f8e7;
}

.s2-type-badge.type-ferien {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.s2-row-type.type-inspection td,
.s2-row-type.type-inspection .today-list-card {
  background: #eefbf3;
}

.s2-type-badge.type-inspection {
  background: #f3e995;
  border-color: #98560a;
  color: #8b6614;
}

.s2-row-type.type-installation td,
.s2-row-type.type-installation .today-list-card {
  background: #e9fbf1;
}

.s2-type-badge.type-installation {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

.s2-row-type.type-key-account-installation td,
.s2-row-type.type-key-account-installation .today-list-card {
  background: #e4f7ee;
}

.s2-type-badge.type-key-account-installation {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #0f766e;
}

.s2-row-type.type-krank td,
.s2-row-type.type-krank .today-list-card {
  background: #ffe3e3;
}

.s2-type-badge.type-krank {
  background: #fecaca;
  border-color: #f87171;
  color: #991b1b;
}

.s2-row-type.type-mittag td,
.s2-row-type.type-mittag .today-list-card {
  background: #ffe8bf;
}

.s2-type-badge.type-mittag {
  background: #fed7aa;
  border-color: #fb923c;
  color: #9a3412;
}

.s2-row-type.type-pause td,
.s2-row-type.type-pause .today-list-card {
  background: #fff1cc;
}

.s2-type-badge.type-pause {
  background: #fde68a;
  border-color: #fbbf24;
  color: #92400e;
}

.s2-row-type.type-pikett td,
.s2-row-type.type-pikett .today-list-card {
  background: #fdeaea;
}

.s2-type-badge.type-pikett {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.s2-row-type.type-post td,
.s2-row-type.type-post .today-list-card {
  background: #fff4e8;
}

.s2-type-badge.type-post {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}

.s2-row-type.type-reparatur td,
.s2-row-type.type-reparatur .today-list-card {
  background: #eaf4ff;
}

.s2-type-badge.type-reparatur {
  background: #1a7afb2e;
  border-color: #3570b2;
  color: #3e5185;
}

.s2-row-type.type-support td,
.s2-row-type.type-support .today-list-card {
  background: #eaf0ff;
}

.s2-type-badge.type-support {
  background: #6995dc8c;
  border-color: #a5b4fc;
  color: #3f4a53;
}

.type-support-aktiv,
.s2-type-badge.type-support-aktiv {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  color: #000000;
}

.type-support-passiv,
.s2-type-badge.type-support-passiv {
  background: #ffedd5;
  border: 1px solid #90591e;
  color: #ee9023;
}

.s2-row-type.type-ueberzeit-bezug td,
.s2-row-type.type-ueberzeit-bezug .today-list-card {
  background: #f8ecff;
}

.s2-type-badge.type-ueberzeit-bezug {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #7e22ce;
}

.s2-row-type.type-wartezeit td,
.s2-row-type.type-wartezeit .today-list-card {
  background: #fff7db;
}

.s2-type-badge.type-wartezeit {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.s2-row-type.type-yoyo-payone td,
.s2-row-type.type-yoyo-payone .today-list-card {
  background: #eef6ff;
}

.s2-type-badge.type-yoyo-payone {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* =========================================================
   Druck / Report
   ========================================================= */

table.report th {
  background: #8fb9ef;
  color: #102235;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
}

.print-day,
.print-date {
  display: block;
  text-align: center;
}

.print-day {
  font-weight: 700;
  line-height: 1.05;
}

.print-date {
  font-size: 12px;
  line-height: 1.05;
  margin-top: 2px;
}

/* =========================================================
   Tablet / Mobile allgemein bis 1080px
   ========================================================= */

@media (max-width: 1080px) {
  .wrap {
    padding: 3px;
  }

  .card {
    border-radius: 14px;
    padding: 5px;
  }

  .card-head,
  .day-nav,
  .toolbar {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .date-wrap {
    text-align: center;
    width: 100%;
  }

  .day-label {
    min-width: 0;
    order: -1;
    width: 100%;
  }

  .tech-grid {
    grid-template-columns: 1fr;
  }

  .entry-head-center,
  .entry-head-left,
  .entry-head-right {
    width: 100%;
  }

  .s2-form-grid {
    align-items: end;
    gap: 10px;
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "daypart daypart"
      "message message"
      "add add";
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .s2-form-grid>label,
  .s2-form-grid>button,
  .s2-form-grid>div {
    min-width: 0;
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from;
  }

  .s2-form-grid label[for="s2To"] {
    grid-area: to;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type;
  }

.s2-form-grid label[for="s2Tid"] {
    grid-area: tid;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city;
  }

  .s2-form-grid #dayPartWrapS2 {
    grid-area: daypart;
  }

  .s2-form-grid #s2TimeConflictMessage {
    grid-area: message;
  }

  .s2-form-grid .s2-add-btn {
    grid-area: add;
    min-width: 0;
    width: 100%;
  }

  .s2-form-grid input,
  .s2-form-grid select {
    margin: 0;
    max-width: none;
    width: 100%;
  }

  .week-strip-wrap {
    grid-template-columns: 40px 1fr 40px;
  }

  .kw-chip {
    font-size: 14px;
    min-width: 120px;
  }

  .s2-mini-actions {
    justify-content: flex-start;
  }

  input,
  select {
    font-size: clamp(16px, 2vw, 18px) !important;
    padding: 6px 10px;
  }

  input#dateRefS2 {
    max-width: 130px;
  }
}

@media (max-width: 640px) {
  .wrap > .card.mb-10:first-child {
    border-radius: 16px;
    padding: 12px;
  }

  .toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .toolbar h2 {
    font-size: clamp(22px, 6vw, 26px);
    line-height: 1.05;
    margin: 0;
    order: 1;
  }

  .toolbar .spacer {
    display: block;
    flex: 1 1 auto;
    order: 1;
  }

  .toolbar .s2-workplaner-reminders {
    justify-content: flex-end;
    order: 1;
  }

  .toolbar .s2-workplaner-open {
    min-height: 38px;
    padding: 6px 10px;
  }

  body.s2-has-workplaner-reminders .toolbar h2 {
    display: none;
  }

  .toolbar .tech-user-box {
    order: 2;
  }

  .toolbar .tech-user-display {
    white-space: normal;
  }

  .login-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    border-radius: 16px;
    padding: 14px;
  }

  .login-actions {
    flex-direction: column;
  }

  .login-actions button {
    width: 100%;
  }

  .day-summary-box {
    border-radius: 16px;
    margin-top: 12px;
    padding: 10px;
  }

  .day-summary-grid,
  .day-summary-grid--compact {
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }

  .day-summary-pill {
    min-height: 58px;
    padding: 8px 6px;
  }

  .day-summary-grid--compact .day-summary-pill--entries {
    grid-column: auto;
  }

  .day-summary-value {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .time-inline {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-inline input[type="time"] {
    max-width: none;
  }
}

@media (max-width: 360px) {

  .day-summary-grid,
  .day-summary-grid--compact {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Zeit-Konflikt beim Erfassen
   ========================================================= */

.s2-time-conflict {
  animation: s2ConflictPulse 0.9s ease-in-out 1;
  border: 2px solid #dc2626 !important;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
  outline: none !important;
}

.s2-time-conflict-label {
  color: #b91c1c !important;
  font-weight: 800;
}

.s2-time-conflict-row td,
.s2-time-conflict-row .today-list-card {
  border-color: #dc2626 !important;
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.22) !important;
}

.s2-time-conflict-message {
  color: #b91c1c;
  display: none;
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 700;
  grid-column: 1 / -1;
  line-height: 1.35;
  margin-top: -4px;
  text-align: center;
}

.s2-time-conflict-message.show {
  display: block;
}

@keyframes s2ConflictPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }

  45% {
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.22);
  }

  100% {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
  }
}

/* =========================================================
   Tagesstunden als 3 kleine Cards
   ========================================================= */

.day-summary-box--cards {
  max-width: 550px;
  padding: 10px;
}

.day-summary-grid--three {
  display: grid;
  gap: 10px;
  grid-template-columns: 1.2fr 1fr 1fr;
  max-width: 100%;
  width: 100%;
}

.day-summary-pill--hours {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(95, 125, 153, 0.28);
}

.day-summary-pill--hours .day-hours-preview {
  color: #0f172a;
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 850;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 2px 0;
  text-align: center;
}

.day-summary-pill--hours .day-summary-sub {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.day-summary-grid--three .day-summary-pill {
  min-height: 76px;
}

@media (max-width: 700px) {
  .day-summary-grid--three {
    grid-template-columns: 1fr;
  }

  .day-summary-grid--three .day-summary-pill {
    min-height: 62px;
  }
}

@media (min-width: 701px) and (max-width: 980px) {
  .day-summary-grid--three {
    grid-template-columns: 1fr 1fr;
  }

  .day-summary-pill--hours {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   Tablet / kleiner Desktop: Formular optimieren
   901px bis 1180px
   ========================================================= */

@media (min-width: 901px) and (max-width: 1180px) {
  .wrap {
    padding: 8px 10px;
  }

  .card {
    padding: 12px;
  }

  .s2-form-grid {
    align-items: end;
    gap: 10px;
    grid-template-areas:
      "from to duration type tid add"
      "customer customer customer customer city city"
      "daypart daypart daypart message message message";
    grid-template-columns:
      120px 120px 130px minmax(190px, 1.2fr) minmax(130px, 0.8fr) 56px;
    width: 100%;
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from;
  }

  .s2-form-grid label[for="s2To"] {
    grid-area: to;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type;
  }

.s2-form-grid label[for="s2Tid"] {
    grid-area: tid;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city;
  }

  .s2-form-grid #dayPartWrapS2 {
    grid-area: daypart;
  }

  .s2-form-grid #s2TimeConflictMessage {
    grid-area: message;
  }

  .s2-form-grid .s2-add-btn {
    grid-area: add;
    height: 46px;
    justify-self: end;
    min-width: 56px;
    width: 56px;
  }

  .s2-form-grid input,
  .s2-form-grid select {
    min-width: 0;
    width: 100%;
  }

  .day-summary-box--cards {
    max-width: 700px;
  }

  .day-summary-grid--three {
    gap: 10px;
    grid-template-columns: 1.15fr 0.85fr 1fr;
  }
}

/* =========================================================
   Einträge heute - Desktop
   ========================================================= */

@media (min-width: 901px) {
  .s2-list-wrap {
    overflow-x: auto;
    width: 100%;
  }

  .s2-list-table {
    border-collapse: separate !important;
    border-spacing: 0 7px;
    display: table !important;
    table-layout: fixed !important;
    width: 100% !important;
  }

  .s2-list-table thead {
    display: table-header-group !important;
  }

  .s2-list-table tbody {
    display: table-row-group !important;
  }

  .s2-list-table thead th {
    background: #eef3f8;
    border: 0;
    border-bottom: 1px solid #cbd5e1;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.03em;
    padding: 8px 10px;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .s2-list-table tr.today-entry-row {
    display: table-row !important;
  }

  .s2-list-table tr.today-entry-row>td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 1px solid rgba(148, 163, 184, 0.35) !important;
    display: table-cell !important;
    font-size: 15px;
    padding: 8px 10px !important;
    text-align: center;
    vertical-align: middle !important;
  }

  .s2-list-table tr.today-entry-row>td:first-child {
    border-bottom-left-radius: 12px;
    border-left: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-top-left-radius: 12px;
    font-weight: 800;
    white-space: nowrap;
  }

  .s2-list-table tr.today-entry-row>td:last-child {
    border-bottom-right-radius: 12px;
    border-right: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-top-right-radius: 12px;
    white-space: nowrap;
  }

  .s2-list-table tr.today-entry-row>td:nth-child(2) {
    font-weight: 800;
    white-space: nowrap;
  }

  .s2-list-table tr.today-entry-row>td:nth-child(3),
  .s2-list-table tr.today-entry-row>td:nth-child(4) {
    font-weight: 650;
    text-align: center;
  }

  .s2-list-table tr.today-entry-row>td:nth-child(5) {
    white-space: nowrap;
  }

  .s2-mini-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: center;
  }

  .s2-mini-actions button {
    align-items: center;
    border-radius: 9px;
    display: inline-flex;
    font-size: 16px;
    height: 34px;
    justify-content: center;
    min-width: 36px;
    padding: 0;
    width: 36px;
  }

  .today-list-actions,
  .today-list-card,
  .today-list-card-cell,
  .today-list-line,
  .today-list-main,
  .today-list-top {
    all: unset;
  }

  .today-list-card-cell {
    display: table-cell !important;
  }
}

.s2-list-table tr.today-entry-row>td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.35) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 1px solid rgba(148, 163, 184, 0.35) !important;
  display: table-cell !important;
  font-size: 15px;
  padding: 8px 10px !important;
  text-align: center;
  vertical-align: middle !important;
}

/* =========================================================
   Handy: Zeit-Inputs max. 125px + 3 Tages-Cards nebeneinander
   ========================================================= */

@media (max-width: 520px) {
  .entry-head {
    gap: 8px !important;
    margin-bottom: 6px !important;
    padding: 0 !important;
  }

  .day-summary-box,
  .day-summary-box--cards {
    margin-top: 8px !important;
    padding: 6px !important;
  }

  /* Tagesstart / Tagesende: nur Inputs max. 125px */
  .time-inline {
    display: grid !important;
    gap: 8px !important;
    grid-template-columns: 1fr 1fr !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .time-inline>div {
    min-width: 0 !important;
    width: 100% !important;
  }

  .time-inline input[type="time"] {
    justify-self: center !important;
    max-width: 125px !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding-bottom: 3px !important;
    padding-top: 3px !important;
    width: 100% !important;
  }

  /* Von / Bis: Inputs max. 125px */
  .s2-form-grid input[type="time"] {
    max-width: 125px !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding-bottom: 3px !important;
    padding-top: 3px !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2From"] input,
  .s2-form-grid label[for="s2To"] input {
    justify-self: stretch !important;
    max-width: 125px !important;
  }

  /* Von / Bis / Dauer / Tätigkeit bleiben nebeneinander */
  .s2-form-grid {
    display: grid !important;
    gap: 10px 12px !important;
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "daypart daypart"
      "message message"
      "add add" !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from;
  }

  .s2-form-grid label[for="s2To"] {
    grid-area: to;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type;
  }

.s2-form-grid label[for="s2Tid"] {
    grid-area: tid;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city;
  }

  .s2-form-grid #dayPartWrapS2 {
    grid-area: daypart;
  }

  .s2-form-grid #s2TimeConflictMessage {
    grid-area: message;
  }

  .s2-form-grid .s2-add-btn {
    grid-area: add;
  }

  /* Kunde, Ort, Meldung, Button volle Breite */
  .s2-form-grid label[for="s2Customer"],
  .s2-form-grid label[for="s2City"],
  .s2-form-grid #dayPartWrapS2,
  .s2-form-grid #s2TimeConflictMessage,
  .s2-form-grid .s2-add-btn {
    grid-column: 1 / -1;
    max-width: none !important;
    width: 100% !important;
  }

  /* 3 Cards: Tagesstunden / Einträge / Fahrstunden nebeneinander */
  .day-summary-grid--three {
    display: grid !important;
    gap: 6px !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
  }

  .day-summary-grid--three .day-summary-pill {
    min-height: 54px !important;
    padding: 4px 4px !important;
  }

  .day-summary-label {
    font-size: 0.62rem !important;
    line-height: 1.05 !important;
  }

  .day-summary-value,
  .day-summary-pill--hours .day-hours-preview {
    font-size: 1rem !important;
    line-height: 1.05 !important;
  }

  /* Infotext unter Tagesstunden ausblenden */
  .day-summary-pill--hours .day-summary-sub {
    display: none !important;
  }
}

/* System2: Tabellen-Spalten exakt ausrichten + aktive Tageszeile markieren */
.s2-list-wrap,
.week-table-wrap {
  overflow-x: auto;
}

.s2-list-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
}

.s2-list-table td,
.s2-list-table th {
  box-sizing: border-box;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.s2-list-table thead th {
  position: relative;
  z-index: 1;
}


@media (min-width: 901px) {
  .week-overview-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
  }

  .week-overview-table .col-week-day {
    width: 15%;
  }

  .week-overview-table .col-week-net {
    width: 11%;
  }

  .week-overview-table .col-week-work {
    width: 11%;
  }

  .week-overview-table .col-week-active {
    width: 13%;
  }

  .week-overview-table .col-week-passive {
    width: 13%;
  }

  .week-overview-table .col-week-break {
    width: 10%;
  }

  .week-overview-table .col-week-drive {
    width: 10%;
  }

  .week-overview-table .col-week-pikett {
    width: 8%;
  }

  .week-overview-table .col-week-over42 {
    width: 9%;
  }
}

.week-overview-table tr.is-selected-day td:first-child {
  border-left: 4px solid #60b5f4 !important;
}

.week-overview-table tr.is-selected-day td:last-child {
  border-right: 4px solid #60b5f4 !important;
}

.week-overview-table tr.is-selected-day td {
  background: rgba(96, 181, 244, 0.08) !important;
  border-bottom: 4px solid #60b5f4 !important;
  border-top: 4px solid #60b5f4 !important;
}

.week-overview-table tr.is-selected-day>td:first-child {
  border-bottom-left-radius: 10px;
  border-top-left-radius: 10px;
  font-weight: 700;
}

.week-overview-table tr.is-selected-day>td:last-child {
  border-bottom-right-radius: 10px;
  border-top-right-radius: 10px;
}

/* =========================================================
   Mobile Fix: Übersicht Woche + KW-Übersicht
   ========================================================= */

@media (max-width: 900px) {
  .week-table-wrap {
    max-width: 100% !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }

  .week-overview-table {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    min-width: 0 !important;
    table-layout: auto !important;
    width: 100% !important;
  }

  .week-overview-table colgroup,
  .week-overview-table thead {
    display: none !important;
  }

  .week-overview-table,
  .week-overview-table tbody,
  .week-overview-table tr,
  .week-overview-table td {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }


  .week-overview-table tbody tr {
    background: #fff !important;
    border: 1px solid #d9e1ea !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    margin: 0 0 12px 0 !important;
    overflow: hidden;
    padding: 10px !important;
    position: relative;
  }

  .week-overview-table tbody tr.week-day-complete {
    border-color: #38cb6e !important;
    box-shadow: 0 0 0 1px rgba(56, 203, 110, 0.45), 0 4px 12px rgba(15, 23, 42, 0.06);
  }

  .week-overview-table tbody tr.week-day-incomplete {
    border-color: #ff981a !important;
    box-shadow: 0 0 0 1px rgba(255, 152, 26, 0.42), 0 4px 12px rgba(15, 23, 42, 0.06);
  }

  .week-overview-table tbody tr.week-day-incomplete::before {
    border-left: 4px solid #ff981a;
    border-top: 4px solid #ff981a;
    border-top-left-radius: 16px;
    content: "";
    inset: -1px auto auto -1px;
    height: calc(50% + 1px);
    pointer-events: none;
    position: absolute;
    width: calc(50% + 1px);
    z-index: 1;
  }
  .week-overview-table tbody tr.week-day-complete::after,
  .week-overview-table tbody tr.week-day-incomplete::after {
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    content: "";
    height: 96px;
    inset: 0 0 auto 0;
    pointer-events: none;
    position: absolute;
    z-index: 0;
  }

  .week-overview-table tbody tr.week-day-complete::after {
    background: linear-gradient(
      180deg,
      rgba(56, 203, 110, 0.13) 0%,
      rgba(56, 203, 110, 0.05) 34%,
      rgba(56, 203, 110, 0.00) 100%
    );
  }

  .week-overview-table tbody tr.week-day-incomplete::after {
    background: linear-gradient(
      180deg,
      rgba(255, 152, 26, 0.20) 0%,
      rgba(255, 152, 26, 0.08) 34%,
      rgba(255, 152, 26, 0.00) 100%
    );
  }



  .week-overview-table tbody tr.is-selected-day.week-day-complete,
  .week-overview-table tbody tr.is-selected-day.week-day-incomplete {
    border-color: #60b5f4 !important;
    box-shadow: 0 0 0 1px rgba(96, 181, 244, 0.55), 0 4px 12px rgba(15, 23, 42, 0.06) !important;
  }

  .week-overview-table tbody tr.is-selected-day.week-day-incomplete::before {
    display: none;
  }

  .week-overview-table tbody tr.is-selected-day.week-day-complete::after {
    background: linear-gradient(
      180deg,
      rgba(56, 203, 110, 0.10) 0%,
      rgba(56, 203, 110, 0.04) 34%,
      rgba(56, 203, 110, 0.00) 100%
    );
  }

  .week-overview-table tbody tr.is-selected-day.week-day-incomplete::after {
    background: linear-gradient(
      180deg,
      rgba(255, 152, 26, 0.16) 0%,
      rgba(255, 152, 26, 0.06) 34%,
      rgba(255, 152, 26, 0.00) 100%
    );
  }

  .week-overview-table tbody tr.is-selected-day.week-day-complete > td.week-day-cell,
  .week-overview-table tbody tr.is-selected-day.week-day-complete > td:first-child {
    background: linear-gradient(
      180deg,
      rgba(56, 203, 110, 0.10) 0%,
      rgba(56, 203, 110, 0.04) 34%,
      rgba(56, 203, 110, 0.00) 100%
    ) !important;
  }

  .week-overview-table tbody tr.is-selected-day.week-day-incomplete > td.week-day-cell,
  .week-overview-table tbody tr.is-selected-day.week-day-incomplete > td:first-child {
    background: linear-gradient(
      180deg,
      rgba(255, 152, 26, 0.16) 0%,
      rgba(255, 152, 26, 0.06) 34%,
      rgba(255, 152, 26, 0.00) 100%
    ) !important;
  }  .week-overview-table tbody tr.week-day-complete > td,
  .week-overview-table tbody tr.week-day-incomplete > td {
    position: relative;
    z-index: 1;
  }

  .week-overview-table tbody td {
    background: transparent !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
  }

  .week-overview-table tbody td.week-day-cell,
  .week-overview-table tbody td:first-child {
    border-bottom: 1px solid #e5e7eb !important;
    margin-bottom: 8px !important;
    padding-bottom: 8px !important;
    text-align: center !important;
  }

  .week-overview-table tbody tr.week-day-complete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-complete > td:first-child,
  .week-overview-table tbody tr.week-day-incomplete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-incomplete > td:first-child {
    box-sizing: border-box !important;
    margin: -10px -10px 8px -10px !important;
    padding: 10px 10px 9px 10px !important;
    max-width: none !important;
    width: calc(100% + 20px) !important;
  }

  .week-overview-table tbody tr.week-day-complete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-complete > td:first-child {
    background: linear-gradient(
      180deg,
      rgba(56, 203, 110, 0.13) 0%,
      rgba(56, 203, 110, 0.05) 34%,
      rgba(56, 203, 110, 0.00) 100%
    ) !important;
    border-bottom-color: rgba(56, 203, 110, 0.20) !important;
  }

  .week-overview-table tbody tr.week-day-incomplete > td.week-day-cell,
  .week-overview-table tbody tr.week-day-incomplete > td:first-child {
    background: linear-gradient(
      180deg,
      rgba(255, 152, 26, 0.20) 0%,
      rgba(255, 152, 26, 0.08) 34%,
      rgba(255, 152, 26, 0.00) 100%
    ) !important;
    border-bottom-color: rgba(255, 152, 26, 0.28) !important;
  }
  .week-overview-table tbody td.week-day-cell .week-date-btn {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
    padding: 0 !important;
  }

  .week-overview-table tbody tr>td:not(.week-day-cell):not(:first-child) {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 6px !important;
    padding: 8px 10px !important;
    text-align: left !important;
  }

  .week-overview-table tbody tr>td:not(.week-day-cell):not(:first-child)::before {
    color: #64748b;
    content: attr(data-label) !important;
    display: inline-block !important;
    font-size: 13px;
    font-weight: 700;
    margin-right: 10px;
  }

  .week-overview-table th,
  .week-overview-table td {
    white-space: normal !important;
  }

  .week-stat-label {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
  }

  .week-stat-value {
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    margin-left: auto;
    text-align: right;
  }

  .week-overview-table tbody tr>td.week-stat-cell.mobile-empty-cell {
    display: none !important;
  }
}

/* =========================================================
   Mobile Fix: KW-Übersicht
   ========================================================= */

@media (max-width: 900px) {
  .year-overview-table {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    min-width: 0 !important;
    table-layout: auto !important;
    width: 100% !important;
  }

  .year-overview-table colgroup,
  .year-overview-table thead {
    display: none !important;
  }

  .year-overview-table,
  .year-overview-table tbody,
  .year-overview-table tr,
  .year-overview-table td {
    box-sizing: border-box !important;
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .year-overview-table tbody tr {
    background: #fff !important;
    border: 1px solid #d9e1ea !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    margin: 0 0 12px 0 !important;
    overflow: hidden;
    padding: 10px !important;
  }

  .year-overview-table tbody td {
    align-items: center !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    display: flex !important;
    justify-content: space-between !important;
    margin-top: 6px !important;
    padding: 8px 10px !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .year-overview-table tbody td::before {
    color: #64748b;
    display: inline-block !important;
    font-size: 13px;
    font-weight: 700;
    margin-right: 10px;
  }

  .year-overview-table tbody td:nth-child(1)::before {
    content: "Zeitraum";
  }

  .year-overview-table tbody td:nth-child(2)::before {
    content: "Zeit";
  }

  .year-overview-table tbody td:nth-child(3)::before {
    content: "Abwesenheit";
  }

  .year-overview-table tbody td:nth-child(4)::before {
    content: "Überzeit";
  }

  .year-overview-table tbody td:first-child {
    background: #eef3f8 !important;
    font-weight: 800;
  }

  .year-overview-table td.kw-cell button {
    text-align: right !important;
  }
}

/* =========================================================
   Jahres-Balkendiagramm Arbeitszeit
   ========================================================= */

.year-work-chart {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  min-height: 220px;
  padding: 12px 4px 4px;
}

.year-work-chart__item {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.year-work-chart__value {
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  min-height: 28px;
  text-align: center;
  writing-mode: vertical-rl;
}

.year-work-chart__bar-wrap {
  align-items: end;
  background: #eef3f8;
  border: 1px solid #d9e1ea;
  border-radius: 999px;
  display: flex;
  height: 130px;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

.year-work-chart__bar {
  background: #2bb673;
  border-radius: 999px 999px 0 0;
  min-height: 4px;
  width: 100%;
}

.year-work-chart__label {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 700px) {
  .year-work-chart {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .year-work-chart__item {
    min-width: 42px;
  }

  .year-work-chart__bar-wrap {
    height: 120px;
  }
}

h3 {
  font-size: clamp(14px, 2vw, 16px);
}

.year-work-chart {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(12, minmax(70px, 1fr));
  min-height: 310px;
  overflow-x: auto;
  padding: 35px 26px 14px;
}

.year-work-chart__item {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.year-work-chart__value {
  color: #1f3556;
  font-size: 14px;
  min-height: 18px;
}

.year-work-chart__bar-wrap {
  align-items: end;
  background: #f6f7f9;
  border: 1px solid #dfe4ec;
  border-radius: 14px;
  display: flex;
  height: 270px;
  justify-content: center;
  overflow: hidden;
  padding: 7px;
  width: 88px;
}

.year-work-chart__bar {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 10px;
  min-height: 6px;
  width: 100%;
}

.year-work-chart__label {
  font-size: 15px;
  font-weight: 700;
}

.year-work-chart {
  align-items: end;
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(12, minmax(90px, 1fr));
  min-height: 330px;
  overflow-x: auto;
  padding: 28px 14px 10px;
}

.year-work-chart__item {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-rows: 20px 20px 230px 24px;
  justify-items: center;
  min-width: 90px;
}

.year-work-chart__target {
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.year-work-chart__overtime {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.year-work-chart__correction {
  background: #fff7ed;
  border: 1px solid #f0bd73;
  border-radius: 999px;
  color: #9a3412;
  display: inline-block;
  font-size: 10px;
  margin-left: 4px;
  padding: 1px 5px;
  vertical-align: 1px;
}

.year-work-chart__overtime.is-minus {
  color: #dc2626;
}

.year-work-chart__overtime.is-plus {
  color: #059669;
}

.year-work-chart__bar-wrap {
  background: #f3f4f6;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  height: 230px;
  overflow: hidden;
  position: relative;
  width: 90px;
}

.year-work-chart__bar-fill {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 10px;
  bottom: 8px;
  left: 8px;
  position: absolute;
  right: 8px;
}

.year-work-chart__bar-text {
  align-items: flex-end;
  bottom: 16px;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  left: 8px;
  overflow: hidden;
  position: absolute;
  right: 8px;
  text-align: center;
  white-space: nowrap;
}

.year-work-chart__bar-text.black {
  color: #111827;
  height: calc(100% - 32px);
}

.year-work-chart__bar-text.white {
  bottom: 16px;
  color: #ffffff;
}

.year-work-chart__label {
  color: #020617;
  font-size: 16px;
  font-weight: 800;
}

.year-work-chart__item.is-current-month .year-work-chart__bar-wrap {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.year-work-chart__item.is-current-month .year-work-chart__label {
  color: #1d4ed8;
}

.year-work-chart__bar-fill {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  border-radius: 10px;
  bottom: 8px;
  left: 8px;
  max-height: calc(100% - 16px);
  position: absolute;
  right: 8px;
}

.year-work-chart__overtime.is-empty {
  visibility: hidden;
}

@media (max-width: 700px) {
  .year-work-chart {
    gap: 16px;
    grid-template-columns: repeat(12, 56px);
    padding: 24px 18px 12px;
    scroll-padding-inline: 18px;
  }

  .year-work-chart__item {
    grid-template-rows: 20px 20px 210px 24px;
    min-width: 65px;
  }

  .year-work-chart__bar-wrap {
    border-radius: 12px;
    height: 210px;
    width: 70px;
  }

  .year-work-chart__bar-fill,
  .year-work-chart__bar-text {
    left: 4px;
    right: 4px;
  }

  .year-work-chart__label {
    font-size: 14px;
  }

  .year-work-chart__target,
  .year-work-chart__overtime {
    font-size: 11px;
  }

  .overtime-correction-stats,
  .overtime-correction-form {
    grid-template-columns: 1fr;
  }

  .overtime-correction-log {
    align-items: flex-start;
  }
}

.s2-article-box {
  grid-area: article;
  min-width: 0;
}

.s2-form-grid label[for="s2Info"] {
  grid-area: info;
}

.s2-article-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(160px, 1fr) minmax(95px, .55fr) 72px;
}

.s2-article-picker {
  min-width: 0;
  position: relative;
}

.s2-article-results {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .18);
  left: 0;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
}

.s2-article-result {
  align-items: center;
  border-radius: 6px;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 1fr auto;
  margin: 0;
  padding: 6px 8px;
  text-align: left;
  width: 100%;
}

.s2-article-result small {
  color: #475569;
  grid-column: 1 / -1;
}

.s2-article-result.is-low {
  background: #fee4e2;
  border-color: #d92d20;
  color: #b42318;
}

.s2-article-result.is-near-low {
  background: #fff4e5;
  border-color: #f79009;
  color: #b54708;
}

.s2-article-result.is-ok {
  background: #ecfdf3;
  border-color: #12b76a;
  color: #067647;
}

.s2-article-result.is-empty {
  color: var(--muted);
  cursor: default;
  display: block;
}

.s2-article-inline,
.today-list-line--article,
.s2-entry-info,
.today-list-line--info {
  color: #0f7c8b;
  font-weight: 800;
}

.today-list-line--tid {
  margin-top: 2px;
}

.s2-entry-tid-row {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.s2-entry-tid-label {
  color: #111827;
  font-size: 1em;
  line-height: 1.2;
  margin-right: 4px;
}

.s2-entry-tid-links {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.s2-entry-tid-link {
  display: inline-flex;
  font-size: 1em !important;
  line-height: 1.2;
}

.s2-article-inline,
.today-list-line--article {
  overflow-wrap: anywhere;
  white-space: pre-line;
  word-break: break-word;
}

.s2-scs-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.s2-scs-link:hover,
.s2-scs-link:focus-visible {
  color: #075985;
}

@media (max-width: 900px) {
  .s2-day-nav-sticky {
    background: rgba(255, 255, 255, 0.97);
    margin: 0 0 6px !important;
    padding: 2px 0 4px !important;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 220;
  }

  .s2-day-remark-toggle {
    margin-bottom: 2px !important;
  }

  .s2-day-remark-toggle .ghost {
    border-radius: 9px !important;
    font-size: 14px !important;
    min-height: 30px !important;
    padding: 3px 10px !important;
  }

  .s2-day-nav-sticky .day-nav {
    border-radius: 9px !important;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.10);
    gap: 6px !important;
    margin: 0 auto !important;
    max-width: 344px !important;
    padding: 4px 8px !important;
  }

  .s2-day-nav-sticky .day-date-picker {
    min-height: 34px !important;
    padding: 0 6px !important;
  }

  .s2-day-nav-sticky #dayLabelS2,
  .s2-day-nav-sticky .day-label {
    font-size: 14px !important;
    line-height: 1.1 !important;
    min-height: 34px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-day-nav-sticky .day-nav .ghost {
    height: 34px !important;
    min-height: 34px !important;
    min-width: 34px !important;
    width: 34px !important;
  }

  .s2-day-nav-sticky.is-fixed {
    box-sizing: border-box !important;
    position: fixed !important;
  }

  .s2-day-nav-sticky-placeholder[hidden] {
    display: none !important;
  }
}

.s2-list-table td {
  overflow-wrap: anywhere;
}

.s2-list-table tbody tr.today-entry-row td:nth-child(4) {
  text-align: left;
  white-space: normal;
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "info info info article article article article article"
      "daypart daypart message message message message message message" !important;
  }
}

@media (max-width: 900px) {
  .s2-article-grid {
    grid-template-columns: 1fr;
  }

  .s2-form-grid {
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }
}

/* Final layout overrides for Infos + Artikel row */
.s2-form-grid label[for="s2Info"],
.s2-article-box {
  align-self: start;
}

.s2-article-box>.label-mini {
  display: block;
  margin-bottom: 6px;
  min-height: 17px;
}

.s2-article-grid {
  align-items: start;
  grid-template-columns: minmax(130px, 1fr) 92px 64px;
}

@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-areas:
      "from to duration type tid customer city add"
      "info info info info article article article article"
      "daypart daypart message message message message message message" !important;
  }

  .s2-article-picker {
    max-width: 230px;
  }
}

@media (max-width: 900px) {
  .s2-form-grid {
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-article-grid {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .s2-article-picker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .s2-article-grid {
    grid-template-columns: minmax(120px, 1fr) 92px 64px !important;
  }

  .s2-article-picker {
    grid-column: auto !important;
  }
}

/* =========================================================
   Artikel-Auswahl: Artikel / Lager / Anzahl nebeneinander
   ========================================================= */

.s2-article-box {
  max-width: 718px !important;
  width: 100% !important;
}

.s2-article-row {
  align-items: center !important;
  display: grid !important;
  gap: 8px !important;
  grid-template-columns: minmax(180px, 359px) 92px 64px !important;
  justify-content: start !important;
  width: 100% !important;
}

.s2-article-picker {
  grid-column: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  position: relative !important;
  width: 100% !important;
}

.s2-article-picker input {
  min-width: 0 !important;
  width: 100% !important;
}

.s2-article-location {
  min-width: 0 !important;
  width: 92px !important;
}

.s2-article-qty {
  min-width: 0 !important;
  width: 64px !important;
}

#s2ArticleLocation,
#s2ArticleQty {
  max-width: none !important;
}

.s2-selected-articles {
  display: grid;
  gap: 6px;
  margin-top: 3px;
}

.s2-selected-articles:empty {
  display: none;
}

.s2-workplaner-reminders {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-start;
  margin: 0;
}

.s2-workplaner-open {
  align-items: center;
  background: #fff8e8;
  border: 2px solid #f4bc62;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(120, 80, 20, 0.08);
  color: #16213a;
  cursor: pointer;
  display: flex;
  font-weight: 800;
  gap: 10px;
  justify-content: center;
  min-height: 40px;
  padding: 7px 12px;
}

.s2-workplaner-open strong {
  align-items: center;
  background: #ffffff;
  border: 1px solid #f2c779;
  border-radius: 999px;
  color: #8a4e00;
  display: inline-flex;
  font-size: 0.85rem;
  height: 26px;
  justify-content: center;
  min-width: 30px;
  padding: 0 9px;
}

.s2-workplaner-reminder-overlay {
  align-items: center;
  background: rgba(7, 15, 30, 0.58);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 2000003;
}

.s2-workplaner-reminder-panel {
  background: #fff8e8;
  border: 2px solid #f4bc62;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(7, 15, 30, 0.35);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 12px;
  width: min(620px, 94vw);
}

.s2-workplaner-reminder-head {
  align-items: center;
  color: #16213a;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.s2-workplaner-reminder-head h3 {
  font-size: 1rem;
  margin: 0;
}

.s2-workplaner-list {
  display: grid;
  gap: 8px;
}

.s2-workplaner-card {
  background: #ffffff;
  border: 1px solid #e8b65e;
  border-radius: 8px;
  color: #14213d;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.s2-workplaner-card:hover,
.s2-workplaner-card:focus-visible {
  border-color: #d18a18;
  box-shadow: 0 0 0 3px rgba(244, 188, 98, 0.3);
  outline: none;
}

.s2-workplaner-card-title {
  font-weight: 800;
}

.s2-workplaner-card-meta,
.s2-workplaner-card-note {
  color: #5b6475;
  font-size: 0.88rem;
  line-height: 1.3;
}

.s2-selected-article {
  align-items: center;
  background: rgba(15, 23, 42, .05);
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 34px;
  padding: 6px 8px;
}

.s2-selected-article strong {
  display: block;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.s2-selected-article small {
  color: #6b7280;
  display: block;
  font-size: 11px;
}

.s2-selected-article button {
  align-items: center;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  color: #991b1b;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 26px;
}

/* Handy: bleibt trotzdem nebeneinander */
@media (max-width: 900px) {
  .s2-article-box {
    max-width: 100% !important;
  }

  .s2-article-row {
    grid-template-columns: minmax(0, 1fr) 82px 58px !important;
  }

  .s2-article-location {
    width: 82px !important;
  }

  .s2-article-qty {
    width: 58px !important;
  }
}

@media (max-width: 390px) {
  .s2-article-row {
    gap: 5px !important;
    grid-template-columns: minmax(0, 1fr) 74px 54px !important;
  }

  .s2-article-location {
    width: 74px !important;
  }

  .s2-article-qty {
    width: 54px !important;
  }
}

/* Feiertag-Zeile in "Einträge heute" wie normale Tabellenzeile */
@media (min-width: 901px) {
  .s2-list-table tr.s2-auto-holiday-row {
    display: table-row !important;
  }

  .s2-list-table tr.s2-auto-holiday-row>td {
    background: #fffaf0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 1px solid rgba(148, 163, 184, 0.35) !important;
    display: table-cell !important;
    font-size: 15px !important;
    padding: 8px 10px !important;
    text-align: center !important;
    vertical-align: middle !important;
  }

  .s2-list-table tr.s2-auto-holiday-row>td:first-child {
    border-bottom-left-radius: 12px !important;
    border-left: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-top-left-radius: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }

  .s2-list-table tr.s2-auto-holiday-row>td:last-child {
    border-bottom-right-radius: 12px !important;
    border-right: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-top-right-radius: 12px !important;
    white-space: nowrap !important;
  }

  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(2),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(3),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(4) {
    font-weight: 800 !important;
  }

  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(1),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(2),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(4),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(5),
  .s2-list-table tr.s2-auto-holiday-row>td:nth-child(6) {
    white-space: nowrap !important;
  }
}

@media (max-width: 900px) {
  .s2-auto-holiday-card {
    background: #fff8e6 !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
  }

  .s2-auto-holiday-card .today-list-actions {
    align-items: center !important;
    justify-content: center !important;
  }

  .s2-auto-holiday-card .s2-auto-holiday-chip {
    color: #92400e !important;
    white-space: nowrap !important;
  }
}

/* Handy: Info-Text in Einträge-heute-Card sauber umbrechen */
@media (max-width: 900px) {

  .today-list-line--info,
  .today-list-line--article {
    display: block !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    word-break: break-word !important;
  }

  .today-list-main {
    min-width: 0 !important;
    overflow: hidden !important;
  }
}

/* SCS-Links im Info-Text */
.s2-scs-link {
  color: #0f5fa8 !important;
  font-weight: 900 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.s2-scs-link:hover {
  color: #0b4a84 !important;
}

/* Infos-Feld mehrzeilig */
#s2Info {
  line-height: 1.35 !important;
  min-height: 44px !important;
  overflow-wrap: anywhere !important;
  resize: vertical !important;
  white-space: pre-wrap !important;
  word-break: break-word !important;
}

/* Auf dem Handy etwas höher */
@media (max-width: 900px) {
  #s2Info {
    min-height: 76px !important;
  }
}

/* Mobile: compact left form column, wider right form column */
@media (max-width: 900px) {
  .s2-form-grid {
    grid-template-columns: minmax(88px, 112px) minmax(0, 1fr) !important;
    grid-template-areas:
      "from to"
      "duration type"
      "tid customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-form-grid label[for="s2From"],
  .s2-form-grid label[for="s2Duration"],
  .s2-form-grid label[for="s2Tid"] {
    max-width: 112px !important;
  }

  .s2-form-grid label[for="s2Type"],
  .s2-form-grid label[for="s2Customer"] {
    min-width: 0 !important;
  }
}

/* Mobile: explicit field placement for compact/wide form columns */
@media (max-width: 900px) {
  .s2-form-grid {
    grid-template-columns: minmax(88px, 112px) minmax(0, 1fr) !important;
    grid-template-areas:
      "from to"
      "duration type"
      "tid customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from !important;
  }

  .s2-form-grid label[for="s2To"] {
    grid-area: to !important;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration !important;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type !important;
  }

  .s2-form-grid label[for="s2Tid"] {
    grid-area: tid !important;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer !important;
  }

  .s2-form-grid label[for="s2From"],
  .s2-form-grid label[for="s2Duration"],
  .s2-form-grid label[for="s2Tid"] {
    grid-column: auto !important;
    max-width: 112px !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2To"],
  .s2-form-grid label[for="s2Type"],
  .s2-form-grid label[for="s2Customer"] {
    grid-column: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city !important;
  }

  .s2-form-grid label[for="s2Info"] {
    grid-area: info !important;
  }

  .s2-article-box {
    grid-area: article !important;
  }
}

/* Desktop: wider TID column and compact TID suggestions */
@media (min-width: 901px) {
  .s2-form-grid {
    grid-template-columns:
      110px 110px 110px minmax(160px, 0.92fr) 188px minmax(145px, 1fr) minmax(118px, 0.68fr) 56px !important;
  }
}

.s2-memory-option[data-kind="tid"] {
  align-items: start;
  display: block;
  min-height: 0;
  padding: 6px 28px 6px 8px;
  position: relative;
}

.s2-memory-option[data-kind="tid"] span:first-child {
  display: block;
  min-width: 0;
}

.s2-memory-option[data-kind="tid"] strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.s2-memory-option[data-kind="tid"] .s2-memory-meta {
  display: block;
  font-size: 11px !important;
  line-height: 1.15;
  margin-top: 2px;
}

.s2-memory-option[data-kind="tid"] .s2-memory-delete {
  height: 22px;
  position: absolute;
  right: 4px;
  top: 4px;
  width: 22px;
}

/* Mobile: TID, Kunde und Ort jeweils eigene Zeile */
@media (max-width: 900px) {
  .s2-form-grid {
    gap: 12px 10px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-form-grid label[for="s2From"],
  .s2-form-grid label[for="s2To"],
  .s2-form-grid label[for="s2Duration"],
  .s2-form-grid label[for="s2Type"] {
    grid-column: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2Tid"],
  .s2-form-grid label[for="s2Customer"],
  .s2-form-grid label[for="s2City"] {
    grid-column: 1 / -1 !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2Tid"] {
    grid-area: tid !important;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer !important;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city !important;
  }

  .s2-form-grid input[type="time"],
  .s2-form-grid label[for="s2From"] input,
  .s2-form-grid label[for="s2To"] input {
    box-sizing: border-box !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

.s2-memory-option[data-kind="tid"] .s2-memory-last-use {
  background: rgba(47, 128, 237, 0.08);
  border-radius: 6px;
  color: #344861;
  display: none;
  font-size: 11px !important;
  line-height: 1.25;
  margin-top: 5px;
  padding: 4px 6px;
  white-space: normal;
}

.s2-memory-option[data-kind="tid"]:hover .s2-memory-last-use,
.s2-memory-option[data-kind="tid"]:focus-visible .s2-memory-last-use,
.s2-memory-option[data-kind="tid"].is-active .s2-memory-last-use,
.s2-memory-option[data-kind="tid"]:active .s2-memory-last-use {
  display: block;
}

/* Artikel: Lager-Auswahl minimal breiter */
.s2-article-row {
  grid-template-columns: minmax(180px, 351px) 100px 64px !important;
}

.s2-article-location {
  min-width: 100px !important;
  width: 100px !important;
}

/* TID: Detaildaten duerfen unter dem Loesch-X mehr Breite nutzen */
.s2-memory-option[data-kind="tid"] {
  padding-right: 8px !important;
}

.s2-memory-option[data-kind="tid"] strong {
  padding-right: 24px;
}

.s2-memory-option[data-kind="tid"] .s2-memory-last-use {
  box-sizing: border-box;
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
}

/* Mobile final input layout and inline clear buttons */
@media (max-width: 900px) {
  .s2-form-grid {
    gap: 10px 10px !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    grid-template-areas:
      "from to"
      "duration type"
      "tid tid"
      "customer customer"
      "city city"
      "info info"
      "article article"
      "daypart daypart"
      "message message"
      "add add" !important;
  }

  .s2-form-grid label[for="s2From"],
  .s2-form-grid label[for="s2To"],
  .s2-form-grid label[for="s2Duration"],
  .s2-form-grid label[for="s2Type"],
  .s2-form-grid label[for="s2Tid"],
  .s2-form-grid label[for="s2Customer"],
  .s2-form-grid label[for="s2City"] {
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid label[for="s2From"] {
    grid-area: from !important;
  }


  .s2-form-grid label[for="s2To"] {
    grid-area: to !important;
  }

  .s2-form-grid label[for="s2Duration"] {
    grid-area: duration !important;
  }

  .s2-form-grid label[for="s2Type"] {
    grid-area: type !important;
  }

  .s2-form-grid label[for="s2Tid"] {
    grid-area: tid !important;
  }

  .s2-form-grid label[for="s2Customer"] {
    grid-area: customer !important;
  }

  .s2-form-grid label[for="s2City"] {
    grid-area: city !important;
  }

  .s2-form-grid label[for="s2From"] input,
  .s2-form-grid label[for="s2To"] input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box !important;
    display: block !important;
    font-size: 16px !important;
    height: 44px !important;
    line-height: normal !important;
    max-width: 100% !important;
    min-height: 44px !important;
    min-width: 0 !important;
    padding-left: 8px !important;
    padding-right: 6px !important;
    width: 100% !important;
  }

  .s2-clearable-field {
    position: relative !important;
  }

  .s2-clearable-field input.has-mobile-clear {
    padding-right: 34px !important;
  }

  .s2-input-clear {
    align-items: center;
    background: #eef4fb;
    border: 1px solid #c9d7e6;
    border-radius: 999px;
    color: #64748b;
    display: none;
    font-size: 16px;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    position: absolute;
    right: 8px;
    top: 31px;
    width: 24px;
    z-index: 2;
  }

  .s2-clearable-field.has-value .s2-input-clear {
    display: flex;
  }
}

@media (min-width: 901px) {
  .s2-clearable-field:not(.has-value) .s2-input-clear {
    display: none !important;
  }
}

/* Clear buttons on all screen sizes */
.s2-clearable-field {
  position: relative !important;
}

.s2-clearable-field input.has-mobile-clear {
  padding-right: 34px !important;
}

.s2-input-clear {
  align-items: center;
  background: #eef4fb;
  border: 1px solid #c9d7e6;
  border-radius: 999px;
  color: #64748b;
  display: none;
  font-size: 16px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 8px;
  top: 31px;
  width: 24px;
  z-index: 2;
}

.s2-clearable-field.has-value .s2-input-clear {
  display: flex !important;
}

/* PDF export review modal */
.pdf-review-overlay[hidden] {
  display: none !important;
}

.pdf-review-overlay {
  inset: 0;
  position: fixed;
  z-index: 1000000;
}

.pdf-review-backdrop {
  background: rgba(15, 23, 42, 0.55);
  inset: 0;
  position: fixed;
}

.pdf-review-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.28);
  left: 50%;
  max-height: 84vh;
  max-width: 860px;
  overflow: hidden;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 860px);
}

.pdf-review-head {
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 18px 12px;
}

.pdf-review-head h3 {
  margin: 0;
}

.pdf-review-head p {
  color: #53657d;
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0 0;
}

.pdf-review-body {
  max-height: calc(84vh - 150px);
  overflow: auto;
  padding: 14px 18px;
}

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

.pdf-review-table th,
.pdf-review-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.pdf-review-table th {
  background: #eef4fb;
  color: #0f172a;
  font-size: 13px;
  text-transform: uppercase;
}

.pdf-review-table td:first-child {
  width: 110px;
}

.pdf-review-table small {
  color: #53657d;
  display: block;
  font-weight: 700;
  margin-top: 2px;
}

.pdf-review-table th:last-child,
.pdf-review-table td:last-child {
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  width: 92px;
}

.pdf-review-time-lines {
  display: grid;
  gap: 5px;
}

.pdf-review-time-main {
  align-items: center;
  color: #0f172a;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  font-weight: 500;
}

.pdf-review-time-main span {
  white-space: nowrap;
}

.pdf-review-time-parts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.pdf-review-time-part {
  align-items: baseline;
  display: inline-flex;
  gap: 4px;
  white-space: nowrap;
}

.pdf-review-time-label {
  color: #0f172a;
}

.pdf-review-time-value {
  color: #1f3556;
  font-weight: 700;
}

.pdf-review-time-part--range .pdf-review-time-value,
.pdf-review-time-part--absence .pdf-review-time-value {
  color: #0f172a;
  font-weight: 500;
}

.pdf-review-total-row td {
  background: #f8fbff;
  border-top: 2px solid #cbd9e8;
  font-weight: 900;
}

.pdf-review-total-row td:last-child {
  text-align: right;
  white-space: nowrap;
}

.pdf-review-actions {
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 18px 16px;
}

.special-overlay-head #btnCloseSpecialOverlayS2 {
  align-items: center !important;
  display: inline-flex !important;
  font-size: 0 !important;
  height: 44px !important;
  justify-content: center !important;
  line-height: 1 !important;
  padding: 0 !important;
  width: 44px !important;
}

.special-overlay-head #btnCloseSpecialOverlayS2::before {
  content: "×";
  font-size: 30px;
  line-height: 1;
  transform: translateY(-1px);
}

.special-item-note {
  color: #0f766e;
  font-weight: 800;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .s2-form-grid label[for="s2From"] input,
  .s2-form-grid label[for="s2To"] input {
    height: 44px !important;
    line-height: 44px !important;
    min-height: 44px !important;
    padding-bottom: 0 !important;
    padding-top: 0 !important;
    width: 90% !important;
  }
}

@media (max-width: 700px) {
  .pdf-review-card {
    max-height: 88vh;
    width: min(94vw, 520px);
  }

  .pdf-review-body {
    max-height: calc(88vh - 160px);
    padding: 12px;
  }

  .pdf-review-table th,
  .pdf-review-table td {
    padding: 8px 6px;
  }

  .pdf-review-actions {
    padding: 12px;
  }
}

/* Inventar-Link: kurzer Text, voller Pfad als Hinweis */
.s2-inventory-path-wrap {
  display: inline-block;
  max-width: min(100%, 230px);
  position: relative;
  vertical-align: bottom;
}

.s2-inventory-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.s2-inventory-tooltip {
  background: #0f172a;
  border-radius: 8px;
  bottom: calc(100% + 7px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .22);
  color: #fff;
  font-size: 12px;
  left: 0;
  line-height: 1.25;
  max-width: min(78vw, 520px);
  opacity: 0;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  pointer-events: none;
  position: absolute;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  visibility: hidden;
  white-space: normal;
  z-index: 80;
}

.s2-inventory-path-wrap:hover .s2-inventory-tooltip,
.s2-inventory-path-wrap:focus-within .s2-inventory-tooltip,
.s2-inventory-path-wrap.is-open .s2-inventory-tooltip {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@media (max-width: 900px) {
  .s2-inventory-path-wrap {
    max-width: min(100%, 185px);
  }
}

/* Optional second TID keeps the form compact for the common case. */
.s2-form-grid .s2-tid-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  grid-area: tid !important;
  min-width: 0;
  width: 100%;
}

.s2-tid-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  font-weight: 700;
  justify-content: space-between;
  min-height: 17px;
}

.s2-tid-extra-toggle {
  align-items: center;
  align-self: center;
  background: #eef4fb;
  border: 1px solid #c9d7e6;
  border-radius: 999px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  line-height: 1;
  padding: 0 8px;
}

.s2-tid-extra-toggle:hover,
.s2-tid-extra-toggle:focus-visible {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.s2-tid-stack label[hidden] {
  display: none !important;
}

.s2-tid-input-label {
  gap: 0 !important;
}

.s2-tid-input-label .s2-input-clear {
  top: 10px;
}

@media (max-width: 900px) {
  .s2-form-grid .s2-tid-stack {
    grid-column: 1 / -1 !important;
    max-width: none !important;
  }
}

@media (min-width: 350px) and (max-width: 900px) {
  .s2-form-grid .s2-tid-stack {
    display: grid !important;
    gap: 6px 10px !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .s2-tid-title-row {
    grid-column: 1 / -1 !important;
  }

  .s2-tid-input-label,
  #s2Tid2Wrap {
    gap: 0 !important;
    min-width: 0 !important;
  }

  #s2Tid2Wrap>span {
    display: none !important;
  }

  #s2Tid2Wrap .s2-input-clear {
    top: 10px !important;
  }
}

/* Artikel-Inventar-Hinweis ausblenden */
#s2ArticleHint {
  display: none !important;
}

/* Final mobile sticky day navigation override */
@media (max-width: 900px) {
  .s2-day-nav-sticky {
    background: rgba(255, 255, 255, 0.97) !important;
    margin: 0 0 6px !important;
    padding: 2px 0 4px !important;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: env(safe-area-inset-top, 0px) !important;
    z-index: 220 !important;
  }

  .s2-day-remark-toggle {
    margin-bottom: 2px !important;
  }

  .s2-day-remark-toggle .ghost {
    border-radius: 9px !important;
    font-size: 14px !important;
    min-height: 30px !important;
    padding: 3px 10px !important;
  }

  .s2-day-nav-sticky .day-nav {
    align-items: center !important;
    background: rgba(239, 247, 255, 0.96) !important;
    border: 2px solid #8eb3d4 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr) 34px !important;
    gap: 6px !important;
    margin: 0 auto !important;
    max-width: 344px !important;
    padding: 4px 8px !important;
  }

  .s2-day-nav-sticky .day-date-control {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-day-nav-sticky #prevDayS2 {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .s2-day-nav-sticky #nextDayS2 {
    grid-column: 3 !important;
    grid-row: 1 !important;
  }

  .s2-day-nav-sticky .day-date-picker {
    min-height: 34px !important;
    padding: 0 6px !important;
  }

  .s2-day-nav-sticky #dayLabelS2,
  .s2-day-nav-sticky .day-label {
    font-size: 14px !important;
    line-height: 1.1 !important;
    min-height: 34px !important;
  }

  .s2-day-nav-sticky .day-nav .ghost {
    height: 34px !important;
    min-height: 34px !important;
    min-width: 34px !important;
    width: 34px !important;
  }
}

@media (max-width: 900px) {
  .s2-day-nav-sticky.is-fixed {
    box-sizing: border-box !important;
    position: fixed !important;
  }

  .s2-day-nav-sticky-placeholder[hidden] {
    display: none !important;
  }
}

/* Final visual override for the mobile sticky date card */
@media (max-width: 900px) {
  .s2-day-nav-sticky,
  .s2-day-nav-sticky.is-fixed {
    background: transparent !important;
  }

  .s2-day-nav-sticky>.day-nav {
    background-color: #eef7ff !important;
    border: 2px solid #6f9fc8 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
}

/* Final mobile TID layout: from 350px, TID 1 and TID 2 share one row. */
@media (min-width: 350px) and (max-width: 900px) {
  .s2-form-grid .s2-tid-stack {
    display: grid !important;
    gap: 6px 10px !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  .s2-tid-title-row {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .s2-tid-input-label {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  #s2Tid2Wrap {
    display: flex !important;
    grid-area: auto !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  #s2Tid2Wrap>span {
    display: none !important;
  }

  .s2-tid-extra-toggle {
    display: none !important;
  }
}

@media (max-width: 349px) {
  #s2Tid2Wrap {
    display: flex !important;
  }

  .s2-tid-extra-toggle {
    display: none !important;
  }
}

/* Strongest mobile TID override: older generic label rules must not shrink TID 1. */
@media (min-width: 350px) and (max-width: 900px) {
  .s2-form-grid .s2-tid-stack>label.s2-tid-input-label[for="s2Tid"] {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid .s2-tid-stack>label#s2Tid2Wrap[for="s2Tid2"] {
    display: flex !important;
    grid-column: 2 !important;
    grid-row: 2 !important;
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .s2-form-grid .s2-tid-stack>label[for="s2Tid"] input,
  .s2-form-grid .s2-tid-stack>label[for="s2Tid2"] input {
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

@media (max-width: 349px) {
  .s2-form-grid .s2-tid-stack>label.s2-tid-input-label[for="s2Tid"],
  .s2-form-grid .s2-tid-stack>label#s2Tid2Wrap[for="s2Tid2"] {
    max-width: none !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* Final mobile compact pass for the day time/summary area. */
@media (max-width: 520px) {
  .entry-head {
    gap: 7px !important;
    margin-bottom: 5px !important;
    padding: 0 !important;
  }

  .time-inline {
    gap: 8px !important;
  }

  .time-inline input[type="time"],
  .s2-form-grid input[type="time"],
  .s2-form-grid label[for="s2From"] input,
  .s2-form-grid label[for="s2To"] input {
    height: 32px !important;
    line-height: 32px !important;
    min-height: 32px !important;
    padding-bottom: 2px !important;
    padding-top: 2px !important;
  }

  #daySummaryBoxS2.day-summary-box,
  #daySummaryBoxS2.day-summary-box--cards {
    margin-top: 7px !important;
    padding: 5px !important;
  }

  #daySummaryBoxS2 .day-summary-grid--three {
    gap: 5px !important;
  }

  #daySummaryBoxS2 .day-summary-grid--three .day-summary-pill {
    min-height: 50px !important;
    padding-bottom: 3px !important;
    padding-top: 3px !important;
  }

  .s2-form-grid {
    gap: 8px 10px !important;
  }
}

.s2-day-nav-sticky.is-today-date>.day-nav,
.s2-day-nav-sticky.is-today-date.is-fixed>.day-nav,
.day-nav.is-today-date {
  background-color: #fff3df !important;
  border-color: #f59e0b !important;
}

.day-date-picker.is-today-date {
  background-color: rgba(245, 158, 11, 0.12) !important;
}
